@smartledger/bsv 5.4.1 → 5.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +27 -0
- package/SECURITY.md +12 -3
- package/bsv-anchor.min.js +1 -1
- package/bsv-covenant.min.js +2 -2
- package/bsv-didweb.min.js +1 -1
- package/bsv-gdaf.min.js +2 -2
- package/bsv-ltp.min.js +2 -2
- package/bsv-mnemonic.min.js +1 -1
- package/bsv-shamir.min.js +1 -1
- package/bsv-smartcontract.min.js +2 -2
- package/bsv-statuslist.min.js +5 -5
- package/bsv-vcjwt.min.js +1 -1
- package/bsv.bundle.js +2 -2
- package/bsv.min.js +2 -2
- package/package.json +4 -4
package/bsv-ltp.min.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*
|
|
5
5
|
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
|
|
6
6
|
* @license MIT
|
|
7
|
-
*/function C(e,t){if(e===t)return 0;for(var r=e.length,i=t.length,n=0,o=Math.min(r,i);n<o;++n)if(e[n]!==t[n]){r=e[n],i=t[n];break}return r<i?-1:i<r?1:0}function N(e,t,r,i){if(e===t)return 0!==e||(!r||c(e,t));if(r){if("object"!==o(e))return"number"==typeof e&&l(e)&&l(t);if("object"!==o(t)||null===e||null===t)return!1;if(Object.getPrototypeOf(e)!==Object.getPrototypeOf(t))return!1}else{if(null===e||"object"!==o(e))return(null===t||"object"!==o(t))&&e==t;if(null===t||"object"!==o(t))return!1}var n,s,u,h,f=g(e);if(f!==g(t))return!1;if(Array.isArray(e)){if(e.length!==t.length)return!1;var p=B(e),d=B(t);return p.length===d.length&&L(e,t,r,i,1,p)}if("[object Object]"===f&&(!_(e)&&_(t)||!S(e)&&S(t)))return!1;if(b(e)){if(!b(t)||Date.prototype.getTime.call(e)!==Date.prototype.getTime.call(t))return!1}else if(w(e)){if(!w(t)||(u=e,h=t,!(a?u.source===h.source&&u.flags===h.flags:RegExp.prototype.toString.call(u)===RegExp.prototype.toString.call(h))))return!1}else if(E(e)||e instanceof Error){if(e.message!==t.message||e.name!==t.name)return!1}else{if(v(e)){if(r||!T(e)&&!R(e)){if(!function(e,t){return e.byteLength===t.byteLength&&0===C(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}(e,t))return!1}else if(!function(e,t){if(e.byteLength!==t.byteLength)return!1;for(var r=0;r<e.byteLength;r++)if(e[r]!==t[r])return!1;return!0}(e,t))return!1;var m=B(e),M=B(t);return m.length===M.length&&L(e,t,r,i,0,m)}if(S(e))return!(!S(t)||e.size!==t.size)&&L(e,t,r,i,2);if(_(e))return!(!_(t)||e.size!==t.size)&&L(e,t,r,i,3);if(y(e)){if(s=t,(n=e).byteLength!==s.byteLength||0!==C(new Uint8Array(n),new Uint8Array(s)))return!1}else if(k(e)&&!function(e,t){return O(e)?O(t)&&c(Number.prototype.valueOf.call(e),Number.prototype.valueOf.call(t)):I(e)?I(t)&&String.prototype.valueOf.call(e)===String.prototype.valueOf.call(t):A(e)?A(t)&&Boolean.prototype.valueOf.call(e)===Boolean.prototype.valueOf.call(t):x(e)?x(t)&&BigInt.prototype.valueOf.call(e)===BigInt.prototype.valueOf.call(t):P(t)&&Symbol.prototype.valueOf.call(e)===Symbol.prototype.valueOf.call(t)}(e,t))return!1}return L(e,t,r,i,0)}function D(e,t){return t.filter(function(t){return d(e,t)})}function L(e,t,r,n,a,c){if(5===arguments.length){c=Object.keys(e);var l=Object.keys(t);if(c.length!==l.length)return!1}for(var f=0;f<c.length;f++)if(!p(t,c[f]))return!1;if(r&&5===arguments.length){var g=h(e);if(0!==g.length){var m=0;for(f=0;f<g.length;f++){var y=g[f];if(d(e,y)){if(!d(t,y))return!1;c.push(y),m++}else if(d(t,y))return!1}var v=h(t);if(g.length!==v.length&&D(t,v).length!==m)return!1}else{var b=h(t);if(0!==b.length&&0!==D(t,b).length)return!1}}if(0===c.length&&(0===a||1===a&&0===e.length||0===e.size))return!0;if(void 0===n)n={val1:new Map,val2:new Map,position:0};else{var _=n.val1.get(e);if(void 0!==_){var w=n.val2.get(t);if(void 0!==w)return _===w}n.position++}n.val1.set(e,n.position),n.val2.set(t,n.position);var S=function(e,t,r,n,a,c){var h=0;if(2===c){if(!function(e,t,r,i){for(var n=null,a=s(e),u=0;u<a.length;u++){var c=a[u];if("object"===o(c)&&null!==c)null===n&&(n=new Set),n.add(c);else if(!t.has(c)){if(r)return!1;if(!H(e,t,c))return!1;null===n&&(n=new Set),n.add(c)}}if(null!==n){for(var h=s(t),l=0;l<h.length;l++){var f=h[l];if("object"===o(f)&&null!==f){if(!j(n,f,r,i))return!1}else if(!r&&!e.has(f)&&!j(n,f,r,i))return!1}return 0===n.size}return!0}(e,t,r,a))return!1}else if(3===c){if(!function(e,t,r,n){for(var a=null,s=u(e),c=0;c<s.length;c++){var h=i(s[c],2),l=h[0],f=h[1];if("object"===o(l)&&null!==l)null===a&&(a=new Set),a.add(l);else{var p=t.get(l);if(void 0===p&&!t.has(l)||!N(f,p,r,n)){if(r)return!1;if(!F(e,t,l,f,n))return!1;null===a&&(a=new Set),a.add(l)}}}if(null!==a){for(var d=u(t),g=0;g<d.length;g++){var m=i(d[g],2),y=m[0],v=m[1];if("object"===o(y)&&null!==y){if(!z(a,e,y,v,r,n))return!1}else if(!(r||e.has(y)&&N(e.get(y),v,!1,n)||z(a,e,y,v,!1,n)))return!1}return 0===a.size}return!0}(e,t,r,a))return!1}else if(1===c)for(;h<e.length;h++){if(!p(e,h)){if(p(t,h))return!1;for(var l=Object.keys(e);h<l.length;h++){var f=l[h];if(!p(t,f)||!N(e[f],t[f],r,a))return!1}return l.length===Object.keys(t).length}if(!p(t,h)||!N(e[h],t[h],r,a))return!1}for(h=0;h<n.length;h++){var d=n[h];if(!N(e[d],t[d],r,a))return!1}return!0}(e,t,r,c,n,a);return n.val1.delete(e),n.val2.delete(t),S}function j(e,t,r,i){for(var n=s(e),o=0;o<n.length;o++){var a=n[o];if(N(t,a,r,i))return e.delete(a),!0}return!1}function U(e){switch(o(e)){case"undefined":return null;case"object":return;case"symbol":return!1;case"string":e=+e;case"number":if(l(e))return!1}return!0}function H(e,t,r){var i=U(r);return null!=i?i:t.has(i)&&!e.has(i)}function F(e,t,r,i,n){var o=U(r);if(null!=o)return o;var a=t.get(o);return!(void 0===a&&!t.has(o)||!N(i,a,!1,n))&&(!e.has(o)&&N(i,a,!1,n))}function z(e,t,r,i,n,o){for(var a=s(e),u=0;u<a.length;u++){var c=a[u];if(N(r,c,n,o)&&N(i,t.get(c),n,o))return e.delete(c),!0}return!1}e.exports={isDeepEqual:function(e,t){return N(e,t,false)},isDeepStrictEqual:function(e,t){return N(e,t,true)}}},5364(e,t,r){"use strict";var i=r(2861).Buffer;e.exports=function(e){if(e.length>=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),r=0;r<t.length;r++)t[r]=255;for(var n=0;n<e.length;n++){var o=e.charAt(n),a=o.charCodeAt(0);if(255!==t[a])throw new TypeError(o+" is ambiguous");t[a]=n}var s=e.length,u=e.charAt(0),c=Math.log(s)/Math.log(256),h=Math.log(256)/Math.log(s);function l(e){if("string"!=typeof e)throw new TypeError("Expected String");if(0===e.length)return i.alloc(0);for(var r=0,n=0,o=0;e[r]===u;)n++,r++;for(var a=(e.length-r)*c+1>>>0,h=new Uint8Array(a);r<e.length;){var l=e.charCodeAt(r);if(l>255)return;var f=t[l];if(255===f)return;for(var p=0,d=a-1;(0!==f||p<o)&&-1!==d;d--,p++)f+=s*h[d]>>>0,h[d]=f%256>>>0,f=f/256>>>0;if(0!==f)throw new Error("Non-zero carry");o=p,r++}for(var g=a-o;g!==a&&0===h[g];)g++;var m=i.allocUnsafe(n+(a-g));m.fill(0,0,n);for(var y=n;g!==a;)m[y++]=h[g++];return m}return{encode:function(t){if((Array.isArray(t)||t instanceof Uint8Array)&&(t=i.from(t)),!i.isBuffer(t))throw new TypeError("Expected Buffer");if(0===t.length)return"";for(var r=0,n=0,o=0,a=t.length;o!==a&&0===t[o];)o++,r++;for(var c=(a-o)*h+1>>>0,l=new Uint8Array(c);o!==a;){for(var f=t[o],p=0,d=c-1;(0!==f||p<n)&&-1!==d;d--,p++)f+=256*l[d]>>>0,l[d]=f%s>>>0,f=f/s>>>0;if(0!==f)throw new Error("Non-zero carry");n=p,o++}for(var g=c-n;g!==c&&0===l[g];)g++;for(var m=u.repeat(r);g<c;++g)m+=e.charAt(l[g]);return m},decodeUnsafe:l,decode:function(e){var t=l(e);if(t)return t;throw new Error("Non-base"+s+" character")}}}},7526(e,t){"use strict";t.toByteArray=function(e){var t,r,o=s(e),a=o[0],u=o[1],c=new n(function(e,t,r){return 3*(t+r)/4-r}(0,a,u)),h=0,l=u>0?a-4:a;for(r=0;r<l;r+=4)t=i[e.charCodeAt(r)]<<18|i[e.charCodeAt(r+1)]<<12|i[e.charCodeAt(r+2)]<<6|i[e.charCodeAt(r+3)],c[h++]=t>>16&255,c[h++]=t>>8&255,c[h++]=255&t;2===u&&(t=i[e.charCodeAt(r)]<<2|i[e.charCodeAt(r+1)]>>4,c[h++]=255&t);1===u&&(t=i[e.charCodeAt(r)]<<10|i[e.charCodeAt(r+1)]<<4|i[e.charCodeAt(r+2)]>>2,c[h++]=t>>8&255,c[h++]=255&t);return c},t.fromByteArray=function(e){for(var t,i=e.length,n=i%3,o=[],a=16383,s=0,u=i-n;s<u;s+=a)o.push(c(e,s,s+a>u?u:s+a));1===n?(t=e[i-1],o.push(r[t>>2]+r[t<<4&63]+"==")):2===n&&(t=(e[i-2]<<8)+e[i-1],o.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"="));return o.join("")};for(var r=[],i=[],n="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0;a<64;++a)r[a]=o[a],i[o.charCodeAt(a)]=a;function s(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function u(e){return r[e>>18&63]+r[e>>12&63]+r[e>>6&63]+r[63&e]}function c(e,t,r){for(var i,n=[],o=t;o<r;o+=3)i=(e[o]<<16&16711680)+(e[o+1]<<8&65280)+(255&e[o+2]),n.push(u(i));return n.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},9404(e,t,r){!function(e,t){"use strict";function i(e,t){if(!e)throw new Error(t||"Assertion failed")}function n(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function o(e,t,r){if(o.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var a;"object"==typeof e?e.exports=o:t.BN=o,o.BN=o,o.wordSize=26;try{a=r(7790).Buffer}catch(e){}function s(e,t,r){for(var i=0,n=Math.min(e.length,r),o=t;o<n;o++){var a=e.charCodeAt(o)-48;i<<=4,i|=a>=49&&a<=54?a-49+10:a>=17&&a<=22?a-17+10:15&a}return i}function u(e,t,r,i){for(var n=0,o=Math.min(e.length,r),a=t;a<o;a++){var s=e.charCodeAt(a)-48;n*=i,n+=s>=49?s-49+10:s>=17?s-17+10:s}return n}o.isBN=function(e){return e instanceof o||null!==e&&"object"==typeof e&&e.constructor.wordSize===o.wordSize&&Array.isArray(e.words)},o.max=function(e,t){return e.cmp(t)>0?e:t},o.min=function(e,t){return e.cmp(t)<0?e:t},o.prototype._init=function(e,t,r){if("number"==typeof e)return this._initNumber(e,t,r);if("object"==typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),i(t===(0|t)&&t>=2&&t<=36);var n=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&n++,16===t?this._parseHex(e,n):this._parseBase(e,t,n),"-"===e[0]&&(this.negative=1),this.strip(),"le"===r&&this._initArray(this.toArray(),t,r)},o.prototype._initNumber=function(e,t,r){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(i(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),t,r)},o.prototype._initArray=function(e,t,r){if(i("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var o,a,s=0;if("be"===r)for(n=e.length-1,o=0;n>=0;n-=3)a=e[n]|e[n-1]<<8|e[n-2]<<16,this.words[o]|=a<<s&67108863,this.words[o+1]=a>>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);else if("le"===r)for(n=0,o=0;n<e.length;n+=3)a=e[n]|e[n+1]<<8|e[n+2]<<16,this.words[o]|=a<<s&67108863,this.words[o+1]=a>>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);return this.strip()},o.prototype._parseHex=function(e,t){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r<this.length;r++)this.words[r]=0;var i,n,o=0;for(r=e.length-6,i=0;r>=t;r-=6)n=s(e,r,r+6),this.words[i]|=n<<o&67108863,this.words[i+1]|=n>>>26-o&4194303,(o+=24)>=26&&(o-=26,i++);r+6!==t&&(n=s(e,t,r+6),this.words[i]|=n<<o&67108863,this.words[i+1]|=n>>>26-o&4194303),this.strip()},o.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var i=0,n=1;n<=67108863;n*=t)i++;i--,n=n/t|0;for(var o=e.length-r,a=o%i,s=Math.min(o,o-a)+r,c=0,h=r;h<s;h+=i)c=u(e,h,h+i,t),this.imuln(n),this.words[0]+c<67108864?this.words[0]+=c:this._iaddn(c);if(0!==a){var l=1;for(c=u(e,h,e.length,t),h=0;h<a;h++)l*=t;this.imuln(l),this.words[0]+c<67108864?this.words[0]+=c:this._iaddn(c)}},o.prototype.copy=function(e){e.words=new Array(this.length);for(var t=0;t<this.length;t++)e.words[t]=this.words[t];e.length=this.length,e.negative=this.negative,e.red=this.red},o.prototype.clone=function(){var e=new o(null);return this.copy(e),e},o.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},o.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?"<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"],h=[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 f(e,t,r){r.negative=t.negative^e.negative;var i=e.length+t.length|0;r.length=i,i=i-1|0;var n=0|e.words[0],o=0|t.words[0],a=n*o,s=67108863&a,u=a/67108864|0;r.words[0]=s;for(var c=1;c<i;c++){for(var h=u>>>26,l=67108863&u,f=Math.min(c,t.length-1),p=Math.max(0,c-e.length+1);p<=f;p++){var d=c-p|0;h+=(a=(n=0|e.words[d])*(o=0|t.words[p])+l)/67108864|0,l=67108863&a}r.words[c]=0|l,u=0|h}return 0!==u?r.words[c]=0|u:r.length--,r.strip()}o.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var n=0,o=0,a=0;a<this.length;a++){var s=this.words[a],u=(16777215&(s<<n|o)).toString(16);r=0!==(o=s>>>24-n&16777215)||a!==this.length-1?c[6-u.length]+u+r:u+r,(n+=2)>=26&&(n-=26,a--)}for(0!==o&&(r=o.toString(16)+r);r.length%t!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var f=h[e],p=l[e];r="";var d=this.clone();for(d.negative=0;!d.isZero();){var g=d.modn(p).toString(e);r=(d=d.idivn(p)).isZero()?g+r:c[f-g.length]+g+r}for(this.isZero()&&(r="0"+r);r.length%t!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}i(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(e,t){return i(void 0!==a),this.toArrayLike(a,e,t)},o.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},o.prototype.toArrayLike=function(e,t,r){var n=this.byteLength(),o=r||Math.max(1,n);i(n<=o,"byte array longer than desired length"),i(o>0,"Requested array length <= 0"),this.strip();var a,s,u="le"===t,c=new e(o),h=this.clone();if(u){for(s=0;!h.isZero();s++)a=h.andln(255),h.iushrn(8),c[s]=a;for(;s<o;s++)c[s]=0}else{for(s=0;s<o-n;s++)c[s]=0;for(s=0;!h.isZero();s++)a=h.andln(255),h.iushrn(8),c[o-s-1]=a}return c},Math.clz32?o.prototype._countBits=function(e){return 32-Math.clz32(e)}:o.prototype._countBits=function(e){var t=e,r=0;return t>=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},o.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 8191&t||(r+=13,t>>>=13),127&t||(r+=7,t>>>=7),15&t||(r+=4,t>>>=4),3&t||(r+=2,t>>>=2),1&t||r++,r},o.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;t<this.length;t++){var r=this._zeroBits(this.words[t]);if(e+=r,26!==r)break}return e},o.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},o.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},o.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},o.prototype.isNeg=function(){return 0!==this.negative},o.prototype.neg=function(){return this.clone().ineg()},o.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},o.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var t=0;t<e.length;t++)this.words[t]=this.words[t]|e.words[t];return this.strip()},o.prototype.ior=function(e){return i(0===(this.negative|e.negative)),this.iuor(e)},o.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},o.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},o.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;r<t.length;r++)this.words[r]=this.words[r]&e.words[r];return this.length=t.length,this.strip()},o.prototype.iand=function(e){return i(0===(this.negative|e.negative)),this.iuand(e)},o.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},o.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},o.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var i=0;i<r.length;i++)this.words[i]=t.words[i]^r.words[i];if(this!==t)for(;i<t.length;i++)this.words[i]=t.words[i];return this.length=t.length,this.strip()},o.prototype.ixor=function(e){return i(0===(this.negative|e.negative)),this.iuxor(e)},o.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},o.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},o.prototype.inotn=function(e){i("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var n=0;n<t;n++)this.words[n]=67108863&~this.words[n];return r>0&&(this.words[n]=~this.words[n]&67108863>>26-r),this.strip()},o.prototype.notn=function(e){return this.clone().inotn(e)},o.prototype.setn=function(e,t){i("number"==typeof e&&e>=0);var r=e/26|0,n=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<<n:this.words[r]&~(1<<n),this.strip()},o.prototype.iadd=function(e){var t,r,i;if(0!==this.negative&&0===e.negative)return this.negative=0,t=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,t=this.isub(e),e.negative=1,t._normSign();this.length>e.length?(r=this,i=e):(r=e,i=this);for(var n=0,o=0;o<i.length;o++)t=(0|r.words[o])+(0|i.words[o])+n,this.words[o]=67108863&t,n=t>>>26;for(;0!==n&&o<r.length;o++)t=(0|r.words[o])+n,this.words[o]=67108863&t,n=t>>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this},o.prototype.add=function(e){var t;return 0!==e.negative&&0===this.negative?(e.negative=0,t=this.sub(e),e.negative^=1,t):0===e.negative&&0!==this.negative?(this.negative=0,t=e.sub(this),this.negative=1,t):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},o.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,i,n=this.cmp(e);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(r=this,i=e):(r=e,i=this);for(var o=0,a=0;a<i.length;a++)o=(t=(0|r.words[a])-(0|i.words[a])+o)>>26,this.words[a]=67108863&t;for(;0!==o&&a<r.length;a++)o=(t=(0|r.words[a])+o)>>26,this.words[a]=67108863&t;if(0===o&&a<r.length&&r!==this)for(;a<r.length;a++)this.words[a]=r.words[a];return this.length=Math.max(this.length,a),r!==this&&(this.negative=1),this.strip()},o.prototype.sub=function(e){return this.clone().isub(e)};var p=function(e,t,r){var i,n,o,a=e.words,s=t.words,u=r.words,c=0,h=0|a[0],l=8191&h,f=h>>>13,p=0|a[1],d=8191&p,g=p>>>13,m=0|a[2],y=8191&m,v=m>>>13,b=0|a[3],_=8191&b,w=b>>>13,S=0|a[4],E=8191&S,k=S>>>13,O=0|a[5],I=8191&O,A=O>>>13,x=0|a[6],P=8191&x,T=x>>>13,R=0|a[7],M=8191&R,B=R>>>13,C=0|a[8],N=8191&C,D=C>>>13,L=0|a[9],j=8191&L,U=L>>>13,H=0|s[0],F=8191&H,z=H>>>13,K=0|s[1],V=8191&K,q=K>>>13,G=0|s[2],Z=8191&G,Y=G>>>13,W=0|s[3],X=8191&W,$=W>>>13,J=0|s[4],Q=8191&J,ee=J>>>13,te=0|s[5],re=8191&te,ie=te>>>13,ne=0|s[6],oe=8191&ne,ae=ne>>>13,se=0|s[7],ue=8191&se,ce=se>>>13,he=0|s[8],le=8191&he,fe=he>>>13,pe=0|s[9],de=8191&pe,ge=pe>>>13;r.negative=e.negative^t.negative,r.length=19;var me=(c+(i=Math.imul(l,F))|0)+((8191&(n=(n=Math.imul(l,z))+Math.imul(f,F)|0))<<13)|0;c=((o=Math.imul(f,z))+(n>>>13)|0)+(me>>>26)|0,me&=67108863,i=Math.imul(d,F),n=(n=Math.imul(d,z))+Math.imul(g,F)|0,o=Math.imul(g,z);var ye=(c+(i=i+Math.imul(l,V)|0)|0)+((8191&(n=(n=n+Math.imul(l,q)|0)+Math.imul(f,V)|0))<<13)|0;c=((o=o+Math.imul(f,q)|0)+(n>>>13)|0)+(ye>>>26)|0,ye&=67108863,i=Math.imul(y,F),n=(n=Math.imul(y,z))+Math.imul(v,F)|0,o=Math.imul(v,z),i=i+Math.imul(d,V)|0,n=(n=n+Math.imul(d,q)|0)+Math.imul(g,V)|0,o=o+Math.imul(g,q)|0;var ve=(c+(i=i+Math.imul(l,Z)|0)|0)+((8191&(n=(n=n+Math.imul(l,Y)|0)+Math.imul(f,Z)|0))<<13)|0;c=((o=o+Math.imul(f,Y)|0)+(n>>>13)|0)+(ve>>>26)|0,ve&=67108863,i=Math.imul(_,F),n=(n=Math.imul(_,z))+Math.imul(w,F)|0,o=Math.imul(w,z),i=i+Math.imul(y,V)|0,n=(n=n+Math.imul(y,q)|0)+Math.imul(v,V)|0,o=o+Math.imul(v,q)|0,i=i+Math.imul(d,Z)|0,n=(n=n+Math.imul(d,Y)|0)+Math.imul(g,Z)|0,o=o+Math.imul(g,Y)|0;var be=(c+(i=i+Math.imul(l,X)|0)|0)+((8191&(n=(n=n+Math.imul(l,$)|0)+Math.imul(f,X)|0))<<13)|0;c=((o=o+Math.imul(f,$)|0)+(n>>>13)|0)+(be>>>26)|0,be&=67108863,i=Math.imul(E,F),n=(n=Math.imul(E,z))+Math.imul(k,F)|0,o=Math.imul(k,z),i=i+Math.imul(_,V)|0,n=(n=n+Math.imul(_,q)|0)+Math.imul(w,V)|0,o=o+Math.imul(w,q)|0,i=i+Math.imul(y,Z)|0,n=(n=n+Math.imul(y,Y)|0)+Math.imul(v,Z)|0,o=o+Math.imul(v,Y)|0,i=i+Math.imul(d,X)|0,n=(n=n+Math.imul(d,$)|0)+Math.imul(g,X)|0,o=o+Math.imul(g,$)|0;var _e=(c+(i=i+Math.imul(l,Q)|0)|0)+((8191&(n=(n=n+Math.imul(l,ee)|0)+Math.imul(f,Q)|0))<<13)|0;c=((o=o+Math.imul(f,ee)|0)+(n>>>13)|0)+(_e>>>26)|0,_e&=67108863,i=Math.imul(I,F),n=(n=Math.imul(I,z))+Math.imul(A,F)|0,o=Math.imul(A,z),i=i+Math.imul(E,V)|0,n=(n=n+Math.imul(E,q)|0)+Math.imul(k,V)|0,o=o+Math.imul(k,q)|0,i=i+Math.imul(_,Z)|0,n=(n=n+Math.imul(_,Y)|0)+Math.imul(w,Z)|0,o=o+Math.imul(w,Y)|0,i=i+Math.imul(y,X)|0,n=(n=n+Math.imul(y,$)|0)+Math.imul(v,X)|0,o=o+Math.imul(v,$)|0,i=i+Math.imul(d,Q)|0,n=(n=n+Math.imul(d,ee)|0)+Math.imul(g,Q)|0,o=o+Math.imul(g,ee)|0;var we=(c+(i=i+Math.imul(l,re)|0)|0)+((8191&(n=(n=n+Math.imul(l,ie)|0)+Math.imul(f,re)|0))<<13)|0;c=((o=o+Math.imul(f,ie)|0)+(n>>>13)|0)+(we>>>26)|0,we&=67108863,i=Math.imul(P,F),n=(n=Math.imul(P,z))+Math.imul(T,F)|0,o=Math.imul(T,z),i=i+Math.imul(I,V)|0,n=(n=n+Math.imul(I,q)|0)+Math.imul(A,V)|0,o=o+Math.imul(A,q)|0,i=i+Math.imul(E,Z)|0,n=(n=n+Math.imul(E,Y)|0)+Math.imul(k,Z)|0,o=o+Math.imul(k,Y)|0,i=i+Math.imul(_,X)|0,n=(n=n+Math.imul(_,$)|0)+Math.imul(w,X)|0,o=o+Math.imul(w,$)|0,i=i+Math.imul(y,Q)|0,n=(n=n+Math.imul(y,ee)|0)+Math.imul(v,Q)|0,o=o+Math.imul(v,ee)|0,i=i+Math.imul(d,re)|0,n=(n=n+Math.imul(d,ie)|0)+Math.imul(g,re)|0,o=o+Math.imul(g,ie)|0;var Se=(c+(i=i+Math.imul(l,oe)|0)|0)+((8191&(n=(n=n+Math.imul(l,ae)|0)+Math.imul(f,oe)|0))<<13)|0;c=((o=o+Math.imul(f,ae)|0)+(n>>>13)|0)+(Se>>>26)|0,Se&=67108863,i=Math.imul(M,F),n=(n=Math.imul(M,z))+Math.imul(B,F)|0,o=Math.imul(B,z),i=i+Math.imul(P,V)|0,n=(n=n+Math.imul(P,q)|0)+Math.imul(T,V)|0,o=o+Math.imul(T,q)|0,i=i+Math.imul(I,Z)|0,n=(n=n+Math.imul(I,Y)|0)+Math.imul(A,Z)|0,o=o+Math.imul(A,Y)|0,i=i+Math.imul(E,X)|0,n=(n=n+Math.imul(E,$)|0)+Math.imul(k,X)|0,o=o+Math.imul(k,$)|0,i=i+Math.imul(_,Q)|0,n=(n=n+Math.imul(_,ee)|0)+Math.imul(w,Q)|0,o=o+Math.imul(w,ee)|0,i=i+Math.imul(y,re)|0,n=(n=n+Math.imul(y,ie)|0)+Math.imul(v,re)|0,o=o+Math.imul(v,ie)|0,i=i+Math.imul(d,oe)|0,n=(n=n+Math.imul(d,ae)|0)+Math.imul(g,oe)|0,o=o+Math.imul(g,ae)|0;var Ee=(c+(i=i+Math.imul(l,ue)|0)|0)+((8191&(n=(n=n+Math.imul(l,ce)|0)+Math.imul(f,ue)|0))<<13)|0;c=((o=o+Math.imul(f,ce)|0)+(n>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,i=Math.imul(N,F),n=(n=Math.imul(N,z))+Math.imul(D,F)|0,o=Math.imul(D,z),i=i+Math.imul(M,V)|0,n=(n=n+Math.imul(M,q)|0)+Math.imul(B,V)|0,o=o+Math.imul(B,q)|0,i=i+Math.imul(P,Z)|0,n=(n=n+Math.imul(P,Y)|0)+Math.imul(T,Z)|0,o=o+Math.imul(T,Y)|0,i=i+Math.imul(I,X)|0,n=(n=n+Math.imul(I,$)|0)+Math.imul(A,X)|0,o=o+Math.imul(A,$)|0,i=i+Math.imul(E,Q)|0,n=(n=n+Math.imul(E,ee)|0)+Math.imul(k,Q)|0,o=o+Math.imul(k,ee)|0,i=i+Math.imul(_,re)|0,n=(n=n+Math.imul(_,ie)|0)+Math.imul(w,re)|0,o=o+Math.imul(w,ie)|0,i=i+Math.imul(y,oe)|0,n=(n=n+Math.imul(y,ae)|0)+Math.imul(v,oe)|0,o=o+Math.imul(v,ae)|0,i=i+Math.imul(d,ue)|0,n=(n=n+Math.imul(d,ce)|0)+Math.imul(g,ue)|0,o=o+Math.imul(g,ce)|0;var ke=(c+(i=i+Math.imul(l,le)|0)|0)+((8191&(n=(n=n+Math.imul(l,fe)|0)+Math.imul(f,le)|0))<<13)|0;c=((o=o+Math.imul(f,fe)|0)+(n>>>13)|0)+(ke>>>26)|0,ke&=67108863,i=Math.imul(j,F),n=(n=Math.imul(j,z))+Math.imul(U,F)|0,o=Math.imul(U,z),i=i+Math.imul(N,V)|0,n=(n=n+Math.imul(N,q)|0)+Math.imul(D,V)|0,o=o+Math.imul(D,q)|0,i=i+Math.imul(M,Z)|0,n=(n=n+Math.imul(M,Y)|0)+Math.imul(B,Z)|0,o=o+Math.imul(B,Y)|0,i=i+Math.imul(P,X)|0,n=(n=n+Math.imul(P,$)|0)+Math.imul(T,X)|0,o=o+Math.imul(T,$)|0,i=i+Math.imul(I,Q)|0,n=(n=n+Math.imul(I,ee)|0)+Math.imul(A,Q)|0,o=o+Math.imul(A,ee)|0,i=i+Math.imul(E,re)|0,n=(n=n+Math.imul(E,ie)|0)+Math.imul(k,re)|0,o=o+Math.imul(k,ie)|0,i=i+Math.imul(_,oe)|0,n=(n=n+Math.imul(_,ae)|0)+Math.imul(w,oe)|0,o=o+Math.imul(w,ae)|0,i=i+Math.imul(y,ue)|0,n=(n=n+Math.imul(y,ce)|0)+Math.imul(v,ue)|0,o=o+Math.imul(v,ce)|0,i=i+Math.imul(d,le)|0,n=(n=n+Math.imul(d,fe)|0)+Math.imul(g,le)|0,o=o+Math.imul(g,fe)|0;var Oe=(c+(i=i+Math.imul(l,de)|0)|0)+((8191&(n=(n=n+Math.imul(l,ge)|0)+Math.imul(f,de)|0))<<13)|0;c=((o=o+Math.imul(f,ge)|0)+(n>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,i=Math.imul(j,V),n=(n=Math.imul(j,q))+Math.imul(U,V)|0,o=Math.imul(U,q),i=i+Math.imul(N,Z)|0,n=(n=n+Math.imul(N,Y)|0)+Math.imul(D,Z)|0,o=o+Math.imul(D,Y)|0,i=i+Math.imul(M,X)|0,n=(n=n+Math.imul(M,$)|0)+Math.imul(B,X)|0,o=o+Math.imul(B,$)|0,i=i+Math.imul(P,Q)|0,n=(n=n+Math.imul(P,ee)|0)+Math.imul(T,Q)|0,o=o+Math.imul(T,ee)|0,i=i+Math.imul(I,re)|0,n=(n=n+Math.imul(I,ie)|0)+Math.imul(A,re)|0,o=o+Math.imul(A,ie)|0,i=i+Math.imul(E,oe)|0,n=(n=n+Math.imul(E,ae)|0)+Math.imul(k,oe)|0,o=o+Math.imul(k,ae)|0,i=i+Math.imul(_,ue)|0,n=(n=n+Math.imul(_,ce)|0)+Math.imul(w,ue)|0,o=o+Math.imul(w,ce)|0,i=i+Math.imul(y,le)|0,n=(n=n+Math.imul(y,fe)|0)+Math.imul(v,le)|0,o=o+Math.imul(v,fe)|0;var Ie=(c+(i=i+Math.imul(d,de)|0)|0)+((8191&(n=(n=n+Math.imul(d,ge)|0)+Math.imul(g,de)|0))<<13)|0;c=((o=o+Math.imul(g,ge)|0)+(n>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,i=Math.imul(j,Z),n=(n=Math.imul(j,Y))+Math.imul(U,Z)|0,o=Math.imul(U,Y),i=i+Math.imul(N,X)|0,n=(n=n+Math.imul(N,$)|0)+Math.imul(D,X)|0,o=o+Math.imul(D,$)|0,i=i+Math.imul(M,Q)|0,n=(n=n+Math.imul(M,ee)|0)+Math.imul(B,Q)|0,o=o+Math.imul(B,ee)|0,i=i+Math.imul(P,re)|0,n=(n=n+Math.imul(P,ie)|0)+Math.imul(T,re)|0,o=o+Math.imul(T,ie)|0,i=i+Math.imul(I,oe)|0,n=(n=n+Math.imul(I,ae)|0)+Math.imul(A,oe)|0,o=o+Math.imul(A,ae)|0,i=i+Math.imul(E,ue)|0,n=(n=n+Math.imul(E,ce)|0)+Math.imul(k,ue)|0,o=o+Math.imul(k,ce)|0,i=i+Math.imul(_,le)|0,n=(n=n+Math.imul(_,fe)|0)+Math.imul(w,le)|0,o=o+Math.imul(w,fe)|0;var Ae=(c+(i=i+Math.imul(y,de)|0)|0)+((8191&(n=(n=n+Math.imul(y,ge)|0)+Math.imul(v,de)|0))<<13)|0;c=((o=o+Math.imul(v,ge)|0)+(n>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,i=Math.imul(j,X),n=(n=Math.imul(j,$))+Math.imul(U,X)|0,o=Math.imul(U,$),i=i+Math.imul(N,Q)|0,n=(n=n+Math.imul(N,ee)|0)+Math.imul(D,Q)|0,o=o+Math.imul(D,ee)|0,i=i+Math.imul(M,re)|0,n=(n=n+Math.imul(M,ie)|0)+Math.imul(B,re)|0,o=o+Math.imul(B,ie)|0,i=i+Math.imul(P,oe)|0,n=(n=n+Math.imul(P,ae)|0)+Math.imul(T,oe)|0,o=o+Math.imul(T,ae)|0,i=i+Math.imul(I,ue)|0,n=(n=n+Math.imul(I,ce)|0)+Math.imul(A,ue)|0,o=o+Math.imul(A,ce)|0,i=i+Math.imul(E,le)|0,n=(n=n+Math.imul(E,fe)|0)+Math.imul(k,le)|0,o=o+Math.imul(k,fe)|0;var xe=(c+(i=i+Math.imul(_,de)|0)|0)+((8191&(n=(n=n+Math.imul(_,ge)|0)+Math.imul(w,de)|0))<<13)|0;c=((o=o+Math.imul(w,ge)|0)+(n>>>13)|0)+(xe>>>26)|0,xe&=67108863,i=Math.imul(j,Q),n=(n=Math.imul(j,ee))+Math.imul(U,Q)|0,o=Math.imul(U,ee),i=i+Math.imul(N,re)|0,n=(n=n+Math.imul(N,ie)|0)+Math.imul(D,re)|0,o=o+Math.imul(D,ie)|0,i=i+Math.imul(M,oe)|0,n=(n=n+Math.imul(M,ae)|0)+Math.imul(B,oe)|0,o=o+Math.imul(B,ae)|0,i=i+Math.imul(P,ue)|0,n=(n=n+Math.imul(P,ce)|0)+Math.imul(T,ue)|0,o=o+Math.imul(T,ce)|0,i=i+Math.imul(I,le)|0,n=(n=n+Math.imul(I,fe)|0)+Math.imul(A,le)|0,o=o+Math.imul(A,fe)|0;var Pe=(c+(i=i+Math.imul(E,de)|0)|0)+((8191&(n=(n=n+Math.imul(E,ge)|0)+Math.imul(k,de)|0))<<13)|0;c=((o=o+Math.imul(k,ge)|0)+(n>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,i=Math.imul(j,re),n=(n=Math.imul(j,ie))+Math.imul(U,re)|0,o=Math.imul(U,ie),i=i+Math.imul(N,oe)|0,n=(n=n+Math.imul(N,ae)|0)+Math.imul(D,oe)|0,o=o+Math.imul(D,ae)|0,i=i+Math.imul(M,ue)|0,n=(n=n+Math.imul(M,ce)|0)+Math.imul(B,ue)|0,o=o+Math.imul(B,ce)|0,i=i+Math.imul(P,le)|0,n=(n=n+Math.imul(P,fe)|0)+Math.imul(T,le)|0,o=o+Math.imul(T,fe)|0;var Te=(c+(i=i+Math.imul(I,de)|0)|0)+((8191&(n=(n=n+Math.imul(I,ge)|0)+Math.imul(A,de)|0))<<13)|0;c=((o=o+Math.imul(A,ge)|0)+(n>>>13)|0)+(Te>>>26)|0,Te&=67108863,i=Math.imul(j,oe),n=(n=Math.imul(j,ae))+Math.imul(U,oe)|0,o=Math.imul(U,ae),i=i+Math.imul(N,ue)|0,n=(n=n+Math.imul(N,ce)|0)+Math.imul(D,ue)|0,o=o+Math.imul(D,ce)|0,i=i+Math.imul(M,le)|0,n=(n=n+Math.imul(M,fe)|0)+Math.imul(B,le)|0,o=o+Math.imul(B,fe)|0;var Re=(c+(i=i+Math.imul(P,de)|0)|0)+((8191&(n=(n=n+Math.imul(P,ge)|0)+Math.imul(T,de)|0))<<13)|0;c=((o=o+Math.imul(T,ge)|0)+(n>>>13)|0)+(Re>>>26)|0,Re&=67108863,i=Math.imul(j,ue),n=(n=Math.imul(j,ce))+Math.imul(U,ue)|0,o=Math.imul(U,ce),i=i+Math.imul(N,le)|0,n=(n=n+Math.imul(N,fe)|0)+Math.imul(D,le)|0,o=o+Math.imul(D,fe)|0;var Me=(c+(i=i+Math.imul(M,de)|0)|0)+((8191&(n=(n=n+Math.imul(M,ge)|0)+Math.imul(B,de)|0))<<13)|0;c=((o=o+Math.imul(B,ge)|0)+(n>>>13)|0)+(Me>>>26)|0,Me&=67108863,i=Math.imul(j,le),n=(n=Math.imul(j,fe))+Math.imul(U,le)|0,o=Math.imul(U,fe);var Be=(c+(i=i+Math.imul(N,de)|0)|0)+((8191&(n=(n=n+Math.imul(N,ge)|0)+Math.imul(D,de)|0))<<13)|0;c=((o=o+Math.imul(D,ge)|0)+(n>>>13)|0)+(Be>>>26)|0,Be&=67108863;var Ce=(c+(i=Math.imul(j,de))|0)+((8191&(n=(n=Math.imul(j,ge))+Math.imul(U,de)|0))<<13)|0;return c=((o=Math.imul(U,ge))+(n>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,u[0]=me,u[1]=ye,u[2]=ve,u[3]=be,u[4]=_e,u[5]=we,u[6]=Se,u[7]=Ee,u[8]=ke,u[9]=Oe,u[10]=Ie,u[11]=Ae,u[12]=xe,u[13]=Pe,u[14]=Te,u[15]=Re,u[16]=Me,u[17]=Be,u[18]=Ce,0!==c&&(u[19]=c,r.length++),r};function d(e,t,r){return(new g).mulp(e,t,r)}function g(e,t){this.x=e,this.y=t}Math.imul||(p=f),o.prototype.mulTo=function(e,t){var r,i=this.length+e.length;return r=10===this.length&&10===e.length?p(this,e,t):i<63?f(this,e,t):i<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var i=0,n=0,o=0;o<r.length-1;o++){var a=n;n=0;for(var s=67108863&i,u=Math.min(o,t.length-1),c=Math.max(0,o-e.length+1);c<=u;c++){var h=o-c,l=(0|e.words[h])*(0|t.words[c]),f=67108863&l;s=67108863&(f=f+s|0),n+=(a=(a=a+(l/67108864|0)|0)+(f>>>26)|0)>>>26,a&=67108863}r.words[o]=s,i=a,a=n}return 0!==i?r.words[o]=i:r.length--,r.strip()}(this,e,t):d(this,e,t),r},g.prototype.makeRBT=function(e){for(var t=new Array(e),r=o.prototype._countBits(e)-1,i=0;i<e;i++)t[i]=this.revBin(i,r,e);return t},g.prototype.revBin=function(e,t,r){if(0===e||e===r-1)return e;for(var i=0,n=0;n<t;n++)i|=(1&e)<<t-n-1,e>>=1;return i},g.prototype.permute=function(e,t,r,i,n,o){for(var a=0;a<o;a++)i[a]=t[e[a]],n[a]=r[e[a]]},g.prototype.transform=function(e,t,r,i,n,o){this.permute(o,e,t,r,i,n);for(var a=1;a<n;a<<=1)for(var s=a<<1,u=Math.cos(2*Math.PI/s),c=Math.sin(2*Math.PI/s),h=0;h<n;h+=s)for(var l=u,f=c,p=0;p<a;p++){var d=r[h+p],g=i[h+p],m=r[h+p+a],y=i[h+p+a],v=l*m-f*y;y=l*y+f*m,m=v,r[h+p]=d+m,i[h+p]=g+y,r[h+p+a]=d-m,i[h+p+a]=g-y,p!==s&&(v=u*l-c*f,f=u*f+c*l,l=v)}},g.prototype.guessLen13b=function(e,t){var r=1|Math.max(t,e),i=1&r,n=0;for(r=r/2|0;r;r>>>=1)n++;return 1<<n+1+i},g.prototype.conjugate=function(e,t,r){if(!(r<=1))for(var i=0;i<r/2;i++){var n=e[i];e[i]=e[r-i-1],e[r-i-1]=n,n=t[i],t[i]=-t[r-i-1],t[r-i-1]=-n}},g.prototype.normalize13b=function(e,t){for(var r=0,i=0;i<t/2;i++){var n=8192*Math.round(e[2*i+1]/t)+Math.round(e[2*i]/t)+r;e[i]=67108863&n,r=n<67108864?0:n/67108864|0}return e},g.prototype.convert13b=function(e,t,r,n){for(var o=0,a=0;a<t;a++)o+=0|e[a],r[2*a]=8191&o,o>>>=13,r[2*a+1]=8191&o,o>>>=13;for(a=2*t;a<n;++a)r[a]=0;i(0===o),i(!(-8192&o))},g.prototype.stub=function(e){for(var t=new Array(e),r=0;r<e;r++)t[r]=0;return t},g.prototype.mulp=function(e,t,r){var i=2*this.guessLen13b(e.length,t.length),n=this.makeRBT(i),o=this.stub(i),a=new Array(i),s=new Array(i),u=new Array(i),c=new Array(i),h=new Array(i),l=new Array(i),f=r.words;f.length=i,this.convert13b(e.words,e.length,a,i),this.convert13b(t.words,t.length,c,i),this.transform(a,o,s,u,i,n),this.transform(c,o,h,l,i,n);for(var p=0;p<i;p++){var d=s[p]*h[p]-u[p]*l[p];u[p]=s[p]*l[p]+u[p]*h[p],s[p]=d}return this.conjugate(s,u,i),this.transform(s,u,f,o,i,n),this.conjugate(f,o,i),this.normalize13b(f,i),r.negative=e.negative^t.negative,r.length=e.length+t.length,r.strip()},o.prototype.mul=function(e){var t=new o(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},o.prototype.mulf=function(e){var t=new o(null);return t.words=new Array(this.length+e.length),d(this,e,t)},o.prototype.imul=function(e){return this.clone().mulTo(e,this)},o.prototype.imuln=function(e){i("number"==typeof e),i(e<67108864);for(var t=0,r=0;r<this.length;r++){var n=(0|this.words[r])*e,o=(67108863&n)+(67108863&t);t>>=26,t+=n/67108864|0,t+=o>>>26,this.words[r]=67108863&o}return 0!==t&&(this.words[r]=t,this.length++),this},o.prototype.muln=function(e){return this.clone().imuln(e)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r<t.length;r++){var i=r/26|0,n=r%26;t[r]=(e.words[i]&1<<n)>>>n}return t}(e);if(0===t.length)return new o(1);for(var r=this,i=0;i<t.length&&0===t[i];i++,r=r.sqr());if(++i<t.length)for(var n=r.sqr();i<t.length;i++,n=n.sqr())0!==t[i]&&(r=r.mul(n));return r},o.prototype.iushln=function(e){i("number"==typeof e&&e>=0);var t,r=e%26,n=(e-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var a=0;for(t=0;t<this.length;t++){var s=this.words[t]&o,u=(0|this.words[t])-s<<r;this.words[t]=u|a,a=s>>>26-r}a&&(this.words[t]=a,this.length++)}if(0!==n){for(t=this.length-1;t>=0;t--)this.words[t+n]=this.words[t];for(t=0;t<n;t++)this.words[t]=0;this.length+=n}return this.strip()},o.prototype.ishln=function(e){return i(0===this.negative),this.iushln(e)},o.prototype.iushrn=function(e,t,r){var n;i("number"==typeof e&&e>=0),n=t?(t-t%26)/26:0;var o=e%26,a=Math.min((e-o)/26,this.length),s=67108863^67108863>>>o<<o,u=r;if(n-=a,n=Math.max(0,n),u){for(var c=0;c<a;c++)u.words[c]=this.words[c];u.length=a}if(0===a);else if(this.length>a)for(this.length-=a,c=0;c<this.length;c++)this.words[c]=this.words[c+a];else this.words[0]=0,this.length=1;var h=0;for(c=this.length-1;c>=0&&(0!==h||c>=n);c--){var l=0|this.words[c];this.words[c]=h<<26-o|l>>>o,h=l&s}return u&&0!==h&&(u.words[u.length++]=h),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(e,t,r){return i(0===this.negative),this.iushrn(e,t,r)},o.prototype.shln=function(e){return this.clone().ishln(e)},o.prototype.ushln=function(e){return this.clone().iushln(e)},o.prototype.shrn=function(e){return this.clone().ishrn(e)},o.prototype.ushrn=function(e){return this.clone().iushrn(e)},o.prototype.testn=function(e){i("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26,n=1<<t;return!(this.length<=r)&&!!(this.words[r]&n)},o.prototype.imaskn=function(e){i("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26;if(i(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var n=67108863^67108863>>>t<<t;this.words[this.length-1]&=n}return this.strip()},o.prototype.maskn=function(e){return this.clone().imaskn(e)},o.prototype.iaddn=function(e){return i("number"==typeof e),i(e<67108864),e<0?this.isubn(-e):0!==this.negative?1===this.length&&(0|this.words[0])<e?(this.words[0]=e-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(e),this.negative=1,this):this._iaddn(e)},o.prototype._iaddn=function(e){this.words[0]+=e;for(var t=0;t<this.length&&this.words[t]>=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},o.prototype.isubn=function(e){if(i("number"==typeof e),i(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t<this.length&&this.words[t]<0;t++)this.words[t]+=67108864,this.words[t+1]-=1;return this.strip()},o.prototype.addn=function(e){return this.clone().iaddn(e)},o.prototype.subn=function(e){return this.clone().isubn(e)},o.prototype.iabs=function(){return this.negative=0,this},o.prototype.abs=function(){return this.clone().iabs()},o.prototype._ishlnsubmul=function(e,t,r){var n,o,a=e.length+r;this._expand(a);var s=0;for(n=0;n<e.length;n++){o=(0|this.words[n+r])+s;var u=(0|e.words[n])*t;s=((o-=67108863&u)>>26)-(u/67108864|0),this.words[n+r]=67108863&o}for(;n<this.length-r;n++)s=(o=(0|this.words[n+r])+s)>>26,this.words[n+r]=67108863&o;if(0===s)return this.strip();for(i(-1===s),s=0,n=0;n<this.length;n++)s=(o=-(0|this.words[n])+s)>>26,this.words[n]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(e,t){var r=(this.length,e.length),i=this.clone(),n=e,a=0|n.words[n.length-1];0!==(r=26-this._countBits(a))&&(n=n.ushln(r),i.iushln(r),a=0|n.words[n.length-1]);var s,u=i.length-n.length;if("mod"!==t){(s=new o(null)).length=u+1,s.words=new Array(s.length);for(var c=0;c<s.length;c++)s.words[c]=0}var h=i.clone()._ishlnsubmul(n,1,u);0===h.negative&&(i=h,s&&(s.words[u]=1));for(var l=u-1;l>=0;l--){var f=67108864*(0|i.words[n.length+l])+(0|i.words[n.length+l-1]);for(f=Math.min(f/a|0,67108863),i._ishlnsubmul(n,f,l);0!==i.negative;)f--,i.negative=0,i._ishlnsubmul(n,1,l),i.isZero()||(i.negative^=1);s&&(s.words[l]=f)}return s&&s.strip(),i.strip(),"div"!==t&&0!==r&&i.iushrn(r),{div:s||null,mod:i}},o.prototype.divmod=function(e,t,r){return i(!e.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(n=s.div.neg()),"div"!==t&&(a=s.mod.neg(),r&&0!==a.negative&&a.iadd(e)),{div:n,mod:a}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(n=s.div.neg()),{div:n,mod:s.mod}):0!==(this.negative&e.negative)?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(a=s.mod.neg(),r&&0!==a.negative&&a.isub(e)),{div:s.div,mod:a}):e.length>this.length||this.cmp(e)<0?{div:new o(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new o(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new o(this.modn(e.words[0]))}:this._wordDiv(e,t);var n,a,s},o.prototype.div=function(e){return this.divmod(e,"div",!1).div},o.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},o.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},o.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,i=e.ushrn(1),n=e.andln(1),o=r.cmp(i);return o<0||1===n&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},o.prototype.modn=function(e){i(e<=67108863);for(var t=(1<<26)%e,r=0,n=this.length-1;n>=0;n--)r=(t*r+(0|this.words[n]))%e;return r},o.prototype.idivn=function(e){i(e<=67108863);for(var t=0,r=this.length-1;r>=0;r--){var n=(0|this.words[r])+67108864*t;this.words[r]=n/e|0,t=n%e}return this.strip()},o.prototype.divn=function(e){return this.clone().idivn(e)},o.prototype.egcd=function(e){i(0===e.negative),i(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var n=new o(1),a=new o(0),s=new o(0),u=new o(1),c=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++c;for(var h=r.clone(),l=t.clone();!t.isZero();){for(var f=0,p=1;0===(t.words[0]&p)&&f<26;++f,p<<=1);if(f>0)for(t.iushrn(f);f-- >0;)(n.isOdd()||a.isOdd())&&(n.iadd(h),a.isub(l)),n.iushrn(1),a.iushrn(1);for(var d=0,g=1;0===(r.words[0]&g)&&d<26;++d,g<<=1);if(d>0)for(r.iushrn(d);d-- >0;)(s.isOdd()||u.isOdd())&&(s.iadd(h),u.isub(l)),s.iushrn(1),u.iushrn(1);t.cmp(r)>=0?(t.isub(r),n.isub(s),a.isub(u)):(r.isub(t),s.isub(n),u.isub(a))}return{a:s,b:u,gcd:r.iushln(c)}},o.prototype._invmp=function(e){i(0===e.negative),i(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var n,a=new o(1),s=new o(0),u=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var c=0,h=1;0===(t.words[0]&h)&&c<26;++c,h<<=1);if(c>0)for(t.iushrn(c);c-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);for(var l=0,f=1;0===(r.words[0]&f)&&l<26;++l,f<<=1);if(l>0)for(r.iushrn(l);l-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);t.cmp(r)>=0?(t.isub(r),a.isub(s)):(r.isub(t),s.isub(a))}return(n=0===t.cmpn(1)?a:s).cmpn(0)<0&&n.iadd(e),n},o.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var i=0;t.isEven()&&r.isEven();i++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var n=t.cmp(r);if(n<0){var o=t;t=r,r=o}else if(0===n||0===r.cmpn(1))break;t.isub(r)}return r.iushln(i)},o.prototype.invm=function(e){return this.egcd(e).a.umod(e)},o.prototype.isEven=function(){return!(1&this.words[0])},o.prototype.isOdd=function(){return!(1&~this.words[0])},o.prototype.andln=function(e){return this.words[0]&e},o.prototype.bincn=function(e){i("number"==typeof e);var t=e%26,r=(e-t)/26,n=1<<t;if(this.length<=r)return this._expand(r+1),this.words[r]|=n,this;for(var o=n,a=r;0!==o&&a<this.length;a++){var s=0|this.words[a];o=(s+=o)>>>26,s&=67108863,this.words[a]=s}return 0!==o&&(this.words[a]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)t=1;else{r&&(e=-e),i(e<=67108863,"Number is too big");var n=0|this.words[0];t=n===e?0:n<e?-1:1}return 0!==this.negative?0|-t:t},o.prototype.cmp=function(e){if(0!==this.negative&&0===e.negative)return-1;if(0===this.negative&&0!==e.negative)return 1;var t=this.ucmp(e);return 0!==this.negative?0|-t:t},o.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var t=0,r=this.length-1;r>=0;r--){var i=0|this.words[r],n=0|e.words[r];if(i!==n){i<n?t=-1:i>n&&(t=1);break}}return t},o.prototype.gtn=function(e){return 1===this.cmpn(e)},o.prototype.gt=function(e){return 1===this.cmp(e)},o.prototype.gten=function(e){return this.cmpn(e)>=0},o.prototype.gte=function(e){return this.cmp(e)>=0},o.prototype.ltn=function(e){return-1===this.cmpn(e)},o.prototype.lt=function(e){return-1===this.cmp(e)},o.prototype.lten=function(e){return this.cmpn(e)<=0},o.prototype.lte=function(e){return this.cmp(e)<=0},o.prototype.eqn=function(e){return 0===this.cmpn(e)},o.prototype.eq=function(e){return 0===this.cmp(e)},o.red=function(e){return new S(e)},o.prototype.toRed=function(e){return i(!this.red,"Already a number in reduction context"),i(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},o.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(e){return this.red=e,this},o.prototype.forceRed=function(e){return i(!this.red,"Already a number in reduction context"),this._forceRed(e)},o.prototype.redAdd=function(e){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},o.prototype.redIAdd=function(e){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},o.prototype.redSub=function(e){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},o.prototype.redISub=function(e){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},o.prototype.redShl=function(e){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},o.prototype.redMul=function(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(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(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(e){return i(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var m={k256:null,p224:null,p192:null,p25519:null};function y(e,t){this.name=e,this.p=new o(t,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function v(){y.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function b(){y.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function _(){y.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function w(){y.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function S(e){if("string"==typeof e){var t=o._prime(e);this.m=t.p,this.prime=t}else i(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function E(e){S.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}y.prototype._tmp=function(){var e=new o(null);return e.words=new Array(Math.ceil(this.n/13)),e},y.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var i=t<this.n?-1:r.ucmp(this.p);return 0===i?(r.words[0]=0,r.length=1):i>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},y.prototype.split=function(e,t){e.iushrn(this.n,0,t)},y.prototype.imulK=function(e){return e.imul(this.k)},n(v,y),v.prototype.split=function(e,t){for(var r=4194303,i=Math.min(e.length,9),n=0;n<i;n++)t.words[n]=e.words[n];if(t.length=i,e.length<=9)return e.words[0]=0,void(e.length=1);var o=e.words[9];for(t.words[t.length++]=o&r,n=10;n<e.length;n++){var a=0|e.words[n];e.words[n-10]=(a&r)<<4|o>>>22,o=a}o>>>=22,e.words[n-10]=o,0===o&&e.length>10?e.length-=10:e.length-=9},v.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r<e.length;r++){var i=0|e.words[r];t+=977*i,e.words[r]=67108863&t,t=64*i+(t/67108864|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},n(b,y),n(_,y),n(w,y),w.prototype.imulK=function(e){for(var t=0,r=0;r<e.length;r++){var i=19*(0|e.words[r])+t,n=67108863&i;i>>>=26,e.words[r]=n,t=i}return 0!==t&&(e.words[e.length++]=t),e},o._prime=function(e){if(m[e])return m[e];var t;if("k256"===e)t=new v;else if("p224"===e)t=new b;else if("p192"===e)t=new _;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new w}return m[e]=t,t},S.prototype._verify1=function(e){i(0===e.negative,"red works only with positives"),i(e.red,"red works only with red numbers")},S.prototype._verify2=function(e,t){i(0===(e.negative|t.negative),"red works only with positives"),i(e.red&&e.red===t.red,"red works only with red numbers")},S.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},S.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},S.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},S.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},S.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},S.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},S.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},S.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},S.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},S.prototype.isqr=function(e){return this.imul(e,e.clone())},S.prototype.sqr=function(e){return this.mul(e,e)},S.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(i(t%2==1),3===t){var r=this.m.add(new o(1)).iushrn(2);return this.pow(e,r)}for(var n=this.m.subn(1),a=0;!n.isZero()&&0===n.andln(1);)a++,n.iushrn(1);i(!n.isZero());var s=new o(1).toRed(this),u=s.redNeg(),c=this.m.subn(1).iushrn(1),h=this.m.bitLength();for(h=new o(2*h*h).toRed(this);0!==this.pow(h,c).cmp(u);)h.redIAdd(u);for(var l=this.pow(h,n),f=this.pow(e,n.addn(1).iushrn(1)),p=this.pow(e,n),d=a;0!==p.cmp(s);){for(var g=p,m=0;0!==g.cmp(s);m++)g=g.redSqr();i(m<d);var y=this.pow(l,new o(1).iushln(d-m-1));f=f.redMul(y),l=y.redSqr(),p=p.redMul(l),d=m}return f},S.prototype.invm=function(e){var t=e._invmp(this.m);return 0!==t.negative?(t.negative=0,this.imod(t).redNeg()):this.imod(t)},S.prototype.pow=function(e,t){if(t.isZero())return new o(1).toRed(this);if(0===t.cmpn(1))return e.clone();var r=new Array(16);r[0]=new o(1).toRed(this),r[1]=e;for(var i=2;i<r.length;i++)r[i]=this.mul(r[i-1],e);var n=r[0],a=0,s=0,u=t.bitLength()%26;for(0===u&&(u=26),i=t.length-1;i>=0;i--){for(var c=t.words[i],h=u-1;h>=0;h--){var l=c>>h&1;n!==r[0]&&(n=this.sqr(n)),0!==l||0!==a?(a<<=1,a|=l,(4===++s||0===i&&0===h)&&(n=this.mul(n,r[a]),s=0,a=0)):s=0}u=26}return n},S.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},S.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},o.mont=function(e){return new E(e)},n(E,S),E.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},E.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},E.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},E.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new o(0)._forceRed(this);var r=e.mul(t),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),a=n;return n.cmp(this.m)>=0?a=n.isub(this.m):n.cmpn(0)<0&&(a=n.iadd(this.m)),a._forceRed(this)},E.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=r.nmd(e),this)},5037(e,t,r){var i;function n(e){this.rand=e}if(e.exports=function(e){return i||(i=new n(null)),i.generate(e)},e.exports.Rand=n,n.prototype.generate=function(e){return this._rand(e)},n.prototype._rand=function(e){if(this.rand.getBytes)return this.rand.getBytes(e);for(var t=new Uint8Array(e),r=0;r<t.length;r++)t[r]=this.rand.getByte();return t},"object"==typeof self)self.crypto&&self.crypto.getRandomValues?n.prototype._rand=function(e){var t=new Uint8Array(e);return self.crypto.getRandomValues(t),t}:self.msCrypto&&self.msCrypto.getRandomValues?n.prototype._rand=function(e){var t=new Uint8Array(e);return self.msCrypto.getRandomValues(t),t}:"object"==typeof window&&(n.prototype._rand=function(){throw new Error("Not implemented yet")});else try{var o=r(3776);if("function"!=typeof o.randomBytes)throw new Error("Not supported");n.prototype._rand=function(e){return o.randomBytes(e)}}catch(e){}},462(e,t,r){var i=r(2861).Buffer;function n(e){i.isBuffer(e)||(e=i.from(e));for(var t=e.length/4|0,r=new Array(t),n=0;n<t;n++)r[n]=e.readUInt32BE(4*n);return r}function o(e){for(;0<e.length;e++)e[0]=0}function a(e,t,r,i,n){for(var o,a,s,u,c=r[0],h=r[1],l=r[2],f=r[3],p=e[0]^t[0],d=e[1]^t[1],g=e[2]^t[2],m=e[3]^t[3],y=4,v=1;v<n;v++)o=c[p>>>24]^h[d>>>16&255]^l[g>>>8&255]^f[255&m]^t[y++],a=c[d>>>24]^h[g>>>16&255]^l[m>>>8&255]^f[255&p]^t[y++],s=c[g>>>24]^h[m>>>16&255]^l[p>>>8&255]^f[255&d]^t[y++],u=c[m>>>24]^h[p>>>16&255]^l[d>>>8&255]^f[255&g]^t[y++],p=o,d=a,g=s,m=u;return o=(i[p>>>24]<<24|i[d>>>16&255]<<16|i[g>>>8&255]<<8|i[255&m])^t[y++],a=(i[d>>>24]<<24|i[g>>>16&255]<<16|i[m>>>8&255]<<8|i[255&p])^t[y++],s=(i[g>>>24]<<24|i[m>>>16&255]<<16|i[p>>>8&255]<<8|i[255&d])^t[y++],u=(i[m>>>24]<<24|i[p>>>16&255]<<16|i[d>>>8&255]<<8|i[255&g])^t[y++],[o>>>=0,a>>>=0,s>>>=0,u>>>=0]}var s=[0,1,2,4,8,16,32,64,128,27,54],u=function(){for(var e=new Array(256),t=0;t<256;t++)e[t]=t<128?t<<1:t<<1^283;for(var r=[],i=[],n=[[],[],[],[]],o=[[],[],[],[]],a=0,s=0,u=0;u<256;++u){var c=s^s<<1^s<<2^s<<3^s<<4;c=c>>>8^255&c^99,r[a]=c,i[c]=a;var h=e[a],l=e[h],f=e[l],p=257*e[c]^16843008*c;n[0][a]=p<<24|p>>>8,n[1][a]=p<<16|p>>>16,n[2][a]=p<<8|p>>>24,n[3][a]=p,p=16843009*f^65537*l^257*h^16843008*a,o[0][c]=p<<24|p>>>8,o[1][c]=p<<16|p>>>16,o[2][c]=p<<8|p>>>24,o[3][c]=p,0===a?a=s=1:(a=h^e[e[e[f^h]]],s^=e[e[s]])}return{SBOX:r,INV_SBOX:i,SUB_MIX:n,INV_SUB_MIX:o}}();function c(e){this._key=n(e),this._reset()}c.blockSize=16,c.keySize=32,c.prototype.blockSize=c.blockSize,c.prototype.keySize=c.keySize,c.prototype._reset=function(){for(var e=this._key,t=e.length,r=t+6,i=4*(r+1),n=[],o=0;o<t;o++)n[o]=e[o];for(o=t;o<i;o++){var a=n[o-1];o%t===0?(a=a<<8|a>>>24,a=u.SBOX[a>>>24]<<24|u.SBOX[a>>>16&255]<<16|u.SBOX[a>>>8&255]<<8|u.SBOX[255&a],a^=s[o/t|0]<<24):t>6&&o%t===4&&(a=u.SBOX[a>>>24]<<24|u.SBOX[a>>>16&255]<<16|u.SBOX[a>>>8&255]<<8|u.SBOX[255&a]),n[o]=n[o-t]^a}for(var c=[],h=0;h<i;h++){var l=i-h,f=n[l-(h%4?0:4)];c[h]=h<4||l<=4?f:u.INV_SUB_MIX[0][u.SBOX[f>>>24]]^u.INV_SUB_MIX[1][u.SBOX[f>>>16&255]]^u.INV_SUB_MIX[2][u.SBOX[f>>>8&255]]^u.INV_SUB_MIX[3][u.SBOX[255&f]]}this._nRounds=r,this._keySchedule=n,this._invKeySchedule=c},c.prototype.encryptBlockRaw=function(e){return a(e=n(e),this._keySchedule,u.SUB_MIX,u.SBOX,this._nRounds)},c.prototype.encryptBlock=function(e){var t=this.encryptBlockRaw(e),r=i.allocUnsafe(16);return r.writeUInt32BE(t[0],0),r.writeUInt32BE(t[1],4),r.writeUInt32BE(t[2],8),r.writeUInt32BE(t[3],12),r},c.prototype.decryptBlock=function(e){var t=(e=n(e))[1];e[1]=e[3],e[3]=t;var r=a(e,this._invKeySchedule,u.INV_SUB_MIX,u.INV_SBOX,this._nRounds),o=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},c.prototype.scrub=function(){o(this._keySchedule),o(this._invKeySchedule),o(this._key)},e.exports.AES=c},2356(e,t,r){var i=r(462),n=r(2861).Buffer,o=r(6168),a=r(6698),s=r(5892),u=r(295),c=r(5122);function h(e,t,r,a){o.call(this);var u=n.alloc(4,0);this._cipher=new i.AES(t);var h=this._cipher.encryptBlock(u);this._ghash=new s(h),r=function(e,t,r){if(12===t.length)return e._finID=n.concat([t,n.from([0,0,0,1])]),n.concat([t,n.from([0,0,0,2])]);var i=new s(r),o=t.length,a=o%16;i.update(t),a&&(a=16-a,i.update(n.alloc(a,0))),i.update(n.alloc(8,0));var u=8*o,h=n.alloc(8);h.writeUIntBE(u,0,8),i.update(h),e._finID=i.state;var l=n.from(e._finID);return c(l),l}(this,r,h),this._prev=n.from(r),this._cache=n.allocUnsafe(0),this._secCache=n.allocUnsafe(0),this._decrypt=a,this._alen=0,this._len=0,this._mode=e,this._authTag=null,this._called=!1}a(h,o),h.prototype._update=function(e){if(!this._called&&this._alen){var t=16-this._alen%16;t<16&&(t=n.alloc(t,0),this._ghash.update(t))}this._called=!0;var r=this._mode.encrypt(this,e);return this._decrypt?this._ghash.update(e):this._ghash.update(r),this._len+=e.length,r},h.prototype._final=function(){if(this._decrypt&&!this._authTag)throw new Error("Unsupported state or unable to authenticate data");var e=u(this._ghash.final(8*this._alen,8*this._len),this._cipher.encryptBlock(this._finID));if(this._decrypt&&function(e,t){var r=0;e.length!==t.length&&r++;for(var i=Math.min(e.length,t.length),n=0;n<i;++n)r+=e[n]^t[n];return r}(e,this._authTag))throw new Error("Unsupported state or unable to authenticate data");this._authTag=e,this._cipher.scrub()},h.prototype.getAuthTag=function(){if(this._decrypt||!n.isBuffer(this._authTag))throw new Error("Attempting to get auth tag in unsupported state");return this._authTag},h.prototype.setAuthTag=function(e){if(!this._decrypt)throw new Error("Attempting to set auth tag in unsupported state");this._authTag=e},h.prototype.setAAD=function(e){if(this._called)throw new Error("Attempting to set AAD in unsupported state");this._ghash.update(e),this._alen+=e.length},e.exports=h},1241(e,t,r){var i=r(5799),n=r(6171),o=r(3219);t.createCipher=t.Cipher=i.createCipher,t.createCipheriv=t.Cipheriv=i.createCipheriv,t.createDecipher=t.Decipher=n.createDecipher,t.createDecipheriv=t.Decipheriv=n.createDecipheriv,t.listCiphers=t.getCiphers=function(){return Object.keys(o)}},6171(e,t,r){var i=r(2356),n=r(2861).Buffer,o=r(530),a=r(650),s=r(6168),u=r(462),c=r(8078);function h(e,t,r){s.call(this),this._cache=new l,this._last=void 0,this._cipher=new u.AES(t),this._prev=n.from(r),this._mode=e,this._autopadding=!0}function l(){this.cache=n.allocUnsafe(0)}function f(e,t,r){var s=o[e.toLowerCase()];if(!s)throw new TypeError("invalid suite type");if("string"==typeof r&&(r=n.from(r)),"GCM"!==s.mode&&r.length!==s.iv)throw new TypeError("invalid iv length "+r.length);if("string"==typeof t&&(t=n.from(t)),t.length!==s.key/8)throw new TypeError("invalid key length "+t.length);return"stream"===s.type?new a(s.module,t,r,!0):"auth"===s.type?new i(s.module,t,r,!0):new h(s.module,t,r)}r(6698)(h,s),h.prototype._update=function(e){var t,r;this._cache.add(e);for(var i=[];t=this._cache.get(this._autopadding);)r=this._mode.decrypt(this,t),i.push(r);return n.concat(i)},h.prototype._final=function(){var e=this._cache.flush();if(this._autopadding)return function(e){var t=e[15];if(t<1||t>16)throw new Error("unable to decrypt data");var r=-1;for(;++r<t;)if(e[r+(16-t)]!==t)throw new Error("unable to decrypt data");if(16===t)return;return e.slice(0,16-t)}(this._mode.decrypt(this,e));if(e)throw new Error("data not multiple of block length")},h.prototype.setAutoPadding=function(e){return this._autopadding=!!e,this},l.prototype.add=function(e){this.cache=n.concat([this.cache,e])},l.prototype.get=function(e){var t;if(e){if(this.cache.length>16)return t=this.cache.slice(0,16),this.cache=this.cache.slice(16),t}else if(this.cache.length>=16)return t=this.cache.slice(0,16),this.cache=this.cache.slice(16),t;return null},l.prototype.flush=function(){if(this.cache.length)return this.cache},t.createDecipher=function(e,t){var r=o[e.toLowerCase()];if(!r)throw new TypeError("invalid suite type");var i=c(t,!1,r.key,r.iv);return f(e,i.key,i.iv)},t.createDecipheriv=f},5799(e,t,r){var i=r(530),n=r(2356),o=r(2861).Buffer,a=r(650),s=r(6168),u=r(462),c=r(8078);function h(e,t,r){s.call(this),this._cache=new f,this._cipher=new u.AES(t),this._prev=o.from(r),this._mode=e,this._autopadding=!0}r(6698)(h,s),h.prototype._update=function(e){var t,r;this._cache.add(e);for(var i=[];t=this._cache.get();)r=this._mode.encrypt(this,t),i.push(r);return o.concat(i)};var l=o.alloc(16,16);function f(){this.cache=o.allocUnsafe(0)}function p(e,t,r){var s=i[e.toLowerCase()];if(!s)throw new TypeError("invalid suite type");if("string"==typeof t&&(t=o.from(t)),t.length!==s.key/8)throw new TypeError("invalid key length "+t.length);if("string"==typeof r&&(r=o.from(r)),"GCM"!==s.mode&&r.length!==s.iv)throw new TypeError("invalid iv length "+r.length);return"stream"===s.type?new a(s.module,t,r):"auth"===s.type?new n(s.module,t,r):new h(s.module,t,r)}h.prototype._final=function(){var e=this._cache.flush();if(this._autopadding)return e=this._mode.encrypt(this,e),this._cipher.scrub(),e;if(!e.equals(l))throw this._cipher.scrub(),new Error("data not multiple of block length")},h.prototype.setAutoPadding=function(e){return this._autopadding=!!e,this},f.prototype.add=function(e){this.cache=o.concat([this.cache,e])},f.prototype.get=function(){if(this.cache.length>15){var e=this.cache.slice(0,16);return this.cache=this.cache.slice(16),e}return null},f.prototype.flush=function(){for(var e=16-this.cache.length,t=o.allocUnsafe(e),r=-1;++r<e;)t.writeUInt8(e,r);return o.concat([this.cache,t])},t.createCipheriv=p,t.createCipher=function(e,t){var r=i[e.toLowerCase()];if(!r)throw new TypeError("invalid suite type");var n=c(t,!1,r.key,r.iv);return p(e,n.key,n.iv)}},5892(e,t,r){var i=r(2861).Buffer,n=i.alloc(16,0);function o(e){var t=i.allocUnsafe(16);return t.writeUInt32BE(e[0]>>>0,0),t.writeUInt32BE(e[1]>>>0,4),t.writeUInt32BE(e[2]>>>0,8),t.writeUInt32BE(e[3]>>>0,12),t}function a(e){this.h=e,this.state=i.alloc(16,0),this.cache=i.allocUnsafe(0)}a.prototype.ghash=function(e){for(var t=-1;++t<e.length;)this.state[t]^=e[t];this._multiply()},a.prototype._multiply=function(){for(var e,t,r,i=[(e=this.h).readUInt32BE(0),e.readUInt32BE(4),e.readUInt32BE(8),e.readUInt32BE(12)],n=[0,0,0,0],a=-1;++a<128;){for(!!(this.state[~~(a/8)]&1<<7-a%8)&&(n[0]^=i[0],n[1]^=i[1],n[2]^=i[2],n[3]^=i[3]),r=!!(1&i[3]),t=3;t>0;t--)i[t]=i[t]>>>1|(1&i[t-1])<<31;i[0]=i[0]>>>1,r&&(i[0]=i[0]^225<<24)}this.state=o(n)},a.prototype.update=function(e){var t;for(this.cache=i.concat([this.cache,e]);this.cache.length>=16;)t=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(t)},a.prototype.final=function(e,t){return this.cache.length&&this.ghash(i.concat([this.cache,n],16)),this.ghash(o([0,e,0,t])),this.state},e.exports=a},5122(e){e.exports=function(e){for(var t,r=e.length;r--;){if(255!==(t=e.readUInt8(r))){t++,e.writeUInt8(t,r);break}e.writeUInt8(0,r)}}},2884(e,t,r){var i=r(295);t.encrypt=function(e,t){var r=i(t,e._prev);return e._prev=e._cipher.encryptBlock(r),e._prev},t.decrypt=function(e,t){var r=e._prev;e._prev=t;var n=e._cipher.decryptBlock(t);return i(n,r)}},6383(e,t,r){var i=r(2861).Buffer,n=r(295);function o(e,t,r){var o=t.length,a=n(t,e._cache);return e._cache=e._cache.slice(o),e._prev=i.concat([e._prev,r?t:a]),a}t.encrypt=function(e,t,r){for(var n,a=i.allocUnsafe(0);t.length;){if(0===e._cache.length&&(e._cache=e._cipher.encryptBlock(e._prev),e._prev=i.allocUnsafe(0)),!(e._cache.length<=t.length)){a=i.concat([a,o(e,t,r)]);break}n=e._cache.length,a=i.concat([a,o(e,t.slice(0,n),r)]),t=t.slice(n)}return a}},5264(e,t,r){var i=r(2861).Buffer;function n(e,t,r){for(var i,n,a=-1,s=0;++a<8;)i=t&1<<7-a?128:0,s+=(128&(n=e._cipher.encryptBlock(e._prev)[0]^i))>>a%8,e._prev=o(e._prev,r?i:n);return s}function o(e,t){var r=e.length,n=-1,o=i.allocUnsafe(e.length);for(e=i.concat([e,i.from([t])]);++n<r;)o[n]=e[n]<<1|e[n+1]>>7;return o}t.encrypt=function(e,t,r){for(var o=t.length,a=i.allocUnsafe(o),s=-1;++s<o;)a[s]=n(e,t[s],r);return a}},6975(e,t,r){var i=r(2861).Buffer;function n(e,t,r){var n=e._cipher.encryptBlock(e._prev)[0]^t;return e._prev=i.concat([e._prev.slice(1),i.from([r?t:n])]),n}t.encrypt=function(e,t,r){for(var o=t.length,a=i.allocUnsafe(o),s=-1;++s<o;)a[s]=n(e,t[s],r);return a}},3053(e,t,r){var i=r(295),n=r(2861).Buffer,o=r(5122);function a(e){var t=e._cipher.encryptBlockRaw(e._prev);return o(e._prev),t}t.encrypt=function(e,t){var r=Math.ceil(t.length/16),o=e._cache.length;e._cache=n.concat([e._cache,n.allocUnsafe(16*r)]);for(var s=0;s<r;s++){var u=a(e),c=o+16*s;e._cache.writeUInt32BE(u[0],c+0),e._cache.writeUInt32BE(u[1],c+4),e._cache.writeUInt32BE(u[2],c+8),e._cache.writeUInt32BE(u[3],c+12)}var h=e._cache.slice(0,t.length);return e._cache=e._cache.slice(t.length),i(t,h)}},2632(e,t){t.encrypt=function(e,t){return e._cipher.encryptBlock(t)},t.decrypt=function(e,t){return e._cipher.decryptBlock(t)}},530(e,t,r){var i={ECB:r(2632),CBC:r(2884),CFB:r(6383),CFB8:r(6975),CFB1:r(5264),OFB:r(6843),CTR:r(3053),GCM:r(3053)},n=r(3219);for(var o in n)n[o].module=i[n[o].mode];e.exports=n},6843(e,t,r){var i=r(8287).Buffer,n=r(295);function o(e){return e._prev=e._cipher.encryptBlock(e._prev),e._prev}t.encrypt=function(e,t){for(;e._cache.length<t.length;)e._cache=i.concat([e._cache,o(e)]);var r=e._cache.slice(0,t.length);return e._cache=e._cache.slice(t.length),n(t,r)}},650(e,t,r){var i=r(462),n=r(2861).Buffer,o=r(6168);function a(e,t,r,a){o.call(this),this._cipher=new i.AES(t),this._prev=n.from(r),this._cache=n.allocUnsafe(0),this._secCache=n.allocUnsafe(0),this._decrypt=a,this._mode=e}r(6698)(a,o),a.prototype._update=function(e){return this._mode.encrypt(this,e,this._decrypt)},a.prototype._final=function(){this._cipher.scrub()},e.exports=a},125(e,t,r){var i=r(4050),n=r(1241),o=r(530),a=r(2438),s=r(8078);function u(e,t,r){if(e=e.toLowerCase(),o[e])return n.createCipheriv(e,t,r);if(a[e])return new i({key:t,iv:r,mode:e});throw new TypeError("invalid suite type")}function c(e,t,r){if(e=e.toLowerCase(),o[e])return n.createDecipheriv(e,t,r);if(a[e])return new i({key:t,iv:r,mode:e,decrypt:!0});throw new TypeError("invalid suite type")}t.createCipher=t.Cipher=function(e,t){var r,i;if(e=e.toLowerCase(),o[e])r=o[e].key,i=o[e].iv;else{if(!a[e])throw new TypeError("invalid suite type");r=8*a[e].key,i=a[e].iv}var n=s(t,!1,r,i);return u(e,n.key,n.iv)},t.createCipheriv=t.Cipheriv=u,t.createDecipher=t.Decipher=function(e,t){var r,i;if(e=e.toLowerCase(),o[e])r=o[e].key,i=o[e].iv;else{if(!a[e])throw new TypeError("invalid suite type");r=8*a[e].key,i=a[e].iv}var n=s(t,!1,r,i);return c(e,n.key,n.iv)},t.createDecipheriv=t.Decipheriv=c,t.listCiphers=t.getCiphers=function(){return Object.keys(a).concat(n.getCiphers())}},4050(e,t,r){var i=r(6168),n=r(9560),o=r(6698),a=r(2861).Buffer,s={"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 u(e){i.call(this);var t,r=e.mode.toLowerCase(),n=s[r];t=e.decrypt?"decrypt":"encrypt";var o=e.key;a.isBuffer(o)||(o=a.from(o)),"des-ede"!==r&&"des-ede-cbc"!==r||(o=a.concat([o,o.slice(0,8)]));var u=e.iv;a.isBuffer(u)||(u=a.from(u)),this._des=n.create({key:o,iv:u,type:t})}s.des=s["des-cbc"],s.des3=s["des-ede3-cbc"],e.exports=u,o(u,i),u.prototype._update=function(e){return a.from(this._des.update(e))},u.prototype._final=function(){return a.from(this._des.final())}},2438(e,t){t["des-ecb"]={key:8,iv:0},t["des-cbc"]=t.des={key:8,iv:8},t["des-ede3-cbc"]=t.des3={key:24,iv:8},t["des-ede3"]={key:24,iv:0},t["des-ede-cbc"]={key:16,iv:8},t["des-ede"]={key:16,iv:0}},7332(e,t,r){"use strict";var i=r(8893),n=r(3209),o=r(2861).Buffer;function a(e){var t,r=e.modulus.byteLength();do{t=new i(n(r))}while(t.cmp(e.modulus)>=0||!t.umod(e.prime1)||!t.umod(e.prime2));return t}function s(e,t){var r=function(e){var t=a(e);return{blinder:t.toRed(i.mont(e.modulus)).redPow(new i(e.publicExponent)).fromRed(),unblinder:t.invm(e.modulus)}}(t),n=t.modulus.byteLength(),s=new i(e).mul(r.blinder).umod(t.modulus),u=s.toRed(i.mont(t.prime1)),c=s.toRed(i.mont(t.prime2)),h=t.coefficient,l=t.prime1,f=t.prime2,p=u.redPow(t.exponent1).fromRed(),d=c.redPow(t.exponent2).fromRed(),g=p.isub(d).imul(h).umod(l).imul(f);return d.iadd(g).imul(r.unblinder).umod(t.modulus).toArrayLike(o,"be",n)}s.getr=a,e.exports=s},8893(e,t,r){!function(e,t){"use strict";function i(e,t){if(!e)throw new Error(t||"Assertion failed")}function n(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function o(e,t,r){if(o.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var a;"object"==typeof e?e.exports=o:t.BN=o,o.BN=o,o.wordSize=26;try{a="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r(8285).Buffer}catch(e){}function s(e,t){var r=e.charCodeAt(t);return r>=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:void i(!1,"Invalid character in "+e)}function u(e,t,r){var i=s(e,r);return r-1>=t&&(i|=s(e,r-1)<<4),i}function c(e,t,r,n){for(var o=0,a=0,s=Math.min(e.length,r),u=t;u<s;u++){var c=e.charCodeAt(u)-48;o*=n,a=c>=49?c-49+10:c>=17?c-17+10:c,i(c>=0&&a<n,"Invalid character"),o+=a}return o}function h(e,t){e.words=t.words,e.length=t.length,e.negative=t.negative,e.red=t.red}if(o.isBN=function(e){return e instanceof o||null!==e&&"object"==typeof e&&e.constructor.wordSize===o.wordSize&&Array.isArray(e.words)},o.max=function(e,t){return e.cmp(t)>0?e:t},o.min=function(e,t){return e.cmp(t)<0?e:t},o.prototype._init=function(e,t,r){if("number"==typeof e)return this._initNumber(e,t,r);if("object"==typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),i(t===(0|t)&&t>=2&&t<=36);var n=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(n++,this.negative=1),n<e.length&&(16===t?this._parseHex(e,n,r):(this._parseBase(e,t,n),"le"===r&&this._initArray(this.toArray(),t,r)))},o.prototype._initNumber=function(e,t,r){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(i(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),t,r)},o.prototype._initArray=function(e,t,r){if(i("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var o,a,s=0;if("be"===r)for(n=e.length-1,o=0;n>=0;n-=3)a=e[n]|e[n-1]<<8|e[n-2]<<16,this.words[o]|=a<<s&67108863,this.words[o+1]=a>>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);else if("le"===r)for(n=0,o=0;n<e.length;n+=3)a=e[n]|e[n+1]<<8|e[n+2]<<16,this.words[o]|=a<<s&67108863,this.words[o+1]=a>>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);return this._strip()},o.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var n,o=0,a=0;if("be"===r)for(i=e.length-1;i>=t;i-=2)n=u(e,t,i)<<o,this.words[a]|=67108863&n,o>=18?(o-=18,a+=1,this.words[a]|=n>>>26):o+=8;else for(i=(e.length-t)%2==0?t+1:t;i<e.length;i+=2)n=u(e,t,i)<<o,this.words[a]|=67108863&n,o>=18?(o-=18,a+=1,this.words[a]|=n>>>26):o+=8;this._strip()},o.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var i=0,n=1;n<=67108863;n*=t)i++;i--,n=n/t|0;for(var o=e.length-r,a=o%i,s=Math.min(o,o-a)+r,u=0,h=r;h<s;h+=i)u=c(e,h,h+i,t),this.imuln(n),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(0!==a){var l=1;for(u=c(e,h,e.length,t),h=0;h<a;h++)l*=t;this.imuln(l),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}this._strip()},o.prototype.copy=function(e){e.words=new Array(this.length);for(var t=0;t<this.length;t++)e.words[t]=this.words[t];e.length=this.length,e.negative=this.negative,e.red=this.red},o.prototype._move=function(e){h(e,this)},o.prototype.clone=function(){var e=new o(null);return this.copy(e),e},o.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},o.prototype._strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{o.prototype[Symbol.for("nodejs.util.inspect.custom")]=l}catch(e){o.prototype.inspect=l}else o.prototype.inspect=l;function l(){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"],p=[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(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var n=0,o=0,a=0;a<this.length;a++){var s=this.words[a],u=(16777215&(s<<n|o)).toString(16);o=s>>>24-n&16777215,(n+=2)>=26&&(n-=26,a--),r=0!==o||a!==this.length-1?f[6-u.length]+u+r:u+r}for(0!==o&&(r=o.toString(16)+r);r.length%t!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var c=p[e],h=d[e];r="";var l=this.clone();for(l.negative=0;!l.isZero();){var g=l.modrn(h).toString(e);r=(l=l.idivn(h)).isZero()?g+r:f[c-g.length]+g+r}for(this.isZero()&&(r="0"+r);r.length%t!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}i(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},o.prototype.toJSON=function(){return this.toString(16,2)},a&&(o.prototype.toBuffer=function(e,t){return this.toArrayLike(a,e,t)}),o.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)};function g(e,t,r){r.negative=t.negative^e.negative;var i=e.length+t.length|0;r.length=i,i=i-1|0;var n=0|e.words[0],o=0|t.words[0],a=n*o,s=67108863&a,u=a/67108864|0;r.words[0]=s;for(var c=1;c<i;c++){for(var h=u>>>26,l=67108863&u,f=Math.min(c,t.length-1),p=Math.max(0,c-e.length+1);p<=f;p++){var d=c-p|0;h+=(a=(n=0|e.words[d])*(o=0|t.words[p])+l)/67108864|0,l=67108863&a}r.words[c]=0|l,u=0|h}return 0!==u?r.words[c]=0|u:r.length--,r._strip()}o.prototype.toArrayLike=function(e,t,r){this._strip();var n=this.byteLength(),o=r||Math.max(1,n);i(n<=o,"byte array longer than desired length"),i(o>0,"Requested array length <= 0");var a=function(e,t){return e.allocUnsafe?e.allocUnsafe(t):new e(t)}(e,o);return this["_toArrayLike"+("le"===t?"LE":"BE")](a,n),a},o.prototype._toArrayLikeLE=function(e,t){for(var r=0,i=0,n=0,o=0;n<this.length;n++){var a=this.words[n]<<o|i;e[r++]=255&a,r<e.length&&(e[r++]=a>>8&255),r<e.length&&(e[r++]=a>>16&255),6===o?(r<e.length&&(e[r++]=a>>24&255),i=0,o=0):(i=a>>>24,o+=2)}if(r<e.length)for(e[r++]=i;r<e.length;)e[r++]=0},o.prototype._toArrayLikeBE=function(e,t){for(var r=e.length-1,i=0,n=0,o=0;n<this.length;n++){var a=this.words[n]<<o|i;e[r--]=255&a,r>=0&&(e[r--]=a>>8&255),r>=0&&(e[r--]=a>>16&255),6===o?(r>=0&&(e[r--]=a>>24&255),i=0,o=0):(i=a>>>24,o+=2)}if(r>=0)for(e[r--]=i;r>=0;)e[r--]=0},Math.clz32?o.prototype._countBits=function(e){return 32-Math.clz32(e)}:o.prototype._countBits=function(e){var t=e,r=0;return t>=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},o.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 8191&t||(r+=13,t>>>=13),127&t||(r+=7,t>>>=7),15&t||(r+=4,t>>>=4),3&t||(r+=2,t>>>=2),1&t||r++,r},o.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;t<this.length;t++){var r=this._zeroBits(this.words[t]);if(e+=r,26!==r)break}return e},o.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},o.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},o.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},o.prototype.isNeg=function(){return 0!==this.negative},o.prototype.neg=function(){return this.clone().ineg()},o.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},o.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var t=0;t<e.length;t++)this.words[t]=this.words[t]|e.words[t];return this._strip()},o.prototype.ior=function(e){return i(0===(this.negative|e.negative)),this.iuor(e)},o.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},o.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},o.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;r<t.length;r++)this.words[r]=this.words[r]&e.words[r];return this.length=t.length,this._strip()},o.prototype.iand=function(e){return i(0===(this.negative|e.negative)),this.iuand(e)},o.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},o.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},o.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var i=0;i<r.length;i++)this.words[i]=t.words[i]^r.words[i];if(this!==t)for(;i<t.length;i++)this.words[i]=t.words[i];return this.length=t.length,this._strip()},o.prototype.ixor=function(e){return i(0===(this.negative|e.negative)),this.iuxor(e)},o.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},o.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},o.prototype.inotn=function(e){i("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var n=0;n<t;n++)this.words[n]=67108863&~this.words[n];return r>0&&(this.words[n]=~this.words[n]&67108863>>26-r),this._strip()},o.prototype.notn=function(e){return this.clone().inotn(e)},o.prototype.setn=function(e,t){i("number"==typeof e&&e>=0);var r=e/26|0,n=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<<n:this.words[r]&~(1<<n),this._strip()},o.prototype.iadd=function(e){var t,r,i;if(0!==this.negative&&0===e.negative)return this.negative=0,t=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,t=this.isub(e),e.negative=1,t._normSign();this.length>e.length?(r=this,i=e):(r=e,i=this);for(var n=0,o=0;o<i.length;o++)t=(0|r.words[o])+(0|i.words[o])+n,this.words[o]=67108863&t,n=t>>>26;for(;0!==n&&o<r.length;o++)t=(0|r.words[o])+n,this.words[o]=67108863&t,n=t>>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this},o.prototype.add=function(e){var t;return 0!==e.negative&&0===this.negative?(e.negative=0,t=this.sub(e),e.negative^=1,t):0===e.negative&&0!==this.negative?(this.negative=0,t=e.sub(this),this.negative=1,t):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},o.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,i,n=this.cmp(e);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(r=this,i=e):(r=e,i=this);for(var o=0,a=0;a<i.length;a++)o=(t=(0|r.words[a])-(0|i.words[a])+o)>>26,this.words[a]=67108863&t;for(;0!==o&&a<r.length;a++)o=(t=(0|r.words[a])+o)>>26,this.words[a]=67108863&t;if(0===o&&a<r.length&&r!==this)for(;a<r.length;a++)this.words[a]=r.words[a];return this.length=Math.max(this.length,a),r!==this&&(this.negative=1),this._strip()},o.prototype.sub=function(e){return this.clone().isub(e)};var m=function(e,t,r){var i,n,o,a=e.words,s=t.words,u=r.words,c=0,h=0|a[0],l=8191&h,f=h>>>13,p=0|a[1],d=8191&p,g=p>>>13,m=0|a[2],y=8191&m,v=m>>>13,b=0|a[3],_=8191&b,w=b>>>13,S=0|a[4],E=8191&S,k=S>>>13,O=0|a[5],I=8191&O,A=O>>>13,x=0|a[6],P=8191&x,T=x>>>13,R=0|a[7],M=8191&R,B=R>>>13,C=0|a[8],N=8191&C,D=C>>>13,L=0|a[9],j=8191&L,U=L>>>13,H=0|s[0],F=8191&H,z=H>>>13,K=0|s[1],V=8191&K,q=K>>>13,G=0|s[2],Z=8191&G,Y=G>>>13,W=0|s[3],X=8191&W,$=W>>>13,J=0|s[4],Q=8191&J,ee=J>>>13,te=0|s[5],re=8191&te,ie=te>>>13,ne=0|s[6],oe=8191&ne,ae=ne>>>13,se=0|s[7],ue=8191&se,ce=se>>>13,he=0|s[8],le=8191&he,fe=he>>>13,pe=0|s[9],de=8191&pe,ge=pe>>>13;r.negative=e.negative^t.negative,r.length=19;var me=(c+(i=Math.imul(l,F))|0)+((8191&(n=(n=Math.imul(l,z))+Math.imul(f,F)|0))<<13)|0;c=((o=Math.imul(f,z))+(n>>>13)|0)+(me>>>26)|0,me&=67108863,i=Math.imul(d,F),n=(n=Math.imul(d,z))+Math.imul(g,F)|0,o=Math.imul(g,z);var ye=(c+(i=i+Math.imul(l,V)|0)|0)+((8191&(n=(n=n+Math.imul(l,q)|0)+Math.imul(f,V)|0))<<13)|0;c=((o=o+Math.imul(f,q)|0)+(n>>>13)|0)+(ye>>>26)|0,ye&=67108863,i=Math.imul(y,F),n=(n=Math.imul(y,z))+Math.imul(v,F)|0,o=Math.imul(v,z),i=i+Math.imul(d,V)|0,n=(n=n+Math.imul(d,q)|0)+Math.imul(g,V)|0,o=o+Math.imul(g,q)|0;var ve=(c+(i=i+Math.imul(l,Z)|0)|0)+((8191&(n=(n=n+Math.imul(l,Y)|0)+Math.imul(f,Z)|0))<<13)|0;c=((o=o+Math.imul(f,Y)|0)+(n>>>13)|0)+(ve>>>26)|0,ve&=67108863,i=Math.imul(_,F),n=(n=Math.imul(_,z))+Math.imul(w,F)|0,o=Math.imul(w,z),i=i+Math.imul(y,V)|0,n=(n=n+Math.imul(y,q)|0)+Math.imul(v,V)|0,o=o+Math.imul(v,q)|0,i=i+Math.imul(d,Z)|0,n=(n=n+Math.imul(d,Y)|0)+Math.imul(g,Z)|0,o=o+Math.imul(g,Y)|0;var be=(c+(i=i+Math.imul(l,X)|0)|0)+((8191&(n=(n=n+Math.imul(l,$)|0)+Math.imul(f,X)|0))<<13)|0;c=((o=o+Math.imul(f,$)|0)+(n>>>13)|0)+(be>>>26)|0,be&=67108863,i=Math.imul(E,F),n=(n=Math.imul(E,z))+Math.imul(k,F)|0,o=Math.imul(k,z),i=i+Math.imul(_,V)|0,n=(n=n+Math.imul(_,q)|0)+Math.imul(w,V)|0,o=o+Math.imul(w,q)|0,i=i+Math.imul(y,Z)|0,n=(n=n+Math.imul(y,Y)|0)+Math.imul(v,Z)|0,o=o+Math.imul(v,Y)|0,i=i+Math.imul(d,X)|0,n=(n=n+Math.imul(d,$)|0)+Math.imul(g,X)|0,o=o+Math.imul(g,$)|0;var _e=(c+(i=i+Math.imul(l,Q)|0)|0)+((8191&(n=(n=n+Math.imul(l,ee)|0)+Math.imul(f,Q)|0))<<13)|0;c=((o=o+Math.imul(f,ee)|0)+(n>>>13)|0)+(_e>>>26)|0,_e&=67108863,i=Math.imul(I,F),n=(n=Math.imul(I,z))+Math.imul(A,F)|0,o=Math.imul(A,z),i=i+Math.imul(E,V)|0,n=(n=n+Math.imul(E,q)|0)+Math.imul(k,V)|0,o=o+Math.imul(k,q)|0,i=i+Math.imul(_,Z)|0,n=(n=n+Math.imul(_,Y)|0)+Math.imul(w,Z)|0,o=o+Math.imul(w,Y)|0,i=i+Math.imul(y,X)|0,n=(n=n+Math.imul(y,$)|0)+Math.imul(v,X)|0,o=o+Math.imul(v,$)|0,i=i+Math.imul(d,Q)|0,n=(n=n+Math.imul(d,ee)|0)+Math.imul(g,Q)|0,o=o+Math.imul(g,ee)|0;var we=(c+(i=i+Math.imul(l,re)|0)|0)+((8191&(n=(n=n+Math.imul(l,ie)|0)+Math.imul(f,re)|0))<<13)|0;c=((o=o+Math.imul(f,ie)|0)+(n>>>13)|0)+(we>>>26)|0,we&=67108863,i=Math.imul(P,F),n=(n=Math.imul(P,z))+Math.imul(T,F)|0,o=Math.imul(T,z),i=i+Math.imul(I,V)|0,n=(n=n+Math.imul(I,q)|0)+Math.imul(A,V)|0,o=o+Math.imul(A,q)|0,i=i+Math.imul(E,Z)|0,n=(n=n+Math.imul(E,Y)|0)+Math.imul(k,Z)|0,o=o+Math.imul(k,Y)|0,i=i+Math.imul(_,X)|0,n=(n=n+Math.imul(_,$)|0)+Math.imul(w,X)|0,o=o+Math.imul(w,$)|0,i=i+Math.imul(y,Q)|0,n=(n=n+Math.imul(y,ee)|0)+Math.imul(v,Q)|0,o=o+Math.imul(v,ee)|0,i=i+Math.imul(d,re)|0,n=(n=n+Math.imul(d,ie)|0)+Math.imul(g,re)|0,o=o+Math.imul(g,ie)|0;var Se=(c+(i=i+Math.imul(l,oe)|0)|0)+((8191&(n=(n=n+Math.imul(l,ae)|0)+Math.imul(f,oe)|0))<<13)|0;c=((o=o+Math.imul(f,ae)|0)+(n>>>13)|0)+(Se>>>26)|0,Se&=67108863,i=Math.imul(M,F),n=(n=Math.imul(M,z))+Math.imul(B,F)|0,o=Math.imul(B,z),i=i+Math.imul(P,V)|0,n=(n=n+Math.imul(P,q)|0)+Math.imul(T,V)|0,o=o+Math.imul(T,q)|0,i=i+Math.imul(I,Z)|0,n=(n=n+Math.imul(I,Y)|0)+Math.imul(A,Z)|0,o=o+Math.imul(A,Y)|0,i=i+Math.imul(E,X)|0,n=(n=n+Math.imul(E,$)|0)+Math.imul(k,X)|0,o=o+Math.imul(k,$)|0,i=i+Math.imul(_,Q)|0,n=(n=n+Math.imul(_,ee)|0)+Math.imul(w,Q)|0,o=o+Math.imul(w,ee)|0,i=i+Math.imul(y,re)|0,n=(n=n+Math.imul(y,ie)|0)+Math.imul(v,re)|0,o=o+Math.imul(v,ie)|0,i=i+Math.imul(d,oe)|0,n=(n=n+Math.imul(d,ae)|0)+Math.imul(g,oe)|0,o=o+Math.imul(g,ae)|0;var Ee=(c+(i=i+Math.imul(l,ue)|0)|0)+((8191&(n=(n=n+Math.imul(l,ce)|0)+Math.imul(f,ue)|0))<<13)|0;c=((o=o+Math.imul(f,ce)|0)+(n>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,i=Math.imul(N,F),n=(n=Math.imul(N,z))+Math.imul(D,F)|0,o=Math.imul(D,z),i=i+Math.imul(M,V)|0,n=(n=n+Math.imul(M,q)|0)+Math.imul(B,V)|0,o=o+Math.imul(B,q)|0,i=i+Math.imul(P,Z)|0,n=(n=n+Math.imul(P,Y)|0)+Math.imul(T,Z)|0,o=o+Math.imul(T,Y)|0,i=i+Math.imul(I,X)|0,n=(n=n+Math.imul(I,$)|0)+Math.imul(A,X)|0,o=o+Math.imul(A,$)|0,i=i+Math.imul(E,Q)|0,n=(n=n+Math.imul(E,ee)|0)+Math.imul(k,Q)|0,o=o+Math.imul(k,ee)|0,i=i+Math.imul(_,re)|0,n=(n=n+Math.imul(_,ie)|0)+Math.imul(w,re)|0,o=o+Math.imul(w,ie)|0,i=i+Math.imul(y,oe)|0,n=(n=n+Math.imul(y,ae)|0)+Math.imul(v,oe)|0,o=o+Math.imul(v,ae)|0,i=i+Math.imul(d,ue)|0,n=(n=n+Math.imul(d,ce)|0)+Math.imul(g,ue)|0,o=o+Math.imul(g,ce)|0;var ke=(c+(i=i+Math.imul(l,le)|0)|0)+((8191&(n=(n=n+Math.imul(l,fe)|0)+Math.imul(f,le)|0))<<13)|0;c=((o=o+Math.imul(f,fe)|0)+(n>>>13)|0)+(ke>>>26)|0,ke&=67108863,i=Math.imul(j,F),n=(n=Math.imul(j,z))+Math.imul(U,F)|0,o=Math.imul(U,z),i=i+Math.imul(N,V)|0,n=(n=n+Math.imul(N,q)|0)+Math.imul(D,V)|0,o=o+Math.imul(D,q)|0,i=i+Math.imul(M,Z)|0,n=(n=n+Math.imul(M,Y)|0)+Math.imul(B,Z)|0,o=o+Math.imul(B,Y)|0,i=i+Math.imul(P,X)|0,n=(n=n+Math.imul(P,$)|0)+Math.imul(T,X)|0,o=o+Math.imul(T,$)|0,i=i+Math.imul(I,Q)|0,n=(n=n+Math.imul(I,ee)|0)+Math.imul(A,Q)|0,o=o+Math.imul(A,ee)|0,i=i+Math.imul(E,re)|0,n=(n=n+Math.imul(E,ie)|0)+Math.imul(k,re)|0,o=o+Math.imul(k,ie)|0,i=i+Math.imul(_,oe)|0,n=(n=n+Math.imul(_,ae)|0)+Math.imul(w,oe)|0,o=o+Math.imul(w,ae)|0,i=i+Math.imul(y,ue)|0,n=(n=n+Math.imul(y,ce)|0)+Math.imul(v,ue)|0,o=o+Math.imul(v,ce)|0,i=i+Math.imul(d,le)|0,n=(n=n+Math.imul(d,fe)|0)+Math.imul(g,le)|0,o=o+Math.imul(g,fe)|0;var Oe=(c+(i=i+Math.imul(l,de)|0)|0)+((8191&(n=(n=n+Math.imul(l,ge)|0)+Math.imul(f,de)|0))<<13)|0;c=((o=o+Math.imul(f,ge)|0)+(n>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,i=Math.imul(j,V),n=(n=Math.imul(j,q))+Math.imul(U,V)|0,o=Math.imul(U,q),i=i+Math.imul(N,Z)|0,n=(n=n+Math.imul(N,Y)|0)+Math.imul(D,Z)|0,o=o+Math.imul(D,Y)|0,i=i+Math.imul(M,X)|0,n=(n=n+Math.imul(M,$)|0)+Math.imul(B,X)|0,o=o+Math.imul(B,$)|0,i=i+Math.imul(P,Q)|0,n=(n=n+Math.imul(P,ee)|0)+Math.imul(T,Q)|0,o=o+Math.imul(T,ee)|0,i=i+Math.imul(I,re)|0,n=(n=n+Math.imul(I,ie)|0)+Math.imul(A,re)|0,o=o+Math.imul(A,ie)|0,i=i+Math.imul(E,oe)|0,n=(n=n+Math.imul(E,ae)|0)+Math.imul(k,oe)|0,o=o+Math.imul(k,ae)|0,i=i+Math.imul(_,ue)|0,n=(n=n+Math.imul(_,ce)|0)+Math.imul(w,ue)|0,o=o+Math.imul(w,ce)|0,i=i+Math.imul(y,le)|0,n=(n=n+Math.imul(y,fe)|0)+Math.imul(v,le)|0,o=o+Math.imul(v,fe)|0;var Ie=(c+(i=i+Math.imul(d,de)|0)|0)+((8191&(n=(n=n+Math.imul(d,ge)|0)+Math.imul(g,de)|0))<<13)|0;c=((o=o+Math.imul(g,ge)|0)+(n>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,i=Math.imul(j,Z),n=(n=Math.imul(j,Y))+Math.imul(U,Z)|0,o=Math.imul(U,Y),i=i+Math.imul(N,X)|0,n=(n=n+Math.imul(N,$)|0)+Math.imul(D,X)|0,o=o+Math.imul(D,$)|0,i=i+Math.imul(M,Q)|0,n=(n=n+Math.imul(M,ee)|0)+Math.imul(B,Q)|0,o=o+Math.imul(B,ee)|0,i=i+Math.imul(P,re)|0,n=(n=n+Math.imul(P,ie)|0)+Math.imul(T,re)|0,o=o+Math.imul(T,ie)|0,i=i+Math.imul(I,oe)|0,n=(n=n+Math.imul(I,ae)|0)+Math.imul(A,oe)|0,o=o+Math.imul(A,ae)|0,i=i+Math.imul(E,ue)|0,n=(n=n+Math.imul(E,ce)|0)+Math.imul(k,ue)|0,o=o+Math.imul(k,ce)|0,i=i+Math.imul(_,le)|0,n=(n=n+Math.imul(_,fe)|0)+Math.imul(w,le)|0,o=o+Math.imul(w,fe)|0;var Ae=(c+(i=i+Math.imul(y,de)|0)|0)+((8191&(n=(n=n+Math.imul(y,ge)|0)+Math.imul(v,de)|0))<<13)|0;c=((o=o+Math.imul(v,ge)|0)+(n>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,i=Math.imul(j,X),n=(n=Math.imul(j,$))+Math.imul(U,X)|0,o=Math.imul(U,$),i=i+Math.imul(N,Q)|0,n=(n=n+Math.imul(N,ee)|0)+Math.imul(D,Q)|0,o=o+Math.imul(D,ee)|0,i=i+Math.imul(M,re)|0,n=(n=n+Math.imul(M,ie)|0)+Math.imul(B,re)|0,o=o+Math.imul(B,ie)|0,i=i+Math.imul(P,oe)|0,n=(n=n+Math.imul(P,ae)|0)+Math.imul(T,oe)|0,o=o+Math.imul(T,ae)|0,i=i+Math.imul(I,ue)|0,n=(n=n+Math.imul(I,ce)|0)+Math.imul(A,ue)|0,o=o+Math.imul(A,ce)|0,i=i+Math.imul(E,le)|0,n=(n=n+Math.imul(E,fe)|0)+Math.imul(k,le)|0,o=o+Math.imul(k,fe)|0;var xe=(c+(i=i+Math.imul(_,de)|0)|0)+((8191&(n=(n=n+Math.imul(_,ge)|0)+Math.imul(w,de)|0))<<13)|0;c=((o=o+Math.imul(w,ge)|0)+(n>>>13)|0)+(xe>>>26)|0,xe&=67108863,i=Math.imul(j,Q),n=(n=Math.imul(j,ee))+Math.imul(U,Q)|0,o=Math.imul(U,ee),i=i+Math.imul(N,re)|0,n=(n=n+Math.imul(N,ie)|0)+Math.imul(D,re)|0,o=o+Math.imul(D,ie)|0,i=i+Math.imul(M,oe)|0,n=(n=n+Math.imul(M,ae)|0)+Math.imul(B,oe)|0,o=o+Math.imul(B,ae)|0,i=i+Math.imul(P,ue)|0,n=(n=n+Math.imul(P,ce)|0)+Math.imul(T,ue)|0,o=o+Math.imul(T,ce)|0,i=i+Math.imul(I,le)|0,n=(n=n+Math.imul(I,fe)|0)+Math.imul(A,le)|0,o=o+Math.imul(A,fe)|0;var Pe=(c+(i=i+Math.imul(E,de)|0)|0)+((8191&(n=(n=n+Math.imul(E,ge)|0)+Math.imul(k,de)|0))<<13)|0;c=((o=o+Math.imul(k,ge)|0)+(n>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,i=Math.imul(j,re),n=(n=Math.imul(j,ie))+Math.imul(U,re)|0,o=Math.imul(U,ie),i=i+Math.imul(N,oe)|0,n=(n=n+Math.imul(N,ae)|0)+Math.imul(D,oe)|0,o=o+Math.imul(D,ae)|0,i=i+Math.imul(M,ue)|0,n=(n=n+Math.imul(M,ce)|0)+Math.imul(B,ue)|0,o=o+Math.imul(B,ce)|0,i=i+Math.imul(P,le)|0,n=(n=n+Math.imul(P,fe)|0)+Math.imul(T,le)|0,o=o+Math.imul(T,fe)|0;var Te=(c+(i=i+Math.imul(I,de)|0)|0)+((8191&(n=(n=n+Math.imul(I,ge)|0)+Math.imul(A,de)|0))<<13)|0;c=((o=o+Math.imul(A,ge)|0)+(n>>>13)|0)+(Te>>>26)|0,Te&=67108863,i=Math.imul(j,oe),n=(n=Math.imul(j,ae))+Math.imul(U,oe)|0,o=Math.imul(U,ae),i=i+Math.imul(N,ue)|0,n=(n=n+Math.imul(N,ce)|0)+Math.imul(D,ue)|0,o=o+Math.imul(D,ce)|0,i=i+Math.imul(M,le)|0,n=(n=n+Math.imul(M,fe)|0)+Math.imul(B,le)|0,o=o+Math.imul(B,fe)|0;var Re=(c+(i=i+Math.imul(P,de)|0)|0)+((8191&(n=(n=n+Math.imul(P,ge)|0)+Math.imul(T,de)|0))<<13)|0;c=((o=o+Math.imul(T,ge)|0)+(n>>>13)|0)+(Re>>>26)|0,Re&=67108863,i=Math.imul(j,ue),n=(n=Math.imul(j,ce))+Math.imul(U,ue)|0,o=Math.imul(U,ce),i=i+Math.imul(N,le)|0,n=(n=n+Math.imul(N,fe)|0)+Math.imul(D,le)|0,o=o+Math.imul(D,fe)|0;var Me=(c+(i=i+Math.imul(M,de)|0)|0)+((8191&(n=(n=n+Math.imul(M,ge)|0)+Math.imul(B,de)|0))<<13)|0;c=((o=o+Math.imul(B,ge)|0)+(n>>>13)|0)+(Me>>>26)|0,Me&=67108863,i=Math.imul(j,le),n=(n=Math.imul(j,fe))+Math.imul(U,le)|0,o=Math.imul(U,fe);var Be=(c+(i=i+Math.imul(N,de)|0)|0)+((8191&(n=(n=n+Math.imul(N,ge)|0)+Math.imul(D,de)|0))<<13)|0;c=((o=o+Math.imul(D,ge)|0)+(n>>>13)|0)+(Be>>>26)|0,Be&=67108863;var Ce=(c+(i=Math.imul(j,de))|0)+((8191&(n=(n=Math.imul(j,ge))+Math.imul(U,de)|0))<<13)|0;return c=((o=Math.imul(U,ge))+(n>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,u[0]=me,u[1]=ye,u[2]=ve,u[3]=be,u[4]=_e,u[5]=we,u[6]=Se,u[7]=Ee,u[8]=ke,u[9]=Oe,u[10]=Ie,u[11]=Ae,u[12]=xe,u[13]=Pe,u[14]=Te,u[15]=Re,u[16]=Me,u[17]=Be,u[18]=Ce,0!==c&&(u[19]=c,r.length++),r};function y(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var i=0,n=0,o=0;o<r.length-1;o++){var a=n;n=0;for(var s=67108863&i,u=Math.min(o,t.length-1),c=Math.max(0,o-e.length+1);c<=u;c++){var h=o-c,l=(0|e.words[h])*(0|t.words[c]),f=67108863&l;s=67108863&(f=f+s|0),n+=(a=(a=a+(l/67108864|0)|0)+(f>>>26)|0)>>>26,a&=67108863}r.words[o]=s,i=a,a=n}return 0!==i?r.words[o]=i:r.length--,r._strip()}function v(e,t,r){return y(e,t,r)}function b(e,t){this.x=e,this.y=t}Math.imul||(m=g),o.prototype.mulTo=function(e,t){var r=this.length+e.length;return 10===this.length&&10===e.length?m(this,e,t):r<63?g(this,e,t):r<1024?y(this,e,t):v(this,e,t)},b.prototype.makeRBT=function(e){for(var t=new Array(e),r=o.prototype._countBits(e)-1,i=0;i<e;i++)t[i]=this.revBin(i,r,e);return t},b.prototype.revBin=function(e,t,r){if(0===e||e===r-1)return e;for(var i=0,n=0;n<t;n++)i|=(1&e)<<t-n-1,e>>=1;return i},b.prototype.permute=function(e,t,r,i,n,o){for(var a=0;a<o;a++)i[a]=t[e[a]],n[a]=r[e[a]]},b.prototype.transform=function(e,t,r,i,n,o){this.permute(o,e,t,r,i,n);for(var a=1;a<n;a<<=1)for(var s=a<<1,u=Math.cos(2*Math.PI/s),c=Math.sin(2*Math.PI/s),h=0;h<n;h+=s)for(var l=u,f=c,p=0;p<a;p++){var d=r[h+p],g=i[h+p],m=r[h+p+a],y=i[h+p+a],v=l*m-f*y;y=l*y+f*m,m=v,r[h+p]=d+m,i[h+p]=g+y,r[h+p+a]=d-m,i[h+p+a]=g-y,p!==s&&(v=u*l-c*f,f=u*f+c*l,l=v)}},b.prototype.guessLen13b=function(e,t){var r=1|Math.max(t,e),i=1&r,n=0;for(r=r/2|0;r;r>>>=1)n++;return 1<<n+1+i},b.prototype.conjugate=function(e,t,r){if(!(r<=1))for(var i=0;i<r/2;i++){var n=e[i];e[i]=e[r-i-1],e[r-i-1]=n,n=t[i],t[i]=-t[r-i-1],t[r-i-1]=-n}},b.prototype.normalize13b=function(e,t){for(var r=0,i=0;i<t/2;i++){var n=8192*Math.round(e[2*i+1]/t)+Math.round(e[2*i]/t)+r;e[i]=67108863&n,r=n<67108864?0:n/67108864|0}return e},b.prototype.convert13b=function(e,t,r,n){for(var o=0,a=0;a<t;a++)o+=0|e[a],r[2*a]=8191&o,o>>>=13,r[2*a+1]=8191&o,o>>>=13;for(a=2*t;a<n;++a)r[a]=0;i(0===o),i(!(-8192&o))},b.prototype.stub=function(e){for(var t=new Array(e),r=0;r<e;r++)t[r]=0;return t},b.prototype.mulp=function(e,t,r){var i=2*this.guessLen13b(e.length,t.length),n=this.makeRBT(i),o=this.stub(i),a=new Array(i),s=new Array(i),u=new Array(i),c=new Array(i),h=new Array(i),l=new Array(i),f=r.words;f.length=i,this.convert13b(e.words,e.length,a,i),this.convert13b(t.words,t.length,c,i),this.transform(a,o,s,u,i,n),this.transform(c,o,h,l,i,n);for(var p=0;p<i;p++){var d=s[p]*h[p]-u[p]*l[p];u[p]=s[p]*l[p]+u[p]*h[p],s[p]=d}return this.conjugate(s,u,i),this.transform(s,u,f,o,i,n),this.conjugate(f,o,i),this.normalize13b(f,i),r.negative=e.negative^t.negative,r.length=e.length+t.length,r._strip()},o.prototype.mul=function(e){var t=new o(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},o.prototype.mulf=function(e){var t=new o(null);return t.words=new Array(this.length+e.length),v(this,e,t)},o.prototype.imul=function(e){return this.clone().mulTo(e,this)},o.prototype.imuln=function(e){var t=e<0;t&&(e=-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,a=(67108863&o)+(67108863&r);r>>=26,r+=o/67108864|0,r+=a>>>26,this.words[n]=67108863&a}return 0!==r&&(this.words[n]=r,this.length++),this.length=0===e?1:this.length,t?this.ineg():this},o.prototype.muln=function(e){return this.clone().imuln(e)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r<t.length;r++){var i=r/26|0,n=r%26;t[r]=e.words[i]>>>n&1}return t}(e);if(0===t.length)return new o(1);for(var r=this,i=0;i<t.length&&0===t[i];i++,r=r.sqr());if(++i<t.length)for(var n=r.sqr();i<t.length;i++,n=n.sqr())0!==t[i]&&(r=r.mul(n));return r},o.prototype.iushln=function(e){i("number"==typeof e&&e>=0);var t,r=e%26,n=(e-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var a=0;for(t=0;t<this.length;t++){var s=this.words[t]&o,u=(0|this.words[t])-s<<r;this.words[t]=u|a,a=s>>>26-r}a&&(this.words[t]=a,this.length++)}if(0!==n){for(t=this.length-1;t>=0;t--)this.words[t+n]=this.words[t];for(t=0;t<n;t++)this.words[t]=0;this.length+=n}return this._strip()},o.prototype.ishln=function(e){return i(0===this.negative),this.iushln(e)},o.prototype.iushrn=function(e,t,r){var n;i("number"==typeof e&&e>=0),n=t?(t-t%26)/26:0;var o=e%26,a=Math.min((e-o)/26,this.length),s=67108863^67108863>>>o<<o,u=r;if(n-=a,n=Math.max(0,n),u){for(var c=0;c<a;c++)u.words[c]=this.words[c];u.length=a}if(0===a);else if(this.length>a)for(this.length-=a,c=0;c<this.length;c++)this.words[c]=this.words[c+a];else this.words[0]=0,this.length=1;var h=0;for(c=this.length-1;c>=0&&(0!==h||c>=n);c--){var l=0|this.words[c];this.words[c]=h<<26-o|l>>>o,h=l&s}return u&&0!==h&&(u.words[u.length++]=h),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},o.prototype.ishrn=function(e,t,r){return i(0===this.negative),this.iushrn(e,t,r)},o.prototype.shln=function(e){return this.clone().ishln(e)},o.prototype.ushln=function(e){return this.clone().iushln(e)},o.prototype.shrn=function(e){return this.clone().ishrn(e)},o.prototype.ushrn=function(e){return this.clone().iushrn(e)},o.prototype.testn=function(e){i("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26,n=1<<t;return!(this.length<=r)&&!!(this.words[r]&n)},o.prototype.imaskn=function(e){i("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26;if(i(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var n=67108863^67108863>>>t<<t;this.words[this.length-1]&=n}return 0===this.length&&(this.words[0]=0,this.length=1),this._strip()},o.prototype.maskn=function(e){return this.clone().imaskn(e)},o.prototype.iaddn=function(e){return i("number"==typeof e),i(e<67108864),e<0?this.isubn(-e):0!==this.negative?1===this.length&&(0|this.words[0])<=e?(this.words[0]=e-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(e),this.negative=1,this):this._iaddn(e)},o.prototype._iaddn=function(e){this.words[0]+=e;for(var t=0;t<this.length&&this.words[t]>=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},o.prototype.isubn=function(e){if(i("number"==typeof e),i(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t<this.length&&this.words[t]<0;t++)this.words[t]+=67108864,this.words[t+1]-=1;return this._strip()},o.prototype.addn=function(e){return this.clone().iaddn(e)},o.prototype.subn=function(e){return this.clone().isubn(e)},o.prototype.iabs=function(){return this.negative=0,this},o.prototype.abs=function(){return this.clone().iabs()},o.prototype._ishlnsubmul=function(e,t,r){var n,o,a=e.length+r;this._expand(a);var s=0;for(n=0;n<e.length;n++){o=(0|this.words[n+r])+s;var u=(0|e.words[n])*t;s=((o-=67108863&u)>>26)-(u/67108864|0),this.words[n+r]=67108863&o}for(;n<this.length-r;n++)s=(o=(0|this.words[n+r])+s)>>26,this.words[n+r]=67108863&o;if(0===s)return this._strip();for(i(-1===s),s=0,n=0;n<this.length;n++)s=(o=-(0|this.words[n])+s)>>26,this.words[n]=67108863&o;return this.negative=1,this._strip()},o.prototype._wordDiv=function(e,t){var r=(this.length,e.length),i=this.clone(),n=e,a=0|n.words[n.length-1];0!==(r=26-this._countBits(a))&&(n=n.ushln(r),i.iushln(r),a=0|n.words[n.length-1]);var s,u=i.length-n.length;if("mod"!==t){(s=new o(null)).length=u+1,s.words=new Array(s.length);for(var c=0;c<s.length;c++)s.words[c]=0}var h=i.clone()._ishlnsubmul(n,1,u);0===h.negative&&(i=h,s&&(s.words[u]=1));for(var l=u-1;l>=0;l--){var f=67108864*(0|i.words[n.length+l])+(0|i.words[n.length+l-1]);for(f=Math.min(f/a|0,67108863),i._ishlnsubmul(n,f,l);0!==i.negative;)f--,i.negative=0,i._ishlnsubmul(n,1,l),i.isZero()||(i.negative^=1);s&&(s.words[l]=f)}return s&&s._strip(),i._strip(),"div"!==t&&0!==r&&i.iushrn(r),{div:s||null,mod:i}},o.prototype.divmod=function(e,t,r){return i(!e.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(n=s.div.neg()),"div"!==t&&(a=s.mod.neg(),r&&0!==a.negative&&a.iadd(e)),{div:n,mod:a}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(n=s.div.neg()),{div:n,mod:s.mod}):0!==(this.negative&e.negative)?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(a=s.mod.neg(),r&&0!==a.negative&&a.isub(e)),{div:s.div,mod:a}):e.length>this.length||this.cmp(e)<0?{div:new o(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new o(this.modrn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new o(this.modrn(e.words[0]))}:this._wordDiv(e,t);var n,a,s},o.prototype.div=function(e){return this.divmod(e,"div",!1).div},o.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},o.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},o.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,i=e.ushrn(1),n=e.andln(1),o=r.cmp(i);return o<0||1===n&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},o.prototype.modrn=function(e){var t=e<0;t&&(e=-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 t?-n:n},o.prototype.modn=function(e){return this.modrn(e)},o.prototype.idivn=function(e){var t=e<0;t&&(e=-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(),t?this.ineg():this},o.prototype.divn=function(e){return this.clone().idivn(e)},o.prototype.egcd=function(e){i(0===e.negative),i(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var n=new o(1),a=new o(0),s=new o(0),u=new o(1),c=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++c;for(var h=r.clone(),l=t.clone();!t.isZero();){for(var f=0,p=1;0===(t.words[0]&p)&&f<26;++f,p<<=1);if(f>0)for(t.iushrn(f);f-- >0;)(n.isOdd()||a.isOdd())&&(n.iadd(h),a.isub(l)),n.iushrn(1),a.iushrn(1);for(var d=0,g=1;0===(r.words[0]&g)&&d<26;++d,g<<=1);if(d>0)for(r.iushrn(d);d-- >0;)(s.isOdd()||u.isOdd())&&(s.iadd(h),u.isub(l)),s.iushrn(1),u.iushrn(1);t.cmp(r)>=0?(t.isub(r),n.isub(s),a.isub(u)):(r.isub(t),s.isub(n),u.isub(a))}return{a:s,b:u,gcd:r.iushln(c)}},o.prototype._invmp=function(e){i(0===e.negative),i(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var n,a=new o(1),s=new o(0),u=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var c=0,h=1;0===(t.words[0]&h)&&c<26;++c,h<<=1);if(c>0)for(t.iushrn(c);c-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);for(var l=0,f=1;0===(r.words[0]&f)&&l<26;++l,f<<=1);if(l>0)for(r.iushrn(l);l-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);t.cmp(r)>=0?(t.isub(r),a.isub(s)):(r.isub(t),s.isub(a))}return(n=0===t.cmpn(1)?a:s).cmpn(0)<0&&n.iadd(e),n},o.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var i=0;t.isEven()&&r.isEven();i++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var n=t.cmp(r);if(n<0){var o=t;t=r,r=o}else if(0===n||0===r.cmpn(1))break;t.isub(r)}return r.iushln(i)},o.prototype.invm=function(e){return this.egcd(e).a.umod(e)},o.prototype.isEven=function(){return!(1&this.words[0])},o.prototype.isOdd=function(){return!(1&~this.words[0])},o.prototype.andln=function(e){return this.words[0]&e},o.prototype.bincn=function(e){i("number"==typeof e);var t=e%26,r=(e-t)/26,n=1<<t;if(this.length<=r)return this._expand(r+1),this.words[r]|=n,this;for(var o=n,a=r;0!==o&&a<this.length;a++){var s=0|this.words[a];o=(s+=o)>>>26,s&=67108863,this.words[a]=s}return 0!==o&&(this.words[a]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this._strip(),this.length>1)t=1;else{r&&(e=-e),i(e<=67108863,"Number is too big");var n=0|this.words[0];t=n===e?0:n<e?-1:1}return 0!==this.negative?0|-t:t},o.prototype.cmp=function(e){if(0!==this.negative&&0===e.negative)return-1;if(0===this.negative&&0!==e.negative)return 1;var t=this.ucmp(e);return 0!==this.negative?0|-t:t},o.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var t=0,r=this.length-1;r>=0;r--){var i=0|this.words[r],n=0|e.words[r];if(i!==n){i<n?t=-1:i>n&&(t=1);break}}return t},o.prototype.gtn=function(e){return 1===this.cmpn(e)},o.prototype.gt=function(e){return 1===this.cmp(e)},o.prototype.gten=function(e){return this.cmpn(e)>=0},o.prototype.gte=function(e){return this.cmp(e)>=0},o.prototype.ltn=function(e){return-1===this.cmpn(e)},o.prototype.lt=function(e){return-1===this.cmp(e)},o.prototype.lten=function(e){return this.cmpn(e)<=0},o.prototype.lte=function(e){return this.cmp(e)<=0},o.prototype.eqn=function(e){return 0===this.cmpn(e)},o.prototype.eq=function(e){return 0===this.cmp(e)},o.red=function(e){return new I(e)},o.prototype.toRed=function(e){return i(!this.red,"Already a number in reduction context"),i(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},o.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(e){return this.red=e,this},o.prototype.forceRed=function(e){return i(!this.red,"Already a number in reduction context"),this._forceRed(e)},o.prototype.redAdd=function(e){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},o.prototype.redIAdd=function(e){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},o.prototype.redSub=function(e){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},o.prototype.redISub=function(e){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},o.prototype.redShl=function(e){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},o.prototype.redMul=function(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(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(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(e){return i(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var _={k256:null,p224:null,p192:null,p25519:null};function w(e,t){this.name=e,this.p=new o(t,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function S(){w.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function E(){w.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function k(){w.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function O(){w.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function I(e){if("string"==typeof e){var t=o._prime(e);this.m=t.p,this.prime=t}else i(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function A(e){I.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}w.prototype._tmp=function(){var e=new o(null);return e.words=new Array(Math.ceil(this.n/13)),e},w.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var i=t<this.n?-1:r.ucmp(this.p);return 0===i?(r.words[0]=0,r.length=1):i>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},w.prototype.split=function(e,t){e.iushrn(this.n,0,t)},w.prototype.imulK=function(e){return e.imul(this.k)},n(S,w),S.prototype.split=function(e,t){for(var r=4194303,i=Math.min(e.length,9),n=0;n<i;n++)t.words[n]=e.words[n];if(t.length=i,e.length<=9)return e.words[0]=0,void(e.length=1);var o=e.words[9];for(t.words[t.length++]=o&r,n=10;n<e.length;n++){var a=0|e.words[n];e.words[n-10]=(a&r)<<4|o>>>22,o=a}o>>>=22,e.words[n-10]=o,0===o&&e.length>10?e.length-=10:e.length-=9},S.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r<e.length;r++){var i=0|e.words[r];t+=977*i,e.words[r]=67108863&t,t=64*i+(t/67108864|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},n(E,w),n(k,w),n(O,w),O.prototype.imulK=function(e){for(var t=0,r=0;r<e.length;r++){var i=19*(0|e.words[r])+t,n=67108863&i;i>>>=26,e.words[r]=n,t=i}return 0!==t&&(e.words[e.length++]=t),e},o._prime=function(e){if(_[e])return _[e];var t;if("k256"===e)t=new S;else if("p224"===e)t=new E;else if("p192"===e)t=new k;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new O}return _[e]=t,t},I.prototype._verify1=function(e){i(0===e.negative,"red works only with positives"),i(e.red,"red works only with red numbers")},I.prototype._verify2=function(e,t){i(0===(e.negative|t.negative),"red works only with positives"),i(e.red&&e.red===t.red,"red works only with red numbers")},I.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):(h(e,e.umod(this.m)._forceRed(this)),e)},I.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},I.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},I.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},I.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},I.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},I.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},I.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},I.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},I.prototype.isqr=function(e){return this.imul(e,e.clone())},I.prototype.sqr=function(e){return this.mul(e,e)},I.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(i(t%2==1),3===t){var r=this.m.add(new o(1)).iushrn(2);return this.pow(e,r)}for(var n=this.m.subn(1),a=0;!n.isZero()&&0===n.andln(1);)a++,n.iushrn(1);i(!n.isZero());var s=new o(1).toRed(this),u=s.redNeg(),c=this.m.subn(1).iushrn(1),h=this.m.bitLength();for(h=new o(2*h*h).toRed(this);0!==this.pow(h,c).cmp(u);)h.redIAdd(u);for(var l=this.pow(h,n),f=this.pow(e,n.addn(1).iushrn(1)),p=this.pow(e,n),d=a;0!==p.cmp(s);){for(var g=p,m=0;0!==g.cmp(s);m++)g=g.redSqr();i(m<d);var y=this.pow(l,new o(1).iushln(d-m-1));f=f.redMul(y),l=y.redSqr(),p=p.redMul(l),d=m}return f},I.prototype.invm=function(e){var t=e._invmp(this.m);return 0!==t.negative?(t.negative=0,this.imod(t).redNeg()):this.imod(t)},I.prototype.pow=function(e,t){if(t.isZero())return new o(1).toRed(this);if(0===t.cmpn(1))return e.clone();var r=new Array(16);r[0]=new o(1).toRed(this),r[1]=e;for(var i=2;i<r.length;i++)r[i]=this.mul(r[i-1],e);var n=r[0],a=0,s=0,u=t.bitLength()%26;for(0===u&&(u=26),i=t.length-1;i>=0;i--){for(var c=t.words[i],h=u-1;h>=0;h--){var l=c>>h&1;n!==r[0]&&(n=this.sqr(n)),0!==l||0!==a?(a<<=1,a|=l,(4===++s||0===i&&0===h)&&(n=this.mul(n,r[a]),s=0,a=0)):s=0}u=26}return n},I.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},I.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},o.mont=function(e){return new A(e)},n(A,I),A.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},A.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},A.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},A.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new o(0)._forceRed(this);var r=e.mul(t),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),a=n;return n.cmp(this.m)>=0?a=n.isub(this.m):n.cmpn(0)<0&&(a=n.iadd(this.m)),a._forceRed(this)},A.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=r.nmd(e),this)},5974(e,t,r){"use strict";var i=r(8287).Buffer,n=r(5606),o=r(4148),a=r(4442),s=r(8411),u=r(1447),c=r(9681);for(var h in c)t[h]=c[h];t.NONE=0,t.DEFLATE=1,t.INFLATE=2,t.GZIP=3,t.GUNZIP=4,t.DEFLATERAW=5,t.INFLATERAW=6,t.UNZIP=7;function l(e){if("number"!=typeof e||e<t.DEFLATE||e>t.UNZIP)throw new TypeError("Bad argument");this.dictionary=null,this.err=0,this.flush=0,this.init_done=!1,this.level=0,this.memLevel=0,this.mode=e,this.strategy=0,this.windowBits=0,this.write_in_progress=!1,this.pending_close=!1,this.gzip_id_bytes_read=0}l.prototype.close=function(){this.write_in_progress?this.pending_close=!0:(this.pending_close=!1,o(this.init_done,"close before init"),o(this.mode<=t.UNZIP),this.mode===t.DEFLATE||this.mode===t.GZIP||this.mode===t.DEFLATERAW?s.deflateEnd(this.strm):this.mode!==t.INFLATE&&this.mode!==t.GUNZIP&&this.mode!==t.INFLATERAW&&this.mode!==t.UNZIP||u.inflateEnd(this.strm),this.mode=t.NONE,this.dictionary=null)},l.prototype.write=function(e,t,r,i,n,o,a){return this._write(!0,e,t,r,i,n,o,a)},l.prototype.writeSync=function(e,t,r,i,n,o,a){return this._write(!1,e,t,r,i,n,o,a)},l.prototype._write=function(e,r,a,s,u,c,h,l){if(o.equal(arguments.length,8),o(this.init_done,"write before init"),o(this.mode!==t.NONE,"already finalized"),o.equal(!1,this.write_in_progress,"write already in progress"),o.equal(!1,this.pending_close,"close is pending"),this.write_in_progress=!0,o.equal(!1,void 0===r,"must provide flush value"),this.write_in_progress=!0,r!==t.Z_NO_FLUSH&&r!==t.Z_PARTIAL_FLUSH&&r!==t.Z_SYNC_FLUSH&&r!==t.Z_FULL_FLUSH&&r!==t.Z_FINISH&&r!==t.Z_BLOCK)throw new Error("Invalid flush value");if(null==a&&(a=i.alloc(0),u=0,s=0),this.strm.avail_in=u,this.strm.input=a,this.strm.next_in=s,this.strm.avail_out=l,this.strm.output=c,this.strm.next_out=h,this.flush=r,!e)return this._process(),this._checkError()?this._afterSync():void 0;var f=this;return n.nextTick(function(){f._process(),f._after()}),this},l.prototype._afterSync=function(){var e=this.strm.avail_out,t=this.strm.avail_in;return this.write_in_progress=!1,[t,e]},l.prototype._process=function(){var e=null;switch(this.mode){case t.DEFLATE:case t.GZIP:case t.DEFLATERAW:this.err=s.deflate(this.strm,this.flush);break;case t.UNZIP:switch(this.strm.avail_in>0&&(e=this.strm.next_in),this.gzip_id_bytes_read){case 0:if(null===e)break;if(31!==this.strm.input[e]){this.mode=t.INFLATE;break}if(this.gzip_id_bytes_read=1,e++,1===this.strm.avail_in)break;case 1:if(null===e)break;139===this.strm.input[e]?(this.gzip_id_bytes_read=2,this.mode=t.GUNZIP):this.mode=t.INFLATE;break;default:throw new Error("invalid number of gzip magic number bytes read")}case t.INFLATE:case t.GUNZIP:case t.INFLATERAW:for(this.err=u.inflate(this.strm,this.flush),this.err===t.Z_NEED_DICT&&this.dictionary&&(this.err=u.inflateSetDictionary(this.strm,this.dictionary),this.err===t.Z_OK?this.err=u.inflate(this.strm,this.flush):this.err===t.Z_DATA_ERROR&&(this.err=t.Z_NEED_DICT));this.strm.avail_in>0&&this.mode===t.GUNZIP&&this.err===t.Z_STREAM_END&&0!==this.strm.next_in[0];)this.reset(),this.err=u.inflate(this.strm,this.flush);break;default:throw new Error("Unknown mode "+this.mode)}},l.prototype._checkError=function(){switch(this.err){case t.Z_OK:case t.Z_BUF_ERROR:if(0!==this.strm.avail_out&&this.flush===t.Z_FINISH)return this._error("unexpected end of file"),!1;break;case t.Z_STREAM_END:break;case t.Z_NEED_DICT:return null==this.dictionary?this._error("Missing dictionary"):this._error("Bad dictionary"),!1;default:return this._error("Zlib error"),!1}return!0},l.prototype._after=function(){if(this._checkError()){var e=this.strm.avail_out,t=this.strm.avail_in;this.write_in_progress=!1,this.callback(t,e),this.pending_close&&this.close()}},l.prototype._error=function(e){this.strm.msg&&(e=this.strm.msg),this.onerror(e,this.err),this.write_in_progress=!1,this.pending_close&&this.close()},l.prototype.init=function(e,r,i,n,a){o(4===arguments.length||5===arguments.length,"init(windowBits, level, memLevel, strategy, [dictionary])"),o(e>=8&&e<=15,"invalid windowBits"),o(r>=-1&&r<=9,"invalid compression level"),o(i>=1&&i<=9,"invalid memlevel"),o(n===t.Z_FILTERED||n===t.Z_HUFFMAN_ONLY||n===t.Z_RLE||n===t.Z_FIXED||n===t.Z_DEFAULT_STRATEGY,"invalid strategy"),this._init(r,e,i,n,a),this._setDictionary()},l.prototype.params=function(){throw new Error("deflateParams Not supported")},l.prototype.reset=function(){this._reset(),this._setDictionary()},l.prototype._init=function(e,r,i,n,o){switch(this.level=e,this.windowBits=r,this.memLevel=i,this.strategy=n,this.flush=t.Z_NO_FLUSH,this.err=t.Z_OK,this.mode!==t.GZIP&&this.mode!==t.GUNZIP||(this.windowBits+=16),this.mode===t.UNZIP&&(this.windowBits+=32),this.mode!==t.DEFLATERAW&&this.mode!==t.INFLATERAW||(this.windowBits=-1*this.windowBits),this.strm=new a,this.mode){case t.DEFLATE:case t.GZIP:case t.DEFLATERAW:this.err=s.deflateInit2(this.strm,this.level,t.Z_DEFLATED,this.windowBits,this.memLevel,this.strategy);break;case t.INFLATE:case t.GUNZIP:case t.INFLATERAW:case t.UNZIP:this.err=u.inflateInit2(this.strm,this.windowBits);break;default:throw new Error("Unknown mode "+this.mode)}this.err!==t.Z_OK&&this._error("Init error"),this.dictionary=o,this.write_in_progress=!1,this.init_done=!0},l.prototype._setDictionary=function(){if(null!=this.dictionary){switch(this.err=t.Z_OK,this.mode){case t.DEFLATE:case t.DEFLATERAW:this.err=s.deflateSetDictionary(this.strm,this.dictionary)}this.err!==t.Z_OK&&this._error("Failed to set dictionary")}},l.prototype._reset=function(){switch(this.err=t.Z_OK,this.mode){case t.DEFLATE:case t.DEFLATERAW:case t.GZIP:this.err=s.deflateReset(this.strm);break;case t.INFLATE:case t.INFLATERAW:case t.GUNZIP:this.err=u.inflateReset(this.strm)}this.err!==t.Z_OK&&this._error("Failed to reset stream")},t.Zlib=l},8559(e,t,r){"use strict";var i=r(5606),n=r(8287).Buffer,o=r(8310).Transform,a=r(5974),s=r(537),u=r(4148).ok,c=r(8287).kMaxLength,h="Cannot create final Buffer. It would be larger than 0x"+c.toString(16)+" bytes";a.Z_MIN_WINDOWBITS=8,a.Z_MAX_WINDOWBITS=15,a.Z_DEFAULT_WINDOWBITS=15,a.Z_MIN_CHUNK=64,a.Z_MAX_CHUNK=1/0,a.Z_DEFAULT_CHUNK=16384,a.Z_MIN_MEMLEVEL=1,a.Z_MAX_MEMLEVEL=9,a.Z_DEFAULT_MEMLEVEL=8,a.Z_MIN_LEVEL=-1,a.Z_MAX_LEVEL=9,a.Z_DEFAULT_LEVEL=a.Z_DEFAULT_COMPRESSION;for(var l=Object.keys(a),f=0;f<l.length;f++){var p=l[f];p.match(/^Z/)&&Object.defineProperty(t,p,{enumerable:!0,value:a[p],writable:!1})}for(var d={Z_OK:a.Z_OK,Z_STREAM_END:a.Z_STREAM_END,Z_NEED_DICT:a.Z_NEED_DICT,Z_ERRNO:a.Z_ERRNO,Z_STREAM_ERROR:a.Z_STREAM_ERROR,Z_DATA_ERROR:a.Z_DATA_ERROR,Z_MEM_ERROR:a.Z_MEM_ERROR,Z_BUF_ERROR:a.Z_BUF_ERROR,Z_VERSION_ERROR:a.Z_VERSION_ERROR},g=Object.keys(d),m=0;m<g.length;m++){var y=g[m];d[d[y]]=y}function v(e,t,r){var i=[],o=0;function a(){for(var t;null!==(t=e.read());)i.push(t),o+=t.length;e.once("readable",a)}function s(){var t,a=null;o>=c?a=new RangeError(h):t=n.concat(i,o),i=[],e.close(),r(a,t)}e.on("error",function(t){e.removeListener("end",s),e.removeListener("readable",a),r(t)}),e.on("end",s),e.end(t),a()}function b(e,t){if("string"==typeof t&&(t=n.from(t)),!n.isBuffer(t))throw new TypeError("Not a string or buffer");var r=e._finishFlushFlag;return e._processChunk(t,r)}function _(e){if(!(this instanceof _))return new _(e);x.call(this,e,a.DEFLATE)}function w(e){if(!(this instanceof w))return new w(e);x.call(this,e,a.INFLATE)}function S(e){if(!(this instanceof S))return new S(e);x.call(this,e,a.GZIP)}function E(e){if(!(this instanceof E))return new E(e);x.call(this,e,a.GUNZIP)}function k(e){if(!(this instanceof k))return new k(e);x.call(this,e,a.DEFLATERAW)}function O(e){if(!(this instanceof O))return new O(e);x.call(this,e,a.INFLATERAW)}function I(e){if(!(this instanceof I))return new I(e);x.call(this,e,a.UNZIP)}function A(e){return e===a.Z_NO_FLUSH||e===a.Z_PARTIAL_FLUSH||e===a.Z_SYNC_FLUSH||e===a.Z_FULL_FLUSH||e===a.Z_FINISH||e===a.Z_BLOCK}function x(e,r){var i=this;if(this._opts=e=e||{},this._chunkSize=e.chunkSize||t.Z_DEFAULT_CHUNK,o.call(this,e),e.flush&&!A(e.flush))throw new Error("Invalid flush flag: "+e.flush);if(e.finishFlush&&!A(e.finishFlush))throw new Error("Invalid flush flag: "+e.finishFlush);if(this._flushFlag=e.flush||a.Z_NO_FLUSH,this._finishFlushFlag=void 0!==e.finishFlush?e.finishFlush:a.Z_FINISH,e.chunkSize&&(e.chunkSize<t.Z_MIN_CHUNK||e.chunkSize>t.Z_MAX_CHUNK))throw new Error("Invalid chunk size: "+e.chunkSize);if(e.windowBits&&(e.windowBits<t.Z_MIN_WINDOWBITS||e.windowBits>t.Z_MAX_WINDOWBITS))throw new Error("Invalid windowBits: "+e.windowBits);if(e.level&&(e.level<t.Z_MIN_LEVEL||e.level>t.Z_MAX_LEVEL))throw new Error("Invalid compression level: "+e.level);if(e.memLevel&&(e.memLevel<t.Z_MIN_MEMLEVEL||e.memLevel>t.Z_MAX_MEMLEVEL))throw new Error("Invalid memLevel: "+e.memLevel);if(e.strategy&&e.strategy!=t.Z_FILTERED&&e.strategy!=t.Z_HUFFMAN_ONLY&&e.strategy!=t.Z_RLE&&e.strategy!=t.Z_FIXED&&e.strategy!=t.Z_DEFAULT_STRATEGY)throw new Error("Invalid strategy: "+e.strategy);if(e.dictionary&&!n.isBuffer(e.dictionary))throw new Error("Invalid dictionary: it should be a Buffer instance");this._handle=new a.Zlib(r);var s=this;this._hadError=!1,this._handle.onerror=function(e,r){P(s),s._hadError=!0;var i=new Error(e);i.errno=r,i.code=t.codes[r],s.emit("error",i)};var u=t.Z_DEFAULT_COMPRESSION;"number"==typeof e.level&&(u=e.level);var c=t.Z_DEFAULT_STRATEGY;"number"==typeof e.strategy&&(c=e.strategy),this._handle.init(e.windowBits||t.Z_DEFAULT_WINDOWBITS,u,e.memLevel||t.Z_DEFAULT_MEMLEVEL,c,e.dictionary),this._buffer=n.allocUnsafe(this._chunkSize),this._offset=0,this._level=u,this._strategy=c,this.once("end",this.close),Object.defineProperty(this,"_closed",{get:function(){return!i._handle},configurable:!0,enumerable:!0})}function P(e,t){t&&i.nextTick(t),e._handle&&(e._handle.close(),e._handle=null)}function T(e){e.emit("close")}Object.defineProperty(t,"codes",{enumerable:!0,value:Object.freeze(d),writable:!1}),t.Deflate=_,t.Inflate=w,t.Gzip=S,t.Gunzip=E,t.DeflateRaw=k,t.InflateRaw=O,t.Unzip=I,t.createDeflate=function(e){return new _(e)},t.createInflate=function(e){return new w(e)},t.createDeflateRaw=function(e){return new k(e)},t.createInflateRaw=function(e){return new O(e)},t.createGzip=function(e){return new S(e)},t.createGunzip=function(e){return new E(e)},t.createUnzip=function(e){return new I(e)},t.deflate=function(e,t,r){return"function"==typeof t&&(r=t,t={}),v(new _(t),e,r)},t.deflateSync=function(e,t){return b(new _(t),e)},t.gzip=function(e,t,r){return"function"==typeof t&&(r=t,t={}),v(new S(t),e,r)},t.gzipSync=function(e,t){return b(new S(t),e)},t.deflateRaw=function(e,t,r){return"function"==typeof t&&(r=t,t={}),v(new k(t),e,r)},t.deflateRawSync=function(e,t){return b(new k(t),e)},t.unzip=function(e,t,r){return"function"==typeof t&&(r=t,t={}),v(new I(t),e,r)},t.unzipSync=function(e,t){return b(new I(t),e)},t.inflate=function(e,t,r){return"function"==typeof t&&(r=t,t={}),v(new w(t),e,r)},t.inflateSync=function(e,t){return b(new w(t),e)},t.gunzip=function(e,t,r){return"function"==typeof t&&(r=t,t={}),v(new E(t),e,r)},t.gunzipSync=function(e,t){return b(new E(t),e)},t.inflateRaw=function(e,t,r){return"function"==typeof t&&(r=t,t={}),v(new O(t),e,r)},t.inflateRawSync=function(e,t){return b(new O(t),e)},s.inherits(x,o),x.prototype.params=function(e,r,n){if(e<t.Z_MIN_LEVEL||e>t.Z_MAX_LEVEL)throw new RangeError("Invalid compression level: "+e);if(r!=t.Z_FILTERED&&r!=t.Z_HUFFMAN_ONLY&&r!=t.Z_RLE&&r!=t.Z_FIXED&&r!=t.Z_DEFAULT_STRATEGY)throw new TypeError("Invalid strategy: "+r);if(this._level!==e||this._strategy!==r){var o=this;this.flush(a.Z_SYNC_FLUSH,function(){u(o._handle,"zlib binding closed"),o._handle.params(e,r),o._hadError||(o._level=e,o._strategy=r,n&&n())})}else i.nextTick(n)},x.prototype.reset=function(){return u(this._handle,"zlib binding closed"),this._handle.reset()},x.prototype._flush=function(e){this._transform(n.alloc(0),"",e)},x.prototype.flush=function(e,t){var r=this,o=this._writableState;("function"==typeof e||void 0===e&&!t)&&(t=e,e=a.Z_FULL_FLUSH),o.ended?t&&i.nextTick(t):o.ending?t&&this.once("end",t):o.needDrain?t&&this.once("drain",function(){return r.flush(e,t)}):(this._flushFlag=e,this.write(n.alloc(0),"",t))},x.prototype.close=function(e){P(this,e),i.nextTick(T,this)},x.prototype._transform=function(e,t,r){var i,o=this._writableState,s=(o.ending||o.ended)&&(!e||o.length===e.length);return null===e||n.isBuffer(e)?this._handle?(s?i=this._finishFlushFlag:(i=this._flushFlag,e.length>=o.length&&(this._flushFlag=this._opts.flush||a.Z_NO_FLUSH)),void this._processChunk(e,i,r)):r(new Error("zlib binding closed")):r(new Error("invalid input"))},x.prototype._processChunk=function(e,t,r){var i=e&&e.length,o=this._chunkSize-this._offset,a=0,s=this,l="function"==typeof r;if(!l){var f,p=[],d=0;this.on("error",function(e){f=e}),u(this._handle,"zlib binding closed");do{var g=this._handle.writeSync(t,e,a,i,this._buffer,this._offset,o)}while(!this._hadError&&v(g[0],g[1]));if(this._hadError)throw f;if(d>=c)throw P(this),new RangeError(h);var m=n.concat(p,d);return P(this),m}u(this._handle,"zlib binding closed");var y=this._handle.write(t,e,a,i,this._buffer,this._offset,o);function v(c,h){if(this&&(this.buffer=null,this.callback=null),!s._hadError){var f=o-h;if(u(f>=0,"have should not go down"),f>0){var g=s._buffer.slice(s._offset,s._offset+f);s._offset+=f,l?s.push(g):(p.push(g),d+=g.length)}if((0===h||s._offset>=s._chunkSize)&&(o=s._chunkSize,s._offset=0,s._buffer=n.allocUnsafe(s._chunkSize)),0===h){if(a+=i-c,i=c,!l)return!0;var m=s._handle.write(t,e,a,i,s._buffer,s._offset,s._chunkSize);return m.callback=v,void(m.buffer=e)}if(!l)return!1;r()}}y.buffer=e,y.callback=v},s.inherits(_,x),s.inherits(w,x),s.inherits(S,x),s.inherits(E,x),s.inherits(k,x),s.inherits(O,x),s.inherits(I,x)},6763(e,t,r){var i=r(5364);e.exports=i("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz")},295(e,t,r){var i=r(8287).Buffer;e.exports=function(e,t){for(var r=Math.min(e.length,t.length),n=new i(r),o=0;o<r;++o)n[o]=e[o]^t[o];return n}},8287(e,t,r){"use strict";
|
|
7
|
+
*/function C(e,t){if(e===t)return 0;for(var r=e.length,i=t.length,n=0,o=Math.min(r,i);n<o;++n)if(e[n]!==t[n]){r=e[n],i=t[n];break}return r<i?-1:i<r?1:0}function N(e,t,r,i){if(e===t)return 0!==e||(!r||c(e,t));if(r){if("object"!==o(e))return"number"==typeof e&&l(e)&&l(t);if("object"!==o(t)||null===e||null===t)return!1;if(Object.getPrototypeOf(e)!==Object.getPrototypeOf(t))return!1}else{if(null===e||"object"!==o(e))return(null===t||"object"!==o(t))&&e==t;if(null===t||"object"!==o(t))return!1}var n,s,u,h,f=g(e);if(f!==g(t))return!1;if(Array.isArray(e)){if(e.length!==t.length)return!1;var p=B(e),d=B(t);return p.length===d.length&&L(e,t,r,i,1,p)}if("[object Object]"===f&&(!_(e)&&_(t)||!S(e)&&S(t)))return!1;if(b(e)){if(!b(t)||Date.prototype.getTime.call(e)!==Date.prototype.getTime.call(t))return!1}else if(w(e)){if(!w(t)||(u=e,h=t,!(a?u.source===h.source&&u.flags===h.flags:RegExp.prototype.toString.call(u)===RegExp.prototype.toString.call(h))))return!1}else if(E(e)||e instanceof Error){if(e.message!==t.message||e.name!==t.name)return!1}else{if(v(e)){if(r||!T(e)&&!R(e)){if(!function(e,t){return e.byteLength===t.byteLength&&0===C(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}(e,t))return!1}else if(!function(e,t){if(e.byteLength!==t.byteLength)return!1;for(var r=0;r<e.byteLength;r++)if(e[r]!==t[r])return!1;return!0}(e,t))return!1;var m=B(e),M=B(t);return m.length===M.length&&L(e,t,r,i,0,m)}if(S(e))return!(!S(t)||e.size!==t.size)&&L(e,t,r,i,2);if(_(e))return!(!_(t)||e.size!==t.size)&&L(e,t,r,i,3);if(y(e)){if(s=t,(n=e).byteLength!==s.byteLength||0!==C(new Uint8Array(n),new Uint8Array(s)))return!1}else if(k(e)&&!function(e,t){return O(e)?O(t)&&c(Number.prototype.valueOf.call(e),Number.prototype.valueOf.call(t)):I(e)?I(t)&&String.prototype.valueOf.call(e)===String.prototype.valueOf.call(t):A(e)?A(t)&&Boolean.prototype.valueOf.call(e)===Boolean.prototype.valueOf.call(t):x(e)?x(t)&&BigInt.prototype.valueOf.call(e)===BigInt.prototype.valueOf.call(t):P(t)&&Symbol.prototype.valueOf.call(e)===Symbol.prototype.valueOf.call(t)}(e,t))return!1}return L(e,t,r,i,0)}function D(e,t){return t.filter(function(t){return d(e,t)})}function L(e,t,r,n,a,c){if(5===arguments.length){c=Object.keys(e);var l=Object.keys(t);if(c.length!==l.length)return!1}for(var f=0;f<c.length;f++)if(!p(t,c[f]))return!1;if(r&&5===arguments.length){var g=h(e);if(0!==g.length){var m=0;for(f=0;f<g.length;f++){var y=g[f];if(d(e,y)){if(!d(t,y))return!1;c.push(y),m++}else if(d(t,y))return!1}var v=h(t);if(g.length!==v.length&&D(t,v).length!==m)return!1}else{var b=h(t);if(0!==b.length&&0!==D(t,b).length)return!1}}if(0===c.length&&(0===a||1===a&&0===e.length||0===e.size))return!0;if(void 0===n)n={val1:new Map,val2:new Map,position:0};else{var _=n.val1.get(e);if(void 0!==_){var w=n.val2.get(t);if(void 0!==w)return _===w}n.position++}n.val1.set(e,n.position),n.val2.set(t,n.position);var S=function(e,t,r,n,a,c){var h=0;if(2===c){if(!function(e,t,r,i){for(var n=null,a=s(e),u=0;u<a.length;u++){var c=a[u];if("object"===o(c)&&null!==c)null===n&&(n=new Set),n.add(c);else if(!t.has(c)){if(r)return!1;if(!H(e,t,c))return!1;null===n&&(n=new Set),n.add(c)}}if(null!==n){for(var h=s(t),l=0;l<h.length;l++){var f=h[l];if("object"===o(f)&&null!==f){if(!j(n,f,r,i))return!1}else if(!r&&!e.has(f)&&!j(n,f,r,i))return!1}return 0===n.size}return!0}(e,t,r,a))return!1}else if(3===c){if(!function(e,t,r,n){for(var a=null,s=u(e),c=0;c<s.length;c++){var h=i(s[c],2),l=h[0],f=h[1];if("object"===o(l)&&null!==l)null===a&&(a=new Set),a.add(l);else{var p=t.get(l);if(void 0===p&&!t.has(l)||!N(f,p,r,n)){if(r)return!1;if(!F(e,t,l,f,n))return!1;null===a&&(a=new Set),a.add(l)}}}if(null!==a){for(var d=u(t),g=0;g<d.length;g++){var m=i(d[g],2),y=m[0],v=m[1];if("object"===o(y)&&null!==y){if(!z(a,e,y,v,r,n))return!1}else if(!(r||e.has(y)&&N(e.get(y),v,!1,n)||z(a,e,y,v,!1,n)))return!1}return 0===a.size}return!0}(e,t,r,a))return!1}else if(1===c)for(;h<e.length;h++){if(!p(e,h)){if(p(t,h))return!1;for(var l=Object.keys(e);h<l.length;h++){var f=l[h];if(!p(t,f)||!N(e[f],t[f],r,a))return!1}return l.length===Object.keys(t).length}if(!p(t,h)||!N(e[h],t[h],r,a))return!1}for(h=0;h<n.length;h++){var d=n[h];if(!N(e[d],t[d],r,a))return!1}return!0}(e,t,r,c,n,a);return n.val1.delete(e),n.val2.delete(t),S}function j(e,t,r,i){for(var n=s(e),o=0;o<n.length;o++){var a=n[o];if(N(t,a,r,i))return e.delete(a),!0}return!1}function U(e){switch(o(e)){case"undefined":return null;case"object":return;case"symbol":return!1;case"string":e=+e;case"number":if(l(e))return!1}return!0}function H(e,t,r){var i=U(r);return null!=i?i:t.has(i)&&!e.has(i)}function F(e,t,r,i,n){var o=U(r);if(null!=o)return o;var a=t.get(o);return!(void 0===a&&!t.has(o)||!N(i,a,!1,n))&&(!e.has(o)&&N(i,a,!1,n))}function z(e,t,r,i,n,o){for(var a=s(e),u=0;u<a.length;u++){var c=a[u];if(N(r,c,n,o)&&N(i,t.get(c),n,o))return e.delete(c),!0}return!1}e.exports={isDeepEqual:function(e,t){return N(e,t,false)},isDeepStrictEqual:function(e,t){return N(e,t,true)}}},5364(e,t,r){"use strict";var i=r(2861).Buffer;e.exports=function(e){if(e.length>=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),r=0;r<t.length;r++)t[r]=255;for(var n=0;n<e.length;n++){var o=e.charAt(n),a=o.charCodeAt(0);if(255!==t[a])throw new TypeError(o+" is ambiguous");t[a]=n}var s=e.length,u=e.charAt(0),c=Math.log(s)/Math.log(256),h=Math.log(256)/Math.log(s);function l(e){if("string"!=typeof e)throw new TypeError("Expected String");if(0===e.length)return i.alloc(0);for(var r=0,n=0,o=0;e[r]===u;)n++,r++;for(var a=(e.length-r)*c+1>>>0,h=new Uint8Array(a);r<e.length;){var l=e.charCodeAt(r);if(l>255)return;var f=t[l];if(255===f)return;for(var p=0,d=a-1;(0!==f||p<o)&&-1!==d;d--,p++)f+=s*h[d]>>>0,h[d]=f%256>>>0,f=f/256>>>0;if(0!==f)throw new Error("Non-zero carry");o=p,r++}for(var g=a-o;g!==a&&0===h[g];)g++;var m=i.allocUnsafe(n+(a-g));m.fill(0,0,n);for(var y=n;g!==a;)m[y++]=h[g++];return m}return{encode:function(t){if((Array.isArray(t)||t instanceof Uint8Array)&&(t=i.from(t)),!i.isBuffer(t))throw new TypeError("Expected Buffer");if(0===t.length)return"";for(var r=0,n=0,o=0,a=t.length;o!==a&&0===t[o];)o++,r++;for(var c=(a-o)*h+1>>>0,l=new Uint8Array(c);o!==a;){for(var f=t[o],p=0,d=c-1;(0!==f||p<n)&&-1!==d;d--,p++)f+=256*l[d]>>>0,l[d]=f%s>>>0,f=f/s>>>0;if(0!==f)throw new Error("Non-zero carry");n=p,o++}for(var g=c-n;g!==c&&0===l[g];)g++;for(var m=u.repeat(r);g<c;++g)m+=e.charAt(l[g]);return m},decodeUnsafe:l,decode:function(e){var t=l(e);if(t)return t;throw new Error("Non-base"+s+" character")}}}},7526(e,t){"use strict";t.toByteArray=function(e){var t,r,o=s(e),a=o[0],u=o[1],c=new n(function(e,t,r){return 3*(t+r)/4-r}(0,a,u)),h=0,l=u>0?a-4:a;for(r=0;r<l;r+=4)t=i[e.charCodeAt(r)]<<18|i[e.charCodeAt(r+1)]<<12|i[e.charCodeAt(r+2)]<<6|i[e.charCodeAt(r+3)],c[h++]=t>>16&255,c[h++]=t>>8&255,c[h++]=255&t;2===u&&(t=i[e.charCodeAt(r)]<<2|i[e.charCodeAt(r+1)]>>4,c[h++]=255&t);1===u&&(t=i[e.charCodeAt(r)]<<10|i[e.charCodeAt(r+1)]<<4|i[e.charCodeAt(r+2)]>>2,c[h++]=t>>8&255,c[h++]=255&t);return c},t.fromByteArray=function(e){for(var t,i=e.length,n=i%3,o=[],a=16383,s=0,u=i-n;s<u;s+=a)o.push(c(e,s,s+a>u?u:s+a));1===n?(t=e[i-1],o.push(r[t>>2]+r[t<<4&63]+"==")):2===n&&(t=(e[i-2]<<8)+e[i-1],o.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"="));return o.join("")};for(var r=[],i=[],n="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0;a<64;++a)r[a]=o[a],i[o.charCodeAt(a)]=a;function s(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function u(e){return r[e>>18&63]+r[e>>12&63]+r[e>>6&63]+r[63&e]}function c(e,t,r){for(var i,n=[],o=t;o<r;o+=3)i=(e[o]<<16&16711680)+(e[o+1]<<8&65280)+(255&e[o+2]),n.push(u(i));return n.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},9404(e,t,r){!function(e,t){"use strict";function i(e,t){if(!e)throw new Error(t||"Assertion failed")}function n(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function o(e,t,r){if(o.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var a;"object"==typeof e?e.exports=o:t.BN=o,o.BN=o,o.wordSize=26;try{a="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r(7790).Buffer}catch(e){}function s(e,t){var r=e.charCodeAt(t);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function u(e,t,r){var i=s(e,r);return r-1>=t&&(i|=s(e,r-1)<<4),i}function c(e,t,r,i){for(var n=0,o=Math.min(e.length,r),a=t;a<o;a++){var s=e.charCodeAt(a)-48;n*=i,n+=s>=49?s-49+10:s>=17?s-17+10:s}return n}o.isBN=function(e){return e instanceof o||null!==e&&"object"==typeof e&&e.constructor.wordSize===o.wordSize&&Array.isArray(e.words)},o.max=function(e,t){return e.cmp(t)>0?e:t},o.min=function(e,t){return e.cmp(t)<0?e:t},o.prototype._init=function(e,t,r){if("number"==typeof e)return this._initNumber(e,t,r);if("object"==typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),i(t===(0|t)&&t>=2&&t<=36);var n=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(n++,this.negative=1),n<e.length&&(16===t?this._parseHex(e,n,r):(this._parseBase(e,t,n),"le"===r&&this._initArray(this.toArray(),t,r)))},o.prototype._initNumber=function(e,t,r){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(i(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),t,r)},o.prototype._initArray=function(e,t,r){if(i("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var o,a,s=0;if("be"===r)for(n=e.length-1,o=0;n>=0;n-=3)a=e[n]|e[n-1]<<8|e[n-2]<<16,this.words[o]|=a<<s&67108863,this.words[o+1]=a>>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);else if("le"===r)for(n=0,o=0;n<e.length;n+=3)a=e[n]|e[n+1]<<8|e[n+2]<<16,this.words[o]|=a<<s&67108863,this.words[o+1]=a>>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);return this.strip()},o.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var n,o=0,a=0;if("be"===r)for(i=e.length-1;i>=t;i-=2)n=u(e,t,i)<<o,this.words[a]|=67108863&n,o>=18?(o-=18,a+=1,this.words[a]|=n>>>26):o+=8;else for(i=(e.length-t)%2==0?t+1:t;i<e.length;i+=2)n=u(e,t,i)<<o,this.words[a]|=67108863&n,o>=18?(o-=18,a+=1,this.words[a]|=n>>>26):o+=8;this.strip()},o.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var i=0,n=1;n<=67108863;n*=t)i++;i--,n=n/t|0;for(var o=e.length-r,a=o%i,s=Math.min(o,o-a)+r,u=0,h=r;h<s;h+=i)u=c(e,h,h+i,t),this.imuln(n),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(0!==a){var l=1;for(u=c(e,h,e.length,t),h=0;h<a;h++)l*=t;this.imuln(l),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}this.strip()},o.prototype.copy=function(e){e.words=new Array(this.length);for(var t=0;t<this.length;t++)e.words[t]=this.words[t];e.length=this.length,e.negative=this.negative,e.red=this.red},o.prototype.clone=function(){var e=new o(null);return this.copy(e),e},o.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},o.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var h=["","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],f=[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 p(e,t,r){r.negative=t.negative^e.negative;var i=e.length+t.length|0;r.length=i,i=i-1|0;var n=0|e.words[0],o=0|t.words[0],a=n*o,s=67108863&a,u=a/67108864|0;r.words[0]=s;for(var c=1;c<i;c++){for(var h=u>>>26,l=67108863&u,f=Math.min(c,t.length-1),p=Math.max(0,c-e.length+1);p<=f;p++){var d=c-p|0;h+=(a=(n=0|e.words[d])*(o=0|t.words[p])+l)/67108864|0,l=67108863&a}r.words[c]=0|l,u=0|h}return 0!==u?r.words[c]=0|u:r.length--,r.strip()}o.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var n=0,o=0,a=0;a<this.length;a++){var s=this.words[a],u=(16777215&(s<<n|o)).toString(16);o=s>>>24-n&16777215,(n+=2)>=26&&(n-=26,a--),r=0!==o||a!==this.length-1?h[6-u.length]+u+r:u+r}for(0!==o&&(r=o.toString(16)+r);r.length%t!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var c=l[e],p=f[e];r="";var d=this.clone();for(d.negative=0;!d.isZero();){var g=d.modn(p).toString(e);r=(d=d.idivn(p)).isZero()?g+r:h[c-g.length]+g+r}for(this.isZero()&&(r="0"+r);r.length%t!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}i(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(e,t){return i(void 0!==a),this.toArrayLike(a,e,t)},o.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},o.prototype.toArrayLike=function(e,t,r){var n=this.byteLength(),o=r||Math.max(1,n);i(n<=o,"byte array longer than desired length"),i(o>0,"Requested array length <= 0"),this.strip();var a,s,u="le"===t,c=new e(o),h=this.clone();if(u){for(s=0;!h.isZero();s++)a=h.andln(255),h.iushrn(8),c[s]=a;for(;s<o;s++)c[s]=0}else{for(s=0;s<o-n;s++)c[s]=0;for(s=0;!h.isZero();s++)a=h.andln(255),h.iushrn(8),c[o-s-1]=a}return c},Math.clz32?o.prototype._countBits=function(e){return 32-Math.clz32(e)}:o.prototype._countBits=function(e){var t=e,r=0;return t>=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},o.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 8191&t||(r+=13,t>>>=13),127&t||(r+=7,t>>>=7),15&t||(r+=4,t>>>=4),3&t||(r+=2,t>>>=2),1&t||r++,r},o.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;t<this.length;t++){var r=this._zeroBits(this.words[t]);if(e+=r,26!==r)break}return e},o.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},o.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},o.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},o.prototype.isNeg=function(){return 0!==this.negative},o.prototype.neg=function(){return this.clone().ineg()},o.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},o.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var t=0;t<e.length;t++)this.words[t]=this.words[t]|e.words[t];return this.strip()},o.prototype.ior=function(e){return i(0===(this.negative|e.negative)),this.iuor(e)},o.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},o.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},o.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;r<t.length;r++)this.words[r]=this.words[r]&e.words[r];return this.length=t.length,this.strip()},o.prototype.iand=function(e){return i(0===(this.negative|e.negative)),this.iuand(e)},o.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},o.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},o.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var i=0;i<r.length;i++)this.words[i]=t.words[i]^r.words[i];if(this!==t)for(;i<t.length;i++)this.words[i]=t.words[i];return this.length=t.length,this.strip()},o.prototype.ixor=function(e){return i(0===(this.negative|e.negative)),this.iuxor(e)},o.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},o.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},o.prototype.inotn=function(e){i("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var n=0;n<t;n++)this.words[n]=67108863&~this.words[n];return r>0&&(this.words[n]=~this.words[n]&67108863>>26-r),this.strip()},o.prototype.notn=function(e){return this.clone().inotn(e)},o.prototype.setn=function(e,t){i("number"==typeof e&&e>=0);var r=e/26|0,n=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<<n:this.words[r]&~(1<<n),this.strip()},o.prototype.iadd=function(e){var t,r,i;if(0!==this.negative&&0===e.negative)return this.negative=0,t=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,t=this.isub(e),e.negative=1,t._normSign();this.length>e.length?(r=this,i=e):(r=e,i=this);for(var n=0,o=0;o<i.length;o++)t=(0|r.words[o])+(0|i.words[o])+n,this.words[o]=67108863&t,n=t>>>26;for(;0!==n&&o<r.length;o++)t=(0|r.words[o])+n,this.words[o]=67108863&t,n=t>>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this},o.prototype.add=function(e){var t;return 0!==e.negative&&0===this.negative?(e.negative=0,t=this.sub(e),e.negative^=1,t):0===e.negative&&0!==this.negative?(this.negative=0,t=e.sub(this),this.negative=1,t):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},o.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,i,n=this.cmp(e);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(r=this,i=e):(r=e,i=this);for(var o=0,a=0;a<i.length;a++)o=(t=(0|r.words[a])-(0|i.words[a])+o)>>26,this.words[a]=67108863&t;for(;0!==o&&a<r.length;a++)o=(t=(0|r.words[a])+o)>>26,this.words[a]=67108863&t;if(0===o&&a<r.length&&r!==this)for(;a<r.length;a++)this.words[a]=r.words[a];return this.length=Math.max(this.length,a),r!==this&&(this.negative=1),this.strip()},o.prototype.sub=function(e){return this.clone().isub(e)};var d=function(e,t,r){var i,n,o,a=e.words,s=t.words,u=r.words,c=0,h=0|a[0],l=8191&h,f=h>>>13,p=0|a[1],d=8191&p,g=p>>>13,m=0|a[2],y=8191&m,v=m>>>13,b=0|a[3],_=8191&b,w=b>>>13,S=0|a[4],E=8191&S,k=S>>>13,O=0|a[5],I=8191&O,A=O>>>13,x=0|a[6],P=8191&x,T=x>>>13,R=0|a[7],M=8191&R,B=R>>>13,C=0|a[8],N=8191&C,D=C>>>13,L=0|a[9],j=8191&L,U=L>>>13,H=0|s[0],F=8191&H,z=H>>>13,K=0|s[1],V=8191&K,q=K>>>13,G=0|s[2],Z=8191&G,Y=G>>>13,W=0|s[3],X=8191&W,$=W>>>13,J=0|s[4],Q=8191&J,ee=J>>>13,te=0|s[5],re=8191&te,ie=te>>>13,ne=0|s[6],oe=8191&ne,ae=ne>>>13,se=0|s[7],ue=8191&se,ce=se>>>13,he=0|s[8],le=8191&he,fe=he>>>13,pe=0|s[9],de=8191&pe,ge=pe>>>13;r.negative=e.negative^t.negative,r.length=19;var me=(c+(i=Math.imul(l,F))|0)+((8191&(n=(n=Math.imul(l,z))+Math.imul(f,F)|0))<<13)|0;c=((o=Math.imul(f,z))+(n>>>13)|0)+(me>>>26)|0,me&=67108863,i=Math.imul(d,F),n=(n=Math.imul(d,z))+Math.imul(g,F)|0,o=Math.imul(g,z);var ye=(c+(i=i+Math.imul(l,V)|0)|0)+((8191&(n=(n=n+Math.imul(l,q)|0)+Math.imul(f,V)|0))<<13)|0;c=((o=o+Math.imul(f,q)|0)+(n>>>13)|0)+(ye>>>26)|0,ye&=67108863,i=Math.imul(y,F),n=(n=Math.imul(y,z))+Math.imul(v,F)|0,o=Math.imul(v,z),i=i+Math.imul(d,V)|0,n=(n=n+Math.imul(d,q)|0)+Math.imul(g,V)|0,o=o+Math.imul(g,q)|0;var ve=(c+(i=i+Math.imul(l,Z)|0)|0)+((8191&(n=(n=n+Math.imul(l,Y)|0)+Math.imul(f,Z)|0))<<13)|0;c=((o=o+Math.imul(f,Y)|0)+(n>>>13)|0)+(ve>>>26)|0,ve&=67108863,i=Math.imul(_,F),n=(n=Math.imul(_,z))+Math.imul(w,F)|0,o=Math.imul(w,z),i=i+Math.imul(y,V)|0,n=(n=n+Math.imul(y,q)|0)+Math.imul(v,V)|0,o=o+Math.imul(v,q)|0,i=i+Math.imul(d,Z)|0,n=(n=n+Math.imul(d,Y)|0)+Math.imul(g,Z)|0,o=o+Math.imul(g,Y)|0;var be=(c+(i=i+Math.imul(l,X)|0)|0)+((8191&(n=(n=n+Math.imul(l,$)|0)+Math.imul(f,X)|0))<<13)|0;c=((o=o+Math.imul(f,$)|0)+(n>>>13)|0)+(be>>>26)|0,be&=67108863,i=Math.imul(E,F),n=(n=Math.imul(E,z))+Math.imul(k,F)|0,o=Math.imul(k,z),i=i+Math.imul(_,V)|0,n=(n=n+Math.imul(_,q)|0)+Math.imul(w,V)|0,o=o+Math.imul(w,q)|0,i=i+Math.imul(y,Z)|0,n=(n=n+Math.imul(y,Y)|0)+Math.imul(v,Z)|0,o=o+Math.imul(v,Y)|0,i=i+Math.imul(d,X)|0,n=(n=n+Math.imul(d,$)|0)+Math.imul(g,X)|0,o=o+Math.imul(g,$)|0;var _e=(c+(i=i+Math.imul(l,Q)|0)|0)+((8191&(n=(n=n+Math.imul(l,ee)|0)+Math.imul(f,Q)|0))<<13)|0;c=((o=o+Math.imul(f,ee)|0)+(n>>>13)|0)+(_e>>>26)|0,_e&=67108863,i=Math.imul(I,F),n=(n=Math.imul(I,z))+Math.imul(A,F)|0,o=Math.imul(A,z),i=i+Math.imul(E,V)|0,n=(n=n+Math.imul(E,q)|0)+Math.imul(k,V)|0,o=o+Math.imul(k,q)|0,i=i+Math.imul(_,Z)|0,n=(n=n+Math.imul(_,Y)|0)+Math.imul(w,Z)|0,o=o+Math.imul(w,Y)|0,i=i+Math.imul(y,X)|0,n=(n=n+Math.imul(y,$)|0)+Math.imul(v,X)|0,o=o+Math.imul(v,$)|0,i=i+Math.imul(d,Q)|0,n=(n=n+Math.imul(d,ee)|0)+Math.imul(g,Q)|0,o=o+Math.imul(g,ee)|0;var we=(c+(i=i+Math.imul(l,re)|0)|0)+((8191&(n=(n=n+Math.imul(l,ie)|0)+Math.imul(f,re)|0))<<13)|0;c=((o=o+Math.imul(f,ie)|0)+(n>>>13)|0)+(we>>>26)|0,we&=67108863,i=Math.imul(P,F),n=(n=Math.imul(P,z))+Math.imul(T,F)|0,o=Math.imul(T,z),i=i+Math.imul(I,V)|0,n=(n=n+Math.imul(I,q)|0)+Math.imul(A,V)|0,o=o+Math.imul(A,q)|0,i=i+Math.imul(E,Z)|0,n=(n=n+Math.imul(E,Y)|0)+Math.imul(k,Z)|0,o=o+Math.imul(k,Y)|0,i=i+Math.imul(_,X)|0,n=(n=n+Math.imul(_,$)|0)+Math.imul(w,X)|0,o=o+Math.imul(w,$)|0,i=i+Math.imul(y,Q)|0,n=(n=n+Math.imul(y,ee)|0)+Math.imul(v,Q)|0,o=o+Math.imul(v,ee)|0,i=i+Math.imul(d,re)|0,n=(n=n+Math.imul(d,ie)|0)+Math.imul(g,re)|0,o=o+Math.imul(g,ie)|0;var Se=(c+(i=i+Math.imul(l,oe)|0)|0)+((8191&(n=(n=n+Math.imul(l,ae)|0)+Math.imul(f,oe)|0))<<13)|0;c=((o=o+Math.imul(f,ae)|0)+(n>>>13)|0)+(Se>>>26)|0,Se&=67108863,i=Math.imul(M,F),n=(n=Math.imul(M,z))+Math.imul(B,F)|0,o=Math.imul(B,z),i=i+Math.imul(P,V)|0,n=(n=n+Math.imul(P,q)|0)+Math.imul(T,V)|0,o=o+Math.imul(T,q)|0,i=i+Math.imul(I,Z)|0,n=(n=n+Math.imul(I,Y)|0)+Math.imul(A,Z)|0,o=o+Math.imul(A,Y)|0,i=i+Math.imul(E,X)|0,n=(n=n+Math.imul(E,$)|0)+Math.imul(k,X)|0,o=o+Math.imul(k,$)|0,i=i+Math.imul(_,Q)|0,n=(n=n+Math.imul(_,ee)|0)+Math.imul(w,Q)|0,o=o+Math.imul(w,ee)|0,i=i+Math.imul(y,re)|0,n=(n=n+Math.imul(y,ie)|0)+Math.imul(v,re)|0,o=o+Math.imul(v,ie)|0,i=i+Math.imul(d,oe)|0,n=(n=n+Math.imul(d,ae)|0)+Math.imul(g,oe)|0,o=o+Math.imul(g,ae)|0;var Ee=(c+(i=i+Math.imul(l,ue)|0)|0)+((8191&(n=(n=n+Math.imul(l,ce)|0)+Math.imul(f,ue)|0))<<13)|0;c=((o=o+Math.imul(f,ce)|0)+(n>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,i=Math.imul(N,F),n=(n=Math.imul(N,z))+Math.imul(D,F)|0,o=Math.imul(D,z),i=i+Math.imul(M,V)|0,n=(n=n+Math.imul(M,q)|0)+Math.imul(B,V)|0,o=o+Math.imul(B,q)|0,i=i+Math.imul(P,Z)|0,n=(n=n+Math.imul(P,Y)|0)+Math.imul(T,Z)|0,o=o+Math.imul(T,Y)|0,i=i+Math.imul(I,X)|0,n=(n=n+Math.imul(I,$)|0)+Math.imul(A,X)|0,o=o+Math.imul(A,$)|0,i=i+Math.imul(E,Q)|0,n=(n=n+Math.imul(E,ee)|0)+Math.imul(k,Q)|0,o=o+Math.imul(k,ee)|0,i=i+Math.imul(_,re)|0,n=(n=n+Math.imul(_,ie)|0)+Math.imul(w,re)|0,o=o+Math.imul(w,ie)|0,i=i+Math.imul(y,oe)|0,n=(n=n+Math.imul(y,ae)|0)+Math.imul(v,oe)|0,o=o+Math.imul(v,ae)|0,i=i+Math.imul(d,ue)|0,n=(n=n+Math.imul(d,ce)|0)+Math.imul(g,ue)|0,o=o+Math.imul(g,ce)|0;var ke=(c+(i=i+Math.imul(l,le)|0)|0)+((8191&(n=(n=n+Math.imul(l,fe)|0)+Math.imul(f,le)|0))<<13)|0;c=((o=o+Math.imul(f,fe)|0)+(n>>>13)|0)+(ke>>>26)|0,ke&=67108863,i=Math.imul(j,F),n=(n=Math.imul(j,z))+Math.imul(U,F)|0,o=Math.imul(U,z),i=i+Math.imul(N,V)|0,n=(n=n+Math.imul(N,q)|0)+Math.imul(D,V)|0,o=o+Math.imul(D,q)|0,i=i+Math.imul(M,Z)|0,n=(n=n+Math.imul(M,Y)|0)+Math.imul(B,Z)|0,o=o+Math.imul(B,Y)|0,i=i+Math.imul(P,X)|0,n=(n=n+Math.imul(P,$)|0)+Math.imul(T,X)|0,o=o+Math.imul(T,$)|0,i=i+Math.imul(I,Q)|0,n=(n=n+Math.imul(I,ee)|0)+Math.imul(A,Q)|0,o=o+Math.imul(A,ee)|0,i=i+Math.imul(E,re)|0,n=(n=n+Math.imul(E,ie)|0)+Math.imul(k,re)|0,o=o+Math.imul(k,ie)|0,i=i+Math.imul(_,oe)|0,n=(n=n+Math.imul(_,ae)|0)+Math.imul(w,oe)|0,o=o+Math.imul(w,ae)|0,i=i+Math.imul(y,ue)|0,n=(n=n+Math.imul(y,ce)|0)+Math.imul(v,ue)|0,o=o+Math.imul(v,ce)|0,i=i+Math.imul(d,le)|0,n=(n=n+Math.imul(d,fe)|0)+Math.imul(g,le)|0,o=o+Math.imul(g,fe)|0;var Oe=(c+(i=i+Math.imul(l,de)|0)|0)+((8191&(n=(n=n+Math.imul(l,ge)|0)+Math.imul(f,de)|0))<<13)|0;c=((o=o+Math.imul(f,ge)|0)+(n>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,i=Math.imul(j,V),n=(n=Math.imul(j,q))+Math.imul(U,V)|0,o=Math.imul(U,q),i=i+Math.imul(N,Z)|0,n=(n=n+Math.imul(N,Y)|0)+Math.imul(D,Z)|0,o=o+Math.imul(D,Y)|0,i=i+Math.imul(M,X)|0,n=(n=n+Math.imul(M,$)|0)+Math.imul(B,X)|0,o=o+Math.imul(B,$)|0,i=i+Math.imul(P,Q)|0,n=(n=n+Math.imul(P,ee)|0)+Math.imul(T,Q)|0,o=o+Math.imul(T,ee)|0,i=i+Math.imul(I,re)|0,n=(n=n+Math.imul(I,ie)|0)+Math.imul(A,re)|0,o=o+Math.imul(A,ie)|0,i=i+Math.imul(E,oe)|0,n=(n=n+Math.imul(E,ae)|0)+Math.imul(k,oe)|0,o=o+Math.imul(k,ae)|0,i=i+Math.imul(_,ue)|0,n=(n=n+Math.imul(_,ce)|0)+Math.imul(w,ue)|0,o=o+Math.imul(w,ce)|0,i=i+Math.imul(y,le)|0,n=(n=n+Math.imul(y,fe)|0)+Math.imul(v,le)|0,o=o+Math.imul(v,fe)|0;var Ie=(c+(i=i+Math.imul(d,de)|0)|0)+((8191&(n=(n=n+Math.imul(d,ge)|0)+Math.imul(g,de)|0))<<13)|0;c=((o=o+Math.imul(g,ge)|0)+(n>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,i=Math.imul(j,Z),n=(n=Math.imul(j,Y))+Math.imul(U,Z)|0,o=Math.imul(U,Y),i=i+Math.imul(N,X)|0,n=(n=n+Math.imul(N,$)|0)+Math.imul(D,X)|0,o=o+Math.imul(D,$)|0,i=i+Math.imul(M,Q)|0,n=(n=n+Math.imul(M,ee)|0)+Math.imul(B,Q)|0,o=o+Math.imul(B,ee)|0,i=i+Math.imul(P,re)|0,n=(n=n+Math.imul(P,ie)|0)+Math.imul(T,re)|0,o=o+Math.imul(T,ie)|0,i=i+Math.imul(I,oe)|0,n=(n=n+Math.imul(I,ae)|0)+Math.imul(A,oe)|0,o=o+Math.imul(A,ae)|0,i=i+Math.imul(E,ue)|0,n=(n=n+Math.imul(E,ce)|0)+Math.imul(k,ue)|0,o=o+Math.imul(k,ce)|0,i=i+Math.imul(_,le)|0,n=(n=n+Math.imul(_,fe)|0)+Math.imul(w,le)|0,o=o+Math.imul(w,fe)|0;var Ae=(c+(i=i+Math.imul(y,de)|0)|0)+((8191&(n=(n=n+Math.imul(y,ge)|0)+Math.imul(v,de)|0))<<13)|0;c=((o=o+Math.imul(v,ge)|0)+(n>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,i=Math.imul(j,X),n=(n=Math.imul(j,$))+Math.imul(U,X)|0,o=Math.imul(U,$),i=i+Math.imul(N,Q)|0,n=(n=n+Math.imul(N,ee)|0)+Math.imul(D,Q)|0,o=o+Math.imul(D,ee)|0,i=i+Math.imul(M,re)|0,n=(n=n+Math.imul(M,ie)|0)+Math.imul(B,re)|0,o=o+Math.imul(B,ie)|0,i=i+Math.imul(P,oe)|0,n=(n=n+Math.imul(P,ae)|0)+Math.imul(T,oe)|0,o=o+Math.imul(T,ae)|0,i=i+Math.imul(I,ue)|0,n=(n=n+Math.imul(I,ce)|0)+Math.imul(A,ue)|0,o=o+Math.imul(A,ce)|0,i=i+Math.imul(E,le)|0,n=(n=n+Math.imul(E,fe)|0)+Math.imul(k,le)|0,o=o+Math.imul(k,fe)|0;var xe=(c+(i=i+Math.imul(_,de)|0)|0)+((8191&(n=(n=n+Math.imul(_,ge)|0)+Math.imul(w,de)|0))<<13)|0;c=((o=o+Math.imul(w,ge)|0)+(n>>>13)|0)+(xe>>>26)|0,xe&=67108863,i=Math.imul(j,Q),n=(n=Math.imul(j,ee))+Math.imul(U,Q)|0,o=Math.imul(U,ee),i=i+Math.imul(N,re)|0,n=(n=n+Math.imul(N,ie)|0)+Math.imul(D,re)|0,o=o+Math.imul(D,ie)|0,i=i+Math.imul(M,oe)|0,n=(n=n+Math.imul(M,ae)|0)+Math.imul(B,oe)|0,o=o+Math.imul(B,ae)|0,i=i+Math.imul(P,ue)|0,n=(n=n+Math.imul(P,ce)|0)+Math.imul(T,ue)|0,o=o+Math.imul(T,ce)|0,i=i+Math.imul(I,le)|0,n=(n=n+Math.imul(I,fe)|0)+Math.imul(A,le)|0,o=o+Math.imul(A,fe)|0;var Pe=(c+(i=i+Math.imul(E,de)|0)|0)+((8191&(n=(n=n+Math.imul(E,ge)|0)+Math.imul(k,de)|0))<<13)|0;c=((o=o+Math.imul(k,ge)|0)+(n>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,i=Math.imul(j,re),n=(n=Math.imul(j,ie))+Math.imul(U,re)|0,o=Math.imul(U,ie),i=i+Math.imul(N,oe)|0,n=(n=n+Math.imul(N,ae)|0)+Math.imul(D,oe)|0,o=o+Math.imul(D,ae)|0,i=i+Math.imul(M,ue)|0,n=(n=n+Math.imul(M,ce)|0)+Math.imul(B,ue)|0,o=o+Math.imul(B,ce)|0,i=i+Math.imul(P,le)|0,n=(n=n+Math.imul(P,fe)|0)+Math.imul(T,le)|0,o=o+Math.imul(T,fe)|0;var Te=(c+(i=i+Math.imul(I,de)|0)|0)+((8191&(n=(n=n+Math.imul(I,ge)|0)+Math.imul(A,de)|0))<<13)|0;c=((o=o+Math.imul(A,ge)|0)+(n>>>13)|0)+(Te>>>26)|0,Te&=67108863,i=Math.imul(j,oe),n=(n=Math.imul(j,ae))+Math.imul(U,oe)|0,o=Math.imul(U,ae),i=i+Math.imul(N,ue)|0,n=(n=n+Math.imul(N,ce)|0)+Math.imul(D,ue)|0,o=o+Math.imul(D,ce)|0,i=i+Math.imul(M,le)|0,n=(n=n+Math.imul(M,fe)|0)+Math.imul(B,le)|0,o=o+Math.imul(B,fe)|0;var Re=(c+(i=i+Math.imul(P,de)|0)|0)+((8191&(n=(n=n+Math.imul(P,ge)|0)+Math.imul(T,de)|0))<<13)|0;c=((o=o+Math.imul(T,ge)|0)+(n>>>13)|0)+(Re>>>26)|0,Re&=67108863,i=Math.imul(j,ue),n=(n=Math.imul(j,ce))+Math.imul(U,ue)|0,o=Math.imul(U,ce),i=i+Math.imul(N,le)|0,n=(n=n+Math.imul(N,fe)|0)+Math.imul(D,le)|0,o=o+Math.imul(D,fe)|0;var Me=(c+(i=i+Math.imul(M,de)|0)|0)+((8191&(n=(n=n+Math.imul(M,ge)|0)+Math.imul(B,de)|0))<<13)|0;c=((o=o+Math.imul(B,ge)|0)+(n>>>13)|0)+(Me>>>26)|0,Me&=67108863,i=Math.imul(j,le),n=(n=Math.imul(j,fe))+Math.imul(U,le)|0,o=Math.imul(U,fe);var Be=(c+(i=i+Math.imul(N,de)|0)|0)+((8191&(n=(n=n+Math.imul(N,ge)|0)+Math.imul(D,de)|0))<<13)|0;c=((o=o+Math.imul(D,ge)|0)+(n>>>13)|0)+(Be>>>26)|0,Be&=67108863;var Ce=(c+(i=Math.imul(j,de))|0)+((8191&(n=(n=Math.imul(j,ge))+Math.imul(U,de)|0))<<13)|0;return c=((o=Math.imul(U,ge))+(n>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,u[0]=me,u[1]=ye,u[2]=ve,u[3]=be,u[4]=_e,u[5]=we,u[6]=Se,u[7]=Ee,u[8]=ke,u[9]=Oe,u[10]=Ie,u[11]=Ae,u[12]=xe,u[13]=Pe,u[14]=Te,u[15]=Re,u[16]=Me,u[17]=Be,u[18]=Ce,0!==c&&(u[19]=c,r.length++),r};function g(e,t,r){return(new m).mulp(e,t,r)}function m(e,t){this.x=e,this.y=t}Math.imul||(d=p),o.prototype.mulTo=function(e,t){var r,i=this.length+e.length;return r=10===this.length&&10===e.length?d(this,e,t):i<63?p(this,e,t):i<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var i=0,n=0,o=0;o<r.length-1;o++){var a=n;n=0;for(var s=67108863&i,u=Math.min(o,t.length-1),c=Math.max(0,o-e.length+1);c<=u;c++){var h=o-c,l=(0|e.words[h])*(0|t.words[c]),f=67108863&l;s=67108863&(f=f+s|0),n+=(a=(a=a+(l/67108864|0)|0)+(f>>>26)|0)>>>26,a&=67108863}r.words[o]=s,i=a,a=n}return 0!==i?r.words[o]=i:r.length--,r.strip()}(this,e,t):g(this,e,t),r},m.prototype.makeRBT=function(e){for(var t=new Array(e),r=o.prototype._countBits(e)-1,i=0;i<e;i++)t[i]=this.revBin(i,r,e);return t},m.prototype.revBin=function(e,t,r){if(0===e||e===r-1)return e;for(var i=0,n=0;n<t;n++)i|=(1&e)<<t-n-1,e>>=1;return i},m.prototype.permute=function(e,t,r,i,n,o){for(var a=0;a<o;a++)i[a]=t[e[a]],n[a]=r[e[a]]},m.prototype.transform=function(e,t,r,i,n,o){this.permute(o,e,t,r,i,n);for(var a=1;a<n;a<<=1)for(var s=a<<1,u=Math.cos(2*Math.PI/s),c=Math.sin(2*Math.PI/s),h=0;h<n;h+=s)for(var l=u,f=c,p=0;p<a;p++){var d=r[h+p],g=i[h+p],m=r[h+p+a],y=i[h+p+a],v=l*m-f*y;y=l*y+f*m,m=v,r[h+p]=d+m,i[h+p]=g+y,r[h+p+a]=d-m,i[h+p+a]=g-y,p!==s&&(v=u*l-c*f,f=u*f+c*l,l=v)}},m.prototype.guessLen13b=function(e,t){var r=1|Math.max(t,e),i=1&r,n=0;for(r=r/2|0;r;r>>>=1)n++;return 1<<n+1+i},m.prototype.conjugate=function(e,t,r){if(!(r<=1))for(var i=0;i<r/2;i++){var n=e[i];e[i]=e[r-i-1],e[r-i-1]=n,n=t[i],t[i]=-t[r-i-1],t[r-i-1]=-n}},m.prototype.normalize13b=function(e,t){for(var r=0,i=0;i<t/2;i++){var n=8192*Math.round(e[2*i+1]/t)+Math.round(e[2*i]/t)+r;e[i]=67108863&n,r=n<67108864?0:n/67108864|0}return e},m.prototype.convert13b=function(e,t,r,n){for(var o=0,a=0;a<t;a++)o+=0|e[a],r[2*a]=8191&o,o>>>=13,r[2*a+1]=8191&o,o>>>=13;for(a=2*t;a<n;++a)r[a]=0;i(0===o),i(!(-8192&o))},m.prototype.stub=function(e){for(var t=new Array(e),r=0;r<e;r++)t[r]=0;return t},m.prototype.mulp=function(e,t,r){var i=2*this.guessLen13b(e.length,t.length),n=this.makeRBT(i),o=this.stub(i),a=new Array(i),s=new Array(i),u=new Array(i),c=new Array(i),h=new Array(i),l=new Array(i),f=r.words;f.length=i,this.convert13b(e.words,e.length,a,i),this.convert13b(t.words,t.length,c,i),this.transform(a,o,s,u,i,n),this.transform(c,o,h,l,i,n);for(var p=0;p<i;p++){var d=s[p]*h[p]-u[p]*l[p];u[p]=s[p]*l[p]+u[p]*h[p],s[p]=d}return this.conjugate(s,u,i),this.transform(s,u,f,o,i,n),this.conjugate(f,o,i),this.normalize13b(f,i),r.negative=e.negative^t.negative,r.length=e.length+t.length,r.strip()},o.prototype.mul=function(e){var t=new o(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},o.prototype.mulf=function(e){var t=new o(null);return t.words=new Array(this.length+e.length),g(this,e,t)},o.prototype.imul=function(e){return this.clone().mulTo(e,this)},o.prototype.imuln=function(e){i("number"==typeof e),i(e<67108864);for(var t=0,r=0;r<this.length;r++){var n=(0|this.words[r])*e,o=(67108863&n)+(67108863&t);t>>=26,t+=n/67108864|0,t+=o>>>26,this.words[r]=67108863&o}return 0!==t&&(this.words[r]=t,this.length++),this.length=0===e?1:this.length,this},o.prototype.muln=function(e){return this.clone().imuln(e)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r<t.length;r++){var i=r/26|0,n=r%26;t[r]=(e.words[i]&1<<n)>>>n}return t}(e);if(0===t.length)return new o(1);for(var r=this,i=0;i<t.length&&0===t[i];i++,r=r.sqr());if(++i<t.length)for(var n=r.sqr();i<t.length;i++,n=n.sqr())0!==t[i]&&(r=r.mul(n));return r},o.prototype.iushln=function(e){i("number"==typeof e&&e>=0);var t,r=e%26,n=(e-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var a=0;for(t=0;t<this.length;t++){var s=this.words[t]&o,u=(0|this.words[t])-s<<r;this.words[t]=u|a,a=s>>>26-r}a&&(this.words[t]=a,this.length++)}if(0!==n){for(t=this.length-1;t>=0;t--)this.words[t+n]=this.words[t];for(t=0;t<n;t++)this.words[t]=0;this.length+=n}return this.strip()},o.prototype.ishln=function(e){return i(0===this.negative),this.iushln(e)},o.prototype.iushrn=function(e,t,r){var n;i("number"==typeof e&&e>=0),n=t?(t-t%26)/26:0;var o=e%26,a=Math.min((e-o)/26,this.length),s=67108863^67108863>>>o<<o,u=r;if(n-=a,n=Math.max(0,n),u){for(var c=0;c<a;c++)u.words[c]=this.words[c];u.length=a}if(0===a);else if(this.length>a)for(this.length-=a,c=0;c<this.length;c++)this.words[c]=this.words[c+a];else this.words[0]=0,this.length=1;var h=0;for(c=this.length-1;c>=0&&(0!==h||c>=n);c--){var l=0|this.words[c];this.words[c]=h<<26-o|l>>>o,h=l&s}return u&&0!==h&&(u.words[u.length++]=h),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(e,t,r){return i(0===this.negative),this.iushrn(e,t,r)},o.prototype.shln=function(e){return this.clone().ishln(e)},o.prototype.ushln=function(e){return this.clone().iushln(e)},o.prototype.shrn=function(e){return this.clone().ishrn(e)},o.prototype.ushrn=function(e){return this.clone().iushrn(e)},o.prototype.testn=function(e){i("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26,n=1<<t;return!(this.length<=r)&&!!(this.words[r]&n)},o.prototype.imaskn=function(e){i("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26;if(i(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var n=67108863^67108863>>>t<<t;this.words[this.length-1]&=n}return 0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.maskn=function(e){return this.clone().imaskn(e)},o.prototype.iaddn=function(e){return i("number"==typeof e),i(e<67108864),e<0?this.isubn(-e):0!==this.negative?1===this.length&&(0|this.words[0])<e?(this.words[0]=e-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(e),this.negative=1,this):this._iaddn(e)},o.prototype._iaddn=function(e){this.words[0]+=e;for(var t=0;t<this.length&&this.words[t]>=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},o.prototype.isubn=function(e){if(i("number"==typeof e),i(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t<this.length&&this.words[t]<0;t++)this.words[t]+=67108864,this.words[t+1]-=1;return this.strip()},o.prototype.addn=function(e){return this.clone().iaddn(e)},o.prototype.subn=function(e){return this.clone().isubn(e)},o.prototype.iabs=function(){return this.negative=0,this},o.prototype.abs=function(){return this.clone().iabs()},o.prototype._ishlnsubmul=function(e,t,r){var n,o,a=e.length+r;this._expand(a);var s=0;for(n=0;n<e.length;n++){o=(0|this.words[n+r])+s;var u=(0|e.words[n])*t;s=((o-=67108863&u)>>26)-(u/67108864|0),this.words[n+r]=67108863&o}for(;n<this.length-r;n++)s=(o=(0|this.words[n+r])+s)>>26,this.words[n+r]=67108863&o;if(0===s)return this.strip();for(i(-1===s),s=0,n=0;n<this.length;n++)s=(o=-(0|this.words[n])+s)>>26,this.words[n]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(e,t){var r=(this.length,e.length),i=this.clone(),n=e,a=0|n.words[n.length-1];0!==(r=26-this._countBits(a))&&(n=n.ushln(r),i.iushln(r),a=0|n.words[n.length-1]);var s,u=i.length-n.length;if("mod"!==t){(s=new o(null)).length=u+1,s.words=new Array(s.length);for(var c=0;c<s.length;c++)s.words[c]=0}var h=i.clone()._ishlnsubmul(n,1,u);0===h.negative&&(i=h,s&&(s.words[u]=1));for(var l=u-1;l>=0;l--){var f=67108864*(0|i.words[n.length+l])+(0|i.words[n.length+l-1]);for(f=Math.min(f/a|0,67108863),i._ishlnsubmul(n,f,l);0!==i.negative;)f--,i.negative=0,i._ishlnsubmul(n,1,l),i.isZero()||(i.negative^=1);s&&(s.words[l]=f)}return s&&s.strip(),i.strip(),"div"!==t&&0!==r&&i.iushrn(r),{div:s||null,mod:i}},o.prototype.divmod=function(e,t,r){return i(!e.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(n=s.div.neg()),"div"!==t&&(a=s.mod.neg(),r&&0!==a.negative&&a.iadd(e)),{div:n,mod:a}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(n=s.div.neg()),{div:n,mod:s.mod}):0!==(this.negative&e.negative)?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(a=s.mod.neg(),r&&0!==a.negative&&a.isub(e)),{div:s.div,mod:a}):e.length>this.length||this.cmp(e)<0?{div:new o(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new o(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new o(this.modn(e.words[0]))}:this._wordDiv(e,t);var n,a,s},o.prototype.div=function(e){return this.divmod(e,"div",!1).div},o.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},o.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},o.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,i=e.ushrn(1),n=e.andln(1),o=r.cmp(i);return o<0||1===n&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},o.prototype.modn=function(e){i(e<=67108863);for(var t=(1<<26)%e,r=0,n=this.length-1;n>=0;n--)r=(t*r+(0|this.words[n]))%e;return r},o.prototype.idivn=function(e){i(e<=67108863);for(var t=0,r=this.length-1;r>=0;r--){var n=(0|this.words[r])+67108864*t;this.words[r]=n/e|0,t=n%e}return this.strip()},o.prototype.divn=function(e){return this.clone().idivn(e)},o.prototype.egcd=function(e){i(0===e.negative),i(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var n=new o(1),a=new o(0),s=new o(0),u=new o(1),c=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++c;for(var h=r.clone(),l=t.clone();!t.isZero();){for(var f=0,p=1;0===(t.words[0]&p)&&f<26;++f,p<<=1);if(f>0)for(t.iushrn(f);f-- >0;)(n.isOdd()||a.isOdd())&&(n.iadd(h),a.isub(l)),n.iushrn(1),a.iushrn(1);for(var d=0,g=1;0===(r.words[0]&g)&&d<26;++d,g<<=1);if(d>0)for(r.iushrn(d);d-- >0;)(s.isOdd()||u.isOdd())&&(s.iadd(h),u.isub(l)),s.iushrn(1),u.iushrn(1);t.cmp(r)>=0?(t.isub(r),n.isub(s),a.isub(u)):(r.isub(t),s.isub(n),u.isub(a))}return{a:s,b:u,gcd:r.iushln(c)}},o.prototype._invmp=function(e){i(0===e.negative),i(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var n,a=new o(1),s=new o(0),u=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var c=0,h=1;0===(t.words[0]&h)&&c<26;++c,h<<=1);if(c>0)for(t.iushrn(c);c-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);for(var l=0,f=1;0===(r.words[0]&f)&&l<26;++l,f<<=1);if(l>0)for(r.iushrn(l);l-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);t.cmp(r)>=0?(t.isub(r),a.isub(s)):(r.isub(t),s.isub(a))}return(n=0===t.cmpn(1)?a:s).cmpn(0)<0&&n.iadd(e),n},o.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var i=0;t.isEven()&&r.isEven();i++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var n=t.cmp(r);if(n<0){var o=t;t=r,r=o}else if(0===n||0===r.cmpn(1))break;t.isub(r)}return r.iushln(i)},o.prototype.invm=function(e){return this.egcd(e).a.umod(e)},o.prototype.isEven=function(){return!(1&this.words[0])},o.prototype.isOdd=function(){return!(1&~this.words[0])},o.prototype.andln=function(e){return this.words[0]&e},o.prototype.bincn=function(e){i("number"==typeof e);var t=e%26,r=(e-t)/26,n=1<<t;if(this.length<=r)return this._expand(r+1),this.words[r]|=n,this;for(var o=n,a=r;0!==o&&a<this.length;a++){var s=0|this.words[a];o=(s+=o)>>>26,s&=67108863,this.words[a]=s}return 0!==o&&(this.words[a]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)t=1;else{r&&(e=-e),i(e<=67108863,"Number is too big");var n=0|this.words[0];t=n===e?0:n<e?-1:1}return 0!==this.negative?0|-t:t},o.prototype.cmp=function(e){if(0!==this.negative&&0===e.negative)return-1;if(0===this.negative&&0!==e.negative)return 1;var t=this.ucmp(e);return 0!==this.negative?0|-t:t},o.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var t=0,r=this.length-1;r>=0;r--){var i=0|this.words[r],n=0|e.words[r];if(i!==n){i<n?t=-1:i>n&&(t=1);break}}return t},o.prototype.gtn=function(e){return 1===this.cmpn(e)},o.prototype.gt=function(e){return 1===this.cmp(e)},o.prototype.gten=function(e){return this.cmpn(e)>=0},o.prototype.gte=function(e){return this.cmp(e)>=0},o.prototype.ltn=function(e){return-1===this.cmpn(e)},o.prototype.lt=function(e){return-1===this.cmp(e)},o.prototype.lten=function(e){return this.cmpn(e)<=0},o.prototype.lte=function(e){return this.cmp(e)<=0},o.prototype.eqn=function(e){return 0===this.cmpn(e)},o.prototype.eq=function(e){return 0===this.cmp(e)},o.red=function(e){return new E(e)},o.prototype.toRed=function(e){return 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(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(e){return this.red=e,this},o.prototype.forceRed=function(e){return i(!this.red,"Already a number in reduction context"),this._forceRed(e)},o.prototype.redAdd=function(e){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},o.prototype.redIAdd=function(e){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},o.prototype.redSub=function(e){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},o.prototype.redISub=function(e){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},o.prototype.redShl=function(e){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},o.prototype.redMul=function(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(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(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(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 v(e,t){this.name=e,this.p=new o(t,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function b(){v.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function _(){v.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function w(){v.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function S(){v.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function E(e){if("string"==typeof e){var t=o._prime(e);this.m=t.p,this.prime=t}else i(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function k(e){E.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}v.prototype._tmp=function(){var e=new o(null);return e.words=new Array(Math.ceil(this.n/13)),e},v.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var i=t<this.n?-1:r.ucmp(this.p);return 0===i?(r.words[0]=0,r.length=1):i>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},v.prototype.split=function(e,t){e.iushrn(this.n,0,t)},v.prototype.imulK=function(e){return e.imul(this.k)},n(b,v),b.prototype.split=function(e,t){for(var r=4194303,i=Math.min(e.length,9),n=0;n<i;n++)t.words[n]=e.words[n];if(t.length=i,e.length<=9)return e.words[0]=0,void(e.length=1);var o=e.words[9];for(t.words[t.length++]=o&r,n=10;n<e.length;n++){var a=0|e.words[n];e.words[n-10]=(a&r)<<4|o>>>22,o=a}o>>>=22,e.words[n-10]=o,0===o&&e.length>10?e.length-=10:e.length-=9},b.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r<e.length;r++){var i=0|e.words[r];t+=977*i,e.words[r]=67108863&t,t=64*i+(t/67108864|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},n(_,v),n(w,v),n(S,v),S.prototype.imulK=function(e){for(var t=0,r=0;r<e.length;r++){var i=19*(0|e.words[r])+t,n=67108863&i;i>>>=26,e.words[r]=n,t=i}return 0!==t&&(e.words[e.length++]=t),e},o._prime=function(e){if(y[e])return y[e];var t;if("k256"===e)t=new b;else if("p224"===e)t=new _;else if("p192"===e)t=new w;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new S}return y[e]=t,t},E.prototype._verify1=function(e){i(0===e.negative,"red works only with positives"),i(e.red,"red works only with red numbers")},E.prototype._verify2=function(e,t){i(0===(e.negative|t.negative),"red works only with positives"),i(e.red&&e.red===t.red,"red works only with red numbers")},E.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},E.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},E.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},E.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},E.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},E.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},E.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},E.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},E.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},E.prototype.isqr=function(e){return this.imul(e,e.clone())},E.prototype.sqr=function(e){return this.mul(e,e)},E.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(i(t%2==1),3===t){var r=this.m.add(new o(1)).iushrn(2);return this.pow(e,r)}for(var n=this.m.subn(1),a=0;!n.isZero()&&0===n.andln(1);)a++,n.iushrn(1);i(!n.isZero());var s=new o(1).toRed(this),u=s.redNeg(),c=this.m.subn(1).iushrn(1),h=this.m.bitLength();for(h=new o(2*h*h).toRed(this);0!==this.pow(h,c).cmp(u);)h.redIAdd(u);for(var l=this.pow(h,n),f=this.pow(e,n.addn(1).iushrn(1)),p=this.pow(e,n),d=a;0!==p.cmp(s);){for(var g=p,m=0;0!==g.cmp(s);m++)g=g.redSqr();i(m<d);var y=this.pow(l,new o(1).iushln(d-m-1));f=f.redMul(y),l=y.redSqr(),p=p.redMul(l),d=m}return f},E.prototype.invm=function(e){var t=e._invmp(this.m);return 0!==t.negative?(t.negative=0,this.imod(t).redNeg()):this.imod(t)},E.prototype.pow=function(e,t){if(t.isZero())return new o(1).toRed(this);if(0===t.cmpn(1))return e.clone();var r=new Array(16);r[0]=new o(1).toRed(this),r[1]=e;for(var i=2;i<r.length;i++)r[i]=this.mul(r[i-1],e);var n=r[0],a=0,s=0,u=t.bitLength()%26;for(0===u&&(u=26),i=t.length-1;i>=0;i--){for(var c=t.words[i],h=u-1;h>=0;h--){var l=c>>h&1;n!==r[0]&&(n=this.sqr(n)),0!==l||0!==a?(a<<=1,a|=l,(4===++s||0===i&&0===h)&&(n=this.mul(n,r[a]),s=0,a=0)):s=0}u=26}return n},E.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},E.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},o.mont=function(e){return new k(e)},n(k,E),k.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},k.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},k.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},k.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new o(0)._forceRed(this);var r=e.mul(t),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),a=n;return n.cmp(this.m)>=0?a=n.isub(this.m):n.cmpn(0)<0&&(a=n.iadd(this.m)),a._forceRed(this)},k.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=r.nmd(e),this)},5037(e,t,r){var i;function n(e){this.rand=e}if(e.exports=function(e){return i||(i=new n(null)),i.generate(e)},e.exports.Rand=n,n.prototype.generate=function(e){return this._rand(e)},n.prototype._rand=function(e){if(this.rand.getBytes)return this.rand.getBytes(e);for(var t=new Uint8Array(e),r=0;r<t.length;r++)t[r]=this.rand.getByte();return t},"object"==typeof self)self.crypto&&self.crypto.getRandomValues?n.prototype._rand=function(e){var t=new Uint8Array(e);return self.crypto.getRandomValues(t),t}:self.msCrypto&&self.msCrypto.getRandomValues?n.prototype._rand=function(e){var t=new Uint8Array(e);return self.msCrypto.getRandomValues(t),t}:"object"==typeof window&&(n.prototype._rand=function(){throw new Error("Not implemented yet")});else try{var o=r(3776);if("function"!=typeof o.randomBytes)throw new Error("Not supported");n.prototype._rand=function(e){return o.randomBytes(e)}}catch(e){}},462(e,t,r){var i=r(2861).Buffer;function n(e){i.isBuffer(e)||(e=i.from(e));for(var t=e.length/4|0,r=new Array(t),n=0;n<t;n++)r[n]=e.readUInt32BE(4*n);return r}function o(e){for(;0<e.length;e++)e[0]=0}function a(e,t,r,i,n){for(var o,a,s,u,c=r[0],h=r[1],l=r[2],f=r[3],p=e[0]^t[0],d=e[1]^t[1],g=e[2]^t[2],m=e[3]^t[3],y=4,v=1;v<n;v++)o=c[p>>>24]^h[d>>>16&255]^l[g>>>8&255]^f[255&m]^t[y++],a=c[d>>>24]^h[g>>>16&255]^l[m>>>8&255]^f[255&p]^t[y++],s=c[g>>>24]^h[m>>>16&255]^l[p>>>8&255]^f[255&d]^t[y++],u=c[m>>>24]^h[p>>>16&255]^l[d>>>8&255]^f[255&g]^t[y++],p=o,d=a,g=s,m=u;return o=(i[p>>>24]<<24|i[d>>>16&255]<<16|i[g>>>8&255]<<8|i[255&m])^t[y++],a=(i[d>>>24]<<24|i[g>>>16&255]<<16|i[m>>>8&255]<<8|i[255&p])^t[y++],s=(i[g>>>24]<<24|i[m>>>16&255]<<16|i[p>>>8&255]<<8|i[255&d])^t[y++],u=(i[m>>>24]<<24|i[p>>>16&255]<<16|i[d>>>8&255]<<8|i[255&g])^t[y++],[o>>>=0,a>>>=0,s>>>=0,u>>>=0]}var s=[0,1,2,4,8,16,32,64,128,27,54],u=function(){for(var e=new Array(256),t=0;t<256;t++)e[t]=t<128?t<<1:t<<1^283;for(var r=[],i=[],n=[[],[],[],[]],o=[[],[],[],[]],a=0,s=0,u=0;u<256;++u){var c=s^s<<1^s<<2^s<<3^s<<4;c=c>>>8^255&c^99,r[a]=c,i[c]=a;var h=e[a],l=e[h],f=e[l],p=257*e[c]^16843008*c;n[0][a]=p<<24|p>>>8,n[1][a]=p<<16|p>>>16,n[2][a]=p<<8|p>>>24,n[3][a]=p,p=16843009*f^65537*l^257*h^16843008*a,o[0][c]=p<<24|p>>>8,o[1][c]=p<<16|p>>>16,o[2][c]=p<<8|p>>>24,o[3][c]=p,0===a?a=s=1:(a=h^e[e[e[f^h]]],s^=e[e[s]])}return{SBOX:r,INV_SBOX:i,SUB_MIX:n,INV_SUB_MIX:o}}();function c(e){this._key=n(e),this._reset()}c.blockSize=16,c.keySize=32,c.prototype.blockSize=c.blockSize,c.prototype.keySize=c.keySize,c.prototype._reset=function(){for(var e=this._key,t=e.length,r=t+6,i=4*(r+1),n=[],o=0;o<t;o++)n[o]=e[o];for(o=t;o<i;o++){var a=n[o-1];o%t===0?(a=a<<8|a>>>24,a=u.SBOX[a>>>24]<<24|u.SBOX[a>>>16&255]<<16|u.SBOX[a>>>8&255]<<8|u.SBOX[255&a],a^=s[o/t|0]<<24):t>6&&o%t===4&&(a=u.SBOX[a>>>24]<<24|u.SBOX[a>>>16&255]<<16|u.SBOX[a>>>8&255]<<8|u.SBOX[255&a]),n[o]=n[o-t]^a}for(var c=[],h=0;h<i;h++){var l=i-h,f=n[l-(h%4?0:4)];c[h]=h<4||l<=4?f:u.INV_SUB_MIX[0][u.SBOX[f>>>24]]^u.INV_SUB_MIX[1][u.SBOX[f>>>16&255]]^u.INV_SUB_MIX[2][u.SBOX[f>>>8&255]]^u.INV_SUB_MIX[3][u.SBOX[255&f]]}this._nRounds=r,this._keySchedule=n,this._invKeySchedule=c},c.prototype.encryptBlockRaw=function(e){return a(e=n(e),this._keySchedule,u.SUB_MIX,u.SBOX,this._nRounds)},c.prototype.encryptBlock=function(e){var t=this.encryptBlockRaw(e),r=i.allocUnsafe(16);return r.writeUInt32BE(t[0],0),r.writeUInt32BE(t[1],4),r.writeUInt32BE(t[2],8),r.writeUInt32BE(t[3],12),r},c.prototype.decryptBlock=function(e){var t=(e=n(e))[1];e[1]=e[3],e[3]=t;var r=a(e,this._invKeySchedule,u.INV_SUB_MIX,u.INV_SBOX,this._nRounds),o=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},c.prototype.scrub=function(){o(this._keySchedule),o(this._invKeySchedule),o(this._key)},e.exports.AES=c},2356(e,t,r){var i=r(462),n=r(2861).Buffer,o=r(6168),a=r(6698),s=r(5892),u=r(295),c=r(5122);function h(e,t,r,a){o.call(this);var u=n.alloc(4,0);this._cipher=new i.AES(t);var h=this._cipher.encryptBlock(u);this._ghash=new s(h),r=function(e,t,r){if(12===t.length)return e._finID=n.concat([t,n.from([0,0,0,1])]),n.concat([t,n.from([0,0,0,2])]);var i=new s(r),o=t.length,a=o%16;i.update(t),a&&(a=16-a,i.update(n.alloc(a,0))),i.update(n.alloc(8,0));var u=8*o,h=n.alloc(8);h.writeUIntBE(u,0,8),i.update(h),e._finID=i.state;var l=n.from(e._finID);return c(l),l}(this,r,h),this._prev=n.from(r),this._cache=n.allocUnsafe(0),this._secCache=n.allocUnsafe(0),this._decrypt=a,this._alen=0,this._len=0,this._mode=e,this._authTag=null,this._called=!1}a(h,o),h.prototype._update=function(e){if(!this._called&&this._alen){var t=16-this._alen%16;t<16&&(t=n.alloc(t,0),this._ghash.update(t))}this._called=!0;var r=this._mode.encrypt(this,e);return this._decrypt?this._ghash.update(e):this._ghash.update(r),this._len+=e.length,r},h.prototype._final=function(){if(this._decrypt&&!this._authTag)throw new Error("Unsupported state or unable to authenticate data");var e=u(this._ghash.final(8*this._alen,8*this._len),this._cipher.encryptBlock(this._finID));if(this._decrypt&&function(e,t){var r=0;e.length!==t.length&&r++;for(var i=Math.min(e.length,t.length),n=0;n<i;++n)r+=e[n]^t[n];return r}(e,this._authTag))throw new Error("Unsupported state or unable to authenticate data");this._authTag=e,this._cipher.scrub()},h.prototype.getAuthTag=function(){if(this._decrypt||!n.isBuffer(this._authTag))throw new Error("Attempting to get auth tag in unsupported state");return this._authTag},h.prototype.setAuthTag=function(e){if(!this._decrypt)throw new Error("Attempting to set auth tag in unsupported state");this._authTag=e},h.prototype.setAAD=function(e){if(this._called)throw new Error("Attempting to set AAD in unsupported state");this._ghash.update(e),this._alen+=e.length},e.exports=h},1241(e,t,r){var i=r(5799),n=r(6171),o=r(3219);t.createCipher=t.Cipher=i.createCipher,t.createCipheriv=t.Cipheriv=i.createCipheriv,t.createDecipher=t.Decipher=n.createDecipher,t.createDecipheriv=t.Decipheriv=n.createDecipheriv,t.listCiphers=t.getCiphers=function(){return Object.keys(o)}},6171(e,t,r){var i=r(2356),n=r(2861).Buffer,o=r(530),a=r(650),s=r(6168),u=r(462),c=r(8078);function h(e,t,r){s.call(this),this._cache=new l,this._last=void 0,this._cipher=new u.AES(t),this._prev=n.from(r),this._mode=e,this._autopadding=!0}function l(){this.cache=n.allocUnsafe(0)}function f(e,t,r){var s=o[e.toLowerCase()];if(!s)throw new TypeError("invalid suite type");if("string"==typeof r&&(r=n.from(r)),"GCM"!==s.mode&&r.length!==s.iv)throw new TypeError("invalid iv length "+r.length);if("string"==typeof t&&(t=n.from(t)),t.length!==s.key/8)throw new TypeError("invalid key length "+t.length);return"stream"===s.type?new a(s.module,t,r,!0):"auth"===s.type?new i(s.module,t,r,!0):new h(s.module,t,r)}r(6698)(h,s),h.prototype._update=function(e){var t,r;this._cache.add(e);for(var i=[];t=this._cache.get(this._autopadding);)r=this._mode.decrypt(this,t),i.push(r);return n.concat(i)},h.prototype._final=function(){var e=this._cache.flush();if(this._autopadding)return function(e){var t=e[15];if(t<1||t>16)throw new Error("unable to decrypt data");var r=-1;for(;++r<t;)if(e[r+(16-t)]!==t)throw new Error("unable to decrypt data");if(16===t)return;return e.slice(0,16-t)}(this._mode.decrypt(this,e));if(e)throw new Error("data not multiple of block length")},h.prototype.setAutoPadding=function(e){return this._autopadding=!!e,this},l.prototype.add=function(e){this.cache=n.concat([this.cache,e])},l.prototype.get=function(e){var t;if(e){if(this.cache.length>16)return t=this.cache.slice(0,16),this.cache=this.cache.slice(16),t}else if(this.cache.length>=16)return t=this.cache.slice(0,16),this.cache=this.cache.slice(16),t;return null},l.prototype.flush=function(){if(this.cache.length)return this.cache},t.createDecipher=function(e,t){var r=o[e.toLowerCase()];if(!r)throw new TypeError("invalid suite type");var i=c(t,!1,r.key,r.iv);return f(e,i.key,i.iv)},t.createDecipheriv=f},5799(e,t,r){var i=r(530),n=r(2356),o=r(2861).Buffer,a=r(650),s=r(6168),u=r(462),c=r(8078);function h(e,t,r){s.call(this),this._cache=new f,this._cipher=new u.AES(t),this._prev=o.from(r),this._mode=e,this._autopadding=!0}r(6698)(h,s),h.prototype._update=function(e){var t,r;this._cache.add(e);for(var i=[];t=this._cache.get();)r=this._mode.encrypt(this,t),i.push(r);return o.concat(i)};var l=o.alloc(16,16);function f(){this.cache=o.allocUnsafe(0)}function p(e,t,r){var s=i[e.toLowerCase()];if(!s)throw new TypeError("invalid suite type");if("string"==typeof t&&(t=o.from(t)),t.length!==s.key/8)throw new TypeError("invalid key length "+t.length);if("string"==typeof r&&(r=o.from(r)),"GCM"!==s.mode&&r.length!==s.iv)throw new TypeError("invalid iv length "+r.length);return"stream"===s.type?new a(s.module,t,r):"auth"===s.type?new n(s.module,t,r):new h(s.module,t,r)}h.prototype._final=function(){var e=this._cache.flush();if(this._autopadding)return e=this._mode.encrypt(this,e),this._cipher.scrub(),e;if(!e.equals(l))throw this._cipher.scrub(),new Error("data not multiple of block length")},h.prototype.setAutoPadding=function(e){return this._autopadding=!!e,this},f.prototype.add=function(e){this.cache=o.concat([this.cache,e])},f.prototype.get=function(){if(this.cache.length>15){var e=this.cache.slice(0,16);return this.cache=this.cache.slice(16),e}return null},f.prototype.flush=function(){for(var e=16-this.cache.length,t=o.allocUnsafe(e),r=-1;++r<e;)t.writeUInt8(e,r);return o.concat([this.cache,t])},t.createCipheriv=p,t.createCipher=function(e,t){var r=i[e.toLowerCase()];if(!r)throw new TypeError("invalid suite type");var n=c(t,!1,r.key,r.iv);return p(e,n.key,n.iv)}},5892(e,t,r){var i=r(2861).Buffer,n=i.alloc(16,0);function o(e){var t=i.allocUnsafe(16);return t.writeUInt32BE(e[0]>>>0,0),t.writeUInt32BE(e[1]>>>0,4),t.writeUInt32BE(e[2]>>>0,8),t.writeUInt32BE(e[3]>>>0,12),t}function a(e){this.h=e,this.state=i.alloc(16,0),this.cache=i.allocUnsafe(0)}a.prototype.ghash=function(e){for(var t=-1;++t<e.length;)this.state[t]^=e[t];this._multiply()},a.prototype._multiply=function(){for(var e,t,r,i=[(e=this.h).readUInt32BE(0),e.readUInt32BE(4),e.readUInt32BE(8),e.readUInt32BE(12)],n=[0,0,0,0],a=-1;++a<128;){for(!!(this.state[~~(a/8)]&1<<7-a%8)&&(n[0]^=i[0],n[1]^=i[1],n[2]^=i[2],n[3]^=i[3]),r=!!(1&i[3]),t=3;t>0;t--)i[t]=i[t]>>>1|(1&i[t-1])<<31;i[0]=i[0]>>>1,r&&(i[0]=i[0]^225<<24)}this.state=o(n)},a.prototype.update=function(e){var t;for(this.cache=i.concat([this.cache,e]);this.cache.length>=16;)t=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(t)},a.prototype.final=function(e,t){return this.cache.length&&this.ghash(i.concat([this.cache,n],16)),this.ghash(o([0,e,0,t])),this.state},e.exports=a},5122(e){e.exports=function(e){for(var t,r=e.length;r--;){if(255!==(t=e.readUInt8(r))){t++,e.writeUInt8(t,r);break}e.writeUInt8(0,r)}}},2884(e,t,r){var i=r(295);t.encrypt=function(e,t){var r=i(t,e._prev);return e._prev=e._cipher.encryptBlock(r),e._prev},t.decrypt=function(e,t){var r=e._prev;e._prev=t;var n=e._cipher.decryptBlock(t);return i(n,r)}},6383(e,t,r){var i=r(2861).Buffer,n=r(295);function o(e,t,r){var o=t.length,a=n(t,e._cache);return e._cache=e._cache.slice(o),e._prev=i.concat([e._prev,r?t:a]),a}t.encrypt=function(e,t,r){for(var n,a=i.allocUnsafe(0);t.length;){if(0===e._cache.length&&(e._cache=e._cipher.encryptBlock(e._prev),e._prev=i.allocUnsafe(0)),!(e._cache.length<=t.length)){a=i.concat([a,o(e,t,r)]);break}n=e._cache.length,a=i.concat([a,o(e,t.slice(0,n),r)]),t=t.slice(n)}return a}},5264(e,t,r){var i=r(2861).Buffer;function n(e,t,r){for(var i,n,a=-1,s=0;++a<8;)i=t&1<<7-a?128:0,s+=(128&(n=e._cipher.encryptBlock(e._prev)[0]^i))>>a%8,e._prev=o(e._prev,r?i:n);return s}function o(e,t){var r=e.length,n=-1,o=i.allocUnsafe(e.length);for(e=i.concat([e,i.from([t])]);++n<r;)o[n]=e[n]<<1|e[n+1]>>7;return o}t.encrypt=function(e,t,r){for(var o=t.length,a=i.allocUnsafe(o),s=-1;++s<o;)a[s]=n(e,t[s],r);return a}},6975(e,t,r){var i=r(2861).Buffer;function n(e,t,r){var n=e._cipher.encryptBlock(e._prev)[0]^t;return e._prev=i.concat([e._prev.slice(1),i.from([r?t:n])]),n}t.encrypt=function(e,t,r){for(var o=t.length,a=i.allocUnsafe(o),s=-1;++s<o;)a[s]=n(e,t[s],r);return a}},3053(e,t,r){var i=r(295),n=r(2861).Buffer,o=r(5122);function a(e){var t=e._cipher.encryptBlockRaw(e._prev);return o(e._prev),t}t.encrypt=function(e,t){var r=Math.ceil(t.length/16),o=e._cache.length;e._cache=n.concat([e._cache,n.allocUnsafe(16*r)]);for(var s=0;s<r;s++){var u=a(e),c=o+16*s;e._cache.writeUInt32BE(u[0],c+0),e._cache.writeUInt32BE(u[1],c+4),e._cache.writeUInt32BE(u[2],c+8),e._cache.writeUInt32BE(u[3],c+12)}var h=e._cache.slice(0,t.length);return e._cache=e._cache.slice(t.length),i(t,h)}},2632(e,t){t.encrypt=function(e,t){return e._cipher.encryptBlock(t)},t.decrypt=function(e,t){return e._cipher.decryptBlock(t)}},530(e,t,r){var i={ECB:r(2632),CBC:r(2884),CFB:r(6383),CFB8:r(6975),CFB1:r(5264),OFB:r(6843),CTR:r(3053),GCM:r(3053)},n=r(3219);for(var o in n)n[o].module=i[n[o].mode];e.exports=n},6843(e,t,r){var i=r(8287).Buffer,n=r(295);function o(e){return e._prev=e._cipher.encryptBlock(e._prev),e._prev}t.encrypt=function(e,t){for(;e._cache.length<t.length;)e._cache=i.concat([e._cache,o(e)]);var r=e._cache.slice(0,t.length);return e._cache=e._cache.slice(t.length),n(t,r)}},650(e,t,r){var i=r(462),n=r(2861).Buffer,o=r(6168);function a(e,t,r,a){o.call(this),this._cipher=new i.AES(t),this._prev=n.from(r),this._cache=n.allocUnsafe(0),this._secCache=n.allocUnsafe(0),this._decrypt=a,this._mode=e}r(6698)(a,o),a.prototype._update=function(e){return this._mode.encrypt(this,e,this._decrypt)},a.prototype._final=function(){this._cipher.scrub()},e.exports=a},125(e,t,r){var i=r(4050),n=r(1241),o=r(530),a=r(2438),s=r(8078);function u(e,t,r){if(e=e.toLowerCase(),o[e])return n.createCipheriv(e,t,r);if(a[e])return new i({key:t,iv:r,mode:e});throw new TypeError("invalid suite type")}function c(e,t,r){if(e=e.toLowerCase(),o[e])return n.createDecipheriv(e,t,r);if(a[e])return new i({key:t,iv:r,mode:e,decrypt:!0});throw new TypeError("invalid suite type")}t.createCipher=t.Cipher=function(e,t){var r,i;if(e=e.toLowerCase(),o[e])r=o[e].key,i=o[e].iv;else{if(!a[e])throw new TypeError("invalid suite type");r=8*a[e].key,i=a[e].iv}var n=s(t,!1,r,i);return u(e,n.key,n.iv)},t.createCipheriv=t.Cipheriv=u,t.createDecipher=t.Decipher=function(e,t){var r,i;if(e=e.toLowerCase(),o[e])r=o[e].key,i=o[e].iv;else{if(!a[e])throw new TypeError("invalid suite type");r=8*a[e].key,i=a[e].iv}var n=s(t,!1,r,i);return c(e,n.key,n.iv)},t.createDecipheriv=t.Decipheriv=c,t.listCiphers=t.getCiphers=function(){return Object.keys(a).concat(n.getCiphers())}},4050(e,t,r){var i=r(6168),n=r(9560),o=r(6698),a=r(2861).Buffer,s={"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 u(e){i.call(this);var t,r=e.mode.toLowerCase(),n=s[r];t=e.decrypt?"decrypt":"encrypt";var o=e.key;a.isBuffer(o)||(o=a.from(o)),"des-ede"!==r&&"des-ede-cbc"!==r||(o=a.concat([o,o.slice(0,8)]));var u=e.iv;a.isBuffer(u)||(u=a.from(u)),this._des=n.create({key:o,iv:u,type:t})}s.des=s["des-cbc"],s.des3=s["des-ede3-cbc"],e.exports=u,o(u,i),u.prototype._update=function(e){return a.from(this._des.update(e))},u.prototype._final=function(){return a.from(this._des.final())}},2438(e,t){t["des-ecb"]={key:8,iv:0},t["des-cbc"]=t.des={key:8,iv:8},t["des-ede3-cbc"]=t.des3={key:24,iv:8},t["des-ede3"]={key:24,iv:0},t["des-ede-cbc"]={key:16,iv:8},t["des-ede"]={key:16,iv:0}},7332(e,t,r){"use strict";var i=r(8893),n=r(3209),o=r(2861).Buffer;function a(e){var t,r=e.modulus.byteLength();do{t=new i(n(r))}while(t.cmp(e.modulus)>=0||!t.umod(e.prime1)||!t.umod(e.prime2));return t}function s(e,t){var r=function(e){var t=a(e);return{blinder:t.toRed(i.mont(e.modulus)).redPow(new i(e.publicExponent)).fromRed(),unblinder:t.invm(e.modulus)}}(t),n=t.modulus.byteLength(),s=new i(e).mul(r.blinder).umod(t.modulus),u=s.toRed(i.mont(t.prime1)),c=s.toRed(i.mont(t.prime2)),h=t.coefficient,l=t.prime1,f=t.prime2,p=u.redPow(t.exponent1).fromRed(),d=c.redPow(t.exponent2).fromRed(),g=p.isub(d).imul(h).umod(l).imul(f);return d.iadd(g).imul(r.unblinder).umod(t.modulus).toArrayLike(o,"be",n)}s.getr=a,e.exports=s},8893(e,t,r){!function(e,t){"use strict";function i(e,t){if(!e)throw new Error(t||"Assertion failed")}function n(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function o(e,t,r){if(o.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var a;"object"==typeof e?e.exports=o:t.BN=o,o.BN=o,o.wordSize=26;try{a="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r(8285).Buffer}catch(e){}function s(e,t){var r=e.charCodeAt(t);return r>=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:void i(!1,"Invalid character in "+e)}function u(e,t,r){var i=s(e,r);return r-1>=t&&(i|=s(e,r-1)<<4),i}function c(e,t,r,n){for(var o=0,a=0,s=Math.min(e.length,r),u=t;u<s;u++){var c=e.charCodeAt(u)-48;o*=n,a=c>=49?c-49+10:c>=17?c-17+10:c,i(c>=0&&a<n,"Invalid character"),o+=a}return o}function h(e,t){e.words=t.words,e.length=t.length,e.negative=t.negative,e.red=t.red}if(o.isBN=function(e){return e instanceof o||null!==e&&"object"==typeof e&&e.constructor.wordSize===o.wordSize&&Array.isArray(e.words)},o.max=function(e,t){return e.cmp(t)>0?e:t},o.min=function(e,t){return e.cmp(t)<0?e:t},o.prototype._init=function(e,t,r){if("number"==typeof e)return this._initNumber(e,t,r);if("object"==typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),i(t===(0|t)&&t>=2&&t<=36);var n=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(n++,this.negative=1),n<e.length&&(16===t?this._parseHex(e,n,r):(this._parseBase(e,t,n),"le"===r&&this._initArray(this.toArray(),t,r)))},o.prototype._initNumber=function(e,t,r){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(i(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),t,r)},o.prototype._initArray=function(e,t,r){if(i("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var o,a,s=0;if("be"===r)for(n=e.length-1,o=0;n>=0;n-=3)a=e[n]|e[n-1]<<8|e[n-2]<<16,this.words[o]|=a<<s&67108863,this.words[o+1]=a>>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);else if("le"===r)for(n=0,o=0;n<e.length;n+=3)a=e[n]|e[n+1]<<8|e[n+2]<<16,this.words[o]|=a<<s&67108863,this.words[o+1]=a>>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);return this._strip()},o.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var n,o=0,a=0;if("be"===r)for(i=e.length-1;i>=t;i-=2)n=u(e,t,i)<<o,this.words[a]|=67108863&n,o>=18?(o-=18,a+=1,this.words[a]|=n>>>26):o+=8;else for(i=(e.length-t)%2==0?t+1:t;i<e.length;i+=2)n=u(e,t,i)<<o,this.words[a]|=67108863&n,o>=18?(o-=18,a+=1,this.words[a]|=n>>>26):o+=8;this._strip()},o.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var i=0,n=1;n<=67108863;n*=t)i++;i--,n=n/t|0;for(var o=e.length-r,a=o%i,s=Math.min(o,o-a)+r,u=0,h=r;h<s;h+=i)u=c(e,h,h+i,t),this.imuln(n),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(0!==a){var l=1;for(u=c(e,h,e.length,t),h=0;h<a;h++)l*=t;this.imuln(l),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}this._strip()},o.prototype.copy=function(e){e.words=new Array(this.length);for(var t=0;t<this.length;t++)e.words[t]=this.words[t];e.length=this.length,e.negative=this.negative,e.red=this.red},o.prototype._move=function(e){h(e,this)},o.prototype.clone=function(){var e=new o(null);return this.copy(e),e},o.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},o.prototype._strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{o.prototype[Symbol.for("nodejs.util.inspect.custom")]=l}catch(e){o.prototype.inspect=l}else o.prototype.inspect=l;function l(){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"],p=[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(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var n=0,o=0,a=0;a<this.length;a++){var s=this.words[a],u=(16777215&(s<<n|o)).toString(16);o=s>>>24-n&16777215,(n+=2)>=26&&(n-=26,a--),r=0!==o||a!==this.length-1?f[6-u.length]+u+r:u+r}for(0!==o&&(r=o.toString(16)+r);r.length%t!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var c=p[e],h=d[e];r="";var l=this.clone();for(l.negative=0;!l.isZero();){var g=l.modrn(h).toString(e);r=(l=l.idivn(h)).isZero()?g+r:f[c-g.length]+g+r}for(this.isZero()&&(r="0"+r);r.length%t!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}i(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},o.prototype.toJSON=function(){return this.toString(16,2)},a&&(o.prototype.toBuffer=function(e,t){return this.toArrayLike(a,e,t)}),o.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)};function g(e,t,r){r.negative=t.negative^e.negative;var i=e.length+t.length|0;r.length=i,i=i-1|0;var n=0|e.words[0],o=0|t.words[0],a=n*o,s=67108863&a,u=a/67108864|0;r.words[0]=s;for(var c=1;c<i;c++){for(var h=u>>>26,l=67108863&u,f=Math.min(c,t.length-1),p=Math.max(0,c-e.length+1);p<=f;p++){var d=c-p|0;h+=(a=(n=0|e.words[d])*(o=0|t.words[p])+l)/67108864|0,l=67108863&a}r.words[c]=0|l,u=0|h}return 0!==u?r.words[c]=0|u:r.length--,r._strip()}o.prototype.toArrayLike=function(e,t,r){this._strip();var n=this.byteLength(),o=r||Math.max(1,n);i(n<=o,"byte array longer than desired length"),i(o>0,"Requested array length <= 0");var a=function(e,t){return e.allocUnsafe?e.allocUnsafe(t):new e(t)}(e,o);return this["_toArrayLike"+("le"===t?"LE":"BE")](a,n),a},o.prototype._toArrayLikeLE=function(e,t){for(var r=0,i=0,n=0,o=0;n<this.length;n++){var a=this.words[n]<<o|i;e[r++]=255&a,r<e.length&&(e[r++]=a>>8&255),r<e.length&&(e[r++]=a>>16&255),6===o?(r<e.length&&(e[r++]=a>>24&255),i=0,o=0):(i=a>>>24,o+=2)}if(r<e.length)for(e[r++]=i;r<e.length;)e[r++]=0},o.prototype._toArrayLikeBE=function(e,t){for(var r=e.length-1,i=0,n=0,o=0;n<this.length;n++){var a=this.words[n]<<o|i;e[r--]=255&a,r>=0&&(e[r--]=a>>8&255),r>=0&&(e[r--]=a>>16&255),6===o?(r>=0&&(e[r--]=a>>24&255),i=0,o=0):(i=a>>>24,o+=2)}if(r>=0)for(e[r--]=i;r>=0;)e[r--]=0},Math.clz32?o.prototype._countBits=function(e){return 32-Math.clz32(e)}:o.prototype._countBits=function(e){var t=e,r=0;return t>=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},o.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 8191&t||(r+=13,t>>>=13),127&t||(r+=7,t>>>=7),15&t||(r+=4,t>>>=4),3&t||(r+=2,t>>>=2),1&t||r++,r},o.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;t<this.length;t++){var r=this._zeroBits(this.words[t]);if(e+=r,26!==r)break}return e},o.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},o.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},o.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},o.prototype.isNeg=function(){return 0!==this.negative},o.prototype.neg=function(){return this.clone().ineg()},o.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},o.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var t=0;t<e.length;t++)this.words[t]=this.words[t]|e.words[t];return this._strip()},o.prototype.ior=function(e){return i(0===(this.negative|e.negative)),this.iuor(e)},o.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},o.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},o.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;r<t.length;r++)this.words[r]=this.words[r]&e.words[r];return this.length=t.length,this._strip()},o.prototype.iand=function(e){return i(0===(this.negative|e.negative)),this.iuand(e)},o.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},o.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},o.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var i=0;i<r.length;i++)this.words[i]=t.words[i]^r.words[i];if(this!==t)for(;i<t.length;i++)this.words[i]=t.words[i];return this.length=t.length,this._strip()},o.prototype.ixor=function(e){return i(0===(this.negative|e.negative)),this.iuxor(e)},o.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},o.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},o.prototype.inotn=function(e){i("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var n=0;n<t;n++)this.words[n]=67108863&~this.words[n];return r>0&&(this.words[n]=~this.words[n]&67108863>>26-r),this._strip()},o.prototype.notn=function(e){return this.clone().inotn(e)},o.prototype.setn=function(e,t){i("number"==typeof e&&e>=0);var r=e/26|0,n=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<<n:this.words[r]&~(1<<n),this._strip()},o.prototype.iadd=function(e){var t,r,i;if(0!==this.negative&&0===e.negative)return this.negative=0,t=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,t=this.isub(e),e.negative=1,t._normSign();this.length>e.length?(r=this,i=e):(r=e,i=this);for(var n=0,o=0;o<i.length;o++)t=(0|r.words[o])+(0|i.words[o])+n,this.words[o]=67108863&t,n=t>>>26;for(;0!==n&&o<r.length;o++)t=(0|r.words[o])+n,this.words[o]=67108863&t,n=t>>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this},o.prototype.add=function(e){var t;return 0!==e.negative&&0===this.negative?(e.negative=0,t=this.sub(e),e.negative^=1,t):0===e.negative&&0!==this.negative?(this.negative=0,t=e.sub(this),this.negative=1,t):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},o.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,i,n=this.cmp(e);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(r=this,i=e):(r=e,i=this);for(var o=0,a=0;a<i.length;a++)o=(t=(0|r.words[a])-(0|i.words[a])+o)>>26,this.words[a]=67108863&t;for(;0!==o&&a<r.length;a++)o=(t=(0|r.words[a])+o)>>26,this.words[a]=67108863&t;if(0===o&&a<r.length&&r!==this)for(;a<r.length;a++)this.words[a]=r.words[a];return this.length=Math.max(this.length,a),r!==this&&(this.negative=1),this._strip()},o.prototype.sub=function(e){return this.clone().isub(e)};var m=function(e,t,r){var i,n,o,a=e.words,s=t.words,u=r.words,c=0,h=0|a[0],l=8191&h,f=h>>>13,p=0|a[1],d=8191&p,g=p>>>13,m=0|a[2],y=8191&m,v=m>>>13,b=0|a[3],_=8191&b,w=b>>>13,S=0|a[4],E=8191&S,k=S>>>13,O=0|a[5],I=8191&O,A=O>>>13,x=0|a[6],P=8191&x,T=x>>>13,R=0|a[7],M=8191&R,B=R>>>13,C=0|a[8],N=8191&C,D=C>>>13,L=0|a[9],j=8191&L,U=L>>>13,H=0|s[0],F=8191&H,z=H>>>13,K=0|s[1],V=8191&K,q=K>>>13,G=0|s[2],Z=8191&G,Y=G>>>13,W=0|s[3],X=8191&W,$=W>>>13,J=0|s[4],Q=8191&J,ee=J>>>13,te=0|s[5],re=8191&te,ie=te>>>13,ne=0|s[6],oe=8191&ne,ae=ne>>>13,se=0|s[7],ue=8191&se,ce=se>>>13,he=0|s[8],le=8191&he,fe=he>>>13,pe=0|s[9],de=8191&pe,ge=pe>>>13;r.negative=e.negative^t.negative,r.length=19;var me=(c+(i=Math.imul(l,F))|0)+((8191&(n=(n=Math.imul(l,z))+Math.imul(f,F)|0))<<13)|0;c=((o=Math.imul(f,z))+(n>>>13)|0)+(me>>>26)|0,me&=67108863,i=Math.imul(d,F),n=(n=Math.imul(d,z))+Math.imul(g,F)|0,o=Math.imul(g,z);var ye=(c+(i=i+Math.imul(l,V)|0)|0)+((8191&(n=(n=n+Math.imul(l,q)|0)+Math.imul(f,V)|0))<<13)|0;c=((o=o+Math.imul(f,q)|0)+(n>>>13)|0)+(ye>>>26)|0,ye&=67108863,i=Math.imul(y,F),n=(n=Math.imul(y,z))+Math.imul(v,F)|0,o=Math.imul(v,z),i=i+Math.imul(d,V)|0,n=(n=n+Math.imul(d,q)|0)+Math.imul(g,V)|0,o=o+Math.imul(g,q)|0;var ve=(c+(i=i+Math.imul(l,Z)|0)|0)+((8191&(n=(n=n+Math.imul(l,Y)|0)+Math.imul(f,Z)|0))<<13)|0;c=((o=o+Math.imul(f,Y)|0)+(n>>>13)|0)+(ve>>>26)|0,ve&=67108863,i=Math.imul(_,F),n=(n=Math.imul(_,z))+Math.imul(w,F)|0,o=Math.imul(w,z),i=i+Math.imul(y,V)|0,n=(n=n+Math.imul(y,q)|0)+Math.imul(v,V)|0,o=o+Math.imul(v,q)|0,i=i+Math.imul(d,Z)|0,n=(n=n+Math.imul(d,Y)|0)+Math.imul(g,Z)|0,o=o+Math.imul(g,Y)|0;var be=(c+(i=i+Math.imul(l,X)|0)|0)+((8191&(n=(n=n+Math.imul(l,$)|0)+Math.imul(f,X)|0))<<13)|0;c=((o=o+Math.imul(f,$)|0)+(n>>>13)|0)+(be>>>26)|0,be&=67108863,i=Math.imul(E,F),n=(n=Math.imul(E,z))+Math.imul(k,F)|0,o=Math.imul(k,z),i=i+Math.imul(_,V)|0,n=(n=n+Math.imul(_,q)|0)+Math.imul(w,V)|0,o=o+Math.imul(w,q)|0,i=i+Math.imul(y,Z)|0,n=(n=n+Math.imul(y,Y)|0)+Math.imul(v,Z)|0,o=o+Math.imul(v,Y)|0,i=i+Math.imul(d,X)|0,n=(n=n+Math.imul(d,$)|0)+Math.imul(g,X)|0,o=o+Math.imul(g,$)|0;var _e=(c+(i=i+Math.imul(l,Q)|0)|0)+((8191&(n=(n=n+Math.imul(l,ee)|0)+Math.imul(f,Q)|0))<<13)|0;c=((o=o+Math.imul(f,ee)|0)+(n>>>13)|0)+(_e>>>26)|0,_e&=67108863,i=Math.imul(I,F),n=(n=Math.imul(I,z))+Math.imul(A,F)|0,o=Math.imul(A,z),i=i+Math.imul(E,V)|0,n=(n=n+Math.imul(E,q)|0)+Math.imul(k,V)|0,o=o+Math.imul(k,q)|0,i=i+Math.imul(_,Z)|0,n=(n=n+Math.imul(_,Y)|0)+Math.imul(w,Z)|0,o=o+Math.imul(w,Y)|0,i=i+Math.imul(y,X)|0,n=(n=n+Math.imul(y,$)|0)+Math.imul(v,X)|0,o=o+Math.imul(v,$)|0,i=i+Math.imul(d,Q)|0,n=(n=n+Math.imul(d,ee)|0)+Math.imul(g,Q)|0,o=o+Math.imul(g,ee)|0;var we=(c+(i=i+Math.imul(l,re)|0)|0)+((8191&(n=(n=n+Math.imul(l,ie)|0)+Math.imul(f,re)|0))<<13)|0;c=((o=o+Math.imul(f,ie)|0)+(n>>>13)|0)+(we>>>26)|0,we&=67108863,i=Math.imul(P,F),n=(n=Math.imul(P,z))+Math.imul(T,F)|0,o=Math.imul(T,z),i=i+Math.imul(I,V)|0,n=(n=n+Math.imul(I,q)|0)+Math.imul(A,V)|0,o=o+Math.imul(A,q)|0,i=i+Math.imul(E,Z)|0,n=(n=n+Math.imul(E,Y)|0)+Math.imul(k,Z)|0,o=o+Math.imul(k,Y)|0,i=i+Math.imul(_,X)|0,n=(n=n+Math.imul(_,$)|0)+Math.imul(w,X)|0,o=o+Math.imul(w,$)|0,i=i+Math.imul(y,Q)|0,n=(n=n+Math.imul(y,ee)|0)+Math.imul(v,Q)|0,o=o+Math.imul(v,ee)|0,i=i+Math.imul(d,re)|0,n=(n=n+Math.imul(d,ie)|0)+Math.imul(g,re)|0,o=o+Math.imul(g,ie)|0;var Se=(c+(i=i+Math.imul(l,oe)|0)|0)+((8191&(n=(n=n+Math.imul(l,ae)|0)+Math.imul(f,oe)|0))<<13)|0;c=((o=o+Math.imul(f,ae)|0)+(n>>>13)|0)+(Se>>>26)|0,Se&=67108863,i=Math.imul(M,F),n=(n=Math.imul(M,z))+Math.imul(B,F)|0,o=Math.imul(B,z),i=i+Math.imul(P,V)|0,n=(n=n+Math.imul(P,q)|0)+Math.imul(T,V)|0,o=o+Math.imul(T,q)|0,i=i+Math.imul(I,Z)|0,n=(n=n+Math.imul(I,Y)|0)+Math.imul(A,Z)|0,o=o+Math.imul(A,Y)|0,i=i+Math.imul(E,X)|0,n=(n=n+Math.imul(E,$)|0)+Math.imul(k,X)|0,o=o+Math.imul(k,$)|0,i=i+Math.imul(_,Q)|0,n=(n=n+Math.imul(_,ee)|0)+Math.imul(w,Q)|0,o=o+Math.imul(w,ee)|0,i=i+Math.imul(y,re)|0,n=(n=n+Math.imul(y,ie)|0)+Math.imul(v,re)|0,o=o+Math.imul(v,ie)|0,i=i+Math.imul(d,oe)|0,n=(n=n+Math.imul(d,ae)|0)+Math.imul(g,oe)|0,o=o+Math.imul(g,ae)|0;var Ee=(c+(i=i+Math.imul(l,ue)|0)|0)+((8191&(n=(n=n+Math.imul(l,ce)|0)+Math.imul(f,ue)|0))<<13)|0;c=((o=o+Math.imul(f,ce)|0)+(n>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,i=Math.imul(N,F),n=(n=Math.imul(N,z))+Math.imul(D,F)|0,o=Math.imul(D,z),i=i+Math.imul(M,V)|0,n=(n=n+Math.imul(M,q)|0)+Math.imul(B,V)|0,o=o+Math.imul(B,q)|0,i=i+Math.imul(P,Z)|0,n=(n=n+Math.imul(P,Y)|0)+Math.imul(T,Z)|0,o=o+Math.imul(T,Y)|0,i=i+Math.imul(I,X)|0,n=(n=n+Math.imul(I,$)|0)+Math.imul(A,X)|0,o=o+Math.imul(A,$)|0,i=i+Math.imul(E,Q)|0,n=(n=n+Math.imul(E,ee)|0)+Math.imul(k,Q)|0,o=o+Math.imul(k,ee)|0,i=i+Math.imul(_,re)|0,n=(n=n+Math.imul(_,ie)|0)+Math.imul(w,re)|0,o=o+Math.imul(w,ie)|0,i=i+Math.imul(y,oe)|0,n=(n=n+Math.imul(y,ae)|0)+Math.imul(v,oe)|0,o=o+Math.imul(v,ae)|0,i=i+Math.imul(d,ue)|0,n=(n=n+Math.imul(d,ce)|0)+Math.imul(g,ue)|0,o=o+Math.imul(g,ce)|0;var ke=(c+(i=i+Math.imul(l,le)|0)|0)+((8191&(n=(n=n+Math.imul(l,fe)|0)+Math.imul(f,le)|0))<<13)|0;c=((o=o+Math.imul(f,fe)|0)+(n>>>13)|0)+(ke>>>26)|0,ke&=67108863,i=Math.imul(j,F),n=(n=Math.imul(j,z))+Math.imul(U,F)|0,o=Math.imul(U,z),i=i+Math.imul(N,V)|0,n=(n=n+Math.imul(N,q)|0)+Math.imul(D,V)|0,o=o+Math.imul(D,q)|0,i=i+Math.imul(M,Z)|0,n=(n=n+Math.imul(M,Y)|0)+Math.imul(B,Z)|0,o=o+Math.imul(B,Y)|0,i=i+Math.imul(P,X)|0,n=(n=n+Math.imul(P,$)|0)+Math.imul(T,X)|0,o=o+Math.imul(T,$)|0,i=i+Math.imul(I,Q)|0,n=(n=n+Math.imul(I,ee)|0)+Math.imul(A,Q)|0,o=o+Math.imul(A,ee)|0,i=i+Math.imul(E,re)|0,n=(n=n+Math.imul(E,ie)|0)+Math.imul(k,re)|0,o=o+Math.imul(k,ie)|0,i=i+Math.imul(_,oe)|0,n=(n=n+Math.imul(_,ae)|0)+Math.imul(w,oe)|0,o=o+Math.imul(w,ae)|0,i=i+Math.imul(y,ue)|0,n=(n=n+Math.imul(y,ce)|0)+Math.imul(v,ue)|0,o=o+Math.imul(v,ce)|0,i=i+Math.imul(d,le)|0,n=(n=n+Math.imul(d,fe)|0)+Math.imul(g,le)|0,o=o+Math.imul(g,fe)|0;var Oe=(c+(i=i+Math.imul(l,de)|0)|0)+((8191&(n=(n=n+Math.imul(l,ge)|0)+Math.imul(f,de)|0))<<13)|0;c=((o=o+Math.imul(f,ge)|0)+(n>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,i=Math.imul(j,V),n=(n=Math.imul(j,q))+Math.imul(U,V)|0,o=Math.imul(U,q),i=i+Math.imul(N,Z)|0,n=(n=n+Math.imul(N,Y)|0)+Math.imul(D,Z)|0,o=o+Math.imul(D,Y)|0,i=i+Math.imul(M,X)|0,n=(n=n+Math.imul(M,$)|0)+Math.imul(B,X)|0,o=o+Math.imul(B,$)|0,i=i+Math.imul(P,Q)|0,n=(n=n+Math.imul(P,ee)|0)+Math.imul(T,Q)|0,o=o+Math.imul(T,ee)|0,i=i+Math.imul(I,re)|0,n=(n=n+Math.imul(I,ie)|0)+Math.imul(A,re)|0,o=o+Math.imul(A,ie)|0,i=i+Math.imul(E,oe)|0,n=(n=n+Math.imul(E,ae)|0)+Math.imul(k,oe)|0,o=o+Math.imul(k,ae)|0,i=i+Math.imul(_,ue)|0,n=(n=n+Math.imul(_,ce)|0)+Math.imul(w,ue)|0,o=o+Math.imul(w,ce)|0,i=i+Math.imul(y,le)|0,n=(n=n+Math.imul(y,fe)|0)+Math.imul(v,le)|0,o=o+Math.imul(v,fe)|0;var Ie=(c+(i=i+Math.imul(d,de)|0)|0)+((8191&(n=(n=n+Math.imul(d,ge)|0)+Math.imul(g,de)|0))<<13)|0;c=((o=o+Math.imul(g,ge)|0)+(n>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,i=Math.imul(j,Z),n=(n=Math.imul(j,Y))+Math.imul(U,Z)|0,o=Math.imul(U,Y),i=i+Math.imul(N,X)|0,n=(n=n+Math.imul(N,$)|0)+Math.imul(D,X)|0,o=o+Math.imul(D,$)|0,i=i+Math.imul(M,Q)|0,n=(n=n+Math.imul(M,ee)|0)+Math.imul(B,Q)|0,o=o+Math.imul(B,ee)|0,i=i+Math.imul(P,re)|0,n=(n=n+Math.imul(P,ie)|0)+Math.imul(T,re)|0,o=o+Math.imul(T,ie)|0,i=i+Math.imul(I,oe)|0,n=(n=n+Math.imul(I,ae)|0)+Math.imul(A,oe)|0,o=o+Math.imul(A,ae)|0,i=i+Math.imul(E,ue)|0,n=(n=n+Math.imul(E,ce)|0)+Math.imul(k,ue)|0,o=o+Math.imul(k,ce)|0,i=i+Math.imul(_,le)|0,n=(n=n+Math.imul(_,fe)|0)+Math.imul(w,le)|0,o=o+Math.imul(w,fe)|0;var Ae=(c+(i=i+Math.imul(y,de)|0)|0)+((8191&(n=(n=n+Math.imul(y,ge)|0)+Math.imul(v,de)|0))<<13)|0;c=((o=o+Math.imul(v,ge)|0)+(n>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,i=Math.imul(j,X),n=(n=Math.imul(j,$))+Math.imul(U,X)|0,o=Math.imul(U,$),i=i+Math.imul(N,Q)|0,n=(n=n+Math.imul(N,ee)|0)+Math.imul(D,Q)|0,o=o+Math.imul(D,ee)|0,i=i+Math.imul(M,re)|0,n=(n=n+Math.imul(M,ie)|0)+Math.imul(B,re)|0,o=o+Math.imul(B,ie)|0,i=i+Math.imul(P,oe)|0,n=(n=n+Math.imul(P,ae)|0)+Math.imul(T,oe)|0,o=o+Math.imul(T,ae)|0,i=i+Math.imul(I,ue)|0,n=(n=n+Math.imul(I,ce)|0)+Math.imul(A,ue)|0,o=o+Math.imul(A,ce)|0,i=i+Math.imul(E,le)|0,n=(n=n+Math.imul(E,fe)|0)+Math.imul(k,le)|0,o=o+Math.imul(k,fe)|0;var xe=(c+(i=i+Math.imul(_,de)|0)|0)+((8191&(n=(n=n+Math.imul(_,ge)|0)+Math.imul(w,de)|0))<<13)|0;c=((o=o+Math.imul(w,ge)|0)+(n>>>13)|0)+(xe>>>26)|0,xe&=67108863,i=Math.imul(j,Q),n=(n=Math.imul(j,ee))+Math.imul(U,Q)|0,o=Math.imul(U,ee),i=i+Math.imul(N,re)|0,n=(n=n+Math.imul(N,ie)|0)+Math.imul(D,re)|0,o=o+Math.imul(D,ie)|0,i=i+Math.imul(M,oe)|0,n=(n=n+Math.imul(M,ae)|0)+Math.imul(B,oe)|0,o=o+Math.imul(B,ae)|0,i=i+Math.imul(P,ue)|0,n=(n=n+Math.imul(P,ce)|0)+Math.imul(T,ue)|0,o=o+Math.imul(T,ce)|0,i=i+Math.imul(I,le)|0,n=(n=n+Math.imul(I,fe)|0)+Math.imul(A,le)|0,o=o+Math.imul(A,fe)|0;var Pe=(c+(i=i+Math.imul(E,de)|0)|0)+((8191&(n=(n=n+Math.imul(E,ge)|0)+Math.imul(k,de)|0))<<13)|0;c=((o=o+Math.imul(k,ge)|0)+(n>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,i=Math.imul(j,re),n=(n=Math.imul(j,ie))+Math.imul(U,re)|0,o=Math.imul(U,ie),i=i+Math.imul(N,oe)|0,n=(n=n+Math.imul(N,ae)|0)+Math.imul(D,oe)|0,o=o+Math.imul(D,ae)|0,i=i+Math.imul(M,ue)|0,n=(n=n+Math.imul(M,ce)|0)+Math.imul(B,ue)|0,o=o+Math.imul(B,ce)|0,i=i+Math.imul(P,le)|0,n=(n=n+Math.imul(P,fe)|0)+Math.imul(T,le)|0,o=o+Math.imul(T,fe)|0;var Te=(c+(i=i+Math.imul(I,de)|0)|0)+((8191&(n=(n=n+Math.imul(I,ge)|0)+Math.imul(A,de)|0))<<13)|0;c=((o=o+Math.imul(A,ge)|0)+(n>>>13)|0)+(Te>>>26)|0,Te&=67108863,i=Math.imul(j,oe),n=(n=Math.imul(j,ae))+Math.imul(U,oe)|0,o=Math.imul(U,ae),i=i+Math.imul(N,ue)|0,n=(n=n+Math.imul(N,ce)|0)+Math.imul(D,ue)|0,o=o+Math.imul(D,ce)|0,i=i+Math.imul(M,le)|0,n=(n=n+Math.imul(M,fe)|0)+Math.imul(B,le)|0,o=o+Math.imul(B,fe)|0;var Re=(c+(i=i+Math.imul(P,de)|0)|0)+((8191&(n=(n=n+Math.imul(P,ge)|0)+Math.imul(T,de)|0))<<13)|0;c=((o=o+Math.imul(T,ge)|0)+(n>>>13)|0)+(Re>>>26)|0,Re&=67108863,i=Math.imul(j,ue),n=(n=Math.imul(j,ce))+Math.imul(U,ue)|0,o=Math.imul(U,ce),i=i+Math.imul(N,le)|0,n=(n=n+Math.imul(N,fe)|0)+Math.imul(D,le)|0,o=o+Math.imul(D,fe)|0;var Me=(c+(i=i+Math.imul(M,de)|0)|0)+((8191&(n=(n=n+Math.imul(M,ge)|0)+Math.imul(B,de)|0))<<13)|0;c=((o=o+Math.imul(B,ge)|0)+(n>>>13)|0)+(Me>>>26)|0,Me&=67108863,i=Math.imul(j,le),n=(n=Math.imul(j,fe))+Math.imul(U,le)|0,o=Math.imul(U,fe);var Be=(c+(i=i+Math.imul(N,de)|0)|0)+((8191&(n=(n=n+Math.imul(N,ge)|0)+Math.imul(D,de)|0))<<13)|0;c=((o=o+Math.imul(D,ge)|0)+(n>>>13)|0)+(Be>>>26)|0,Be&=67108863;var Ce=(c+(i=Math.imul(j,de))|0)+((8191&(n=(n=Math.imul(j,ge))+Math.imul(U,de)|0))<<13)|0;return c=((o=Math.imul(U,ge))+(n>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,u[0]=me,u[1]=ye,u[2]=ve,u[3]=be,u[4]=_e,u[5]=we,u[6]=Se,u[7]=Ee,u[8]=ke,u[9]=Oe,u[10]=Ie,u[11]=Ae,u[12]=xe,u[13]=Pe,u[14]=Te,u[15]=Re,u[16]=Me,u[17]=Be,u[18]=Ce,0!==c&&(u[19]=c,r.length++),r};function y(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var i=0,n=0,o=0;o<r.length-1;o++){var a=n;n=0;for(var s=67108863&i,u=Math.min(o,t.length-1),c=Math.max(0,o-e.length+1);c<=u;c++){var h=o-c,l=(0|e.words[h])*(0|t.words[c]),f=67108863&l;s=67108863&(f=f+s|0),n+=(a=(a=a+(l/67108864|0)|0)+(f>>>26)|0)>>>26,a&=67108863}r.words[o]=s,i=a,a=n}return 0!==i?r.words[o]=i:r.length--,r._strip()}function v(e,t,r){return y(e,t,r)}function b(e,t){this.x=e,this.y=t}Math.imul||(m=g),o.prototype.mulTo=function(e,t){var r=this.length+e.length;return 10===this.length&&10===e.length?m(this,e,t):r<63?g(this,e,t):r<1024?y(this,e,t):v(this,e,t)},b.prototype.makeRBT=function(e){for(var t=new Array(e),r=o.prototype._countBits(e)-1,i=0;i<e;i++)t[i]=this.revBin(i,r,e);return t},b.prototype.revBin=function(e,t,r){if(0===e||e===r-1)return e;for(var i=0,n=0;n<t;n++)i|=(1&e)<<t-n-1,e>>=1;return i},b.prototype.permute=function(e,t,r,i,n,o){for(var a=0;a<o;a++)i[a]=t[e[a]],n[a]=r[e[a]]},b.prototype.transform=function(e,t,r,i,n,o){this.permute(o,e,t,r,i,n);for(var a=1;a<n;a<<=1)for(var s=a<<1,u=Math.cos(2*Math.PI/s),c=Math.sin(2*Math.PI/s),h=0;h<n;h+=s)for(var l=u,f=c,p=0;p<a;p++){var d=r[h+p],g=i[h+p],m=r[h+p+a],y=i[h+p+a],v=l*m-f*y;y=l*y+f*m,m=v,r[h+p]=d+m,i[h+p]=g+y,r[h+p+a]=d-m,i[h+p+a]=g-y,p!==s&&(v=u*l-c*f,f=u*f+c*l,l=v)}},b.prototype.guessLen13b=function(e,t){var r=1|Math.max(t,e),i=1&r,n=0;for(r=r/2|0;r;r>>>=1)n++;return 1<<n+1+i},b.prototype.conjugate=function(e,t,r){if(!(r<=1))for(var i=0;i<r/2;i++){var n=e[i];e[i]=e[r-i-1],e[r-i-1]=n,n=t[i],t[i]=-t[r-i-1],t[r-i-1]=-n}},b.prototype.normalize13b=function(e,t){for(var r=0,i=0;i<t/2;i++){var n=8192*Math.round(e[2*i+1]/t)+Math.round(e[2*i]/t)+r;e[i]=67108863&n,r=n<67108864?0:n/67108864|0}return e},b.prototype.convert13b=function(e,t,r,n){for(var o=0,a=0;a<t;a++)o+=0|e[a],r[2*a]=8191&o,o>>>=13,r[2*a+1]=8191&o,o>>>=13;for(a=2*t;a<n;++a)r[a]=0;i(0===o),i(!(-8192&o))},b.prototype.stub=function(e){for(var t=new Array(e),r=0;r<e;r++)t[r]=0;return t},b.prototype.mulp=function(e,t,r){var i=2*this.guessLen13b(e.length,t.length),n=this.makeRBT(i),o=this.stub(i),a=new Array(i),s=new Array(i),u=new Array(i),c=new Array(i),h=new Array(i),l=new Array(i),f=r.words;f.length=i,this.convert13b(e.words,e.length,a,i),this.convert13b(t.words,t.length,c,i),this.transform(a,o,s,u,i,n),this.transform(c,o,h,l,i,n);for(var p=0;p<i;p++){var d=s[p]*h[p]-u[p]*l[p];u[p]=s[p]*l[p]+u[p]*h[p],s[p]=d}return this.conjugate(s,u,i),this.transform(s,u,f,o,i,n),this.conjugate(f,o,i),this.normalize13b(f,i),r.negative=e.negative^t.negative,r.length=e.length+t.length,r._strip()},o.prototype.mul=function(e){var t=new o(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},o.prototype.mulf=function(e){var t=new o(null);return t.words=new Array(this.length+e.length),v(this,e,t)},o.prototype.imul=function(e){return this.clone().mulTo(e,this)},o.prototype.imuln=function(e){var t=e<0;t&&(e=-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,a=(67108863&o)+(67108863&r);r>>=26,r+=o/67108864|0,r+=a>>>26,this.words[n]=67108863&a}return 0!==r&&(this.words[n]=r,this.length++),this.length=0===e?1:this.length,t?this.ineg():this},o.prototype.muln=function(e){return this.clone().imuln(e)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r<t.length;r++){var i=r/26|0,n=r%26;t[r]=e.words[i]>>>n&1}return t}(e);if(0===t.length)return new o(1);for(var r=this,i=0;i<t.length&&0===t[i];i++,r=r.sqr());if(++i<t.length)for(var n=r.sqr();i<t.length;i++,n=n.sqr())0!==t[i]&&(r=r.mul(n));return r},o.prototype.iushln=function(e){i("number"==typeof e&&e>=0);var t,r=e%26,n=(e-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var a=0;for(t=0;t<this.length;t++){var s=this.words[t]&o,u=(0|this.words[t])-s<<r;this.words[t]=u|a,a=s>>>26-r}a&&(this.words[t]=a,this.length++)}if(0!==n){for(t=this.length-1;t>=0;t--)this.words[t+n]=this.words[t];for(t=0;t<n;t++)this.words[t]=0;this.length+=n}return this._strip()},o.prototype.ishln=function(e){return i(0===this.negative),this.iushln(e)},o.prototype.iushrn=function(e,t,r){var n;i("number"==typeof e&&e>=0),n=t?(t-t%26)/26:0;var o=e%26,a=Math.min((e-o)/26,this.length),s=67108863^67108863>>>o<<o,u=r;if(n-=a,n=Math.max(0,n),u){for(var c=0;c<a;c++)u.words[c]=this.words[c];u.length=a}if(0===a);else if(this.length>a)for(this.length-=a,c=0;c<this.length;c++)this.words[c]=this.words[c+a];else this.words[0]=0,this.length=1;var h=0;for(c=this.length-1;c>=0&&(0!==h||c>=n);c--){var l=0|this.words[c];this.words[c]=h<<26-o|l>>>o,h=l&s}return u&&0!==h&&(u.words[u.length++]=h),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},o.prototype.ishrn=function(e,t,r){return i(0===this.negative),this.iushrn(e,t,r)},o.prototype.shln=function(e){return this.clone().ishln(e)},o.prototype.ushln=function(e){return this.clone().iushln(e)},o.prototype.shrn=function(e){return this.clone().ishrn(e)},o.prototype.ushrn=function(e){return this.clone().iushrn(e)},o.prototype.testn=function(e){i("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26,n=1<<t;return!(this.length<=r)&&!!(this.words[r]&n)},o.prototype.imaskn=function(e){i("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26;if(i(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var n=67108863^67108863>>>t<<t;this.words[this.length-1]&=n}return 0===this.length&&(this.words[0]=0,this.length=1),this._strip()},o.prototype.maskn=function(e){return this.clone().imaskn(e)},o.prototype.iaddn=function(e){return i("number"==typeof e),i(e<67108864),e<0?this.isubn(-e):0!==this.negative?1===this.length&&(0|this.words[0])<=e?(this.words[0]=e-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(e),this.negative=1,this):this._iaddn(e)},o.prototype._iaddn=function(e){this.words[0]+=e;for(var t=0;t<this.length&&this.words[t]>=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},o.prototype.isubn=function(e){if(i("number"==typeof e),i(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t<this.length&&this.words[t]<0;t++)this.words[t]+=67108864,this.words[t+1]-=1;return this._strip()},o.prototype.addn=function(e){return this.clone().iaddn(e)},o.prototype.subn=function(e){return this.clone().isubn(e)},o.prototype.iabs=function(){return this.negative=0,this},o.prototype.abs=function(){return this.clone().iabs()},o.prototype._ishlnsubmul=function(e,t,r){var n,o,a=e.length+r;this._expand(a);var s=0;for(n=0;n<e.length;n++){o=(0|this.words[n+r])+s;var u=(0|e.words[n])*t;s=((o-=67108863&u)>>26)-(u/67108864|0),this.words[n+r]=67108863&o}for(;n<this.length-r;n++)s=(o=(0|this.words[n+r])+s)>>26,this.words[n+r]=67108863&o;if(0===s)return this._strip();for(i(-1===s),s=0,n=0;n<this.length;n++)s=(o=-(0|this.words[n])+s)>>26,this.words[n]=67108863&o;return this.negative=1,this._strip()},o.prototype._wordDiv=function(e,t){var r=(this.length,e.length),i=this.clone(),n=e,a=0|n.words[n.length-1];0!==(r=26-this._countBits(a))&&(n=n.ushln(r),i.iushln(r),a=0|n.words[n.length-1]);var s,u=i.length-n.length;if("mod"!==t){(s=new o(null)).length=u+1,s.words=new Array(s.length);for(var c=0;c<s.length;c++)s.words[c]=0}var h=i.clone()._ishlnsubmul(n,1,u);0===h.negative&&(i=h,s&&(s.words[u]=1));for(var l=u-1;l>=0;l--){var f=67108864*(0|i.words[n.length+l])+(0|i.words[n.length+l-1]);for(f=Math.min(f/a|0,67108863),i._ishlnsubmul(n,f,l);0!==i.negative;)f--,i.negative=0,i._ishlnsubmul(n,1,l),i.isZero()||(i.negative^=1);s&&(s.words[l]=f)}return s&&s._strip(),i._strip(),"div"!==t&&0!==r&&i.iushrn(r),{div:s||null,mod:i}},o.prototype.divmod=function(e,t,r){return i(!e.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(n=s.div.neg()),"div"!==t&&(a=s.mod.neg(),r&&0!==a.negative&&a.iadd(e)),{div:n,mod:a}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(n=s.div.neg()),{div:n,mod:s.mod}):0!==(this.negative&e.negative)?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(a=s.mod.neg(),r&&0!==a.negative&&a.isub(e)),{div:s.div,mod:a}):e.length>this.length||this.cmp(e)<0?{div:new o(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new o(this.modrn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new o(this.modrn(e.words[0]))}:this._wordDiv(e,t);var n,a,s},o.prototype.div=function(e){return this.divmod(e,"div",!1).div},o.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},o.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},o.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,i=e.ushrn(1),n=e.andln(1),o=r.cmp(i);return o<0||1===n&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},o.prototype.modrn=function(e){var t=e<0;t&&(e=-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 t?-n:n},o.prototype.modn=function(e){return this.modrn(e)},o.prototype.idivn=function(e){var t=e<0;t&&(e=-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(),t?this.ineg():this},o.prototype.divn=function(e){return this.clone().idivn(e)},o.prototype.egcd=function(e){i(0===e.negative),i(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var n=new o(1),a=new o(0),s=new o(0),u=new o(1),c=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++c;for(var h=r.clone(),l=t.clone();!t.isZero();){for(var f=0,p=1;0===(t.words[0]&p)&&f<26;++f,p<<=1);if(f>0)for(t.iushrn(f);f-- >0;)(n.isOdd()||a.isOdd())&&(n.iadd(h),a.isub(l)),n.iushrn(1),a.iushrn(1);for(var d=0,g=1;0===(r.words[0]&g)&&d<26;++d,g<<=1);if(d>0)for(r.iushrn(d);d-- >0;)(s.isOdd()||u.isOdd())&&(s.iadd(h),u.isub(l)),s.iushrn(1),u.iushrn(1);t.cmp(r)>=0?(t.isub(r),n.isub(s),a.isub(u)):(r.isub(t),s.isub(n),u.isub(a))}return{a:s,b:u,gcd:r.iushln(c)}},o.prototype._invmp=function(e){i(0===e.negative),i(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var n,a=new o(1),s=new o(0),u=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var c=0,h=1;0===(t.words[0]&h)&&c<26;++c,h<<=1);if(c>0)for(t.iushrn(c);c-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);for(var l=0,f=1;0===(r.words[0]&f)&&l<26;++l,f<<=1);if(l>0)for(r.iushrn(l);l-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);t.cmp(r)>=0?(t.isub(r),a.isub(s)):(r.isub(t),s.isub(a))}return(n=0===t.cmpn(1)?a:s).cmpn(0)<0&&n.iadd(e),n},o.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var i=0;t.isEven()&&r.isEven();i++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var n=t.cmp(r);if(n<0){var o=t;t=r,r=o}else if(0===n||0===r.cmpn(1))break;t.isub(r)}return r.iushln(i)},o.prototype.invm=function(e){return this.egcd(e).a.umod(e)},o.prototype.isEven=function(){return!(1&this.words[0])},o.prototype.isOdd=function(){return!(1&~this.words[0])},o.prototype.andln=function(e){return this.words[0]&e},o.prototype.bincn=function(e){i("number"==typeof e);var t=e%26,r=(e-t)/26,n=1<<t;if(this.length<=r)return this._expand(r+1),this.words[r]|=n,this;for(var o=n,a=r;0!==o&&a<this.length;a++){var s=0|this.words[a];o=(s+=o)>>>26,s&=67108863,this.words[a]=s}return 0!==o&&(this.words[a]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this._strip(),this.length>1)t=1;else{r&&(e=-e),i(e<=67108863,"Number is too big");var n=0|this.words[0];t=n===e?0:n<e?-1:1}return 0!==this.negative?0|-t:t},o.prototype.cmp=function(e){if(0!==this.negative&&0===e.negative)return-1;if(0===this.negative&&0!==e.negative)return 1;var t=this.ucmp(e);return 0!==this.negative?0|-t:t},o.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var t=0,r=this.length-1;r>=0;r--){var i=0|this.words[r],n=0|e.words[r];if(i!==n){i<n?t=-1:i>n&&(t=1);break}}return t},o.prototype.gtn=function(e){return 1===this.cmpn(e)},o.prototype.gt=function(e){return 1===this.cmp(e)},o.prototype.gten=function(e){return this.cmpn(e)>=0},o.prototype.gte=function(e){return this.cmp(e)>=0},o.prototype.ltn=function(e){return-1===this.cmpn(e)},o.prototype.lt=function(e){return-1===this.cmp(e)},o.prototype.lten=function(e){return this.cmpn(e)<=0},o.prototype.lte=function(e){return this.cmp(e)<=0},o.prototype.eqn=function(e){return 0===this.cmpn(e)},o.prototype.eq=function(e){return 0===this.cmp(e)},o.red=function(e){return new I(e)},o.prototype.toRed=function(e){return i(!this.red,"Already a number in reduction context"),i(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},o.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(e){return this.red=e,this},o.prototype.forceRed=function(e){return i(!this.red,"Already a number in reduction context"),this._forceRed(e)},o.prototype.redAdd=function(e){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},o.prototype.redIAdd=function(e){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},o.prototype.redSub=function(e){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},o.prototype.redISub=function(e){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},o.prototype.redShl=function(e){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},o.prototype.redMul=function(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(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(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(e){return i(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var _={k256:null,p224:null,p192:null,p25519:null};function w(e,t){this.name=e,this.p=new o(t,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function S(){w.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function E(){w.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function k(){w.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function O(){w.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function I(e){if("string"==typeof e){var t=o._prime(e);this.m=t.p,this.prime=t}else i(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function A(e){I.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}w.prototype._tmp=function(){var e=new o(null);return e.words=new Array(Math.ceil(this.n/13)),e},w.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var i=t<this.n?-1:r.ucmp(this.p);return 0===i?(r.words[0]=0,r.length=1):i>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},w.prototype.split=function(e,t){e.iushrn(this.n,0,t)},w.prototype.imulK=function(e){return e.imul(this.k)},n(S,w),S.prototype.split=function(e,t){for(var r=4194303,i=Math.min(e.length,9),n=0;n<i;n++)t.words[n]=e.words[n];if(t.length=i,e.length<=9)return e.words[0]=0,void(e.length=1);var o=e.words[9];for(t.words[t.length++]=o&r,n=10;n<e.length;n++){var a=0|e.words[n];e.words[n-10]=(a&r)<<4|o>>>22,o=a}o>>>=22,e.words[n-10]=o,0===o&&e.length>10?e.length-=10:e.length-=9},S.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r<e.length;r++){var i=0|e.words[r];t+=977*i,e.words[r]=67108863&t,t=64*i+(t/67108864|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},n(E,w),n(k,w),n(O,w),O.prototype.imulK=function(e){for(var t=0,r=0;r<e.length;r++){var i=19*(0|e.words[r])+t,n=67108863&i;i>>>=26,e.words[r]=n,t=i}return 0!==t&&(e.words[e.length++]=t),e},o._prime=function(e){if(_[e])return _[e];var t;if("k256"===e)t=new S;else if("p224"===e)t=new E;else if("p192"===e)t=new k;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new O}return _[e]=t,t},I.prototype._verify1=function(e){i(0===e.negative,"red works only with positives"),i(e.red,"red works only with red numbers")},I.prototype._verify2=function(e,t){i(0===(e.negative|t.negative),"red works only with positives"),i(e.red&&e.red===t.red,"red works only with red numbers")},I.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):(h(e,e.umod(this.m)._forceRed(this)),e)},I.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},I.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},I.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},I.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},I.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},I.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},I.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},I.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},I.prototype.isqr=function(e){return this.imul(e,e.clone())},I.prototype.sqr=function(e){return this.mul(e,e)},I.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(i(t%2==1),3===t){var r=this.m.add(new o(1)).iushrn(2);return this.pow(e,r)}for(var n=this.m.subn(1),a=0;!n.isZero()&&0===n.andln(1);)a++,n.iushrn(1);i(!n.isZero());var s=new o(1).toRed(this),u=s.redNeg(),c=this.m.subn(1).iushrn(1),h=this.m.bitLength();for(h=new o(2*h*h).toRed(this);0!==this.pow(h,c).cmp(u);)h.redIAdd(u);for(var l=this.pow(h,n),f=this.pow(e,n.addn(1).iushrn(1)),p=this.pow(e,n),d=a;0!==p.cmp(s);){for(var g=p,m=0;0!==g.cmp(s);m++)g=g.redSqr();i(m<d);var y=this.pow(l,new o(1).iushln(d-m-1));f=f.redMul(y),l=y.redSqr(),p=p.redMul(l),d=m}return f},I.prototype.invm=function(e){var t=e._invmp(this.m);return 0!==t.negative?(t.negative=0,this.imod(t).redNeg()):this.imod(t)},I.prototype.pow=function(e,t){if(t.isZero())return new o(1).toRed(this);if(0===t.cmpn(1))return e.clone();var r=new Array(16);r[0]=new o(1).toRed(this),r[1]=e;for(var i=2;i<r.length;i++)r[i]=this.mul(r[i-1],e);var n=r[0],a=0,s=0,u=t.bitLength()%26;for(0===u&&(u=26),i=t.length-1;i>=0;i--){for(var c=t.words[i],h=u-1;h>=0;h--){var l=c>>h&1;n!==r[0]&&(n=this.sqr(n)),0!==l||0!==a?(a<<=1,a|=l,(4===++s||0===i&&0===h)&&(n=this.mul(n,r[a]),s=0,a=0)):s=0}u=26}return n},I.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},I.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},o.mont=function(e){return new A(e)},n(A,I),A.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},A.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},A.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},A.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new o(0)._forceRed(this);var r=e.mul(t),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),a=n;return n.cmp(this.m)>=0?a=n.isub(this.m):n.cmpn(0)<0&&(a=n.iadd(this.m)),a._forceRed(this)},A.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=r.nmd(e),this)},5974(e,t,r){"use strict";var i=r(8287).Buffer,n=r(5606),o=r(4148),a=r(4442),s=r(8411),u=r(1447),c=r(9681);for(var h in c)t[h]=c[h];t.NONE=0,t.DEFLATE=1,t.INFLATE=2,t.GZIP=3,t.GUNZIP=4,t.DEFLATERAW=5,t.INFLATERAW=6,t.UNZIP=7;function l(e){if("number"!=typeof e||e<t.DEFLATE||e>t.UNZIP)throw new TypeError("Bad argument");this.dictionary=null,this.err=0,this.flush=0,this.init_done=!1,this.level=0,this.memLevel=0,this.mode=e,this.strategy=0,this.windowBits=0,this.write_in_progress=!1,this.pending_close=!1,this.gzip_id_bytes_read=0}l.prototype.close=function(){this.write_in_progress?this.pending_close=!0:(this.pending_close=!1,o(this.init_done,"close before init"),o(this.mode<=t.UNZIP),this.mode===t.DEFLATE||this.mode===t.GZIP||this.mode===t.DEFLATERAW?s.deflateEnd(this.strm):this.mode!==t.INFLATE&&this.mode!==t.GUNZIP&&this.mode!==t.INFLATERAW&&this.mode!==t.UNZIP||u.inflateEnd(this.strm),this.mode=t.NONE,this.dictionary=null)},l.prototype.write=function(e,t,r,i,n,o,a){return this._write(!0,e,t,r,i,n,o,a)},l.prototype.writeSync=function(e,t,r,i,n,o,a){return this._write(!1,e,t,r,i,n,o,a)},l.prototype._write=function(e,r,a,s,u,c,h,l){if(o.equal(arguments.length,8),o(this.init_done,"write before init"),o(this.mode!==t.NONE,"already finalized"),o.equal(!1,this.write_in_progress,"write already in progress"),o.equal(!1,this.pending_close,"close is pending"),this.write_in_progress=!0,o.equal(!1,void 0===r,"must provide flush value"),this.write_in_progress=!0,r!==t.Z_NO_FLUSH&&r!==t.Z_PARTIAL_FLUSH&&r!==t.Z_SYNC_FLUSH&&r!==t.Z_FULL_FLUSH&&r!==t.Z_FINISH&&r!==t.Z_BLOCK)throw new Error("Invalid flush value");if(null==a&&(a=i.alloc(0),u=0,s=0),this.strm.avail_in=u,this.strm.input=a,this.strm.next_in=s,this.strm.avail_out=l,this.strm.output=c,this.strm.next_out=h,this.flush=r,!e)return this._process(),this._checkError()?this._afterSync():void 0;var f=this;return n.nextTick(function(){f._process(),f._after()}),this},l.prototype._afterSync=function(){var e=this.strm.avail_out,t=this.strm.avail_in;return this.write_in_progress=!1,[t,e]},l.prototype._process=function(){var e=null;switch(this.mode){case t.DEFLATE:case t.GZIP:case t.DEFLATERAW:this.err=s.deflate(this.strm,this.flush);break;case t.UNZIP:switch(this.strm.avail_in>0&&(e=this.strm.next_in),this.gzip_id_bytes_read){case 0:if(null===e)break;if(31!==this.strm.input[e]){this.mode=t.INFLATE;break}if(this.gzip_id_bytes_read=1,e++,1===this.strm.avail_in)break;case 1:if(null===e)break;139===this.strm.input[e]?(this.gzip_id_bytes_read=2,this.mode=t.GUNZIP):this.mode=t.INFLATE;break;default:throw new Error("invalid number of gzip magic number bytes read")}case t.INFLATE:case t.GUNZIP:case t.INFLATERAW:for(this.err=u.inflate(this.strm,this.flush),this.err===t.Z_NEED_DICT&&this.dictionary&&(this.err=u.inflateSetDictionary(this.strm,this.dictionary),this.err===t.Z_OK?this.err=u.inflate(this.strm,this.flush):this.err===t.Z_DATA_ERROR&&(this.err=t.Z_NEED_DICT));this.strm.avail_in>0&&this.mode===t.GUNZIP&&this.err===t.Z_STREAM_END&&0!==this.strm.next_in[0];)this.reset(),this.err=u.inflate(this.strm,this.flush);break;default:throw new Error("Unknown mode "+this.mode)}},l.prototype._checkError=function(){switch(this.err){case t.Z_OK:case t.Z_BUF_ERROR:if(0!==this.strm.avail_out&&this.flush===t.Z_FINISH)return this._error("unexpected end of file"),!1;break;case t.Z_STREAM_END:break;case t.Z_NEED_DICT:return null==this.dictionary?this._error("Missing dictionary"):this._error("Bad dictionary"),!1;default:return this._error("Zlib error"),!1}return!0},l.prototype._after=function(){if(this._checkError()){var e=this.strm.avail_out,t=this.strm.avail_in;this.write_in_progress=!1,this.callback(t,e),this.pending_close&&this.close()}},l.prototype._error=function(e){this.strm.msg&&(e=this.strm.msg),this.onerror(e,this.err),this.write_in_progress=!1,this.pending_close&&this.close()},l.prototype.init=function(e,r,i,n,a){o(4===arguments.length||5===arguments.length,"init(windowBits, level, memLevel, strategy, [dictionary])"),o(e>=8&&e<=15,"invalid windowBits"),o(r>=-1&&r<=9,"invalid compression level"),o(i>=1&&i<=9,"invalid memlevel"),o(n===t.Z_FILTERED||n===t.Z_HUFFMAN_ONLY||n===t.Z_RLE||n===t.Z_FIXED||n===t.Z_DEFAULT_STRATEGY,"invalid strategy"),this._init(r,e,i,n,a),this._setDictionary()},l.prototype.params=function(){throw new Error("deflateParams Not supported")},l.prototype.reset=function(){this._reset(),this._setDictionary()},l.prototype._init=function(e,r,i,n,o){switch(this.level=e,this.windowBits=r,this.memLevel=i,this.strategy=n,this.flush=t.Z_NO_FLUSH,this.err=t.Z_OK,this.mode!==t.GZIP&&this.mode!==t.GUNZIP||(this.windowBits+=16),this.mode===t.UNZIP&&(this.windowBits+=32),this.mode!==t.DEFLATERAW&&this.mode!==t.INFLATERAW||(this.windowBits=-1*this.windowBits),this.strm=new a,this.mode){case t.DEFLATE:case t.GZIP:case t.DEFLATERAW:this.err=s.deflateInit2(this.strm,this.level,t.Z_DEFLATED,this.windowBits,this.memLevel,this.strategy);break;case t.INFLATE:case t.GUNZIP:case t.INFLATERAW:case t.UNZIP:this.err=u.inflateInit2(this.strm,this.windowBits);break;default:throw new Error("Unknown mode "+this.mode)}this.err!==t.Z_OK&&this._error("Init error"),this.dictionary=o,this.write_in_progress=!1,this.init_done=!0},l.prototype._setDictionary=function(){if(null!=this.dictionary){switch(this.err=t.Z_OK,this.mode){case t.DEFLATE:case t.DEFLATERAW:this.err=s.deflateSetDictionary(this.strm,this.dictionary)}this.err!==t.Z_OK&&this._error("Failed to set dictionary")}},l.prototype._reset=function(){switch(this.err=t.Z_OK,this.mode){case t.DEFLATE:case t.DEFLATERAW:case t.GZIP:this.err=s.deflateReset(this.strm);break;case t.INFLATE:case t.INFLATERAW:case t.GUNZIP:this.err=u.inflateReset(this.strm)}this.err!==t.Z_OK&&this._error("Failed to reset stream")},t.Zlib=l},8559(e,t,r){"use strict";var i=r(5606),n=r(8287).Buffer,o=r(8310).Transform,a=r(5974),s=r(537),u=r(4148).ok,c=r(8287).kMaxLength,h="Cannot create final Buffer. It would be larger than 0x"+c.toString(16)+" bytes";a.Z_MIN_WINDOWBITS=8,a.Z_MAX_WINDOWBITS=15,a.Z_DEFAULT_WINDOWBITS=15,a.Z_MIN_CHUNK=64,a.Z_MAX_CHUNK=1/0,a.Z_DEFAULT_CHUNK=16384,a.Z_MIN_MEMLEVEL=1,a.Z_MAX_MEMLEVEL=9,a.Z_DEFAULT_MEMLEVEL=8,a.Z_MIN_LEVEL=-1,a.Z_MAX_LEVEL=9,a.Z_DEFAULT_LEVEL=a.Z_DEFAULT_COMPRESSION;for(var l=Object.keys(a),f=0;f<l.length;f++){var p=l[f];p.match(/^Z/)&&Object.defineProperty(t,p,{enumerable:!0,value:a[p],writable:!1})}for(var d={Z_OK:a.Z_OK,Z_STREAM_END:a.Z_STREAM_END,Z_NEED_DICT:a.Z_NEED_DICT,Z_ERRNO:a.Z_ERRNO,Z_STREAM_ERROR:a.Z_STREAM_ERROR,Z_DATA_ERROR:a.Z_DATA_ERROR,Z_MEM_ERROR:a.Z_MEM_ERROR,Z_BUF_ERROR:a.Z_BUF_ERROR,Z_VERSION_ERROR:a.Z_VERSION_ERROR},g=Object.keys(d),m=0;m<g.length;m++){var y=g[m];d[d[y]]=y}function v(e,t,r){var i=[],o=0;function a(){for(var t;null!==(t=e.read());)i.push(t),o+=t.length;e.once("readable",a)}function s(){var t,a=null;o>=c?a=new RangeError(h):t=n.concat(i,o),i=[],e.close(),r(a,t)}e.on("error",function(t){e.removeListener("end",s),e.removeListener("readable",a),r(t)}),e.on("end",s),e.end(t),a()}function b(e,t){if("string"==typeof t&&(t=n.from(t)),!n.isBuffer(t))throw new TypeError("Not a string or buffer");var r=e._finishFlushFlag;return e._processChunk(t,r)}function _(e){if(!(this instanceof _))return new _(e);x.call(this,e,a.DEFLATE)}function w(e){if(!(this instanceof w))return new w(e);x.call(this,e,a.INFLATE)}function S(e){if(!(this instanceof S))return new S(e);x.call(this,e,a.GZIP)}function E(e){if(!(this instanceof E))return new E(e);x.call(this,e,a.GUNZIP)}function k(e){if(!(this instanceof k))return new k(e);x.call(this,e,a.DEFLATERAW)}function O(e){if(!(this instanceof O))return new O(e);x.call(this,e,a.INFLATERAW)}function I(e){if(!(this instanceof I))return new I(e);x.call(this,e,a.UNZIP)}function A(e){return e===a.Z_NO_FLUSH||e===a.Z_PARTIAL_FLUSH||e===a.Z_SYNC_FLUSH||e===a.Z_FULL_FLUSH||e===a.Z_FINISH||e===a.Z_BLOCK}function x(e,r){var i=this;if(this._opts=e=e||{},this._chunkSize=e.chunkSize||t.Z_DEFAULT_CHUNK,o.call(this,e),e.flush&&!A(e.flush))throw new Error("Invalid flush flag: "+e.flush);if(e.finishFlush&&!A(e.finishFlush))throw new Error("Invalid flush flag: "+e.finishFlush);if(this._flushFlag=e.flush||a.Z_NO_FLUSH,this._finishFlushFlag=void 0!==e.finishFlush?e.finishFlush:a.Z_FINISH,e.chunkSize&&(e.chunkSize<t.Z_MIN_CHUNK||e.chunkSize>t.Z_MAX_CHUNK))throw new Error("Invalid chunk size: "+e.chunkSize);if(e.windowBits&&(e.windowBits<t.Z_MIN_WINDOWBITS||e.windowBits>t.Z_MAX_WINDOWBITS))throw new Error("Invalid windowBits: "+e.windowBits);if(e.level&&(e.level<t.Z_MIN_LEVEL||e.level>t.Z_MAX_LEVEL))throw new Error("Invalid compression level: "+e.level);if(e.memLevel&&(e.memLevel<t.Z_MIN_MEMLEVEL||e.memLevel>t.Z_MAX_MEMLEVEL))throw new Error("Invalid memLevel: "+e.memLevel);if(e.strategy&&e.strategy!=t.Z_FILTERED&&e.strategy!=t.Z_HUFFMAN_ONLY&&e.strategy!=t.Z_RLE&&e.strategy!=t.Z_FIXED&&e.strategy!=t.Z_DEFAULT_STRATEGY)throw new Error("Invalid strategy: "+e.strategy);if(e.dictionary&&!n.isBuffer(e.dictionary))throw new Error("Invalid dictionary: it should be a Buffer instance");this._handle=new a.Zlib(r);var s=this;this._hadError=!1,this._handle.onerror=function(e,r){P(s),s._hadError=!0;var i=new Error(e);i.errno=r,i.code=t.codes[r],s.emit("error",i)};var u=t.Z_DEFAULT_COMPRESSION;"number"==typeof e.level&&(u=e.level);var c=t.Z_DEFAULT_STRATEGY;"number"==typeof e.strategy&&(c=e.strategy),this._handle.init(e.windowBits||t.Z_DEFAULT_WINDOWBITS,u,e.memLevel||t.Z_DEFAULT_MEMLEVEL,c,e.dictionary),this._buffer=n.allocUnsafe(this._chunkSize),this._offset=0,this._level=u,this._strategy=c,this.once("end",this.close),Object.defineProperty(this,"_closed",{get:function(){return!i._handle},configurable:!0,enumerable:!0})}function P(e,t){t&&i.nextTick(t),e._handle&&(e._handle.close(),e._handle=null)}function T(e){e.emit("close")}Object.defineProperty(t,"codes",{enumerable:!0,value:Object.freeze(d),writable:!1}),t.Deflate=_,t.Inflate=w,t.Gzip=S,t.Gunzip=E,t.DeflateRaw=k,t.InflateRaw=O,t.Unzip=I,t.createDeflate=function(e){return new _(e)},t.createInflate=function(e){return new w(e)},t.createDeflateRaw=function(e){return new k(e)},t.createInflateRaw=function(e){return new O(e)},t.createGzip=function(e){return new S(e)},t.createGunzip=function(e){return new E(e)},t.createUnzip=function(e){return new I(e)},t.deflate=function(e,t,r){return"function"==typeof t&&(r=t,t={}),v(new _(t),e,r)},t.deflateSync=function(e,t){return b(new _(t),e)},t.gzip=function(e,t,r){return"function"==typeof t&&(r=t,t={}),v(new S(t),e,r)},t.gzipSync=function(e,t){return b(new S(t),e)},t.deflateRaw=function(e,t,r){return"function"==typeof t&&(r=t,t={}),v(new k(t),e,r)},t.deflateRawSync=function(e,t){return b(new k(t),e)},t.unzip=function(e,t,r){return"function"==typeof t&&(r=t,t={}),v(new I(t),e,r)},t.unzipSync=function(e,t){return b(new I(t),e)},t.inflate=function(e,t,r){return"function"==typeof t&&(r=t,t={}),v(new w(t),e,r)},t.inflateSync=function(e,t){return b(new w(t),e)},t.gunzip=function(e,t,r){return"function"==typeof t&&(r=t,t={}),v(new E(t),e,r)},t.gunzipSync=function(e,t){return b(new E(t),e)},t.inflateRaw=function(e,t,r){return"function"==typeof t&&(r=t,t={}),v(new O(t),e,r)},t.inflateRawSync=function(e,t){return b(new O(t),e)},s.inherits(x,o),x.prototype.params=function(e,r,n){if(e<t.Z_MIN_LEVEL||e>t.Z_MAX_LEVEL)throw new RangeError("Invalid compression level: "+e);if(r!=t.Z_FILTERED&&r!=t.Z_HUFFMAN_ONLY&&r!=t.Z_RLE&&r!=t.Z_FIXED&&r!=t.Z_DEFAULT_STRATEGY)throw new TypeError("Invalid strategy: "+r);if(this._level!==e||this._strategy!==r){var o=this;this.flush(a.Z_SYNC_FLUSH,function(){u(o._handle,"zlib binding closed"),o._handle.params(e,r),o._hadError||(o._level=e,o._strategy=r,n&&n())})}else i.nextTick(n)},x.prototype.reset=function(){return u(this._handle,"zlib binding closed"),this._handle.reset()},x.prototype._flush=function(e){this._transform(n.alloc(0),"",e)},x.prototype.flush=function(e,t){var r=this,o=this._writableState;("function"==typeof e||void 0===e&&!t)&&(t=e,e=a.Z_FULL_FLUSH),o.ended?t&&i.nextTick(t):o.ending?t&&this.once("end",t):o.needDrain?t&&this.once("drain",function(){return r.flush(e,t)}):(this._flushFlag=e,this.write(n.alloc(0),"",t))},x.prototype.close=function(e){P(this,e),i.nextTick(T,this)},x.prototype._transform=function(e,t,r){var i,o=this._writableState,s=(o.ending||o.ended)&&(!e||o.length===e.length);return null===e||n.isBuffer(e)?this._handle?(s?i=this._finishFlushFlag:(i=this._flushFlag,e.length>=o.length&&(this._flushFlag=this._opts.flush||a.Z_NO_FLUSH)),void this._processChunk(e,i,r)):r(new Error("zlib binding closed")):r(new Error("invalid input"))},x.prototype._processChunk=function(e,t,r){var i=e&&e.length,o=this._chunkSize-this._offset,a=0,s=this,l="function"==typeof r;if(!l){var f,p=[],d=0;this.on("error",function(e){f=e}),u(this._handle,"zlib binding closed");do{var g=this._handle.writeSync(t,e,a,i,this._buffer,this._offset,o)}while(!this._hadError&&v(g[0],g[1]));if(this._hadError)throw f;if(d>=c)throw P(this),new RangeError(h);var m=n.concat(p,d);return P(this),m}u(this._handle,"zlib binding closed");var y=this._handle.write(t,e,a,i,this._buffer,this._offset,o);function v(c,h){if(this&&(this.buffer=null,this.callback=null),!s._hadError){var f=o-h;if(u(f>=0,"have should not go down"),f>0){var g=s._buffer.slice(s._offset,s._offset+f);s._offset+=f,l?s.push(g):(p.push(g),d+=g.length)}if((0===h||s._offset>=s._chunkSize)&&(o=s._chunkSize,s._offset=0,s._buffer=n.allocUnsafe(s._chunkSize)),0===h){if(a+=i-c,i=c,!l)return!0;var m=s._handle.write(t,e,a,i,s._buffer,s._offset,s._chunkSize);return m.callback=v,void(m.buffer=e)}if(!l)return!1;r()}}y.buffer=e,y.callback=v},s.inherits(_,x),s.inherits(w,x),s.inherits(S,x),s.inherits(E,x),s.inherits(k,x),s.inherits(O,x),s.inherits(I,x)},6763(e,t,r){var i=r(5364);e.exports=i("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz")},295(e,t,r){var i=r(8287).Buffer;e.exports=function(e,t){for(var r=Math.min(e.length,t.length),n=new i(r),o=0;o<r;++o)n[o]=e[o]^t[o];return n}},8287(e,t,r){"use strict";
|
|
8
8
|
/*!
|
|
9
9
|
* The buffer module from node.js, for the browser.
|
|
10
10
|
*
|
|
@@ -42,4 +42,4 @@ const re=BigInt(0),ie=BigInt(1);function ne(e,t){const r=t.negate();return e?r:t
|
|
|
42
42
|
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
43
43
|
const ge=(e,t)=>(e+(e>=0?t:-t)/Se)/t;function me(e){if(!["compact","recovered","der"].includes(e))throw new Error('Signature format must be "compact", "recovered", or "der"');return e}function ye(e,t){A(e);const r={};for(let i of Object.keys(t))r[i]=void 0===e[i]?t[i]:e[i];return d(r.lowS,"lowS"),d(r.prehash,"prehash"),void 0!==r.format&&me(r.format),r}class ve extends Error{constructor(e=""){super(e)}}const be={Err:ve,_tlv:{encode:(e,t)=>{const{Err:r}=be;if(m(e,"tag"),e<0||e>255)throw new r("tlv.encode: wrong tag");if("string"!=typeof t)throw new TypeError('"data" expected string, got type='+typeof t);if(1&t.length)throw new r("tlv.encode: unpadded data");const i=t.length/2,n=y(i);if(n.length/2&128)throw new r("tlv.encode: long form length too big");const o=i>127?y(n.length/2|128):"";return y(e)+o+n+t},decode(e,t){const{Err:r}=be;t=o(t,void 0,"DER data");let i=0;if(e<0||e>255)throw new r("tlv.encode: wrong tag");if(t.length<2||t[i++]!==e)throw new r("tlv.decode: wrong tlv");const n=t[i++];let a=0;if(!!(128&n)){const e=127&n;if(!e)throw new r("tlv.decode(long): indefinite length not supported");if(e>4)throw new r("tlv.decode(long): byte length is too big");const o=t.subarray(i,i+e);if(o.length!==e)throw new r("tlv.decode: length bytes not complete");if(0===o[0])throw new r("tlv.decode(long): zero leftmost byte");for(const e of o)a=a<<8|e;if(i+=e,a<128)throw new r("tlv.decode(long): not minimal encoding")}else a=n;const s=t.subarray(i,i+a);if(s.length!==a)throw new r("tlv.decode: wrong value length");return{v:s,l:t.subarray(i+a)}}},_int:{encode(e){const{Err:t}=be;if(g(e),e<_e)throw new t("integer: negative integers are not allowed");let r=y(e);if(8&Number.parseInt(r[0],16)&&(r="00"+r),1&r.length)throw new t("unexpected DER parsing assertion: unpadded hex");return r},decode(e){const{Err:t}=be;if(e.length<1)throw new t("invalid signature integer: empty");if(128&e[0])throw new t("invalid signature integer: negative");if(e.length>1&&0===e[0]&&!(128&e[1]))throw new t("invalid signature integer: unnecessary leading zero");return b(e)}},toSig(e){const{Err:t,_int:r,_tlv:i}=be,n=o(e,void 0,"signature"),{v:a,l:s}=i.decode(48,n);if(s.length)throw new t("invalid signature: left bytes after parsing");const{v:u,l:c}=i.decode(2,a),{v:h,l}=i.decode(2,c);if(l.length)throw new t("invalid signature: left bytes after parsing");return{r:r.decode(u),s:r.decode(h)}},hexFromSig(e){const{_tlv:t,_int:r}=be,i=t.encode(2,r.encode(e.r))+t.encode(2,r.encode(e.s));return t.encode(48,i)}};Object.freeze(be._tlv),Object.freeze(be._int),Object.freeze(be);const _e=BigInt(0),we=BigInt(1),Se=BigInt(2),Ee=BigInt(3),ke=BigInt(4);function Oe(e,t={}){const r=function(e,t,r={},i){if(void 0===i&&(i="edwards"===e),!t||"object"!=typeof t)throw new Error(`expected valid ${e} CURVE object`);for(const e of["p","n","h"]){const r=t[e];if(!("bigint"==typeof r&&r>re))throw new Error(`CURVE.${e} must be positive bigint`)}const n=de(t.p,r.Fp,i),o=de(t.n,r.Fn,i),a=["Gx","Gy","a","weierstrass"===e?"b":"d"];for(const e of a)if(!n.isValid(t[e]))throw new Error(`CURVE.${e} must be valid field element of CURVE.Fp`);return{CURVE:t=Object.freeze(Object.assign({},t)),Fp:n,Fn:o}}("weierstrass",e,t),i=r.Fp,n=r.Fn;let a=r.CURVE;const{h,n:l}=a;A(t,{},{allowInfinityPoint:"boolean",clearCofactor:"function",isTorsionFree:"function",fromBytes:"function",toBytes:"function",endo:"object"});const{endo:f,allowInfinityPoint:p}=t;if(f&&(!i.is0(a.a)||"bigint"!=typeof f.beta||!Array.isArray(f.basises)))throw new Error('invalid endo: expected "beta": bigint and "basises": array');const g=Ae(i,n);function m(){if(!i.isOdd)throw new Error("compression is not supported: Field does not have .isOdd()")}const y=void 0===t.toBytes?function(e,t,r){if(p&&t.is0())return Uint8Array.of(0);const{x:n,y:o}=t.toAffine(),a=i.toBytes(n);if(d(r,"isCompressed"),r){m();const e=!i.isOdd(o);return u(Ie(e),a)}return u(Uint8Array.of(4),a,i.toBytes(o))}:t.toBytes,v=void 0===t.fromBytes?function(e){o(e,void 0,"Point");const{publicKey:t,publicKeyUncompressed:r}=g,n=e.length,a=e[0],s=e.subarray(1);if(p&&1===n&&0===a)return{x:i.ZERO,y:i.ZERO};if(n!==t||2!==a&&3!==a){if(n===r&&4===a){const e=i.BYTES,t=i.fromBytes(s.subarray(0,e)),r=i.fromBytes(s.subarray(e,2*e));if(!_(t,r))throw new Error("bad point: is not on curve");return{x:t,y:r}}throw new Error(`bad point: got length ${n}, expected compressed=${t} or uncompressed=${r}`)}{const e=i.fromBytes(s);if(!i.isValid(e))throw new Error("bad point: is not on curve, wrong x");const t=b(e);let r;try{r=i.sqrt(t)}catch(e){const t=e instanceof Error?": "+e.message:"";throw new Error("bad point: is not on curve, sqrt error"+t)}m();return!(1&~a)!==i.isOdd(r)&&(r=i.neg(r)),{x:e,y:r}}}:t.fromBytes;function b(e){const t=i.sqr(e),r=i.mul(t,e);return i.add(i.add(r,i.mul(e,a.a)),a.b)}function _(e,t){const r=i.sqr(t),n=b(e);return i.eql(r,n)}if(!_(a.Gx,a.Gy))throw new Error("bad curve params: generator point");const w=i.mul(i.pow(a.a,Ee),ke),S=i.mul(i.sqr(a.b),BigInt(27));if(i.is0(i.add(w,S)))throw new Error("bad curve params: a or b");function E(e,t,r=!1){if(!i.isValid(t)||r&&i.is0(t))throw new Error(`bad point coordinate ${e}`);return t}function x(e){if(!(e instanceof R))throw new Error("Weierstrass Point expected")}function P(e){if(!f||!f.basises)throw new Error("no endo");return function(e,t,r){k("scalar",e,_e,r);const[[i,n],[o,a]]=t,s=ge(a*e,r),u=ge(-n*e,r);let c=e-s*i-u*o,h=-s*n-u*a;const l=c<_e,f=h<_e;l&&(c=-c),f&&(h=-h);const p=I(Math.ceil(O(r)/2))+we;if(c<_e||c>=p||h<_e||h>=p)throw new Error("splitScalar (endomorphism): failed for k");return{k1neg:l,k1:c,k2neg:f,k2:h}}(e,f.basises,n.ORDER)}function T(e,t,r,n,o){return r=new R(i.mul(r.X,e),r.Y,r.Z),t=ne(n,t),r=ne(o,r),t.add(r)}class R{static BASE=new R(a.Gx,a.Gy,i.ONE);static ZERO=new R(i.ZERO,i.ONE,i.ZERO);static Fp=i;static Fn=n;X;Y;Z;constructor(e,t,r){this.X=E("x",e),this.Y=E("y",t,!0),this.Z=E("z",r),Object.freeze(this)}static CURVE(){return a}static fromAffine(e){const{x:t,y:r}=e||{};if(!e||!i.isValid(t)||!i.isValid(r))throw new Error("invalid affine point");if(e instanceof R)throw new Error("projective point not allowed");return i.is0(t)&&i.is0(r)?R.ZERO:new R(t,r,i.ONE)}static fromBytes(e){const t=R.fromAffine(v(o(e,void 0,"point")));return t.assertValidity(),t}static fromHex(e){return R.fromBytes(c(e))}get x(){return this.toAffine().x}get y(){return this.toAffine().y}precompute(e=8,t=!0){return B.createCache(this,e),t||this.multiply(Ee),this}assertValidity(){const e=this;if(e.is0()){if(t.allowInfinityPoint&&i.is0(e.X)&&i.eql(e.Y,i.ONE)&&i.is0(e.Z))return;throw new Error("bad point: ZERO")}const{x:r,y:n}=e.toAffine();if(!i.isValid(r)||!i.isValid(n))throw new Error("bad point: x or y not field elements");if(!_(r,n))throw new Error("bad point: equation left != right");if(!e.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){const{y:e}=this.toAffine();if(!i.isOdd)throw new Error("Field doesn't support isOdd");return!i.isOdd(e)}equals(e){x(e);const{X:t,Y:r,Z:n}=this,{X:o,Y:a,Z:s}=e,u=i.eql(i.mul(t,s),i.mul(o,n)),c=i.eql(i.mul(r,s),i.mul(a,n));return u&&c}negate(){return new R(this.X,i.neg(this.Y),this.Z)}double(){const{a:e,b:t}=a,r=i.mul(t,Ee),{X:n,Y:o,Z:s}=this;let u=i.ZERO,c=i.ZERO,h=i.ZERO,l=i.mul(n,n),f=i.mul(o,o),p=i.mul(s,s),d=i.mul(n,o);return d=i.add(d,d),h=i.mul(n,s),h=i.add(h,h),u=i.mul(e,h),c=i.mul(r,p),c=i.add(u,c),u=i.sub(f,c),c=i.add(f,c),c=i.mul(u,c),u=i.mul(d,u),h=i.mul(r,h),p=i.mul(e,p),d=i.sub(l,p),d=i.mul(e,d),d=i.add(d,h),h=i.add(l,l),l=i.add(h,l),l=i.add(l,p),l=i.mul(l,d),c=i.add(c,l),p=i.mul(o,s),p=i.add(p,p),l=i.mul(p,d),u=i.sub(u,l),h=i.mul(p,f),h=i.add(h,h),h=i.add(h,h),new R(u,c,h)}add(e){x(e);const{X:t,Y:r,Z:n}=this,{X:o,Y:s,Z:u}=e;let c=i.ZERO,h=i.ZERO,l=i.ZERO;const f=a.a,p=i.mul(a.b,Ee);let d=i.mul(t,o),g=i.mul(r,s),m=i.mul(n,u),y=i.add(t,r),v=i.add(o,s);y=i.mul(y,v),v=i.add(d,g),y=i.sub(y,v),v=i.add(t,n);let b=i.add(o,u);return v=i.mul(v,b),b=i.add(d,m),v=i.sub(v,b),b=i.add(r,n),c=i.add(s,u),b=i.mul(b,c),c=i.add(g,m),b=i.sub(b,c),l=i.mul(f,v),c=i.mul(p,m),l=i.add(c,l),c=i.sub(g,l),l=i.add(g,l),h=i.mul(c,l),g=i.add(d,d),g=i.add(g,d),m=i.mul(f,m),v=i.mul(p,v),g=i.add(g,m),m=i.sub(d,m),m=i.mul(f,m),v=i.add(v,m),d=i.mul(g,v),h=i.add(h,d),d=i.mul(b,v),c=i.mul(y,c),c=i.sub(c,d),d=i.mul(y,g),l=i.mul(b,l),l=i.add(l,d),new R(c,h,l)}subtract(e){return x(e),this.add(e.negate())}is0(){return this.equals(R.ZERO)}multiply(e){const{endo:r}=t;if(!n.isValidNot0(e))throw new RangeError("invalid scalar: out of range");let i,o;const a=e=>B.cached(this,e,e=>oe(R,e));if(r){const{k1neg:t,k1:n,k2neg:s,k2:u}=P(e),{p:c,f:h}=a(n),{p:l,f}=a(u);o=h.add(f),i=T(r.beta,c,l,t,s)}else{const{p:t,f:r}=a(e);i=t,o=r}return oe(R,[i,o])[0]}multiplyUnsafe(e){const{endo:r}=t,i=this,o=e;if(!n.isValid(o))throw new RangeError("invalid scalar: out of range");if(o===_e||i.is0())return R.ZERO;if(o===we)return i;if(B.hasCache(this))return this.multiply(o);if(r){const{k1neg:e,k1:t,k2neg:n,k2:a}=P(o),{p1:s,p2:u}=function(e,t,r,i){let n=t,o=e.ZERO,a=e.ZERO;for(;r>re||i>re;)r&ie&&(o=o.add(n)),i&ie&&(a=a.add(n)),n=n.double(),r>>=ie,i>>=ie;return{p1:o,p2:a}}(R,i,t,a);return T(r.beta,s,u,e,n)}return B.unsafe(i,o)}toAffine(e){let t=e;const{X:r,Y:n,Z:o}=this;if(i.eql(o,i.ONE))return{x:r,y:n};const a=this.is0();null==t&&(t=a?i.ONE:i.inv(o));const s=i.mul(r,t),u=i.mul(n,t),c=i.mul(o,t);if(a)return{x:i.ZERO,y:i.ZERO};if(!i.eql(c,i.ONE))throw new Error("invZ was invalid");return{x:s,y:u}}isTorsionFree(){const{isTorsionFree:e}=t;return h===we||(e?e(R,this):B.unsafe(this,l).is0())}clearCofactor(){const{clearCofactor:e}=t;return h===we?this:e?e(R,this):this.multiplyUnsafe(h)}isSmallOrder(){return h===we?this.is0():this.clearCofactor().is0()}toBytes(e=!0){return d(e,"isCompressed"),this.assertValidity(),y(R,this,e)}toHex(e=!0){return s(this.toBytes(e))}toString(){return`<Point ${this.is0()?"ZERO":this.toHex()}>`}}const M=n.BITS,B=new pe(R,t.endo?Math.ceil(M/2):M);return M>=8&&R.BASE.precompute(8),Object.freeze(R.prototype),Object.freeze(R),R}function Ie(e){return Uint8Array.of(e?2:3)}function Ae(e,t){return{secretKey:t.BYTES,publicKey:1+e.BYTES,publicKeyUncompressed:1+2*e.BYTES,publicKeyHasPrefix:!0,signature:2*t.BYTES}}function xe(e,t={}){const{Fn:r}=e,i=void 0===t.randomBytes?l:t.randomBytes,n=Object.assign(Ae(e.Fp,r),{seed:Math.max(ee(r.ORDER),16)});function a(e){return e=void 0===e?i(n.seed):e,function(e,t,r=!1){o(e);const i=e.length,n=Q(t),a=Math.max(ee(t),16);if(i<a||i>1024)throw new Error("expected "+a+"-1024 bytes of input, got "+i);const s=j(r?_(e):b(e),t-P)+P;return r?S(s,n):w(s,n)}(o(e,n.seed,"seed"),r.ORDER)}function s(t,i=!0){return e.BASE.multiply(r.fromBytes(t)).toBytes(i)}function u(e){const{secretKey:t,publicKey:i,publicKeyUncompressed:a}=n,s=r._lengths;if(!h(e))return;const u=o(e,void 0,"key").length,c=u===i||u===a,l=u===t||!!s?.includes(u);return c&&l?void 0:c}const c={isValidSecretKey:function(e){try{const t=r.fromBytes(e);return r.isValidNot0(t)}catch(e){return!1}},isValidPublicKey:function(t,r){const{publicKey:i,publicKeyUncompressed:o}=n;try{const n=t.length;return(!0!==r||n===i)&&((!1!==r||n===o)&&!!e.fromBytes(t))}catch(e){return!1}},randomSecretKey:a},f=function(e,t){return function(r){const i=e(r);return{secretKey:i,publicKey:t(i)}}}(a,s);return Object.freeze(c),Object.freeze(n),Object.freeze({getPublicKey:s,getSharedSecret:function(t,i,n=!0){if(!0===u(t))throw new Error("first arg must be private key");if(!1===u(i))throw new Error("second arg must be public key");const o=r.fromBytes(t);return e.fromBytes(i).multiply(o).toBytes(n)},keygen:f,Point:e,utils:c,lengths:n})}function Pe(e,t,r={}){const i=t;(0,n.sd)(i),A(r,{},{hmac:"function",lowS:"boolean",randomBytes:"function",bits2int:"function",bits2int_modN:"function"});const a=void 0===(r=Object.assign({},r)).randomBytes?l:r.randomBytes,f=void 0===r.hmac?(e,t)=>(0,te.hmac)(i,e,t):r.hmac,{Fp:p,Fn:d}=e,{ORDER:g,BITS:m}=d,{keygen:y,getPublicKey:v,getSharedSecret:_,utils:w,lengths:S}=xe(e,r),E={prehash:!0,lowS:"boolean"!=typeof r.lowS||r.lowS,format:"compact",extraEntropy:!1},O=g*Se+we<p.ORDER;function x(e){return e>g>>we}function P(e,t){if(!d.isValidNot0(t))throw new Error(`invalid signature ${e}: out of range 1..Point.Fn.ORDER`);return t}function T(){if(O)throw new Error('"recovered" sig type is not supported for cofactor >2 curves')}function R(e,t){me(t);const r=S.signature;return o(e,"compact"===t?r:"recovered"===t?r+1:void 0)}class M{r;s;recovery;constructor(e,t,r){if(this.r=P("r",e),this.s=P("s",t),null!=r){if(T(),![0,1,2,3].includes(r))throw new Error("invalid recovery id");this.recovery=r}Object.freeze(this)}static fromBytes(e,t=E.format){let r;if(R(e,t),"der"===t){const{r:t,s:r}=be.toSig(o(e));return new M(t,r)}"recovered"===t&&(r=e[0],t="compact",e=e.subarray(1));const i=S.signature/2,n=e.subarray(0,i),a=e.subarray(i,2*i);return new M(d.fromBytes(n),d.fromBytes(a),r)}static fromHex(e,t){return this.fromBytes(c(e),t)}assertRecovery(){const{recovery:e}=this;if(null==e)throw new Error("invalid recovery id: must be present");return e}addRecoveryBit(e){return new M(this.r,this.s,e)}recoverPublicKey(t){const{r,s:i}=this,n=this.assertRecovery(),a=2===n||3===n?r+g:r;if(!p.isValid(a))throw new Error("invalid recovery id: sig.r+curve.n != R.x");const s=p.toBytes(a),c=e.fromBytes(u(Ie(!(1&n)),s)),h=d.inv(a),l=C(o(t,void 0,"msgHash")),f=d.create(-l*h),m=d.create(i*h),y=e.BASE.multiplyUnsafe(f).add(c.multiplyUnsafe(m));if(y.is0())throw new Error("invalid recovery: point at infinify");return y.assertValidity(),y}hasHighS(){return x(this.s)}toBytes(e=E.format){if(me(e),"der"===e)return c(be.hexFromSig(this));const{r:t,s:r}=this,i=d.toBytes(t),n=d.toBytes(r);return"recovered"===e?(T(),u(Uint8Array.of(this.assertRecovery()),i,n)):u(i,n)}toHex(e){return s(this.toBytes(e))}}Object.freeze(M.prototype),Object.freeze(M);const B=void 0===r.bits2int?function(e){if(e.length>8192)throw new Error("input is too large");const t=b(e),r=8*e.length-m;return r>0?t>>BigInt(r):t}:r.bits2int,C=void 0===r.bits2int_modN?function(e){return d.create(B(e))}:r.bits2int_modN,N=I(m);function D(e){return k("num < 2^"+m,e,_e,N),d.toBytes(e)}function L(e,t){return o(e,void 0,"message"),t?o(i(e),void 0,"prehashed message"):e}return Object.freeze({keygen:y,getPublicKey:v,getSharedSecret:_,utils:w,lengths:S,Point:e,sign:function(t,r,s={}){const{seed:c,k2sig:h}=function(t,r,i){const{lowS:n,prehash:s,extraEntropy:c}=ye(i,E);t=L(t,s);const h=C(t),l=d.fromBytes(r);if(!d.isValidNot0(l))throw new Error("invalid private key");const f=[D(l),D(h)];if(null!=c&&!1!==c){const e=!0===c?a(S.secretKey):c;f.push(o(e,void 0,"extraEntropy"))}const p=u(...f),g=h;return{seed:p,k2sig:function(t){const r=B(t);if(!d.isValidNot0(r))return;const i=d.inv(r),o=e.BASE.multiply(r).toAffine(),a=d.create(o.x);if(a===_e)return;const s=d.create(i*d.create(g+a*l));if(s===_e)return;let u=(o.x===a?0:2)|Number(o.y&we),c=s;return n&&x(s)&&(c=d.neg(s),u^=1),new M(a,c,O?void 0:u)}}}(t,r,s);return function(e,t,r){if((0,n.Fe)(e,"hashLen"),(0,n.Fe)(t,"qByteLen"),"function"!=typeof r)throw new TypeError("hmacFn must be a function");const i=e=>new Uint8Array(e),o=Uint8Array.of(),a=Uint8Array.of(0),s=Uint8Array.of(1);let c=i(e),h=i(e),l=0;const f=()=>{c.fill(1),h.fill(0),l=0},p=(...e)=>r(h,u(c,...e)),d=(e=o)=>{h=p(a,e),c=p(),0!==e.length&&(h=p(s,e),c=p())},g=()=>{if(l++>=1e3)throw new Error("drbg: tried max amount of iterations");let e=0;const r=[];for(;e<t;){c=p();const t=c.slice();r.push(t),e+=c.length}return u(...r)};return(e,t)=>{let r;for(f(),d(e);void 0===(r=t(g()));)d();return f(),r}}(i.outputLen,d.BYTES,f)(c,h).toBytes(s.format)},verify:function(t,r,i,n={}){const{lowS:a,prehash:s,format:u}=ye(n,E);if(i=o(i,void 0,"publicKey"),r=L(r,s),!h(t)){throw new Error("verify expects Uint8Array signature"+(t instanceof M?", use sig.toBytes()":""))}R(t,u);try{const n=M.fromBytes(t,u),o=e.fromBytes(i);if(a&&n.hasHighS())return!1;const{r:s,s:c}=n,h=C(r),l=d.inv(c),f=d.create(h*l),p=d.create(s*l),g=e.BASE.multiplyUnsafe(f).add(o.multiplyUnsafe(p));if(g.is0())return!1;return d.create(g.x)===s}catch(e){return!1}},recoverPublicKey:function(e,t,r={}){const{prehash:i}=ye(r,E);return t=L(t,i),M.fromBytes(e,"recovered").recoverPublicKey(t).toBytes()},Signature:M,hash:i})}
|
|
44
44
|
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
45
|
-
const Te={p:BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),n:BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),h:BigInt(1),a:BigInt(0),b:BigInt(7),Gx:BigInt("0x79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798"),Gy:BigInt("0x483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8")},Re={beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),basises:[[BigInt("0x3086d221a7d46bcde86c90e49284eb15"),-BigInt("0xe4437ed6010e88286f547fa90abfe4c3")],[BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),BigInt("0x3086d221a7d46bcde86c90e49284eb15")]]},Me=BigInt(2);const Be=J(Te.p,{sqrt:function(e){const t=Te.p,r=BigInt(3),i=BigInt(6),n=BigInt(11),o=BigInt(22),a=BigInt(23),s=BigInt(44),u=BigInt(88),c=e*e*e%t,h=c*c*e%t,l=U(h,r,t)*h%t,f=U(l,r,t)*h%t,p=U(f,Me,t)*c%t,d=U(p,n,t)*p%t,g=U(d,o,t)*d%t,m=U(g,s,t)*g%t,y=U(m,u,t)*m%t,v=U(y,s,t)*g%t,b=U(v,r,t)*h%t,_=U(b,a,t)*d%t,w=U(_,i,t)*c%t,S=U(w,Me,t);if(!Be.eql(Be.sqr(S),e))throw new Error("Cannot find square root");return S}}),Ce=Oe(Te,{Fp:Be,endo:Re}),Ne=Pe(Ce,i.sha256)},7474(e,t,r){"use strict";r.d(t,{hmac:()=>o});var i=r(508);class n{oHash;iHash;blockLen;outputLen;canXOF=!1;finished=!1;destroyed=!1;constructor(e,t){if((0,i.sd)(e),(0,i.DO)(t,void 0,"key"),this.iHash=e.create(),"function"!=typeof this.iHash.update)throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const r=this.blockLen,n=new Uint8Array(r);n.set(t.length>r?e.create().update(t).digest():t);for(let e=0;e<n.length;e++)n[e]^=54;this.iHash.update(n),this.oHash=e.create();for(let e=0;e<n.length;e++)n[e]^=106;this.oHash.update(n),(0,i.uH)(n)}update(e){return(0,i.CC)(this),this.iHash.update(e),this}digestInto(e){(0,i.CC)(this),(0,i.Ht)(e,this),this.finished=!0;const t=e.subarray(0,this.outputLen);this.iHash.digestInto(t),this.oHash.update(t),this.oHash.digestInto(t),this.destroy()}digest(){const e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||=Object.create(Object.getPrototypeOf(this),{});const{oHash:t,iHash:r,finished:i,destroyed:n,blockLen:o,outputLen:a}=this;return e.finished=i,e.destroyed=n,e.blockLen=o,e.outputLen=a,e.oHash=t._cloneInto(e.oHash),e.iHash=r._cloneInto(e.iHash),e}clone(){return this._cloneInto()}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}const o=(()=>{const e=(e,t,r)=>new n(e,t).update(r).digest();return e.create=(e,t)=>new n(e,t),e})()},4544(e,t,r){"use strict";r.d(t,{sha256:()=>L,sha512:()=>j});var i=r(508);function n(e,t,r){return e&t^~e&r}function o(e,t,r){return e&t^e&r^t&r}class a{blockLen;outputLen;canXOF=!1;padOffset;isLE;buffer;view;finished=!1;length=0;pos=0;destroyed=!1;constructor(e,t,r,n){this.blockLen=e,this.outputLen=t,this.padOffset=r,this.isLE=n,this.buffer=new Uint8Array(e),this.view=(0,i.O8)(this.buffer)}update(e){(0,i.CC)(this),(0,i.DO)(e);const{view:t,buffer:r,blockLen:n}=this,o=e.length;for(let a=0;a<o;){const s=Math.min(n-this.pos,o-a);if(s===n){const t=(0,i.O8)(e);for(;n<=o-a;a+=n)this.process(t,a);continue}r.set(e.subarray(a,a+s),this.pos),this.pos+=s,a+=s,this.pos===n&&(this.process(t,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){(0,i.CC)(this),(0,i.Ht)(e,this),this.finished=!0;const{buffer:t,view:r,blockLen:n,isLE:o}=this;let{pos:a}=this;t[a++]=128,(0,i.uH)(this.buffer.subarray(a)),this.padOffset>n-a&&(this.process(r,0),a=0);for(let e=a;e<n;e++)t[e]=0;r.setBigUint64(n-8,BigInt(8*this.length),o),this.process(r,0);const s=(0,i.O8)(e),u=this.outputLen;if(u%4)throw new Error("_sha2: outputLen must be aligned to 32bit");const c=u/4,h=this.get();if(c>h.length)throw new Error("_sha2: outputLen bigger than state");for(let e=0;e<c;e++)s.setUint32(4*e,h[e],o)}digest(){const{buffer:e,outputLen:t}=this;this.digestInto(e);const r=e.slice(0,t);return this.destroy(),r}_cloneInto(e){e||=new this.constructor,e.set(...this.get());const{blockLen:t,buffer:r,length:i,finished:n,destroyed:o,pos:a}=this;return e.destroyed=o,e.finished=n,e.length=i,e.pos=a,i%t&&e.buffer.set(r),e}clone(){return this._cloneInto()}}const s=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),u=Uint32Array.from([1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209]),c=BigInt(2**32-1),h=BigInt(32);function l(e,t=!1){return t?{h:Number(e&c),l:Number(e>>h&c)}:{h:0|Number(e>>h&c),l:0|Number(e&c)}}function f(e,t=!1){const r=e.length;let i=new Uint32Array(r),n=new Uint32Array(r);for(let o=0;o<r;o++){const{h:r,l:a}=l(e[o],t);[i[o],n[o]]=[r,a]}return[i,n]}const p=(e,t,r)=>e>>>r,d=(e,t,r)=>e<<32-r|t>>>r,g=(e,t,r)=>e>>>r|t<<32-r,m=(e,t,r)=>e<<32-r|t>>>r,y=(e,t,r)=>e<<64-r|t>>>r-32,v=(e,t,r)=>e>>>r-32|t<<64-r;function b(e,t,r,i){const n=(t>>>0)+(i>>>0);return{h:e+r+(n/2**32|0)|0,l:0|n}}const _=(e,t,r)=>(e>>>0)+(t>>>0)+(r>>>0),w=(e,t,r,i)=>t+r+i+(e/2**32|0)|0,S=(e,t,r,i)=>(e>>>0)+(t>>>0)+(r>>>0)+(i>>>0),E=(e,t,r,i,n)=>t+r+i+n+(e/2**32|0)|0,k=(e,t,r,i,n)=>(e>>>0)+(t>>>0)+(r>>>0)+(i>>>0)+(n>>>0),O=(e,t,r,i,n,o)=>t+r+i+n+o+(e/2**32|0)|0;const I=Uint32Array.from([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 Uint32Array(64);class x extends a{constructor(e){super(64,e,8,!1)}get(){const{A:e,B:t,C:r,D:i,E:n,F:o,G:a,H:s}=this;return[e,t,r,i,n,o,a,s]}set(e,t,r,i,n,o,a,s){this.A=0|e,this.B=0|t,this.C=0|r,this.D=0|i,this.E=0|n,this.F=0|o,this.G=0|a,this.H=0|s}process(e,t){for(let r=0;r<16;r++,t+=4)A[r]=e.getUint32(t,!1);for(let e=16;e<64;e++){const t=A[e-15],r=A[e-2],n=(0,i.Ow)(t,7)^(0,i.Ow)(t,18)^t>>>3,o=(0,i.Ow)(r,17)^(0,i.Ow)(r,19)^r>>>10;A[e]=o+A[e-7]+n+A[e-16]|0}let{A:r,B:a,C:s,D:u,E:c,F:h,G:l,H:f}=this;for(let e=0;e<64;e++){const t=f+((0,i.Ow)(c,6)^(0,i.Ow)(c,11)^(0,i.Ow)(c,25))+n(c,h,l)+I[e]+A[e]|0,p=((0,i.Ow)(r,2)^(0,i.Ow)(r,13)^(0,i.Ow)(r,22))+o(r,a,s)|0;f=l,l=h,h=c,c=u+t|0,u=s,s=a,a=r,r=t+p|0}r=r+this.A|0,a=a+this.B|0,s=s+this.C|0,u=u+this.D|0,c=c+this.E|0,h=h+this.F|0,l=l+this.G|0,f=f+this.H|0,this.set(r,a,s,u,c,h,l,f)}roundClean(){(0,i.uH)(A)}destroy(){this.destroyed=!0,this.set(0,0,0,0,0,0,0,0),(0,i.uH)(this.buffer)}}class P extends x{A=0|s[0];B=0|s[1];C=0|s[2];D=0|s[3];E=0|s[4];F=0|s[5];G=0|s[6];H=0|s[7];constructor(){super(32)}}const T=(()=>f(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(e=>BigInt(e))))(),R=(()=>T[0])(),M=(()=>T[1])(),B=new Uint32Array(80),C=new Uint32Array(80);class N extends a{constructor(e){super(128,e,16,!1)}get(){const{Ah:e,Al:t,Bh:r,Bl:i,Ch:n,Cl:o,Dh:a,Dl:s,Eh:u,El:c,Fh:h,Fl:l,Gh:f,Gl:p,Hh:d,Hl:g}=this;return[e,t,r,i,n,o,a,s,u,c,h,l,f,p,d,g]}set(e,t,r,i,n,o,a,s,u,c,h,l,f,p,d,g){this.Ah=0|e,this.Al=0|t,this.Bh=0|r,this.Bl=0|i,this.Ch=0|n,this.Cl=0|o,this.Dh=0|a,this.Dl=0|s,this.Eh=0|u,this.El=0|c,this.Fh=0|h,this.Fl=0|l,this.Gh=0|f,this.Gl=0|p,this.Hh=0|d,this.Hl=0|g}process(e,t){for(let r=0;r<16;r++,t+=4)B[r]=e.getUint32(t),C[r]=e.getUint32(t+=4);for(let e=16;e<80;e++){const t=0|B[e-15],r=0|C[e-15],i=g(t,r,1)^g(t,r,8)^p(t,0,7),n=m(t,r,1)^m(t,r,8)^d(t,r,7),o=0|B[e-2],a=0|C[e-2],s=g(o,a,19)^y(o,a,61)^p(o,0,6),u=m(o,a,19)^v(o,a,61)^d(o,a,6),c=S(n,u,C[e-7],C[e-16]),h=E(c,i,s,B[e-7],B[e-16]);B[e]=0|h,C[e]=0|c}let{Ah:r,Al:i,Bh:n,Bl:o,Ch:a,Cl:s,Dh:u,Dl:c,Eh:h,El:l,Fh:f,Fl:I,Gh:A,Gl:x,Hh:P,Hl:T}=this;for(let e=0;e<80;e++){const t=g(h,l,14)^g(h,l,18)^y(h,l,41),p=m(h,l,14)^m(h,l,18)^v(h,l,41),d=h&f^~h&A,S=k(T,p,l&I^~l&x,M[e],C[e]),E=O(S,P,t,d,R[e],B[e]),N=0|S,D=g(r,i,28)^y(r,i,34)^y(r,i,39),L=m(r,i,28)^v(r,i,34)^v(r,i,39),j=r&n^r&a^n&a,U=i&o^i&s^o&s;P=0|A,T=0|x,A=0|f,x=0|I,f=0|h,I=0|l,({h,l}=b(0|u,0|c,0|E,0|N)),u=0|a,c=0|s,a=0|n,s=0|o,n=0|r,o=0|i;const H=_(N,L,U);r=w(H,E,D,j),i=0|H}({h:r,l:i}=b(0|this.Ah,0|this.Al,0|r,0|i)),({h:n,l:o}=b(0|this.Bh,0|this.Bl,0|n,0|o)),({h:a,l:s}=b(0|this.Ch,0|this.Cl,0|a,0|s)),({h:u,l:c}=b(0|this.Dh,0|this.Dl,0|u,0|c)),({h,l}=b(0|this.Eh,0|this.El,0|h,0|l)),({h:f,l:I}=b(0|this.Fh,0|this.Fl,0|f,0|I)),({h:A,l:x}=b(0|this.Gh,0|this.Gl,0|A,0|x)),({h:P,l:T}=b(0|this.Hh,0|this.Hl,0|P,0|T)),this.set(r,i,n,o,a,s,u,c,h,l,f,I,A,x,P,T)}roundClean(){(0,i.uH)(B,C)}destroy(){this.destroyed=!0,(0,i.uH)(this.buffer),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}class D extends N{Ah=0|u[0];Al=0|u[1];Bh=0|u[2];Bl=0|u[3];Ch=0|u[4];Cl=0|u[5];Dh=0|u[6];Dl=0|u[7];Eh=0|u[8];El=0|u[9];Fh=0|u[10];Fl=0|u[11];Gh=0|u[12];Gl=0|u[13];Hh=0|u[14];Hl=0|u[15];constructor(){super(64)}}const L=(0,i.qj)(()=>new P,(0,i.nx)(1)),j=(0,i.qj)(()=>new D,(0,i.nx)(3))},508(e,t,r){"use strict";function i(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&"Uint8Array"===e.constructor.name&&"BYTES_PER_ELEMENT"in e&&1===e.BYTES_PER_ELEMENT}function n(e,t=""){if("number"!=typeof e){throw new TypeError(`${t&&`"${t}" `}expected number, got ${typeof e}`)}if(!Number.isSafeInteger(e)||e<0){throw new RangeError(`${t&&`"${t}" `}expected integer >= 0, got ${e}`)}}function o(e,t,r=""){const n=i(e),o=e?.length,a=void 0!==t;if(!n||a&&o!==t){const i=(r&&`"${r}" `)+"expected Uint8Array"+(a?` of length ${t}`:"")+", got "+(n?`length=${o}`:"type="+typeof e);if(!n)throw new TypeError(i);throw new RangeError(i)}return e}function a(e){if("function"!=typeof e||"function"!=typeof e.create)throw new TypeError("Hash must wrapped by utils.createHasher");if(n(e.outputLen),n(e.blockLen),e.outputLen<1)throw new Error('"outputLen" must be >= 1');if(e.blockLen<1)throw new Error('"blockLen" must be >= 1')}function s(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function u(e,t){o(e,void 0,"digestInto() output");const r=t.outputLen;if(e.length<r)throw new RangeError('"digestInto() output" expected to be of length >='+r)}function c(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function h(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function l(e,t){return e<<32-t|e>>>t}r.d(t,{CC:()=>s,DO:()=>o,Fe:()=>n,Ht:()=>u,Id:()=>E,My:()=>d,O8:()=>h,Ow:()=>l,aT:()=>S,aY:()=>i,nx:()=>I,po:()=>O,qj:()=>k,sd:()=>a,uH:()=>c});const f=(()=>"function"==typeof Uint8Array.from([]).toHex&&"function"==typeof Uint8Array.fromHex)(),p=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function d(e){if(o(e),f)return e.toHex();let t="";for(let r=0;r<e.length;r++)t+=p[e[r]];return t}const g=48,m=57,y=65,v=70,b=97,_=102;function w(e){return e>=g&&e<=m?e-g:e>=y&&e<=v?e-(y-10):e>=b&&e<=_?e-(b-10):void 0}function S(e){if("string"!=typeof e)throw new TypeError("hex string expected, got "+typeof e);if(f)try{return Uint8Array.fromHex(e)}catch(e){if(e instanceof SyntaxError)throw new RangeError(e.message);throw e}const t=e.length,r=t/2;if(t%2)throw new RangeError("hex string expected, got unpadded hex of length "+t);const i=new Uint8Array(r);for(let t=0,n=0;t<r;t++,n+=2){const r=w(e.charCodeAt(n)),o=w(e.charCodeAt(n+1));if(void 0===r||void 0===o){const t=e[n]+e[n+1];throw new RangeError('hex string expected, got non-hex character "'+t+'" at index '+n)}i[t]=16*r+o}return i}function E(...e){let t=0;for(let r=0;r<e.length;r++){const i=e[r];o(i),t+=i.length}const r=new Uint8Array(t);for(let t=0,i=0;t<e.length;t++){const n=e[t];r.set(n,i),i+=n.length}return r}function k(e,t={}){const r=(t,r)=>e(r).update(t).digest(),i=e(void 0);return r.outputLen=i.outputLen,r.blockLen=i.blockLen,r.canXOF=i.canXOF,r.create=t=>e(t),Object.assign(r,t),Object.freeze(r)}function O(e=32){n(e,"bytesLength");const t="object"==typeof globalThis?globalThis.crypto:null;if("function"!=typeof t?.getRandomValues)throw new Error("crypto.getRandomValues must be defined");if(e>65536)throw new RangeError(`"bytesLength" expected <= 65536, got ${e}`);return t.getRandomValues(new Uint8Array(e))}const I=e=>({oid:Uint8Array.from([6,9,96,134,72,1,101,3,4,2,e])})},9294(e,t,r){"use strict";r.d(t,{c:()=>i});var i=r(4233)},3219(e){"use strict";e.exports=JSON.parse('{"aes-128-ecb":{"cipher":"AES","key":128,"iv":0,"mode":"ECB","type":"block"},"aes-192-ecb":{"cipher":"AES","key":192,"iv":0,"mode":"ECB","type":"block"},"aes-256-ecb":{"cipher":"AES","key":256,"iv":0,"mode":"ECB","type":"block"},"aes-128-cbc":{"cipher":"AES","key":128,"iv":16,"mode":"CBC","type":"block"},"aes-192-cbc":{"cipher":"AES","key":192,"iv":16,"mode":"CBC","type":"block"},"aes-256-cbc":{"cipher":"AES","key":256,"iv":16,"mode":"CBC","type":"block"},"aes128":{"cipher":"AES","key":128,"iv":16,"mode":"CBC","type":"block"},"aes192":{"cipher":"AES","key":192,"iv":16,"mode":"CBC","type":"block"},"aes256":{"cipher":"AES","key":256,"iv":16,"mode":"CBC","type":"block"},"aes-128-cfb":{"cipher":"AES","key":128,"iv":16,"mode":"CFB","type":"stream"},"aes-192-cfb":{"cipher":"AES","key":192,"iv":16,"mode":"CFB","type":"stream"},"aes-256-cfb":{"cipher":"AES","key":256,"iv":16,"mode":"CFB","type":"stream"},"aes-128-cfb8":{"cipher":"AES","key":128,"iv":16,"mode":"CFB8","type":"stream"},"aes-192-cfb8":{"cipher":"AES","key":192,"iv":16,"mode":"CFB8","type":"stream"},"aes-256-cfb8":{"cipher":"AES","key":256,"iv":16,"mode":"CFB8","type":"stream"},"aes-128-cfb1":{"cipher":"AES","key":128,"iv":16,"mode":"CFB1","type":"stream"},"aes-192-cfb1":{"cipher":"AES","key":192,"iv":16,"mode":"CFB1","type":"stream"},"aes-256-cfb1":{"cipher":"AES","key":256,"iv":16,"mode":"CFB1","type":"stream"},"aes-128-ofb":{"cipher":"AES","key":128,"iv":16,"mode":"OFB","type":"stream"},"aes-192-ofb":{"cipher":"AES","key":192,"iv":16,"mode":"OFB","type":"stream"},"aes-256-ofb":{"cipher":"AES","key":256,"iv":16,"mode":"OFB","type":"stream"},"aes-128-ctr":{"cipher":"AES","key":128,"iv":16,"mode":"CTR","type":"stream"},"aes-192-ctr":{"cipher":"AES","key":192,"iv":16,"mode":"CTR","type":"stream"},"aes-256-ctr":{"cipher":"AES","key":256,"iv":16,"mode":"CTR","type":"stream"},"aes-128-gcm":{"cipher":"AES","key":128,"iv":12,"mode":"GCM","type":"auth"},"aes-192-gcm":{"cipher":"AES","key":192,"iv":12,"mode":"GCM","type":"auth"},"aes-256-gcm":{"cipher":"AES","key":256,"iv":12,"mode":"GCM","type":"auth"}}')},3241(e){"use strict";e.exports=JSON.parse('{"modp1":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a3620ffffffffffffffff"},"modp2":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece65381ffffffffffffffff"},"modp5":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca237327ffffffffffffffff"},"modp14":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aacaa68ffffffffffffffff"},"modp15":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a93ad2caffffffffffffffff"},"modp16":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c934063199ffffffffffffffff"},"modp17":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dcc4024ffffffffffffffff"},"modp18":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dbe115974a3926f12fee5e438777cb6a932df8cd8bec4d073b931ba3bc832b68d9dd300741fa7bf8afc47ed2576f6936ba424663aab639c5ae4f5683423b4742bf1c978238f16cbe39d652de3fdb8befc848ad922222e04a4037c0713eb57a81a23f0c73473fc646cea306b4bcbc8862f8385ddfa9d4b7fa2c087e879683303ed5bdd3a062b3cf5b3a278a66d2a13f83f44f82ddf310ee074ab6a364597e899a0255dc164f31cc50846851df9ab48195ded7ea1b1d510bd7ee74d73faf36bc31ecfa268359046f4eb879f924009438b481c6cd7889a002ed5ee382bc9190da6fc026e479558e4475677e9aa9e3050e2765694dfc81f56e880b96e7160c980dd98edd3dfffffffffffffffff"}}')},5579(e){"use strict";e.exports=JSON.parse('{"2.16.840.1.101.3.4.1.1":"aes-128-ecb","2.16.840.1.101.3.4.1.2":"aes-128-cbc","2.16.840.1.101.3.4.1.3":"aes-128-ofb","2.16.840.1.101.3.4.1.4":"aes-128-cfb","2.16.840.1.101.3.4.1.21":"aes-192-ecb","2.16.840.1.101.3.4.1.22":"aes-192-cbc","2.16.840.1.101.3.4.1.23":"aes-192-ofb","2.16.840.1.101.3.4.1.24":"aes-192-cfb","2.16.840.1.101.3.4.1.41":"aes-256-ecb","2.16.840.1.101.3.4.1.42":"aes-256-cbc","2.16.840.1.101.3.4.1.43":"aes-256-ofb","2.16.840.1.101.3.4.1.44":"aes-256-cfb"}')},8330(e){"use strict";e.exports={rE:"5.4.1"}}},__webpack_module_cache__={};function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var r=__webpack_module_cache__[e]={id:e,loaded:!1,exports:{}};return __webpack_modules__[e].call(r.exports,r,r.exports,__webpack_require__),r.loaded=!0,r.exports}__webpack_require__.c=__webpack_module_cache__,__webpack_require__.d=(e,t)=>{for(var r in t)__webpack_require__.o(t,r)&&!__webpack_require__.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),__webpack_require__.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);var __webpack_exports__=__webpack_require__(__webpack_require__.s=9272);return __webpack_exports__})());
|
|
45
|
+
const Te={p:BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),n:BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),h:BigInt(1),a:BigInt(0),b:BigInt(7),Gx:BigInt("0x79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798"),Gy:BigInt("0x483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8")},Re={beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),basises:[[BigInt("0x3086d221a7d46bcde86c90e49284eb15"),-BigInt("0xe4437ed6010e88286f547fa90abfe4c3")],[BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),BigInt("0x3086d221a7d46bcde86c90e49284eb15")]]},Me=BigInt(2);const Be=J(Te.p,{sqrt:function(e){const t=Te.p,r=BigInt(3),i=BigInt(6),n=BigInt(11),o=BigInt(22),a=BigInt(23),s=BigInt(44),u=BigInt(88),c=e*e*e%t,h=c*c*e%t,l=U(h,r,t)*h%t,f=U(l,r,t)*h%t,p=U(f,Me,t)*c%t,d=U(p,n,t)*p%t,g=U(d,o,t)*d%t,m=U(g,s,t)*g%t,y=U(m,u,t)*m%t,v=U(y,s,t)*g%t,b=U(v,r,t)*h%t,_=U(b,a,t)*d%t,w=U(_,i,t)*c%t,S=U(w,Me,t);if(!Be.eql(Be.sqr(S),e))throw new Error("Cannot find square root");return S}}),Ce=Oe(Te,{Fp:Be,endo:Re}),Ne=Pe(Ce,i.sha256)},7474(e,t,r){"use strict";r.d(t,{hmac:()=>o});var i=r(508);class n{oHash;iHash;blockLen;outputLen;canXOF=!1;finished=!1;destroyed=!1;constructor(e,t){if((0,i.sd)(e),(0,i.DO)(t,void 0,"key"),this.iHash=e.create(),"function"!=typeof this.iHash.update)throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const r=this.blockLen,n=new Uint8Array(r);n.set(t.length>r?e.create().update(t).digest():t);for(let e=0;e<n.length;e++)n[e]^=54;this.iHash.update(n),this.oHash=e.create();for(let e=0;e<n.length;e++)n[e]^=106;this.oHash.update(n),(0,i.uH)(n)}update(e){return(0,i.CC)(this),this.iHash.update(e),this}digestInto(e){(0,i.CC)(this),(0,i.Ht)(e,this),this.finished=!0;const t=e.subarray(0,this.outputLen);this.iHash.digestInto(t),this.oHash.update(t),this.oHash.digestInto(t),this.destroy()}digest(){const e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||=Object.create(Object.getPrototypeOf(this),{});const{oHash:t,iHash:r,finished:i,destroyed:n,blockLen:o,outputLen:a}=this;return e.finished=i,e.destroyed=n,e.blockLen=o,e.outputLen=a,e.oHash=t._cloneInto(e.oHash),e.iHash=r._cloneInto(e.iHash),e}clone(){return this._cloneInto()}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}const o=(()=>{const e=(e,t,r)=>new n(e,t).update(r).digest();return e.create=(e,t)=>new n(e,t),e})()},4544(e,t,r){"use strict";r.d(t,{sha256:()=>L,sha512:()=>j});var i=r(508);function n(e,t,r){return e&t^~e&r}function o(e,t,r){return e&t^e&r^t&r}class a{blockLen;outputLen;canXOF=!1;padOffset;isLE;buffer;view;finished=!1;length=0;pos=0;destroyed=!1;constructor(e,t,r,n){this.blockLen=e,this.outputLen=t,this.padOffset=r,this.isLE=n,this.buffer=new Uint8Array(e),this.view=(0,i.O8)(this.buffer)}update(e){(0,i.CC)(this),(0,i.DO)(e);const{view:t,buffer:r,blockLen:n}=this,o=e.length;for(let a=0;a<o;){const s=Math.min(n-this.pos,o-a);if(s===n){const t=(0,i.O8)(e);for(;n<=o-a;a+=n)this.process(t,a);continue}r.set(e.subarray(a,a+s),this.pos),this.pos+=s,a+=s,this.pos===n&&(this.process(t,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){(0,i.CC)(this),(0,i.Ht)(e,this),this.finished=!0;const{buffer:t,view:r,blockLen:n,isLE:o}=this;let{pos:a}=this;t[a++]=128,(0,i.uH)(this.buffer.subarray(a)),this.padOffset>n-a&&(this.process(r,0),a=0);for(let e=a;e<n;e++)t[e]=0;r.setBigUint64(n-8,BigInt(8*this.length),o),this.process(r,0);const s=(0,i.O8)(e),u=this.outputLen;if(u%4)throw new Error("_sha2: outputLen must be aligned to 32bit");const c=u/4,h=this.get();if(c>h.length)throw new Error("_sha2: outputLen bigger than state");for(let e=0;e<c;e++)s.setUint32(4*e,h[e],o)}digest(){const{buffer:e,outputLen:t}=this;this.digestInto(e);const r=e.slice(0,t);return this.destroy(),r}_cloneInto(e){e||=new this.constructor,e.set(...this.get());const{blockLen:t,buffer:r,length:i,finished:n,destroyed:o,pos:a}=this;return e.destroyed=o,e.finished=n,e.length=i,e.pos=a,i%t&&e.buffer.set(r),e}clone(){return this._cloneInto()}}const s=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),u=Uint32Array.from([1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209]),c=BigInt(2**32-1),h=BigInt(32);function l(e,t=!1){return t?{h:Number(e&c),l:Number(e>>h&c)}:{h:0|Number(e>>h&c),l:0|Number(e&c)}}function f(e,t=!1){const r=e.length;let i=new Uint32Array(r),n=new Uint32Array(r);for(let o=0;o<r;o++){const{h:r,l:a}=l(e[o],t);[i[o],n[o]]=[r,a]}return[i,n]}const p=(e,t,r)=>e>>>r,d=(e,t,r)=>e<<32-r|t>>>r,g=(e,t,r)=>e>>>r|t<<32-r,m=(e,t,r)=>e<<32-r|t>>>r,y=(e,t,r)=>e<<64-r|t>>>r-32,v=(e,t,r)=>e>>>r-32|t<<64-r;function b(e,t,r,i){const n=(t>>>0)+(i>>>0);return{h:e+r+(n/2**32|0)|0,l:0|n}}const _=(e,t,r)=>(e>>>0)+(t>>>0)+(r>>>0),w=(e,t,r,i)=>t+r+i+(e/2**32|0)|0,S=(e,t,r,i)=>(e>>>0)+(t>>>0)+(r>>>0)+(i>>>0),E=(e,t,r,i,n)=>t+r+i+n+(e/2**32|0)|0,k=(e,t,r,i,n)=>(e>>>0)+(t>>>0)+(r>>>0)+(i>>>0)+(n>>>0),O=(e,t,r,i,n,o)=>t+r+i+n+o+(e/2**32|0)|0;const I=Uint32Array.from([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 Uint32Array(64);class x extends a{constructor(e){super(64,e,8,!1)}get(){const{A:e,B:t,C:r,D:i,E:n,F:o,G:a,H:s}=this;return[e,t,r,i,n,o,a,s]}set(e,t,r,i,n,o,a,s){this.A=0|e,this.B=0|t,this.C=0|r,this.D=0|i,this.E=0|n,this.F=0|o,this.G=0|a,this.H=0|s}process(e,t){for(let r=0;r<16;r++,t+=4)A[r]=e.getUint32(t,!1);for(let e=16;e<64;e++){const t=A[e-15],r=A[e-2],n=(0,i.Ow)(t,7)^(0,i.Ow)(t,18)^t>>>3,o=(0,i.Ow)(r,17)^(0,i.Ow)(r,19)^r>>>10;A[e]=o+A[e-7]+n+A[e-16]|0}let{A:r,B:a,C:s,D:u,E:c,F:h,G:l,H:f}=this;for(let e=0;e<64;e++){const t=f+((0,i.Ow)(c,6)^(0,i.Ow)(c,11)^(0,i.Ow)(c,25))+n(c,h,l)+I[e]+A[e]|0,p=((0,i.Ow)(r,2)^(0,i.Ow)(r,13)^(0,i.Ow)(r,22))+o(r,a,s)|0;f=l,l=h,h=c,c=u+t|0,u=s,s=a,a=r,r=t+p|0}r=r+this.A|0,a=a+this.B|0,s=s+this.C|0,u=u+this.D|0,c=c+this.E|0,h=h+this.F|0,l=l+this.G|0,f=f+this.H|0,this.set(r,a,s,u,c,h,l,f)}roundClean(){(0,i.uH)(A)}destroy(){this.destroyed=!0,this.set(0,0,0,0,0,0,0,0),(0,i.uH)(this.buffer)}}class P extends x{A=0|s[0];B=0|s[1];C=0|s[2];D=0|s[3];E=0|s[4];F=0|s[5];G=0|s[6];H=0|s[7];constructor(){super(32)}}const T=(()=>f(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(e=>BigInt(e))))(),R=(()=>T[0])(),M=(()=>T[1])(),B=new Uint32Array(80),C=new Uint32Array(80);class N extends a{constructor(e){super(128,e,16,!1)}get(){const{Ah:e,Al:t,Bh:r,Bl:i,Ch:n,Cl:o,Dh:a,Dl:s,Eh:u,El:c,Fh:h,Fl:l,Gh:f,Gl:p,Hh:d,Hl:g}=this;return[e,t,r,i,n,o,a,s,u,c,h,l,f,p,d,g]}set(e,t,r,i,n,o,a,s,u,c,h,l,f,p,d,g){this.Ah=0|e,this.Al=0|t,this.Bh=0|r,this.Bl=0|i,this.Ch=0|n,this.Cl=0|o,this.Dh=0|a,this.Dl=0|s,this.Eh=0|u,this.El=0|c,this.Fh=0|h,this.Fl=0|l,this.Gh=0|f,this.Gl=0|p,this.Hh=0|d,this.Hl=0|g}process(e,t){for(let r=0;r<16;r++,t+=4)B[r]=e.getUint32(t),C[r]=e.getUint32(t+=4);for(let e=16;e<80;e++){const t=0|B[e-15],r=0|C[e-15],i=g(t,r,1)^g(t,r,8)^p(t,0,7),n=m(t,r,1)^m(t,r,8)^d(t,r,7),o=0|B[e-2],a=0|C[e-2],s=g(o,a,19)^y(o,a,61)^p(o,0,6),u=m(o,a,19)^v(o,a,61)^d(o,a,6),c=S(n,u,C[e-7],C[e-16]),h=E(c,i,s,B[e-7],B[e-16]);B[e]=0|h,C[e]=0|c}let{Ah:r,Al:i,Bh:n,Bl:o,Ch:a,Cl:s,Dh:u,Dl:c,Eh:h,El:l,Fh:f,Fl:I,Gh:A,Gl:x,Hh:P,Hl:T}=this;for(let e=0;e<80;e++){const t=g(h,l,14)^g(h,l,18)^y(h,l,41),p=m(h,l,14)^m(h,l,18)^v(h,l,41),d=h&f^~h&A,S=k(T,p,l&I^~l&x,M[e],C[e]),E=O(S,P,t,d,R[e],B[e]),N=0|S,D=g(r,i,28)^y(r,i,34)^y(r,i,39),L=m(r,i,28)^v(r,i,34)^v(r,i,39),j=r&n^r&a^n&a,U=i&o^i&s^o&s;P=0|A,T=0|x,A=0|f,x=0|I,f=0|h,I=0|l,({h,l}=b(0|u,0|c,0|E,0|N)),u=0|a,c=0|s,a=0|n,s=0|o,n=0|r,o=0|i;const H=_(N,L,U);r=w(H,E,D,j),i=0|H}({h:r,l:i}=b(0|this.Ah,0|this.Al,0|r,0|i)),({h:n,l:o}=b(0|this.Bh,0|this.Bl,0|n,0|o)),({h:a,l:s}=b(0|this.Ch,0|this.Cl,0|a,0|s)),({h:u,l:c}=b(0|this.Dh,0|this.Dl,0|u,0|c)),({h,l}=b(0|this.Eh,0|this.El,0|h,0|l)),({h:f,l:I}=b(0|this.Fh,0|this.Fl,0|f,0|I)),({h:A,l:x}=b(0|this.Gh,0|this.Gl,0|A,0|x)),({h:P,l:T}=b(0|this.Hh,0|this.Hl,0|P,0|T)),this.set(r,i,n,o,a,s,u,c,h,l,f,I,A,x,P,T)}roundClean(){(0,i.uH)(B,C)}destroy(){this.destroyed=!0,(0,i.uH)(this.buffer),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}class D extends N{Ah=0|u[0];Al=0|u[1];Bh=0|u[2];Bl=0|u[3];Ch=0|u[4];Cl=0|u[5];Dh=0|u[6];Dl=0|u[7];Eh=0|u[8];El=0|u[9];Fh=0|u[10];Fl=0|u[11];Gh=0|u[12];Gl=0|u[13];Hh=0|u[14];Hl=0|u[15];constructor(){super(64)}}const L=(0,i.qj)(()=>new P,(0,i.nx)(1)),j=(0,i.qj)(()=>new D,(0,i.nx)(3))},508(e,t,r){"use strict";function i(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&"Uint8Array"===e.constructor.name&&"BYTES_PER_ELEMENT"in e&&1===e.BYTES_PER_ELEMENT}function n(e,t=""){if("number"!=typeof e){throw new TypeError(`${t&&`"${t}" `}expected number, got ${typeof e}`)}if(!Number.isSafeInteger(e)||e<0){throw new RangeError(`${t&&`"${t}" `}expected integer >= 0, got ${e}`)}}function o(e,t,r=""){const n=i(e),o=e?.length,a=void 0!==t;if(!n||a&&o!==t){const i=(r&&`"${r}" `)+"expected Uint8Array"+(a?` of length ${t}`:"")+", got "+(n?`length=${o}`:"type="+typeof e);if(!n)throw new TypeError(i);throw new RangeError(i)}return e}function a(e){if("function"!=typeof e||"function"!=typeof e.create)throw new TypeError("Hash must wrapped by utils.createHasher");if(n(e.outputLen),n(e.blockLen),e.outputLen<1)throw new Error('"outputLen" must be >= 1');if(e.blockLen<1)throw new Error('"blockLen" must be >= 1')}function s(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function u(e,t){o(e,void 0,"digestInto() output");const r=t.outputLen;if(e.length<r)throw new RangeError('"digestInto() output" expected to be of length >='+r)}function c(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function h(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function l(e,t){return e<<32-t|e>>>t}r.d(t,{CC:()=>s,DO:()=>o,Fe:()=>n,Ht:()=>u,Id:()=>E,My:()=>d,O8:()=>h,Ow:()=>l,aT:()=>S,aY:()=>i,nx:()=>I,po:()=>O,qj:()=>k,sd:()=>a,uH:()=>c});const f=(()=>"function"==typeof Uint8Array.from([]).toHex&&"function"==typeof Uint8Array.fromHex)(),p=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function d(e){if(o(e),f)return e.toHex();let t="";for(let r=0;r<e.length;r++)t+=p[e[r]];return t}const g=48,m=57,y=65,v=70,b=97,_=102;function w(e){return e>=g&&e<=m?e-g:e>=y&&e<=v?e-(y-10):e>=b&&e<=_?e-(b-10):void 0}function S(e){if("string"!=typeof e)throw new TypeError("hex string expected, got "+typeof e);if(f)try{return Uint8Array.fromHex(e)}catch(e){if(e instanceof SyntaxError)throw new RangeError(e.message);throw e}const t=e.length,r=t/2;if(t%2)throw new RangeError("hex string expected, got unpadded hex of length "+t);const i=new Uint8Array(r);for(let t=0,n=0;t<r;t++,n+=2){const r=w(e.charCodeAt(n)),o=w(e.charCodeAt(n+1));if(void 0===r||void 0===o){const t=e[n]+e[n+1];throw new RangeError('hex string expected, got non-hex character "'+t+'" at index '+n)}i[t]=16*r+o}return i}function E(...e){let t=0;for(let r=0;r<e.length;r++){const i=e[r];o(i),t+=i.length}const r=new Uint8Array(t);for(let t=0,i=0;t<e.length;t++){const n=e[t];r.set(n,i),i+=n.length}return r}function k(e,t={}){const r=(t,r)=>e(r).update(t).digest(),i=e(void 0);return r.outputLen=i.outputLen,r.blockLen=i.blockLen,r.canXOF=i.canXOF,r.create=t=>e(t),Object.assign(r,t),Object.freeze(r)}function O(e=32){n(e,"bytesLength");const t="object"==typeof globalThis?globalThis.crypto:null;if("function"!=typeof t?.getRandomValues)throw new Error("crypto.getRandomValues must be defined");if(e>65536)throw new RangeError(`"bytesLength" expected <= 65536, got ${e}`);return t.getRandomValues(new Uint8Array(e))}const I=e=>({oid:Uint8Array.from([6,9,96,134,72,1,101,3,4,2,e])})},9294(e,t,r){"use strict";r.d(t,{c:()=>i});var i=r(4233)},3219(e){"use strict";e.exports=JSON.parse('{"aes-128-ecb":{"cipher":"AES","key":128,"iv":0,"mode":"ECB","type":"block"},"aes-192-ecb":{"cipher":"AES","key":192,"iv":0,"mode":"ECB","type":"block"},"aes-256-ecb":{"cipher":"AES","key":256,"iv":0,"mode":"ECB","type":"block"},"aes-128-cbc":{"cipher":"AES","key":128,"iv":16,"mode":"CBC","type":"block"},"aes-192-cbc":{"cipher":"AES","key":192,"iv":16,"mode":"CBC","type":"block"},"aes-256-cbc":{"cipher":"AES","key":256,"iv":16,"mode":"CBC","type":"block"},"aes128":{"cipher":"AES","key":128,"iv":16,"mode":"CBC","type":"block"},"aes192":{"cipher":"AES","key":192,"iv":16,"mode":"CBC","type":"block"},"aes256":{"cipher":"AES","key":256,"iv":16,"mode":"CBC","type":"block"},"aes-128-cfb":{"cipher":"AES","key":128,"iv":16,"mode":"CFB","type":"stream"},"aes-192-cfb":{"cipher":"AES","key":192,"iv":16,"mode":"CFB","type":"stream"},"aes-256-cfb":{"cipher":"AES","key":256,"iv":16,"mode":"CFB","type":"stream"},"aes-128-cfb8":{"cipher":"AES","key":128,"iv":16,"mode":"CFB8","type":"stream"},"aes-192-cfb8":{"cipher":"AES","key":192,"iv":16,"mode":"CFB8","type":"stream"},"aes-256-cfb8":{"cipher":"AES","key":256,"iv":16,"mode":"CFB8","type":"stream"},"aes-128-cfb1":{"cipher":"AES","key":128,"iv":16,"mode":"CFB1","type":"stream"},"aes-192-cfb1":{"cipher":"AES","key":192,"iv":16,"mode":"CFB1","type":"stream"},"aes-256-cfb1":{"cipher":"AES","key":256,"iv":16,"mode":"CFB1","type":"stream"},"aes-128-ofb":{"cipher":"AES","key":128,"iv":16,"mode":"OFB","type":"stream"},"aes-192-ofb":{"cipher":"AES","key":192,"iv":16,"mode":"OFB","type":"stream"},"aes-256-ofb":{"cipher":"AES","key":256,"iv":16,"mode":"OFB","type":"stream"},"aes-128-ctr":{"cipher":"AES","key":128,"iv":16,"mode":"CTR","type":"stream"},"aes-192-ctr":{"cipher":"AES","key":192,"iv":16,"mode":"CTR","type":"stream"},"aes-256-ctr":{"cipher":"AES","key":256,"iv":16,"mode":"CTR","type":"stream"},"aes-128-gcm":{"cipher":"AES","key":128,"iv":12,"mode":"GCM","type":"auth"},"aes-192-gcm":{"cipher":"AES","key":192,"iv":12,"mode":"GCM","type":"auth"},"aes-256-gcm":{"cipher":"AES","key":256,"iv":12,"mode":"GCM","type":"auth"}}')},3241(e){"use strict";e.exports=JSON.parse('{"modp1":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a3620ffffffffffffffff"},"modp2":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece65381ffffffffffffffff"},"modp5":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca237327ffffffffffffffff"},"modp14":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aacaa68ffffffffffffffff"},"modp15":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a93ad2caffffffffffffffff"},"modp16":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c934063199ffffffffffffffff"},"modp17":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dcc4024ffffffffffffffff"},"modp18":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dbe115974a3926f12fee5e438777cb6a932df8cd8bec4d073b931ba3bc832b68d9dd300741fa7bf8afc47ed2576f6936ba424663aab639c5ae4f5683423b4742bf1c978238f16cbe39d652de3fdb8befc848ad922222e04a4037c0713eb57a81a23f0c73473fc646cea306b4bcbc8862f8385ddfa9d4b7fa2c087e879683303ed5bdd3a062b3cf5b3a278a66d2a13f83f44f82ddf310ee074ab6a364597e899a0255dc164f31cc50846851df9ab48195ded7ea1b1d510bd7ee74d73faf36bc31ecfa268359046f4eb879f924009438b481c6cd7889a002ed5ee382bc9190da6fc026e479558e4475677e9aa9e3050e2765694dfc81f56e880b96e7160c980dd98edd3dfffffffffffffffff"}}')},5579(e){"use strict";e.exports=JSON.parse('{"2.16.840.1.101.3.4.1.1":"aes-128-ecb","2.16.840.1.101.3.4.1.2":"aes-128-cbc","2.16.840.1.101.3.4.1.3":"aes-128-ofb","2.16.840.1.101.3.4.1.4":"aes-128-cfb","2.16.840.1.101.3.4.1.21":"aes-192-ecb","2.16.840.1.101.3.4.1.22":"aes-192-cbc","2.16.840.1.101.3.4.1.23":"aes-192-ofb","2.16.840.1.101.3.4.1.24":"aes-192-cfb","2.16.840.1.101.3.4.1.41":"aes-256-ecb","2.16.840.1.101.3.4.1.42":"aes-256-cbc","2.16.840.1.101.3.4.1.43":"aes-256-ofb","2.16.840.1.101.3.4.1.44":"aes-256-cfb"}')},8330(e){"use strict";e.exports={rE:"5.4.2"}}},__webpack_module_cache__={};function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var r=__webpack_module_cache__[e]={id:e,loaded:!1,exports:{}};return __webpack_modules__[e].call(r.exports,r,r.exports,__webpack_require__),r.loaded=!0,r.exports}__webpack_require__.c=__webpack_module_cache__,__webpack_require__.d=(e,t)=>{for(var r in t)__webpack_require__.o(t,r)&&!__webpack_require__.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),__webpack_require__.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);var __webpack_exports__=__webpack_require__(__webpack_require__.s=9272);return __webpack_exports__})());
|