UNPKG

onepass-vault-library

Version:
8 lines 314 kB
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var r=t();for(var i in r)("object"==typeof exports?exports:e)[i]=r[i]}}("undefined"!=typeof self?self:this,function(){return function(e){var t={};function r(i){if(t[i])return t[i].exports;var n=t[i]={i:i,l:!1,exports:{}};return e[i].call(n.exports,n,n.exports,r),n.l=!0,n.exports}return r.m=e,r.c=t,r.d=function(e,t,i){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(r.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)r.d(i,n,function(t){return e[t]}.bind(null,n));return i},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=72)}([function(e,t){"function"==typeof Object.create?e.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}},function(e,t,r){var i=r(3),n=i.Buffer;function a(e,t){for(var r in e)t[r]=e[r]}function o(e,t,r){return n(e,t,r)}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?e.exports=i:(a(i,t),t.Buffer=o),a(n,o),o.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return n(e,t,r)},o.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var i=n(e);return void 0!==t?"string"==typeof r?i.fill(t,r):i.fill(t):i.fill(0),i},o.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n(e)},o.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i.SlowBuffer(e)}},function(e,t,r){(function(e){!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 a(e,t,r){if(a.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var o;"object"==typeof e?e.exports=a:t.BN=a,a.BN=a,a.wordSize=26;try{o=r(113).Buffer}catch(e){}function f(e,t,r){for(var i=0,n=Math.min(e.length,r),a=t;a<n;a++){var o=e.charCodeAt(a)-48;i<<=4,i|=o>=49&&o<=54?o-49+10:o>=17&&o<=22?o-17+10:15&o}return i}function s(e,t,r,i){for(var n=0,a=Math.min(e.length,r),o=t;o<a;o++){var f=e.charCodeAt(o)-48;n*=i,n+=f>=49?f-49+10:f>=17?f-17+10:f}return n}a.isBN=function(e){return e instanceof a||null!==e&&"object"==typeof e&&e.constructor.wordSize===a.wordSize&&Array.isArray(e.words)},a.max=function(e,t){return e.cmp(t)>0?e:t},a.min=function(e,t){return e.cmp(t)<0?e:t},a.prototype._init=function(e,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)},a.prototype._initNumber=function(e,t,r){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(i(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),t,r)},a.prototype._initArray=function(e,t,r){if(i("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var a,o,f=0;if("be"===r)for(n=e.length-1,a=0;n>=0;n-=3)o=e[n]|e[n-1]<<8|e[n-2]<<16,this.words[a]|=o<<f&67108863,this.words[a+1]=o>>>26-f&67108863,(f+=24)>=26&&(f-=26,a++);else if("le"===r)for(n=0,a=0;n<e.length;n+=3)o=e[n]|e[n+1]<<8|e[n+2]<<16,this.words[a]|=o<<f&67108863,this.words[a+1]=o>>>26-f&67108863,(f+=24)>=26&&(f-=26,a++);return this.strip()},a.prototype._parseHex=function(e,t){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r<this.length;r++)this.words[r]=0;var i,n,a=0;for(r=e.length-6,i=0;r>=t;r-=6)n=f(e,r,r+6),this.words[i]|=n<<a&67108863,this.words[i+1]|=n>>>26-a&4194303,(a+=24)>=26&&(a-=26,i++);r+6!==t&&(n=f(e,t,r+6),this.words[i]|=n<<a&67108863,this.words[i+1]|=n>>>26-a&4194303),this.strip()},a.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 a=e.length-r,o=a%i,f=Math.min(a,a-o)+r,c=0,h=r;h<f;h+=i)c=s(e,h,h+i,t),this.imuln(n),this.words[0]+c<67108864?this.words[0]+=c:this._iaddn(c);if(0!==o){var d=1;for(c=s(e,h,e.length,t),h=0;h<o;h++)d*=t;this.imuln(d),this.words[0]+c<67108864?this.words[0]+=c:this._iaddn(c)}},a.prototype.copy=function(e){e.words=new Array(this.length);for(var t=0;t<this.length;t++)e.words[t]=this.words[t];e.length=this.length,e.negative=this.negative,e.red=this.red},a.prototype.clone=function(){var e=new a(null);return this.copy(e),e},a.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},a.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},a.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},a.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var 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],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];function u(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],a=0|t.words[0],o=n*a,f=67108863&o,s=o/67108864|0;r.words[0]=f;for(var c=1;c<i;c++){for(var h=s>>>26,d=67108863&s,u=Math.min(c,t.length-1),l=Math.max(0,c-e.length+1);l<=u;l++){var p=c-l|0;h+=(o=(n=0|e.words[p])*(a=0|t.words[l])+d)/67108864|0,d=67108863&o}r.words[c]=0|d,s=0|h}return 0!==s?r.words[c]=0|s:r.length--,r.strip()}a.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var n=0,a=0,o=0;o<this.length;o++){var f=this.words[o],s=(16777215&(f<<n|a)).toString(16);r=0!==(a=f>>>24-n&16777215)||o!==this.length-1?c[6-s.length]+s+r:s+r,(n+=2)>=26&&(n-=26,o--)}for(0!==a&&(r=a.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 u=h[e],l=d[e];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var b=p.modn(l).toString(e);r=(p=p.idivn(l)).isZero()?b+r:c[u-b.length]+b+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}i(!1,"Base should be between 2 and 36")},a.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},a.prototype.toJSON=function(){return this.toString(16)},a.prototype.toBuffer=function(e,t){return i(void 0!==o),this.toArrayLike(o,e,t)},a.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},a.prototype.toArrayLike=function(e,t,r){var n=this.byteLength(),a=r||Math.max(1,n);i(n<=a,"byte array longer than desired length"),i(a>0,"Requested array length <= 0"),this.strip();var o,f,s="le"===t,c=new e(a),h=this.clone();if(s){for(f=0;!h.isZero();f++)o=h.andln(255),h.iushrn(8),c[f]=o;for(;f<a;f++)c[f]=0}else{for(f=0;f<a-n;f++)c[f]=0;for(f=0;!h.isZero();f++)o=h.andln(255),h.iushrn(8),c[a-f-1]=o}return c},Math.clz32?a.prototype._countBits=function(e){return 32-Math.clz32(e)}:a.prototype._countBits=function(e){var t=e,r=0;return t>=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},a.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0==(8191&t)&&(r+=13,t>>>=13),0==(127&t)&&(r+=7,t>>>=7),0==(15&t)&&(r+=4,t>>>=4),0==(3&t)&&(r+=2,t>>>=2),0==(1&t)&&r++,r},a.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},a.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;t<this.length;t++){var r=this._zeroBits(this.words[t]);if(e+=r,26!==r)break}return e},a.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},a.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},a.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},a.prototype.isNeg=function(){return 0!==this.negative},a.prototype.neg=function(){return this.clone().ineg()},a.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},a.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var t=0;t<e.length;t++)this.words[t]=this.words[t]|e.words[t];return this.strip()},a.prototype.ior=function(e){return i(0==(this.negative|e.negative)),this.iuor(e)},a.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},a.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},a.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;r<t.length;r++)this.words[r]=this.words[r]&e.words[r];return this.length=t.length,this.strip()},a.prototype.iand=function(e){return i(0==(this.negative|e.negative)),this.iuand(e)},a.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},a.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},a.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var 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()},a.prototype.ixor=function(e){return i(0==(this.negative|e.negative)),this.iuxor(e)},a.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},a.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},a.prototype.inotn=function(e){i("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var n=0;n<t;n++)this.words[n]=67108863&~this.words[n];return r>0&&(this.words[n]=~this.words[n]&67108863>>26-r),this.strip()},a.prototype.notn=function(e){return this.clone().inotn(e)},a.prototype.setn=function(e,t){i("number"==typeof e&&e>=0);var r=e/26|0,n=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<<n:this.words[r]&~(1<<n),this.strip()},a.prototype.iadd=function(e){var t,r,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,a=0;a<i.length;a++)t=(0|r.words[a])+(0|i.words[a])+n,this.words[a]=67108863&t,n=t>>>26;for(;0!==n&&a<r.length;a++)t=(0|r.words[a])+n,this.words[a]=67108863&t,n=t>>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;a<r.length;a++)this.words[a]=r.words[a];return this},a.prototype.add=function(e){var t;return 0!==e.negative&&0===this.negative?(e.negative=0,t=this.sub(e),e.negative^=1,t):0===e.negative&&0!==this.negative?(this.negative=0,t=e.sub(this),this.negative=1,t):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},a.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,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 a=0,o=0;o<i.length;o++)a=(t=(0|r.words[o])-(0|i.words[o])+a)>>26,this.words[o]=67108863&t;for(;0!==a&&o<r.length;o++)a=(t=(0|r.words[o])+a)>>26,this.words[o]=67108863&t;if(0===a&&o<r.length&&r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this.length=Math.max(this.length,o),r!==this&&(this.negative=1),this.strip()},a.prototype.sub=function(e){return this.clone().isub(e)};var l=function(e,t,r){var i,n,a,o=e.words,f=t.words,s=r.words,c=0,h=0|o[0],d=8191&h,u=h>>>13,l=0|o[1],p=8191&l,b=l>>>13,y=0|o[2],v=8191&y,m=y>>>13,g=0|o[3],_=8191&g,w=g>>>13,S=0|o[4],M=8191&S,E=S>>>13,k=0|o[5],A=8191&k,x=k>>>13,I=0|o[6],B=8191&I,R=I>>>13,P=0|o[7],T=8191&P,C=P>>>13,j=0|o[8],O=8191&j,D=j>>>13,L=0|o[9],U=8191&L,q=L>>>13,N=0|f[0],z=8191&N,K=N>>>13,F=0|f[1],H=8191&F,Y=F>>>13,W=0|f[2],V=8191&W,X=W>>>13,J=0|f[3],G=8191&J,Z=J>>>13,$=0|f[4],Q=8191&$,ee=$>>>13,te=0|f[5],re=8191&te,ie=te>>>13,ne=0|f[6],ae=8191&ne,oe=ne>>>13,fe=0|f[7],se=8191&fe,ce=fe>>>13,he=0|f[8],de=8191&he,ue=he>>>13,le=0|f[9],pe=8191&le,be=le>>>13;r.negative=e.negative^t.negative,r.length=19;var ye=(c+(i=Math.imul(d,z))|0)+((8191&(n=(n=Math.imul(d,K))+Math.imul(u,z)|0))<<13)|0;c=((a=Math.imul(u,K))+(n>>>13)|0)+(ye>>>26)|0,ye&=67108863,i=Math.imul(p,z),n=(n=Math.imul(p,K))+Math.imul(b,z)|0,a=Math.imul(b,K);var ve=(c+(i=i+Math.imul(d,H)|0)|0)+((8191&(n=(n=n+Math.imul(d,Y)|0)+Math.imul(u,H)|0))<<13)|0;c=((a=a+Math.imul(u,Y)|0)+(n>>>13)|0)+(ve>>>26)|0,ve&=67108863,i=Math.imul(v,z),n=(n=Math.imul(v,K))+Math.imul(m,z)|0,a=Math.imul(m,K),i=i+Math.imul(p,H)|0,n=(n=n+Math.imul(p,Y)|0)+Math.imul(b,H)|0,a=a+Math.imul(b,Y)|0;var me=(c+(i=i+Math.imul(d,V)|0)|0)+((8191&(n=(n=n+Math.imul(d,X)|0)+Math.imul(u,V)|0))<<13)|0;c=((a=a+Math.imul(u,X)|0)+(n>>>13)|0)+(me>>>26)|0,me&=67108863,i=Math.imul(_,z),n=(n=Math.imul(_,K))+Math.imul(w,z)|0,a=Math.imul(w,K),i=i+Math.imul(v,H)|0,n=(n=n+Math.imul(v,Y)|0)+Math.imul(m,H)|0,a=a+Math.imul(m,Y)|0,i=i+Math.imul(p,V)|0,n=(n=n+Math.imul(p,X)|0)+Math.imul(b,V)|0,a=a+Math.imul(b,X)|0;var ge=(c+(i=i+Math.imul(d,G)|0)|0)+((8191&(n=(n=n+Math.imul(d,Z)|0)+Math.imul(u,G)|0))<<13)|0;c=((a=a+Math.imul(u,Z)|0)+(n>>>13)|0)+(ge>>>26)|0,ge&=67108863,i=Math.imul(M,z),n=(n=Math.imul(M,K))+Math.imul(E,z)|0,a=Math.imul(E,K),i=i+Math.imul(_,H)|0,n=(n=n+Math.imul(_,Y)|0)+Math.imul(w,H)|0,a=a+Math.imul(w,Y)|0,i=i+Math.imul(v,V)|0,n=(n=n+Math.imul(v,X)|0)+Math.imul(m,V)|0,a=a+Math.imul(m,X)|0,i=i+Math.imul(p,G)|0,n=(n=n+Math.imul(p,Z)|0)+Math.imul(b,G)|0,a=a+Math.imul(b,Z)|0;var _e=(c+(i=i+Math.imul(d,Q)|0)|0)+((8191&(n=(n=n+Math.imul(d,ee)|0)+Math.imul(u,Q)|0))<<13)|0;c=((a=a+Math.imul(u,ee)|0)+(n>>>13)|0)+(_e>>>26)|0,_e&=67108863,i=Math.imul(A,z),n=(n=Math.imul(A,K))+Math.imul(x,z)|0,a=Math.imul(x,K),i=i+Math.imul(M,H)|0,n=(n=n+Math.imul(M,Y)|0)+Math.imul(E,H)|0,a=a+Math.imul(E,Y)|0,i=i+Math.imul(_,V)|0,n=(n=n+Math.imul(_,X)|0)+Math.imul(w,V)|0,a=a+Math.imul(w,X)|0,i=i+Math.imul(v,G)|0,n=(n=n+Math.imul(v,Z)|0)+Math.imul(m,G)|0,a=a+Math.imul(m,Z)|0,i=i+Math.imul(p,Q)|0,n=(n=n+Math.imul(p,ee)|0)+Math.imul(b,Q)|0,a=a+Math.imul(b,ee)|0;var we=(c+(i=i+Math.imul(d,re)|0)|0)+((8191&(n=(n=n+Math.imul(d,ie)|0)+Math.imul(u,re)|0))<<13)|0;c=((a=a+Math.imul(u,ie)|0)+(n>>>13)|0)+(we>>>26)|0,we&=67108863,i=Math.imul(B,z),n=(n=Math.imul(B,K))+Math.imul(R,z)|0,a=Math.imul(R,K),i=i+Math.imul(A,H)|0,n=(n=n+Math.imul(A,Y)|0)+Math.imul(x,H)|0,a=a+Math.imul(x,Y)|0,i=i+Math.imul(M,V)|0,n=(n=n+Math.imul(M,X)|0)+Math.imul(E,V)|0,a=a+Math.imul(E,X)|0,i=i+Math.imul(_,G)|0,n=(n=n+Math.imul(_,Z)|0)+Math.imul(w,G)|0,a=a+Math.imul(w,Z)|0,i=i+Math.imul(v,Q)|0,n=(n=n+Math.imul(v,ee)|0)+Math.imul(m,Q)|0,a=a+Math.imul(m,ee)|0,i=i+Math.imul(p,re)|0,n=(n=n+Math.imul(p,ie)|0)+Math.imul(b,re)|0,a=a+Math.imul(b,ie)|0;var Se=(c+(i=i+Math.imul(d,ae)|0)|0)+((8191&(n=(n=n+Math.imul(d,oe)|0)+Math.imul(u,ae)|0))<<13)|0;c=((a=a+Math.imul(u,oe)|0)+(n>>>13)|0)+(Se>>>26)|0,Se&=67108863,i=Math.imul(T,z),n=(n=Math.imul(T,K))+Math.imul(C,z)|0,a=Math.imul(C,K),i=i+Math.imul(B,H)|0,n=(n=n+Math.imul(B,Y)|0)+Math.imul(R,H)|0,a=a+Math.imul(R,Y)|0,i=i+Math.imul(A,V)|0,n=(n=n+Math.imul(A,X)|0)+Math.imul(x,V)|0,a=a+Math.imul(x,X)|0,i=i+Math.imul(M,G)|0,n=(n=n+Math.imul(M,Z)|0)+Math.imul(E,G)|0,a=a+Math.imul(E,Z)|0,i=i+Math.imul(_,Q)|0,n=(n=n+Math.imul(_,ee)|0)+Math.imul(w,Q)|0,a=a+Math.imul(w,ee)|0,i=i+Math.imul(v,re)|0,n=(n=n+Math.imul(v,ie)|0)+Math.imul(m,re)|0,a=a+Math.imul(m,ie)|0,i=i+Math.imul(p,ae)|0,n=(n=n+Math.imul(p,oe)|0)+Math.imul(b,ae)|0,a=a+Math.imul(b,oe)|0;var Me=(c+(i=i+Math.imul(d,se)|0)|0)+((8191&(n=(n=n+Math.imul(d,ce)|0)+Math.imul(u,se)|0))<<13)|0;c=((a=a+Math.imul(u,ce)|0)+(n>>>13)|0)+(Me>>>26)|0,Me&=67108863,i=Math.imul(O,z),n=(n=Math.imul(O,K))+Math.imul(D,z)|0,a=Math.imul(D,K),i=i+Math.imul(T,H)|0,n=(n=n+Math.imul(T,Y)|0)+Math.imul(C,H)|0,a=a+Math.imul(C,Y)|0,i=i+Math.imul(B,V)|0,n=(n=n+Math.imul(B,X)|0)+Math.imul(R,V)|0,a=a+Math.imul(R,X)|0,i=i+Math.imul(A,G)|0,n=(n=n+Math.imul(A,Z)|0)+Math.imul(x,G)|0,a=a+Math.imul(x,Z)|0,i=i+Math.imul(M,Q)|0,n=(n=n+Math.imul(M,ee)|0)+Math.imul(E,Q)|0,a=a+Math.imul(E,ee)|0,i=i+Math.imul(_,re)|0,n=(n=n+Math.imul(_,ie)|0)+Math.imul(w,re)|0,a=a+Math.imul(w,ie)|0,i=i+Math.imul(v,ae)|0,n=(n=n+Math.imul(v,oe)|0)+Math.imul(m,ae)|0,a=a+Math.imul(m,oe)|0,i=i+Math.imul(p,se)|0,n=(n=n+Math.imul(p,ce)|0)+Math.imul(b,se)|0,a=a+Math.imul(b,ce)|0;var Ee=(c+(i=i+Math.imul(d,de)|0)|0)+((8191&(n=(n=n+Math.imul(d,ue)|0)+Math.imul(u,de)|0))<<13)|0;c=((a=a+Math.imul(u,ue)|0)+(n>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,i=Math.imul(U,z),n=(n=Math.imul(U,K))+Math.imul(q,z)|0,a=Math.imul(q,K),i=i+Math.imul(O,H)|0,n=(n=n+Math.imul(O,Y)|0)+Math.imul(D,H)|0,a=a+Math.imul(D,Y)|0,i=i+Math.imul(T,V)|0,n=(n=n+Math.imul(T,X)|0)+Math.imul(C,V)|0,a=a+Math.imul(C,X)|0,i=i+Math.imul(B,G)|0,n=(n=n+Math.imul(B,Z)|0)+Math.imul(R,G)|0,a=a+Math.imul(R,Z)|0,i=i+Math.imul(A,Q)|0,n=(n=n+Math.imul(A,ee)|0)+Math.imul(x,Q)|0,a=a+Math.imul(x,ee)|0,i=i+Math.imul(M,re)|0,n=(n=n+Math.imul(M,ie)|0)+Math.imul(E,re)|0,a=a+Math.imul(E,ie)|0,i=i+Math.imul(_,ae)|0,n=(n=n+Math.imul(_,oe)|0)+Math.imul(w,ae)|0,a=a+Math.imul(w,oe)|0,i=i+Math.imul(v,se)|0,n=(n=n+Math.imul(v,ce)|0)+Math.imul(m,se)|0,a=a+Math.imul(m,ce)|0,i=i+Math.imul(p,de)|0,n=(n=n+Math.imul(p,ue)|0)+Math.imul(b,de)|0,a=a+Math.imul(b,ue)|0;var ke=(c+(i=i+Math.imul(d,pe)|0)|0)+((8191&(n=(n=n+Math.imul(d,be)|0)+Math.imul(u,pe)|0))<<13)|0;c=((a=a+Math.imul(u,be)|0)+(n>>>13)|0)+(ke>>>26)|0,ke&=67108863,i=Math.imul(U,H),n=(n=Math.imul(U,Y))+Math.imul(q,H)|0,a=Math.imul(q,Y),i=i+Math.imul(O,V)|0,n=(n=n+Math.imul(O,X)|0)+Math.imul(D,V)|0,a=a+Math.imul(D,X)|0,i=i+Math.imul(T,G)|0,n=(n=n+Math.imul(T,Z)|0)+Math.imul(C,G)|0,a=a+Math.imul(C,Z)|0,i=i+Math.imul(B,Q)|0,n=(n=n+Math.imul(B,ee)|0)+Math.imul(R,Q)|0,a=a+Math.imul(R,ee)|0,i=i+Math.imul(A,re)|0,n=(n=n+Math.imul(A,ie)|0)+Math.imul(x,re)|0,a=a+Math.imul(x,ie)|0,i=i+Math.imul(M,ae)|0,n=(n=n+Math.imul(M,oe)|0)+Math.imul(E,ae)|0,a=a+Math.imul(E,oe)|0,i=i+Math.imul(_,se)|0,n=(n=n+Math.imul(_,ce)|0)+Math.imul(w,se)|0,a=a+Math.imul(w,ce)|0,i=i+Math.imul(v,de)|0,n=(n=n+Math.imul(v,ue)|0)+Math.imul(m,de)|0,a=a+Math.imul(m,ue)|0;var Ae=(c+(i=i+Math.imul(p,pe)|0)|0)+((8191&(n=(n=n+Math.imul(p,be)|0)+Math.imul(b,pe)|0))<<13)|0;c=((a=a+Math.imul(b,be)|0)+(n>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,i=Math.imul(U,V),n=(n=Math.imul(U,X))+Math.imul(q,V)|0,a=Math.imul(q,X),i=i+Math.imul(O,G)|0,n=(n=n+Math.imul(O,Z)|0)+Math.imul(D,G)|0,a=a+Math.imul(D,Z)|0,i=i+Math.imul(T,Q)|0,n=(n=n+Math.imul(T,ee)|0)+Math.imul(C,Q)|0,a=a+Math.imul(C,ee)|0,i=i+Math.imul(B,re)|0,n=(n=n+Math.imul(B,ie)|0)+Math.imul(R,re)|0,a=a+Math.imul(R,ie)|0,i=i+Math.imul(A,ae)|0,n=(n=n+Math.imul(A,oe)|0)+Math.imul(x,ae)|0,a=a+Math.imul(x,oe)|0,i=i+Math.imul(M,se)|0,n=(n=n+Math.imul(M,ce)|0)+Math.imul(E,se)|0,a=a+Math.imul(E,ce)|0,i=i+Math.imul(_,de)|0,n=(n=n+Math.imul(_,ue)|0)+Math.imul(w,de)|0,a=a+Math.imul(w,ue)|0;var xe=(c+(i=i+Math.imul(v,pe)|0)|0)+((8191&(n=(n=n+Math.imul(v,be)|0)+Math.imul(m,pe)|0))<<13)|0;c=((a=a+Math.imul(m,be)|0)+(n>>>13)|0)+(xe>>>26)|0,xe&=67108863,i=Math.imul(U,G),n=(n=Math.imul(U,Z))+Math.imul(q,G)|0,a=Math.imul(q,Z),i=i+Math.imul(O,Q)|0,n=(n=n+Math.imul(O,ee)|0)+Math.imul(D,Q)|0,a=a+Math.imul(D,ee)|0,i=i+Math.imul(T,re)|0,n=(n=n+Math.imul(T,ie)|0)+Math.imul(C,re)|0,a=a+Math.imul(C,ie)|0,i=i+Math.imul(B,ae)|0,n=(n=n+Math.imul(B,oe)|0)+Math.imul(R,ae)|0,a=a+Math.imul(R,oe)|0,i=i+Math.imul(A,se)|0,n=(n=n+Math.imul(A,ce)|0)+Math.imul(x,se)|0,a=a+Math.imul(x,ce)|0,i=i+Math.imul(M,de)|0,n=(n=n+Math.imul(M,ue)|0)+Math.imul(E,de)|0,a=a+Math.imul(E,ue)|0;var Ie=(c+(i=i+Math.imul(_,pe)|0)|0)+((8191&(n=(n=n+Math.imul(_,be)|0)+Math.imul(w,pe)|0))<<13)|0;c=((a=a+Math.imul(w,be)|0)+(n>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,i=Math.imul(U,Q),n=(n=Math.imul(U,ee))+Math.imul(q,Q)|0,a=Math.imul(q,ee),i=i+Math.imul(O,re)|0,n=(n=n+Math.imul(O,ie)|0)+Math.imul(D,re)|0,a=a+Math.imul(D,ie)|0,i=i+Math.imul(T,ae)|0,n=(n=n+Math.imul(T,oe)|0)+Math.imul(C,ae)|0,a=a+Math.imul(C,oe)|0,i=i+Math.imul(B,se)|0,n=(n=n+Math.imul(B,ce)|0)+Math.imul(R,se)|0,a=a+Math.imul(R,ce)|0,i=i+Math.imul(A,de)|0,n=(n=n+Math.imul(A,ue)|0)+Math.imul(x,de)|0,a=a+Math.imul(x,ue)|0;var Be=(c+(i=i+Math.imul(M,pe)|0)|0)+((8191&(n=(n=n+Math.imul(M,be)|0)+Math.imul(E,pe)|0))<<13)|0;c=((a=a+Math.imul(E,be)|0)+(n>>>13)|0)+(Be>>>26)|0,Be&=67108863,i=Math.imul(U,re),n=(n=Math.imul(U,ie))+Math.imul(q,re)|0,a=Math.imul(q,ie),i=i+Math.imul(O,ae)|0,n=(n=n+Math.imul(O,oe)|0)+Math.imul(D,ae)|0,a=a+Math.imul(D,oe)|0,i=i+Math.imul(T,se)|0,n=(n=n+Math.imul(T,ce)|0)+Math.imul(C,se)|0,a=a+Math.imul(C,ce)|0,i=i+Math.imul(B,de)|0,n=(n=n+Math.imul(B,ue)|0)+Math.imul(R,de)|0,a=a+Math.imul(R,ue)|0;var Re=(c+(i=i+Math.imul(A,pe)|0)|0)+((8191&(n=(n=n+Math.imul(A,be)|0)+Math.imul(x,pe)|0))<<13)|0;c=((a=a+Math.imul(x,be)|0)+(n>>>13)|0)+(Re>>>26)|0,Re&=67108863,i=Math.imul(U,ae),n=(n=Math.imul(U,oe))+Math.imul(q,ae)|0,a=Math.imul(q,oe),i=i+Math.imul(O,se)|0,n=(n=n+Math.imul(O,ce)|0)+Math.imul(D,se)|0,a=a+Math.imul(D,ce)|0,i=i+Math.imul(T,de)|0,n=(n=n+Math.imul(T,ue)|0)+Math.imul(C,de)|0,a=a+Math.imul(C,ue)|0;var Pe=(c+(i=i+Math.imul(B,pe)|0)|0)+((8191&(n=(n=n+Math.imul(B,be)|0)+Math.imul(R,pe)|0))<<13)|0;c=((a=a+Math.imul(R,be)|0)+(n>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,i=Math.imul(U,se),n=(n=Math.imul(U,ce))+Math.imul(q,se)|0,a=Math.imul(q,ce),i=i+Math.imul(O,de)|0,n=(n=n+Math.imul(O,ue)|0)+Math.imul(D,de)|0,a=a+Math.imul(D,ue)|0;var Te=(c+(i=i+Math.imul(T,pe)|0)|0)+((8191&(n=(n=n+Math.imul(T,be)|0)+Math.imul(C,pe)|0))<<13)|0;c=((a=a+Math.imul(C,be)|0)+(n>>>13)|0)+(Te>>>26)|0,Te&=67108863,i=Math.imul(U,de),n=(n=Math.imul(U,ue))+Math.imul(q,de)|0,a=Math.imul(q,ue);var Ce=(c+(i=i+Math.imul(O,pe)|0)|0)+((8191&(n=(n=n+Math.imul(O,be)|0)+Math.imul(D,pe)|0))<<13)|0;c=((a=a+Math.imul(D,be)|0)+(n>>>13)|0)+(Ce>>>26)|0,Ce&=67108863;var je=(c+(i=Math.imul(U,pe))|0)+((8191&(n=(n=Math.imul(U,be))+Math.imul(q,pe)|0))<<13)|0;return c=((a=Math.imul(q,be))+(n>>>13)|0)+(je>>>26)|0,je&=67108863,s[0]=ye,s[1]=ve,s[2]=me,s[3]=ge,s[4]=_e,s[5]=we,s[6]=Se,s[7]=Me,s[8]=Ee,s[9]=ke,s[10]=Ae,s[11]=xe,s[12]=Ie,s[13]=Be,s[14]=Re,s[15]=Pe,s[16]=Te,s[17]=Ce,s[18]=je,0!==c&&(s[19]=c,r.length++),r};function p(e,t,r){return(new b).mulp(e,t,r)}function b(e,t){this.x=e,this.y=t}Math.imul||(l=u),a.prototype.mulTo=function(e,t){var r=this.length+e.length;return 10===this.length&&10===e.length?l(this,e,t):r<63?u(this,e,t):r<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var i=0,n=0,a=0;a<r.length-1;a++){var o=n;n=0;for(var f=67108863&i,s=Math.min(a,t.length-1),c=Math.max(0,a-e.length+1);c<=s;c++){var h=a-c,d=(0|e.words[h])*(0|t.words[c]),u=67108863&d;f=67108863&(u=u+f|0),n+=(o=(o=o+(d/67108864|0)|0)+(u>>>26)|0)>>>26,o&=67108863}r.words[a]=f,i=o,o=n}return 0!==i?r.words[a]=i:r.length--,r.strip()}(this,e,t):p(this,e,t)},b.prototype.makeRBT=function(e){for(var t=new Array(e),r=a.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,a){for(var o=0;o<a;o++)i[o]=t[e[o]],n[o]=r[e[o]]},b.prototype.transform=function(e,t,r,i,n,a){this.permute(a,e,t,r,i,n);for(var o=1;o<n;o<<=1)for(var f=o<<1,s=Math.cos(2*Math.PI/f),c=Math.sin(2*Math.PI/f),h=0;h<n;h+=f)for(var d=s,u=c,l=0;l<o;l++){var p=r[h+l],b=i[h+l],y=r[h+l+o],v=i[h+l+o],m=d*y-u*v;v=d*v+u*y,y=m,r[h+l]=p+y,i[h+l]=b+v,r[h+l+o]=p-y,i[h+l+o]=b-v,l!==f&&(m=s*d-c*u,u=s*u+c*d,d=m)}},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 a=0,o=0;o<t;o++)a+=0|e[o],r[2*o]=8191&a,a>>>=13,r[2*o+1]=8191&a,a>>>=13;for(o=2*t;o<n;++o)r[o]=0;i(0===a),i(0==(-8192&a))},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),a=this.stub(i),o=new Array(i),f=new Array(i),s=new Array(i),c=new Array(i),h=new Array(i),d=new Array(i),u=r.words;u.length=i,this.convert13b(e.words,e.length,o,i),this.convert13b(t.words,t.length,c,i),this.transform(o,a,f,s,i,n),this.transform(c,a,h,d,i,n);for(var l=0;l<i;l++){var p=f[l]*h[l]-s[l]*d[l];s[l]=f[l]*d[l]+s[l]*h[l],f[l]=p}return this.conjugate(f,s,i),this.transform(f,s,u,a,i,n),this.conjugate(u,a,i),this.normalize13b(u,i),r.negative=e.negative^t.negative,r.length=e.length+t.length,r.strip()},a.prototype.mul=function(e){var t=new a(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},a.prototype.mulf=function(e){var t=new a(null);return t.words=new Array(this.length+e.length),p(this,e,t)},a.prototype.imul=function(e){return this.clone().mulTo(e,this)},a.prototype.imuln=function(e){i("number"==typeof e),i(e<67108864);for(var t=0,r=0;r<this.length;r++){var n=(0|this.words[r])*e,a=(67108863&n)+(67108863&t);t>>=26,t+=n/67108864|0,t+=a>>>26,this.words[r]=67108863&a}return 0!==t&&(this.words[r]=t,this.length++),this},a.prototype.muln=function(e){return this.clone().imuln(e)},a.prototype.sqr=function(){return this.mul(this)},a.prototype.isqr=function(){return this.imul(this.clone())},a.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r<t.length;r++){var i=r/26|0,n=r%26;t[r]=(e.words[i]&1<<n)>>>n}return t}(e);if(0===t.length)return new a(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},a.prototype.iushln=function(e){i("number"==typeof e&&e>=0);var t,r=e%26,n=(e-r)/26,a=67108863>>>26-r<<26-r;if(0!==r){var o=0;for(t=0;t<this.length;t++){var f=this.words[t]&a,s=(0|this.words[t])-f<<r;this.words[t]=s|o,o=f>>>26-r}o&&(this.words[t]=o,this.length++)}if(0!==n){for(t=this.length-1;t>=0;t--)this.words[t+n]=this.words[t];for(t=0;t<n;t++)this.words[t]=0;this.length+=n}return this.strip()},a.prototype.ishln=function(e){return i(0===this.negative),this.iushln(e)},a.prototype.iushrn=function(e,t,r){var n;i("number"==typeof e&&e>=0),n=t?(t-t%26)/26:0;var a=e%26,o=Math.min((e-a)/26,this.length),f=67108863^67108863>>>a<<a,s=r;if(n-=o,n=Math.max(0,n),s){for(var c=0;c<o;c++)s.words[c]=this.words[c];s.length=o}if(0===o);else if(this.length>o)for(this.length-=o,c=0;c<this.length;c++)this.words[c]=this.words[c+o];else this.words[0]=0,this.length=1;var h=0;for(c=this.length-1;c>=0&&(0!==h||c>=n);c--){var d=0|this.words[c];this.words[c]=h<<26-a|d>>>a,h=d&f}return s&&0!==h&&(s.words[s.length++]=h),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},a.prototype.ishrn=function(e,t,r){return i(0===this.negative),this.iushrn(e,t,r)},a.prototype.shln=function(e){return this.clone().ishln(e)},a.prototype.ushln=function(e){return this.clone().iushln(e)},a.prototype.shrn=function(e){return this.clone().ishrn(e)},a.prototype.ushrn=function(e){return this.clone().iushrn(e)},a.prototype.testn=function(e){i("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26,n=1<<t;return!(this.length<=r)&&!!(this.words[r]&n)},a.prototype.imaskn=function(e){i("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26;if(i(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var n=67108863^67108863>>>t<<t;this.words[this.length-1]&=n}return this.strip()},a.prototype.maskn=function(e){return this.clone().imaskn(e)},a.prototype.iaddn=function(e){return i("number"==typeof e),i(e<67108864),e<0?this.isubn(-e):0!==this.negative?1===this.length&&(0|this.words[0])<e?(this.words[0]=e-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(e),this.negative=1,this):this._iaddn(e)},a.prototype._iaddn=function(e){this.words[0]+=e;for(var t=0;t<this.length&&this.words[t]>=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},a.prototype.isubn=function(e){if(i("number"==typeof e),i(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t<this.length&&this.words[t]<0;t++)this.words[t]+=67108864,this.words[t+1]-=1;return this.strip()},a.prototype.addn=function(e){return this.clone().iaddn(e)},a.prototype.subn=function(e){return this.clone().isubn(e)},a.prototype.iabs=function(){return this.negative=0,this},a.prototype.abs=function(){return this.clone().iabs()},a.prototype._ishlnsubmul=function(e,t,r){var n,a,o=e.length+r;this._expand(o);var f=0;for(n=0;n<e.length;n++){a=(0|this.words[n+r])+f;var s=(0|e.words[n])*t;f=((a-=67108863&s)>>26)-(s/67108864|0),this.words[n+r]=67108863&a}for(;n<this.length-r;n++)f=(a=(0|this.words[n+r])+f)>>26,this.words[n+r]=67108863&a;if(0===f)return this.strip();for(i(-1===f),f=0,n=0;n<this.length;n++)f=(a=-(0|this.words[n])+f)>>26,this.words[n]=67108863&a;return this.negative=1,this.strip()},a.prototype._wordDiv=function(e,t){var r=(this.length,e.length),i=this.clone(),n=e,o=0|n.words[n.length-1];0!==(r=26-this._countBits(o))&&(n=n.ushln(r),i.iushln(r),o=0|n.words[n.length-1]);var f,s=i.length-n.length;if("mod"!==t){(f=new a(null)).length=s+1,f.words=new Array(f.length);for(var c=0;c<f.length;c++)f.words[c]=0}var h=i.clone()._ishlnsubmul(n,1,s);0===h.negative&&(i=h,f&&(f.words[s]=1));for(var d=s-1;d>=0;d--){var u=67108864*(0|i.words[n.length+d])+(0|i.words[n.length+d-1]);for(u=Math.min(u/o|0,67108863),i._ishlnsubmul(n,u,d);0!==i.negative;)u--,i.negative=0,i._ishlnsubmul(n,1,d),i.isZero()||(i.negative^=1);f&&(f.words[d]=u)}return f&&f.strip(),i.strip(),"div"!==t&&0!==r&&i.iushrn(r),{div:f||null,mod:i}},a.prototype.divmod=function(e,t,r){return i(!e.isZero()),this.isZero()?{div:new a(0),mod:new a(0)}:0!==this.negative&&0===e.negative?(f=this.neg().divmod(e,t),"mod"!==t&&(n=f.div.neg()),"div"!==t&&(o=f.mod.neg(),r&&0!==o.negative&&o.iadd(e)),{div:n,mod:o}):0===this.negative&&0!==e.negative?(f=this.divmod(e.neg(),t),"mod"!==t&&(n=f.div.neg()),{div:n,mod:f.mod}):0!=(this.negative&e.negative)?(f=this.neg().divmod(e.neg(),t),"div"!==t&&(o=f.mod.neg(),r&&0!==o.negative&&o.isub(e)),{div:f.div,mod:o}):e.length>this.length||this.cmp(e)<0?{div:new a(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new a(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new a(this.modn(e.words[0]))}:this._wordDiv(e,t);var n,o,f},a.prototype.div=function(e){return this.divmod(e,"div",!1).div},a.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},a.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},a.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,i=e.ushrn(1),n=e.andln(1),a=r.cmp(i);return a<0||1===n&&0===a?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},a.prototype.modn=function(e){i(e<=67108863);for(var t=(1<<26)%e,r=0,n=this.length-1;n>=0;n--)r=(t*r+(0|this.words[n]))%e;return r},a.prototype.idivn=function(e){i(e<=67108863);for(var t=0,r=this.length-1;r>=0;r--){var n=(0|this.words[r])+67108864*t;this.words[r]=n/e|0,t=n%e}return this.strip()},a.prototype.divn=function(e){return this.clone().idivn(e)},a.prototype.egcd=function(e){i(0===e.negative),i(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var n=new a(1),o=new a(0),f=new a(0),s=new a(1),c=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++c;for(var h=r.clone(),d=t.clone();!t.isZero();){for(var u=0,l=1;0==(t.words[0]&l)&&u<26;++u,l<<=1);if(u>0)for(t.iushrn(u);u-- >0;)(n.isOdd()||o.isOdd())&&(n.iadd(h),o.isub(d)),n.iushrn(1),o.iushrn(1);for(var p=0,b=1;0==(r.words[0]&b)&&p<26;++p,b<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(f.isOdd()||s.isOdd())&&(f.iadd(h),s.isub(d)),f.iushrn(1),s.iushrn(1);t.cmp(r)>=0?(t.isub(r),n.isub(f),o.isub(s)):(r.isub(t),f.isub(n),s.isub(o))}return{a:f,b:s,gcd:r.iushln(c)}},a.prototype._invmp=function(e){i(0===e.negative),i(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var n,o=new a(1),f=new a(0),s=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;)o.isOdd()&&o.iadd(s),o.iushrn(1);for(var d=0,u=1;0==(r.words[0]&u)&&d<26;++d,u<<=1);if(d>0)for(r.iushrn(d);d-- >0;)f.isOdd()&&f.iadd(s),f.iushrn(1);t.cmp(r)>=0?(t.isub(r),o.isub(f)):(r.isub(t),f.isub(o))}return(n=0===t.cmpn(1)?o:f).cmpn(0)<0&&n.iadd(e),n},a.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var 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 a=t;t=r,r=a}else if(0===n||0===r.cmpn(1))break;t.isub(r)}return r.iushln(i)},a.prototype.invm=function(e){return this.egcd(e).a.umod(e)},a.prototype.isEven=function(){return 0==(1&this.words[0])},a.prototype.isOdd=function(){return 1==(1&this.words[0])},a.prototype.andln=function(e){return this.words[0]&e},a.prototype.bincn=function(e){i("number"==typeof e);var t=e%26,r=(e-t)/26,n=1<<t;if(this.length<=r)return this._expand(r+1),this.words[r]|=n,this;for(var a=n,o=r;0!==a&&o<this.length;o++){var f=0|this.words[o];a=(f+=a)>>>26,f&=67108863,this.words[o]=f}return 0!==a&&(this.words[o]=a,this.length++),this},a.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},a.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)t=1;else{r&&(e=-e),i(e<=67108863,"Number is too big");var n=0|this.words[0];t=n===e?0:n<e?-1:1}return 0!==this.negative?0|-t:t},a.prototype.cmp=function(e){if(0!==this.negative&&0===e.negative)return-1;if(0===this.negative&&0!==e.negative)return 1;var t=this.ucmp(e);return 0!==this.negative?0|-t:t},a.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var t=0,r=this.length-1;r>=0;r--){var i=0|this.words[r],n=0|e.words[r];if(i!==n){i<n?t=-1:i>n&&(t=1);break}}return t},a.prototype.gtn=function(e){return 1===this.cmpn(e)},a.prototype.gt=function(e){return 1===this.cmp(e)},a.prototype.gten=function(e){return this.cmpn(e)>=0},a.prototype.gte=function(e){return this.cmp(e)>=0},a.prototype.ltn=function(e){return-1===this.cmpn(e)},a.prototype.lt=function(e){return-1===this.cmp(e)},a.prototype.lten=function(e){return this.cmpn(e)<=0},a.prototype.lte=function(e){return this.cmp(e)<=0},a.prototype.eqn=function(e){return 0===this.cmpn(e)},a.prototype.eq=function(e){return 0===this.cmp(e)},a.red=function(e){return new S(e)},a.prototype.toRed=function(e){return i(!this.red,"Already a number in reduction context"),i(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},a.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},a.prototype._forceRed=function(e){return this.red=e,this},a.prototype.forceRed=function(e){return i(!this.red,"Already a number in reduction context"),this._forceRed(e)},a.prototype.redAdd=function(e){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},a.prototype.redIAdd=function(e){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},a.prototype.redSub=function(e){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},a.prototype.redISub=function(e){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},a.prototype.redShl=function(e){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},a.prototype.redMul=function(e){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},a.prototype.redIMul=function(e){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},a.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},a.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},a.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},a.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},a.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},a.prototype.redPow=function(e){return i(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var y={k256:null,p224:null,p192:null,p25519:null};function v(e,t){this.name=e,this.p=new a(t,16),this.n=this.p.bitLength(),this.k=new a(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function m(){v.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function g(){v.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function _(){v.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function w(){v.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function S(e){if("string"==typeof e){var t=a._prime(e);this.m=t.p,this.prime=t}else i(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function M(e){S.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new a(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}v.prototype._tmp=function(){var e=new a(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):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(m,v),m.prototype.split=function(e,t){for(var r=Math.min(e.length,9),i=0;i<r;i++)t.words[i]=e.words[i];if(t.length=r,e.length<=9)return e.words[0]=0,void(e.length=1);var n=e.words[9];for(t.words[t.length++]=4194303&n,i=10;i<e.length;i++){var a=0|e.words[i];e.words[i-10]=(4194303&a)<<4|n>>>22,n=a}n>>>=22,e.words[i-10]=n,0===n&&e.length>10?e.length-=10:e.length-=9},m.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(g,v),n(_,v),n(w,v),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},a._prime=function(e){if(y[e])return y[e];var t;if("k256"===e)t=new m;else if("p224"===e)t=new g;else if("p192"===e)t=new _;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new w}return y[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 a(1)).iushrn(2);return this.pow(e,r)}for(var n=this.m.subn(1),o=0;!n.isZero()&&0===n.andln(1);)o++,n.iushrn(1);i(!n.isZero());var f=new a(1).toRed(this),s=f.redNeg(),c=this.m.subn(1).iushrn(1),h=this.m.bitLength();for(h=new a(2*h*h).toRed(this);0!==this.pow(h,c).cmp(s);)h.redIAdd(s);for(var d=this.pow(h,n),u=this.pow(e,n.addn(1).iushrn(1)),l=this.pow(e,n),p=o;0!==l.cmp(f);){for(var b=l,y=0;0!==b.cmp(f);y++)b=b.redSqr();i(y<p);var v=this.pow(d,new a(1).iushln(p-y-1));u=u.redMul(v),d=v.redSqr(),l=l.redMul(d),p=y}return u},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 a(1).toRed(this);if(0===t.cmpn(1))return e.clone();var r=new Array(16);r[0]=new a(1).toRed(this),r[1]=e;for(var i=2;i<r.length;i++)r[i]=this.mul(r[i-1],e);var n=r[0],o=0,f=0,s=t.bitLength()%26;for(0===s&&(s=26),i=t.length-1;i>=0;i--){for(var c=t.words[i],h=s-1;h>=0;h--){var d=c>>h&1;n!==r[0]&&(n=this.sqr(n)),0!==d||0!==o?(o<<=1,o|=d,(4===++f||0===i&&0===h)&&(n=this.mul(n,r[o]),f=0,o=0)):f=0}s=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},a.mont=function(e){return new M(e)},n(M,S),M.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},M.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},M.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),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)},M.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new a(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),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)},M.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e,this)}).call(this,r(112)(e))},function(e,t,r){"use strict";(function(e){ /*! * The buffer module from node.js, for the browser. * * @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org> * @license MIT */ var i=r(73),n=r(74),a=r(37);function o(){return s.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function f(e,t){if(o()<t)throw new RangeError("Invalid typed array length");return s.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=s.prototype:(null===e&&(e=new s(t)),e.length=t),e}function s(e,t,r){if(!(s.TYPED_ARRAY_SUPPORT||this instanceof s))return new s(e,t,r);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return d(this,e)}return c(this,e,t,r)}function c(e,t,r,i){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?function(e,t,r,i){if(t.byteLength,r<0||t.byteLength<r)throw new RangeError("'offset' is out of bounds");if(t.byteLength<r+(i||0))throw new RangeError("'length' is out of bounds");t=void 0===r&&void 0===i?new Uint8Array(t):void 0===i?new Uint8Array(t,r):new Uint8Array(t,r,i);s.TYPED_ARRAY_SUPPORT?(e=t).__proto__=s.prototype:e=u(e,t);return e}(e,t,r,i):"string"==typeof t?function(e,t,r){"string"==typeof r&&""!==r||(r="utf8");if(!s.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var i=0|p(t,r),n=(e=f(e,i)).write(t,r);n!==i&&(e=e.slice(0,n));return e}(e,t,r):function(e,t){if(s.isBuffer(t)){var r=0|l(t.length);return 0===(e=f(e,r)).length?e:(t.copy(e,0,0,r),e)}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||(i=t.length)!=i?f(e,0):u(e,t);if("Buffer"===t.type&&a(t.data))return u(e,t.data)}var i;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,t)}function h(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function d(e,t){if(h(t),e=f(e,t<0?0:0|l(t)),!s.TYPED_ARRAY_SUPPORT)for(var r=0;r<t;++r)e[r]=0;return e}function u(e,t){var r=t.length<0?0:0|l(t.length);e=f(e,r);for(var i=0;i<r;i+=1)e[i]=255&t[i];return e}function l(e){if(e>=o())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o().toString(16)+" bytes");return 0|e}function p(e,t){if(s.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var r=e.length;if(0===r)return 0;for(var i=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return N(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return z(e).length;default:if(i)return N(e).length;t=(""+t).toLowerCase(),i=!0}}function b(e,t,r){var i=e[t];e[t]=e[r],e[r]=i}function y(e,t,r,i,n){if(0===e.length)return-1;if("string"==typeof r?(i=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=n?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(n)return-1;r=e.length-1}else if(r<0){if(!n)return-1;r=0}if("string"==typeof t&&(t=s.from(t,i)),s.isBuffer(t))return 0===t.length?-1:v(e,t,r,i,n);if("number"==typeof t)return t&=255,s.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?n?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):v(e,[t],r,i,n);throw new TypeError("val must be string, number or Buffer")}function v(e,t,r,i,n){var a,o=1,f=e.length,s=t.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(e.length<2||t.length<2)return-1;o=2,f/=2,s/=2,r/=2}function c(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(n){var h=-1;for(a=r;a<f;a++)if(c(e,a)===c(t,-1===h?0:a-h)){if(-1===h&&(h=a),a-h+1===s)return h*o}else-1!==h&&(a-=a-h),h=-1}else for(r+s>f&&(r=f-s),a=r;a>=0;a--){for(var d=!0,u=0;u<s;u++)if(c(e,a+u)!==c(t,u)){d=!1;break}if(d)return a}return-1}function m(e,t,r,i){r=Number(r)||0;var n=e.length-r;i?(i=Number(i))>n&&(i=n):i=n;var a=t.length;if(a%2!=0)throw new TypeError("Invalid hex string");i>a/2&&(i=a/2);for(var o=0;o<i;++o){var f=parseInt(t.substr(2*o,2),16);if(isNaN(f))return o;e[r+o]=f}return o}function g(e,t,r,i){return K(N(t,e.length-r),e,r,i)}function _(e,t,r,i){return K(function(e){for(var t=[],r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,i)}function w(e,t,r,i){return _(e,t,r,i)}function S(e,t,r,i){return K(z(t),e,r,i)}function M(e,t,r,i){return K(function(e,t){for(var r,i,n,a=[],o=0;o<e.length&&!((