oidc-client
Version:
OpenID Connect (OIDC) & OAuth2 client library
1 lines • 819 kB
JavaScript
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=207)}([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){"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,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(116),o=r(12),s=r(117),a=r(125),h=r(220),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(212),u=r(121);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(181);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=0,n=0;t.cmpn(-i)>0||e.cmpn(-n)>0;){var o,s,a,h=t.andln(3)+i&3,u=e.andln(3)+n&3;if(3===h&&(h=-1),3===u&&(u=-1),0==(1&h))o=0;else o=3!==(a=t.andln(7)+i&7)&&5!==a||2!==u?h:-h;if(r[0].push(o),0==(1&u))s=0;else s=3!==(a=e.andln(7)+n&7)&&5!==a||2!==h?u:-u;r[1].push(s),2*i===o+1&&(i=1-i),2*n===s+1&&(n=1-n),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(0);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=r(340).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,j=L>>>13,B=0|a[8],C=8191&B,U=B>>>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(j,F)|0,s=Math.imul(j,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(j,K)|0,s=s+Math.imul(j,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(j,J)|0,s=s+Math.imul(j,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(j,X)|0,s=s+Math.imul(j,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(j,tt)|0,s=s+Math.imul(j,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(j,it)|0,s=s+Math.imul(j,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(j,st)|0,s=s+Math.imul(j,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(j,ut)|0,s=s+Math.imul(j,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(j,lt)|0,s=s+Math.imul(j,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(j,mt)|0))<<13)|0;f=((s=s+Math.imul(j,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 jt=(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)+(jt>>>26)|0,jt&=67108863;var Bt=(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)+(Bt>>>26)|0,Bt&=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]=jt,u[18]=Bt,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;fo