This repository has been archived by the owner on Mar 3, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 836
/
Copy pathoidc-client.rsa256.slim.min.js
22 lines (22 loc) · 800 KB
/
oidc-client.rsa256.slim.min.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
var Oidc=function(t){var e={};function r(i){if(e[i])return e[i].exports;var n=e[i]={i:i,l:!1,exports:{}};return t[i].call(n.exports,n,n.exports,r),n.l=!0,n.exports}return r.m=t,r.c=e,r.d=function(t,e,i){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(r.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var n in t)r.d(i,n,function(e){return t[e]}.bind(null,n));return i},r.n=function(t){var e=t&&t.__esModule?function e(){return t.default}:function e(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=208)}([function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,r,i){return r&&t(e.prototype,r),i&&t(e,i),e}}();var n={debug:function t(){},info:function t(){},warn:function t(){},error:function t(){}},o=void 0,s=void 0;(e.Log=function(){function t(){!function e(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}(this,t)}return t.reset=function t(){s=3,o=n},t.debug=function t(){if(s>=4){for(var e=arguments.length,r=Array(e),i=0;i<e;i++)r[i]=arguments[i];o.debug.apply(o,Array.from(r))}},t.info=function t(){if(s>=3){for(var e=arguments.length,r=Array(e),i=0;i<e;i++)r[i]=arguments[i];o.info.apply(o,Array.from(r))}},t.warn=function t(){if(s>=2){for(var e=arguments.length,r=Array(e),i=0;i<e;i++)r[i]=arguments[i];o.warn.apply(o,Array.from(r))}},t.error=function t(){if(s>=1){for(var e=arguments.length,r=Array(e),i=0;i<e;i++)r[i]=arguments[i];o.error.apply(o,Array.from(r))}},i(t,null,[{key:"NONE",get:function t(){return 0}},{key:"ERROR",get:function t(){return 1}},{key:"WARN",get:function t(){return 2}},{key:"INFO",get:function t(){return 3}},{key:"DEBUG",get:function t(){return 4}},{key:"level",get:function t(){return s},set:function t(e){if(!(0<=e&&e<=4))throw new Error("Invalid log level");s=e}},{key:"logger",get:function t(){return o},set:function t(e){if(!e.debug&&e.info&&(e.debug=e.info),!(e.debug&&e.info&&e.warn&&e.error))throw new Error("Invalid logger");o=e}}]),t}()).reset()},function(t,e){"function"==typeof Object.create?t.exports=function t(e,r){e.super_=r,e.prototype=Object.create(r.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:t.exports=function t(e,r){e.super_=r;var i=function(){};i.prototype=r.prototype,e.prototype=new i,e.prototype.constructor=e}},function(t,e,r){var i=r(7),n=i.Buffer;function o(t,e){for(var r in t)e[r]=t[r]}function s(t,e,r){return n(t,e,r)}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?t.exports=i:(o(i,e),e.Buffer=s),o(n,s),s.from=function(t,e,r){if("number"==typeof t)throw new TypeError("Argument must not be a number");return n(t,e,r)},s.alloc=function(t,e,r){if("number"!=typeof t)throw new TypeError("Argument must be a number");var i=n(t);return void 0!==e?"string"==typeof r?i.fill(e,r):i.fill(e):i.fill(0),i},s.allocUnsafe=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return n(t)},s.allocUnsafeSlow=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return i.SlowBuffer(t)}},function(t,e,r){(function(e){var r=function(t){return t&&t.Math==Math&&t};t.exports=r("object"==typeof globalThis&&globalThis)||r("object"==typeof window&&window)||r("object"==typeof self&&self)||r("object"==typeof e&&e)||function(){return this}()||Function("return this")()}).call(this,r(5))},function(t,e){var r,i,n=t.exports={};function o(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function a(t){if(r===setTimeout)return setTimeout(t,0);if((r===o||!r)&&setTimeout)return r=setTimeout,setTimeout(t,0);try{return r(t,0)}catch(e){try{return r.call(null,t,0)}catch(e){return r.call(this,t,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:o}catch(t){r=o}try{i="function"==typeof clearTimeout?clearTimeout:s}catch(t){i=s}}();var h,u=[],f=!1,c=-1;function l(){f&&h&&(f=!1,h.length?u=h.concat(u):c=-1,u.length&&d())}function d(){if(!f){var t=a(l);f=!0;for(var e=u.length;e;){for(h=u,u=[];++c<e;)h&&h[c].run();c=-1,e=u.length}h=null,f=!1,function r(t){if(i===clearTimeout)return clearTimeout(t);if((i===s||!i)&&clearTimeout)return i=clearTimeout,clearTimeout(t);try{return i(t)}catch(e){try{return i.call(null,t)}catch(e){return i.call(this,t)}}}(t)}}function p(t,e){this.fun=t,this.array=e}function m(){}n.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];u.push(new p(t,e)),1!==u.length||f||a(d)},p.prototype.run=function(){this.fun.apply(null,this.array)},n.title="browser",n.browser=!0,n.env={},n.argv=[],n.version="",n.versions={},n.on=m,n.addListener=m,n.once=m,n.off=m,n.removeListener=m,n.removeAllListeners=m,n.emit=m,n.prependListener=m,n.prependOnceListener=m,n.listeners=function(t){return[]},n.binding=function(t){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(t){throw new Error("process.chdir is not supported")},n.umask=function(){return 0}},function(t,e){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(t){"object"==typeof window&&(r=window)}t.exports=r},function(t,e,r){var i=r(3),n=r(117),o=r(12),s=r(118),a=r(126),h=r(221),u=n("wks"),f=i.Symbol,c=h?f:f&&f.withoutSetter||s;t.exports=function(t){return o(u,t)||(a&&o(f,t)?u[t]=f[t]:u[t]=c("Symbol."+t)),u[t]}},function(t,e){},function(t,e,r){var i=r(3),n=r(67).f,o=r(18),s=r(29),a=r(72),h=r(213),u=r(122);t.exports=function(t,e){var r,f,c,l,d,p=t.target,m=t.global,g=t.stat;if(r=m?i:g?i[p]||a(p,{}):(i[p]||{}).prototype)for(f in e){if(l=e[f],c=t.noTargetGet?(d=n(r,f))&&d.value:r[f],!u(m?f:p+(g?".":"#")+f,t.forced)&&void 0!==c){if(typeof l==typeof c)continue;h(l,c)}(t.sham||c&&c.sham)&&o(l,"sham",!0),s(r,f,l,t)}}},function(t,e){t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,e){function r(t,e){if(!t)throw new Error(e||"Assertion failed")}t.exports=r,r.equal=function t(e,r,i){if(e!=r)throw new Error(i||"Assertion failed: "+e+" != "+r)}},function(t,e,r){"use strict";var i=e,n=r(16),o=r(10),s=r(182);i.assert=o,i.toArray=s.toArray,i.zero2=s.zero2,i.toHex=s.toHex,i.encode=s.encode,i.getNAF=function a(t,e,r){var i=new Array(Math.max(t.bitLength(),r)+1);i.fill(0);for(var n=1<<e+1,o=t.clone(),s=0;s<i.length;s++){var a,h=o.andln(n-1);o.isOdd()?(a=h>(n>>1)-1?(n>>1)-h:h,o.isubn(a)):a=0,i[s]=a,o.iushrn(1)}return i},i.getJSF=function h(t,e){var r=[[],[]];t=t.clone(),e=e.clone();for(var i,n=0,o=0;t.cmpn(-n)>0||e.cmpn(-o)>0;){var s,a,h=t.andln(3)+n&3,u=e.andln(3)+o&3;3===h&&(h=-1),3===u&&(u=-1),s=0==(1&h)?0:3!==(i=t.andln(7)+n&7)&&5!==i||2!==u?h:-h,r[0].push(s),a=0==(1&u)?0:3!==(i=e.andln(7)+o&7)&&5!==i||2!==h?u:-u,r[1].push(a),2*n===s+1&&(n=1-n),2*o===a+1&&(o=1-o),t.iushrn(1),e.iushrn(1)}return r},i.cachedProperty=function u(t,e,r){var i="_"+e;t.prototype[e]=function t(){return void 0!==this[i]?this[i]:this[i]=r.call(this)}},i.parseBytes=function f(t){return"string"==typeof t?i.toArray(t,"hex"):t},i.intFromLE=function c(t){return new n(t,"hex","le")}},function(t,e){var r={}.hasOwnProperty;t.exports=function(t,e){return r.call(t,e)}},function(t,e,r){"use strict";var i=r(10),n=r(1);function o(t,e){return 55296==(64512&t.charCodeAt(e))&&(!(e<0||e+1>=t.length)&&56320==(64512&t.charCodeAt(e+1)))}function s(t){return(t>>>24|t>>>8&65280|t<<8&16711680|(255&t)<<24)>>>0}function a(t){return 1===t.length?"0"+t:t}function h(t){return 7===t.length?"0"+t:6===t.length?"00"+t:5===t.length?"000"+t:4===t.length?"0000"+t:3===t.length?"00000"+t:2===t.length?"000000"+t:1===t.length?"0000000"+t:t}e.inherits=n,e.toArray=function u(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var r=[];if("string"==typeof t)if(e){if("hex"===e)for((t=t.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(t="0"+t),n=0;n<t.length;n+=2)r.push(parseInt(t[n]+t[n+1],16))}else for(var i=0,n=0;n<t.length;n++){var s=t.charCodeAt(n);s<128?r[i++]=s:s<2048?(r[i++]=s>>6|192,r[i++]=63&s|128):o(t,n)?(s=65536+((1023&s)<<10)+(1023&t.charCodeAt(++n)),r[i++]=s>>18|240,r[i++]=s>>12&63|128,r[i++]=s>>6&63|128,r[i++]=63&s|128):(r[i++]=s>>12|224,r[i++]=s>>6&63|128,r[i++]=63&s|128)}else for(n=0;n<t.length;n++)r[n]=0|t[n];return r},e.toHex=function f(t){for(var e="",r=0;r<t.length;r++)e+=a(t[r].toString(16));return e},e.htonl=s,e.toHex32=function c(t,e){for(var r="",i=0;i<t.length;i++){var n=t[i];"little"===e&&(n=s(n)),r+=h(n.toString(16))}return r},e.zero2=a,e.zero8=h,e.join32=function l(t,e,r,n){var o=r-e;i(o%4==0);for(var s=new Array(o/4),a=0,h=e;a<s.length;a++,h+=4){var u;u="big"===n?t[h]<<24|t[h+1]<<16|t[h+2]<<8|t[h+3]:t[h+3]<<24|t[h+2]<<16|t[h+1]<<8|t[h],s[a]=u>>>0}return s},e.split32=function d(t,e){for(var r=new Array(4*t.length),i=0,n=0;i<t.length;i++,n+=4){var o=t[i];"big"===e?(r[n]=o>>>24,r[n+1]=o>>>16&255,r[n+2]=o>>>8&255,r[n+3]=255&o):(r[n+3]=o>>>24,r[n+2]=o>>>16&255,r[n+1]=o>>>8&255,r[n]=255&o)}return r},e.rotr32=function p(t,e){return t>>>e|t<<32-e},e.rotl32=function m(t,e){return t<<e|t>>>32-e},e.sum32=function g(t,e){return t+e>>>0},e.sum32_3=function v(t,e,r){return t+e+r>>>0},e.sum32_4=function b(t,e,r,i){return t+e+r+i>>>0},e.sum32_5=function y(t,e,r,i,n){return t+e+r+i+n>>>0},e.sum64=function w(t,e,r,i){var n=t[e],o=i+t[e+1]>>>0,s=(o<i?1:0)+r+n;t[e]=s>>>0,t[e+1]=o},e.sum64_hi=function _(t,e,r,i){return(e+i>>>0<e?1:0)+t+r>>>0},e.sum64_lo=function M(t,e,r,i){return e+i>>>0},e.sum64_4_hi=function S(t,e,r,i,n,o,s,a){var h=0,u=e;return h+=(u=u+i>>>0)<e?1:0,h+=(u=u+o>>>0)<o?1:0,t+r+n+s+(h+=(u=u+a>>>0)<a?1:0)>>>0},e.sum64_4_lo=function k(t,e,r,i,n,o,s,a){return e+i+o+a>>>0},e.sum64_5_hi=function E(t,e,r,i,n,o,s,a,h,u){var f=0,c=e;return f+=(c=c+i>>>0)<e?1:0,f+=(c=c+o>>>0)<o?1:0,f+=(c=c+a>>>0)<a?1:0,t+r+n+s+h+(f+=(c=c+u>>>0)<u?1:0)>>>0},e.sum64_5_lo=function R(t,e,r,i,n,o,s,a,h,u){return e+i+o+a+u>>>0},e.rotr64_hi=function A(t,e,r){return(e<<32-r|t>>>r)>>>0},e.rotr64_lo=function x(t,e,r){return(t<<32-r|e>>>r)>>>0},e.shr64_hi=function T(t,e,r){return t>>>r},e.shr64_lo=function P(t,e,r){return(t<<32-r|e>>>r)>>>0}},function(t,e){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,e,r){var i=r(14);t.exports=function(t){if(!i(t))throw TypeError(String(t)+" is not an object");return t}},function(t,e,r){(function(t){!function(t,e){"use strict";function i(t,e){if(!t)throw new Error(e||"Assertion failed")}function n(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function o(t,e,r){if(o.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var s;"object"==typeof t?t.exports=o:e.BN=o,o.BN=o,o.wordSize=26;try{s="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r(341).Buffer}catch(t){}function a(t,e){var r=t.charCodeAt(e);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function h(t,e,r){var i=a(t,r);return r-1>=e&&(i|=a(t,r-1)<<4),i}function u(t,e,r,i){for(var n=0,o=Math.min(t.length,r),s=e;s<o;s++){var a=t.charCodeAt(s)-48;n*=i,n+=a>=49?a-49+10:a>=17?a-17+10:a}return n}o.isBN=function t(e){return e instanceof o||null!==e&&"object"==typeof e&&e.constructor.wordSize===o.wordSize&&Array.isArray(e.words)},o.max=function t(e,r){return e.cmp(r)>0?e:r},o.min=function t(e,r){return e.cmp(r)<0?e:r},o.prototype._init=function t(e,r,n){if("number"==typeof e)return this._initNumber(e,r,n);if("object"==typeof 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++,this.negative=1),o<e.length&&(16===r?this._parseHex(e,o,n):(this._parseBase(e,r,o),"le"===n&&this._initArray(this.toArray(),r,n)))},o.prototype._initNumber=function t(e,r,n){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"===n&&this._initArray(this.toArray(),r,n)},o.prototype._initArray=function t(e,r,n){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 o=0;o<this.length;o++)this.words[o]=0;var s,a,h=0;if("be"===n)for(o=e.length-1,s=0;o>=0;o-=3)a=e[o]|e[o-1]<<8|e[o-2]<<16,this.words[s]|=a<<h&67108863,this.words[s+1]=a>>>26-h&67108863,(h+=24)>=26&&(h-=26,s++);else if("le"===n)for(o=0,s=0;o<e.length;o+=3)a=e[o]|e[o+1]<<8|e[o+2]<<16,this.words[s]|=a<<h&67108863,this.words[s+1]=a>>>26-h&67108863,(h+=24)>=26&&(h-=26,s++);return this.strip()},o.prototype._parseHex=function t(e,r,i){this.length=Math.ceil((e.length-r)/6),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var o,s=0,a=0;if("be"===i)for(n=e.length-1;n>=r;n-=2)o=h(e,r,n)<<s,this.words[a]|=67108863&o,s>=18?(s-=18,a+=1,this.words[a]|=o>>>26):s+=8;else for(n=(e.length-r)%2==0?r+1:r;n<e.length;n+=2)o=h(e,r,n)<<s,this.words[a]|=67108863&o,s>=18?(s-=18,a+=1,this.words[a]|=o>>>26):s+=8;this.strip()},o.prototype._parseBase=function t(e,r,i){this.words=[0],this.length=1;for(var n=0,o=1;o<=67108863;o*=r)n++;n--,o=o/r|0;for(var s=e.length-i,a=s%n,h=Math.min(s,s-a)+i,f=0,c=i;c<h;c+=n)f=u(e,c,c+n,r),this.imuln(o),this.words[0]+f<67108864?this.words[0]+=f:this._iaddn(f);if(0!==a){var l=1;for(f=u(e,c,e.length,r),c=0;c<a;c++)l*=r;this.imuln(l),this.words[0]+f<67108864?this.words[0]+=f:this._iaddn(f)}this.strip()},o.prototype.copy=function t(e){e.words=new Array(this.length);for(var r=0;r<this.length;r++)e.words[r]=this.words[r];e.length=this.length,e.negative=this.negative,e.red=this.red},o.prototype.clone=function t(){var e=new o(null);return this.copy(e),e},o.prototype._expand=function t(e){for(;this.length<e;)this.words[this.length++]=0;return this},o.prototype.strip=function t(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function t(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function t(){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"],c=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],l=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function d(t,e,r){r.negative=e.negative^t.negative;var i=t.length+e.length|0;r.length=i,i=i-1|0;var n=0|t.words[0],o=0|e.words[0],s=n*o,a=67108863&s,h=s/67108864|0;r.words[0]=a;for(var u=1;u<i;u++){for(var f=h>>>26,c=67108863&h,l=Math.min(u,e.length-1),d=Math.max(0,u-t.length+1);d<=l;d++){var p=u-d|0;f+=(s=(n=0|t.words[p])*(o=0|e.words[d])+c)/67108864|0,c=67108863&s}r.words[u]=0|c,h=0|f}return 0!==h?r.words[u]=0|h:r.length--,r.strip()}o.prototype.toString=function t(e,r){var n;if(r=0|r||1,16===(e=e||10)||"hex"===e){n="";for(var o=0,s=0,a=0;a<this.length;a++){var h=this.words[a],u=(16777215&(h<<o|s)).toString(16);n=0!==(s=h>>>24-o&16777215)||a!==this.length-1?f[6-u.length]+u+n:u+n,(o+=2)>=26&&(o-=26,a--)}for(0!==s&&(n=s.toString(16)+n);n.length%r!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}if(e===(0|e)&&e>=2&&e<=36){var d=c[e],p=l[e];n="";var m=this.clone();for(m.negative=0;!m.isZero();){var g=m.modn(p).toString(e);n=(m=m.idivn(p)).isZero()?g+n:f[d-g.length]+g+n}for(this.isZero()&&(n="0"+n);n.length%r!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}i(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function t(){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},o.prototype.toJSON=function t(){return this.toString(16)},o.prototype.toBuffer=function t(e,r){return i(void 0!==s),this.toArrayLike(s,e,r)},o.prototype.toArray=function t(e,r){return this.toArrayLike(Array,e,r)},o.prototype.toArrayLike=function t(e,r,n){var o=this.byteLength(),s=n||Math.max(1,o);i(o<=s,"byte array longer than desired length"),i(s>0,"Requested array length <= 0"),this.strip();var a,h,u="le"===r,f=new e(s),c=this.clone();if(u){for(h=0;!c.isZero();h++)a=c.andln(255),c.iushrn(8),f[h]=a;for(;h<s;h++)f[h]=0}else{for(h=0;h<s-o;h++)f[h]=0;for(h=0;!c.isZero();h++)a=c.andln(255),c.iushrn(8),f[s-h-1]=a}return f},Math.clz32?o.prototype._countBits=function t(e){return 32-Math.clz32(e)}:o.prototype._countBits=function t(e){var r=e,i=0;return r>=4096&&(i+=13,r>>>=13),r>=64&&(i+=7,r>>>=7),r>=8&&(i+=4,r>>>=4),r>=2&&(i+=2,r>>>=2),i+r},o.prototype._zeroBits=function t(e){if(0===e)return 26;var r=e,i=0;return 0==(8191&r)&&(i+=13,r>>>=13),0==(127&r)&&(i+=7,r>>>=7),0==(15&r)&&(i+=4,r>>>=4),0==(3&r)&&(i+=2,r>>>=2),0==(1&r)&&i++,i},o.prototype.bitLength=function t(){var e=this.words[this.length-1],r=this._countBits(e);return 26*(this.length-1)+r},o.prototype.zeroBits=function t(){if(this.isZero())return 0;for(var e=0,r=0;r<this.length;r++){var i=this._zeroBits(this.words[r]);if(e+=i,26!==i)break}return e},o.prototype.byteLength=function t(){return Math.ceil(this.bitLength()/8)},o.prototype.toTwos=function t(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},o.prototype.fromTwos=function t(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},o.prototype.isNeg=function t(){return 0!==this.negative},o.prototype.neg=function t(){return this.clone().ineg()},o.prototype.ineg=function t(){return this.isZero()||(this.negative^=1),this},o.prototype.iuor=function t(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var r=0;r<e.length;r++)this.words[r]=this.words[r]|e.words[r];return this.strip()},o.prototype.ior=function t(e){return i(0==(this.negative|e.negative)),this.iuor(e)},o.prototype.or=function t(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},o.prototype.uor=function t(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},o.prototype.iuand=function t(e){var r;r=this.length>e.length?e:this;for(var i=0;i<r.length;i++)this.words[i]=this.words[i]&e.words[i];return this.length=r.length,this.strip()},o.prototype.iand=function t(e){return i(0==(this.negative|e.negative)),this.iuand(e)},o.prototype.and=function t(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},o.prototype.uand=function t(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},o.prototype.iuxor=function t(e){var r,i;this.length>e.length?(r=this,i=e):(r=e,i=this);for(var n=0;n<i.length;n++)this.words[n]=r.words[n]^i.words[n];if(this!==r)for(;n<r.length;n++)this.words[n]=r.words[n];return this.length=r.length,this.strip()},o.prototype.ixor=function t(e){return i(0==(this.negative|e.negative)),this.iuxor(e)},o.prototype.xor=function t(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},o.prototype.uxor=function t(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},o.prototype.inotn=function t(e){i("number"==typeof e&&e>=0);var r=0|Math.ceil(e/26),n=e%26;this._expand(r),n>0&&r--;for(var o=0;o<r;o++)this.words[o]=67108863&~this.words[o];return n>0&&(this.words[o]=~this.words[o]&67108863>>26-n),this.strip()},o.prototype.notn=function t(e){return this.clone().inotn(e)},o.prototype.setn=function t(e,r){i("number"==typeof e&&e>=0);var n=e/26|0,o=e%26;return this._expand(n+1),this.words[n]=r?this.words[n]|1<<o:this.words[n]&~(1<<o),this.strip()},o.prototype.iadd=function t(e){var r,i,n;if(0!==this.negative&&0===e.negative)return this.negative=0,r=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,r=this.isub(e),e.negative=1,r._normSign();this.length>e.length?(i=this,n=e):(i=e,n=this);for(var o=0,s=0;s<n.length;s++)r=(0|i.words[s])+(0|n.words[s])+o,this.words[s]=67108863&r,o=r>>>26;for(;0!==o&&s<i.length;s++)r=(0|i.words[s])+o,this.words[s]=67108863&r,o=r>>>26;if(this.length=i.length,0!==o)this.words[this.length]=o,this.length++;else if(i!==this)for(;s<i.length;s++)this.words[s]=i.words[s];return this},o.prototype.add=function t(e){var r;return 0!==e.negative&&0===this.negative?(e.negative=0,r=this.sub(e),e.negative^=1,r):0===e.negative&&0!==this.negative?(this.negative=0,r=e.sub(this),this.negative=1,r):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},o.prototype.isub=function t(e){if(0!==e.negative){e.negative=0;var r=this.iadd(e);return e.negative=1,r._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var i,n,o=this.cmp(e);if(0===o)return this.negative=0,this.length=1,this.words[0]=0,this;o>0?(i=this,n=e):(i=e,n=this);for(var s=0,a=0;a<n.length;a++)s=(r=(0|i.words[a])-(0|n.words[a])+s)>>26,this.words[a]=67108863&r;for(;0!==s&&a<i.length;a++)s=(r=(0|i.words[a])+s)>>26,this.words[a]=67108863&r;if(0===s&&a<i.length&&i!==this)for(;a<i.length;a++)this.words[a]=i.words[a];return this.length=Math.max(this.length,a),i!==this&&(this.negative=1),this.strip()},o.prototype.sub=function t(e){return this.clone().isub(e)};var p=function t(e,r,i){var n,o,s,a=e.words,h=r.words,u=i.words,f=0,c=0|a[0],l=8191&c,d=c>>>13,p=0|a[1],m=8191&p,g=p>>>13,v=0|a[2],b=8191&v,y=v>>>13,w=0|a[3],_=8191&w,M=w>>>13,S=0|a[4],k=8191&S,E=S>>>13,R=0|a[5],A=8191&R,x=R>>>13,T=0|a[6],P=8191&T,I=T>>>13,L=0|a[7],O=8191&L,B=L>>>13,j=0|a[8],C=8191&j,U=j>>>13,N=0|a[9],q=8191&N,D=N>>>13,z=0|h[0],F=8191&z,W=z>>>13,H=0|h[1],K=8191&H,Z=H>>>13,V=0|h[2],J=8191&V,Y=V>>>13,G=0|h[3],X=8191&G,Q=G>>>13,$=0|h[4],tt=8191&$,et=$>>>13,rt=0|h[5],it=8191&rt,nt=rt>>>13,ot=0|h[6],st=8191&ot,at=ot>>>13,ht=0|h[7],ut=8191&ht,ft=ht>>>13,ct=0|h[8],lt=8191&ct,dt=ct>>>13,pt=0|h[9],mt=8191&pt,gt=pt>>>13;i.negative=e.negative^r.negative,i.length=19;var vt=(f+(n=Math.imul(l,F))|0)+((8191&(o=(o=Math.imul(l,W))+Math.imul(d,F)|0))<<13)|0;f=((s=Math.imul(d,W))+(o>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(m,F),o=(o=Math.imul(m,W))+Math.imul(g,F)|0,s=Math.imul(g,W);var bt=(f+(n=n+Math.imul(l,K)|0)|0)+((8191&(o=(o=o+Math.imul(l,Z)|0)+Math.imul(d,K)|0))<<13)|0;f=((s=s+Math.imul(d,Z)|0)+(o>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(b,F),o=(o=Math.imul(b,W))+Math.imul(y,F)|0,s=Math.imul(y,W),n=n+Math.imul(m,K)|0,o=(o=o+Math.imul(m,Z)|0)+Math.imul(g,K)|0,s=s+Math.imul(g,Z)|0;var yt=(f+(n=n+Math.imul(l,J)|0)|0)+((8191&(o=(o=o+Math.imul(l,Y)|0)+Math.imul(d,J)|0))<<13)|0;f=((s=s+Math.imul(d,Y)|0)+(o>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(_,F),o=(o=Math.imul(_,W))+Math.imul(M,F)|0,s=Math.imul(M,W),n=n+Math.imul(b,K)|0,o=(o=o+Math.imul(b,Z)|0)+Math.imul(y,K)|0,s=s+Math.imul(y,Z)|0,n=n+Math.imul(m,J)|0,o=(o=o+Math.imul(m,Y)|0)+Math.imul(g,J)|0,s=s+Math.imul(g,Y)|0;var wt=(f+(n=n+Math.imul(l,X)|0)|0)+((8191&(o=(o=o+Math.imul(l,Q)|0)+Math.imul(d,X)|0))<<13)|0;f=((s=s+Math.imul(d,Q)|0)+(o>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(k,F),o=(o=Math.imul(k,W))+Math.imul(E,F)|0,s=Math.imul(E,W),n=n+Math.imul(_,K)|0,o=(o=o+Math.imul(_,Z)|0)+Math.imul(M,K)|0,s=s+Math.imul(M,Z)|0,n=n+Math.imul(b,J)|0,o=(o=o+Math.imul(b,Y)|0)+Math.imul(y,J)|0,s=s+Math.imul(y,Y)|0,n=n+Math.imul(m,X)|0,o=(o=o+Math.imul(m,Q)|0)+Math.imul(g,X)|0,s=s+Math.imul(g,Q)|0;var _t=(f+(n=n+Math.imul(l,tt)|0)|0)+((8191&(o=(o=o+Math.imul(l,et)|0)+Math.imul(d,tt)|0))<<13)|0;f=((s=s+Math.imul(d,et)|0)+(o>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(A,F),o=(o=Math.imul(A,W))+Math.imul(x,F)|0,s=Math.imul(x,W),n=n+Math.imul(k,K)|0,o=(o=o+Math.imul(k,Z)|0)+Math.imul(E,K)|0,s=s+Math.imul(E,Z)|0,n=n+Math.imul(_,J)|0,o=(o=o+Math.imul(_,Y)|0)+Math.imul(M,J)|0,s=s+Math.imul(M,Y)|0,n=n+Math.imul(b,X)|0,o=(o=o+Math.imul(b,Q)|0)+Math.imul(y,X)|0,s=s+Math.imul(y,Q)|0,n=n+Math.imul(m,tt)|0,o=(o=o+Math.imul(m,et)|0)+Math.imul(g,tt)|0,s=s+Math.imul(g,et)|0;var Mt=(f+(n=n+Math.imul(l,it)|0)|0)+((8191&(o=(o=o+Math.imul(l,nt)|0)+Math.imul(d,it)|0))<<13)|0;f=((s=s+Math.imul(d,nt)|0)+(o>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(P,F),o=(o=Math.imul(P,W))+Math.imul(I,F)|0,s=Math.imul(I,W),n=n+Math.imul(A,K)|0,o=(o=o+Math.imul(A,Z)|0)+Math.imul(x,K)|0,s=s+Math.imul(x,Z)|0,n=n+Math.imul(k,J)|0,o=(o=o+Math.imul(k,Y)|0)+Math.imul(E,J)|0,s=s+Math.imul(E,Y)|0,n=n+Math.imul(_,X)|0,o=(o=o+Math.imul(_,Q)|0)+Math.imul(M,X)|0,s=s+Math.imul(M,Q)|0,n=n+Math.imul(b,tt)|0,o=(o=o+Math.imul(b,et)|0)+Math.imul(y,tt)|0,s=s+Math.imul(y,et)|0,n=n+Math.imul(m,it)|0,o=(o=o+Math.imul(m,nt)|0)+Math.imul(g,it)|0,s=s+Math.imul(g,nt)|0;var St=(f+(n=n+Math.imul(l,st)|0)|0)+((8191&(o=(o=o+Math.imul(l,at)|0)+Math.imul(d,st)|0))<<13)|0;f=((s=s+Math.imul(d,at)|0)+(o>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(O,F),o=(o=Math.imul(O,W))+Math.imul(B,F)|0,s=Math.imul(B,W),n=n+Math.imul(P,K)|0,o=(o=o+Math.imul(P,Z)|0)+Math.imul(I,K)|0,s=s+Math.imul(I,Z)|0,n=n+Math.imul(A,J)|0,o=(o=o+Math.imul(A,Y)|0)+Math.imul(x,J)|0,s=s+Math.imul(x,Y)|0,n=n+Math.imul(k,X)|0,o=(o=o+Math.imul(k,Q)|0)+Math.imul(E,X)|0,s=s+Math.imul(E,Q)|0,n=n+Math.imul(_,tt)|0,o=(o=o+Math.imul(_,et)|0)+Math.imul(M,tt)|0,s=s+Math.imul(M,et)|0,n=n+Math.imul(b,it)|0,o=(o=o+Math.imul(b,nt)|0)+Math.imul(y,it)|0,s=s+Math.imul(y,nt)|0,n=n+Math.imul(m,st)|0,o=(o=o+Math.imul(m,at)|0)+Math.imul(g,st)|0,s=s+Math.imul(g,at)|0;var kt=(f+(n=n+Math.imul(l,ut)|0)|0)+((8191&(o=(o=o+Math.imul(l,ft)|0)+Math.imul(d,ut)|0))<<13)|0;f=((s=s+Math.imul(d,ft)|0)+(o>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(C,F),o=(o=Math.imul(C,W))+Math.imul(U,F)|0,s=Math.imul(U,W),n=n+Math.imul(O,K)|0,o=(o=o+Math.imul(O,Z)|0)+Math.imul(B,K)|0,s=s+Math.imul(B,Z)|0,n=n+Math.imul(P,J)|0,o=(o=o+Math.imul(P,Y)|0)+Math.imul(I,J)|0,s=s+Math.imul(I,Y)|0,n=n+Math.imul(A,X)|0,o=(o=o+Math.imul(A,Q)|0)+Math.imul(x,X)|0,s=s+Math.imul(x,Q)|0,n=n+Math.imul(k,tt)|0,o=(o=o+Math.imul(k,et)|0)+Math.imul(E,tt)|0,s=s+Math.imul(E,et)|0,n=n+Math.imul(_,it)|0,o=(o=o+Math.imul(_,nt)|0)+Math.imul(M,it)|0,s=s+Math.imul(M,nt)|0,n=n+Math.imul(b,st)|0,o=(o=o+Math.imul(b,at)|0)+Math.imul(y,st)|0,s=s+Math.imul(y,at)|0,n=n+Math.imul(m,ut)|0,o=(o=o+Math.imul(m,ft)|0)+Math.imul(g,ut)|0,s=s+Math.imul(g,ft)|0;var Et=(f+(n=n+Math.imul(l,lt)|0)|0)+((8191&(o=(o=o+Math.imul(l,dt)|0)+Math.imul(d,lt)|0))<<13)|0;f=((s=s+Math.imul(d,dt)|0)+(o>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(q,F),o=(o=Math.imul(q,W))+Math.imul(D,F)|0,s=Math.imul(D,W),n=n+Math.imul(C,K)|0,o=(o=o+Math.imul(C,Z)|0)+Math.imul(U,K)|0,s=s+Math.imul(U,Z)|0,n=n+Math.imul(O,J)|0,o=(o=o+Math.imul(O,Y)|0)+Math.imul(B,J)|0,s=s+Math.imul(B,Y)|0,n=n+Math.imul(P,X)|0,o=(o=o+Math.imul(P,Q)|0)+Math.imul(I,X)|0,s=s+Math.imul(I,Q)|0,n=n+Math.imul(A,tt)|0,o=(o=o+Math.imul(A,et)|0)+Math.imul(x,tt)|0,s=s+Math.imul(x,et)|0,n=n+Math.imul(k,it)|0,o=(o=o+Math.imul(k,nt)|0)+Math.imul(E,it)|0,s=s+Math.imul(E,nt)|0,n=n+Math.imul(_,st)|0,o=(o=o+Math.imul(_,at)|0)+Math.imul(M,st)|0,s=s+Math.imul(M,at)|0,n=n+Math.imul(b,ut)|0,o=(o=o+Math.imul(b,ft)|0)+Math.imul(y,ut)|0,s=s+Math.imul(y,ft)|0,n=n+Math.imul(m,lt)|0,o=(o=o+Math.imul(m,dt)|0)+Math.imul(g,lt)|0,s=s+Math.imul(g,dt)|0;var Rt=(f+(n=n+Math.imul(l,mt)|0)|0)+((8191&(o=(o=o+Math.imul(l,gt)|0)+Math.imul(d,mt)|0))<<13)|0;f=((s=s+Math.imul(d,gt)|0)+(o>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,n=Math.imul(q,K),o=(o=Math.imul(q,Z))+Math.imul(D,K)|0,s=Math.imul(D,Z),n=n+Math.imul(C,J)|0,o=(o=o+Math.imul(C,Y)|0)+Math.imul(U,J)|0,s=s+Math.imul(U,Y)|0,n=n+Math.imul(O,X)|0,o=(o=o+Math.imul(O,Q)|0)+Math.imul(B,X)|0,s=s+Math.imul(B,Q)|0,n=n+Math.imul(P,tt)|0,o=(o=o+Math.imul(P,et)|0)+Math.imul(I,tt)|0,s=s+Math.imul(I,et)|0,n=n+Math.imul(A,it)|0,o=(o=o+Math.imul(A,nt)|0)+Math.imul(x,it)|0,s=s+Math.imul(x,nt)|0,n=n+Math.imul(k,st)|0,o=(o=o+Math.imul(k,at)|0)+Math.imul(E,st)|0,s=s+Math.imul(E,at)|0,n=n+Math.imul(_,ut)|0,o=(o=o+Math.imul(_,ft)|0)+Math.imul(M,ut)|0,s=s+Math.imul(M,ft)|0,n=n+Math.imul(b,lt)|0,o=(o=o+Math.imul(b,dt)|0)+Math.imul(y,lt)|0,s=s+Math.imul(y,dt)|0;var At=(f+(n=n+Math.imul(m,mt)|0)|0)+((8191&(o=(o=o+Math.imul(m,gt)|0)+Math.imul(g,mt)|0))<<13)|0;f=((s=s+Math.imul(g,gt)|0)+(o>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(q,J),o=(o=Math.imul(q,Y))+Math.imul(D,J)|0,s=Math.imul(D,Y),n=n+Math.imul(C,X)|0,o=(o=o+Math.imul(C,Q)|0)+Math.imul(U,X)|0,s=s+Math.imul(U,Q)|0,n=n+Math.imul(O,tt)|0,o=(o=o+Math.imul(O,et)|0)+Math.imul(B,tt)|0,s=s+Math.imul(B,et)|0,n=n+Math.imul(P,it)|0,o=(o=o+Math.imul(P,nt)|0)+Math.imul(I,it)|0,s=s+Math.imul(I,nt)|0,n=n+Math.imul(A,st)|0,o=(o=o+Math.imul(A,at)|0)+Math.imul(x,st)|0,s=s+Math.imul(x,at)|0,n=n+Math.imul(k,ut)|0,o=(o=o+Math.imul(k,ft)|0)+Math.imul(E,ut)|0,s=s+Math.imul(E,ft)|0,n=n+Math.imul(_,lt)|0,o=(o=o+Math.imul(_,dt)|0)+Math.imul(M,lt)|0,s=s+Math.imul(M,dt)|0;var xt=(f+(n=n+Math.imul(b,mt)|0)|0)+((8191&(o=(o=o+Math.imul(b,gt)|0)+Math.imul(y,mt)|0))<<13)|0;f=((s=s+Math.imul(y,gt)|0)+(o>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(q,X),o=(o=Math.imul(q,Q))+Math.imul(D,X)|0,s=Math.imul(D,Q),n=n+Math.imul(C,tt)|0,o=(o=o+Math.imul(C,et)|0)+Math.imul(U,tt)|0,s=s+Math.imul(U,et)|0,n=n+Math.imul(O,it)|0,o=(o=o+Math.imul(O,nt)|0)+Math.imul(B,it)|0,s=s+Math.imul(B,nt)|0,n=n+Math.imul(P,st)|0,o=(o=o+Math.imul(P,at)|0)+Math.imul(I,st)|0,s=s+Math.imul(I,at)|0,n=n+Math.imul(A,ut)|0,o=(o=o+Math.imul(A,ft)|0)+Math.imul(x,ut)|0,s=s+Math.imul(x,ft)|0,n=n+Math.imul(k,lt)|0,o=(o=o+Math.imul(k,dt)|0)+Math.imul(E,lt)|0,s=s+Math.imul(E,dt)|0;var Tt=(f+(n=n+Math.imul(_,mt)|0)|0)+((8191&(o=(o=o+Math.imul(_,gt)|0)+Math.imul(M,mt)|0))<<13)|0;f=((s=s+Math.imul(M,gt)|0)+(o>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(q,tt),o=(o=Math.imul(q,et))+Math.imul(D,tt)|0,s=Math.imul(D,et),n=n+Math.imul(C,it)|0,o=(o=o+Math.imul(C,nt)|0)+Math.imul(U,it)|0,s=s+Math.imul(U,nt)|0,n=n+Math.imul(O,st)|0,o=(o=o+Math.imul(O,at)|0)+Math.imul(B,st)|0,s=s+Math.imul(B,at)|0,n=n+Math.imul(P,ut)|0,o=(o=o+Math.imul(P,ft)|0)+Math.imul(I,ut)|0,s=s+Math.imul(I,ft)|0,n=n+Math.imul(A,lt)|0,o=(o=o+Math.imul(A,dt)|0)+Math.imul(x,lt)|0,s=s+Math.imul(x,dt)|0;var Pt=(f+(n=n+Math.imul(k,mt)|0)|0)+((8191&(o=(o=o+Math.imul(k,gt)|0)+Math.imul(E,mt)|0))<<13)|0;f=((s=s+Math.imul(E,gt)|0)+(o>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,n=Math.imul(q,it),o=(o=Math.imul(q,nt))+Math.imul(D,it)|0,s=Math.imul(D,nt),n=n+Math.imul(C,st)|0,o=(o=o+Math.imul(C,at)|0)+Math.imul(U,st)|0,s=s+Math.imul(U,at)|0,n=n+Math.imul(O,ut)|0,o=(o=o+Math.imul(O,ft)|0)+Math.imul(B,ut)|0,s=s+Math.imul(B,ft)|0,n=n+Math.imul(P,lt)|0,o=(o=o+Math.imul(P,dt)|0)+Math.imul(I,lt)|0,s=s+Math.imul(I,dt)|0;var It=(f+(n=n+Math.imul(A,mt)|0)|0)+((8191&(o=(o=o+Math.imul(A,gt)|0)+Math.imul(x,mt)|0))<<13)|0;f=((s=s+Math.imul(x,gt)|0)+(o>>>13)|0)+(It>>>26)|0,It&=67108863,n=Math.imul(q,st),o=(o=Math.imul(q,at))+Math.imul(D,st)|0,s=Math.imul(D,at),n=n+Math.imul(C,ut)|0,o=(o=o+Math.imul(C,ft)|0)+Math.imul(U,ut)|0,s=s+Math.imul(U,ft)|0,n=n+Math.imul(O,lt)|0,o=(o=o+Math.imul(O,dt)|0)+Math.imul(B,lt)|0,s=s+Math.imul(B,dt)|0;var Lt=(f+(n=n+Math.imul(P,mt)|0)|0)+((8191&(o=(o=o+Math.imul(P,gt)|0)+Math.imul(I,mt)|0))<<13)|0;f=((s=s+Math.imul(I,gt)|0)+(o>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,n=Math.imul(q,ut),o=(o=Math.imul(q,ft))+Math.imul(D,ut)|0,s=Math.imul(D,ft),n=n+Math.imul(C,lt)|0,o=(o=o+Math.imul(C,dt)|0)+Math.imul(U,lt)|0,s=s+Math.imul(U,dt)|0;var Ot=(f+(n=n+Math.imul(O,mt)|0)|0)+((8191&(o=(o=o+Math.imul(O,gt)|0)+Math.imul(B,mt)|0))<<13)|0;f=((s=s+Math.imul(B,gt)|0)+(o>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,n=Math.imul(q,lt),o=(o=Math.imul(q,dt))+Math.imul(D,lt)|0,s=Math.imul(D,dt);var Bt=(f+(n=n+Math.imul(C,mt)|0)|0)+((8191&(o=(o=o+Math.imul(C,gt)|0)+Math.imul(U,mt)|0))<<13)|0;f=((s=s+Math.imul(U,gt)|0)+(o>>>13)|0)+(Bt>>>26)|0,Bt&=67108863;var jt=(f+(n=Math.imul(q,mt))|0)+((8191&(o=(o=Math.imul(q,gt))+Math.imul(D,mt)|0))<<13)|0;return f=((s=Math.imul(D,gt))+(o>>>13)|0)+(jt>>>26)|0,jt&=67108863,u[0]=vt,u[1]=bt,u[2]=yt,u[3]=wt,u[4]=_t,u[5]=Mt,u[6]=St,u[7]=kt,u[8]=Et,u[9]=Rt,u[10]=At,u[11]=xt,u[12]=Tt,u[13]=Pt,u[14]=It,u[15]=Lt,u[16]=Ot,u[17]=Bt,u[18]=jt,0!==f&&(u[19]=f,i.length++),i};function m(t,e,r){return(new g).mulp(t,e,r)}function g(t,e){this.x=t,this.y=e}Math.imul||(p=d),o.prototype.mulTo=function t(e,r){var i=this.length+e.length;return 10===this.length&&10===e.length?p(this,e,r):i<63?d(this,e,r):i<1024?function n(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var i=0,n=0,o=0;o<r.length-1;o++){var s=n;n=0;for(var a=67108863&i,h=Math.min(o,e.length-1),u=Math.max(0,o-t.length+1);u<=h;u++){var f=o-u,c=(0|t.words[f])*(0|e.words[u]),l=67108863&c;a=67108863&(l=l+a|0),n+=(s=(s=s+(c/67108864|0)|0)+(l>>>26)|0)>>>26,s&=67108863}r.words[o]=a,i=s,s=n}return 0!==i?r.words[o]=i:r.length--,r.strip()}(this,e,r):m(this,e,r)},g.prototype.makeRBT=function t(e){for(var r=new Array(e),i=o.prototype._countBits(e)-1,n=0;n<e;n++)r[n]=this.revBin(n,i,e);return r},g.prototype.revBin=function t(e,r,i){if(0===e||e===i-1)return e;for(var n=0,o=0;o<r;o++)n|=(1&e)<<r-o-1,e>>=1;return n},g.prototype.permute=function t(e,r,i,n,o,s){for(var a=0;a<s;a++)n[a]=r[e[a]],o[a]=i[e[a]]},g.prototype.transform=function t(e,r,i,n,o,s){this.permute(s,e,r,i,n,o);for(var a=1;a<o;a<<=1)for(var h=a<<1,u=Math.cos(2*Math.PI/h),f=Math.sin(2*Math.PI/h),c=0;c<o;c+=h)for(var l=u,d=f,p=0;p<a;p++){var m=i[c+p],g=n[c+p],v=i[c+p+a],b=n[c+p+a],y=l*v-d*b;b=l*b+d*v,v=y,i[c+p]=m+v,n[c+p]=g+b,i[c+p+a]=m-v,n[c+p+a]=g-b,p!==h&&(y=u*l-f*d,d=u*d+f*l,l=y)}},g.prototype.guessLen13b=function t(e,r){var i=1|Math.max(r,e),n=1&i,o=0;for(i=i/2|0;i;i>>>=1)o++;return 1<<o+1+n},g.prototype.conjugate=function t(e,r,i){if(!(i<=1))for(var n=0;n<i/2;n++){var o=e[n];e[n]=e[i-n-1],e[i-n-1]=o,o=r[n],r[n]=-r[i-n-1],r[i-n-1]=-o}},g.prototype.normalize13b=function t(e,r){for(var i=0,n=0;n<r/2;n++){var o=8192*Math.round(e[2*n+1]/r)+Math.round(e[2*n]/r)+i;e[n]=67108863&o,i=o<67108864?0:o/67108864|0}return e},g.prototype.convert13b=function t(e,r,n,o){for(var s=0,a=0;a<r;a++)s+=0|e[a],n[2*a]=8191&s,s>>>=13,n[2*a+1]=8191&s,s>>>=13;for(a=2*r;a<o;++a)n[a]=0;i(0===s),i(0==(-8192&s))},g.prototype.stub=function t(e){for(var r=new Array(e),i=0;i<e;i++)r[i]=0;return r},g.prototype.mulp=function t(e,r,i){var n=2*this.guessLen13b(e.length,r.length),o=this.makeRBT(n),s=this.stub(n),a=new Array(n),h=new Array(n),u=new Array(n),f=new Array(n),c=new Array(n),l=new Array(n),d=i.words;d.length=n,this.convert13b(e.words,e.length,a,n),this.convert13b(r.words,r.length,f,n),this.transform(a,s,h,u,n,o),this.transform(f,s,c,l,n,o);for(var p=0;p<n;p++){var m=h[p]*c[p]-u[p]*l[p];u[p]=h[p]*l[p]+u[p]*c[p],h[p]=m}return this.conjugate(h,u,n),this.transform(h,u,d,s,n,o),this.conjugate(d,s,n),this.normalize13b(d,n),i.negative=e.negative^r.negative,i.length=e.length+r.length,i.strip()},o.prototype.mul=function t(e){var r=new o(null);return r.words=new Array(this.length+e.length),this.mulTo(e,r)},o.prototype.mulf=function t(e){var r=new o(null);return r.words=new Array(this.length+e.length),m(this,e,r)},o.prototype.imul=function t(e){return this.clone().mulTo(e,this)},o.prototype.imuln=function t(e){i("number"==typeof e),i(e<67108864);for(var r=0,n=0;n<this.length;n++){var o=(0|this.words[n])*e,s=(67108863&o)+(67108863&r);r>>=26,r+=o/67108864|0,r+=s>>>26,this.words[n]=67108863&s}return 0!==r&&(this.words[n]=r,this.length++),this},o.prototype.muln=function t(e){return this.clone().imuln(e)},o.prototype.sqr=function t(){return this.mul(this)},o.prototype.isqr=function t(){return this.imul(this.clone())},o.prototype.pow=function t(e){var r=function i(t){for(var e=new Array(t.bitLength()),r=0;r<e.length;r++){var i=r/26|0,n=r%26;e[r]=(t.words[i]&1<<n)>>>n}return e}(e);if(0===r.length)return new o(1);for(var n=this,s=0;s<r.length&&0===r[s];s++,n=n.sqr());if(++s<r.length)for(var a=n.sqr();s<r.length;s++,a=a.sqr())0!==r[s]&&(n=n.mul(a));return n},o.prototype.iushln=function t(e){i("number"==typeof e&&e>=0);var r,n=e%26,o=(e-n)/26,s=67108863>>>26-n<<26-n;if(0!==n){var a=0;for(r=0;r<this.length;r++){var h=this.words[r]&s,u=(0|this.words[r])-h<<n;this.words[r]=u|a,a=h>>>26-n}a&&(this.words[r]=a,this.length++)}if(0!==o){for(r=this.length-1;r>=0;r--)this.words[r+o]=this.words[r];for(r=0;r<o;r++)this.words[r]=0;this.length+=o}return this.strip()},o.prototype.ishln=function t(e){return i(0===this.negative),this.iushln(e)},o.prototype.iushrn=function t(e,r,n){var o;i("number"==typeof e&&e>=0),o=r?(r-r%26)/26:0;var s=e%26,a=Math.min((e-s)/26,this.length),h=67108863^67108863>>>s<<s,u=n;if(o-=a,o=Math.max(0,o),u){for(var f=0;f<a;f++)u.words[f]=this.words[f];u.length=a}if(0===a);else if(this.length>a)for(this.length-=a,f=0;f<this.length;f++)this.words[f]=this.words[f+a];else this.words[0]=0,this.length=1;var c=0;for(f=this.length-1;f>=0&&(0!==c||f>=o);f--){var l=0|this.words[f];this.words[f]=c<<26-s|l>>>s,c=l&h}return u&&0!==c&&(u.words[u.length++]=c),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function t(e,r,n){return i(0===this.negative),this.iushrn(e,r,n)},o.prototype.shln=function t(e){return this.clone().ishln(e)},o.prototype.ushln=function t(e){return this.clone().iushln(e)},o.prototype.shrn=function t(e){return this.clone().ishrn(e)},o.prototype.ushrn=function t(e){return this.clone().iushrn(e)},o.prototype.testn=function t(e){i("number"==typeof e&&e>=0);var r=e%26,n=(e-r)/26,o=1<<r;return!(this.length<=n)&&!!(this.words[n]&o)},o.prototype.imaskn=function t(e){i("number"==typeof e&&e>=0);var r=e%26,n=(e-r)/26;if(i(0===this.negative,"imaskn works only with positive numbers"),this.length<=n)return this;if(0!==r&&n++,this.length=Math.min(n,this.length),0!==r){var o=67108863^67108863>>>r<<r;this.words[this.length-1]&=o}return this.strip()},o.prototype.maskn=function t(e){return this.clone().imaskn(e)},o.prototype.iaddn=function t(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)},o.prototype._iaddn=function t(e){this.words[0]+=e;for(var r=0;r<this.length&&this.words[r]>=67108864;r++)this.words[r]-=67108864,r===this.length-1?this.words[r+1]=1:this.words[r+1]++;return this.length=Math.max(this.length,r+1),this},o.prototype.isubn=function t(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 r=0;r<this.length&&this.words[r]<0;r++)this.words[r]+=67108864,this.words[r+1]-=1;return this.strip()},o.prototype.addn=function t(e){return this.clone().iaddn(e)},o.prototype.subn=function t(e){return this.clone().isubn(e)},o.prototype.iabs=function t(){return this.negative=0,this},o.prototype.abs=function t(){return this.clone().iabs()},o.prototype._ishlnsubmul=function t(e,r,n){var o,s,a=e.length+n;this._expand(a);var h=0;for(o=0;o<e.length;o++){s=(0|this.words[o+n])+h;var u=(0|e.words[o])*r;h=((s-=67108863&u)>>26)-(u/67108864|0),this.words[o+n]=67108863&s}for(;o<this.length-n;o++)h=(s=(0|this.words[o+n])+h)>>26,this.words[o+n]=67108863&s;if(0===h)return this.strip();for(i(-1===h),h=0,o=0;o<this.length;o++)h=(s=-(0|this.words[o])+h)>>26,this.words[o]=67108863&s;return this.negative=1,this.strip()},o.prototype._wordDiv=function t(e,r){var i=(this.length,e.length),n=this.clone(),s=e,a=0|s.words[s.length-1];0!==(i=26-this._countBits(a))&&(s=s.ushln(i),n.iushln(i),a=0|s.words[s.length-1]);var h,u=n.length-s.length;if("mod"!==r){(h=new o(null)).length=u+1,h.words=new Array(h.length);for(var f=0;f<h.length;f++)h.words[f]=0}var c=n.clone()._ishlnsubmul(s,1,u);0===c.negative&&(n=c,h&&(h.words[u]=1));for(var l=u-1;l>=0;l--){var d=67108864*(0|n.words[s.length+l])+(0|n.words[s.length+l-1]);for(d=Math.min(d/a|0,67108863),n._ishlnsubmul(s,d,l);0!==n.negative;)d--,n.negative=0,n._ishlnsubmul(s,1,l),n.isZero()||(n.negative^=1);h&&(h.words[l]=d)}return h&&h.strip(),n.strip(),"div"!==r&&0!==i&&n.iushrn(i),{div:h||null,mod:n}},o.prototype.divmod=function t(e,r,n){return i(!e.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===e.negative?(h=this.neg().divmod(e,r),"mod"!==r&&(s=h.div.neg()),"div"!==r&&(a=h.mod.neg(),n&&0!==a.negative&&a.iadd(e)),{div:s,mod:a}):0===this.negative&&0!==e.negative?(h=this.divmod(e.neg(),r),"mod"!==r&&(s=h.div.neg()),{div:s,mod:h.mod}):0!=(this.negative&e.negative)?(h=this.neg().divmod(e.neg(),r),"div"!==r&&(a=h.mod.neg(),n&&0!==a.negative&&a.isub(e)),{div:h.div,mod:a}):e.length>this.length||this.cmp(e)<0?{div:new o(0),mod:this}:1===e.length?"div"===r?{div:this.divn(e.words[0]),mod:null}:"mod"===r?{div:null,mod:new o(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new o(this.modn(e.words[0]))}:this._wordDiv(e,r);var s,a,h},o.prototype.div=function t(e){return this.divmod(e,"div",!1).div},o.prototype.mod=function t(e){return this.divmod(e,"mod",!1).mod},o.prototype.umod=function t(e){return this.divmod(e,"mod",!0).mod},o.prototype.divRound=function t(e){var r=this.divmod(e);if(r.mod.isZero())return r.div;var i=0!==r.div.negative?r.mod.isub(e):r.mod,n=e.ushrn(1),o=e.andln(1),s=i.cmp(n);return s<0||1===o&&0===s?r.div:0!==r.div.negative?r.div.isubn(1):r.div.iaddn(1)},o.prototype.modn=function t(e){i(e<=67108863);for(var r=(1<<26)%e,n=0,o=this.length-1;o>=0;o--)n=(r*n+(0|this.words[o]))%e;return n},o.prototype.idivn=function t(e){i(e<=67108863);for(var r=0,n=this.length-1;n>=0;n--){var o=(0|this.words[n])+67108864*r;this.words[n]=o/e|0,r=o%e}return this.strip()},o.prototype.divn=function t(e){return this.clone().idivn(e)},o.prototype.egcd=function t(e){i(0===e.negative),i(!e.isZero());var r=this,n=e.clone();r=0!==r.negative?r.umod(e):r.clone();for(var s=new o(1),a=new o(0),h=new o(0),u=new o(1),f=0;r.isEven()&&n.isEven();)r.iushrn(1),n.iushrn(1),++f;for(var c=n.clone(),l=r.clone();!r.isZero();){for(var d=0,p=1;0==(r.words[0]&p)&&d<26;++d,p<<=1);if(d>0)for(r.iushrn(d);d-- >0;)(s.isOdd()||a.isOdd())&&(s.iadd(c),a.isub(l)),s.iushrn(1),a.iushrn(1);for(var m=0,g=1;0==(n.words[0]&g)&&m<26;++m,g<<=1);if(m>0)for(n.iushrn(m);m-- >0;)(h.isOdd()||u.isOdd())&&(h.iadd(c),u.isub(l)),h.iushrn(1),u.iushrn(1);r.cmp(n)>=0?(r.isub(n),s.isub(h),a.isub(u)):(n.isub(r),h.isub(s),u.isub(a))}return{a:h,b:u,gcd:n.iushln(f)}},o.prototype._invmp=function t(e){i(0===e.negative),i(!e.isZero());var r=this,n=e.clone();r=0!==r.negative?r.umod(e):r.clone();for(var s,a=new o(1),h=new o(0),u=n.clone();r.cmpn(1)>0&&n.cmpn(1)>0;){for(var f=0,c=1;0==(r.words[0]&c)&&f<26;++f,c<<=1);if(f>0)for(r.iushrn(f);f-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);for(var l=0,d=1;0==(n.words[0]&d)&&l<26;++l,d<<=1);if(l>0)for(n.iushrn(l);l-- >0;)h.isOdd()&&h.iadd(u),h.iushrn(1);r.cmp(n)>=0?(r.isub(n),a.isub(h)):(n.isub(r),h.isub(a))}return(s=0===r.cmpn(1)?a:h).cmpn(0)<0&&s.iadd(e),s},o.prototype.gcd=function t(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var r=this.clone(),i=e.clone();r.negative=0,i.negative=0;for(var n=0;r.isEven()&&i.isEven();n++)r.iushrn(1),i.iushrn(1);for(;;){for(;r.isEven();)r.iushrn(1);for(;i.isEven();)i.iushrn(1);var o=r.cmp(i);if(o<0){var s=r;r=i,i=s}else if(0===o||0===i.cmpn(1))break;r.isub(i)}return i.iushln(n)},o.prototype.invm=function t(e){return this.egcd(e).a.umod(e)},o.prototype.isEven=function t(){return 0==(1&this.words[0])},o.prototype.isOdd=function t(){return 1==(1&this.words[0])},o.prototype.andln=function t(e){return this.words[0]&e},o.prototype.bincn=function t(e){i("number"==typeof e);var r=e%26,n=(e-r)/26,o=1<<r;if(this.length<=n)return this._expand(n+1),this.words[n]|=o,this;for(var s=o,a=n;0!==s&&a<this.length;a++){var h=0|this.words[a];s=(h+=s)>>>26,h&=67108863,this.words[a]=h}return 0!==s&&(this.words[a]=s,this.length++),this},o.prototype.isZero=function t(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function t(e){var r,n=e<0;if(0!==this.negative&&!n)return-1;if(0===this.negative&&n)return 1;if(this.strip(),this.length>1)r=1;else{n&&(e=-e),i(e<=67108863,"Number is too big");var o=0|this.words[0];r=o===e?0:o<e?-1:1}return 0!==this.negative?0|-r:r},o.prototype.cmp=function t(e){if(0!==this.negative&&0===e.negative)return-1;if(0===this.negative&&0!==e.negative)return 1;var r=this.ucmp(e);return 0!==this.negative?0|-r:r},o.prototype.ucmp=function t(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var r=0,i=this.length-1;i>=0;i--){var n=0|this.words[i],o=0|e.words[i];if(n!==o){n<o?r=-1:n>o&&(r=1);break}}return r},o.prototype.gtn=function t(e){return 1===this.cmpn(e)},o.prototype.gt=function t(e){return 1===this.cmp(e)},o.prototype.gten=function t(e){return this.cmpn(e)>=0},o.prototype.gte=function t(e){return this.cmp(e)>=0},o.prototype.ltn=function t(e){return-1===this.cmpn(e)},o.prototype.lt=function t(e){return-1===this.cmp(e)},o.prototype.lten=function t(e){return this.cmpn(e)<=0},o.prototype.lte=function t(e){return this.cmp(e)<=0},o.prototype.eqn=function t(e){return 0===this.cmpn(e)},o.prototype.eq=function t(e){return 0===this.cmp(e)},o.red=function t(e){return new S(e)},o.prototype.toRed=function t(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)},o.prototype.fromRed=function t(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function t(e){return this.red=e,this},o.prototype.forceRed=function t(e){return i(!this.red,"Already a number in reduction context"),this._forceRed(e)},o.prototype.redAdd=function t(e){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},o.prototype.redIAdd=function t(e){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},o.prototype.redSub=function t(e){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},o.prototype.redISub=function t(e){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},o.prototype.redShl=function t(e){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},o.prototype.redMul=function t(e){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},o.prototype.redIMul=function t(e){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},o.prototype.redSqr=function t(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function t(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function t(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function t(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function t(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function t(e){return i(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var v={k256:null,p224:null,p192:null,p25519:null};function b(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function y(){b.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){b.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function _(){b.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function M(){b.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function S(t){if("string"==typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else i(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function k(t){S.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}b.prototype._tmp=function t(){var e=new o(null);return e.words=new Array(Math.ceil(this.n/13)),e},b.prototype.ireduce=function t(e){var r,i=e;do{this.split(i,this.tmp),r=(i=(i=this.imulK(i)).iadd(this.tmp)).bitLength()}while(r>this.n);var n=r<this.n?-1:i.ucmp(this.p);return 0===n?(i.words[0]=0,i.length=1):n>0?i.isub(this.p):void 0!==i.strip?i.strip():i._strip(),i},b.prototype.split=function t(e,r){e.iushrn(this.n,0,r)},b.prototype.imulK=function t(e){return e.imul(this.k)},n(y,b),y.prototype.split=function t(e,r){for(var i=4194303,n=Math.min(e.length,9),o=0;o<n;o++)r.words[o]=e.words[o];if(r.length=n,e.length<=9)return e.words[0]=0,void(e.length=1);var s=e.words[9];for(r.words[r.length++]=s&i,o=10;o<e.length;o++){var a=0|e.words[o];e.words[o-10]=(a&i)<<4|s>>>22,s=a}s>>>=22,e.words[o-10]=s,0===s&&e.length>10?e.length-=10:e.length-=9},y.prototype.imulK=function t(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var r=0,i=0;i<e.length;i++){var n=0|e.words[i];r+=977*n,e.words[i]=67108863&r,r=64*n+(r/67108864|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},n(w,b),n(_,b),n(M,b),M.prototype.imulK=function t(e){for(var r=0,i=0;i<e.length;i++){var n=19*(0|e.words[i])+r,o=67108863&n;n>>>=26,e.words[i]=o,r=n}return 0!==r&&(e.words[e.length++]=r),e},o._prime=function t(e){if(v[e])return v[e];var t;if("k256"===e)t=new y;else if("p224"===e)t=new w;else if("p192"===e)t=new _;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new M}return v[e]=t,t},S.prototype._verify1=function t(e){i(0===e.negative,"red works only with positives"),i(e.red,"red works only with red numbers")},S.prototype._verify2=function t(e,r){i(0==(e.negative|r.negative),"red works only with positives"),i(e.red&&e.red===r.red,"red works only with red numbers")},S.prototype.imod=function t(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},S.prototype.neg=function t(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},S.prototype.add=function t(e,r){this._verify2(e,r);var i=e.add(r);return i.cmp(this.m)>=0&&i.isub(this.m),i._forceRed(this)},S.prototype.iadd=function t(e,r){this._verify2(e,r);var i=e.iadd(r);return i.cmp(this.m)>=0&&i.isub(this.m),i},S.prototype.sub=function t(e,r){this._verify2(e,r);var i=e.sub(r);return i.cmpn(0)<0&&i.iadd(this.m),i._forceRed(this)},S.prototype.isub=function t(e,r){this._verify2(e,r);var i=e.isub(r);return i.cmpn(0)<0&&i.iadd(this.m),i},S.prototype.shl=function t(e,r){return this._verify1(e),this.imod(e.ushln(r))},S.prototype.imul=function t(e,r){return this._verify2(e,r),this.imod(e.imul(r))},S.prototype.mul=function t(e,r){return this._verify2(e,r),this.imod(e.mul(r))},S.prototype.isqr=function t(e){return this.imul(e,e.clone())},S.prototype.sqr=function t(e){return this.mul(e,e)},S.prototype.sqrt=function t(e){if(e.isZero())return e.clone();var r=this.m.andln(3);if(i(r%2==1),3===r){var n=this.m.add(new o(1)).iushrn(2);return this.pow(e,n)}for(var s=this.m.subn(1),a=0;!s.isZero()&&0===s.andln(1);)a++,s.iushrn(1);i(!s.isZero());var h=new o(1).toRed(this),u=h.redNeg(),f=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new o(2*c*c).toRed(this);0!==this.pow(c,f).cmp(u);)c.redIAdd(u);for(var l=this.pow(c,s),d=this.pow(e,s.addn(1).iushrn(1)),p=this.pow(e,s),m=a;0!==p.cmp(h);){for(var g=p,v=0;0!==g.cmp(h);v++)g=g.redSqr();i(v<m);var b=this.pow(l,new o(1).iushln(m-v-1));d=d.redMul(b),l=b.redSqr(),p=p.redMul(l),m=v}return d},S.prototype.invm=function t(e){var r=e._invmp(this.m);return 0!==r.negative?(r.negative=0,this.imod(r).redNeg()):this.imod(r)},S.prototype.pow=function t(e,r){if(r.isZero())return new o(1).toRed(this);if(0===r.cmpn(1))return e.clone();var i=new Array(16);i[0]=new o(1).toRed(this),i[1]=e;for(var n=2;n<i.length;n++)i[n]=this.mul(i[n-1],e);var s=i[0],a=0,h=0,u=r.bitLength()%26;for(0===u&&(u=26),n=r.length-1;n>=0;n--){for(var f=r.words[n],c=u-1;c>=0;c--){var l=f>>c&1;s!==i[0]&&(s=this.sqr(s)),0!==l||0!==a?(a<<=1,a|=l,(4===++h||0===n&&0===c)&&(s=this.mul(s,i[a]),h=0,a=0)):h=0}u=26}return s},S.prototype.convertTo=function t(e){var r=e.umod(this.m);return r===e?r.clone():r},S.prototype.convertFrom=function t(e){var r=e.clone();return r.red=null,r},o.mont=function t(e){return new k(e)},n(k,S),k.prototype.convertTo=function t(e){return this.imod(e.ushln(this.shift))},k.prototype.convertFrom=function t(e){var r=this.imod(e.mul(this.rinv));return r.red=null,r},k.prototype.imul=function t(e,r){if(e.isZero()||r.isZero())return e.words[0]=0,e.length=1,e;var i=e.imul(r),n=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=i.isub(n).iushrn(this.shift),s=o;return o.cmp(this.m)>=0?s=o.isub(this.m):o.cmpn(0)<0&&(s=o.iadd(this.m)),s._forceRed(this)},k.prototype.mul=function t(e,r){if(e.isZero()||r.isZero())return new o(0)._forceRed(this);var i=e.mul(r),n=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),s=i.isub(n).iushrn(this.shift),a=s;return s.cmp(this.m)>=0?a=s.isub(this.m):s.cmpn(0)<0&&(a=s.iadd(this.m)),a._forceRed(this)},k.prototype.invm=function t(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(t,this)}).call(this,r(28)(t))},function(t,e,r){var i=r(9);t.exports=!i((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},function(t,e,r){var i=r(17),n=r(21),o=r(39);t.exports=i?function(t,e,r){return n.f(t,e,o(1,r))}:function(t,e,r){return t[e]=r,t}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,r,i){return r&&t(e.prototype,r),i&&t(e,i),e}}();var n={setInterval:function(t){function e(e,r){return t.apply(this,arguments)}return e.toString=function(){return t.toString()},e}((function(t,e){return setInterval(t,e)})),clearInterval:function(t){function e(e){return t.apply(this,arguments)}return e.toString=function(){return t.toString()},e}((function(t){return clearInterval(t)}))},o=!1,s=null;e.Global=function(){function t(){!function e(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}(this,t)}return t._testing=function t(){o=!0},t.setXMLHttpRequest=function t(e){s=e},i(t,null,[{key:"location",get:function t(){if(!o)return location}},{key:"localStorage",get:function t(){if(!o&&"undefined"!=typeof window)return localStorage}},{key:"sessionStorage",get:function t(){if(!o&&"undefined"!=typeof window)return sessionStorage}},{key:"XMLHttpRequest",get:function t(){if(!o&&"undefined"!=typeof window)return s||XMLHttpRequest}},{key:"timer",get:function t(){if(!o)return n}}]),t}()},function(t,e,r){var i=r(2).Buffer,n=r(291).Transform,o=r(25).StringDecoder;function s(t){n.call(this),this.hashMode="string"==typeof t,this.hashMode?this[t]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}r(1)(s,n),s.prototype.update=function(t,e,r){"string"==typeof t&&(t=i.from(t,e));var n=this._update(t);return this.hashMode?this:(r&&(n=this._toString(n,r)),n)},s.prototype.setAutoPadding=function(){},s.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},s.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},s.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},s.prototype._transform=function(t,e,r){var i;try{this.hashMode?this._update(t):this.push(this._update(t))}catch(t){i=t}finally{r(i)}},s.prototype._flush=function(t){var e;try{this.push(this.__final())}catch(t){e=t}t(e)},s.prototype._finalOrDigest=function(t){var e=this.__final()||i.alloc(0);return t&&(e=this._toString(e,t,!0)),e},s.prototype._toString=function(t,e,r){if(this._decoder||(this._decoder=new o(e),this._encoding=e),this._encoding!==e)throw new Error("can't switch encodings");var i=this._decoder.write(t);return r&&(i+=this._decoder.end()),i},t.exports=s},function(t,e,r){var i=r(17),n=r(116),o=r(15),s=r(70),a=Object.defineProperty;e.f=i?a:function t(e,r,i){if(o(e),r=s(r,!0),o(i),n)try{return a(e,r,i)}catch(t){}if("get"in i||"set"in i)throw TypeError("Accessors not supported");return"value"in i&&(e[r]=i.value),e}},function(t,e,r){var i=r(52),n=r(3),o=function(t){return"function"==typeof t?t:void 0};t.exports=function(t,e){return arguments.length<2?o(i[t])||o(n[t]):i[t]&&i[t][e]||n[t]&&n[t][e]}},function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(String(t)+" is not a function");return t}},function(t,e,r){"use strict";var i,n="object"==typeof Reflect?Reflect:null,o=n&&"function"==typeof n.apply?n.apply:function t(e,r,i){return Function.prototype.apply.call(e,r,i)};i=n&&"function"==typeof n.ownKeys?n.ownKeys:Object.getOwnPropertySymbols?function t(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function t(e){return Object.getOwnPropertyNames(e)};var s=Number.isNaN||function t(e){return e!=e};function a(){a.init.call(this)}t.exports=a,t.exports.once=function h(t,e){return new Promise((function(r,i){function n(){void 0!==o&&t.removeListener("error",o),r([].slice.call(arguments))}var o;"error"!==e&&(o=function r(o){t.removeListener(e,n),i(o)},t.once("error",o)),t.once(e,n)}))},a.EventEmitter=a,a.prototype._events=void 0,a.prototype._eventsCount=0,a.prototype._maxListeners=void 0;var u=10;function f(t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function c(t){return void 0===t._maxListeners?a.defaultMaxListeners:t._maxListeners}function l(t,e,r,i){var n,o,s;if(f(r),void 0===(o=t._events)?(o=t._events=Object.create(null),t._eventsCount=0):(void 0!==o.newListener&&(t.emit("newListener",e,r.listener?r.listener:r),o=t._events),s=o[e]),void 0===s)s=o[e]=r,++t._eventsCount;else if("function"==typeof s?s=o[e]=i?[r,s]:[s,r]:i?s.unshift(r):s.push(r),(n=c(t))>0&&s.length>n&&!s.warned){s.warned=!0;var a=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");a.name="MaxListenersExceededWarning",a.emitter=t,a.type=e,a.count=s.length,function h(t){console&&console.warn&&console.warn(t)}(a)}return t}function d(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function p(t,e,r){var i={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},n=d.bind(i);return n.listener=r,i.wrapFn=n,n}function m(t,e,r){var i=t._events;if(void 0===i)return[];var n=i[e];return void 0===n?[]:"function"==typeof n?r?[n.listener||n]:[n]:r?function o(t){for(var e=new Array(t.length),r=0;r<e.length;++r)e[r]=t[r].listener||t[r];return e}(n):v(n,n.length)}function g(t){var e=this._events;if(void 0!==e){var r=e[t];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function v(t,e){for(var r=new Array(e),i=0;i<e;++i)r[i]=t[i];return r}Object.defineProperty(a,"defaultMaxListeners",{enumerable:!0,get:function(){return u},set:function(t){if("number"!=typeof t||t<0||s(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");u=t}}),a.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},a.prototype.setMaxListeners=function t(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},a.prototype.getMaxListeners=function t(){return c(this)},a.prototype.emit=function t(e){for(var r=[],i=1;i<arguments.length;i++)r.push(arguments[i]);var n="error"===e,s=this._events;if(void 0!==s)n=n&&void 0===s.error;else if(!n)return!1;if(n){var a;if(r.length>0&&(a=r[0]),a instanceof Error)throw a;var h=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw h.context=a,h}var u=s[e];if(void 0===u)return!1;if("function"==typeof u)o(u,this,r);else{var f=u.length,c=v(u,f);for(i=0;i<f;++i)o(c[i],this,r)}return!0},a.prototype.addListener=function t(e,r){return l(this,e,r,!1)},a.prototype.on=a.prototype.addListener,a.prototype.prependListener=function t(e,r){return l(this,e,r,!0)},a.prototype.once=function t(e,r){return f(r),this.on(e,p(this,e,r)),this},a.prototype.prependOnceListener=function t(e,r){return f(r),this.prependListener(e,p(this,e,r)),this},a.prototype.removeListener=function t(e,r){var i,n,o,s,a;if(f(r),void 0===(n=this._events))return this;if(void 0===(i=n[e]))return this;if(i===r||i.listener===r)0==--this._eventsCount?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit("removeListener",e,i.listener||r));else if("function"!=typeof i){for(o=-1,s=i.length-1;s>=0;s--)if(i[s]===r||i[s].listener===r){a=i[s].listener,o=s;break}if(o<0)return this;0===o?i.shift():function h(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}(i,o),1===i.length&&(n[e]=i[0]),void 0!==n.removeListener&&this.emit("removeListener",e,a||r)}return this},a.prototype.off=a.prototype.removeListener,a.prototype.removeAllListeners=function t(e){var r,i,n;if(void 0===(i=this._events))return this;if(void 0===i.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==i[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete i[e]),this;if(0===arguments.length){var o,s=Object.keys(i);for(n=0;n<s.length;++n)"removeListener"!==(o=s[n])&&this.removeAllListeners(o);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(r=i[e]))this.removeListener(e,r);else if(void 0!==r)for(n=r.length-1;n>=0;n--)this.removeListener(e,r[n]);return this},a.prototype.listeners=function t(e){return m(this,e,!0)},a.prototype.rawListeners=function t(e){return m(this,e,!1)},a.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):g.call(t,e)},a.prototype.listenerCount=g,a.prototype.eventNames=function t(){return this._eventsCount>0?i(this._events):[]}},function(t,e,r){"use strict";var i=r(2).Buffer,n=i.isEncoding||function(t){switch((t=""+t)&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function o(t){var e;switch(this.encoding=function r(t){var e=function r(t){if(!t)return"utf8";for(var e;;)switch(t){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 t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}(t);if("string"!=typeof e&&(i.isEncoding===n||!n(t)))throw new Error("Unknown encoding: "+t);return e||t}(t),this.encoding){case"utf16le":this.text=h,this.end=u,e=4;break;case"utf8":this.fillLast=a,e=4;break;case"base64":this.text=f,this.end=c,e=3;break;default:return this.write=l,void(this.end=d)}this.lastNeed=0,this.lastTotal=0,this.lastChar=i.allocUnsafe(e)}function s(t){return t<=127?0:t>>5==6?2:t>>4==14?3:t>>3==30?4:t>>6==2?-1:-2}function a(t){var e=this.lastTotal-this.lastNeed,r=function i(t,e,r){if(128!=(192&e[0]))return t.lastNeed=0,"�";if(t.lastNeed>1&&e.length>1){if(128!=(192&e[1]))return t.lastNeed=1,"�";if(t.lastNeed>2&&e.length>2&&128!=(192&e[2]))return t.lastNeed=2,"�"}}(this,t);return void 0!==r?r:this.lastNeed<=t.length?(t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(t.copy(this.lastChar,e,0,t.length),void(this.lastNeed-=t.length))}function h(t,e){if((t.length-e)%2==0){var r=t.toString("utf16le",e);if(r){var i=r.charCodeAt(r.length-1);if(i>=55296&&i<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function u(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,r)}return e}function f(t,e){var r=(t.length-e)%3;return 0===r?t.toString("base64",e):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-r))}function c(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function l(t){return t.toString(this.encoding)}function d(t){return t&&t.length?this.write(t):""}e.StringDecoder=o,o.prototype.write=function(t){if(0===t.length)return"";var e,r;if(this.lastNeed){if(void 0===(e=this.fillLast(t)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<t.length?e?e+this.text(t,r):this.text(t,r):e||""},o.prototype.end=function p(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"�":e},o.prototype.text=function m(t,e){var r=function i(t,e,r){var i=e.length-1;if(i<r)return 0;var n=s(e[i]);if(n>=0)return n>0&&(t.lastNeed=n-1),n;if(--i<r||-2===n)return 0;if((n=s(e[i]))>=0)return n>0&&(t.lastNeed=n-2),n;if(--i<r||-2===n)return 0;if((n=s(e[i]))>=0)return n>0&&(2===n?n=0:t.lastNeed=n-3),n;return 0}(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=r;var n=t.length-(r-this.lastNeed);return t.copy(this.lastChar,0,n),t.toString("utf8",e,n)},o.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length}},function(t,e,r){"use strict";(function(t){
/*!
* The buffer module from node.js, for the browser.
*
* @author Feross Aboukhadijeh <http://feross.org>
* @license MIT
*/
var i=r(155),n=r(292),o=r(153);function s(){return h.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function a(t,e){if(s()<e)throw new RangeError("Invalid typed array length");return h.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e)).__proto__=h.prototype:(null===t&&(t=new h(e)),t.length=e),t}function h(t,e,r){if(!(h.TYPED_ARRAY_SUPPORT||this instanceof h))return new h(t,e,r);if("number"==typeof t){if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return c(this,t)}return u(this,t,e,r)}function u(t,e,r,i){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer?function n(t,e,r,i){if(e.byteLength,r<0||e.byteLength<r)throw new RangeError("'offset' is out of bounds");if(e.byteLength<r+(i||0))throw new RangeError("'length' is out of bounds");e=void 0===r&&void 0===i?new Uint8Array(e):void 0===i?new Uint8Array(e,r):new Uint8Array(e,r,i);h.TYPED_ARRAY_SUPPORT?(t=e).__proto__=h.prototype:t=l(t,e);return t}(t,e,r,i):"string"==typeof e?function s(t,e,r){"string"==typeof r&&""!==r||(r="utf8");if(!h.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var i=0|p(e,r),n=(t=a(t,i)).write(e,r);n!==i&&(t=t.slice(0,n));return t}(t,e,r):function u(t,e){if(h.isBuffer(e)){var r=0|d(e.length);return 0===(t=a(t,r)).length||e.copy(t,0,0,r),t}if(e){if("undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return"number"!=typeof e.length||function i(t){return t!=t}(e.length)?a(t,0):l(t,e);if("Buffer"===e.type&&o(e.data))return l(t,e.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(t,e)}function f(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function c(t,e){if(f(e),t=a(t,e<0?0:0|d(e)),!h.TYPED_ARRAY_SUPPORT)for(var r=0;r<e;++r)t[r]=0;return t}function l(t,e){var r=e.length<0?0:0|d(e.length);t=a(t,r);for(var i=0;i<r;i+=1)t[i]=255&e[i];return t}function d(t){if(t>=s())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s().toString(16)+" bytes");return 0|t}function p(t,e){if(h.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var r=t.length;if(0===r)return 0;for(var i=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return W(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return H(t).length;default:if(i)return W(t).length;e=(""+e).toLowerCase(),i=!0}}function m(t,e,r){var i=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return L(this,e,r);case"utf8":case"utf-8":return R(this,e,r);case"ascii":return P(this,e,r);case"latin1":case"binary":return I(this,e,r);case"base64":return E(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O(this,e,r);default:if(i)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),i=!0}}function g(t,e,r){var i=t[e];t[e]=t[r],t[r]=i}function v(t,e,r,i,n){if(0===t.length)return-1;if("string"==typeof r?(i=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=n?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(n)return-1;r=t.length-1}else if(r<0){if(!n)return-1;r=0}if("string"==typeof e&&(e=h.from(e,i)),h.isBuffer(e))return 0===e.length?-1:b(t,e,r,i,n);if("number"==typeof e)return e&=255,h.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?n?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):b(t,[e],r,i,n);throw new TypeError("val must be string, number or Buffer")}function b(t,e,r,i,n){var o,s=1,a=t.length,h=e.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(t.length<2||e.length<2)return-1;s=2,a/=2,h/=2,r/=2}function u(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(n){var f=-1;for(o=r;o<a;o++)if(u(t,o)===u(e,-1===f?0:o-f)){if(-1===f&&(f=o),o-f+1===h)return f*s}else-1!==f&&(o-=o-f),f=-1}else for(r+h>a&&(r=a-h),o=r;o>=0;o--){for(var c=!0,l=0;l<h;l++)if(u(t,o+l)!==u(e,l)){c=!1;break}if(c)return o}return-1}function y(t,e,r,i){r=Number(r)||0;var n=t.length-r;i?(i=Number(i))>n&&(i=n):i=n;var o=e.length;if(o%2!=0)throw new TypeError("Invalid hex string");i>o/2&&(i=o/2);for(var s=0;s<i;++s){var a=parseInt(e.substr(2*s,2),16);if(isNaN(a))return s;t[r+s]=a}return s}function w(t,e,r,i){return K(W(e,t.length-r),t,r,i)}function _(t,e,r,i){return K(function n(t){for(var e=[],r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(e),t,r,i)}function M(t,e,r,i){return _(t,e,r,i)}function S(t,e,r,i){return K(H(e),t,r,i)}function k(t,e,r,i){return K(function n(t,e){for(var r,i,n,o=[],s=0;s<t.length&&!((e-=2)<0);++s)i=(r=t.charCodeAt(s))>>8,n=r%256,o.push(n),o.push(i);return o}(e,t.length-r),t,r,i)}function E(t,e,r){return 0===e&&r===t.length?i.fromByteArray(t):i.fromByteArray(t.slice(e,r))}function R(t,e,r){r=Math.min(t.length,r);for(var i=[],n=e;n<r;){var o,s,a,h,u=t[n],f=null,c=u>239?4:u>223?3:u>191?2:1;if(n+c<=r)switch(c){case 1:u<128&&(f=u);break;case 2:128==(192&(o=t[n+1]))&&(h=(31&u)<<6|63&o)>127&&(f=h);break;case 3:o=t[n+1],s=t[n+2],128==(192&o)&&128==(192&s)&&(h=(15&u)<<12|(63&o)<<6|63&s)>2047&&(h<55296||h>57343)&&(f=h);break;case 4:o=t[n+1],s=t[n+2],a=t[n+3],128==(192&o)&&128==(192&s)&&128==(192&a)&&(h=(15&u)<<18|(63&o)<<12|(63&s)<<6|63&a)>65535&&h<1114112&&(f=h)}null===f?(f=65533,c=1):f>65535&&(f-=65536,i.push(f>>>10&1023|55296),f=56320|1023&f),i.push(f),n+=c}return function l(t){var e=t.length;if(e<=T)return String.fromCharCode.apply(String,t);var r="",i=0;for(;i<e;)r+=String.fromCharCode.apply(String,t.slice(i,i+=T));return r}(i)}e.Buffer=h,e.SlowBuffer=function A(t){+t!=t&&(t=0);return h.alloc(+t)},e.INSPECT_MAX_BYTES=50,h.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:function x(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(t){return!1}}(),e.kMaxLength=s(),h.poolSize=8192,h._augment=function(t){return t.__proto__=h.prototype,t},h.from=function(t,e,r){return u(null,t,e,r)},h.TYPED_ARRAY_SUPPORT&&(h.prototype.__proto__=Uint8Array.prototype,h.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&h[Symbol.species]===h&&Object.defineProperty(h,Symbol.species,{value:null,configurable:!0})),h.alloc=function(t,e,r){return function i(t,e,r,n){return f(e),e<=0?a(t,e):void 0!==r?"string"==typeof n?a(t,e).fill(r,n):a(t,e).fill(r):a(t,e)}(null,t,e,r)},h.allocUnsafe=function(t){return c(null,t)},h.allocUnsafeSlow=function(t){return c(null,t)},h.isBuffer=function t(e){return!(null==e||!e._isBuffer)},h.compare=function t(e,r){if(!h.isBuffer(e)||!h.isBuffer(r))throw new TypeError("Arguments must be Buffers");if(e===r)return 0;for(var i=e.length,n=r.length,o=0,s=Math.min(i,n);o<s;++o)if(e[o]!==r[o]){i=e[o],n=r[o];break}return i<n?-1:n<i?1:0},h.isEncoding=function t(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}},h.concat=function t(e,r){if(!o(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return h.alloc(0);var i;if(void 0===r)for(r=0,i=0;i<e.length;++i)r+=e[i].length;var n=h.allocUnsafe(r),s=0;for(i=0;i<e.length;++i){var a=e[i];if(!h.isBuffer(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(n,s),s+=a.length}return n},h.byteLength=p,h.prototype._isBuffer=!0,h.prototype.swap16=function t(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var r=0;r<e;r+=2)g(this,r,r+1);return this},h.prototype.swap32=function t(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var r=0;r<e;r+=4)g(this,r,r+3),g(this,r+1,r+2);return this},h.prototype.swap64=function t(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var r=0;r<e;r+=8)g(this,r,r+7),g(this,r+1,r+6),g(this,r+2,r+5),g(this,r+3,r+4);return this},h.prototype.toString=function t(){var e=0|this.length;return 0===e?"":0===arguments.length?R(this,0,e):m.apply(this,arguments)},h.prototype.equals=function t(e){if(!h.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===h.compare(this,e)},h.prototype.inspect=function t(){var r="",i=e.INSPECT_MAX_BYTES;return this.length>0&&(r=this.toString("hex",0,i).match(/.{2}/g).join(" "),this.length>i&&(r+=" ... ")),"<Buffer "+r+">"},h.prototype.compare=function t(e,r,i,n,o){if(!h.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===r&&(r=0),void 0===i&&(i=e?e.length:0),void 0===n&&(n=0),void 0===o&&(o=this.length),r<0||i>e.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&r>=i)return 0;if(n>=o)return-1;if(r>=i)return 1;if(this===e)return 0;for(var s=(o>>>=0)-(n>>>=0),a=(i>>>=0)-(r>>>=0),u=Math.min(s,a),f=this.slice(n,o),c=e.slice(r,i),l=0;l<u;++l)if(f[l]!==c[l]){s=f[l],a=c[l];break}return s<a?-1:a<s?1:0},h.prototype.includes=function t(e,r,i){return-1!==this.indexOf(e,r,i)},h.prototype.indexOf=function t(e,r,i){return v(this,e,r,i,!0)},h.prototype.lastIndexOf=function t(e,r,i){return v(this,e,r,i,!1)},h.prototype.write=function t(e,r,i,n){if(void 0===r)n="utf8",i=this.length,r=0;else if(void 0===i&&"string"==typeof r)n=r,i=this.length,r=0;else{if(!isFinite(r))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");r|=0,isFinite(i)?(i|=0,void 0===n&&(n="utf8")):(n=i,i=void 0)}var o=this.length-r;if((void 0===i||i>o)&&(i=o),e.length>0&&(i<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var s=!1;;)switch(n){case"hex":return y(this,e,r,i);case"utf8":case"utf-8":return w(this,e,r,i);case"ascii":return _(this,e,r,i);case"latin1":case"binary":return M(this,e,r,i);case"base64":return S(this,e,r,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return k(this,e,r,i);default:if(s)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),s=!0}},h.prototype.toJSON=function t(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var T=4096;function P(t,e,r){var i="";r=Math.min(t.length,r);for(var n=e;n<r;++n)i+=String.fromCharCode(127&t[n]);return i}function I(t,e,r){var i="";r=Math.min(t.length,r);for(var n=e;n<r;++n)i+=String.fromCharCode(t[n]);return i}function L(t,e,r){var i=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>i)&&(r=i);for(var n="",o=e;o<r;++o)n+=F(t[o]);return n}function O(t,e,r){for(var i=t.slice(e,r),n="",o=0;o<i.length;o+=2)n+=String.fromCharCode(i[o]+256*i[o+1]);return n}function B(t,e,r){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function j(t,e,r,i,n,o){if(!h.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>n||e<o)throw new RangeError('"value" argument is out of bounds');if(r+i>t.length)throw new RangeError("Index out of range")}function C(t,e,r,i){e<0&&(e=65535+e+1);for(var n=0,o=Math.min(t.length-r,2);n<o;++n)t[r+n]=(e&255<<8*(i?n:1-n))>>>8*(i?n:1-n)}function U(t,e,r,i){e<0&&(e=4294967295+e+1);for(var n=0,o=Math.min(t.length-r,4);n<o;++n)t[r+n]=e>>>8*(i?n:3-n)&255}function N(t,e,r,i,n,o){if(r+i>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function q(t,e,r,i,o){return o||N(t,0,r,4),n.write(t,e,r,i,23,4),r+4}function D(t,e,r,i,o){return o||N(t,0,r,8),n.write(t,e,r,i,52,8),r+8}h.prototype.slice=function t(e,r){var i,n=this.length;if((e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(r=void 0===r?n:~~r)<0?(r+=n)<0&&(r=0):r>n&&(r=n),r<e&&(r=e),h.TYPED_ARRAY_SUPPORT)(i=this.subarray(e,r)).__proto__=h.prototype;else{var o=r-e;i=new h(o,void 0);for(var s=0;s<o;++s)i[s]=this[s+e]}return i},h.prototype.readUIntLE=function t(e,r,i){e|=0,r|=0,i||B(e,r,this.length);for(var n=this[e],o=1,s=0;++s<r&&(o*=256);)n+=this[e+s]*o;return n},h.prototype.readUIntBE=function t(e,r,i){e|=0,r|=0,i||B(e,r,this.length);for(var n=this[e+--r],o=1;r>0&&(o*=256);)n+=this[e+--r]*o;return n},h.prototype.readUInt8=function t(e,r){return r||B(e,1,this.length),this[e]},h.prototype.readUInt16LE=function t(e,r){return r||B(e,2,this.length),this[e]|this[e+1]<<8},h.prototype.readUInt16BE=function t(e,r){return r||B(e,2,this.length),this[e]<<8|this[e+1]},h.prototype.readUInt32LE=function t(e,r){return r||B(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},h.prototype.readUInt32BE=function t(e,r){return r||B(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},h.prototype.readIntLE=function t(e,r,i){e|=0,r|=0,i||B(e,r,this.length);for(var n=this[e],o=1,s=0;++s<r&&(o*=256);)n+=this[e+s]*o;return n>=(o*=128)&&(n-=Math.pow(2,8*r)),n},h.prototype.readIntBE=function t(e,r,i){e|=0,r|=0,i||B(e,r,this.length);for(var n=r,o=1,s=this[e+--n];n>0&&(o*=256);)s+=this[e+--n]*o;return s>=(o*=128)&&(s-=Math.pow(2,8*r)),s},h.prototype.readInt8=function t(e,r){return r||B(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},h.prototype.readInt16LE=function t(e,r){r||B(e,2,this.length);var i=this[e]|this[e+1]<<8;return 32768&i?4294901760|i:i},h.prototype.readInt16BE=function t(e,r){r||B(e,2,this.length);var i=this[e+1]|this[e]<<8;return 32768&i?4294901760|i:i},h.prototype.readInt32LE=function t(e,r){return r||B(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},h.prototype.readInt32BE=function t(e,r){return r||B(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},h.prototype.readFloatLE=function t(e,r){return r||B(e,4,this.length),n.read(this,e,!0,23,4)},h.prototype.readFloatBE=function t(e,r){return r||B(e,4,this.length),n.read(this,e,!1,23,4)},h.prototype.readDoubleLE=function t(e,r){return r||B(e,8,this.length),n.read(this,e,!0,52,8)},h.prototype.readDoubleBE=function t(e,r){return r||B(e,8,this.length),n.read(this,e,!1,52,8)},h.prototype.writeUIntLE=function t(e,r,i,n){(e=+e,r|=0,i|=0,n)||j(this,e,r,i,Math.pow(2,8*i)-1,0);var o=1,s=0;for(this[r]=255&e;++s<i&&(o*=256);)this[r+s]=e/o&255;return r+i},h.prototype.writeUIntBE=function t(e,r,i,n){(e=+e,r|=0,i|=0,n)||j(this,e,r,i,Math.pow(2,8*i)-1,0);var o=i-1,s=1;for(this[r+o]=255&e;--o>=0&&(s*=256);)this[r+o]=e/s&255;return r+i},h.prototype.writeUInt8=function t(e,r,i){return e=+e,r|=0,i||j(this,e,r,1,255,0),h.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[r]=255&e,r+1},h.prototype.writeUInt16LE=function t(e,r,i){return e=+e,r|=0,i||j(this,e,r,2,65535,0),h.TYPED_ARRAY_SUPPORT?(this[r]=255&e,this[r+1]=e>>>8):C(this,e,r,!0),r+2},h.prototype.writeUInt16BE=function t(e,r,i){return e=+e,r|=0,i||j(this,e,r,2,65535,0),h.TYPED_ARRAY_SUPPORT?(this[r]=e>>>8,this[r+1]=255&e):C(this,e,r,!1),r+2},h.prototype.writeUInt32LE=function t(e,r,i){return e=+e,r|=0,i||j(this,e,r,4,4294967295,0),h.TYPED_ARRAY_SUPPORT?(this[r+3]=e>>>24,this[r+2]=e>>>16,this[r+1]=e>>>8,this[r]=255&e):U(this,e,r,!0),r+4},h.prototype.writeUInt32BE=function t(e,r,i){return e=+e,r|=0,i||j(this,e,r,4,4294967295,0),h.TYPED_ARRAY_SUPPORT?(this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=255&e):U(this,e,r,!1),r+4},h.prototype.writeIntLE=function t(e,r,i,n){if(e=+e,r|=0,!n){var o=Math.pow(2,8*i-1);j(this,e,r,i,o-1,-o)}var s=0,a=1,h=0;for(this[r]=255&e;++s<i&&(a*=256);)e<0&&0===h&&0!==this[r+s-1]&&(h=1),this[r+s]=(e/a>>0)-h&255;return r+i},h.prototype.writeIntBE=function t(e,r,i,n){if(e=+e,r|=0,!n){var o=Math.pow(2,8*i-1);j(this,e,r,i,o-1,-o)}var s=i-1,a=1,h=0;for(this[r+s]=255&e;--s>=0&&(a*=256);)e<0&&0===h&&0!==this[r+s+1]&&(h=1),this[r+s]=(e/a>>0)-h&255;return r+i},h.prototype.writeInt8=function t(e,r,i){return e=+e,r|=0,i||j(this,e,r,1,127,-128),h.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[r]=255&e,r+1},h.prototype.writeInt16LE=function t(e,r,i){return e=+e,r|=0,i||j(this,e,r,2,32767,-32768),h.TYPED_ARRAY_SUPPORT?(this[r]=255&e,this[r+1]=e>>>8):C(this,e,r,!0),r+2},h.prototype.writeInt16BE=function t(e,r,i){return e=+e,r|=0,i||j(this,e,r,2,32767,-32768),h.TYPED_ARRAY_SUPPORT?(this[r]=e>>>8,this[r+1]=255&e):C(this,e,r,!1),r+2},h.prototype.writeInt32LE=function t(e,r,i){return e=+e,r|=0,i||j(this,e,r,4,2147483647,-2147483648),h.TYPED_ARRAY_SUPPORT?(this[r]=255&e,this[r+1]=e>>>8,this[r+2]=e>>>16,this[r+3]=e>>>24):U(this,e,r,!0),r+4},h.prototype.writeInt32BE=function t(e,r,i){return e=+e,r|=0,i||j(this,e,r,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),h.TYPED_ARRAY_SUPPORT?(this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=255&e):U(this,e,r,!1),r+4},h.prototype.writeFloatLE=function t(e,r,i){return q(this,e,r,!0,i)},h.prototype.writeFloatBE=function t(e,r,i){return q(this,e,r,!1,i)},h.prototype.writeDoubleLE=function t(e,r,i){return D(this,e,r,!0,i)},h.prototype.writeDoubleBE=function t(e,r,i){return D(this,e,r,!1,i)},h.prototype.copy=function t(e,r,i,n){if(i||(i=0),n||0===n||(n=this.length),r>=e.length&&(r=e.length),r||(r=0),n>0&&n<i&&(n=i),n===i)return 0;if(0===e.length||0===this.length)return 0;if(r<0)throw new RangeError("targetStart out of bounds");if(i<0||i>=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-r<n-i&&(n=e.length-r+i);var o,s=n-i;if(this===e&&i<r&&r<n)for(o=s-1;o>=0;--o)e[o+r]=this[o+i];else if(s<1e3||!h.TYPED_ARRAY_SUPPORT)for(o=0;o<s;++o)e[o+r]=this[o+i];else Uint8Array.prototype.set.call(e,this.subarray(i,i+s),r);return s},h.prototype.fill=function t(e,r,i,n){if("string"==typeof e){if("string"==typeof r?(n=r,r=0,i=this.length):"string"==typeof i&&(n=i,i=this.length),1===e.length){var o=e.charCodeAt(0);o<256&&(e=o)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!h.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof e&&(e&=255);if(r<0||this.length<r||this.length<i)throw new RangeError("Out of range index");if(i<=r)return this;var s;if(r>>>=0,i=void 0===i?this.length:i>>>0,e||(e=0),"number"==typeof e)for(s=r;s<i;++s)this[s]=e;else{var a=h.isBuffer(e)?e:W(new h(e,n).toString()),u=a.length;for(s=0;s<i-r;++s)this[s+r]=a[s%u]}return this};var z=/[^+\/0-9A-Za-z-_]/g;function F(t){return t<16?"0"+t.toString(16):t.toString(16)}function W(t,e){var r;e=e||1/0;for(var i=t.length,n=null,o=[],s=0;s<i;++s){if((r=t.charCodeAt(s))>55295&&r<57344){if(!n){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(s+1===i){(e-=3)>-1&&o.push(239,191,189);continue}n=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),n=r;continue}r=65536+(n-55296<<10|r-56320)}else n&&(e-=3)>-1&&o.push(239,191,189);if(n=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function H(t){return i.toByteArray(function e(t){if((t=function e(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(z,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function K(t,e,r,i){for(var n=0;n<i&&!(n+r>=e.length||n>=t.length);++n)e[n+r]=t[n];return n}}).call(this,r(5))},function(t,e,r){"use strict";var i=r(61),n=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e};t.exports=c;var o=Object.create(r(44));o.inherits=r(1);var s=r(152),a=r(94);o.inherits(c,s);for(var h=n(a.prototype),u=0;u<h.length;u++){var f=h[u];c.prototype[f]||(c.prototype[f]=a.prototype[f])}function c(t){if(!(this instanceof c))return new c(t);s.call(this,t),a.call(this,t),t&&!1===t.readable&&(this.readable=!1),t&&!1===t.writable&&(this.writable=!1),this.allowHalfOpen=!0,t&&!1===t.allowHalfOpen&&(this.allowHalfOpen=!1),this.once("end",l)}function l(){this.allowHalfOpen||this._writableState.ended||i.nextTick(d,this)}function d(t){t.end()}Object.defineProperty(c.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(c.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed&&this._writableState.destroyed)},set:function(t){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=t,this._writableState.destroyed=t)}}),c.prototype._destroy=function(t,e){this.push(null),this.end(),i.nextTick(e,t)}},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e,r){var i=r(3),n=r(18),o=r(12),s=r(72),a=r(73),h=r(51),u=h.get,f=h.enforce,c=String(String).split("String");(t.exports=function(t,e,r,a){var h,u=!!a&&!!a.unsafe,l=!!a&&!!a.enumerable,d=!!a&&!!a.noTargetGet;"function"==typeof r&&("string"!=typeof e||o(r,"name")||n(r,"name",e),(h=f(r)).source||(h.source=c.join("string"==typeof e?e:""))),t!==i?(u?!d&&t[e]&&(l=!0):delete t[e],l?t[e]=r:n(t,e,r)):l?t[e]=r:s(e,r)})(Function.prototype,"toString",(function t(){return"function"==typeof this&&u(this).source||a(this)}))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.MetadataService=void 0;var i=function(){function t(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,r,i){return r&&t(e.prototype,r),i&&t(e,i),e}}(),n=r(0),o=r(87);function s(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var a=".well-known/openid-configuration";e.MetadataService=function(){function t(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o.JsonService;if(s(this,t),!e)throw n.Log.error("MetadataService: No settings passed to MetadataService"),new Error("settings");this._settings=e,this._jsonService=new r(["application/jwk-set+json"])}return t.prototype.resetSigningKeys=function t(){this._settings=this._settings||{},this._settings.signingKeys=void 0},t.prototype.getMetadata=function t(){var e=this;return this._settings.metadata?(n.Log.debug("MetadataService.getMetadata: Returning metadata from settings"),Promise.resolve(this._settings.metadata)):this.metadataUrl?(n.Log.debug("MetadataService.getMetadata: getting metadata from",this.metadataUrl),this._jsonService.getJson(this.metadataUrl).then((function(t){n.Log.debug("MetadataService.getMetadata: json received");var r=e._settings.metadataSeed||{};return e._settings.metadata=Object.assign({},r,t),e._settings.metadata}))):(n.Log.error("MetadataService.getMetadata: No authority or metadataUrl configured on settings"),Promise.reject(new Error("No authority or metadataUrl configured on settings")))},t.prototype.getIssuer=function t(){return this._getMetadataProperty("issuer")},t.prototype.getAuthorizationEndpoint=function t(){return this._getMetadataProperty("authorization_endpoint")},t.prototype.getUserInfoEndpoint=function t(){return this._getMetadataProperty("userinfo_endpoint")},t.prototype.getTokenEndpoint=function t(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this._getMetadataProperty("token_endpoint",e)},t.prototype.getCheckSessionIframe=function t(){return this._getMetadataProperty("check_session_iframe",!0)},t.prototype.getEndSessionEndpoint=function t(){return this._getMetadataProperty("end_session_endpoint",!0)},t.prototype.getRevocationEndpoint=function t(){return this._getMetadataProperty("revocation_endpoint",!0)},t.prototype.getKeysEndpoint=function t(){return this._getMetadataProperty("jwks_uri",!0)},t.prototype._getMetadataProperty=function t(e){var r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return n.Log.debug("MetadataService.getMetadataProperty for: "+e),this.getMetadata().then((function(t){if(n.Log.debug("MetadataService.getMetadataProperty: metadata recieved"),void 0===t[e]){if(!0===r)return void n.Log.warn("MetadataService.getMetadataProperty: Metadata does not contain optional property "+e);throw n.Log.error("MetadataService.getMetadataProperty: Metadata does not contain property "+e),new Error("Metadata does not contain property "+e)}return t[e]}))},t.prototype.getSigningKeys=function t(){var e=this;return this._settings.signingKeys?(n.Log.debug("MetadataService.getSigningKeys: Returning signingKeys from settings"),Promise.resolve(this._settings.signingKeys)):this._getMetadataProperty("jwks_uri").then((function(t){return n.Log.debug("MetadataService.getSigningKeys: jwks_uri received",t),e._jsonService.getJson(t).then((function(t){if(n.Log.debug("MetadataService.getSigningKeys: key set received",t),!t.keys)throw n.Log.error("MetadataService.getSigningKeys: Missing keys on keyset"),new Error("Missing keys on keyset");return e._settings.signingKeys=t.keys,e._settings.signingKeys}))}))},i(t,[{key:"metadataUrl",get:function t(){return this._metadataUrl||(this._settings.metadataUrl?this._metadataUrl=this._settings.metadataUrl:(this._metadataUrl=this._settings.authority,this._metadataUrl&&this._metadataUrl.indexOf(a)<0&&("/"!==this._metadataUrl[this._metadataUrl.length-1]&&(this._metadataUrl+="/"),this._metadataUrl+=a))),this._metadataUrl}}]),t}()},function(t,e,r){"use strict";(function(e,i){var n=65536,o=4294967295;var s=r(2).Buffer,a=e.crypto||e.msCrypto;a&&a.getRandomValues?t.exports=function h(t,e){if(t>o)throw new RangeError("requested too many random bytes");var r=s.allocUnsafe(t);if(t>0)if(t>n)for(var h=0;h<t;h+=n)a.getRandomValues(r.slice(h,h+n));else a.getRandomValues(r);if("function"==typeof e)return i.nextTick((function(){e(null,r)}));return r}:t.exports=function u(){throw new Error("Secure random number generation is not supported by this browser.\nUse Chrome, Firefox or Internet Explorer 11")}}).call(this,r(5),r(4))},function(t,e,r){"use strict";var i={};function n(t,e,r){r||(r=Error);var n=function(t){function r(r,i,n){return t.call(this,function o(t,r,i){return"string"==typeof e?e:e(t,r,i)}(r,i,n))||this}return function i(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}(r,t),r}(r);n.prototype.name=r.name,n.prototype.code=t,i[t]=n}function o(t,e){if(Array.isArray(t)){var r=t.length;return t=t.map((function(t){return String(t)})),r>2?"one of ".concat(e," ").concat(t.slice(0,r-1).join(", "),", or ")+t[r-1]:2===r?"one of ".concat(e," ").concat(t[0]," or ").concat(t[1]):"of ".concat(e," ").concat(t[0])}return"of ".concat(e," ").concat(String(t))}n("ERR_INVALID_OPT_VALUE",(function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'}),TypeError),n("ERR_INVALID_ARG_TYPE",(function(t,e,r){var i,n;if("string"==typeof e&&function s(t,e,r){return t.substr(!r||r<0?0:+r,e.length)===e}(e,"not ")?(i="must not be",e=e.replace(/^not /,"")):i="must be",function a(t,e,r){return(void 0===r||r>t.length)&&(r=t.length),t.substring(r-e.length,r)===e}(t," argument"))n="The ".concat(t," ").concat(i," ").concat(o(e,"type"));else{var h=function u(t,e,r){return"number"!=typeof r&&(r=0),!(r+e.length>t.length)&&-1!==t.indexOf(e,r)}(t,".")?"property":"argument";n='The "'.concat(t,'" ').concat(h," ").concat(i," ").concat(o(e,"type"))}return n+=". Received type ".concat(typeof r)}),TypeError),n("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),n("ERR_METHOD_NOT_IMPLEMENTED",(function(t){return"The "+t+" method is not implemented"})),n("ERR_STREAM_PREMATURE_CLOSE","Premature close"),n("ERR_STREAM_DESTROYED",(function(t){return"Cannot call "+t+" after a stream was destroyed"})),n("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),n("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),n("ERR_STREAM_WRITE_AFTER_END","write after end"),n("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),n("ERR_UNKNOWN_ENCODING",(function(t){return"Unknown encoding: "+t}),TypeError),n("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),t.exports.codes=i},function(t,e){"function"==typeof Object.create?t.exports=function t(e,r){r&&(e.super_=r,e.prototype=Object.create(r.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function t(e,r){if(r){e.super_=r;var i=function(){};i.prototype=r.prototype,e.prototype=new i,e.prototype.constructor=e}}},function(t,e,r){"use strict";(function(e){var i=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e};t.exports=u;var n=r(144),o=r(148);r(33)(u,n);for(var s=i(o.prototype),a=0;a<s.length;a++){var h=s[a];u.prototype[h]||(u.prototype[h]=o.prototype[h])}function u(t){if(!(this instanceof u))return new u(t);n.call(this,t),o.call(this,t),this.allowHalfOpen=!0,t&&(!1===t.readable&&(this.readable=!1),!1===t.writable&&(this.writable=!1),!1===t.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",f)))}function f(){this._writableState.ended||e.nextTick(c,this)}function c(t){t.end()}Object.defineProperty(u.prototype,"writableHighWaterMark",{enumerable:!1,get:function t(){return this._writableState.highWaterMark}}),Object.defineProperty(u.prototype,"writableBuffer",{enumerable:!1,get:function t(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(u.prototype,"writableLength",{enumerable:!1,get:function t(){return this._writableState.length}}),Object.defineProperty(u.prototype,"destroyed",{enumerable:!1,get:function t(){return void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed&&this._writableState.destroyed)},set:function t(e){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}})}).call(this,r(4))},function(t,e,r){var i=r(2).Buffer;function n(t,e){this._block=i.alloc(t),this._finalSize=e,this._blockSize=t,this._len=0}n.prototype.update=function(t,e){"string"==typeof t&&(e=e||"utf8",t=i.from(t,e));for(var r=this._block,n=this._blockSize,o=t.length,s=this._len,a=0;a<o;){for(var h=s%n,u=Math.min(o-a,n-h),f=0;f<u;f++)r[h+f]=t[a+f];a+=u,(s+=u)%n==0&&this._update(r)}return this._len+=o,this},n.prototype.digest=function(t){var e=this._len%this._blockSize;this._block[e]=128,this._block.fill(0,e+1),e>=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 i=(4294967295&r)>>>0,n=(r-i)/4294967296;this._block.writeUInt32BE(n,this._blockSize-8),this._block.writeUInt32BE(i,this._blockSize-4)}this._update(this._block);var o=this._hash();return t?o.toString(t):o},n.prototype._update=function(){throw new Error("_update must be implemented by subclass")},t.exports=n},function(t,e,r){"use strict";var i={};function n(t,e,r){r||(r=Error);var n=function(t){function r(r,i,n){return t.call(this,function o(t,r,i){return"string"==typeof e?e:e(t,r,i)}(r,i,n))||this}return function i(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}(r,t),r}(r);n.prototype.name=r.name,n.prototype.code=t,i[t]=n}function o(t,e){if(Array.isArray(t)){var r=t.length;return t=t.map((function(t){return String(t)})),r>2?"one of ".concat(e," ").concat(t.slice(0,r-1).join(", "),", or ")+t[r-1]:2===r?"one of ".concat(e," ").concat(t[0]," or ").concat(t[1]):"of ".concat(e," ").concat(t[0])}return"of ".concat(e," ").concat(String(t))}n("ERR_INVALID_OPT_VALUE",(function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'}),TypeError),n("ERR_INVALID_ARG_TYPE",(function(t,e,r){var i,n;if("string"==typeof e&&function s(t,e,r){return t.substr(!r||r<0?0:+r,e.length)===e}(e,"not ")?(i="must not be",e=e.replace(/^not /,"")):i="must be",function a(t,e,r){return(void 0===r||r>t.length)&&(r=t.length),t.substring(r-e.length,r)===e}(t," argument"))n="The ".concat(t," ").concat(i," ").concat(o(e,"type"));else{var h=function u(t,e,r){return"number"!=typeof r&&(r=0),!(r+e.length>t.length)&&-1!==t.indexOf(e,r)}(t,".")?"property":"argument";n='The "'.concat(t,'" ').concat(h," ").concat(i," ").concat(o(e,"type"))}return n+=". Received type ".concat(typeof r)}),TypeError),n("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),n("ERR_METHOD_NOT_IMPLEMENTED",(function(t){return"The "+t+" method is not implemented"})),n("ERR_STREAM_PREMATURE_CLOSE","Premature close"),n("ERR_STREAM_DESTROYED",(function(t){return"Cannot call "+t+" after a stream was destroyed"})),n("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),n("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),n("ERR_STREAM_WRITE_AFTER_END","write after end"),n("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),n("ERR_UNKNOWN_ENCODING",(function(t){return"Unknown encoding: "+t}),TypeError),n("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),t.exports.codes=i},function(t,e){"function"==typeof Object.create?t.exports=function t(e,r){r&&(e.super_=r,e.prototype=Object.create(r.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function t(e,r){if(r){e.super_=r;var i=function(){};i.prototype=r.prototype,e.prototype=new i,e.prototype.constructor=e}}},function(t,e,r){"use strict";(function(e){var i=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e};t.exports=u;var n=r(176),o=r(180);r(37)(u,n);for(var s=i(o.prototype),a=0;a<s.length;a++){var h=s[a];u.prototype[h]||(u.prototype[h]=o.prototype[h])}function u(t){if(!(this instanceof u))return new u(t);n.call(this,t),o.call(this,t),this.allowHalfOpen=!0,t&&(!1===t.readable&&(this.readable=!1),!1===t.writable&&(this.writable=!1),!1===t.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",f)))}function f(){this._writableState.ended||e.nextTick(c,this)}function c(t){t.end()}Object.defineProperty(u.prototype,"writableHighWaterMark",{enumerable:!1,get:function t(){return this._writableState.highWaterMark}}),Object.defineProperty(u.prototype,"writableBuffer",{enumerable:!1,get:function t(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(u.prototype,"writableLength",{enumerable:!1,get:function t(){return this._writableState.length}}),Object.defineProperty(u.prototype,"destroyed",{enumerable:!1,get:function t(){return void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed&&this._writableState.destroyed)},set:function t(e){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}})}).call(this,r(4))},function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},function(t,e){t.exports=!1},function(t,e){t.exports={}},function(t,e,r){"use strict";var i=r(23),n=function(t){var e,r;this.promise=new t((function(t,i){if(void 0!==e||void 0!==r)throw TypeError("Bad Promise constructor");e=t,r=i})),this.resolve=i(e),this.reject=i(r)};t.exports.f=function(t){return new n(t)}},function(t,e,r){"use strict";var i=r(1),n=r(88),o=r(91),s=r(92),a=r(20);function h(t){a.call(this,"digest"),this._hash=t}i(h,a),h.prototype._update=function(t){this._hash.update(t)},h.prototype._final=function(){return this._hash.digest()},t.exports=function t(e){return"md5"===(e=e.toLowerCase())?new n:"rmd160"===e||"ripemd160"===e?new o:new h(s(e))}},function(t,e,r){(function(t){function r(t){return Object.prototype.toString.call(t)}e.isArray=function i(t){return Array.isArray?Array.isArray(t):"[object Array]"===r(t)},e.isBoolean=function n(t){return"boolean"==typeof t},e.isNull=function o(t){return null===t},e.isNullOrUndefined=function s(t){return null==t},e.isNumber=function a(t){return"number"==typeof t},e.isString=function h(t){return"string"==typeof t},e.isSymbol=function u(t){return"symbol"==typeof t},e.isUndefined=function f(t){return void 0===t},e.isRegExp=function c(t){return"[object RegExp]"===r(t)},e.isObject=function l(t){return"object"==typeof t&&null!==t},e.isDate=function d(t){return"[object Date]"===r(t)},e.isError=function p(t){return"[object Error]"===r(t)||t instanceof Error},e.isFunction=function m(t){return"function"==typeof t},e.isPrimitive=function g(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||void 0===t},e.isBuffer=t.isBuffer}).call(this,r(26).Buffer)},function(t,e,r){(function(e){t.exports=function t(r,i){for(var n=Math.min(r.length,i.length),o=new e(n),s=0;s<n;++s)o[s]=r[s]^i[s];return o}}).call(this,r(26).Buffer)},function(t,e,r){"use strict";var i=r(13),n=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}e.BlockHash=o,o.prototype.update=function t(e,r){if(e=i.toArray(e,r),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){var n=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-n,e.length),0===this.pending.length&&(this.pending=null),e=i.join32(e,0,e.length-n,this.endian);for(var o=0;o<e.length;o+=this._delta32)this._update(e,o,o+this._delta32)}return this},o.prototype.digest=function t(e){return this.update(this._pad()),n(null===this.pending),this._digest(e)},o.prototype._pad=function t(){var e=this.pendingTotal,r=this._delta8,i=r-(e+this.padLength)%r,n=new Array(i+this.padLength);n[0]=128;for(var o=1;o<i;o++)n[o]=0;if(e<<=3,"big"===this.endian){for(var s=8;s<this.padLength;s++)n[o++]=0;n[o++]=0,n[o++]=0,n[o++]=0,n[o++]=0,n[o++]=e>>>24&255,n[o++]=e>>>16&255,n[o++]=e>>>8&255,n[o++]=255&e}else for(n[o++]=255&e,n[o++]=e>>>8&255,n[o++]=e>>>16&255,n[o++]=e>>>24&255,n[o++]=0,n[o++]=0,n[o++]=0,n[o++]=0,s=8;s<this.padLength;s++)n[o++]=0;return n}},function(t,e,r){"use strict";const i=r(1),n=r(109).Reporter,o=r(107).Buffer;function s(t,e){n.call(this,e),o.isBuffer(t)?(this.base=t,this.offset=0,this.length=t.length):this.error("Input not Buffer")}function a(t,e){if(Array.isArray(t))this.length=0,this.value=t.map((function(t){return a.isEncoderBuffer(t)||(t=new a(t,e)),this.length+=t.length,t}),this);else if("number"==typeof t){if(!(0<=t&&t<=255))return e.error("non-byte EncoderBuffer value");this.value=t,this.length=1}else if("string"==typeof t)this.value=t,this.length=o.byteLength(t);else{if(!o.isBuffer(t))return e.error("Unsupported type: "+typeof t);this.value=t,this.length=t.length}}i(s,n),e.DecoderBuffer=s,s.isDecoderBuffer=function t(e){if(e instanceof s)return!0;return"object"==typeof e&&o.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 t(){return{offset:this.offset,reporter:n.prototype.save.call(this)}},s.prototype.restore=function t(e){const r=new s(this.base);return r.offset=e.offset,r.length=this.offset,this.offset=e.offset,n.prototype.restore.call(this,e.reporter),r},s.prototype.isEmpty=function t(){return this.offset===this.length},s.prototype.readUInt8=function t(e){return this.offset+1<=this.length?this.base.readUInt8(this.offset++,!0):this.error(e||"DecoderBuffer overrun")},s.prototype.skip=function t(e,r){if(!(this.offset+e<=this.length))return this.error(r||"DecoderBuffer overrun");const i=new s(this.base);return i._reporterState=this._reporterState,i.offset=this.offset,i.length=this.offset+e,this.offset+=e,i},s.prototype.raw=function t(e){return this.base.slice(e?e.offset:this.offset,this.length)},e.EncoderBuffer=a,a.isEncoderBuffer=function t(e){if(e instanceof a)return!0;return"object"==typeof e&&"EncoderBuffer"===e.constructor.name&&"number"==typeof e.length&&"function"==typeof e.join},a.prototype.join=function t(e,r){return e||(e=o.alloc(this.length)),r||(r=0),0===this.length||(Array.isArray(this.value)?this.value.forEach((function(t){t.join(e,r),r+=t.length})):("number"==typeof this.value?e[r]=this.value:"string"==typeof this.value?e.write(this.value,r):o.isBuffer(this.value)&&this.value.copy(e,r),r+=this.length)),e}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.UrlUtility=void 0;var i=r(0),n=r(19);e.UrlUtility=function(){function t(){!function e(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}(this,t)}return t.addQueryParam=function t(e,r,i){return e.indexOf("?")<0&&(e+="?"),"?"!==e[e.length-1]&&(e+="&"),e+=encodeURIComponent(r),e+="=",e+=encodeURIComponent(i)},t.parseUrlFragment=function t(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"#",o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:n.Global;"string"!=typeof e&&(e=o.location.href);var s=e.lastIndexOf(r);s>=0&&(e=e.substr(s+1)),"?"===r&&(s=e.indexOf("#"))>=0&&(e=e.substr(0,s));for(var a,h={},u=/([^&=]+)=([^&]*)/g,f=0;a=u.exec(e);)if(h[decodeURIComponent(a[1])]=decodeURIComponent(a[2].replace(/\+/g," ")),f++>50)return i.Log.error("UrlUtility.parseUrlFragment: response exceeded expected number of parameters",e),{error:"Response exceeded expected number of parameters"};for(var c in h)return h;return{}},t}()},function(t,e,r){var i=r(68),n=r(69);t.exports=function(t){return i(n(t))}},function(t,e){var r={}.toString;t.exports=function(t){return r.call(t).slice(8,-1)}},function(t,e,r){var i,n,o,s=r(212),a=r(3),h=r(14),u=r(18),f=r(12),c=r(74),l=r(75),d=r(76),p=a.WeakMap;if(s){var m=c.state||(c.state=new p),g=m.get,v=m.has,b=m.set;i=function(t,e){return e.facade=t,b.call(m,t,e),e},n=function(t){return g.call(m,t)||{}},o=function(t){return v.call(m,t)}}else{var y=l("state");d[y]=!0,i=function(t,e){return e.facade=t,u(t,y,e),e},n=function(t){return f(t,y)?t[y]:{}},o=function(t){return f(t,y)}}t.exports={set:i,get:n,has:o,enforce:function(t){return o(t)?n(t):i(t,{})},getterFor:function(t){return function(e){var r;if(!h(e)||(r=n(e)).type!==t)throw TypeError("Incompatible receiver, "+t+" required");return r}}}},function(t,e,r){var i=r(3);t.exports=i},function(t,e,r){var i=r(54),n=Math.min;t.exports=function(t){return t>0?n(i(t),9007199254740991):0}},function(t,e){var r=Math.ceil,i=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?i:r)(t)}},function(t,e,r){var i=r(69);t.exports=function(t){return Object(i(t))}},function(t,e,r){var i=r(15),n=r(220),o=r(53),s=r(57),a=r(222),h=r(223),u=function(t,e){this.stopped=t,this.result=e};t.exports=function(t,e,r){var f,c,l,d,p,m,g,v=r&&r.that,b=!(!r||!r.AS_ENTRIES),y=!(!r||!r.IS_ITERATOR),w=!(!r||!r.INTERRUPTED),_=s(e,v,1+b+w),M=function(t){return f&&h(f),new u(!0,t)},S=function(t){return b?(i(t),w?_(t[0],t[1],M):_(t[0],t[1])):w?_(t,M):_(t)};if(y)f=t;else{if("function"!=typeof(c=a(t)))throw TypeError("Target is not iterable");if(n(c)){for(l=0,d=o(t.length);d>l;l++)if((p=S(t[l]))&&p instanceof u)return p;return new u(!1)}f=c.call(t)}for(m=f.next;!(g=m.call(f)).done;){try{p=S(g.value)}catch(t){throw h(f),t}if("object"==typeof p&&p&&p instanceof u)return p}return new u(!1)}},function(t,e,r){var i=r(23);t.exports=function(t,e,r){if(i(t),void 0===e)return t;switch(r){case 0:return function(){return t.call(e)};case 1:return function(r){return t.call(e,r)};case 2:return function(r,i){return t.call(e,r,i)};case 3:return function(r,i,n){return t.call(e,r,i,n)}}return function(){return t.apply(e,arguments)}}},function(t,e){t.exports=function(t){try{return{error:!1,value:t()}}catch(t){return{error:!0,value:t}}}},function(t,e,r){var i=r(3),n=r(57),o=Function.call;t.exports=function(t,e,r){return n(o,i[t].prototype[e],r)}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.JoseUtil=void 0;var i=r(272),n=function o(t){return t&&t.__esModule?t:{default:t}}(r(378));e.JoseUtil=(0,n.default)({jws:i.jws,KeyUtil:i.KeyUtil,X509:i.X509,crypto:i.crypto,hextob64u:i.hextob64u,b64tohex:i.b64tohex,AllowedSigningAlgs:i.AllowedSigningAlgs})},function(t,e,r){"use strict";(function(e){!e.version||0===e.version.indexOf("v0.")||0===e.version.indexOf("v1.")&&0!==e.version.indexOf("v1.8.")?t.exports={nextTick:function r(t,i,n,o){if("function"!=typeof t)throw new TypeError('"callback" argument must be a function');var s,a,h=arguments.length;switch(h){case 0:case 1:return e.nextTick(t);case 2:return e.nextTick((function e(){t.call(null,i)}));case 3:return e.nextTick((function e(){t.call(null,i,n)}));case 4:return e.nextTick((function e(){t.call(null,i,n,o)}));default:for(s=new Array(h-1),a=0;a<s.length;)s[a++]=arguments[a];return e.nextTick((function e(){t.apply(null,s)}))}}}:t.exports=e}).call(this,r(4))},function(t,e,r){var i=r(2).Buffer;function n(t){i.isBuffer(t)||(t=i.from(t));for(var e=t.length/4|0,r=new Array(e),n=0;n<e;n++)r[n]=t.readUInt32BE(4*n);return r}function o(t){for(;0<t.length;t++)t[0]=0}function s(t,e,r,i,n){for(var o,s,a,h,u=r[0],f=r[1],c=r[2],l=r[3],d=t[0]^e[0],p=t[1]^e[1],m=t[2]^e[2],g=t[3]^e[3],v=4,b=1;b<n;b++)o=u[d>>>24]^f[p>>>16&255]^c[m>>>8&255]^l[255&g]^e[v++],s=u[p>>>24]^f[m>>>16&255]^c[g>>>8&255]^l[255&d]^e[v++],a=u[m>>>24]^f[g>>>16&255]^c[d>>>8&255]^l[255&p]^e[v++],h=u[g>>>24]^f[d>>>16&255]^c[p>>>8&255]^l[255&m]^e[v++],d=o,p=s,m=a,g=h;return o=(i[d>>>24]<<24|i[p>>>16&255]<<16|i[m>>>8&255]<<8|i[255&g])^e[v++],s=(i[p>>>24]<<24|i[m>>>16&255]<<16|i[g>>>8&255]<<8|i[255&d])^e[v++],a=(i[m>>>24]<<24|i[g>>>16&255]<<16|i[d>>>8&255]<<8|i[255&p])^e[v++],h=(i[g>>>24]<<24|i[d>>>16&255]<<16|i[p>>>8&255]<<8|i[255&m])^e[v++],[o>>>=0,s>>>=0,a>>>=0,h>>>=0]}var a=[0,1,2,4,8,16,32,64,128,27,54],h=function(){for(var t=new Array(256),e=0;e<256;e++)t[e]=e<128?e<<1:e<<1^283;for(var r=[],i=[],n=[[],[],[],[]],o=[[],[],[],[]],s=0,a=0,h=0;h<256;++h){var u=a^a<<1^a<<2^a<<3^a<<4;u=u>>>8^255&u^99,r[s]=u,i[u]=s;var f=t[s],c=t[f],l=t[c],d=257*t[u]^16843008*u;n[0][s]=d<<24|d>>>8,n[1][s]=d<<16|d>>>16,n[2][s]=d<<8|d>>>24,n[3][s]=d,d=16843009*l^65537*c^257*f^16843008*s,o[0][u]=d<<24|d>>>8,o[1][u]=d<<16|d>>>16,o[2][u]=d<<8|d>>>24,o[3][u]=d,0===s?s=a=1:(s=f^t[t[t[l^f]]],a^=t[t[a]])}return{SBOX:r,INV_SBOX:i,SUB_MIX:n,INV_SUB_MIX:o}}();function u(t){this._key=n(t),this._reset()}u.blockSize=16,u.keySize=32,u.prototype.blockSize=u.blockSize,u.prototype.keySize=u.keySize,u.prototype._reset=function(){for(var t=this._key,e=t.length,r=e+6,i=4*(r+1),n=[],o=0;o<e;o++)n[o]=t[o];for(o=e;o<i;o++){var s=n[o-1];o%e==0?(s=s<<8|s>>>24,s=h.SBOX[s>>>24]<<24|h.SBOX[s>>>16&255]<<16|h.SBOX[s>>>8&255]<<8|h.SBOX[255&s],s^=a[o/e|0]<<24):e>6&&o%e==4&&(s=h.SBOX[s>>>24]<<24|h.SBOX[s>>>16&255]<<16|h.SBOX[s>>>8&255]<<8|h.SBOX[255&s]),n[o]=n[o-e]^s}for(var u=[],f=0;f<i;f++){var c=i-f,l=n[c-(f%4?0:4)];u[f]=f<4||c<=4?l:h.INV_SUB_MIX[0][h.SBOX[l>>>24]]^h.INV_SUB_MIX[1][h.SBOX[l>>>16&255]]^h.INV_SUB_MIX[2][h.SBOX[l>>>8&255]]^h.INV_SUB_MIX[3][h.SBOX[255&l]]}this._nRounds=r,this._keySchedule=n,this._invKeySchedule=u},u.prototype.encryptBlockRaw=function(t){return s(t=n(t),this._keySchedule,h.SUB_MIX,h.SBOX,this._nRounds)},u.prototype.encryptBlock=function(t){var e=this.encryptBlockRaw(t),r=i.allocUnsafe(16);return r.writeUInt32BE(e[0],0),r.writeUInt32BE(e[1],4),r.writeUInt32BE(e[2],8),r.writeUInt32BE(e[3],12),r},u.prototype.decryptBlock=function(t){var e=(t=n(t))[1];t[1]=t[3],t[3]=e;var r=s(t,this._invKeySchedule,h.INV_SUB_MIX,h.INV_SBOX,this._nRounds),o=i.allocUnsafe(16);return o.writeUInt32BE(r[0],0),o.writeUInt32BE(r[3],4),o.writeUInt32BE(r[2],8),o.writeUInt32BE(r[1],12),o},u.prototype.scrub=function(){o(this._keySchedule),o(this._invKeySchedule),o(this._key)},t.exports.AES=u},function(t,e,r){var i=r(2).Buffer,n=r(88);t.exports=function o(t,e,r,s){if(i.isBuffer(t)||(t=i.from(t,"binary")),e&&(i.isBuffer(e)||(e=i.from(e,"binary")),8!==e.length))throw new RangeError("salt should be Buffer with 8 byte length");for(var a=r/8,h=i.alloc(a),u=i.alloc(s||0),f=i.alloc(0);a>0||s>0;){var c=new n;c.update(f),c.update(t),e&&c.update(e),f=c.digest();var l=0;if(a>0){var d=h.length-a;l=Math.min(a,f.length),f.copy(h,d,0,l),a-=l}if(l<f.length&&s>0){var p=u.length-s,m=Math.min(s,f.length-l);f.copy(u,p,l,l+m),s-=m}}return f.fill(0),{key:h,iv:u}}},function(t,e,r){"use strict";var i=r(16),n=r(11),o=n.getNAF,s=n.getJSF,a=n.assert;function h(t,e){this.type=t,this.p=new i(e.p,16),this.red=e.prime?i.red(e.prime):i.mont(this.p),this.zero=new i(0).toRed(this.red),this.one=new i(1).toRed(this.red),this.two=new i(2).toRed(this.red),this.n=e.n&&new i(e.n,16),this.g=e.g&&this.pointFromJSON(e.g,e.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function u(t,e){this.curve=t,this.type=e,this.precomputed=null}t.exports=h,h.prototype.point=function t(){throw new Error("Not implemented")},h.prototype.validate=function t(){throw new Error("Not implemented")},h.prototype._fixedNafMul=function t(e,r){a(e.precomputed);var i=e._getDoubles(),n=o(r,1,this._bitLength),s=(1<<i.step+1)-(i.step%2==0?2:1);s/=3;var h,u,f=[];for(h=0;h<n.length;h+=i.step){u=0;for(var c=h+i.step-1;c>=h;c--)u=(u<<1)+n[c];f.push(u)}for(var l=this.jpoint(null,null,null),d=this.jpoint(null,null,null),p=s;p>0;p--){for(h=0;h<f.length;h++)(u=f[h])===p?d=d.mixedAdd(i.points[h]):u===-p&&(d=d.mixedAdd(i.points[h].neg()));l=l.add(d)}return l.toP()},h.prototype._wnafMul=function t(e,r){var i=4,n=e._getNAFPoints(i);i=n.wnd;for(var s=n.points,h=o(r,i,this._bitLength),u=this.jpoint(null,null,null),f=h.length-1;f>=0;f--){for(var c=0;f>=0&&0===h[f];f--)c++;if(f>=0&&c++,u=u.dblp(c),f<0)break;var l=h[f];a(0!==l),u="affine"===e.type?l>0?u.mixedAdd(s[l-1>>1]):u.mixedAdd(s[-l-1>>1].neg()):l>0?u.add(s[l-1>>1]):u.add(s[-l-1>>1].neg())}return"affine"===e.type?u.toP():u},h.prototype._wnafMulAdd=function t(e,r,i,n,a){var h,u,f,c=this._wnafT1,l=this._wnafT2,d=this._wnafT3,p=0;for(h=0;h<n;h++){var m=(f=r[h])._getNAFPoints(e);c[h]=m.wnd,l[h]=m.points}for(h=n-1;h>=1;h-=2){var g=h-1,v=h;if(1===c[g]&&1===c[v]){var b=[r[g],null,null,r[v]];0===r[g].y.cmp(r[v].y)?(b[1]=r[g].add(r[v]),b[2]=r[g].toJ().mixedAdd(r[v].neg())):0===r[g].y.cmp(r[v].y.redNeg())?(b[1]=r[g].toJ().mixedAdd(r[v]),b[2]=r[g].add(r[v].neg())):(b[1]=r[g].toJ().mixedAdd(r[v]),b[2]=r[g].toJ().mixedAdd(r[v].neg()));var y=[-3,-1,-5,-7,0,7,5,1,3],w=s(i[g],i[v]);for(p=Math.max(w[0].length,p),d[g]=new Array(p),d[v]=new Array(p),u=0;u<p;u++){var _=0|w[0][u],M=0|w[1][u];d[g][u]=y[3*(_+1)+(M+1)],d[v][u]=0,l[g]=b}}else d[g]=o(i[g],c[g],this._bitLength),d[v]=o(i[v],c[v],this._bitLength),p=Math.max(d[g].length,p),p=Math.max(d[v].length,p)}var S=this.jpoint(null,null,null),k=this._wnafT4;for(h=p;h>=0;h--){for(var E=0;h>=0;){var R=!0;for(u=0;u<n;u++)k[u]=0|d[u][h],0!==k[u]&&(R=!1);if(!R)break;E++,h--}if(h>=0&&E++,S=S.dblp(E),h<0)break;for(u=0;u<n;u++){var A=k[u];0!==A&&(A>0?f=l[u][A-1>>1]:A<0&&(f=l[u][-A-1>>1].neg()),S="affine"===f.type?S.mixedAdd(f):S.add(f))}}for(h=0;h<n;h++)l[h]=null;return a?S:S.toP()},h.BasePoint=u,u.prototype.eq=function t(){throw new Error("Not implemented")},u.prototype.validate=function t(){return this.curve.validate(this)},h.prototype.decodePoint=function t(e,r){e=n.toArray(e,r);var i=this.p.byteLength();if((4===e[0]||6===e[0]||7===e[0])&&e.length-1==2*i)return 6===e[0]?a(e[e.length-1]%2==0):7===e[0]&&a(e[e.length-1]%2==1),this.point(e.slice(1,1+i),e.slice(1+i,1+2*i));if((2===e[0]||3===e[0])&&e.length-1===i)return this.pointFromX(e.slice(1,1+i),3===e[0]);throw new Error("Unknown point format")},u.prototype.encodeCompressed=function t(e){return this.encode(e,!0)},u.prototype._encode=function t(e){var r=this.curve.p.byteLength(),i=this.getX().toArray("be",r);return e?[this.getY().isEven()?2:3].concat(i):[4].concat(i,this.getY().toArray("be",r))},u.prototype.encode=function t(e,r){return n.encode(this._encode(r),e)},u.prototype.precompute=function t(e){if(this.precomputed)return this;var r={doubles:null,naf:null,beta:null};return r.naf=this._getNAFPoints(8),r.doubles=this._getDoubles(4,e),r.beta=this._getBeta(),this.precomputed=r,this},u.prototype._hasDoubles=function t(e){if(!this.precomputed)return!1;var r=this.precomputed.doubles;return!!r&&r.points.length>=Math.ceil((e.bitLength()+1)/r.step)},u.prototype._getDoubles=function t(e,r){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var i=[this],n=this,o=0;o<r;o+=e){for(var s=0;s<e;s++)n=n.dbl();i.push(n)}return{step:e,points:i}},u.prototype._getNAFPoints=function t(e){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var r=[this],i=(1<<e)-1,n=1===i?null:this.dbl(),o=1;o<i;o++)r[o]=r[o-1].add(n);return{wnd:e,points:r}},u.prototype._getBeta=function t(){return null},u.prototype.dblp=function t(e){for(var r=this,i=0;i<e;i++)r=r.dbl();return r}},function(t,e,r){var i=r(359),n=r(367),o=r(368),s=r(96),a=r(161),h=r(2).Buffer;function u(t){var e;"object"!=typeof t||h.isBuffer(t)||(e=t.passphrase,t=t.key),"string"==typeof t&&(t=h.from(t));var r,u,f=o(t,e),c=f.tag,l=f.data;switch(c){case"CERTIFICATE":u=i.certificate.decode(l,"der").tbsCertificate.subjectPublicKeyInfo;case"PUBLIC KEY":switch(u||(u=i.PublicKey.decode(l,"der")),r=u.algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return i.RSAPublicKey.decode(u.subjectPublicKey.data,"der");case"1.2.840.10045.2.1":return u.subjectPrivateKey=u.subjectPublicKey,{type:"ec",data:u};case"1.2.840.10040.4.1":return u.algorithm.params.pub_key=i.DSAparam.decode(u.subjectPublicKey.data,"der"),{type:"dsa",data:u.algorithm.params};default:throw new Error("unknown key id "+r)}case"ENCRYPTED PRIVATE KEY":l=function d(t,e){var r=t.algorithm.decrypt.kde.kdeparams.salt,i=parseInt(t.algorithm.decrypt.kde.kdeparams.iters.toString(),10),o=n[t.algorithm.decrypt.cipher.algo.join(".")],u=t.algorithm.decrypt.cipher.iv,f=t.subjectPrivateKey,c=parseInt(o.split("-")[1],10)/8,l=a.pbkdf2Sync(e,r,i,c,"sha1"),d=s.createDecipheriv(o,l,u),p=[];return p.push(d.update(f)),p.push(d.final()),h.concat(p)}(l=i.EncryptedPrivateKey.decode(l,"der"),e);case"PRIVATE KEY":switch(r=(u=i.PrivateKey.decode(l,"der")).algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return i.RSAPrivateKey.decode(u.subjectPrivateKey,"der");case"1.2.840.10045.2.1":return{curve:u.algorithm.curve,privateKey:i.ECPrivateKey.decode(u.subjectPrivateKey,"der").privateKey};case"1.2.840.10040.4.1":return u.algorithm.params.priv_key=i.DSAparam.decode(u.subjectPrivateKey,"der"),{type:"dsa",params:u.algorithm.params};default:throw new Error("unknown key id "+r)}case"RSA PUBLIC KEY":return i.RSAPublicKey.decode(l,"der");case"RSA PRIVATE KEY":return i.RSAPrivateKey.decode(l,"der");case"DSA PRIVATE KEY":return{type:"dsa",params:i.DSAPrivateKey.decode(l,"der")};case"EC PRIVATE KEY":return{curve:(l=i.ECPrivateKey.decode(l,"der")).parameters.value,privateKey:l.privateKey};default:throw new Error("unknown key type "+c)}}t.exports=u,u.signature=i.signature},function(t,e,r){
/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
var i=r(7),n=i.Buffer;function o(t,e){for(var r in t)e[r]=t[r]}function s(t,e,r){return n(t,e,r)}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?t.exports=i:(o(i,e),e.Buffer=s),s.prototype=Object.create(n.prototype),o(n,s),s.from=function(t,e,r){if("number"==typeof t)throw new TypeError("Argument must not be a number");return n(t,e,r)},s.alloc=function(t,e,r){if("number"!=typeof t)throw new TypeError("Argument must be a number");var i=n(t);return void 0!==e?"string"==typeof r?i.fill(e,r):i.fill(e):i.fill(0),i},s.allocUnsafe=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return n(t)},s.allocUnsafeSlow=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return i.SlowBuffer(t)}},function(t,e,r){var i=r(17),n=r(115),o=r(39),s=r(49),a=r(70),h=r(12),u=r(116),f=Object.getOwnPropertyDescriptor;e.f=i?f:function t(e,r){if(e=s(e),r=a(r,!0),u)try{return f(e,r)}catch(t){}if(h(e,r))return o(!n.f.call(e,r),e[r])}},function(t,e,r){var i=r(9),n=r(50),o="".split;t.exports=i((function(){return!Object("z").propertyIsEnumerable(0)}))?function(t){return"String"==n(t)?o.call(t,""):Object(t)}:Object},function(t,e){t.exports=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t}},function(t,e,r){var i=r(14);t.exports=function(t,e){if(!i(t))return t;var r,n;if(e&&"function"==typeof(r=t.toString)&&!i(n=r.call(t)))return n;if("function"==typeof(r=t.valueOf)&&!i(n=r.call(t)))return n;if(!e&&"function"==typeof(r=t.toString)&&!i(n=r.call(t)))return n;throw TypeError("Can't convert object to primitive value")}},function(t,e,r){var i=r(3),n=r(14),o=i.document,s=n(o)&&n(o.createElement);t.exports=function(t){return s?o.createElement(t):{}}},function(t,e,r){var i=r(3),n=r(18);t.exports=function(t,e){try{n(i,t,e)}catch(r){i[t]=e}return e}},function(t,e,r){var i=r(74),n=Function.toString;"function"!=typeof i.inspectSource&&(i.inspectSource=function(t){return n.call(t)}),t.exports=i.inspectSource},function(t,e,r){var i=r(3),n=r(72),o="__core-js_shared__",s=i[o]||n(o,{});t.exports=s},function(t,e,r){var i=r(117),n=r(118),o=i("keys");t.exports=function(t){return o[t]||(o[t]=n(t))}},function(t,e){t.exports={}},function(t,e){t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},function(t,e,r){var i=r(12),n=r(55),o=r(75),s=r(217),a=o("IE_PROTO"),h=Object.prototype;t.exports=s?Object.getPrototypeOf:function(t){return t=n(t),i(t,a)?t[a]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?h:null}},function(t,e,r){var i,n=r(15),o=r(219),s=r(77),a=r(76),h=r(125),u=r(71),f=r(75),c=f("IE_PROTO"),l=function(){},d=function(t){return"<script>"+t+"</"+"script>"},p=function(){try{i=document.domain&&new ActiveXObject("htmlfile")}catch(t){}var t,e;p=i?function(t){t.write(d("")),t.close();var e=t.parentWindow.Object;return t=null,e}(i):((e=u("iframe")).style.display="none",h.appendChild(e),e.src=String("javascript:"),(t=e.contentWindow.document).open(),t.write(d("document.F=Object")),t.close(),t.F);for(var r=s.length;r--;)delete p.prototype[s[r]];return p()};a[c]=!0,t.exports=Object.create||function t(e,r){var i;return null!==e?(l.prototype=n(e),i=new l,l.prototype=null,i[c]=e):i=p(),void 0===r?i:o(i,r)}},function(t,e,r){var i={};i[r(6)("toStringTag")]="z",t.exports="[object z]"===String(i)},function(t,e,r){var i=r(21).f,n=r(12),o=r(6)("toStringTag");t.exports=function(t,e,r){t&&!n(t=r?t:t.prototype,o)&&i(t,o,{configurable:!0,value:e})}},function(t,e,r){var i=r(22);t.exports=i("navigator","userAgent")||""},function(t,e,r){var i=r(50),n=r(3);t.exports="process"==i(n.process)},function(t,e,r){var i=r(17),n=r(9),o=r(12),s=Object.defineProperty,a={},h=function(t){throw t};t.exports=function(t,e){if(o(a,t))return a[t];e||(e={});var r=[][t],u=!!o(e,"ACCESSORS")&&e.ACCESSORS,f=o(e,0)?e[0]:h,c=o(e,1)?e[1]:void 0;return a[t]=!!r&&!n((function(){if(u&&!i)return!0;var t={length:-1};u?s(t,1,{enumerable:!0,get:h}):t[1]=1,r.call(t,f,c)}))}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.OidcClientSettings=void 0;var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n=function(){function t(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,r,i){return r&&t(e.prototype,r),i&&t(e,i),e}}(),o=r(0),s=r(269),a=r(86),h=r(270),u=r(30);function f(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var c=".well-known/openid-configuration",l="id_token",d="openid",p="client_secret_post";e.OidcClientSettings=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=e.authority,n=e.metadataUrl,o=e.metadata,c=e.signingKeys,m=e.metadataSeed,g=e.client_id,v=e.client_secret,b=e.response_type,y=void 0===b?l:b,w=e.scope,_=void 0===w?d:w,M=e.redirect_uri,S=e.post_logout_redirect_uri,k=e.client_authentication,E=void 0===k?p:k,R=e.prompt,A=e.display,x=e.max_age,T=e.ui_locales,P=e.acr_values,I=e.resource,L=e.response_mode,O=e.filterProtocolClaims,B=void 0===O||O,j=e.loadUserInfo,C=void 0===j||j,U=e.staleStateAge,N=void 0===U?900:U,q=e.clockSkew,D=void 0===q?300:q,z=e.clockService,F=void 0===z?new s.ClockService:z,W=e.userInfoJwtIssuer,H=void 0===W?"OP":W,K=e.mergeClaims,Z=void 0!==K&&K,V=e.stateStore,J=void 0===V?new a.WebStorageStateStore:V,Y=e.ResponseValidatorCtor,G=void 0===Y?h.ResponseValidator:Y,X=e.MetadataServiceCtor,Q=void 0===X?u.MetadataService:X,$=e.extraQueryParams,tt=void 0===$?{}:$,et=e.extraTokenParams,rt=void 0===et?{}:et;f(this,t),this._authority=r,this._metadataUrl=n,this._metadata=o,this._metadataSeed=m,this._signingKeys=c,this._client_id=g,this._client_secret=v,this._response_type=y,this._scope=_,this._redirect_uri=M,this._post_logout_redirect_uri=S,this._client_authentication=E,this._prompt=R,this._display=A,this._max_age=x,this._ui_locales=T,this._acr_values=P,this._resource=I,this._response_mode=L,this._filterProtocolClaims=!!B,this._loadUserInfo=!!C,this._staleStateAge=N,this._clockSkew=D,this._clockService=F,this._userInfoJwtIssuer=H,this._mergeClaims=!!Z,this._stateStore=J,this._validator=new G(this),this._metadataService=new Q(this),this._extraQueryParams="object"===(void 0===tt?"undefined":i(tt))?tt:{},this._extraTokenParams="object"===(void 0===rt?"undefined":i(rt))?rt:{}}return t.prototype.getEpochTime=function t(){return this._clockService.getEpochTime()},n(t,[{key:"client_id",get:function t(){return this._client_id},set:function t(e){if(this._client_id)throw o.Log.error("OidcClientSettings.set_client_id: client_id has already been assigned."),new Error("client_id has already been assigned.");this._client_id=e}},{key:"client_secret",get:function t(){return this._client_secret}},{key:"response_type",get:function t(){return this._response_type}},{key:"scope",get:function t(){return this._scope}},{key:"redirect_uri",get:function t(){return this._redirect_uri}},{key:"post_logout_redirect_uri",get:function t(){return this._post_logout_redirect_uri}},{key:"client_authentication",get:function t(){return this._client_authentication}},{key:"prompt",get:function t(){return this._prompt}},{key:"display",get:function t(){return this._display}},{key:"max_age",get:function t(){return this._max_age}},{key:"ui_locales",get:function t(){return this._ui_locales}},{key:"acr_values",get:function t(){return this._acr_values}},{key:"resource",get:function t(){return this._resource}},{key:"response_mode",get:function t(){return this._response_mode}},{key:"authority",get:function t(){return this._authority},set:function t(e){if(this._authority)throw o.Log.error("OidcClientSettings.set_authority: authority has already been assigned."),new Error("authority has already been assigned.");this._authority=e}},{key:"metadataUrl",get:function t(){return this._metadataUrl||(this._metadataUrl=this.authority,this._metadataUrl&&this._metadataUrl.indexOf(c)<0&&("/"!==this._metadataUrl[this._metadataUrl.length-1]&&(this._metadataUrl+="/"),this._metadataUrl+=c)),this._metadataUrl}},{key:"metadata",get:function t(){return this._metadata},set:function t(e){this._metadata=e}},{key:"metadataSeed",get:function t(){return this._metadataSeed},set:function t(e){this._metadataSeed=e}},{key:"signingKeys",get:function t(){return this._signingKeys},set:function t(e){this._signingKeys=e}},{key:"filterProtocolClaims",get:function t(){return this._filterProtocolClaims}},{key:"loadUserInfo",get:function t(){return this._loadUserInfo}},{key:"staleStateAge",get:function t(){return this._staleStateAge}},{key:"clockSkew",get:function t(){return this._clockSkew}},{key:"userInfoJwtIssuer",get:function t(){return this._userInfoJwtIssuer}},{key:"mergeClaims",get:function t(){return this._mergeClaims}},{key:"stateStore",get:function t(){return this._stateStore}},{key:"validator",get:function t(){return this._validator}},{key:"metadataService",get:function t(){return this._metadataService}},{key:"extraQueryParams",get:function t(){return this._extraQueryParams},set:function t(e){"object"===(void 0===e?"undefined":i(e))?this._extraQueryParams=e:this._extraQueryParams={}}},{key:"extraTokenParams",get:function t(){return this._extraTokenParams},set:function t(e){"object"===(void 0===e?"undefined":i(e))?this._extraTokenParams=e:this._extraTokenParams={}}}]),t}()},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.WebStorageStateStore=void 0;var i=r(0),n=r(19);function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}e.WebStorageStateStore=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=e.prefix,i=void 0===r?"oidc.":r,s=e.store,a=void 0===s?n.Global.localStorage:s;o(this,t),this._store=a,this._prefix=i}return t.prototype.set=function t(e,r){return i.Log.debug("WebStorageStateStore.set",e),e=this._prefix+e,this._store.setItem(e,r),Promise.resolve()},t.prototype.get=function t(e){i.Log.debug("WebStorageStateStore.get",e),e=this._prefix+e;var r=this._store.getItem(e);return Promise.resolve(r)},t.prototype.remove=function t(e){i.Log.debug("WebStorageStateStore.remove",e),e=this._prefix+e;var r=this._store.getItem(e);return this._store.removeItem(e),Promise.resolve(r)},t.prototype.getAllKeys=function t(){i.Log.debug("WebStorageStateStore.getAllKeys");for(var e=[],r=0;r<this._store.length;r++){var n=this._store.key(r);0===n.indexOf(this._prefix)&&e.push(n.substr(this._prefix.length))}return Promise.resolve(e)},t}()},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.JsonService=void 0;var i=r(0),n=r(19);function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}e.JsonService=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:n.Global.XMLHttpRequest,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;o(this,t),e&&Array.isArray(e)?this._contentTypes=e.slice():this._contentTypes=[],this._contentTypes.push("application/json"),i&&this._contentTypes.push("application/jwt"),this._XMLHttpRequest=r,this._jwtHandler=i}return t.prototype.getJson=function t(e,r){var n=this;if(!e)throw i.Log.error("JsonService.getJson: No url passed"),new Error("url");return i.Log.debug("JsonService.getJson, url: ",e),new Promise((function(t,o){var s=new n._XMLHttpRequest;s.open("GET",e);var a=n._contentTypes,h=n._jwtHandler;s.onload=function(){if(i.Log.debug("JsonService.getJson: HTTP response received, status",s.status),200===s.status){var r=s.getResponseHeader("Content-Type");if(r){var n=a.find((function(t){if(r.startsWith(t))return!0}));if("application/jwt"==n)return void h(s).then(t,o);if(n)try{return void t(JSON.parse(s.responseText))}catch(t){return i.Log.error("JsonService.getJson: Error parsing JSON response",t.message),void o(t)}}o(Error("Invalid response Content-Type: "+r+", from URL: "+e))}else o(Error(s.statusText+" ("+s.status+")"))},s.onerror=function(){i.Log.error("JsonService.getJson: network error"),o(Error("Network Error"))},r&&(i.Log.debug("JsonService.getJson: token passed, setting Authorization header"),s.setRequestHeader("Authorization","Bearer "+r)),s.send()}))},t.prototype.postForm=function t(e,r,n){var o=this;if(!e)throw i.Log.error("JsonService.postForm: No url passed"),new Error("url");return i.Log.debug("JsonService.postForm, url: ",e),new Promise((function(t,s){var a=new o._XMLHttpRequest;a.open("POST",e);var h=o._contentTypes;a.onload=function(){if(i.Log.debug("JsonService.postForm: HTTP response received, status",a.status),200!==a.status){if(400===a.status)if(n=a.getResponseHeader("Content-Type"))if(h.find((function(t){if(n.startsWith(t))return!0})))try{var r=JSON.parse(a.responseText);if(r&&r.error)return i.Log.error("JsonService.postForm: Error from server: ",r.error),void s(new Error(r.error))}catch(t){return i.Log.error("JsonService.postForm: Error parsing JSON response",t.message),void s(t)}s(Error(a.statusText+" ("+a.status+")"))}else{var n;if((n=a.getResponseHeader("Content-Type"))&&h.find((function(t){if(n.startsWith(t))return!0})))try{return void t(JSON.parse(a.responseText))}catch(t){return i.Log.error("JsonService.postForm: Error parsing JSON response",t.message),void s(t)}s(Error("Invalid response Content-Type: "+n+", from URL: "+e))}},a.onerror=function(){i.Log.error("JsonService.postForm: network error"),s(Error("Network Error"))};var u="";for(var f in r){var c=r[f];c&&(u.length>0&&(u+="&"),u+=encodeURIComponent(f),u+="=",u+=encodeURIComponent(c))}a.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),void 0!==n&&a.setRequestHeader("Authorization","Basic "+btoa(n)),a.send(u)}))},t}()},function(t,e,r){"use strict";var i=r(1),n=r(143),o=r(286).Buffer,s=new Array(16);function a(){n.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}function h(t,e){return t<<e|t>>>32-e}function u(t,e,r,i,n,o,s){return h(t+(e&r|~e&i)+n+o|0,s)+e|0}function f(t,e,r,i,n,o,s){return h(t+(e&i|r&~i)+n+o|0,s)+e|0}function c(t,e,r,i,n,o,s){return h(t+(e^r^i)+n+o|0,s)+e|0}function l(t,e,r,i,n,o,s){return h(t+(r^(e|~i))+n+o|0,s)+e|0}i(a,n),a.prototype._update=function(){for(var t=s,e=0;e<16;++e)t[e]=this._block.readInt32LE(4*e);var r=this._a,i=this._b,n=this._c,o=this._d;r=u(r,i,n,o,t[0],3614090360,7),o=u(o,r,i,n,t[1],3905402710,12),n=u(n,o,r,i,t[2],606105819,17),i=u(i,n,o,r,t[3],3250441966,22),r=u(r,i,n,o,t[4],4118548399,7),o=u(o,r,i,n,t[5],1200080426,12),n=u(n,o,r,i,t[6],2821735955,17),i=u(i,n,o,r,t[7],4249261313,22),r=u(r,i,n,o,t[8],1770035416,7),o=u(o,r,i,n,t[9],2336552879,12),n=u(n,o,r,i,t[10],4294925233,17),i=u(i,n,o,r,t[11],2304563134,22),r=u(r,i,n,o,t[12],1804603682,7),o=u(o,r,i,n,t[13],4254626195,12),n=u(n,o,r,i,t[14],2792965006,17),r=f(r,i=u(i,n,o,r,t[15],1236535329,22),n,o,t[1],4129170786,5),o=f(o,r,i,n,t[6],3225465664,9),n=f(n,o,r,i,t[11],643717713,14),i=f(i,n,o,r,t[0],3921069994,20),r=f(r,i,n,o,t[5],3593408605,5),o=f(o,r,i,n,t[10],38016083,9),n=f(n,o,r,i,t[15],3634488961,14),i=f(i,n,o,r,t[4],3889429448,20),r=f(r,i,n,o,t[9],568446438,5),o=f(o,r,i,n,t[14],3275163606,9),n=f(n,o,r,i,t[3],4107603335,14),i=f(i,n,o,r,t[8],1163531501,20),r=f(r,i,n,o,t[13],2850285829,5),o=f(o,r,i,n,t[2],4243563512,9),n=f(n,o,r,i,t[7],1735328473,14),r=c(r,i=f(i,n,o,r,t[12],2368359562,20),n,o,t[5],4294588738,4),o=c(o,r,i,n,t[8],2272392833,11),n=c(n,o,r,i,t[11],1839030562,16),i=c(i,n,o,r,t[14],4259657740,23),r=c(r,i,n,o,t[1],2763975236,4),o=c(o,r,i,n,t[4],1272893353,11),n=c(n,o,r,i,t[7],4139469664,16),i=c(i,n,o,r,t[10],3200236656,23),r=c(r,i,n,o,t[13],681279174,4),o=c(o,r,i,n,t[0],3936430074,11),n=c(n,o,r,i,t[3],3572445317,16),i=c(i,n,o,r,t[6],76029189,23),r=c(r,i,n,o,t[9],3654602809,4),o=c(o,r,i,n,t[12],3873151461,11),n=c(n,o,r,i,t[15],530742520,16),r=l(r,i=c(i,n,o,r,t[2],3299628645,23),n,o,t[0],4096336452,6),o=l(o,r,i,n,t[7],1126891415,10),n=l(n,o,r,i,t[14],2878612391,15),i=l(i,n,o,r,t[5],4237533241,21),r=l(r,i,n,o,t[12],1700485571,6),o=l(o,r,i,n,t[3],2399980690,10),n=l(n,o,r,i,t[10],4293915773,15),i=l(i,n,o,r,t[1],2240044497,21),r=l(r,i,n,o,t[8],1873313359,6),o=l(o,r,i,n,t[15],4264355552,10),n=l(n,o,r,i,t[6],2734768916,15),i=l(i,n,o,r,t[13],1309151649,21),r=l(r,i,n,o,t[4],4149444226,6),o=l(o,r,i,n,t[11],3174756917,10),n=l(n,o,r,i,t[2],718787259,15),i=l(i,n,o,r,t[9],3951481745,21),this._a=this._a+r|0,this._b=this._b+i|0,this._c=this._c+n|0,this._d=this._d+o|0},a.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var t=o.allocUnsafe(16);return t.writeInt32LE(this._a,0),t.writeInt32LE(this._b,4),t.writeInt32LE(this._c,8),t.writeInt32LE(this._d,12),t},t.exports=a},function(t,e,r){(function(e){function r(t){try{if(!e.localStorage)return!1}catch(t){return!1}var r=e.localStorage[t];return null!=r&&"true"===String(r).toLowerCase()}t.exports=function i(t,e){if(r("noDeprecation"))return t;var i=!1;return function n(){if(!i){if(r("throwDeprecation"))throw new Error(e);r("traceDeprecation")?console.trace(e):console.warn(e),i=!0}return t.apply(this,arguments)}}}).call(this,r(5))},function(t,e,r){"use strict";var i=r(32).codes.ERR_STREAM_PREMATURE_CLOSE;function n(){}t.exports=function t(e,r,o){if("function"==typeof r)return t(e,null,r);r||(r={}),o=function s(t){var e=!1;return function(){if(!e){e=!0;for(var r=arguments.length,i=new Array(r),n=0;n<r;n++)i[n]=arguments[n];t.apply(this,i)}}}(o||n);var a=r.readable||!1!==r.readable&&e.readable,h=r.writable||!1!==r.writable&&e.writable,u=function t(){e.writable||c()},f=e._writableState&&e._writableState.finished,c=function t(){h=!1,f=!0,a||o.call(e)},l=e._readableState&&e._readableState.endEmitted,d=function t(){a=!1,l=!0,h||o.call(e)},p=function t(r){o.call(e,r)},m=function t(){var r;return a&&!l?(e._readableState&&e._readableState.ended||(r=new i),o.call(e,r)):h&&!f?(e._writableState&&e._writableState.ended||(r=new i),o.call(e,r)):void 0},g=function t(){e.req.on("finish",c)};return!function v(t){return t.setHeader&&"function"==typeof t.abort}(e)?h&&!e._writableState&&(e.on("end",u),e.on("close",u)):(e.on("complete",c),e.on("abort",m),e.req?g():e.on("request",g)),e.on("end",d),e.on("finish",c),!1!==r.error&&e.on("error",p),e.on("close",m),function(){e.removeListener("complete",c),e.removeListener("abort",m),e.removeListener("request",g),e.req&&e.req.removeListener("finish",c),e.removeListener("end",u),e.removeListener("close",u),e.removeListener("finish",c),e.removeListener("end",d),e.removeListener("error",p),e.removeListener("close",m)}}},function(t,e,r){"use strict";var i=r(7).Buffer,n=r(1),o=r(143),s=new Array(16),a=[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],h=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],u=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],f=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11],c=[0,1518500249,1859775393,2400959708,2840853838],l=[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(t,e){return t<<e|t>>>32-e}function m(t,e,r,i,n,o,s,a){return p(t+(e^r^i)+o+s|0,a)+n|0}function g(t,e,r,i,n,o,s,a){return p(t+(e&r|~e&i)+o+s|0,a)+n|0}function v(t,e,r,i,n,o,s,a){return p(t+((e|~r)^i)+o+s|0,a)+n|0}function b(t,e,r,i,n,o,s,a){return p(t+(e&i|r&~i)+o+s|0,a)+n|0}function y(t,e,r,i,n,o,s,a){return p(t+(e^(r|~i))+o+s|0,a)+n|0}n(d,o),d.prototype._update=function(){for(var t=s,e=0;e<16;++e)t[e]=this._block.readInt32LE(4*e);for(var r=0|this._a,i=0|this._b,n=0|this._c,o=0|this._d,d=0|this._e,w=0|this._a,_=0|this._b,M=0|this._c,S=0|this._d,k=0|this._e,E=0;E<80;E+=1){var R,A;E<16?(R=m(r,i,n,o,d,t[a[E]],c[0],u[E]),A=y(w,_,M,S,k,t[h[E]],l[0],f[E])):E<32?(R=g(r,i,n,o,d,t[a[E]],c[1],u[E]),A=b(w,_,M,S,k,t[h[E]],l[1],f[E])):E<48?(R=v(r,i,n,o,d,t[a[E]],c[2],u[E]),A=v(w,_,M,S,k,t[h[E]],l[2],f[E])):E<64?(R=b(r,i,n,o,d,t[a[E]],c[3],u[E]),A=g(w,_,M,S,k,t[h[E]],l[3],f[E])):(R=y(r,i,n,o,d,t[a[E]],c[4],u[E]),A=m(w,_,M,S,k,t[h[E]],l[4],f[E])),r=d,d=o,o=p(n,10),n=i,i=R,w=k,k=S,S=p(M,10),M=_,_=A}var x=this._b+n+S|0;this._b=this._c+o+k|0,this._c=this._d+d+w|0,this._d=this._e+r+_|0,this._e=this._a+i+M|0,this._a=x},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 t=i.alloc?i.alloc(20):new i(20);return t.writeInt32LE(this._a,0),t.writeInt32LE(this._b,4),t.writeInt32LE(this._c,8),t.writeInt32LE(this._d,12),t.writeInt32LE(this._e,16),t},t.exports=d},function(t,e,r){(e=t.exports=function t(r){r=r.toLowerCase();var i=e[r];if(!i)throw new Error(r+" is not supported (we accept pull requests)");return new i}).sha=r(287),e.sha1=r(288),e.sha224=r(289),e.sha256=r(150),e.sha384=r(290),e.sha512=r(151)},function(t,e,r){(e=t.exports=r(152)).Stream=e,e.Readable=e,e.Writable=r(94),e.Duplex=r(27),e.Transform=r(157),e.PassThrough=r(298)},function(t,e,r){"use strict";(function(e,i,n){var o=r(61);function s(t){var e=this;this.next=null,this.entry=null,this.finish=function(){!function r(t,e,i){var n=t.entry;t.entry=null;for(;n;){var o=n.callback;e.pendingcb--,o(i),n=n.next}e.corkedRequestsFree?e.corkedRequestsFree.next=t:e.corkedRequestsFree=t}(e,t)}}t.exports=b;var a,h=!e.browser&&["v0.10","v0.9."].indexOf(e.version.slice(0,5))>-1?i:o.nextTick;b.WritableState=v;var u=Object.create(r(44));u.inherits=r(1);var f={deprecate:r(89)},c=r(154),l=r(2).Buffer,d=n.Uint8Array||function(){};var p,m=r(156);function g(){}function v(t,e){a=a||r(27),t=t||{};var i=e instanceof a;this.objectMode=!!t.objectMode,i&&(this.objectMode=this.objectMode||!!t.writableObjectMode);var n=t.highWaterMark,u=t.writableHighWaterMark,f=this.objectMode?16:16384;this.highWaterMark=n||0===n?n:i&&(u||0===u)?u:f,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var c=!1===t.decodeStrings;this.decodeStrings=!c,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(t){!function r(t,e){var r=t._writableState,i=r.sync,n=r.writecb;if(function s(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}(r),e)!function a(t,e,r,i,n){--e.pendingcb,r?(o.nextTick(n,i),o.nextTick(k,t,e),t._writableState.errorEmitted=!0,t.emit("error",i)):(n(i),t._writableState.errorEmitted=!0,t.emit("error",i),k(t,e))}(t,r,i,e,n);else{var u=M(r);u||r.corked||r.bufferProcessing||!r.bufferedRequest||_(t,r),i?h(w,t,r,u,n):w(t,r,u,n)}}(e,t)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new s(this)}function b(t){if(a=a||r(27),!(p.call(b,this)||this instanceof a))return new b(t);this._writableState=new v(t,this),this.writable=!0,t&&("function"==typeof t.write&&(this._write=t.write),"function"==typeof t.writev&&(this._writev=t.writev),"function"==typeof t.destroy&&(this._destroy=t.destroy),"function"==typeof t.final&&(this._final=t.final)),c.call(this)}function y(t,e,r,i,n,o,s){e.writelen=i,e.writecb=s,e.writing=!0,e.sync=!0,r?t._writev(n,e.onwrite):t._write(n,o,e.onwrite),e.sync=!1}function w(t,e,r,i){r||function n(t,e){0===e.length&&e.needDrain&&(e.needDrain=!1,t.emit("drain"))}(t,e),e.pendingcb--,i(),k(t,e)}function _(t,e){e.bufferProcessing=!0;var r=e.bufferedRequest;if(t._writev&&r&&r.next){var i=e.bufferedRequestCount,n=new Array(i),o=e.corkedRequestsFree;o.entry=r;for(var a=0,h=!0;r;)n[a]=r,r.isBuf||(h=!1),r=r.next,a+=1;n.allBuffers=h,y(t,e,!0,e.length,n,"",o.finish),e.pendingcb++,e.lastBufferedRequest=null,o.next?(e.corkedRequestsFree=o.next,o.next=null):e.corkedRequestsFree=new s(e),e.bufferedRequestCount=0}else{for(;r;){var u=r.chunk,f=r.encoding,c=r.callback;if(y(t,e,!1,e.objectMode?1:u.length,u,f,c),r=r.next,e.bufferedRequestCount--,e.writing)break}null===r&&(e.lastBufferedRequest=null)}e.bufferedRequest=r,e.bufferProcessing=!1}function M(t){return t.ending&&0===t.length&&null===t.bufferedRequest&&!t.finished&&!t.writing}function S(t,e){t._final((function(r){e.pendingcb--,r&&t.emit("error",r),e.prefinished=!0,t.emit("prefinish"),k(t,e)}))}function k(t,e){var r=M(e);return r&&(!function i(t,e){e.prefinished||e.finalCalled||("function"==typeof t._final?(e.pendingcb++,e.finalCalled=!0,o.nextTick(S,t,e)):(e.prefinished=!0,t.emit("prefinish")))}(t,e),0===e.pendingcb&&(e.finished=!0,t.emit("finish"))),r}u.inherits(b,c),v.prototype.getBuffer=function t(){for(var e=this.bufferedRequest,r=[];e;)r.push(e),e=e.next;return r},function(){try{Object.defineProperty(v.prototype,"buffer",{get:f.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(t){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(p=Function.prototype[Symbol.hasInstance],Object.defineProperty(b,Symbol.hasInstance,{value:function(t){return!!p.call(this,t)||this===b&&(t&&t._writableState instanceof v)}})):p=function(t){return t instanceof this},b.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},b.prototype.write=function(t,e,r){var i=this._writableState,n=!1,s=!i.objectMode&&function a(t){return l.isBuffer(t)||t instanceof d}(t);return s&&!l.isBuffer(t)&&(t=function h(t){return l.from(t)}(t)),"function"==typeof e&&(r=e,e=null),s?e="buffer":e||(e=i.defaultEncoding),"function"!=typeof r&&(r=g),i.ended?function u(t,e){var r=new Error("write after end");t.emit("error",r),o.nextTick(e,r)}(this,r):(s||function f(t,e,r,i){var n=!0,s=!1;return null===r?s=new TypeError("May not write null values to stream"):"string"==typeof r||void 0===r||e.objectMode||(s=new TypeError("Invalid non-string/buffer chunk")),s&&(t.emit("error",s),o.nextTick(i,s),n=!1),n}(this,i,t,r))&&(i.pendingcb++,n=function c(t,e,r,i,n,o){if(!r){var s=function a(t,e,r){t.objectMode||!1===t.decodeStrings||"string"!=typeof e||(e=l.from(e,r));return e}(e,i,n);i!==s&&(r=!0,n="buffer",i=s)}var h=e.objectMode?1:i.length;e.length+=h;var u=e.length<e.highWaterMark;u||(e.needDrain=!0);if(e.writing||e.corked){var f=e.lastBufferedRequest;e.lastBufferedRequest={chunk:i,encoding:n,isBuf:r,callback:o,next:null},f?f.next=e.lastBufferedRequest:e.bufferedRequest=e.lastBufferedRequest,e.bufferedRequestCount+=1}else y(t,e,!1,h,i,n,o);return u}(this,i,s,t,e,r)),n},b.prototype.cork=function(){this._writableState.corked++},b.prototype.uncork=function(){var t=this._writableState;t.corked&&(t.corked--,t.writing||t.corked||t.finished||t.bufferProcessing||!t.bufferedRequest||_(this,t))},b.prototype.setDefaultEncoding=function t(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(b.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),b.prototype._write=function(t,e,r){r(new Error("_write() is not implemented"))},b.prototype._writev=null,b.prototype.end=function(t,e,r){var i=this._writableState;"function"==typeof t?(r=t,t=null,e=null):"function"==typeof e&&(r=e,e=null),null!=t&&this.write(t,e),i.corked&&(i.corked=1,this.uncork()),i.ending||i.finished||function n(t,e,r){e.ending=!0,k(t,e),r&&(e.finished?o.nextTick(r):t.once("finish",r));e.ended=!0,t.writable=!1}(this,i,r)},Object.defineProperty(b.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),b.prototype.destroy=m.destroy,b.prototype._undestroy=m.undestroy,b.prototype._destroy=function(t,e){this.end(),e(t)}}).call(this,r(4),r(296).setImmediate,r(5))},function(t,e,r){"use strict";var i=r(10);function n(t){this.options=t,this.type=this.options.type,this.blockSize=8,this._init(),this.buffer=new Array(this.blockSize),this.bufferOff=0}t.exports=n,n.prototype._init=function t(){},n.prototype.update=function t(e){return 0===e.length?[]:"decrypt"===this.type?this._updateDecrypt(e):this._updateEncrypt(e)},n.prototype._buffer=function t(e,r){for(var i=Math.min(this.buffer.length-this.bufferOff,e.length-r),n=0;n<i;n++)this.buffer[this.bufferOff+n]=e[r+n];return this.bufferOff+=i,i},n.prototype._flushBuffer=function t(e,r){return this._update(this.buffer,0,e,r),this.bufferOff=0,this.blockSize},n.prototype._updateEncrypt=function t(e){var r=0,i=0,n=(this.bufferOff+e.length)/this.blockSize|0,o=new Array(n*this.blockSize);0!==this.bufferOff&&(r+=this._buffer(e,r),this.bufferOff===this.buffer.length&&(i+=this._flushBuffer(o,i)));for(var s=e.length-(e.length-r)%this.blockSize;r<s;r+=this.blockSize)this._update(e,r,o,i),i+=this.blockSize;for(;r<e.length;r++,this.bufferOff++)this.buffer[this.bufferOff]=e[r];return o},n.prototype._updateDecrypt=function t(e){for(var r=0,i=0,n=Math.ceil((this.bufferOff+e.length)/this.blockSize)-1,o=new Array(n*this.blockSize);n>0;n--)r+=this._buffer(e,r),i+=this._flushBuffer(o,i);return r+=this._buffer(e,r),o},n.prototype.final=function t(e){var r,i;return e&&(r=this.update(e)),i="encrypt"===this.type?this._finalEncrypt():this._finalDecrypt(),r?r.concat(i):i},n.prototype._pad=function t(e,r){if(0===r)return!1;for(;r<e.length;)e[r++]=0;return!0},n.prototype._finalEncrypt=function t(){if(!this._pad(this.buffer,this.bufferOff))return[];var e=new Array(this.blockSize);return this._update(this.buffer,0,e,0),e},n.prototype._unpad=function t(e){return e},n.prototype._finalDecrypt=function t(){i.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(t,e,r){var i=r(312),n=r(320),o=r(170);e.createCipher=e.Cipher=i.createCipher,e.createCipheriv=e.Cipheriv=i.createCipheriv,e.createDecipher=e.Decipher=n.createDecipher,e.createDecipheriv=e.Decipheriv=n.createDecipheriv,e.listCiphers=e.getCiphers=function s(){return Object.keys(o)}},function(t,e,r){var i={ECB:r(313),CBC:r(314),CFB:r(315),CFB8:r(316),CFB1:r(317),OFB:r(318),CTR:r(168),GCM:r(168)},n=r(170);for(var o in n)n[o].module=i[n[o].mode];t.exports=n},function(t,e,r){var i;function n(t){this.rand=t}if(t.exports=function t(e){return i||(i=new n(null)),i.generate(e)},t.exports.Rand=n,n.prototype.generate=function t(e){return this._rand(e)},n.prototype._rand=function t(e){if(this.rand.getBytes)return this.rand.getBytes(e);for(var r=new Uint8Array(e),i=0;i<r.length;i++)r[i]=this.rand.getByte();return r},"object"==typeof self)self.crypto&&self.crypto.getRandomValues?n.prototype._rand=function t(e){var r=new Uint8Array(e);return self.crypto.getRandomValues(r),r}:self.msCrypto&&self.msCrypto.getRandomValues?n.prototype._rand=function t(e){var r=new Uint8Array(e);return self.msCrypto.getRandomValues(r),r}:"object"==typeof window&&(n.prototype._rand=function(){throw new Error("Not implemented yet")});else try{var o=r(326);if("function"!=typeof o.randomBytes)throw new Error("Not supported");n.prototype._rand=function t(e){return o.randomBytes(e)}}catch(t){}},function(t,e,r){
/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
var i=r(7),n=i.Buffer;function o(t,e){for(var r in t)e[r]=t[r]}function s(t,e,r){return n(t,e,r)}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?t.exports=i:(o(i,e),e.Buffer=s),s.prototype=Object.create(n.prototype),o(n,s),s.from=function(t,e,r){if("number"==typeof t)throw new TypeError("Argument must not be a number");return n(t,e,r)},s.alloc=function(t,e,r){if("number"!=typeof t)throw new TypeError("Argument must be a number");var i=n(t);return void 0!==e?"string"==typeof r?i.fill(e,r):i.fill(e):i.fill(0),i},s.allocUnsafe=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return n(t)},s.allocUnsafeSlow=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return i.SlowBuffer(t)}},function(t,e,r){"use strict";var i=r(36).codes.ERR_STREAM_PREMATURE_CLOSE;function n(){}t.exports=function t(e,r,o){if("function"==typeof r)return t(e,null,r);r||(r={}),o=function s(t){var e=!1;return function(){if(!e){e=!0;for(var r=arguments.length,i=new Array(r),n=0;n<r;n++)i[n]=arguments[n];t.apply(this,i)}}}(o||n);var a=r.readable||!1!==r.readable&&e.readable,h=r.writable||!1!==r.writable&&e.writable,u=function t(){e.writable||c()},f=e._writableState&&e._writableState.finished,c=function t(){h=!1,f=!0,a||o.call(e)},l=e._readableState&&e._readableState.endEmitted,d=function t(){a=!1,l=!0,h||o.call(e)},p=function t(r){o.call(e,r)},m=function t(){var r;return a&&!l?(e._readableState&&e._readableState.ended||(r=new i),o.call(e,r)):h&&!f?(e._writableState&&e._writableState.ended||(r=new i),o.call(e,r)):void 0},g=function t(){e.req.on("finish",c)};return!function v(t){return t.setHeader&&"function"==typeof t.abort}(e)?h&&!e._writableState&&(e.on("end",u),e.on("close",u)):(e.on("complete",c),e.on("abort",m),e.req?g():e.on("request",g)),e.on("end",d),e.on("finish",c),!1!==r.error&&e.on("error",p),e.on("close",m),function(){e.removeListener("complete",c),e.removeListener("abort",m),e.removeListener("request",g),e.req&&e.req.removeListener("finish",c),e.removeListener("end",u),e.removeListener("close",u),e.removeListener("finish",c),e.removeListener("end",d),e.removeListener("error",p),e.removeListener("close",m)}}},function(t,e,r){(function(e){var i=r(102),n=r(31);function o(t){var e,r=t.modulus.byteLength();do{e=new i(n(r))}while(e.cmp(t.modulus)>=0||!e.umod(t.prime1)||!e.umod(t.prime2));return e}function s(t,r){var n=function s(t){var e=o(t);return{blinder:e.toRed(i.mont(t.modulus)).redPow(new i(t.publicExponent)).fromRed(),unblinder:e.invm(t.modulus)}}(r),a=r.modulus.byteLength(),h=new i(t).mul(n.blinder).umod(r.modulus),u=h.toRed(i.mont(r.prime1)),f=h.toRed(i.mont(r.prime2)),c=r.coefficient,l=r.prime1,d=r.prime2,p=u.redPow(r.exponent1).fromRed(),m=f.redPow(r.exponent2).fromRed(),g=p.isub(m).imul(c).umod(l).imul(d);return m.iadd(g).imul(n.unblinder).umod(r.modulus).toArrayLike(e,"be",a)}s.getr=o,t.exports=s}).call(this,r(26).Buffer)},function(t,e,r){(function(t){!function(t,e){"use strict";function i(t,e){if(!t)throw new Error(e||"Assertion failed")}function n(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function o(t,e,r){if(o.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var s;"object"==typeof t?t.exports=o:e.BN=o,o.BN=o,o.wordSize=26;try{s=r(339).Buffer}catch(t){}function a(t,e,r){for(var n=0,o=Math.min(t.length,r),s=0,a=e;a<o;a++){var h,u=t.charCodeAt(a)-48;n<<=4,n|=h=u>=49&&u<=54?u-49+10:u>=17&&u<=22?u-17+10:u,s|=h}return i(!(240&s),"Invalid character in "+t),n}function h(t,e,r,n){for(var o=0,s=0,a=Math.min(t.length,r),h=e;h<a;h++){var u=t.charCodeAt(h)-48;o*=n,s=u>=49?u-49+10:u>=17?u-17+10:u,i(u>=0&&s<n,"Invalid character"),o+=s}return o}function u(t,e){t.words=e.words,t.length=e.length,t.negative=e.negative,t.red=e.red}if(o.isBN=function t(e){return e instanceof o||null!==e&&"object"==typeof e&&e.constructor.wordSize===o.wordSize&&Array.isArray(e.words)},o.max=function t(e,r){return e.cmp(r)>0?e:r},o.min=function t(e,r){return e.cmp(r)<0?e:r},o.prototype._init=function t(e,r,n){if("number"==typeof e)return this._initNumber(e,r,n);if("object"==typeof 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)},o.prototype._initNumber=function t(e,r,n){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"===n&&this._initArray(this.toArray(),r,n)},o.prototype._initArray=function t(e,r,n){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 o=0;o<this.length;o++)this.words[o]=0;var s,a,h=0;if("be"===n)for(o=e.length-1,s=0;o>=0;o-=3)a=e[o]|e[o-1]<<8|e[o-2]<<16,this.words[s]|=a<<h&67108863,this.words[s+1]=a>>>26-h&67108863,(h+=24)>=26&&(h-=26,s++);else if("le"===n)for(o=0,s=0;o<e.length;o+=3)a=e[o]|e[o+1]<<8|e[o+2]<<16,this.words[s]|=a<<h&67108863,this.words[s+1]=a>>>26-h&67108863,(h+=24)>=26&&(h-=26,s++);return this._strip()},o.prototype._parseHex=function t(e,r){this.length=Math.ceil((e.length-r)/6),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var n,o,s=0;for(i=e.length-6,n=0;i>=r;i-=6)o=a(e,i,i+6),this.words[n]|=o<<s&67108863,this.words[n+1]|=o>>>26-s&4194303,(s+=24)>=26&&(s-=26,n++);i+6!==r&&(o=a(e,r,i+6),this.words[n]|=o<<s&67108863,this.words[n+1]|=o>>>26-s&4194303),this._strip()},o.prototype._parseBase=function t(e,r,i){this.words=[0],this.length=1;for(var n=0,o=1;o<=67108863;o*=r)n++;n--,o=o/r|0;for(var s=e.length-i,a=s%n,u=Math.min(s,s-a)+i,f=0,c=i;c<u;c+=n)f=h(e,c,c+n,r),this.imuln(o),this.words[0]+f<67108864?this.words[0]+=f:this._iaddn(f);if(0!==a){var l=1;for(f=h(e,c,e.length,r),c=0;c<a;c++)l*=r;this.imuln(l),this.words[0]+f<67108864?this.words[0]+=f:this._iaddn(f)}},o.prototype.copy=function t(e){e.words=new Array(this.length);for(var r=0;r<this.length;r++)e.words[r]=this.words[r];e.length=this.length,e.negative=this.negative,e.red=this.red},o.prototype._move=function t(e){u(e,this)},o.prototype.clone=function t(){var e=new o(null);return this.copy(e),e},o.prototype._expand=function t(e){for(;this.length<e;)this.words[this.length++]=0;return this},o.prototype._strip=function t(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function t(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{o.prototype[Symbol.for("nodejs.util.inspect.custom")]=f}catch(t){o.prototype.inspect=f}else o.prototype.inspect=f;function f(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var c=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],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],d=[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];o.prototype.toString=function t(e,r){var n;if(r=0|r||1,16===(e=e||10)||"hex"===e){n="";for(var o=0,s=0,a=0;a<this.length;a++){var h=this.words[a],u=(16777215&(h<<o|s)).toString(16);n=0!==(s=h>>>24-o&16777215)||a!==this.length-1?c[6-u.length]+u+n:u+n,(o+=2)>=26&&(o-=26,a--)}for(0!==s&&(n=s.toString(16)+n);n.length%r!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}if(e===(0|e)&&e>=2&&e<=36){var f=l[e],p=d[e];n="";var m=this.clone();for(m.negative=0;!m.isZero();){var g=m.modrn(p).toString(e);n=(m=m.idivn(p)).isZero()?g+n:c[f-g.length]+g+n}for(this.isZero()&&(n="0"+n);n.length%r!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}i(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function t(){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},o.prototype.toJSON=function t(){return this.toString(16,2)},s&&(o.prototype.toBuffer=function t(e,r){return this.toArrayLike(s,e,r)}),o.prototype.toArray=function t(e,r){return this.toArrayLike(Array,e,r)};function p(t,e,r){r.negative=e.negative^t.negative;var i=t.length+e.length|0;r.length=i,i=i-1|0;var n=0|t.words[0],o=0|e.words[0],s=n*o,a=67108863&s,h=s/67108864|0;r.words[0]=a;for(var u=1;u<i;u++){for(var f=h>>>26,c=67108863&h,l=Math.min(u,e.length-1),d=Math.max(0,u-t.length+1);d<=l;d++){var p=u-d|0;f+=(s=(n=0|t.words[p])*(o=0|e.words[d])+c)/67108864|0,c=67108863&s}r.words[u]=0|c,h=0|f}return 0!==h?r.words[u]=0|h:r.length--,r._strip()}o.prototype.toArrayLike=function t(e,r,n){this._strip();var o=this.byteLength(),s=n||Math.max(1,o);i(o<=s,"byte array longer than desired length"),i(s>0,"Requested array length <= 0");var a=function t(e,r){return e.allocUnsafe?e.allocUnsafe(r):new e(r)}(e,s);return this["_toArrayLike"+("le"===r?"LE":"BE")](a,o),a},o.prototype._toArrayLikeLE=function t(e,r){for(var i=0,n=0,o=0,s=0;o<this.length;o++){var a=this.words[o]<<s|n;e[i++]=255&a,i<e.length&&(e[i++]=a>>8&255),i<e.length&&(e[i++]=a>>16&255),6===s?(i<e.length&&(e[i++]=a>>24&255),n=0,s=0):(n=a>>>24,s+=2)}if(i<e.length)for(e[i++]=n;i<e.length;)e[i++]=0},o.prototype._toArrayLikeBE=function t(e,r){for(var i=e.length-1,n=0,o=0,s=0;o<this.length;o++){var a=this.words[o]<<s|n;e[i--]=255&a,i>=0&&(e[i--]=a>>8&255),i>=0&&(e[i--]=a>>16&255),6===s?(i>=0&&(e[i--]=a>>24&255),n=0,s=0):(n=a>>>24,s+=2)}if(i>=0)for(e[i--]=n;i>=0;)e[i--]=0},Math.clz32?o.prototype._countBits=function t(e){return 32-Math.clz32(e)}:o.prototype._countBits=function t(e){var r=e,i=0;return r>=4096&&(i+=13,r>>>=13),r>=64&&(i+=7,r>>>=7),r>=8&&(i+=4,r>>>=4),r>=2&&(i+=2,r>>>=2),i+r},o.prototype._zeroBits=function t(e){if(0===e)return 26;var r=e,i=0;return 0==(8191&r)&&(i+=13,r>>>=13),0==(127&r)&&(i+=7,r>>>=7),0==(15&r)&&(i+=4,r>>>=4),0==(3&r)&&(i+=2,r>>>=2),0==(1&r)&&i++,i},o.prototype.bitLength=function t(){var e=this.words[this.length-1],r=this._countBits(e);return 26*(this.length-1)+r},o.prototype.zeroBits=function t(){if(this.isZero())return 0;for(var e=0,r=0;r<this.length;r++){var i=this._zeroBits(this.words[r]);if(e+=i,26!==i)break}return e},o.prototype.byteLength=function t(){return Math.ceil(this.bitLength()/8)},o.prototype.toTwos=function t(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},o.prototype.fromTwos=function t(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},o.prototype.isNeg=function t(){return 0!==this.negative},o.prototype.neg=function t(){return this.clone().ineg()},o.prototype.ineg=function t(){return this.isZero()||(this.negative^=1),this},o.prototype.iuor=function t(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var r=0;r<e.length;r++)this.words[r]=this.words[r]|e.words[r];return this._strip()},o.prototype.ior=function t(e){return i(0==(this.negative|e.negative)),this.iuor(e)},o.prototype.or=function t(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},o.prototype.uor=function t(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},o.prototype.iuand=function t(e){var r;r=this.length>e.length?e:this;for(var i=0;i<r.length;i++)this.words[i]=this.words[i]&e.words[i];return this.length=r.length,this._strip()},o.prototype.iand=function t(e){return i(0==(this.negative|e.negative)),this.iuand(e)},o.prototype.and=function t(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},o.prototype.uand=function t(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},o.prototype.iuxor=function t(e){var r,i;this.length>e.length?(r=this,i=e):(r=e,i=this);for(var n=0;n<i.length;n++)this.words[n]=r.words[n]^i.words[n];if(this!==r)for(;n<r.length;n++)this.words[n]=r.words[n];return this.length=r.length,this._strip()},o.prototype.ixor=function t(e){return i(0==(this.negative|e.negative)),this.iuxor(e)},o.prototype.xor=function t(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},o.prototype.uxor=function t(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},o.prototype.inotn=function t(e){i("number"==typeof e&&e>=0);var r=0|Math.ceil(e/26),n=e%26;this._expand(r),n>0&&r--;for(var o=0;o<r;o++)this.words[o]=67108863&~this.words[o];return n>0&&(this.words[o]=~this.words[o]&67108863>>26-n),this._strip()},o.prototype.notn=function t(e){return this.clone().inotn(e)},o.prototype.setn=function t(e,r){i("number"==typeof e&&e>=0);var n=e/26|0,o=e%26;return this._expand(n+1),this.words[n]=r?this.words[n]|1<<o:this.words[n]&~(1<<o),this._strip()},o.prototype.iadd=function t(e){var r,i,n;if(0!==this.negative&&0===e.negative)return this.negative=0,r=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,r=this.isub(e),e.negative=1,r._normSign();this.length>e.length?(i=this,n=e):(i=e,n=this);for(var o=0,s=0;s<n.length;s++)r=(0|i.words[s])+(0|n.words[s])+o,this.words[s]=67108863&r,o=r>>>26;for(;0!==o&&s<i.length;s++)r=(0|i.words[s])+o,this.words[s]=67108863&r,o=r>>>26;if(this.length=i.length,0!==o)this.words[this.length]=o,this.length++;else if(i!==this)for(;s<i.length;s++)this.words[s]=i.words[s];return this},o.prototype.add=function t(e){var r;return 0!==e.negative&&0===this.negative?(e.negative=0,r=this.sub(e),e.negative^=1,r):0===e.negative&&0!==this.negative?(this.negative=0,r=e.sub(this),this.negative=1,r):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},o.prototype.isub=function t(e){if(0!==e.negative){e.negative=0;var r=this.iadd(e);return e.negative=1,r._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var i,n,o=this.cmp(e);if(0===o)return this.negative=0,this.length=1,this.words[0]=0,this;o>0?(i=this,n=e):(i=e,n=this);for(var s=0,a=0;a<n.length;a++)s=(r=(0|i.words[a])-(0|n.words[a])+s)>>26,this.words[a]=67108863&r;for(;0!==s&&a<i.length;a++)s=(r=(0|i.words[a])+s)>>26,this.words[a]=67108863&r;if(0===s&&a<i.length&&i!==this)for(;a<i.length;a++)this.words[a]=i.words[a];return this.length=Math.max(this.length,a),i!==this&&(this.negative=1),this._strip()},o.prototype.sub=function t(e){return this.clone().isub(e)};var m=function t(e,r,i){var n,o,s,a=e.words,h=r.words,u=i.words,f=0,c=0|a[0],l=8191&c,d=c>>>13,p=0|a[1],m=8191&p,g=p>>>13,v=0|a[2],b=8191&v,y=v>>>13,w=0|a[3],_=8191&w,M=w>>>13,S=0|a[4],k=8191&S,E=S>>>13,R=0|a[5],A=8191&R,x=R>>>13,T=0|a[6],P=8191&T,I=T>>>13,L=0|a[7],O=8191&L,B=L>>>13,j=0|a[8],C=8191&j,U=j>>>13,N=0|a[9],q=8191&N,D=N>>>13,z=0|h[0],F=8191&z,W=z>>>13,H=0|h[1],K=8191&H,Z=H>>>13,V=0|h[2],J=8191&V,Y=V>>>13,G=0|h[3],X=8191&G,Q=G>>>13,$=0|h[4],tt=8191&$,et=$>>>13,rt=0|h[5],it=8191&rt,nt=rt>>>13,ot=0|h[6],st=8191&ot,at=ot>>>13,ht=0|h[7],ut=8191&ht,ft=ht>>>13,ct=0|h[8],lt=8191&ct,dt=ct>>>13,pt=0|h[9],mt=8191&pt,gt=pt>>>13;i.negative=e.negative^r.negative,i.length=19;var vt=(f+(n=Math.imul(l,F))|0)+((8191&(o=(o=Math.imul(l,W))+Math.imul(d,F)|0))<<13)|0;f=((s=Math.imul(d,W))+(o>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(m,F),o=(o=Math.imul(m,W))+Math.imul(g,F)|0,s=Math.imul(g,W);var bt=(f+(n=n+Math.imul(l,K)|0)|0)+((8191&(o=(o=o+Math.imul(l,Z)|0)+Math.imul(d,K)|0))<<13)|0;f=((s=s+Math.imul(d,Z)|0)+(o>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(b,F),o=(o=Math.imul(b,W))+Math.imul(y,F)|0,s=Math.imul(y,W),n=n+Math.imul(m,K)|0,o=(o=o+Math.imul(m,Z)|0)+Math.imul(g,K)|0,s=s+Math.imul(g,Z)|0;var yt=(f+(n=n+Math.imul(l,J)|0)|0)+((8191&(o=(o=o+Math.imul(l,Y)|0)+Math.imul(d,J)|0))<<13)|0;f=((s=s+Math.imul(d,Y)|0)+(o>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(_,F),o=(o=Math.imul(_,W))+Math.imul(M,F)|0,s=Math.imul(M,W),n=n+Math.imul(b,K)|0,o=(o=o+Math.imul(b,Z)|0)+Math.imul(y,K)|0,s=s+Math.imul(y,Z)|0,n=n+Math.imul(m,J)|0,o=(o=o+Math.imul(m,Y)|0)+Math.imul(g,J)|0,s=s+Math.imul(g,Y)|0;var wt=(f+(n=n+Math.imul(l,X)|0)|0)+((8191&(o=(o=o+Math.imul(l,Q)|0)+Math.imul(d,X)|0))<<13)|0;f=((s=s+Math.imul(d,Q)|0)+(o>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(k,F),o=(o=Math.imul(k,W))+Math.imul(E,F)|0,s=Math.imul(E,W),n=n+Math.imul(_,K)|0,o=(o=o+Math.imul(_,Z)|0)+Math.imul(M,K)|0,s=s+Math.imul(M,Z)|0,n=n+Math.imul(b,J)|0,o=(o=o+Math.imul(b,Y)|0)+Math.imul(y,J)|0,s=s+Math.imul(y,Y)|0,n=n+Math.imul(m,X)|0,o=(o=o+Math.imul(m,Q)|0)+Math.imul(g,X)|0,s=s+Math.imul(g,Q)|0;var _t=(f+(n=n+Math.imul(l,tt)|0)|0)+((8191&(o=(o=o+Math.imul(l,et)|0)+Math.imul(d,tt)|0))<<13)|0;f=((s=s+Math.imul(d,et)|0)+(o>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(A,F),o=(o=Math.imul(A,W))+Math.imul(x,F)|0,s=Math.imul(x,W),n=n+Math.imul(k,K)|0,o=(o=o+Math.imul(k,Z)|0)+Math.imul(E,K)|0,s=s+Math.imul(E,Z)|0,n=n+Math.imul(_,J)|0,o=(o=o+Math.imul(_,Y)|0)+Math.imul(M,J)|0,s=s+Math.imul(M,Y)|0,n=n+Math.imul(b,X)|0,o=(o=o+Math.imul(b,Q)|0)+Math.imul(y,X)|0,s=s+Math.imul(y,Q)|0,n=n+Math.imul(m,tt)|0,o=(o=o+Math.imul(m,et)|0)+Math.imul(g,tt)|0,s=s+Math.imul(g,et)|0;var Mt=(f+(n=n+Math.imul(l,it)|0)|0)+((8191&(o=(o=o+Math.imul(l,nt)|0)+Math.imul(d,it)|0))<<13)|0;f=((s=s+Math.imul(d,nt)|0)+(o>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(P,F),o=(o=Math.imul(P,W))+Math.imul(I,F)|0,s=Math.imul(I,W),n=n+Math.imul(A,K)|0,o=(o=o+Math.imul(A,Z)|0)+Math.imul(x,K)|0,s=s+Math.imul(x,Z)|0,n=n+Math.imul(k,J)|0,o=(o=o+Math.imul(k,Y)|0)+Math.imul(E,J)|0,s=s+Math.imul(E,Y)|0,n=n+Math.imul(_,X)|0,o=(o=o+Math.imul(_,Q)|0)+Math.imul(M,X)|0,s=s+Math.imul(M,Q)|0,n=n+Math.imul(b,tt)|0,o=(o=o+Math.imul(b,et)|0)+Math.imul(y,tt)|0,s=s+Math.imul(y,et)|0,n=n+Math.imul(m,it)|0,o=(o=o+Math.imul(m,nt)|0)+Math.imul(g,it)|0,s=s+Math.imul(g,nt)|0;var St=(f+(n=n+Math.imul(l,st)|0)|0)+((8191&(o=(o=o+Math.imul(l,at)|0)+Math.imul(d,st)|0))<<13)|0;f=((s=s+Math.imul(d,at)|0)+(o>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(O,F),o=(o=Math.imul(O,W))+Math.imul(B,F)|0,s=Math.imul(B,W),n=n+Math.imul(P,K)|0,o=(o=o+Math.imul(P,Z)|0)+Math.imul(I,K)|0,s=s+Math.imul(I,Z)|0,n=n+Math.imul(A,J)|0,o=(o=o+Math.imul(A,Y)|0)+Math.imul(x,J)|0,s=s+Math.imul(x,Y)|0,n=n+Math.imul(k,X)|0,o=(o=o+Math.imul(k,Q)|0)+Math.imul(E,X)|0,s=s+Math.imul(E,Q)|0,n=n+Math.imul(_,tt)|0,o=(o=o+Math.imul(_,et)|0)+Math.imul(M,tt)|0,s=s+Math.imul(M,et)|0,n=n+Math.imul(b,it)|0,o=(o=o+Math.imul(b,nt)|0)+Math.imul(y,it)|0,s=s+Math.imul(y,nt)|0,n=n+Math.imul(m,st)|0,o=(o=o+Math.imul(m,at)|0)+Math.imul(g,st)|0,s=s+Math.imul(g,at)|0;var kt=(f+(n=n+Math.imul(l,ut)|0)|0)+((8191&(o=(o=o+Math.imul(l,ft)|0)+Math.imul(d,ut)|0))<<13)|0;f=((s=s+Math.imul(d,ft)|0)+(o>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(C,F),o=(o=Math.imul(C,W))+Math.imul(U,F)|0,s=Math.imul(U,W),n=n+Math.imul(O,K)|0,o=(o=o+Math.imul(O,Z)|0)+Math.imul(B,K)|0,s=s+Math.imul(B,Z)|0,n=n+Math.imul(P,J)|0,o=(o=o+Math.imul(P,Y)|0)+Math.imul(I,J)|0,s=s+Math.imul(I,Y)|0,n=n+Math.imul(A,X)|0,o=(o=o+Math.imul(A,Q)|0)+Math.imul(x,X)|0,s=s+Math.imul(x,Q)|0,n=n+Math.imul(k,tt)|0,o=(o=o+Math.imul(k,et)|0)+Math.imul(E,tt)|0,s=s+Math.imul(E,et)|0,n=n+Math.imul(_,it)|0,o=(o=o+Math.imul(_,nt)|0)+Math.imul(M,it)|0,s=s+Math.imul(M,nt)|0,n=n+Math.imul(b,st)|0,o=(o=o+Math.imul(b,at)|0)+Math.imul(y,st)|0,s=s+Math.imul(y,at)|0,n=n+Math.imul(m,ut)|0,o=(o=o+Math.imul(m,ft)|0)+Math.imul(g,ut)|0,s=s+Math.imul(g,ft)|0;var Et=(f+(n=n+Math.imul(l,lt)|0)|0)+((8191&(o=(o=o+Math.imul(l,dt)|0)+Math.imul(d,lt)|0))<<13)|0;f=((s=s+Math.imul(d,dt)|0)+(o>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(q,F),o=(o=Math.imul(q,W))+Math.imul(D,F)|0,s=Math.imul(D,W),n=n+Math.imul(C,K)|0,o=(o=o+Math.imul(C,Z)|0)+Math.imul(U,K)|0,s=s+Math.imul(U,Z)|0,n=n+Math.imul(O,J)|0,o=(o=o+Math.imul(O,Y)|0)+Math.imul(B,J)|0,s=s+Math.imul(B,Y)|0,n=n+Math.imul(P,X)|0,o=(o=o+Math.imul(P,Q)|0)+Math.imul(I,X)|0,s=s+Math.imul(I,Q)|0,n=n+Math.imul(A,tt)|0,o=(o=o+Math.imul(A,et)|0)+Math.imul(x,tt)|0,s=s+Math.imul(x,et)|0,n=n+Math.imul(k,it)|0,o=(o=o+Math.imul(k,nt)|0)+Math.imul(E,it)|0,s=s+Math.imul(E,nt)|0,n=n+Math.imul(_,st)|0,o=(o=o+Math.imul(_,at)|0)+Math.imul(M,st)|0,s=s+Math.imul(M,at)|0,n=n+Math.imul(b,ut)|0,o=(o=o+Math.imul(b,ft)|0)+Math.imul(y,ut)|0,s=s+Math.imul(y,ft)|0,n=n+Math.imul(m,lt)|0,o=(o=o+Math.imul(m,dt)|0)+Math.imul(g,lt)|0,s=s+Math.imul(g,dt)|0;var Rt=(f+(n=n+Math.imul(l,mt)|0)|0)+((8191&(o=(o=o+Math.imul(l,gt)|0)+Math.imul(d,mt)|0))<<13)|0;f=((s=s+Math.imul(d,gt)|0)+(o>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,n=Math.imul(q,K),o=(o=Math.imul(q,Z))+Math.imul(D,K)|0,s=Math.imul(D,Z),n=n+Math.imul(C,J)|0,o=(o=o+Math.imul(C,Y)|0)+Math.imul(U,J)|0,s=s+Math.imul(U,Y)|0,n=n+Math.imul(O,X)|0,o=(o=o+Math.imul(O,Q)|0)+Math.imul(B,X)|0,s=s+Math.imul(B,Q)|0,n=n+Math.imul(P,tt)|0,o=(o=o+Math.imul(P,et)|0)+Math.imul(I,tt)|0,s=s+Math.imul(I,et)|0,n=n+Math.imul(A,it)|0,o=(o=o+Math.imul(A,nt)|0)+Math.imul(x,it)|0,s=s+Math.imul(x,nt)|0,n=n+Math.imul(k,st)|0,o=(o=o+Math.imul(k,at)|0)+Math.imul(E,st)|0,s=s+Math.imul(E,at)|0,n=n+Math.imul(_,ut)|0,o=(o=o+Math.imul(_,ft)|0)+Math.imul(M,ut)|0,s=s+Math.imul(M,ft)|0,n=n+Math.imul(b,lt)|0,o=(o=o+Math.imul(b,dt)|0)+Math.imul(y,lt)|0,s=s+Math.imul(y,dt)|0;var At=(f+(n=n+Math.imul(m,mt)|0)|0)+((8191&(o=(o=o+Math.imul(m,gt)|0)+Math.imul(g,mt)|0))<<13)|0;f=((s=s+Math.imul(g,gt)|0)+(o>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(q,J),o=(o=Math.imul(q,Y))+Math.imul(D,J)|0,s=Math.imul(D,Y),n=n+Math.imul(C,X)|0,o=(o=o+Math.imul(C,Q)|0)+Math.imul(U,X)|0,s=s+Math.imul(U,Q)|0,n=n+Math.imul(O,tt)|0,o=(o=o+Math.imul(O,et)|0)+Math.imul(B,tt)|0,s=s+Math.imul(B,et)|0,n=n+Math.imul(P,it)|0,o=(o=o+Math.imul(P,nt)|0)+Math.imul(I,it)|0,s=s+Math.imul(I,nt)|0,n=n+Math.imul(A,st)|0,o=(o=o+Math.imul(A,at)|0)+Math.imul(x,st)|0,s=s+Math.imul(x,at)|0,n=n+Math.imul(k,ut)|0,o=(o=o+Math.imul(k,ft)|0)+Math.imul(E,ut)|0,s=s+Math.imul(E,ft)|0,n=n+Math.imul(_,lt)|0,o=(o=o+Math.imul(_,dt)|0)+Math.imul(M,lt)|0,s=s+Math.imul(M,dt)|0;var xt=(f+(n=n+Math.imul(b,mt)|0)|0)+((8191&(o=(o=o+Math.imul(b,gt)|0)+Math.imul(y,mt)|0))<<13)|0;f=((s=s+Math.imul(y,gt)|0)+(o>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(q,X),o=(o=Math.imul(q,Q))+Math.imul(D,X)|0,s=Math.imul(D,Q),n=n+Math.imul(C,tt)|0,o=(o=o+Math.imul(C,et)|0)+Math.imul(U,tt)|0,s=s+Math.imul(U,et)|0,n=n+Math.imul(O,it)|0,o=(o=o+Math.imul(O,nt)|0)+Math.imul(B,it)|0,s=s+Math.imul(B,nt)|0,n=n+Math.imul(P,st)|0,o=(o=o+Math.imul(P,at)|0)+Math.imul(I,st)|0,s=s+Math.imul(I,at)|0,n=n+Math.imul(A,ut)|0,o=(o=o+Math.imul(A,ft)|0)+Math.imul(x,ut)|0,s=s+Math.imul(x,ft)|0,n=n+Math.imul(k,lt)|0,o=(o=o+Math.imul(k,dt)|0)+Math.imul(E,lt)|0,s=s+Math.imul(E,dt)|0;var Tt=(f+(n=n+Math.imul(_,mt)|0)|0)+((8191&(o=(o=o+Math.imul(_,gt)|0)+Math.imul(M,mt)|0))<<13)|0;f=((s=s+Math.imul(M,gt)|0)+(o>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(q,tt),o=(o=Math.imul(q,et))+Math.imul(D,tt)|0,s=Math.imul(D,et),n=n+Math.imul(C,it)|0,o=(o=o+Math.imul(C,nt)|0)+Math.imul(U,it)|0,s=s+Math.imul(U,nt)|0,n=n+Math.imul(O,st)|0,o=(o=o+Math.imul(O,at)|0)+Math.imul(B,st)|0,s=s+Math.imul(B,at)|0,n=n+Math.imul(P,ut)|0,o=(o=o+Math.imul(P,ft)|0)+Math.imul(I,ut)|0,s=s+Math.imul(I,ft)|0,n=n+Math.imul(A,lt)|0,o=(o=o+Math.imul(A,dt)|0)+Math.imul(x,lt)|0,s=s+Math.imul(x,dt)|0;var Pt=(f+(n=n+Math.imul(k,mt)|0)|0)+((8191&(o=(o=o+Math.imul(k,gt)|0)+Math.imul(E,mt)|0))<<13)|0;f=((s=s+Math.imul(E,gt)|0)+(o>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,n=Math.imul(q,it),o=(o=Math.imul(q,nt))+Math.imul(D,it)|0,s=Math.imul(D,nt),n=n+Math.imul(C,st)|0,o=(o=o+Math.imul(C,at)|0)+Math.imul(U,st)|0,s=s+Math.imul(U,at)|0,n=n+Math.imul(O,ut)|0,o=(o=o+Math.imul(O,ft)|0)+Math.imul(B,ut)|0,s=s+Math.imul(B,ft)|0,n=n+Math.imul(P,lt)|0,o=(o=o+Math.imul(P,dt)|0)+Math.imul(I,lt)|0,s=s+Math.imul(I,dt)|0;var It=(f+(n=n+Math.imul(A,mt)|0)|0)+((8191&(o=(o=o+Math.imul(A,gt)|0)+Math.imul(x,mt)|0))<<13)|0;f=((s=s+Math.imul(x,gt)|0)+(o>>>13)|0)+(It>>>26)|0,It&=67108863,n=Math.imul(q,st),o=(o=Math.imul(q,at))+Math.imul(D,st)|0,s=Math.imul(D,at),n=n+Math.imul(C,ut)|0,o=(o=o+Math.imul(C,ft)|0)+Math.imul(U,ut)|0,s=s+Math.imul(U,ft)|0,n=n+Math.imul(O,lt)|0,o=(o=o+Math.imul(O,dt)|0)+Math.imul(B,lt)|0,s=s+Math.imul(B,dt)|0;var Lt=(f+(n=n+Math.imul(P,mt)|0)|0)+((8191&(o=(o=o+Math.imul(P,gt)|0)+Math.imul(I,mt)|0))<<13)|0;f=((s=s+Math.imul(I,gt)|0)+(o>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,n=Math.imul(q,ut),o=(o=Math.imul(q,ft))+Math.imul(D,ut)|0,s=Math.imul(D,ft),n=n+Math.imul(C,lt)|0,o=(o=o+Math.imul(C,dt)|0)+Math.imul(U,lt)|0,s=s+Math.imul(U,dt)|0;var Ot=(f+(n=n+Math.imul(O,mt)|0)|0)+((8191&(o=(o=o+Math.imul(O,gt)|0)+Math.imul(B,mt)|0))<<13)|0;f=((s=s+Math.imul(B,gt)|0)+(o>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,n=Math.imul(q,lt),o=(o=Math.imul(q,dt))+Math.imul(D,lt)|0,s=Math.imul(D,dt);var Bt=(f+(n=n+Math.imul(C,mt)|0)|0)+((8191&(o=(o=o+Math.imul(C,gt)|0)+Math.imul(U,mt)|0))<<13)|0;f=((s=s+Math.imul(U,gt)|0)+(o>>>13)|0)+(Bt>>>26)|0,Bt&=67108863;var jt=(f+(n=Math.imul(q,mt))|0)+((8191&(o=(o=Math.imul(q,gt))+Math.imul(D,mt)|0))<<13)|0;return f=((s=Math.imul(D,gt))+(o>>>13)|0)+(jt>>>26)|0,jt&=67108863,u[0]=vt,u[1]=bt,u[2]=yt,u[3]=wt,u[4]=_t,u[5]=Mt,u[6]=St,u[7]=kt,u[8]=Et,u[9]=Rt,u[10]=At,u[11]=xt,u[12]=Tt,u[13]=Pt,u[14]=It,u[15]=Lt,u[16]=Ot,u[17]=Bt,u[18]=jt,0!==f&&(u[19]=f,i.length++),i};function g(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var i=0,n=0,o=0;o<r.length-1;o++){var s=n;n=0;for(var a=67108863&i,h=Math.min(o,e.length-1),u=Math.max(0,o-t.length+1);u<=h;u++){var f=o-u,c=(0|t.words[f])*(0|e.words[u]),l=67108863&c;a=67108863&(l=l+a|0),n+=(s=(s=s+(c/67108864|0)|0)+(l>>>26)|0)>>>26,s&=67108863}r.words[o]=a,i=s,s=n}return 0!==i?r.words[o]=i:r.length--,r._strip()}function v(t,e,r){return g(t,e,r)}function b(t,e){this.x=t,this.y=e}Math.imul||(m=p),o.prototype.mulTo=function t(e,r){var i=this.length+e.length;return 10===this.length&&10===e.length?m(this,e,r):i<63?p(this,e,r):i<1024?g(this,e,r):v(this,e,r)},b.prototype.makeRBT=function t(e){for(var r=new Array(e),i=o.prototype._countBits(e)-1,n=0;n<e;n++)r[n]=this.revBin(n,i,e);return r},b.prototype.revBin=function t(e,r,i){if(0===e||e===i-1)return e;for(var n=0,o=0;o<r;o++)n|=(1&e)<<r-o-1,e>>=1;return n},b.prototype.permute=function t(e,r,i,n,o,s){for(var a=0;a<s;a++)n[a]=r[e[a]],o[a]=i[e[a]]},b.prototype.transform=function t(e,r,i,n,o,s){this.permute(s,e,r,i,n,o);for(var a=1;a<o;a<<=1)for(var h=a<<1,u=Math.cos(2*Math.PI/h),f=Math.sin(2*Math.PI/h),c=0;c<o;c+=h)for(var l=u,d=f,p=0;p<a;p++){var m=i[c+p],g=n[c+p],v=i[c+p+a],b=n[c+p+a],y=l*v-d*b;b=l*b+d*v,v=y,i[c+p]=m+v,n[c+p]=g+b,i[c+p+a]=m-v,n[c+p+a]=g-b,p!==h&&(y=u*l-f*d,d=u*d+f*l,l=y)}},b.prototype.guessLen13b=function t(e,r){var i=1|Math.max(r,e),n=1&i,o=0;for(i=i/2|0;i;i>>>=1)o++;return 1<<o+1+n},b.prototype.conjugate=function t(e,r,i){if(!(i<=1))for(var n=0;n<i/2;n++){var o=e[n];e[n]=e[i-n-1],e[i-n-1]=o,o=r[n],r[n]=-r[i-n-1],r[i-n-1]=-o}},b.prototype.normalize13b=function t(e,r){for(var i=0,n=0;n<r/2;n++){var o=8192*Math.round(e[2*n+1]/r)+Math.round(e[2*n]/r)+i;e[n]=67108863&o,i=o<67108864?0:o/67108864|0}return e},b.prototype.convert13b=function t(e,r,n,o){for(var s=0,a=0;a<r;a++)s+=0|e[a],n[2*a]=8191&s,s>>>=13,n[2*a+1]=8191&s,s>>>=13;for(a=2*r;a<o;++a)n[a]=0;i(0===s),i(0==(-8192&s))},b.prototype.stub=function t(e){for(var r=new Array(e),i=0;i<e;i++)r[i]=0;return r},b.prototype.mulp=function t(e,r,i){var n=2*this.guessLen13b(e.length,r.length),o=this.makeRBT(n),s=this.stub(n),a=new Array(n),h=new Array(n),u=new Array(n),f=new Array(n),c=new Array(n),l=new Array(n),d=i.words;d.length=n,this.convert13b(e.words,e.length,a,n),this.convert13b(r.words,r.length,f,n),this.transform(a,s,h,u,n,o),this.transform(f,s,c,l,n,o);for(var p=0;p<n;p++){var m=h[p]*c[p]-u[p]*l[p];u[p]=h[p]*l[p]+u[p]*c[p],h[p]=m}return this.conjugate(h,u,n),this.transform(h,u,d,s,n,o),this.conjugate(d,s,n),this.normalize13b(d,n),i.negative=e.negative^r.negative,i.length=e.length+r.length,i._strip()},o.prototype.mul=function t(e){var r=new o(null);return r.words=new Array(this.length+e.length),this.mulTo(e,r)},o.prototype.mulf=function t(e){var r=new o(null);return r.words=new Array(this.length+e.length),v(this,e,r)},o.prototype.imul=function t(e){return this.clone().mulTo(e,this)},o.prototype.imuln=function t(e){var r=e<0;r&&(e=-e),i("number"==typeof e),i(e<67108864);for(var n=0,o=0;o<this.length;o++){var s=(0|this.words[o])*e,a=(67108863&s)+(67108863&n);n>>=26,n+=s/67108864|0,n+=a>>>26,this.words[o]=67108863&a}return 0!==n&&(this.words[o]=n,this.length++),r?this.ineg():this},o.prototype.muln=function t(e){return this.clone().imuln(e)},o.prototype.sqr=function t(){return this.mul(this)},o.prototype.isqr=function t(){return this.imul(this.clone())},o.prototype.pow=function t(e){var r=function i(t){for(var e=new Array(t.bitLength()),r=0;r<e.length;r++){var i=r/26|0,n=r%26;e[r]=t.words[i]>>>n&1}return e}(e);if(0===r.length)return new o(1);for(var n=this,s=0;s<r.length&&0===r[s];s++,n=n.sqr());if(++s<r.length)for(var a=n.sqr();s<r.length;s++,a=a.sqr())0!==r[s]&&(n=n.mul(a));return n},o.prototype.iushln=function t(e){i("number"==typeof e&&e>=0);var r,n=e%26,o=(e-n)/26,s=67108863>>>26-n<<26-n;if(0!==n){var a=0;for(r=0;r<this.length;r++){var h=this.words[r]&s,u=(0|this.words[r])-h<<n;this.words[r]=u|a,a=h>>>26-n}a&&(this.words[r]=a,this.length++)}if(0!==o){for(r=this.length-1;r>=0;r--)this.words[r+o]=this.words[r];for(r=0;r<o;r++)this.words[r]=0;this.length+=o}return this._strip()},o.prototype.ishln=function t(e){return i(0===this.negative),this.iushln(e)},o.prototype.iushrn=function t(e,r,n){var o;i("number"==typeof e&&e>=0),o=r?(r-r%26)/26:0;var s=e%26,a=Math.min((e-s)/26,this.length),h=67108863^67108863>>>s<<s,u=n;if(o-=a,o=Math.max(0,o),u){for(var f=0;f<a;f++)u.words[f]=this.words[f];u.length=a}if(0===a);else if(this.length>a)for(this.length-=a,f=0;f<this.length;f++)this.words[f]=this.words[f+a];else this.words[0]=0,this.length=1;var c=0;for(f=this.length-1;f>=0&&(0!==c||f>=o);f--){var l=0|this.words[f];this.words[f]=c<<26-s|l>>>s,c=l&h}return u&&0!==c&&(u.words[u.length++]=c),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},o.prototype.ishrn=function t(e,r,n){return i(0===this.negative),this.iushrn(e,r,n)},o.prototype.shln=function t(e){return this.clone().ishln(e)},o.prototype.ushln=function t(e){return this.clone().iushln(e)},o.prototype.shrn=function t(e){return this.clone().ishrn(e)},o.prototype.ushrn=function t(e){return this.clone().iushrn(e)},o.prototype.testn=function t(e){i("number"==typeof e&&e>=0);var r=e%26,n=(e-r)/26,o=1<<r;return!(this.length<=n)&&!!(this.words[n]&o)},o.prototype.imaskn=function t(e){i("number"==typeof e&&e>=0);var r=e%26,n=(e-r)/26;if(i(0===this.negative,"imaskn works only with positive numbers"),this.length<=n)return this;if(0!==r&&n++,this.length=Math.min(n,this.length),0!==r){var o=67108863^67108863>>>r<<r;this.words[this.length-1]&=o}return this._strip()},o.prototype.maskn=function t(e){return this.clone().imaskn(e)},o.prototype.iaddn=function t(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)},o.prototype._iaddn=function t(e){this.words[0]+=e;for(var r=0;r<this.length&&this.words[r]>=67108864;r++)this.words[r]-=67108864,r===this.length-1?this.words[r+1]=1:this.words[r+1]++;return this.length=Math.max(this.length,r+1),this},o.prototype.isubn=function t(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 r=0;r<this.length&&this.words[r]<0;r++)this.words[r]+=67108864,this.words[r+1]-=1;return this._strip()},o.prototype.addn=function t(e){return this.clone().iaddn(e)},o.prototype.subn=function t(e){return this.clone().isubn(e)},o.prototype.iabs=function t(){return this.negative=0,this},o.prototype.abs=function t(){return this.clone().iabs()},o.prototype._ishlnsubmul=function t(e,r,n){var o,s,a=e.length+n;this._expand(a);var h=0;for(o=0;o<e.length;o++){s=(0|this.words[o+n])+h;var u=(0|e.words[o])*r;h=((s-=67108863&u)>>26)-(u/67108864|0),this.words[o+n]=67108863&s}for(;o<this.length-n;o++)h=(s=(0|this.words[o+n])+h)>>26,this.words[o+n]=67108863&s;if(0===h)return this._strip();for(i(-1===h),h=0,o=0;o<this.length;o++)h=(s=-(0|this.words[o])+h)>>26,this.words[o]=67108863&s;return this.negative=1,this._strip()},o.prototype._wordDiv=function t(e,r){var i=(this.length,e.length),n=this.clone(),s=e,a=0|s.words[s.length-1];0!==(i=26-this._countBits(a))&&(s=s.ushln(i),n.iushln(i),a=0|s.words[s.length-1]);var h,u=n.length-s.length;if("mod"!==r){(h=new o(null)).length=u+1,h.words=new Array(h.length);for(var f=0;f<h.length;f++)h.words[f]=0}var c=n.clone()._ishlnsubmul(s,1,u);0===c.negative&&(n=c,h&&(h.words[u]=1));for(var l=u-1;l>=0;l--){var d=67108864*(0|n.words[s.length+l])+(0|n.words[s.length+l-1]);for(d=Math.min(d/a|0,67108863),n._ishlnsubmul(s,d,l);0!==n.negative;)d--,n.negative=0,n._ishlnsubmul(s,1,l),n.isZero()||(n.negative^=1);h&&(h.words[l]=d)}return h&&h._strip(),n._strip(),"div"!==r&&0!==i&&n.iushrn(i),{div:h||null,mod:n}},o.prototype.divmod=function t(e,r,n){return i(!e.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===e.negative?(h=this.neg().divmod(e,r),"mod"!==r&&(s=h.div.neg()),"div"!==r&&(a=h.mod.neg(),n&&0!==a.negative&&a.iadd(e)),{div:s,mod:a}):0===this.negative&&0!==e.negative?(h=this.divmod(e.neg(),r),"mod"!==r&&(s=h.div.neg()),{div:s,mod:h.mod}):0!=(this.negative&e.negative)?(h=this.neg().divmod(e.neg(),r),"div"!==r&&(a=h.mod.neg(),n&&0!==a.negative&&a.isub(e)),{div:h.div,mod:a}):e.length>this.length||this.cmp(e)<0?{div:new o(0),mod:this}:1===e.length?"div"===r?{div:this.divn(e.words[0]),mod:null}:"mod"===r?{div:null,mod:new o(this.modrn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new o(this.modrn(e.words[0]))}:this._wordDiv(e,r);var s,a,h},o.prototype.div=function t(e){return this.divmod(e,"div",!1).div},o.prototype.mod=function t(e){return this.divmod(e,"mod",!1).mod},o.prototype.umod=function t(e){return this.divmod(e,"mod",!0).mod},o.prototype.divRound=function t(e){var r=this.divmod(e);if(r.mod.isZero())return r.div;var i=0!==r.div.negative?r.mod.isub(e):r.mod,n=e.ushrn(1),o=e.andln(1),s=i.cmp(n);return s<0||1===o&&0===s?r.div:0!==r.div.negative?r.div.isubn(1):r.div.iaddn(1)},o.prototype.modrn=function t(e){var r=e<0;r&&(e=-e),i(e<=67108863);for(var n=(1<<26)%e,o=0,s=this.length-1;s>=0;s--)o=(n*o+(0|this.words[s]))%e;return r?-o:o},o.prototype.modn=function t(e){return this.modrn(e)},o.prototype.idivn=function t(e){var r=e<0;r&&(e=-e),i(e<=67108863);for(var n=0,o=this.length-1;o>=0;o--){var s=(0|this.words[o])+67108864*n;this.words[o]=s/e|0,n=s%e}return this._strip(),r?this.ineg():this},o.prototype.divn=function t(e){return this.clone().idivn(e)},o.prototype.egcd=function t(e){i(0===e.negative),i(!e.isZero());var r=this,n=e.clone();r=0!==r.negative?r.umod(e):r.clone();for(var s=new o(1),a=new o(0),h=new o(0),u=new o(1),f=0;r.isEven()&&n.isEven();)r.iushrn(1),n.iushrn(1),++f;for(var c=n.clone(),l=r.clone();!r.isZero();){for(var d=0,p=1;0==(r.words[0]&p)&&d<26;++d,p<<=1);if(d>0)for(r.iushrn(d);d-- >0;)(s.isOdd()||a.isOdd())&&(s.iadd(c),a.isub(l)),s.iushrn(1),a.iushrn(1);for(var m=0,g=1;0==(n.words[0]&g)&&m<26;++m,g<<=1);if(m>0)for(n.iushrn(m);m-- >0;)(h.isOdd()||u.isOdd())&&(h.iadd(c),u.isub(l)),h.iushrn(1),u.iushrn(1);r.cmp(n)>=0?(r.isub(n),s.isub(h),a.isub(u)):(n.isub(r),h.isub(s),u.isub(a))}return{a:h,b:u,gcd:n.iushln(f)}},o.prototype._invmp=function t(e){i(0===e.negative),i(!e.isZero());var r=this,n=e.clone();r=0!==r.negative?r.umod(e):r.clone();for(var s,a=new o(1),h=new o(0),u=n.clone();r.cmpn(1)>0&&n.cmpn(1)>0;){for(var f=0,c=1;0==(r.words[0]&c)&&f<26;++f,c<<=1);if(f>0)for(r.iushrn(f);f-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);for(var l=0,d=1;0==(n.words[0]&d)&&l<26;++l,d<<=1);if(l>0)for(n.iushrn(l);l-- >0;)h.isOdd()&&h.iadd(u),h.iushrn(1);r.cmp(n)>=0?(r.isub(n),a.isub(h)):(n.isub(r),h.isub(a))}return(s=0===r.cmpn(1)?a:h).cmpn(0)<0&&s.iadd(e),s},o.prototype.gcd=function t(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var r=this.clone(),i=e.clone();r.negative=0,i.negative=0;for(var n=0;r.isEven()&&i.isEven();n++)r.iushrn(1),i.iushrn(1);for(;;){for(;r.isEven();)r.iushrn(1);for(;i.isEven();)i.iushrn(1);var o=r.cmp(i);if(o<0){var s=r;r=i,i=s}else if(0===o||0===i.cmpn(1))break;r.isub(i)}return i.iushln(n)},o.prototype.invm=function t(e){return this.egcd(e).a.umod(e)},o.prototype.isEven=function t(){return 0==(1&this.words[0])},o.prototype.isOdd=function t(){return 1==(1&this.words[0])},o.prototype.andln=function t(e){return this.words[0]&e},o.prototype.bincn=function t(e){i("number"==typeof e);var r=e%26,n=(e-r)/26,o=1<<r;if(this.length<=n)return this._expand(n+1),this.words[n]|=o,this;for(var s=o,a=n;0!==s&&a<this.length;a++){var h=0|this.words[a];s=(h+=s)>>>26,h&=67108863,this.words[a]=h}return 0!==s&&(this.words[a]=s,this.length++),this},o.prototype.isZero=function t(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function t(e){var r,n=e<0;if(0!==this.negative&&!n)return-1;if(0===this.negative&&n)return 1;if(this._strip(),this.length>1)r=1;else{n&&(e=-e),i(e<=67108863,"Number is too big");var o=0|this.words[0];r=o===e?0:o<e?-1:1}return 0!==this.negative?0|-r:r},o.prototype.cmp=function t(e){if(0!==this.negative&&0===e.negative)return-1;if(0===this.negative&&0!==e.negative)return 1;var r=this.ucmp(e);return 0!==this.negative?0|-r:r},o.prototype.ucmp=function t(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var r=0,i=this.length-1;i>=0;i--){var n=0|this.words[i],o=0|e.words[i];if(n!==o){n<o?r=-1:n>o&&(r=1);break}}return r},o.prototype.gtn=function t(e){return 1===this.cmpn(e)},o.prototype.gt=function t(e){return 1===this.cmp(e)},o.prototype.gten=function t(e){return this.cmpn(e)>=0},o.prototype.gte=function t(e){return this.cmp(e)>=0},o.prototype.ltn=function t(e){return-1===this.cmpn(e)},o.prototype.lt=function t(e){return-1===this.cmp(e)},o.prototype.lten=function t(e){return this.cmpn(e)<=0},o.prototype.lte=function t(e){return this.cmp(e)<=0},o.prototype.eqn=function t(e){return 0===this.cmpn(e)},o.prototype.eq=function t(e){return 0===this.cmp(e)},o.red=function t(e){return new E(e)},o.prototype.toRed=function t(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)},o.prototype.fromRed=function t(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function t(e){return this.red=e,this},o.prototype.forceRed=function t(e){return i(!this.red,"Already a number in reduction context"),this._forceRed(e)},o.prototype.redAdd=function t(e){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},o.prototype.redIAdd=function t(e){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},o.prototype.redSub=function t(e){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},o.prototype.redISub=function t(e){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},o.prototype.redShl=function t(e){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},o.prototype.redMul=function t(e){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},o.prototype.redIMul=function t(e){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},o.prototype.redSqr=function t(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function t(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function t(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function t(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function t(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function t(e){return i(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var y={k256:null,p224:null,p192:null,p25519:null};function w(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function _(){w.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function M(){w.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function S(){w.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function k(){w.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function E(t){if("string"==typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else i(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function R(t){E.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}w.prototype._tmp=function t(){var e=new o(null);return e.words=new Array(Math.ceil(this.n/13)),e},w.prototype.ireduce=function t(e){var r,i=e;do{this.split(i,this.tmp),r=(i=(i=this.imulK(i)).iadd(this.tmp)).bitLength()}while(r>this.n);var n=r<this.n?-1:i.ucmp(this.p);return 0===n?(i.words[0]=0,i.length=1):n>0?i.isub(this.p):void 0!==i.strip?i.strip():i._strip(),i},w.prototype.split=function t(e,r){e.iushrn(this.n,0,r)},w.prototype.imulK=function t(e){return e.imul(this.k)},n(_,w),_.prototype.split=function t(e,r){for(var i=4194303,n=Math.min(e.length,9),o=0;o<n;o++)r.words[o]=e.words[o];if(r.length=n,e.length<=9)return e.words[0]=0,void(e.length=1);var s=e.words[9];for(r.words[r.length++]=s&i,o=10;o<e.length;o++){var a=0|e.words[o];e.words[o-10]=(a&i)<<4|s>>>22,s=a}s>>>=22,e.words[o-10]=s,0===s&&e.length>10?e.length-=10:e.length-=9},_.prototype.imulK=function t(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var r=0,i=0;i<e.length;i++){var n=0|e.words[i];r+=977*n,e.words[i]=67108863&r,r=64*n+(r/67108864|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},n(M,w),n(S,w),n(k,w),k.prototype.imulK=function t(e){for(var r=0,i=0;i<e.length;i++){var n=19*(0|e.words[i])+r,o=67108863&n;n>>>=26,e.words[i]=o,r=n}return 0!==r&&(e.words[e.length++]=r),e},o._prime=function t(e){if(y[e])return y[e];var t;if("k256"===e)t=new _;else if("p224"===e)t=new M;else if("p192"===e)t=new S;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new k}return y[e]=t,t},E.prototype._verify1=function t(e){i(0===e.negative,"red works only with positives"),i(e.red,"red works only with red numbers")},E.prototype._verify2=function t(e,r){i(0==(e.negative|r.negative),"red works only with positives"),i(e.red&&e.red===r.red,"red works only with red numbers")},E.prototype.imod=function t(e){return this.prime?this.prime.ireduce(e)._forceRed(this):(u(e,e.umod(this.m)._forceRed(this)),e)},E.prototype.neg=function t(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},E.prototype.add=function t(e,r){this._verify2(e,r);var i=e.add(r);return i.cmp(this.m)>=0&&i.isub(this.m),i._forceRed(this)},E.prototype.iadd=function t(e,r){this._verify2(e,r);var i=e.iadd(r);return i.cmp(this.m)>=0&&i.isub(this.m),i},E.prototype.sub=function t(e,r){this._verify2(e,r);var i=e.sub(r);return i.cmpn(0)<0&&i.iadd(this.m),i._forceRed(this)},E.prototype.isub=function t(e,r){this._verify2(e,r);var i=e.isub(r);return i.cmpn(0)<0&&i.iadd(this.m),i},E.prototype.shl=function t(e,r){return this._verify1(e),this.imod(e.ushln(r))},E.prototype.imul=function t(e,r){return this._verify2(e,r),this.imod(e.imul(r))},E.prototype.mul=function t(e,r){return this._verify2(e,r),this.imod(e.mul(r))},E.prototype.isqr=function t(e){return this.imul(e,e.clone())},E.prototype.sqr=function t(e){return this.mul(e,e)},E.prototype.sqrt=function t(e){if(e.isZero())return e.clone();var r=this.m.andln(3);if(i(r%2==1),3===r){var n=this.m.add(new o(1)).iushrn(2);return this.pow(e,n)}for(var s=this.m.subn(1),a=0;!s.isZero()&&0===s.andln(1);)a++,s.iushrn(1);i(!s.isZero());var h=new o(1).toRed(this),u=h.redNeg(),f=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new o(2*c*c).toRed(this);0!==this.pow(c,f).cmp(u);)c.redIAdd(u);for(var l=this.pow(c,s),d=this.pow(e,s.addn(1).iushrn(1)),p=this.pow(e,s),m=a;0!==p.cmp(h);){for(var g=p,v=0;0!==g.cmp(h);v++)g=g.redSqr();i(v<m);var b=this.pow(l,new o(1).iushln(m-v-1));d=d.redMul(b),l=b.redSqr(),p=p.redMul(l),m=v}return d},E.prototype.invm=function t(e){var r=e._invmp(this.m);return 0!==r.negative?(r.negative=0,this.imod(r).redNeg()):this.imod(r)},E.prototype.pow=function t(e,r){if(r.isZero())return new o(1).toRed(this);if(0===r.cmpn(1))return e.clone();var i=new Array(16);i[0]=new o(1).toRed(this),i[1]=e;for(var n=2;n<i.length;n++)i[n]=this.mul(i[n-1],e);var s=i[0],a=0,h=0,u=r.bitLength()%26;for(0===u&&(u=26),n=r.length-1;n>=0;n--){for(var f=r.words[n],c=u-1;c>=0;c--){var l=f>>c&1;s!==i[0]&&(s=this.sqr(s)),0!==l||0!==a?(a<<=1,a|=l,(4===++h||0===n&&0===c)&&(s=this.mul(s,i[a]),h=0,a=0)):h=0}u=26}return s},E.prototype.convertTo=function t(e){var r=e.umod(this.m);return r===e?r.clone():r},E.prototype.convertFrom=function t(e){var r=e.clone();return r.red=null,r},o.mont=function t(e){return new R(e)},n(R,E),R.prototype.convertTo=function t(e){return this.imod(e.ushln(this.shift))},R.prototype.convertFrom=function t(e){var r=this.imod(e.mul(this.rinv));return r.red=null,r},R.prototype.imul=function t(e,r){if(e.isZero()||r.isZero())return e.words[0]=0,e.length=1,e;var i=e.imul(r),n=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=i.isub(n).iushrn(this.shift),s=o;return o.cmp(this.m)>=0?s=o.isub(this.m):o.cmpn(0)<0&&(s=o.iadd(this.m)),s._forceRed(this)},R.prototype.mul=function t(e,r){if(e.isZero()||r.isZero())return new o(0)._forceRed(this);var i=e.mul(r),n=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),s=i.isub(n).iushrn(this.shift),a=s;return s.cmp(this.m)>=0?a=s.isub(this.m):s.cmpn(0)<0&&(a=s.iadd(this.m)),a._forceRed(this)},R.prototype.invm=function t(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(t,this)}).call(this,r(28)(t))},function(t,e,r){"use strict";var i=e;i.version=r(340).version,i.utils=r(11),i.rand=r(98),i.curve=r(183),i.curves=r(105),i.ec=r(352),i.eddsa=r(356)},function(t,e){"function"==typeof Object.create?t.exports=function t(e,r){r&&(e.super_=r,e.prototype=Object.create(r.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function t(e,r){if(r){e.super_=r;var i=function(){};i.prototype=r.prototype,e.prototype=new i,e.prototype.constructor=e}}},function(t,e,r){"use strict";var i,n=e,o=r(106),s=r(183),a=r(11).assert;function h(t){"short"===t.type?this.curve=new s.short(t):"edwards"===t.type?this.curve=new s.edwards(t):this.curve=new s.mont(t),this.g=this.curve.g,this.n=this.curve.n,this.hash=t.hash,a(this.g.validate(),"Invalid curve"),a(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function u(t,e){Object.defineProperty(n,t,{configurable:!0,enumerable:!0,get:function(){var r=new h(e);return Object.defineProperty(n,t,{configurable:!0,enumerable:!0,value:r}),r}})}n.PresetCurve=h,u("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:o.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),u("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:o.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),u("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:o.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),u("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:o.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),u("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:o.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),u("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:o.sha256,gRed:!1,g:["9"]}),u("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:o.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{i=r(351)}catch(t){i=void 0}u("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:o.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",i]})},function(t,e,r){var i=e;i.utils=r(13),i.common=r(46),i.sha=r(345),i.ripemd=r(349),i.hmac=r(350),i.sha1=i.sha.sha1,i.sha256=i.sha.sha256,i.sha224=i.sha.sha224,i.sha384=i.sha.sha384,i.sha512=i.sha.sha512,i.ripemd160=i.ripemd.ripemd160},function(t,e,r){"use strict";(function(e){var i,n=r(7),o=n.Buffer,s={};for(i in n)n.hasOwnProperty(i)&&"SlowBuffer"!==i&&"Buffer"!==i&&(s[i]=n[i]);var a=s.Buffer={};for(i in o)o.hasOwnProperty(i)&&"allocUnsafe"!==i&&"allocUnsafeSlow"!==i&&(a[i]=o[i]);if(s.Buffer.prototype=o.prototype,a.from&&a.from!==Uint8Array.from||(a.from=function(t,e,r){if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type '+typeof t);if(t&&void 0===t.length)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);return o(t,e,r)}),a.alloc||(a.alloc=function(t,e,r){if("number"!=typeof t)throw new TypeError('The "size" argument must be of type number. Received type '+typeof t);if(t<0||t>=2*(1<<30))throw new RangeError('The value "'+t+'" is invalid for option "size"');var i=o(t);return e&&0!==e.length?"string"==typeof r?i.fill(e,r):i.fill(e):i.fill(0),i}),!s.kStringMaxLength)try{s.kStringMaxLength=e.binding("buffer").kStringMaxLength}catch(t){}s.constants||(s.constants={MAX_LENGTH:s.kMaxLength},s.kStringMaxLength&&(s.constants.MAX_STRING_LENGTH=s.kStringMaxLength)),t.exports=s}).call(this,r(4))},function(t,e,r){"use strict";const i=r(109).Reporter,n=r(47).EncoderBuffer,o=r(47).DecoderBuffer,s=r(10),a=["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"],h=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(a);function u(t,e,r){const i={};this._baseState=i,i.name=r,i.enc=t,i.parent=e||null,i.children=null,i.tag=null,i.args=null,i.reverseArgs=null,i.choice=null,i.optional=!1,i.any=!1,i.obj=!1,i.use=null,i.useDecoder=null,i.key=null,i.default=null,i.explicit=null,i.implicit=null,i.contains=null,i.parent||(i.children=[],this._wrap())}t.exports=u;const f=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];u.prototype.clone=function t(){const e=this._baseState,r={};f.forEach((function(t){r[t]=e[t]}));const i=new this.constructor(r.parent);return i._baseState=r,i},u.prototype._wrap=function t(){const e=this._baseState;h.forEach((function(t){this[t]=function r(){const i=new this.constructor(this);return e.children.push(i),i[t].apply(i,arguments)}}),this)},u.prototype._init=function t(e){const r=this._baseState;s(null===r.parent),e.call(this),r.children=r.children.filter((function(t){return t._baseState.parent===this}),this),s.equal(r.children.length,1,"Root node can have only one child")},u.prototype._useArgs=function t(e){const r=this._baseState,i=e.filter((function(t){return t instanceof this.constructor}),this);e=e.filter((function(t){return!(t instanceof this.constructor)}),this),0!==i.length&&(s(null===r.children),r.children=i,i.forEach((function(t){t._baseState.parent=this}),this)),0!==e.length&&(s(null===r.args),r.args=e,r.reverseArgs=e.map((function(t){if("object"!=typeof t||t.constructor!==Object)return t;const e={};return Object.keys(t).forEach((function(r){r==(0|r)&&(r|=0);const i=t[r];e[i]=r})),e})))},["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"].forEach((function(t){u.prototype[t]=function e(){const r=this._baseState;throw new Error(t+" not implemented for encoding: "+r.enc)}})),a.forEach((function(t){u.prototype[t]=function e(){const r=this._baseState,i=Array.prototype.slice.call(arguments);return s(null===r.tag),r.tag=t,this._useArgs(i),this}})),u.prototype.use=function t(e){s(e);const r=this._baseState;return s(null===r.use),r.use=e,this},u.prototype.optional=function t(){return this._baseState.optional=!0,this},u.prototype.def=function t(e){const r=this._baseState;return s(null===r.default),r.default=e,r.optional=!0,this},u.prototype.explicit=function t(e){const r=this._baseState;return s(null===r.explicit&&null===r.implicit),r.explicit=e,this},u.prototype.implicit=function t(e){const r=this._baseState;return s(null===r.explicit&&null===r.implicit),r.implicit=e,this},u.prototype.obj=function t(){const e=this._baseState,r=Array.prototype.slice.call(arguments);return e.obj=!0,0!==r.length&&this._useArgs(r),this},u.prototype.key=function t(e){const r=this._baseState;return s(null===r.key),r.key=e,this},u.prototype.any=function t(){return this._baseState.any=!0,this},u.prototype.choice=function t(e){const r=this._baseState;return s(null===r.choice),r.choice=e,this._useArgs(Object.keys(e).map((function(t){return e[t]}))),this},u.prototype.contains=function t(e){const r=this._baseState;return s(null===r.use),r.contains=e,this},u.prototype._decode=function t(e,r){const i=this._baseState;if(null===i.parent)return e.wrapResult(i.children[0]._decode(e,r));let n,s=i.default,a=!0,h=null;if(null!==i.key&&(h=e.enterKey(i.key)),i.optional){let t=null;if(null!==i.explicit?t=i.explicit:null!==i.implicit?t=i.implicit:null!==i.tag&&(t=i.tag),null!==t||i.any){if(a=this._peekTag(e,t,i.any),e.isError(a))return a}else{const t=e.save();try{null===i.choice?this._decodeGeneric(i.tag,e,r):this._decodeChoice(e,r),a=!0}catch(t){a=!1}e.restore(t)}}if(i.obj&&a&&(n=e.enterObject()),a){if(null!==i.explicit){const t=this._decodeTag(e,i.explicit);if(e.isError(t))return t;e=t}const t=e.offset;if(null===i.use&&null===i.choice){let t;i.any&&(t=e.save());const r=this._decodeTag(e,null!==i.implicit?i.implicit:i.tag,i.any);if(e.isError(r))return r;i.any?s=e.raw(t):e=r}if(r&&r.track&&null!==i.tag&&r.track(e.path(),t,e.length,"tagged"),r&&r.track&&null!==i.tag&&r.track(e.path(),e.offset,e.length,"content"),i.any||(s=null===i.choice?this._decodeGeneric(i.tag,e,r):this._decodeChoice(e,r)),e.isError(s))return s;if(i.any||null!==i.choice||null===i.children||i.children.forEach((function t(i){i._decode(e,r)})),i.contains&&("octstr"===i.tag||"bitstr"===i.tag)){const t=new o(s);s=this._getUse(i.contains,e._reporterState.obj)._decode(t,r)}}return i.obj&&a&&(s=e.leaveObject(n)),null===i.key||null===s&&!0!==a?null!==h&&e.exitKey(h):e.leaveKey(h,i.key,s),s},u.prototype._decodeGeneric=function t(e,r,i){const n=this._baseState;return"seq"===e||"set"===e?null:"seqof"===e||"setof"===e?this._decodeList(r,e,n.args[0],i):/str$/.test(e)?this._decodeStr(r,e,i):"objid"===e&&n.args?this._decodeObjid(r,n.args[0],n.args[1],i):"objid"===e?this._decodeObjid(r,null,null,i):"gentime"===e||"utctime"===e?this._decodeTime(r,e,i):"null_"===e?this._decodeNull(r,i):"bool"===e?this._decodeBool(r,i):"objDesc"===e?this._decodeStr(r,e,i):"int"===e||"enum"===e?this._decodeInt(r,n.args&&n.args[0],i):null!==n.use?this._getUse(n.use,r._reporterState.obj)._decode(r,i):r.error("unknown tag: "+e)},u.prototype._getUse=function t(e,r){const i=this._baseState;return i.useDecoder=this._use(e,r),s(null===i.useDecoder._baseState.parent),i.useDecoder=i.useDecoder._baseState.children[0],i.implicit!==i.useDecoder._baseState.implicit&&(i.useDecoder=i.useDecoder.clone(),i.useDecoder._baseState.implicit=i.implicit),i.useDecoder},u.prototype._decodeChoice=function t(e,r){const i=this._baseState;let n=null,o=!1;return Object.keys(i.choice).some((function(t){const s=e.save(),a=i.choice[t];try{const i=a._decode(e,r);if(e.isError(i))return!1;n={type:t,value:i},o=!0}catch(t){return e.restore(s),!1}return!0}),this),o?n:e.error("Choice not matched")},u.prototype._createEncoderBuffer=function t(e){return new n(e,this.reporter)},u.prototype._encode=function t(e,r,i){const n=this._baseState;if(null!==n.default&&n.default===e)return;const o=this._encodeValue(e,r,i);return void 0===o||this._skipDefault(o,r,i)?void 0:o},u.prototype._encodeValue=function t(e,r,n){const o=this._baseState;if(null===o.parent)return o.children[0]._encode(e,r||new i);let s=null;if(this.reporter=r,o.optional&&void 0===e){if(null===o.default)return;e=o.default}let a=null,h=!1;if(o.any)s=this._createEncoderBuffer(e);else if(o.choice)s=this._encodeChoice(e,r);else if(o.contains)a=this._getUse(o.contains,n)._encode(e,r),h=!0;else if(o.children)a=o.children.map((function(t){if("null_"===t._baseState.tag)return t._encode(null,r,e);if(null===t._baseState.key)return r.error("Child should have a key");const i=r.enterKey(t._baseState.key);if("object"!=typeof e)return r.error("Child expected, but input is not object");const n=t._encode(e[t._baseState.key],r,e);return r.leaveKey(i),n}),this).filter((function(t){return t})),a=this._createEncoderBuffer(a);else if("seqof"===o.tag||"setof"===o.tag){if(!o.args||1!==o.args.length)return r.error("Too many args for : "+o.tag);if(!Array.isArray(e))return r.error("seqof/setof, but data is not Array");const t=this.clone();t._baseState.implicit=null,a=this._createEncoderBuffer(e.map((function(t){const i=this._baseState;return this._getUse(i.args[0],e)._encode(t,r)}),t))}else null!==o.use?s=this._getUse(o.use,n)._encode(e,r):(a=this._encodePrimitive(o.tag,e),h=!0);if(!o.any&&null===o.choice){const t=null!==o.implicit?o.implicit:o.tag,e=null===o.implicit?"universal":"context";null===t?null===o.use&&r.error("Tag could be omitted only for .use()"):null===o.use&&(s=this._encodeComposite(t,h,e,a))}return null!==o.explicit&&(s=this._encodeComposite(o.explicit,!1,"context",s)),s},u.prototype._encodeChoice=function t(e,r){const i=this._baseState,n=i.choice[e.type];return n||s(!1,e.type+" not found in "+JSON.stringify(Object.keys(i.choice))),n._encode(e.value,r)},u.prototype._encodePrimitive=function t(e,r){const i=this._baseState;if(/str$/.test(e))return this._encodeStr(r,e);if("objid"===e&&i.args)return this._encodeObjid(r,i.reverseArgs[0],i.args[1]);if("objid"===e)return this._encodeObjid(r,null,null);if("gentime"===e||"utctime"===e)return this._encodeTime(r,e);if("null_"===e)return this._encodeNull();if("int"===e||"enum"===e)return this._encodeInt(r,i.args&&i.reverseArgs[0]);if("bool"===e)return this._encodeBool(r);if("objDesc"===e)return this._encodeStr(r,e);throw new Error("Unsupported tag: "+e)},u.prototype._isNumstr=function t(e){return/^[0-9 ]*$/.test(e)},u.prototype._isPrintstr=function t(e){return/^[A-Za-z0-9 '()+,-./:=?]*$/.test(e)}},function(t,e,r){"use strict";const i=r(1);function n(t){this._reporterState={obj:null,path:[],options:t||{},errors:[]}}function o(t,e){this.path=t,this.rethrow(e)}e.Reporter=n,n.prototype.isError=function t(e){return e instanceof o},n.prototype.save=function t(){const e=this._reporterState;return{obj:e.obj,pathLen:e.path.length}},n.prototype.restore=function t(e){const r=this._reporterState;r.obj=e.obj,r.path=r.path.slice(0,e.pathLen)},n.prototype.enterKey=function t(e){return this._reporterState.path.push(e)},n.prototype.exitKey=function t(e){const r=this._reporterState;r.path=r.path.slice(0,e-1)},n.prototype.leaveKey=function t(e,r,i){const n=this._reporterState;this.exitKey(e),null!==n.obj&&(n.obj[r]=i)},n.prototype.path=function t(){return this._reporterState.path.join("/")},n.prototype.enterObject=function t(){const e=this._reporterState,r=e.obj;return e.obj={},r},n.prototype.leaveObject=function t(e){const r=this._reporterState,i=r.obj;return r.obj=e,i},n.prototype.error=function t(e){let r;const i=this._reporterState,n=e instanceof o;if(r=n?e:new o(i.path.map((function(t){return"["+JSON.stringify(t)+"]"})).join(""),e.message||e,e.stack),!i.options.partial)throw r;return n||i.errors.push(r),r},n.prototype.wrapResult=function t(e){const r=this._reporterState;return r.options.partial?{result:this.isError(e)?null:e,errors:r.errors}:e},i(o,Error),o.prototype.rethrow=function t(e){if(this.message=e+" at: "+(this.path||"(shallow)"),Error.captureStackTrace&&Error.captureStackTrace(this,o),!this.stack)try{throw new Error(this.message)}catch(t){this.stack=t.stack}return this}},function(t,e,r){"use strict";function i(t){const e={};return Object.keys(t).forEach((function(r){(0|r)==r&&(r|=0);const i=t[r];e[i]=r})),e}e.tagClass={0:"universal",1:"application",2:"context",3:"private"},e.tagClassByName=i(e.tagClass),e.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"},e.tagByName=i(e.tag)},function(t,e,r){(function(t){!function(t,e){"use strict";function i(t,e){if(!t)throw new Error(e||"Assertion failed")}function n(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function o(t,e,r){if(o.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var s;"object"==typeof t?t.exports=o:e.BN=o,o.BN=o,o.wordSize=26;try{s=r(375).Buffer}catch(t){}function a(t,e,r){for(var i=0,n=Math.min(t.length,r),o=e;o<n;o++){var s=t.charCodeAt(o)-48;i<<=4,i|=s>=49&&s<=54?s-49+10:s>=17&&s<=22?s-17+10:15&s}return i}function h(t,e,r,i){for(var n=0,o=Math.min(t.length,r),s=e;s<o;s++){var a=t.charCodeAt(s)-48;n*=i,n+=a>=49?a-49+10:a>=17?a-17+10:a}return n}o.isBN=function t(e){return e instanceof o||null!==e&&"object"==typeof e&&e.constructor.wordSize===o.wordSize&&Array.isArray(e.words)},o.max=function t(e,r){return e.cmp(r)>0?e:r},o.min=function t(e,r){return e.cmp(r)<0?e:r},o.prototype._init=function t(e,r,n){if("number"==typeof e)return this._initNumber(e,r,n);if("object"==typeof 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)},o.prototype._initNumber=function t(e,r,n){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"===n&&this._initArray(this.toArray(),r,n)},o.prototype._initArray=function t(e,r,n){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 o=0;o<this.length;o++)this.words[o]=0;var s,a,h=0;if("be"===n)for(o=e.length-1,s=0;o>=0;o-=3)a=e[o]|e[o-1]<<8|e[o-2]<<16,this.words[s]|=a<<h&67108863,this.words[s+1]=a>>>26-h&67108863,(h+=24)>=26&&(h-=26,s++);else if("le"===n)for(o=0,s=0;o<e.length;o+=3)a=e[o]|e[o+1]<<8|e[o+2]<<16,this.words[s]|=a<<h&67108863,this.words[s+1]=a>>>26-h&67108863,(h+=24)>=26&&(h-=26,s++);return this.strip()},o.prototype._parseHex=function t(e,r){this.length=Math.ceil((e.length-r)/6),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var n,o,s=0;for(i=e.length-6,n=0;i>=r;i-=6)o=a(e,i,i+6),this.words[n]|=o<<s&67108863,this.words[n+1]|=o>>>26-s&4194303,(s+=24)>=26&&(s-=26,n++);i+6!==r&&(o=a(e,r,i+6),this.words[n]|=o<<s&67108863,this.words[n+1]|=o>>>26-s&4194303),this.strip()},o.prototype._parseBase=function t(e,r,i){this.words=[0],this.length=1;for(var n=0,o=1;o<=67108863;o*=r)n++;n--,o=o/r|0;for(var s=e.length-i,a=s%n,u=Math.min(s,s-a)+i,f=0,c=i;c<u;c+=n)f=h(e,c,c+n,r),this.imuln(o),this.words[0]+f<67108864?this.words[0]+=f:this._iaddn(f);if(0!==a){var l=1;for(f=h(e,c,e.length,r),c=0;c<a;c++)l*=r;this.imuln(l),this.words[0]+f<67108864?this.words[0]+=f:this._iaddn(f)}},o.prototype.copy=function t(e){e.words=new Array(this.length);for(var r=0;r<this.length;r++)e.words[r]=this.words[r];e.length=this.length,e.negative=this.negative,e.red=this.red},o.prototype.clone=function t(){var e=new o(null);return this.copy(e),e},o.prototype._expand=function t(e){for(;this.length<e;)this.words[this.length++]=0;return this},o.prototype.strip=function t(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function t(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function t(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var u=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],f=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],c=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function l(t,e,r){r.negative=e.negative^t.negative;var i=t.length+e.length|0;r.length=i,i=i-1|0;var n=0|t.words[0],o=0|e.words[0],s=n*o,a=67108863&s,h=s/67108864|0;r.words[0]=a;for(var u=1;u<i;u++){for(var f=h>>>26,c=67108863&h,l=Math.min(u,e.length-1),d=Math.max(0,u-t.length+1);d<=l;d++){var p=u-d|0;f+=(s=(n=0|t.words[p])*(o=0|e.words[d])+c)/67108864|0,c=67108863&s}r.words[u]=0|c,h=0|f}return 0!==h?r.words[u]=0|h:r.length--,r.strip()}o.prototype.toString=function t(e,r){var n;if(r=0|r||1,16===(e=e||10)||"hex"===e){n="";for(var o=0,s=0,a=0;a<this.length;a++){var h=this.words[a],l=(16777215&(h<<o|s)).toString(16);n=0!==(s=h>>>24-o&16777215)||a!==this.length-1?u[6-l.length]+l+n:l+n,(o+=2)>=26&&(o-=26,a--)}for(0!==s&&(n=s.toString(16)+n);n.length%r!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}if(e===(0|e)&&e>=2&&e<=36){var d=f[e],p=c[e];n="";var m=this.clone();for(m.negative=0;!m.isZero();){var g=m.modn(p).toString(e);n=(m=m.idivn(p)).isZero()?g+n:u[d-g.length]+g+n}for(this.isZero()&&(n="0"+n);n.length%r!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}i(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function t(){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},o.prototype.toJSON=function t(){return this.toString(16)},o.prototype.toBuffer=function t(e,r){return i(void 0!==s),this.toArrayLike(s,e,r)},o.prototype.toArray=function t(e,r){return this.toArrayLike(Array,e,r)},o.prototype.toArrayLike=function t(e,r,n){var o=this.byteLength(),s=n||Math.max(1,o);i(o<=s,"byte array longer than desired length"),i(s>0,"Requested array length <= 0"),this.strip();var a,h,u="le"===r,f=new e(s),c=this.clone();if(u){for(h=0;!c.isZero();h++)a=c.andln(255),c.iushrn(8),f[h]=a;for(;h<s;h++)f[h]=0}else{for(h=0;h<s-o;h++)f[h]=0;for(h=0;!c.isZero();h++)a=c.andln(255),c.iushrn(8),f[s-h-1]=a}return f},Math.clz32?o.prototype._countBits=function t(e){return 32-Math.clz32(e)}:o.prototype._countBits=function t(e){var r=e,i=0;return r>=4096&&(i+=13,r>>>=13),r>=64&&(i+=7,r>>>=7),r>=8&&(i+=4,r>>>=4),r>=2&&(i+=2,r>>>=2),i+r},o.prototype._zeroBits=function t(e){if(0===e)return 26;var r=e,i=0;return 0==(8191&r)&&(i+=13,r>>>=13),0==(127&r)&&(i+=7,r>>>=7),0==(15&r)&&(i+=4,r>>>=4),0==(3&r)&&(i+=2,r>>>=2),0==(1&r)&&i++,i},o.prototype.bitLength=function t(){var e=this.words[this.length-1],r=this._countBits(e);return 26*(this.length-1)+r},o.prototype.zeroBits=function t(){if(this.isZero())return 0;for(var e=0,r=0;r<this.length;r++){var i=this._zeroBits(this.words[r]);if(e+=i,26!==i)break}return e},o.prototype.byteLength=function t(){return Math.ceil(this.bitLength()/8)},o.prototype.toTwos=function t(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},o.prototype.fromTwos=function t(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},o.prototype.isNeg=function t(){return 0!==this.negative},o.prototype.neg=function t(){return this.clone().ineg()},o.prototype.ineg=function t(){return this.isZero()||(this.negative^=1),this},o.prototype.iuor=function t(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var r=0;r<e.length;r++)this.words[r]=this.words[r]|e.words[r];return this.strip()},o.prototype.ior=function t(e){return i(0==(this.negative|e.negative)),this.iuor(e)},o.prototype.or=function t(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},o.prototype.uor=function t(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},o.prototype.iuand=function t(e){var r;r=this.length>e.length?e:this;for(var i=0;i<r.length;i++)this.words[i]=this.words[i]&e.words[i];return this.length=r.length,this.strip()},o.prototype.iand=function t(e){return i(0==(this.negative|e.negative)),this.iuand(e)},o.prototype.and=function t(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},o.prototype.uand=function t(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},o.prototype.iuxor=function t(e){var r,i;this.length>e.length?(r=this,i=e):(r=e,i=this);for(var n=0;n<i.length;n++)this.words[n]=r.words[n]^i.words[n];if(this!==r)for(;n<r.length;n++)this.words[n]=r.words[n];return this.length=r.length,this.strip()},o.prototype.ixor=function t(e){return i(0==(this.negative|e.negative)),this.iuxor(e)},o.prototype.xor=function t(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},o.prototype.uxor=function t(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},o.prototype.inotn=function t(e){i("number"==typeof e&&e>=0);var r=0|Math.ceil(e/26),n=e%26;this._expand(r),n>0&&r--;for(var o=0;o<r;o++)this.words[o]=67108863&~this.words[o];return n>0&&(this.words[o]=~this.words[o]&67108863>>26-n),this.strip()},o.prototype.notn=function t(e){return this.clone().inotn(e)},o.prototype.setn=function t(e,r){i("number"==typeof e&&e>=0);var n=e/26|0,o=e%26;return this._expand(n+1),this.words[n]=r?this.words[n]|1<<o:this.words[n]&~(1<<o),this.strip()},o.prototype.iadd=function t(e){var r,i,n;if(0!==this.negative&&0===e.negative)return this.negative=0,r=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,r=this.isub(e),e.negative=1,r._normSign();this.length>e.length?(i=this,n=e):(i=e,n=this);for(var o=0,s=0;s<n.length;s++)r=(0|i.words[s])+(0|n.words[s])+o,this.words[s]=67108863&r,o=r>>>26;for(;0!==o&&s<i.length;s++)r=(0|i.words[s])+o,this.words[s]=67108863&r,o=r>>>26;if(this.length=i.length,0!==o)this.words[this.length]=o,this.length++;else if(i!==this)for(;s<i.length;s++)this.words[s]=i.words[s];return this},o.prototype.add=function t(e){var r;return 0!==e.negative&&0===this.negative?(e.negative=0,r=this.sub(e),e.negative^=1,r):0===e.negative&&0!==this.negative?(this.negative=0,r=e.sub(this),this.negative=1,r):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},o.prototype.isub=function t(e){if(0!==e.negative){e.negative=0;var r=this.iadd(e);return e.negative=1,r._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var i,n,o=this.cmp(e);if(0===o)return this.negative=0,this.length=1,this.words[0]=0,this;o>0?(i=this,n=e):(i=e,n=this);for(var s=0,a=0;a<n.length;a++)s=(r=(0|i.words[a])-(0|n.words[a])+s)>>26,this.words[a]=67108863&r;for(;0!==s&&a<i.length;a++)s=(r=(0|i.words[a])+s)>>26,this.words[a]=67108863&r;if(0===s&&a<i.length&&i!==this)for(;a<i.length;a++)this.words[a]=i.words[a];return this.length=Math.max(this.length,a),i!==this&&(this.negative=1),this.strip()},o.prototype.sub=function t(e){return this.clone().isub(e)};var d=function t(e,r,i){var n,o,s,a=e.words,h=r.words,u=i.words,f=0,c=0|a[0],l=8191&c,d=c>>>13,p=0|a[1],m=8191&p,g=p>>>13,v=0|a[2],b=8191&v,y=v>>>13,w=0|a[3],_=8191&w,M=w>>>13,S=0|a[4],k=8191&S,E=S>>>13,R=0|a[5],A=8191&R,x=R>>>13,T=0|a[6],P=8191&T,I=T>>>13,L=0|a[7],O=8191&L,B=L>>>13,j=0|a[8],C=8191&j,U=j>>>13,N=0|a[9],q=8191&N,D=N>>>13,z=0|h[0],F=8191&z,W=z>>>13,H=0|h[1],K=8191&H,Z=H>>>13,V=0|h[2],J=8191&V,Y=V>>>13,G=0|h[3],X=8191&G,Q=G>>>13,$=0|h[4],tt=8191&$,et=$>>>13,rt=0|h[5],it=8191&rt,nt=rt>>>13,ot=0|h[6],st=8191&ot,at=ot>>>13,ht=0|h[7],ut=8191&ht,ft=ht>>>13,ct=0|h[8],lt=8191&ct,dt=ct>>>13,pt=0|h[9],mt=8191&pt,gt=pt>>>13;i.negative=e.negative^r.negative,i.length=19;var vt=(f+(n=Math.imul(l,F))|0)+((8191&(o=(o=Math.imul(l,W))+Math.imul(d,F)|0))<<13)|0;f=((s=Math.imul(d,W))+(o>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(m,F),o=(o=Math.imul(m,W))+Math.imul(g,F)|0,s=Math.imul(g,W);var bt=(f+(n=n+Math.imul(l,K)|0)|0)+((8191&(o=(o=o+Math.imul(l,Z)|0)+Math.imul(d,K)|0))<<13)|0;f=((s=s+Math.imul(d,Z)|0)+(o>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(b,F),o=(o=Math.imul(b,W))+Math.imul(y,F)|0,s=Math.imul(y,W),n=n+Math.imul(m,K)|0,o=(o=o+Math.imul(m,Z)|0)+Math.imul(g,K)|0,s=s+Math.imul(g,Z)|0;var yt=(f+(n=n+Math.imul(l,J)|0)|0)+((8191&(o=(o=o+Math.imul(l,Y)|0)+Math.imul(d,J)|0))<<13)|0;f=((s=s+Math.imul(d,Y)|0)+(o>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(_,F),o=(o=Math.imul(_,W))+Math.imul(M,F)|0,s=Math.imul(M,W),n=n+Math.imul(b,K)|0,o=(o=o+Math.imul(b,Z)|0)+Math.imul(y,K)|0,s=s+Math.imul(y,Z)|0,n=n+Math.imul(m,J)|0,o=(o=o+Math.imul(m,Y)|0)+Math.imul(g,J)|0,s=s+Math.imul(g,Y)|0;var wt=(f+(n=n+Math.imul(l,X)|0)|0)+((8191&(o=(o=o+Math.imul(l,Q)|0)+Math.imul(d,X)|0))<<13)|0;f=((s=s+Math.imul(d,Q)|0)+(o>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(k,F),o=(o=Math.imul(k,W))+Math.imul(E,F)|0,s=Math.imul(E,W),n=n+Math.imul(_,K)|0,o=(o=o+Math.imul(_,Z)|0)+Math.imul(M,K)|0,s=s+Math.imul(M,Z)|0,n=n+Math.imul(b,J)|0,o=(o=o+Math.imul(b,Y)|0)+Math.imul(y,J)|0,s=s+Math.imul(y,Y)|0,n=n+Math.imul(m,X)|0,o=(o=o+Math.imul(m,Q)|0)+Math.imul(g,X)|0,s=s+Math.imul(g,Q)|0;var _t=(f+(n=n+Math.imul(l,tt)|0)|0)+((8191&(o=(o=o+Math.imul(l,et)|0)+Math.imul(d,tt)|0))<<13)|0;f=((s=s+Math.imul(d,et)|0)+(o>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(A,F),o=(o=Math.imul(A,W))+Math.imul(x,F)|0,s=Math.imul(x,W),n=n+Math.imul(k,K)|0,o=(o=o+Math.imul(k,Z)|0)+Math.imul(E,K)|0,s=s+Math.imul(E,Z)|0,n=n+Math.imul(_,J)|0,o=(o=o+Math.imul(_,Y)|0)+Math.imul(M,J)|0,s=s+Math.imul(M,Y)|0,n=n+Math.imul(b,X)|0,o=(o=o+Math.imul(b,Q)|0)+Math.imul(y,X)|0,s=s+Math.imul(y,Q)|0,n=n+Math.imul(m,tt)|0,o=(o=o+Math.imul(m,et)|0)+Math.imul(g,tt)|0,s=s+Math.imul(g,et)|0;var Mt=(f+(n=n+Math.imul(l,it)|0)|0)+((8191&(o=(o=o+Math.imul(l,nt)|0)+Math.imul(d,it)|0))<<13)|0;f=((s=s+Math.imul(d,nt)|0)+(o>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(P,F),o=(o=Math.imul(P,W))+Math.imul(I,F)|0,s=Math.imul(I,W),n=n+Math.imul(A,K)|0,o=(o=o+Math.imul(A,Z)|0)+Math.imul(x,K)|0,s=s+Math.imul(x,Z)|0,n=n+Math.imul(k,J)|0,o=(o=o+Math.imul(k,Y)|0)+Math.imul(E,J)|0,s=s+Math.imul(E,Y)|0,n=n+Math.imul(_,X)|0,o=(o=o+Math.imul(_,Q)|0)+Math.imul(M,X)|0,s=s+Math.imul(M,Q)|0,n=n+Math.imul(b,tt)|0,o=(o=o+Math.imul(b,et)|0)+Math.imul(y,tt)|0,s=s+Math.imul(y,et)|0,n=n+Math.imul(m,it)|0,o=(o=o+Math.imul(m,nt)|0)+Math.imul(g,it)|0,s=s+Math.imul(g,nt)|0;var St=(f+(n=n+Math.imul(l,st)|0)|0)+((8191&(o=(o=o+Math.imul(l,at)|0)+Math.imul(d,st)|0))<<13)|0;f=((s=s+Math.imul(d,at)|0)+(o>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(O,F),o=(o=Math.imul(O,W))+Math.imul(B,F)|0,s=Math.imul(B,W),n=n+Math.imul(P,K)|0,o=(o=o+Math.imul(P,Z)|0)+Math.imul(I,K)|0,s=s+Math.imul(I,Z)|0,n=n+Math.imul(A,J)|0,o=(o=o+Math.imul(A,Y)|0)+Math.imul(x,J)|0,s=s+Math.imul(x,Y)|0,n=n+Math.imul(k,X)|0,o=(o=o+Math.imul(k,Q)|0)+Math.imul(E,X)|0,s=s+Math.imul(E,Q)|0,n=n+Math.imul(_,tt)|0,o=(o=o+Math.imul(_,et)|0)+Math.imul(M,tt)|0,s=s+Math.imul(M,et)|0,n=n+Math.imul(b,it)|0,o=(o=o+Math.imul(b,nt)|0)+Math.imul(y,it)|0,s=s+Math.imul(y,nt)|0,n=n+Math.imul(m,st)|0,o=(o=o+Math.imul(m,at)|0)+Math.imul(g,st)|0,s=s+Math.imul(g,at)|0;var kt=(f+(n=n+Math.imul(l,ut)|0)|0)+((8191&(o=(o=o+Math.imul(l,ft)|0)+Math.imul(d,ut)|0))<<13)|0;f=((s=s+Math.imul(d,ft)|0)+(o>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(C,F),o=(o=Math.imul(C,W))+Math.imul(U,F)|0,s=Math.imul(U,W),n=n+Math.imul(O,K)|0,o=(o=o+Math.imul(O,Z)|0)+Math.imul(B,K)|0,s=s+Math.imul(B,Z)|0,n=n+Math.imul(P,J)|0,o=(o=o+Math.imul(P,Y)|0)+Math.imul(I,J)|0,s=s+Math.imul(I,Y)|0,n=n+Math.imul(A,X)|0,o=(o=o+Math.imul(A,Q)|0)+Math.imul(x,X)|0,s=s+Math.imul(x,Q)|0,n=n+Math.imul(k,tt)|0,o=(o=o+Math.imul(k,et)|0)+Math.imul(E,tt)|0,s=s+Math.imul(E,et)|0,n=n+Math.imul(_,it)|0,o=(o=o+Math.imul(_,nt)|0)+Math.imul(M,it)|0,s=s+Math.imul(M,nt)|0,n=n+Math.imul(b,st)|0,o=(o=o+Math.imul(b,at)|0)+Math.imul(y,st)|0,s=s+Math.imul(y,at)|0,n=n+Math.imul(m,ut)|0,o=(o=o+Math.imul(m,ft)|0)+Math.imul(g,ut)|0,s=s+Math.imul(g,ft)|0;var Et=(f+(n=n+Math.imul(l,lt)|0)|0)+((8191&(o=(o=o+Math.imul(l,dt)|0)+Math.imul(d,lt)|0))<<13)|0;f=((s=s+Math.imul(d,dt)|0)+(o>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(q,F),o=(o=Math.imul(q,W))+Math.imul(D,F)|0,s=Math.imul(D,W),n=n+Math.imul(C,K)|0,o=(o=o+Math.imul(C,Z)|0)+Math.imul(U,K)|0,s=s+Math.imul(U,Z)|0,n=n+Math.imul(O,J)|0,o=(o=o+Math.imul(O,Y)|0)+Math.imul(B,J)|0,s=s+Math.imul(B,Y)|0,n=n+Math.imul(P,X)|0,o=(o=o+Math.imul(P,Q)|0)+Math.imul(I,X)|0,s=s+Math.imul(I,Q)|0,n=n+Math.imul(A,tt)|0,o=(o=o+Math.imul(A,et)|0)+Math.imul(x,tt)|0,s=s+Math.imul(x,et)|0,n=n+Math.imul(k,it)|0,o=(o=o+Math.imul(k,nt)|0)+Math.imul(E,it)|0,s=s+Math.imul(E,nt)|0,n=n+Math.imul(_,st)|0,o=(o=o+Math.imul(_,at)|0)+Math.imul(M,st)|0,s=s+Math.imul(M,at)|0,n=n+Math.imul(b,ut)|0,o=(o=o+Math.imul(b,ft)|0)+Math.imul(y,ut)|0,s=s+Math.imul(y,ft)|0,n=n+Math.imul(m,lt)|0,o=(o=o+Math.imul(m,dt)|0)+Math.imul(g,lt)|0,s=s+Math.imul(g,dt)|0;var Rt=(f+(n=n+Math.imul(l,mt)|0)|0)+((8191&(o=(o=o+Math.imul(l,gt)|0)+Math.imul(d,mt)|0))<<13)|0;f=((s=s+Math.imul(d,gt)|0)+(o>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,n=Math.imul(q,K),o=(o=Math.imul(q,Z))+Math.imul(D,K)|0,s=Math.imul(D,Z),n=n+Math.imul(C,J)|0,o=(o=o+Math.imul(C,Y)|0)+Math.imul(U,J)|0,s=s+Math.imul(U,Y)|0,n=n+Math.imul(O,X)|0,o=(o=o+Math.imul(O,Q)|0)+Math.imul(B,X)|0,s=s+Math.imul(B,Q)|0,n=n+Math.imul(P,tt)|0,o=(o=o+Math.imul(P,et)|0)+Math.imul(I,tt)|0,s=s+Math.imul(I,et)|0,n=n+Math.imul(A,it)|0,o=(o=o+Math.imul(A,nt)|0)+Math.imul(x,it)|0,s=s+Math.imul(x,nt)|0,n=n+Math.imul(k,st)|0,o=(o=o+Math.imul(k,at)|0)+Math.imul(E,st)|0,s=s+Math.imul(E,at)|0,n=n+Math.imul(_,ut)|0,o=(o=o+Math.imul(_,ft)|0)+Math.imul(M,ut)|0,s=s+Math.imul(M,ft)|0,n=n+Math.imul(b,lt)|0,o=(o=o+Math.imul(b,dt)|0)+Math.imul(y,lt)|0,s=s+Math.imul(y,dt)|0;var At=(f+(n=n+Math.imul(m,mt)|0)|0)+((8191&(o=(o=o+Math.imul(m,gt)|0)+Math.imul(g,mt)|0))<<13)|0;f=((s=s+Math.imul(g,gt)|0)+(o>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(q,J),o=(o=Math.imul(q,Y))+Math.imul(D,J)|0,s=Math.imul(D,Y),n=n+Math.imul(C,X)|0,o=(o=o+Math.imul(C,Q)|0)+Math.imul(U,X)|0,s=s+Math.imul(U,Q)|0,n=n+Math.imul(O,tt)|0,o=(o=o+Math.imul(O,et)|0)+Math.imul(B,tt)|0,s=s+Math.imul(B,et)|0,n=n+Math.imul(P,it)|0,o=(o=o+Math.imul(P,nt)|0)+Math.imul(I,it)|0,s=s+Math.imul(I,nt)|0,n=n+Math.imul(A,st)|0,o=(o=o+Math.imul(A,at)|0)+Math.imul(x,st)|0,s=s+Math.imul(x,at)|0,n=n+Math.imul(k,ut)|0,o=(o=o+Math.imul(k,ft)|0)+Math.imul(E,ut)|0,s=s+Math.imul(E,ft)|0,n=n+Math.imul(_,lt)|0,o=(o=o+Math.imul(_,dt)|0)+Math.imul(M,lt)|0,s=s+Math.imul(M,dt)|0;var xt=(f+(n=n+Math.imul(b,mt)|0)|0)+((8191&(o=(o=o+Math.imul(b,gt)|0)+Math.imul(y,mt)|0))<<13)|0;f=((s=s+Math.imul(y,gt)|0)+(o>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(q,X),o=(o=Math.imul(q,Q))+Math.imul(D,X)|0,s=Math.imul(D,Q),n=n+Math.imul(C,tt)|0,o=(o=o+Math.imul(C,et)|0)+Math.imul(U,tt)|0,s=s+Math.imul(U,et)|0,n=n+Math.imul(O,it)|0,o=(o=o+Math.imul(O,nt)|0)+Math.imul(B,it)|0,s=s+Math.imul(B,nt)|0,n=n+Math.imul(P,st)|0,o=(o=o+Math.imul(P,at)|0)+Math.imul(I,st)|0,s=s+Math.imul(I,at)|0,n=n+Math.imul(A,ut)|0,o=(o=o+Math.imul(A,ft)|0)+Math.imul(x,ut)|0,s=s+Math.imul(x,ft)|0,n=n+Math.imul(k,lt)|0,o=(o=o+Math.imul(k,dt)|0)+Math.imul(E,lt)|0,s=s+Math.imul(E,dt)|0;var Tt=(f+(n=n+Math.imul(_,mt)|0)|0)+((8191&(o=(o=o+Math.imul(_,gt)|0)+Math.imul(M,mt)|0))<<13)|0;f=((s=s+Math.imul(M,gt)|0)+(o>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(q,tt),o=(o=Math.imul(q,et))+Math.imul(D,tt)|0,s=Math.imul(D,et),n=n+Math.imul(C,it)|0,o=(o=o+Math.imul(C,nt)|0)+Math.imul(U,it)|0,s=s+Math.imul(U,nt)|0,n=n+Math.imul(O,st)|0,o=(o=o+Math.imul(O,at)|0)+Math.imul(B,st)|0,s=s+Math.imul(B,at)|0,n=n+Math.imul(P,ut)|0,o=(o=o+Math.imul(P,ft)|0)+Math.imul(I,ut)|0,s=s+Math.imul(I,ft)|0,n=n+Math.imul(A,lt)|0,o=(o=o+Math.imul(A,dt)|0)+Math.imul(x,lt)|0,s=s+Math.imul(x,dt)|0;var Pt=(f+(n=n+Math.imul(k,mt)|0)|0)+((8191&(o=(o=o+Math.imul(k,gt)|0)+Math.imul(E,mt)|0))<<13)|0;f=((s=s+Math.imul(E,gt)|0)+(o>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,n=Math.imul(q,it),o=(o=Math.imul(q,nt))+Math.imul(D,it)|0,s=Math.imul(D,nt),n=n+Math.imul(C,st)|0,o=(o=o+Math.imul(C,at)|0)+Math.imul(U,st)|0,s=s+Math.imul(U,at)|0,n=n+Math.imul(O,ut)|0,o=(o=o+Math.imul(O,ft)|0)+Math.imul(B,ut)|0,s=s+Math.imul(B,ft)|0,n=n+Math.imul(P,lt)|0,o=(o=o+Math.imul(P,dt)|0)+Math.imul(I,lt)|0,s=s+Math.imul(I,dt)|0;var It=(f+(n=n+Math.imul(A,mt)|0)|0)+((8191&(o=(o=o+Math.imul(A,gt)|0)+Math.imul(x,mt)|0))<<13)|0;f=((s=s+Math.imul(x,gt)|0)+(o>>>13)|0)+(It>>>26)|0,It&=67108863,n=Math.imul(q,st),o=(o=Math.imul(q,at))+Math.imul(D,st)|0,s=Math.imul(D,at),n=n+Math.imul(C,ut)|0,o=(o=o+Math.imul(C,ft)|0)+Math.imul(U,ut)|0,s=s+Math.imul(U,ft)|0,n=n+Math.imul(O,lt)|0,o=(o=o+Math.imul(O,dt)|0)+Math.imul(B,lt)|0,s=s+Math.imul(B,dt)|0;var Lt=(f+(n=n+Math.imul(P,mt)|0)|0)+((8191&(o=(o=o+Math.imul(P,gt)|0)+Math.imul(I,mt)|0))<<13)|0;f=((s=s+Math.imul(I,gt)|0)+(o>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,n=Math.imul(q,ut),o=(o=Math.imul(q,ft))+Math.imul(D,ut)|0,s=Math.imul(D,ft),n=n+Math.imul(C,lt)|0,o=(o=o+Math.imul(C,dt)|0)+Math.imul(U,lt)|0,s=s+Math.imul(U,dt)|0;var Ot=(f+(n=n+Math.imul(O,mt)|0)|0)+((8191&(o=(o=o+Math.imul(O,gt)|0)+Math.imul(B,mt)|0))<<13)|0;f=((s=s+Math.imul(B,gt)|0)+(o>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,n=Math.imul(q,lt),o=(o=Math.imul(q,dt))+Math.imul(D,lt)|0,s=Math.imul(D,dt);var Bt=(f+(n=n+Math.imul(C,mt)|0)|0)+((8191&(o=(o=o+Math.imul(C,gt)|0)+Math.imul(U,mt)|0))<<13)|0;f=((s=s+Math.imul(U,gt)|0)+(o>>>13)|0)+(Bt>>>26)|0,Bt&=67108863;var jt=(f+(n=Math.imul(q,mt))|0)+((8191&(o=(o=Math.imul(q,gt))+Math.imul(D,mt)|0))<<13)|0;return f=((s=Math.imul(D,gt))+(o>>>13)|0)+(jt>>>26)|0,jt&=67108863,u[0]=vt,u[1]=bt,u[2]=yt,u[3]=wt,u[4]=_t,u[5]=Mt,u[6]=St,u[7]=kt,u[8]=Et,u[9]=Rt,u[10]=At,u[11]=xt,u[12]=Tt,u[13]=Pt,u[14]=It,u[15]=Lt,u[16]=Ot,u[17]=Bt,u[18]=jt,0!==f&&(u[19]=f,i.length++),i};function p(t,e,r){return(new m).mulp(t,e,r)}function m(t,e){this.x=t,this.y=e}Math.imul||(d=l),o.prototype.mulTo=function t(e,r){var i=this.length+e.length;return 10===this.length&&10===e.length?d(this,e,r):i<63?l(this,e,r):i<1024?function n(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var i=0,n=0,o=0;o<r.length-1;o++){var s=n;n=0;for(var a=67108863&i,h=Math.min(o,e.length-1),u=Math.max(0,o-t.length+1);u<=h;u++){var f=o-u,c=(0|t.words[f])*(0|e.words[u]),l=67108863&c;a=67108863&(l=l+a|0),n+=(s=(s=s+(c/67108864|0)|0)+(l>>>26)|0)>>>26,s&=67108863}r.words[o]=a,i=s,s=n}return 0!==i?r.words[o]=i:r.length--,r.strip()}(this,e,r):p(this,e,r)},m.prototype.makeRBT=function t(e){for(var r=new Array(e),i=o.prototype._countBits(e)-1,n=0;n<e;n++)r[n]=this.revBin(n,i,e);return r},m.prototype.revBin=function t(e,r,i){if(0===e||e===i-1)return e;for(var n=0,o=0;o<r;o++)n|=(1&e)<<r-o-1,e>>=1;return n},m.prototype.permute=function t(e,r,i,n,o,s){for(var a=0;a<s;a++)n[a]=r[e[a]],o[a]=i[e[a]]},m.prototype.transform=function t(e,r,i,n,o,s){this.permute(s,e,r,i,n,o);for(var a=1;a<o;a<<=1)for(var h=a<<1,u=Math.cos(2*Math.PI/h),f=Math.sin(2*Math.PI/h),c=0;c<o;c+=h)for(var l=u,d=f,p=0;p<a;p++){var m=i[c+p],g=n[c+p],v=i[c+p+a],b=n[c+p+a],y=l*v-d*b;b=l*b+d*v,v=y,i[c+p]=m+v,n[c+p]=g+b,i[c+p+a]=m-v,n[c+p+a]=g-b,p!==h&&(y=u*l-f*d,d=u*d+f*l,l=y)}},m.prototype.guessLen13b=function t(e,r){var i=1|Math.max(r,e),n=1&i,o=0;for(i=i/2|0;i;i>>>=1)o++;return 1<<o+1+n},m.prototype.conjugate=function t(e,r,i){if(!(i<=1))for(var n=0;n<i/2;n++){var o=e[n];e[n]=e[i-n-1],e[i-n-1]=o,o=r[n],r[n]=-r[i-n-1],r[i-n-1]=-o}},m.prototype.normalize13b=function t(e,r){for(var i=0,n=0;n<r/2;n++){var o=8192*Math.round(e[2*n+1]/r)+Math.round(e[2*n]/r)+i;e[n]=67108863&o,i=o<67108864?0:o/67108864|0}return e},m.prototype.convert13b=function t(e,r,n,o){for(var s=0,a=0;a<r;a++)s+=0|e[a],n[2*a]=8191&s,s>>>=13,n[2*a+1]=8191&s,s>>>=13;for(a=2*r;a<o;++a)n[a]=0;i(0===s),i(0==(-8192&s))},m.prototype.stub=function t(e){for(var r=new Array(e),i=0;i<e;i++)r[i]=0;return r},m.prototype.mulp=function t(e,r,i){var n=2*this.guessLen13b(e.length,r.length),o=this.makeRBT(n),s=this.stub(n),a=new Array(n),h=new Array(n),u=new Array(n),f=new Array(n),c=new Array(n),l=new Array(n),d=i.words;d.length=n,this.convert13b(e.words,e.length,a,n),this.convert13b(r.words,r.length,f,n),this.transform(a,s,h,u,n,o),this.transform(f,s,c,l,n,o);for(var p=0;p<n;p++){var m=h[p]*c[p]-u[p]*l[p];u[p]=h[p]*l[p]+u[p]*c[p],h[p]=m}return this.conjugate(h,u,n),this.transform(h,u,d,s,n,o),this.conjugate(d,s,n),this.normalize13b(d,n),i.negative=e.negative^r.negative,i.length=e.length+r.length,i.strip()},o.prototype.mul=function t(e){var r=new o(null);return r.words=new Array(this.length+e.length),this.mulTo(e,r)},o.prototype.mulf=function t(e){var r=new o(null);return r.words=new Array(this.length+e.length),p(this,e,r)},o.prototype.imul=function t(e){return this.clone().mulTo(e,this)},o.prototype.imuln=function t(e){i("number"==typeof e),i(e<67108864);for(var r=0,n=0;n<this.length;n++){var o=(0|this.words[n])*e,s=(67108863&o)+(67108863&r);r>>=26,r+=o/67108864|0,r+=s>>>26,this.words[n]=67108863&s}return 0!==r&&(this.words[n]=r,this.length++),this},o.prototype.muln=function t(e){return this.clone().imuln(e)},o.prototype.sqr=function t(){return this.mul(this)},o.prototype.isqr=function t(){return this.imul(this.clone())},o.prototype.pow=function t(e){var r=function i(t){for(var e=new Array(t.bitLength()),r=0;r<e.length;r++){var i=r/26|0,n=r%26;e[r]=(t.words[i]&1<<n)>>>n}return e}(e);if(0===r.length)return new o(1);for(var n=this,s=0;s<r.length&&0===r[s];s++,n=n.sqr());if(++s<r.length)for(var a=n.sqr();s<r.length;s++,a=a.sqr())0!==r[s]&&(n=n.mul(a));return n},o.prototype.iushln=function t(e){i("number"==typeof e&&e>=0);var r,n=e%26,o=(e-n)/26,s=67108863>>>26-n<<26-n;if(0!==n){var a=0;for(r=0;r<this.length;r++){var h=this.words[r]&s,u=(0|this.words[r])-h<<n;this.words[r]=u|a,a=h>>>26-n}a&&(this.words[r]=a,this.length++)}if(0!==o){for(r=this.length-1;r>=0;r--)this.words[r+o]=this.words[r];for(r=0;r<o;r++)this.words[r]=0;this.length+=o}return this.strip()},o.prototype.ishln=function t(e){return i(0===this.negative),this.iushln(e)},o.prototype.iushrn=function t(e,r,n){var o;i("number"==typeof e&&e>=0),o=r?(r-r%26)/26:0;var s=e%26,a=Math.min((e-s)/26,this.length),h=67108863^67108863>>>s<<s,u=n;if(o-=a,o=Math.max(0,o),u){for(var f=0;f<a;f++)u.words[f]=this.words[f];u.length=a}if(0===a);else if(this.length>a)for(this.length-=a,f=0;f<this.length;f++)this.words[f]=this.words[f+a];else this.words[0]=0,this.length=1;var c=0;for(f=this.length-1;f>=0&&(0!==c||f>=o);f--){var l=0|this.words[f];this.words[f]=c<<26-s|l>>>s,c=l&h}return u&&0!==c&&(u.words[u.length++]=c),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function t(e,r,n){return i(0===this.negative),this.iushrn(e,r,n)},o.prototype.shln=function t(e){return this.clone().ishln(e)},o.prototype.ushln=function t(e){return this.clone().iushln(e)},o.prototype.shrn=function t(e){return this.clone().ishrn(e)},o.prototype.ushrn=function t(e){return this.clone().iushrn(e)},o.prototype.testn=function t(e){i("number"==typeof e&&e>=0);var r=e%26,n=(e-r)/26,o=1<<r;return!(this.length<=n)&&!!(this.words[n]&o)},o.prototype.imaskn=function t(e){i("number"==typeof e&&e>=0);var r=e%26,n=(e-r)/26;if(i(0===this.negative,"imaskn works only with positive numbers"),this.length<=n)return this;if(0!==r&&n++,this.length=Math.min(n,this.length),0!==r){var o=67108863^67108863>>>r<<r;this.words[this.length-1]&=o}return this.strip()},o.prototype.maskn=function t(e){return this.clone().imaskn(e)},o.prototype.iaddn=function t(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)},o.prototype._iaddn=function t(e){this.words[0]+=e;for(var r=0;r<this.length&&this.words[r]>=67108864;r++)this.words[r]-=67108864,r===this.length-1?this.words[r+1]=1:this.words[r+1]++;return this.length=Math.max(this.length,r+1),this},o.prototype.isubn=function t(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 r=0;r<this.length&&this.words[r]<0;r++)this.words[r]+=67108864,this.words[r+1]-=1;return this.strip()},o.prototype.addn=function t(e){return this.clone().iaddn(e)},o.prototype.subn=function t(e){return this.clone().isubn(e)},o.prototype.iabs=function t(){return this.negative=0,this},o.prototype.abs=function t(){return this.clone().iabs()},o.prototype._ishlnsubmul=function t(e,r,n){var o,s,a=e.length+n;this._expand(a);var h=0;for(o=0;o<e.length;o++){s=(0|this.words[o+n])+h;var u=(0|e.words[o])*r;h=((s-=67108863&u)>>26)-(u/67108864|0),this.words[o+n]=67108863&s}for(;o<this.length-n;o++)h=(s=(0|this.words[o+n])+h)>>26,this.words[o+n]=67108863&s;if(0===h)return this.strip();for(i(-1===h),h=0,o=0;o<this.length;o++)h=(s=-(0|this.words[o])+h)>>26,this.words[o]=67108863&s;return this.negative=1,this.strip()},o.prototype._wordDiv=function t(e,r){var i=(this.length,e.length),n=this.clone(),s=e,a=0|s.words[s.length-1];0!==(i=26-this._countBits(a))&&(s=s.ushln(i),n.iushln(i),a=0|s.words[s.length-1]);var h,u=n.length-s.length;if("mod"!==r){(h=new o(null)).length=u+1,h.words=new Array(h.length);for(var f=0;f<h.length;f++)h.words[f]=0}var c=n.clone()._ishlnsubmul(s,1,u);0===c.negative&&(n=c,h&&(h.words[u]=1));for(var l=u-1;l>=0;l--){var d=67108864*(0|n.words[s.length+l])+(0|n.words[s.length+l-1]);for(d=Math.min(d/a|0,67108863),n._ishlnsubmul(s,d,l);0!==n.negative;)d--,n.negative=0,n._ishlnsubmul(s,1,l),n.isZero()||(n.negative^=1);h&&(h.words[l]=d)}return h&&h.strip(),n.strip(),"div"!==r&&0!==i&&n.iushrn(i),{div:h||null,mod:n}},o.prototype.divmod=function t(e,r,n){return i(!e.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===e.negative?(h=this.neg().divmod(e,r),"mod"!==r&&(s=h.div.neg()),"div"!==r&&(a=h.mod.neg(),n&&0!==a.negative&&a.iadd(e)),{div:s,mod:a}):0===this.negative&&0!==e.negative?(h=this.divmod(e.neg(),r),"mod"!==r&&(s=h.div.neg()),{div:s,mod:h.mod}):0!=(this.negative&e.negative)?(h=this.neg().divmod(e.neg(),r),"div"!==r&&(a=h.mod.neg(),n&&0!==a.negative&&a.isub(e)),{div:h.div,mod:a}):e.length>this.length||this.cmp(e)<0?{div:new o(0),mod:this}:1===e.length?"div"===r?{div:this.divn(e.words[0]),mod:null}:"mod"===r?{div:null,mod:new o(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new o(this.modn(e.words[0]))}:this._wordDiv(e,r);var s,a,h},o.prototype.div=function t(e){return this.divmod(e,"div",!1).div},o.prototype.mod=function t(e){return this.divmod(e,"mod",!1).mod},o.prototype.umod=function t(e){return this.divmod(e,"mod",!0).mod},o.prototype.divRound=function t(e){var r=this.divmod(e);if(r.mod.isZero())return r.div;var i=0!==r.div.negative?r.mod.isub(e):r.mod,n=e.ushrn(1),o=e.andln(1),s=i.cmp(n);return s<0||1===o&&0===s?r.div:0!==r.div.negative?r.div.isubn(1):r.div.iaddn(1)},o.prototype.modn=function t(e){i(e<=67108863);for(var r=(1<<26)%e,n=0,o=this.length-1;o>=0;o--)n=(r*n+(0|this.words[o]))%e;return n},o.prototype.idivn=function t(e){i(e<=67108863);for(var r=0,n=this.length-1;n>=0;n--){var o=(0|this.words[n])+67108864*r;this.words[n]=o/e|0,r=o%e}return this.strip()},o.prototype.divn=function t(e){return this.clone().idivn(e)},o.prototype.egcd=function t(e){i(0===e.negative),i(!e.isZero());var r=this,n=e.clone();r=0!==r.negative?r.umod(e):r.clone();for(var s=new o(1),a=new o(0),h=new o(0),u=new o(1),f=0;r.isEven()&&n.isEven();)r.iushrn(1),n.iushrn(1),++f;for(var c=n.clone(),l=r.clone();!r.isZero();){for(var d=0,p=1;0==(r.words[0]&p)&&d<26;++d,p<<=1);if(d>0)for(r.iushrn(d);d-- >0;)(s.isOdd()||a.isOdd())&&(s.iadd(c),a.isub(l)),s.iushrn(1),a.iushrn(1);for(var m=0,g=1;0==(n.words[0]&g)&&m<26;++m,g<<=1);if(m>0)for(n.iushrn(m);m-- >0;)(h.isOdd()||u.isOdd())&&(h.iadd(c),u.isub(l)),h.iushrn(1),u.iushrn(1);r.cmp(n)>=0?(r.isub(n),s.isub(h),a.isub(u)):(n.isub(r),h.isub(s),u.isub(a))}return{a:h,b:u,gcd:n.iushln(f)}},o.prototype._invmp=function t(e){i(0===e.negative),i(!e.isZero());var r=this,n=e.clone();r=0!==r.negative?r.umod(e):r.clone();for(var s,a=new o(1),h=new o(0),u=n.clone();r.cmpn(1)>0&&n.cmpn(1)>0;){for(var f=0,c=1;0==(r.words[0]&c)&&f<26;++f,c<<=1);if(f>0)for(r.iushrn(f);f-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);for(var l=0,d=1;0==(n.words[0]&d)&&l<26;++l,d<<=1);if(l>0)for(n.iushrn(l);l-- >0;)h.isOdd()&&h.iadd(u),h.iushrn(1);r.cmp(n)>=0?(r.isub(n),a.isub(h)):(n.isub(r),h.isub(a))}return(s=0===r.cmpn(1)?a:h).cmpn(0)<0&&s.iadd(e),s},o.prototype.gcd=function t(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var r=this.clone(),i=e.clone();r.negative=0,i.negative=0;for(var n=0;r.isEven()&&i.isEven();n++)r.iushrn(1),i.iushrn(1);for(;;){for(;r.isEven();)r.iushrn(1);for(;i.isEven();)i.iushrn(1);var o=r.cmp(i);if(o<0){var s=r;r=i,i=s}else if(0===o||0===i.cmpn(1))break;r.isub(i)}return i.iushln(n)},o.prototype.invm=function t(e){return this.egcd(e).a.umod(e)},o.prototype.isEven=function t(){return 0==(1&this.words[0])},o.prototype.isOdd=function t(){return 1==(1&this.words[0])},o.prototype.andln=function t(e){return this.words[0]&e},o.prototype.bincn=function t(e){i("number"==typeof e);var r=e%26,n=(e-r)/26,o=1<<r;if(this.length<=n)return this._expand(n+1),this.words[n]|=o,this;for(var s=o,a=n;0!==s&&a<this.length;a++){var h=0|this.words[a];s=(h+=s)>>>26,h&=67108863,this.words[a]=h}return 0!==s&&(this.words[a]=s,this.length++),this},o.prototype.isZero=function t(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function t(e){var r,n=e<0;if(0!==this.negative&&!n)return-1;if(0===this.negative&&n)return 1;if(this.strip(),this.length>1)r=1;else{n&&(e=-e),i(e<=67108863,"Number is too big");var o=0|this.words[0];r=o===e?0:o<e?-1:1}return 0!==this.negative?0|-r:r},o.prototype.cmp=function t(e){if(0!==this.negative&&0===e.negative)return-1;if(0===this.negative&&0!==e.negative)return 1;var r=this.ucmp(e);return 0!==this.negative?0|-r:r},o.prototype.ucmp=function t(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var r=0,i=this.length-1;i>=0;i--){var n=0|this.words[i],o=0|e.words[i];if(n!==o){n<o?r=-1:n>o&&(r=1);break}}return r},o.prototype.gtn=function t(e){return 1===this.cmpn(e)},o.prototype.gt=function t(e){return 1===this.cmp(e)},o.prototype.gten=function t(e){return this.cmpn(e)>=0},o.prototype.gte=function t(e){return this.cmp(e)>=0},o.prototype.ltn=function t(e){return-1===this.cmpn(e)},o.prototype.lt=function t(e){return-1===this.cmp(e)},o.prototype.lten=function t(e){return this.cmpn(e)<=0},o.prototype.lte=function t(e){return this.cmp(e)<=0},o.prototype.eqn=function t(e){return 0===this.cmpn(e)},o.prototype.eq=function t(e){return 0===this.cmp(e)},o.red=function t(e){return new M(e)},o.prototype.toRed=function t(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)},o.prototype.fromRed=function t(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function t(e){return this.red=e,this},o.prototype.forceRed=function t(e){return i(!this.red,"Already a number in reduction context"),this._forceRed(e)},o.prototype.redAdd=function t(e){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},o.prototype.redIAdd=function t(e){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},o.prototype.redSub=function t(e){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},o.prototype.redISub=function t(e){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},o.prototype.redShl=function t(e){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},o.prototype.redMul=function t(e){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},o.prototype.redIMul=function t(e){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},o.prototype.redSqr=function t(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function t(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function t(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function t(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function t(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function t(e){return i(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var g={k256:null,p224:null,p192:null,p25519:null};function v(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function b(){v.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function y(){v.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function w(){v.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function _(){v.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function M(t){if("string"==typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else i(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function S(t){M.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}v.prototype._tmp=function t(){var e=new o(null);return e.words=new Array(Math.ceil(this.n/13)),e},v.prototype.ireduce=function t(e){var r,i=e;do{this.split(i,this.tmp),r=(i=(i=this.imulK(i)).iadd(this.tmp)).bitLength()}while(r>this.n);var n=r<this.n?-1:i.ucmp(this.p);return 0===n?(i.words[0]=0,i.length=1):n>0?i.isub(this.p):void 0!==i.strip?i.strip():i._strip(),i},v.prototype.split=function t(e,r){e.iushrn(this.n,0,r)},v.prototype.imulK=function t(e){return e.imul(this.k)},n(b,v),b.prototype.split=function t(e,r){for(var i=4194303,n=Math.min(e.length,9),o=0;o<n;o++)r.words[o]=e.words[o];if(r.length=n,e.length<=9)return e.words[0]=0,void(e.length=1);var s=e.words[9];for(r.words[r.length++]=s&i,o=10;o<e.length;o++){var a=0|e.words[o];e.words[o-10]=(a&i)<<4|s>>>22,s=a}s>>>=22,e.words[o-10]=s,0===s&&e.length>10?e.length-=10:e.length-=9},b.prototype.imulK=function t(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var r=0,i=0;i<e.length;i++){var n=0|e.words[i];r+=977*n,e.words[i]=67108863&r,r=64*n+(r/67108864|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},n(y,v),n(w,v),n(_,v),_.prototype.imulK=function t(e){for(var r=0,i=0;i<e.length;i++){var n=19*(0|e.words[i])+r,o=67108863&n;n>>>=26,e.words[i]=o,r=n}return 0!==r&&(e.words[e.length++]=r),e},o._prime=function t(e){if(g[e])return g[e];var t;if("k256"===e)t=new b;else if("p224"===e)t=new y;else if("p192"===e)t=new w;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new _}return g[e]=t,t},M.prototype._verify1=function t(e){i(0===e.negative,"red works only with positives"),i(e.red,"red works only with red numbers")},M.prototype._verify2=function t(e,r){i(0==(e.negative|r.negative),"red works only with positives"),i(e.red&&e.red===r.red,"red works only with red numbers")},M.prototype.imod=function t(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},M.prototype.neg=function t(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},M.prototype.add=function t(e,r){this._verify2(e,r);var i=e.add(r);return i.cmp(this.m)>=0&&i.isub(this.m),i._forceRed(this)},M.prototype.iadd=function t(e,r){this._verify2(e,r);var i=e.iadd(r);return i.cmp(this.m)>=0&&i.isub(this.m),i},M.prototype.sub=function t(e,r){this._verify2(e,r);var i=e.sub(r);return i.cmpn(0)<0&&i.iadd(this.m),i._forceRed(this)},M.prototype.isub=function t(e,r){this._verify2(e,r);var i=e.isub(r);return i.cmpn(0)<0&&i.iadd(this.m),i},M.prototype.shl=function t(e,r){return this._verify1(e),this.imod(e.ushln(r))},M.prototype.imul=function t(e,r){return this._verify2(e,r),this.imod(e.imul(r))},M.prototype.mul=function t(e,r){return this._verify2(e,r),this.imod(e.mul(r))},M.prototype.isqr=function t(e){return this.imul(e,e.clone())},M.prototype.sqr=function t(e){return this.mul(e,e)},M.prototype.sqrt=function t(e){if(e.isZero())return e.clone();var r=this.m.andln(3);if(i(r%2==1),3===r){var n=this.m.add(new o(1)).iushrn(2);return this.pow(e,n)}for(var s=this.m.subn(1),a=0;!s.isZero()&&0===s.andln(1);)a++,s.iushrn(1);i(!s.isZero());var h=new o(1).toRed(this),u=h.redNeg(),f=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new o(2*c*c).toRed(this);0!==this.pow(c,f).cmp(u);)c.redIAdd(u);for(var l=this.pow(c,s),d=this.pow(e,s.addn(1).iushrn(1)),p=this.pow(e,s),m=a;0!==p.cmp(h);){for(var g=p,v=0;0!==g.cmp(h);v++)g=g.redSqr();i(v<m);var b=this.pow(l,new o(1).iushln(m-v-1));d=d.redMul(b),l=b.redSqr(),p=p.redMul(l),m=v}return d},M.prototype.invm=function t(e){var r=e._invmp(this.m);return 0!==r.negative?(r.negative=0,this.imod(r).redNeg()):this.imod(r)},M.prototype.pow=function t(e,r){if(r.isZero())return new o(1).toRed(this);if(0===r.cmpn(1))return e.clone();var i=new Array(16);i[0]=new o(1).toRed(this),i[1]=e;for(var n=2;n<i.length;n++)i[n]=this.mul(i[n-1],e);var s=i[0],a=0,h=0,u=r.bitLength()%26;for(0===u&&(u=26),n=r.length-1;n>=0;n--){for(var f=r.words[n],c=u-1;c>=0;c--){var l=f>>c&1;s!==i[0]&&(s=this.sqr(s)),0!==l||0!==a?(a<<=1,a|=l,(4===++h||0===n&&0===c)&&(s=this.mul(s,i[a]),h=0,a=0)):h=0}u=26}return s},M.prototype.convertTo=function t(e){var r=e.umod(this.m);return r===e?r.clone():r},M.prototype.convertFrom=function t(e){var r=e.clone();return r.red=null,r},o.mont=function t(e){return new S(e)},n(S,M),S.prototype.convertTo=function t(e){return this.imod(e.ushln(this.shift))},S.prototype.convertFrom=function t(e){var r=this.imod(e.mul(this.rinv));return r.red=null,r},S.prototype.imul=function t(e,r){if(e.isZero()||r.isZero())return e.words[0]=0,e.length=1,e;var i=e.imul(r),n=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=i.isub(n).iushrn(this.shift),s=o;return o.cmp(this.m)>=0?s=o.isub(this.m):o.cmpn(0)<0&&(s=o.iadd(this.m)),s._forceRed(this)},S.prototype.mul=function t(e,r){if(e.isZero()||r.isZero())return new o(0)._forceRed(this);var i=e.mul(r),n=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),s=i.isub(n).iushrn(this.shift),a=s;return s.cmp(this.m)>=0?a=s.isub(this.m):s.cmpn(0)<0&&(a=s.iadd(this.m)),a._forceRed(this)},S.prototype.invm=function t(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(t,this)}).call(this,r(28)(t))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SigninRequest=void 0;var i=r(0),n=r(48),o=r(199);e.SigninRequest=function(){function t(e){var r=e.url,s=e.client_id,a=e.redirect_uri,h=e.response_type,u=e.scope,f=e.authority,c=e.data,l=e.prompt,d=e.display,p=e.max_age,m=e.ui_locales,g=e.id_token_hint,v=e.login_hint,b=e.acr_values,y=e.resource,w=e.response_mode,_=e.request,M=e.request_uri,S=e.extraQueryParams,k=e.request_type,E=e.client_secret,R=e.extraTokenParams,A=e.skipUserInfo;if(function x(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),!r)throw i.Log.error("SigninRequest.ctor: No url passed"),new Error("url");if(!s)throw i.Log.error("SigninRequest.ctor: No client_id passed"),new Error("client_id");if(!a)throw i.Log.error("SigninRequest.ctor: No redirect_uri passed"),new Error("redirect_uri");if(!h)throw i.Log.error("SigninRequest.ctor: No response_type passed"),new Error("response_type");if(!u)throw i.Log.error("SigninRequest.ctor: No scope passed"),new Error("scope");if(!f)throw i.Log.error("SigninRequest.ctor: No authority passed"),new Error("authority");var T=t.isOidc(h),P=t.isCode(h);w||(w=t.isCode(h)?"query":null),this.state=new o.SigninState({nonce:T,data:c,client_id:s,authority:f,redirect_uri:a,code_verifier:P,request_type:k,response_mode:w,client_secret:E,scope:u,extraTokenParams:R,skipUserInfo:A}),r=n.UrlUtility.addQueryParam(r,"client_id",s),r=n.UrlUtility.addQueryParam(r,"redirect_uri",a),r=n.UrlUtility.addQueryParam(r,"response_type",h),r=n.UrlUtility.addQueryParam(r,"scope",u),r=n.UrlUtility.addQueryParam(r,"state",this.state.id),T&&(r=n.UrlUtility.addQueryParam(r,"nonce",this.state.nonce)),P&&(r=n.UrlUtility.addQueryParam(r,"code_challenge",this.state.code_challenge),r=n.UrlUtility.addQueryParam(r,"code_challenge_method","S256"));var I={prompt:l,display:d,max_age:p,ui_locales:m,id_token_hint:g,login_hint:v,acr_values:b,resource:y,request:_,request_uri:M,response_mode:w};for(var L in I)I[L]&&(r=n.UrlUtility.addQueryParam(r,L,I[L]));for(var O in S)r=n.UrlUtility.addQueryParam(r,O,S[O]);this.url=r}return t.isOidc=function t(e){return!!e.split(/\s+/g).filter((function(t){return"id_token"===t}))[0]},t.isOAuth=function t(e){return!!e.split(/\s+/g).filter((function(t){return"token"===t}))[0]},t.isCode=function t(e){return!!e.split(/\s+/g).filter((function(t){return"code"===t}))[0]},t}()},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.State=void 0;var i=function(){function t(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,r,i){return r&&t(e.prototype,r),i&&t(e,i),e}}(),n=r(0),o=function s(t){return t&&t.__esModule?t:{default:t}}(r(200));function a(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}e.State=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=e.id,i=e.data,n=e.created,s=e.request_type;a(this,t),this._id=r||(0,o.default)(),this._data=i,this._created="number"==typeof n&&n>0?n:parseInt(Date.now()/1e3),this._request_type=s}return t.prototype.toStorageString=function t(){return n.Log.debug("State.toStorageString"),JSON.stringify({id:this.id,data:this.data,created:this.created,request_type:this.request_type})},t.fromStorageString=function e(r){return n.Log.debug("State.fromStorageString"),new t(JSON.parse(r))},t.clearStaleState=function e(r,i){var o=Date.now()/1e3-i;return r.getAllKeys().then((function(e){n.Log.debug("State.clearStaleState: got keys",e);for(var i=[],s=function s(a){var u=e[a];h=r.get(u).then((function(e){var i=!1;if(e)try{var s=t.fromStorageString(e);n.Log.debug("State.clearStaleState: got item from key: ",u,s.created),s.created<=o&&(i=!0)}catch(t){n.Log.error("State.clearStaleState: Error parsing state for key",u,t.message),i=!0}else n.Log.debug("State.clearStaleState: no item in storage for key: ",u),i=!0;if(i)return n.Log.debug("State.clearStaleState: removed item for key: ",u),r.remove(u)})),i.push(h)},a=0;a<e.length;a++){var h;s(a)}return n.Log.debug("State.clearStaleState: waiting on promise count:",i.length),Promise.all(i)}))},i(t,[{key:"id",get:function t(){return this._id}},{key:"data",get:function t(){return this._data}},{key:"created",get:function t(){return this._created}},{key:"request_type",get:function t(){return this._request_type}}]),t}()},function(t,e,r){"use strict";var i=r(8),n=r(78),o=r(123),s=r(79),a=r(18),h=r(39),u=r(56),f=function t(e,r){var i=this;if(!(i instanceof f))return new f(e,r);o&&(i=o(new Error(void 0),n(i))),void 0!==r&&a(i,"message",String(r));var s=[];return u(e,s.push,{that:s}),a(i,"errors",s),i};f.prototype=s(Error.prototype,{constructor:h(5,f),message:h(5,""),name:h(5,"AggregateError")}),i({global:!0},{AggregateError:f})},function(t,e,r){"use strict";var i={}.propertyIsEnumerable,n=Object.getOwnPropertyDescriptor,o=n&&!i.call({1:2},1);e.f=o?function t(e){var r=n(this,e);return!!r&&r.enumerable}:i},function(t,e,r){var i=r(17),n=r(9),o=r(71);t.exports=!i&&!n((function(){return 7!=Object.defineProperty(o("div"),"a",{get:function(){return 7}}).a}))},function(t,e,r){var i=r(40),n=r(74);(t.exports=function(t,e){return n[t]||(n[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.6.5",mode:i?"pure":"global",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"})},function(t,e){var r=0,i=Math.random();t.exports=function(t){return"Symbol("+String(void 0===t?"":t)+")_"+(++r+i).toString(36)}},function(t,e,r){var i=r(12),n=r(49),o=r(216).indexOf,s=r(76);t.exports=function(t,e){var r,a=n(t),h=0,u=[];for(r in a)!i(s,r)&&i(a,r)&&u.push(r);for(;e.length>h;)i(a,r=e[h++])&&(~o(u,r)||u.push(r));return u}},function(t,e,r){var i=r(54),n=Math.max,o=Math.min;t.exports=function(t,e){var r=i(t);return r<0?n(r+e,0):o(r,e)}},function(t,e){e.f=Object.getOwnPropertySymbols},function(t,e,r){var i=r(9),n=/#|\.prototype\./,o=function(t,e){var r=a[s(t)];return r==u||r!=h&&("function"==typeof e?i(e):!!e)},s=o.normalize=function(t){return String(t).replace(n,".").toLowerCase()},a=o.data={},h=o.NATIVE="N",u=o.POLYFILL="P";t.exports=o},function(t,e,r){var i=r(15),n=r(218);t.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var t,e=!1,r={};try{(t=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set).call(r,[]),e=r instanceof Array}catch(t){}return function r(o,s){return i(o),n(s),e?t.call(o,s):o.__proto__=s,o}}():void 0)},function(t,e,r){var i=r(119),n=r(77);t.exports=Object.keys||function t(e){return i(e,n)}},function(t,e,r){var i=r(22);t.exports=i("document","documentElement")},function(t,e,r){var i=r(9);t.exports=!!Object.getOwnPropertySymbols&&!i((function(){return!String(Symbol())}))},function(t,e,r){var i=r(80),n=r(50),o=r(6)("toStringTag"),s="Arguments"==n(function(){return arguments}());t.exports=i?n:function(t){var e,r,i;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(r=function(t,e){try{return t[e]}catch(t){}}(e=Object(t),o))?r:s?n(e):"Object"==(i=n(e))&&"function"==typeof e.callee?"Arguments":i}},function(t,e,r){var i=r(3);t.exports=i.Promise},function(t,e,r){var i=r(15),n=r(23),o=r(6)("species");t.exports=function(t,e){var r,s=i(t).constructor;return void 0===s||null==(r=i(s)[o])?e:n(r)}},function(t,e,r){var i,n,o,s=r(3),a=r(9),h=r(57),u=r(125),f=r(71),c=r(131),l=r(83),d=s.location,p=s.setImmediate,m=s.clearImmediate,g=s.process,v=s.MessageChannel,b=s.Dispatch,y=0,w={},_="onreadystatechange",M=function(t){if(w.hasOwnProperty(t)){var e=w[t];delete w[t],e()}},S=function(t){return function(){M(t)}},k=function(t){M(t.data)},E=function(t){s.postMessage(t+"",d.protocol+"//"+d.host)};p&&m||(p=function t(e){for(var r=[],n=1;arguments.length>n;)r.push(arguments[n++]);return w[++y]=function(){("function"==typeof e?e:Function(e)).apply(void 0,r)},i(y),y},m=function t(e){delete w[e]},l?i=function(t){g.nextTick(S(t))}:b&&b.now?i=function(t){b.now(S(t))}:v&&!c?(o=(n=new v).port2,n.port1.onmessage=k,i=h(o.postMessage,o,1)):s.addEventListener&&"function"==typeof postMessage&&!s.importScripts&&d&&"file:"!==d.protocol&&!a(E)?(i=E,s.addEventListener("message",k,!1)):i=_ in f("script")?function(t){u.appendChild(f("script")).onreadystatechange=function(){u.removeChild(this),M(t)}}:function(t){setTimeout(S(t),0)}),t.exports={set:p,clear:m}},function(t,e,r){var i=r(82);t.exports=/(iphone|ipod|ipad).*applewebkit/i.test(i)},function(t,e,r){var i=r(15),n=r(14),o=r(42);t.exports=function(t,e){if(i(t),n(e)&&e.constructor===t)return e;var r=o.f(t);return(0,r.resolve)(e),r.promise}},function(t,e,r){var i,n,o=r(3),s=r(82),a=o.process,h=a&&a.versions,u=h&&h.v8;u?n=(i=u.split("."))[0]+i[1]:s&&(!(i=s.match(/Edge\/(\d+)/))||i[1]>=74)&&(i=s.match(/Chrome\/(\d+)/))&&(n=i[1]),t.exports=n&&+n},function(t,e,r){"use strict";var i=r(8),n=r(23),o=r(42),s=r(58),a=r(56);i({target:"Promise",stat:!0},{allSettled:function t(e){var r=this,i=o.f(r),h=i.resolve,u=i.reject,f=s((function(){var t=n(r.resolve),i=[],o=0,s=1;a(e,(function(e){var n=o++,a=!1;i.push(void 0),s++,t.call(r,e).then((function(t){a||(a=!0,i[n]={status:"fulfilled",value:t},--s||h(i))}),(function(t){a||(a=!0,i[n]={status:"rejected",reason:t},--s||h(i))}))})),--s||h(i)}));return f.error&&u(f.value),i.promise}})},function(t,e,r){"use strict";var i=r(8),n=r(23),o=r(22),s=r(42),a=r(58),h=r(56),u="No one promise resolved";i({target:"Promise",stat:!0},{any:function t(e){var r=this,i=s.f(r),f=i.resolve,c=i.reject,l=a((function(){var t=n(r.resolve),i=[],s=0,a=1,l=!1;h(e,(function(e){var n=s++,h=!1;i.push(void 0),a++,t.call(r,e).then((function(t){h||l||(l=!0,f(t))}),(function(t){h||l||(h=!0,i[n]=t,--a||c(new(o("AggregateError"))(i,u)))}))})),--a||c(new(o("AggregateError"))(i,u))}));return l.error&&c(l.value),i.promise}})},function(t,e,r){"use strict";var i=r(8),n=r(237),o=r(78),s=r(123),a=r(81),h=r(18),u=r(29),f=r(6),c=r(40),l=r(41),d=r(137),p=d.IteratorPrototype,m=d.BUGGY_SAFARI_ITERATORS,g=f("iterator"),v="keys",b="values",y="entries",w=function(){return this};t.exports=function(t,e,r,f,d,_,M){n(r,e,f);var S,k,E,R=function(t){if(t===d&&I)return I;if(!m&&t in T)return T[t];switch(t){case v:return function e(){return new r(this,t)};case b:return function e(){return new r(this,t)};case y:return function e(){return new r(this,t)}}return function(){return new r(this)}},A=e+" Iterator",x=!1,T=t.prototype,P=T[g]||T["@@iterator"]||d&&T[d],I=!m&&P||R(d),L="Array"==e&&T.entries||P;if(L&&(S=o(L.call(new t)),p!==Object.prototype&&S.next&&(c||o(S)===p||(s?s(S,p):"function"!=typeof S[g]&&h(S,g,w)),a(S,A,!0,!0),c&&(l[A]=w))),d==b&&P&&P.name!==b&&(x=!0,I=function t(){return P.call(this)}),c&&!M||T[g]===I||h(T,g,I),l[e]=I,d)if(k={values:R(b),keys:_?I:R(v),entries:R(y)},M)for(E in k)(m||x||!(E in T))&&u(T,E,k[E]);else i({target:e,proto:!0,forced:m||x},k);return k}},function(t,e,r){"use strict";var i,n,o,s=r(9),a=r(78),h=r(18),u=r(12),f=r(6),c=r(40),l=f("iterator"),d=!1;[].keys&&("next"in(o=[].keys())?(n=a(a(o)))!==Object.prototype&&(i=n):d=!0);var p=null==i||s((function(){var t={};return i[l].call(t)!==t}));p&&(i={}),c&&!p||u(i,l)||h(i,l,(function(){return this})),t.exports={IteratorPrototype:i,BUGGY_SAFARI_ITERATORS:d}},function(t,e,r){var i=r(6),n=r(79),o=r(21),s=i("unscopables"),a=Array.prototype;null==a[s]&&o.f(a,s,{configurable:!0,value:n(null)}),t.exports=function(t){a[s][t]=!0}},function(t,e,r){var i=r(57),n=r(68),o=r(55),s=r(53),a=r(140),h=[].push,u=function(t){var e=1==t,r=2==t,u=3==t,f=4==t,c=6==t,l=7==t,d=5==t||c;return function(p,m,g,v){for(var b,y,w=o(p),_=n(w),M=i(m,g,3),S=s(_.length),k=0,E=v||a,R=e?E(p,S):r||l?E(p,0):void 0;S>k;k++)if((d||k in _)&&(y=M(b=_[k],k,w),t))if(e)R[k]=y;else if(y)switch(t){case 3:return!0;case 5:return b;case 6:return k;case 2:h.call(R,b)}else switch(t){case 4:return!1;case 7:h.call(R,b)}return c?-1:u||f?f:R}};t.exports={forEach:u(0),map:u(1),filter:u(2),some:u(3),every:u(4),find:u(5),findIndex:u(6),filterOut:u(7)}},function(t,e,r){var i=r(14),n=r(141),o=r(6)("species");t.exports=function(t,e){var r;return n(t)&&("function"!=typeof(r=t.constructor)||r!==Array&&!n(r.prototype)?i(r)&&null===(r=r[o])&&(r=void 0):r=void 0),new(void 0===r?Array:r)(0===e?0:e)}},function(t,e,r){var i=r(50);t.exports=Array.isArray||function t(e){return"Array"==i(e)}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.OidcClient=void 0;var i=function(){function t(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,r,i){return r&&t(e.prototype,r),i&&t(e,i),e}}(),n=r(0),o=r(85),s=r(198),a=r(112),h=r(379),u=r(380),f=r(381),c=r(199),l=r(113);function d(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}e.OidcClient=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};d(this,t),e instanceof o.OidcClientSettings?this._settings=e:this._settings=new o.OidcClientSettings(e)}return t.prototype.createSigninRequest=function t(){var e=this,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=r.response_type,o=r.scope,s=r.redirect_uri,h=r.data,u=r.state,f=r.prompt,c=r.display,l=r.max_age,d=r.ui_locales,p=r.id_token_hint,m=r.login_hint,g=r.acr_values,v=r.resource,b=r.request,y=r.request_uri,w=r.response_mode,_=r.extraQueryParams,M=r.extraTokenParams,S=r.request_type,k=r.skipUserInfo,E=arguments[1];n.Log.debug("OidcClient.createSigninRequest");var R=this._settings.client_id;i=i||this._settings.response_type,o=o||this._settings.scope,s=s||this._settings.redirect_uri,f=f||this._settings.prompt,c=c||this._settings.display,l=l||this._settings.max_age,d=d||this._settings.ui_locales,g=g||this._settings.acr_values,v=v||this._settings.resource,w=w||this._settings.response_mode,_=_||this._settings.extraQueryParams,M=M||this._settings.extraTokenParams;var A=this._settings.authority;return a.SigninRequest.isCode(i)&&"code"!==i?Promise.reject(new Error("OpenID Connect hybrid flow is not supported")):this._metadataService.getAuthorizationEndpoint().then((function(t){n.Log.debug("OidcClient.createSigninRequest: Received authorization endpoint",t);var r=new a.SigninRequest({url:t,client_id:R,redirect_uri:s,response_type:i,scope:o,data:h||u,authority:A,prompt:f,display:c,max_age:l,ui_locales:d,id_token_hint:p,login_hint:m,acr_values:g,resource:v,request:b,request_uri:y,extraQueryParams:_,extraTokenParams:M,request_type:S,response_mode:w,client_secret:e._settings.client_secret,skipUserInfo:k}),x=r.state;return(E=E||e._stateStore).set(x.id,x.toStorageString()).then((function(){return r}))}))},t.prototype.readSigninResponseState=function t(e,r){var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];n.Log.debug("OidcClient.readSigninResponseState");var o="query"===this._settings.response_mode||!this._settings.response_mode&&a.SigninRequest.isCode(this._settings.response_type),s=o?"?":"#",u=new h.SigninResponse(e,s);if(!u.state)return n.Log.error("OidcClient.readSigninResponseState: No state in response"),Promise.reject(new Error("No state in response"));r=r||this._stateStore;var f=i?r.remove.bind(r):r.get.bind(r);return f(u.state).then((function(t){if(!t)throw n.Log.error("OidcClient.readSigninResponseState: No matching state found in storage"),new Error("No matching state found in storage");return{state:c.SigninState.fromStorageString(t),response:u}}))},t.prototype.processSigninResponse=function t(e,r){var i=this;return n.Log.debug("OidcClient.processSigninResponse"),this.readSigninResponseState(e,r,!0).then((function(t){var e=t.state,r=t.response;return n.Log.debug("OidcClient.processSigninResponse: Received state from storage; validating response"),i._validator.validateSigninResponse(e,r)}))},t.prototype.createSignoutRequest=function t(){var e=this,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=r.id_token_hint,o=r.data,s=r.state,a=r.post_logout_redirect_uri,h=r.extraQueryParams,f=r.request_type,c=arguments[1];return n.Log.debug("OidcClient.createSignoutRequest"),a=a||this._settings.post_logout_redirect_uri,h=h||this._settings.extraQueryParams,this._metadataService.getEndSessionEndpoint().then((function(t){if(!t)throw n.Log.error("OidcClient.createSignoutRequest: No end session endpoint url returned"),new Error("no end session endpoint");n.Log.debug("OidcClient.createSignoutRequest: Received end session endpoint",t);var r=new u.SignoutRequest({url:t,id_token_hint:i,post_logout_redirect_uri:a,data:o||s,extraQueryParams:h,request_type:f}),l=r.state;return l&&(n.Log.debug("OidcClient.createSignoutRequest: Signout request has state to persist"),(c=c||e._stateStore).set(l.id,l.toStorageString())),r}))},t.prototype.readSignoutResponseState=function t(e,r){var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];n.Log.debug("OidcClient.readSignoutResponseState");var o=new f.SignoutResponse(e);if(!o.state)return n.Log.debug("OidcClient.readSignoutResponseState: No state in response"),o.error?(n.Log.warn("OidcClient.readSignoutResponseState: Response was error: ",o.error),Promise.reject(new s.ErrorResponse(o))):Promise.resolve({state:void 0,response:o});var a=o.state;r=r||this._stateStore;var h=i?r.remove.bind(r):r.get.bind(r);return h(a).then((function(t){if(!t)throw n.Log.error("OidcClient.readSignoutResponseState: No matching state found in storage"),new Error("No matching state found in storage");return{state:l.State.fromStorageString(t),response:o}}))},t.prototype.processSignoutResponse=function t(e,r){var i=this;return n.Log.debug("OidcClient.processSignoutResponse"),this.readSignoutResponseState(e,r,!0).then((function(t){var e=t.state,r=t.response;return e?(n.Log.debug("OidcClient.processSignoutResponse: Received state from storage; validating response"),i._validator.validateSignoutResponse(e,r)):(n.Log.debug("OidcClient.processSignoutResponse: No state from storage; skipping validating response"),r)}))},t.prototype.clearStaleState=function t(e){return n.Log.debug("OidcClient.clearStaleState"),e=e||this._stateStore,l.State.clearStaleState(e,this.settings.staleStateAge)},i(t,[{key:"_stateStore",get:function t(){return this.settings.stateStore}},{key:"_validator",get:function t(){return this.settings.validator}},{key:"_metadataService",get:function t(){return this.settings.metadataService}},{key:"settings",get:function t(){return this._settings}},{key:"metadataService",get:function t(){return this._metadataService}}]),t}()},function(t,e,r){"use strict";var i=r(277).Buffer,n=r(278).Transform;function o(t){n.call(this),this._block=i.allocUnsafe(t),this._blockSize=t,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}r(33)(o,n),o.prototype._transform=function(t,e,r){var i=null;try{this.update(t,e)}catch(t){i=t}r(i)},o.prototype._flush=function(t){var e=null;try{this.push(this.digest())}catch(t){e=t}t(e)},o.prototype.update=function(t,e){if(function r(t,e){if(!i.isBuffer(t)&&"string"!=typeof t)throw new TypeError(e+" must be a string or a buffer")}(t,"Data"),this._finalized)throw new Error("Digest already called");i.isBuffer(t)||(t=i.from(t,e));for(var n=this._block,o=0;this._blockOffset+t.length-o>=this._blockSize;){for(var s=this._blockOffset;s<this._blockSize;)n[s++]=t[o++];this._update(),this._blockOffset=0}for(;o<t.length;)n[this._blockOffset++]=t[o++];for(var a=0,h=8*t.length;h>0;++a)this._length[a]+=h,(h=this._length[a]/4294967296|0)>0&&(this._length[a]-=4294967296*h);return this},o.prototype._update=function(){throw new Error("_update is not implemented")},o.prototype.digest=function(t){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var e=this._digest();void 0!==t&&(e=e.toString(t)),this._block.fill(0),this._blockOffset=0;for(var r=0;r<4;++r)this._length[r]=0;return e},o.prototype._digest=function(){throw new Error("_digest is not implemented")},t.exports=o},function(t,e,r){"use strict";(function(e,i){var n;t.exports=E,E.ReadableState=k;r(24).EventEmitter;var o=function t(e,r){return e.listeners(r).length},s=r(145),a=r(7).Buffer,h=e.Uint8Array||function(){};var u,f=r(279);u=f&&f.debuglog?f.debuglog("stream"):function t(){};var c,l,d,p=r(280),m=r(146),g=r(147).getHighWaterMark,v=r(32).codes,b=v.ERR_INVALID_ARG_TYPE,y=v.ERR_STREAM_PUSH_AFTER_EOF,w=v.ERR_METHOD_NOT_IMPLEMENTED,_=v.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;r(33)(E,s);var M=m.errorOrDestroy,S=["error","close","destroy","pause","resume"];function k(t,e,i){n=n||r(34),t=t||{},"boolean"!=typeof i&&(i=e instanceof n),this.objectMode=!!t.objectMode,i&&(this.objectMode=this.objectMode||!!t.readableObjectMode),this.highWaterMark=g(this,t,"readableHighWaterMark",i),this.buffer=new p,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.paused=!0,this.emitClose=!1!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(c||(c=r(25).StringDecoder),this.decoder=new c(t.encoding),this.encoding=t.encoding)}function E(t){if(n=n||r(34),!(this instanceof E))return new E(t);var e=this instanceof n;this._readableState=new k(t,this,e),this.readable=!0,t&&("function"==typeof t.read&&(this._read=t.read),"function"==typeof t.destroy&&(this._destroy=t.destroy)),s.call(this)}function R(t,e,r,i,n){u("readableAddChunk",e);var o,s=t._readableState;if(null===e)s.reading=!1,function f(t,e){if(u("onEofChunk"),e.ended)return;if(e.decoder){var r=e.decoder.end();r&&r.length&&(e.buffer.push(r),e.length+=e.objectMode?1:r.length)}e.ended=!0,e.sync?P(t):(e.needReadable=!1,e.emittedReadable||(e.emittedReadable=!0,I(t)))}(t,s);else if(n||(o=function c(t,e){var r;(function i(t){return a.isBuffer(t)||t instanceof h})(e)||"string"==typeof e||void 0===e||t.objectMode||(r=new b("chunk",["string","Buffer","Uint8Array"],e));return r}(s,e)),o)M(t,o);else if(s.objectMode||e&&e.length>0)if("string"==typeof e||s.objectMode||Object.getPrototypeOf(e)===a.prototype||(e=function l(t){return a.from(t)}(e)),i)s.endEmitted?M(t,new _):A(t,s,e,!0);else if(s.ended)M(t,new y);else{if(s.destroyed)return!1;s.reading=!1,s.decoder&&!r?(e=s.decoder.write(e),s.objectMode||0!==e.length?A(t,s,e,!1):L(t,s)):A(t,s,e,!1)}else i||(s.reading=!1,L(t,s));return!s.ended&&(s.length<s.highWaterMark||0===s.length)}function A(t,e,r,i){e.flowing&&0===e.length&&!e.sync?(e.awaitDrain=0,t.emit("data",r)):(e.length+=e.objectMode?1:r.length,i?e.buffer.unshift(r):e.buffer.push(r),e.needReadable&&P(t)),L(t,e)}Object.defineProperty(E.prototype,"destroyed",{enumerable:!1,get:function t(){return void 0!==this._readableState&&this._readableState.destroyed},set:function t(e){this._readableState&&(this._readableState.destroyed=e)}}),E.prototype.destroy=m.destroy,E.prototype._undestroy=m.undestroy,E.prototype._destroy=function(t,e){e(t)},E.prototype.push=function(t,e){var r,i=this._readableState;return i.objectMode?r=!0:"string"==typeof t&&((e=e||i.defaultEncoding)!==i.encoding&&(t=a.from(t,e),e=""),r=!0),R(this,t,e,!1,r)},E.prototype.unshift=function(t){return R(this,t,null,!0,!1)},E.prototype.isPaused=function(){return!1===this._readableState.flowing},E.prototype.setEncoding=function(t){c||(c=r(25).StringDecoder);var e=new c(t);this._readableState.decoder=e,this._readableState.encoding=this._readableState.decoder.encoding;for(var i=this._readableState.buffer.head,n="";null!==i;)n+=e.write(i.data),i=i.next;return this._readableState.buffer.clear(),""!==n&&this._readableState.buffer.push(n),this._readableState.length=n.length,this};var x=1073741824;function T(t,e){return t<=0||0===e.length&&e.ended?0:e.objectMode?1:t!=t?e.flowing&&e.length?e.buffer.head.data.length:e.length:(t>e.highWaterMark&&(e.highWaterMark=function r(t){return t>=x?t=x:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function P(t){var e=t._readableState;u("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(u("emitReadable",e.flowing),e.emittedReadable=!0,i.nextTick(I,t))}function I(t){var e=t._readableState;u("emitReadable_",e.destroyed,e.length,e.ended),e.destroyed||!e.length&&!e.ended||(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,U(t)}function L(t,e){e.readingMore||(e.readingMore=!0,i.nextTick(O,t,e))}function O(t,e){for(;!e.reading&&!e.ended&&(e.length<e.highWaterMark||e.flowing&&0===e.length);){var r=e.length;if(u("maybeReadMore read 0"),t.read(0),r===e.length)break}e.readingMore=!1}function B(t){var e=t._readableState;e.readableListening=t.listenerCount("readable")>0,e.resumeScheduled&&!e.paused?e.flowing=!0:t.listenerCount("data")>0&&t.resume()}function j(t){u("readable nexttick read 0"),t.read(0)}function C(t,e){u("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),U(t),e.flowing&&!e.reading&&t.read(0)}function U(t){var e=t._readableState;for(u("flow",e.flowing);e.flowing&&null!==t.read(););}function N(t,e){return 0===e.length?null:(e.objectMode?r=e.buffer.shift():!t||t>=e.length?(r=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.first():e.buffer.concat(e.length),e.buffer.clear()):r=e.buffer.consume(t,e.decoder),r);var r}function q(t){var e=t._readableState;u("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,i.nextTick(D,e,t))}function D(t,e){if(u("endReadableNT",t.endEmitted,t.length),!t.endEmitted&&0===t.length&&(t.endEmitted=!0,e.readable=!1,e.emit("end"),t.autoDestroy)){var r=e._writableState;(!r||r.autoDestroy&&r.finished)&&e.destroy()}}function z(t,e){for(var r=0,i=t.length;r<i;r++)if(t[r]===e)return r;return-1}E.prototype.read=function(t){u("read",t),t=parseInt(t,10);var e=this._readableState,r=t;if(0!==t&&(e.emittedReadable=!1),0===t&&e.needReadable&&((0!==e.highWaterMark?e.length>=e.highWaterMark:e.length>0)||e.ended))return u("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?q(this):P(this),null;if(0===(t=T(t,e))&&e.ended)return 0===e.length&&q(this),null;var i,n=e.needReadable;return u("need readable",n),(0===e.length||e.length-t<e.highWaterMark)&&u("length less than watermark",n=!0),e.ended||e.reading?u("reading or ended",n=!1):n&&(u("do read"),e.reading=!0,e.sync=!0,0===e.length&&(e.needReadable=!0),this._read(e.highWaterMark),e.sync=!1,e.reading||(t=T(r,e))),null===(i=t>0?N(t,e):null)?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.awaitDrain=0),0===e.length&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&q(this)),null!==i&&this.emit("data",i),i},E.prototype._read=function(t){M(this,new w("_read()"))},E.prototype.pipe=function(t,e){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=t;break;case 1:n.pipes=[n.pipes,t];break;default:n.pipes.push(t)}n.pipesCount+=1,u("pipe count=%d opts=%j",n.pipesCount,e);var s=(!e||!1!==e.end)&&t!==i.stdout&&t!==i.stderr?h:v;function a(e,i){u("onunpipe"),e===r&&i&&!1===i.hasUnpiped&&(i.hasUnpiped=!0,function o(){u("cleanup"),t.removeListener("close",m),t.removeListener("finish",g),t.removeListener("drain",f),t.removeListener("error",p),t.removeListener("unpipe",a),r.removeListener("end",h),r.removeListener("end",v),r.removeListener("data",d),l=!0,!n.awaitDrain||t._writableState&&!t._writableState.needDrain||f()}())}function h(){u("onend"),t.end()}n.endEmitted?i.nextTick(s):r.once("end",s),t.on("unpipe",a);var f=function c(t){return function e(){var r=t._readableState;u("pipeOnDrain",r.awaitDrain),r.awaitDrain&&r.awaitDrain--,0===r.awaitDrain&&o(t,"data")&&(r.flowing=!0,U(t))}}(r);t.on("drain",f);var l=!1;function d(e){u("ondata");var i=t.write(e);u("dest.write",i),!1===i&&((1===n.pipesCount&&n.pipes===t||n.pipesCount>1&&-1!==z(n.pipes,t))&&!l&&(u("false write response, pause",n.awaitDrain),n.awaitDrain++),r.pause())}function p(e){u("onerror",e),v(),t.removeListener("error",p),0===o(t,"error")&&M(t,e)}function m(){t.removeListener("finish",g),v()}function g(){u("onfinish"),t.removeListener("close",m),v()}function v(){u("unpipe"),r.unpipe(t)}return r.on("data",d),function b(t,e,r){if("function"==typeof t.prependListener)return t.prependListener(e,r);t._events&&t._events[e]?Array.isArray(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]]:t.on(e,r)}(t,"error",p),t.once("close",m),t.once("finish",g),t.emit("pipe",r),n.flowing||(u("pipe resume"),r.resume()),t},E.prototype.unpipe=function(t){var e=this._readableState,r={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes||(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,r)),this;if(!t){var i=e.pipes,n=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var o=0;o<n;o++)i[o].emit("unpipe",this,{hasUnpiped:!1});return this}var s=z(e.pipes,t);return-1===s||(e.pipes.splice(s,1),e.pipesCount-=1,1===e.pipesCount&&(e.pipes=e.pipes[0]),t.emit("unpipe",this,r)),this},E.prototype.on=function(t,e){var r=s.prototype.on.call(this,t,e),n=this._readableState;return"data"===t?(n.readableListening=this.listenerCount("readable")>0,!1!==n.flowing&&this.resume()):"readable"===t&&(n.endEmitted||n.readableListening||(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,u("on readable",n.length,n.reading),n.length?P(this):n.reading||i.nextTick(j,this))),r},E.prototype.addListener=E.prototype.on,E.prototype.removeListener=function(t,e){var r=s.prototype.removeListener.call(this,t,e);return"readable"===t&&i.nextTick(B,this),r},E.prototype.removeAllListeners=function(t){var e=s.prototype.removeAllListeners.apply(this,arguments);return"readable"!==t&&void 0!==t||i.nextTick(B,this),e},E.prototype.resume=function(){var t=this._readableState;return t.flowing||(u("resume"),t.flowing=!t.readableListening,function e(t,r){r.resumeScheduled||(r.resumeScheduled=!0,i.nextTick(C,t,r))}(this,t)),t.paused=!1,this},E.prototype.pause=function(){return u("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(u("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},E.prototype.wrap=function(t){var e=this,r=this._readableState,i=!1;for(var n in t.on("end",(function(){if(u("wrapped end"),r.decoder&&!r.ended){var t=r.decoder.end();t&&t.length&&e.push(t)}e.push(null)})),t.on("data",(function(n){(u("wrapped data"),r.decoder&&(n=r.decoder.write(n)),r.objectMode&&null==n)||(r.objectMode||n&&n.length)&&(e.push(n)||(i=!0,t.pause()))})),t)void 0===this[n]&&"function"==typeof t[n]&&(this[n]=function e(r){return function e(){return t[r].apply(t,arguments)}}(n));for(var o=0;o<S.length;o++)t.on(S[o],this.emit.bind(this,S[o]));return this._read=function(e){u("wrapped _read",e),i&&(i=!1,t.resume())},this},"function"==typeof Symbol&&(E.prototype[Symbol.asyncIterator]=function(){return void 0===l&&(l=r(282)),l(this)}),Object.defineProperty(E.prototype,"readableHighWaterMark",{enumerable:!1,get:function t(){return this._readableState.highWaterMark}}),Object.defineProperty(E.prototype,"readableBuffer",{enumerable:!1,get:function t(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(E.prototype,"readableFlowing",{enumerable:!1,get:function t(){return this._readableState.flowing},set:function t(e){this._readableState&&(this._readableState.flowing=e)}}),E._fromList=N,Object.defineProperty(E.prototype,"readableLength",{enumerable:!1,get:function t(){return this._readableState.length}}),"function"==typeof Symbol&&(E.from=function(t,e){return void 0===d&&(d=r(283)),d(E,t,e)})}).call(this,r(5),r(4))},function(t,e,r){t.exports=r(24).EventEmitter},function(t,e,r){"use strict";(function(e){function r(t,e){n(t,e),i(t)}function i(t){t._writableState&&!t._writableState.emitClose||t._readableState&&!t._readableState.emitClose||t.emit("close")}function n(t,e){t.emit("error",e)}t.exports={destroy:function o(t,s){var a=this,h=this._readableState&&this._readableState.destroyed,u=this._writableState&&this._writableState.destroyed;return h||u?(s?s(t):t&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,e.nextTick(n,this,t)):e.nextTick(n,this,t)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,(function(t){!s&&t?a._writableState?a._writableState.errorEmitted?e.nextTick(i,a):(a._writableState.errorEmitted=!0,e.nextTick(r,a,t)):e.nextTick(r,a,t):s?(e.nextTick(i,a),s(t)):e.nextTick(i,a)})),this)},undestroy:function s(){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.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function a(t,e){var r=t._readableState,i=t._writableState;r&&r.autoDestroy||i&&i.autoDestroy?t.destroy(e):t.emit("error",e)}}}).call(this,r(4))},function(t,e,r){"use strict";var i=r(32).codes.ERR_INVALID_OPT_VALUE;t.exports={getHighWaterMark:function n(t,e,r,o){var s=function a(t,e,r){return null!=t.highWaterMark?t.highWaterMark:e?t[r]:null}(e,o,r);if(null!=s){if(!isFinite(s)||Math.floor(s)!==s||s<0)throw new i(o?r:"highWaterMark",s);return Math.floor(s)}return t.objectMode?16:16384}}},function(t,e,r){"use strict";(function(e,i){function n(t){var e=this;this.next=null,this.entry=null,this.finish=function(){!function r(t,e,i){var n=t.entry;t.entry=null;for(;n;){var o=n.callback;e.pendingcb--,o(i),n=n.next}e.corkedRequestsFree.next=t}(e,t)}}var o;t.exports=E,E.WritableState=k;var s={deprecate:r(89)},a=r(145),h=r(7).Buffer,u=e.Uint8Array||function(){};var f,c=r(146),l=r(147).getHighWaterMark,d=r(32).codes,p=d.ERR_INVALID_ARG_TYPE,m=d.ERR_METHOD_NOT_IMPLEMENTED,g=d.ERR_MULTIPLE_CALLBACK,v=d.ERR_STREAM_CANNOT_PIPE,b=d.ERR_STREAM_DESTROYED,y=d.ERR_STREAM_NULL_VALUES,w=d.ERR_STREAM_WRITE_AFTER_END,_=d.ERR_UNKNOWN_ENCODING,M=c.errorOrDestroy;function S(){}function k(t,e,s){o=o||r(34),t=t||{},"boolean"!=typeof s&&(s=e instanceof o),this.objectMode=!!t.objectMode,s&&(this.objectMode=this.objectMode||!!t.writableObjectMode),this.highWaterMark=l(this,t,"writableHighWaterMark",s),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var a=!1===t.decodeStrings;this.decodeStrings=!a,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(t){!function r(t,e){var r=t._writableState,n=r.sync,o=r.writecb;if("function"!=typeof o)throw new g;if(function s(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}(r),e)!function a(t,e,r,n,o){--e.pendingcb,r?(i.nextTick(o,n),i.nextTick(I,t,e),t._writableState.errorEmitted=!0,M(t,n)):(o(n),t._writableState.errorEmitted=!0,M(t,n),I(t,e))}(t,r,n,e,o);else{var h=T(r)||t.destroyed;h||r.corked||r.bufferProcessing||!r.bufferedRequest||x(t,r),n?i.nextTick(A,t,r,h,o):A(t,r,h,o)}}(e,t)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new n(this)}function E(t){var e=this instanceof(o=o||r(34));if(!e&&!f.call(E,this))return new E(t);this._writableState=new k(t,this,e),this.writable=!0,t&&("function"==typeof t.write&&(this._write=t.write),"function"==typeof t.writev&&(this._writev=t.writev),"function"==typeof t.destroy&&(this._destroy=t.destroy),"function"==typeof t.final&&(this._final=t.final)),a.call(this)}function R(t,e,r,i,n,o,s){e.writelen=i,e.writecb=s,e.writing=!0,e.sync=!0,e.destroyed?e.onwrite(new b("write")):r?t._writev(n,e.onwrite):t._write(n,o,e.onwrite),e.sync=!1}function A(t,e,r,i){r||function n(t,e){0===e.length&&e.needDrain&&(e.needDrain=!1,t.emit("drain"))}(t,e),e.pendingcb--,i(),I(t,e)}function x(t,e){e.bufferProcessing=!0;var r=e.bufferedRequest;if(t._writev&&r&&r.next){var i=e.bufferedRequestCount,o=new Array(i),s=e.corkedRequestsFree;s.entry=r;for(var a=0,h=!0;r;)o[a]=r,r.isBuf||(h=!1),r=r.next,a+=1;o.allBuffers=h,R(t,e,!0,e.length,o,"",s.finish),e.pendingcb++,e.lastBufferedRequest=null,s.next?(e.corkedRequestsFree=s.next,s.next=null):e.corkedRequestsFree=new n(e),e.bufferedRequestCount=0}else{for(;r;){var u=r.chunk,f=r.encoding,c=r.callback;if(R(t,e,!1,e.objectMode?1:u.length,u,f,c),r=r.next,e.bufferedRequestCount--,e.writing)break}null===r&&(e.lastBufferedRequest=null)}e.bufferedRequest=r,e.bufferProcessing=!1}function T(t){return t.ending&&0===t.length&&null===t.bufferedRequest&&!t.finished&&!t.writing}function P(t,e){t._final((function(r){e.pendingcb--,r&&M(t,r),e.prefinished=!0,t.emit("prefinish"),I(t,e)}))}function I(t,e){var r=T(e);if(r&&(function n(t,e){e.prefinished||e.finalCalled||("function"!=typeof t._final||e.destroyed?(e.prefinished=!0,t.emit("prefinish")):(e.pendingcb++,e.finalCalled=!0,i.nextTick(P,t,e)))}(t,e),0===e.pendingcb&&(e.finished=!0,t.emit("finish"),e.autoDestroy))){var o=t._readableState;(!o||o.autoDestroy&&o.endEmitted)&&t.destroy()}return r}r(33)(E,a),k.prototype.getBuffer=function t(){for(var e=this.bufferedRequest,r=[];e;)r.push(e),e=e.next;return r},function(){try{Object.defineProperty(k.prototype,"buffer",{get:s.deprecate((function t(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(t){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(f=Function.prototype[Symbol.hasInstance],Object.defineProperty(E,Symbol.hasInstance,{value:function t(e){return!!f.call(this,e)||this===E&&(e&&e._writableState instanceof k)}})):f=function t(e){return e instanceof this},E.prototype.pipe=function(){M(this,new v)},E.prototype.write=function(t,e,r){var n=this._writableState,o=!1,s=!n.objectMode&&function a(t){return h.isBuffer(t)||t instanceof u}(t);return s&&!h.isBuffer(t)&&(t=function f(t){return h.from(t)}(t)),"function"==typeof e&&(r=e,e=null),s?e="buffer":e||(e=n.defaultEncoding),"function"!=typeof r&&(r=S),n.ending?function c(t,e){var r=new w;M(t,r),i.nextTick(e,r)}(this,r):(s||function l(t,e,r,n){var o;return null===r?o=new y:"string"==typeof r||e.objectMode||(o=new p("chunk",["string","Buffer"],r)),!o||(M(t,o),i.nextTick(n,o),!1)}(this,n,t,r))&&(n.pendingcb++,o=function d(t,e,r,i,n,o){if(!r){var s=function a(t,e,r){t.objectMode||!1===t.decodeStrings||"string"!=typeof e||(e=h.from(e,r));return e}(e,i,n);i!==s&&(r=!0,n="buffer",i=s)}var u=e.objectMode?1:i.length;e.length+=u;var f=e.length<e.highWaterMark;f||(e.needDrain=!0);if(e.writing||e.corked){var c=e.lastBufferedRequest;e.lastBufferedRequest={chunk:i,encoding:n,isBuf:r,callback:o,next:null},c?c.next=e.lastBufferedRequest:e.bufferedRequest=e.lastBufferedRequest,e.bufferedRequestCount+=1}else R(t,e,!1,u,i,n,o);return f}(this,n,s,t,e,r)),o},E.prototype.cork=function(){this._writableState.corked++},E.prototype.uncork=function(){var t=this._writableState;t.corked&&(t.corked--,t.writing||t.corked||t.bufferProcessing||!t.bufferedRequest||x(this,t))},E.prototype.setDefaultEncoding=function t(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 _(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(E.prototype,"writableBuffer",{enumerable:!1,get:function t(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(E.prototype,"writableHighWaterMark",{enumerable:!1,get:function t(){return this._writableState.highWaterMark}}),E.prototype._write=function(t,e,r){r(new m("_write()"))},E.prototype._writev=null,E.prototype.end=function(t,e,r){var n=this._writableState;return"function"==typeof t?(r=t,t=null,e=null):"function"==typeof e&&(r=e,e=null),null!=t&&this.write(t,e),n.corked&&(n.corked=1,this.uncork()),n.ending||function o(t,e,r){e.ending=!0,I(t,e),r&&(e.finished?i.nextTick(r):t.once("finish",r));e.ended=!0,t.writable=!1}(this,n,r),this},Object.defineProperty(E.prototype,"writableLength",{enumerable:!1,get:function t(){return this._writableState.length}}),Object.defineProperty(E.prototype,"destroyed",{enumerable:!1,get:function t(){return void 0!==this._writableState&&this._writableState.destroyed},set:function t(e){this._writableState&&(this._writableState.destroyed=e)}}),E.prototype.destroy=c.destroy,E.prototype._undestroy=c.undestroy,E.prototype._destroy=function(t,e){e(t)}}).call(this,r(5),r(4))},function(t,e,r){"use strict";t.exports=f;var i=r(32).codes,n=i.ERR_METHOD_NOT_IMPLEMENTED,o=i.ERR_MULTIPLE_CALLBACK,s=i.ERR_TRANSFORM_ALREADY_TRANSFORMING,a=i.ERR_TRANSFORM_WITH_LENGTH_0,h=r(34);function u(t,e){var r=this._transformState;r.transforming=!1;var i=r.writecb;if(null===i)return this.emit("error",new o);r.writechunk=null,r.writecb=null,null!=e&&this.push(e),i(t);var n=this._readableState;n.reading=!1,(n.needReadable||n.length<n.highWaterMark)&&this._read(n.highWaterMark)}function f(t){if(!(this instanceof f))return new f(t);h.call(this,t),this._transformState={afterTransform:u.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,t&&("function"==typeof t.transform&&(this._transform=t.transform),"function"==typeof t.flush&&(this._flush=t.flush)),this.on("prefinish",c)}function c(){var t=this;"function"!=typeof this._flush||this._readableState.destroyed?l(this,null,null):this._flush((function(e,r){l(t,e,r)}))}function l(t,e,r){if(e)return t.emit("error",e);if(null!=r&&t.push(r),t._writableState.length)throw new a;if(t._transformState.transforming)throw new s;return t.push(null)}r(33)(f,h),f.prototype.push=function(t,e){return this._transformState.needTransform=!1,h.prototype.push.call(this,t,e)},f.prototype._transform=function(t,e,r){r(new n("_transform()"))},f.prototype._write=function(t,e,r){var i=this._transformState;if(i.writecb=r,i.writechunk=t,i.writeencoding=e,!i.transforming){var n=this._readableState;(i.needTransform||n.needReadable||n.length<n.highWaterMark)&&this._read(n.highWaterMark)}},f.prototype._read=function(t){var e=this._transformState;null===e.writechunk||e.transforming?e.needTransform=!0:(e.transforming=!0,this._transform(e.writechunk,e.writeencoding,e.afterTransform))},f.prototype._destroy=function(t,e){h.prototype._destroy.call(this,t,(function(t){e(t)}))}},function(t,e,r){var i=r(1),n=r(35),o=r(2).Buffer,s=[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],a=new Array(64);function h(){this.init(),this._w=a,n.call(this,64,56)}function u(t,e,r){return r^t&(e^r)}function f(t,e,r){return t&e|r&(t|e)}function c(t){return(t>>>2|t<<30)^(t>>>13|t<<19)^(t>>>22|t<<10)}function l(t){return(t>>>6|t<<26)^(t>>>11|t<<21)^(t>>>25|t<<7)}function d(t){return(t>>>7|t<<25)^(t>>>18|t<<14)^t>>>3}i(h,n),h.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},h.prototype._update=function(t){for(var e,r=this._w,i=0|this._a,n=0|this._b,o=0|this._c,a=0|this._d,h=0|this._e,p=0|this._f,m=0|this._g,g=0|this._h,v=0;v<16;++v)r[v]=t.readInt32BE(4*v);for(;v<64;++v)r[v]=0|(((e=r[v-2])>>>17|e<<15)^(e>>>19|e<<13)^e>>>10)+r[v-7]+d(r[v-15])+r[v-16];for(var b=0;b<64;++b){var y=g+l(h)+u(h,p,m)+s[b]+r[b]|0,w=c(i)+f(i,n,o)|0;g=m,m=p,p=h,h=a+y|0,a=o,o=n,n=i,i=y+w|0}this._a=i+this._a|0,this._b=n+this._b|0,this._c=o+this._c|0,this._d=a+this._d|0,this._e=h+this._e|0,this._f=p+this._f|0,this._g=m+this._g|0,this._h=g+this._h|0},h.prototype._hash=function(){var t=o.allocUnsafe(32);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t.writeInt32BE(this._h,28),t},t.exports=h},function(t,e,r){var i=r(1),n=r(35),o=r(2).Buffer,s=[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],a=new Array(160);function h(){this.init(),this._w=a,n.call(this,128,112)}function u(t,e,r){return r^t&(e^r)}function f(t,e,r){return t&e|r&(t|e)}function c(t,e){return(t>>>28|e<<4)^(e>>>2|t<<30)^(e>>>7|t<<25)}function l(t,e){return(t>>>14|e<<18)^(t>>>18|e<<14)^(e>>>9|t<<23)}function d(t,e){return(t>>>1|e<<31)^(t>>>8|e<<24)^t>>>7}function p(t,e){return(t>>>1|e<<31)^(t>>>8|e<<24)^(t>>>7|e<<25)}function m(t,e){return(t>>>19|e<<13)^(e>>>29|t<<3)^t>>>6}function g(t,e){return(t>>>19|e<<13)^(e>>>29|t<<3)^(t>>>6|e<<26)}function v(t,e){return t>>>0<e>>>0?1:0}i(h,n),h.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},h.prototype._update=function(t){for(var e=this._w,r=0|this._ah,i=0|this._bh,n=0|this._ch,o=0|this._dh,a=0|this._eh,h=0|this._fh,b=0|this._gh,y=0|this._hh,w=0|this._al,_=0|this._bl,M=0|this._cl,S=0|this._dl,k=0|this._el,E=0|this._fl,R=0|this._gl,A=0|this._hl,x=0;x<32;x+=2)e[x]=t.readInt32BE(4*x),e[x+1]=t.readInt32BE(4*x+4);for(;x<160;x+=2){var T=e[x-30],P=e[x-30+1],I=d(T,P),L=p(P,T),O=m(T=e[x-4],P=e[x-4+1]),B=g(P,T),j=e[x-14],C=e[x-14+1],U=e[x-32],N=e[x-32+1],q=L+C|0,D=I+j+v(q,L)|0;D=(D=D+O+v(q=q+B|0,B)|0)+U+v(q=q+N|0,N)|0,e[x]=D,e[x+1]=q}for(var z=0;z<160;z+=2){D=e[z],q=e[z+1];var F=f(r,i,n),W=f(w,_,M),H=c(r,w),K=c(w,r),Z=l(a,k),V=l(k,a),J=s[z],Y=s[z+1],G=u(a,h,b),X=u(k,E,R),Q=A+V|0,$=y+Z+v(Q,A)|0;$=($=($=$+G+v(Q=Q+X|0,X)|0)+J+v(Q=Q+Y|0,Y)|0)+D+v(Q=Q+q|0,q)|0;var tt=K+W|0,et=H+F+v(tt,K)|0;y=b,A=R,b=h,R=E,h=a,E=k,a=o+$+v(k=S+Q|0,S)|0,o=n,S=M,n=i,M=_,i=r,_=w,r=$+et+v(w=Q+tt|0,Q)|0}this._al=this._al+w|0,this._bl=this._bl+_|0,this._cl=this._cl+M|0,this._dl=this._dl+S|0,this._el=this._el+k|0,this._fl=this._fl+E|0,this._gl=this._gl+R|0,this._hl=this._hl+A|0,this._ah=this._ah+r+v(this._al,w)|0,this._bh=this._bh+i+v(this._bl,_)|0,this._ch=this._ch+n+v(this._cl,M)|0,this._dh=this._dh+o+v(this._dl,S)|0,this._eh=this._eh+a+v(this._el,k)|0,this._fh=this._fh+h+v(this._fl,E)|0,this._gh=this._gh+b+v(this._gl,R)|0,this._hh=this._hh+y+v(this._hl,A)|0},h.prototype._hash=function(){var t=o.allocUnsafe(64);function e(e,r,i){t.writeInt32BE(e,i),t.writeInt32BE(r,i+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),e(this._gh,this._gl,48),e(this._hh,this._hl,56),t},t.exports=h},function(t,e,r){"use strict";(function(e,i){var n=r(61);t.exports=y;var o,s=r(153);y.ReadableState=b;r(24).EventEmitter;var a=function(t,e){return t.listeners(e).length},h=r(154),u=r(2).Buffer,f=e.Uint8Array||function(){};var c=Object.create(r(44));c.inherits=r(1);var l=r(293),d=void 0;d=l&&l.debuglog?l.debuglog("stream"):function(){};var p,m=r(294),g=r(156);c.inherits(y,h);var v=["error","close","destroy","pause","resume"];function b(t,e){t=t||{};var i=e instanceof(o=o||r(27));this.objectMode=!!t.objectMode,i&&(this.objectMode=this.objectMode||!!t.readableObjectMode);var n=t.highWaterMark,s=t.readableHighWaterMark,a=this.objectMode?16:16384;this.highWaterMark=n||0===n?n:i&&(s||0===s)?s:a,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new m,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=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(p||(p=r(25).StringDecoder),this.decoder=new p(t.encoding),this.encoding=t.encoding)}function y(t){if(o=o||r(27),!(this instanceof y))return new y(t);this._readableState=new b(t,this),this.readable=!0,t&&("function"==typeof t.read&&(this._read=t.read),"function"==typeof t.destroy&&(this._destroy=t.destroy)),h.call(this)}function w(t,e,r,i,n){var o,s=t._readableState;null===e?(s.reading=!1,function a(t,e){if(e.ended)return;if(e.decoder){var r=e.decoder.end();r&&r.length&&(e.buffer.push(r),e.length+=e.objectMode?1:r.length)}e.ended=!0,k(t)}(t,s)):(n||(o=function h(t,e){var r;(function i(t){return u.isBuffer(t)||t instanceof f})(e)||"string"==typeof e||void 0===e||t.objectMode||(r=new TypeError("Invalid non-string/buffer chunk"));return r}(s,e)),o?t.emit("error",o):s.objectMode||e&&e.length>0?("string"==typeof e||s.objectMode||Object.getPrototypeOf(e)===u.prototype||(e=function c(t){return u.from(t)}(e)),i?s.endEmitted?t.emit("error",new Error("stream.unshift() after end event")):_(t,s,e,!0):s.ended?t.emit("error",new Error("stream.push() after EOF")):(s.reading=!1,s.decoder&&!r?(e=s.decoder.write(e),s.objectMode||0!==e.length?_(t,s,e,!1):R(t,s)):_(t,s,e,!1))):i||(s.reading=!1));return function l(t){return!t.ended&&(t.needReadable||t.length<t.highWaterMark||0===t.length)}(s)}function _(t,e,r,i){e.flowing&&0===e.length&&!e.sync?(t.emit("data",r),t.read(0)):(e.length+=e.objectMode?1:r.length,i?e.buffer.unshift(r):e.buffer.push(r),e.needReadable&&k(t)),R(t,e)}Object.defineProperty(y.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(t){this._readableState&&(this._readableState.destroyed=t)}}),y.prototype.destroy=g.destroy,y.prototype._undestroy=g.undestroy,y.prototype._destroy=function(t,e){this.push(null),e(t)},y.prototype.push=function(t,e){var r,i=this._readableState;return i.objectMode?r=!0:"string"==typeof t&&((e=e||i.defaultEncoding)!==i.encoding&&(t=u.from(t,e),e=""),r=!0),w(this,t,e,!1,r)},y.prototype.unshift=function(t){return w(this,t,null,!0,!1)},y.prototype.isPaused=function(){return!1===this._readableState.flowing},y.prototype.setEncoding=function(t){return p||(p=r(25).StringDecoder),this._readableState.decoder=new p(t),this._readableState.encoding=t,this};var M=8388608;function S(t,e){return t<=0||0===e.length&&e.ended?0:e.objectMode?1:t!=t?e.flowing&&e.length?e.buffer.head.data.length:e.length:(t>e.highWaterMark&&(e.highWaterMark=function r(t){return t>=M?t=M:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function k(t){var e=t._readableState;e.needReadable=!1,e.emittedReadable||(d("emitReadable",e.flowing),e.emittedReadable=!0,e.sync?n.nextTick(E,t):E(t))}function E(t){d("emit readable"),t.emit("readable"),P(t)}function R(t,e){e.readingMore||(e.readingMore=!0,n.nextTick(A,t,e))}function A(t,e){for(var r=e.length;!e.reading&&!e.flowing&&!e.ended&&e.length<e.highWaterMark&&(d("maybeReadMore read 0"),t.read(0),r!==e.length);)r=e.length;e.readingMore=!1}function x(t){d("readable nexttick read 0"),t.read(0)}function T(t,e){e.reading||(d("resume read 0"),t.read(0)),e.resumeScheduled=!1,e.awaitDrain=0,t.emit("resume"),P(t),e.flowing&&!e.reading&&t.read(0)}function P(t){var e=t._readableState;for(d("flow",e.flowing);e.flowing&&null!==t.read(););}function I(t,e){return 0===e.length?null:(e.objectMode?i=e.buffer.shift():!t||t>=e.length?(i=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.head.data:e.buffer.concat(e.length),e.buffer.clear()):i=function r(t,e,i){var n;t<e.head.data.length?(n=e.head.data.slice(0,t),e.head.data=e.head.data.slice(t)):n=t===e.head.data.length?e.shift():i?function o(t,e){var r=e.head,i=1,n=r.data;t-=n.length;for(;r=r.next;){var o=r.data,s=t>o.length?o.length:t;if(s===o.length?n+=o:n+=o.slice(0,t),0===(t-=s)){s===o.length?(++i,r.next?e.head=r.next:e.head=e.tail=null):(e.head=r,r.data=o.slice(s));break}++i}return e.length-=i,n}(t,e):function s(t,e){var r=u.allocUnsafe(t),i=e.head,n=1;i.data.copy(r),t-=i.data.length;for(;i=i.next;){var o=i.data,s=t>o.length?o.length:t;if(o.copy(r,r.length-t,0,s),0===(t-=s)){s===o.length?(++n,i.next?e.head=i.next:e.head=e.tail=null):(e.head=i,i.data=o.slice(s));break}++n}return e.length-=n,r}(t,e);return n}(t,e.buffer,e.decoder),i);var i}function L(t){var e=t._readableState;if(e.length>0)throw new Error('"endReadable()" called on non-empty stream');e.endEmitted||(e.ended=!0,n.nextTick(O,e,t))}function O(t,e){t.endEmitted||0!==t.length||(t.endEmitted=!0,e.readable=!1,e.emit("end"))}function B(t,e){for(var r=0,i=t.length;r<i;r++)if(t[r]===e)return r;return-1}y.prototype.read=function(t){d("read",t),t=parseInt(t,10);var e=this._readableState,r=t;if(0!==t&&(e.emittedReadable=!1),0===t&&e.needReadable&&(e.length>=e.highWaterMark||e.ended))return d("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?L(this):k(this),null;if(0===(t=S(t,e))&&e.ended)return 0===e.length&&L(this),null;var i,n=e.needReadable;return d("need readable",n),(0===e.length||e.length-t<e.highWaterMark)&&d("length less than watermark",n=!0),e.ended||e.reading?d("reading or ended",n=!1):n&&(d("do read"),e.reading=!0,e.sync=!0,0===e.length&&(e.needReadable=!0),this._read(e.highWaterMark),e.sync=!1,e.reading||(t=S(r,e))),null===(i=t>0?I(t,e):null)?(e.needReadable=!0,t=0):e.length-=t,0===e.length&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&L(this)),null!==i&&this.emit("data",i),i},y.prototype._read=function(t){this.emit("error",new Error("_read() is not implemented"))},y.prototype.pipe=function(t,e){var r=this,o=this._readableState;switch(o.pipesCount){case 0:o.pipes=t;break;case 1:o.pipes=[o.pipes,t];break;default:o.pipes.push(t)}o.pipesCount+=1,d("pipe count=%d opts=%j",o.pipesCount,e);var h=(!e||!1!==e.end)&&t!==i.stdout&&t!==i.stderr?f:w;function u(e,i){d("onunpipe"),e===r&&i&&!1===i.hasUnpiped&&(i.hasUnpiped=!0,function n(){d("cleanup"),t.removeListener("close",b),t.removeListener("finish",y),t.removeListener("drain",c),t.removeListener("error",v),t.removeListener("unpipe",u),r.removeListener("end",f),r.removeListener("end",w),r.removeListener("data",g),p=!0,!o.awaitDrain||t._writableState&&!t._writableState.needDrain||c()}())}function f(){d("onend"),t.end()}o.endEmitted?n.nextTick(h):r.once("end",h),t.on("unpipe",u);var c=function l(t){return function(){var e=t._readableState;d("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&a(t,"data")&&(e.flowing=!0,P(t))}}(r);t.on("drain",c);var p=!1;var m=!1;function g(e){d("ondata"),m=!1,!1!==t.write(e)||m||((1===o.pipesCount&&o.pipes===t||o.pipesCount>1&&-1!==B(o.pipes,t))&&!p&&(d("false write response, pause",r._readableState.awaitDrain),r._readableState.awaitDrain++,m=!0),r.pause())}function v(e){d("onerror",e),w(),t.removeListener("error",v),0===a(t,"error")&&t.emit("error",e)}function b(){t.removeListener("finish",y),w()}function y(){d("onfinish"),t.removeListener("close",b),w()}function w(){d("unpipe"),r.unpipe(t)}return r.on("data",g),function _(t,e,r){if("function"==typeof t.prependListener)return t.prependListener(e,r);t._events&&t._events[e]?s(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]]:t.on(e,r)}(t,"error",v),t.once("close",b),t.once("finish",y),t.emit("pipe",r),o.flowing||(d("pipe resume"),r.resume()),t},y.prototype.unpipe=function(t){var e=this._readableState,r={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes||(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,r)),this;if(!t){var i=e.pipes,n=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var o=0;o<n;o++)i[o].emit("unpipe",this,r);return this}var s=B(e.pipes,t);return-1===s||(e.pipes.splice(s,1),e.pipesCount-=1,1===e.pipesCount&&(e.pipes=e.pipes[0]),t.emit("unpipe",this,r)),this},y.prototype.on=function(t,e){var r=h.prototype.on.call(this,t,e);if("data"===t)!1!==this._readableState.flowing&&this.resume();else if("readable"===t){var i=this._readableState;i.endEmitted||i.readableListening||(i.readableListening=i.needReadable=!0,i.emittedReadable=!1,i.reading?i.length&&k(this):n.nextTick(x,this))}return r},y.prototype.addListener=y.prototype.on,y.prototype.resume=function(){var t=this._readableState;return t.flowing||(d("resume"),t.flowing=!0,function e(t,r){r.resumeScheduled||(r.resumeScheduled=!0,n.nextTick(T,t,r))}(this,t)),this},y.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},y.prototype.wrap=function(t){var e=this,r=this._readableState,i=!1;for(var n in t.on("end",(function(){if(d("wrapped end"),r.decoder&&!r.ended){var t=r.decoder.end();t&&t.length&&e.push(t)}e.push(null)})),t.on("data",(function(n){(d("wrapped data"),r.decoder&&(n=r.decoder.write(n)),r.objectMode&&null==n)||(r.objectMode||n&&n.length)&&(e.push(n)||(i=!0,t.pause()))})),t)void 0===this[n]&&"function"==typeof t[n]&&(this[n]=function(e){return function(){return t[e].apply(t,arguments)}}(n));for(var o=0;o<v.length;o++)t.on(v[o],this.emit.bind(this,v[o]));return this._read=function(e){d("wrapped _read",e),i&&(i=!1,t.resume())},this},Object.defineProperty(y.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),y._fromList=I}).call(this,r(5),r(4))},function(t,e){var r={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==r.call(t)}},function(t,e,r){t.exports=r(24).EventEmitter},function(t,e,r){"use strict";e.byteLength=function i(t){var e=l(t),r=e[0],i=e[1];return 3*(r+i)/4-i},e.toByteArray=function n(t){var e,r,i=l(t),n=i[0],o=i[1],s=new h(function u(t,e,r){return 3*(e+r)/4-r}(0,n,o)),f=0,c=o>0?n-4:n;for(r=0;r<c;r+=4)e=a[t.charCodeAt(r)]<<18|a[t.charCodeAt(r+1)]<<12|a[t.charCodeAt(r+2)]<<6|a[t.charCodeAt(r+3)],s[f++]=e>>16&255,s[f++]=e>>8&255,s[f++]=255&e;2===o&&(e=a[t.charCodeAt(r)]<<2|a[t.charCodeAt(r+1)]>>4,s[f++]=255&e);1===o&&(e=a[t.charCodeAt(r)]<<10|a[t.charCodeAt(r+1)]<<4|a[t.charCodeAt(r+2)]>>2,s[f++]=e>>8&255,s[f++]=255&e);return s},e.fromByteArray=function o(t){for(var e,r=t.length,i=r%3,n=[],o=16383,a=0,h=r-i;a<h;a+=o)n.push(d(t,a,a+o>h?h:a+o));1===i?(e=t[r-1],n.push(s[e>>2]+s[e<<4&63]+"==")):2===i&&(e=(t[r-2]<<8)+t[r-1],n.push(s[e>>10]+s[e>>4&63]+s[e<<2&63]+"="));return n.join("")};for(var s=[],a=[],h="undefined"!=typeof Uint8Array?Uint8Array:Array,u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",f=0,c=u.length;f<c;++f)s[f]=u[f],a[u.charCodeAt(f)]=f;function l(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function d(t,e,r){for(var i,n,o=[],a=e;a<r;a+=3)i=(t[a]<<16&16711680)+(t[a+1]<<8&65280)+(255&t[a+2]),o.push(s[(n=i)>>18&63]+s[n>>12&63]+s[n>>6&63]+s[63&n]);return o.join("")}a["-".charCodeAt(0)]=62,a["_".charCodeAt(0)]=63},function(t,e,r){"use strict";var i=r(61);function n(t,e){t.emit("error",e)}t.exports={destroy:function o(t,e){var r=this,o=this._readableState&&this._readableState.destroyed,s=this._writableState&&this._writableState.destroyed;return o||s?(e?e(t):!t||this._writableState&&this._writableState.errorEmitted||i.nextTick(n,this,t),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,(function(t){!e&&t?(i.nextTick(n,r,t),r._writableState&&(r._writableState.errorEmitted=!0)):e&&e(t)})),this)},undestroy:function s(){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(t,e,r){"use strict";t.exports=s;var i=r(27),n=Object.create(r(44));function o(t,e){var r=this._transformState;r.transforming=!1;var i=r.writecb;if(!i)return this.emit("error",new Error("write callback called multiple times"));r.writechunk=null,r.writecb=null,null!=e&&this.push(e),i(t);var n=this._readableState;n.reading=!1,(n.needReadable||n.length<n.highWaterMark)&&this._read(n.highWaterMark)}function s(t){if(!(this instanceof s))return new s(t);i.call(this,t),this._transformState={afterTransform:o.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,t&&("function"==typeof t.transform&&(this._transform=t.transform),"function"==typeof t.flush&&(this._flush=t.flush)),this.on("prefinish",a)}function a(){var t=this;"function"==typeof this._flush?this._flush((function(e,r){h(t,e,r)})):h(this,null,null)}function h(t,e,r){if(e)return t.emit("error",e);if(null!=r&&t.push(r),t._writableState.length)throw new Error("Calling transform done when ws.length != 0");if(t._transformState.transforming)throw new Error("Calling transform done when still transforming");return t.push(null)}n.inherits=r(1),n.inherits(s,i),s.prototype.push=function(t,e){return this._transformState.needTransform=!1,i.prototype.push.call(this,t,e)},s.prototype._transform=function(t,e,r){throw new Error("_transform() is not implemented")},s.prototype._write=function(t,e,r){var i=this._transformState;if(i.writecb=r,i.writechunk=t,i.writeencoding=e,!i.transforming){var n=this._readableState;(i.needTransform||n.needReadable||n.length<n.highWaterMark)&&this._read(n.highWaterMark)}},s.prototype._read=function(t){var e=this._transformState;null!==e.writechunk&&e.writecb&&!e.transforming?(e.transforming=!0,this._transform(e.writechunk,e.writeencoding,e.afterTransform)):e.needTransform=!0},s.prototype._destroy=function(t,e){var r=this;i.prototype._destroy.call(this,t,(function(t){e(t),r.emit("close")}))}},function(t,e,r){"use strict";var i=r(1),n=r(303),o=r(20),s=r(2).Buffer,a=r(159),h=r(91),u=r(92),f=s.alloc(128);function c(t,e){o.call(this,"digest"),"string"==typeof e&&(e=s.from(e));var r="sha512"===t||"sha384"===t?128:64;(this._alg=t,this._key=e,e.length>r)?e=("rmd160"===t?new h:u(t)).update(e).digest():e.length<r&&(e=s.concat([e,f],r));for(var i=this._ipad=s.allocUnsafe(r),n=this._opad=s.allocUnsafe(r),a=0;a<r;a++)i[a]=54^e[a],n[a]=92^e[a];this._hash="rmd160"===t?new h:u(t),this._hash.update(i)}i(c,o),c.prototype._update=function(t){this._hash.update(t)},c.prototype._final=function(){var t=this._hash.digest();return("rmd160"===this._alg?new h:u(this._alg)).update(this._opad).update(t).digest()},t.exports=function t(e,r){return"rmd160"===(e=e.toLowerCase())||"ripemd160"===e?new c("rmd160",r):"md5"===e?new n(a,r):new c(e,r)}},function(t,e,r){var i=r(88);t.exports=function(t){return(new i).update(t).digest()}},function(t){t.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(t,e,r){e.pbkdf2=r(305),e.pbkdf2Sync=r(164)},function(t,e){var r=Math.pow(2,30)-1;t.exports=function(t,e){if("number"!=typeof t)throw new TypeError("Iterations not a number");if(t<0)throw new TypeError("Bad iterations");if("number"!=typeof e)throw new TypeError("Key length not a number");if(e<0||e>r||e!=e)throw new TypeError("Bad key length")}},function(t,e,r){(function(e){var r;if(e.browser)r="utf-8";else if(e.version){r=parseInt(e.version.split(".")[0].slice(1),10)>=6?"utf-8":"binary"}else r="utf-8";t.exports=r}).call(this,r(4))},function(t,e,r){var i=r(159),n=r(91),o=r(92),s=r(2).Buffer,a=r(162),h=r(163),u=r(165),f=s.alloc(128),c={md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,rmd160:20,ripemd160:20};function l(t,e,r){var a=function h(t){function e(e){return o(t).update(e).digest()}function r(t){return(new n).update(t).digest()}return"rmd160"===t||"ripemd160"===t?r:"md5"===t?i:e}(t),u="sha512"===t||"sha384"===t?128:64;e.length>u?e=a(e):e.length<u&&(e=s.concat([e,f],u));for(var l=s.allocUnsafe(u+c[t]),d=s.allocUnsafe(u+c[t]),p=0;p<u;p++)l[p]=54^e[p],d[p]=92^e[p];var m=s.allocUnsafe(u+r+4);l.copy(m,0,0,u),this.ipad1=m,this.ipad2=l,this.opad=d,this.alg=t,this.blocksize=u,this.hash=a,this.size=c[t]}l.prototype.run=function(t,e){return t.copy(e,this.blocksize),this.hash(e).copy(this.opad,this.blocksize),this.hash(this.opad)},t.exports=function d(t,e,r,i,n){a(r,i);var o=new l(n=n||"sha1",t=u(t,h,"Password"),(e=u(e,h,"Salt")).length),f=s.allocUnsafe(i),d=s.allocUnsafe(e.length+4);e.copy(d,0,0,e.length);for(var p=0,m=c[n],g=Math.ceil(i/m),v=1;v<=g;v++){d.writeUInt32BE(v,e.length);for(var b=o.run(d,o.ipad1),y=b,w=1;w<r;w++){y=o.run(y,o.ipad2);for(var _=0;_<m;_++)b[_]^=y[_]}b.copy(f,p),p+=m}return f}},function(t,e,r){var i=r(2).Buffer;t.exports=function(t,e,r){if(i.isBuffer(t))return t;if("string"==typeof t)return i.from(t,e);if(ArrayBuffer.isView(t))return i.from(t.buffer);throw new TypeError(r+" must be a string, a Buffer, a typed array or a DataView")}},function(t,e,r){"use strict";e.readUInt32BE=function t(e,r){return(e[0+r]<<24|e[1+r]<<16|e[2+r]<<8|e[3+r])>>>0},e.writeUInt32BE=function t(e,r,i){e[0+i]=r>>>24,e[1+i]=r>>>16&255,e[2+i]=r>>>8&255,e[3+i]=255&r},e.ip=function t(e,r,i,n){for(var o=0,s=0,a=6;a>=0;a-=2){for(var h=0;h<=24;h+=8)o<<=1,o|=r>>>h+a&1;for(h=0;h<=24;h+=8)o<<=1,o|=e>>>h+a&1}for(a=6;a>=0;a-=2){for(h=1;h<=25;h+=8)s<<=1,s|=r>>>h+a&1;for(h=1;h<=25;h+=8)s<<=1,s|=e>>>h+a&1}i[n+0]=o>>>0,i[n+1]=s>>>0},e.rip=function t(e,r,i,n){for(var o=0,s=0,a=0;a<4;a++)for(var h=24;h>=0;h-=8)o<<=1,o|=r>>>h+a&1,o<<=1,o|=e>>>h+a&1;for(a=4;a<8;a++)for(h=24;h>=0;h-=8)s<<=1,s|=r>>>h+a&1,s<<=1,s|=e>>>h+a&1;i[n+0]=o>>>0,i[n+1]=s>>>0},e.pc1=function t(e,r,i,n){for(var o=0,s=0,a=7;a>=5;a--){for(var h=0;h<=24;h+=8)o<<=1,o|=r>>h+a&1;for(h=0;h<=24;h+=8)o<<=1,o|=e>>h+a&1}for(h=0;h<=24;h+=8)o<<=1,o|=r>>h+a&1;for(a=1;a<=3;a++){for(h=0;h<=24;h+=8)s<<=1,s|=r>>h+a&1;for(h=0;h<=24;h+=8)s<<=1,s|=e>>h+a&1}for(h=0;h<=24;h+=8)s<<=1,s|=e>>h+a&1;i[n+0]=o>>>0,i[n+1]=s>>>0},e.r28shl=function t(e,r){return e<<r&268435455|e>>>28-r};var i=[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];e.pc2=function t(e,r,n,o){for(var s=0,a=0,h=i.length>>>1,u=0;u<h;u++)s<<=1,s|=e>>>i[u]&1;for(u=h;u<i.length;u++)a<<=1,a|=r>>>i[u]&1;n[o+0]=s>>>0,n[o+1]=a>>>0},e.expand=function t(e,r,i){var n=0,o=0;n=(1&e)<<5|e>>>27;for(var s=23;s>=15;s-=4)n<<=6,n|=e>>>s&63;for(s=11;s>=3;s-=4)o|=e>>>s&63,o<<=6;o|=(31&e)<<1|e>>>31,r[i+0]=n>>>0,r[i+1]=o>>>0};var n=[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];e.substitute=function t(e,r){for(var i=0,o=0;o<4;o++){i<<=4,i|=n[64*o+(e>>>18-6*o&63)]}for(o=0;o<4;o++){i<<=4,i|=n[256+64*o+(r>>>18-6*o&63)]}return i>>>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];e.permute=function t(e){for(var r=0,i=0;i<o.length;i++)r<<=1,r|=e>>>o[i]&1;return r>>>0},e.padSplit=function t(e,r,i){for(var n=e.toString(2);n.length<r;)n="0"+n;for(var o=[],s=0;s<r;s+=i)o.push(n.slice(s,s+i));return o.join(" ")}},function(t,e,r){"use strict";var i=r(10),n=r(1),o=r(166),s=r(95);function a(){this.tmp=new Array(2),this.keys=null}function h(t){s.call(this,t);var e=new a;this._desState=e,this.deriveKeys(e,t.key)}n(h,s),t.exports=h,h.create=function t(e){return new h(e)};var u=[1,1,2,2,2,2,2,2,1,2,2,2,2,2,2,1];h.prototype.deriveKeys=function t(e,r){e.keys=new Array(32),i.equal(r.length,this.blockSize,"Invalid key length");var n=o.readUInt32BE(r,0),s=o.readUInt32BE(r,4);o.pc1(n,s,e.tmp,0),n=e.tmp[0],s=e.tmp[1];for(var a=0;a<e.keys.length;a+=2){var h=u[a>>>1];n=o.r28shl(n,h),s=o.r28shl(s,h),o.pc2(n,s,e.keys,a)}},h.prototype._update=function t(e,r,i,n){var s=this._desState,a=o.readUInt32BE(e,r),h=o.readUInt32BE(e,r+4);o.ip(a,h,s.tmp,0),a=s.tmp[0],h=s.tmp[1],"encrypt"===this.type?this._encrypt(s,a,h,s.tmp,0):this._decrypt(s,a,h,s.tmp,0),a=s.tmp[0],h=s.tmp[1],o.writeUInt32BE(i,a,n),o.writeUInt32BE(i,h,n+4)},h.prototype._pad=function t(e,r){for(var i=e.length-r,n=r;n<e.length;n++)e[n]=i;return!0},h.prototype._unpad=function t(e){for(var r=e[e.length-1],n=e.length-r;n<e.length;n++)i.equal(e[n],r);return e.slice(0,e.length-r)},h.prototype._encrypt=function t(e,r,i,n,s){for(var a=r,h=i,u=0;u<e.keys.length;u+=2){var f=e.keys[u],c=e.keys[u+1];o.expand(h,e.tmp,0),f^=e.tmp[0],c^=e.tmp[1];var l=o.substitute(f,c),d=h;h=(a^o.permute(l))>>>0,a=d}o.rip(h,a,n,s)},h.prototype._decrypt=function t(e,r,i,n,s){for(var a=i,h=r,u=e.keys.length-2;u>=0;u-=2){var f=e.keys[u],c=e.keys[u+1];o.expand(a,e.tmp,0),f^=e.tmp[0],c^=e.tmp[1];var l=o.substitute(f,c),d=a;a=(h^o.permute(l))>>>0,h=d}o.rip(a,h,n,s)}},function(t,e,r){var i=r(45),n=r(2).Buffer,o=r(169);function s(t){var e=t._cipher.encryptBlockRaw(t._prev);return o(t._prev),e}e.encrypt=function(t,e){var r=Math.ceil(e.length/16),o=t._cache.length;t._cache=n.concat([t._cache,n.allocUnsafe(16*r)]);for(var a=0;a<r;a++){var h=s(t),u=o+16*a;t._cache.writeUInt32BE(h[0],u+0),t._cache.writeUInt32BE(h[1],u+4),t._cache.writeUInt32BE(h[2],u+8),t._cache.writeUInt32BE(h[3],u+12)}var f=t._cache.slice(0,e.length);return t._cache=t._cache.slice(e.length),i(e,f)}},function(t,e){t.exports=function r(t){for(var e,r=t.length;r--;){if(255!==(e=t.readUInt8(r))){e++,t.writeUInt8(e,r);break}t.writeUInt8(0,r)}}},function(t){t.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(t,e,r){var i=r(62),n=r(2).Buffer,o=r(20),s=r(1),a=r(319),h=r(45),u=r(169);function f(t,e,r,s){o.call(this);var h=n.alloc(4,0);this._cipher=new i.AES(e);var f=this._cipher.encryptBlock(h);this._ghash=new a(f),r=function c(t,e,r){if(12===e.length)return t._finID=n.concat([e,n.from([0,0,0,1])]),n.concat([e,n.from([0,0,0,2])]);var i=new a(r),o=e.length,s=o%16;i.update(e),s&&(s=16-s,i.update(n.alloc(s,0))),i.update(n.alloc(8,0));var h=8*o,f=n.alloc(8);f.writeUIntBE(h,0,8),i.update(f),t._finID=i.state;var c=n.from(t._finID);return u(c),c}(this,r,f),this._prev=n.from(r),this._cache=n.allocUnsafe(0),this._secCache=n.allocUnsafe(0),this._decrypt=s,this._alen=0,this._len=0,this._mode=t,this._authTag=null,this._called=!1}s(f,o),f.prototype._update=function(t){if(!this._called&&this._alen){var e=16-this._alen%16;e<16&&(e=n.alloc(e,0),this._ghash.update(e))}this._called=!0;var r=this._mode.encrypt(this,t);return this._decrypt?this._ghash.update(t):this._ghash.update(r),this._len+=t.length,r},f.prototype._final=function(){if(this._decrypt&&!this._authTag)throw new Error("Unsupported state or unable to authenticate data");var t=h(this._ghash.final(8*this._alen,8*this._len),this._cipher.encryptBlock(this._finID));if(this._decrypt&&function e(t,r){var i=0;t.length!==r.length&&i++;for(var n=Math.min(t.length,r.length),o=0;o<n;++o)i+=t[o]^r[o];return i}(t,this._authTag))throw new Error("Unsupported state or unable to authenticate data");this._authTag=t,this._cipher.scrub()},f.prototype.getAuthTag=function t(){if(this._decrypt||!n.isBuffer(this._authTag))throw new Error("Attempting to get auth tag in unsupported state");return this._authTag},f.prototype.setAuthTag=function t(e){if(!this._decrypt)throw new Error("Attempting to set auth tag in unsupported state");this._authTag=e},f.prototype.setAAD=function t(e){if(this._called)throw new Error("Attempting to set AAD in unsupported state");this._ghash.update(e),this._alen+=e.length},t.exports=f},function(t,e,r){var i=r(62),n=r(2).Buffer,o=r(20);function s(t,e,r,s){o.call(this),this._cipher=new i.AES(e),this._prev=n.from(r),this._cache=n.allocUnsafe(0),this._secCache=n.allocUnsafe(0),this._decrypt=s,this._mode=t}r(1)(s,o),s.prototype._update=function(t){return this._mode.encrypt(this,t,this._decrypt)},s.prototype._final=function(){this._cipher.scrub()},t.exports=s},function(t,e,r){var i=r(31);t.exports=b,b.simpleSieve=g,b.fermatTest=v;var n=r(174),o=new n(24),s=new(r(175)),a=new n(1),h=new n(2),u=new n(5),f=(new n(16),new n(8),new n(10)),c=new n(3),l=(new n(7),new n(11)),d=new n(4),p=(new n(12),null);function m(){if(null!==p)return p;var t=[];t[0]=2;for(var e=1,r=3;r<1048576;r+=2){for(var i=Math.ceil(Math.sqrt(r)),n=0;n<e&&t[n]<=i&&r%t[n]!=0;n++);e!==n&&t[n]<=i||(t[e++]=r)}return p=t,t}function g(t){for(var e=m(),r=0;r<e.length;r++)if(0===t.modn(e[r]))return 0===t.cmpn(e[r]);return!0}function v(t){var e=n.mont(t);return 0===h.toRed(e).redPow(t.subn(1)).fromRed().cmpn(1)}function b(t,e){if(t<16)return new n(2===e||5===e?[140,123]:[140,39]);var r,p;for(e=new n(e);;){for(r=new n(i(Math.ceil(t/8)));r.bitLength()>t;)r.ishrn(1);if(r.isEven()&&r.iadd(a),r.testn(1)||r.iadd(h),e.cmp(h)){if(!e.cmp(u))for(;r.mod(f).cmp(c);)r.iadd(d)}else for(;r.mod(o).cmp(l);)r.iadd(d);if(g(p=r.shrn(1))&&g(r)&&v(p)&&v(r)&&s.test(p)&&s.test(r))return r}}},function(t,e,r){(function(t){!function(t,e){"use strict";function i(t,e){if(!t)throw new Error(e||"Assertion failed")}function n(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function o(t,e,r){if(o.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var s;"object"==typeof t?t.exports=o:e.BN=o,o.BN=o,o.wordSize=26;try{s=r(323).Buffer}catch(t){}function a(t,e,r){for(var i=0,n=Math.min(t.length,r),o=e;o<n;o++){var s=t.charCodeAt(o)-48;i<<=4,i|=s>=49&&s<=54?s-49+10:s>=17&&s<=22?s-17+10:15&s}return i}function h(t,e,r,i){for(var n=0,o=Math.min(t.length,r),s=e;s<o;s++){var a=t.charCodeAt(s)-48;n*=i,n+=a>=49?a-49+10:a>=17?a-17+10:a}return n}o.isBN=function t(e){return e instanceof o||null!==e&&"object"==typeof e&&e.constructor.wordSize===o.wordSize&&Array.isArray(e.words)},o.max=function t(e,r){return e.cmp(r)>0?e:r},o.min=function t(e,r){return e.cmp(r)<0?e:r},o.prototype._init=function t(e,r,n){if("number"==typeof e)return this._initNumber(e,r,n);if("object"==typeof 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)},o.prototype._initNumber=function t(e,r,n){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"===n&&this._initArray(this.toArray(),r,n)},o.prototype._initArray=function t(e,r,n){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 o=0;o<this.length;o++)this.words[o]=0;var s,a,h=0;if("be"===n)for(o=e.length-1,s=0;o>=0;o-=3)a=e[o]|e[o-1]<<8|e[o-2]<<16,this.words[s]|=a<<h&67108863,this.words[s+1]=a>>>26-h&67108863,(h+=24)>=26&&(h-=26,s++);else if("le"===n)for(o=0,s=0;o<e.length;o+=3)a=e[o]|e[o+1]<<8|e[o+2]<<16,this.words[s]|=a<<h&67108863,this.words[s+1]=a>>>26-h&67108863,(h+=24)>=26&&(h-=26,s++);return this.strip()},o.prototype._parseHex=function t(e,r){this.length=Math.ceil((e.length-r)/6),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var n,o,s=0;for(i=e.length-6,n=0;i>=r;i-=6)o=a(e,i,i+6),this.words[n]|=o<<s&67108863,this.words[n+1]|=o>>>26-s&4194303,(s+=24)>=26&&(s-=26,n++);i+6!==r&&(o=a(e,r,i+6),this.words[n]|=o<<s&67108863,this.words[n+1]|=o>>>26-s&4194303),this.strip()},o.prototype._parseBase=function t(e,r,i){this.words=[0],this.length=1;for(var n=0,o=1;o<=67108863;o*=r)n++;n--,o=o/r|0;for(var s=e.length-i,a=s%n,u=Math.min(s,s-a)+i,f=0,c=i;c<u;c+=n)f=h(e,c,c+n,r),this.imuln(o),this.words[0]+f<67108864?this.words[0]+=f:this._iaddn(f);if(0!==a){var l=1;for(f=h(e,c,e.length,r),c=0;c<a;c++)l*=r;this.imuln(l),this.words[0]+f<67108864?this.words[0]+=f:this._iaddn(f)}},o.prototype.copy=function t(e){e.words=new Array(this.length);for(var r=0;r<this.length;r++)e.words[r]=this.words[r];e.length=this.length,e.negative=this.negative,e.red=this.red},o.prototype.clone=function t(){var e=new o(null);return this.copy(e),e},o.prototype._expand=function t(e){for(;this.length<e;)this.words[this.length++]=0;return this},o.prototype.strip=function t(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function t(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function t(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var u=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],f=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],c=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function l(t,e,r){r.negative=e.negative^t.negative;var i=t.length+e.length|0;r.length=i,i=i-1|0;var n=0|t.words[0],o=0|e.words[0],s=n*o,a=67108863&s,h=s/67108864|0;r.words[0]=a;for(var u=1;u<i;u++){for(var f=h>>>26,c=67108863&h,l=Math.min(u,e.length-1),d=Math.max(0,u-t.length+1);d<=l;d++){var p=u-d|0;f+=(s=(n=0|t.words[p])*(o=0|e.words[d])+c)/67108864|0,c=67108863&s}r.words[u]=0|c,h=0|f}return 0!==h?r.words[u]=0|h:r.length--,r.strip()}o.prototype.toString=function t(e,r){var n;if(r=0|r||1,16===(e=e||10)||"hex"===e){n="";for(var o=0,s=0,a=0;a<this.length;a++){var h=this.words[a],l=(16777215&(h<<o|s)).toString(16);n=0!==(s=h>>>24-o&16777215)||a!==this.length-1?u[6-l.length]+l+n:l+n,(o+=2)>=26&&(o-=26,a--)}for(0!==s&&(n=s.toString(16)+n);n.length%r!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}if(e===(0|e)&&e>=2&&e<=36){var d=f[e],p=c[e];n="";var m=this.clone();for(m.negative=0;!m.isZero();){var g=m.modn(p).toString(e);n=(m=m.idivn(p)).isZero()?g+n:u[d-g.length]+g+n}for(this.isZero()&&(n="0"+n);n.length%r!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}i(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function t(){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},o.prototype.toJSON=function t(){return this.toString(16)},o.prototype.toBuffer=function t(e,r){return i(void 0!==s),this.toArrayLike(s,e,r)},o.prototype.toArray=function t(e,r){return this.toArrayLike(Array,e,r)},o.prototype.toArrayLike=function t(e,r,n){var o=this.byteLength(),s=n||Math.max(1,o);i(o<=s,"byte array longer than desired length"),i(s>0,"Requested array length <= 0"),this.strip();var a,h,u="le"===r,f=new e(s),c=this.clone();if(u){for(h=0;!c.isZero();h++)a=c.andln(255),c.iushrn(8),f[h]=a;for(;h<s;h++)f[h]=0}else{for(h=0;h<s-o;h++)f[h]=0;for(h=0;!c.isZero();h++)a=c.andln(255),c.iushrn(8),f[s-h-1]=a}return f},Math.clz32?o.prototype._countBits=function t(e){return 32-Math.clz32(e)}:o.prototype._countBits=function t(e){var r=e,i=0;return r>=4096&&(i+=13,r>>>=13),r>=64&&(i+=7,r>>>=7),r>=8&&(i+=4,r>>>=4),r>=2&&(i+=2,r>>>=2),i+r},o.prototype._zeroBits=function t(e){if(0===e)return 26;var r=e,i=0;return 0==(8191&r)&&(i+=13,r>>>=13),0==(127&r)&&(i+=7,r>>>=7),0==(15&r)&&(i+=4,r>>>=4),0==(3&r)&&(i+=2,r>>>=2),0==(1&r)&&i++,i},o.prototype.bitLength=function t(){var e=this.words[this.length-1],r=this._countBits(e);return 26*(this.length-1)+r},o.prototype.zeroBits=function t(){if(this.isZero())return 0;for(var e=0,r=0;r<this.length;r++){var i=this._zeroBits(this.words[r]);if(e+=i,26!==i)break}return e},o.prototype.byteLength=function t(){return Math.ceil(this.bitLength()/8)},o.prototype.toTwos=function t(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},o.prototype.fromTwos=function t(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},o.prototype.isNeg=function t(){return 0!==this.negative},o.prototype.neg=function t(){return this.clone().ineg()},o.prototype.ineg=function t(){return this.isZero()||(this.negative^=1),this},o.prototype.iuor=function t(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var r=0;r<e.length;r++)this.words[r]=this.words[r]|e.words[r];return this.strip()},o.prototype.ior=function t(e){return i(0==(this.negative|e.negative)),this.iuor(e)},o.prototype.or=function t(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},o.prototype.uor=function t(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},o.prototype.iuand=function t(e){var r;r=this.length>e.length?e:this;for(var i=0;i<r.length;i++)this.words[i]=this.words[i]&e.words[i];return this.length=r.length,this.strip()},o.prototype.iand=function t(e){return i(0==(this.negative|e.negative)),this.iuand(e)},o.prototype.and=function t(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},o.prototype.uand=function t(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},o.prototype.iuxor=function t(e){var r,i;this.length>e.length?(r=this,i=e):(r=e,i=this);for(var n=0;n<i.length;n++)this.words[n]=r.words[n]^i.words[n];if(this!==r)for(;n<r.length;n++)this.words[n]=r.words[n];return this.length=r.length,this.strip()},o.prototype.ixor=function t(e){return i(0==(this.negative|e.negative)),this.iuxor(e)},o.prototype.xor=function t(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},o.prototype.uxor=function t(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},o.prototype.inotn=function t(e){i("number"==typeof e&&e>=0);var r=0|Math.ceil(e/26),n=e%26;this._expand(r),n>0&&r--;for(var o=0;o<r;o++)this.words[o]=67108863&~this.words[o];return n>0&&(this.words[o]=~this.words[o]&67108863>>26-n),this.strip()},o.prototype.notn=function t(e){return this.clone().inotn(e)},o.prototype.setn=function t(e,r){i("number"==typeof e&&e>=0);var n=e/26|0,o=e%26;return this._expand(n+1),this.words[n]=r?this.words[n]|1<<o:this.words[n]&~(1<<o),this.strip()},o.prototype.iadd=function t(e){var r,i,n;if(0!==this.negative&&0===e.negative)return this.negative=0,r=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,r=this.isub(e),e.negative=1,r._normSign();this.length>e.length?(i=this,n=e):(i=e,n=this);for(var o=0,s=0;s<n.length;s++)r=(0|i.words[s])+(0|n.words[s])+o,this.words[s]=67108863&r,o=r>>>26;for(;0!==o&&s<i.length;s++)r=(0|i.words[s])+o,this.words[s]=67108863&r,o=r>>>26;if(this.length=i.length,0!==o)this.words[this.length]=o,this.length++;else if(i!==this)for(;s<i.length;s++)this.words[s]=i.words[s];return this},o.prototype.add=function t(e){var r;return 0!==e.negative&&0===this.negative?(e.negative=0,r=this.sub(e),e.negative^=1,r):0===e.negative&&0!==this.negative?(this.negative=0,r=e.sub(this),this.negative=1,r):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},o.prototype.isub=function t(e){if(0!==e.negative){e.negative=0;var r=this.iadd(e);return e.negative=1,r._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var i,n,o=this.cmp(e);if(0===o)return this.negative=0,this.length=1,this.words[0]=0,this;o>0?(i=this,n=e):(i=e,n=this);for(var s=0,a=0;a<n.length;a++)s=(r=(0|i.words[a])-(0|n.words[a])+s)>>26,this.words[a]=67108863&r;for(;0!==s&&a<i.length;a++)s=(r=(0|i.words[a])+s)>>26,this.words[a]=67108863&r;if(0===s&&a<i.length&&i!==this)for(;a<i.length;a++)this.words[a]=i.words[a];return this.length=Math.max(this.length,a),i!==this&&(this.negative=1),this.strip()},o.prototype.sub=function t(e){return this.clone().isub(e)};var d=function t(e,r,i){var n,o,s,a=e.words,h=r.words,u=i.words,f=0,c=0|a[0],l=8191&c,d=c>>>13,p=0|a[1],m=8191&p,g=p>>>13,v=0|a[2],b=8191&v,y=v>>>13,w=0|a[3],_=8191&w,M=w>>>13,S=0|a[4],k=8191&S,E=S>>>13,R=0|a[5],A=8191&R,x=R>>>13,T=0|a[6],P=8191&T,I=T>>>13,L=0|a[7],O=8191&L,B=L>>>13,j=0|a[8],C=8191&j,U=j>>>13,N=0|a[9],q=8191&N,D=N>>>13,z=0|h[0],F=8191&z,W=z>>>13,H=0|h[1],K=8191&H,Z=H>>>13,V=0|h[2],J=8191&V,Y=V>>>13,G=0|h[3],X=8191&G,Q=G>>>13,$=0|h[4],tt=8191&$,et=$>>>13,rt=0|h[5],it=8191&rt,nt=rt>>>13,ot=0|h[6],st=8191&ot,at=ot>>>13,ht=0|h[7],ut=8191&ht,ft=ht>>>13,ct=0|h[8],lt=8191&ct,dt=ct>>>13,pt=0|h[9],mt=8191&pt,gt=pt>>>13;i.negative=e.negative^r.negative,i.length=19;var vt=(f+(n=Math.imul(l,F))|0)+((8191&(o=(o=Math.imul(l,W))+Math.imul(d,F)|0))<<13)|0;f=((s=Math.imul(d,W))+(o>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(m,F),o=(o=Math.imul(m,W))+Math.imul(g,F)|0,s=Math.imul(g,W);var bt=(f+(n=n+Math.imul(l,K)|0)|0)+((8191&(o=(o=o+Math.imul(l,Z)|0)+Math.imul(d,K)|0))<<13)|0;f=((s=s+Math.imul(d,Z)|0)+(o>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(b,F),o=(o=Math.imul(b,W))+Math.imul(y,F)|0,s=Math.imul(y,W),n=n+Math.imul(m,K)|0,o=(o=o+Math.imul(m,Z)|0)+Math.imul(g,K)|0,s=s+Math.imul(g,Z)|0;var yt=(f+(n=n+Math.imul(l,J)|0)|0)+((8191&(o=(o=o+Math.imul(l,Y)|0)+Math.imul(d,J)|0))<<13)|0;f=((s=s+Math.imul(d,Y)|0)+(o>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(_,F),o=(o=Math.imul(_,W))+Math.imul(M,F)|0,s=Math.imul(M,W),n=n+Math.imul(b,K)|0,o=(o=o+Math.imul(b,Z)|0)+Math.imul(y,K)|0,s=s+Math.imul(y,Z)|0,n=n+Math.imul(m,J)|0,o=(o=o+Math.imul(m,Y)|0)+Math.imul(g,J)|0,s=s+Math.imul(g,Y)|0;var wt=(f+(n=n+Math.imul(l,X)|0)|0)+((8191&(o=(o=o+Math.imul(l,Q)|0)+Math.imul(d,X)|0))<<13)|0;f=((s=s+Math.imul(d,Q)|0)+(o>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(k,F),o=(o=Math.imul(k,W))+Math.imul(E,F)|0,s=Math.imul(E,W),n=n+Math.imul(_,K)|0,o=(o=o+Math.imul(_,Z)|0)+Math.imul(M,K)|0,s=s+Math.imul(M,Z)|0,n=n+Math.imul(b,J)|0,o=(o=o+Math.imul(b,Y)|0)+Math.imul(y,J)|0,s=s+Math.imul(y,Y)|0,n=n+Math.imul(m,X)|0,o=(o=o+Math.imul(m,Q)|0)+Math.imul(g,X)|0,s=s+Math.imul(g,Q)|0;var _t=(f+(n=n+Math.imul(l,tt)|0)|0)+((8191&(o=(o=o+Math.imul(l,et)|0)+Math.imul(d,tt)|0))<<13)|0;f=((s=s+Math.imul(d,et)|0)+(o>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(A,F),o=(o=Math.imul(A,W))+Math.imul(x,F)|0,s=Math.imul(x,W),n=n+Math.imul(k,K)|0,o=(o=o+Math.imul(k,Z)|0)+Math.imul(E,K)|0,s=s+Math.imul(E,Z)|0,n=n+Math.imul(_,J)|0,o=(o=o+Math.imul(_,Y)|0)+Math.imul(M,J)|0,s=s+Math.imul(M,Y)|0,n=n+Math.imul(b,X)|0,o=(o=o+Math.imul(b,Q)|0)+Math.imul(y,X)|0,s=s+Math.imul(y,Q)|0,n=n+Math.imul(m,tt)|0,o=(o=o+Math.imul(m,et)|0)+Math.imul(g,tt)|0,s=s+Math.imul(g,et)|0;var Mt=(f+(n=n+Math.imul(l,it)|0)|0)+((8191&(o=(o=o+Math.imul(l,nt)|0)+Math.imul(d,it)|0))<<13)|0;f=((s=s+Math.imul(d,nt)|0)+(o>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(P,F),o=(o=Math.imul(P,W))+Math.imul(I,F)|0,s=Math.imul(I,W),n=n+Math.imul(A,K)|0,o=(o=o+Math.imul(A,Z)|0)+Math.imul(x,K)|0,s=s+Math.imul(x,Z)|0,n=n+Math.imul(k,J)|0,o=(o=o+Math.imul(k,Y)|0)+Math.imul(E,J)|0,s=s+Math.imul(E,Y)|0,n=n+Math.imul(_,X)|0,o=(o=o+Math.imul(_,Q)|0)+Math.imul(M,X)|0,s=s+Math.imul(M,Q)|0,n=n+Math.imul(b,tt)|0,o=(o=o+Math.imul(b,et)|0)+Math.imul(y,tt)|0,s=s+Math.imul(y,et)|0,n=n+Math.imul(m,it)|0,o=(o=o+Math.imul(m,nt)|0)+Math.imul(g,it)|0,s=s+Math.imul(g,nt)|0;var St=(f+(n=n+Math.imul(l,st)|0)|0)+((8191&(o=(o=o+Math.imul(l,at)|0)+Math.imul(d,st)|0))<<13)|0;f=((s=s+Math.imul(d,at)|0)+(o>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(O,F),o=(o=Math.imul(O,W))+Math.imul(B,F)|0,s=Math.imul(B,W),n=n+Math.imul(P,K)|0,o=(o=o+Math.imul(P,Z)|0)+Math.imul(I,K)|0,s=s+Math.imul(I,Z)|0,n=n+Math.imul(A,J)|0,o=(o=o+Math.imul(A,Y)|0)+Math.imul(x,J)|0,s=s+Math.imul(x,Y)|0,n=n+Math.imul(k,X)|0,o=(o=o+Math.imul(k,Q)|0)+Math.imul(E,X)|0,s=s+Math.imul(E,Q)|0,n=n+Math.imul(_,tt)|0,o=(o=o+Math.imul(_,et)|0)+Math.imul(M,tt)|0,s=s+Math.imul(M,et)|0,n=n+Math.imul(b,it)|0,o=(o=o+Math.imul(b,nt)|0)+Math.imul(y,it)|0,s=s+Math.imul(y,nt)|0,n=n+Math.imul(m,st)|0,o=(o=o+Math.imul(m,at)|0)+Math.imul(g,st)|0,s=s+Math.imul(g,at)|0;var kt=(f+(n=n+Math.imul(l,ut)|0)|0)+((8191&(o=(o=o+Math.imul(l,ft)|0)+Math.imul(d,ut)|0))<<13)|0;f=((s=s+Math.imul(d,ft)|0)+(o>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(C,F),o=(o=Math.imul(C,W))+Math.imul(U,F)|0,s=Math.imul(U,W),n=n+Math.imul(O,K)|0,o=(o=o+Math.imul(O,Z)|0)+Math.imul(B,K)|0,s=s+Math.imul(B,Z)|0,n=n+Math.imul(P,J)|0,o=(o=o+Math.imul(P,Y)|0)+Math.imul(I,J)|0,s=s+Math.imul(I,Y)|0,n=n+Math.imul(A,X)|0,o=(o=o+Math.imul(A,Q)|0)+Math.imul(x,X)|0,s=s+Math.imul(x,Q)|0,n=n+Math.imul(k,tt)|0,o=(o=o+Math.imul(k,et)|0)+Math.imul(E,tt)|0,s=s+Math.imul(E,et)|0,n=n+Math.imul(_,it)|0,o=(o=o+Math.imul(_,nt)|0)+Math.imul(M,it)|0,s=s+Math.imul(M,nt)|0,n=n+Math.imul(b,st)|0,o=(o=o+Math.imul(b,at)|0)+Math.imul(y,st)|0,s=s+Math.imul(y,at)|0,n=n+Math.imul(m,ut)|0,o=(o=o+Math.imul(m,ft)|0)+Math.imul(g,ut)|0,s=s+Math.imul(g,ft)|0;var Et=(f+(n=n+Math.imul(l,lt)|0)|0)+((8191&(o=(o=o+Math.imul(l,dt)|0)+Math.imul(d,lt)|0))<<13)|0;f=((s=s+Math.imul(d,dt)|0)+(o>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(q,F),o=(o=Math.imul(q,W))+Math.imul(D,F)|0,s=Math.imul(D,W),n=n+Math.imul(C,K)|0,o=(o=o+Math.imul(C,Z)|0)+Math.imul(U,K)|0,s=s+Math.imul(U,Z)|0,n=n+Math.imul(O,J)|0,o=(o=o+Math.imul(O,Y)|0)+Math.imul(B,J)|0,s=s+Math.imul(B,Y)|0,n=n+Math.imul(P,X)|0,o=(o=o+Math.imul(P,Q)|0)+Math.imul(I,X)|0,s=s+Math.imul(I,Q)|0,n=n+Math.imul(A,tt)|0,o=(o=o+Math.imul(A,et)|0)+Math.imul(x,tt)|0,s=s+Math.imul(x,et)|0,n=n+Math.imul(k,it)|0,o=(o=o+Math.imul(k,nt)|0)+Math.imul(E,it)|0,s=s+Math.imul(E,nt)|0,n=n+Math.imul(_,st)|0,o=(o=o+Math.imul(_,at)|0)+Math.imul(M,st)|0,s=s+Math.imul(M,at)|0,n=n+Math.imul(b,ut)|0,o=(o=o+Math.imul(b,ft)|0)+Math.imul(y,ut)|0,s=s+Math.imul(y,ft)|0,n=n+Math.imul(m,lt)|0,o=(o=o+Math.imul(m,dt)|0)+Math.imul(g,lt)|0,s=s+Math.imul(g,dt)|0;var Rt=(f+(n=n+Math.imul(l,mt)|0)|0)+((8191&(o=(o=o+Math.imul(l,gt)|0)+Math.imul(d,mt)|0))<<13)|0;f=((s=s+Math.imul(d,gt)|0)+(o>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,n=Math.imul(q,K),o=(o=Math.imul(q,Z))+Math.imul(D,K)|0,s=Math.imul(D,Z),n=n+Math.imul(C,J)|0,o=(o=o+Math.imul(C,Y)|0)+Math.imul(U,J)|0,s=s+Math.imul(U,Y)|0,n=n+Math.imul(O,X)|0,o=(o=o+Math.imul(O,Q)|0)+Math.imul(B,X)|0,s=s+Math.imul(B,Q)|0,n=n+Math.imul(P,tt)|0,o=(o=o+Math.imul(P,et)|0)+Math.imul(I,tt)|0,s=s+Math.imul(I,et)|0,n=n+Math.imul(A,it)|0,o=(o=o+Math.imul(A,nt)|0)+Math.imul(x,it)|0,s=s+Math.imul(x,nt)|0,n=n+Math.imul(k,st)|0,o=(o=o+Math.imul(k,at)|0)+Math.imul(E,st)|0,s=s+Math.imul(E,at)|0,n=n+Math.imul(_,ut)|0,o=(o=o+Math.imul(_,ft)|0)+Math.imul(M,ut)|0,s=s+Math.imul(M,ft)|0,n=n+Math.imul(b,lt)|0,o=(o=o+Math.imul(b,dt)|0)+Math.imul(y,lt)|0,s=s+Math.imul(y,dt)|0;var At=(f+(n=n+Math.imul(m,mt)|0)|0)+((8191&(o=(o=o+Math.imul(m,gt)|0)+Math.imul(g,mt)|0))<<13)|0;f=((s=s+Math.imul(g,gt)|0)+(o>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(q,J),o=(o=Math.imul(q,Y))+Math.imul(D,J)|0,s=Math.imul(D,Y),n=n+Math.imul(C,X)|0,o=(o=o+Math.imul(C,Q)|0)+Math.imul(U,X)|0,s=s+Math.imul(U,Q)|0,n=n+Math.imul(O,tt)|0,o=(o=o+Math.imul(O,et)|0)+Math.imul(B,tt)|0,s=s+Math.imul(B,et)|0,n=n+Math.imul(P,it)|0,o=(o=o+Math.imul(P,nt)|0)+Math.imul(I,it)|0,s=s+Math.imul(I,nt)|0,n=n+Math.imul(A,st)|0,o=(o=o+Math.imul(A,at)|0)+Math.imul(x,st)|0,s=s+Math.imul(x,at)|0,n=n+Math.imul(k,ut)|0,o=(o=o+Math.imul(k,ft)|0)+Math.imul(E,ut)|0,s=s+Math.imul(E,ft)|0,n=n+Math.imul(_,lt)|0,o=(o=o+Math.imul(_,dt)|0)+Math.imul(M,lt)|0,s=s+Math.imul(M,dt)|0;var xt=(f+(n=n+Math.imul(b,mt)|0)|0)+((8191&(o=(o=o+Math.imul(b,gt)|0)+Math.imul(y,mt)|0))<<13)|0;f=((s=s+Math.imul(y,gt)|0)+(o>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(q,X),o=(o=Math.imul(q,Q))+Math.imul(D,X)|0,s=Math.imul(D,Q),n=n+Math.imul(C,tt)|0,o=(o=o+Math.imul(C,et)|0)+Math.imul(U,tt)|0,s=s+Math.imul(U,et)|0,n=n+Math.imul(O,it)|0,o=(o=o+Math.imul(O,nt)|0)+Math.imul(B,it)|0,s=s+Math.imul(B,nt)|0,n=n+Math.imul(P,st)|0,o=(o=o+Math.imul(P,at)|0)+Math.imul(I,st)|0,s=s+Math.imul(I,at)|0,n=n+Math.imul(A,ut)|0,o=(o=o+Math.imul(A,ft)|0)+Math.imul(x,ut)|0,s=s+Math.imul(x,ft)|0,n=n+Math.imul(k,lt)|0,o=(o=o+Math.imul(k,dt)|0)+Math.imul(E,lt)|0,s=s+Math.imul(E,dt)|0;var Tt=(f+(n=n+Math.imul(_,mt)|0)|0)+((8191&(o=(o=o+Math.imul(_,gt)|0)+Math.imul(M,mt)|0))<<13)|0;f=((s=s+Math.imul(M,gt)|0)+(o>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(q,tt),o=(o=Math.imul(q,et))+Math.imul(D,tt)|0,s=Math.imul(D,et),n=n+Math.imul(C,it)|0,o=(o=o+Math.imul(C,nt)|0)+Math.imul(U,it)|0,s=s+Math.imul(U,nt)|0,n=n+Math.imul(O,st)|0,o=(o=o+Math.imul(O,at)|0)+Math.imul(B,st)|0,s=s+Math.imul(B,at)|0,n=n+Math.imul(P,ut)|0,o=(o=o+Math.imul(P,ft)|0)+Math.imul(I,ut)|0,s=s+Math.imul(I,ft)|0,n=n+Math.imul(A,lt)|0,o=(o=o+Math.imul(A,dt)|0)+Math.imul(x,lt)|0,s=s+Math.imul(x,dt)|0;var Pt=(f+(n=n+Math.imul(k,mt)|0)|0)+((8191&(o=(o=o+Math.imul(k,gt)|0)+Math.imul(E,mt)|0))<<13)|0;f=((s=s+Math.imul(E,gt)|0)+(o>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,n=Math.imul(q,it),o=(o=Math.imul(q,nt))+Math.imul(D,it)|0,s=Math.imul(D,nt),n=n+Math.imul(C,st)|0,o=(o=o+Math.imul(C,at)|0)+Math.imul(U,st)|0,s=s+Math.imul(U,at)|0,n=n+Math.imul(O,ut)|0,o=(o=o+Math.imul(O,ft)|0)+Math.imul(B,ut)|0,s=s+Math.imul(B,ft)|0,n=n+Math.imul(P,lt)|0,o=(o=o+Math.imul(P,dt)|0)+Math.imul(I,lt)|0,s=s+Math.imul(I,dt)|0;var It=(f+(n=n+Math.imul(A,mt)|0)|0)+((8191&(o=(o=o+Math.imul(A,gt)|0)+Math.imul(x,mt)|0))<<13)|0;f=((s=s+Math.imul(x,gt)|0)+(o>>>13)|0)+(It>>>26)|0,It&=67108863,n=Math.imul(q,st),o=(o=Math.imul(q,at))+Math.imul(D,st)|0,s=Math.imul(D,at),n=n+Math.imul(C,ut)|0,o=(o=o+Math.imul(C,ft)|0)+Math.imul(U,ut)|0,s=s+Math.imul(U,ft)|0,n=n+Math.imul(O,lt)|0,o=(o=o+Math.imul(O,dt)|0)+Math.imul(B,lt)|0,s=s+Math.imul(B,dt)|0;var Lt=(f+(n=n+Math.imul(P,mt)|0)|0)+((8191&(o=(o=o+Math.imul(P,gt)|0)+Math.imul(I,mt)|0))<<13)|0;f=((s=s+Math.imul(I,gt)|0)+(o>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,n=Math.imul(q,ut),o=(o=Math.imul(q,ft))+Math.imul(D,ut)|0,s=Math.imul(D,ft),n=n+Math.imul(C,lt)|0,o=(o=o+Math.imul(C,dt)|0)+Math.imul(U,lt)|0,s=s+Math.imul(U,dt)|0;var Ot=(f+(n=n+Math.imul(O,mt)|0)|0)+((8191&(o=(o=o+Math.imul(O,gt)|0)+Math.imul(B,mt)|0))<<13)|0;f=((s=s+Math.imul(B,gt)|0)+(o>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,n=Math.imul(q,lt),o=(o=Math.imul(q,dt))+Math.imul(D,lt)|0,s=Math.imul(D,dt);var Bt=(f+(n=n+Math.imul(C,mt)|0)|0)+((8191&(o=(o=o+Math.imul(C,gt)|0)+Math.imul(U,mt)|0))<<13)|0;f=((s=s+Math.imul(U,gt)|0)+(o>>>13)|0)+(Bt>>>26)|0,Bt&=67108863;var jt=(f+(n=Math.imul(q,mt))|0)+((8191&(o=(o=Math.imul(q,gt))+Math.imul(D,mt)|0))<<13)|0;return f=((s=Math.imul(D,gt))+(o>>>13)|0)+(jt>>>26)|0,jt&=67108863,u[0]=vt,u[1]=bt,u[2]=yt,u[3]=wt,u[4]=_t,u[5]=Mt,u[6]=St,u[7]=kt,u[8]=Et,u[9]=Rt,u[10]=At,u[11]=xt,u[12]=Tt,u[13]=Pt,u[14]=It,u[15]=Lt,u[16]=Ot,u[17]=Bt,u[18]=jt,0!==f&&(u[19]=f,i.length++),i};function p(t,e,r){return(new m).mulp(t,e,r)}function m(t,e){this.x=t,this.y=e}Math.imul||(d=l),o.prototype.mulTo=function t(e,r){var i=this.length+e.length;return 10===this.length&&10===e.length?d(this,e,r):i<63?l(this,e,r):i<1024?function n(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var i=0,n=0,o=0;o<r.length-1;o++){var s=n;n=0;for(var a=67108863&i,h=Math.min(o,e.length-1),u=Math.max(0,o-t.length+1);u<=h;u++){var f=o-u,c=(0|t.words[f])*(0|e.words[u]),l=67108863&c;a=67108863&(l=l+a|0),n+=(s=(s=s+(c/67108864|0)|0)+(l>>>26)|0)>>>26,s&=67108863}r.words[o]=a,i=s,s=n}return 0!==i?r.words[o]=i:r.length--,r.strip()}(this,e,r):p(this,e,r)},m.prototype.makeRBT=function t(e){for(var r=new Array(e),i=o.prototype._countBits(e)-1,n=0;n<e;n++)r[n]=this.revBin(n,i,e);return r},m.prototype.revBin=function t(e,r,i){if(0===e||e===i-1)return e;for(var n=0,o=0;o<r;o++)n|=(1&e)<<r-o-1,e>>=1;return n},m.prototype.permute=function t(e,r,i,n,o,s){for(var a=0;a<s;a++)n[a]=r[e[a]],o[a]=i[e[a]]},m.prototype.transform=function t(e,r,i,n,o,s){this.permute(s,e,r,i,n,o);for(var a=1;a<o;a<<=1)for(var h=a<<1,u=Math.cos(2*Math.PI/h),f=Math.sin(2*Math.PI/h),c=0;c<o;c+=h)for(var l=u,d=f,p=0;p<a;p++){var m=i[c+p],g=n[c+p],v=i[c+p+a],b=n[c+p+a],y=l*v-d*b;b=l*b+d*v,v=y,i[c+p]=m+v,n[c+p]=g+b,i[c+p+a]=m-v,n[c+p+a]=g-b,p!==h&&(y=u*l-f*d,d=u*d+f*l,l=y)}},m.prototype.guessLen13b=function t(e,r){var i=1|Math.max(r,e),n=1&i,o=0;for(i=i/2|0;i;i>>>=1)o++;return 1<<o+1+n},m.prototype.conjugate=function t(e,r,i){if(!(i<=1))for(var n=0;n<i/2;n++){var o=e[n];e[n]=e[i-n-1],e[i-n-1]=o,o=r[n],r[n]=-r[i-n-1],r[i-n-1]=-o}},m.prototype.normalize13b=function t(e,r){for(var i=0,n=0;n<r/2;n++){var o=8192*Math.round(e[2*n+1]/r)+Math.round(e[2*n]/r)+i;e[n]=67108863&o,i=o<67108864?0:o/67108864|0}return e},m.prototype.convert13b=function t(e,r,n,o){for(var s=0,a=0;a<r;a++)s+=0|e[a],n[2*a]=8191&s,s>>>=13,n[2*a+1]=8191&s,s>>>=13;for(a=2*r;a<o;++a)n[a]=0;i(0===s),i(0==(-8192&s))},m.prototype.stub=function t(e){for(var r=new Array(e),i=0;i<e;i++)r[i]=0;return r},m.prototype.mulp=function t(e,r,i){var n=2*this.guessLen13b(e.length,r.length),o=this.makeRBT(n),s=this.stub(n),a=new Array(n),h=new Array(n),u=new Array(n),f=new Array(n),c=new Array(n),l=new Array(n),d=i.words;d.length=n,this.convert13b(e.words,e.length,a,n),this.convert13b(r.words,r.length,f,n),this.transform(a,s,h,u,n,o),this.transform(f,s,c,l,n,o);for(var p=0;p<n;p++){var m=h[p]*c[p]-u[p]*l[p];u[p]=h[p]*l[p]+u[p]*c[p],h[p]=m}return this.conjugate(h,u,n),this.transform(h,u,d,s,n,o),this.conjugate(d,s,n),this.normalize13b(d,n),i.negative=e.negative^r.negative,i.length=e.length+r.length,i.strip()},o.prototype.mul=function t(e){var r=new o(null);return r.words=new Array(this.length+e.length),this.mulTo(e,r)},o.prototype.mulf=function t(e){var r=new o(null);return r.words=new Array(this.length+e.length),p(this,e,r)},o.prototype.imul=function t(e){return this.clone().mulTo(e,this)},o.prototype.imuln=function t(e){i("number"==typeof e),i(e<67108864);for(var r=0,n=0;n<this.length;n++){var o=(0|this.words[n])*e,s=(67108863&o)+(67108863&r);r>>=26,r+=o/67108864|0,r+=s>>>26,this.words[n]=67108863&s}return 0!==r&&(this.words[n]=r,this.length++),this},o.prototype.muln=function t(e){return this.clone().imuln(e)},o.prototype.sqr=function t(){return this.mul(this)},o.prototype.isqr=function t(){return this.imul(this.clone())},o.prototype.pow=function t(e){var r=function i(t){for(var e=new Array(t.bitLength()),r=0;r<e.length;r++){var i=r/26|0,n=r%26;e[r]=(t.words[i]&1<<n)>>>n}return e}(e);if(0===r.length)return new o(1);for(var n=this,s=0;s<r.length&&0===r[s];s++,n=n.sqr());if(++s<r.length)for(var a=n.sqr();s<r.length;s++,a=a.sqr())0!==r[s]&&(n=n.mul(a));return n},o.prototype.iushln=function t(e){i("number"==typeof e&&e>=0);var r,n=e%26,o=(e-n)/26,s=67108863>>>26-n<<26-n;if(0!==n){var a=0;for(r=0;r<this.length;r++){var h=this.words[r]&s,u=(0|this.words[r])-h<<n;this.words[r]=u|a,a=h>>>26-n}a&&(this.words[r]=a,this.length++)}if(0!==o){for(r=this.length-1;r>=0;r--)this.words[r+o]=this.words[r];for(r=0;r<o;r++)this.words[r]=0;this.length+=o}return this.strip()},o.prototype.ishln=function t(e){return i(0===this.negative),this.iushln(e)},o.prototype.iushrn=function t(e,r,n){var o;i("number"==typeof e&&e>=0),o=r?(r-r%26)/26:0;var s=e%26,a=Math.min((e-s)/26,this.length),h=67108863^67108863>>>s<<s,u=n;if(o-=a,o=Math.max(0,o),u){for(var f=0;f<a;f++)u.words[f]=this.words[f];u.length=a}if(0===a);else if(this.length>a)for(this.length-=a,f=0;f<this.length;f++)this.words[f]=this.words[f+a];else this.words[0]=0,this.length=1;var c=0;for(f=this.length-1;f>=0&&(0!==c||f>=o);f--){var l=0|this.words[f];this.words[f]=c<<26-s|l>>>s,c=l&h}return u&&0!==c&&(u.words[u.length++]=c),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function t(e,r,n){return i(0===this.negative),this.iushrn(e,r,n)},o.prototype.shln=function t(e){return this.clone().ishln(e)},o.prototype.ushln=function t(e){return this.clone().iushln(e)},o.prototype.shrn=function t(e){return this.clone().ishrn(e)},o.prototype.ushrn=function t(e){return this.clone().iushrn(e)},o.prototype.testn=function t(e){i("number"==typeof e&&e>=0);var r=e%26,n=(e-r)/26,o=1<<r;return!(this.length<=n)&&!!(this.words[n]&o)},o.prototype.imaskn=function t(e){i("number"==typeof e&&e>=0);var r=e%26,n=(e-r)/26;if(i(0===this.negative,"imaskn works only with positive numbers"),this.length<=n)return this;if(0!==r&&n++,this.length=Math.min(n,this.length),0!==r){var o=67108863^67108863>>>r<<r;this.words[this.length-1]&=o}return this.strip()},o.prototype.maskn=function t(e){return this.clone().imaskn(e)},o.prototype.iaddn=function t(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)},o.prototype._iaddn=function t(e){this.words[0]+=e;for(var r=0;r<this.length&&this.words[r]>=67108864;r++)this.words[r]-=67108864,r===this.length-1?this.words[r+1]=1:this.words[r+1]++;return this.length=Math.max(this.length,r+1),this},o.prototype.isubn=function t(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 r=0;r<this.length&&this.words[r]<0;r++)this.words[r]+=67108864,this.words[r+1]-=1;return this.strip()},o.prototype.addn=function t(e){return this.clone().iaddn(e)},o.prototype.subn=function t(e){return this.clone().isubn(e)},o.prototype.iabs=function t(){return this.negative=0,this},o.prototype.abs=function t(){return this.clone().iabs()},o.prototype._ishlnsubmul=function t(e,r,n){var o,s,a=e.length+n;this._expand(a);var h=0;for(o=0;o<e.length;o++){s=(0|this.words[o+n])+h;var u=(0|e.words[o])*r;h=((s-=67108863&u)>>26)-(u/67108864|0),this.words[o+n]=67108863&s}for(;o<this.length-n;o++)h=(s=(0|this.words[o+n])+h)>>26,this.words[o+n]=67108863&s;if(0===h)return this.strip();for(i(-1===h),h=0,o=0;o<this.length;o++)h=(s=-(0|this.words[o])+h)>>26,this.words[o]=67108863&s;return this.negative=1,this.strip()},o.prototype._wordDiv=function t(e,r){var i=(this.length,e.length),n=this.clone(),s=e,a=0|s.words[s.length-1];0!==(i=26-this._countBits(a))&&(s=s.ushln(i),n.iushln(i),a=0|s.words[s.length-1]);var h,u=n.length-s.length;if("mod"!==r){(h=new o(null)).length=u+1,h.words=new Array(h.length);for(var f=0;f<h.length;f++)h.words[f]=0}var c=n.clone()._ishlnsubmul(s,1,u);0===c.negative&&(n=c,h&&(h.words[u]=1));for(var l=u-1;l>=0;l--){var d=67108864*(0|n.words[s.length+l])+(0|n.words[s.length+l-1]);for(d=Math.min(d/a|0,67108863),n._ishlnsubmul(s,d,l);0!==n.negative;)d--,n.negative=0,n._ishlnsubmul(s,1,l),n.isZero()||(n.negative^=1);h&&(h.words[l]=d)}return h&&h.strip(),n.strip(),"div"!==r&&0!==i&&n.iushrn(i),{div:h||null,mod:n}},o.prototype.divmod=function t(e,r,n){return i(!e.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===e.negative?(h=this.neg().divmod(e,r),"mod"!==r&&(s=h.div.neg()),"div"!==r&&(a=h.mod.neg(),n&&0!==a.negative&&a.iadd(e)),{div:s,mod:a}):0===this.negative&&0!==e.negative?(h=this.divmod(e.neg(),r),"mod"!==r&&(s=h.div.neg()),{div:s,mod:h.mod}):0!=(this.negative&e.negative)?(h=this.neg().divmod(e.neg(),r),"div"!==r&&(a=h.mod.neg(),n&&0!==a.negative&&a.isub(e)),{div:h.div,mod:a}):e.length>this.length||this.cmp(e)<0?{div:new o(0),mod:this}:1===e.length?"div"===r?{div:this.divn(e.words[0]),mod:null}:"mod"===r?{div:null,mod:new o(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new o(this.modn(e.words[0]))}:this._wordDiv(e,r);var s,a,h},o.prototype.div=function t(e){return this.divmod(e,"div",!1).div},o.prototype.mod=function t(e){return this.divmod(e,"mod",!1).mod},o.prototype.umod=function t(e){return this.divmod(e,"mod",!0).mod},o.prototype.divRound=function t(e){var r=this.divmod(e);if(r.mod.isZero())return r.div;var i=0!==r.div.negative?r.mod.isub(e):r.mod,n=e.ushrn(1),o=e.andln(1),s=i.cmp(n);return s<0||1===o&&0===s?r.div:0!==r.div.negative?r.div.isubn(1):r.div.iaddn(1)},o.prototype.modn=function t(e){i(e<=67108863);for(var r=(1<<26)%e,n=0,o=this.length-1;o>=0;o--)n=(r*n+(0|this.words[o]))%e;return n},o.prototype.idivn=function t(e){i(e<=67108863);for(var r=0,n=this.length-1;n>=0;n--){var o=(0|this.words[n])+67108864*r;this.words[n]=o/e|0,r=o%e}return this.strip()},o.prototype.divn=function t(e){return this.clone().idivn(e)},o.prototype.egcd=function t(e){i(0===e.negative),i(!e.isZero());var r=this,n=e.clone();r=0!==r.negative?r.umod(e):r.clone();for(var s=new o(1),a=new o(0),h=new o(0),u=new o(1),f=0;r.isEven()&&n.isEven();)r.iushrn(1),n.iushrn(1),++f;for(var c=n.clone(),l=r.clone();!r.isZero();){for(var d=0,p=1;0==(r.words[0]&p)&&d<26;++d,p<<=1);if(d>0)for(r.iushrn(d);d-- >0;)(s.isOdd()||a.isOdd())&&(s.iadd(c),a.isub(l)),s.iushrn(1),a.iushrn(1);for(var m=0,g=1;0==(n.words[0]&g)&&m<26;++m,g<<=1);if(m>0)for(n.iushrn(m);m-- >0;)(h.isOdd()||u.isOdd())&&(h.iadd(c),u.isub(l)),h.iushrn(1),u.iushrn(1);r.cmp(n)>=0?(r.isub(n),s.isub(h),a.isub(u)):(n.isub(r),h.isub(s),u.isub(a))}return{a:h,b:u,gcd:n.iushln(f)}},o.prototype._invmp=function t(e){i(0===e.negative),i(!e.isZero());var r=this,n=e.clone();r=0!==r.negative?r.umod(e):r.clone();for(var s,a=new o(1),h=new o(0),u=n.clone();r.cmpn(1)>0&&n.cmpn(1)>0;){for(var f=0,c=1;0==(r.words[0]&c)&&f<26;++f,c<<=1);if(f>0)for(r.iushrn(f);f-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);for(var l=0,d=1;0==(n.words[0]&d)&&l<26;++l,d<<=1);if(l>0)for(n.iushrn(l);l-- >0;)h.isOdd()&&h.iadd(u),h.iushrn(1);r.cmp(n)>=0?(r.isub(n),a.isub(h)):(n.isub(r),h.isub(a))}return(s=0===r.cmpn(1)?a:h).cmpn(0)<0&&s.iadd(e),s},o.prototype.gcd=function t(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var r=this.clone(),i=e.clone();r.negative=0,i.negative=0;for(var n=0;r.isEven()&&i.isEven();n++)r.iushrn(1),i.iushrn(1);for(;;){for(;r.isEven();)r.iushrn(1);for(;i.isEven();)i.iushrn(1);var o=r.cmp(i);if(o<0){var s=r;r=i,i=s}else if(0===o||0===i.cmpn(1))break;r.isub(i)}return i.iushln(n)},o.prototype.invm=function t(e){return this.egcd(e).a.umod(e)},o.prototype.isEven=function t(){return 0==(1&this.words[0])},o.prototype.isOdd=function t(){return 1==(1&this.words[0])},o.prototype.andln=function t(e){return this.words[0]&e},o.prototype.bincn=function t(e){i("number"==typeof e);var r=e%26,n=(e-r)/26,o=1<<r;if(this.length<=n)return this._expand(n+1),this.words[n]|=o,this;for(var s=o,a=n;0!==s&&a<this.length;a++){var h=0|this.words[a];s=(h+=s)>>>26,h&=67108863,this.words[a]=h}return 0!==s&&(this.words[a]=s,this.length++),this},o.prototype.isZero=function t(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function t(e){var r,n=e<0;if(0!==this.negative&&!n)return-1;if(0===this.negative&&n)return 1;if(this.strip(),this.length>1)r=1;else{n&&(e=-e),i(e<=67108863,"Number is too big");var o=0|this.words[0];r=o===e?0:o<e?-1:1}return 0!==this.negative?0|-r:r},o.prototype.cmp=function t(e){if(0!==this.negative&&0===e.negative)return-1;if(0===this.negative&&0!==e.negative)return 1;var r=this.ucmp(e);return 0!==this.negative?0|-r:r},o.prototype.ucmp=function t(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var r=0,i=this.length-1;i>=0;i--){var n=0|this.words[i],o=0|e.words[i];if(n!==o){n<o?r=-1:n>o&&(r=1);break}}return r},o.prototype.gtn=function t(e){return 1===this.cmpn(e)},o.prototype.gt=function t(e){return 1===this.cmp(e)},o.prototype.gten=function t(e){return this.cmpn(e)>=0},o.prototype.gte=function t(e){return this.cmp(e)>=0},o.prototype.ltn=function t(e){return-1===this.cmpn(e)},o.prototype.lt=function t(e){return-1===this.cmp(e)},o.prototype.lten=function t(e){return this.cmpn(e)<=0},o.prototype.lte=function t(e){return this.cmp(e)<=0},o.prototype.eqn=function t(e){return 0===this.cmpn(e)},o.prototype.eq=function t(e){return 0===this.cmp(e)},o.red=function t(e){return new M(e)},o.prototype.toRed=function t(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)},o.prototype.fromRed=function t(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function t(e){return this.red=e,this},o.prototype.forceRed=function t(e){return i(!this.red,"Already a number in reduction context"),this._forceRed(e)},o.prototype.redAdd=function t(e){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},o.prototype.redIAdd=function t(e){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},o.prototype.redSub=function t(e){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},o.prototype.redISub=function t(e){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},o.prototype.redShl=function t(e){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},o.prototype.redMul=function t(e){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},o.prototype.redIMul=function t(e){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},o.prototype.redSqr=function t(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function t(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function t(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function t(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function t(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function t(e){return i(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var g={k256:null,p224:null,p192:null,p25519:null};function v(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function b(){v.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function y(){v.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function w(){v.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function _(){v.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function M(t){if("string"==typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else i(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function S(t){M.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}v.prototype._tmp=function t(){var e=new o(null);return e.words=new Array(Math.ceil(this.n/13)),e},v.prototype.ireduce=function t(e){var r,i=e;do{this.split(i,this.tmp),r=(i=(i=this.imulK(i)).iadd(this.tmp)).bitLength()}while(r>this.n);var n=r<this.n?-1:i.ucmp(this.p);return 0===n?(i.words[0]=0,i.length=1):n>0?i.isub(this.p):void 0!==i.strip?i.strip():i._strip(),i},v.prototype.split=function t(e,r){e.iushrn(this.n,0,r)},v.prototype.imulK=function t(e){return e.imul(this.k)},n(b,v),b.prototype.split=function t(e,r){for(var i=4194303,n=Math.min(e.length,9),o=0;o<n;o++)r.words[o]=e.words[o];if(r.length=n,e.length<=9)return e.words[0]=0,void(e.length=1);var s=e.words[9];for(r.words[r.length++]=s&i,o=10;o<e.length;o++){var a=0|e.words[o];e.words[o-10]=(a&i)<<4|s>>>22,s=a}s>>>=22,e.words[o-10]=s,0===s&&e.length>10?e.length-=10:e.length-=9},b.prototype.imulK=function t(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var r=0,i=0;i<e.length;i++){var n=0|e.words[i];r+=977*n,e.words[i]=67108863&r,r=64*n+(r/67108864|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},n(y,v),n(w,v),n(_,v),_.prototype.imulK=function t(e){for(var r=0,i=0;i<e.length;i++){var n=19*(0|e.words[i])+r,o=67108863&n;n>>>=26,e.words[i]=o,r=n}return 0!==r&&(e.words[e.length++]=r),e},o._prime=function t(e){if(g[e])return g[e];var t;if("k256"===e)t=new b;else if("p224"===e)t=new y;else if("p192"===e)t=new w;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new _}return g[e]=t,t},M.prototype._verify1=function t(e){i(0===e.negative,"red works only with positives"),i(e.red,"red works only with red numbers")},M.prototype._verify2=function t(e,r){i(0==(e.negative|r.negative),"red works only with positives"),i(e.red&&e.red===r.red,"red works only with red numbers")},M.prototype.imod=function t(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},M.prototype.neg=function t(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},M.prototype.add=function t(e,r){this._verify2(e,r);var i=e.add(r);return i.cmp(this.m)>=0&&i.isub(this.m),i._forceRed(this)},M.prototype.iadd=function t(e,r){this._verify2(e,r);var i=e.iadd(r);return i.cmp(this.m)>=0&&i.isub(this.m),i},M.prototype.sub=function t(e,r){this._verify2(e,r);var i=e.sub(r);return i.cmpn(0)<0&&i.iadd(this.m),i._forceRed(this)},M.prototype.isub=function t(e,r){this._verify2(e,r);var i=e.isub(r);return i.cmpn(0)<0&&i.iadd(this.m),i},M.prototype.shl=function t(e,r){return this._verify1(e),this.imod(e.ushln(r))},M.prototype.imul=function t(e,r){return this._verify2(e,r),this.imod(e.imul(r))},M.prototype.mul=function t(e,r){return this._verify2(e,r),this.imod(e.mul(r))},M.prototype.isqr=function t(e){return this.imul(e,e.clone())},M.prototype.sqr=function t(e){return this.mul(e,e)},M.prototype.sqrt=function t(e){if(e.isZero())return e.clone();var r=this.m.andln(3);if(i(r%2==1),3===r){var n=this.m.add(new o(1)).iushrn(2);return this.pow(e,n)}for(var s=this.m.subn(1),a=0;!s.isZero()&&0===s.andln(1);)a++,s.iushrn(1);i(!s.isZero());var h=new o(1).toRed(this),u=h.redNeg(),f=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new o(2*c*c).toRed(this);0!==this.pow(c,f).cmp(u);)c.redIAdd(u);for(var l=this.pow(c,s),d=this.pow(e,s.addn(1).iushrn(1)),p=this.pow(e,s),m=a;0!==p.cmp(h);){for(var g=p,v=0;0!==g.cmp(h);v++)g=g.redSqr();i(v<m);var b=this.pow(l,new o(1).iushln(m-v-1));d=d.redMul(b),l=b.redSqr(),p=p.redMul(l),m=v}return d},M.prototype.invm=function t(e){var r=e._invmp(this.m);return 0!==r.negative?(r.negative=0,this.imod(r).redNeg()):this.imod(r)},M.prototype.pow=function t(e,r){if(r.isZero())return new o(1).toRed(this);if(0===r.cmpn(1))return e.clone();var i=new Array(16);i[0]=new o(1).toRed(this),i[1]=e;for(var n=2;n<i.length;n++)i[n]=this.mul(i[n-1],e);var s=i[0],a=0,h=0,u=r.bitLength()%26;for(0===u&&(u=26),n=r.length-1;n>=0;n--){for(var f=r.words[n],c=u-1;c>=0;c--){var l=f>>c&1;s!==i[0]&&(s=this.sqr(s)),0!==l||0!==a?(a<<=1,a|=l,(4===++h||0===n&&0===c)&&(s=this.mul(s,i[a]),h=0,a=0)):h=0}u=26}return s},M.prototype.convertTo=function t(e){var r=e.umod(this.m);return r===e?r.clone():r},M.prototype.convertFrom=function t(e){var r=e.clone();return r.red=null,r},o.mont=function t(e){return new S(e)},n(S,M),S.prototype.convertTo=function t(e){return this.imod(e.ushln(this.shift))},S.prototype.convertFrom=function t(e){var r=this.imod(e.mul(this.rinv));return r.red=null,r},S.prototype.imul=function t(e,r){if(e.isZero()||r.isZero())return e.words[0]=0,e.length=1,e;var i=e.imul(r),n=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=i.isub(n).iushrn(this.shift),s=o;return o.cmp(this.m)>=0?s=o.isub(this.m):o.cmpn(0)<0&&(s=o.iadd(this.m)),s._forceRed(this)},S.prototype.mul=function t(e,r){if(e.isZero()||r.isZero())return new o(0)._forceRed(this);var i=e.mul(r),n=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),s=i.isub(n).iushrn(this.shift),a=s;return s.cmp(this.m)>=0?a=s.isub(this.m):s.cmpn(0)<0&&(a=s.iadd(this.m)),a._forceRed(this)},S.prototype.invm=function t(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(t,this)}).call(this,r(28)(t))},function(t,e,r){var i=r(324),n=r(98);function o(t){this.rand=t||new n.Rand}t.exports=o,o.create=function t(e){return new o(e)},o.prototype._randbelow=function t(e){var r=e.bitLength(),n=Math.ceil(r/8);do{var o=new i(this.rand.generate(n))}while(o.cmp(e)>=0);return o},o.prototype._randrange=function t(e,r){var i=r.sub(e);return e.add(this._randbelow(i))},o.prototype.test=function t(e,r,n){var o=e.bitLength(),s=i.mont(e),a=new i(1).toRed(s);r||(r=Math.max(1,o/48|0));for(var h=e.subn(1),u=0;!h.testn(u);u++);for(var f=e.shrn(u),c=h.toRed(s);r>0;r--){var l=this._randrange(new i(2),h);n&&n(l);var d=l.toRed(s).redPow(f);if(0!==d.cmp(a)&&0!==d.cmp(c)){for(var p=1;p<u;p++){if(0===(d=d.redSqr()).cmp(a))return!1;if(0===d.cmp(c))break}if(p===u)return!1}}return!0},o.prototype.getDivisor=function t(e,r){var n=e.bitLength(),o=i.mont(e),s=new i(1).toRed(o);r||(r=Math.max(1,n/48|0));for(var a=e.subn(1),h=0;!a.testn(h);h++);for(var u=e.shrn(h),f=a.toRed(o);r>0;r--){var c=this._randrange(new i(2),a),l=e.gcd(c);if(0!==l.cmpn(1))return l;var d=c.toRed(o).redPow(u);if(0!==d.cmp(s)&&0!==d.cmp(f)){for(var p=1;p<h;p++){if(0===(d=d.redSqr()).cmp(s))return d.fromRed().subn(1).gcd(e);if(0===d.cmp(f))break}if(p===h)return(d=d.redSqr()).fromRed().subn(1).gcd(e)}}return!1}},function(t,e,r){"use strict";(function(e,i){var n;t.exports=E,E.ReadableState=k;r(24).EventEmitter;var o=function t(e,r){return e.listeners(r).length},s=r(177),a=r(7).Buffer,h=e.Uint8Array||function(){};var u,f=r(331);u=f&&f.debuglog?f.debuglog("stream"):function t(){};var c,l,d,p=r(332),m=r(178),g=r(179).getHighWaterMark,v=r(36).codes,b=v.ERR_INVALID_ARG_TYPE,y=v.ERR_STREAM_PUSH_AFTER_EOF,w=v.ERR_METHOD_NOT_IMPLEMENTED,_=v.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;r(37)(E,s);var M=m.errorOrDestroy,S=["error","close","destroy","pause","resume"];function k(t,e,i){n=n||r(38),t=t||{},"boolean"!=typeof i&&(i=e instanceof n),this.objectMode=!!t.objectMode,i&&(this.objectMode=this.objectMode||!!t.readableObjectMode),this.highWaterMark=g(this,t,"readableHighWaterMark",i),this.buffer=new p,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.paused=!0,this.emitClose=!1!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(c||(c=r(25).StringDecoder),this.decoder=new c(t.encoding),this.encoding=t.encoding)}function E(t){if(n=n||r(38),!(this instanceof E))return new E(t);var e=this instanceof n;this._readableState=new k(t,this,e),this.readable=!0,t&&("function"==typeof t.read&&(this._read=t.read),"function"==typeof t.destroy&&(this._destroy=t.destroy)),s.call(this)}function R(t,e,r,i,n){u("readableAddChunk",e);var o,s=t._readableState;if(null===e)s.reading=!1,function f(t,e){if(u("onEofChunk"),e.ended)return;if(e.decoder){var r=e.decoder.end();r&&r.length&&(e.buffer.push(r),e.length+=e.objectMode?1:r.length)}e.ended=!0,e.sync?P(t):(e.needReadable=!1,e.emittedReadable||(e.emittedReadable=!0,I(t)))}(t,s);else if(n||(o=function c(t,e){var r;(function i(t){return a.isBuffer(t)||t instanceof h})(e)||"string"==typeof e||void 0===e||t.objectMode||(r=new b("chunk",["string","Buffer","Uint8Array"],e));return r}(s,e)),o)M(t,o);else if(s.objectMode||e&&e.length>0)if("string"==typeof e||s.objectMode||Object.getPrototypeOf(e)===a.prototype||(e=function l(t){return a.from(t)}(e)),i)s.endEmitted?M(t,new _):A(t,s,e,!0);else if(s.ended)M(t,new y);else{if(s.destroyed)return!1;s.reading=!1,s.decoder&&!r?(e=s.decoder.write(e),s.objectMode||0!==e.length?A(t,s,e,!1):L(t,s)):A(t,s,e,!1)}else i||(s.reading=!1,L(t,s));return!s.ended&&(s.length<s.highWaterMark||0===s.length)}function A(t,e,r,i){e.flowing&&0===e.length&&!e.sync?(e.awaitDrain=0,t.emit("data",r)):(e.length+=e.objectMode?1:r.length,i?e.buffer.unshift(r):e.buffer.push(r),e.needReadable&&P(t)),L(t,e)}Object.defineProperty(E.prototype,"destroyed",{enumerable:!1,get:function t(){return void 0!==this._readableState&&this._readableState.destroyed},set:function t(e){this._readableState&&(this._readableState.destroyed=e)}}),E.prototype.destroy=m.destroy,E.prototype._undestroy=m.undestroy,E.prototype._destroy=function(t,e){e(t)},E.prototype.push=function(t,e){var r,i=this._readableState;return i.objectMode?r=!0:"string"==typeof t&&((e=e||i.defaultEncoding)!==i.encoding&&(t=a.from(t,e),e=""),r=!0),R(this,t,e,!1,r)},E.prototype.unshift=function(t){return R(this,t,null,!0,!1)},E.prototype.isPaused=function(){return!1===this._readableState.flowing},E.prototype.setEncoding=function(t){c||(c=r(25).StringDecoder);var e=new c(t);this._readableState.decoder=e,this._readableState.encoding=this._readableState.decoder.encoding;for(var i=this._readableState.buffer.head,n="";null!==i;)n+=e.write(i.data),i=i.next;return this._readableState.buffer.clear(),""!==n&&this._readableState.buffer.push(n),this._readableState.length=n.length,this};var x=1073741824;function T(t,e){return t<=0||0===e.length&&e.ended?0:e.objectMode?1:t!=t?e.flowing&&e.length?e.buffer.head.data.length:e.length:(t>e.highWaterMark&&(e.highWaterMark=function r(t){return t>=x?t=x:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function P(t){var e=t._readableState;u("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(u("emitReadable",e.flowing),e.emittedReadable=!0,i.nextTick(I,t))}function I(t){var e=t._readableState;u("emitReadable_",e.destroyed,e.length,e.ended),e.destroyed||!e.length&&!e.ended||(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,U(t)}function L(t,e){e.readingMore||(e.readingMore=!0,i.nextTick(O,t,e))}function O(t,e){for(;!e.reading&&!e.ended&&(e.length<e.highWaterMark||e.flowing&&0===e.length);){var r=e.length;if(u("maybeReadMore read 0"),t.read(0),r===e.length)break}e.readingMore=!1}function B(t){var e=t._readableState;e.readableListening=t.listenerCount("readable")>0,e.resumeScheduled&&!e.paused?e.flowing=!0:t.listenerCount("data")>0&&t.resume()}function j(t){u("readable nexttick read 0"),t.read(0)}function C(t,e){u("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),U(t),e.flowing&&!e.reading&&t.read(0)}function U(t){var e=t._readableState;for(u("flow",e.flowing);e.flowing&&null!==t.read(););}function N(t,e){return 0===e.length?null:(e.objectMode?r=e.buffer.shift():!t||t>=e.length?(r=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.first():e.buffer.concat(e.length),e.buffer.clear()):r=e.buffer.consume(t,e.decoder),r);var r}function q(t){var e=t._readableState;u("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,i.nextTick(D,e,t))}function D(t,e){if(u("endReadableNT",t.endEmitted,t.length),!t.endEmitted&&0===t.length&&(t.endEmitted=!0,e.readable=!1,e.emit("end"),t.autoDestroy)){var r=e._writableState;(!r||r.autoDestroy&&r.finished)&&e.destroy()}}function z(t,e){for(var r=0,i=t.length;r<i;r++)if(t[r]===e)return r;return-1}E.prototype.read=function(t){u("read",t),t=parseInt(t,10);var e=this._readableState,r=t;if(0!==t&&(e.emittedReadable=!1),0===t&&e.needReadable&&((0!==e.highWaterMark?e.length>=e.highWaterMark:e.length>0)||e.ended))return u("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?q(this):P(this),null;if(0===(t=T(t,e))&&e.ended)return 0===e.length&&q(this),null;var i,n=e.needReadable;return u("need readable",n),(0===e.length||e.length-t<e.highWaterMark)&&u("length less than watermark",n=!0),e.ended||e.reading?u("reading or ended",n=!1):n&&(u("do read"),e.reading=!0,e.sync=!0,0===e.length&&(e.needReadable=!0),this._read(e.highWaterMark),e.sync=!1,e.reading||(t=T(r,e))),null===(i=t>0?N(t,e):null)?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.awaitDrain=0),0===e.length&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&q(this)),null!==i&&this.emit("data",i),i},E.prototype._read=function(t){M(this,new w("_read()"))},E.prototype.pipe=function(t,e){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=t;break;case 1:n.pipes=[n.pipes,t];break;default:n.pipes.push(t)}n.pipesCount+=1,u("pipe count=%d opts=%j",n.pipesCount,e);var s=(!e||!1!==e.end)&&t!==i.stdout&&t!==i.stderr?h:v;function a(e,i){u("onunpipe"),e===r&&i&&!1===i.hasUnpiped&&(i.hasUnpiped=!0,function o(){u("cleanup"),t.removeListener("close",m),t.removeListener("finish",g),t.removeListener("drain",f),t.removeListener("error",p),t.removeListener("unpipe",a),r.removeListener("end",h),r.removeListener("end",v),r.removeListener("data",d),l=!0,!n.awaitDrain||t._writableState&&!t._writableState.needDrain||f()}())}function h(){u("onend"),t.end()}n.endEmitted?i.nextTick(s):r.once("end",s),t.on("unpipe",a);var f=function c(t){return function e(){var r=t._readableState;u("pipeOnDrain",r.awaitDrain),r.awaitDrain&&r.awaitDrain--,0===r.awaitDrain&&o(t,"data")&&(r.flowing=!0,U(t))}}(r);t.on("drain",f);var l=!1;function d(e){u("ondata");var i=t.write(e);u("dest.write",i),!1===i&&((1===n.pipesCount&&n.pipes===t||n.pipesCount>1&&-1!==z(n.pipes,t))&&!l&&(u("false write response, pause",n.awaitDrain),n.awaitDrain++),r.pause())}function p(e){u("onerror",e),v(),t.removeListener("error",p),0===o(t,"error")&&M(t,e)}function m(){t.removeListener("finish",g),v()}function g(){u("onfinish"),t.removeListener("close",m),v()}function v(){u("unpipe"),r.unpipe(t)}return r.on("data",d),function b(t,e,r){if("function"==typeof t.prependListener)return t.prependListener(e,r);t._events&&t._events[e]?Array.isArray(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]]:t.on(e,r)}(t,"error",p),t.once("close",m),t.once("finish",g),t.emit("pipe",r),n.flowing||(u("pipe resume"),r.resume()),t},E.prototype.unpipe=function(t){var e=this._readableState,r={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes||(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,r)),this;if(!t){var i=e.pipes,n=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var o=0;o<n;o++)i[o].emit("unpipe",this,{hasUnpiped:!1});return this}var s=z(e.pipes,t);return-1===s||(e.pipes.splice(s,1),e.pipesCount-=1,1===e.pipesCount&&(e.pipes=e.pipes[0]),t.emit("unpipe",this,r)),this},E.prototype.on=function(t,e){var r=s.prototype.on.call(this,t,e),n=this._readableState;return"data"===t?(n.readableListening=this.listenerCount("readable")>0,!1!==n.flowing&&this.resume()):"readable"===t&&(n.endEmitted||n.readableListening||(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,u("on readable",n.length,n.reading),n.length?P(this):n.reading||i.nextTick(j,this))),r},E.prototype.addListener=E.prototype.on,E.prototype.removeListener=function(t,e){var r=s.prototype.removeListener.call(this,t,e);return"readable"===t&&i.nextTick(B,this),r},E.prototype.removeAllListeners=function(t){var e=s.prototype.removeAllListeners.apply(this,arguments);return"readable"!==t&&void 0!==t||i.nextTick(B,this),e},E.prototype.resume=function(){var t=this._readableState;return t.flowing||(u("resume"),t.flowing=!t.readableListening,function e(t,r){r.resumeScheduled||(r.resumeScheduled=!0,i.nextTick(C,t,r))}(this,t)),t.paused=!1,this},E.prototype.pause=function(){return u("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(u("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},E.prototype.wrap=function(t){var e=this,r=this._readableState,i=!1;for(var n in t.on("end",(function(){if(u("wrapped end"),r.decoder&&!r.ended){var t=r.decoder.end();t&&t.length&&e.push(t)}e.push(null)})),t.on("data",(function(n){(u("wrapped data"),r.decoder&&(n=r.decoder.write(n)),r.objectMode&&null==n)||(r.objectMode||n&&n.length)&&(e.push(n)||(i=!0,t.pause()))})),t)void 0===this[n]&&"function"==typeof t[n]&&(this[n]=function e(r){return function e(){return t[r].apply(t,arguments)}}(n));for(var o=0;o<S.length;o++)t.on(S[o],this.emit.bind(this,S[o]));return this._read=function(e){u("wrapped _read",e),i&&(i=!1,t.resume())},this},"function"==typeof Symbol&&(E.prototype[Symbol.asyncIterator]=function(){return void 0===l&&(l=r(334)),l(this)}),Object.defineProperty(E.prototype,"readableHighWaterMark",{enumerable:!1,get:function t(){return this._readableState.highWaterMark}}),Object.defineProperty(E.prototype,"readableBuffer",{enumerable:!1,get:function t(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(E.prototype,"readableFlowing",{enumerable:!1,get:function t(){return this._readableState.flowing},set:function t(e){this._readableState&&(this._readableState.flowing=e)}}),E._fromList=N,Object.defineProperty(E.prototype,"readableLength",{enumerable:!1,get:function t(){return this._readableState.length}}),"function"==typeof Symbol&&(E.from=function(t,e){return void 0===d&&(d=r(335)),d(E,t,e)})}).call(this,r(5),r(4))},function(t,e,r){t.exports=r(24).EventEmitter},function(t,e,r){"use strict";(function(e){function r(t,e){n(t,e),i(t)}function i(t){t._writableState&&!t._writableState.emitClose||t._readableState&&!t._readableState.emitClose||t.emit("close")}function n(t,e){t.emit("error",e)}t.exports={destroy:function o(t,s){var a=this,h=this._readableState&&this._readableState.destroyed,u=this._writableState&&this._writableState.destroyed;return h||u?(s?s(t):t&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,e.nextTick(n,this,t)):e.nextTick(n,this,t)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,(function(t){!s&&t?a._writableState?a._writableState.errorEmitted?e.nextTick(i,a):(a._writableState.errorEmitted=!0,e.nextTick(r,a,t)):e.nextTick(r,a,t):s?(e.nextTick(i,a),s(t)):e.nextTick(i,a)})),this)},undestroy:function s(){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.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function a(t,e){var r=t._readableState,i=t._writableState;r&&r.autoDestroy||i&&i.autoDestroy?t.destroy(e):t.emit("error",e)}}}).call(this,r(4))},function(t,e,r){"use strict";var i=r(36).codes.ERR_INVALID_OPT_VALUE;t.exports={getHighWaterMark:function n(t,e,r,o){var s=function a(t,e,r){return null!=t.highWaterMark?t.highWaterMark:e?t[r]:null}(e,o,r);if(null!=s){if(!isFinite(s)||Math.floor(s)!==s||s<0)throw new i(o?r:"highWaterMark",s);return Math.floor(s)}return t.objectMode?16:16384}}},function(t,e,r){"use strict";(function(e,i){function n(t){var e=this;this.next=null,this.entry=null,this.finish=function(){!function r(t,e,i){var n=t.entry;t.entry=null;for(;n;){var o=n.callback;e.pendingcb--,o(i),n=n.next}e.corkedRequestsFree.next=t}(e,t)}}var o;t.exports=E,E.WritableState=k;var s={deprecate:r(89)},a=r(177),h=r(7).Buffer,u=e.Uint8Array||function(){};var f,c=r(178),l=r(179).getHighWaterMark,d=r(36).codes,p=d.ERR_INVALID_ARG_TYPE,m=d.ERR_METHOD_NOT_IMPLEMENTED,g=d.ERR_MULTIPLE_CALLBACK,v=d.ERR_STREAM_CANNOT_PIPE,b=d.ERR_STREAM_DESTROYED,y=d.ERR_STREAM_NULL_VALUES,w=d.ERR_STREAM_WRITE_AFTER_END,_=d.ERR_UNKNOWN_ENCODING,M=c.errorOrDestroy;function S(){}function k(t,e,s){o=o||r(38),t=t||{},"boolean"!=typeof s&&(s=e instanceof o),this.objectMode=!!t.objectMode,s&&(this.objectMode=this.objectMode||!!t.writableObjectMode),this.highWaterMark=l(this,t,"writableHighWaterMark",s),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var a=!1===t.decodeStrings;this.decodeStrings=!a,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(t){!function r(t,e){var r=t._writableState,n=r.sync,o=r.writecb;if("function"!=typeof o)throw new g;if(function s(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}(r),e)!function a(t,e,r,n,o){--e.pendingcb,r?(i.nextTick(o,n),i.nextTick(I,t,e),t._writableState.errorEmitted=!0,M(t,n)):(o(n),t._writableState.errorEmitted=!0,M(t,n),I(t,e))}(t,r,n,e,o);else{var h=T(r)||t.destroyed;h||r.corked||r.bufferProcessing||!r.bufferedRequest||x(t,r),n?i.nextTick(A,t,r,h,o):A(t,r,h,o)}}(e,t)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new n(this)}function E(t){var e=this instanceof(o=o||r(38));if(!e&&!f.call(E,this))return new E(t);this._writableState=new k(t,this,e),this.writable=!0,t&&("function"==typeof t.write&&(this._write=t.write),"function"==typeof t.writev&&(this._writev=t.writev),"function"==typeof t.destroy&&(this._destroy=t.destroy),"function"==typeof t.final&&(this._final=t.final)),a.call(this)}function R(t,e,r,i,n,o,s){e.writelen=i,e.writecb=s,e.writing=!0,e.sync=!0,e.destroyed?e.onwrite(new b("write")):r?t._writev(n,e.onwrite):t._write(n,o,e.onwrite),e.sync=!1}function A(t,e,r,i){r||function n(t,e){0===e.length&&e.needDrain&&(e.needDrain=!1,t.emit("drain"))}(t,e),e.pendingcb--,i(),I(t,e)}function x(t,e){e.bufferProcessing=!0;var r=e.bufferedRequest;if(t._writev&&r&&r.next){var i=e.bufferedRequestCount,o=new Array(i),s=e.corkedRequestsFree;s.entry=r;for(var a=0,h=!0;r;)o[a]=r,r.isBuf||(h=!1),r=r.next,a+=1;o.allBuffers=h,R(t,e,!0,e.length,o,"",s.finish),e.pendingcb++,e.lastBufferedRequest=null,s.next?(e.corkedRequestsFree=s.next,s.next=null):e.corkedRequestsFree=new n(e),e.bufferedRequestCount=0}else{for(;r;){var u=r.chunk,f=r.encoding,c=r.callback;if(R(t,e,!1,e.objectMode?1:u.length,u,f,c),r=r.next,e.bufferedRequestCount--,e.writing)break}null===r&&(e.lastBufferedRequest=null)}e.bufferedRequest=r,e.bufferProcessing=!1}function T(t){return t.ending&&0===t.length&&null===t.bufferedRequest&&!t.finished&&!t.writing}function P(t,e){t._final((function(r){e.pendingcb--,r&&M(t,r),e.prefinished=!0,t.emit("prefinish"),I(t,e)}))}function I(t,e){var r=T(e);if(r&&(function n(t,e){e.prefinished||e.finalCalled||("function"!=typeof t._final||e.destroyed?(e.prefinished=!0,t.emit("prefinish")):(e.pendingcb++,e.finalCalled=!0,i.nextTick(P,t,e)))}(t,e),0===e.pendingcb&&(e.finished=!0,t.emit("finish"),e.autoDestroy))){var o=t._readableState;(!o||o.autoDestroy&&o.endEmitted)&&t.destroy()}return r}r(37)(E,a),k.prototype.getBuffer=function t(){for(var e=this.bufferedRequest,r=[];e;)r.push(e),e=e.next;return r},function(){try{Object.defineProperty(k.prototype,"buffer",{get:s.deprecate((function t(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(t){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(f=Function.prototype[Symbol.hasInstance],Object.defineProperty(E,Symbol.hasInstance,{value:function t(e){return!!f.call(this,e)||this===E&&(e&&e._writableState instanceof k)}})):f=function t(e){return e instanceof this},E.prototype.pipe=function(){M(this,new v)},E.prototype.write=function(t,e,r){var n=this._writableState,o=!1,s=!n.objectMode&&function a(t){return h.isBuffer(t)||t instanceof u}(t);return s&&!h.isBuffer(t)&&(t=function f(t){return h.from(t)}(t)),"function"==typeof e&&(r=e,e=null),s?e="buffer":e||(e=n.defaultEncoding),"function"!=typeof r&&(r=S),n.ending?function c(t,e){var r=new w;M(t,r),i.nextTick(e,r)}(this,r):(s||function l(t,e,r,n){var o;return null===r?o=new y:"string"==typeof r||e.objectMode||(o=new p("chunk",["string","Buffer"],r)),!o||(M(t,o),i.nextTick(n,o),!1)}(this,n,t,r))&&(n.pendingcb++,o=function d(t,e,r,i,n,o){if(!r){var s=function a(t,e,r){t.objectMode||!1===t.decodeStrings||"string"!=typeof e||(e=h.from(e,r));return e}(e,i,n);i!==s&&(r=!0,n="buffer",i=s)}var u=e.objectMode?1:i.length;e.length+=u;var f=e.length<e.highWaterMark;f||(e.needDrain=!0);if(e.writing||e.corked){var c=e.lastBufferedRequest;e.lastBufferedRequest={chunk:i,encoding:n,isBuf:r,callback:o,next:null},c?c.next=e.lastBufferedRequest:e.bufferedRequest=e.lastBufferedRequest,e.bufferedRequestCount+=1}else R(t,e,!1,u,i,n,o);return f}(this,n,s,t,e,r)),o},E.prototype.cork=function(){this._writableState.corked++},E.prototype.uncork=function(){var t=this._writableState;t.corked&&(t.corked--,t.writing||t.corked||t.bufferProcessing||!t.bufferedRequest||x(this,t))},E.prototype.setDefaultEncoding=function t(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 _(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(E.prototype,"writableBuffer",{enumerable:!1,get:function t(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(E.prototype,"writableHighWaterMark",{enumerable:!1,get:function t(){return this._writableState.highWaterMark}}),E.prototype._write=function(t,e,r){r(new m("_write()"))},E.prototype._writev=null,E.prototype.end=function(t,e,r){var n=this._writableState;return"function"==typeof t?(r=t,t=null,e=null):"function"==typeof e&&(r=e,e=null),null!=t&&this.write(t,e),n.corked&&(n.corked=1,this.uncork()),n.ending||function o(t,e,r){e.ending=!0,I(t,e),r&&(e.finished?i.nextTick(r):t.once("finish",r));e.ended=!0,t.writable=!1}(this,n,r),this},Object.defineProperty(E.prototype,"writableLength",{enumerable:!1,get:function t(){return this._writableState.length}}),Object.defineProperty(E.prototype,"destroyed",{enumerable:!1,get:function t(){return void 0!==this._writableState&&this._writableState.destroyed},set:function t(e){this._writableState&&(this._writableState.destroyed=e)}}),E.prototype.destroy=c.destroy,E.prototype._undestroy=c.undestroy,E.prototype._destroy=function(t,e){e(t)}}).call(this,r(5),r(4))},function(t,e,r){"use strict";t.exports=f;var i=r(36).codes,n=i.ERR_METHOD_NOT_IMPLEMENTED,o=i.ERR_MULTIPLE_CALLBACK,s=i.ERR_TRANSFORM_ALREADY_TRANSFORMING,a=i.ERR_TRANSFORM_WITH_LENGTH_0,h=r(38);function u(t,e){var r=this._transformState;r.transforming=!1;var i=r.writecb;if(null===i)return this.emit("error",new o);r.writechunk=null,r.writecb=null,null!=e&&this.push(e),i(t);var n=this._readableState;n.reading=!1,(n.needReadable||n.length<n.highWaterMark)&&this._read(n.highWaterMark)}function f(t){if(!(this instanceof f))return new f(t);h.call(this,t),this._transformState={afterTransform:u.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,t&&("function"==typeof t.transform&&(this._transform=t.transform),"function"==typeof t.flush&&(this._flush=t.flush)),this.on("prefinish",c)}function c(){var t=this;"function"!=typeof this._flush||this._readableState.destroyed?l(this,null,null):this._flush((function(e,r){l(t,e,r)}))}function l(t,e,r){if(e)return t.emit("error",e);if(null!=r&&t.push(r),t._writableState.length)throw new a;if(t._transformState.transforming)throw new s;return t.push(null)}r(37)(f,h),f.prototype.push=function(t,e){return this._transformState.needTransform=!1,h.prototype.push.call(this,t,e)},f.prototype._transform=function(t,e,r){r(new n("_transform()"))},f.prototype._write=function(t,e,r){var i=this._transformState;if(i.writecb=r,i.writechunk=t,i.writeencoding=e,!i.transforming){var n=this._readableState;(i.needTransform||n.needReadable||n.length<n.highWaterMark)&&this._read(n.highWaterMark)}},f.prototype._read=function(t){var e=this._transformState;null===e.writechunk||e.transforming?e.needTransform=!0:(e.transforming=!0,this._transform(e.writechunk,e.writeencoding,e.afterTransform))},f.prototype._destroy=function(t,e){h.prototype._destroy.call(this,t,(function(t){e(t)}))}},function(t,e,r){"use strict";var i=e;function n(t){return 1===t.length?"0"+t:t}function o(t){for(var e="",r=0;r<t.length;r++)e+=n(t[r].toString(16));return e}i.toArray=function s(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var r=[];if("string"!=typeof t){for(var i=0;i<t.length;i++)r[i]=0|t[i];return r}if("hex"===e){(t=t.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(t="0"+t);for(i=0;i<t.length;i+=2)r.push(parseInt(t[i]+t[i+1],16))}else for(i=0;i<t.length;i++){var n=t.charCodeAt(i),o=n>>8,s=255&n;o?r.push(o,s):r.push(s)}return r},i.zero2=n,i.toHex=o,i.encode=function t(e,r){return"hex"===r?o(e):e}},function(t,e,r){"use strict";var i=e;i.base=r(64),i.short=r(342),i.mont=r(343),i.edwards=r(344)},function(t,e,r){"use strict";var i=r(13).rotr32;function n(t,e,r){return t&e^~t&r}function o(t,e,r){return t&e^t&r^e&r}function s(t,e,r){return t^e^r}e.ft_1=function a(t,e,r,i){return 0===t?n(e,r,i):1===t||3===t?s(e,r,i):2===t?o(e,r,i):void 0},e.ch32=n,e.maj32=o,e.p32=s,e.s0_256=function h(t){return i(t,2)^i(t,13)^i(t,22)},e.s1_256=function u(t){return i(t,6)^i(t,11)^i(t,25)},e.g0_256=function f(t){return i(t,7)^i(t,18)^t>>>3},e.g1_256=function c(t){return i(t,17)^i(t,19)^t>>>10}},function(t,e,r){"use strict";var i=r(13),n=r(46),o=r(184),s=r(10),a=i.sum32,h=i.sum32_4,u=i.sum32_5,f=o.ch32,c=o.maj32,l=o.s0_256,d=o.s1_256,p=o.g0_256,m=o.g1_256,g=n.BlockHash,v=[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 b(){if(!(this instanceof b))return new b;g.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=v,this.W=new Array(64)}i.inherits(b,g),t.exports=b,b.blockSize=512,b.outSize=256,b.hmacStrength=192,b.padLength=64,b.prototype._update=function t(e,r){for(var i=this.W,n=0;n<16;n++)i[n]=e[r+n];for(;n<i.length;n++)i[n]=h(m(i[n-2]),i[n-7],p(i[n-15]),i[n-16]);var o=this.h[0],g=this.h[1],v=this.h[2],b=this.h[3],y=this.h[4],w=this.h[5],_=this.h[6],M=this.h[7];for(s(this.k.length===i.length),n=0;n<i.length;n++){var S=u(M,d(y),f(y,w,_),this.k[n],i[n]),k=a(l(o),c(o,g,v));M=_,_=w,w=y,y=a(b,S),b=v,v=g,g=o,o=a(S,k)}this.h[0]=a(this.h[0],o),this.h[1]=a(this.h[1],g),this.h[2]=a(this.h[2],v),this.h[3]=a(this.h[3],b),this.h[4]=a(this.h[4],y),this.h[5]=a(this.h[5],w),this.h[6]=a(this.h[6],_),this.h[7]=a(this.h[7],M)},b.prototype._digest=function t(e){return"hex"===e?i.toHex32(this.h,"big"):i.split32(this.h,"big")}},function(t,e,r){"use strict";var i=r(13),n=r(46),o=r(10),s=i.rotr64_hi,a=i.rotr64_lo,h=i.shr64_hi,u=i.shr64_lo,f=i.sum64,c=i.sum64_hi,l=i.sum64_lo,d=i.sum64_4_hi,p=i.sum64_4_lo,m=i.sum64_5_hi,g=i.sum64_5_lo,v=n.BlockHash,b=[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 y(){if(!(this instanceof y))return new y;v.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=b,this.W=new Array(160)}function w(t,e,r,i,n){var o=t&r^~t&n;return o<0&&(o+=4294967296),o}function _(t,e,r,i,n,o){var s=e&i^~e&o;return s<0&&(s+=4294967296),s}function M(t,e,r,i,n){var o=t&r^t&n^r&n;return o<0&&(o+=4294967296),o}function S(t,e,r,i,n,o){var s=e&i^e&o^i&o;return s<0&&(s+=4294967296),s}function k(t,e){var r=s(t,e,28)^s(e,t,2)^s(e,t,7);return r<0&&(r+=4294967296),r}function E(t,e){var r=a(t,e,28)^a(e,t,2)^a(e,t,7);return r<0&&(r+=4294967296),r}function R(t,e){var r=s(t,e,14)^s(t,e,18)^s(e,t,9);return r<0&&(r+=4294967296),r}function A(t,e){var r=a(t,e,14)^a(t,e,18)^a(e,t,9);return r<0&&(r+=4294967296),r}function x(t,e){var r=s(t,e,1)^s(t,e,8)^h(t,e,7);return r<0&&(r+=4294967296),r}function T(t,e){var r=a(t,e,1)^a(t,e,8)^u(t,e,7);return r<0&&(r+=4294967296),r}function P(t,e){var r=s(t,e,19)^s(e,t,29)^h(t,e,6);return r<0&&(r+=4294967296),r}function I(t,e){var r=a(t,e,19)^a(e,t,29)^u(t,e,6);return r<0&&(r+=4294967296),r}i.inherits(y,v),t.exports=y,y.blockSize=1024,y.outSize=512,y.hmacStrength=192,y.padLength=128,y.prototype._prepareBlock=function t(e,r){for(var i=this.W,n=0;n<32;n++)i[n]=e[r+n];for(;n<i.length;n+=2){var o=P(i[n-4],i[n-3]),s=I(i[n-4],i[n-3]),a=i[n-14],h=i[n-13],u=x(i[n-30],i[n-29]),f=T(i[n-30],i[n-29]),c=i[n-32],l=i[n-31];i[n]=d(o,s,a,h,u,f,c,l),i[n+1]=p(o,s,a,h,u,f,c,l)}},y.prototype._update=function t(e,r){this._prepareBlock(e,r);var i=this.W,n=this.h[0],s=this.h[1],a=this.h[2],h=this.h[3],u=this.h[4],d=this.h[5],p=this.h[6],v=this.h[7],b=this.h[8],y=this.h[9],x=this.h[10],T=this.h[11],P=this.h[12],I=this.h[13],L=this.h[14],O=this.h[15];o(this.k.length===i.length);for(var B=0;B<i.length;B+=2){var j=L,C=O,U=R(b,y),N=A(b,y),q=w(b,y,x,T,P),D=_(b,y,x,T,P,I),z=this.k[B],F=this.k[B+1],W=i[B],H=i[B+1],K=m(j,C,U,N,q,D,z,F,W,H),Z=g(j,C,U,N,q,D,z,F,W,H);j=k(n,s),C=E(n,s),U=M(n,s,a,h,u),N=S(n,s,a,h,u,d);var V=c(j,C,U,N),J=l(j,C,U,N);L=P,O=I,P=x,I=T,x=b,T=y,b=c(p,v,K,Z),y=l(v,v,K,Z),p=u,v=d,u=a,d=h,a=n,h=s,n=c(K,Z,V,J),s=l(K,Z,V,J)}f(this.h,0,n,s),f(this.h,2,a,h),f(this.h,4,u,d),f(this.h,6,p,v),f(this.h,8,b,y),f(this.h,10,x,T),f(this.h,12,P,I),f(this.h,14,L,O)},y.prototype._digest=function t(e){return"hex"===e?i.toHex32(this.h,"big"):i.split32(this.h,"big")}},function(t,e,r){"use strict";const i=e;i.bignum=r(188),i.define=r(361).define,i.base=r(364),i.constants=r(365),i.decoders=r(191),i.encoders=r(189)},function(t,e,r){(function(t){!function(t,e){"use strict";function i(t,e){if(!t)throw new Error(e||"Assertion failed")}function n(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function o(t,e,r){if(o.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var s;"object"==typeof t?t.exports=o:e.BN=o,o.BN=o,o.wordSize=26;try{s=r(360).Buffer}catch(t){}function a(t,e,r){for(var i=0,n=Math.min(t.length,r),o=e;o<n;o++){var s=t.charCodeAt(o)-48;i<<=4,i|=s>=49&&s<=54?s-49+10:s>=17&&s<=22?s-17+10:15&s}return i}function h(t,e,r,i){for(var n=0,o=Math.min(t.length,r),s=e;s<o;s++){var a=t.charCodeAt(s)-48;n*=i,n+=a>=49?a-49+10:a>=17?a-17+10:a}return n}o.isBN=function t(e){return e instanceof o||null!==e&&"object"==typeof e&&e.constructor.wordSize===o.wordSize&&Array.isArray(e.words)},o.max=function t(e,r){return e.cmp(r)>0?e:r},o.min=function t(e,r){return e.cmp(r)<0?e:r},o.prototype._init=function t(e,r,n){if("number"==typeof e)return this._initNumber(e,r,n);if("object"==typeof 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)},o.prototype._initNumber=function t(e,r,n){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"===n&&this._initArray(this.toArray(),r,n)},o.prototype._initArray=function t(e,r,n){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 o=0;o<this.length;o++)this.words[o]=0;var s,a,h=0;if("be"===n)for(o=e.length-1,s=0;o>=0;o-=3)a=e[o]|e[o-1]<<8|e[o-2]<<16,this.words[s]|=a<<h&67108863,this.words[s+1]=a>>>26-h&67108863,(h+=24)>=26&&(h-=26,s++);else if("le"===n)for(o=0,s=0;o<e.length;o+=3)a=e[o]|e[o+1]<<8|e[o+2]<<16,this.words[s]|=a<<h&67108863,this.words[s+1]=a>>>26-h&67108863,(h+=24)>=26&&(h-=26,s++);return this.strip()},o.prototype._parseHex=function t(e,r){this.length=Math.ceil((e.length-r)/6),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var n,o,s=0;for(i=e.length-6,n=0;i>=r;i-=6)o=a(e,i,i+6),this.words[n]|=o<<s&67108863,this.words[n+1]|=o>>>26-s&4194303,(s+=24)>=26&&(s-=26,n++);i+6!==r&&(o=a(e,r,i+6),this.words[n]|=o<<s&67108863,this.words[n+1]|=o>>>26-s&4194303),this.strip()},o.prototype._parseBase=function t(e,r,i){this.words=[0],this.length=1;for(var n=0,o=1;o<=67108863;o*=r)n++;n--,o=o/r|0;for(var s=e.length-i,a=s%n,u=Math.min(s,s-a)+i,f=0,c=i;c<u;c+=n)f=h(e,c,c+n,r),this.imuln(o),this.words[0]+f<67108864?this.words[0]+=f:this._iaddn(f);if(0!==a){var l=1;for(f=h(e,c,e.length,r),c=0;c<a;c++)l*=r;this.imuln(l),this.words[0]+f<67108864?this.words[0]+=f:this._iaddn(f)}},o.prototype.copy=function t(e){e.words=new Array(this.length);for(var r=0;r<this.length;r++)e.words[r]=this.words[r];e.length=this.length,e.negative=this.negative,e.red=this.red},o.prototype.clone=function t(){var e=new o(null);return this.copy(e),e},o.prototype._expand=function t(e){for(;this.length<e;)this.words[this.length++]=0;return this},o.prototype.strip=function t(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function t(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function t(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var u=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],f=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],c=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function l(t,e,r){r.negative=e.negative^t.negative;var i=t.length+e.length|0;r.length=i,i=i-1|0;var n=0|t.words[0],o=0|e.words[0],s=n*o,a=67108863&s,h=s/67108864|0;r.words[0]=a;for(var u=1;u<i;u++){for(var f=h>>>26,c=67108863&h,l=Math.min(u,e.length-1),d=Math.max(0,u-t.length+1);d<=l;d++){var p=u-d|0;f+=(s=(n=0|t.words[p])*(o=0|e.words[d])+c)/67108864|0,c=67108863&s}r.words[u]=0|c,h=0|f}return 0!==h?r.words[u]=0|h:r.length--,r.strip()}o.prototype.toString=function t(e,r){var n;if(r=0|r||1,16===(e=e||10)||"hex"===e){n="";for(var o=0,s=0,a=0;a<this.length;a++){var h=this.words[a],l=(16777215&(h<<o|s)).toString(16);n=0!==(s=h>>>24-o&16777215)||a!==this.length-1?u[6-l.length]+l+n:l+n,(o+=2)>=26&&(o-=26,a--)}for(0!==s&&(n=s.toString(16)+n);n.length%r!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}if(e===(0|e)&&e>=2&&e<=36){var d=f[e],p=c[e];n="";var m=this.clone();for(m.negative=0;!m.isZero();){var g=m.modn(p).toString(e);n=(m=m.idivn(p)).isZero()?g+n:u[d-g.length]+g+n}for(this.isZero()&&(n="0"+n);n.length%r!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}i(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function t(){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},o.prototype.toJSON=function t(){return this.toString(16)},o.prototype.toBuffer=function t(e,r){return i(void 0!==s),this.toArrayLike(s,e,r)},o.prototype.toArray=function t(e,r){return this.toArrayLike(Array,e,r)},o.prototype.toArrayLike=function t(e,r,n){var o=this.byteLength(),s=n||Math.max(1,o);i(o<=s,"byte array longer than desired length"),i(s>0,"Requested array length <= 0"),this.strip();var a,h,u="le"===r,f=new e(s),c=this.clone();if(u){for(h=0;!c.isZero();h++)a=c.andln(255),c.iushrn(8),f[h]=a;for(;h<s;h++)f[h]=0}else{for(h=0;h<s-o;h++)f[h]=0;for(h=0;!c.isZero();h++)a=c.andln(255),c.iushrn(8),f[s-h-1]=a}return f},Math.clz32?o.prototype._countBits=function t(e){return 32-Math.clz32(e)}:o.prototype._countBits=function t(e){var r=e,i=0;return r>=4096&&(i+=13,r>>>=13),r>=64&&(i+=7,r>>>=7),r>=8&&(i+=4,r>>>=4),r>=2&&(i+=2,r>>>=2),i+r},o.prototype._zeroBits=function t(e){if(0===e)return 26;var r=e,i=0;return 0==(8191&r)&&(i+=13,r>>>=13),0==(127&r)&&(i+=7,r>>>=7),0==(15&r)&&(i+=4,r>>>=4),0==(3&r)&&(i+=2,r>>>=2),0==(1&r)&&i++,i},o.prototype.bitLength=function t(){var e=this.words[this.length-1],r=this._countBits(e);return 26*(this.length-1)+r},o.prototype.zeroBits=function t(){if(this.isZero())return 0;for(var e=0,r=0;r<this.length;r++){var i=this._zeroBits(this.words[r]);if(e+=i,26!==i)break}return e},o.prototype.byteLength=function t(){return Math.ceil(this.bitLength()/8)},o.prototype.toTwos=function t(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},o.prototype.fromTwos=function t(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},o.prototype.isNeg=function t(){return 0!==this.negative},o.prototype.neg=function t(){return this.clone().ineg()},o.prototype.ineg=function t(){return this.isZero()||(this.negative^=1),this},o.prototype.iuor=function t(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var r=0;r<e.length;r++)this.words[r]=this.words[r]|e.words[r];return this.strip()},o.prototype.ior=function t(e){return i(0==(this.negative|e.negative)),this.iuor(e)},o.prototype.or=function t(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},o.prototype.uor=function t(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},o.prototype.iuand=function t(e){var r;r=this.length>e.length?e:this;for(var i=0;i<r.length;i++)this.words[i]=this.words[i]&e.words[i];return this.length=r.length,this.strip()},o.prototype.iand=function t(e){return i(0==(this.negative|e.negative)),this.iuand(e)},o.prototype.and=function t(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},o.prototype.uand=function t(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},o.prototype.iuxor=function t(e){var r,i;this.length>e.length?(r=this,i=e):(r=e,i=this);for(var n=0;n<i.length;n++)this.words[n]=r.words[n]^i.words[n];if(this!==r)for(;n<r.length;n++)this.words[n]=r.words[n];return this.length=r.length,this.strip()},o.prototype.ixor=function t(e){return i(0==(this.negative|e.negative)),this.iuxor(e)},o.prototype.xor=function t(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},o.prototype.uxor=function t(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},o.prototype.inotn=function t(e){i("number"==typeof e&&e>=0);var r=0|Math.ceil(e/26),n=e%26;this._expand(r),n>0&&r--;for(var o=0;o<r;o++)this.words[o]=67108863&~this.words[o];return n>0&&(this.words[o]=~this.words[o]&67108863>>26-n),this.strip()},o.prototype.notn=function t(e){return this.clone().inotn(e)},o.prototype.setn=function t(e,r){i("number"==typeof e&&e>=0);var n=e/26|0,o=e%26;return this._expand(n+1),this.words[n]=r?this.words[n]|1<<o:this.words[n]&~(1<<o),this.strip()},o.prototype.iadd=function t(e){var r,i,n;if(0!==this.negative&&0===e.negative)return this.negative=0,r=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,r=this.isub(e),e.negative=1,r._normSign();this.length>e.length?(i=this,n=e):(i=e,n=this);for(var o=0,s=0;s<n.length;s++)r=(0|i.words[s])+(0|n.words[s])+o,this.words[s]=67108863&r,o=r>>>26;for(;0!==o&&s<i.length;s++)r=(0|i.words[s])+o,this.words[s]=67108863&r,o=r>>>26;if(this.length=i.length,0!==o)this.words[this.length]=o,this.length++;else if(i!==this)for(;s<i.length;s++)this.words[s]=i.words[s];return this},o.prototype.add=function t(e){var r;return 0!==e.negative&&0===this.negative?(e.negative=0,r=this.sub(e),e.negative^=1,r):0===e.negative&&0!==this.negative?(this.negative=0,r=e.sub(this),this.negative=1,r):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},o.prototype.isub=function t(e){if(0!==e.negative){e.negative=0;var r=this.iadd(e);return e.negative=1,r._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var i,n,o=this.cmp(e);if(0===o)return this.negative=0,this.length=1,this.words[0]=0,this;o>0?(i=this,n=e):(i=e,n=this);for(var s=0,a=0;a<n.length;a++)s=(r=(0|i.words[a])-(0|n.words[a])+s)>>26,this.words[a]=67108863&r;for(;0!==s&&a<i.length;a++)s=(r=(0|i.words[a])+s)>>26,this.words[a]=67108863&r;if(0===s&&a<i.length&&i!==this)for(;a<i.length;a++)this.words[a]=i.words[a];return this.length=Math.max(this.length,a),i!==this&&(this.negative=1),this.strip()},o.prototype.sub=function t(e){return this.clone().isub(e)};var d=function t(e,r,i){var n,o,s,a=e.words,h=r.words,u=i.words,f=0,c=0|a[0],l=8191&c,d=c>>>13,p=0|a[1],m=8191&p,g=p>>>13,v=0|a[2],b=8191&v,y=v>>>13,w=0|a[3],_=8191&w,M=w>>>13,S=0|a[4],k=8191&S,E=S>>>13,R=0|a[5],A=8191&R,x=R>>>13,T=0|a[6],P=8191&T,I=T>>>13,L=0|a[7],O=8191&L,B=L>>>13,j=0|a[8],C=8191&j,U=j>>>13,N=0|a[9],q=8191&N,D=N>>>13,z=0|h[0],F=8191&z,W=z>>>13,H=0|h[1],K=8191&H,Z=H>>>13,V=0|h[2],J=8191&V,Y=V>>>13,G=0|h[3],X=8191&G,Q=G>>>13,$=0|h[4],tt=8191&$,et=$>>>13,rt=0|h[5],it=8191&rt,nt=rt>>>13,ot=0|h[6],st=8191&ot,at=ot>>>13,ht=0|h[7],ut=8191&ht,ft=ht>>>13,ct=0|h[8],lt=8191&ct,dt=ct>>>13,pt=0|h[9],mt=8191&pt,gt=pt>>>13;i.negative=e.negative^r.negative,i.length=19;var vt=(f+(n=Math.imul(l,F))|0)+((8191&(o=(o=Math.imul(l,W))+Math.imul(d,F)|0))<<13)|0;f=((s=Math.imul(d,W))+(o>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(m,F),o=(o=Math.imul(m,W))+Math.imul(g,F)|0,s=Math.imul(g,W);var bt=(f+(n=n+Math.imul(l,K)|0)|0)+((8191&(o=(o=o+Math.imul(l,Z)|0)+Math.imul(d,K)|0))<<13)|0;f=((s=s+Math.imul(d,Z)|0)+(o>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(b,F),o=(o=Math.imul(b,W))+Math.imul(y,F)|0,s=Math.imul(y,W),n=n+Math.imul(m,K)|0,o=(o=o+Math.imul(m,Z)|0)+Math.imul(g,K)|0,s=s+Math.imul(g,Z)|0;var yt=(f+(n=n+Math.imul(l,J)|0)|0)+((8191&(o=(o=o+Math.imul(l,Y)|0)+Math.imul(d,J)|0))<<13)|0;f=((s=s+Math.imul(d,Y)|0)+(o>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(_,F),o=(o=Math.imul(_,W))+Math.imul(M,F)|0,s=Math.imul(M,W),n=n+Math.imul(b,K)|0,o=(o=o+Math.imul(b,Z)|0)+Math.imul(y,K)|0,s=s+Math.imul(y,Z)|0,n=n+Math.imul(m,J)|0,o=(o=o+Math.imul(m,Y)|0)+Math.imul(g,J)|0,s=s+Math.imul(g,Y)|0;var wt=(f+(n=n+Math.imul(l,X)|0)|0)+((8191&(o=(o=o+Math.imul(l,Q)|0)+Math.imul(d,X)|0))<<13)|0;f=((s=s+Math.imul(d,Q)|0)+(o>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(k,F),o=(o=Math.imul(k,W))+Math.imul(E,F)|0,s=Math.imul(E,W),n=n+Math.imul(_,K)|0,o=(o=o+Math.imul(_,Z)|0)+Math.imul(M,K)|0,s=s+Math.imul(M,Z)|0,n=n+Math.imul(b,J)|0,o=(o=o+Math.imul(b,Y)|0)+Math.imul(y,J)|0,s=s+Math.imul(y,Y)|0,n=n+Math.imul(m,X)|0,o=(o=o+Math.imul(m,Q)|0)+Math.imul(g,X)|0,s=s+Math.imul(g,Q)|0;var _t=(f+(n=n+Math.imul(l,tt)|0)|0)+((8191&(o=(o=o+Math.imul(l,et)|0)+Math.imul(d,tt)|0))<<13)|0;f=((s=s+Math.imul(d,et)|0)+(o>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(A,F),o=(o=Math.imul(A,W))+Math.imul(x,F)|0,s=Math.imul(x,W),n=n+Math.imul(k,K)|0,o=(o=o+Math.imul(k,Z)|0)+Math.imul(E,K)|0,s=s+Math.imul(E,Z)|0,n=n+Math.imul(_,J)|0,o=(o=o+Math.imul(_,Y)|0)+Math.imul(M,J)|0,s=s+Math.imul(M,Y)|0,n=n+Math.imul(b,X)|0,o=(o=o+Math.imul(b,Q)|0)+Math.imul(y,X)|0,s=s+Math.imul(y,Q)|0,n=n+Math.imul(m,tt)|0,o=(o=o+Math.imul(m,et)|0)+Math.imul(g,tt)|0,s=s+Math.imul(g,et)|0;var Mt=(f+(n=n+Math.imul(l,it)|0)|0)+((8191&(o=(o=o+Math.imul(l,nt)|0)+Math.imul(d,it)|0))<<13)|0;f=((s=s+Math.imul(d,nt)|0)+(o>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(P,F),o=(o=Math.imul(P,W))+Math.imul(I,F)|0,s=Math.imul(I,W),n=n+Math.imul(A,K)|0,o=(o=o+Math.imul(A,Z)|0)+Math.imul(x,K)|0,s=s+Math.imul(x,Z)|0,n=n+Math.imul(k,J)|0,o=(o=o+Math.imul(k,Y)|0)+Math.imul(E,J)|0,s=s+Math.imul(E,Y)|0,n=n+Math.imul(_,X)|0,o=(o=o+Math.imul(_,Q)|0)+Math.imul(M,X)|0,s=s+Math.imul(M,Q)|0,n=n+Math.imul(b,tt)|0,o=(o=o+Math.imul(b,et)|0)+Math.imul(y,tt)|0,s=s+Math.imul(y,et)|0,n=n+Math.imul(m,it)|0,o=(o=o+Math.imul(m,nt)|0)+Math.imul(g,it)|0,s=s+Math.imul(g,nt)|0;var St=(f+(n=n+Math.imul(l,st)|0)|0)+((8191&(o=(o=o+Math.imul(l,at)|0)+Math.imul(d,st)|0))<<13)|0;f=((s=s+Math.imul(d,at)|0)+(o>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(O,F),o=(o=Math.imul(O,W))+Math.imul(B,F)|0,s=Math.imul(B,W),n=n+Math.imul(P,K)|0,o=(o=o+Math.imul(P,Z)|0)+Math.imul(I,K)|0,s=s+Math.imul(I,Z)|0,n=n+Math.imul(A,J)|0,o=(o=o+Math.imul(A,Y)|0)+Math.imul(x,J)|0,s=s+Math.imul(x,Y)|0,n=n+Math.imul(k,X)|0,o=(o=o+Math.imul(k,Q)|0)+Math.imul(E,X)|0,s=s+Math.imul(E,Q)|0,n=n+Math.imul(_,tt)|0,o=(o=o+Math.imul(_,et)|0)+Math.imul(M,tt)|0,s=s+Math.imul(M,et)|0,n=n+Math.imul(b,it)|0,o=(o=o+Math.imul(b,nt)|0)+Math.imul(y,it)|0,s=s+Math.imul(y,nt)|0,n=n+Math.imul(m,st)|0,o=(o=o+Math.imul(m,at)|0)+Math.imul(g,st)|0,s=s+Math.imul(g,at)|0;var kt=(f+(n=n+Math.imul(l,ut)|0)|0)+((8191&(o=(o=o+Math.imul(l,ft)|0)+Math.imul(d,ut)|0))<<13)|0;f=((s=s+Math.imul(d,ft)|0)+(o>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(C,F),o=(o=Math.imul(C,W))+Math.imul(U,F)|0,s=Math.imul(U,W),n=n+Math.imul(O,K)|0,o=(o=o+Math.imul(O,Z)|0)+Math.imul(B,K)|0,s=s+Math.imul(B,Z)|0,n=n+Math.imul(P,J)|0,o=(o=o+Math.imul(P,Y)|0)+Math.imul(I,J)|0,s=s+Math.imul(I,Y)|0,n=n+Math.imul(A,X)|0,o=(o=o+Math.imul(A,Q)|0)+Math.imul(x,X)|0,s=s+Math.imul(x,Q)|0,n=n+Math.imul(k,tt)|0,o=(o=o+Math.imul(k,et)|0)+Math.imul(E,tt)|0,s=s+Math.imul(E,et)|0,n=n+Math.imul(_,it)|0,o=(o=o+Math.imul(_,nt)|0)+Math.imul(M,it)|0,s=s+Math.imul(M,nt)|0,n=n+Math.imul(b,st)|0,o=(o=o+Math.imul(b,at)|0)+Math.imul(y,st)|0,s=s+Math.imul(y,at)|0,n=n+Math.imul(m,ut)|0,o=(o=o+Math.imul(m,ft)|0)+Math.imul(g,ut)|0,s=s+Math.imul(g,ft)|0;var Et=(f+(n=n+Math.imul(l,lt)|0)|0)+((8191&(o=(o=o+Math.imul(l,dt)|0)+Math.imul(d,lt)|0))<<13)|0;f=((s=s+Math.imul(d,dt)|0)+(o>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(q,F),o=(o=Math.imul(q,W))+Math.imul(D,F)|0,s=Math.imul(D,W),n=n+Math.imul(C,K)|0,o=(o=o+Math.imul(C,Z)|0)+Math.imul(U,K)|0,s=s+Math.imul(U,Z)|0,n=n+Math.imul(O,J)|0,o=(o=o+Math.imul(O,Y)|0)+Math.imul(B,J)|0,s=s+Math.imul(B,Y)|0,n=n+Math.imul(P,X)|0,o=(o=o+Math.imul(P,Q)|0)+Math.imul(I,X)|0,s=s+Math.imul(I,Q)|0,n=n+Math.imul(A,tt)|0,o=(o=o+Math.imul(A,et)|0)+Math.imul(x,tt)|0,s=s+Math.imul(x,et)|0,n=n+Math.imul(k,it)|0,o=(o=o+Math.imul(k,nt)|0)+Math.imul(E,it)|0,s=s+Math.imul(E,nt)|0,n=n+Math.imul(_,st)|0,o=(o=o+Math.imul(_,at)|0)+Math.imul(M,st)|0,s=s+Math.imul(M,at)|0,n=n+Math.imul(b,ut)|0,o=(o=o+Math.imul(b,ft)|0)+Math.imul(y,ut)|0,s=s+Math.imul(y,ft)|0,n=n+Math.imul(m,lt)|0,o=(o=o+Math.imul(m,dt)|0)+Math.imul(g,lt)|0,s=s+Math.imul(g,dt)|0;var Rt=(f+(n=n+Math.imul(l,mt)|0)|0)+((8191&(o=(o=o+Math.imul(l,gt)|0)+Math.imul(d,mt)|0))<<13)|0;f=((s=s+Math.imul(d,gt)|0)+(o>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,n=Math.imul(q,K),o=(o=Math.imul(q,Z))+Math.imul(D,K)|0,s=Math.imul(D,Z),n=n+Math.imul(C,J)|0,o=(o=o+Math.imul(C,Y)|0)+Math.imul(U,J)|0,s=s+Math.imul(U,Y)|0,n=n+Math.imul(O,X)|0,o=(o=o+Math.imul(O,Q)|0)+Math.imul(B,X)|0,s=s+Math.imul(B,Q)|0,n=n+Math.imul(P,tt)|0,o=(o=o+Math.imul(P,et)|0)+Math.imul(I,tt)|0,s=s+Math.imul(I,et)|0,n=n+Math.imul(A,it)|0,o=(o=o+Math.imul(A,nt)|0)+Math.imul(x,it)|0,s=s+Math.imul(x,nt)|0,n=n+Math.imul(k,st)|0,o=(o=o+Math.imul(k,at)|0)+Math.imul(E,st)|0,s=s+Math.imul(E,at)|0,n=n+Math.imul(_,ut)|0,o=(o=o+Math.imul(_,ft)|0)+Math.imul(M,ut)|0,s=s+Math.imul(M,ft)|0,n=n+Math.imul(b,lt)|0,o=(o=o+Math.imul(b,dt)|0)+Math.imul(y,lt)|0,s=s+Math.imul(y,dt)|0;var At=(f+(n=n+Math.imul(m,mt)|0)|0)+((8191&(o=(o=o+Math.imul(m,gt)|0)+Math.imul(g,mt)|0))<<13)|0;f=((s=s+Math.imul(g,gt)|0)+(o>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(q,J),o=(o=Math.imul(q,Y))+Math.imul(D,J)|0,s=Math.imul(D,Y),n=n+Math.imul(C,X)|0,o=(o=o+Math.imul(C,Q)|0)+Math.imul(U,X)|0,s=s+Math.imul(U,Q)|0,n=n+Math.imul(O,tt)|0,o=(o=o+Math.imul(O,et)|0)+Math.imul(B,tt)|0,s=s+Math.imul(B,et)|0,n=n+Math.imul(P,it)|0,o=(o=o+Math.imul(P,nt)|0)+Math.imul(I,it)|0,s=s+Math.imul(I,nt)|0,n=n+Math.imul(A,st)|0,o=(o=o+Math.imul(A,at)|0)+Math.imul(x,st)|0,s=s+Math.imul(x,at)|0,n=n+Math.imul(k,ut)|0,o=(o=o+Math.imul(k,ft)|0)+Math.imul(E,ut)|0,s=s+Math.imul(E,ft)|0,n=n+Math.imul(_,lt)|0,o=(o=o+Math.imul(_,dt)|0)+Math.imul(M,lt)|0,s=s+Math.imul(M,dt)|0;var xt=(f+(n=n+Math.imul(b,mt)|0)|0)+((8191&(o=(o=o+Math.imul(b,gt)|0)+Math.imul(y,mt)|0))<<13)|0;f=((s=s+Math.imul(y,gt)|0)+(o>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(q,X),o=(o=Math.imul(q,Q))+Math.imul(D,X)|0,s=Math.imul(D,Q),n=n+Math.imul(C,tt)|0,o=(o=o+Math.imul(C,et)|0)+Math.imul(U,tt)|0,s=s+Math.imul(U,et)|0,n=n+Math.imul(O,it)|0,o=(o=o+Math.imul(O,nt)|0)+Math.imul(B,it)|0,s=s+Math.imul(B,nt)|0,n=n+Math.imul(P,st)|0,o=(o=o+Math.imul(P,at)|0)+Math.imul(I,st)|0,s=s+Math.imul(I,at)|0,n=n+Math.imul(A,ut)|0,o=(o=o+Math.imul(A,ft)|0)+Math.imul(x,ut)|0,s=s+Math.imul(x,ft)|0,n=n+Math.imul(k,lt)|0,o=(o=o+Math.imul(k,dt)|0)+Math.imul(E,lt)|0,s=s+Math.imul(E,dt)|0;var Tt=(f+(n=n+Math.imul(_,mt)|0)|0)+((8191&(o=(o=o+Math.imul(_,gt)|0)+Math.imul(M,mt)|0))<<13)|0;f=((s=s+Math.imul(M,gt)|0)+(o>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(q,tt),o=(o=Math.imul(q,et))+Math.imul(D,tt)|0,s=Math.imul(D,et),n=n+Math.imul(C,it)|0,o=(o=o+Math.imul(C,nt)|0)+Math.imul(U,it)|0,s=s+Math.imul(U,nt)|0,n=n+Math.imul(O,st)|0,o=(o=o+Math.imul(O,at)|0)+Math.imul(B,st)|0,s=s+Math.imul(B,at)|0,n=n+Math.imul(P,ut)|0,o=(o=o+Math.imul(P,ft)|0)+Math.imul(I,ut)|0,s=s+Math.imul(I,ft)|0,n=n+Math.imul(A,lt)|0,o=(o=o+Math.imul(A,dt)|0)+Math.imul(x,lt)|0,s=s+Math.imul(x,dt)|0;var Pt=(f+(n=n+Math.imul(k,mt)|0)|0)+((8191&(o=(o=o+Math.imul(k,gt)|0)+Math.imul(E,mt)|0))<<13)|0;f=((s=s+Math.imul(E,gt)|0)+(o>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,n=Math.imul(q,it),o=(o=Math.imul(q,nt))+Math.imul(D,it)|0,s=Math.imul(D,nt),n=n+Math.imul(C,st)|0,o=(o=o+Math.imul(C,at)|0)+Math.imul(U,st)|0,s=s+Math.imul(U,at)|0,n=n+Math.imul(O,ut)|0,o=(o=o+Math.imul(O,ft)|0)+Math.imul(B,ut)|0,s=s+Math.imul(B,ft)|0,n=n+Math.imul(P,lt)|0,o=(o=o+Math.imul(P,dt)|0)+Math.imul(I,lt)|0,s=s+Math.imul(I,dt)|0;var It=(f+(n=n+Math.imul(A,mt)|0)|0)+((8191&(o=(o=o+Math.imul(A,gt)|0)+Math.imul(x,mt)|0))<<13)|0;f=((s=s+Math.imul(x,gt)|0)+(o>>>13)|0)+(It>>>26)|0,It&=67108863,n=Math.imul(q,st),o=(o=Math.imul(q,at))+Math.imul(D,st)|0,s=Math.imul(D,at),n=n+Math.imul(C,ut)|0,o=(o=o+Math.imul(C,ft)|0)+Math.imul(U,ut)|0,s=s+Math.imul(U,ft)|0,n=n+Math.imul(O,lt)|0,o=(o=o+Math.imul(O,dt)|0)+Math.imul(B,lt)|0,s=s+Math.imul(B,dt)|0;var Lt=(f+(n=n+Math.imul(P,mt)|0)|0)+((8191&(o=(o=o+Math.imul(P,gt)|0)+Math.imul(I,mt)|0))<<13)|0;f=((s=s+Math.imul(I,gt)|0)+(o>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,n=Math.imul(q,ut),o=(o=Math.imul(q,ft))+Math.imul(D,ut)|0,s=Math.imul(D,ft),n=n+Math.imul(C,lt)|0,o=(o=o+Math.imul(C,dt)|0)+Math.imul(U,lt)|0,s=s+Math.imul(U,dt)|0;var Ot=(f+(n=n+Math.imul(O,mt)|0)|0)+((8191&(o=(o=o+Math.imul(O,gt)|0)+Math.imul(B,mt)|0))<<13)|0;f=((s=s+Math.imul(B,gt)|0)+(o>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,n=Math.imul(q,lt),o=(o=Math.imul(q,dt))+Math.imul(D,lt)|0,s=Math.imul(D,dt);var Bt=(f+(n=n+Math.imul(C,mt)|0)|0)+((8191&(o=(o=o+Math.imul(C,gt)|0)+Math.imul(U,mt)|0))<<13)|0;f=((s=s+Math.imul(U,gt)|0)+(o>>>13)|0)+(Bt>>>26)|0,Bt&=67108863;var jt=(f+(n=Math.imul(q,mt))|0)+((8191&(o=(o=Math.imul(q,gt))+Math.imul(D,mt)|0))<<13)|0;return f=((s=Math.imul(D,gt))+(o>>>13)|0)+(jt>>>26)|0,jt&=67108863,u[0]=vt,u[1]=bt,u[2]=yt,u[3]=wt,u[4]=_t,u[5]=Mt,u[6]=St,u[7]=kt,u[8]=Et,u[9]=Rt,u[10]=At,u[11]=xt,u[12]=Tt,u[13]=Pt,u[14]=It,u[15]=Lt,u[16]=Ot,u[17]=Bt,u[18]=jt,0!==f&&(u[19]=f,i.length++),i};function p(t,e,r){return(new m).mulp(t,e,r)}function m(t,e){this.x=t,this.y=e}Math.imul||(d=l),o.prototype.mulTo=function t(e,r){var i=this.length+e.length;return 10===this.length&&10===e.length?d(this,e,r):i<63?l(this,e,r):i<1024?function n(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var i=0,n=0,o=0;o<r.length-1;o++){var s=n;n=0;for(var a=67108863&i,h=Math.min(o,e.length-1),u=Math.max(0,o-t.length+1);u<=h;u++){var f=o-u,c=(0|t.words[f])*(0|e.words[u]),l=67108863&c;a=67108863&(l=l+a|0),n+=(s=(s=s+(c/67108864|0)|0)+(l>>>26)|0)>>>26,s&=67108863}r.words[o]=a,i=s,s=n}return 0!==i?r.words[o]=i:r.length--,r.strip()}(this,e,r):p(this,e,r)},m.prototype.makeRBT=function t(e){for(var r=new Array(e),i=o.prototype._countBits(e)-1,n=0;n<e;n++)r[n]=this.revBin(n,i,e);return r},m.prototype.revBin=function t(e,r,i){if(0===e||e===i-1)return e;for(var n=0,o=0;o<r;o++)n|=(1&e)<<r-o-1,e>>=1;return n},m.prototype.permute=function t(e,r,i,n,o,s){for(var a=0;a<s;a++)n[a]=r[e[a]],o[a]=i[e[a]]},m.prototype.transform=function t(e,r,i,n,o,s){this.permute(s,e,r,i,n,o);for(var a=1;a<o;a<<=1)for(var h=a<<1,u=Math.cos(2*Math.PI/h),f=Math.sin(2*Math.PI/h),c=0;c<o;c+=h)for(var l=u,d=f,p=0;p<a;p++){var m=i[c+p],g=n[c+p],v=i[c+p+a],b=n[c+p+a],y=l*v-d*b;b=l*b+d*v,v=y,i[c+p]=m+v,n[c+p]=g+b,i[c+p+a]=m-v,n[c+p+a]=g-b,p!==h&&(y=u*l-f*d,d=u*d+f*l,l=y)}},m.prototype.guessLen13b=function t(e,r){var i=1|Math.max(r,e),n=1&i,o=0;for(i=i/2|0;i;i>>>=1)o++;return 1<<o+1+n},m.prototype.conjugate=function t(e,r,i){if(!(i<=1))for(var n=0;n<i/2;n++){var o=e[n];e[n]=e[i-n-1],e[i-n-1]=o,o=r[n],r[n]=-r[i-n-1],r[i-n-1]=-o}},m.prototype.normalize13b=function t(e,r){for(var i=0,n=0;n<r/2;n++){var o=8192*Math.round(e[2*n+1]/r)+Math.round(e[2*n]/r)+i;e[n]=67108863&o,i=o<67108864?0:o/67108864|0}return e},m.prototype.convert13b=function t(e,r,n,o){for(var s=0,a=0;a<r;a++)s+=0|e[a],n[2*a]=8191&s,s>>>=13,n[2*a+1]=8191&s,s>>>=13;for(a=2*r;a<o;++a)n[a]=0;i(0===s),i(0==(-8192&s))},m.prototype.stub=function t(e){for(var r=new Array(e),i=0;i<e;i++)r[i]=0;return r},m.prototype.mulp=function t(e,r,i){var n=2*this.guessLen13b(e.length,r.length),o=this.makeRBT(n),s=this.stub(n),a=new Array(n),h=new Array(n),u=new Array(n),f=new Array(n),c=new Array(n),l=new Array(n),d=i.words;d.length=n,this.convert13b(e.words,e.length,a,n),this.convert13b(r.words,r.length,f,n),this.transform(a,s,h,u,n,o),this.transform(f,s,c,l,n,o);for(var p=0;p<n;p++){var m=h[p]*c[p]-u[p]*l[p];u[p]=h[p]*l[p]+u[p]*c[p],h[p]=m}return this.conjugate(h,u,n),this.transform(h,u,d,s,n,o),this.conjugate(d,s,n),this.normalize13b(d,n),i.negative=e.negative^r.negative,i.length=e.length+r.length,i.strip()},o.prototype.mul=function t(e){var r=new o(null);return r.words=new Array(this.length+e.length),this.mulTo(e,r)},o.prototype.mulf=function t(e){var r=new o(null);return r.words=new Array(this.length+e.length),p(this,e,r)},o.prototype.imul=function t(e){return this.clone().mulTo(e,this)},o.prototype.imuln=function t(e){i("number"==typeof e),i(e<67108864);for(var r=0,n=0;n<this.length;n++){var o=(0|this.words[n])*e,s=(67108863&o)+(67108863&r);r>>=26,r+=o/67108864|0,r+=s>>>26,this.words[n]=67108863&s}return 0!==r&&(this.words[n]=r,this.length++),this},o.prototype.muln=function t(e){return this.clone().imuln(e)},o.prototype.sqr=function t(){return this.mul(this)},o.prototype.isqr=function t(){return this.imul(this.clone())},o.prototype.pow=function t(e){var r=function i(t){for(var e=new Array(t.bitLength()),r=0;r<e.length;r++){var i=r/26|0,n=r%26;e[r]=(t.words[i]&1<<n)>>>n}return e}(e);if(0===r.length)return new o(1);for(var n=this,s=0;s<r.length&&0===r[s];s++,n=n.sqr());if(++s<r.length)for(var a=n.sqr();s<r.length;s++,a=a.sqr())0!==r[s]&&(n=n.mul(a));return n},o.prototype.iushln=function t(e){i("number"==typeof e&&e>=0);var r,n=e%26,o=(e-n)/26,s=67108863>>>26-n<<26-n;if(0!==n){var a=0;for(r=0;r<this.length;r++){var h=this.words[r]&s,u=(0|this.words[r])-h<<n;this.words[r]=u|a,a=h>>>26-n}a&&(this.words[r]=a,this.length++)}if(0!==o){for(r=this.length-1;r>=0;r--)this.words[r+o]=this.words[r];for(r=0;r<o;r++)this.words[r]=0;this.length+=o}return this.strip()},o.prototype.ishln=function t(e){return i(0===this.negative),this.iushln(e)},o.prototype.iushrn=function t(e,r,n){var o;i("number"==typeof e&&e>=0),o=r?(r-r%26)/26:0;var s=e%26,a=Math.min((e-s)/26,this.length),h=67108863^67108863>>>s<<s,u=n;if(o-=a,o=Math.max(0,o),u){for(var f=0;f<a;f++)u.words[f]=this.words[f];u.length=a}if(0===a);else if(this.length>a)for(this.length-=a,f=0;f<this.length;f++)this.words[f]=this.words[f+a];else this.words[0]=0,this.length=1;var c=0;for(f=this.length-1;f>=0&&(0!==c||f>=o);f--){var l=0|this.words[f];this.words[f]=c<<26-s|l>>>s,c=l&h}return u&&0!==c&&(u.words[u.length++]=c),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function t(e,r,n){return i(0===this.negative),this.iushrn(e,r,n)},o.prototype.shln=function t(e){return this.clone().ishln(e)},o.prototype.ushln=function t(e){return this.clone().iushln(e)},o.prototype.shrn=function t(e){return this.clone().ishrn(e)},o.prototype.ushrn=function t(e){return this.clone().iushrn(e)},o.prototype.testn=function t(e){i("number"==typeof e&&e>=0);var r=e%26,n=(e-r)/26,o=1<<r;return!(this.length<=n)&&!!(this.words[n]&o)},o.prototype.imaskn=function t(e){i("number"==typeof e&&e>=0);var r=e%26,n=(e-r)/26;if(i(0===this.negative,"imaskn works only with positive numbers"),this.length<=n)return this;if(0!==r&&n++,this.length=Math.min(n,this.length),0!==r){var o=67108863^67108863>>>r<<r;this.words[this.length-1]&=o}return this.strip()},o.prototype.maskn=function t(e){return this.clone().imaskn(e)},o.prototype.iaddn=function t(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)},o.prototype._iaddn=function t(e){this.words[0]+=e;for(var r=0;r<this.length&&this.words[r]>=67108864;r++)this.words[r]-=67108864,r===this.length-1?this.words[r+1]=1:this.words[r+1]++;return this.length=Math.max(this.length,r+1),this},o.prototype.isubn=function t(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 r=0;r<this.length&&this.words[r]<0;r++)this.words[r]+=67108864,this.words[r+1]-=1;return this.strip()},o.prototype.addn=function t(e){return this.clone().iaddn(e)},o.prototype.subn=function t(e){return this.clone().isubn(e)},o.prototype.iabs=function t(){return this.negative=0,this},o.prototype.abs=function t(){return this.clone().iabs()},o.prototype._ishlnsubmul=function t(e,r,n){var o,s,a=e.length+n;this._expand(a);var h=0;for(o=0;o<e.length;o++){s=(0|this.words[o+n])+h;var u=(0|e.words[o])*r;h=((s-=67108863&u)>>26)-(u/67108864|0),this.words[o+n]=67108863&s}for(;o<this.length-n;o++)h=(s=(0|this.words[o+n])+h)>>26,this.words[o+n]=67108863&s;if(0===h)return this.strip();for(i(-1===h),h=0,o=0;o<this.length;o++)h=(s=-(0|this.words[o])+h)>>26,this.words[o]=67108863&s;return this.negative=1,this.strip()},o.prototype._wordDiv=function t(e,r){var i=(this.length,e.length),n=this.clone(),s=e,a=0|s.words[s.length-1];0!==(i=26-this._countBits(a))&&(s=s.ushln(i),n.iushln(i),a=0|s.words[s.length-1]);var h,u=n.length-s.length;if("mod"!==r){(h=new o(null)).length=u+1,h.words=new Array(h.length);for(var f=0;f<h.length;f++)h.words[f]=0}var c=n.clone()._ishlnsubmul(s,1,u);0===c.negative&&(n=c,h&&(h.words[u]=1));for(var l=u-1;l>=0;l--){var d=67108864*(0|n.words[s.length+l])+(0|n.words[s.length+l-1]);for(d=Math.min(d/a|0,67108863),n._ishlnsubmul(s,d,l);0!==n.negative;)d--,n.negative=0,n._ishlnsubmul(s,1,l),n.isZero()||(n.negative^=1);h&&(h.words[l]=d)}return h&&h.strip(),n.strip(),"div"!==r&&0!==i&&n.iushrn(i),{div:h||null,mod:n}},o.prototype.divmod=function t(e,r,n){return i(!e.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===e.negative?(h=this.neg().divmod(e,r),"mod"!==r&&(s=h.div.neg()),"div"!==r&&(a=h.mod.neg(),n&&0!==a.negative&&a.iadd(e)),{div:s,mod:a}):0===this.negative&&0!==e.negative?(h=this.divmod(e.neg(),r),"mod"!==r&&(s=h.div.neg()),{div:s,mod:h.mod}):0!=(this.negative&e.negative)?(h=this.neg().divmod(e.neg(),r),"div"!==r&&(a=h.mod.neg(),n&&0!==a.negative&&a.isub(e)),{div:h.div,mod:a}):e.length>this.length||this.cmp(e)<0?{div:new o(0),mod:this}:1===e.length?"div"===r?{div:this.divn(e.words[0]),mod:null}:"mod"===r?{div:null,mod:new o(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new o(this.modn(e.words[0]))}:this._wordDiv(e,r);var s,a,h},o.prototype.div=function t(e){return this.divmod(e,"div",!1).div},o.prototype.mod=function t(e){return this.divmod(e,"mod",!1).mod},o.prototype.umod=function t(e){return this.divmod(e,"mod",!0).mod},o.prototype.divRound=function t(e){var r=this.divmod(e);if(r.mod.isZero())return r.div;var i=0!==r.div.negative?r.mod.isub(e):r.mod,n=e.ushrn(1),o=e.andln(1),s=i.cmp(n);return s<0||1===o&&0===s?r.div:0!==r.div.negative?r.div.isubn(1):r.div.iaddn(1)},o.prototype.modn=function t(e){i(e<=67108863);for(var r=(1<<26)%e,n=0,o=this.length-1;o>=0;o--)n=(r*n+(0|this.words[o]))%e;return n},o.prototype.idivn=function t(e){i(e<=67108863);for(var r=0,n=this.length-1;n>=0;n--){var o=(0|this.words[n])+67108864*r;this.words[n]=o/e|0,r=o%e}return this.strip()},o.prototype.divn=function t(e){return this.clone().idivn(e)},o.prototype.egcd=function t(e){i(0===e.negative),i(!e.isZero());var r=this,n=e.clone();r=0!==r.negative?r.umod(e):r.clone();for(var s=new o(1),a=new o(0),h=new o(0),u=new o(1),f=0;r.isEven()&&n.isEven();)r.iushrn(1),n.iushrn(1),++f;for(var c=n.clone(),l=r.clone();!r.isZero();){for(var d=0,p=1;0==(r.words[0]&p)&&d<26;++d,p<<=1);if(d>0)for(r.iushrn(d);d-- >0;)(s.isOdd()||a.isOdd())&&(s.iadd(c),a.isub(l)),s.iushrn(1),a.iushrn(1);for(var m=0,g=1;0==(n.words[0]&g)&&m<26;++m,g<<=1);if(m>0)for(n.iushrn(m);m-- >0;)(h.isOdd()||u.isOdd())&&(h.iadd(c),u.isub(l)),h.iushrn(1),u.iushrn(1);r.cmp(n)>=0?(r.isub(n),s.isub(h),a.isub(u)):(n.isub(r),h.isub(s),u.isub(a))}return{a:h,b:u,gcd:n.iushln(f)}},o.prototype._invmp=function t(e){i(0===e.negative),i(!e.isZero());var r=this,n=e.clone();r=0!==r.negative?r.umod(e):r.clone();for(var s,a=new o(1),h=new o(0),u=n.clone();r.cmpn(1)>0&&n.cmpn(1)>0;){for(var f=0,c=1;0==(r.words[0]&c)&&f<26;++f,c<<=1);if(f>0)for(r.iushrn(f);f-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);for(var l=0,d=1;0==(n.words[0]&d)&&l<26;++l,d<<=1);if(l>0)for(n.iushrn(l);l-- >0;)h.isOdd()&&h.iadd(u),h.iushrn(1);r.cmp(n)>=0?(r.isub(n),a.isub(h)):(n.isub(r),h.isub(a))}return(s=0===r.cmpn(1)?a:h).cmpn(0)<0&&s.iadd(e),s},o.prototype.gcd=function t(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var r=this.clone(),i=e.clone();r.negative=0,i.negative=0;for(var n=0;r.isEven()&&i.isEven();n++)r.iushrn(1),i.iushrn(1);for(;;){for(;r.isEven();)r.iushrn(1);for(;i.isEven();)i.iushrn(1);var o=r.cmp(i);if(o<0){var s=r;r=i,i=s}else if(0===o||0===i.cmpn(1))break;r.isub(i)}return i.iushln(n)},o.prototype.invm=function t(e){return this.egcd(e).a.umod(e)},o.prototype.isEven=function t(){return 0==(1&this.words[0])},o.prototype.isOdd=function t(){return 1==(1&this.words[0])},o.prototype.andln=function t(e){return this.words[0]&e},o.prototype.bincn=function t(e){i("number"==typeof e);var r=e%26,n=(e-r)/26,o=1<<r;if(this.length<=n)return this._expand(n+1),this.words[n]|=o,this;for(var s=o,a=n;0!==s&&a<this.length;a++){var h=0|this.words[a];s=(h+=s)>>>26,h&=67108863,this.words[a]=h}return 0!==s&&(this.words[a]=s,this.length++),this},o.prototype.isZero=function t(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function t(e){var r,n=e<0;if(0!==this.negative&&!n)return-1;if(0===this.negative&&n)return 1;if(this.strip(),this.length>1)r=1;else{n&&(e=-e),i(e<=67108863,"Number is too big");var o=0|this.words[0];r=o===e?0:o<e?-1:1}return 0!==this.negative?0|-r:r},o.prototype.cmp=function t(e){if(0!==this.negative&&0===e.negative)return-1;if(0===this.negative&&0!==e.negative)return 1;var r=this.ucmp(e);return 0!==this.negative?0|-r:r},o.prototype.ucmp=function t(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var r=0,i=this.length-1;i>=0;i--){var n=0|this.words[i],o=0|e.words[i];if(n!==o){n<o?r=-1:n>o&&(r=1);break}}return r},o.prototype.gtn=function t(e){return 1===this.cmpn(e)},o.prototype.gt=function t(e){return 1===this.cmp(e)},o.prototype.gten=function t(e){return this.cmpn(e)>=0},o.prototype.gte=function t(e){return this.cmp(e)>=0},o.prototype.ltn=function t(e){return-1===this.cmpn(e)},o.prototype.lt=function t(e){return-1===this.cmp(e)},o.prototype.lten=function t(e){return this.cmpn(e)<=0},o.prototype.lte=function t(e){return this.cmp(e)<=0},o.prototype.eqn=function t(e){return 0===this.cmpn(e)},o.prototype.eq=function t(e){return 0===this.cmp(e)},o.red=function t(e){return new M(e)},o.prototype.toRed=function t(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)},o.prototype.fromRed=function t(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function t(e){return this.red=e,this},o.prototype.forceRed=function t(e){return i(!this.red,"Already a number in reduction context"),this._forceRed(e)},o.prototype.redAdd=function t(e){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},o.prototype.redIAdd=function t(e){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},o.prototype.redSub=function t(e){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},o.prototype.redISub=function t(e){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},o.prototype.redShl=function t(e){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},o.prototype.redMul=function t(e){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},o.prototype.redIMul=function t(e){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},o.prototype.redSqr=function t(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function t(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function t(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function t(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function t(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function t(e){return i(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var g={k256:null,p224:null,p192:null,p25519:null};function v(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function b(){v.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function y(){v.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function w(){v.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function _(){v.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function M(t){if("string"==typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else i(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function S(t){M.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}v.prototype._tmp=function t(){var e=new o(null);return e.words=new Array(Math.ceil(this.n/13)),e},v.prototype.ireduce=function t(e){var r,i=e;do{this.split(i,this.tmp),r=(i=(i=this.imulK(i)).iadd(this.tmp)).bitLength()}while(r>this.n);var n=r<this.n?-1:i.ucmp(this.p);return 0===n?(i.words[0]=0,i.length=1):n>0?i.isub(this.p):void 0!==i.strip?i.strip():i._strip(),i},v.prototype.split=function t(e,r){e.iushrn(this.n,0,r)},v.prototype.imulK=function t(e){return e.imul(this.k)},n(b,v),b.prototype.split=function t(e,r){for(var i=4194303,n=Math.min(e.length,9),o=0;o<n;o++)r.words[o]=e.words[o];if(r.length=n,e.length<=9)return e.words[0]=0,void(e.length=1);var s=e.words[9];for(r.words[r.length++]=s&i,o=10;o<e.length;o++){var a=0|e.words[o];e.words[o-10]=(a&i)<<4|s>>>22,s=a}s>>>=22,e.words[o-10]=s,0===s&&e.length>10?e.length-=10:e.length-=9},b.prototype.imulK=function t(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var r=0,i=0;i<e.length;i++){var n=0|e.words[i];r+=977*n,e.words[i]=67108863&r,r=64*n+(r/67108864|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},n(y,v),n(w,v),n(_,v),_.prototype.imulK=function t(e){for(var r=0,i=0;i<e.length;i++){var n=19*(0|e.words[i])+r,o=67108863&n;n>>>=26,e.words[i]=o,r=n}return 0!==r&&(e.words[e.length++]=r),e},o._prime=function t(e){if(g[e])return g[e];var t;if("k256"===e)t=new b;else if("p224"===e)t=new y;else if("p192"===e)t=new w;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new _}return g[e]=t,t},M.prototype._verify1=function t(e){i(0===e.negative,"red works only with positives"),i(e.red,"red works only with red numbers")},M.prototype._verify2=function t(e,r){i(0==(e.negative|r.negative),"red works only with positives"),i(e.red&&e.red===r.red,"red works only with red numbers")},M.prototype.imod=function t(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},M.prototype.neg=function t(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},M.prototype.add=function t(e,r){this._verify2(e,r);var i=e.add(r);return i.cmp(this.m)>=0&&i.isub(this.m),i._forceRed(this)},M.prototype.iadd=function t(e,r){this._verify2(e,r);var i=e.iadd(r);return i.cmp(this.m)>=0&&i.isub(this.m),i},M.prototype.sub=function t(e,r){this._verify2(e,r);var i=e.sub(r);return i.cmpn(0)<0&&i.iadd(this.m),i._forceRed(this)},M.prototype.isub=function t(e,r){this._verify2(e,r);var i=e.isub(r);return i.cmpn(0)<0&&i.iadd(this.m),i},M.prototype.shl=function t(e,r){return this._verify1(e),this.imod(e.ushln(r))},M.prototype.imul=function t(e,r){return this._verify2(e,r),this.imod(e.imul(r))},M.prototype.mul=function t(e,r){return this._verify2(e,r),this.imod(e.mul(r))},M.prototype.isqr=function t(e){return this.imul(e,e.clone())},M.prototype.sqr=function t(e){return this.mul(e,e)},M.prototype.sqrt=function t(e){if(e.isZero())return e.clone();var r=this.m.andln(3);if(i(r%2==1),3===r){var n=this.m.add(new o(1)).iushrn(2);return this.pow(e,n)}for(var s=this.m.subn(1),a=0;!s.isZero()&&0===s.andln(1);)a++,s.iushrn(1);i(!s.isZero());var h=new o(1).toRed(this),u=h.redNeg(),f=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new o(2*c*c).toRed(this);0!==this.pow(c,f).cmp(u);)c.redIAdd(u);for(var l=this.pow(c,s),d=this.pow(e,s.addn(1).iushrn(1)),p=this.pow(e,s),m=a;0!==p.cmp(h);){for(var g=p,v=0;0!==g.cmp(h);v++)g=g.redSqr();i(v<m);var b=this.pow(l,new o(1).iushln(m-v-1));d=d.redMul(b),l=b.redSqr(),p=p.redMul(l),m=v}return d},M.prototype.invm=function t(e){var r=e._invmp(this.m);return 0!==r.negative?(r.negative=0,this.imod(r).redNeg()):this.imod(r)},M.prototype.pow=function t(e,r){if(r.isZero())return new o(1).toRed(this);if(0===r.cmpn(1))return e.clone();var i=new Array(16);i[0]=new o(1).toRed(this),i[1]=e;for(var n=2;n<i.length;n++)i[n]=this.mul(i[n-1],e);var s=i[0],a=0,h=0,u=r.bitLength()%26;for(0===u&&(u=26),n=r.length-1;n>=0;n--){for(var f=r.words[n],c=u-1;c>=0;c--){var l=f>>c&1;s!==i[0]&&(s=this.sqr(s)),0!==l||0!==a?(a<<=1,a|=l,(4===++h||0===n&&0===c)&&(s=this.mul(s,i[a]),h=0,a=0)):h=0}u=26}return s},M.prototype.convertTo=function t(e){var r=e.umod(this.m);return r===e?r.clone():r},M.prototype.convertFrom=function t(e){var r=e.clone();return r.red=null,r},o.mont=function t(e){return new S(e)},n(S,M),S.prototype.convertTo=function t(e){return this.imod(e.ushln(this.shift))},S.prototype.convertFrom=function t(e){var r=this.imod(e.mul(this.rinv));return r.red=null,r},S.prototype.imul=function t(e,r){if(e.isZero()||r.isZero())return e.words[0]=0,e.length=1,e;var i=e.imul(r),n=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=i.isub(n).iushrn(this.shift),s=o;return o.cmp(this.m)>=0?s=o.isub(this.m):o.cmpn(0)<0&&(s=o.iadd(this.m)),s._forceRed(this)},S.prototype.mul=function t(e,r){if(e.isZero()||r.isZero())return new o(0)._forceRed(this);var i=e.mul(r),n=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),s=i.isub(n).iushrn(this.shift),a=s;return s.cmp(this.m)>=0?a=s.isub(this.m):s.cmpn(0)<0&&(a=s.iadd(this.m)),a._forceRed(this)},S.prototype.invm=function t(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(t,this)}).call(this,r(28)(t))},function(t,e,r){"use strict";const i=e;i.der=r(190),i.pem=r(362)},function(t,e,r){"use strict";const i=r(1),n=r(107).Buffer,o=r(108),s=r(110);function a(t){this.enc="der",this.name=t.name,this.entity=t,this.tree=new h,this.tree._init(t.body)}function h(t){o.call(this,"der",t)}function u(t){return t<10?"0"+t:t}t.exports=a,a.prototype.encode=function t(e,r){return this.tree._encode(e,r).join()},i(h,o),h.prototype._encodeComposite=function t(e,r,i,o){const a=function h(t,e,r,i){let n;"seqof"===t?t="seq":"setof"===t&&(t="set");if(s.tagByName.hasOwnProperty(t))n=s.tagByName[t];else{if("number"!=typeof t||(0|t)!==t)return i.error("Unknown tag: "+t);n=t}if(n>=31)return i.error("Multi-octet tag encoding unsupported");e||(n|=32);return n|=s.tagClassByName[r||"universal"]<<6,n}(e,r,i,this.reporter);if(o.length<128){const t=n.alloc(2);return t[0]=a,t[1]=o.length,this._createEncoderBuffer([t,o])}let u=1;for(let t=o.length;t>=256;t>>=8)u++;const f=n.alloc(2+u);f[0]=a,f[1]=128|u;for(let t=1+u,e=o.length;e>0;t--,e>>=8)f[t]=255&e;return this._createEncoderBuffer([f,o])},h.prototype._encodeStr=function t(e,r){if("bitstr"===r)return this._createEncoderBuffer([0|e.unused,e.data]);if("bmpstr"===r){const t=n.alloc(2*e.length);for(let r=0;r<e.length;r++)t.writeUInt16BE(e.charCodeAt(r),2*r);return this._createEncoderBuffer(t)}return"numstr"===r?this._isNumstr(e)?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: numstr supports only digits and space"):"printstr"===r?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(r)||"objDesc"===r?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: "+r+" unsupported")},h.prototype._encodeObjid=function t(e,r,i){if("string"==typeof e){if(!r)return this.reporter.error("string objid given, but no values map found");if(!r.hasOwnProperty(e))return this.reporter.error("objid not found in values map");e=r[e].split(/[\s.]+/g);for(let t=0;t<e.length;t++)e[t]|=0}else if(Array.isArray(e)){e=e.slice();for(let t=0;t<e.length;t++)e[t]|=0}if(!Array.isArray(e))return this.reporter.error("objid() should be either array or string, got: "+JSON.stringify(e));if(!i){if(e[1]>=40)return this.reporter.error("Second objid identifier OOB");e.splice(0,2,40*e[0]+e[1])}let o=0;for(let t=0;t<e.length;t++){let r=e[t];for(o++;r>=128;r>>=7)o++}const s=n.alloc(o);let a=s.length-1;for(let t=e.length-1;t>=0;t--){let r=e[t];for(s[a--]=127&r;(r>>=7)>0;)s[a--]=128|127&r}return this._createEncoderBuffer(s)},h.prototype._encodeTime=function t(e,r){let i;const n=new Date(e);return"gentime"===r?i=[u(n.getUTCFullYear()),u(n.getUTCMonth()+1),u(n.getUTCDate()),u(n.getUTCHours()),u(n.getUTCMinutes()),u(n.getUTCSeconds()),"Z"].join(""):"utctime"===r?i=[u(n.getUTCFullYear()%100),u(n.getUTCMonth()+1),u(n.getUTCDate()),u(n.getUTCHours()),u(n.getUTCMinutes()),u(n.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+r+" time is not supported yet"),this._encodeStr(i,"octstr")},h.prototype._encodeNull=function t(){return this._createEncoderBuffer("")},h.prototype._encodeInt=function t(e,r){if("string"==typeof e){if(!r)return this.reporter.error("String int or enum given, but no values map");if(!r.hasOwnProperty(e))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(e));e=r[e]}if("number"!=typeof e&&!n.isBuffer(e)){const t=e.toArray();!e.sign&&128&t[0]&&t.unshift(0),e=n.from(t)}if(n.isBuffer(e)){let t=e.length;0===e.length&&t++;const r=n.alloc(t);return e.copy(r),0===e.length&&(r[0]=0),this._createEncoderBuffer(r)}if(e<128)return this._createEncoderBuffer(e);if(e<256)return this._createEncoderBuffer([0,e]);let i=1;for(let t=e;t>=256;t>>=8)i++;const o=new Array(i);for(let t=o.length-1;t>=0;t--)o[t]=255&e,e>>=8;return 128&o[0]&&o.unshift(0),this._createEncoderBuffer(n.from(o))},h.prototype._encodeBool=function t(e){return this._createEncoderBuffer(e?255:0)},h.prototype._use=function t(e,r){return"function"==typeof e&&(e=e(r)),e._getEncoder("der").tree},h.prototype._skipDefault=function t(e,r,i){const n=this._baseState;let o;if(null===n.default)return!1;const s=e.join();if(void 0===n.defaultBuffer&&(n.defaultBuffer=this._encodeValue(n.default,r,i).join()),s.length!==n.defaultBuffer.length)return!1;for(o=0;o<s.length;o++)if(s[o]!==n.defaultBuffer[o])return!1;return!0}},function(t,e,r){"use strict";const i=e;i.der=r(192),i.pem=r(363)},function(t,e,r){"use strict";const i=r(1),n=r(188),o=r(47).DecoderBuffer,s=r(108),a=r(110);function h(t){this.enc="der",this.name=t.name,this.entity=t,this.tree=new u,this.tree._init(t.body)}function u(t){s.call(this,"der",t)}function f(t,e){let r=t.readUInt8(e);if(t.isError(r))return r;const i=a.tagClass[r>>6],n=0==(32&r);if(31==(31&r)){let i=r;for(r=0;128==(128&i);){if(i=t.readUInt8(e),t.isError(i))return i;r<<=7,r|=127&i}}else r&=31;return{cls:i,primitive:n,tag:r,tagStr:a.tag[r]}}function c(t,e,r){let i=t.readUInt8(r);if(t.isError(i))return i;if(!e&&128===i)return null;if(0==(128&i))return i;const n=127&i;if(n>4)return t.error("length octect is too long");i=0;for(let e=0;e<n;e++){i<<=8;const e=t.readUInt8(r);if(t.isError(e))return e;i|=e}return i}t.exports=h,h.prototype.decode=function t(e,r){return o.isDecoderBuffer(e)||(e=new o(e,r)),this.tree._decode(e,r)},i(u,s),u.prototype._peekTag=function t(e,r,i){if(e.isEmpty())return!1;const n=e.save(),o=f(e,'Failed to peek tag: "'+r+'"');return e.isError(o)?o:(e.restore(n),o.tag===r||o.tagStr===r||o.tagStr+"of"===r||i)},u.prototype._decodeTag=function t(e,r,i){const n=f(e,'Failed to decode tag of "'+r+'"');if(e.isError(n))return n;let o=c(e,n.primitive,'Failed to get length of "'+r+'"');if(e.isError(o))return o;if(!i&&n.tag!==r&&n.tagStr!==r&&n.tagStr+"of"!==r)return e.error('Failed to match tag: "'+r+'"');if(n.primitive||null!==o)return e.skip(o,'Failed to match body of: "'+r+'"');const s=e.save(),a=this._skipUntilEnd(e,'Failed to skip indefinite length body: "'+this.tag+'"');return e.isError(a)?a:(o=e.offset-s.offset,e.restore(s),e.skip(o,'Failed to match body of: "'+r+'"'))},u.prototype._skipUntilEnd=function t(e,r){for(;;){const t=f(e,r);if(e.isError(t))return t;const i=c(e,t.primitive,r);if(e.isError(i))return i;let n;if(n=t.primitive||null!==i?e.skip(i):this._skipUntilEnd(e,r),e.isError(n))return n;if("end"===t.tagStr)break}},u.prototype._decodeList=function t(e,r,i,n){const o=[];for(;!e.isEmpty();){const t=this._peekTag(e,"end");if(e.isError(t))return t;const r=i.decode(e,"der",n);if(e.isError(r)&&t)break;o.push(r)}return o},u.prototype._decodeStr=function t(e,r){if("bitstr"===r){const t=e.readUInt8();return e.isError(t)?t:{unused:t,data:e.raw()}}if("bmpstr"===r){const t=e.raw();if(t.length%2==1)return e.error("Decoding of string type: bmpstr length mismatch");let r="";for(let e=0;e<t.length/2;e++)r+=String.fromCharCode(t.readUInt16BE(2*e));return r}if("numstr"===r){const t=e.raw().toString("ascii");return this._isNumstr(t)?t:e.error("Decoding of string type: numstr unsupported characters")}if("octstr"===r)return e.raw();if("objDesc"===r)return e.raw();if("printstr"===r){const t=e.raw().toString("ascii");return this._isPrintstr(t)?t:e.error("Decoding of string type: printstr unsupported characters")}return/str$/.test(r)?e.raw().toString():e.error("Decoding of string type: "+r+" unsupported")},u.prototype._decodeObjid=function t(e,r,i){let n;const o=[];let s=0,a=0;for(;!e.isEmpty();)a=e.readUInt8(),s<<=7,s|=127&a,0==(128&a)&&(o.push(s),s=0);128&a&&o.push(s);const h=o[0]/40|0,u=o[0]%40;if(n=i?o:[h,u].concat(o.slice(1)),r){let t=r[n.join(" ")];void 0===t&&(t=r[n.join(".")]),void 0!==t&&(n=t)}return n},u.prototype._decodeTime=function t(e,r){const i=e.raw().toString();let n,o,s,a,h,u;if("gentime"===r)n=0|i.slice(0,4),o=0|i.slice(4,6),s=0|i.slice(6,8),a=0|i.slice(8,10),h=0|i.slice(10,12),u=0|i.slice(12,14);else{if("utctime"!==r)return e.error("Decoding "+r+" time is not supported yet");n=0|i.slice(0,2),o=0|i.slice(2,4),s=0|i.slice(4,6),a=0|i.slice(6,8),h=0|i.slice(8,10),u=0|i.slice(10,12),n=n<70?2e3+n:1900+n}return Date.UTC(n,o-1,s,a,h,u,0)},u.prototype._decodeNull=function t(){return null},u.prototype._decodeBool=function t(e){const r=e.readUInt8();return e.isError(r)?r:0!==r},u.prototype._decodeInt=function t(e,r){const i=e.raw();let o=new n(i);return r&&(o=r[o.toString(10)]||o),o},u.prototype._use=function t(e,r){return"function"==typeof e&&(e=e(r)),e._getDecoder("der").tree}},function(t){t.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(t,e,r){var i=r(43),n=r(66).Buffer;function o(t){var e=n.allocUnsafe(4);return e.writeUInt32BE(t,0),e}t.exports=function(t,e){for(var r,s=n.alloc(0),a=0;s.length<e;)r=o(a++),s=n.concat([s,i("sha1").update(t).update(r).digest()]);return s.slice(0,e)}},function(t,e){t.exports=function t(e,r){for(var i=e.length,n=-1;++n<i;)e[n]^=r[n];return e}},function(t,e,r){var i=r(111),n=r(66).Buffer;t.exports=function o(t,e){return n.from(t.toRed(i.mont(e.modulus)).redPow(new i(e.publicExponent)).fromRed().toArray())}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TokenClient=void 0;var i=r(87),n=r(30),o=r(0);function s(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}e.TokenClient=function(){function t(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:i.JsonService,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:n.MetadataService;if(s(this,t),!e)throw o.Log.error("TokenClient.ctor: No settings passed"),new Error("settings");this._settings=e,this._jsonService=new r,this._metadataService=new a(this._settings)}return t.prototype.exchangeCode=function t(){var e=this,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(r=Object.assign({},r)).grant_type=r.grant_type||"authorization_code",r.client_id=r.client_id||this._settings.client_id,r.client_secret=r.client_secret||this._settings.client_secret,r.redirect_uri=r.redirect_uri||this._settings.redirect_uri;var i=void 0,n=r._client_authentication||this._settings._client_authentication;return delete r._client_authentication,r.code?r.redirect_uri?r.code_verifier?r.client_id?r.client_secret||"client_secret_basic"!=n?("client_secret_basic"==n&&(i=r.client_id+":"+r.client_secret,delete r.client_id,delete r.client_secret),this._metadataService.getTokenEndpoint(!1).then((function(t){return o.Log.debug("TokenClient.exchangeCode: Received token endpoint"),e._jsonService.postForm(t,r,i).then((function(t){return o.Log.debug("TokenClient.exchangeCode: response received"),t}))}))):(o.Log.error("TokenClient.exchangeCode: No client_secret passed"),Promise.reject(new Error("A client_secret is required"))):(o.Log.error("TokenClient.exchangeCode: No client_id passed"),Promise.reject(new Error("A client_id is required"))):(o.Log.error("TokenClient.exchangeCode: No code_verifier passed"),Promise.reject(new Error("A code_verifier is required"))):(o.Log.error("TokenClient.exchangeCode: No redirect_uri passed"),Promise.reject(new Error("A redirect_uri is required"))):(o.Log.error("TokenClient.exchangeCode: No code passed"),Promise.reject(new Error("A code is required")))},t.prototype.exchangeRefreshToken=function t(){var e=this,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(r=Object.assign({},r)).grant_type=r.grant_type||"refresh_token",r.client_id=r.client_id||this._settings.client_id,r.client_secret=r.client_secret||this._settings.client_secret;var i=void 0,n=r._client_authentication||this._settings._client_authentication;return delete r._client_authentication,r.refresh_token?r.client_id?("client_secret_basic"==n&&(i=r.client_id+":"+r.client_secret,delete r.client_id,delete r.client_secret),this._metadataService.getTokenEndpoint(!1).then((function(t){return o.Log.debug("TokenClient.exchangeRefreshToken: Received token endpoint"),e._jsonService.postForm(t,r,i).then((function(t){return o.Log.debug("TokenClient.exchangeRefreshToken: response received"),t}))}))):(o.Log.error("TokenClient.exchangeRefreshToken: No client_id passed"),Promise.reject(new Error("A client_id is required"))):(o.Log.error("TokenClient.exchangeRefreshToken: No refresh_token passed"),Promise.reject(new Error("A refresh_token is required")))},t}()},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ErrorResponse=void 0;var i=r(0);function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}e.ErrorResponse=function(t){function e(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},s=r.error,a=r.error_description,h=r.error_uri,u=r.state,f=r.session_state;if(n(this,e),!s)throw i.Log.error("No error passed to ErrorResponse"),new Error("error");var c=o(this,t.call(this,a||s));return c.name="ErrorResponse",c.error=s,c.error_description=a,c.error_uri=h,c.state=u,c.session_state=f,c}return function r(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),e}(Error)},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SigninState=void 0;var i=function(){function t(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,r,i){return r&&t(e.prototype,r),i&&t(e,i),e}}(),n=r(0),o=r(113),s=r(60),a=function h(t){return t&&t.__esModule?t:{default:t}}(r(200));function u(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function f(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}e.SigninState=function(t){function e(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=r.nonce,n=r.authority,o=r.client_id,h=r.redirect_uri,c=r.code_verifier,l=r.response_mode,d=r.client_secret,p=r.scope,m=r.extraTokenParams,g=r.skipUserInfo;u(this,e);var v=f(this,t.call(this,arguments[0]));if(!0===i?v._nonce=(0,a.default)():i&&(v._nonce=i),!0===c?v._code_verifier=(0,a.default)()+(0,a.default)()+(0,a.default)():c&&(v._code_verifier=c),v.code_verifier){var b=s.JoseUtil.hashString(v.code_verifier,"SHA256");v._code_challenge=s.JoseUtil.hexToBase64Url(b)}return v._redirect_uri=h,v._authority=n,v._client_id=o,v._response_mode=l,v._client_secret=d,v._scope=p,v._extraTokenParams=m,v._skipUserInfo=g,v}return function r(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),e.prototype.toStorageString=function t(){return n.Log.debug("SigninState.toStorageString"),JSON.stringify({id:this.id,data:this.data,created:this.created,request_type:this.request_type,nonce:this.nonce,code_verifier:this.code_verifier,redirect_uri:this.redirect_uri,authority:this.authority,client_id:this.client_id,response_mode:this.response_mode,client_secret:this.client_secret,scope:this.scope,extraTokenParams:this.extraTokenParams,skipUserInfo:this.skipUserInfo})},e.fromStorageString=function t(r){return n.Log.debug("SigninState.fromStorageString"),new e(JSON.parse(r))},i(e,[{key:"nonce",get:function t(){return this._nonce}},{key:"authority",get:function t(){return this._authority}},{key:"client_id",get:function t(){return this._client_id}},{key:"redirect_uri",get:function t(){return this._redirect_uri}},{key:"code_verifier",get:function t(){return this._code_verifier}},{key:"code_challenge",get:function t(){return this._code_challenge}},{key:"response_mode",get:function t(){return this._response_mode}},{key:"client_secret",get:function t(){return this._client_secret}},{key:"scope",get:function t(){return this._scope}},{key:"extraTokenParams",get:function t(){return this._extraTokenParams}},{key:"skipUserInfo",get:function t(){return this._skipUserInfo}}]),e}(o.State)},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function i(){return("undefined"!=n&&null!==n&&void 0!==n.getRandomValues?o:s)().replace(/-/g,"")};var n="undefined"!=typeof window?window.crypto||window.msCrypto:null;function o(){return([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,(function(t){return(t^n.getRandomValues(new Uint8Array(1))[0]&15>>t/4).toString(16)}))}function s(){return([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,(function(t){return(t^16*Math.random()>>t/4).toString(16)}))}t.exports=e.default},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.User=void 0;var i=function(){function t(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,r,i){return r&&t(e.prototype,r),i&&t(e,i),e}}(),n=r(0);e.User=function(){function t(e){var r=e.id_token,i=e.session_state,n=e.access_token,o=e.refresh_token,s=e.token_type,a=e.scope,h=e.profile,u=e.expires_at,f=e.state;!function c(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.id_token=r,this.session_state=i,this.access_token=n,this.refresh_token=o,this.token_type=s,this.scope=a,this.profile=h,this.expires_at=u,this.state=f}return t.prototype.toStorageString=function t(){return n.Log.debug("User.toStorageString"),JSON.stringify({id_token:this.id_token,session_state:this.session_state,access_token:this.access_token,refresh_token:this.refresh_token,token_type:this.token_type,scope:this.scope,profile:this.profile,expires_at:this.expires_at})},t.fromStorageString=function e(r){return n.Log.debug("User.fromStorageString"),new t(JSON.parse(r))},i(t,[{key:"expires_in",get:function t(){if(this.expires_at){var e=parseInt(Date.now()/1e3);return this.expires_at-e}},set:function t(e){var r=parseInt(e);if("number"==typeof r&&r>0){var i=parseInt(Date.now()/1e3);this.expires_at=i+r}}},{key:"expired",get:function t(){var e=this.expires_in;if(void 0!==e)return e<=0}},{key:"scopes",get:function t(){return(this.scope||"").split(" ")}}]),t}()},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.AccessTokenEvents=void 0;var i=r(0),n=r(391);function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}e.AccessTokenEvents=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=e.accessTokenExpiringNotificationTime,i=void 0===r?60:r,s=e.accessTokenExpiringTimer,a=void 0===s?new n.Timer("Access token expiring"):s,h=e.accessTokenExpiredTimer,u=void 0===h?new n.Timer("Access token expired"):h;o(this,t),this._accessTokenExpiringNotificationTime=i,this._accessTokenExpiring=a,this._accessTokenExpired=u}return t.prototype.load=function t(e){if(e.access_token&&void 0!==e.expires_in){var r=e.expires_in;if(i.Log.debug("AccessTokenEvents.load: access token present, remaining duration:",r),r>0){var n=r-this._accessTokenExpiringNotificationTime;n<=0&&(n=1),i.Log.debug("AccessTokenEvents.load: registering expiring timer in:",n),this._accessTokenExpiring.init(n)}else i.Log.debug("AccessTokenEvents.load: canceling existing expiring timer becase we're past expiration."),this._accessTokenExpiring.cancel();var o=r+1;i.Log.debug("AccessTokenEvents.load: registering expired timer in:",o),this._accessTokenExpired.init(o)}else this._accessTokenExpiring.cancel(),this._accessTokenExpired.cancel()},t.prototype.unload=function t(){i.Log.debug("AccessTokenEvents.unload: canceling existing access token timers"),this._accessTokenExpiring.cancel(),this._accessTokenExpired.cancel()},t.prototype.addAccessTokenExpiring=function t(e){this._accessTokenExpiring.addHandler(e)},t.prototype.removeAccessTokenExpiring=function t(e){this._accessTokenExpiring.removeHandler(e)},t.prototype.addAccessTokenExpired=function t(e){this._accessTokenExpired.addHandler(e)},t.prototype.removeAccessTokenExpired=function t(e){this._accessTokenExpired.removeHandler(e)},t}()},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Event=void 0;var i=r(0);e.Event=function(){function t(e){!function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this._name=e,this._callbacks=[]}return t.prototype.addHandler=function t(e){this._callbacks.push(e)},t.prototype.removeHandler=function t(e){var r=this._callbacks.findIndex((function(t){return t===e}));r>=0&&this._callbacks.splice(r,1)},t.prototype.raise=function t(){i.Log.debug("Event: Raising event: "+this._name);for(var e=0;e<this._callbacks.length;e++){var r;(r=this._callbacks)[e].apply(r,arguments)}},t}()},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SessionMonitor=void 0;var i=function(){function t(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,r,i){return r&&t(e.prototype,r),i&&t(e,i),e}}(),n=r(0),o=r(205),s=r(19);function a(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}e.SessionMonitor=function(){function t(e){var r=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o.CheckSessionIFrame,h=arguments.length>2&&void 0!==arguments[2]?arguments[2]:s.Global.timer;if(a(this,t),!e)throw n.Log.error("SessionMonitor.ctor: No user manager passed to SessionMonitor"),new Error("userManager");this._userManager=e,this._CheckSessionIFrameCtor=i,this._timer=h,this._userManager.events.addUserLoaded(this._start.bind(this)),this._userManager.events.addUserUnloaded(this._stop.bind(this)),Promise.resolve(this._userManager.getUser().then((function(t){t?r._start(t):r._settings.monitorAnonymousSession&&r._userManager.querySessionStatus().then((function(t){var e={session_state:t.session_state};t.sub&&t.sid&&(e.profile={sub:t.sub,sid:t.sid}),r._start(e)})).catch((function(t){n.Log.error("SessionMonitor ctor: error from querySessionStatus:",t.message)}))})).catch((function(t){n.Log.error("SessionMonitor ctor: error from getUser:",t.message)})))}return t.prototype._start=function t(e){var r=this,i=e.session_state;i&&(e.profile?(this._sub=e.profile.sub,this._sid=e.profile.sid,n.Log.debug("SessionMonitor._start: session_state:",i,", sub:",this._sub)):(this._sub=void 0,this._sid=void 0,n.Log.debug("SessionMonitor._start: session_state:",i,", anonymous user")),this._checkSessionIFrame?this._checkSessionIFrame.start(i):this._metadataService.getCheckSessionIframe().then((function(t){if(t){n.Log.debug("SessionMonitor._start: Initializing check session iframe");var e=r._client_id,o=r._checkSessionInterval,s=r._stopCheckSessionOnError;r._checkSessionIFrame=new r._CheckSessionIFrameCtor(r._callback.bind(r),e,t,o,s),r._checkSessionIFrame.load().then((function(){r._checkSessionIFrame.start(i)}))}else n.Log.warn("SessionMonitor._start: No check session iframe found in the metadata")})).catch((function(t){n.Log.error("SessionMonitor._start: Error from getCheckSessionIframe:",t.message)})))},t.prototype._stop=function t(){var e=this;if(this._sub=void 0,this._sid=void 0,this._checkSessionIFrame&&(n.Log.debug("SessionMonitor._stop"),this._checkSessionIFrame.stop()),this._settings.monitorAnonymousSession)var r=this._timer.setInterval((function(){e._timer.clearInterval(r),e._userManager.querySessionStatus().then((function(t){var r={session_state:t.session_state};t.sub&&t.sid&&(r.profile={sub:t.sub,sid:t.sid}),e._start(r)})).catch((function(t){n.Log.error("SessionMonitor: error from querySessionStatus:",t.message)}))}),1e3)},t.prototype._callback=function t(){var e=this;this._userManager.querySessionStatus().then((function(t){var r=!0;t?t.sub===e._sub?(r=!1,e._checkSessionIFrame.start(t.session_state),t.sid===e._sid?n.Log.debug("SessionMonitor._callback: Same sub still logged in at OP, restarting check session iframe; session_state:",t.session_state):(n.Log.debug("SessionMonitor._callback: Same sub still logged in at OP, session state has changed, restarting check session iframe; session_state:",t.session_state),e._userManager.events._raiseUserSessionChanged())):n.Log.debug("SessionMonitor._callback: Different subject signed into OP:",t.sub):n.Log.debug("SessionMonitor._callback: Subject no longer signed into OP"),r&&(e._sub?(n.Log.debug("SessionMonitor._callback: SessionMonitor._callback; raising signed out event"),e._userManager.events._raiseUserSignedOut()):(n.Log.debug("SessionMonitor._callback: SessionMonitor._callback; raising signed in event"),e._userManager.events._raiseUserSignedIn()))})).catch((function(t){e._sub&&(n.Log.debug("SessionMonitor._callback: Error calling queryCurrentSigninSession; raising signed out event",t.message),e._userManager.events._raiseUserSignedOut())}))},i(t,[{key:"_settings",get:function t(){return this._userManager.settings}},{key:"_metadataService",get:function t(){return this._userManager.metadataService}},{key:"_client_id",get:function t(){return this._settings.client_id}},{key:"_checkSessionInterval",get:function t(){return this._settings.checkSessionInterval}},{key:"_stopCheckSessionOnError",get:function t(){return this._settings.stopCheckSessionOnError}}]),t}()},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.CheckSessionIFrame=void 0;var i=r(0);function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}e.CheckSessionIFrame=function(){function t(e,r,i,o){var s=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];n(this,t),this._callback=e,this._client_id=r,this._url=i,this._interval=o||2e3,this._stopOnError=s;var a=i.indexOf("/",i.indexOf("//")+2);this._frame_origin=i.substr(0,a),this._frame=window.document.createElement("iframe"),this._frame.style.visibility="hidden",this._frame.style.position="absolute",this._frame.style.display="none",this._frame.width=0,this._frame.height=0,this._frame.src=i}return t.prototype.load=function t(){var e=this;return new Promise((function(t){e._frame.onload=function(){t()},window.document.body.appendChild(e._frame),e._boundMessageEvent=e._message.bind(e),window.addEventListener("message",e._boundMessageEvent,!1)}))},t.prototype._message=function t(e){e.origin===this._frame_origin&&e.source===this._frame.contentWindow&&("error"===e.data?(i.Log.error("CheckSessionIFrame: error message from check session op iframe"),this._stopOnError&&this.stop()):"changed"===e.data?(i.Log.debug("CheckSessionIFrame: changed message from check session op iframe"),this.stop(),this._callback()):i.Log.debug("CheckSessionIFrame: "+e.data+" message from check session op iframe"))},t.prototype.start=function t(e){var r=this;if(this._session_state!==e){i.Log.debug("CheckSessionIFrame.start"),this.stop(),this._session_state=e;var n=function t(){r._frame.contentWindow.postMessage(r._client_id+" "+r._session_state,r._frame_origin)};n(),this._timer=window.setInterval(n,this._interval)}},t.prototype.stop=function t(){this._session_state=null,this._timer&&(i.Log.debug("CheckSessionIFrame.stop"),window.clearInterval(this._timer),this._timer=null)},t}()},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TokenRevocationClient=void 0;var i=r(0),n=r(30),o=r(19);function s(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var a="access_token",h="refresh_token";e.TokenRevocationClient=function(){function t(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o.Global.XMLHttpRequest,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:n.MetadataService;if(s(this,t),!e)throw i.Log.error("TokenRevocationClient.ctor: No settings provided"),new Error("No settings provided.");this._settings=e,this._XMLHttpRequestCtor=r,this._metadataService=new a(this._settings)}return t.prototype.revoke=function t(e,r){var n=this,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"access_token";if(!e)throw i.Log.error("TokenRevocationClient.revoke: No token provided"),new Error("No token provided.");if(o!==a&&o!=h)throw i.Log.error("TokenRevocationClient.revoke: Invalid token type"),new Error("Invalid token type.");return this._metadataService.getRevocationEndpoint().then((function(t){if(t){i.Log.debug("TokenRevocationClient.revoke: Revoking "+o);var s=n._settings.client_id,a=n._settings.client_secret;return n._revoke(t,s,a,e,o)}if(r)throw i.Log.error("TokenRevocationClient.revoke: Revocation not supported"),new Error("Revocation not supported")}))},t.prototype._revoke=function t(e,r,n,o,s){var a=this;return new Promise((function(t,h){var u=new a._XMLHttpRequestCtor;u.open("POST",e),u.onload=function(){i.Log.debug("TokenRevocationClient.revoke: HTTP response received, status",u.status),200===u.status?t():h(Error(u.statusText+" ("+u.status+")"))},u.onerror=function(){i.Log.debug("TokenRevocationClient.revoke: Network Error."),h("Network Error")};var f="client_id="+encodeURIComponent(r);n&&(f+="&client_secret="+encodeURIComponent(n)),f+="&token_type_hint="+encodeURIComponent(s),f+="&token="+encodeURIComponent(o),u.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),u.send(f)}))},t}()},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.CordovaPopupWindow=void 0;var i=function(){function t(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,r,i){return r&&t(e.prototype,r),i&&t(e,i),e}}(),n=r(0);e.CordovaPopupWindow=function(){function t(e){var r=this;!function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this._promise=new Promise((function(t,e){r._resolve=t,r._reject=e})),this.features=e.popupWindowFeatures||"location=no,toolbar=no,zoom=no",this.target=e.popupWindowTarget||"_blank",this.redirect_uri=e.startUrl,n.Log.debug("CordovaPopupWindow.ctor: redirect_uri: "+this.redirect_uri)}return t.prototype._isInAppBrowserInstalled=function t(e){return["cordova-plugin-inappbrowser","cordova-plugin-inappbrowser.inappbrowser","org.apache.cordova.inappbrowser"].some((function(t){return e.hasOwnProperty(t)}))},t.prototype.navigate=function t(e){if(e&&e.url){if(!window.cordova)return this._error("cordova is undefined");var r=window.cordova.require("cordova/plugin_list").metadata;if(!1===this._isInAppBrowserInstalled(r))return this._error("InAppBrowser plugin not found");this._popup=cordova.InAppBrowser.open(e.url,this.target,this.features),this._popup?(n.Log.debug("CordovaPopupWindow.navigate: popup successfully created"),this._exitCallbackEvent=this._exitCallback.bind(this),this._loadStartCallbackEvent=this._loadStartCallback.bind(this),this._popup.addEventListener("exit",this._exitCallbackEvent,!1),this._popup.addEventListener("loadstart",this._loadStartCallbackEvent,!1)):this._error("Error opening popup window")}else this._error("No url provided");return this.promise},t.prototype._loadStartCallback=function t(e){0===e.url.indexOf(this.redirect_uri)&&this._success({url:e.url})},t.prototype._exitCallback=function t(e){this._error(e)},t.prototype._success=function t(e){this._cleanup(),n.Log.debug("CordovaPopupWindow: Successful response from cordova popup window"),this._resolve(e)},t.prototype._error=function t(e){this._cleanup(),n.Log.error(e),this._reject(new Error(e))},t.prototype.close=function t(){this._cleanup()},t.prototype._cleanup=function t(){this._popup&&(n.Log.debug("CordovaPopupWindow: cleaning up popup"),this._popup.removeEventListener("exit",this._exitCallbackEvent,!1),this._popup.removeEventListener("loadstart",this._loadStartCallbackEvent,!1),this._popup.close()),this._popup=null},i(t,[{key:"promise",get:function t(){return this._promise}}]),t}()},function(t,e,r){r(209),t.exports=r(268)},function(t,e,r){"use strict";r(210),r(245),r(249),r(253),r(256),r(260),r(263)},function(t,e,r){var i=r(211);r(241),r(242),r(243),r(244),t.exports=i},function(t,e,r){r(114),r(224),r(226),r(134),r(135),r(234),r(235),r(238);var i=r(52);t.exports=i.Promise},function(t,e,r){var i=r(3),n=r(73),o=i.WeakMap;t.exports="function"==typeof o&&/native code/.test(n(o))},function(t,e,r){var i=r(12),n=r(214),o=r(67),s=r(21);t.exports=function(t,e){for(var r=n(e),a=s.f,h=o.f,u=0;u<r.length;u++){var f=r[u];i(t,f)||a(t,f,h(e,f))}}},function(t,e,r){var i=r(22),n=r(215),o=r(121),s=r(15);t.exports=i("Reflect","ownKeys")||function t(e){var r=n.f(s(e)),i=o.f;return i?r.concat(i(e)):r}},function(t,e,r){var i=r(119),n=r(77).concat("length","prototype");e.f=Object.getOwnPropertyNames||function t(e){return i(e,n)}},function(t,e,r){var i=r(49),n=r(53),o=r(120),s=function(t){return function(e,r,s){var a,h=i(e),u=n(h.length),f=o(s,u);if(t&&r!=r){for(;u>f;)if((a=h[f++])!=a)return!0}else for(;u>f;f++)if((t||f in h)&&h[f]===r)return t||f||0;return!t&&-1}};t.exports={includes:s(!0),indexOf:s(!1)}},function(t,e,r){var i=r(9);t.exports=!i((function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype}))},function(t,e,r){var i=r(14);t.exports=function(t){if(!i(t)&&null!==t)throw TypeError("Can't set "+String(t)+" as a prototype");return t}},function(t,e,r){var i=r(17),n=r(21),o=r(15),s=r(124);t.exports=i?Object.defineProperties:function t(e,r){o(e);for(var i,a=s(r),h=a.length,u=0;h>u;)n.f(e,i=a[u++],r[i]);return e}},function(t,e,r){var i=r(6),n=r(41),o=i("iterator"),s=Array.prototype;t.exports=function(t){return void 0!==t&&(n.Array===t||s[o]===t)}},function(t,e,r){var i=r(126);t.exports=i&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},function(t,e,r){var i=r(127),n=r(41),o=r(6)("iterator");t.exports=function(t){if(null!=t)return t[o]||t["@@iterator"]||n[i(t)]}},function(t,e,r){var i=r(15);t.exports=function(t){var e=t.return;if(void 0!==e)return i(e.call(t)).value}},function(t,e,r){var i=r(80),n=r(29),o=r(225);i||n(Object.prototype,"toString",o,{unsafe:!0})},function(t,e,r){"use strict";var i=r(80),n=r(127);t.exports=i?{}.toString:function t(){return"[object "+n(this)+"]"}},function(t,e,r){"use strict";var i,n,o,s,a=r(8),h=r(40),u=r(3),f=r(22),c=r(128),l=r(29),d=r(227),p=r(81),m=r(228),g=r(14),v=r(23),b=r(229),y=r(73),w=r(56),_=r(230),M=r(129),S=r(130).set,k=r(231),E=r(132),R=r(233),A=r(42),x=r(58),T=r(51),P=r(122),I=r(6),L=r(83),O=r(133),B=I("species"),j="Promise",C=T.get,U=T.set,N=T.getterFor(j),q=c,D=u.TypeError,z=u.document,F=u.process,W=f("fetch"),H=A.f,K=H,Z=!!(z&&z.createEvent&&u.dispatchEvent),V="function"==typeof PromiseRejectionEvent,J="unhandledrejection",Y=P(j,(function(){if(!(y(q)!==String(q))){if(66===O)return!0;if(!L&&!V)return!0}if(h&&!q.prototype.finally)return!0;if(O>=51&&/native code/.test(q))return!1;var t=q.resolve(1),e=function(t){t((function(){}),(function(){}))};return(t.constructor={})[B]=e,!(t.then((function(){}))instanceof e)})),G=Y||!_((function(t){q.all(t).catch((function(){}))})),X=function(t){var e;return!(!g(t)||"function"!=typeof(e=t.then))&&e},Q=function(t,e){if(!t.notified){t.notified=!0;var r=t.reactions;k((function(){for(var i=t.value,n=1==t.state,o=0;r.length>o;){var s,a,h,u=r[o++],f=n?u.ok:u.fail,c=u.resolve,l=u.reject,d=u.domain;try{f?(n||(2===t.rejection&&rt(t),t.rejection=1),!0===f?s=i:(d&&d.enter(),s=f(i),d&&(d.exit(),h=!0)),s===u.promise?l(D("Promise-chain cycle")):(a=X(s))?a.call(s,c,l):c(s)):l(i)}catch(t){d&&!h&&d.exit(),l(t)}}t.reactions=[],t.notified=!1,e&&!t.rejection&&tt(t)}))}},$=function(t,e,r){var i,n;Z?((i=z.createEvent("Event")).promise=e,i.reason=r,i.initEvent(t,!1,!0),u.dispatchEvent(i)):i={promise:e,reason:r},!V&&(n=u["on"+t])?n(i):t===J&&R("Unhandled promise rejection",r)},tt=function(t){S.call(u,(function(){var e,r=t.facade,i=t.value;if(et(t)&&(e=x((function(){L?F.emit("unhandledRejection",i,r):$(J,r,i)})),t.rejection=L||et(t)?2:1,e.error))throw e.value}))},et=function(t){return 1!==t.rejection&&!t.parent},rt=function(t){S.call(u,(function(){var e=t.facade;L?F.emit("rejectionHandled",e):$("rejectionhandled",e,t.value)}))},it=function(t,e,r){return function(i){t(e,i,r)}},nt=function(t,e,r){t.done||(t.done=!0,r&&(t=r),t.value=e,t.state=2,Q(t,!0))},ot=function(t,e,r){if(!t.done){t.done=!0,r&&(t=r);try{if(t.facade===e)throw D("Promise can't be resolved itself");var i=X(e);i?k((function(){var r={done:!1};try{i.call(e,it(ot,r,t),it(nt,r,t))}catch(e){nt(r,e,t)}})):(t.value=e,t.state=1,Q(t,!1))}catch(e){nt({done:!1},e,t)}}};Y&&(q=function t(e){b(this,q,j),v(e),i.call(this);var r=C(this);try{e(it(ot,r),it(nt,r))}catch(t){nt(r,t)}},(i=function t(e){U(this,{type:j,done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:0,value:void 0})}).prototype=d(q.prototype,{then:function t(e,r){var i=N(this),n=H(M(this,q));return n.ok="function"!=typeof e||e,n.fail="function"==typeof r&&r,n.domain=L?F.domain:void 0,i.parent=!0,i.reactions.push(n),0!=i.state&&Q(i,!1),n.promise},catch:function(t){return this.then(void 0,t)}}),n=function(){var t=new i,e=C(t);this.promise=t,this.resolve=it(ot,e),this.reject=it(nt,e)},A.f=H=function(t){return t===q||t===o?new n(t):K(t)},h||"function"!=typeof c||(s=c.prototype.then,l(c.prototype,"then",(function t(e,r){var i=this;return new q((function(t,e){s.call(i,t,e)})).then(e,r)}),{unsafe:!0}),"function"==typeof W&&a({global:!0,enumerable:!0,forced:!0},{fetch:function t(e){return E(q,W.apply(u,arguments))}}))),a({global:!0,wrap:!0,forced:Y},{Promise:q}),p(q,j,!1,!0),m(j),o=f(j),a({target:j,stat:!0,forced:Y},{reject:function t(e){var r=H(this);return r.reject.call(void 0,e),r.promise}}),a({target:j,stat:!0,forced:h||Y},{resolve:function t(e){return E(h&&this===o?q:this,e)}}),a({target:j,stat:!0,forced:G},{all:function t(e){var r=this,i=H(r),n=i.resolve,o=i.reject,s=x((function(){var t=v(r.resolve),i=[],s=0,a=1;w(e,(function(e){var h=s++,u=!1;i.push(void 0),a++,t.call(r,e).then((function(t){u||(u=!0,i[h]=t,--a||n(i))}),o)})),--a||n(i)}));return s.error&&o(s.value),i.promise},race:function t(e){var r=this,i=H(r),n=i.reject,o=x((function(){var t=v(r.resolve);w(e,(function(e){t.call(r,e).then(i.resolve,n)}))}));return o.error&&n(o.value),i.promise}})},function(t,e,r){var i=r(29);t.exports=function(t,e,r){for(var n in e)i(t,n,e[n],r);return t}},function(t,e,r){"use strict";var i=r(22),n=r(21),o=r(6),s=r(17),a=o("species");t.exports=function(t){var e=i(t),r=n.f;s&&e&&!e[a]&&r(e,a,{configurable:!0,get:function(){return this}})}},function(t,e){t.exports=function(t,e,r){if(!(t instanceof e))throw TypeError("Incorrect "+(r?r+" ":"")+"invocation");return t}},function(t,e,r){var i=r(6)("iterator"),n=!1;try{var o=0,s={next:function(){return{done:!!o++}},return:function(){n=!0}};s[i]=function(){return this},Array.from(s,(function(){throw 2}))}catch(t){}t.exports=function(t,e){if(!e&&!n)return!1;var r=!1;try{var o={};o[i]=function(){return{next:function(){return{done:r=!0}}}},t(o)}catch(t){}return r}},function(t,e,r){var i,n,o,s,a,h,u,f,c=r(3),l=r(67).f,d=r(130).set,p=r(131),m=r(232),g=r(83),v=c.MutationObserver||c.WebKitMutationObserver,b=c.document,y=c.process,w=c.Promise,_=l(c,"queueMicrotask"),M=_&&_.value;M||(i=function(){var t,e;for(g&&(t=y.domain)&&t.exit();n;){e=n.fn,n=n.next;try{e()}catch(t){throw n?s():o=void 0,t}}o=void 0,t&&t.enter()},p||g||m||!v||!b?w&&w.resolve?(u=w.resolve(void 0),f=u.then,s=function(){f.call(u,i)}):s=g?function(){y.nextTick(i)}:function(){d.call(c,i)}:(a=!0,h=b.createTextNode(""),new v(i).observe(h,{characterData:!0}),s=function(){h.data=a=!a})),t.exports=M||function(t){var e={fn:t,next:void 0};o&&(o.next=e),n||(n=e,s()),o=e}},function(t,e,r){var i=r(82);t.exports=/web0s(?!.*chrome)/i.test(i)},function(t,e,r){var i=r(3);t.exports=function(t,e){var r=i.console;r&&r.error&&(1===arguments.length?r.error(t):r.error(t,e))}},function(t,e,r){"use strict";var i=r(8),n=r(40),o=r(128),s=r(9),a=r(22),h=r(129),u=r(132),f=r(29);i({target:"Promise",proto:!0,real:!0,forced:!!o&&s((function(){o.prototype.finally.call({then:function(){}},(function(){}))}))},{finally:function(t){var e=h(this,a("Promise")),r="function"==typeof t;return this.then(r?function(r){return u(e,t()).then((function(){return r}))}:t,r?function(r){return u(e,t()).then((function(){throw r}))}:t)}}),n||"function"!=typeof o||o.prototype.finally||f(o.prototype,"finally",a("Promise").prototype.finally)},function(t,e,r){"use strict";var i=r(236).charAt,n=r(51),o=r(136),s="String Iterator",a=n.set,h=n.getterFor(s);o(String,"String",(function(t){a(this,{type:s,string:String(t),index:0})}),(function t(){var e,r=h(this),n=r.string,o=r.index;return o>=n.length?{value:void 0,done:!0}:(e=i(n,o),r.index+=e.length,{value:e,done:!1})}))},function(t,e,r){var i=r(54),n=r(69),o=function(t){return function(e,r){var o,s,a=String(n(e)),h=i(r),u=a.length;return h<0||h>=u?t?"":void 0:(o=a.charCodeAt(h))<55296||o>56319||h+1===u||(s=a.charCodeAt(h+1))<56320||s>57343?t?a.charAt(h):o:t?a.slice(h,h+2):s-56320+(o-55296<<10)+65536}};t.exports={codeAt:o(!1),charAt:o(!0)}},function(t,e,r){"use strict";var i=r(137).IteratorPrototype,n=r(79),o=r(39),s=r(81),a=r(41),h=function(){return this};t.exports=function(t,e,r){var u=e+" Iterator";return t.prototype=n(i,{next:o(1,r)}),s(t,u,!1,!0),a[u]=h,t}},function(t,e,r){var i=r(3),n=r(239),o=r(240),s=r(18),a=r(6),h=a("iterator"),u=a("toStringTag"),f=o.values;for(var c in n){var l=i[c],d=l&&l.prototype;if(d){if(d[h]!==f)try{s(d,h,f)}catch(t){d[h]=f}if(d[u]||s(d,u,c),n[c])for(var p in o)if(d[p]!==o[p])try{s(d,p,o[p])}catch(t){d[p]=o[p]}}}},function(t,e){t.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},function(t,e,r){"use strict";var i=r(49),n=r(138),o=r(41),s=r(51),a=r(136),h="Array Iterator",u=s.set,f=s.getterFor(h);t.exports=a(Array,"Array",(function(t,e){u(this,{type:h,target:i(t),index:0,kind:e})}),(function(){var t=f(this),e=t.target,r=t.kind,i=t.index++;return!e||i>=e.length?(t.target=void 0,{value:void 0,done:!0}):"keys"==r?{value:i,done:!1}:"values"==r?{value:e[i],done:!1}:{value:[i,e[i]],done:!1}}),"values"),o.Arguments=o.Array,n("keys"),n("values"),n("entries")},function(t,e,r){r(114)},function(t,e,r){r(134)},function(t,e,r){"use strict";var i=r(8),n=r(42),o=r(58);i({target:"Promise",stat:!0},{try:function(t){var e=n.f(this),r=o(t);return(r.error?e.reject:e.resolve)(r.value),e.promise}})},function(t,e,r){r(135)},function(t,e,r){var i=r(246);t.exports=i},function(t,e,r){r(247);var i=r(59);t.exports=i("Function","bind")},function(t,e,r){r(8)({target:"Function",proto:!0},{bind:r(248)})},function(t,e,r){"use strict";var i=r(23),n=r(14),o=[].slice,s={},a=function(t,e,r){if(!(e in s)){for(var i=[],n=0;n<e;n++)i[n]="a["+n+"]";s[e]=Function("C,a","return new C("+i.join(",")+")")}return s[e](t,r)};t.exports=Function.bind||function t(e){var r=i(this),s=o.call(arguments,1),h=function t(){var i=s.concat(o.call(arguments));return this instanceof h?a(r,i.length,i):r.apply(e,i)};return n(r.prototype)&&(h.prototype=r.prototype),h}},function(t,e,r){var i=r(250);t.exports=i},function(t,e,r){r(251);var i=r(52);t.exports=i.Object.assign},function(t,e,r){var i=r(8),n=r(252);i({target:"Object",stat:!0,forced:Object.assign!==n},{assign:n})},function(t,e,r){"use strict";var i=r(17),n=r(9),o=r(124),s=r(121),a=r(115),h=r(55),u=r(68),f=Object.assign,c=Object.defineProperty;t.exports=!f||n((function(){if(i&&1!==f({b:1},f(c({},"a",{enumerable:!0,get:function(){c(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var t={},e={},r=Symbol(),n="abcdefghijklmnopqrst";return t[r]=7,n.split("").forEach((function(t){e[t]=t})),7!=f({},t)[r]||o(f({},e)).join("")!=n}))?function t(e,r){for(var n=h(e),f=arguments.length,c=1,l=s.f,d=a.f;f>c;)for(var p,m=u(arguments[c++]),g=l?o(m).concat(l(m)):o(m),v=g.length,b=0;v>b;)p=g[b++],i&&!d.call(m,p)||(n[p]=m[p]);return n}:f},function(t,e,r){var i=r(254);t.exports=i},function(t,e,r){r(255);var i=r(59);t.exports=i("Array","find")},function(t,e,r){"use strict";var i=r(8),n=r(139).find,o=r(138),s=r(84),a="find",h=!0,u=s(a);a in[]&&Array(1).find((function(){h=!1})),i({target:"Array",proto:!0,forced:h||!u},{find:function t(e){return n(this,e,arguments.length>1?arguments[1]:void 0)}}),o(a)},function(t,e,r){var i=r(257);t.exports=i},function(t,e,r){r(258);var i=r(59);t.exports=i("Array","some")},function(t,e,r){"use strict";var i=r(8),n=r(139).some,o=r(259),s=r(84),a=o("some"),h=s("some");i({target:"Array",proto:!0,forced:!a||!h},{some:function t(e){return n(this,e,arguments.length>1?arguments[1]:void 0)}})},function(t,e,r){"use strict";var i=r(9);t.exports=function(t,e){var r=[][t];return!!r&&i((function(){r.call(null,e||function(){throw 1},1)}))}},function(t,e,r){var i=r(261);t.exports=i},function(t,e,r){r(262);var i=r(52);t.exports=i.Array.isArray},function(t,e,r){r(8)({target:"Array",stat:!0},{isArray:r(141)})},function(t,e,r){var i=r(264);t.exports=i},function(t,e,r){r(265);var i=r(59);t.exports=i("Array","splice")},function(t,e,r){"use strict";var i=r(8),n=r(120),o=r(54),s=r(53),a=r(55),h=r(140),u=r(266),f=r(267),c=r(84),l=f("splice"),d=c("splice",{ACCESSORS:!0,0:0,1:2}),p=Math.max,m=Math.min,g=9007199254740991,v="Maximum allowed length exceeded";i({target:"Array",proto:!0,forced:!l||!d},{splice:function t(e,r){var i,f,c,l,d,b,y=a(this),w=s(y.length),_=n(e,w),M=arguments.length;if(0===M?i=f=0:1===M?(i=0,f=w-_):(i=M-2,f=m(p(o(r),0),w-_)),w+i-f>g)throw TypeError(v);for(c=h(y,f),l=0;l<f;l++)(d=_+l)in y&&u(c,l,y[d]);if(c.length=f,i<f){for(l=_;l<w-f;l++)b=l+i,(d=l+f)in y?y[b]=y[d]:delete y[b];for(l=w;l>w-f+i;l--)delete y[l-1]}else if(i>f)for(l=w-f;l>_;l--)b=l+i-1,(d=l+f-1)in y?y[b]=y[d]:delete y[b];for(l=0;l<i;l++)y[l+_]=arguments[l+2];return y.length=w-f+i,c}})},function(t,e,r){"use strict";var i=r(70),n=r(21),o=r(39);t.exports=function(t,e,r){var s=i(e);s in t?n.f(t,s,o(0,r)):t[s]=r}},function(t,e,r){var i=r(9),n=r(6),o=r(133),s=n("species");t.exports=function(t){return o>=51||!i((function(){var e=[];return(e.constructor={})[s]=function(){return{foo:1}},1!==e[t](Boolean).foo}))}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=r(0),n=r(142),o=r(85),s=r(86),a=r(382),h=r(383),u=r(202),f=r(30),c=r(393),l=r(394),d=r(205),p=r(206),m=r(204),g=r(19),v=r(201),b=r(395);e.default={Version:b.Version,Log:i.Log,OidcClient:n.OidcClient,OidcClientSettings:o.OidcClientSettings,WebStorageStateStore:s.WebStorageStateStore,InMemoryWebStorage:a.InMemoryWebStorage,UserManager:h.UserManager,AccessTokenEvents:u.AccessTokenEvents,MetadataService:f.MetadataService,CordovaPopupNavigator:c.CordovaPopupNavigator,CordovaIFrameNavigator:l.CordovaIFrameNavigator,CheckSessionIFrame:d.CheckSessionIFrame,TokenRevocationClient:p.TokenRevocationClient,SessionMonitor:m.SessionMonitor,Global:g.Global,User:v.User},t.exports=e.default},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.ClockService=function(){function t(){!function e(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}(this,t)}return t.prototype.getEpochTime=function t(){return Promise.resolve(Date.now()/1e3|0)},t}()},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ResponseValidator=void 0;var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n=r(0),o=r(30),s=r(271),a=r(197),h=r(198),u=r(60);function f(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var c=["nonce","at_hash","iat","nbf","exp","aud","iss","c_hash"];e.ResponseValidator=function(){function t(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o.MetadataService,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:s.UserInfoService,h=arguments.length>3&&void 0!==arguments[3]?arguments[3]:u.JoseUtil,c=arguments.length>4&&void 0!==arguments[4]?arguments[4]:a.TokenClient;if(f(this,t),!e)throw n.Log.error("ResponseValidator.ctor: No settings passed to ResponseValidator"),new Error("settings");this._settings=e,this._metadataService=new r(this._settings),this._userInfoService=new i(this._settings),this._joseUtil=h,this._tokenClient=new c(this._settings)}return t.prototype.validateSigninResponse=function t(e,r){var i=this;return n.Log.debug("ResponseValidator.validateSigninResponse"),this._processSigninParams(e,r).then((function(t){return n.Log.debug("ResponseValidator.validateSigninResponse: state processed"),i._validateTokens(e,t).then((function(t){return n.Log.debug("ResponseValidator.validateSigninResponse: tokens validated"),i._processClaims(e,t).then((function(t){return n.Log.debug("ResponseValidator.validateSigninResponse: claims processed"),t}))}))}))},t.prototype.validateSignoutResponse=function t(e,r){return e.id!==r.state?(n.Log.error("ResponseValidator.validateSignoutResponse: State does not match"),Promise.reject(new Error("State does not match"))):(n.Log.debug("ResponseValidator.validateSignoutResponse: state validated"),r.state=e.data,r.error?(n.Log.warn("ResponseValidator.validateSignoutResponse: Response was error",r.error),Promise.reject(new h.ErrorResponse(r))):Promise.resolve(r))},t.prototype._processSigninParams=function t(e,r){if(e.id!==r.state)return n.Log.error("ResponseValidator._processSigninParams: State does not match"),Promise.reject(new Error("State does not match"));if(!e.client_id)return n.Log.error("ResponseValidator._processSigninParams: No client_id on state"),Promise.reject(new Error("No client_id on state"));if(!e.authority)return n.Log.error("ResponseValidator._processSigninParams: No authority on state"),Promise.reject(new Error("No authority on state"));if(this._settings.authority){if(this._settings.authority&&this._settings.authority!==e.authority)return n.Log.error("ResponseValidator._processSigninParams: authority mismatch on settings vs. signin state"),Promise.reject(new Error("authority mismatch on settings vs. signin state"))}else this._settings.authority=e.authority;if(this._settings.client_id){if(this._settings.client_id&&this._settings.client_id!==e.client_id)return n.Log.error("ResponseValidator._processSigninParams: client_id mismatch on settings vs. signin state"),Promise.reject(new Error("client_id mismatch on settings vs. signin state"))}else this._settings.client_id=e.client_id;return n.Log.debug("ResponseValidator._processSigninParams: state validated"),r.state=e.data,r.error?(n.Log.warn("ResponseValidator._processSigninParams: Response was error",r.error),Promise.reject(new h.ErrorResponse(r))):e.nonce&&!r.id_token?(n.Log.error("ResponseValidator._processSigninParams: Expecting id_token in response"),Promise.reject(new Error("No id_token in response"))):!e.nonce&&r.id_token?(n.Log.error("ResponseValidator._processSigninParams: Not expecting id_token in response"),Promise.reject(new Error("Unexpected id_token in response"))):e.code_verifier&&!r.code?(n.Log.error("ResponseValidator._processSigninParams: Expecting code in response"),Promise.reject(new Error("No code in response"))):!e.code_verifier&&r.code?(n.Log.error("ResponseValidator._processSigninParams: Not expecting code in response"),Promise.reject(new Error("Unexpected code in response"))):(r.scope||(r.scope=e.scope),Promise.resolve(r))},t.prototype._processClaims=function t(e,r){var i=this;if(r.isOpenIdConnect){if(n.Log.debug("ResponseValidator._processClaims: response is OIDC, processing claims"),r.profile=this._filterProtocolClaims(r.profile),!0!==e.skipUserInfo&&this._settings.loadUserInfo&&r.access_token)return n.Log.debug("ResponseValidator._processClaims: loading user info"),this._userInfoService.getClaims(r.access_token).then((function(t){return n.Log.debug("ResponseValidator._processClaims: user info claims received from user info endpoint"),t.sub!==r.profile.sub?(n.Log.error("ResponseValidator._processClaims: sub from user info endpoint does not match sub in id_token"),Promise.reject(new Error("sub from user info endpoint does not match sub in id_token"))):(r.profile=i._mergeClaims(r.profile,t),n.Log.debug("ResponseValidator._processClaims: user info claims received, updated profile:",r.profile),r)}));n.Log.debug("ResponseValidator._processClaims: not loading user info")}else n.Log.debug("ResponseValidator._processClaims: response is not OIDC, not processing claims");return Promise.resolve(r)},t.prototype._mergeClaims=function t(e,r){var n=Object.assign({},e);for(var o in r){var s=r[o];Array.isArray(s)||(s=[s]);for(var a=0;a<s.length;a++){var h=s[a];n[o]?Array.isArray(n[o])?n[o].indexOf(h)<0&&n[o].push(h):n[o]!==h&&("object"===(void 0===h?"undefined":i(h))&&this._settings.mergeClaims?n[o]=this._mergeClaims(n[o],h):n[o]=[n[o],h]):n[o]=h}}return n},t.prototype._filterProtocolClaims=function t(e){n.Log.debug("ResponseValidator._filterProtocolClaims, incoming claims:",e);var r=Object.assign({},e);return this._settings._filterProtocolClaims?(c.forEach((function(t){delete r[t]})),n.Log.debug("ResponseValidator._filterProtocolClaims: protocol claims filtered",r)):n.Log.debug("ResponseValidator._filterProtocolClaims: protocol claims not filtered"),r},t.prototype._validateTokens=function t(e,r){return r.code?(n.Log.debug("ResponseValidator._validateTokens: Validating code"),this._processCode(e,r)):r.id_token?r.access_token?(n.Log.debug("ResponseValidator._validateTokens: Validating id_token and access_token"),this._validateIdTokenAndAccessToken(e,r)):(n.Log.debug("ResponseValidator._validateTokens: Validating id_token"),this._validateIdToken(e,r)):(n.Log.debug("ResponseValidator._validateTokens: No code to process or id_token to validate"),Promise.resolve(r))},t.prototype._processCode=function t(e,r){var o=this,s={client_id:e.client_id,client_secret:e.client_secret,code:r.code,redirect_uri:e.redirect_uri,code_verifier:e.code_verifier};return e.extraTokenParams&&"object"===i(e.extraTokenParams)&&Object.assign(s,e.extraTokenParams),this._tokenClient.exchangeCode(s).then((function(t){for(var i in t)r[i]=t[i];return r.id_token?(n.Log.debug("ResponseValidator._processCode: token response successful, processing id_token"),o._validateIdTokenAttributes(e,r)):(n.Log.debug("ResponseValidator._processCode: token response successful, returning response"),r)}))},t.prototype._validateIdTokenAttributes=function t(e,r){var i=this;return this._metadataService.getIssuer().then((function(t){var o=e.client_id,s=i._settings.clockSkew;return n.Log.debug("ResponseValidator._validateIdTokenAttributes: Validaing JWT attributes; using clock skew (in seconds) of: ",s),i._settings.getEpochTime().then((function(a){return i._joseUtil.validateJwtAttributes(r.id_token,t,o,s,a).then((function(t){return e.nonce&&e.nonce!==t.nonce?(n.Log.error("ResponseValidator._validateIdTokenAttributes: Invalid nonce in id_token"),Promise.reject(new Error("Invalid nonce in id_token"))):t.sub?(r.profile=t,r):(n.Log.error("ResponseValidator._validateIdTokenAttributes: No sub present in id_token"),Promise.reject(new Error("No sub present in id_token")))}))}))}))},t.prototype._validateIdTokenAndAccessToken=function t(e,r){var i=this;return this._validateIdToken(e,r).then((function(t){return i._validateAccessToken(t)}))},t.prototype._getSigningKeyForJwt=function t(e){var r=this;return this._metadataService.getSigningKeys().then((function(t){var i=e.header.kid;if(!t)return n.Log.error("ResponseValidator._validateIdToken: No signing keys from metadata"),Promise.reject(new Error("No signing keys from metadata"));n.Log.debug("ResponseValidator._validateIdToken: Received signing keys");var o=void 0;if(i)o=t.filter((function(t){return t.kid===i}))[0];else{if((t=r._filterByAlg(t,e.header.alg)).length>1)return n.Log.error("ResponseValidator._validateIdToken: No kid found in id_token and more than one key found in metadata"),Promise.reject(new Error("No kid found in id_token and more than one key found in metadata"));o=t[0]}return Promise.resolve(o)}))},t.prototype._getSigningKeyForJwtWithSingleRetry=function t(e){var r=this;return this._getSigningKeyForJwt(e).then((function(t){return t?Promise.resolve(t):(r._metadataService.resetSigningKeys(),r._getSigningKeyForJwt(e))}))},t.prototype._validateIdToken=function t(e,r){var i=this;if(!e.nonce)return n.Log.error("ResponseValidator._validateIdToken: No nonce on state"),Promise.reject(new Error("No nonce on state"));var o=this._joseUtil.parseJwt(r.id_token);return o&&o.header&&o.payload?e.nonce!==o.payload.nonce?(n.Log.error("ResponseValidator._validateIdToken: Invalid nonce in id_token"),Promise.reject(new Error("Invalid nonce in id_token"))):this._metadataService.getIssuer().then((function(t){return n.Log.debug("ResponseValidator._validateIdToken: Received issuer"),i._getSigningKeyForJwtWithSingleRetry(o).then((function(s){if(!s)return n.Log.error("ResponseValidator._validateIdToken: No key matching kid or alg found in signing keys"),Promise.reject(new Error("No key matching kid or alg found in signing keys"));var a=e.client_id,h=i._settings.clockSkew;return n.Log.debug("ResponseValidator._validateIdToken: Validaing JWT; using clock skew (in seconds) of: ",h),i._joseUtil.validateJwt(r.id_token,s,t,a,h).then((function(){return n.Log.debug("ResponseValidator._validateIdToken: JWT validation successful"),o.payload.sub?(r.profile=o.payload,r):(n.Log.error("ResponseValidator._validateIdToken: No sub present in id_token"),Promise.reject(new Error("No sub present in id_token")))}))}))})):(n.Log.error("ResponseValidator._validateIdToken: Failed to parse id_token",o),Promise.reject(new Error("Failed to parse id_token")))},t.prototype._filterByAlg=function t(e,r){var i=null;if(r.startsWith("RS"))i="RSA";else if(r.startsWith("PS"))i="PS";else{if(!r.startsWith("ES"))return n.Log.debug("ResponseValidator._filterByAlg: alg not supported: ",r),[];i="EC"}return n.Log.debug("ResponseValidator._filterByAlg: Looking for keys that match kty: ",i),e=e.filter((function(t){return t.kty===i})),n.Log.debug("ResponseValidator._filterByAlg: Number of keys that match kty: ",i,e.length),e},t.prototype._validateAccessToken=function t(e){if(!e.profile)return n.Log.error("ResponseValidator._validateAccessToken: No profile loaded from id_token"),Promise.reject(new Error("No profile loaded from id_token"));if(!e.profile.at_hash)return n.Log.error("ResponseValidator._validateAccessToken: No at_hash in id_token"),Promise.reject(new Error("No at_hash in id_token"));if(!e.id_token)return n.Log.error("ResponseValidator._validateAccessToken: No id_token"),Promise.reject(new Error("No id_token"));var r=this._joseUtil.parseJwt(e.id_token);if(!r||!r.header)return n.Log.error("ResponseValidator._validateAccessToken: Failed to parse id_token",r),Promise.reject(new Error("Failed to parse id_token"));var i=r.header.alg;if(!i||5!==i.length)return n.Log.error("ResponseValidator._validateAccessToken: Unsupported alg:",i),Promise.reject(new Error("Unsupported alg: "+i));var o=i.substr(2,3);if(!o)return n.Log.error("ResponseValidator._validateAccessToken: Unsupported alg:",i,o),Promise.reject(new Error("Unsupported alg: "+i));if(256!==(o=parseInt(o))&&384!==o&&512!==o)return n.Log.error("ResponseValidator._validateAccessToken: Unsupported alg:",i,o),Promise.reject(new Error("Unsupported alg: "+i));var s="sha"+o,a=this._joseUtil.hashString(e.access_token,s);if(!a)return n.Log.error("ResponseValidator._validateAccessToken: access_token hash failed:",s),Promise.reject(new Error("Failed to validate at_hash"));var h=a.substr(0,a.length/2),u=this._joseUtil.hexToBase64Url(h);return u!==e.profile.at_hash?(n.Log.error("ResponseValidator._validateAccessToken: Failed to validate at_hash",u,e.profile.at_hash),Promise.reject(new Error("Failed to validate at_hash"))):(n.Log.debug("ResponseValidator._validateAccessToken: success"),Promise.resolve(e))},t}()},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.UserInfoService=void 0;var i=r(87),n=r(30),o=r(0),s=r(60);function a(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}e.UserInfoService=function(){function t(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:i.JsonService,h=arguments.length>2&&void 0!==arguments[2]?arguments[2]:n.MetadataService,u=arguments.length>3&&void 0!==arguments[3]?arguments[3]:s.JoseUtil;if(a(this,t),!e)throw o.Log.error("UserInfoService.ctor: No settings passed"),new Error("settings");this._settings=e,this._jsonService=new r(void 0,void 0,this._getClaimsFromJwt.bind(this)),this._metadataService=new h(this._settings),this._joseUtil=u}return t.prototype.getClaims=function t(e){var r=this;return e?this._metadataService.getUserInfoEndpoint().then((function(t){return o.Log.debug("UserInfoService.getClaims: received userinfo url",t),r._jsonService.getJson(t,e).then((function(t){return o.Log.debug("UserInfoService.getClaims: claims received",t),t}))})):(o.Log.error("UserInfoService.getClaims: No token passed"),Promise.reject(new Error("A token is required")))},t.prototype._getClaimsFromJwt=function t(e){var r=this;try{var i=this._joseUtil.parseJwt(e.responseText);if(!i||!i.header||!i.payload)return o.Log.error("UserInfoService._getClaimsFromJwt: Failed to parse JWT",i),Promise.reject(new Error("Failed to parse id_token"));var n=i.header.kid,s=void 0;switch(this._settings.userInfoJwtIssuer){case"OP":s=this._metadataService.getIssuer();break;case"ANY":s=Promise.resolve(i.payload.iss);break;default:s=Promise.resolve(this._settings.userInfoJwtIssuer)}return s.then((function(t){return o.Log.debug("UserInfoService._getClaimsFromJwt: Received issuer:"+t),r._metadataService.getSigningKeys().then((function(s){if(!s)return o.Log.error("UserInfoService._getClaimsFromJwt: No signing keys from metadata"),Promise.reject(new Error("No signing keys from metadata"));o.Log.debug("UserInfoService._getClaimsFromJwt: Received signing keys");var a=void 0;if(n)a=s.filter((function(t){return t.kid===n}))[0];else{if((s=r._filterByAlg(s,i.header.alg)).length>1)return o.Log.error("UserInfoService._getClaimsFromJwt: No kid found in id_token and more than one key found in metadata"),Promise.reject(new Error("No kid found in id_token and more than one key found in metadata"));a=s[0]}if(!a)return o.Log.error("UserInfoService._getClaimsFromJwt: No key matching kid or alg found in signing keys"),Promise.reject(new Error("No key matching kid or alg found in signing keys"));var h=r._settings.client_id,u=r._settings.clockSkew;return o.Log.debug("UserInfoService._getClaimsFromJwt: Validaing JWT; using clock skew (in seconds) of: ",u),r._joseUtil.validateJwt(e.responseText,a,t,h,u,void 0,!0).then((function(){return o.Log.debug("UserInfoService._getClaimsFromJwt: JWT validation successful"),i.payload}))}))}))}catch(t){return o.Log.error("UserInfoService._getClaimsFromJwt: Error parsing JWT response",t.message),void reject(t)}},t.prototype._filterByAlg=function t(e,r){var i=null;if(r.startsWith("RS"))i="RSA";else if(r.startsWith("PS"))i="PS";else{if(!r.startsWith("ES"))return o.Log.debug("UserInfoService._filterByAlg: alg not supported: ",r),[];i="EC"}return o.Log.debug("UserInfoService._filterByAlg: Looking for keys that match kty: ",i),e=e.filter((function(t){return t.kty===i})),o.Log.debug("UserInfoService._filterByAlg: Number of keys that match kty: ",i,e.length),e},t}()},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.AllowedSigningAlgs=e.b64tohex=e.hextob64u=e.crypto=e.X509=e.KeyUtil=e.jws=void 0;var i=s(r(273)),n=s(r(274)),o=s(r(155));function s(t){return t&&t.__esModule?t:{default:t}}var a=i.default.BigInteger,h="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",u={b64tohex:function t(e){var r,i,n="",o=0;for(r=0;r<e.length&&"="!==e.charAt(r);++r){var s=h.indexOf(e.charAt(r));s<0||(0===o?(n+=String.fromCharCode(s>>2),i=3&s,o=1):1===o?(n+=String.fromCharCode(i<<2|s>>4),i=15&s,o=2):2===o?(n+=String.fromCharCode(i),n+=String.fromCharCode(s>>2),i=3&s,o=3):(n+=String.fromCharCode(i<<2|s>>4),n+=String.fromCharCode(15&s),o=0))}return 1===o&&(n+=String.fromCharCode(i<<2)),n},hexToBase64:function t(e){var r,i,n="";for(r=0;r+3<=e.length;r+=3)i=parseInt(e.substring(r,r+3),16),n+=h.charAt(i>>6)+h.charAt(63&i);for(r+1===e.length?(i=parseInt(e.substring(r,r+1),16),n+=h.charAt(i<<2)):r+2===e.length&&(i=parseInt(e.substring(r,r+2),16),n+=h.charAt(i>>2)+h.charAt((3&i)<<4)),"=";(3&n.length)>0;)n+="=";return n},padding:function t(e){var r=e.length%4;return 0===r?e:e+new Array(1+(4-r)).join("=")},byteArrayToHex:function t(e){for(var r="",i=0;i<e.length;i++){var n=e[i].toString(16);r+=2===n.length?n:"0"+n}return r},decodeToHEX:function t(e){return u.byteArrayToHex(o.default.toByteArray(u.padding(e)))},base64ToBase64Url:function t(e){return e=(e=(e=e.replace(/=/g,"")).replace(/\+/g,"-")).replace(/\//g,"_")},urlDecode:function t(e){return e=e.replace(/-/g,"+").replace(/_/g,"/").replace(/\s/g," "),atob(e)}},f={sha1:"3021300906052b0e03021a05000414",sha224:"302d300d06096086480165030402040500041c",sha256:"3031300d060960864801650304020105000420",sha384:"3041300d060960864801650304020205000430",sha512:"3051300d060960864801650304020305000440",md2:"3020300c06082a864886f70d020205000410",md5:"3020300c06082a864886f70d020505000410",ripemd160:"3021300906052b2403020105000414"},c={sha256:n.default,SHA256:n.default};
/*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/
*/function l(t,e){if(this.n=null,this.e=0,!(null!=t&&null!=e&&t.length>0&&e.length>0))throw new Error("Invalid key data");this.n=new a(t,16),this.e=parseInt(e,16)}l.prototype.verify=function(t,e){e=(e=u.decodeToHEX(e)).replace(/[^0-9a-f]|[\s\n]]/gi,"");var r=new a(e,16);if(r.bitLength()>this.n.bitLength())throw new Error("Signature does not match with the key modulus.");var i=function n(t){for(var e in f){var r=f[e],i=r.length;if(t.substring(0,i)===r)return{alg:e,hash:t.substring(i)}}return[]}(r.modPowInt(this.e,this.n).toString(16).replace(/^1f+00/,""));if(0===i.length)return!1;if(!c.hasOwnProperty(i.alg))throw new Error("Hashing algorithm is not supported.");var o=c[i.alg](t).toString();return i.hash===o};var d=["RS256"],p={JWS:{parse:function t(e){var r,i,n=e.split(".");if(3===n.length){try{r=JSON.parse(u.urlDecode(n[0])),i=JSON.parse(u.urlDecode(n[1]))}catch(t){return new Error("Token header or payload is not valid JSON")}return{headerObj:r,payloadObj:i}}},verify:function t(e,r){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];i.forEach((function(t){if(-1===d.indexOf(t))throw new Error("Invalid signing algorithm: "+t)}));var t=new l(r.n,r.e),n=e.split("."),o=[n[0],n[1]].join(".");return t.verify(o,n[2])}}},m={getKey:function t(e){return"RSA"===e.kty?{e:u.decodeToHEX(e.e),n:u.decodeToHEX(e.n)}:null}},g={getPublicKeyFromCertPEM:function t(){throw new Error("Not implemented. Use the full oidc-client library if you need support for X509.")}},v={Util:{hashString:function t(e,r){return(0,c[r])(e).toString()}}};var b=u.b64tohex;e.jws=p,e.KeyUtil=m,e.X509=g,e.crypto=v,e.hextob64u=function y(t){return t.length%2==1&&(t="0"+t),u.base64ToBase64Url(u.hexToBase64(t))},e.b64tohex=b,e.AllowedSigningAlgs=d},function(t,e,r){(function(){var e;function r(t,e,r){null!=t&&("number"==typeof t?this.fromNumber(t,e,r):null==e&&"string"!=typeof t?this.fromString(t,256):this.fromString(t,e))}function i(){return new r(null)}var n="undefined"!=typeof navigator;n&&"Microsoft Internet Explorer"==navigator.appName?(r.prototype.am=function o(t,e,r,i,n,s){for(var a=32767&e,h=e>>15;--s>=0;){var u=32767&this[t],f=this[t++]>>15,c=h*u+f*a;n=((u=a*u+((32767&c)<<15)+r[i]+(1073741823&n))>>>30)+(c>>>15)+h*f+(n>>>30),r[i++]=1073741823&u}return n},e=30):n&&"Netscape"!=navigator.appName?(r.prototype.am=function s(t,e,r,i,n,o){for(;--o>=0;){var s=e*this[t++]+r[i]+n;n=Math.floor(s/67108864),r[i++]=67108863&s}return n},e=26):(r.prototype.am=function a(t,e,r,i,n,o){for(var s=16383&e,a=e>>14;--o>=0;){var h=16383&this[t],u=this[t++]>>14,f=a*h+u*s;n=((h=s*h+((16383&f)<<14)+r[i]+n)>>28)+(f>>14)+a*u,r[i++]=268435455&h}return n},e=28),r.prototype.DB=e,r.prototype.DM=(1<<e)-1,r.prototype.DV=1<<e;r.prototype.FV=Math.pow(2,52),r.prototype.F1=52-e,r.prototype.F2=2*e-52;var h,u,f=new Array;for(h="0".charCodeAt(0),u=0;u<=9;++u)f[h++]=u;for(h="a".charCodeAt(0),u=10;u<36;++u)f[h++]=u;for(h="A".charCodeAt(0),u=10;u<36;++u)f[h++]=u;function c(t){return"0123456789abcdefghijklmnopqrstuvwxyz".charAt(t)}function l(t,e){var r=f[t.charCodeAt(e)];return null==r?-1:r}function d(t){var e=i();return e.fromInt(t),e}function p(t){var e,r=1;return 0!=(e=t>>>16)&&(t=e,r+=16),0!=(e=t>>8)&&(t=e,r+=8),0!=(e=t>>4)&&(t=e,r+=4),0!=(e=t>>2)&&(t=e,r+=2),0!=(e=t>>1)&&(t=e,r+=1),r}function m(t){this.m=t}function g(t){this.m=t,this.mp=t.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<<t.DB-15)-1,this.mt2=2*t.t}function v(t,e){return t&e}function b(t,e){return t|e}function y(t,e){return t^e}function w(t,e){return t&~e}function _(t){if(0==t)return-1;var e=0;return 0==(65535&t)&&(t>>=16,e+=16),0==(255&t)&&(t>>=8,e+=8),0==(15&t)&&(t>>=4,e+=4),0==(3&t)&&(t>>=2,e+=2),0==(1&t)&&++e,e}function M(t){for(var e=0;0!=t;)t&=t-1,++e;return e}function S(){}function k(t){return t}function E(t){this.r2=i(),this.q3=i(),r.ONE.dlShiftTo(2*t.t,this.r2),this.mu=this.r2.divide(t),this.m=t}m.prototype.convert=function R(t){return t.s<0||t.compareTo(this.m)>=0?t.mod(this.m):t},m.prototype.revert=function A(t){return t},m.prototype.reduce=function x(t){t.divRemTo(this.m,null,t)},m.prototype.mulTo=function T(t,e,r){t.multiplyTo(e,r),this.reduce(r)},m.prototype.sqrTo=function P(t,e){t.squareTo(e),this.reduce(e)},g.prototype.convert=function I(t){var e=i();return t.abs().dlShiftTo(this.m.t,e),e.divRemTo(this.m,null,e),t.s<0&&e.compareTo(r.ZERO)>0&&this.m.subTo(e,e),e},g.prototype.revert=function L(t){var e=i();return t.copyTo(e),this.reduce(e),e},g.prototype.reduce=function O(t){for(;t.t<=this.mt2;)t[t.t++]=0;for(var e=0;e<this.m.t;++e){var r=32767&t[e],i=r*this.mpl+((r*this.mph+(t[e]>>15)*this.mpl&this.um)<<15)&t.DM;for(t[r=e+this.m.t]+=this.m.am(0,i,t,e,0,this.m.t);t[r]>=t.DV;)t[r]-=t.DV,t[++r]++}t.clamp(),t.drShiftTo(this.m.t,t),t.compareTo(this.m)>=0&&t.subTo(this.m,t)},g.prototype.mulTo=function B(t,e,r){t.multiplyTo(e,r),this.reduce(r)},g.prototype.sqrTo=function j(t,e){t.squareTo(e),this.reduce(e)},r.prototype.copyTo=function C(t){for(var e=this.t-1;e>=0;--e)t[e]=this[e];t.t=this.t,t.s=this.s},r.prototype.fromInt=function U(t){this.t=1,this.s=t<0?-1:0,t>0?this[0]=t:t<-1?this[0]=t+this.DV:this.t=0},r.prototype.fromString=function N(t,e){var i;if(16==e)i=4;else if(8==e)i=3;else if(256==e)i=8;else if(2==e)i=1;else if(32==e)i=5;else{if(4!=e)return void this.fromRadix(t,e);i=2}this.t=0,this.s=0;for(var n=t.length,o=!1,s=0;--n>=0;){var a=8==i?255&t[n]:l(t,n);a<0?"-"==t.charAt(n)&&(o=!0):(o=!1,0==s?this[this.t++]=a:s+i>this.DB?(this[this.t-1]|=(a&(1<<this.DB-s)-1)<<s,this[this.t++]=a>>this.DB-s):this[this.t-1]|=a<<s,(s+=i)>=this.DB&&(s-=this.DB))}8==i&&0!=(128&t[0])&&(this.s=-1,s>0&&(this[this.t-1]|=(1<<this.DB-s)-1<<s)),this.clamp(),o&&r.ZERO.subTo(this,this)},r.prototype.clamp=function q(){for(var t=this.s&this.DM;this.t>0&&this[this.t-1]==t;)--this.t},r.prototype.dlShiftTo=function D(t,e){var r;for(r=this.t-1;r>=0;--r)e[r+t]=this[r];for(r=t-1;r>=0;--r)e[r]=0;e.t=this.t+t,e.s=this.s},r.prototype.drShiftTo=function z(t,e){for(var r=t;r<this.t;++r)e[r-t]=this[r];e.t=Math.max(this.t-t,0),e.s=this.s},r.prototype.lShiftTo=function F(t,e){var r,i=t%this.DB,n=this.DB-i,o=(1<<n)-1,s=Math.floor(t/this.DB),a=this.s<<i&this.DM;for(r=this.t-1;r>=0;--r)e[r+s+1]=this[r]>>n|a,a=(this[r]&o)<<i;for(r=s-1;r>=0;--r)e[r]=0;e[s]=a,e.t=this.t+s+1,e.s=this.s,e.clamp()},r.prototype.rShiftTo=function W(t,e){e.s=this.s;var r=Math.floor(t/this.DB);if(r>=this.t)e.t=0;else{var i=t%this.DB,n=this.DB-i,o=(1<<i)-1;e[0]=this[r]>>i;for(var s=r+1;s<this.t;++s)e[s-r-1]|=(this[s]&o)<<n,e[s-r]=this[s]>>i;i>0&&(e[this.t-r-1]|=(this.s&o)<<n),e.t=this.t-r,e.clamp()}},r.prototype.subTo=function H(t,e){for(var r=0,i=0,n=Math.min(t.t,this.t);r<n;)i+=this[r]-t[r],e[r++]=i&this.DM,i>>=this.DB;if(t.t<this.t){for(i-=t.s;r<this.t;)i+=this[r],e[r++]=i&this.DM,i>>=this.DB;i+=this.s}else{for(i+=this.s;r<t.t;)i-=t[r],e[r++]=i&this.DM,i>>=this.DB;i-=t.s}e.s=i<0?-1:0,i<-1?e[r++]=this.DV+i:i>0&&(e[r++]=i),e.t=r,e.clamp()},r.prototype.multiplyTo=function K(t,e){var i=this.abs(),n=t.abs(),o=i.t;for(e.t=o+n.t;--o>=0;)e[o]=0;for(o=0;o<n.t;++o)e[o+i.t]=i.am(0,n[o],e,o,0,i.t);e.s=0,e.clamp(),this.s!=t.s&&r.ZERO.subTo(e,e)},r.prototype.squareTo=function Z(t){for(var e=this.abs(),r=t.t=2*e.t;--r>=0;)t[r]=0;for(r=0;r<e.t-1;++r){var i=e.am(r,e[r],t,2*r,0,1);(t[r+e.t]+=e.am(r+1,2*e[r],t,2*r+1,i,e.t-r-1))>=e.DV&&(t[r+e.t]-=e.DV,t[r+e.t+1]=1)}t.t>0&&(t[t.t-1]+=e.am(r,e[r],t,2*r,0,1)),t.s=0,t.clamp()},r.prototype.divRemTo=function V(t,e,n){var o=t.abs();if(!(o.t<=0)){var s=this.abs();if(s.t<o.t)return null!=e&&e.fromInt(0),void(null!=n&&this.copyTo(n));null==n&&(n=i());var a=i(),h=this.s,u=t.s,f=this.DB-p(o[o.t-1]);f>0?(o.lShiftTo(f,a),s.lShiftTo(f,n)):(o.copyTo(a),s.copyTo(n));var c=a.t,l=a[c-1];if(0!=l){var d=l*(1<<this.F1)+(c>1?a[c-2]>>this.F2:0),m=this.FV/d,g=(1<<this.F1)/d,v=1<<this.F2,b=n.t,y=b-c,w=null==e?i():e;for(a.dlShiftTo(y,w),n.compareTo(w)>=0&&(n[n.t++]=1,n.subTo(w,n)),r.ONE.dlShiftTo(c,w),w.subTo(a,a);a.t<c;)a[a.t++]=0;for(;--y>=0;){var _=n[--b]==l?this.DM:Math.floor(n[b]*m+(n[b-1]+v)*g);if((n[b]+=a.am(0,_,n,y,0,c))<_)for(a.dlShiftTo(y,w),n.subTo(w,n);n[b]<--_;)n.subTo(w,n)}null!=e&&(n.drShiftTo(c,e),h!=u&&r.ZERO.subTo(e,e)),n.t=c,n.clamp(),f>0&&n.rShiftTo(f,n),h<0&&r.ZERO.subTo(n,n)}}},r.prototype.invDigit=function J(){if(this.t<1)return 0;var t=this[0];if(0==(1&t))return 0;var e=3&t;return(e=(e=(e=(e=e*(2-(15&t)*e)&15)*(2-(255&t)*e)&255)*(2-((65535&t)*e&65535))&65535)*(2-t*e%this.DV)%this.DV)>0?this.DV-e:-e},r.prototype.isEven=function Y(){return 0==(this.t>0?1&this[0]:this.s)},r.prototype.exp=function G(t,e){if(t>4294967295||t<1)return r.ONE;var n=i(),o=i(),s=e.convert(this),a=p(t)-1;for(s.copyTo(n);--a>=0;)if(e.sqrTo(n,o),(t&1<<a)>0)e.mulTo(o,s,n);else{var h=n;n=o,o=h}return e.revert(n)},r.prototype.toString=function X(t){if(this.s<0)return"-"+this.negate().toString(t);var e;if(16==t)e=4;else if(8==t)e=3;else if(2==t)e=1;else if(32==t)e=5;else{if(4!=t)return this.toRadix(t);e=2}var r,i=(1<<e)-1,n=!1,o="",s=this.t,a=this.DB-s*this.DB%e;if(s-- >0)for(a<this.DB&&(r=this[s]>>a)>0&&(n=!0,o=c(r));s>=0;)a<e?(r=(this[s]&(1<<a)-1)<<e-a,r|=this[--s]>>(a+=this.DB-e)):(r=this[s]>>(a-=e)&i,a<=0&&(a+=this.DB,--s)),r>0&&(n=!0),n&&(o+=c(r));return n?o:"0"},r.prototype.negate=function Q(){var t=i();return r.ZERO.subTo(this,t),t},r.prototype.abs=function $(){return this.s<0?this.negate():this},r.prototype.compareTo=function tt(t){var e=this.s-t.s;if(0!=e)return e;var r=this.t;if(0!=(e=r-t.t))return this.s<0?-e:e;for(;--r>=0;)if(0!=(e=this[r]-t[r]))return e;return 0},r.prototype.bitLength=function et(){return this.t<=0?0:this.DB*(this.t-1)+p(this[this.t-1]^this.s&this.DM)},r.prototype.mod=function rt(t){var e=i();return this.abs().divRemTo(t,null,e),this.s<0&&e.compareTo(r.ZERO)>0&&t.subTo(e,e),e},r.prototype.modPowInt=function it(t,e){var r;return r=t<256||e.isEven()?new m(e):new g(e),this.exp(t,r)},r.ZERO=d(0),r.ONE=d(1),S.prototype.convert=k,S.prototype.revert=k,S.prototype.mulTo=function nt(t,e,r){t.multiplyTo(e,r)},S.prototype.sqrTo=function ot(t,e){t.squareTo(e)},E.prototype.convert=function st(t){if(t.s<0||t.t>2*this.m.t)return t.mod(this.m);if(t.compareTo(this.m)<0)return t;var e=i();return t.copyTo(e),this.reduce(e),e},E.prototype.revert=function at(t){return t},E.prototype.reduce=function ht(t){for(t.drShiftTo(this.m.t-1,this.r2),t.t>this.m.t+1&&(t.t=this.m.t+1,t.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);t.compareTo(this.r2)<0;)t.dAddOffset(1,this.m.t+1);for(t.subTo(this.r2,t);t.compareTo(this.m)>=0;)t.subTo(this.m,t)},E.prototype.mulTo=function ut(t,e,r){t.multiplyTo(e,r),this.reduce(r)},E.prototype.sqrTo=function ft(t,e){t.squareTo(e),this.reduce(e)};var ct,lt,dt,pt=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],mt=(1<<26)/pt[pt.length-1];function gt(){!function t(e){lt[dt++]^=255&e,lt[dt++]^=e>>8&255,lt[dt++]^=e>>16&255,lt[dt++]^=e>>24&255,dt>=ye&&(dt-=ye)}((new Date).getTime())}if(r.prototype.chunkSize=function vt(t){return Math.floor(Math.LN2*this.DB/Math.log(t))},r.prototype.toRadix=function bt(t){if(null==t&&(t=10),0==this.signum()||t<2||t>36)return"0";var e=this.chunkSize(t),r=Math.pow(t,e),n=d(r),o=i(),s=i(),a="";for(this.divRemTo(n,o,s);o.signum()>0;)a=(r+s.intValue()).toString(t).substr(1)+a,o.divRemTo(n,o,s);return s.intValue().toString(t)+a},r.prototype.fromRadix=function yt(t,e){this.fromInt(0),null==e&&(e=10);for(var i=this.chunkSize(e),n=Math.pow(e,i),o=!1,s=0,a=0,h=0;h<t.length;++h){var u=l(t,h);u<0?"-"==t.charAt(h)&&0==this.signum()&&(o=!0):(a=e*a+u,++s>=i&&(this.dMultiply(n),this.dAddOffset(a,0),s=0,a=0))}s>0&&(this.dMultiply(Math.pow(e,s)),this.dAddOffset(a,0)),o&&r.ZERO.subTo(this,this)},r.prototype.fromNumber=function wt(t,e,i){if("number"==typeof e)if(t<2)this.fromInt(1);else for(this.fromNumber(t,i),this.testBit(t-1)||this.bitwiseTo(r.ONE.shiftLeft(t-1),b,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(e);)this.dAddOffset(2,0),this.bitLength()>t&&this.subTo(r.ONE.shiftLeft(t-1),this);else{var n=new Array,o=7&t;n.length=1+(t>>3),e.nextBytes(n),o>0?n[0]&=(1<<o)-1:n[0]=0,this.fromString(n,256)}},r.prototype.bitwiseTo=function _t(t,e,r){var i,n,o=Math.min(t.t,this.t);for(i=0;i<o;++i)r[i]=e(this[i],t[i]);if(t.t<this.t){for(n=t.s&this.DM,i=o;i<this.t;++i)r[i]=e(this[i],n);r.t=this.t}else{for(n=this.s&this.DM,i=o;i<t.t;++i)r[i]=e(n,t[i]);r.t=t.t}r.s=e(this.s,t.s),r.clamp()},r.prototype.changeBit=function Mt(t,e){var i=r.ONE.shiftLeft(t);return this.bitwiseTo(i,e,i),i},r.prototype.addTo=function St(t,e){for(var r=0,i=0,n=Math.min(t.t,this.t);r<n;)i+=this[r]+t[r],e[r++]=i&this.DM,i>>=this.DB;if(t.t<this.t){for(i+=t.s;r<this.t;)i+=this[r],e[r++]=i&this.DM,i>>=this.DB;i+=this.s}else{for(i+=this.s;r<t.t;)i+=t[r],e[r++]=i&this.DM,i>>=this.DB;i+=t.s}e.s=i<0?-1:0,i>0?e[r++]=i:i<-1&&(e[r++]=this.DV+i),e.t=r,e.clamp()},r.prototype.dMultiply=function kt(t){this[this.t]=this.am(0,t-1,this,0,0,this.t),++this.t,this.clamp()},r.prototype.dAddOffset=function Et(t,e){if(0!=t){for(;this.t<=e;)this[this.t++]=0;for(this[e]+=t;this[e]>=this.DV;)this[e]-=this.DV,++e>=this.t&&(this[this.t++]=0),++this[e]}},r.prototype.multiplyLowerTo=function Rt(t,e,r){var i,n=Math.min(this.t+t.t,e);for(r.s=0,r.t=n;n>0;)r[--n]=0;for(i=r.t-this.t;n<i;++n)r[n+this.t]=this.am(0,t[n],r,n,0,this.t);for(i=Math.min(t.t,e);n<i;++n)this.am(0,t[n],r,n,0,e-n);r.clamp()},r.prototype.multiplyUpperTo=function At(t,e,r){--e;var i=r.t=this.t+t.t-e;for(r.s=0;--i>=0;)r[i]=0;for(i=Math.max(e-this.t,0);i<t.t;++i)r[this.t+i-e]=this.am(e-i,t[i],r,0,0,this.t+i-e);r.clamp(),r.drShiftTo(1,r)},r.prototype.modInt=function xt(t){if(t<=0)return 0;var e=this.DV%t,r=this.s<0?t-1:0;if(this.t>0)if(0==e)r=this[0]%t;else for(var i=this.t-1;i>=0;--i)r=(e*r+this[i])%t;return r},r.prototype.millerRabin=function Tt(t){var e=this.subtract(r.ONE),n=e.getLowestSetBit();if(n<=0)return!1;var o=e.shiftRight(n);(t=t+1>>1)>pt.length&&(t=pt.length);for(var s=i(),a=0;a<t;++a){s.fromInt(pt[Math.floor(Math.random()*pt.length)]);var h=s.modPow(o,this);if(0!=h.compareTo(r.ONE)&&0!=h.compareTo(e)){for(var u=1;u++<n&&0!=h.compareTo(e);)if(0==(h=h.modPowInt(2,this)).compareTo(r.ONE))return!1;if(0!=h.compareTo(e))return!1}}return!0},r.prototype.clone=function Pt(){var t=i();return this.copyTo(t),t},r.prototype.intValue=function It(){if(this.s<0){if(1==this.t)return this[0]-this.DV;if(0==this.t)return-1}else{if(1==this.t)return this[0];if(0==this.t)return 0}return(this[1]&(1<<32-this.DB)-1)<<this.DB|this[0]},r.prototype.byteValue=function Lt(){return 0==this.t?this.s:this[0]<<24>>24},r.prototype.shortValue=function Ot(){return 0==this.t?this.s:this[0]<<16>>16},r.prototype.signum=function Bt(){return this.s<0?-1:this.t<=0||1==this.t&&this[0]<=0?0:1},r.prototype.toByteArray=function jt(){var t=this.t,e=new Array;e[0]=this.s;var r,i=this.DB-t*this.DB%8,n=0;if(t-- >0)for(i<this.DB&&(r=this[t]>>i)!=(this.s&this.DM)>>i&&(e[n++]=r|this.s<<this.DB-i);t>=0;)i<8?(r=(this[t]&(1<<i)-1)<<8-i,r|=this[--t]>>(i+=this.DB-8)):(r=this[t]>>(i-=8)&255,i<=0&&(i+=this.DB,--t)),0!=(128&r)&&(r|=-256),0==n&&(128&this.s)!=(128&r)&&++n,(n>0||r!=this.s)&&(e[n++]=r);return e},r.prototype.equals=function Ct(t){return 0==this.compareTo(t)},r.prototype.min=function Ut(t){return this.compareTo(t)<0?this:t},r.prototype.max=function Nt(t){return this.compareTo(t)>0?this:t},r.prototype.and=function qt(t){var e=i();return this.bitwiseTo(t,v,e),e},r.prototype.or=function Dt(t){var e=i();return this.bitwiseTo(t,b,e),e},r.prototype.xor=function zt(t){var e=i();return this.bitwiseTo(t,y,e),e},r.prototype.andNot=function Ft(t){var e=i();return this.bitwiseTo(t,w,e),e},r.prototype.not=function Wt(){for(var t=i(),e=0;e<this.t;++e)t[e]=this.DM&~this[e];return t.t=this.t,t.s=~this.s,t},r.prototype.shiftLeft=function Ht(t){var e=i();return t<0?this.rShiftTo(-t,e):this.lShiftTo(t,e),e},r.prototype.shiftRight=function Kt(t){var e=i();return t<0?this.lShiftTo(-t,e):this.rShiftTo(t,e),e},r.prototype.getLowestSetBit=function Zt(){for(var t=0;t<this.t;++t)if(0!=this[t])return t*this.DB+_(this[t]);return this.s<0?this.t*this.DB:-1},r.prototype.bitCount=function Vt(){for(var t=0,e=this.s&this.DM,r=0;r<this.t;++r)t+=M(this[r]^e);return t},r.prototype.testBit=function Jt(t){var e=Math.floor(t/this.DB);return e>=this.t?0!=this.s:0!=(this[e]&1<<t%this.DB)},r.prototype.setBit=function Yt(t){return this.changeBit(t,b)},r.prototype.clearBit=function Gt(t){return this.changeBit(t,w)},r.prototype.flipBit=function Xt(t){return this.changeBit(t,y)},r.prototype.add=function Qt(t){var e=i();return this.addTo(t,e),e},r.prototype.subtract=function $t(t){var e=i();return this.subTo(t,e),e},r.prototype.multiply=function te(t){var e=i();return this.multiplyTo(t,e),e},r.prototype.divide=function ee(t){var e=i();return this.divRemTo(t,e,null),e},r.prototype.remainder=function re(t){var e=i();return this.divRemTo(t,null,e),e},r.prototype.divideAndRemainder=function ie(t){var e=i(),r=i();return this.divRemTo(t,e,r),new Array(e,r)},r.prototype.modPow=function ne(t,e){var r,n,o=t.bitLength(),s=d(1);if(o<=0)return s;r=o<18?1:o<48?3:o<144?4:o<768?5:6,n=o<8?new m(e):e.isEven()?new E(e):new g(e);var a=new Array,h=3,u=r-1,f=(1<<r)-1;if(a[1]=n.convert(this),r>1){var c=i();for(n.sqrTo(a[1],c);h<=f;)a[h]=i(),n.mulTo(c,a[h-2],a[h]),h+=2}var l,v,b=t.t-1,y=!0,w=i();for(o=p(t[b])-1;b>=0;){for(o>=u?l=t[b]>>o-u&f:(l=(t[b]&(1<<o+1)-1)<<u-o,b>0&&(l|=t[b-1]>>this.DB+o-u)),h=r;0==(1&l);)l>>=1,--h;if((o-=h)<0&&(o+=this.DB,--b),y)a[l].copyTo(s),y=!1;else{for(;h>1;)n.sqrTo(s,w),n.sqrTo(w,s),h-=2;h>0?n.sqrTo(s,w):(v=s,s=w,w=v),n.mulTo(w,a[l],s)}for(;b>=0&&0==(t[b]&1<<o);)n.sqrTo(s,w),v=s,s=w,w=v,--o<0&&(o=this.DB-1,--b)}return n.revert(s)},r.prototype.modInverse=function oe(t){var e=t.isEven();if(this.isEven()&&e||0==t.signum())return r.ZERO;for(var i=t.clone(),n=this.clone(),o=d(1),s=d(0),a=d(0),h=d(1);0!=i.signum();){for(;i.isEven();)i.rShiftTo(1,i),e?(o.isEven()&&s.isEven()||(o.addTo(this,o),s.subTo(t,s)),o.rShiftTo(1,o)):s.isEven()||s.subTo(t,s),s.rShiftTo(1,s);for(;n.isEven();)n.rShiftTo(1,n),e?(a.isEven()&&h.isEven()||(a.addTo(this,a),h.subTo(t,h)),a.rShiftTo(1,a)):h.isEven()||h.subTo(t,h),h.rShiftTo(1,h);i.compareTo(n)>=0?(i.subTo(n,i),e&&o.subTo(a,o),s.subTo(h,s)):(n.subTo(i,n),e&&a.subTo(o,a),h.subTo(s,h))}return 0!=n.compareTo(r.ONE)?r.ZERO:h.compareTo(t)>=0?h.subtract(t):h.signum()<0?(h.addTo(t,h),h.signum()<0?h.add(t):h):h},r.prototype.pow=function se(t){return this.exp(t,new S)},r.prototype.gcd=function ae(t){var e=this.s<0?this.negate():this.clone(),r=t.s<0?t.negate():t.clone();if(e.compareTo(r)<0){var i=e;e=r,r=i}var n=e.getLowestSetBit(),o=r.getLowestSetBit();if(o<0)return e;for(n<o&&(o=n),o>0&&(e.rShiftTo(o,e),r.rShiftTo(o,r));e.signum()>0;)(n=e.getLowestSetBit())>0&&e.rShiftTo(n,e),(n=r.getLowestSetBit())>0&&r.rShiftTo(n,r),e.compareTo(r)>=0?(e.subTo(r,e),e.rShiftTo(1,e)):(r.subTo(e,r),r.rShiftTo(1,r));return o>0&&r.lShiftTo(o,r),r},r.prototype.isProbablePrime=function he(t){var e,r=this.abs();if(1==r.t&&r[0]<=pt[pt.length-1]){for(e=0;e<pt.length;++e)if(r[0]==pt[e])return!0;return!1}if(r.isEven())return!1;for(e=1;e<pt.length;){for(var i=pt[e],n=e+1;n<pt.length&&i<mt;)i*=pt[n++];for(i=r.modInt(i);e<n;)if(i%pt[e++]==0)return!1}return r.millerRabin(t)},r.prototype.square=function ue(){var t=i();return this.squareTo(t),t},r.prototype.Barrett=E,null==lt){var fe;if(lt=new Array,dt=0,"undefined"!=typeof window&&window.crypto)if(window.crypto.getRandomValues){var ce=new Uint8Array(32);for(window.crypto.getRandomValues(ce),fe=0;fe<32;++fe)lt[dt++]=ce[fe]}else if("Netscape"==navigator.appName&&navigator.appVersion<"5"){var le=window.crypto.random(32);for(fe=0;fe<le.length;++fe)lt[dt++]=255&le.charCodeAt(fe)}for(;dt<ye;)fe=Math.floor(65536*Math.random()),lt[dt++]=fe>>>8,lt[dt++]=255&fe;dt=0,gt()}function de(){if(null==ct){for(gt(),(ct=function t(){return new me}()).init(lt),dt=0;dt<lt.length;++dt)lt[dt]=0;dt=0}return ct.next()}function pe(){}function me(){this.i=0,this.j=0,this.S=new Array}pe.prototype.nextBytes=function ge(t){var e;for(e=0;e<t.length;++e)t[e]=de()},me.prototype.init=function ve(t){var e,r,i;for(e=0;e<256;++e)this.S[e]=e;for(r=0,e=0;e<256;++e)r=r+this.S[e]+t[e%t.length]&255,i=this.S[e],this.S[e]=this.S[r],this.S[r]=i;this.i=0,this.j=0},me.prototype.next=function be(){var t;return this.i=this.i+1&255,this.j=this.j+this.S[this.i]&255,t=this.S[this.i],this.S[this.i]=this.S[this.j],this.S[this.j]=t,this.S[t+this.S[this.i]&255]};var ye=256;t.exports={default:r,BigInteger:r,SecureRandom:pe}}).call(this)},function(t,e,r){var i;t.exports=(i=r(275),function(t){var e=i,r=e.lib,n=r.WordArray,o=r.Hasher,s=e.algo,a=[],h=[];!function(){function e(e){for(var r=t.sqrt(e),i=2;i<=r;i++)if(!(e%i))return!1;return!0}function r(t){return 4294967296*(t-(0|t))|0}for(var i=2,n=0;n<64;)e(i)&&(n<8&&(a[n]=r(t.pow(i,.5))),h[n]=r(t.pow(i,1/3)),n++),i++}();var u=[],f=s.SHA256=o.extend({_doReset:function(){this._hash=new n.init(a.slice(0))},_doProcessBlock:function(t,e){for(var r=this._hash.words,i=r[0],n=r[1],o=r[2],s=r[3],a=r[4],f=r[5],c=r[6],l=r[7],d=0;d<64;d++){if(d<16)u[d]=0|t[e+d];else{var p=u[d-15],m=(p<<25|p>>>7)^(p<<14|p>>>18)^p>>>3,g=u[d-2],v=(g<<15|g>>>17)^(g<<13|g>>>19)^g>>>10;u[d]=m+u[d-7]+v+u[d-16]}var b=i&n^i&o^n&o,y=(i<<30|i>>>2)^(i<<19|i>>>13)^(i<<10|i>>>22),w=l+((a<<26|a>>>6)^(a<<21|a>>>11)^(a<<7|a>>>25))+(a&f^~a&c)+h[d]+u[d];l=c,c=f,f=a,a=s+w|0,s=o,o=n,n=i,i=w+(y+b)|0}r[0]=r[0]+i|0,r[1]=r[1]+n|0,r[2]=r[2]+o|0,r[3]=r[3]+s|0,r[4]=r[4]+a|0,r[5]=r[5]+f|0,r[6]=r[6]+c|0,r[7]=r[7]+l|0},_doFinalize:function(){var e=this._data,r=e.words,i=8*this._nDataBytes,n=8*e.sigBytes;return r[n>>>5]|=128<<24-n%32,r[14+(n+64>>>9<<4)]=t.floor(i/4294967296),r[15+(n+64>>>9<<4)]=i,e.sigBytes=4*r.length,this._process(),this._hash},clone:function(){var t=o.clone.call(this);return t._hash=this._hash.clone(),t}});e.SHA256=o._createHelper(f),e.HmacSHA256=o._createHmacHelper(f)}(Math),i.SHA256)},function(t,e,r){(function(e){var i;t.exports=(i=i||function(t,i){var n;if("undefined"!=typeof window&&window.crypto&&(n=window.crypto),!n&&"undefined"!=typeof window&&window.msCrypto&&(n=window.msCrypto),!n&&void 0!==e&&e.crypto&&(n=e.crypto),!n)try{n=r(276)}catch(t){}var o=function(){if(n){if("function"==typeof n.getRandomValues)try{return n.getRandomValues(new Uint32Array(1))[0]}catch(t){}if("function"==typeof n.randomBytes)try{return n.randomBytes(4).readInt32LE()}catch(t){}}throw new Error("Native crypto module could not be used to get secure random number.")},s=Object.create||function(){function t(){}return function(e){var r;return t.prototype=e,r=new t,t.prototype=null,r}}(),a={},h=a.lib={},u=h.Base={extend:function(t){var e=s(this);return t&&e.mixIn(t),e.hasOwnProperty("init")&&this.init!==e.init||(e.init=function(){e.$super.init.apply(this,arguments)}),e.init.prototype=e,e.$super=this,e},create:function(){var t=this.extend();return t.init.apply(t,arguments),t},init:function(){},mixIn:function(t){for(var e in t)t.hasOwnProperty(e)&&(this[e]=t[e]);t.hasOwnProperty("toString")&&(this.toString=t.toString)},clone:function(){return this.init.prototype.extend(this)}},f=h.WordArray=u.extend({init:function(t,e){t=this.words=t||[],this.sigBytes=e!=i?e:4*t.length},toString:function(t){return(t||l).stringify(this)},concat:function(t){var e=this.words,r=t.words,i=this.sigBytes,n=t.sigBytes;if(this.clamp(),i%4)for(var o=0;o<n;o++){var s=r[o>>>2]>>>24-o%4*8&255;e[i+o>>>2]|=s<<24-(i+o)%4*8}else for(o=0;o<n;o+=4)e[i+o>>>2]=r[o>>>2];return this.sigBytes+=n,this},clamp:function(){var e=this.words,r=this.sigBytes;e[r>>>2]&=4294967295<<32-r%4*8,e.length=t.ceil(r/4)},clone:function(){var t=u.clone.call(this);return t.words=this.words.slice(0),t},random:function(t){for(var e=[],r=0;r<t;r+=4)e.push(o());return new f.init(e,t)}}),c=a.enc={},l=c.Hex={stringify:function(t){for(var e=t.words,r=t.sigBytes,i=[],n=0;n<r;n++){var o=e[n>>>2]>>>24-n%4*8&255;i.push((o>>>4).toString(16)),i.push((15&o).toString(16))}return i.join("")},parse:function(t){for(var e=t.length,r=[],i=0;i<e;i+=2)r[i>>>3]|=parseInt(t.substr(i,2),16)<<24-i%8*4;return new f.init(r,e/2)}},d=c.Latin1={stringify:function(t){for(var e=t.words,r=t.sigBytes,i=[],n=0;n<r;n++){var o=e[n>>>2]>>>24-n%4*8&255;i.push(String.fromCharCode(o))}return i.join("")},parse:function(t){for(var e=t.length,r=[],i=0;i<e;i++)r[i>>>2]|=(255&t.charCodeAt(i))<<24-i%4*8;return new f.init(r,e)}},p=c.Utf8={stringify:function(t){try{return decodeURIComponent(escape(d.stringify(t)))}catch(t){throw new Error("Malformed UTF-8 data")}},parse:function(t){return d.parse(unescape(encodeURIComponent(t)))}},m=h.BufferedBlockAlgorithm=u.extend({reset:function(){this._data=new f.init,this._nDataBytes=0},_append:function(t){"string"==typeof t&&(t=p.parse(t)),this._data.concat(t),this._nDataBytes+=t.sigBytes},_process:function(e){var r,i=this._data,n=i.words,o=i.sigBytes,s=this.blockSize,a=o/(4*s),h=(a=e?t.ceil(a):t.max((0|a)-this._minBufferSize,0))*s,u=t.min(4*h,o);if(h){for(var c=0;c<h;c+=s)this._doProcessBlock(n,c);r=n.splice(0,h),i.sigBytes-=u}return new f.init(r,u)},clone:function(){var t=u.clone.call(this);return t._data=this._data.clone(),t},_minBufferSize:0}),g=(h.Hasher=m.extend({cfg:u.extend(),init:function(t){this.cfg=this.cfg.extend(t),this.reset()},reset:function(){m.reset.call(this),this._doReset()},update:function(t){return this._append(t),this._process(),this},finalize:function(t){return t&&this._append(t),this._doFinalize()},blockSize:16,_createHelper:function(t){return function(e,r){return new t.init(r).finalize(e)}},_createHmacHelper:function(t){return function(e,r){return new g.HMAC.init(t,r).finalize(e)}}}),a.algo={});return a}(Math),i)}).call(this,r(5))},function(t,e,r){"use strict";e.randomBytes=e.rng=e.pseudoRandomBytes=e.prng=r(31),e.createHash=e.Hash=r(43),e.createHmac=e.Hmac=r(158);var i=r(304),n=Object.keys(i),o=["sha1","sha224","sha256","sha384","sha512","md5","rmd160"].concat(n);e.getHashes=function(){return o};var s=r(161);e.pbkdf2=s.pbkdf2,e.pbkdf2Sync=s.pbkdf2Sync;var a=r(306);e.Cipher=a.Cipher,e.createCipher=a.createCipher,e.Cipheriv=a.Cipheriv,e.createCipheriv=a.createCipheriv,e.Decipher=a.Decipher,e.createDecipher=a.createDecipher,e.Decipheriv=a.Decipheriv,e.createDecipheriv=a.createDecipheriv,e.getCiphers=a.getCiphers,e.listCiphers=a.listCiphers;var h=r(322);e.DiffieHellmanGroup=h.DiffieHellmanGroup,e.createDiffieHellmanGroup=h.createDiffieHellmanGroup,e.getDiffieHellman=h.getDiffieHellman,e.createDiffieHellman=h.createDiffieHellman,e.DiffieHellman=h.DiffieHellman;var u=r(329);e.createSign=u.createSign,e.Sign=u.Sign,e.createVerify=u.createVerify,e.Verify=u.Verify,e.createECDH=r(370);var f=r(373);e.publicEncrypt=f.publicEncrypt,e.privateEncrypt=f.privateEncrypt,e.publicDecrypt=f.publicDecrypt,e.privateDecrypt=f.privateDecrypt;var c=r(377);e.randomFill=c.randomFill,e.randomFillSync=c.randomFillSync,e.createCredentials=function(){throw new Error(["sorry, createCredentials is not implemented yet","we accept pull requests","https://github.com/crypto-browserify/crypto-browserify"].join("\n"))},e.constants={DH_CHECK_P_NOT_SAFE_PRIME:2,DH_CHECK_P_NOT_PRIME:1,DH_UNABLE_TO_CHECK_GENERATOR:4,DH_NOT_SUITABLE_GENERATOR:8,NPN_ENABLED:1,ALPN_ENABLED:1,RSA_PKCS1_PADDING:1,RSA_SSLV23_PADDING:2,RSA_NO_PADDING:3,RSA_PKCS1_OAEP_PADDING:4,RSA_X931_PADDING:5,RSA_PKCS1_PSS_PADDING:6,POINT_CONVERSION_COMPRESSED:2,POINT_CONVERSION_UNCOMPRESSED:4,POINT_CONVERSION_HYBRID:6}},function(t,e,r){
/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
var i=r(7),n=i.Buffer;function o(t,e){for(var r in t)e[r]=t[r]}function s(t,e,r){return n(t,e,r)}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?t.exports=i:(o(i,e),e.Buffer=s),s.prototype=Object.create(n.prototype),o(n,s),s.from=function(t,e,r){if("number"==typeof t)throw new TypeError("Argument must not be a number");return n(t,e,r)},s.alloc=function(t,e,r){if("number"!=typeof t)throw new TypeError("Argument must be a number");var i=n(t);return void 0!==e?"string"==typeof r?i.fill(e,r):i.fill(e):i.fill(0),i},s.allocUnsafe=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return n(t)},s.allocUnsafeSlow=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return i.SlowBuffer(t)}},function(t,e,r){(e=t.exports=r(144)).Stream=e,e.Readable=e,e.Writable=r(148),e.Duplex=r(34),e.Transform=r(149),e.PassThrough=r(284),e.finished=r(90),e.pipeline=r(285)},function(t,e){},function(t,e,r){"use strict";function i(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,i)}return r}function n(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function o(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}var s=r(7).Buffer,a=r(281).inspect,h=a&&a.custom||"inspect";t.exports=function(){function t(){!function e(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}(this,t),this.head=null,this.tail=null,this.length=0}return function e(t,r,i){return r&&o(t.prototype,r),i&&o(t,i),t}(t,[{key:"push",value:function t(e){var r={data:e,next:null};this.length>0?this.tail.next=r:this.head=r,this.tail=r,++this.length}},{key:"unshift",value:function t(e){var r={data:e,next:this.head};0===this.length&&(this.tail=r),this.head=r,++this.length}},{key:"shift",value:function t(){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}}},{key:"clear",value:function t(){this.head=this.tail=null,this.length=0}},{key:"join",value:function t(e){if(0===this.length)return"";for(var r=this.head,i=""+r.data;r=r.next;)i+=e+r.data;return i}},{key:"concat",value:function t(e){if(0===this.length)return s.alloc(0);for(var r,i,n,o=s.allocUnsafe(e>>>0),a=this.head,h=0;a;)r=a.data,i=o,n=h,s.prototype.copy.call(r,i,n),h+=a.data.length,a=a.next;return o}},{key:"consume",value:function t(e,r){var i;return e<this.head.data.length?(i=this.head.data.slice(0,e),this.head.data=this.head.data.slice(e)):i=e===this.head.data.length?this.shift():r?this._getString(e):this._getBuffer(e),i}},{key:"first",value:function t(){return this.head.data}},{key:"_getString",value:function t(e){var r=this.head,i=1,n=r.data;for(e-=n.length;r=r.next;){var o=r.data,s=e>o.length?o.length:e;if(s===o.length?n+=o:n+=o.slice(0,e),0===(e-=s)){s===o.length?(++i,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=o.slice(s));break}++i}return this.length-=i,n}},{key:"_getBuffer",value:function t(e){var r=s.allocUnsafe(e),i=this.head,n=1;for(i.data.copy(r),e-=i.data.length;i=i.next;){var o=i.data,a=e>o.length?o.length:e;if(o.copy(r,r.length-e,0,a),0===(e-=a)){a===o.length?(++n,i.next?this.head=i.next:this.head=this.tail=null):(this.head=i,i.data=o.slice(a));break}++n}return this.length-=n,r}},{key:h,value:function t(e,r){return a(this,function o(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?i(Object(r),!0).forEach((function(e){n(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):i(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}({},r,{depth:0,customInspect:!1}))}}]),t}()},function(t,e){},function(t,e,r){"use strict";(function(e){var i;function n(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var o=r(90),s=Symbol("lastResolve"),a=Symbol("lastReject"),h=Symbol("error"),u=Symbol("ended"),f=Symbol("lastPromise"),c=Symbol("handlePromise"),l=Symbol("stream");function d(t,e){return{value:t,done:e}}function p(t){var e=t[s];if(null!==e){var r=t[l].read();null!==r&&(t[f]=null,t[s]=null,t[a]=null,e(d(r,!1)))}}function m(t){e.nextTick(p,t)}var g=Object.getPrototypeOf((function(){})),v=Object.setPrototypeOf((n(i={get stream(){return this[l]},next:function t(){var r=this,i=this[h];if(null!==i)return Promise.reject(i);if(this[u])return Promise.resolve(d(void 0,!0));if(this[l].destroyed)return new Promise((function(t,i){e.nextTick((function(){r[h]?i(r[h]):t(d(void 0,!0))}))}));var n,o=this[f];if(o)n=new Promise(function s(t,e){return function(r,i){t.then((function(){e[u]?r(d(void 0,!0)):e[c](r,i)}),i)}}(o,this));else{var a=this[l].read();if(null!==a)return Promise.resolve(d(a,!1));n=new Promise(this[c])}return this[f]=n,n}},Symbol.asyncIterator,(function(){return this})),n(i,"return",(function t(){var e=this;return new Promise((function(t,r){e[l].destroy(null,(function(e){e?r(e):t(d(void 0,!0))}))}))})),i),g);t.exports=function t(e){var r,i=Object.create(v,(n(r={},l,{value:e,writable:!0}),n(r,s,{value:null,writable:!0}),n(r,a,{value:null,writable:!0}),n(r,h,{value:null,writable:!0}),n(r,u,{value:e._readableState.endEmitted,writable:!0}),n(r,c,{value:function t(e,r){var n=i[l].read();n?(i[f]=null,i[s]=null,i[a]=null,e(d(n,!1))):(i[s]=e,i[a]=r)},writable:!0}),r));return i[f]=null,o(e,(function(t){if(t&&"ERR_STREAM_PREMATURE_CLOSE"!==t.code){var e=i[a];return null!==e&&(i[f]=null,i[s]=null,i[a]=null,e(t)),void(i[h]=t)}var r=i[s];null!==r&&(i[f]=null,i[s]=null,i[a]=null,r(d(void 0,!0))),i[u]=!0})),e.on("readable",m.bind(null,i)),i}}).call(this,r(4))},function(t,e){t.exports=function(){throw new Error("Readable.from is not available in the browser")}},function(t,e,r){"use strict";t.exports=n;var i=r(149);function n(t){if(!(this instanceof n))return new n(t);i.call(this,t)}r(33)(n,i),n.prototype._transform=function(t,e,r){r(null,t)}},function(t,e,r){"use strict";var i;var n=r(32).codes,o=n.ERR_MISSING_ARGS,s=n.ERR_STREAM_DESTROYED;function a(t){if(t)throw t}function h(t,e,n,o){o=function a(t){var e=!1;return function(){e||(e=!0,t.apply(void 0,arguments))}}(o);var h=!1;t.on("close",(function(){h=!0})),void 0===i&&(i=r(90)),i(t,{readable:e,writable:n},(function(t){if(t)return o(t);h=!0,o()}));var u=!1;return function(e){if(!h&&!u)return u=!0,function r(t){return t.setHeader&&"function"==typeof t.abort}(t)?t.abort():"function"==typeof t.destroy?t.destroy():void o(e||new s("pipe"))}}function u(t){t()}function f(t,e){return t.pipe(e)}function c(t){return t.length?"function"!=typeof t[t.length-1]?a:t.pop():a}t.exports=function l(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];var i,n=c(e);if(Array.isArray(e[0])&&(e=e[0]),e.length<2)throw new o("streams");var s=e.map((function(t,r){var o=r<e.length-1;return h(t,o,r>0,(function(t){i||(i=t),t&&s.forEach(u),o||(s.forEach(u),n(i))}))}));return e.reduce(f)}},function(t,e,r){
/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
var i=r(7),n=i.Buffer;function o(t,e){for(var r in t)e[r]=t[r]}function s(t,e,r){return n(t,e,r)}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?t.exports=i:(o(i,e),e.Buffer=s),s.prototype=Object.create(n.prototype),o(n,s),s.from=function(t,e,r){if("number"==typeof t)throw new TypeError("Argument must not be a number");return n(t,e,r)},s.alloc=function(t,e,r){if("number"!=typeof t)throw new TypeError("Argument must be a number");var i=n(t);return void 0!==e?"string"==typeof r?i.fill(e,r):i.fill(e):i.fill(0),i},s.allocUnsafe=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return n(t)},s.allocUnsafeSlow=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return i.SlowBuffer(t)}},function(t,e,r){var i=r(1),n=r(35),o=r(2).Buffer,s=[1518500249,1859775393,-1894007588,-899497514],a=new Array(80);function h(){this.init(),this._w=a,n.call(this,64,56)}function u(t){return t<<30|t>>>2}function f(t,e,r,i){return 0===t?e&r|~e&i:2===t?e&r|e&i|r&i:e^r^i}i(h,n),h.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},h.prototype._update=function(t){for(var e,r=this._w,i=0|this._a,n=0|this._b,o=0|this._c,a=0|this._d,h=0|this._e,c=0;c<16;++c)r[c]=t.readInt32BE(4*c);for(;c<80;++c)r[c]=r[c-3]^r[c-8]^r[c-14]^r[c-16];for(var l=0;l<80;++l){var d=~~(l/20),p=0|((e=i)<<5|e>>>27)+f(d,n,o,a)+h+r[l]+s[d];h=a,a=o,o=u(n),n=i,i=p}this._a=i+this._a|0,this._b=n+this._b|0,this._c=o+this._c|0,this._d=a+this._d|0,this._e=h+this._e|0},h.prototype._hash=function(){var t=o.allocUnsafe(20);return t.writeInt32BE(0|this._a,0),t.writeInt32BE(0|this._b,4),t.writeInt32BE(0|this._c,8),t.writeInt32BE(0|this._d,12),t.writeInt32BE(0|this._e,16),t},t.exports=h},function(t,e,r){var i=r(1),n=r(35),o=r(2).Buffer,s=[1518500249,1859775393,-1894007588,-899497514],a=new Array(80);function h(){this.init(),this._w=a,n.call(this,64,56)}function u(t){return t<<5|t>>>27}function f(t){return t<<30|t>>>2}function c(t,e,r,i){return 0===t?e&r|~e&i:2===t?e&r|e&i|r&i:e^r^i}i(h,n),h.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},h.prototype._update=function(t){for(var e,r=this._w,i=0|this._a,n=0|this._b,o=0|this._c,a=0|this._d,h=0|this._e,l=0;l<16;++l)r[l]=t.readInt32BE(4*l);for(;l<80;++l)r[l]=(e=r[l-3]^r[l-8]^r[l-14]^r[l-16])<<1|e>>>31;for(var d=0;d<80;++d){var p=~~(d/20),m=u(i)+c(p,n,o,a)+h+r[d]+s[p]|0;h=a,a=o,o=f(n),n=i,i=m}this._a=i+this._a|0,this._b=n+this._b|0,this._c=o+this._c|0,this._d=a+this._d|0,this._e=h+this._e|0},h.prototype._hash=function(){var t=o.allocUnsafe(20);return t.writeInt32BE(0|this._a,0),t.writeInt32BE(0|this._b,4),t.writeInt32BE(0|this._c,8),t.writeInt32BE(0|this._d,12),t.writeInt32BE(0|this._e,16),t},t.exports=h},function(t,e,r){var i=r(1),n=r(150),o=r(35),s=r(2).Buffer,a=new Array(64);function h(){this.init(),this._w=a,o.call(this,64,56)}i(h,n),h.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},h.prototype._hash=function(){var t=s.allocUnsafe(28);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t},t.exports=h},function(t,e,r){var i=r(1),n=r(151),o=r(35),s=r(2).Buffer,a=new Array(160);function h(){this.init(),this._w=a,o.call(this,128,112)}i(h,n),h.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},h.prototype._hash=function(){var t=s.allocUnsafe(48);function e(e,r,i){t.writeInt32BE(e,i),t.writeInt32BE(r,i+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),t},t.exports=h},function(t,e,r){t.exports=n;var i=r(24).EventEmitter;function n(){i.call(this)}r(1)(n,i),n.Readable=r(93),n.Writable=r(299),n.Duplex=r(300),n.Transform=r(301),n.PassThrough=r(302),n.Stream=n,n.prototype.pipe=function(t,e){var r=this;function n(e){t.writable&&!1===t.write(e)&&r.pause&&r.pause()}function o(){r.readable&&r.resume&&r.resume()}r.on("data",n),t.on("drain",o),t._isStdio||e&&!1===e.end||(r.on("end",a),r.on("close",h));var s=!1;function a(){s||(s=!0,t.end())}function h(){s||(s=!0,"function"==typeof t.destroy&&t.destroy())}function u(t){if(f(),0===i.listenerCount(this,"error"))throw t}function f(){r.removeListener("data",n),t.removeListener("drain",o),r.removeListener("end",a),r.removeListener("close",h),r.removeListener("error",u),t.removeListener("error",u),r.removeListener("end",f),r.removeListener("close",f),t.removeListener("close",f)}return r.on("error",u),t.on("error",u),r.on("end",f),r.on("close",f),t.on("close",f),t.emit("pipe",r),t}},function(t,e){
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
e.read=function(t,e,r,i,n){var o,s,a=8*n-i-1,h=(1<<a)-1,u=h>>1,f=-7,c=r?n-1:0,l=r?-1:1,d=t[e+c];for(c+=l,o=d&(1<<-f)-1,d>>=-f,f+=a;f>0;o=256*o+t[e+c],c+=l,f-=8);for(s=o&(1<<-f)-1,o>>=-f,f+=i;f>0;s=256*s+t[e+c],c+=l,f-=8);if(0===o)o=1-u;else{if(o===h)return s?NaN:1/0*(d?-1:1);s+=Math.pow(2,i),o-=u}return(d?-1:1)*s*Math.pow(2,o-i)},e.write=function(t,e,r,i,n,o){var s,a,h,u=8*o-n-1,f=(1<<u)-1,c=f>>1,l=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,d=i?0:o-1,p=i?1:-1,m=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=f):(s=Math.floor(Math.log(e)/Math.LN2),e*(h=Math.pow(2,-s))<1&&(s--,h*=2),(e+=s+c>=1?l/h:l*Math.pow(2,1-c))*h>=2&&(s++,h/=2),s+c>=f?(a=0,s=f):s+c>=1?(a=(e*h-1)*Math.pow(2,n),s+=c):(a=e*Math.pow(2,c-1)*Math.pow(2,n),s=0));n>=8;t[r+d]=255&a,d+=p,a/=256,n-=8);for(s=s<<n|a,u+=n;u>0;t[r+d]=255&s,d+=p,s/=256,u-=8);t[r+d-p]|=128*m}},function(t,e){},function(t,e,r){"use strict";var i=r(2).Buffer,n=r(295);t.exports=function(){function t(){!function e(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}(this,t),this.head=null,this.tail=null,this.length=0}return t.prototype.push=function t(e){var r={data:e,next:null};this.length>0?this.tail.next=r:this.head=r,this.tail=r,++this.length},t.prototype.unshift=function t(e){var r={data:e,next:this.head};0===this.length&&(this.tail=r),this.head=r,++this.length},t.prototype.shift=function t(){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}},t.prototype.clear=function t(){this.head=this.tail=null,this.length=0},t.prototype.join=function t(e){if(0===this.length)return"";for(var r=this.head,i=""+r.data;r=r.next;)i+=e+r.data;return i},t.prototype.concat=function t(e){if(0===this.length)return i.alloc(0);if(1===this.length)return this.head.data;for(var r,n,o,s=i.allocUnsafe(e>>>0),a=this.head,h=0;a;)r=a.data,n=s,o=h,r.copy(n,o),h+=a.data.length,a=a.next;return s},t}(),n&&n.inspect&&n.inspect.custom&&(t.exports.prototype[n.inspect.custom]=function(){var t=n.inspect({length:this.length});return this.constructor.name+" "+t})},function(t,e){},function(t,e,r){(function(t){var i=void 0!==t&&t||"undefined"!=typeof self&&self||window,n=Function.prototype.apply;function o(t,e){this._id=t,this._clearFn=e}e.setTimeout=function(){return new o(n.call(setTimeout,i,arguments),clearTimeout)},e.setInterval=function(){return new o(n.call(setInterval,i,arguments),clearInterval)},e.clearTimeout=e.clearInterval=function(t){t&&t.close()},o.prototype.unref=o.prototype.ref=function(){},o.prototype.close=function(){this._clearFn.call(i,this._id)},e.enroll=function(t,e){clearTimeout(t._idleTimeoutId),t._idleTimeout=e},e.unenroll=function(t){clearTimeout(t._idleTimeoutId),t._idleTimeout=-1},e._unrefActive=e.active=function(t){clearTimeout(t._idleTimeoutId);var e=t._idleTimeout;e>=0&&(t._idleTimeoutId=setTimeout((function e(){t._onTimeout&&t._onTimeout()}),e))},r(297),e.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==t&&t.setImmediate||this&&this.setImmediate,e.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==t&&t.clearImmediate||this&&this.clearImmediate}).call(this,r(5))},function(t,e,r){(function(t,e){!function(t,r){"use strict";if(!t.setImmediate){var i,n=1,o={},s=!1,a=t.document,h=Object.getPrototypeOf&&Object.getPrototypeOf(t);h=h&&h.setTimeout?h:t,"[object process]"==={}.toString.call(t.process)?function u(){i=function(t){e.nextTick((function(){v(t)}))}}():!function f(){if(t.postMessage&&!t.importScripts){var e=!0,r=t.onmessage;return t.onmessage=function(){e=!1},t.postMessage("","*"),t.onmessage=r,e}}()?t.MessageChannel?function c(){var t=new MessageChannel;t.port1.onmessage=function(t){v(t.data)},i=function(e){t.port2.postMessage(e)}}():a&&"onreadystatechange"in a.createElement("script")?function l(){var t=a.documentElement;i=function(e){var r=a.createElement("script");r.onreadystatechange=function(){v(e),r.onreadystatechange=null,t.removeChild(r),r=null},t.appendChild(r)}}():function d(){i=function(t){setTimeout(v,0,t)}}():function p(){var e="setImmediate$"+Math.random()+"$",r=function(r){r.source===t&&"string"==typeof r.data&&0===r.data.indexOf(e)&&v(+r.data.slice(e.length))};t.addEventListener?t.addEventListener("message",r,!1):t.attachEvent("onmessage",r),i=function(r){t.postMessage(e+r,"*")}}(),h.setImmediate=function m(t){"function"!=typeof t&&(t=new Function(""+t));for(var e=new Array(arguments.length-1),r=0;r<e.length;r++)e[r]=arguments[r+1];var s={callback:t,args:e};return o[n]=s,i(n),n++},h.clearImmediate=g}function g(t){delete o[t]}function v(t){if(s)setTimeout(v,0,t);else{var e=o[t];if(e){s=!0;try{!function r(t){var e=t.callback,r=t.args;switch(r.length){case 0:e();break;case 1:e(r[0]);break;case 2:e(r[0],r[1]);break;case 3:e(r[0],r[1],r[2]);break;default:e.apply(void 0,r)}}(e)}finally{g(t),s=!1}}}}}("undefined"==typeof self?void 0===t?this:t:self)}).call(this,r(5),r(4))},function(t,e,r){"use strict";t.exports=o;var i=r(157),n=Object.create(r(44));function o(t){if(!(this instanceof o))return new o(t);i.call(this,t)}n.inherits=r(1),n.inherits(o,i),o.prototype._transform=function(t,e,r){r(null,t)}},function(t,e,r){t.exports=r(94)},function(t,e,r){t.exports=r(27)},function(t,e,r){t.exports=r(93).Transform},function(t,e,r){t.exports=r(93).PassThrough},function(t,e,r){"use strict";var i=r(1),n=r(2).Buffer,o=r(20),s=n.alloc(128),a=64;function h(t,e){o.call(this,"digest"),"string"==typeof e&&(e=n.from(e)),this._alg=t,this._key=e,e.length>a?e=t(e):e.length<a&&(e=n.concat([e,s],a));for(var r=this._ipad=n.allocUnsafe(a),i=this._opad=n.allocUnsafe(a),h=0;h<a;h++)r[h]=54^e[h],i[h]=92^e[h];this._hash=[r]}i(h,o),h.prototype._update=function(t){this._hash.push(t)},h.prototype._final=function(){var t=this._alg(n.concat(this._hash));return this._alg(n.concat([this._opad,t]))},t.exports=h},function(t,e,r){t.exports=r(160)},function(t,e,r){(function(e,i){var n,o=r(2).Buffer,s=r(162),a=r(163),h=r(164),u=r(165),f=e.crypto&&e.crypto.subtle,c={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 d(t,e,r,i,n){return f.importKey("raw",t,{name:"PBKDF2"},!1,["deriveBits"]).then((function(t){return f.deriveBits({name:"PBKDF2",salt:e,iterations:r,hash:{name:n}},t,i<<3)})).then((function(t){return o.from(t)}))}t.exports=function(t,r,p,m,g,v){"function"==typeof g&&(v=g,g=void 0);var b=c[(g=g||"sha1").toLowerCase()];if(!b||"function"!=typeof e.Promise)return i.nextTick((function(){var e;try{e=h(t,r,p,m,g)}catch(t){return v(t)}v(null,e)}));if(s(p,m),t=u(t,a,"Password"),r=u(r,a,"Salt"),"function"!=typeof v)throw new Error("No callback provided to pbkdf2");!function w(t,e){t.then((function(t){i.nextTick((function(){e(null,t)}))}),(function(t){i.nextTick((function(){e(t)}))}))}(function y(t){if(e.process&&!e.process.browser)return Promise.resolve(!1);if(!f||!f.importKey||!f.deriveBits)return Promise.resolve(!1);if(void 0!==l[t])return l[t];var r=d(n=n||o.alloc(8),n,10,128,t).then((function(){return!0})).catch((function(){return!1}));return l[t]=r,r}(b).then((function(e){return e?d(t,r,p,m,b):h(t,r,p,m,g)})),v)}}).call(this,r(5),r(4))},function(t,e,r){var i=r(307),n=r(96),o=r(97),s=r(321),a=r(63);function h(t,e,r){if(t=t.toLowerCase(),o[t])return n.createCipheriv(t,e,r);if(s[t])return new i({key:e,iv:r,mode:t});throw new TypeError("invalid suite type")}function u(t,e,r){if(t=t.toLowerCase(),o[t])return n.createDecipheriv(t,e,r);if(s[t])return new i({key:e,iv:r,mode:t,decrypt:!0});throw new TypeError("invalid suite type")}e.createCipher=e.Cipher=function f(t,e){var r,i;if(t=t.toLowerCase(),o[t])r=o[t].key,i=o[t].iv;else{if(!s[t])throw new TypeError("invalid suite type");r=8*s[t].key,i=s[t].iv}var n=a(e,!1,r,i);return h(t,n.key,n.iv)},e.createCipheriv=e.Cipheriv=h,e.createDecipher=e.Decipher=function c(t,e){var r,i;if(t=t.toLowerCase(),o[t])r=o[t].key,i=o[t].iv;else{if(!s[t])throw new TypeError("invalid suite type");r=8*s[t].key,i=s[t].iv}var n=a(e,!1,r,i);return u(t,n.key,n.iv)},e.createDecipheriv=e.Decipheriv=u,e.listCiphers=e.getCiphers=function l(){return Object.keys(s).concat(n.getCiphers())}},function(t,e,r){var i=r(20),n=r(308),o=r(1),s=r(311).Buffer,a={"des-ede3-cbc":n.CBC.instantiate(n.EDE),"des-ede3":n.EDE,"des-ede-cbc":n.CBC.instantiate(n.EDE),"des-ede":n.EDE,"des-cbc":n.CBC.instantiate(n.DES),"des-ecb":n.DES};function h(t){i.call(this);var e,r=t.mode.toLowerCase(),n=a[r];e=t.decrypt?"decrypt":"encrypt";var o=t.key;s.isBuffer(o)||(o=s.from(o)),"des-ede"!==r&&"des-ede-cbc"!==r||(o=s.concat([o,o.slice(0,8)]));var h=t.iv;s.isBuffer(h)||(h=s.from(h)),this._des=n.create({key:o,iv:h,type:e})}a.des=a["des-cbc"],a.des3=a["des-ede3-cbc"],t.exports=h,o(h,i),h.prototype._update=function(t){return s.from(this._des.update(t))},h.prototype._final=function(){return s.from(this._des.final())}},function(t,e,r){"use strict";e.utils=r(166),e.Cipher=r(95),e.DES=r(167),e.CBC=r(309),e.EDE=r(310)},function(t,e,r){"use strict";var i=r(10),n=r(1),o={};function s(t){i.equal(t.length,8,"Invalid IV length"),this.iv=new Array(8);for(var e=0;e<this.iv.length;e++)this.iv[e]=t[e]}e.instantiate=function a(t){function e(e){t.call(this,e),this._cbcInit()}n(e,t);for(var r=Object.keys(o),i=0;i<r.length;i++){var s=r[i];e.prototype[s]=o[s]}return e.create=function t(r){return new e(r)},e},o._cbcInit=function t(){var e=new s(this.options.iv);this._cbcState=e},o._update=function t(e,r,i,n){var o=this._cbcState,s=this.constructor.super_.prototype,a=o.iv;if("encrypt"===this.type){for(var h=0;h<this.blockSize;h++)a[h]^=e[r+h];s._update.call(this,a,0,i,n);for(h=0;h<this.blockSize;h++)a[h]=i[n+h]}else{s._update.call(this,e,r,i,n);for(h=0;h<this.blockSize;h++)i[n+h]^=a[h];for(h=0;h<this.blockSize;h++)a[h]=e[r+h]}}},function(t,e,r){"use strict";var i=r(10),n=r(1),o=r(95),s=r(167);function a(t,e){i.equal(e.length,24,"Invalid key length");var r=e.slice(0,8),n=e.slice(8,16),o=e.slice(16,24);this.ciphers="encrypt"===t?[s.create({type:"encrypt",key:r}),s.create({type:"decrypt",key:n}),s.create({type:"encrypt",key:o})]:[s.create({type:"decrypt",key:o}),s.create({type:"encrypt",key:n}),s.create({type:"decrypt",key:r})]}function h(t){o.call(this,t);var e=new a(this.type,this.options.key);this._edeState=e}n(h,o),t.exports=h,h.create=function t(e){return new h(e)},h.prototype._update=function t(e,r,i,n){var o=this._edeState;o.ciphers[0]._update(e,r,i,n),o.ciphers[1]._update(i,n,i,n),o.ciphers[2]._update(i,n,i,n)},h.prototype._pad=s.prototype._pad,h.prototype._unpad=s.prototype._unpad},function(t,e,r){
/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
var i=r(7),n=i.Buffer;function o(t,e){for(var r in t)e[r]=t[r]}function s(t,e,r){return n(t,e,r)}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?t.exports=i:(o(i,e),e.Buffer=s),s.prototype=Object.create(n.prototype),o(n,s),s.from=function(t,e,r){if("number"==typeof t)throw new TypeError("Argument must not be a number");return n(t,e,r)},s.alloc=function(t,e,r){if("number"!=typeof t)throw new TypeError("Argument must be a number");var i=n(t);return void 0!==e?"string"==typeof r?i.fill(e,r):i.fill(e):i.fill(0),i},s.allocUnsafe=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return n(t)},s.allocUnsafeSlow=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return i.SlowBuffer(t)}},function(t,e,r){var i=r(97),n=r(171),o=r(2).Buffer,s=r(172),a=r(20),h=r(62),u=r(63);function f(t,e,r){a.call(this),this._cache=new l,this._cipher=new h.AES(e),this._prev=o.from(r),this._mode=t,this._autopadding=!0}r(1)(f,a),f.prototype._update=function(t){var e,r;this._cache.add(t);for(var i=[];e=this._cache.get();)r=this._mode.encrypt(this,e),i.push(r);return o.concat(i)};var c=o.alloc(16,16);function l(){this.cache=o.allocUnsafe(0)}function d(t,e,r){var a=i[t.toLowerCase()];if(!a)throw new TypeError("invalid suite type");if("string"==typeof e&&(e=o.from(e)),e.length!==a.key/8)throw new TypeError("invalid key length "+e.length);if("string"==typeof r&&(r=o.from(r)),"GCM"!==a.mode&&r.length!==a.iv)throw new TypeError("invalid iv length "+r.length);return"stream"===a.type?new s(a.module,e,r):"auth"===a.type?new n(a.module,e,r):new f(a.module,e,r)}f.prototype._final=function(){var t=this._cache.flush();if(this._autopadding)return t=this._mode.encrypt(this,t),this._cipher.scrub(),t;if(!t.equals(c))throw this._cipher.scrub(),new Error("data not multiple of block length")},f.prototype.setAutoPadding=function(t){return this._autopadding=!!t,this},l.prototype.add=function(t){this.cache=o.concat([this.cache,t])},l.prototype.get=function(){if(this.cache.length>15){var t=this.cache.slice(0,16);return this.cache=this.cache.slice(16),t}return null},l.prototype.flush=function(){for(var t=16-this.cache.length,e=o.allocUnsafe(t),r=-1;++r<t;)e.writeUInt8(t,r);return o.concat([this.cache,e])},e.createCipheriv=d,e.createCipher=function p(t,e){var r=i[t.toLowerCase()];if(!r)throw new TypeError("invalid suite type");var n=u(e,!1,r.key,r.iv);return d(t,n.key,n.iv)}},function(t,e){e.encrypt=function(t,e){return t._cipher.encryptBlock(e)},e.decrypt=function(t,e){return t._cipher.decryptBlock(e)}},function(t,e,r){var i=r(45);e.encrypt=function(t,e){var r=i(e,t._prev);return t._prev=t._cipher.encryptBlock(r),t._prev},e.decrypt=function(t,e){var r=t._prev;t._prev=e;var n=t._cipher.decryptBlock(e);return i(n,r)}},function(t,e,r){var i=r(2).Buffer,n=r(45);function o(t,e,r){var o=e.length,s=n(e,t._cache);return t._cache=t._cache.slice(o),t._prev=i.concat([t._prev,r?e:s]),s}e.encrypt=function(t,e,r){for(var n,s=i.allocUnsafe(0);e.length;){if(0===t._cache.length&&(t._cache=t._cipher.encryptBlock(t._prev),t._prev=i.allocUnsafe(0)),!(t._cache.length<=e.length)){s=i.concat([s,o(t,e,r)]);break}n=t._cache.length,s=i.concat([s,o(t,e.slice(0,n),r)]),e=e.slice(n)}return s}},function(t,e,r){var i=r(2).Buffer;function n(t,e,r){var n=t._cipher.encryptBlock(t._prev)[0]^e;return t._prev=i.concat([t._prev.slice(1),i.from([r?e:n])]),n}e.encrypt=function(t,e,r){for(var o=e.length,s=i.allocUnsafe(o),a=-1;++a<o;)s[a]=n(t,e[a],r);return s}},function(t,e,r){var i=r(2).Buffer;function n(t,e,r){for(var i,n,s=-1,a=0;++s<8;)i=e&1<<7-s?128:0,a+=(128&(n=t._cipher.encryptBlock(t._prev)[0]^i))>>s%8,t._prev=o(t._prev,r?i:n);return a}function o(t,e){var r=t.length,n=-1,o=i.allocUnsafe(t.length);for(t=i.concat([t,i.from([e])]);++n<r;)o[n]=t[n]<<1|t[n+1]>>7;return o}e.encrypt=function(t,e,r){for(var o=e.length,s=i.allocUnsafe(o),a=-1;++a<o;)s[a]=n(t,e[a],r);return s}},function(t,e,r){(function(t){var i=r(45);function n(t){return t._prev=t._cipher.encryptBlock(t._prev),t._prev}e.encrypt=function(e,r){for(;e._cache.length<r.length;)e._cache=t.concat([e._cache,n(e)]);var o=e._cache.slice(0,r.length);return e._cache=e._cache.slice(r.length),i(r,o)}}).call(this,r(26).Buffer)},function(t,e,r){var i=r(2).Buffer,n=i.alloc(16,0);function o(t){var e=i.allocUnsafe(16);return e.writeUInt32BE(t[0]>>>0,0),e.writeUInt32BE(t[1]>>>0,4),e.writeUInt32BE(t[2]>>>0,8),e.writeUInt32BE(t[3]>>>0,12),e}function s(t){this.h=t,this.state=i.alloc(16,0),this.cache=i.allocUnsafe(0)}s.prototype.ghash=function(t){for(var e=-1;++e<t.length;)this.state[e]^=t[e];this._multiply()},s.prototype._multiply=function(){for(var t,e,r=function i(t){return[t.readUInt32BE(0),t.readUInt32BE(4),t.readUInt32BE(8),t.readUInt32BE(12)]}(this.h),n=[0,0,0,0],s=-1;++s<128;){for(0!=(this.state[~~(s/8)]&1<<7-s%8)&&(n[0]^=r[0],n[1]^=r[1],n[2]^=r[2],n[3]^=r[3]),e=0!=(1&r[3]),t=3;t>0;t--)r[t]=r[t]>>>1|(1&r[t-1])<<31;r[0]=r[0]>>>1,e&&(r[0]=r[0]^225<<24)}this.state=o(n)},s.prototype.update=function(t){var e;for(this.cache=i.concat([this.cache,t]);this.cache.length>=16;)e=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(e)},s.prototype.final=function(t,e){return this.cache.length&&this.ghash(i.concat([this.cache,n],16)),this.ghash(o([0,t,0,e])),this.state},t.exports=s},function(t,e,r){var i=r(171),n=r(2).Buffer,o=r(97),s=r(172),a=r(20),h=r(62),u=r(63);function f(t,e,r){a.call(this),this._cache=new c,this._last=void 0,this._cipher=new h.AES(e),this._prev=n.from(r),this._mode=t,this._autopadding=!0}function c(){this.cache=n.allocUnsafe(0)}function l(t,e,r){var a=o[t.toLowerCase()];if(!a)throw new TypeError("invalid suite type");if("string"==typeof r&&(r=n.from(r)),"GCM"!==a.mode&&r.length!==a.iv)throw new TypeError("invalid iv length "+r.length);if("string"==typeof e&&(e=n.from(e)),e.length!==a.key/8)throw new TypeError("invalid key length "+e.length);return"stream"===a.type?new s(a.module,e,r,!0):"auth"===a.type?new i(a.module,e,r,!0):new f(a.module,e,r)}r(1)(f,a),f.prototype._update=function(t){var e,r;this._cache.add(t);for(var i=[];e=this._cache.get(this._autopadding);)r=this._mode.decrypt(this,e),i.push(r);return n.concat(i)},f.prototype._final=function(){var t=this._cache.flush();if(this._autopadding)return function e(t){var e=t[15];if(e<1||e>16)throw new Error("unable to decrypt data");var r=-1;for(;++r<e;)if(t[r+(16-e)]!==e)throw new Error("unable to decrypt data");if(16===e)return;return t.slice(0,16-e)}(this._mode.decrypt(this,t));if(t)throw new Error("data not multiple of block length")},f.prototype.setAutoPadding=function(t){return this._autopadding=!!t,this},c.prototype.add=function(t){this.cache=n.concat([this.cache,t])},c.prototype.get=function(t){var e;if(t){if(this.cache.length>16)return e=this.cache.slice(0,16),this.cache=this.cache.slice(16),e}else if(this.cache.length>=16)return e=this.cache.slice(0,16),this.cache=this.cache.slice(16),e;return null},c.prototype.flush=function(){if(this.cache.length)return this.cache},e.createDecipher=function d(t,e){var r=o[t.toLowerCase()];if(!r)throw new TypeError("invalid suite type");var i=u(e,!1,r.key,r.iv);return l(t,i.key,i.iv)},e.createDecipheriv=l},function(t,e){e["des-ecb"]={key:8,iv:0},e["des-cbc"]=e.des={key:8,iv:8},e["des-ede3-cbc"]=e.des3={key:24,iv:8},e["des-ede3"]={key:24,iv:0},e["des-ede-cbc"]={key:16,iv:8},e["des-ede"]={key:16,iv:0}},function(t,e,r){(function(t){var i=r(173),n=r(327),o=r(328);var s={binary:!0,hex:!0,base64:!0};e.DiffieHellmanGroup=e.createDiffieHellmanGroup=e.getDiffieHellman=function a(e){var r=new t(n[e].prime,"hex"),i=new t(n[e].gen,"hex");return new o(r,i)},e.createDiffieHellman=e.DiffieHellman=function e(r,n,a,h){return t.isBuffer(n)||void 0===s[n]?e(r,"binary",n,a):(n=n||"binary",h=h||"binary",a=a||new t([2]),t.isBuffer(a)||(a=new t(a,h)),"number"==typeof r?new o(i(r,a),a,!0):(t.isBuffer(r)||(r=new t(r,n)),new o(r,a,!0)))}}).call(this,r(26).Buffer)},function(t,e){},function(t,e,r){(function(t){!function(t,e){"use strict";function i(t,e){if(!t)throw new Error(e||"Assertion failed")}function n(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function o(t,e,r){if(o.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var s;"object"==typeof t?t.exports=o:e.BN=o,o.BN=o,o.wordSize=26;try{s=r(325).Buffer}catch(t){}function a(t,e,r){for(var i=0,n=Math.min(t.length,r),o=e;o<n;o++){var s=t.charCodeAt(o)-48;i<<=4,i|=s>=49&&s<=54?s-49+10:s>=17&&s<=22?s-17+10:15&s}return i}function h(t,e,r,i){for(var n=0,o=Math.min(t.length,r),s=e;s<o;s++){var a=t.charCodeAt(s)-48;n*=i,n+=a>=49?a-49+10:a>=17?a-17+10:a}return n}o.isBN=function t(e){return e instanceof o||null!==e&&"object"==typeof e&&e.constructor.wordSize===o.wordSize&&Array.isArray(e.words)},o.max=function t(e,r){return e.cmp(r)>0?e:r},o.min=function t(e,r){return e.cmp(r)<0?e:r},o.prototype._init=function t(e,r,n){if("number"==typeof e)return this._initNumber(e,r,n);if("object"==typeof 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)},o.prototype._initNumber=function t(e,r,n){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"===n&&this._initArray(this.toArray(),r,n)},o.prototype._initArray=function t(e,r,n){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 o=0;o<this.length;o++)this.words[o]=0;var s,a,h=0;if("be"===n)for(o=e.length-1,s=0;o>=0;o-=3)a=e[o]|e[o-1]<<8|e[o-2]<<16,this.words[s]|=a<<h&67108863,this.words[s+1]=a>>>26-h&67108863,(h+=24)>=26&&(h-=26,s++);else if("le"===n)for(o=0,s=0;o<e.length;o+=3)a=e[o]|e[o+1]<<8|e[o+2]<<16,this.words[s]|=a<<h&67108863,this.words[s+1]=a>>>26-h&67108863,(h+=24)>=26&&(h-=26,s++);return this.strip()},o.prototype._parseHex=function t(e,r){this.length=Math.ceil((e.length-r)/6),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var n,o,s=0;for(i=e.length-6,n=0;i>=r;i-=6)o=a(e,i,i+6),this.words[n]|=o<<s&67108863,this.words[n+1]|=o>>>26-s&4194303,(s+=24)>=26&&(s-=26,n++);i+6!==r&&(o=a(e,r,i+6),this.words[n]|=o<<s&67108863,this.words[n+1]|=o>>>26-s&4194303),this.strip()},o.prototype._parseBase=function t(e,r,i){this.words=[0],this.length=1;for(var n=0,o=1;o<=67108863;o*=r)n++;n--,o=o/r|0;for(var s=e.length-i,a=s%n,u=Math.min(s,s-a)+i,f=0,c=i;c<u;c+=n)f=h(e,c,c+n,r),this.imuln(o),this.words[0]+f<67108864?this.words[0]+=f:this._iaddn(f);if(0!==a){var l=1;for(f=h(e,c,e.length,r),c=0;c<a;c++)l*=r;this.imuln(l),this.words[0]+f<67108864?this.words[0]+=f:this._iaddn(f)}},o.prototype.copy=function t(e){e.words=new Array(this.length);for(var r=0;r<this.length;r++)e.words[r]=this.words[r];e.length=this.length,e.negative=this.negative,e.red=this.red},o.prototype.clone=function t(){var e=new o(null);return this.copy(e),e},o.prototype._expand=function t(e){for(;this.length<e;)this.words[this.length++]=0;return this},o.prototype.strip=function t(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function t(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function t(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var u=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],f=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],c=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function l(t,e,r){r.negative=e.negative^t.negative;var i=t.length+e.length|0;r.length=i,i=i-1|0;var n=0|t.words[0],o=0|e.words[0],s=n*o,a=67108863&s,h=s/67108864|0;r.words[0]=a;for(var u=1;u<i;u++){for(var f=h>>>26,c=67108863&h,l=Math.min(u,e.length-1),d=Math.max(0,u-t.length+1);d<=l;d++){var p=u-d|0;f+=(s=(n=0|t.words[p])*(o=0|e.words[d])+c)/67108864|0,c=67108863&s}r.words[u]=0|c,h=0|f}return 0!==h?r.words[u]=0|h:r.length--,r.strip()}o.prototype.toString=function t(e,r){var n;if(r=0|r||1,16===(e=e||10)||"hex"===e){n="";for(var o=0,s=0,a=0;a<this.length;a++){var h=this.words[a],l=(16777215&(h<<o|s)).toString(16);n=0!==(s=h>>>24-o&16777215)||a!==this.length-1?u[6-l.length]+l+n:l+n,(o+=2)>=26&&(o-=26,a--)}for(0!==s&&(n=s.toString(16)+n);n.length%r!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}if(e===(0|e)&&e>=2&&e<=36){var d=f[e],p=c[e];n="";var m=this.clone();for(m.negative=0;!m.isZero();){var g=m.modn(p).toString(e);n=(m=m.idivn(p)).isZero()?g+n:u[d-g.length]+g+n}for(this.isZero()&&(n="0"+n);n.length%r!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}i(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function t(){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},o.prototype.toJSON=function t(){return this.toString(16)},o.prototype.toBuffer=function t(e,r){return i(void 0!==s),this.toArrayLike(s,e,r)},o.prototype.toArray=function t(e,r){return this.toArrayLike(Array,e,r)},o.prototype.toArrayLike=function t(e,r,n){var o=this.byteLength(),s=n||Math.max(1,o);i(o<=s,"byte array longer than desired length"),i(s>0,"Requested array length <= 0"),this.strip();var a,h,u="le"===r,f=new e(s),c=this.clone();if(u){for(h=0;!c.isZero();h++)a=c.andln(255),c.iushrn(8),f[h]=a;for(;h<s;h++)f[h]=0}else{for(h=0;h<s-o;h++)f[h]=0;for(h=0;!c.isZero();h++)a=c.andln(255),c.iushrn(8),f[s-h-1]=a}return f},Math.clz32?o.prototype._countBits=function t(e){return 32-Math.clz32(e)}:o.prototype._countBits=function t(e){var r=e,i=0;return r>=4096&&(i+=13,r>>>=13),r>=64&&(i+=7,r>>>=7),r>=8&&(i+=4,r>>>=4),r>=2&&(i+=2,r>>>=2),i+r},o.prototype._zeroBits=function t(e){if(0===e)return 26;var r=e,i=0;return 0==(8191&r)&&(i+=13,r>>>=13),0==(127&r)&&(i+=7,r>>>=7),0==(15&r)&&(i+=4,r>>>=4),0==(3&r)&&(i+=2,r>>>=2),0==(1&r)&&i++,i},o.prototype.bitLength=function t(){var e=this.words[this.length-1],r=this._countBits(e);return 26*(this.length-1)+r},o.prototype.zeroBits=function t(){if(this.isZero())return 0;for(var e=0,r=0;r<this.length;r++){var i=this._zeroBits(this.words[r]);if(e+=i,26!==i)break}return e},o.prototype.byteLength=function t(){return Math.ceil(this.bitLength()/8)},o.prototype.toTwos=function t(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},o.prototype.fromTwos=function t(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},o.prototype.isNeg=function t(){return 0!==this.negative},o.prototype.neg=function t(){return this.clone().ineg()},o.prototype.ineg=function t(){return this.isZero()||(this.negative^=1),this},o.prototype.iuor=function t(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var r=0;r<e.length;r++)this.words[r]=this.words[r]|e.words[r];return this.strip()},o.prototype.ior=function t(e){return i(0==(this.negative|e.negative)),this.iuor(e)},o.prototype.or=function t(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},o.prototype.uor=function t(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},o.prototype.iuand=function t(e){var r;r=this.length>e.length?e:this;for(var i=0;i<r.length;i++)this.words[i]=this.words[i]&e.words[i];return this.length=r.length,this.strip()},o.prototype.iand=function t(e){return i(0==(this.negative|e.negative)),this.iuand(e)},o.prototype.and=function t(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},o.prototype.uand=function t(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},o.prototype.iuxor=function t(e){var r,i;this.length>e.length?(r=this,i=e):(r=e,i=this);for(var n=0;n<i.length;n++)this.words[n]=r.words[n]^i.words[n];if(this!==r)for(;n<r.length;n++)this.words[n]=r.words[n];return this.length=r.length,this.strip()},o.prototype.ixor=function t(e){return i(0==(this.negative|e.negative)),this.iuxor(e)},o.prototype.xor=function t(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},o.prototype.uxor=function t(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},o.prototype.inotn=function t(e){i("number"==typeof e&&e>=0);var r=0|Math.ceil(e/26),n=e%26;this._expand(r),n>0&&r--;for(var o=0;o<r;o++)this.words[o]=67108863&~this.words[o];return n>0&&(this.words[o]=~this.words[o]&67108863>>26-n),this.strip()},o.prototype.notn=function t(e){return this.clone().inotn(e)},o.prototype.setn=function t(e,r){i("number"==typeof e&&e>=0);var n=e/26|0,o=e%26;return this._expand(n+1),this.words[n]=r?this.words[n]|1<<o:this.words[n]&~(1<<o),this.strip()},o.prototype.iadd=function t(e){var r,i,n;if(0!==this.negative&&0===e.negative)return this.negative=0,r=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,r=this.isub(e),e.negative=1,r._normSign();this.length>e.length?(i=this,n=e):(i=e,n=this);for(var o=0,s=0;s<n.length;s++)r=(0|i.words[s])+(0|n.words[s])+o,this.words[s]=67108863&r,o=r>>>26;for(;0!==o&&s<i.length;s++)r=(0|i.words[s])+o,this.words[s]=67108863&r,o=r>>>26;if(this.length=i.length,0!==o)this.words[this.length]=o,this.length++;else if(i!==this)for(;s<i.length;s++)this.words[s]=i.words[s];return this},o.prototype.add=function t(e){var r;return 0!==e.negative&&0===this.negative?(e.negative=0,r=this.sub(e),e.negative^=1,r):0===e.negative&&0!==this.negative?(this.negative=0,r=e.sub(this),this.negative=1,r):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},o.prototype.isub=function t(e){if(0!==e.negative){e.negative=0;var r=this.iadd(e);return e.negative=1,r._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var i,n,o=this.cmp(e);if(0===o)return this.negative=0,this.length=1,this.words[0]=0,this;o>0?(i=this,n=e):(i=e,n=this);for(var s=0,a=0;a<n.length;a++)s=(r=(0|i.words[a])-(0|n.words[a])+s)>>26,this.words[a]=67108863&r;for(;0!==s&&a<i.length;a++)s=(r=(0|i.words[a])+s)>>26,this.words[a]=67108863&r;if(0===s&&a<i.length&&i!==this)for(;a<i.length;a++)this.words[a]=i.words[a];return this.length=Math.max(this.length,a),i!==this&&(this.negative=1),this.strip()},o.prototype.sub=function t(e){return this.clone().isub(e)};var d=function t(e,r,i){var n,o,s,a=e.words,h=r.words,u=i.words,f=0,c=0|a[0],l=8191&c,d=c>>>13,p=0|a[1],m=8191&p,g=p>>>13,v=0|a[2],b=8191&v,y=v>>>13,w=0|a[3],_=8191&w,M=w>>>13,S=0|a[4],k=8191&S,E=S>>>13,R=0|a[5],A=8191&R,x=R>>>13,T=0|a[6],P=8191&T,I=T>>>13,L=0|a[7],O=8191&L,B=L>>>13,j=0|a[8],C=8191&j,U=j>>>13,N=0|a[9],q=8191&N,D=N>>>13,z=0|h[0],F=8191&z,W=z>>>13,H=0|h[1],K=8191&H,Z=H>>>13,V=0|h[2],J=8191&V,Y=V>>>13,G=0|h[3],X=8191&G,Q=G>>>13,$=0|h[4],tt=8191&$,et=$>>>13,rt=0|h[5],it=8191&rt,nt=rt>>>13,ot=0|h[6],st=8191&ot,at=ot>>>13,ht=0|h[7],ut=8191&ht,ft=ht>>>13,ct=0|h[8],lt=8191&ct,dt=ct>>>13,pt=0|h[9],mt=8191&pt,gt=pt>>>13;i.negative=e.negative^r.negative,i.length=19;var vt=(f+(n=Math.imul(l,F))|0)+((8191&(o=(o=Math.imul(l,W))+Math.imul(d,F)|0))<<13)|0;f=((s=Math.imul(d,W))+(o>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(m,F),o=(o=Math.imul(m,W))+Math.imul(g,F)|0,s=Math.imul(g,W);var bt=(f+(n=n+Math.imul(l,K)|0)|0)+((8191&(o=(o=o+Math.imul(l,Z)|0)+Math.imul(d,K)|0))<<13)|0;f=((s=s+Math.imul(d,Z)|0)+(o>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(b,F),o=(o=Math.imul(b,W))+Math.imul(y,F)|0,s=Math.imul(y,W),n=n+Math.imul(m,K)|0,o=(o=o+Math.imul(m,Z)|0)+Math.imul(g,K)|0,s=s+Math.imul(g,Z)|0;var yt=(f+(n=n+Math.imul(l,J)|0)|0)+((8191&(o=(o=o+Math.imul(l,Y)|0)+Math.imul(d,J)|0))<<13)|0;f=((s=s+Math.imul(d,Y)|0)+(o>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(_,F),o=(o=Math.imul(_,W))+Math.imul(M,F)|0,s=Math.imul(M,W),n=n+Math.imul(b,K)|0,o=(o=o+Math.imul(b,Z)|0)+Math.imul(y,K)|0,s=s+Math.imul(y,Z)|0,n=n+Math.imul(m,J)|0,o=(o=o+Math.imul(m,Y)|0)+Math.imul(g,J)|0,s=s+Math.imul(g,Y)|0;var wt=(f+(n=n+Math.imul(l,X)|0)|0)+((8191&(o=(o=o+Math.imul(l,Q)|0)+Math.imul(d,X)|0))<<13)|0;f=((s=s+Math.imul(d,Q)|0)+(o>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(k,F),o=(o=Math.imul(k,W))+Math.imul(E,F)|0,s=Math.imul(E,W),n=n+Math.imul(_,K)|0,o=(o=o+Math.imul(_,Z)|0)+Math.imul(M,K)|0,s=s+Math.imul(M,Z)|0,n=n+Math.imul(b,J)|0,o=(o=o+Math.imul(b,Y)|0)+Math.imul(y,J)|0,s=s+Math.imul(y,Y)|0,n=n+Math.imul(m,X)|0,o=(o=o+Math.imul(m,Q)|0)+Math.imul(g,X)|0,s=s+Math.imul(g,Q)|0;var _t=(f+(n=n+Math.imul(l,tt)|0)|0)+((8191&(o=(o=o+Math.imul(l,et)|0)+Math.imul(d,tt)|0))<<13)|0;f=((s=s+Math.imul(d,et)|0)+(o>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(A,F),o=(o=Math.imul(A,W))+Math.imul(x,F)|0,s=Math.imul(x,W),n=n+Math.imul(k,K)|0,o=(o=o+Math.imul(k,Z)|0)+Math.imul(E,K)|0,s=s+Math.imul(E,Z)|0,n=n+Math.imul(_,J)|0,o=(o=o+Math.imul(_,Y)|0)+Math.imul(M,J)|0,s=s+Math.imul(M,Y)|0,n=n+Math.imul(b,X)|0,o=(o=o+Math.imul(b,Q)|0)+Math.imul(y,X)|0,s=s+Math.imul(y,Q)|0,n=n+Math.imul(m,tt)|0,o=(o=o+Math.imul(m,et)|0)+Math.imul(g,tt)|0,s=s+Math.imul(g,et)|0;var Mt=(f+(n=n+Math.imul(l,it)|0)|0)+((8191&(o=(o=o+Math.imul(l,nt)|0)+Math.imul(d,it)|0))<<13)|0;f=((s=s+Math.imul(d,nt)|0)+(o>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(P,F),o=(o=Math.imul(P,W))+Math.imul(I,F)|0,s=Math.imul(I,W),n=n+Math.imul(A,K)|0,o=(o=o+Math.imul(A,Z)|0)+Math.imul(x,K)|0,s=s+Math.imul(x,Z)|0,n=n+Math.imul(k,J)|0,o=(o=o+Math.imul(k,Y)|0)+Math.imul(E,J)|0,s=s+Math.imul(E,Y)|0,n=n+Math.imul(_,X)|0,o=(o=o+Math.imul(_,Q)|0)+Math.imul(M,X)|0,s=s+Math.imul(M,Q)|0,n=n+Math.imul(b,tt)|0,o=(o=o+Math.imul(b,et)|0)+Math.imul(y,tt)|0,s=s+Math.imul(y,et)|0,n=n+Math.imul(m,it)|0,o=(o=o+Math.imul(m,nt)|0)+Math.imul(g,it)|0,s=s+Math.imul(g,nt)|0;var St=(f+(n=n+Math.imul(l,st)|0)|0)+((8191&(o=(o=o+Math.imul(l,at)|0)+Math.imul(d,st)|0))<<13)|0;f=((s=s+Math.imul(d,at)|0)+(o>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(O,F),o=(o=Math.imul(O,W))+Math.imul(B,F)|0,s=Math.imul(B,W),n=n+Math.imul(P,K)|0,o=(o=o+Math.imul(P,Z)|0)+Math.imul(I,K)|0,s=s+Math.imul(I,Z)|0,n=n+Math.imul(A,J)|0,o=(o=o+Math.imul(A,Y)|0)+Math.imul(x,J)|0,s=s+Math.imul(x,Y)|0,n=n+Math.imul(k,X)|0,o=(o=o+Math.imul(k,Q)|0)+Math.imul(E,X)|0,s=s+Math.imul(E,Q)|0,n=n+Math.imul(_,tt)|0,o=(o=o+Math.imul(_,et)|0)+Math.imul(M,tt)|0,s=s+Math.imul(M,et)|0,n=n+Math.imul(b,it)|0,o=(o=o+Math.imul(b,nt)|0)+Math.imul(y,it)|0,s=s+Math.imul(y,nt)|0,n=n+Math.imul(m,st)|0,o=(o=o+Math.imul(m,at)|0)+Math.imul(g,st)|0,s=s+Math.imul(g,at)|0;var kt=(f+(n=n+Math.imul(l,ut)|0)|0)+((8191&(o=(o=o+Math.imul(l,ft)|0)+Math.imul(d,ut)|0))<<13)|0;f=((s=s+Math.imul(d,ft)|0)+(o>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(C,F),o=(o=Math.imul(C,W))+Math.imul(U,F)|0,s=Math.imul(U,W),n=n+Math.imul(O,K)|0,o=(o=o+Math.imul(O,Z)|0)+Math.imul(B,K)|0,s=s+Math.imul(B,Z)|0,n=n+Math.imul(P,J)|0,o=(o=o+Math.imul(P,Y)|0)+Math.imul(I,J)|0,s=s+Math.imul(I,Y)|0,n=n+Math.imul(A,X)|0,o=(o=o+Math.imul(A,Q)|0)+Math.imul(x,X)|0,s=s+Math.imul(x,Q)|0,n=n+Math.imul(k,tt)|0,o=(o=o+Math.imul(k,et)|0)+Math.imul(E,tt)|0,s=s+Math.imul(E,et)|0,n=n+Math.imul(_,it)|0,o=(o=o+Math.imul(_,nt)|0)+Math.imul(M,it)|0,s=s+Math.imul(M,nt)|0,n=n+Math.imul(b,st)|0,o=(o=o+Math.imul(b,at)|0)+Math.imul(y,st)|0,s=s+Math.imul(y,at)|0,n=n+Math.imul(m,ut)|0,o=(o=o+Math.imul(m,ft)|0)+Math.imul(g,ut)|0,s=s+Math.imul(g,ft)|0;var Et=(f+(n=n+Math.imul(l,lt)|0)|0)+((8191&(o=(o=o+Math.imul(l,dt)|0)+Math.imul(d,lt)|0))<<13)|0;f=((s=s+Math.imul(d,dt)|0)+(o>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(q,F),o=(o=Math.imul(q,W))+Math.imul(D,F)|0,s=Math.imul(D,W),n=n+Math.imul(C,K)|0,o=(o=o+Math.imul(C,Z)|0)+Math.imul(U,K)|0,s=s+Math.imul(U,Z)|0,n=n+Math.imul(O,J)|0,o=(o=o+Math.imul(O,Y)|0)+Math.imul(B,J)|0,s=s+Math.imul(B,Y)|0,n=n+Math.imul(P,X)|0,o=(o=o+Math.imul(P,Q)|0)+Math.imul(I,X)|0,s=s+Math.imul(I,Q)|0,n=n+Math.imul(A,tt)|0,o=(o=o+Math.imul(A,et)|0)+Math.imul(x,tt)|0,s=s+Math.imul(x,et)|0,n=n+Math.imul(k,it)|0,o=(o=o+Math.imul(k,nt)|0)+Math.imul(E,it)|0,s=s+Math.imul(E,nt)|0,n=n+Math.imul(_,st)|0,o=(o=o+Math.imul(_,at)|0)+Math.imul(M,st)|0,s=s+Math.imul(M,at)|0,n=n+Math.imul(b,ut)|0,o=(o=o+Math.imul(b,ft)|0)+Math.imul(y,ut)|0,s=s+Math.imul(y,ft)|0,n=n+Math.imul(m,lt)|0,o=(o=o+Math.imul(m,dt)|0)+Math.imul(g,lt)|0,s=s+Math.imul(g,dt)|0;var Rt=(f+(n=n+Math.imul(l,mt)|0)|0)+((8191&(o=(o=o+Math.imul(l,gt)|0)+Math.imul(d,mt)|0))<<13)|0;f=((s=s+Math.imul(d,gt)|0)+(o>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,n=Math.imul(q,K),o=(o=Math.imul(q,Z))+Math.imul(D,K)|0,s=Math.imul(D,Z),n=n+Math.imul(C,J)|0,o=(o=o+Math.imul(C,Y)|0)+Math.imul(U,J)|0,s=s+Math.imul(U,Y)|0,n=n+Math.imul(O,X)|0,o=(o=o+Math.imul(O,Q)|0)+Math.imul(B,X)|0,s=s+Math.imul(B,Q)|0,n=n+Math.imul(P,tt)|0,o=(o=o+Math.imul(P,et)|0)+Math.imul(I,tt)|0,s=s+Math.imul(I,et)|0,n=n+Math.imul(A,it)|0,o=(o=o+Math.imul(A,nt)|0)+Math.imul(x,it)|0,s=s+Math.imul(x,nt)|0,n=n+Math.imul(k,st)|0,o=(o=o+Math.imul(k,at)|0)+Math.imul(E,st)|0,s=s+Math.imul(E,at)|0,n=n+Math.imul(_,ut)|0,o=(o=o+Math.imul(_,ft)|0)+Math.imul(M,ut)|0,s=s+Math.imul(M,ft)|0,n=n+Math.imul(b,lt)|0,o=(o=o+Math.imul(b,dt)|0)+Math.imul(y,lt)|0,s=s+Math.imul(y,dt)|0;var At=(f+(n=n+Math.imul(m,mt)|0)|0)+((8191&(o=(o=o+Math.imul(m,gt)|0)+Math.imul(g,mt)|0))<<13)|0;f=((s=s+Math.imul(g,gt)|0)+(o>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(q,J),o=(o=Math.imul(q,Y))+Math.imul(D,J)|0,s=Math.imul(D,Y),n=n+Math.imul(C,X)|0,o=(o=o+Math.imul(C,Q)|0)+Math.imul(U,X)|0,s=s+Math.imul(U,Q)|0,n=n+Math.imul(O,tt)|0,o=(o=o+Math.imul(O,et)|0)+Math.imul(B,tt)|0,s=s+Math.imul(B,et)|0,n=n+Math.imul(P,it)|0,o=(o=o+Math.imul(P,nt)|0)+Math.imul(I,it)|0,s=s+Math.imul(I,nt)|0,n=n+Math.imul(A,st)|0,o=(o=o+Math.imul(A,at)|0)+Math.imul(x,st)|0,s=s+Math.imul(x,at)|0,n=n+Math.imul(k,ut)|0,o=(o=o+Math.imul(k,ft)|0)+Math.imul(E,ut)|0,s=s+Math.imul(E,ft)|0,n=n+Math.imul(_,lt)|0,o=(o=o+Math.imul(_,dt)|0)+Math.imul(M,lt)|0,s=s+Math.imul(M,dt)|0;var xt=(f+(n=n+Math.imul(b,mt)|0)|0)+((8191&(o=(o=o+Math.imul(b,gt)|0)+Math.imul(y,mt)|0))<<13)|0;f=((s=s+Math.imul(y,gt)|0)+(o>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(q,X),o=(o=Math.imul(q,Q))+Math.imul(D,X)|0,s=Math.imul(D,Q),n=n+Math.imul(C,tt)|0,o=(o=o+Math.imul(C,et)|0)+Math.imul(U,tt)|0,s=s+Math.imul(U,et)|0,n=n+Math.imul(O,it)|0,o=(o=o+Math.imul(O,nt)|0)+Math.imul(B,it)|0,s=s+Math.imul(B,nt)|0,n=n+Math.imul(P,st)|0,o=(o=o+Math.imul(P,at)|0)+Math.imul(I,st)|0,s=s+Math.imul(I,at)|0,n=n+Math.imul(A,ut)|0,o=(o=o+Math.imul(A,ft)|0)+Math.imul(x,ut)|0,s=s+Math.imul(x,ft)|0,n=n+Math.imul(k,lt)|0,o=(o=o+Math.imul(k,dt)|0)+Math.imul(E,lt)|0,s=s+Math.imul(E,dt)|0;var Tt=(f+(n=n+Math.imul(_,mt)|0)|0)+((8191&(o=(o=o+Math.imul(_,gt)|0)+Math.imul(M,mt)|0))<<13)|0;f=((s=s+Math.imul(M,gt)|0)+(o>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(q,tt),o=(o=Math.imul(q,et))+Math.imul(D,tt)|0,s=Math.imul(D,et),n=n+Math.imul(C,it)|0,o=(o=o+Math.imul(C,nt)|0)+Math.imul(U,it)|0,s=s+Math.imul(U,nt)|0,n=n+Math.imul(O,st)|0,o=(o=o+Math.imul(O,at)|0)+Math.imul(B,st)|0,s=s+Math.imul(B,at)|0,n=n+Math.imul(P,ut)|0,o=(o=o+Math.imul(P,ft)|0)+Math.imul(I,ut)|0,s=s+Math.imul(I,ft)|0,n=n+Math.imul(A,lt)|0,o=(o=o+Math.imul(A,dt)|0)+Math.imul(x,lt)|0,s=s+Math.imul(x,dt)|0;var Pt=(f+(n=n+Math.imul(k,mt)|0)|0)+((8191&(o=(o=o+Math.imul(k,gt)|0)+Math.imul(E,mt)|0))<<13)|0;f=((s=s+Math.imul(E,gt)|0)+(o>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,n=Math.imul(q,it),o=(o=Math.imul(q,nt))+Math.imul(D,it)|0,s=Math.imul(D,nt),n=n+Math.imul(C,st)|0,o=(o=o+Math.imul(C,at)|0)+Math.imul(U,st)|0,s=s+Math.imul(U,at)|0,n=n+Math.imul(O,ut)|0,o=(o=o+Math.imul(O,ft)|0)+Math.imul(B,ut)|0,s=s+Math.imul(B,ft)|0,n=n+Math.imul(P,lt)|0,o=(o=o+Math.imul(P,dt)|0)+Math.imul(I,lt)|0,s=s+Math.imul(I,dt)|0;var It=(f+(n=n+Math.imul(A,mt)|0)|0)+((8191&(o=(o=o+Math.imul(A,gt)|0)+Math.imul(x,mt)|0))<<13)|0;f=((s=s+Math.imul(x,gt)|0)+(o>>>13)|0)+(It>>>26)|0,It&=67108863,n=Math.imul(q,st),o=(o=Math.imul(q,at))+Math.imul(D,st)|0,s=Math.imul(D,at),n=n+Math.imul(C,ut)|0,o=(o=o+Math.imul(C,ft)|0)+Math.imul(U,ut)|0,s=s+Math.imul(U,ft)|0,n=n+Math.imul(O,lt)|0,o=(o=o+Math.imul(O,dt)|0)+Math.imul(B,lt)|0,s=s+Math.imul(B,dt)|0;var Lt=(f+(n=n+Math.imul(P,mt)|0)|0)+((8191&(o=(o=o+Math.imul(P,gt)|0)+Math.imul(I,mt)|0))<<13)|0;f=((s=s+Math.imul(I,gt)|0)+(o>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,n=Math.imul(q,ut),o=(o=Math.imul(q,ft))+Math.imul(D,ut)|0,s=Math.imul(D,ft),n=n+Math.imul(C,lt)|0,o=(o=o+Math.imul(C,dt)|0)+Math.imul(U,lt)|0,s=s+Math.imul(U,dt)|0;var Ot=(f+(n=n+Math.imul(O,mt)|0)|0)+((8191&(o=(o=o+Math.imul(O,gt)|0)+Math.imul(B,mt)|0))<<13)|0;f=((s=s+Math.imul(B,gt)|0)+(o>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,n=Math.imul(q,lt),o=(o=Math.imul(q,dt))+Math.imul(D,lt)|0,s=Math.imul(D,dt);var Bt=(f+(n=n+Math.imul(C,mt)|0)|0)+((8191&(o=(o=o+Math.imul(C,gt)|0)+Math.imul(U,mt)|0))<<13)|0;f=((s=s+Math.imul(U,gt)|0)+(o>>>13)|0)+(Bt>>>26)|0,Bt&=67108863;var jt=(f+(n=Math.imul(q,mt))|0)+((8191&(o=(o=Math.imul(q,gt))+Math.imul(D,mt)|0))<<13)|0;return f=((s=Math.imul(D,gt))+(o>>>13)|0)+(jt>>>26)|0,jt&=67108863,u[0]=vt,u[1]=bt,u[2]=yt,u[3]=wt,u[4]=_t,u[5]=Mt,u[6]=St,u[7]=kt,u[8]=Et,u[9]=Rt,u[10]=At,u[11]=xt,u[12]=Tt,u[13]=Pt,u[14]=It,u[15]=Lt,u[16]=Ot,u[17]=Bt,u[18]=jt,0!==f&&(u[19]=f,i.length++),i};function p(t,e,r){return(new m).mulp(t,e,r)}function m(t,e){this.x=t,this.y=e}Math.imul||(d=l),o.prototype.mulTo=function t(e,r){var i=this.length+e.length;return 10===this.length&&10===e.length?d(this,e,r):i<63?l(this,e,r):i<1024?function n(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var i=0,n=0,o=0;o<r.length-1;o++){var s=n;n=0;for(var a=67108863&i,h=Math.min(o,e.length-1),u=Math.max(0,o-t.length+1);u<=h;u++){var f=o-u,c=(0|t.words[f])*(0|e.words[u]),l=67108863&c;a=67108863&(l=l+a|0),n+=(s=(s=s+(c/67108864|0)|0)+(l>>>26)|0)>>>26,s&=67108863}r.words[o]=a,i=s,s=n}return 0!==i?r.words[o]=i:r.length--,r.strip()}(this,e,r):p(this,e,r)},m.prototype.makeRBT=function t(e){for(var r=new Array(e),i=o.prototype._countBits(e)-1,n=0;n<e;n++)r[n]=this.revBin(n,i,e);return r},m.prototype.revBin=function t(e,r,i){if(0===e||e===i-1)return e;for(var n=0,o=0;o<r;o++)n|=(1&e)<<r-o-1,e>>=1;return n},m.prototype.permute=function t(e,r,i,n,o,s){for(var a=0;a<s;a++)n[a]=r[e[a]],o[a]=i[e[a]]},m.prototype.transform=function t(e,r,i,n,o,s){this.permute(s,e,r,i,n,o);for(var a=1;a<o;a<<=1)for(var h=a<<1,u=Math.cos(2*Math.PI/h),f=Math.sin(2*Math.PI/h),c=0;c<o;c+=h)for(var l=u,d=f,p=0;p<a;p++){var m=i[c+p],g=n[c+p],v=i[c+p+a],b=n[c+p+a],y=l*v-d*b;b=l*b+d*v,v=y,i[c+p]=m+v,n[c+p]=g+b,i[c+p+a]=m-v,n[c+p+a]=g-b,p!==h&&(y=u*l-f*d,d=u*d+f*l,l=y)}},m.prototype.guessLen13b=function t(e,r){var i=1|Math.max(r,e),n=1&i,o=0;for(i=i/2|0;i;i>>>=1)o++;return 1<<o+1+n},m.prototype.conjugate=function t(e,r,i){if(!(i<=1))for(var n=0;n<i/2;n++){var o=e[n];e[n]=e[i-n-1],e[i-n-1]=o,o=r[n],r[n]=-r[i-n-1],r[i-n-1]=-o}},m.prototype.normalize13b=function t(e,r){for(var i=0,n=0;n<r/2;n++){var o=8192*Math.round(e[2*n+1]/r)+Math.round(e[2*n]/r)+i;e[n]=67108863&o,i=o<67108864?0:o/67108864|0}return e},m.prototype.convert13b=function t(e,r,n,o){for(var s=0,a=0;a<r;a++)s+=0|e[a],n[2*a]=8191&s,s>>>=13,n[2*a+1]=8191&s,s>>>=13;for(a=2*r;a<o;++a)n[a]=0;i(0===s),i(0==(-8192&s))},m.prototype.stub=function t(e){for(var r=new Array(e),i=0;i<e;i++)r[i]=0;return r},m.prototype.mulp=function t(e,r,i){var n=2*this.guessLen13b(e.length,r.length),o=this.makeRBT(n),s=this.stub(n),a=new Array(n),h=new Array(n),u=new Array(n),f=new Array(n),c=new Array(n),l=new Array(n),d=i.words;d.length=n,this.convert13b(e.words,e.length,a,n),this.convert13b(r.words,r.length,f,n),this.transform(a,s,h,u,n,o),this.transform(f,s,c,l,n,o);for(var p=0;p<n;p++){var m=h[p]*c[p]-u[p]*l[p];u[p]=h[p]*l[p]+u[p]*c[p],h[p]=m}return this.conjugate(h,u,n),this.transform(h,u,d,s,n,o),this.conjugate(d,s,n),this.normalize13b(d,n),i.negative=e.negative^r.negative,i.length=e.length+r.length,i.strip()},o.prototype.mul=function t(e){var r=new o(null);return r.words=new Array(this.length+e.length),this.mulTo(e,r)},o.prototype.mulf=function t(e){var r=new o(null);return r.words=new Array(this.length+e.length),p(this,e,r)},o.prototype.imul=function t(e){return this.clone().mulTo(e,this)},o.prototype.imuln=function t(e){i("number"==typeof e),i(e<67108864);for(var r=0,n=0;n<this.length;n++){var o=(0|this.words[n])*e,s=(67108863&o)+(67108863&r);r>>=26,r+=o/67108864|0,r+=s>>>26,this.words[n]=67108863&s}return 0!==r&&(this.words[n]=r,this.length++),this},o.prototype.muln=function t(e){return this.clone().imuln(e)},o.prototype.sqr=function t(){return this.mul(this)},o.prototype.isqr=function t(){return this.imul(this.clone())},o.prototype.pow=function t(e){var r=function i(t){for(var e=new Array(t.bitLength()),r=0;r<e.length;r++){var i=r/26|0,n=r%26;e[r]=(t.words[i]&1<<n)>>>n}return e}(e);if(0===r.length)return new o(1);for(var n=this,s=0;s<r.length&&0===r[s];s++,n=n.sqr());if(++s<r.length)for(var a=n.sqr();s<r.length;s++,a=a.sqr())0!==r[s]&&(n=n.mul(a));return n},o.prototype.iushln=function t(e){i("number"==typeof e&&e>=0);var r,n=e%26,o=(e-n)/26,s=67108863>>>26-n<<26-n;if(0!==n){var a=0;for(r=0;r<this.length;r++){var h=this.words[r]&s,u=(0|this.words[r])-h<<n;this.words[r]=u|a,a=h>>>26-n}a&&(this.words[r]=a,this.length++)}if(0!==o){for(r=this.length-1;r>=0;r--)this.words[r+o]=this.words[r];for(r=0;r<o;r++)this.words[r]=0;this.length+=o}return this.strip()},o.prototype.ishln=function t(e){return i(0===this.negative),this.iushln(e)},o.prototype.iushrn=function t(e,r,n){var o;i("number"==typeof e&&e>=0),o=r?(r-r%26)/26:0;var s=e%26,a=Math.min((e-s)/26,this.length),h=67108863^67108863>>>s<<s,u=n;if(o-=a,o=Math.max(0,o),u){for(var f=0;f<a;f++)u.words[f]=this.words[f];u.length=a}if(0===a);else if(this.length>a)for(this.length-=a,f=0;f<this.length;f++)this.words[f]=this.words[f+a];else this.words[0]=0,this.length=1;var c=0;for(f=this.length-1;f>=0&&(0!==c||f>=o);f--){var l=0|this.words[f];this.words[f]=c<<26-s|l>>>s,c=l&h}return u&&0!==c&&(u.words[u.length++]=c),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function t(e,r,n){return i(0===this.negative),this.iushrn(e,r,n)},o.prototype.shln=function t(e){return this.clone().ishln(e)},o.prototype.ushln=function t(e){return this.clone().iushln(e)},o.prototype.shrn=function t(e){return this.clone().ishrn(e)},o.prototype.ushrn=function t(e){return this.clone().iushrn(e)},o.prototype.testn=function t(e){i("number"==typeof e&&e>=0);var r=e%26,n=(e-r)/26,o=1<<r;return!(this.length<=n)&&!!(this.words[n]&o)},o.prototype.imaskn=function t(e){i("number"==typeof e&&e>=0);var r=e%26,n=(e-r)/26;if(i(0===this.negative,"imaskn works only with positive numbers"),this.length<=n)return this;if(0!==r&&n++,this.length=Math.min(n,this.length),0!==r){var o=67108863^67108863>>>r<<r;this.words[this.length-1]&=o}return this.strip()},o.prototype.maskn=function t(e){return this.clone().imaskn(e)},o.prototype.iaddn=function t(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)},o.prototype._iaddn=function t(e){this.words[0]+=e;for(var r=0;r<this.length&&this.words[r]>=67108864;r++)this.words[r]-=67108864,r===this.length-1?this.words[r+1]=1:this.words[r+1]++;return this.length=Math.max(this.length,r+1),this},o.prototype.isubn=function t(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 r=0;r<this.length&&this.words[r]<0;r++)this.words[r]+=67108864,this.words[r+1]-=1;return this.strip()},o.prototype.addn=function t(e){return this.clone().iaddn(e)},o.prototype.subn=function t(e){return this.clone().isubn(e)},o.prototype.iabs=function t(){return this.negative=0,this},o.prototype.abs=function t(){return this.clone().iabs()},o.prototype._ishlnsubmul=function t(e,r,n){var o,s,a=e.length+n;this._expand(a);var h=0;for(o=0;o<e.length;o++){s=(0|this.words[o+n])+h;var u=(0|e.words[o])*r;h=((s-=67108863&u)>>26)-(u/67108864|0),this.words[o+n]=67108863&s}for(;o<this.length-n;o++)h=(s=(0|this.words[o+n])+h)>>26,this.words[o+n]=67108863&s;if(0===h)return this.strip();for(i(-1===h),h=0,o=0;o<this.length;o++)h=(s=-(0|this.words[o])+h)>>26,this.words[o]=67108863&s;return this.negative=1,this.strip()},o.prototype._wordDiv=function t(e,r){var i=(this.length,e.length),n=this.clone(),s=e,a=0|s.words[s.length-1];0!==(i=26-this._countBits(a))&&(s=s.ushln(i),n.iushln(i),a=0|s.words[s.length-1]);var h,u=n.length-s.length;if("mod"!==r){(h=new o(null)).length=u+1,h.words=new Array(h.length);for(var f=0;f<h.length;f++)h.words[f]=0}var c=n.clone()._ishlnsubmul(s,1,u);0===c.negative&&(n=c,h&&(h.words[u]=1));for(var l=u-1;l>=0;l--){var d=67108864*(0|n.words[s.length+l])+(0|n.words[s.length+l-1]);for(d=Math.min(d/a|0,67108863),n._ishlnsubmul(s,d,l);0!==n.negative;)d--,n.negative=0,n._ishlnsubmul(s,1,l),n.isZero()||(n.negative^=1);h&&(h.words[l]=d)}return h&&h.strip(),n.strip(),"div"!==r&&0!==i&&n.iushrn(i),{div:h||null,mod:n}},o.prototype.divmod=function t(e,r,n){return i(!e.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===e.negative?(h=this.neg().divmod(e,r),"mod"!==r&&(s=h.div.neg()),"div"!==r&&(a=h.mod.neg(),n&&0!==a.negative&&a.iadd(e)),{div:s,mod:a}):0===this.negative&&0!==e.negative?(h=this.divmod(e.neg(),r),"mod"!==r&&(s=h.div.neg()),{div:s,mod:h.mod}):0!=(this.negative&e.negative)?(h=this.neg().divmod(e.neg(),r),"div"!==r&&(a=h.mod.neg(),n&&0!==a.negative&&a.isub(e)),{div:h.div,mod:a}):e.length>this.length||this.cmp(e)<0?{div:new o(0),mod:this}:1===e.length?"div"===r?{div:this.divn(e.words[0]),mod:null}:"mod"===r?{div:null,mod:new o(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new o(this.modn(e.words[0]))}:this._wordDiv(e,r);var s,a,h},o.prototype.div=function t(e){return this.divmod(e,"div",!1).div},o.prototype.mod=function t(e){return this.divmod(e,"mod",!1).mod},o.prototype.umod=function t(e){return this.divmod(e,"mod",!0).mod},o.prototype.divRound=function t(e){var r=this.divmod(e);if(r.mod.isZero())return r.div;var i=0!==r.div.negative?r.mod.isub(e):r.mod,n=e.ushrn(1),o=e.andln(1),s=i.cmp(n);return s<0||1===o&&0===s?r.div:0!==r.div.negative?r.div.isubn(1):r.div.iaddn(1)},o.prototype.modn=function t(e){i(e<=67108863);for(var r=(1<<26)%e,n=0,o=this.length-1;o>=0;o--)n=(r*n+(0|this.words[o]))%e;return n},o.prototype.idivn=function t(e){i(e<=67108863);for(var r=0,n=this.length-1;n>=0;n--){var o=(0|this.words[n])+67108864*r;this.words[n]=o/e|0,r=o%e}return this.strip()},o.prototype.divn=function t(e){return this.clone().idivn(e)},o.prototype.egcd=function t(e){i(0===e.negative),i(!e.isZero());var r=this,n=e.clone();r=0!==r.negative?r.umod(e):r.clone();for(var s=new o(1),a=new o(0),h=new o(0),u=new o(1),f=0;r.isEven()&&n.isEven();)r.iushrn(1),n.iushrn(1),++f;for(var c=n.clone(),l=r.clone();!r.isZero();){for(var d=0,p=1;0==(r.words[0]&p)&&d<26;++d,p<<=1);if(d>0)for(r.iushrn(d);d-- >0;)(s.isOdd()||a.isOdd())&&(s.iadd(c),a.isub(l)),s.iushrn(1),a.iushrn(1);for(var m=0,g=1;0==(n.words[0]&g)&&m<26;++m,g<<=1);if(m>0)for(n.iushrn(m);m-- >0;)(h.isOdd()||u.isOdd())&&(h.iadd(c),u.isub(l)),h.iushrn(1),u.iushrn(1);r.cmp(n)>=0?(r.isub(n),s.isub(h),a.isub(u)):(n.isub(r),h.isub(s),u.isub(a))}return{a:h,b:u,gcd:n.iushln(f)}},o.prototype._invmp=function t(e){i(0===e.negative),i(!e.isZero());var r=this,n=e.clone();r=0!==r.negative?r.umod(e):r.clone();for(var s,a=new o(1),h=new o(0),u=n.clone();r.cmpn(1)>0&&n.cmpn(1)>0;){for(var f=0,c=1;0==(r.words[0]&c)&&f<26;++f,c<<=1);if(f>0)for(r.iushrn(f);f-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);for(var l=0,d=1;0==(n.words[0]&d)&&l<26;++l,d<<=1);if(l>0)for(n.iushrn(l);l-- >0;)h.isOdd()&&h.iadd(u),h.iushrn(1);r.cmp(n)>=0?(r.isub(n),a.isub(h)):(n.isub(r),h.isub(a))}return(s=0===r.cmpn(1)?a:h).cmpn(0)<0&&s.iadd(e),s},o.prototype.gcd=function t(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var r=this.clone(),i=e.clone();r.negative=0,i.negative=0;for(var n=0;r.isEven()&&i.isEven();n++)r.iushrn(1),i.iushrn(1);for(;;){for(;r.isEven();)r.iushrn(1);for(;i.isEven();)i.iushrn(1);var o=r.cmp(i);if(o<0){var s=r;r=i,i=s}else if(0===o||0===i.cmpn(1))break;r.isub(i)}return i.iushln(n)},o.prototype.invm=function t(e){return this.egcd(e).a.umod(e)},o.prototype.isEven=function t(){return 0==(1&this.words[0])},o.prototype.isOdd=function t(){return 1==(1&this.words[0])},o.prototype.andln=function t(e){return this.words[0]&e},o.prototype.bincn=function t(e){i("number"==typeof e);var r=e%26,n=(e-r)/26,o=1<<r;if(this.length<=n)return this._expand(n+1),this.words[n]|=o,this;for(var s=o,a=n;0!==s&&a<this.length;a++){var h=0|this.words[a];s=(h+=s)>>>26,h&=67108863,this.words[a]=h}return 0!==s&&(this.words[a]=s,this.length++),this},o.prototype.isZero=function t(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function t(e){var r,n=e<0;if(0!==this.negative&&!n)return-1;if(0===this.negative&&n)return 1;if(this.strip(),this.length>1)r=1;else{n&&(e=-e),i(e<=67108863,"Number is too big");var o=0|this.words[0];r=o===e?0:o<e?-1:1}return 0!==this.negative?0|-r:r},o.prototype.cmp=function t(e){if(0!==this.negative&&0===e.negative)return-1;if(0===this.negative&&0!==e.negative)return 1;var r=this.ucmp(e);return 0!==this.negative?0|-r:r},o.prototype.ucmp=function t(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var r=0,i=this.length-1;i>=0;i--){var n=0|this.words[i],o=0|e.words[i];if(n!==o){n<o?r=-1:n>o&&(r=1);break}}return r},o.prototype.gtn=function t(e){return 1===this.cmpn(e)},o.prototype.gt=function t(e){return 1===this.cmp(e)},o.prototype.gten=function t(e){return this.cmpn(e)>=0},o.prototype.gte=function t(e){return this.cmp(e)>=0},o.prototype.ltn=function t(e){return-1===this.cmpn(e)},o.prototype.lt=function t(e){return-1===this.cmp(e)},o.prototype.lten=function t(e){return this.cmpn(e)<=0},o.prototype.lte=function t(e){return this.cmp(e)<=0},o.prototype.eqn=function t(e){return 0===this.cmpn(e)},o.prototype.eq=function t(e){return 0===this.cmp(e)},o.red=function t(e){return new M(e)},o.prototype.toRed=function t(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)},o.prototype.fromRed=function t(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function t(e){return this.red=e,this},o.prototype.forceRed=function t(e){return i(!this.red,"Already a number in reduction context"),this._forceRed(e)},o.prototype.redAdd=function t(e){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},o.prototype.redIAdd=function t(e){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},o.prototype.redSub=function t(e){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},o.prototype.redISub=function t(e){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},o.prototype.redShl=function t(e){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},o.prototype.redMul=function t(e){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},o.prototype.redIMul=function t(e){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},o.prototype.redSqr=function t(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function t(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function t(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function t(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function t(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function t(e){return i(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var g={k256:null,p224:null,p192:null,p25519:null};function v(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function b(){v.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function y(){v.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function w(){v.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function _(){v.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function M(t){if("string"==typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else i(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function S(t){M.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}v.prototype._tmp=function t(){var e=new o(null);return e.words=new Array(Math.ceil(this.n/13)),e},v.prototype.ireduce=function t(e){var r,i=e;do{this.split(i,this.tmp),r=(i=(i=this.imulK(i)).iadd(this.tmp)).bitLength()}while(r>this.n);var n=r<this.n?-1:i.ucmp(this.p);return 0===n?(i.words[0]=0,i.length=1):n>0?i.isub(this.p):void 0!==i.strip?i.strip():i._strip(),i},v.prototype.split=function t(e,r){e.iushrn(this.n,0,r)},v.prototype.imulK=function t(e){return e.imul(this.k)},n(b,v),b.prototype.split=function t(e,r){for(var i=4194303,n=Math.min(e.length,9),o=0;o<n;o++)r.words[o]=e.words[o];if(r.length=n,e.length<=9)return e.words[0]=0,void(e.length=1);var s=e.words[9];for(r.words[r.length++]=s&i,o=10;o<e.length;o++){var a=0|e.words[o];e.words[o-10]=(a&i)<<4|s>>>22,s=a}s>>>=22,e.words[o-10]=s,0===s&&e.length>10?e.length-=10:e.length-=9},b.prototype.imulK=function t(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var r=0,i=0;i<e.length;i++){var n=0|e.words[i];r+=977*n,e.words[i]=67108863&r,r=64*n+(r/67108864|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},n(y,v),n(w,v),n(_,v),_.prototype.imulK=function t(e){for(var r=0,i=0;i<e.length;i++){var n=19*(0|e.words[i])+r,o=67108863&n;n>>>=26,e.words[i]=o,r=n}return 0!==r&&(e.words[e.length++]=r),e},o._prime=function t(e){if(g[e])return g[e];var t;if("k256"===e)t=new b;else if("p224"===e)t=new y;else if("p192"===e)t=new w;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new _}return g[e]=t,t},M.prototype._verify1=function t(e){i(0===e.negative,"red works only with positives"),i(e.red,"red works only with red numbers")},M.prototype._verify2=function t(e,r){i(0==(e.negative|r.negative),"red works only with positives"),i(e.red&&e.red===r.red,"red works only with red numbers")},M.prototype.imod=function t(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},M.prototype.neg=function t(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},M.prototype.add=function t(e,r){this._verify2(e,r);var i=e.add(r);return i.cmp(this.m)>=0&&i.isub(this.m),i._forceRed(this)},M.prototype.iadd=function t(e,r){this._verify2(e,r);var i=e.iadd(r);return i.cmp(this.m)>=0&&i.isub(this.m),i},M.prototype.sub=function t(e,r){this._verify2(e,r);var i=e.sub(r);return i.cmpn(0)<0&&i.iadd(this.m),i._forceRed(this)},M.prototype.isub=function t(e,r){this._verify2(e,r);var i=e.isub(r);return i.cmpn(0)<0&&i.iadd(this.m),i},M.prototype.shl=function t(e,r){return this._verify1(e),this.imod(e.ushln(r))},M.prototype.imul=function t(e,r){return this._verify2(e,r),this.imod(e.imul(r))},M.prototype.mul=function t(e,r){return this._verify2(e,r),this.imod(e.mul(r))},M.prototype.isqr=function t(e){return this.imul(e,e.clone())},M.prototype.sqr=function t(e){return this.mul(e,e)},M.prototype.sqrt=function t(e){if(e.isZero())return e.clone();var r=this.m.andln(3);if(i(r%2==1),3===r){var n=this.m.add(new o(1)).iushrn(2);return this.pow(e,n)}for(var s=this.m.subn(1),a=0;!s.isZero()&&0===s.andln(1);)a++,s.iushrn(1);i(!s.isZero());var h=new o(1).toRed(this),u=h.redNeg(),f=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new o(2*c*c).toRed(this);0!==this.pow(c,f).cmp(u);)c.redIAdd(u);for(var l=this.pow(c,s),d=this.pow(e,s.addn(1).iushrn(1)),p=this.pow(e,s),m=a;0!==p.cmp(h);){for(var g=p,v=0;0!==g.cmp(h);v++)g=g.redSqr();i(v<m);var b=this.pow(l,new o(1).iushln(m-v-1));d=d.redMul(b),l=b.redSqr(),p=p.redMul(l),m=v}return d},M.prototype.invm=function t(e){var r=e._invmp(this.m);return 0!==r.negative?(r.negative=0,this.imod(r).redNeg()):this.imod(r)},M.prototype.pow=function t(e,r){if(r.isZero())return new o(1).toRed(this);if(0===r.cmpn(1))return e.clone();var i=new Array(16);i[0]=new o(1).toRed(this),i[1]=e;for(var n=2;n<i.length;n++)i[n]=this.mul(i[n-1],e);var s=i[0],a=0,h=0,u=r.bitLength()%26;for(0===u&&(u=26),n=r.length-1;n>=0;n--){for(var f=r.words[n],c=u-1;c>=0;c--){var l=f>>c&1;s!==i[0]&&(s=this.sqr(s)),0!==l||0!==a?(a<<=1,a|=l,(4===++h||0===n&&0===c)&&(s=this.mul(s,i[a]),h=0,a=0)):h=0}u=26}return s},M.prototype.convertTo=function t(e){var r=e.umod(this.m);return r===e?r.clone():r},M.prototype.convertFrom=function t(e){var r=e.clone();return r.red=null,r},o.mont=function t(e){return new S(e)},n(S,M),S.prototype.convertTo=function t(e){return this.imod(e.ushln(this.shift))},S.prototype.convertFrom=function t(e){var r=this.imod(e.mul(this.rinv));return r.red=null,r},S.prototype.imul=function t(e,r){if(e.isZero()||r.isZero())return e.words[0]=0,e.length=1,e;var i=e.imul(r),n=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=i.isub(n).iushrn(this.shift),s=o;return o.cmp(this.m)>=0?s=o.isub(this.m):o.cmpn(0)<0&&(s=o.iadd(this.m)),s._forceRed(this)},S.prototype.mul=function t(e,r){if(e.isZero()||r.isZero())return new o(0)._forceRed(this);var i=e.mul(r),n=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),s=i.isub(n).iushrn(this.shift),a=s;return s.cmp(this.m)>=0?a=s.isub(this.m):s.cmpn(0)<0&&(a=s.iadd(this.m)),a._forceRed(this)},S.prototype.invm=function t(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(t,this)}).call(this,r(28)(t))},function(t,e){},function(t,e){},function(t){t.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(t,e,r){(function(e){var i=r(174),n=new(r(175)),o=new i(24),s=new i(11),a=new i(10),h=new i(3),u=new i(7),f=r(173),c=r(31);function l(t,r){return r=r||"utf8",e.isBuffer(t)||(t=new e(t,r)),this._pub=new i(t),this}function d(t,r){return r=r||"utf8",e.isBuffer(t)||(t=new e(t,r)),this._priv=new i(t),this}t.exports=m;var p={};function m(t,e,r){this.setGenerator(e),this.__prime=new i(t),this._prime=i.mont(this.__prime),this._primeLen=t.length,this._pub=void 0,this._priv=void 0,this._primeCode=void 0,r?(this.setPublicKey=l,this.setPrivateKey=d):this._primeCode=8}function g(t,r){var i=new e(t.toArray());return r?i.toString(r):i}Object.defineProperty(m.prototype,"verifyError",{enumerable:!0,get:function(){return"number"!=typeof this._primeCode&&(this._primeCode=function t(e,r){var i=r.toString("hex"),c=[i,e.toString(16)].join("_");if(c in p)return p[c];var l,d=0;if(e.isEven()||!f.simpleSieve||!f.fermatTest(e)||!n.test(e))return d+=1,d+="02"===i||"05"===i?8:4,p[c]=d,d;switch(n.test(e.shrn(1))||(d+=2),i){case"02":e.mod(o).cmp(s)&&(d+=8);break;case"05":(l=e.mod(a)).cmp(h)&&l.cmp(u)&&(d+=8);break;default:d+=4}return p[c]=d,d}(this.__prime,this.__gen)),this._primeCode}}),m.prototype.generateKeys=function(){return this._priv||(this._priv=new i(c(this._primeLen))),this._pub=this._gen.toRed(this._prime).redPow(this._priv).fromRed(),this.getPublicKey()},m.prototype.computeSecret=function(t){var r=(t=(t=new i(t)).toRed(this._prime)).redPow(this._priv).fromRed(),n=new e(r.toArray()),o=this.getPrime();if(n.length<o.length){var s=new e(o.length-n.length);s.fill(0),n=e.concat([s,n])}return n},m.prototype.getPublicKey=function t(e){return g(this._pub,e)},m.prototype.getPrivateKey=function t(e){return g(this._priv,e)},m.prototype.getPrime=function(t){return g(this.__prime,t)},m.prototype.getGenerator=function(t){return g(this._gen,t)},m.prototype.setGenerator=function(t,r){return r=r||"utf8",e.isBuffer(t)||(t=new e(t,r)),this.__gen=t,this._gen=new i(t),this}}).call(this,r(26).Buffer)},function(t,e,r){var i=r(99).Buffer,n=r(43),o=r(330),s=r(37),a=r(338),h=r(369),u=r(160);function f(t){o.Writable.call(this);var e=u[t];if(!e)throw new Error("Unknown message digest");this._hashType=e.hash,this._hash=n(e.hash),this._tag=e.id,this._signType=e.sign}function c(t){o.Writable.call(this);var e=u[t];if(!e)throw new Error("Unknown message digest");this._hash=n(e.hash),this._tag=e.id,this._signType=e.sign}function l(t){return new f(t)}function d(t){return new c(t)}Object.keys(u).forEach((function(t){u[t].id=i.from(u[t].id,"hex"),u[t.toLowerCase()]=u[t]})),s(f,o.Writable),f.prototype._write=function t(e,r,i){this._hash.update(e),i()},f.prototype.update=function t(e,r){return"string"==typeof e&&(e=i.from(e,r)),this._hash.update(e),this},f.prototype.sign=function t(e,r){this.end();var i=this._hash.digest(),n=a(i,e,this._hashType,this._signType,this._tag);return r?n.toString(r):n},s(c,o.Writable),c.prototype._write=function t(e,r,i){this._hash.update(e),i()},c.prototype.update=function t(e,r){return"string"==typeof e&&(e=i.from(e,r)),this._hash.update(e),this},c.prototype.verify=function t(e,r,n){"string"==typeof r&&(r=i.from(r,n)),this.end();var o=this._hash.digest();return h(r,o,e,this._signType,this._tag)},t.exports={Sign:l,Verify:d,createSign:l,createVerify:d}},function(t,e,r){(e=t.exports=r(176)).Stream=e,e.Readable=e,e.Writable=r(180),e.Duplex=r(38),e.Transform=r(181),e.PassThrough=r(336),e.finished=r(100),e.pipeline=r(337)},function(t,e){},function(t,e,r){"use strict";function i(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,i)}return r}function n(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function o(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}var s=r(7).Buffer,a=r(333).inspect,h=a&&a.custom||"inspect";t.exports=function(){function t(){!function e(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}(this,t),this.head=null,this.tail=null,this.length=0}return function e(t,r,i){return r&&o(t.prototype,r),i&&o(t,i),t}(t,[{key:"push",value:function t(e){var r={data:e,next:null};this.length>0?this.tail.next=r:this.head=r,this.tail=r,++this.length}},{key:"unshift",value:function t(e){var r={data:e,next:this.head};0===this.length&&(this.tail=r),this.head=r,++this.length}},{key:"shift",value:function t(){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}}},{key:"clear",value:function t(){this.head=this.tail=null,this.length=0}},{key:"join",value:function t(e){if(0===this.length)return"";for(var r=this.head,i=""+r.data;r=r.next;)i+=e+r.data;return i}},{key:"concat",value:function t(e){if(0===this.length)return s.alloc(0);for(var r,i,n,o=s.allocUnsafe(e>>>0),a=this.head,h=0;a;)r=a.data,i=o,n=h,s.prototype.copy.call(r,i,n),h+=a.data.length,a=a.next;return o}},{key:"consume",value:function t(e,r){var i;return e<this.head.data.length?(i=this.head.data.slice(0,e),this.head.data=this.head.data.slice(e)):i=e===this.head.data.length?this.shift():r?this._getString(e):this._getBuffer(e),i}},{key:"first",value:function t(){return this.head.data}},{key:"_getString",value:function t(e){var r=this.head,i=1,n=r.data;for(e-=n.length;r=r.next;){var o=r.data,s=e>o.length?o.length:e;if(s===o.length?n+=o:n+=o.slice(0,e),0===(e-=s)){s===o.length?(++i,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=o.slice(s));break}++i}return this.length-=i,n}},{key:"_getBuffer",value:function t(e){var r=s.allocUnsafe(e),i=this.head,n=1;for(i.data.copy(r),e-=i.data.length;i=i.next;){var o=i.data,a=e>o.length?o.length:e;if(o.copy(r,r.length-e,0,a),0===(e-=a)){a===o.length?(++n,i.next?this.head=i.next:this.head=this.tail=null):(this.head=i,i.data=o.slice(a));break}++n}return this.length-=n,r}},{key:h,value:function t(e,r){return a(this,function o(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?i(Object(r),!0).forEach((function(e){n(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):i(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}({},r,{depth:0,customInspect:!1}))}}]),t}()},function(t,e){},function(t,e,r){"use strict";(function(e){var i;function n(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var o=r(100),s=Symbol("lastResolve"),a=Symbol("lastReject"),h=Symbol("error"),u=Symbol("ended"),f=Symbol("lastPromise"),c=Symbol("handlePromise"),l=Symbol("stream");function d(t,e){return{value:t,done:e}}function p(t){var e=t[s];if(null!==e){var r=t[l].read();null!==r&&(t[f]=null,t[s]=null,t[a]=null,e(d(r,!1)))}}function m(t){e.nextTick(p,t)}var g=Object.getPrototypeOf((function(){})),v=Object.setPrototypeOf((n(i={get stream(){return this[l]},next:function t(){var r=this,i=this[h];if(null!==i)return Promise.reject(i);if(this[u])return Promise.resolve(d(void 0,!0));if(this[l].destroyed)return new Promise((function(t,i){e.nextTick((function(){r[h]?i(r[h]):t(d(void 0,!0))}))}));var n,o=this[f];if(o)n=new Promise(function s(t,e){return function(r,i){t.then((function(){e[u]?r(d(void 0,!0)):e[c](r,i)}),i)}}(o,this));else{var a=this[l].read();if(null!==a)return Promise.resolve(d(a,!1));n=new Promise(this[c])}return this[f]=n,n}},Symbol.asyncIterator,(function(){return this})),n(i,"return",(function t(){var e=this;return new Promise((function(t,r){e[l].destroy(null,(function(e){e?r(e):t(d(void 0,!0))}))}))})),i),g);t.exports=function t(e){var r,i=Object.create(v,(n(r={},l,{value:e,writable:!0}),n(r,s,{value:null,writable:!0}),n(r,a,{value:null,writable:!0}),n(r,h,{value:null,writable:!0}),n(r,u,{value:e._readableState.endEmitted,writable:!0}),n(r,c,{value:function t(e,r){var n=i[l].read();n?(i[f]=null,i[s]=null,i[a]=null,e(d(n,!1))):(i[s]=e,i[a]=r)},writable:!0}),r));return i[f]=null,o(e,(function(t){if(t&&"ERR_STREAM_PREMATURE_CLOSE"!==t.code){var e=i[a];return null!==e&&(i[f]=null,i[s]=null,i[a]=null,e(t)),void(i[h]=t)}var r=i[s];null!==r&&(i[f]=null,i[s]=null,i[a]=null,r(d(void 0,!0))),i[u]=!0})),e.on("readable",m.bind(null,i)),i}}).call(this,r(4))},function(t,e){t.exports=function(){throw new Error("Readable.from is not available in the browser")}},function(t,e,r){"use strict";t.exports=n;var i=r(181);function n(t){if(!(this instanceof n))return new n(t);i.call(this,t)}r(37)(n,i),n.prototype._transform=function(t,e,r){r(null,t)}},function(t,e,r){"use strict";var i;var n=r(36).codes,o=n.ERR_MISSING_ARGS,s=n.ERR_STREAM_DESTROYED;function a(t){if(t)throw t}function h(t,e,n,o){o=function a(t){var e=!1;return function(){e||(e=!0,t.apply(void 0,arguments))}}(o);var h=!1;t.on("close",(function(){h=!0})),void 0===i&&(i=r(100)),i(t,{readable:e,writable:n},(function(t){if(t)return o(t);h=!0,o()}));var u=!1;return function(e){if(!h&&!u)return u=!0,function r(t){return t.setHeader&&"function"==typeof t.abort}(t)?t.abort():"function"==typeof t.destroy?t.destroy():void o(e||new s("pipe"))}}function u(t){t()}function f(t,e){return t.pipe(e)}function c(t){return t.length?"function"!=typeof t[t.length-1]?a:t.pop():a}t.exports=function l(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];var i,n=c(e);if(Array.isArray(e[0])&&(e=e[0]),e.length<2)throw new o("streams");var s=e.map((function(t,r){var o=r<e.length-1;return h(t,o,r>0,(function(t){i||(i=t),t&&s.forEach(u),o||(s.forEach(u),n(i))}))}));return e.reduce(f)}},function(t,e,r){var i=r(99).Buffer,n=r(158),o=r(101),s=r(103).ec,a=r(102),h=r(65),u=r(193);function f(t,e,r,o){if((t=i.from(t.toArray())).length<e.byteLength()){var s=i.alloc(e.byteLength()-t.length);t=i.concat([s,t])}var a=r.length,h=function u(t,e){t=(t=c(t,e)).mod(e);var r=i.from(t.toArray());if(r.length<e.byteLength()){var n=i.alloc(e.byteLength()-r.length);r=i.concat([n,r])}return r}(r,e),f=i.alloc(a);f.fill(1);var l=i.alloc(a);return l=n(o,l).update(f).update(i.from([0])).update(t).update(h).digest(),f=n(o,l).update(f).digest(),{k:l=n(o,l).update(f).update(i.from([1])).update(t).update(h).digest(),v:f=n(o,l).update(f).digest()}}function c(t,e){var r=new a(t),i=(t.length<<3)-e.bitLength();return i>0&&r.ishrn(i),r}function l(t,e,r){var o,s;do{for(o=i.alloc(0);8*o.length<t.bitLength();)e.v=n(r,e.k).update(e.v).digest(),o=i.concat([o,e.v]);s=c(o,t),e.k=n(r,e.k).update(e.v).update(i.from([0])).digest(),e.v=n(r,e.k).update(e.v).digest()}while(-1!==s.cmp(t));return s}function d(t,e,r,i){return t.toRed(a.mont(r)).redPow(e).fromRed().mod(i)}t.exports=function p(t,e,r,n,m){var g=h(e);if(g.curve){if("ecdsa"!==n&&"ecdsa/rsa"!==n)throw new Error("wrong private key type");return function v(t,e){var r=u[e.curve.join(".")];if(!r)throw new Error("unknown curve "+e.curve.join("."));var n=new s(r).keyFromPrivate(e.privateKey).sign(t);return i.from(n.toDER())}(t,g)}if("dsa"===g.type){if("dsa"!==n)throw new Error("wrong private key type");return function b(t,e,r){var n,o=e.params.priv_key,s=e.params.p,h=e.params.q,u=e.params.g,p=new a(0),m=c(t,h).mod(h),g=!1,v=f(o,h,t,r);for(;!1===g;)p=d(u,n=l(h,v,r),s,h),0===(g=n.invm(h).imul(m.add(o.mul(p))).mod(h)).cmpn(0)&&(g=!1,p=new a(0));return function b(t,e){t=t.toArray(),e=e.toArray(),128&t[0]&&(t=[0].concat(t));128&e[0]&&(e=[0].concat(e));var r=[48,t.length+e.length+4,2,t.length];return r=r.concat(t,[2,e.length],e),i.from(r)}(p,g)}(t,g,r)}if("rsa"!==n&&"ecdsa/rsa"!==n)throw new Error("wrong private key type");t=i.concat([m,t]);for(var y=g.modulus.byteLength(),w=[0,1];t.length+w.length+1<y;)w.push(255);w.push(0);for(var _=-1;++_<t.length;)w.push(t[_]);return o(w,g)},t.exports.getKey=f,t.exports.makeKey=l},function(t,e){},function(t){t.exports=JSON.parse('{"_args":[["[email protected]","C:\\\\ballen\\\\github\\\\IdentityModel\\\\oidc-client-js"]],"_development":true,"_from":"[email protected]","_id":"[email protected]","_inBundle":false,"_integrity":"sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ==","_location":"/elliptic","_phantomChildren":{},"_requested":{"type":"version","registry":true,"raw":"[email protected]","name":"elliptic","escapedName":"elliptic","rawSpec":"6.5.4","saveSpec":null,"fetchSpec":"6.5.4"},"_requiredBy":["/browserify-sign","/create-ecdh"],"_resolved":"https://registry.npmjs.org/elliptic/-/elliptic-6.5.4.tgz","_spec":"6.5.4","_where":"C:\\\\ballen\\\\github\\\\IdentityModel\\\\oidc-client-js","author":{"name":"Fedor Indutny","email":"[email protected]"},"bugs":{"url":"https://github.com/indutny/elliptic/issues"},"dependencies":{"bn.js":"^4.11.9","brorand":"^1.1.0","hash.js":"^1.0.0","hmac-drbg":"^1.0.1","inherits":"^2.0.4","minimalistic-assert":"^1.0.1","minimalistic-crypto-utils":"^1.0.1"},"description":"EC cryptography","devDependencies":{"brfs":"^2.0.2","coveralls":"^3.1.0","eslint":"^7.6.0","grunt":"^1.2.1","grunt-browserify":"^5.3.0","grunt-cli":"^1.3.2","grunt-contrib-connect":"^3.0.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-uglify":"^5.0.0","grunt-mocha-istanbul":"^5.0.2","grunt-saucelabs":"^9.0.1","istanbul":"^0.4.5","mocha":"^8.0.1"},"files":["lib"],"homepage":"https://github.com/indutny/elliptic","keywords":["EC","Elliptic","curve","Cryptography"],"license":"MIT","main":"lib/elliptic.js","name":"elliptic","repository":{"type":"git","url":"git+ssh://[email protected]/indutny/elliptic.git"},"scripts":{"lint":"eslint lib test","lint:fix":"npm run lint -- --fix","test":"npm run lint && npm run unit","unit":"istanbul test _mocha --reporter=spec test/index.js","version":"grunt dist && git add dist/"},"version":"6.5.4"}')},function(t,e){},function(t,e,r){"use strict";var i=r(11),n=r(16),o=r(104),s=r(64),a=i.assert;function h(t){s.call(this,"short",t),this.a=new n(t.a,16).toRed(this.red),this.b=new n(t.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(t),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function u(t,e,r,i){s.BasePoint.call(this,t,"affine"),null===e&&null===r?(this.x=null,this.y=null,this.inf=!0):(this.x=new n(e,16),this.y=new n(r,16),i&&(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(t,e,r,i){s.BasePoint.call(this,t,"jacobian"),null===e&&null===r&&null===i?(this.x=this.curve.one,this.y=this.curve.one,this.z=new n(0)):(this.x=new n(e,16),this.y=new n(r,16),this.z=new n(i,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}o(h,s),t.exports=h,h.prototype._getEndomorphism=function t(e){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var r,i;if(e.beta)r=new n(e.beta,16).toRed(this.red);else{var o=this._getEndoRoots(this.p);r=(r=o[0].cmp(o[1])<0?o[0]:o[1]).toRed(this.red)}if(e.lambda)i=new n(e.lambda,16);else{var s=this._getEndoRoots(this.n);0===this.g.mul(s[0]).x.cmp(this.g.x.redMul(r))?i=s[0]:(i=s[1],a(0===this.g.mul(i).x.cmp(this.g.x.redMul(r))))}return{beta:r,lambda:i,basis:e.basis?e.basis.map((function(t){return{a:new n(t.a,16),b:new n(t.b,16)}})):this._getEndoBasis(i)}}},h.prototype._getEndoRoots=function t(e){var r=e===this.p?this.red:n.mont(e),i=new n(2).toRed(r).redInvm(),o=i.redNeg(),s=new n(3).toRed(r).redNeg().redSqrt().redMul(i);return[o.redAdd(s).fromRed(),o.redSub(s).fromRed()]},h.prototype._getEndoBasis=function t(e){for(var r,i,o,s,a,h,u,f,c,l=this.n.ushrn(Math.floor(this.n.bitLength()/2)),d=e,p=this.n.clone(),m=new n(1),g=new n(0),v=new n(0),b=new n(1),y=0;0!==d.cmpn(0);){var w=p.div(d);f=p.sub(w.mul(d)),c=v.sub(w.mul(m));var _=b.sub(w.mul(g));if(!o&&f.cmp(l)<0)r=u.neg(),i=m,o=f.neg(),s=c;else if(o&&2==++y)break;u=f,p=d,d=f,v=m,m=c,b=g,g=_}a=f.neg(),h=c;var M=o.sqr().add(s.sqr());return a.sqr().add(h.sqr()).cmp(M)>=0&&(a=r,h=i),o.negative&&(o=o.neg(),s=s.neg()),a.negative&&(a=a.neg(),h=h.neg()),[{a:o,b:s},{a:a,b:h}]},h.prototype._endoSplit=function t(e){var r=this.endo.basis,i=r[0],n=r[1],o=n.b.mul(e).divRound(this.n),s=i.b.neg().mul(e).divRound(this.n),a=o.mul(i.a),h=s.mul(n.a),u=o.mul(i.b),f=s.mul(n.b);return{k1:e.sub(a).sub(h),k2:u.add(f).neg()}},h.prototype.pointFromX=function t(e,r){(e=new n(e,16)).red||(e=e.toRed(this.red));var i=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),o=i.redSqrt();if(0!==o.redSqr().redSub(i).cmp(this.zero))throw new Error("invalid point");var s=o.fromRed().isOdd();return(r&&!s||!r&&s)&&(o=o.redNeg()),this.point(e,o)},h.prototype.validate=function t(e){if(e.inf)return!0;var r=e.x,i=e.y,n=this.a.redMul(r),o=r.redSqr().redMul(r).redIAdd(n).redIAdd(this.b);return 0===i.redSqr().redISub(o).cmpn(0)},h.prototype._endoWnafMulAdd=function t(e,r,i){for(var n=this._endoWnafT1,o=this._endoWnafT2,s=0;s<e.length;s++){var a=this._endoSplit(r[s]),h=e[s],u=h._getBeta();a.k1.negative&&(a.k1.ineg(),h=h.neg(!0)),a.k2.negative&&(a.k2.ineg(),u=u.neg(!0)),n[2*s]=h,n[2*s+1]=u,o[2*s]=a.k1,o[2*s+1]=a.k2}for(var f=this._wnafMulAdd(1,n,o,2*s,i),c=0;c<2*s;c++)n[c]=null,o[c]=null;return f},o(u,s.BasePoint),h.prototype.point=function t(e,r,i){return new u(this,e,r,i)},h.prototype.pointFromJSON=function t(e,r){return u.fromJSON(this,e,r)},u.prototype._getBeta=function t(){if(this.curve.endo){var e=this.precomputed;if(e&&e.beta)return e.beta;var r=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(e){var i=this.curve,n=function(t){return i.point(t.x.redMul(i.endo.beta),t.y)};e.beta=r,r.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 r}},u.prototype.toJSON=function t(){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]},u.fromJSON=function t(e,r,i){"string"==typeof r&&(r=JSON.parse(r));var n=e.point(r[0],r[1],i);if(!r[2])return n;function o(t){return e.point(t[0],t[1],i)}var s=r[2];return n.precomputed={beta:null,doubles:s.doubles&&{step:s.doubles.step,points:[n].concat(s.doubles.points.map(o))},naf:s.naf&&{wnd:s.naf.wnd,points:[n].concat(s.naf.points.map(o))}},n},u.prototype.inspect=function t(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},u.prototype.isInfinity=function t(){return this.inf},u.prototype.add=function t(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 r=this.y.redSub(e.y);0!==r.cmpn(0)&&(r=r.redMul(this.x.redSub(e.x).redInvm()));var i=r.redSqr().redISub(this.x).redISub(e.x),n=r.redMul(this.x.redSub(i)).redISub(this.y);return this.curve.point(i,n)},u.prototype.dbl=function t(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var r=this.curve.a,i=this.x.redSqr(),n=e.redInvm(),o=i.redAdd(i).redIAdd(i).redIAdd(r).redMul(n),s=o.redSqr().redISub(this.x.redAdd(this.x)),a=o.redMul(this.x.redSub(s)).redISub(this.y);return this.curve.point(s,a)},u.prototype.getX=function t(){return this.x.fromRed()},u.prototype.getY=function t(){return this.y.fromRed()},u.prototype.mul=function t(e){return e=new n(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},u.prototype.mulAdd=function t(e,r,i){var n=[this,r],o=[e,i];return this.curve.endo?this.curve._endoWnafMulAdd(n,o):this.curve._wnafMulAdd(1,n,o,2)},u.prototype.jmulAdd=function t(e,r,i){var n=[this,r],o=[e,i];return this.curve.endo?this.curve._endoWnafMulAdd(n,o,!0):this.curve._wnafMulAdd(1,n,o,2,!0)},u.prototype.eq=function t(e){return this===e||this.inf===e.inf&&(this.inf||0===this.x.cmp(e.x)&&0===this.y.cmp(e.y))},u.prototype.neg=function t(e){if(this.inf)return this;var r=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var i=this.precomputed,n=function(t){return t.neg()};r.precomputed={naf:i.naf&&{wnd:i.naf.wnd,points:i.naf.points.map(n)},doubles:i.doubles&&{step:i.doubles.step,points:i.doubles.points.map(n)}}}return r},u.prototype.toJ=function t(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},o(f,s.BasePoint),h.prototype.jpoint=function t(e,r,i){return new f(this,e,r,i)},f.prototype.toP=function t(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),r=e.redSqr(),i=this.x.redMul(r),n=this.y.redMul(r).redMul(e);return this.curve.point(i,n)},f.prototype.neg=function t(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},f.prototype.add=function t(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var r=e.z.redSqr(),i=this.z.redSqr(),n=this.x.redMul(r),o=e.x.redMul(i),s=this.y.redMul(r.redMul(e.z)),a=e.y.redMul(i.redMul(this.z)),h=n.redSub(o),u=s.redSub(a);if(0===h.cmpn(0))return 0!==u.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var f=h.redSqr(),c=f.redMul(h),l=n.redMul(f),d=u.redSqr().redIAdd(c).redISub(l).redISub(l),p=u.redMul(l.redISub(d)).redISub(s.redMul(c)),m=this.z.redMul(e.z).redMul(h);return this.curve.jpoint(d,p,m)},f.prototype.mixedAdd=function t(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var r=this.z.redSqr(),i=this.x,n=e.x.redMul(r),o=this.y,s=e.y.redMul(r).redMul(this.z),a=i.redSub(n),h=o.redSub(s);if(0===a.cmpn(0))return 0!==h.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=a.redSqr(),f=u.redMul(a),c=i.redMul(u),l=h.redSqr().redIAdd(f).redISub(c).redISub(c),d=h.redMul(c.redISub(l)).redISub(o.redMul(f)),p=this.z.redMul(a);return this.curve.jpoint(l,d,p)},f.prototype.dblp=function t(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var r;if(this.curve.zeroA||this.curve.threeA){var i=this;for(r=0;r<e;r++)i=i.dbl();return i}var n=this.curve.a,o=this.curve.tinv,s=this.x,a=this.y,h=this.z,u=h.redSqr().redSqr(),f=a.redAdd(a);for(r=0;r<e;r++){var c=s.redSqr(),l=f.redSqr(),d=l.redSqr(),p=c.redAdd(c).redIAdd(c).redIAdd(n.redMul(u)),m=s.redMul(l),g=p.redSqr().redISub(m.redAdd(m)),v=m.redISub(g),b=p.redMul(v);b=b.redIAdd(b).redISub(d);var y=f.redMul(h);r+1<e&&(u=u.redMul(d)),s=g,h=y,f=b}return this.curve.jpoint(s,f.redMul(o),h)},f.prototype.dbl=function t(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},f.prototype._zeroDbl=function t(){var e,r,i;if(this.zOne){var n=this.x.redSqr(),o=this.y.redSqr(),s=o.redSqr(),a=this.x.redAdd(o).redSqr().redISub(n).redISub(s);a=a.redIAdd(a);var h=n.redAdd(n).redIAdd(n),u=h.redSqr().redISub(a).redISub(a),f=s.redIAdd(s);f=(f=f.redIAdd(f)).redIAdd(f),e=u,r=h.redMul(a.redISub(u)).redISub(f),i=this.y.redAdd(this.y)}else{var c=this.x.redSqr(),l=this.y.redSqr(),d=l.redSqr(),p=this.x.redAdd(l).redSqr().redISub(c).redISub(d);p=p.redIAdd(p);var m=c.redAdd(c).redIAdd(c),g=m.redSqr(),v=d.redIAdd(d);v=(v=v.redIAdd(v)).redIAdd(v),e=g.redISub(p).redISub(p),r=m.redMul(p.redISub(e)).redISub(v),i=(i=this.y.redMul(this.z)).redIAdd(i)}return this.curve.jpoint(e,r,i)},f.prototype._threeDbl=function t(){var e,r,i;if(this.zOne){var n=this.x.redSqr(),o=this.y.redSqr(),s=o.redSqr(),a=this.x.redAdd(o).redSqr().redISub(n).redISub(s);a=a.redIAdd(a);var h=n.redAdd(n).redIAdd(n).redIAdd(this.curve.a),u=h.redSqr().redISub(a).redISub(a);e=u;var f=s.redIAdd(s);f=(f=f.redIAdd(f)).redIAdd(f),r=h.redMul(a.redISub(u)).redISub(f),i=this.y.redAdd(this.y)}else{var c=this.z.redSqr(),l=this.y.redSqr(),d=this.x.redMul(l),p=this.x.redSub(c).redMul(this.x.redAdd(c));p=p.redAdd(p).redIAdd(p);var m=d.redIAdd(d),g=(m=m.redIAdd(m)).redAdd(m);e=p.redSqr().redISub(g),i=this.y.redAdd(this.z).redSqr().redISub(l).redISub(c);var v=l.redSqr();v=(v=(v=v.redIAdd(v)).redIAdd(v)).redIAdd(v),r=p.redMul(m.redISub(e)).redISub(v)}return this.curve.jpoint(e,r,i)},f.prototype._dbl=function t(){var e=this.curve.a,r=this.x,i=this.y,n=this.z,o=n.redSqr().redSqr(),s=r.redSqr(),a=i.redSqr(),h=s.redAdd(s).redIAdd(s).redIAdd(e.redMul(o)),u=r.redAdd(r),f=(u=u.redIAdd(u)).redMul(a),c=h.redSqr().redISub(f.redAdd(f)),l=f.redISub(c),d=a.redSqr();d=(d=(d=d.redIAdd(d)).redIAdd(d)).redIAdd(d);var p=h.redMul(l).redISub(d),m=i.redAdd(i).redMul(n);return this.curve.jpoint(c,p,m)},f.prototype.trpl=function t(){if(!this.curve.zeroA)return this.dbl().add(this);var e=this.x.redSqr(),r=this.y.redSqr(),i=this.z.redSqr(),n=r.redSqr(),o=e.redAdd(e).redIAdd(e),s=o.redSqr(),a=this.x.redAdd(r).redSqr().redISub(e).redISub(n),h=(a=(a=(a=a.redIAdd(a)).redAdd(a).redIAdd(a)).redISub(s)).redSqr(),u=n.redIAdd(n);u=(u=(u=u.redIAdd(u)).redIAdd(u)).redIAdd(u);var f=o.redIAdd(a).redSqr().redISub(s).redISub(h).redISub(u),c=r.redMul(f);c=(c=c.redIAdd(c)).redIAdd(c);var l=this.x.redMul(h).redISub(c);l=(l=l.redIAdd(l)).redIAdd(l);var d=this.y.redMul(f.redMul(u.redISub(f)).redISub(a.redMul(h)));d=(d=(d=d.redIAdd(d)).redIAdd(d)).redIAdd(d);var p=this.z.redAdd(a).redSqr().redISub(i).redISub(h);return this.curve.jpoint(l,d,p)},f.prototype.mul=function t(e,r){return e=new n(e,r),this.curve._wnafMul(this,e)},f.prototype.eq=function t(e){if("affine"===e.type)return this.eq(e.toJ());if(this===e)return!0;var r=this.z.redSqr(),i=e.z.redSqr();if(0!==this.x.redMul(i).redISub(e.x.redMul(r)).cmpn(0))return!1;var n=r.redMul(this.z),o=i.redMul(e.z);return 0===this.y.redMul(o).redISub(e.y.redMul(n)).cmpn(0)},f.prototype.eqXToP=function t(e){var r=this.z.redSqr(),i=e.toRed(this.curve.red).redMul(r);if(0===this.x.cmp(i))return!0;for(var n=e.clone(),o=this.curve.redN.redMul(r);;){if(n.iadd(this.curve.n),n.cmp(this.curve.p)>=0)return!1;if(i.redIAdd(o),0===this.x.cmp(i))return!0}},f.prototype.inspect=function t(){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 t(){return 0===this.z.cmpn(0)}},function(t,e,r){"use strict";var i=r(16),n=r(104),o=r(64),s=r(11);function a(t){o.call(this,"mont",t),this.a=new i(t.a,16).toRed(this.red),this.b=new i(t.b,16).toRed(this.red),this.i4=new i(4).toRed(this.red).redInvm(),this.two=new i(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function h(t,e,r){o.BasePoint.call(this,t,"projective"),null===e&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new i(e,16),this.z=new i(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}n(a,o),t.exports=a,a.prototype.validate=function t(e){var r=e.normalize().x,i=r.redSqr(),n=i.redMul(r).redAdd(i.redMul(this.a)).redAdd(r);return 0===n.redSqrt().redSqr().cmp(n)},n(h,o.BasePoint),a.prototype.decodePoint=function t(e,r){return this.point(s.toArray(e,r),1)},a.prototype.point=function t(e,r){return new h(this,e,r)},a.prototype.pointFromJSON=function t(e){return h.fromJSON(this,e)},h.prototype.precompute=function t(){},h.prototype._encode=function t(){return this.getX().toArray("be",this.curve.p.byteLength())},h.fromJSON=function t(e,r){return new h(e,r[0],r[1]||e.one)},h.prototype.inspect=function t(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},h.prototype.isInfinity=function t(){return 0===this.z.cmpn(0)},h.prototype.dbl=function t(){var e=this.x.redAdd(this.z).redSqr(),r=this.x.redSub(this.z).redSqr(),i=e.redSub(r),n=e.redMul(r),o=i.redMul(r.redAdd(this.curve.a24.redMul(i)));return this.curve.point(n,o)},h.prototype.add=function t(){throw new Error("Not supported on Montgomery curve")},h.prototype.diffAdd=function t(e,r){var i=this.x.redAdd(this.z),n=this.x.redSub(this.z),o=e.x.redAdd(e.z),s=e.x.redSub(e.z).redMul(i),a=o.redMul(n),h=r.z.redMul(s.redAdd(a).redSqr()),u=r.x.redMul(s.redISub(a).redSqr());return this.curve.point(h,u)},h.prototype.mul=function t(e){for(var r=e.clone(),i=this,n=this.curve.point(null,null),o=[];0!==r.cmpn(0);r.iushrn(1))o.push(r.andln(1));for(var s=o.length-1;s>=0;s--)0===o[s]?(i=i.diffAdd(n,this),n=n.dbl()):(n=i.diffAdd(n,this),i=i.dbl());return n},h.prototype.mulAdd=function t(){throw new Error("Not supported on Montgomery curve")},h.prototype.jumlAdd=function t(){throw new Error("Not supported on Montgomery curve")},h.prototype.eq=function t(e){return 0===this.getX().cmp(e.getX())},h.prototype.normalize=function t(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},h.prototype.getX=function t(){return this.normalize(),this.x.fromRed()}},function(t,e,r){"use strict";var i=r(11),n=r(16),o=r(104),s=r(64),a=i.assert;function h(t){this.twisted=1!=(0|t.a),this.mOneA=this.twisted&&-1==(0|t.a),this.extended=this.mOneA,s.call(this,"edwards",t),this.a=new n(t.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new n(t.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new n(t.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),a(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1==(0|t.c)}function u(t,e,r,i,o){s.BasePoint.call(this,t,"projective"),null===e&&null===r&&null===i?(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 n(e,16),this.y=new n(r,16),this.z=i?new n(i,16):this.curve.one,this.t=o&&new n(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(h,s),t.exports=h,h.prototype._mulA=function t(e){return this.mOneA?e.redNeg():this.a.redMul(e)},h.prototype._mulC=function t(e){return this.oneC?e:this.c.redMul(e)},h.prototype.jpoint=function t(e,r,i,n){return this.point(e,r,i,n)},h.prototype.pointFromX=function t(e,r){(e=new n(e,16)).red||(e=e.toRed(this.red));var i=e.redSqr(),o=this.c2.redSub(this.a.redMul(i)),s=this.one.redSub(this.c2.redMul(this.d).redMul(i)),a=o.redMul(s.redInvm()),h=a.redSqrt();if(0!==h.redSqr().redSub(a).cmp(this.zero))throw new Error("invalid point");var u=h.fromRed().isOdd();return(r&&!u||!r&&u)&&(h=h.redNeg()),this.point(e,h)},h.prototype.pointFromY=function t(e,r){(e=new n(e,16)).red||(e=e.toRed(this.red));var i=e.redSqr(),o=i.redSub(this.c2),s=i.redMul(this.d).redMul(this.c2).redSub(this.a),a=o.redMul(s.redInvm());if(0===a.cmp(this.zero)){if(r)throw new Error("invalid point");return this.point(this.zero,e)}var h=a.redSqrt();if(0!==h.redSqr().redSub(a).cmp(this.zero))throw new Error("invalid point");return h.fromRed().isOdd()!==r&&(h=h.redNeg()),this.point(h,e)},h.prototype.validate=function t(e){if(e.isInfinity())return!0;e.normalize();var r=e.x.redSqr(),i=e.y.redSqr(),n=r.redMul(this.a).redAdd(i),o=this.c2.redMul(this.one.redAdd(this.d.redMul(r).redMul(i)));return 0===n.cmp(o)},o(u,s.BasePoint),h.prototype.pointFromJSON=function t(e){return u.fromJSON(this,e)},h.prototype.point=function t(e,r,i,n){return new u(this,e,r,i,n)},u.fromJSON=function t(e,r){return new u(e,r[0],r[1],r[2])},u.prototype.inspect=function t(){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)+">"},u.prototype.isInfinity=function t(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},u.prototype._extDbl=function t(){var e=this.x.redSqr(),r=this.y.redSqr(),i=this.z.redSqr();i=i.redIAdd(i);var n=this.curve._mulA(e),o=this.x.redAdd(this.y).redSqr().redISub(e).redISub(r),s=n.redAdd(r),a=s.redSub(i),h=n.redSub(r),u=o.redMul(a),f=s.redMul(h),c=o.redMul(h),l=a.redMul(s);return this.curve.point(u,f,l,c)},u.prototype._projDbl=function t(){var e,r,i,n,o,s,a=this.x.redAdd(this.y).redSqr(),h=this.x.redSqr(),u=this.y.redSqr();if(this.curve.twisted){var f=(n=this.curve._mulA(h)).redAdd(u);this.zOne?(e=a.redSub(h).redSub(u).redMul(f.redSub(this.curve.two)),r=f.redMul(n.redSub(u)),i=f.redSqr().redSub(f).redSub(f)):(o=this.z.redSqr(),s=f.redSub(o).redISub(o),e=a.redSub(h).redISub(u).redMul(s),r=f.redMul(n.redSub(u)),i=f.redMul(s))}else n=h.redAdd(u),o=this.curve._mulC(this.z).redSqr(),s=n.redSub(o).redSub(o),e=this.curve._mulC(a.redISub(n)).redMul(s),r=this.curve._mulC(n).redMul(h.redISub(u)),i=n.redMul(s);return this.curve.point(e,r,i)},u.prototype.dbl=function t(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},u.prototype._extAdd=function t(e){var r=this.y.redSub(this.x).redMul(e.y.redSub(e.x)),i=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),n=this.t.redMul(this.curve.dd).redMul(e.t),o=this.z.redMul(e.z.redAdd(e.z)),s=i.redSub(r),a=o.redSub(n),h=o.redAdd(n),u=i.redAdd(r),f=s.redMul(a),c=h.redMul(u),l=s.redMul(u),d=a.redMul(h);return this.curve.point(f,c,d,l)},u.prototype._projAdd=function t(e){var r,i,n=this.z.redMul(e.z),o=n.redSqr(),s=this.x.redMul(e.x),a=this.y.redMul(e.y),h=this.curve.d.redMul(s).redMul(a),u=o.redSub(h),f=o.redAdd(h),c=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(s).redISub(a),l=n.redMul(u).redMul(c);return this.curve.twisted?(r=n.redMul(f).redMul(a.redSub(this.curve._mulA(s))),i=u.redMul(f)):(r=n.redMul(f).redMul(a.redSub(s)),i=this.curve._mulC(u).redMul(f)),this.curve.point(l,r,i)},u.prototype.add=function t(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},u.prototype.mul=function t(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},u.prototype.mulAdd=function t(e,r,i){return this.curve._wnafMulAdd(1,[this,r],[e,i],2,!1)},u.prototype.jmulAdd=function t(e,r,i){return this.curve._wnafMulAdd(1,[this,r],[e,i],2,!0)},u.prototype.normalize=function t(){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},u.prototype.neg=function t(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},u.prototype.getX=function t(){return this.normalize(),this.x.fromRed()},u.prototype.getY=function t(){return this.normalize(),this.y.fromRed()},u.prototype.eq=function t(e){return this===e||0===this.getX().cmp(e.getX())&&0===this.getY().cmp(e.getY())},u.prototype.eqXToP=function t(e){var r=e.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(r))return!0;for(var i=e.clone(),n=this.curve.redN.redMul(this.z);;){if(i.iadd(this.curve.n),i.cmp(this.curve.p)>=0)return!1;if(r.redIAdd(n),0===this.x.cmp(r))return!0}},u.prototype.toP=u.prototype.normalize,u.prototype.mixedAdd=u.prototype.add},function(t,e,r){"use strict";e.sha1=r(346),e.sha224=r(347),e.sha256=r(185),e.sha384=r(348),e.sha512=r(186)},function(t,e,r){"use strict";var i=r(13),n=r(46),o=r(184),s=i.rotl32,a=i.sum32,h=i.sum32_5,u=o.ft_1,f=n.BlockHash,c=[1518500249,1859775393,2400959708,3395469782];function l(){if(!(this instanceof l))return new l;f.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}i.inherits(l,f),t.exports=l,l.blockSize=512,l.outSize=160,l.hmacStrength=80,l.padLength=64,l.prototype._update=function t(e,r){for(var i=this.W,n=0;n<16;n++)i[n]=e[r+n];for(;n<i.length;n++)i[n]=s(i[n-3]^i[n-8]^i[n-14]^i[n-16],1);var o=this.h[0],f=this.h[1],l=this.h[2],d=this.h[3],p=this.h[4];for(n=0;n<i.length;n++){var m=~~(n/20),g=h(s(o,5),u(m,f,l,d),p,i[n],c[m]);p=d,d=l,l=s(f,30),f=o,o=g}this.h[0]=a(this.h[0],o),this.h[1]=a(this.h[1],f),this.h[2]=a(this.h[2],l),this.h[3]=a(this.h[3],d),this.h[4]=a(this.h[4],p)},l.prototype._digest=function t(e){return"hex"===e?i.toHex32(this.h,"big"):i.split32(this.h,"big")}},function(t,e,r){"use strict";var i=r(13),n=r(185);function o(){if(!(this instanceof o))return new o;n.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}i.inherits(o,n),t.exports=o,o.blockSize=512,o.outSize=224,o.hmacStrength=192,o.padLength=64,o.prototype._digest=function t(e){return"hex"===e?i.toHex32(this.h.slice(0,7),"big"):i.split32(this.h.slice(0,7),"big")}},function(t,e,r){"use strict";var i=r(13),n=r(186);function o(){if(!(this instanceof o))return new o;n.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}i.inherits(o,n),t.exports=o,o.blockSize=1024,o.outSize=384,o.hmacStrength=192,o.padLength=128,o.prototype._digest=function t(e){return"hex"===e?i.toHex32(this.h.slice(0,12),"big"):i.split32(this.h.slice(0,12),"big")}},function(t,e,r){"use strict";var i=r(13),n=r(46),o=i.rotl32,s=i.sum32,a=i.sum32_3,h=i.sum32_4,u=n.BlockHash;function f(){if(!(this instanceof f))return new f;u.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}function c(t,e,r,i){return t<=15?e^r^i:t<=31?e&r|~e&i:t<=47?(e|~r)^i:t<=63?e&i|r&~i:e^(r|~i)}function l(t){return t<=15?0:t<=31?1518500249:t<=47?1859775393:t<=63?2400959708:2840853838}function d(t){return t<=15?1352829926:t<=31?1548603684:t<=47?1836072691:t<=63?2053994217:0}i.inherits(f,u),e.ripemd160=f,f.blockSize=512,f.outSize=160,f.hmacStrength=192,f.padLength=64,f.prototype._update=function t(e,r){for(var i=this.h[0],n=this.h[1],u=this.h[2],f=this.h[3],b=this.h[4],y=i,w=n,_=u,M=f,S=b,k=0;k<80;k++){var E=s(o(h(i,c(k,n,u,f),e[p[k]+r],l(k)),g[k]),b);i=b,b=f,f=o(u,10),u=n,n=E,E=s(o(h(y,c(79-k,w,_,M),e[m[k]+r],d(k)),v[k]),S),y=S,S=M,M=o(_,10),_=w,w=E}E=a(this.h[1],u,M),this.h[1]=a(this.h[2],f,S),this.h[2]=a(this.h[3],b,y),this.h[3]=a(this.h[4],i,w),this.h[4]=a(this.h[0],n,_),this.h[0]=E},f.prototype._digest=function t(e){return"hex"===e?i.toHex32(this.h,"little"):i.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],m=[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],g=[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],v=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]},function(t,e,r){"use strict";var i=r(13),n=r(10);function o(t,e,r){if(!(this instanceof o))return new o(t,e,r);this.Hash=t,this.blockSize=t.blockSize/8,this.outSize=t.outSize/8,this.inner=null,this.outer=null,this._init(i.toArray(e,r))}t.exports=o,o.prototype._init=function t(e){e.length>this.blockSize&&(e=(new this.Hash).update(e).digest()),n(e.length<=this.blockSize);for(var r=e.length;r<this.blockSize;r++)e.push(0);for(r=0;r<e.length;r++)e[r]^=54;for(this.inner=(new this.Hash).update(e),r=0;r<e.length;r++)e[r]^=106;this.outer=(new this.Hash).update(e)},o.prototype.update=function t(e,r){return this.inner.update(e,r),this},o.prototype.digest=function t(e){return this.outer.update(this.inner.digest()),this.outer.digest(e)}},function(t,e){t.exports={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}}},function(t,e,r){"use strict";var i=r(16),n=r(353),o=r(11),s=r(105),a=r(98),h=o.assert,u=r(354),f=r(355);function c(t){if(!(this instanceof c))return new c(t);"string"==typeof t&&(h(Object.prototype.hasOwnProperty.call(s,t),"Unknown curve "+t),t=s[t]),t instanceof s.PresetCurve&&(t={curve:t}),this.curve=t.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=t.curve.g,this.g.precompute(t.curve.n.bitLength()+1),this.hash=t.hash||t.curve.hash}t.exports=c,c.prototype.keyPair=function t(e){return new u(this,e)},c.prototype.keyFromPrivate=function t(e,r){return u.fromPrivate(this,e,r)},c.prototype.keyFromPublic=function t(e,r){return u.fromPublic(this,e,r)},c.prototype.genKeyPair=function t(e){e||(e={});for(var r=new n({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||a(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),o=this.n.byteLength(),s=this.n.sub(new i(2));;){var h=new i(r.generate(o));if(!(h.cmp(s)>0))return h.iaddn(1),this.keyFromPrivate(h)}},c.prototype._truncateToN=function t(e,r){var i=8*e.byteLength()-this.n.bitLength();return i>0&&(e=e.ushrn(i)),!r&&e.cmp(this.n)>=0?e.sub(this.n):e},c.prototype.sign=function t(e,r,o,s){"object"==typeof o&&(s=o,o=null),s||(s={}),r=this.keyFromPrivate(r,o),e=this._truncateToN(new i(e,16));for(var a=this.n.byteLength(),h=r.getPrivate().toArray("be",a),u=e.toArray("be",a),c=new n({hash:this.hash,entropy:h,nonce:u,pers:s.pers,persEnc:s.persEnc||"utf8"}),l=this.n.sub(new i(1)),d=0;;d++){var p=s.k?s.k(d):new i(c.generate(this.n.byteLength()));if(!((p=this._truncateToN(p,!0)).cmpn(1)<=0||p.cmp(l)>=0)){var m=this.g.mul(p);if(!m.isInfinity()){var g=m.getX(),v=g.umod(this.n);if(0!==v.cmpn(0)){var b=p.invm(this.n).mul(v.mul(r.getPrivate()).iadd(e));if(0!==(b=b.umod(this.n)).cmpn(0)){var y=(m.getY().isOdd()?1:0)|(0!==g.cmp(v)?2:0);return s.canonical&&b.cmp(this.nh)>0&&(b=this.n.sub(b),y^=1),new f({r:v,s:b,recoveryParam:y})}}}}}},c.prototype.verify=function t(e,r,n,o){e=this._truncateToN(new i(e,16)),n=this.keyFromPublic(n,o);var s=(r=new f(r,"hex")).r,a=r.s;if(s.cmpn(1)<0||s.cmp(this.n)>=0)return!1;if(a.cmpn(1)<0||a.cmp(this.n)>=0)return!1;var h,u=a.invm(this.n),c=u.mul(e).umod(this.n),l=u.mul(s).umod(this.n);return this.curve._maxwellTrick?!(h=this.g.jmulAdd(c,n.getPublic(),l)).isInfinity()&&h.eqXToP(s):!(h=this.g.mulAdd(c,n.getPublic(),l)).isInfinity()&&0===h.getX().umod(this.n).cmp(s)},c.prototype.recoverPubKey=function(t,e,r,n){h((3&r)===r,"The recovery param is more than two bits"),e=new f(e,n);var o=this.n,s=new i(t),a=e.r,u=e.s,c=1&r,l=r>>1;if(a.cmp(this.curve.p.umod(this.curve.n))>=0&&l)throw new Error("Unable to find sencond key candinate");a=l?this.curve.pointFromX(a.add(this.curve.n),c):this.curve.pointFromX(a,c);var d=e.r.invm(o),p=o.sub(s).mul(d).umod(o),m=u.mul(d).umod(o);return this.g.mulAdd(p,a,m)},c.prototype.getKeyRecoveryParam=function(t,e,r,i){if(null!==(e=new f(e,i)).recoveryParam)return e.recoveryParam;for(var n=0;n<4;n++){var o;try{o=this.recoverPubKey(t,e,n)}catch(t){continue}if(o.eq(r))return n}throw new Error("Unable to find valid recovery factor")}},function(t,e,r){"use strict";var i=r(106),n=r(182),o=r(10);function s(t){if(!(this instanceof s))return new s(t);this.hash=t.hash,this.predResist=!!t.predResist,this.outLen=this.hash.outSize,this.minEntropy=t.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var e=n.toArray(t.entropy,t.entropyEnc||"hex"),r=n.toArray(t.nonce,t.nonceEnc||"hex"),i=n.toArray(t.pers,t.persEnc||"hex");o(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,r,i)}t.exports=s,s.prototype._init=function t(e,r,i){var n=e.concat(r).concat(i);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var o=0;o<this.V.length;o++)this.K[o]=0,this.V[o]=1;this._update(n),this._reseed=1,this.reseedInterval=281474976710656},s.prototype._hmac=function t(){return new i.hmac(this.hash,this.K)},s.prototype._update=function t(e){var r=this._hmac().update(this.V).update([0]);e&&(r=r.update(e)),this.K=r.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())},s.prototype.reseed=function t(e,r,i,s){"string"!=typeof r&&(s=i,i=r,r=null),e=n.toArray(e,r),i=n.toArray(i,s),o(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(i||[])),this._reseed=1},s.prototype.generate=function t(e,r,i,o){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof r&&(o=i,i=r,r=null),i&&(i=n.toArray(i,o||"hex"),this._update(i));for(var s=[];s.length<e;)this.V=this._hmac().update(this.V).digest(),s=s.concat(this.V);var a=s.slice(0,e);return this._update(i),this._reseed++,n.encode(a,r)}},function(t,e,r){"use strict";var i=r(16),n=r(11).assert;function o(t,e){this.ec=t,this.priv=null,this.pub=null,e.priv&&this._importPrivate(e.priv,e.privEnc),e.pub&&this._importPublic(e.pub,e.pubEnc)}t.exports=o,o.fromPublic=function t(e,r,i){return r instanceof o?r:new o(e,{pub:r,pubEnc:i})},o.fromPrivate=function t(e,r,i){return r instanceof o?r:new o(e,{priv:r,privEnc:i})},o.prototype.validate=function t(){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 t(e,r){return"string"==typeof e&&(r=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),r?this.pub.encode(r,e):this.pub},o.prototype.getPrivate=function t(e){return"hex"===e?this.priv.toString(16,2):this.priv},o.prototype._importPrivate=function t(e,r){this.priv=new i(e,r||16),this.priv=this.priv.umod(this.ec.curve.n)},o.prototype._importPublic=function t(e,r){if(e.x||e.y)return"mont"===this.ec.curve.type?n(e.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||n(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,r)},o.prototype.derive=function t(e){return e.validate()||n(e.validate(),"public point not validated"),e.mul(this.priv).getX()},o.prototype.sign=function t(e,r,i){return this.ec.sign(e,this,r,i)},o.prototype.verify=function t(e,r){return this.ec.verify(e,r,this)},o.prototype.inspect=function t(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"}},function(t,e,r){"use strict";var i=r(16),n=r(11),o=n.assert;function s(t,e){if(t instanceof s)return t;this._importDER(t,e)||(o(t.r&&t.s,"Signature without r or s"),this.r=new i(t.r,16),this.s=new i(t.s,16),void 0===t.recoveryParam?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}function a(){this.place=0}function h(t,e){var r=t[e.place++];if(!(128&r))return r;var i=15&r;if(0===i||i>4)return!1;for(var n=0,o=0,s=e.place;o<i;o++,s++)n<<=8,n|=t[s],n>>>=0;return!(n<=127)&&(e.place=s,n)}function u(t){for(var e=0,r=t.length-1;!t[e]&&!(128&t[e+1])&&e<r;)e++;return 0===e?t:t.slice(e)}function f(t,e){if(e<128)t.push(e);else{var r=1+(Math.log(e)/Math.LN2>>>3);for(t.push(128|r);--r;)t.push(e>>>(r<<3)&255);t.push(e)}}t.exports=s,s.prototype._importDER=function t(e,r){e=n.toArray(e,r);var o=new a;if(48!==e[o.place++])return!1;var s=h(e,o);if(!1===s)return!1;if(s+o.place!==e.length)return!1;if(2!==e[o.place++])return!1;var u=h(e,o);if(!1===u)return!1;var f=e.slice(o.place,u+o.place);if(o.place+=u,2!==e[o.place++])return!1;var c=h(e,o);if(!1===c)return!1;if(e.length!==c+o.place)return!1;var l=e.slice(o.place,c+o.place);if(0===f[0]){if(!(128&f[1]))return!1;f=f.slice(1)}if(0===l[0]){if(!(128&l[1]))return!1;l=l.slice(1)}return this.r=new i(f),this.s=new i(l),this.recoveryParam=null,!0},s.prototype.toDER=function t(e){var r=this.r.toArray(),i=this.s.toArray();for(128&r[0]&&(r=[0].concat(r)),128&i[0]&&(i=[0].concat(i)),r=u(r),i=u(i);!(i[0]||128&i[1]);)i=i.slice(1);var o=[2];f(o,r.length),(o=o.concat(r)).push(2),f(o,i.length);var s=o.concat(i),a=[48];return f(a,s.length),a=a.concat(s),n.encode(a,e)}},function(t,e,r){"use strict";var i=r(106),n=r(105),o=r(11),s=o.assert,a=o.parseBytes,h=r(357),u=r(358);function f(t){if(s("ed25519"===t,"only tested with ed25519 so far"),!(this instanceof f))return new f(t);t=n[t].curve,this.curve=t,this.g=t.g,this.g.precompute(t.n.bitLength()+1),this.pointClass=t.point().constructor,this.encodingLength=Math.ceil(t.n.bitLength()/8),this.hash=i.sha512}t.exports=f,f.prototype.sign=function t(e,r){e=a(e);var i=this.keyFromSecret(r),n=this.hashInt(i.messagePrefix(),e),o=this.g.mul(n),s=this.encodePoint(o),h=this.hashInt(s,i.pubBytes(),e).mul(i.priv()),u=n.add(h).umod(this.curve.n);return this.makeSignature({R:o,S:u,Rencoded:s})},f.prototype.verify=function t(e,r,i){e=a(e),r=this.makeSignature(r);var n=this.keyFromPublic(i),o=this.hashInt(r.Rencoded(),n.pubBytes(),e),s=this.g.mul(r.S());return r.R().add(n.pub().mul(o)).eq(s)},f.prototype.hashInt=function t(){for(var e=this.hash(),r=0;r<arguments.length;r++)e.update(arguments[r]);return o.intFromLE(e.digest()).umod(this.curve.n)},f.prototype.keyFromPublic=function t(e){return h.fromPublic(this,e)},f.prototype.keyFromSecret=function t(e){return h.fromSecret(this,e)},f.prototype.makeSignature=function t(e){return e instanceof u?e:new u(this,e)},f.prototype.encodePoint=function t(e){var r=e.getY().toArray("le",this.encodingLength);return r[this.encodingLength-1]|=e.getX().isOdd()?128:0,r},f.prototype.decodePoint=function t(e){var r=(e=o.parseBytes(e)).length-1,i=e.slice(0,r).concat(-129&e[r]),n=0!=(128&e[r]),s=o.intFromLE(i);return this.curve.pointFromY(s,n)},f.prototype.encodeInt=function t(e){return e.toArray("le",this.encodingLength)},f.prototype.decodeInt=function t(e){return o.intFromLE(e)},f.prototype.isPoint=function t(e){return e instanceof this.pointClass}},function(t,e,r){"use strict";var i=r(11),n=i.assert,o=i.parseBytes,s=i.cachedProperty;function a(t,e){this.eddsa=t,this._secret=o(e.secret),t.isPoint(e.pub)?this._pub=e.pub:this._pubBytes=o(e.pub)}a.fromPublic=function t(e,r){return r instanceof a?r:new a(e,{pub:r})},a.fromSecret=function t(e,r){return r instanceof a?r:new a(e,{secret:r})},a.prototype.secret=function t(){return this._secret},s(a,"pubBytes",(function t(){return this.eddsa.encodePoint(this.pub())})),s(a,"pub",(function t(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())})),s(a,"privBytes",(function t(){var e=this.eddsa,r=this.hash(),i=e.encodingLength-1,n=r.slice(0,e.encodingLength);return n[0]&=248,n[i]&=127,n[i]|=64,n})),s(a,"priv",(function t(){return this.eddsa.decodeInt(this.privBytes())})),s(a,"hash",(function t(){return this.eddsa.hash().update(this.secret()).digest()})),s(a,"messagePrefix",(function t(){return this.hash().slice(this.eddsa.encodingLength)})),a.prototype.sign=function t(e){return n(this._secret,"KeyPair can only verify"),this.eddsa.sign(e,this)},a.prototype.verify=function t(e,r){return this.eddsa.verify(e,r,this)},a.prototype.getSecret=function t(e){return n(this._secret,"KeyPair is public only"),i.encode(this.secret(),e)},a.prototype.getPublic=function t(e){return i.encode(this.pubBytes(),e)},t.exports=a},function(t,e,r){"use strict";var i=r(16),n=r(11),o=n.assert,s=n.cachedProperty,a=n.parseBytes;function h(t,e){this.eddsa=t,"object"!=typeof e&&(e=a(e)),Array.isArray(e)&&(e={R:e.slice(0,t.encodingLength),S:e.slice(t.encodingLength)}),o(e.R&&e.S,"Signature without R or S"),t.isPoint(e.R)&&(this._R=e.R),e.S instanceof i&&(this._S=e.S),this._Rencoded=Array.isArray(e.R)?e.R:e.Rencoded,this._Sencoded=Array.isArray(e.S)?e.S:e.Sencoded}s(h,"S",(function t(){return this.eddsa.decodeInt(this.Sencoded())})),s(h,"R",(function t(){return this.eddsa.decodePoint(this.Rencoded())})),s(h,"Rencoded",(function t(){return this.eddsa.encodePoint(this.R())})),s(h,"Sencoded",(function t(){return this.eddsa.encodeInt(this.S())})),h.prototype.toBytes=function t(){return this.Rencoded().concat(this.Sencoded())},h.prototype.toHex=function t(){return n.encode(this.toBytes(),"hex").toUpperCase()},t.exports=h},function(t,e,r){"use strict";var i=r(187);e.certificate=r(366);var n=i.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())}));e.RSAPrivateKey=n;var o=i.define("RSAPublicKey",(function(){this.seq().obj(this.key("modulus").int(),this.key("publicExponent").int())}));e.RSAPublicKey=o;var s=i.define("SubjectPublicKeyInfo",(function(){this.seq().obj(this.key("algorithm").use(a),this.key("subjectPublicKey").bitstr())}));e.PublicKey=s;var a=i.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())})),h=i.define("PrivateKeyInfo",(function(){this.seq().obj(this.key("version").int(),this.key("algorithm").use(a),this.key("subjectPrivateKey").octstr())}));e.PrivateKey=h;var u=i.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())}));e.EncryptedPrivateKey=u;var f=i.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())}));e.DSAPrivateKey=f,e.DSAparam=i.define("DSAparam",(function(){this.int()}));var c=i.define("ECPrivateKey",(function(){this.seq().obj(this.key("version").int(),this.key("privateKey").octstr(),this.key("parameters").optional().explicit(0).use(l),this.key("publicKey").optional().explicit(1).bitstr())}));e.ECPrivateKey=c;var l=i.define("ECParameters",(function(){this.choice({namedCurve:this.objid()})}));e.signature=i.define("signature",(function(){this.seq().obj(this.key("r").int(),this.key("s").int())}))},function(t,e){},function(t,e,r){"use strict";const i=r(189),n=r(191),o=r(1);function s(t,e){this.name=t,this.body=e,this.decoders={},this.encoders={}}e.define=function t(e,r){return new s(e,r)},s.prototype._createNamed=function t(e){const r=this.name;function i(t){this._initNamed(t,r)}return o(i,e),i.prototype._initNamed=function t(r,i){e.call(this,r,i)},new i(this)},s.prototype._getDecoder=function t(e){return e=e||"der",this.decoders.hasOwnProperty(e)||(this.decoders[e]=this._createNamed(n[e])),this.decoders[e]},s.prototype.decode=function t(e,r,i){return this._getDecoder(r).decode(e,i)},s.prototype._getEncoder=function t(e){return e=e||"der",this.encoders.hasOwnProperty(e)||(this.encoders[e]=this._createNamed(i[e])),this.encoders[e]},s.prototype.encode=function t(e,r,i){return this._getEncoder(r).encode(e,i)}},function(t,e,r){"use strict";const i=r(1),n=r(190);function o(t){n.call(this,t),this.enc="pem"}i(o,n),t.exports=o,o.prototype.encode=function t(e,r){const i=n.prototype.encode.call(this,e).toString("base64"),o=["-----BEGIN "+r.label+"-----"];for(let t=0;t<i.length;t+=64)o.push(i.slice(t,t+64));return o.push("-----END "+r.label+"-----"),o.join("\n")}},function(t,e,r){"use strict";const i=r(1),n=r(107).Buffer,o=r(192);function s(t){o.call(this,t),this.enc="pem"}i(s,o),t.exports=s,s.prototype.decode=function t(e,r){const i=e.toString().split(/[\r\n]+/g),s=r.label.toUpperCase(),a=/^-----(BEGIN|END) ([^-]+)-----$/;let h=-1,u=-1;for(let t=0;t<i.length;t++){const e=i[t].match(a);if(null!==e&&e[2]===s){if(-1!==h){if("END"!==e[1])break;u=t;break}if("BEGIN"!==e[1])break;h=t}}if(-1===h||-1===u)throw new Error("PEM section not found for: "+s);const f=i.slice(h+1,u).join("");f.replace(/[^a-z0-9+/=]+/gi,"");const c=n.from(f,"base64");return o.prototype.decode.call(this,c,r)}},function(t,e,r){"use strict";const i=e;i.Reporter=r(109).Reporter,i.DecoderBuffer=r(47).DecoderBuffer,i.EncoderBuffer=r(47).EncoderBuffer,i.Node=r(108)},function(t,e,r){"use strict";const i=e;i._reverse=function t(e){const r={};return Object.keys(e).forEach((function(t){(0|t)==t&&(t|=0);const i=e[t];r[i]=t})),r},i.der=r(110)},function(t,e,r){"use strict";var i=r(187),n=i.define("Time",(function(){this.choice({utcTime:this.utctime(),generalTime:this.gentime()})})),o=i.define("AttributeTypeValue",(function(){this.seq().obj(this.key("type").objid(),this.key("value").any())})),s=i.define("AlgorithmIdentifier",(function(){this.seq().obj(this.key("algorithm").objid(),this.key("parameters").optional(),this.key("curve").objid().optional())})),a=i.define("SubjectPublicKeyInfo",(function(){this.seq().obj(this.key("algorithm").use(s),this.key("subjectPublicKey").bitstr())})),h=i.define("RelativeDistinguishedName",(function(){this.setof(o)})),u=i.define("RDNSequence",(function(){this.seqof(h)})),f=i.define("Name",(function(){this.choice({rdnSequence:this.use(u)})})),c=i.define("Validity",(function(){this.seq().obj(this.key("notBefore").use(n),this.key("notAfter").use(n))})),l=i.define("Extension",(function(){this.seq().obj(this.key("extnID").objid(),this.key("critical").bool().def(!1),this.key("extnValue").octstr())})),d=i.define("TBSCertificate",(function(){this.seq().obj(this.key("version").explicit(0).int().optional(),this.key("serialNumber").int(),this.key("signature").use(s),this.key("issuer").use(f),this.key("validity").use(c),this.key("subject").use(f),this.key("subjectPublicKeyInfo").use(a),this.key("issuerUniqueID").implicit(1).bitstr().optional(),this.key("subjectUniqueID").implicit(2).bitstr().optional(),this.key("extensions").explicit(3).seqof(l).optional())})),p=i.define("X509Certificate",(function(){this.seq().obj(this.key("tbsCertificate").use(d),this.key("signatureAlgorithm").use(s),this.key("signatureValue").bitstr())}));t.exports=p},function(t){t.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(t,e,r){var i=/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,n=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----/m,o=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----([0-9A-z\n\r+/=]+)-----END \1-----$/m,s=r(63),a=r(96),h=r(2).Buffer;t.exports=function(t,e){var r,u=t.toString(),f=u.match(i);if(f){var c="aes"+f[1],l=h.from(f[2],"hex"),d=h.from(f[3].replace(/[\r\n]/g,""),"base64"),p=s(e,l.slice(0,8),parseInt(f[1],10)).key,m=[],g=a.createDecipheriv(c,p,l);m.push(g.update(d)),m.push(g.final()),r=h.concat(m)}else{var v=u.match(o);r=h.from(v[2].replace(/[\r\n]/g,""),"base64")}return{tag:u.match(n)[1],data:r}}},function(t,e,r){var i=r(99).Buffer,n=r(102),o=r(103).ec,s=r(65),a=r(193);function h(t,e){if(t.cmpn(0)<=0)throw new Error("invalid sig");if(t.cmp(e)>=e)throw new Error("invalid sig")}t.exports=function u(t,e,r,f,c){var l=s(r);if("ec"===l.type){if("ecdsa"!==f&&"ecdsa/rsa"!==f)throw new Error("wrong public key type");return function d(t,e,r){var i=a[r.data.algorithm.curve.join(".")];if(!i)throw new Error("unknown curve "+r.data.algorithm.curve.join("."));var n=new o(i),s=r.data.subjectPrivateKey.data;return n.verify(e,t,s)}(t,e,l)}if("dsa"===l.type){if("dsa"!==f)throw new Error("wrong public key type");return function p(t,e,r){var i=r.data.p,o=r.data.q,a=r.data.g,u=r.data.pub_key,f=s.signature.decode(t,"der"),c=f.s,l=f.r;h(c,o),h(l,o);var d=n.mont(i),p=c.invm(o);return 0===a.toRed(d).redPow(new n(e).mul(p).mod(o)).fromRed().mul(u.toRed(d).redPow(l.mul(p).mod(o)).fromRed()).mod(i).mod(o).cmp(l)}(t,e,l)}if("rsa"!==f&&"ecdsa/rsa"!==f)throw new Error("wrong public key type");e=i.concat([c,e]);for(var m=l.modulus.byteLength(),g=[1],v=0;e.length+g.length+2<m;)g.push(255),v++;g.push(0);for(var b=-1;++b<e.length;)g.push(e[b]);g=i.from(g);var y=n.mont(l.modulus);t=(t=new n(t).toRed(y)).redPow(new n(l.publicExponent)),t=i.from(t.fromRed().toArray());var w=v<8?1:0;for(m=Math.min(t.length,g.length),t.length!==g.length&&(w=1),b=-1;++b<m;)w|=t[b]^g[b];return 0===w}},function(t,e,r){(function(e){var i=r(103),n=r(371);t.exports=function t(e){return new s(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 s(t){this.curveType=o[t],this.curveType||(this.curveType={name:t}),this.curve=new i.ec(this.curveType.name),this.keys=void 0}function a(t,r,i){Array.isArray(t)||(t=t.toArray());var n=new e(t);if(i&&n.length<i){var o=new e(i-n.length);o.fill(0),n=e.concat([o,n])}return r?n.toString(r):n}o.p224=o.secp224r1,o.p256=o.secp256r1=o.prime256v1,o.p192=o.secp192r1=o.prime192v1,o.p384=o.secp384r1,o.p521=o.secp521r1,s.prototype.generateKeys=function(t,e){return this.keys=this.curve.genKeyPair(),this.getPublicKey(t,e)},s.prototype.computeSecret=function(t,r,i){return r=r||"utf8",e.isBuffer(t)||(t=new e(t,r)),a(this.curve.keyFromPublic(t).getPublic().mul(this.keys.getPrivate()).getX(),i,this.curveType.byteLength)},s.prototype.getPublicKey=function(t,e){var r=this.keys.getPublic("compressed"===e,!0);return"hybrid"===e&&(r[r.length-1]%2?r[0]=7:r[0]=6),a(r,t)},s.prototype.getPrivateKey=function(t){return a(this.keys.getPrivate(),t)},s.prototype.setPublicKey=function(t,r){return r=r||"utf8",e.isBuffer(t)||(t=new e(t,r)),this.keys._importPublic(t),this},s.prototype.setPrivateKey=function(t,r){r=r||"utf8",e.isBuffer(t)||(t=new e(t,r));var i=new n(t);return i=i.toString(16),this.keys=this.curve.genKeyPair(),this.keys._importPrivate(i),this}}).call(this,r(26).Buffer)},function(t,e,r){(function(t){!function(t,e){"use strict";function i(t,e){if(!t)throw new Error(e||"Assertion failed")}function n(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function o(t,e,r){if(o.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var s;"object"==typeof t?t.exports=o:e.BN=o,o.BN=o,o.wordSize=26;try{s=r(372).Buffer}catch(t){}function a(t,e,r){for(var i=0,n=Math.min(t.length,r),o=e;o<n;o++){var s=t.charCodeAt(o)-48;i<<=4,i|=s>=49&&s<=54?s-49+10:s>=17&&s<=22?s-17+10:15&s}return i}function h(t,e,r,i){for(var n=0,o=Math.min(t.length,r),s=e;s<o;s++){var a=t.charCodeAt(s)-48;n*=i,n+=a>=49?a-49+10:a>=17?a-17+10:a}return n}o.isBN=function t(e){return e instanceof o||null!==e&&"object"==typeof e&&e.constructor.wordSize===o.wordSize&&Array.isArray(e.words)},o.max=function t(e,r){return e.cmp(r)>0?e:r},o.min=function t(e,r){return e.cmp(r)<0?e:r},o.prototype._init=function t(e,r,n){if("number"==typeof e)return this._initNumber(e,r,n);if("object"==typeof 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)},o.prototype._initNumber=function t(e,r,n){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"===n&&this._initArray(this.toArray(),r,n)},o.prototype._initArray=function t(e,r,n){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 o=0;o<this.length;o++)this.words[o]=0;var s,a,h=0;if("be"===n)for(o=e.length-1,s=0;o>=0;o-=3)a=e[o]|e[o-1]<<8|e[o-2]<<16,this.words[s]|=a<<h&67108863,this.words[s+1]=a>>>26-h&67108863,(h+=24)>=26&&(h-=26,s++);else if("le"===n)for(o=0,s=0;o<e.length;o+=3)a=e[o]|e[o+1]<<8|e[o+2]<<16,this.words[s]|=a<<h&67108863,this.words[s+1]=a>>>26-h&67108863,(h+=24)>=26&&(h-=26,s++);return this.strip()},o.prototype._parseHex=function t(e,r){this.length=Math.ceil((e.length-r)/6),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var n,o,s=0;for(i=e.length-6,n=0;i>=r;i-=6)o=a(e,i,i+6),this.words[n]|=o<<s&67108863,this.words[n+1]|=o>>>26-s&4194303,(s+=24)>=26&&(s-=26,n++);i+6!==r&&(o=a(e,r,i+6),this.words[n]|=o<<s&67108863,this.words[n+1]|=o>>>26-s&4194303),this.strip()},o.prototype._parseBase=function t(e,r,i){this.words=[0],this.length=1;for(var n=0,o=1;o<=67108863;o*=r)n++;n--,o=o/r|0;for(var s=e.length-i,a=s%n,u=Math.min(s,s-a)+i,f=0,c=i;c<u;c+=n)f=h(e,c,c+n,r),this.imuln(o),this.words[0]+f<67108864?this.words[0]+=f:this._iaddn(f);if(0!==a){var l=1;for(f=h(e,c,e.length,r),c=0;c<a;c++)l*=r;this.imuln(l),this.words[0]+f<67108864?this.words[0]+=f:this._iaddn(f)}},o.prototype.copy=function t(e){e.words=new Array(this.length);for(var r=0;r<this.length;r++)e.words[r]=this.words[r];e.length=this.length,e.negative=this.negative,e.red=this.red},o.prototype.clone=function t(){var e=new o(null);return this.copy(e),e},o.prototype._expand=function t(e){for(;this.length<e;)this.words[this.length++]=0;return this},o.prototype.strip=function t(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function t(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function t(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var u=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],f=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],c=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function l(t,e,r){r.negative=e.negative^t.negative;var i=t.length+e.length|0;r.length=i,i=i-1|0;var n=0|t.words[0],o=0|e.words[0],s=n*o,a=67108863&s,h=s/67108864|0;r.words[0]=a;for(var u=1;u<i;u++){for(var f=h>>>26,c=67108863&h,l=Math.min(u,e.length-1),d=Math.max(0,u-t.length+1);d<=l;d++){var p=u-d|0;f+=(s=(n=0|t.words[p])*(o=0|e.words[d])+c)/67108864|0,c=67108863&s}r.words[u]=0|c,h=0|f}return 0!==h?r.words[u]=0|h:r.length--,r.strip()}o.prototype.toString=function t(e,r){var n;if(r=0|r||1,16===(e=e||10)||"hex"===e){n="";for(var o=0,s=0,a=0;a<this.length;a++){var h=this.words[a],l=(16777215&(h<<o|s)).toString(16);n=0!==(s=h>>>24-o&16777215)||a!==this.length-1?u[6-l.length]+l+n:l+n,(o+=2)>=26&&(o-=26,a--)}for(0!==s&&(n=s.toString(16)+n);n.length%r!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}if(e===(0|e)&&e>=2&&e<=36){var d=f[e],p=c[e];n="";var m=this.clone();for(m.negative=0;!m.isZero();){var g=m.modn(p).toString(e);n=(m=m.idivn(p)).isZero()?g+n:u[d-g.length]+g+n}for(this.isZero()&&(n="0"+n);n.length%r!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}i(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function t(){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},o.prototype.toJSON=function t(){return this.toString(16)},o.prototype.toBuffer=function t(e,r){return i(void 0!==s),this.toArrayLike(s,e,r)},o.prototype.toArray=function t(e,r){return this.toArrayLike(Array,e,r)},o.prototype.toArrayLike=function t(e,r,n){var o=this.byteLength(),s=n||Math.max(1,o);i(o<=s,"byte array longer than desired length"),i(s>0,"Requested array length <= 0"),this.strip();var a,h,u="le"===r,f=new e(s),c=this.clone();if(u){for(h=0;!c.isZero();h++)a=c.andln(255),c.iushrn(8),f[h]=a;for(;h<s;h++)f[h]=0}else{for(h=0;h<s-o;h++)f[h]=0;for(h=0;!c.isZero();h++)a=c.andln(255),c.iushrn(8),f[s-h-1]=a}return f},Math.clz32?o.prototype._countBits=function t(e){return 32-Math.clz32(e)}:o.prototype._countBits=function t(e){var r=e,i=0;return r>=4096&&(i+=13,r>>>=13),r>=64&&(i+=7,r>>>=7),r>=8&&(i+=4,r>>>=4),r>=2&&(i+=2,r>>>=2),i+r},o.prototype._zeroBits=function t(e){if(0===e)return 26;var r=e,i=0;return 0==(8191&r)&&(i+=13,r>>>=13),0==(127&r)&&(i+=7,r>>>=7),0==(15&r)&&(i+=4,r>>>=4),0==(3&r)&&(i+=2,r>>>=2),0==(1&r)&&i++,i},o.prototype.bitLength=function t(){var e=this.words[this.length-1],r=this._countBits(e);return 26*(this.length-1)+r},o.prototype.zeroBits=function t(){if(this.isZero())return 0;for(var e=0,r=0;r<this.length;r++){var i=this._zeroBits(this.words[r]);if(e+=i,26!==i)break}return e},o.prototype.byteLength=function t(){return Math.ceil(this.bitLength()/8)},o.prototype.toTwos=function t(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},o.prototype.fromTwos=function t(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},o.prototype.isNeg=function t(){return 0!==this.negative},o.prototype.neg=function t(){return this.clone().ineg()},o.prototype.ineg=function t(){return this.isZero()||(this.negative^=1),this},o.prototype.iuor=function t(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var r=0;r<e.length;r++)this.words[r]=this.words[r]|e.words[r];return this.strip()},o.prototype.ior=function t(e){return i(0==(this.negative|e.negative)),this.iuor(e)},o.prototype.or=function t(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},o.prototype.uor=function t(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},o.prototype.iuand=function t(e){var r;r=this.length>e.length?e:this;for(var i=0;i<r.length;i++)this.words[i]=this.words[i]&e.words[i];return this.length=r.length,this.strip()},o.prototype.iand=function t(e){return i(0==(this.negative|e.negative)),this.iuand(e)},o.prototype.and=function t(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},o.prototype.uand=function t(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},o.prototype.iuxor=function t(e){var r,i;this.length>e.length?(r=this,i=e):(r=e,i=this);for(var n=0;n<i.length;n++)this.words[n]=r.words[n]^i.words[n];if(this!==r)for(;n<r.length;n++)this.words[n]=r.words[n];return this.length=r.length,this.strip()},o.prototype.ixor=function t(e){return i(0==(this.negative|e.negative)),this.iuxor(e)},o.prototype.xor=function t(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},o.prototype.uxor=function t(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},o.prototype.inotn=function t(e){i("number"==typeof e&&e>=0);var r=0|Math.ceil(e/26),n=e%26;this._expand(r),n>0&&r--;for(var o=0;o<r;o++)this.words[o]=67108863&~this.words[o];return n>0&&(this.words[o]=~this.words[o]&67108863>>26-n),this.strip()},o.prototype.notn=function t(e){return this.clone().inotn(e)},o.prototype.setn=function t(e,r){i("number"==typeof e&&e>=0);var n=e/26|0,o=e%26;return this._expand(n+1),this.words[n]=r?this.words[n]|1<<o:this.words[n]&~(1<<o),this.strip()},o.prototype.iadd=function t(e){var r,i,n;if(0!==this.negative&&0===e.negative)return this.negative=0,r=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,r=this.isub(e),e.negative=1,r._normSign();this.length>e.length?(i=this,n=e):(i=e,n=this);for(var o=0,s=0;s<n.length;s++)r=(0|i.words[s])+(0|n.words[s])+o,this.words[s]=67108863&r,o=r>>>26;for(;0!==o&&s<i.length;s++)r=(0|i.words[s])+o,this.words[s]=67108863&r,o=r>>>26;if(this.length=i.length,0!==o)this.words[this.length]=o,this.length++;else if(i!==this)for(;s<i.length;s++)this.words[s]=i.words[s];return this},o.prototype.add=function t(e){var r;return 0!==e.negative&&0===this.negative?(e.negative=0,r=this.sub(e),e.negative^=1,r):0===e.negative&&0!==this.negative?(this.negative=0,r=e.sub(this),this.negative=1,r):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},o.prototype.isub=function t(e){if(0!==e.negative){e.negative=0;var r=this.iadd(e);return e.negative=1,r._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var i,n,o=this.cmp(e);if(0===o)return this.negative=0,this.length=1,this.words[0]=0,this;o>0?(i=this,n=e):(i=e,n=this);for(var s=0,a=0;a<n.length;a++)s=(r=(0|i.words[a])-(0|n.words[a])+s)>>26,this.words[a]=67108863&r;for(;0!==s&&a<i.length;a++)s=(r=(0|i.words[a])+s)>>26,this.words[a]=67108863&r;if(0===s&&a<i.length&&i!==this)for(;a<i.length;a++)this.words[a]=i.words[a];return this.length=Math.max(this.length,a),i!==this&&(this.negative=1),this.strip()},o.prototype.sub=function t(e){return this.clone().isub(e)};var d=function t(e,r,i){var n,o,s,a=e.words,h=r.words,u=i.words,f=0,c=0|a[0],l=8191&c,d=c>>>13,p=0|a[1],m=8191&p,g=p>>>13,v=0|a[2],b=8191&v,y=v>>>13,w=0|a[3],_=8191&w,M=w>>>13,S=0|a[4],k=8191&S,E=S>>>13,R=0|a[5],A=8191&R,x=R>>>13,T=0|a[6],P=8191&T,I=T>>>13,L=0|a[7],O=8191&L,B=L>>>13,j=0|a[8],C=8191&j,U=j>>>13,N=0|a[9],q=8191&N,D=N>>>13,z=0|h[0],F=8191&z,W=z>>>13,H=0|h[1],K=8191&H,Z=H>>>13,V=0|h[2],J=8191&V,Y=V>>>13,G=0|h[3],X=8191&G,Q=G>>>13,$=0|h[4],tt=8191&$,et=$>>>13,rt=0|h[5],it=8191&rt,nt=rt>>>13,ot=0|h[6],st=8191&ot,at=ot>>>13,ht=0|h[7],ut=8191&ht,ft=ht>>>13,ct=0|h[8],lt=8191&ct,dt=ct>>>13,pt=0|h[9],mt=8191&pt,gt=pt>>>13;i.negative=e.negative^r.negative,i.length=19;var vt=(f+(n=Math.imul(l,F))|0)+((8191&(o=(o=Math.imul(l,W))+Math.imul(d,F)|0))<<13)|0;f=((s=Math.imul(d,W))+(o>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(m,F),o=(o=Math.imul(m,W))+Math.imul(g,F)|0,s=Math.imul(g,W);var bt=(f+(n=n+Math.imul(l,K)|0)|0)+((8191&(o=(o=o+Math.imul(l,Z)|0)+Math.imul(d,K)|0))<<13)|0;f=((s=s+Math.imul(d,Z)|0)+(o>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(b,F),o=(o=Math.imul(b,W))+Math.imul(y,F)|0,s=Math.imul(y,W),n=n+Math.imul(m,K)|0,o=(o=o+Math.imul(m,Z)|0)+Math.imul(g,K)|0,s=s+Math.imul(g,Z)|0;var yt=(f+(n=n+Math.imul(l,J)|0)|0)+((8191&(o=(o=o+Math.imul(l,Y)|0)+Math.imul(d,J)|0))<<13)|0;f=((s=s+Math.imul(d,Y)|0)+(o>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(_,F),o=(o=Math.imul(_,W))+Math.imul(M,F)|0,s=Math.imul(M,W),n=n+Math.imul(b,K)|0,o=(o=o+Math.imul(b,Z)|0)+Math.imul(y,K)|0,s=s+Math.imul(y,Z)|0,n=n+Math.imul(m,J)|0,o=(o=o+Math.imul(m,Y)|0)+Math.imul(g,J)|0,s=s+Math.imul(g,Y)|0;var wt=(f+(n=n+Math.imul(l,X)|0)|0)+((8191&(o=(o=o+Math.imul(l,Q)|0)+Math.imul(d,X)|0))<<13)|0;f=((s=s+Math.imul(d,Q)|0)+(o>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(k,F),o=(o=Math.imul(k,W))+Math.imul(E,F)|0,s=Math.imul(E,W),n=n+Math.imul(_,K)|0,o=(o=o+Math.imul(_,Z)|0)+Math.imul(M,K)|0,s=s+Math.imul(M,Z)|0,n=n+Math.imul(b,J)|0,o=(o=o+Math.imul(b,Y)|0)+Math.imul(y,J)|0,s=s+Math.imul(y,Y)|0,n=n+Math.imul(m,X)|0,o=(o=o+Math.imul(m,Q)|0)+Math.imul(g,X)|0,s=s+Math.imul(g,Q)|0;var _t=(f+(n=n+Math.imul(l,tt)|0)|0)+((8191&(o=(o=o+Math.imul(l,et)|0)+Math.imul(d,tt)|0))<<13)|0;f=((s=s+Math.imul(d,et)|0)+(o>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(A,F),o=(o=Math.imul(A,W))+Math.imul(x,F)|0,s=Math.imul(x,W),n=n+Math.imul(k,K)|0,o=(o=o+Math.imul(k,Z)|0)+Math.imul(E,K)|0,s=s+Math.imul(E,Z)|0,n=n+Math.imul(_,J)|0,o=(o=o+Math.imul(_,Y)|0)+Math.imul(M,J)|0,s=s+Math.imul(M,Y)|0,n=n+Math.imul(b,X)|0,o=(o=o+Math.imul(b,Q)|0)+Math.imul(y,X)|0,s=s+Math.imul(y,Q)|0,n=n+Math.imul(m,tt)|0,o=(o=o+Math.imul(m,et)|0)+Math.imul(g,tt)|0,s=s+Math.imul(g,et)|0;var Mt=(f+(n=n+Math.imul(l,it)|0)|0)+((8191&(o=(o=o+Math.imul(l,nt)|0)+Math.imul(d,it)|0))<<13)|0;f=((s=s+Math.imul(d,nt)|0)+(o>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(P,F),o=(o=Math.imul(P,W))+Math.imul(I,F)|0,s=Math.imul(I,W),n=n+Math.imul(A,K)|0,o=(o=o+Math.imul(A,Z)|0)+Math.imul(x,K)|0,s=s+Math.imul(x,Z)|0,n=n+Math.imul(k,J)|0,o=(o=o+Math.imul(k,Y)|0)+Math.imul(E,J)|0,s=s+Math.imul(E,Y)|0,n=n+Math.imul(_,X)|0,o=(o=o+Math.imul(_,Q)|0)+Math.imul(M,X)|0,s=s+Math.imul(M,Q)|0,n=n+Math.imul(b,tt)|0,o=(o=o+Math.imul(b,et)|0)+Math.imul(y,tt)|0,s=s+Math.imul(y,et)|0,n=n+Math.imul(m,it)|0,o=(o=o+Math.imul(m,nt)|0)+Math.imul(g,it)|0,s=s+Math.imul(g,nt)|0;var St=(f+(n=n+Math.imul(l,st)|0)|0)+((8191&(o=(o=o+Math.imul(l,at)|0)+Math.imul(d,st)|0))<<13)|0;f=((s=s+Math.imul(d,at)|0)+(o>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(O,F),o=(o=Math.imul(O,W))+Math.imul(B,F)|0,s=Math.imul(B,W),n=n+Math.imul(P,K)|0,o=(o=o+Math.imul(P,Z)|0)+Math.imul(I,K)|0,s=s+Math.imul(I,Z)|0,n=n+Math.imul(A,J)|0,o=(o=o+Math.imul(A,Y)|0)+Math.imul(x,J)|0,s=s+Math.imul(x,Y)|0,n=n+Math.imul(k,X)|0,o=(o=o+Math.imul(k,Q)|0)+Math.imul(E,X)|0,s=s+Math.imul(E,Q)|0,n=n+Math.imul(_,tt)|0,o=(o=o+Math.imul(_,et)|0)+Math.imul(M,tt)|0,s=s+Math.imul(M,et)|0,n=n+Math.imul(b,it)|0,o=(o=o+Math.imul(b,nt)|0)+Math.imul(y,it)|0,s=s+Math.imul(y,nt)|0,n=n+Math.imul(m,st)|0,o=(o=o+Math.imul(m,at)|0)+Math.imul(g,st)|0,s=s+Math.imul(g,at)|0;var kt=(f+(n=n+Math.imul(l,ut)|0)|0)+((8191&(o=(o=o+Math.imul(l,ft)|0)+Math.imul(d,ut)|0))<<13)|0;f=((s=s+Math.imul(d,ft)|0)+(o>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(C,F),o=(o=Math.imul(C,W))+Math.imul(U,F)|0,s=Math.imul(U,W),n=n+Math.imul(O,K)|0,o=(o=o+Math.imul(O,Z)|0)+Math.imul(B,K)|0,s=s+Math.imul(B,Z)|0,n=n+Math.imul(P,J)|0,o=(o=o+Math.imul(P,Y)|0)+Math.imul(I,J)|0,s=s+Math.imul(I,Y)|0,n=n+Math.imul(A,X)|0,o=(o=o+Math.imul(A,Q)|0)+Math.imul(x,X)|0,s=s+Math.imul(x,Q)|0,n=n+Math.imul(k,tt)|0,o=(o=o+Math.imul(k,et)|0)+Math.imul(E,tt)|0,s=s+Math.imul(E,et)|0,n=n+Math.imul(_,it)|0,o=(o=o+Math.imul(_,nt)|0)+Math.imul(M,it)|0,s=s+Math.imul(M,nt)|0,n=n+Math.imul(b,st)|0,o=(o=o+Math.imul(b,at)|0)+Math.imul(y,st)|0,s=s+Math.imul(y,at)|0,n=n+Math.imul(m,ut)|0,o=(o=o+Math.imul(m,ft)|0)+Math.imul(g,ut)|0,s=s+Math.imul(g,ft)|0;var Et=(f+(n=n+Math.imul(l,lt)|0)|0)+((8191&(o=(o=o+Math.imul(l,dt)|0)+Math.imul(d,lt)|0))<<13)|0;f=((s=s+Math.imul(d,dt)|0)+(o>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(q,F),o=(o=Math.imul(q,W))+Math.imul(D,F)|0,s=Math.imul(D,W),n=n+Math.imul(C,K)|0,o=(o=o+Math.imul(C,Z)|0)+Math.imul(U,K)|0,s=s+Math.imul(U,Z)|0,n=n+Math.imul(O,J)|0,o=(o=o+Math.imul(O,Y)|0)+Math.imul(B,J)|0,s=s+Math.imul(B,Y)|0,n=n+Math.imul(P,X)|0,o=(o=o+Math.imul(P,Q)|0)+Math.imul(I,X)|0,s=s+Math.imul(I,Q)|0,n=n+Math.imul(A,tt)|0,o=(o=o+Math.imul(A,et)|0)+Math.imul(x,tt)|0,s=s+Math.imul(x,et)|0,n=n+Math.imul(k,it)|0,o=(o=o+Math.imul(k,nt)|0)+Math.imul(E,it)|0,s=s+Math.imul(E,nt)|0,n=n+Math.imul(_,st)|0,o=(o=o+Math.imul(_,at)|0)+Math.imul(M,st)|0,s=s+Math.imul(M,at)|0,n=n+Math.imul(b,ut)|0,o=(o=o+Math.imul(b,ft)|0)+Math.imul(y,ut)|0,s=s+Math.imul(y,ft)|0,n=n+Math.imul(m,lt)|0,o=(o=o+Math.imul(m,dt)|0)+Math.imul(g,lt)|0,s=s+Math.imul(g,dt)|0;var Rt=(f+(n=n+Math.imul(l,mt)|0)|0)+((8191&(o=(o=o+Math.imul(l,gt)|0)+Math.imul(d,mt)|0))<<13)|0;f=((s=s+Math.imul(d,gt)|0)+(o>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,n=Math.imul(q,K),o=(o=Math.imul(q,Z))+Math.imul(D,K)|0,s=Math.imul(D,Z),n=n+Math.imul(C,J)|0,o=(o=o+Math.imul(C,Y)|0)+Math.imul(U,J)|0,s=s+Math.imul(U,Y)|0,n=n+Math.imul(O,X)|0,o=(o=o+Math.imul(O,Q)|0)+Math.imul(B,X)|0,s=s+Math.imul(B,Q)|0,n=n+Math.imul(P,tt)|0,o=(o=o+Math.imul(P,et)|0)+Math.imul(I,tt)|0,s=s+Math.imul(I,et)|0,n=n+Math.imul(A,it)|0,o=(o=o+Math.imul(A,nt)|0)+Math.imul(x,it)|0,s=s+Math.imul(x,nt)|0,n=n+Math.imul(k,st)|0,o=(o=o+Math.imul(k,at)|0)+Math.imul(E,st)|0,s=s+Math.imul(E,at)|0,n=n+Math.imul(_,ut)|0,o=(o=o+Math.imul(_,ft)|0)+Math.imul(M,ut)|0,s=s+Math.imul(M,ft)|0,n=n+Math.imul(b,lt)|0,o=(o=o+Math.imul(b,dt)|0)+Math.imul(y,lt)|0,s=s+Math.imul(y,dt)|0;var At=(f+(n=n+Math.imul(m,mt)|0)|0)+((8191&(o=(o=o+Math.imul(m,gt)|0)+Math.imul(g,mt)|0))<<13)|0;f=((s=s+Math.imul(g,gt)|0)+(o>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(q,J),o=(o=Math.imul(q,Y))+Math.imul(D,J)|0,s=Math.imul(D,Y),n=n+Math.imul(C,X)|0,o=(o=o+Math.imul(C,Q)|0)+Math.imul(U,X)|0,s=s+Math.imul(U,Q)|0,n=n+Math.imul(O,tt)|0,o=(o=o+Math.imul(O,et)|0)+Math.imul(B,tt)|0,s=s+Math.imul(B,et)|0,n=n+Math.imul(P,it)|0,o=(o=o+Math.imul(P,nt)|0)+Math.imul(I,it)|0,s=s+Math.imul(I,nt)|0,n=n+Math.imul(A,st)|0,o=(o=o+Math.imul(A,at)|0)+Math.imul(x,st)|0,s=s+Math.imul(x,at)|0,n=n+Math.imul(k,ut)|0,o=(o=o+Math.imul(k,ft)|0)+Math.imul(E,ut)|0,s=s+Math.imul(E,ft)|0,n=n+Math.imul(_,lt)|0,o=(o=o+Math.imul(_,dt)|0)+Math.imul(M,lt)|0,s=s+Math.imul(M,dt)|0;var xt=(f+(n=n+Math.imul(b,mt)|0)|0)+((8191&(o=(o=o+Math.imul(b,gt)|0)+Math.imul(y,mt)|0))<<13)|0;f=((s=s+Math.imul(y,gt)|0)+(o>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(q,X),o=(o=Math.imul(q,Q))+Math.imul(D,X)|0,s=Math.imul(D,Q),n=n+Math.imul(C,tt)|0,o=(o=o+Math.imul(C,et)|0)+Math.imul(U,tt)|0,s=s+Math.imul(U,et)|0,n=n+Math.imul(O,it)|0,o=(o=o+Math.imul(O,nt)|0)+Math.imul(B,it)|0,s=s+Math.imul(B,nt)|0,n=n+Math.imul(P,st)|0,o=(o=o+Math.imul(P,at)|0)+Math.imul(I,st)|0,s=s+Math.imul(I,at)|0,n=n+Math.imul(A,ut)|0,o=(o=o+Math.imul(A,ft)|0)+Math.imul(x,ut)|0,s=s+Math.imul(x,ft)|0,n=n+Math.imul(k,lt)|0,o=(o=o+Math.imul(k,dt)|0)+Math.imul(E,lt)|0,s=s+Math.imul(E,dt)|0;var Tt=(f+(n=n+Math.imul(_,mt)|0)|0)+((8191&(o=(o=o+Math.imul(_,gt)|0)+Math.imul(M,mt)|0))<<13)|0;f=((s=s+Math.imul(M,gt)|0)+(o>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(q,tt),o=(o=Math.imul(q,et))+Math.imul(D,tt)|0,s=Math.imul(D,et),n=n+Math.imul(C,it)|0,o=(o=o+Math.imul(C,nt)|0)+Math.imul(U,it)|0,s=s+Math.imul(U,nt)|0,n=n+Math.imul(O,st)|0,o=(o=o+Math.imul(O,at)|0)+Math.imul(B,st)|0,s=s+Math.imul(B,at)|0,n=n+Math.imul(P,ut)|0,o=(o=o+Math.imul(P,ft)|0)+Math.imul(I,ut)|0,s=s+Math.imul(I,ft)|0,n=n+Math.imul(A,lt)|0,o=(o=o+Math.imul(A,dt)|0)+Math.imul(x,lt)|0,s=s+Math.imul(x,dt)|0;var Pt=(f+(n=n+Math.imul(k,mt)|0)|0)+((8191&(o=(o=o+Math.imul(k,gt)|0)+Math.imul(E,mt)|0))<<13)|0;f=((s=s+Math.imul(E,gt)|0)+(o>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,n=Math.imul(q,it),o=(o=Math.imul(q,nt))+Math.imul(D,it)|0,s=Math.imul(D,nt),n=n+Math.imul(C,st)|0,o=(o=o+Math.imul(C,at)|0)+Math.imul(U,st)|0,s=s+Math.imul(U,at)|0,n=n+Math.imul(O,ut)|0,o=(o=o+Math.imul(O,ft)|0)+Math.imul(B,ut)|0,s=s+Math.imul(B,ft)|0,n=n+Math.imul(P,lt)|0,o=(o=o+Math.imul(P,dt)|0)+Math.imul(I,lt)|0,s=s+Math.imul(I,dt)|0;var It=(f+(n=n+Math.imul(A,mt)|0)|0)+((8191&(o=(o=o+Math.imul(A,gt)|0)+Math.imul(x,mt)|0))<<13)|0;f=((s=s+Math.imul(x,gt)|0)+(o>>>13)|0)+(It>>>26)|0,It&=67108863,n=Math.imul(q,st),o=(o=Math.imul(q,at))+Math.imul(D,st)|0,s=Math.imul(D,at),n=n+Math.imul(C,ut)|0,o=(o=o+Math.imul(C,ft)|0)+Math.imul(U,ut)|0,s=s+Math.imul(U,ft)|0,n=n+Math.imul(O,lt)|0,o=(o=o+Math.imul(O,dt)|0)+Math.imul(B,lt)|0,s=s+Math.imul(B,dt)|0;var Lt=(f+(n=n+Math.imul(P,mt)|0)|0)+((8191&(o=(o=o+Math.imul(P,gt)|0)+Math.imul(I,mt)|0))<<13)|0;f=((s=s+Math.imul(I,gt)|0)+(o>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,n=Math.imul(q,ut),o=(o=Math.imul(q,ft))+Math.imul(D,ut)|0,s=Math.imul(D,ft),n=n+Math.imul(C,lt)|0,o=(o=o+Math.imul(C,dt)|0)+Math.imul(U,lt)|0,s=s+Math.imul(U,dt)|0;var Ot=(f+(n=n+Math.imul(O,mt)|0)|0)+((8191&(o=(o=o+Math.imul(O,gt)|0)+Math.imul(B,mt)|0))<<13)|0;f=((s=s+Math.imul(B,gt)|0)+(o>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,n=Math.imul(q,lt),o=(o=Math.imul(q,dt))+Math.imul(D,lt)|0,s=Math.imul(D,dt);var Bt=(f+(n=n+Math.imul(C,mt)|0)|0)+((8191&(o=(o=o+Math.imul(C,gt)|0)+Math.imul(U,mt)|0))<<13)|0;f=((s=s+Math.imul(U,gt)|0)+(o>>>13)|0)+(Bt>>>26)|0,Bt&=67108863;var jt=(f+(n=Math.imul(q,mt))|0)+((8191&(o=(o=Math.imul(q,gt))+Math.imul(D,mt)|0))<<13)|0;return f=((s=Math.imul(D,gt))+(o>>>13)|0)+(jt>>>26)|0,jt&=67108863,u[0]=vt,u[1]=bt,u[2]=yt,u[3]=wt,u[4]=_t,u[5]=Mt,u[6]=St,u[7]=kt,u[8]=Et,u[9]=Rt,u[10]=At,u[11]=xt,u[12]=Tt,u[13]=Pt,u[14]=It,u[15]=Lt,u[16]=Ot,u[17]=Bt,u[18]=jt,0!==f&&(u[19]=f,i.length++),i};function p(t,e,r){return(new m).mulp(t,e,r)}function m(t,e){this.x=t,this.y=e}Math.imul||(d=l),o.prototype.mulTo=function t(e,r){var i=this.length+e.length;return 10===this.length&&10===e.length?d(this,e,r):i<63?l(this,e,r):i<1024?function n(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var i=0,n=0,o=0;o<r.length-1;o++){var s=n;n=0;for(var a=67108863&i,h=Math.min(o,e.length-1),u=Math.max(0,o-t.length+1);u<=h;u++){var f=o-u,c=(0|t.words[f])*(0|e.words[u]),l=67108863&c;a=67108863&(l=l+a|0),n+=(s=(s=s+(c/67108864|0)|0)+(l>>>26)|0)>>>26,s&=67108863}r.words[o]=a,i=s,s=n}return 0!==i?r.words[o]=i:r.length--,r.strip()}(this,e,r):p(this,e,r)},m.prototype.makeRBT=function t(e){for(var r=new Array(e),i=o.prototype._countBits(e)-1,n=0;n<e;n++)r[n]=this.revBin(n,i,e);return r},m.prototype.revBin=function t(e,r,i){if(0===e||e===i-1)return e;for(var n=0,o=0;o<r;o++)n|=(1&e)<<r-o-1,e>>=1;return n},m.prototype.permute=function t(e,r,i,n,o,s){for(var a=0;a<s;a++)n[a]=r[e[a]],o[a]=i[e[a]]},m.prototype.transform=function t(e,r,i,n,o,s){this.permute(s,e,r,i,n,o);for(var a=1;a<o;a<<=1)for(var h=a<<1,u=Math.cos(2*Math.PI/h),f=Math.sin(2*Math.PI/h),c=0;c<o;c+=h)for(var l=u,d=f,p=0;p<a;p++){var m=i[c+p],g=n[c+p],v=i[c+p+a],b=n[c+p+a],y=l*v-d*b;b=l*b+d*v,v=y,i[c+p]=m+v,n[c+p]=g+b,i[c+p+a]=m-v,n[c+p+a]=g-b,p!==h&&(y=u*l-f*d,d=u*d+f*l,l=y)}},m.prototype.guessLen13b=function t(e,r){var i=1|Math.max(r,e),n=1&i,o=0;for(i=i/2|0;i;i>>>=1)o++;return 1<<o+1+n},m.prototype.conjugate=function t(e,r,i){if(!(i<=1))for(var n=0;n<i/2;n++){var o=e[n];e[n]=e[i-n-1],e[i-n-1]=o,o=r[n],r[n]=-r[i-n-1],r[i-n-1]=-o}},m.prototype.normalize13b=function t(e,r){for(var i=0,n=0;n<r/2;n++){var o=8192*Math.round(e[2*n+1]/r)+Math.round(e[2*n]/r)+i;e[n]=67108863&o,i=o<67108864?0:o/67108864|0}return e},m.prototype.convert13b=function t(e,r,n,o){for(var s=0,a=0;a<r;a++)s+=0|e[a],n[2*a]=8191&s,s>>>=13,n[2*a+1]=8191&s,s>>>=13;for(a=2*r;a<o;++a)n[a]=0;i(0===s),i(0==(-8192&s))},m.prototype.stub=function t(e){for(var r=new Array(e),i=0;i<e;i++)r[i]=0;return r},m.prototype.mulp=function t(e,r,i){var n=2*this.guessLen13b(e.length,r.length),o=this.makeRBT(n),s=this.stub(n),a=new Array(n),h=new Array(n),u=new Array(n),f=new Array(n),c=new Array(n),l=new Array(n),d=i.words;d.length=n,this.convert13b(e.words,e.length,a,n),this.convert13b(r.words,r.length,f,n),this.transform(a,s,h,u,n,o),this.transform(f,s,c,l,n,o);for(var p=0;p<n;p++){var m=h[p]*c[p]-u[p]*l[p];u[p]=h[p]*l[p]+u[p]*c[p],h[p]=m}return this.conjugate(h,u,n),this.transform(h,u,d,s,n,o),this.conjugate(d,s,n),this.normalize13b(d,n),i.negative=e.negative^r.negative,i.length=e.length+r.length,i.strip()},o.prototype.mul=function t(e){var r=new o(null);return r.words=new Array(this.length+e.length),this.mulTo(e,r)},o.prototype.mulf=function t(e){var r=new o(null);return r.words=new Array(this.length+e.length),p(this,e,r)},o.prototype.imul=function t(e){return this.clone().mulTo(e,this)},o.prototype.imuln=function t(e){i("number"==typeof e),i(e<67108864);for(var r=0,n=0;n<this.length;n++){var o=(0|this.words[n])*e,s=(67108863&o)+(67108863&r);r>>=26,r+=o/67108864|0,r+=s>>>26,this.words[n]=67108863&s}return 0!==r&&(this.words[n]=r,this.length++),this},o.prototype.muln=function t(e){return this.clone().imuln(e)},o.prototype.sqr=function t(){return this.mul(this)},o.prototype.isqr=function t(){return this.imul(this.clone())},o.prototype.pow=function t(e){var r=function i(t){for(var e=new Array(t.bitLength()),r=0;r<e.length;r++){var i=r/26|0,n=r%26;e[r]=(t.words[i]&1<<n)>>>n}return e}(e);if(0===r.length)return new o(1);for(var n=this,s=0;s<r.length&&0===r[s];s++,n=n.sqr());if(++s<r.length)for(var a=n.sqr();s<r.length;s++,a=a.sqr())0!==r[s]&&(n=n.mul(a));return n},o.prototype.iushln=function t(e){i("number"==typeof e&&e>=0);var r,n=e%26,o=(e-n)/26,s=67108863>>>26-n<<26-n;if(0!==n){var a=0;for(r=0;r<this.length;r++){var h=this.words[r]&s,u=(0|this.words[r])-h<<n;this.words[r]=u|a,a=h>>>26-n}a&&(this.words[r]=a,this.length++)}if(0!==o){for(r=this.length-1;r>=0;r--)this.words[r+o]=this.words[r];for(r=0;r<o;r++)this.words[r]=0;this.length+=o}return this.strip()},o.prototype.ishln=function t(e){return i(0===this.negative),this.iushln(e)},o.prototype.iushrn=function t(e,r,n){var o;i("number"==typeof e&&e>=0),o=r?(r-r%26)/26:0;var s=e%26,a=Math.min((e-s)/26,this.length),h=67108863^67108863>>>s<<s,u=n;if(o-=a,o=Math.max(0,o),u){for(var f=0;f<a;f++)u.words[f]=this.words[f];u.length=a}if(0===a);else if(this.length>a)for(this.length-=a,f=0;f<this.length;f++)this.words[f]=this.words[f+a];else this.words[0]=0,this.length=1;var c=0;for(f=this.length-1;f>=0&&(0!==c||f>=o);f--){var l=0|this.words[f];this.words[f]=c<<26-s|l>>>s,c=l&h}return u&&0!==c&&(u.words[u.length++]=c),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function t(e,r,n){return i(0===this.negative),this.iushrn(e,r,n)},o.prototype.shln=function t(e){return this.clone().ishln(e)},o.prototype.ushln=function t(e){return this.clone().iushln(e)},o.prototype.shrn=function t(e){return this.clone().ishrn(e)},o.prototype.ushrn=function t(e){return this.clone().iushrn(e)},o.prototype.testn=function t(e){i("number"==typeof e&&e>=0);var r=e%26,n=(e-r)/26,o=1<<r;return!(this.length<=n)&&!!(this.words[n]&o)},o.prototype.imaskn=function t(e){i("number"==typeof e&&e>=0);var r=e%26,n=(e-r)/26;if(i(0===this.negative,"imaskn works only with positive numbers"),this.length<=n)return this;if(0!==r&&n++,this.length=Math.min(n,this.length),0!==r){var o=67108863^67108863>>>r<<r;this.words[this.length-1]&=o}return this.strip()},o.prototype.maskn=function t(e){return this.clone().imaskn(e)},o.prototype.iaddn=function t(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)},o.prototype._iaddn=function t(e){this.words[0]+=e;for(var r=0;r<this.length&&this.words[r]>=67108864;r++)this.words[r]-=67108864,r===this.length-1?this.words[r+1]=1:this.words[r+1]++;return this.length=Math.max(this.length,r+1),this},o.prototype.isubn=function t(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 r=0;r<this.length&&this.words[r]<0;r++)this.words[r]+=67108864,this.words[r+1]-=1;return this.strip()},o.prototype.addn=function t(e){return this.clone().iaddn(e)},o.prototype.subn=function t(e){return this.clone().isubn(e)},o.prototype.iabs=function t(){return this.negative=0,this},o.prototype.abs=function t(){return this.clone().iabs()},o.prototype._ishlnsubmul=function t(e,r,n){var o,s,a=e.length+n;this._expand(a);var h=0;for(o=0;o<e.length;o++){s=(0|this.words[o+n])+h;var u=(0|e.words[o])*r;h=((s-=67108863&u)>>26)-(u/67108864|0),this.words[o+n]=67108863&s}for(;o<this.length-n;o++)h=(s=(0|this.words[o+n])+h)>>26,this.words[o+n]=67108863&s;if(0===h)return this.strip();for(i(-1===h),h=0,o=0;o<this.length;o++)h=(s=-(0|this.words[o])+h)>>26,this.words[o]=67108863&s;return this.negative=1,this.strip()},o.prototype._wordDiv=function t(e,r){var i=(this.length,e.length),n=this.clone(),s=e,a=0|s.words[s.length-1];0!==(i=26-this._countBits(a))&&(s=s.ushln(i),n.iushln(i),a=0|s.words[s.length-1]);var h,u=n.length-s.length;if("mod"!==r){(h=new o(null)).length=u+1,h.words=new Array(h.length);for(var f=0;f<h.length;f++)h.words[f]=0}var c=n.clone()._ishlnsubmul(s,1,u);0===c.negative&&(n=c,h&&(h.words[u]=1));for(var l=u-1;l>=0;l--){var d=67108864*(0|n.words[s.length+l])+(0|n.words[s.length+l-1]);for(d=Math.min(d/a|0,67108863),n._ishlnsubmul(s,d,l);0!==n.negative;)d--,n.negative=0,n._ishlnsubmul(s,1,l),n.isZero()||(n.negative^=1);h&&(h.words[l]=d)}return h&&h.strip(),n.strip(),"div"!==r&&0!==i&&n.iushrn(i),{div:h||null,mod:n}},o.prototype.divmod=function t(e,r,n){return i(!e.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===e.negative?(h=this.neg().divmod(e,r),"mod"!==r&&(s=h.div.neg()),"div"!==r&&(a=h.mod.neg(),n&&0!==a.negative&&a.iadd(e)),{div:s,mod:a}):0===this.negative&&0!==e.negative?(h=this.divmod(e.neg(),r),"mod"!==r&&(s=h.div.neg()),{div:s,mod:h.mod}):0!=(this.negative&e.negative)?(h=this.neg().divmod(e.neg(),r),"div"!==r&&(a=h.mod.neg(),n&&0!==a.negative&&a.isub(e)),{div:h.div,mod:a}):e.length>this.length||this.cmp(e)<0?{div:new o(0),mod:this}:1===e.length?"div"===r?{div:this.divn(e.words[0]),mod:null}:"mod"===r?{div:null,mod:new o(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new o(this.modn(e.words[0]))}:this._wordDiv(e,r);var s,a,h},o.prototype.div=function t(e){return this.divmod(e,"div",!1).div},o.prototype.mod=function t(e){return this.divmod(e,"mod",!1).mod},o.prototype.umod=function t(e){return this.divmod(e,"mod",!0).mod},o.prototype.divRound=function t(e){var r=this.divmod(e);if(r.mod.isZero())return r.div;var i=0!==r.div.negative?r.mod.isub(e):r.mod,n=e.ushrn(1),o=e.andln(1),s=i.cmp(n);return s<0||1===o&&0===s?r.div:0!==r.div.negative?r.div.isubn(1):r.div.iaddn(1)},o.prototype.modn=function t(e){i(e<=67108863);for(var r=(1<<26)%e,n=0,o=this.length-1;o>=0;o--)n=(r*n+(0|this.words[o]))%e;return n},o.prototype.idivn=function t(e){i(e<=67108863);for(var r=0,n=this.length-1;n>=0;n--){var o=(0|this.words[n])+67108864*r;this.words[n]=o/e|0,r=o%e}return this.strip()},o.prototype.divn=function t(e){return this.clone().idivn(e)},o.prototype.egcd=function t(e){i(0===e.negative),i(!e.isZero());var r=this,n=e.clone();r=0!==r.negative?r.umod(e):r.clone();for(var s=new o(1),a=new o(0),h=new o(0),u=new o(1),f=0;r.isEven()&&n.isEven();)r.iushrn(1),n.iushrn(1),++f;for(var c=n.clone(),l=r.clone();!r.isZero();){for(var d=0,p=1;0==(r.words[0]&p)&&d<26;++d,p<<=1);if(d>0)for(r.iushrn(d);d-- >0;)(s.isOdd()||a.isOdd())&&(s.iadd(c),a.isub(l)),s.iushrn(1),a.iushrn(1);for(var m=0,g=1;0==(n.words[0]&g)&&m<26;++m,g<<=1);if(m>0)for(n.iushrn(m);m-- >0;)(h.isOdd()||u.isOdd())&&(h.iadd(c),u.isub(l)),h.iushrn(1),u.iushrn(1);r.cmp(n)>=0?(r.isub(n),s.isub(h),a.isub(u)):(n.isub(r),h.isub(s),u.isub(a))}return{a:h,b:u,gcd:n.iushln(f)}},o.prototype._invmp=function t(e){i(0===e.negative),i(!e.isZero());var r=this,n=e.clone();r=0!==r.negative?r.umod(e):r.clone();for(var s,a=new o(1),h=new o(0),u=n.clone();r.cmpn(1)>0&&n.cmpn(1)>0;){for(var f=0,c=1;0==(r.words[0]&c)&&f<26;++f,c<<=1);if(f>0)for(r.iushrn(f);f-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);for(var l=0,d=1;0==(n.words[0]&d)&&l<26;++l,d<<=1);if(l>0)for(n.iushrn(l);l-- >0;)h.isOdd()&&h.iadd(u),h.iushrn(1);r.cmp(n)>=0?(r.isub(n),a.isub(h)):(n.isub(r),h.isub(a))}return(s=0===r.cmpn(1)?a:h).cmpn(0)<0&&s.iadd(e),s},o.prototype.gcd=function t(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var r=this.clone(),i=e.clone();r.negative=0,i.negative=0;for(var n=0;r.isEven()&&i.isEven();n++)r.iushrn(1),i.iushrn(1);for(;;){for(;r.isEven();)r.iushrn(1);for(;i.isEven();)i.iushrn(1);var o=r.cmp(i);if(o<0){var s=r;r=i,i=s}else if(0===o||0===i.cmpn(1))break;r.isub(i)}return i.iushln(n)},o.prototype.invm=function t(e){return this.egcd(e).a.umod(e)},o.prototype.isEven=function t(){return 0==(1&this.words[0])},o.prototype.isOdd=function t(){return 1==(1&this.words[0])},o.prototype.andln=function t(e){return this.words[0]&e},o.prototype.bincn=function t(e){i("number"==typeof e);var r=e%26,n=(e-r)/26,o=1<<r;if(this.length<=n)return this._expand(n+1),this.words[n]|=o,this;for(var s=o,a=n;0!==s&&a<this.length;a++){var h=0|this.words[a];s=(h+=s)>>>26,h&=67108863,this.words[a]=h}return 0!==s&&(this.words[a]=s,this.length++),this},o.prototype.isZero=function t(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function t(e){var r,n=e<0;if(0!==this.negative&&!n)return-1;if(0===this.negative&&n)return 1;if(this.strip(),this.length>1)r=1;else{n&&(e=-e),i(e<=67108863,"Number is too big");var o=0|this.words[0];r=o===e?0:o<e?-1:1}return 0!==this.negative?0|-r:r},o.prototype.cmp=function t(e){if(0!==this.negative&&0===e.negative)return-1;if(0===this.negative&&0!==e.negative)return 1;var r=this.ucmp(e);return 0!==this.negative?0|-r:r},o.prototype.ucmp=function t(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var r=0,i=this.length-1;i>=0;i--){var n=0|this.words[i],o=0|e.words[i];if(n!==o){n<o?r=-1:n>o&&(r=1);break}}return r},o.prototype.gtn=function t(e){return 1===this.cmpn(e)},o.prototype.gt=function t(e){return 1===this.cmp(e)},o.prototype.gten=function t(e){return this.cmpn(e)>=0},o.prototype.gte=function t(e){return this.cmp(e)>=0},o.prototype.ltn=function t(e){return-1===this.cmpn(e)},o.prototype.lt=function t(e){return-1===this.cmp(e)},o.prototype.lten=function t(e){return this.cmpn(e)<=0},o.prototype.lte=function t(e){return this.cmp(e)<=0},o.prototype.eqn=function t(e){return 0===this.cmpn(e)},o.prototype.eq=function t(e){return 0===this.cmp(e)},o.red=function t(e){return new M(e)},o.prototype.toRed=function t(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)},o.prototype.fromRed=function t(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function t(e){return this.red=e,this},o.prototype.forceRed=function t(e){return i(!this.red,"Already a number in reduction context"),this._forceRed(e)},o.prototype.redAdd=function t(e){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},o.prototype.redIAdd=function t(e){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},o.prototype.redSub=function t(e){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},o.prototype.redISub=function t(e){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},o.prototype.redShl=function t(e){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},o.prototype.redMul=function t(e){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},o.prototype.redIMul=function t(e){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},o.prototype.redSqr=function t(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function t(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function t(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function t(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function t(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function t(e){return i(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var g={k256:null,p224:null,p192:null,p25519:null};function v(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function b(){v.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function y(){v.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function w(){v.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function _(){v.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function M(t){if("string"==typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else i(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function S(t){M.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}v.prototype._tmp=function t(){var e=new o(null);return e.words=new Array(Math.ceil(this.n/13)),e},v.prototype.ireduce=function t(e){var r,i=e;do{this.split(i,this.tmp),r=(i=(i=this.imulK(i)).iadd(this.tmp)).bitLength()}while(r>this.n);var n=r<this.n?-1:i.ucmp(this.p);return 0===n?(i.words[0]=0,i.length=1):n>0?i.isub(this.p):void 0!==i.strip?i.strip():i._strip(),i},v.prototype.split=function t(e,r){e.iushrn(this.n,0,r)},v.prototype.imulK=function t(e){return e.imul(this.k)},n(b,v),b.prototype.split=function t(e,r){for(var i=4194303,n=Math.min(e.length,9),o=0;o<n;o++)r.words[o]=e.words[o];if(r.length=n,e.length<=9)return e.words[0]=0,void(e.length=1);var s=e.words[9];for(r.words[r.length++]=s&i,o=10;o<e.length;o++){var a=0|e.words[o];e.words[o-10]=(a&i)<<4|s>>>22,s=a}s>>>=22,e.words[o-10]=s,0===s&&e.length>10?e.length-=10:e.length-=9},b.prototype.imulK=function t(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var r=0,i=0;i<e.length;i++){var n=0|e.words[i];r+=977*n,e.words[i]=67108863&r,r=64*n+(r/67108864|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},n(y,v),n(w,v),n(_,v),_.prototype.imulK=function t(e){for(var r=0,i=0;i<e.length;i++){var n=19*(0|e.words[i])+r,o=67108863&n;n>>>=26,e.words[i]=o,r=n}return 0!==r&&(e.words[e.length++]=r),e},o._prime=function t(e){if(g[e])return g[e];var t;if("k256"===e)t=new b;else if("p224"===e)t=new y;else if("p192"===e)t=new w;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new _}return g[e]=t,t},M.prototype._verify1=function t(e){i(0===e.negative,"red works only with positives"),i(e.red,"red works only with red numbers")},M.prototype._verify2=function t(e,r){i(0==(e.negative|r.negative),"red works only with positives"),i(e.red&&e.red===r.red,"red works only with red numbers")},M.prototype.imod=function t(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},M.prototype.neg=function t(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},M.prototype.add=function t(e,r){this._verify2(e,r);var i=e.add(r);return i.cmp(this.m)>=0&&i.isub(this.m),i._forceRed(this)},M.prototype.iadd=function t(e,r){this._verify2(e,r);var i=e.iadd(r);return i.cmp(this.m)>=0&&i.isub(this.m),i},M.prototype.sub=function t(e,r){this._verify2(e,r);var i=e.sub(r);return i.cmpn(0)<0&&i.iadd(this.m),i._forceRed(this)},M.prototype.isub=function t(e,r){this._verify2(e,r);var i=e.isub(r);return i.cmpn(0)<0&&i.iadd(this.m),i},M.prototype.shl=function t(e,r){return this._verify1(e),this.imod(e.ushln(r))},M.prototype.imul=function t(e,r){return this._verify2(e,r),this.imod(e.imul(r))},M.prototype.mul=function t(e,r){return this._verify2(e,r),this.imod(e.mul(r))},M.prototype.isqr=function t(e){return this.imul(e,e.clone())},M.prototype.sqr=function t(e){return this.mul(e,e)},M.prototype.sqrt=function t(e){if(e.isZero())return e.clone();var r=this.m.andln(3);if(i(r%2==1),3===r){var n=this.m.add(new o(1)).iushrn(2);return this.pow(e,n)}for(var s=this.m.subn(1),a=0;!s.isZero()&&0===s.andln(1);)a++,s.iushrn(1);i(!s.isZero());var h=new o(1).toRed(this),u=h.redNeg(),f=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new o(2*c*c).toRed(this);0!==this.pow(c,f).cmp(u);)c.redIAdd(u);for(var l=this.pow(c,s),d=this.pow(e,s.addn(1).iushrn(1)),p=this.pow(e,s),m=a;0!==p.cmp(h);){for(var g=p,v=0;0!==g.cmp(h);v++)g=g.redSqr();i(v<m);var b=this.pow(l,new o(1).iushln(m-v-1));d=d.redMul(b),l=b.redSqr(),p=p.redMul(l),m=v}return d},M.prototype.invm=function t(e){var r=e._invmp(this.m);return 0!==r.negative?(r.negative=0,this.imod(r).redNeg()):this.imod(r)},M.prototype.pow=function t(e,r){if(r.isZero())return new o(1).toRed(this);if(0===r.cmpn(1))return e.clone();var i=new Array(16);i[0]=new o(1).toRed(this),i[1]=e;for(var n=2;n<i.length;n++)i[n]=this.mul(i[n-1],e);var s=i[0],a=0,h=0,u=r.bitLength()%26;for(0===u&&(u=26),n=r.length-1;n>=0;n--){for(var f=r.words[n],c=u-1;c>=0;c--){var l=f>>c&1;s!==i[0]&&(s=this.sqr(s)),0!==l||0!==a?(a<<=1,a|=l,(4===++h||0===n&&0===c)&&(s=this.mul(s,i[a]),h=0,a=0)):h=0}u=26}return s},M.prototype.convertTo=function t(e){var r=e.umod(this.m);return r===e?r.clone():r},M.prototype.convertFrom=function t(e){var r=e.clone();return r.red=null,r},o.mont=function t(e){return new S(e)},n(S,M),S.prototype.convertTo=function t(e){return this.imod(e.ushln(this.shift))},S.prototype.convertFrom=function t(e){var r=this.imod(e.mul(this.rinv));return r.red=null,r},S.prototype.imul=function t(e,r){if(e.isZero()||r.isZero())return e.words[0]=0,e.length=1,e;var i=e.imul(r),n=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=i.isub(n).iushrn(this.shift),s=o;return o.cmp(this.m)>=0?s=o.isub(this.m):o.cmpn(0)<0&&(s=o.iadd(this.m)),s._forceRed(this)},S.prototype.mul=function t(e,r){if(e.isZero()||r.isZero())return new o(0)._forceRed(this);var i=e.mul(r),n=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),s=i.isub(n).iushrn(this.shift),a=s;return s.cmp(this.m)>=0?a=s.isub(this.m):s.cmpn(0)<0&&(a=s.iadd(this.m)),a._forceRed(this)},S.prototype.invm=function t(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(t,this)}).call(this,r(28)(t))},function(t,e){},function(t,e,r){e.publicEncrypt=r(374),e.privateDecrypt=r(376),e.privateEncrypt=function t(r,i){return e.publicEncrypt(r,i,!0)},e.publicDecrypt=function t(r,i){return e.privateDecrypt(r,i,!0)}},function(t,e,r){var i=r(65),n=r(31),o=r(43),s=r(194),a=r(195),h=r(111),u=r(196),f=r(101),c=r(66).Buffer;t.exports=function t(e,r,l){var d;d=e.padding?e.padding:l?1:4;var p,m=i(e);if(4===d)p=function g(t,e){var r=t.modulus.byteLength(),i=e.length,u=o("sha1").update(c.alloc(0)).digest(),f=u.length,l=2*f;if(i>r-l-2)throw new Error("message too long");var d=c.alloc(r-i-l-2),p=r-f-1,m=n(f),g=a(c.concat([u,d,c.alloc(1,1),e],p),s(m,p)),v=a(m,s(g,f));return new h(c.concat([c.alloc(1),v,g],r))}(m,r);else if(1===d)p=function v(t,e,r){var i,o=e.length,s=t.modulus.byteLength();if(o>s-11)throw new Error("message too long");i=r?c.alloc(s-o-3,255):function a(t){var e,r=c.allocUnsafe(t),i=0,o=n(2*t),s=0;for(;i<t;)s===o.length&&(o=n(2*t),s=0),(e=o[s++])&&(r[i++]=e);return r}(s-o-3);return new h(c.concat([c.from([0,r?1:2]),i,c.alloc(1),e],s))}(m,r,l);else{if(3!==d)throw new Error("unknown padding");if((p=new h(r)).cmp(m.modulus)>=0)throw new Error("data too long for modulus")}return l?f(p,m):u(p,m)}},function(t,e){},function(t,e,r){var i=r(65),n=r(194),o=r(195),s=r(111),a=r(101),h=r(43),u=r(196),f=r(66).Buffer;t.exports=function t(e,r,c){var l;l=e.padding?e.padding:c?1:4;var d,p=i(e),m=p.modulus.byteLength();if(r.length>m||new s(r).cmp(p.modulus)>=0)throw new Error("decryption error");d=c?u(new s(r),p):a(r,p);var g=f.alloc(m-d.length);if(d=f.concat([g,d],m),4===l)return function v(t,e){var r=t.modulus.byteLength(),i=h("sha1").update(f.alloc(0)).digest(),s=i.length;if(0!==e[0])throw new Error("decryption error");var a=e.slice(1,s+1),u=e.slice(s+1),c=o(a,n(u,s)),l=o(u,n(c,r-s-1));if(function d(t,e){t=f.from(t),e=f.from(e);var r=0,i=t.length;t.length!==e.length&&(r++,i=Math.min(t.length,e.length));var n=-1;for(;++n<i;)r+=t[n]^e[n];return r}(i,l.slice(0,s)))throw new Error("decryption error");var p=s;for(;0===l[p];)p++;if(1!==l[p++])throw new Error("decryption error");return l.slice(p)}(p,d);if(1===l)return function b(t,e,r){var i=e.slice(0,2),n=2,o=0;for(;0!==e[n++];)if(n>=e.length){o++;break}var s=e.slice(2,n-1);("0002"!==i.toString("hex")&&!r||"0001"!==i.toString("hex")&&r)&&o++;s.length<8&&o++;if(o)throw new Error("decryption error");return e.slice(n)}(0,d,c);if(3===l)return d;throw new Error("unknown padding")}},function(t,e,r){"use strict";(function(t,i){function n(){throw new Error("secure random number generation not supported by this browser\nuse chrome, FireFox or Internet Explorer 11")}var o=r(2),s=r(31),a=o.Buffer,h=o.kMaxLength,u=t.crypto||t.msCrypto,f=Math.pow(2,32)-1;function c(t,e){if("number"!=typeof t||t!=t)throw new TypeError("offset must be a number");if(t>f||t<0)throw new TypeError("offset must be a uint32");if(t>h||t>e)throw new RangeError("offset out of range")}function l(t,e,r){if("number"!=typeof t||t!=t)throw new TypeError("size must be a number");if(t>f||t<0)throw new TypeError("size must be a uint32");if(t+e>r||t>h)throw new RangeError("buffer too small")}function d(t,e,r,n){if(i.browser){var o=t.buffer,a=new Uint8Array(o,e,r);return u.getRandomValues(a),n?void i.nextTick((function(){n(null,t)})):t}if(!n)return s(r).copy(t,e),t;s(r,(function(r,i){if(r)return n(r);i.copy(t,e),n(null,t)}))}u&&u.getRandomValues||!i.browser?(e.randomFill=function p(e,r,i,n){if(!(a.isBuffer(e)||e instanceof t.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');if("function"==typeof r)n=r,r=0,i=e.length;else if("function"==typeof i)n=i,i=e.length-r;else if("function"!=typeof n)throw new TypeError('"cb" argument must be a function');return c(r,e.length),l(i,r,e.length),d(e,r,i,n)},e.randomFillSync=function m(e,r,i){void 0===r&&(r=0);if(!(a.isBuffer(e)||e instanceof t.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');c(r,e.length),void 0===i&&(i=e.length-r);return l(i,r,e.length),d(e,r,i)}):(e.randomFill=n,e.randomFillSync=n)}).call(this,r(5),r(4))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function i(t){var e=t.jws,r=t.KeyUtil,i=t.X509,o=t.crypto,s=t.hextob64u,a=t.b64tohex,h=t.AllowedSigningAlgs;return function(){function t(){!function e(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}(this,t)}return t.parseJwt=function t(r){n.Log.debug("JoseUtil.parseJwt");try{var i=e.JWS.parse(r);return{header:i.headerObj,payload:i.payloadObj}}catch(t){n.Log.error(t)}},t.validateJwt=function e(o,s,h,u,f,c,l){n.Log.debug("JoseUtil.validateJwt");try{if("RSA"===s.kty)if(s.e&&s.n)s=r.getKey(s);else{if(!s.x5c||!s.x5c.length)return n.Log.error("JoseUtil.validateJwt: RSA key missing key material",s),Promise.reject(new Error("RSA key missing key material"));var d=a(s.x5c[0]);s=i.getPublicKeyFromCertHex(d)}else{if("EC"!==s.kty)return n.Log.error("JoseUtil.validateJwt: Unsupported key type",s&&s.kty),Promise.reject(new Error(s.kty));if(!(s.crv&&s.x&&s.y))return n.Log.error("JoseUtil.validateJwt: EC key missing key material",s),Promise.reject(new Error("EC key missing key material"));s=r.getKey(s)}return t._validateJwt(o,s,h,u,f,c,l)}catch(t){return n.Log.error(t&&t.message||t),Promise.reject("JWT validation failed")}},t.validateJwtAttributes=function e(r,i,o,s,a,h){s||(s=0),a||(a=parseInt(Date.now()/1e3));var u=t.parseJwt(r).payload;if(!u.iss)return n.Log.error("JoseUtil._validateJwt: issuer was not provided"),Promise.reject(new Error("issuer was not provided"));if(u.iss!==i)return n.Log.error("JoseUtil._validateJwt: Invalid issuer in token",u.iss),Promise.reject(new Error("Invalid issuer in token: "+u.iss));if(!u.aud)return n.Log.error("JoseUtil._validateJwt: aud was not provided"),Promise.reject(new Error("aud was not provided"));if(!(u.aud===o||Array.isArray(u.aud)&&u.aud.indexOf(o)>=0))return n.Log.error("JoseUtil._validateJwt: Invalid audience in token",u.aud),Promise.reject(new Error("Invalid audience in token: "+u.aud));if(u.azp&&u.azp!==o)return n.Log.error("JoseUtil._validateJwt: Invalid azp in token",u.azp),Promise.reject(new Error("Invalid azp in token: "+u.azp));if(!h){var f=a+s,c=a-s;if(!u.iat)return n.Log.error("JoseUtil._validateJwt: iat was not provided"),Promise.reject(new Error("iat was not provided"));if(f<u.iat)return n.Log.error("JoseUtil._validateJwt: iat is in the future",u.iat),Promise.reject(new Error("iat is in the future: "+u.iat));if(u.nbf&&f<u.nbf)return n.Log.error("JoseUtil._validateJwt: nbf is in the future",u.nbf),Promise.reject(new Error("nbf is in the future: "+u.nbf));if(!u.exp)return n.Log.error("JoseUtil._validateJwt: exp was not provided"),Promise.reject(new Error("exp was not provided"));if(u.exp<c)return n.Log.error("JoseUtil._validateJwt: exp is in the past",u.exp),Promise.reject(new Error("exp is in the past:"+u.exp))}return Promise.resolve(u)},t._validateJwt=function r(i,o,s,a,u,f,c){return t.validateJwtAttributes(i,s,a,u,f,c).then((function(t){try{return e.JWS.verify(i,o,h)?t:(n.Log.error("JoseUtil._validateJwt: signature validation failed"),Promise.reject(new Error("signature validation failed")))}catch(t){return n.Log.error(t&&t.message||t),Promise.reject(new Error("signature validation failed"))}}))},t.hashString=function t(e,r){try{return o.Util.hashString(e,r)}catch(t){n.Log.error(t)}},t.hexToBase64Url=function t(e){try{return s(e)}catch(t){n.Log.error(t)}},t}()};var n=r(0);t.exports=e.default},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SigninResponse=void 0;var i=function(){function t(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,r,i){return r&&t(e.prototype,r),i&&t(e,i),e}}(),n=r(48);function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}e.SigninResponse=function(){function t(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"#";o(this,t);var i=n.UrlUtility.parseUrlFragment(e,r);this.error=i.error,this.error_description=i.error_description,this.error_uri=i.error_uri,this.code=i.code,this.state=i.state,this.id_token=i.id_token,this.session_state=i.session_state,this.access_token=i.access_token,this.token_type=i.token_type,this.scope=i.scope,this.profile=void 0,this.expires_in=i.expires_in}return i(t,[{key:"expires_in",get:function t(){if(this.expires_at){var e=parseInt(Date.now()/1e3);return this.expires_at-e}},set:function t(e){var r=parseInt(e);if("number"==typeof r&&r>0){var i=parseInt(Date.now()/1e3);this.expires_at=i+r}}},{key:"expired",get:function t(){var e=this.expires_in;if(void 0!==e)return e<=0}},{key:"scopes",get:function t(){return(this.scope||"").split(" ")}},{key:"isOpenIdConnect",get:function t(){return this.scopes.indexOf("openid")>=0||!!this.id_token}}]),t}()},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SignoutRequest=void 0;var i=r(0),n=r(48),o=r(113);e.SignoutRequest=function t(e){var r=e.url,s=e.id_token_hint,a=e.post_logout_redirect_uri,h=e.data,u=e.extraQueryParams,f=e.request_type;if(function c(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),!r)throw i.Log.error("SignoutRequest.ctor: No url passed"),new Error("url");for(var l in s&&(r=n.UrlUtility.addQueryParam(r,"id_token_hint",s)),a&&(r=n.UrlUtility.addQueryParam(r,"post_logout_redirect_uri",a),h&&(this.state=new o.State({data:h,request_type:f}),r=n.UrlUtility.addQueryParam(r,"state",this.state.id))),u)r=n.UrlUtility.addQueryParam(r,l,u[l]);this.url=r}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SignoutResponse=void 0;var i=r(48);e.SignoutResponse=function t(e){!function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t);var n=i.UrlUtility.parseUrlFragment(e,"?");this.error=n.error,this.error_description=n.error_description,this.error_uri=n.error_uri,this.state=n.state}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.InMemoryWebStorage=void 0;var i=function(){function t(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,r,i){return r&&t(e.prototype,r),i&&t(e,i),e}}(),n=r(0);e.InMemoryWebStorage=function(){function t(){!function e(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}(this,t),this._data={}}return t.prototype.getItem=function t(e){return n.Log.debug("InMemoryWebStorage.getItem",e),this._data[e]},t.prototype.setItem=function t(e,r){n.Log.debug("InMemoryWebStorage.setItem",e),this._data[e]=r},t.prototype.removeItem=function t(e){n.Log.debug("InMemoryWebStorage.removeItem",e),delete this._data[e]},t.prototype.key=function t(e){return Object.getOwnPropertyNames(this._data)[e]},i(t,[{key:"length",get:function t(){return Object.getOwnPropertyNames(this._data).length}}]),t}()},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.UserManager=void 0;var i=function(){function t(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,r,i){return r&&t(e.prototype,r),i&&t(e,i),e}}(),n=r(0),o=r(142),s=r(384),a=r(201),h=r(390),u=r(392),f=r(204),c=r(112),l=r(206),d=r(197),p=r(60);function m(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function g(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}e.UserManager=function(t){function e(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:u.SilentRenewService,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:f.SessionMonitor,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:l.TokenRevocationClient,c=arguments.length>4&&void 0!==arguments[4]?arguments[4]:d.TokenClient,v=arguments.length>5&&void 0!==arguments[5]?arguments[5]:p.JoseUtil;m(this,e),r instanceof s.UserManagerSettings||(r=new s.UserManagerSettings(r));var b=g(this,t.call(this,r));return b._events=new h.UserManagerEvents(r),b._silentRenewService=new i(b),b.settings.automaticSilentRenew&&(n.Log.debug("UserManager.ctor: automaticSilentRenew is configured, setting up silent renew"),b.startSilentRenew()),b.settings.monitorSession&&(n.Log.debug("UserManager.ctor: monitorSession is configured, setting up session monitor"),b._sessionMonitor=new o(b)),b._tokenRevocationClient=new a(b._settings),b._tokenClient=new c(b._settings),b._joseUtil=v,b}return function r(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),e.prototype.getUser=function t(){var e=this;return this._loadUser().then((function(t){return t?(n.Log.info("UserManager.getUser: user loaded"),e._events.load(t,!1),t):(n.Log.info("UserManager.getUser: user not found in storage"),null)}))},e.prototype.removeUser=function t(){var e=this;return this.storeUser(null).then((function(){n.Log.info("UserManager.removeUser: user removed from storage"),e._events.unload()}))},e.prototype.signinRedirect=function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(e=Object.assign({},e)).request_type="si:r";var r={useReplaceToNavigate:e.useReplaceToNavigate};return this._signinStart(e,this._redirectNavigator,r).then((function(){n.Log.info("UserManager.signinRedirect: successful")}))},e.prototype.signinRedirectCallback=function t(e){return this._signinEnd(e||this._redirectNavigator.url).then((function(t){return t.profile&&t.profile.sub?n.Log.info("UserManager.signinRedirectCallback: successful, signed in sub: ",t.profile.sub):n.Log.info("UserManager.signinRedirectCallback: no sub"),t}))},e.prototype.signinPopup=function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(e=Object.assign({},e)).request_type="si:p";var r=e.redirect_uri||this.settings.popup_redirect_uri||this.settings.redirect_uri;return r?(e.redirect_uri=r,e.display="popup",this._signin(e,this._popupNavigator,{startUrl:r,popupWindowFeatures:e.popupWindowFeatures||this.settings.popupWindowFeatures,popupWindowTarget:e.popupWindowTarget||this.settings.popupWindowTarget}).then((function(t){return t&&(t.profile&&t.profile.sub?n.Log.info("UserManager.signinPopup: signinPopup successful, signed in sub: ",t.profile.sub):n.Log.info("UserManager.signinPopup: no sub")),t}))):(n.Log.error("UserManager.signinPopup: No popup_redirect_uri or redirect_uri configured"),Promise.reject(new Error("No popup_redirect_uri or redirect_uri configured")))},e.prototype.signinPopupCallback=function t(e){return this._signinCallback(e,this._popupNavigator).then((function(t){return t&&(t.profile&&t.profile.sub?n.Log.info("UserManager.signinPopupCallback: successful, signed in sub: ",t.profile.sub):n.Log.info("UserManager.signinPopupCallback: no sub")),t})).catch((function(t){n.Log.error(t.message)}))},e.prototype.signinSilent=function t(){var e=this,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return r=Object.assign({},r),this._loadUser().then((function(t){return t&&t.refresh_token?(r.refresh_token=t.refresh_token,e._useRefreshToken(r)):(r.request_type="si:s",r.id_token_hint=r.id_token_hint||e.settings.includeIdTokenInSilentRenew&&t&&t.id_token,t&&e._settings.validateSubOnSilentRenew&&(n.Log.debug("UserManager.signinSilent, subject prior to silent renew: ",t.profile.sub),r.current_sub=t.profile.sub),e._signinSilentIframe(r))}))},e.prototype._useRefreshToken=function t(){var e=this,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this._tokenClient.exchangeRefreshToken(r).then((function(t){return t?t.access_token?e._loadUser().then((function(r){if(r){var i=Promise.resolve();return t.id_token&&(i=e._validateIdTokenFromTokenRefreshToken(r.profile,t.id_token)),i.then((function(){return n.Log.debug("UserManager._useRefreshToken: refresh token response success"),r.id_token=t.id_token||r.id_token,r.access_token=t.access_token,r.refresh_token=t.refresh_token||r.refresh_token,r.expires_in=t.expires_in,e.storeUser(r).then((function(){return e._events.load(r),r}))}))}return null})):(n.Log.error("UserManager._useRefreshToken: No access token returned from token endpoint"),Promise.reject("No access token returned from token endpoint")):(n.Log.error("UserManager._useRefreshToken: No response returned from token endpoint"),Promise.reject("No response returned from token endpoint"))}))},e.prototype._validateIdTokenFromTokenRefreshToken=function t(e,r){var i=this;return this._metadataService.getIssuer().then((function(t){return i.settings.getEpochTime().then((function(o){return i._joseUtil.validateJwtAttributes(r,t,i._settings.client_id,i._settings.clockSkew,o).then((function(t){return t?t.sub!==e.sub?(n.Log.error("UserManager._validateIdTokenFromTokenRefreshToken: sub in id_token does not match current sub"),Promise.reject(new Error("sub in id_token does not match current sub"))):t.auth_time&&t.auth_time!==e.auth_time?(n.Log.error("UserManager._validateIdTokenFromTokenRefreshToken: auth_time in id_token does not match original auth_time"),Promise.reject(new Error("auth_time in id_token does not match original auth_time"))):t.azp&&t.azp!==e.azp?(n.Log.error("UserManager._validateIdTokenFromTokenRefreshToken: azp in id_token does not match original azp"),Promise.reject(new Error("azp in id_token does not match original azp"))):!t.azp&&e.azp?(n.Log.error("UserManager._validateIdTokenFromTokenRefreshToken: azp not in id_token, but present in original id_token"),Promise.reject(new Error("azp not in id_token, but present in original id_token"))):void 0:(n.Log.error("UserManager._validateIdTokenFromTokenRefreshToken: Failed to validate id_token"),Promise.reject(new Error("Failed to validate id_token")))}))}))}))},e.prototype._signinSilentIframe=function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=e.redirect_uri||this.settings.silent_redirect_uri||this.settings.redirect_uri;return r?(e.redirect_uri=r,e.prompt=e.prompt||"none",this._signin(e,this._iframeNavigator,{startUrl:r,silentRequestTimeout:e.silentRequestTimeout||this.settings.silentRequestTimeout}).then((function(t){return t&&(t.profile&&t.profile.sub?n.Log.info("UserManager.signinSilent: successful, signed in sub: ",t.profile.sub):n.Log.info("UserManager.signinSilent: no sub")),t}))):(n.Log.error("UserManager.signinSilent: No silent_redirect_uri configured"),Promise.reject(new Error("No silent_redirect_uri configured")))},e.prototype.signinSilentCallback=function t(e){return this._signinCallback(e,this._iframeNavigator).then((function(t){return t&&(t.profile&&t.profile.sub?n.Log.info("UserManager.signinSilentCallback: successful, signed in sub: ",t.profile.sub):n.Log.info("UserManager.signinSilentCallback: no sub")),t}))},e.prototype.signinCallback=function t(e){var r=this;return this.readSigninResponseState(e).then((function(t){var i=t.state;t.response;return"si:r"===i.request_type?r.signinRedirectCallback(e):"si:p"===i.request_type?r.signinPopupCallback(e):"si:s"===i.request_type?r.signinSilentCallback(e):Promise.reject(new Error("invalid response_type in state"))}))},e.prototype.signoutCallback=function t(e,r){var i=this;return this.readSignoutResponseState(e).then((function(t){var n=t.state,o=t.response;return n?"so:r"===n.request_type?i.signoutRedirectCallback(e):"so:p"===n.request_type?i.signoutPopupCallback(e,r):Promise.reject(new Error("invalid response_type in state")):o}))},e.prototype.querySessionStatus=function t(){var e=this,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(r=Object.assign({},r)).request_type="si:s";var i=r.redirect_uri||this.settings.silent_redirect_uri||this.settings.redirect_uri;return i?(r.redirect_uri=i,r.prompt="none",r.response_type=r.response_type||this.settings.query_status_response_type,r.scope=r.scope||"openid",r.skipUserInfo=!0,this._signinStart(r,this._iframeNavigator,{startUrl:i,silentRequestTimeout:r.silentRequestTimeout||this.settings.silentRequestTimeout}).then((function(t){return e.processSigninResponse(t.url).then((function(t){if(n.Log.debug("UserManager.querySessionStatus: got signin response"),t.session_state&&t.profile.sub)return n.Log.info("UserManager.querySessionStatus: querySessionStatus success for sub: ",t.profile.sub),{session_state:t.session_state,sub:t.profile.sub,sid:t.profile.sid};n.Log.info("querySessionStatus successful, user not authenticated")})).catch((function(t){if(t.session_state&&e.settings.monitorAnonymousSession&&("login_required"==t.message||"consent_required"==t.message||"interaction_required"==t.message||"account_selection_required"==t.message))return n.Log.info("UserManager.querySessionStatus: querySessionStatus success for anonymous user"),{session_state:t.session_state};throw t}))}))):(n.Log.error("UserManager.querySessionStatus: No silent_redirect_uri configured"),Promise.reject(new Error("No silent_redirect_uri configured")))},e.prototype._signin=function t(e,r){var i=this,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this._signinStart(e,r,n).then((function(t){return i._signinEnd(t.url,e)}))},e.prototype._signinStart=function t(e,r){var i=this,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return r.prepare(o).then((function(t){return n.Log.debug("UserManager._signinStart: got navigator window handle"),i.createSigninRequest(e).then((function(e){return n.Log.debug("UserManager._signinStart: got signin request"),o.url=e.url,o.id=e.state.id,t.navigate(o)})).catch((function(e){throw t.close&&(n.Log.debug("UserManager._signinStart: Error after preparing navigator, closing navigator window"),t.close()),e}))}))},e.prototype._signinEnd=function t(e){var r=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.processSigninResponse(e).then((function(t){n.Log.debug("UserManager._signinEnd: got signin response");var e=new a.User(t);if(i.current_sub){if(i.current_sub!==e.profile.sub)return n.Log.debug("UserManager._signinEnd: current user does not match user returned from signin. sub from signin: ",e.profile.sub),Promise.reject(new Error("login_required"));n.Log.debug("UserManager._signinEnd: current user matches user returned from signin")}return r.storeUser(e).then((function(){return n.Log.debug("UserManager._signinEnd: user stored"),r._events.load(e),e}))}))},e.prototype._signinCallback=function t(e,r){n.Log.debug("UserManager._signinCallback");var i="query"===this._settings.response_mode||!this._settings.response_mode&&c.SigninRequest.isCode(this._settings.response_type)?"?":"#";return r.callback(e,void 0,i)},e.prototype.signoutRedirect=function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(e=Object.assign({},e)).request_type="so:r";var r=e.post_logout_redirect_uri||this.settings.post_logout_redirect_uri;r&&(e.post_logout_redirect_uri=r);var i={useReplaceToNavigate:e.useReplaceToNavigate};return this._signoutStart(e,this._redirectNavigator,i).then((function(){n.Log.info("UserManager.signoutRedirect: successful")}))},e.prototype.signoutRedirectCallback=function t(e){return this._signoutEnd(e||this._redirectNavigator.url).then((function(t){return n.Log.info("UserManager.signoutRedirectCallback: successful"),t}))},e.prototype.signoutPopup=function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(e=Object.assign({},e)).request_type="so:p";var r=e.post_logout_redirect_uri||this.settings.popup_post_logout_redirect_uri||this.settings.post_logout_redirect_uri;return e.post_logout_redirect_uri=r,e.display="popup",e.post_logout_redirect_uri&&(e.state=e.state||{}),this._signout(e,this._popupNavigator,{startUrl:r,popupWindowFeatures:e.popupWindowFeatures||this.settings.popupWindowFeatures,popupWindowTarget:e.popupWindowTarget||this.settings.popupWindowTarget}).then((function(){n.Log.info("UserManager.signoutPopup: successful")}))},e.prototype.signoutPopupCallback=function t(e,r){void 0===r&&"boolean"==typeof e&&(r=e,e=null);return this._popupNavigator.callback(e,r,"?").then((function(){n.Log.info("UserManager.signoutPopupCallback: successful")}))},e.prototype._signout=function t(e,r){var i=this,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this._signoutStart(e,r,n).then((function(t){return i._signoutEnd(t.url)}))},e.prototype._signoutStart=function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=this,i=arguments[1],o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return i.prepare(o).then((function(t){return n.Log.debug("UserManager._signoutStart: got navigator window handle"),r._loadUser().then((function(i){return n.Log.debug("UserManager._signoutStart: loaded current user from storage"),(r._settings.revokeAccessTokenOnSignout?r._revokeInternal(i):Promise.resolve()).then((function(){var s=e.id_token_hint||i&&i.id_token;return s&&(n.Log.debug("UserManager._signoutStart: Setting id_token into signout request"),e.id_token_hint=s),r.removeUser().then((function(){return n.Log.debug("UserManager._signoutStart: user removed, creating signout request"),r.createSignoutRequest(e).then((function(e){return n.Log.debug("UserManager._signoutStart: got signout request"),o.url=e.url,e.state&&(o.id=e.state.id),t.navigate(o)}))}))}))})).catch((function(e){throw t.close&&(n.Log.debug("UserManager._signoutStart: Error after preparing navigator, closing navigator window"),t.close()),e}))}))},e.prototype._signoutEnd=function t(e){return this.processSignoutResponse(e).then((function(t){return n.Log.debug("UserManager._signoutEnd: got signout response"),t}))},e.prototype.revokeAccessToken=function t(){var e=this;return this._loadUser().then((function(t){return e._revokeInternal(t,!0).then((function(r){if(r)return n.Log.debug("UserManager.revokeAccessToken: removing token properties from user and re-storing"),t.access_token=null,t.refresh_token=null,t.expires_at=null,t.token_type=null,e.storeUser(t).then((function(){n.Log.debug("UserManager.revokeAccessToken: user stored"),e._events.load(t)}))}))})).then((function(){n.Log.info("UserManager.revokeAccessToken: access token revoked successfully")}))},e.prototype._revokeInternal=function t(e,r){var i=this;if(e){var o=e.access_token,s=e.refresh_token;return this._revokeAccessTokenInternal(o,r).then((function(t){return i._revokeRefreshTokenInternal(s,r).then((function(e){return t||e||n.Log.debug("UserManager.revokeAccessToken: no need to revoke due to no token(s), or JWT format"),t||e}))}))}return Promise.resolve(!1)},e.prototype._revokeAccessTokenInternal=function t(e,r){return!e||e.indexOf(".")>=0?Promise.resolve(!1):this._tokenRevocationClient.revoke(e,r).then((function(){return!0}))},e.prototype._revokeRefreshTokenInternal=function t(e,r){return e?this._tokenRevocationClient.revoke(e,r,"refresh_token").then((function(){return!0})):Promise.resolve(!1)},e.prototype.startSilentRenew=function t(){this._silentRenewService.start()},e.prototype.stopSilentRenew=function t(){this._silentRenewService.stop()},e.prototype._loadUser=function t(){return this._userStore.get(this._userStoreKey).then((function(t){return t?(n.Log.debug("UserManager._loadUser: user storageString loaded"),a.User.fromStorageString(t)):(n.Log.debug("UserManager._loadUser: no user storageString"),null)}))},e.prototype.storeUser=function t(e){if(e){n.Log.debug("UserManager.storeUser: storing user");var r=e.toStorageString();return this._userStore.set(this._userStoreKey,r)}return n.Log.debug("storeUser.storeUser: removing user"),this._userStore.remove(this._userStoreKey)},i(e,[{key:"_redirectNavigator",get:function t(){return this.settings.redirectNavigator}},{key:"_popupNavigator",get:function t(){return this.settings.popupNavigator}},{key:"_iframeNavigator",get:function t(){return this.settings.iframeNavigator}},{key:"_userStore",get:function t(){return this.settings.userStore}},{key:"events",get:function t(){return this._events}},{key:"_userStoreKey",get:function t(){return"user:"+this.settings.authority+":"+this.settings.client_id}}]),e}(o.OidcClient)},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.UserManagerSettings=void 0;var i=function(){function t(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,r,i){return r&&t(e.prototype,r),i&&t(e,i),e}}(),n=(r(0),r(85)),o=r(385),s=r(386),a=r(388),h=r(86),u=r(19),f=r(112);function c(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function l(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}e.UserManagerSettings=function(t){function e(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=r.popup_redirect_uri,n=r.popup_post_logout_redirect_uri,d=r.popupWindowFeatures,p=r.popupWindowTarget,m=r.silent_redirect_uri,g=r.silentRequestTimeout,v=r.automaticSilentRenew,b=void 0!==v&&v,y=r.validateSubOnSilentRenew,w=void 0!==y&&y,_=r.includeIdTokenInSilentRenew,M=void 0===_||_,S=r.monitorSession,k=void 0===S||S,E=r.monitorAnonymousSession,R=void 0!==E&&E,A=r.checkSessionInterval,x=void 0===A?2e3:A,T=r.stopCheckSessionOnError,P=void 0===T||T,I=r.query_status_response_type,L=r.revokeAccessTokenOnSignout,O=void 0!==L&&L,B=r.accessTokenExpiringNotificationTime,j=void 0===B?60:B,C=r.redirectNavigator,U=void 0===C?new o.RedirectNavigator:C,N=r.popupNavigator,q=void 0===N?new s.PopupNavigator:N,D=r.iframeNavigator,z=void 0===D?new a.IFrameNavigator:D,F=r.userStore,W=void 0===F?new h.WebStorageStateStore({store:u.Global.sessionStorage}):F;c(this,e);var H=l(this,t.call(this,arguments[0]));return H._popup_redirect_uri=i,H._popup_post_logout_redirect_uri=n,H._popupWindowFeatures=d,H._popupWindowTarget=p,H._silent_redirect_uri=m,H._silentRequestTimeout=g,H._automaticSilentRenew=b,H._validateSubOnSilentRenew=w,H._includeIdTokenInSilentRenew=M,H._accessTokenExpiringNotificationTime=j,H._monitorSession=k,H._monitorAnonymousSession=R,H._checkSessionInterval=x,H._stopCheckSessionOnError=P,I?H._query_status_response_type=I:arguments[0]&&arguments[0].response_type?H._query_status_response_type=f.SigninRequest.isOidc(arguments[0].response_type)?"id_token":"code":H._query_status_response_type="id_token",H._revokeAccessTokenOnSignout=O,H._redirectNavigator=U,H._popupNavigator=q,H._iframeNavigator=z,H._userStore=W,H}return function r(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),i(e,[{key:"popup_redirect_uri",get:function t(){return this._popup_redirect_uri}},{key:"popup_post_logout_redirect_uri",get:function t(){return this._popup_post_logout_redirect_uri}},{key:"popupWindowFeatures",get:function t(){return this._popupWindowFeatures}},{key:"popupWindowTarget",get:function t(){return this._popupWindowTarget}},{key:"silent_redirect_uri",get:function t(){return this._silent_redirect_uri}},{key:"silentRequestTimeout",get:function t(){return this._silentRequestTimeout}},{key:"automaticSilentRenew",get:function t(){return this._automaticSilentRenew}},{key:"validateSubOnSilentRenew",get:function t(){return this._validateSubOnSilentRenew}},{key:"includeIdTokenInSilentRenew",get:function t(){return this._includeIdTokenInSilentRenew}},{key:"accessTokenExpiringNotificationTime",get:function t(){return this._accessTokenExpiringNotificationTime}},{key:"monitorSession",get:function t(){return this._monitorSession}},{key:"monitorAnonymousSession",get:function t(){return this._monitorAnonymousSession}},{key:"checkSessionInterval",get:function t(){return this._checkSessionInterval}},{key:"stopCheckSessionOnError",get:function t(){return this._stopCheckSessionOnError}},{key:"query_status_response_type",get:function t(){return this._query_status_response_type}},{key:"revokeAccessTokenOnSignout",get:function t(){return this._revokeAccessTokenOnSignout}},{key:"redirectNavigator",get:function t(){return this._redirectNavigator}},{key:"popupNavigator",get:function t(){return this._popupNavigator}},{key:"iframeNavigator",get:function t(){return this._iframeNavigator}},{key:"userStore",get:function t(){return this._userStore}}]),e}(n.OidcClientSettings)},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.RedirectNavigator=void 0;var i=function(){function t(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,r,i){return r&&t(e.prototype,r),i&&t(e,i),e}}(),n=r(0);e.RedirectNavigator=function(){function t(){!function e(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}(this,t)}return t.prototype.prepare=function t(){return Promise.resolve(this)},t.prototype.navigate=function t(e){return e&&e.url?(e.useReplaceToNavigate?window.location.replace(e.url):window.location=e.url,Promise.resolve()):(n.Log.error("RedirectNavigator.navigate: No url provided"),Promise.reject(new Error("No url provided")))},i(t,[{key:"url",get:function t(){return window.location.href}}]),t}()},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.PopupNavigator=void 0;var i=r(0),n=r(387);e.PopupNavigator=function(){function t(){!function e(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}(this,t)}return t.prototype.prepare=function t(e){var r=new n.PopupWindow(e);return Promise.resolve(r)},t.prototype.callback=function t(e,r,o){i.Log.debug("PopupNavigator.callback");try{return n.PopupWindow.notifyOpener(e,r,o),Promise.resolve()}catch(t){return Promise.reject(t)}},t}()},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.PopupWindow=void 0;var i=function(){function t(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,r,i){return r&&t(e.prototype,r),i&&t(e,i),e}}(),n=r(0),o=r(48);e.PopupWindow=function(){function t(e){var r=this;!function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this._promise=new Promise((function(t,e){r._resolve=t,r._reject=e}));var o=e.popupWindowTarget||"_blank",s=e.popupWindowFeatures||"location=no,toolbar=no,width=500,height=500,left=100,top=100;";this._popup=window.open("",o,s),this._popup&&(n.Log.debug("PopupWindow.ctor: popup successfully created"),this._checkForPopupClosedTimer=window.setInterval(this._checkForPopupClosed.bind(this),500))}return t.prototype.navigate=function t(e){return this._popup?e&&e.url?(n.Log.debug("PopupWindow.navigate: Setting URL in popup"),this._id=e.id,this._id&&(window["popupCallback_"+e.id]=this._callback.bind(this)),this._popup.focus(),this._popup.window.location=e.url):(this._error("PopupWindow.navigate: no url provided"),this._error("No url provided")):this._error("PopupWindow.navigate: Error opening popup window"),this.promise},t.prototype._success=function t(e){n.Log.debug("PopupWindow.callback: Successful response from popup window"),this._cleanup(),this._resolve(e)},t.prototype._error=function t(e){n.Log.error("PopupWindow.error: ",e),this._cleanup(),this._reject(new Error(e))},t.prototype.close=function t(){this._cleanup(!1)},t.prototype._cleanup=function t(e){n.Log.debug("PopupWindow.cleanup"),window.clearInterval(this._checkForPopupClosedTimer),this._checkForPopupClosedTimer=null,delete window["popupCallback_"+this._id],this._popup&&!e&&this._popup.close(),this._popup=null},t.prototype._checkForPopupClosed=function t(){this._popup&&!this._popup.closed||this._error("Popup window closed")},t.prototype._callback=function t(e,r){this._cleanup(r),e?(n.Log.debug("PopupWindow.callback success"),this._success({url:e})):(n.Log.debug("PopupWindow.callback: Invalid response from popup"),this._error("Invalid response from popup"))},t.notifyOpener=function t(e,r,i){if(window.opener){if(e=e||window.location.href){var s=o.UrlUtility.parseUrlFragment(e,i);if(s.state){var a="popupCallback_"+s.state,h=window.opener[a];h?(n.Log.debug("PopupWindow.notifyOpener: passing url message to opener"),h(e,r)):n.Log.warn("PopupWindow.notifyOpener: no matching callback found on opener")}else n.Log.warn("PopupWindow.notifyOpener: no state found in response url")}}else n.Log.warn("PopupWindow.notifyOpener: no window.opener. Can't complete notification.")},i(t,[{key:"promise",get:function t(){return this._promise}}]),t}()},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.IFrameNavigator=void 0;var i=r(0),n=r(389);e.IFrameNavigator=function(){function t(){!function e(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}(this,t)}return t.prototype.prepare=function t(e){var r=new n.IFrameWindow(e);return Promise.resolve(r)},t.prototype.callback=function t(e){i.Log.debug("IFrameNavigator.callback");try{return n.IFrameWindow.notifyParent(e),Promise.resolve()}catch(t){return Promise.reject(t)}},t}()},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.IFrameWindow=void 0;var i=function(){function t(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,r,i){return r&&t(e.prototype,r),i&&t(e,i),e}}(),n=r(0);e.IFrameWindow=function(){function t(e){var r=this;!function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this._promise=new Promise((function(t,e){r._resolve=t,r._reject=e})),this._boundMessageEvent=this._message.bind(this),window.addEventListener("message",this._boundMessageEvent,!1),this._frame=window.document.createElement("iframe"),this._frame.style.visibility="hidden",this._frame.style.position="absolute",this._frame.width=0,this._frame.height=0,window.document.body.appendChild(this._frame)}return t.prototype.navigate=function t(e){if(e&&e.url){var r=e.silentRequestTimeout||1e4;n.Log.debug("IFrameWindow.navigate: Using timeout of:",r),this._timer=window.setTimeout(this._timeout.bind(this),r),this._frame.src=e.url}else this._error("No url provided");return this.promise},t.prototype._success=function t(e){this._cleanup(),n.Log.debug("IFrameWindow: Successful response from frame window"),this._resolve(e)},t.prototype._error=function t(e){this._cleanup(),n.Log.error(e),this._reject(new Error(e))},t.prototype.close=function t(){this._cleanup()},t.prototype._cleanup=function t(){this._frame&&(n.Log.debug("IFrameWindow: cleanup"),window.removeEventListener("message",this._boundMessageEvent,!1),window.clearTimeout(this._timer),window.document.body.removeChild(this._frame),this._timer=null,this._frame=null,this._boundMessageEvent=null)},t.prototype._timeout=function t(){n.Log.debug("IFrameWindow.timeout"),this._error("Frame window timed out")},t.prototype._message=function t(e){if(n.Log.debug("IFrameWindow.message"),this._timer&&e.origin===this._origin&&e.source===this._frame.contentWindow&&"string"==typeof e.data&&(e.data.startsWith("http://")||e.data.startsWith("https://"))){var r=e.data;r?this._success({url:r}):this._error("Invalid response from frame")}},t.notifyParent=function t(e){n.Log.debug("IFrameWindow.notifyParent"),(e=e||window.location.href)&&(n.Log.debug("IFrameWindow.notifyParent: posting url message to parent"),window.parent.postMessage(e,location.protocol+"//"+location.host))},i(t,[{key:"promise",get:function t(){return this._promise}},{key:"_origin",get:function t(){return location.protocol+"//"+location.host}}]),t}()},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.UserManagerEvents=void 0;var i=r(0),n=r(202),o=r(203);e.UserManagerEvents=function(t){function e(r){!function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var n=function s(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,t.call(this,r));return n._userLoaded=new o.Event("User loaded"),n._userUnloaded=new o.Event("User unloaded"),n._silentRenewError=new o.Event("Silent renew error"),n._userSignedIn=new o.Event("User signed in"),n._userSignedOut=new o.Event("User signed out"),n._userSessionChanged=new o.Event("User session changed"),n}return function r(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),e.prototype.load=function e(r){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];i.Log.debug("UserManagerEvents.load"),t.prototype.load.call(this,r),n&&this._userLoaded.raise(r)},e.prototype.unload=function e(){i.Log.debug("UserManagerEvents.unload"),t.prototype.unload.call(this),this._userUnloaded.raise()},e.prototype.addUserLoaded=function t(e){this._userLoaded.addHandler(e)},e.prototype.removeUserLoaded=function t(e){this._userLoaded.removeHandler(e)},e.prototype.addUserUnloaded=function t(e){this._userUnloaded.addHandler(e)},e.prototype.removeUserUnloaded=function t(e){this._userUnloaded.removeHandler(e)},e.prototype.addSilentRenewError=function t(e){this._silentRenewError.addHandler(e)},e.prototype.removeSilentRenewError=function t(e){this._silentRenewError.removeHandler(e)},e.prototype._raiseSilentRenewError=function t(e){i.Log.debug("UserManagerEvents._raiseSilentRenewError",e.message),this._silentRenewError.raise(e)},e.prototype.addUserSignedIn=function t(e){this._userSignedIn.addHandler(e)},e.prototype.removeUserSignedIn=function t(e){this._userSignedIn.removeHandler(e)},e.prototype._raiseUserSignedIn=function t(){i.Log.debug("UserManagerEvents._raiseUserSignedIn"),this._userSignedIn.raise()},e.prototype.addUserSignedOut=function t(e){this._userSignedOut.addHandler(e)},e.prototype.removeUserSignedOut=function t(e){this._userSignedOut.removeHandler(e)},e.prototype._raiseUserSignedOut=function t(){i.Log.debug("UserManagerEvents._raiseUserSignedOut"),this._userSignedOut.raise()},e.prototype.addUserSessionChanged=function t(e){this._userSessionChanged.addHandler(e)},e.prototype.removeUserSessionChanged=function t(e){this._userSessionChanged.removeHandler(e)},e.prototype._raiseUserSessionChanged=function t(){i.Log.debug("UserManagerEvents._raiseUserSessionChanged"),this._userSessionChanged.raise()},e}(n.AccessTokenEvents)},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Timer=void 0;var i=function(){function t(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,r,i){return r&&t(e.prototype,r),i&&t(e,i),e}}(),n=r(0),o=r(19),s=r(203);function a(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function h(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}e.Timer=function(t){function e(r){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o.Global.timer,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;a(this,e);var s=h(this,t.call(this,r));return s._timer=i,s._nowFunc=n||function(){return Date.now()/1e3},s}return function r(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),e.prototype.init=function t(e){e<=0&&(e=1),e=parseInt(e);var r=this.now+e;if(this.expiration===r&&this._timerHandle)n.Log.debug("Timer.init timer "+this._name+" skipping initialization since already initialized for expiration:",this.expiration);else{this.cancel(),n.Log.debug("Timer.init timer "+this._name+" for duration:",e),this._expiration=r;var i=5;e<i&&(i=e),this._timerHandle=this._timer.setInterval(this._callback.bind(this),1e3*i)}},e.prototype.cancel=function t(){this._timerHandle&&(n.Log.debug("Timer.cancel: ",this._name),this._timer.clearInterval(this._timerHandle),this._timerHandle=null)},e.prototype._callback=function e(){var r=this._expiration-this.now;n.Log.debug("Timer.callback; "+this._name+" timer expires in:",r),this._expiration<=this.now&&(this.cancel(),t.prototype.raise.call(this))},i(e,[{key:"now",get:function t(){return parseInt(this._nowFunc())}},{key:"expiration",get:function t(){return this._expiration}}]),e}(s.Event)},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SilentRenewService=void 0;var i=r(0);e.SilentRenewService=function(){function t(e){!function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this._userManager=e}return t.prototype.start=function t(){this._callback||(this._callback=this._tokenExpiring.bind(this),this._userManager.events.addAccessTokenExpiring(this._callback),this._userManager.getUser().then((function(t){})).catch((function(t){i.Log.error("SilentRenewService.start: Error from getUser:",t.message)})))},t.prototype.stop=function t(){this._callback&&(this._userManager.events.removeAccessTokenExpiring(this._callback),delete this._callback)},t.prototype._tokenExpiring=function t(){var e=this;this._userManager.signinSilent().then((function(t){i.Log.debug("SilentRenewService._tokenExpiring: Silent token renewal successful")}),(function(t){i.Log.error("SilentRenewService._tokenExpiring: Error from signinSilent:",t.message),e._userManager.events._raiseSilentRenewError(t)}))},t}()},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.CordovaPopupNavigator=void 0;var i=r(207);e.CordovaPopupNavigator=function(){function t(){!function e(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}(this,t)}return t.prototype.prepare=function t(e){var r=new i.CordovaPopupWindow(e);return Promise.resolve(r)},t}()},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.CordovaIFrameNavigator=void 0;var i=r(207);e.CordovaIFrameNavigator=function(){function t(){!function e(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}(this,t)}return t.prototype.prepare=function t(e){e.popupWindowFeatures="hidden=yes";var r=new i.CordovaPopupWindow(e);return Promise.resolve(r)},t}()},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.Version="1.11.6-beta.1"}]);