UNPKG

lastpass-vault

Version:

Cross Platform javascript client for handling lastpass vaults.

8 lines 349 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=76)}([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 s(e,t,r){return n(e,t,r)}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?e.exports=i:(a(i,t),t.Buffer=s),a(n,s),s.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return n(e,t,r)},s.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},s.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n(e)},s.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 s;"object"==typeof e?e.exports=a:t.BN=a,a.BN=a,a.wordSize=26;try{s=r(117).Buffer}catch(e){}function o(e,t,r){for(var i=0,n=Math.min(e.length,r),a=t;a<n;a++){var s=e.charCodeAt(a)-48;i<<=4,i|=s>=49&&s<=54?s-49+10:s>=17&&s<=22?s-17+10:15&s}return i}function f(e,t,r,i){for(var n=0,a=Math.min(e.length,r),s=t;s<a;s++){var o=e.charCodeAt(s)-48;n*=i,n+=o>=49?o-49+10:o>=17?o-17+10:o}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,s,o=0;if("be"===r)for(n=e.length-1,a=0;n>=0;n-=3)s=e[n]|e[n-1]<<8|e[n-2]<<16,this.words[a]|=s<<o&67108863,this.words[a+1]=s>>>26-o&67108863,(o+=24)>=26&&(o-=26,a++);else if("le"===r)for(n=0,a=0;n<e.length;n+=3)s=e[n]|e[n+1]<<8|e[n+2]<<16,this.words[a]|=s<<o&67108863,this.words[a+1]=s>>>26-o&67108863,(o+=24)>=26&&(o-=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=o(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=o(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,s=a%i,o=Math.min(a,a-s)+r,c=0,u=r;u<o;u+=i)c=f(e,u,u+i,t),this.imuln(n),this.words[0]+c<67108864?this.words[0]+=c:this._iaddn(c);if(0!==s){var h=1;for(c=f(e,u,e.length,t),u=0;u<s;u++)h*=t;this.imuln(h),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"],u=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],h=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function d(e,t,r){r.negative=t.negative^e.negative;var i=e.length+t.length|0;r.length=i,i=i-1|0;var n=0|e.words[0],a=0|t.words[0],s=n*a,o=67108863&s,f=s/67108864|0;r.words[0]=o;for(var c=1;c<i;c++){for(var u=f>>>26,h=67108863&f,d=Math.min(c,t.length-1),l=Math.max(0,c-e.length+1);l<=d;l++){var p=c-l|0;u+=(s=(n=0|e.words[p])*(a=0|t.words[l])+h)/67108864|0,h=67108863&s}r.words[c]=0|h,f=0|u}return 0!==f?r.words[c]=0|f: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,s=0;s<this.length;s++){var o=this.words[s],f=(16777215&(o<<n|a)).toString(16);r=0!==(a=o>>>24-n&16777215)||s!==this.length-1?c[6-f.length]+f+r:f+r,(n+=2)>=26&&(n-=26,s--)}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 d=u[e],l=h[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[d-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!==s),this.toArrayLike(s,e,t)},a.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},a.prototype.toArrayLike=function(e,t,r){var n=this.byteLength(),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 s,o,f="le"===t,c=new e(a),u=this.clone();if(f){for(o=0;!u.isZero();o++)s=u.andln(255),u.iushrn(8),c[o]=s;for(;o<a;o++)c[o]=0}else{for(o=0;o<a-n;o++)c[o]=0;for(o=0;!u.isZero();o++)s=u.andln(255),u.iushrn(8),c[a-o-1]=s}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,s=0;s<i.length;s++)a=(t=(0|r.words[s])-(0|i.words[s])+a)>>26,this.words[s]=67108863&t;for(;0!==a&&s<r.length;s++)a=(t=(0|r.words[s])+a)>>26,this.words[s]=67108863&t;if(0===a&&s<r.length&&r!==this)for(;s<r.length;s++)this.words[s]=r.words[s];return this.length=Math.max(this.length,s),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,s=e.words,o=t.words,f=r.words,c=0,u=0|s[0],h=8191&u,d=u>>>13,l=0|s[1],p=8191&l,b=l>>>13,y=0|s[2],m=8191&y,g=y>>>13,v=0|s[3],_=8191&v,w=v>>>13,E=0|s[4],S=8191&E,A=E>>>13,M=0|s[5],x=8191&M,k=M>>>13,T=0|s[6],I=8191&T,B=T>>>13,R=0|s[7],C=8191&R,N=R>>>13,P=0|s[8],O=8191&P,D=P>>>13,j=0|s[9],F=8191&j,L=j>>>13,U=0|o[0],q=8191&U,K=U>>>13,z=0|o[1],H=8191&z,V=z>>>13,Y=0|o[2],G=8191&Y,W=Y>>>13,X=0|o[3],J=8191&X,Z=X>>>13,Q=0|o[4],$=8191&Q,ee=Q>>>13,te=0|o[5],re=8191&te,ie=te>>>13,ne=0|o[6],ae=8191&ne,se=ne>>>13,oe=0|o[7],fe=8191&oe,ce=oe>>>13,ue=0|o[8],he=8191&ue,de=ue>>>13,le=0|o[9],pe=8191&le,be=le>>>13;r.negative=e.negative^t.negative,r.length=19;var ye=(c+(i=Math.imul(h,q))|0)+((8191&(n=(n=Math.imul(h,K))+Math.imul(d,q)|0))<<13)|0;c=((a=Math.imul(d,K))+(n>>>13)|0)+(ye>>>26)|0,ye&=67108863,i=Math.imul(p,q),n=(n=Math.imul(p,K))+Math.imul(b,q)|0,a=Math.imul(b,K);var me=(c+(i=i+Math.imul(h,H)|0)|0)+((8191&(n=(n=n+Math.imul(h,V)|0)+Math.imul(d,H)|0))<<13)|0;c=((a=a+Math.imul(d,V)|0)+(n>>>13)|0)+(me>>>26)|0,me&=67108863,i=Math.imul(m,q),n=(n=Math.imul(m,K))+Math.imul(g,q)|0,a=Math.imul(g,K),i=i+Math.imul(p,H)|0,n=(n=n+Math.imul(p,V)|0)+Math.imul(b,H)|0,a=a+Math.imul(b,V)|0;var ge=(c+(i=i+Math.imul(h,G)|0)|0)+((8191&(n=(n=n+Math.imul(h,W)|0)+Math.imul(d,G)|0))<<13)|0;c=((a=a+Math.imul(d,W)|0)+(n>>>13)|0)+(ge>>>26)|0,ge&=67108863,i=Math.imul(_,q),n=(n=Math.imul(_,K))+Math.imul(w,q)|0,a=Math.imul(w,K),i=i+Math.imul(m,H)|0,n=(n=n+Math.imul(m,V)|0)+Math.imul(g,H)|0,a=a+Math.imul(g,V)|0,i=i+Math.imul(p,G)|0,n=(n=n+Math.imul(p,W)|0)+Math.imul(b,G)|0,a=a+Math.imul(b,W)|0;var ve=(c+(i=i+Math.imul(h,J)|0)|0)+((8191&(n=(n=n+Math.imul(h,Z)|0)+Math.imul(d,J)|0))<<13)|0;c=((a=a+Math.imul(d,Z)|0)+(n>>>13)|0)+(ve>>>26)|0,ve&=67108863,i=Math.imul(S,q),n=(n=Math.imul(S,K))+Math.imul(A,q)|0,a=Math.imul(A,K),i=i+Math.imul(_,H)|0,n=(n=n+Math.imul(_,V)|0)+Math.imul(w,H)|0,a=a+Math.imul(w,V)|0,i=i+Math.imul(m,G)|0,n=(n=n+Math.imul(m,W)|0)+Math.imul(g,G)|0,a=a+Math.imul(g,W)|0,i=i+Math.imul(p,J)|0,n=(n=n+Math.imul(p,Z)|0)+Math.imul(b,J)|0,a=a+Math.imul(b,Z)|0;var _e=(c+(i=i+Math.imul(h,$)|0)|0)+((8191&(n=(n=n+Math.imul(h,ee)|0)+Math.imul(d,$)|0))<<13)|0;c=((a=a+Math.imul(d,ee)|0)+(n>>>13)|0)+(_e>>>26)|0,_e&=67108863,i=Math.imul(x,q),n=(n=Math.imul(x,K))+Math.imul(k,q)|0,a=Math.imul(k,K),i=i+Math.imul(S,H)|0,n=(n=n+Math.imul(S,V)|0)+Math.imul(A,H)|0,a=a+Math.imul(A,V)|0,i=i+Math.imul(_,G)|0,n=(n=n+Math.imul(_,W)|0)+Math.imul(w,G)|0,a=a+Math.imul(w,W)|0,i=i+Math.imul(m,J)|0,n=(n=n+Math.imul(m,Z)|0)+Math.imul(g,J)|0,a=a+Math.imul(g,Z)|0,i=i+Math.imul(p,$)|0,n=(n=n+Math.imul(p,ee)|0)+Math.imul(b,$)|0,a=a+Math.imul(b,ee)|0;var we=(c+(i=i+Math.imul(h,re)|0)|0)+((8191&(n=(n=n+Math.imul(h,ie)|0)+Math.imul(d,re)|0))<<13)|0;c=((a=a+Math.imul(d,ie)|0)+(n>>>13)|0)+(we>>>26)|0,we&=67108863,i=Math.imul(I,q),n=(n=Math.imul(I,K))+Math.imul(B,q)|0,a=Math.imul(B,K),i=i+Math.imul(x,H)|0,n=(n=n+Math.imul(x,V)|0)+Math.imul(k,H)|0,a=a+Math.imul(k,V)|0,i=i+Math.imul(S,G)|0,n=(n=n+Math.imul(S,W)|0)+Math.imul(A,G)|0,a=a+Math.imul(A,W)|0,i=i+Math.imul(_,J)|0,n=(n=n+Math.imul(_,Z)|0)+Math.imul(w,J)|0,a=a+Math.imul(w,Z)|0,i=i+Math.imul(m,$)|0,n=(n=n+Math.imul(m,ee)|0)+Math.imul(g,$)|0,a=a+Math.imul(g,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 Ee=(c+(i=i+Math.imul(h,ae)|0)|0)+((8191&(n=(n=n+Math.imul(h,se)|0)+Math.imul(d,ae)|0))<<13)|0;c=((a=a+Math.imul(d,se)|0)+(n>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,i=Math.imul(C,q),n=(n=Math.imul(C,K))+Math.imul(N,q)|0,a=Math.imul(N,K),i=i+Math.imul(I,H)|0,n=(n=n+Math.imul(I,V)|0)+Math.imul(B,H)|0,a=a+Math.imul(B,V)|0,i=i+Math.imul(x,G)|0,n=(n=n+Math.imul(x,W)|0)+Math.imul(k,G)|0,a=a+Math.imul(k,W)|0,i=i+Math.imul(S,J)|0,n=(n=n+Math.imul(S,Z)|0)+Math.imul(A,J)|0,a=a+Math.imul(A,Z)|0,i=i+Math.imul(_,$)|0,n=(n=n+Math.imul(_,ee)|0)+Math.imul(w,$)|0,a=a+Math.imul(w,ee)|0,i=i+Math.imul(m,re)|0,n=(n=n+Math.imul(m,ie)|0)+Math.imul(g,re)|0,a=a+Math.imul(g,ie)|0,i=i+Math.imul(p,ae)|0,n=(n=n+Math.imul(p,se)|0)+Math.imul(b,ae)|0,a=a+Math.imul(b,se)|0;var Se=(c+(i=i+Math.imul(h,fe)|0)|0)+((8191&(n=(n=n+Math.imul(h,ce)|0)+Math.imul(d,fe)|0))<<13)|0;c=((a=a+Math.imul(d,ce)|0)+(n>>>13)|0)+(Se>>>26)|0,Se&=67108863,i=Math.imul(O,q),n=(n=Math.imul(O,K))+Math.imul(D,q)|0,a=Math.imul(D,K),i=i+Math.imul(C,H)|0,n=(n=n+Math.imul(C,V)|0)+Math.imul(N,H)|0,a=a+Math.imul(N,V)|0,i=i+Math.imul(I,G)|0,n=(n=n+Math.imul(I,W)|0)+Math.imul(B,G)|0,a=a+Math.imul(B,W)|0,i=i+Math.imul(x,J)|0,n=(n=n+Math.imul(x,Z)|0)+Math.imul(k,J)|0,a=a+Math.imul(k,Z)|0,i=i+Math.imul(S,$)|0,n=(n=n+Math.imul(S,ee)|0)+Math.imul(A,$)|0,a=a+Math.imul(A,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(m,ae)|0,n=(n=n+Math.imul(m,se)|0)+Math.imul(g,ae)|0,a=a+Math.imul(g,se)|0,i=i+Math.imul(p,fe)|0,n=(n=n+Math.imul(p,ce)|0)+Math.imul(b,fe)|0,a=a+Math.imul(b,ce)|0;var Ae=(c+(i=i+Math.imul(h,he)|0)|0)+((8191&(n=(n=n+Math.imul(h,de)|0)+Math.imul(d,he)|0))<<13)|0;c=((a=a+Math.imul(d,de)|0)+(n>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,i=Math.imul(F,q),n=(n=Math.imul(F,K))+Math.imul(L,q)|0,a=Math.imul(L,K),i=i+Math.imul(O,H)|0,n=(n=n+Math.imul(O,V)|0)+Math.imul(D,H)|0,a=a+Math.imul(D,V)|0,i=i+Math.imul(C,G)|0,n=(n=n+Math.imul(C,W)|0)+Math.imul(N,G)|0,a=a+Math.imul(N,W)|0,i=i+Math.imul(I,J)|0,n=(n=n+Math.imul(I,Z)|0)+Math.imul(B,J)|0,a=a+Math.imul(B,Z)|0,i=i+Math.imul(x,$)|0,n=(n=n+Math.imul(x,ee)|0)+Math.imul(k,$)|0,a=a+Math.imul(k,ee)|0,i=i+Math.imul(S,re)|0,n=(n=n+Math.imul(S,ie)|0)+Math.imul(A,re)|0,a=a+Math.imul(A,ie)|0,i=i+Math.imul(_,ae)|0,n=(n=n+Math.imul(_,se)|0)+Math.imul(w,ae)|0,a=a+Math.imul(w,se)|0,i=i+Math.imul(m,fe)|0,n=(n=n+Math.imul(m,ce)|0)+Math.imul(g,fe)|0,a=a+Math.imul(g,ce)|0,i=i+Math.imul(p,he)|0,n=(n=n+Math.imul(p,de)|0)+Math.imul(b,he)|0,a=a+Math.imul(b,de)|0;var Me=(c+(i=i+Math.imul(h,pe)|0)|0)+((8191&(n=(n=n+Math.imul(h,be)|0)+Math.imul(d,pe)|0))<<13)|0;c=((a=a+Math.imul(d,be)|0)+(n>>>13)|0)+(Me>>>26)|0,Me&=67108863,i=Math.imul(F,H),n=(n=Math.imul(F,V))+Math.imul(L,H)|0,a=Math.imul(L,V),i=i+Math.imul(O,G)|0,n=(n=n+Math.imul(O,W)|0)+Math.imul(D,G)|0,a=a+Math.imul(D,W)|0,i=i+Math.imul(C,J)|0,n=(n=n+Math.imul(C,Z)|0)+Math.imul(N,J)|0,a=a+Math.imul(N,Z)|0,i=i+Math.imul(I,$)|0,n=(n=n+Math.imul(I,ee)|0)+Math.imul(B,$)|0,a=a+Math.imul(B,ee)|0,i=i+Math.imul(x,re)|0,n=(n=n+Math.imul(x,ie)|0)+Math.imul(k,re)|0,a=a+Math.imul(k,ie)|0,i=i+Math.imul(S,ae)|0,n=(n=n+Math.imul(S,se)|0)+Math.imul(A,ae)|0,a=a+Math.imul(A,se)|0,i=i+Math.imul(_,fe)|0,n=(n=n+Math.imul(_,ce)|0)+Math.imul(w,fe)|0,a=a+Math.imul(w,ce)|0,i=i+Math.imul(m,he)|0,n=(n=n+Math.imul(m,de)|0)+Math.imul(g,he)|0,a=a+Math.imul(g,de)|0;var xe=(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)+(xe>>>26)|0,xe&=67108863,i=Math.imul(F,G),n=(n=Math.imul(F,W))+Math.imul(L,G)|0,a=Math.imul(L,W),i=i+Math.imul(O,J)|0,n=(n=n+Math.imul(O,Z)|0)+Math.imul(D,J)|0,a=a+Math.imul(D,Z)|0,i=i+Math.imul(C,$)|0,n=(n=n+Math.imul(C,ee)|0)+Math.imul(N,$)|0,a=a+Math.imul(N,ee)|0,i=i+Math.imul(I,re)|0,n=(n=n+Math.imul(I,ie)|0)+Math.imul(B,re)|0,a=a+Math.imul(B,ie)|0,i=i+Math.imul(x,ae)|0,n=(n=n+Math.imul(x,se)|0)+Math.imul(k,ae)|0,a=a+Math.imul(k,se)|0,i=i+Math.imul(S,fe)|0,n=(n=n+Math.imul(S,ce)|0)+Math.imul(A,fe)|0,a=a+Math.imul(A,ce)|0,i=i+Math.imul(_,he)|0,n=(n=n+Math.imul(_,de)|0)+Math.imul(w,he)|0,a=a+Math.imul(w,de)|0;var ke=(c+(i=i+Math.imul(m,pe)|0)|0)+((8191&(n=(n=n+Math.imul(m,be)|0)+Math.imul(g,pe)|0))<<13)|0;c=((a=a+Math.imul(g,be)|0)+(n>>>13)|0)+(ke>>>26)|0,ke&=67108863,i=Math.imul(F,J),n=(n=Math.imul(F,Z))+Math.imul(L,J)|0,a=Math.imul(L,Z),i=i+Math.imul(O,$)|0,n=(n=n+Math.imul(O,ee)|0)+Math.imul(D,$)|0,a=a+Math.imul(D,ee)|0,i=i+Math.imul(C,re)|0,n=(n=n+Math.imul(C,ie)|0)+Math.imul(N,re)|0,a=a+Math.imul(N,ie)|0,i=i+Math.imul(I,ae)|0,n=(n=n+Math.imul(I,se)|0)+Math.imul(B,ae)|0,a=a+Math.imul(B,se)|0,i=i+Math.imul(x,fe)|0,n=(n=n+Math.imul(x,ce)|0)+Math.imul(k,fe)|0,a=a+Math.imul(k,ce)|0,i=i+Math.imul(S,he)|0,n=(n=n+Math.imul(S,de)|0)+Math.imul(A,he)|0,a=a+Math.imul(A,de)|0;var Te=(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)+(Te>>>26)|0,Te&=67108863,i=Math.imul(F,$),n=(n=Math.imul(F,ee))+Math.imul(L,$)|0,a=Math.imul(L,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(C,ae)|0,n=(n=n+Math.imul(C,se)|0)+Math.imul(N,ae)|0,a=a+Math.imul(N,se)|0,i=i+Math.imul(I,fe)|0,n=(n=n+Math.imul(I,ce)|0)+Math.imul(B,fe)|0,a=a+Math.imul(B,ce)|0,i=i+Math.imul(x,he)|0,n=(n=n+Math.imul(x,de)|0)+Math.imul(k,he)|0,a=a+Math.imul(k,de)|0;var Ie=(c+(i=i+Math.imul(S,pe)|0)|0)+((8191&(n=(n=n+Math.imul(S,be)|0)+Math.imul(A,pe)|0))<<13)|0;c=((a=a+Math.imul(A,be)|0)+(n>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,i=Math.imul(F,re),n=(n=Math.imul(F,ie))+Math.imul(L,re)|0,a=Math.imul(L,ie),i=i+Math.imul(O,ae)|0,n=(n=n+Math.imul(O,se)|0)+Math.imul(D,ae)|0,a=a+Math.imul(D,se)|0,i=i+Math.imul(C,fe)|0,n=(n=n+Math.imul(C,ce)|0)+Math.imul(N,fe)|0,a=a+Math.imul(N,ce)|0,i=i+Math.imul(I,he)|0,n=(n=n+Math.imul(I,de)|0)+Math.imul(B,he)|0,a=a+Math.imul(B,de)|0;var Be=(c+(i=i+Math.imul(x,pe)|0)|0)+((8191&(n=(n=n+Math.imul(x,be)|0)+Math.imul(k,pe)|0))<<13)|0;c=((a=a+Math.imul(k,be)|0)+(n>>>13)|0)+(Be>>>26)|0,Be&=67108863,i=Math.imul(F,ae),n=(n=Math.imul(F,se))+Math.imul(L,ae)|0,a=Math.imul(L,se),i=i+Math.imul(O,fe)|0,n=(n=n+Math.imul(O,ce)|0)+Math.imul(D,fe)|0,a=a+Math.imul(D,ce)|0,i=i+Math.imul(C,he)|0,n=(n=n+Math.imul(C,de)|0)+Math.imul(N,he)|0,a=a+Math.imul(N,de)|0;var Re=(c+(i=i+Math.imul(I,pe)|0)|0)+((8191&(n=(n=n+Math.imul(I,be)|0)+Math.imul(B,pe)|0))<<13)|0;c=((a=a+Math.imul(B,be)|0)+(n>>>13)|0)+(Re>>>26)|0,Re&=67108863,i=Math.imul(F,fe),n=(n=Math.imul(F,ce))+Math.imul(L,fe)|0,a=Math.imul(L,ce),i=i+Math.imul(O,he)|0,n=(n=n+Math.imul(O,de)|0)+Math.imul(D,he)|0,a=a+Math.imul(D,de)|0;var Ce=(c+(i=i+Math.imul(C,pe)|0)|0)+((8191&(n=(n=n+Math.imul(C,be)|0)+Math.imul(N,pe)|0))<<13)|0;c=((a=a+Math.imul(N,be)|0)+(n>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,i=Math.imul(F,he),n=(n=Math.imul(F,de))+Math.imul(L,he)|0,a=Math.imul(L,de);var Ne=(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)+(Ne>>>26)|0,Ne&=67108863;var Pe=(c+(i=Math.imul(F,pe))|0)+((8191&(n=(n=Math.imul(F,be))+Math.imul(L,pe)|0))<<13)|0;return c=((a=Math.imul(L,be))+(n>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,f[0]=ye,f[1]=me,f[2]=ge,f[3]=ve,f[4]=_e,f[5]=we,f[6]=Ee,f[7]=Se,f[8]=Ae,f[9]=Me,f[10]=xe,f[11]=ke,f[12]=Te,f[13]=Ie,f[14]=Be,f[15]=Re,f[16]=Ce,f[17]=Ne,f[18]=Pe,0!==c&&(f[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=d),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?d(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 s=n;n=0;for(var o=67108863&i,f=Math.min(a,t.length-1),c=Math.max(0,a-e.length+1);c<=f;c++){var u=a-c,h=(0|e.words[u])*(0|t.words[c]),d=67108863&h;o=67108863&(d=d+o|0),n+=(s=(s=s+(h/67108864|0)|0)+(d>>>26)|0)>>>26,s&=67108863}r.words[a]=o,i=s,s=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 s=0;s<a;s++)i[s]=t[e[s]],n[s]=r[e[s]]},b.prototype.transform=function(e,t,r,i,n,a){this.permute(a,e,t,r,i,n);for(var s=1;s<n;s<<=1)for(var o=s<<1,f=Math.cos(2*Math.PI/o),c=Math.sin(2*Math.PI/o),u=0;u<n;u+=o)for(var h=f,d=c,l=0;l<s;l++){var p=r[u+l],b=i[u+l],y=r[u+l+s],m=i[u+l+s],g=h*y-d*m;m=h*m+d*y,y=g,r[u+l]=p+y,i[u+l]=b+m,r[u+l+s]=p-y,i[u+l+s]=b-m,l!==o&&(g=f*h-c*d,d=f*d+c*h,h=g)}},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,s=0;s<t;s++)a+=0|e[s],r[2*s]=8191&a,a>>>=13,r[2*s+1]=8191&a,a>>>=13;for(s=2*t;s<n;++s)r[s]=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),s=new Array(i),o=new Array(i),f=new Array(i),c=new Array(i),u=new Array(i),h=new Array(i),d=r.words;d.length=i,this.convert13b(e.words,e.length,s,i),this.convert13b(t.words,t.length,c,i),this.transform(s,a,o,f,i,n),this.transform(c,a,u,h,i,n);for(var l=0;l<i;l++){var p=o[l]*u[l]-f[l]*h[l];f[l]=o[l]*h[l]+f[l]*u[l],o[l]=p}return this.conjugate(o,f,i),this.transform(o,f,d,a,i,n),this.conjugate(d,a,i),this.normalize13b(d,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 s=0;for(t=0;t<this.length;t++){var o=this.words[t]&a,f=(0|this.words[t])-o<<r;this.words[t]=f|s,s=o>>>26-r}s&&(this.words[t]=s,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,s=Math.min((e-a)/26,this.length),o=67108863^67108863>>>a<<a,f=r;if(n-=s,n=Math.max(0,n),f){for(var c=0;c<s;c++)f.words[c]=this.words[c];f.length=s}if(0===s);else if(this.length>s)for(this.length-=s,c=0;c<this.length;c++)this.words[c]=this.words[c+s];else this.words[0]=0,this.length=1;var u=0;for(c=this.length-1;c>=0&&(0!==u||c>=n);c--){var h=0|this.words[c];this.words[c]=u<<26-a|h>>>a,u=h&o}return f&&0!==u&&(f.words[f.length++]=u),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,s=e.length+r;this._expand(s);var o=0;for(n=0;n<e.length;n++){a=(0|this.words[n+r])+o;var f=(0|e.words[n])*t;o=((a-=67108863&f)>>26)-(f/67108864|0),this.words[n+r]=67108863&a}for(;n<this.length-r;n++)o=(a=(0|this.words[n+r])+o)>>26,this.words[n+r]=67108863&a;if(0===o)return this.strip();for(i(-1===o),o=0,n=0;n<this.length;n++)o=(a=-(0|this.words[n])+o)>>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,s=0|n.words[n.length-1];0!==(r=26-this._countBits(s))&&(n=n.ushln(r),i.iushln(r),s=0|n.words[n.length-1]);var o,f=i.length-n.length;if("mod"!==t){(o=new a(null)).length=f+1,o.words=new Array(o.length);for(var c=0;c<o.length;c++)o.words[c]=0}var u=i.clone()._ishlnsubmul(n,1,f);0===u.negative&&(i=u,o&&(o.words[f]=1));for(var h=f-1;h>=0;h--){var d=67108864*(0|i.words[n.length+h])+(0|i.words[n.length+h-1]);for(d=Math.min(d/s|0,67108863),i._ishlnsubmul(n,d,h);0!==i.negative;)d--,i.negative=0,i._ishlnsubmul(n,1,h),i.isZero()||(i.negative^=1);o&&(o.words[h]=d)}return o&&o.strip(),i.strip(),"div"!==t&&0!==r&&i.iushrn(r),{div:o||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?(o=this.neg().divmod(e,t),"mod"!==t&&(n=o.div.neg()),"div"!==t&&(s=o.mod.neg(),r&&0!==s.negative&&s.iadd(e)),{div:n,mod:s}):0===this.negative&&0!==e.negative?(o=this.divmod(e.neg(),t),"mod"!==t&&(n=o.div.neg()),{div:n,mod:o.mod}):0!=(this.negative&e.negative)?(o=this.neg().divmod(e.neg(),t),"div"!==t&&(s=o.mod.neg(),r&&0!==s.negative&&s.isub(e)),{div:o.div,mod:s}):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,s,o},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),s=new a(0),o=new a(0),f=new a(1),c=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++c;for(var u=r.clone(),h=t.clone();!t.isZero();){for(var d=0,l=1;0==(t.words[0]&l)&&d<26;++d,l<<=1);if(d>0)for(t.iushrn(d);d-- >0;)(n.isOdd()||s.isOdd())&&(n.iadd(u),s.isub(h)),n.iushrn(1),s.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;)(o.isOdd()||f.isOdd())&&(o.iadd(u),f.isub(h)),o.iushrn(1),f.iushrn(1);t.cmp(r)>=0?(t.isub(r),n.isub(o),s.isub(f)):(r.isub(t),o.isub(n),f.isub(s))}return{a:o,b:f,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,s=new a(1),o=new a(0),f=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var c=0,u=1;0==(t.words[0]&u)&&c<26;++c,u<<=1);if(c>0)for(t.iushrn(c);c-- >0;)s.isOdd()&&s.iadd(f),s.iushrn(1);for(var h=0,d=1;0==(r.words[0]&d)&&h<26;++h,d<<=1);if(h>0)for(r.iushrn(h);h-- >0;)o.isOdd()&&o.iadd(f),o.iushrn(1);t.cmp(r)>=0?(t.isub(r),s.isub(o)):(r.isub(t),o.isub(s))}return(n=0===t.cmpn(1)?s:o).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,s=r;0!==a&&s<this.length;s++){var o=0|this.words[s];a=(o+=a)>>>26,o&=67108863,this.words[s]=o}return 0!==a&&(this.words[s]=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 E(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 m(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 g(){m.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function v(){m.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function _(){m.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function w(){m.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function E(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 S(e){E.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)}m.prototype._tmp=function(){var e=new a(null);return e.words=new Array(Math.ceil(this.n/13)),e},m.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},m.prototype.split=function(e,t){e.iushrn(this.n,0,t)},m.prototype.imulK=function(e){return e.imul(this.k)},n(g,m),g.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},g.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,m),n(_,m),n(w,m),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 g;else if("p224"===e)t=new v;else if("p192"===e)t=new _;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new w}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 a(1)).iushrn(2);return this.pow(e,r)}for(var n=this.m.subn(1),s=0;!n.isZero()&&0===n.andln(1);)s++,n.iushrn(1);i(!n.isZero());var o=new a(1).toRed(this),f=o.redNeg(),c=this.m.subn(1).iushrn(1),u=this.m.bitLength();for(u=new a(2*u*u).toRed(this);0!==this.pow(u,c).cmp(f);)u.redIAdd(f);for(var h=this.pow(u,n),d=this.pow(e,n.addn(1).iushrn(1)),l=this.pow(e,n),p=s;0!==l.cmp(o);){for(var b=l,y=0;0!==b.cmp(o);y++)b=b.redSqr();i(y<p);var m=this.pow(h,new a(1).iushln(p-y-1));d=d.redMul(m),h=m.redSqr(),l=l.redMul(h),p=y}return d},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 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],s=0,o=0,f=t.bitLength()%26;for(0===f&&(f=26),i=t.length-1;i>=0;i--){for(var c=t.words[i],u=f-1;u>=0;u--){var h=c>>u&1;n!==r[0]&&(n=this.sqr(n)),0!==h||0!==s?(s<<=1,s|=h,(4===++o||0===i&&0===u)&&(n=this.mul(n,r[s]),o=0,s=0)):o=0}f=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},a.mont=function(e){return new S(e)},n(S,E),S.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},S.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},S.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)},S.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),s=n;return n.cmp(this.m)>=0?s=n.isub(this.m):n.cmpn(0)<0&&(s=n.iadd(this.m)),s._forceRed(this)},S.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e,this)}).call(this,r(116)(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(77),n=r(78),a=r(39);function s(){return f.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function o(e,t){if(s()<t)throw new RangeError("Invalid typed array length");return f.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=f.prototype:(null===e&&(e=new f(t)),e.length=t),e}function f(e,t,r){if(!(f.TYPED_ARRAY_SUPPORT||this instanceof f))return new f(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 h(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);f.TYPED_ARRAY_SUPPORT?(e=t).__proto__=f.prototype:e=d(e,t);return e}(e,t,r,i):"string"==typeof t?function(e,t,r){"string"==typeof r&&""!==r||(r="utf8");if(!f.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var i=0|p(t,r),n=(e=o(e,i)).write(t,r);n!==i&&(e=e.slice(0,n));return e}(e,t,r):function(e,t){if(f.isBuffer(t)){var r=0|l(t.length);return 0===(e=o(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?o(e,0):d(e,t);if("Buffer"===t.type&&a(t.data))return d(e,t.data)}var i;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,t)}function u(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 h(e,t){if(u(t),e=o(e,t<0?0:0|l(t)),!f.TYPED_ARRAY_SUPPORT)for(var r=0;r<t;++r)e[r]=0;return e}function d(e,t){var r=t.length<0?0:0|l(t.length);e=o(e,r);for(var i=0;i<r;i+=1)e[i]=255&t[i];return e}function l(e){if(e>=s())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s().toString(16)+" bytes");return 0|e}function p(e,t){if(f.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 U(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return q(e).length;default:if(i)return U(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=f.from(t,i)),f.isBuffer(t))return 0===t.length?-1:m(e,t,r,i,n);if("number"==typeof t)return t&=255,f.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?n?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):m(e,[t],r,i,n);throw new TypeError("val must be string, number or Buffer")}function m(e,t,r,i,n){var a,s=1,o=e.length,f=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;s=2,o/=2,f/=2,r/=2}function c(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(n){var u=-1;for(a=r;a<o;a++)if(c(e,a)===c(t,-1===u?0:a-u)){if(-1===u&&(u=a),a-u+1===f)return u*s}else-1!==u&&(a-=a-u),u=-1}else for(r+f>o&&(r=o-f),a=r;a>=0;a--){for(var h=!0,d=0;d<f;d++)if(c(e,a+d)!==c(t,d)){h=!1;break}if(h)return a}return-1}function g(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 s=0;s<i;++s){var o=parseInt(t.substr(2*s,2),16);if(isNaN(o))return s;e[r+s]=o}return s}function v(e,t,r,i){return K(U(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 E(e,t,r,i){return K(q(t),e,r,i)}function S(e,t,r,i){return K(function(e,t){for(var r,i,n,a=[],s=0;s<e.length&&!((