>>=26,e.words[r]=i,t=n}return 0!==t&&(e.words[e.length++]=t),e},o._prime=function(e){var t;if(b[e])return b[e];if("k256"===e)t=new _;else if("p224"===e)t=new S;else if("p192"===e)t=new E;else if("p25519"===e)t=new w;else throw Error("Unknown prime "+e);return b[e]=t,t},T.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},T.prototype._verify2=function(e,t){n((e.negative|t.negative)==0,"red works only with positives"),n(e.red&&e.red===t.red,"red works only with red numbers")},T.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},T.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},T.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)},T.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},T.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return 0>r.cmpn(0)&&r.iadd(this.m),r._forceRed(this)},T.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return 0>r.cmpn(0)&&r.iadd(this.m),r},T.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},T.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},T.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},T.prototype.isqr=function(e){return this.imul(e,e.clone())},T.prototype.sqr=function(e){return this.mul(e,e)},T.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(n(t%2==1),3===t){var r=this.m.add(new o(1)).iushrn(2);return this.pow(e,r)}for(var i=this.m.subn(1),a=0;!i.isZero()&&0===i.andln(1);)a++,i.iushrn(1);n(!i.isZero());var s=new o(1).toRed(this),u=s.redNeg(),c=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new o(2*l*l).toRed(this);0!==this.pow(l,c).cmp(u);)l.redIAdd(u);for(var f=this.pow(l,i),d=this.pow(e,i.addn(1).iushrn(1)),h=this.pow(e,i),p=a;0!==h.cmp(s);){for(var m=h,y=0;0!==m.cmp(s);y++)m=m.redSqr();n(y=0;i--){for(var l=t.words[i],f=c-1;f>=0;f--){var d=l>>f&1;if(a!==n[0]&&(a=this.sqr(a)),0===d&&0===s){u=0;continue}s<<=1,s|=d,(++u===r||0===i&&0===f)&&(a=this.mul(a,n[s]),u=0,s=0)}c=26}return a},T.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},T.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},o.mont=function(e){return new x(e)},i(x,T),x.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},x.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},x.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):0>i.cmpn(0)&&(o=i.iadd(this.m)),o._forceRed(this)},x.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new o(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):0>i.cmpn(0)&&(a=i.iadd(this.m)),a._forceRed(this)},x.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=r.nmd(e),this)},1670:function(e,t,r){!function(e,t){"use strict";function n(e,t){if(!e)throw Error(t||"Assertion failed")}function i(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function o(e,t,r){if(o.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&(("le"===t||"be"===t)&&(r=t,t=10),this._init(e||0,t||10,r||"be"))}"object"==typeof e?e.exports=o:t.BN=o,o.BN=o,o.wordSize=26;try{l=r(4300).Buffer}catch(e){}function a(e,t,r){for(var i=0,o=Math.min(e.length,r),a=0,s=t;s=49&&c<=54?c-49+10:c>=17&&c<=22?c-17+10:c,a|=u}return n(!(240&a),"Invalid character in "+e),i}function s(e,t,r,i){for(var o=0,a=0,s=Math.min(e.length,r),u=t;u=49?c-49+10:c>=17?c-17+10:c,n(c>=0&&a"}o.isBN=function(e){return e instanceof o||null!==e&&"object"==typeof e&&e.constructor.wordSize===o.wordSize&&Array.isArray(e.words)},o.max=function(e,t){return e.cmp(t)>0?e:t},o.min=function(e,t){return 0>e.cmp(t)?e:t},o.prototype._init=function(e,t,r){if("number"==typeof e)return this._initNumber(e,t,r);if("object"==typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),n(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&i++,16===t?this._parseHex(e,i):this._parseBase(e,t,i),"-"===e[0]&&(this.negative=1),this._strip(),"le"===r&&this._initArray(this.toArray(),t,r)},o.prototype._initNumber=function(e,t,r){e<0&&(this.negative=1,e=-e),e<0x4000000?(this.words=[0x3ffffff&e],this.length=1):e<0x10000000000000?(this.words=[0x3ffffff&e,e/0x4000000&0x3ffffff],this.length=2):(n(e<0x20000000000000),this.words=[0x3ffffff&e,e/0x4000000&0x3ffffff,1],this.length=3),"le"===r&&this._initArray(this.toArray(),t,r)},o.prototype._initArray=function(e,t,r){if(n("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=Array(this.length);for(var i,o,a=0;a=0;a-=3)o=e[a]|e[a-1]<<8|e[a-2]<<16,this.words[i]|=o<>>26-s&0x3ffffff,(s+=24)>=26&&(s-=26,i++);else if("le"===r)for(a=0,i=0;a>>26-s&0x3ffffff,(s+=24)>=26&&(s-=26,i++);return this._strip()},o.prototype._parseHex=function(e,t){this.length=Math.ceil((e.length-t)/6),this.words=Array(this.length);for(var r,n,i=0;i=t;i-=6)n=a(e,i,i+6),this.words[r]|=n<>>26-o&4194303,(o+=24)>=26&&(o-=26,r++);i+6!==t&&(n=a(e,t,i+6),this.words[r]|=n<>>26-o&4194303),this._strip()},o.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=0x3ffffff;i*=t)n++;n--,i=i/t|0;for(var o=e.length-r,a=o%n,u=Math.min(o,o-a)+r,c=0,l=r;l1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"u">typeof Symbol&&"function"==typeof Symbol.for?o.prototype[Symbol.for("nodejs.util.inspect.custom")]=c:o.prototype.inspect=c;var l,f=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],d=[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,0x2000000,0x290d741,0x1000000,0x2e90edd,0x39aa400,0x267bf47,0x1000000,0x290d741,1e7,0x12959c3,0x222c000,0x3bd7765,7529536,0xadcea1,0x1000000,0x1704f61,0x206fc40,0x2cddcf9,64e6,4084101,5153632,6436343,7962624,9765625,0xb54ba0,0xdaf26b,0x1069c00,0x138f9ad,243e5,0x1b4d89f,0x2000000,0x25528a1,0x2b54a20,0x3216b93,0x39aa400];o.prototype.toString=function(e,t){if(t=0|t||1,16===(e=e||10)||"hex"===e){for(var r="",i=0,o=0,a=0;a>>24-i&0xffffff)||a!==this.length-1?f[6-u.length]+u+r:u+r,(i+=2)>=26&&(i-=26,a--)}for(0!==o&&(r=o.toString(16)+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var c=d[e],l=h[e];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modrn(l).toString(e);r=(p=p.idivn(l)).isZero()?m+r:f[c-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=0x4000000*this.words[1]:3===this.length&&1===this.words[2]?e+=0x10000000000000+0x4000000*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},o.prototype.toJSON=function(){return this.toString(16,2)},l&&(o.prototype.toBuffer=function(e,t){return this.toArrayLike(l,e,t)}),o.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)};var p=function(e,t){return e.allocUnsafe?e.allocUnsafe(t):new e(t)};function m(e){for(var t=Array(e.bitLength()),r=0;r>>i&1}return t}function y(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var i=0|e.words[0],o=0|t.words[0],a=i*o,s=0x3ffffff&a,u=a/0x4000000|0;r.words[0]=s;for(var c=1;c>>26,f=0x3ffffff&u,d=Math.min(c,t.length-1),h=Math.max(0,c-e.length+1);h<=d;h++){var p=c-h|0;l+=(a=(i=0|e.words[p])*(o=0|t.words[h])+f)/0x4000000|0,f=0x3ffffff&a}r.words[c]=0|f,u=0|l}return 0!==u?r.words[c]=0|u:r.length--,r._strip()}o.prototype.toArrayLike=function(e,t,r){this._strip();var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0");var a=p(e,o);return this["_toArrayLike"+("le"===t?"LE":"BE")](a,i),a},o.prototype._toArrayLikeLE=function(e,t){for(var r=0,n=0,i=0,o=0;i>8&255),r>16&255),6===o?(r>24&255),n=0,o=0):(n=a>>>24,o+=2)}if(r=0&&(e[r--]=a>>8&255),r>=0&&(e[r--]=a>>16&255),6===o?(r>=0&&(e[r--]=a>>24&255),n=0,o=0):(n=a>>>24,o+=2)}if(r>=0)for(e[r--]=n;r>=0;)e[r--]=0},Math.clz32?o.prototype._countBits=function(e){return 32-Math.clz32(e)}:o.prototype._countBits=function(e){var t=e,r=0;return t>=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},o.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return(8191&t)==0&&(r+=13,t>>>=13),(127&t)==0&&(r+=7,t>>>=7),(15&t)==0&&(r+=4,t>>>=4),(3&t)==0&&(r+=2,t>>>=2),(1&t)==0&&r++,r},o.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return(this.length-1)*26+t},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},o.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},o.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;re.length?this.clone().iand(e):e.clone().iand(this)},o.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},o.prototype.iuxor=function(e){this.length>e.length?(t=this,r=e):(t=e,r=this);for(var t,r,n=0;ne.length?this.clone().ixor(e):e.clone().ixor(this)},o.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},o.prototype.inotn=function(e){n("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var i=0;i0&&(this.words[i]=~this.words[i]&0x3ffffff>>26-r),this._strip()},o.prototype.notn=function(e){return this.clone().inotn(e)},o.prototype.setn=function(e,t){n("number"==typeof e&&e>=0);var r=e/26|0,i=e%26;return this._expand(r+1),t?this.words[r]=this.words[r]|1<e.length?(r=this,n=e):(r=e,n=this);for(var t,r,n,i=0,o=0;o>>26;for(;0!==i&&o>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;oe.length?this.clone().iadd(e):e.clone().iadd(this)},o.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t,r,n=this.iadd(e);return e.negative=1,n._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(t=this,r=e):(t=e,r=this);for(var o=0,a=0;a>26,this.words[a]=0x3ffffff&n;for(;0!==o&&a>26,this.words[a]=0x3ffffff&n;if(0===o&&a>>13,h=0|a[1],p=8191&h,m=h>>>13,y=0|a[2],g=8191&y,b=y>>>13,v=0|a[3],_=8191&v,S=v>>>13,E=0|a[4],w=8191&E,T=E>>>13,x=0|a[5],A=8191&x,O=x>>>13,M=0|a[6],R=8191&M,C=M>>>13,I=0|a[7],N=8191&I,P=I>>>13,k=0|a[8],D=8191&k,L=k>>>13,j=0|a[9],U=8191&j,B=j>>>13,F=0|s[0],z=8191&F,$=F>>>13,V=0|s[1],Y=8191&V,q=V>>>13,H=0|s[2],W=8191&H,G=H>>>13,Z=0|s[3],K=8191&Z,X=Z>>>13,J=0|s[4],Q=8191&J,ee=J>>>13,et=0|s[5],er=8191&et,en=et>>>13,ei=0|s[6],eo=8191&ei,ea=ei>>>13,es=0|s[7],eu=8191&es,ec=es>>>13,el=0|s[8],ef=8191&el,ed=el>>>13,eh=0|s[9],ep=8191&eh,em=eh>>>13;r.negative=e.negative^t.negative,r.length=19,n=Math.imul(f,z);var ey=(c+n|0)+((8191&(i=(i=Math.imul(f,$))+Math.imul(d,z)|0))<<13)|0;c=((o=Math.imul(d,$))+(i>>>13)|0)+(ey>>>26)|0,ey&=0x3ffffff,n=Math.imul(p,z),i=(i=Math.imul(p,$))+Math.imul(m,z)|0,o=Math.imul(m,$),n=n+Math.imul(f,Y)|0;var eg=(c+n|0)+((8191&(i=(i=i+Math.imul(f,q)|0)+Math.imul(d,Y)|0))<<13)|0;c=((o=o+Math.imul(d,q)|0)+(i>>>13)|0)+(eg>>>26)|0,eg&=0x3ffffff,n=Math.imul(g,z),i=(i=Math.imul(g,$))+Math.imul(b,z)|0,o=Math.imul(b,$),n=n+Math.imul(p,Y)|0,i=(i=i+Math.imul(p,q)|0)+Math.imul(m,Y)|0,o=o+Math.imul(m,q)|0,n=n+Math.imul(f,W)|0;var eb=(c+n|0)+((8191&(i=(i=i+Math.imul(f,G)|0)+Math.imul(d,W)|0))<<13)|0;c=((o=o+Math.imul(d,G)|0)+(i>>>13)|0)+(eb>>>26)|0,eb&=0x3ffffff,n=Math.imul(_,z),i=(i=Math.imul(_,$))+Math.imul(S,z)|0,o=Math.imul(S,$),n=n+Math.imul(g,Y)|0,i=(i=i+Math.imul(g,q)|0)+Math.imul(b,Y)|0,o=o+Math.imul(b,q)|0,n=n+Math.imul(p,W)|0,i=(i=i+Math.imul(p,G)|0)+Math.imul(m,W)|0,o=o+Math.imul(m,G)|0,n=n+Math.imul(f,K)|0;var ev=(c+n|0)+((8191&(i=(i=i+Math.imul(f,X)|0)+Math.imul(d,K)|0))<<13)|0;c=((o=o+Math.imul(d,X)|0)+(i>>>13)|0)+(ev>>>26)|0,ev&=0x3ffffff,n=Math.imul(w,z),i=(i=Math.imul(w,$))+Math.imul(T,z)|0,o=Math.imul(T,$),n=n+Math.imul(_,Y)|0,i=(i=i+Math.imul(_,q)|0)+Math.imul(S,Y)|0,o=o+Math.imul(S,q)|0,n=n+Math.imul(g,W)|0,i=(i=i+Math.imul(g,G)|0)+Math.imul(b,W)|0,o=o+Math.imul(b,G)|0,n=n+Math.imul(p,K)|0,i=(i=i+Math.imul(p,X)|0)+Math.imul(m,K)|0,o=o+Math.imul(m,X)|0,n=n+Math.imul(f,Q)|0;var e_=(c+n|0)+((8191&(i=(i=i+Math.imul(f,ee)|0)+Math.imul(d,Q)|0))<<13)|0;c=((o=o+Math.imul(d,ee)|0)+(i>>>13)|0)+(e_>>>26)|0,e_&=0x3ffffff,n=Math.imul(A,z),i=(i=Math.imul(A,$))+Math.imul(O,z)|0,o=Math.imul(O,$),n=n+Math.imul(w,Y)|0,i=(i=i+Math.imul(w,q)|0)+Math.imul(T,Y)|0,o=o+Math.imul(T,q)|0,n=n+Math.imul(_,W)|0,i=(i=i+Math.imul(_,G)|0)+Math.imul(S,W)|0,o=o+Math.imul(S,G)|0,n=n+Math.imul(g,K)|0,i=(i=i+Math.imul(g,X)|0)+Math.imul(b,K)|0,o=o+Math.imul(b,X)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,ee)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,ee)|0,n=n+Math.imul(f,er)|0;var eS=(c+n|0)+((8191&(i=(i=i+Math.imul(f,en)|0)+Math.imul(d,er)|0))<<13)|0;c=((o=o+Math.imul(d,en)|0)+(i>>>13)|0)+(eS>>>26)|0,eS&=0x3ffffff,n=Math.imul(R,z),i=(i=Math.imul(R,$))+Math.imul(C,z)|0,o=Math.imul(C,$),n=n+Math.imul(A,Y)|0,i=(i=i+Math.imul(A,q)|0)+Math.imul(O,Y)|0,o=o+Math.imul(O,q)|0,n=n+Math.imul(w,W)|0,i=(i=i+Math.imul(w,G)|0)+Math.imul(T,W)|0,o=o+Math.imul(T,G)|0,n=n+Math.imul(_,K)|0,i=(i=i+Math.imul(_,X)|0)+Math.imul(S,K)|0,o=o+Math.imul(S,X)|0,n=n+Math.imul(g,Q)|0,i=(i=i+Math.imul(g,ee)|0)+Math.imul(b,Q)|0,o=o+Math.imul(b,ee)|0,n=n+Math.imul(p,er)|0,i=(i=i+Math.imul(p,en)|0)+Math.imul(m,er)|0,o=o+Math.imul(m,en)|0,n=n+Math.imul(f,eo)|0;var eE=(c+n|0)+((8191&(i=(i=i+Math.imul(f,ea)|0)+Math.imul(d,eo)|0))<<13)|0;c=((o=o+Math.imul(d,ea)|0)+(i>>>13)|0)+(eE>>>26)|0,eE&=0x3ffffff,n=Math.imul(N,z),i=(i=Math.imul(N,$))+Math.imul(P,z)|0,o=Math.imul(P,$),n=n+Math.imul(R,Y)|0,i=(i=i+Math.imul(R,q)|0)+Math.imul(C,Y)|0,o=o+Math.imul(C,q)|0,n=n+Math.imul(A,W)|0,i=(i=i+Math.imul(A,G)|0)+Math.imul(O,W)|0,o=o+Math.imul(O,G)|0,n=n+Math.imul(w,K)|0,i=(i=i+Math.imul(w,X)|0)+Math.imul(T,K)|0,o=o+Math.imul(T,X)|0,n=n+Math.imul(_,Q)|0,i=(i=i+Math.imul(_,ee)|0)+Math.imul(S,Q)|0,o=o+Math.imul(S,ee)|0,n=n+Math.imul(g,er)|0,i=(i=i+Math.imul(g,en)|0)+Math.imul(b,er)|0,o=o+Math.imul(b,en)|0,n=n+Math.imul(p,eo)|0,i=(i=i+Math.imul(p,ea)|0)+Math.imul(m,eo)|0,o=o+Math.imul(m,ea)|0,n=n+Math.imul(f,eu)|0;var ew=(c+n|0)+((8191&(i=(i=i+Math.imul(f,ec)|0)+Math.imul(d,eu)|0))<<13)|0;c=((o=o+Math.imul(d,ec)|0)+(i>>>13)|0)+(ew>>>26)|0,ew&=0x3ffffff,n=Math.imul(D,z),i=(i=Math.imul(D,$))+Math.imul(L,z)|0,o=Math.imul(L,$),n=n+Math.imul(N,Y)|0,i=(i=i+Math.imul(N,q)|0)+Math.imul(P,Y)|0,o=o+Math.imul(P,q)|0,n=n+Math.imul(R,W)|0,i=(i=i+Math.imul(R,G)|0)+Math.imul(C,W)|0,o=o+Math.imul(C,G)|0,n=n+Math.imul(A,K)|0,i=(i=i+Math.imul(A,X)|0)+Math.imul(O,K)|0,o=o+Math.imul(O,X)|0,n=n+Math.imul(w,Q)|0,i=(i=i+Math.imul(w,ee)|0)+Math.imul(T,Q)|0,o=o+Math.imul(T,ee)|0,n=n+Math.imul(_,er)|0,i=(i=i+Math.imul(_,en)|0)+Math.imul(S,er)|0,o=o+Math.imul(S,en)|0,n=n+Math.imul(g,eo)|0,i=(i=i+Math.imul(g,ea)|0)+Math.imul(b,eo)|0,o=o+Math.imul(b,ea)|0,n=n+Math.imul(p,eu)|0,i=(i=i+Math.imul(p,ec)|0)+Math.imul(m,eu)|0,o=o+Math.imul(m,ec)|0,n=n+Math.imul(f,ef)|0;var eT=(c+n|0)+((8191&(i=(i=i+Math.imul(f,ed)|0)+Math.imul(d,ef)|0))<<13)|0;c=((o=o+Math.imul(d,ed)|0)+(i>>>13)|0)+(eT>>>26)|0,eT&=0x3ffffff,n=Math.imul(U,z),i=(i=Math.imul(U,$))+Math.imul(B,z)|0,o=Math.imul(B,$),n=n+Math.imul(D,Y)|0,i=(i=i+Math.imul(D,q)|0)+Math.imul(L,Y)|0,o=o+Math.imul(L,q)|0,n=n+Math.imul(N,W)|0,i=(i=i+Math.imul(N,G)|0)+Math.imul(P,W)|0,o=o+Math.imul(P,G)|0,n=n+Math.imul(R,K)|0,i=(i=i+Math.imul(R,X)|0)+Math.imul(C,K)|0,o=o+Math.imul(C,X)|0,n=n+Math.imul(A,Q)|0,i=(i=i+Math.imul(A,ee)|0)+Math.imul(O,Q)|0,o=o+Math.imul(O,ee)|0,n=n+Math.imul(w,er)|0,i=(i=i+Math.imul(w,en)|0)+Math.imul(T,er)|0,o=o+Math.imul(T,en)|0,n=n+Math.imul(_,eo)|0,i=(i=i+Math.imul(_,ea)|0)+Math.imul(S,eo)|0,o=o+Math.imul(S,ea)|0,n=n+Math.imul(g,eu)|0,i=(i=i+Math.imul(g,ec)|0)+Math.imul(b,eu)|0,o=o+Math.imul(b,ec)|0,n=n+Math.imul(p,ef)|0,i=(i=i+Math.imul(p,ed)|0)+Math.imul(m,ef)|0,o=o+Math.imul(m,ed)|0,n=n+Math.imul(f,ep)|0;var ex=(c+n|0)+((8191&(i=(i=i+Math.imul(f,em)|0)+Math.imul(d,ep)|0))<<13)|0;c=((o=o+Math.imul(d,em)|0)+(i>>>13)|0)+(ex>>>26)|0,ex&=0x3ffffff,n=Math.imul(U,Y),i=(i=Math.imul(U,q))+Math.imul(B,Y)|0,o=Math.imul(B,q),n=n+Math.imul(D,W)|0,i=(i=i+Math.imul(D,G)|0)+Math.imul(L,W)|0,o=o+Math.imul(L,G)|0,n=n+Math.imul(N,K)|0,i=(i=i+Math.imul(N,X)|0)+Math.imul(P,K)|0,o=o+Math.imul(P,X)|0,n=n+Math.imul(R,Q)|0,i=(i=i+Math.imul(R,ee)|0)+Math.imul(C,Q)|0,o=o+Math.imul(C,ee)|0,n=n+Math.imul(A,er)|0,i=(i=i+Math.imul(A,en)|0)+Math.imul(O,er)|0,o=o+Math.imul(O,en)|0,n=n+Math.imul(w,eo)|0,i=(i=i+Math.imul(w,ea)|0)+Math.imul(T,eo)|0,o=o+Math.imul(T,ea)|0,n=n+Math.imul(_,eu)|0,i=(i=i+Math.imul(_,ec)|0)+Math.imul(S,eu)|0,o=o+Math.imul(S,ec)|0,n=n+Math.imul(g,ef)|0,i=(i=i+Math.imul(g,ed)|0)+Math.imul(b,ef)|0,o=o+Math.imul(b,ed)|0,n=n+Math.imul(p,ep)|0;var eA=(c+n|0)+((8191&(i=(i=i+Math.imul(p,em)|0)+Math.imul(m,ep)|0))<<13)|0;c=((o=o+Math.imul(m,em)|0)+(i>>>13)|0)+(eA>>>26)|0,eA&=0x3ffffff,n=Math.imul(U,W),i=(i=Math.imul(U,G))+Math.imul(B,W)|0,o=Math.imul(B,G),n=n+Math.imul(D,K)|0,i=(i=i+Math.imul(D,X)|0)+Math.imul(L,K)|0,o=o+Math.imul(L,X)|0,n=n+Math.imul(N,Q)|0,i=(i=i+Math.imul(N,ee)|0)+Math.imul(P,Q)|0,o=o+Math.imul(P,ee)|0,n=n+Math.imul(R,er)|0,i=(i=i+Math.imul(R,en)|0)+Math.imul(C,er)|0,o=o+Math.imul(C,en)|0,n=n+Math.imul(A,eo)|0,i=(i=i+Math.imul(A,ea)|0)+Math.imul(O,eo)|0,o=o+Math.imul(O,ea)|0,n=n+Math.imul(w,eu)|0,i=(i=i+Math.imul(w,ec)|0)+Math.imul(T,eu)|0,o=o+Math.imul(T,ec)|0,n=n+Math.imul(_,ef)|0,i=(i=i+Math.imul(_,ed)|0)+Math.imul(S,ef)|0,o=o+Math.imul(S,ed)|0,n=n+Math.imul(g,ep)|0;var eO=(c+n|0)+((8191&(i=(i=i+Math.imul(g,em)|0)+Math.imul(b,ep)|0))<<13)|0;c=((o=o+Math.imul(b,em)|0)+(i>>>13)|0)+(eO>>>26)|0,eO&=0x3ffffff,n=Math.imul(U,K),i=(i=Math.imul(U,X))+Math.imul(B,K)|0,o=Math.imul(B,X),n=n+Math.imul(D,Q)|0,i=(i=i+Math.imul(D,ee)|0)+Math.imul(L,Q)|0,o=o+Math.imul(L,ee)|0,n=n+Math.imul(N,er)|0,i=(i=i+Math.imul(N,en)|0)+Math.imul(P,er)|0,o=o+Math.imul(P,en)|0,n=n+Math.imul(R,eo)|0,i=(i=i+Math.imul(R,ea)|0)+Math.imul(C,eo)|0,o=o+Math.imul(C,ea)|0,n=n+Math.imul(A,eu)|0,i=(i=i+Math.imul(A,ec)|0)+Math.imul(O,eu)|0,o=o+Math.imul(O,ec)|0,n=n+Math.imul(w,ef)|0,i=(i=i+Math.imul(w,ed)|0)+Math.imul(T,ef)|0,o=o+Math.imul(T,ed)|0,n=n+Math.imul(_,ep)|0;var eM=(c+n|0)+((8191&(i=(i=i+Math.imul(_,em)|0)+Math.imul(S,ep)|0))<<13)|0;c=((o=o+Math.imul(S,em)|0)+(i>>>13)|0)+(eM>>>26)|0,eM&=0x3ffffff,n=Math.imul(U,Q),i=(i=Math.imul(U,ee))+Math.imul(B,Q)|0,o=Math.imul(B,ee),n=n+Math.imul(D,er)|0,i=(i=i+Math.imul(D,en)|0)+Math.imul(L,er)|0,o=o+Math.imul(L,en)|0,n=n+Math.imul(N,eo)|0,i=(i=i+Math.imul(N,ea)|0)+Math.imul(P,eo)|0,o=o+Math.imul(P,ea)|0,n=n+Math.imul(R,eu)|0,i=(i=i+Math.imul(R,ec)|0)+Math.imul(C,eu)|0,o=o+Math.imul(C,ec)|0,n=n+Math.imul(A,ef)|0,i=(i=i+Math.imul(A,ed)|0)+Math.imul(O,ef)|0,o=o+Math.imul(O,ed)|0,n=n+Math.imul(w,ep)|0;var eR=(c+n|0)+((8191&(i=(i=i+Math.imul(w,em)|0)+Math.imul(T,ep)|0))<<13)|0;c=((o=o+Math.imul(T,em)|0)+(i>>>13)|0)+(eR>>>26)|0,eR&=0x3ffffff,n=Math.imul(U,er),i=(i=Math.imul(U,en))+Math.imul(B,er)|0,o=Math.imul(B,en),n=n+Math.imul(D,eo)|0,i=(i=i+Math.imul(D,ea)|0)+Math.imul(L,eo)|0,o=o+Math.imul(L,ea)|0,n=n+Math.imul(N,eu)|0,i=(i=i+Math.imul(N,ec)|0)+Math.imul(P,eu)|0,o=o+Math.imul(P,ec)|0,n=n+Math.imul(R,ef)|0,i=(i=i+Math.imul(R,ed)|0)+Math.imul(C,ef)|0,o=o+Math.imul(C,ed)|0,n=n+Math.imul(A,ep)|0;var eC=(c+n|0)+((8191&(i=(i=i+Math.imul(A,em)|0)+Math.imul(O,ep)|0))<<13)|0;c=((o=o+Math.imul(O,em)|0)+(i>>>13)|0)+(eC>>>26)|0,eC&=0x3ffffff,n=Math.imul(U,eo),i=(i=Math.imul(U,ea))+Math.imul(B,eo)|0,o=Math.imul(B,ea),n=n+Math.imul(D,eu)|0,i=(i=i+Math.imul(D,ec)|0)+Math.imul(L,eu)|0,o=o+Math.imul(L,ec)|0,n=n+Math.imul(N,ef)|0,i=(i=i+Math.imul(N,ed)|0)+Math.imul(P,ef)|0,o=o+Math.imul(P,ed)|0,n=n+Math.imul(R,ep)|0;var eI=(c+n|0)+((8191&(i=(i=i+Math.imul(R,em)|0)+Math.imul(C,ep)|0))<<13)|0;c=((o=o+Math.imul(C,em)|0)+(i>>>13)|0)+(eI>>>26)|0,eI&=0x3ffffff,n=Math.imul(U,eu),i=(i=Math.imul(U,ec))+Math.imul(B,eu)|0,o=Math.imul(B,ec),n=n+Math.imul(D,ef)|0,i=(i=i+Math.imul(D,ed)|0)+Math.imul(L,ef)|0,o=o+Math.imul(L,ed)|0,n=n+Math.imul(N,ep)|0;var eN=(c+n|0)+((8191&(i=(i=i+Math.imul(N,em)|0)+Math.imul(P,ep)|0))<<13)|0;c=((o=o+Math.imul(P,em)|0)+(i>>>13)|0)+(eN>>>26)|0,eN&=0x3ffffff,n=Math.imul(U,ef),i=(i=Math.imul(U,ed))+Math.imul(B,ef)|0,o=Math.imul(B,ed),n=n+Math.imul(D,ep)|0;var eP=(c+n|0)+((8191&(i=(i=i+Math.imul(D,em)|0)+Math.imul(L,ep)|0))<<13)|0;c=((o=o+Math.imul(L,em)|0)+(i>>>13)|0)+(eP>>>26)|0,eP&=0x3ffffff,n=Math.imul(U,ep);var ek=(c+n|0)+((8191&(i=(i=Math.imul(U,em))+Math.imul(B,ep)|0))<<13)|0;return c=((o=Math.imul(B,em))+(i>>>13)|0)+(ek>>>26)|0,ek&=0x3ffffff,u[0]=ey,u[1]=eg,u[2]=eb,u[3]=ev,u[4]=e_,u[5]=eS,u[6]=eE,u[7]=ew,u[8]=eT,u[9]=ex,u[10]=eA,u[11]=eO,u[12]=eM,u[13]=eR,u[14]=eC,u[15]=eI,u[16]=eN,u[17]=eP,u[18]=ek,0!==c&&(u[19]=c,r.length++),r};function b(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,i=0,o=0;o>>26)|0)>>>26,a&=0x3ffffff}r.words[o]=s,n=a,a=i}return 0!==n?r.words[o]=n:r.length--,r._strip()}function v(e,t,r){return b(e,t,r)}function _(e,t){this.x=e,this.y=t}Math.imul||(g=y),o.prototype.mulTo=function(e,t){var r=this.length+e.length;return 10===this.length&&10===e.length?g(this,e,t):r<63?y(this,e,t):r<1024?b(this,e,t):v(this,e,t)},_.prototype.makeRBT=function(e){for(var t=Array(e),r=o.prototype._countBits(e)-1,n=0;n>=1;return n},_.prototype.permute=function(e,t,r,n,i,o){for(var a=0;a>>=1)i++;return 1<>>=13,r[2*a+1]=8191&o,o>>>=13;for(a=2*t;a>=26,r+=(o/0x4000000|0)+(a>>>26),this.words[i]=0x3ffffff&a}return 0!==r&&(this.words[i]=r,this.length++),t?this.ineg():this},o.prototype.muln=function(e){return this.clone().imuln(e)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(e){var t=m(e);if(0===t.length)return new o(1);for(var r=this,n=0;n=0);var t,r=e%26,i=(e-r)/26,o=0x3ffffff>>>26-r<<26-r;if(0!==r){var a=0;for(t=0;t>>26-r}a&&(this.words[t]=a,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t=0);var i=t?(t-t%26)/26:0,o=e%26,a=Math.min((e-o)/26,this.length),s=0x3ffffff^0x3ffffff>>>o<a)for(this.length-=a,c=0;c=0&&(0!==l||c>=i);c--){var f=0|this.words[c];this.words[c]=l<<26-o|f>>>o,l=f&s}return u&&0!==l&&(u.words[u.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},o.prototype.ishrn=function(e,t,r){return n(0===this.negative),this.iushrn(e,t,r)},o.prototype.shln=function(e){return this.clone().ishln(e)},o.prototype.ushln=function(e){return this.clone().iushln(e)},o.prototype.shrn=function(e){return this.clone().ishrn(e)},o.prototype.ushrn=function(e){return this.clone().iushrn(e)},o.prototype.testn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26,i=1<=0);var t=e%26,r=(e-t)/26;if(n(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 i=0x3ffffff^0x3ffffff>>>t<=0x4000000;t++)this.words[t]-=0x4000000,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},o.prototype.isubn=function(e){if(n("number"==typeof e),n(e<0x4000000),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>26)-(u/0x4000000|0),this.words[i+r]=0x3ffffff&o}for(;i>26,this.words[i+r]=0x3ffffff&o;if(0===s)return this._strip();for(n(-1===s),s=0,i=0;i>26,this.words[i]=0x3ffffff&o;return this.negative=1,this._strip()},o.prototype._wordDiv=function(e,t){var r,n=this.length-e.length,i=this.clone(),a=e,s=0|a.words[a.length-1];0!=(n=26-this._countBits(s))&&(a=a.ushln(n),i.iushln(n),s=0|a.words[a.length-1]);var u=i.length-a.length;if("mod"!==t){(r=new o(null)).length=u+1,r.words=Array(r.length);for(var c=0;c=0;f--){var d=(0|i.words[a.length+f])*0x4000000+(0|i.words[a.length+f-1]);for(d=Math.min(d/s|0,0x3ffffff),i._ishlnsubmul(a,d,f);0!==i.negative;)d--,i.negative=0,i._ishlnsubmul(a,1,f),i.isZero()||(i.negative^=1);r&&(r.words[f]=d)}return r&&r._strip(),i._strip(),"div"!==t&&0!==n&&i.iushrn(n),{div:r||null,mod:i}},o.prototype.divmod=function(e,t,r){var i,a,s;return(n(!e.isZero()),this.isZero())?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(i=s.div.neg()),"div"!==t&&(a=s.mod.neg(),r&&0!==a.negative&&a.iadd(e)),{div:i,mod:a}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(i=s.div.neg()),{div:i,mod:s.mod}):(this.negative&e.negative)!=0?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(a=s.mod.neg(),r&&0!==a.negative&&a.isub(e)),{div:s.div,mod:a}):e.length>this.length||0>this.cmp(e)?{div:new o(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new o(this.modrn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new o(this.modrn(e.words[0]))}:this._wordDiv(e,t)},o.prototype.div=function(e){return this.divmod(e,"div",!1).div},o.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},o.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},o.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),i=e.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},o.prototype.modrn=function(e){var t=e<0;t&&(e=-e),n(e<=0x3ffffff);for(var r=0x4000000%e,i=0,o=this.length-1;o>=0;o--)i=(r*i+(0|this.words[o]))%e;return t?-i:i},o.prototype.modn=function(e){return this.modrn(e)},o.prototype.idivn=function(e){var t=e<0;t&&(e=-e),n(e<=0x3ffffff);for(var r=0,i=this.length-1;i>=0;i--){var o=(0|this.words[i])+0x4000000*r;this.words[i]=o/e|0,r=o%e}return this._strip(),t?this.ineg():this},o.prototype.divn=function(e){return this.clone().idivn(e)},o.prototype.egcd=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new o(1),a=new o(0),s=new o(0),u=new o(1),c=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++c;for(var l=r.clone(),f=t.clone();!t.isZero();){for(var d=0,h=1;(t.words[0]&h)==0&&d<26;++d,h<<=1);if(d>0)for(t.iushrn(d);d-- >0;)(i.isOdd()||a.isOdd())&&(i.iadd(l),a.isub(f)),i.iushrn(1),a.iushrn(1);for(var p=0,m=1;(r.words[0]&m)==0&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(s.isOdd()||u.isOdd())&&(s.iadd(l),u.isub(f)),s.iushrn(1),u.iushrn(1);t.cmp(r)>=0?(t.isub(r),i.isub(s),a.isub(u)):(r.isub(t),s.isub(i),u.isub(a))}return{a:s,b:u,gcd:r.iushln(c)}},o.prototype._invmp=function(e){n(0===e.negative),n(!e.isZero());var t,r=this,i=e.clone();r=0!==r.negative?r.umod(e):r.clone();for(var a=new o(1),s=new o(0),u=i.clone();r.cmpn(1)>0&&i.cmpn(1)>0;){for(var c=0,l=1;(r.words[0]&l)==0&&c<26;++c,l<<=1);if(c>0)for(r.iushrn(c);c-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);for(var f=0,d=1;(i.words[0]&d)==0&&f<26;++f,d<<=1);if(f>0)for(i.iushrn(f);f-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);r.cmp(i)>=0?(r.isub(i),a.isub(s)):(i.isub(r),s.isub(a))}return 0>(t=0===r.cmpn(1)?a:s).cmpn(0)&&t.iadd(e),t},o.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=t.cmp(r);if(i<0){var o=t;t=r,r=o}else if(0===i||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},o.prototype.invm=function(e){return this.egcd(e).a.umod(e)},o.prototype.isEven=function(){return(1&this.words[0])==0},o.prototype.isOdd=function(){return(1&this.words[0])==1},o.prototype.andln=function(e){return this.words[0]&e},o.prototype.bincn=function(e){n("number"==typeof e);var t=e%26,r=(e-t)/26,i=1<>>26,s&=0x3ffffff,this.words[a]=s}return 0!==o&&(this.words[a]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return -1;if(0===this.negative&&r)return 1;if(this._strip(),this.length>1)t=1;else{r&&(e=-e),n(e<=0x3ffffff,"Number is too big");var i=0|this.words[0];t=i===e?0:ie.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|e.words[r];if(n!==i){ni&&(t=1);break}}return t},o.prototype.gtn=function(e){return 1===this.cmpn(e)},o.prototype.gt=function(e){return 1===this.cmp(e)},o.prototype.gten=function(e){return this.cmpn(e)>=0},o.prototype.gte=function(e){return this.cmp(e)>=0},o.prototype.ltn=function(e){return -1===this.cmpn(e)},o.prototype.lt=function(e){return -1===this.cmp(e)},o.prototype.lten=function(e){return 0>=this.cmpn(e)},o.prototype.lte=function(e){return 0>=this.cmp(e)},o.prototype.eqn=function(e){return 0===this.cmpn(e)},o.prototype.eq=function(e){return 0===this.cmp(e)},o.red=function(e){return new O(e)},o.prototype.toRed=function(e){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(e){return this.red=e,this},o.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},o.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},o.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},o.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},o.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},o.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},o.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},o.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var S={k256:null,p224:null,p192:null,p25519:null};function E(e,t){this.name=e,this.p=new o(t,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function w(){E.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function T(){E.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function x(){E.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function A(){E.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function O(e){if("string"==typeof e){var t=o._prime(e);this.m=t.p,this.prime=t}else n(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function M(e){O.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}E.prototype._tmp=function(){var e=new o(null);return e.words=Array(Math.ceil(this.n/13)),e},E.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 n=t0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},E.prototype.split=function(e,t){e.iushrn(this.n,0,t)},E.prototype.imulK=function(e){return e.imul(this.k)},i(w,E),w.prototype.split=function(e,t){for(var r=4194303,n=Math.min(e.length,9),i=0;i>>22,o=a}o>>>=22,e.words[i-10]=o,0===o&&e.length>10?e.length-=10:e.length-=9},w.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>>=26,e.words[r]=i,t=n}return 0!==t&&(e.words[e.length++]=t),e},o._prime=function(e){var t;if(S[e])return S[e];if("k256"===e)t=new w;else if("p224"===e)t=new T;else if("p192"===e)t=new x;else if("p25519"===e)t=new A;else throw Error("Unknown prime "+e);return S[e]=t,t},O.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},O.prototype._verify2=function(e,t){n((e.negative|t.negative)==0,"red works only with positives"),n(e.red&&e.red===t.red,"red works only with red numbers")},O.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):(u(e,e.umod(this.m)._forceRed(this)),e)},O.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},O.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)},O.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},O.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return 0>r.cmpn(0)&&r.iadd(this.m),r._forceRed(this)},O.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return 0>r.cmpn(0)&&r.iadd(this.m),r},O.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},O.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},O.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},O.prototype.isqr=function(e){return this.imul(e,e.clone())},O.prototype.sqr=function(e){return this.mul(e,e)},O.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(n(t%2==1),3===t){var r=this.m.add(new o(1)).iushrn(2);return this.pow(e,r)}for(var i=this.m.subn(1),a=0;!i.isZero()&&0===i.andln(1);)a++,i.iushrn(1);n(!i.isZero());var s=new o(1).toRed(this),u=s.redNeg(),c=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new o(2*l*l).toRed(this);0!==this.pow(l,c).cmp(u);)l.redIAdd(u);for(var f=this.pow(l,i),d=this.pow(e,i.addn(1).iushrn(1)),h=this.pow(e,i),p=a;0!==h.cmp(s);){for(var m=h,y=0;0!==m.cmp(s);y++)m=m.redSqr();n(y=0;i--){for(var l=t.words[i],f=c-1;f>=0;f--){var d=l>>f&1;if(a!==n[0]&&(a=this.sqr(a)),0===d&&0===s){u=0;continue}s<<=1,s|=d,(++u===r||0===i&&0===f)&&(a=this.mul(a,n[s]),u=0,s=0)}c=26}return a},O.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},O.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},o.mont=function(e){return new M(e)},i(M,O),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),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):0>i.cmpn(0)&&(o=i.iadd(this.m)),o._forceRed(this)},M.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new o(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):0>i.cmpn(0)&&(a=i.iadd(this.m)),a._forceRed(this)},M.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=r.nmd(e),this)},3500:function(e,t,r){var n;function i(e){this.rand=e}if(e.exports=function(e){return n||(n=new i(null)),n.generate(e)},e.exports.Rand=i,i.prototype.generate=function(e){return this._rand(e)},i.prototype._rand=function(e){if(this.rand.getBytes)return this.rand.getBytes(e);for(var t=new Uint8Array(e),r=0;r>>24]^l[p>>>16&255]^f[m>>>8&255]^d[255&y]^t[g++],a=c[p>>>24]^l[m>>>16&255]^f[y>>>8&255]^d[255&h]^t[g++],s=c[m>>>24]^l[y>>>16&255]^f[h>>>8&255]^d[255&p]^t[g++],u=c[y>>>24]^l[h>>>16&255]^f[p>>>8&255]^d[255&m]^t[g++],h=o,p=a,m=s,y=u;return o=(n[h>>>24]<<24|n[p>>>16&255]<<16|n[m>>>8&255]<<8|n[255&y])^t[g++],a=(n[p>>>24]<<24|n[m>>>16&255]<<16|n[y>>>8&255]<<8|n[255&h])^t[g++],s=(n[m>>>24]<<24|n[y>>>16&255]<<16|n[h>>>8&255]<<8|n[255&p])^t[g++],[o>>>=0,a>>>=0,s>>>=0,u=((n[y>>>24]<<24|n[h>>>16&255]<<16|n[p>>>8&255]<<8|n[255&m])^t[g++])>>>0]}var s=[0,1,2,4,8,16,32,64,128,27,54],u=function(){for(var e=Array(256),t=0;t<256;t++)t<128?e[t]=t<<1:e[t]=t<<1^283;for(var r=[],n=[],i=[[],[],[],[]],o=[[],[],[],[]],a=0,s=0,u=0;u<256;++u){var c=s^s<<1^s<<2^s<<3^s<<4;c=c>>>8^255&c^99,r[a]=c,n[c]=a;var l=e[a],f=e[l],d=e[f],h=257*e[c]^0x1010100*c;i[0][a]=h<<24|h>>>8,i[1][a]=h<<16|h>>>16,i[2][a]=h<<8|h>>>24,i[3][a]=h,h=0x1010101*d^65537*f^257*l^0x1010100*a,o[0][c]=h<<24|h>>>8,o[1][c]=h<<16|h>>>16,o[2][c]=h<<8|h>>>24,o[3][c]=h,0===a?a=s=1:(a=l^e[e[e[d^l]]],s^=e[e[s]])}return{SBOX:r,INV_SBOX:n,SUB_MIX:i,INV_SUB_MIX:o}}();function c(e){this._key=i(e),this._reset()}c.blockSize=16,c.keySize=32,c.prototype.blockSize=c.blockSize,c.prototype.keySize=c.keySize,c.prototype._reset=function(){for(var e=this._key,t=e.length,r=t+6,n=(r+1)*4,i=[],o=0;o>>24,a=(u.SBOX[a>>>24]<<24|u.SBOX[a>>>16&255]<<16|u.SBOX[a>>>8&255]<<8|u.SBOX[255&a])^s[o/t|0]<<24):t>6&&o%t==4&&(a=u.SBOX[a>>>24]<<24|u.SBOX[a>>>16&255]<<16|u.SBOX[a>>>8&255]<<8|u.SBOX[255&a]),i[o]=i[o-t]^a}for(var c=[],l=0;l>>24]]^u.INV_SUB_MIX[1][u.SBOX[d>>>16&255]]^u.INV_SUB_MIX[2][u.SBOX[d>>>8&255]]^u.INV_SUB_MIX[3][u.SBOX[255&d]]}this._nRounds=r,this._keySchedule=i,this._invKeySchedule=c},c.prototype.encryptBlockRaw=function(e){return a(e=i(e),this._keySchedule,u.SUB_MIX,u.SBOX,this._nRounds)},c.prototype.encryptBlock=function(e){var t=this.encryptBlockRaw(e),r=n.allocUnsafe(16);return r.writeUInt32BE(t[0],0),r.writeUInt32BE(t[1],4),r.writeUInt32BE(t[2],8),r.writeUInt32BE(t[3],12),r},c.prototype.decryptBlock=function(e){var t=(e=i(e))[1];e[1]=e[3],e[3]=t;var r=a(e,this._invKeySchedule,u.INV_SUB_MIX,u.INV_SBOX,this._nRounds),o=n.allocUnsafe(16);return o.writeUInt32BE(r[0],0),o.writeUInt32BE(r[3],4),o.writeUInt32BE(r[2],8),o.writeUInt32BE(r[1],12),o},c.prototype.scrub=function(){o(this._keySchedule),o(this._invKeySchedule),o(this._key)},e.exports.AES=c},6624:function(e,t,r){var n=r(1387),i=r(6911).Buffer,o=r(1043),a=r(3782),s=r(7225),u=r(4734),c=r(598);function l(e,t){var r=0;e.length!==t.length&&r++;for(var n=Math.min(e.length,t.length),i=0;i16)throw Error("unable to decrypt data");for(var r=-1;++r16)return t=this.cache.slice(0,16),this.cache=this.cache.slice(16),t}else if(this.cache.length>=16)return t=this.cache.slice(0,16),this.cache=this.cache.slice(16),t;return null},f.prototype.flush=function(){if(this.cache.length)return this.cache},t.createDecipher=function(e,t){var r=o[e.toLowerCase()];if(!r)throw TypeError("invalid suite type");var n=c(t,!1,r.key,r.iv);return h(e,n.key,n.iv)},t.createDecipheriv=h},2:function(e,t,r){var n=r(6370),i=r(6624),o=r(6911).Buffer,a=r(126),s=r(1043),u=r(1387),c=r(8368);function l(e,t,r){s.call(this),this._cache=new d,this._cipher=new u.AES(t),this._prev=o.from(r),this._mode=e,this._autopadding=!0}r(3782)(l,s),l.prototype._update=function(e){this._cache.add(e);for(var t,r,n=[];t=this._cache.get();)r=this._mode.encrypt(this,t),n.push(r);return o.concat(n)};var f=o.alloc(16,16);function d(){this.cache=o.allocUnsafe(0)}function h(e,t,r){var s=n[e.toLowerCase()];if(!s)throw TypeError("invalid suite type");if("string"==typeof t&&(t=o.from(t)),t.length!==s.key/8)throw TypeError("invalid key length "+t.length);if("string"==typeof r&&(r=o.from(r)),"GCM"!==s.mode&&r.length!==s.iv)throw TypeError("invalid iv length "+r.length);return"stream"===s.type?new a(s.module,t,r):"auth"===s.type?new i(s.module,t,r):new l(s.module,t,r)}function p(e,t){var r=n[e.toLowerCase()];if(!r)throw TypeError("invalid suite type");var i=c(t,!1,r.key,r.iv);return h(e,i.key,i.iv)}l.prototype._final=function(){var e=this._cache.flush();if(this._autopadding)return e=this._mode.encrypt(this,e),this._cipher.scrub(),e;if(!e.equals(f))throw this._cipher.scrub(),Error("data not multiple of block length")},l.prototype.setAutoPadding=function(e){return this._autopadding=!!e,this},d.prototype.add=function(e){this.cache=o.concat([this.cache,e])},d.prototype.get=function(){if(this.cache.length>15){var e=this.cache.slice(0,16);return this.cache=this.cache.slice(16),e}return null},d.prototype.flush=function(){for(var e=16-this.cache.length,t=o.allocUnsafe(e),r=-1;++r>>0,0),t.writeUInt32BE(e[1]>>>0,4),t.writeUInt32BE(e[2]>>>0,8),t.writeUInt32BE(e[3]>>>0,12),t}function s(e){this.h=e,this.state=n.alloc(16,0),this.cache=n.allocUnsafe(0)}s.prototype.ghash=function(e){for(var t=-1;++t0;e--)r[e]=r[e]>>>1|(1&r[e-1])<<31;r[0]=r[0]>>>1,t&&(r[0]=-0x1f000000^r[0])}this.state=a(n)},s.prototype.update=function(e){var t;for(this.cache=n.concat([this.cache,e]);this.cache.length>=16;)t=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(t)},s.prototype.final=function(e,t){return this.cache.length&&this.ghash(n.concat([this.cache,i],16)),this.ghash(a([0,e,0,t])),this.state},e.exports=s},598:function(e){e.exports=function(e){for(var t,r=e.length;r--;)if(255===(t=e.readUInt8(r)))e.writeUInt8(0,r);else{t++,e.writeUInt8(t,r);break}}},9825:function(e,t,r){var n=r(4734);t.encrypt=function(e,t){var r=n(t,e._prev);return e._prev=e._cipher.encryptBlock(r),e._prev},t.decrypt=function(e,t){var r=e._prev;return e._prev=t,n(e._cipher.decryptBlock(t),r)}},321:function(e,t,r){var n=r(6911).Buffer,i=r(4734);function o(e,t,r){var o=t.length,a=i(t,e._cache);return e._cache=e._cache.slice(o),e._prev=n.concat([e._prev,r?t:a]),a}t.encrypt=function(e,t,r){for(var i,a=n.allocUnsafe(0);t.length;)if(0===e._cache.length&&(e._cache=e._cipher.encryptBlock(e._prev),e._prev=n.allocUnsafe(0)),e._cache.length<=t.length)i=e._cache.length,a=n.concat([a,o(e,t.slice(0,i),r)]),t=t.slice(i);else{a=n.concat([a,o(e,t,r)]);break}return a}},3147:function(e,t,r){var n=r(6911).Buffer;function i(e,t,r){for(var n,i,a,s=-1,u=8,c=0;++s>s%8,e._prev=o(e._prev,r?i:a);return c}function o(e,t){var r=e.length,i=-1,o=n.allocUnsafe(e.length);for(e=n.concat([e,n.from([t])]);++i>7;return o}t.encrypt=function(e,t,r){for(var o=t.length,a=n.allocUnsafe(o),s=-1;++s=0||!r.umod(e.prime1)||!r.umod(e.prime2);)r=new n(o(t));return r}e.exports=s,s.getr=u},9276:function(e,t,r){e.exports=r(2908)},4078:function(e,t,r){var n=r(6911).Buffer,i=r(9739),o=r(3726),a=r(3782),s=r(9807),u=r(4013),c=r(2908);function l(e){o.Writable.call(this);var t=c[e];if(!t)throw Error("Unknown message digest");this._hashType=t.hash,this._hash=i(t.hash),this._tag=t.id,this._signType=t.sign}function f(e){o.Writable.call(this);var t=c[e];if(!t)throw Error("Unknown message digest");this._hash=i(t.hash),this._tag=t.id,this._signType=t.sign}function d(e){return new l(e)}function h(e){return new f(e)}Object.keys(c).forEach(function(e){c[e].id=n.from(c[e].id,"hex"),c[e.toLowerCase()]=c[e]}),a(l,o.Writable),l.prototype._write=function(e,t,r){this._hash.update(e),r()},l.prototype.update=function(e,t){return"string"==typeof e&&(e=n.from(e,t)),this._hash.update(e),this},l.prototype.sign=function(e,t){this.end();var r=s(this._hash.digest(),e,this._hashType,this._signType,this._tag);return t?r.toString(t):r},a(f,o.Writable),f.prototype._write=function(e,t,r){this._hash.update(e),r()},f.prototype.update=function(e,t){return"string"==typeof e&&(e=n.from(e,t)),this._hash.update(e),this},f.prototype.verify=function(e,t,r){return"string"==typeof t&&(t=n.from(t,r)),this.end(),u(t,this._hash.digest(),e,this._signType,this._tag)},e.exports={Sign:d,Verify:h,createSign:d,createVerify:h}},9807:function(e,t,r){var n=r(6911).Buffer,i=r(4873),o=r(7166),a=r(949).ec,s=r(1670),u=r(9902),c=r(9267);function l(e,t){var r=c[t.curve.join(".")];if(!r)throw Error("unknown curve "+t.curve.join("."));var i=new a(r).keyFromPrivate(t.privateKey).sign(e);return n.from(i.toDER())}function f(e,t,r){for(var n,i=t.params.priv_key,o=t.params.p,a=t.params.q,u=t.params.g,c=new s(0),l=p(e,a).mod(a),f=!1,m=h(i,a,e,r);!1===f;)c=g(u,n=y(a,m,r),o,a),0===(f=n.invm(a).imul(l.add(i.mul(c))).mod(a)).cmpn(0)&&(f=!1,c=new s(0));return d(c,f)}function d(e,t){e=e.toArray(),t=t.toArray(),128&e[0]&&(e=[0].concat(e)),128&t[0]&&(t=[0].concat(t));var r=[48,e.length+t.length+4,2,e.length];return r=r.concat(e,[2,t.length],t),n.from(r)}function h(e,t,r,o){if((e=n.from(e.toArray())).length0&&r.ishrn(n),r}function m(e,t){e=(e=p(e,t)).mod(t);var r=n.from(e.toArray());if(r.length=e.cmpn(0)||e.cmp(t)>=t)throw Error("invalid sig")}e.exports=function(e,t,r,o,s){var l=a(r);if("ec"===l.type){if("ecdsa"!==o&&"ecdsa/rsa"!==o)throw Error("wrong public key type");return u(e,t,l)}if("dsa"===l.type){if("dsa"!==o)throw Error("wrong public key type");return c(e,t,l)}if("rsa"!==o&&"ecdsa/rsa"!==o)throw Error("wrong public key type");t=n.concat([s,t]);for(var f=l.modulus.byteLength(),d=[1],h=0;t.length+d.length+2r?t=("rmd160"===e?new u:c(e)).update(t).digest():t.lengths?t=e(t):t.length0;n--)t+=this._buffer(e,t),r+=this._flushBuffer(i,r);return t+=this._buffer(e,t),i},i.prototype.final=function(e){var t,r;return(e&&(t=this.update(e)),r="encrypt"===this.type?this._finalEncrypt():this._finalDecrypt(),t)?t.concat(r):r},i.prototype._pad=function(e,t){if(0===t)return!1;for(;t>>1];r=o.r28shl(r,s),i=o.r28shl(i,s),o.pc2(r,i,e.keys,a)}},u.prototype._update=function(e,t,r,n){var i=this._desState,a=o.readUInt32BE(e,t),s=o.readUInt32BE(e,t+4);o.ip(a,s,i.tmp,0),a=i.tmp[0],s=i.tmp[1],"encrypt"===this.type?this._encrypt(i,a,s,i.tmp,0):this._decrypt(i,a,s,i.tmp,0),a=i.tmp[0],s=i.tmp[1],o.writeUInt32BE(r,a,n),o.writeUInt32BE(r,s,n+4)},u.prototype._pad=function(e,t){for(var r=e.length-t,n=t;n>>0,a=h}o.rip(s,a,n,i)},u.prototype._decrypt=function(e,t,r,n,i){for(var a=r,s=t,u=e.keys.length-2;u>=0;u-=2){var c=e.keys[u],l=e.keys[u+1];o.expand(a,e.tmp,0),c^=e.tmp[0],l^=e.tmp[1];var f=o.substitute(c,l),d=o.permute(f),h=a;a=(s^d)>>>0,s=h}o.rip(a,s,n,i)}},6159:function(e,t,r){"use strict";var n=r(3523),i=r(3782),o=r(9876),a=r(1016);function s(e,t){n.equal(t.length,24,"Invalid key length");var r=t.slice(0,8),i=t.slice(8,16),o=t.slice(16,24);"encrypt"===e?this.ciphers=[a.create({type:"encrypt",key:r}),a.create({type:"decrypt",key:i}),a.create({type:"encrypt",key:o})]:this.ciphers=[a.create({type:"decrypt",key:o}),a.create({type:"encrypt",key:i}),a.create({type:"decrypt",key:r})]}function u(e){o.call(this,e);var t=new s(this.type,this.options.key);this._edeState=t}i(u,o),e.exports=u,u.create=function(e){return new u(e)},u.prototype._update=function(e,t,r,n){var i=this._edeState;i.ciphers[0]._update(e,t,r,n),i.ciphers[1]._update(r,n,r,n),i.ciphers[2]._update(r,n,r,n)},u.prototype._pad=a.prototype._pad,u.prototype._unpad=a.prototype._unpad},5334:function(e,t){"use strict";t.readUInt32BE=function(e,t){return(e[0+t]<<24|e[1+t]<<16|e[2+t]<<8|e[3+t])>>>0},t.writeUInt32BE=function(e,t,r){e[0+r]=t>>>24,e[1+r]=t>>>16&255,e[2+r]=t>>>8&255,e[3+r]=255&t},t.ip=function(e,t,r,n){for(var i=0,o=0,a=6;a>=0;a-=2){for(var s=0;s<=24;s+=8)i<<=1,i|=t>>>s+a&1;for(var s=0;s<=24;s+=8)i<<=1,i|=e>>>s+a&1}for(var a=6;a>=0;a-=2){for(var s=1;s<=25;s+=8)o<<=1,o|=t>>>s+a&1;for(var s=1;s<=25;s+=8)o<<=1,o|=e>>>s+a&1}r[n+0]=i>>>0,r[n+1]=o>>>0},t.rip=function(e,t,r,n){for(var i=0,o=0,a=0;a<4;a++)for(var s=24;s>=0;s-=8)i<<=1,i|=t>>>s+a&1,i<<=1,i|=e>>>s+a&1;for(var a=4;a<8;a++)for(var s=24;s>=0;s-=8)o<<=1,o|=t>>>s+a&1,o<<=1,o|=e>>>s+a&1;r[n+0]=i>>>0,r[n+1]=o>>>0},t.pc1=function(e,t,r,n){for(var i=0,o=0,a=7;a>=5;a--){for(var s=0;s<=24;s+=8)i<<=1,i|=t>>s+a&1;for(var s=0;s<=24;s+=8)i<<=1,i|=e>>s+a&1}for(var s=0;s<=24;s+=8)i<<=1,i|=t>>s+a&1;for(var a=1;a<=3;a++){for(var s=0;s<=24;s+=8)o<<=1,o|=t>>s+a&1;for(var s=0;s<=24;s+=8)o<<=1,o|=e>>s+a&1}for(var s=0;s<=24;s+=8)o<<=1,o|=e>>s+a&1;r[n+0]=i>>>0,r[n+1]=o>>>0},t.r28shl=function(e,t){return e<>>28-t};var r=[14,11,17,4,27,23,25,0,13,22,7,18,5,9,16,24,2,20,12,21,1,8,15,26,15,4,25,19,9,1,26,16,5,11,23,8,12,7,17,0,22,3,10,14,6,20,27,24];t.pc2=function(e,t,n,i){for(var o=0,a=0,s=r.length>>>1,u=0;u>>r[u]&1;for(var u=s;u>>r[u]&1;n[i+0]=o>>>0,n[i+1]=a>>>0},t.expand=function(e,t,r){var n=0,i=0;n=(1&e)<<5|e>>>27;for(var o=23;o>=15;o-=4)n<<=6,n|=e>>>o&63;for(var o=11;o>=3;o-=4)i|=e>>>o&63,i<<=6;i|=(31&e)<<1|e>>>31,t[r+0]=n>>>0,t[r+1]=i>>>0};var n=[14,0,4,15,13,7,1,4,2,14,15,2,11,13,8,1,3,10,10,6,6,12,12,11,5,9,9,5,0,3,7,8,4,15,1,12,14,8,8,2,13,4,6,9,2,1,11,7,15,5,12,11,9,3,7,14,3,10,10,0,5,6,0,13,15,3,1,13,8,4,14,7,6,15,11,2,3,8,4,14,9,12,7,0,2,1,13,10,12,6,0,9,5,11,10,5,0,13,14,8,7,10,11,1,10,3,4,15,13,4,1,2,5,11,8,6,12,7,6,12,9,0,3,5,2,14,15,9,10,13,0,7,9,0,14,9,6,3,3,4,15,6,5,10,1,2,13,8,12,5,7,14,11,12,4,11,2,15,8,1,13,1,6,10,4,13,9,0,8,6,15,9,3,8,0,7,11,4,1,15,2,14,12,3,5,11,10,5,14,2,7,12,7,13,13,8,14,11,3,5,0,6,6,15,9,0,10,3,1,4,2,7,8,2,5,12,11,1,12,10,4,14,15,9,10,3,6,15,9,0,0,6,12,10,11,1,7,13,13,8,15,9,1,4,3,5,14,11,5,12,2,7,8,2,4,14,2,14,12,11,4,2,1,12,7,4,10,7,11,13,6,1,8,5,5,0,3,15,15,10,13,3,0,9,14,8,9,6,4,11,2,8,1,12,11,7,10,1,13,14,7,2,8,13,15,6,9,15,12,0,5,9,6,10,3,4,0,5,14,3,12,10,1,15,10,4,15,2,9,7,2,12,6,9,8,5,0,6,13,1,3,13,4,14,14,0,7,11,5,3,11,8,9,4,14,3,15,2,5,12,2,9,8,5,12,15,3,10,7,11,0,14,4,1,10,7,1,6,13,0,11,8,6,13,4,13,11,0,2,11,14,7,15,4,0,9,8,1,13,10,3,14,12,3,9,5,7,12,5,2,10,15,6,8,1,6,1,6,4,11,11,13,13,8,12,1,3,4,7,10,14,7,10,9,15,5,6,0,8,15,0,14,5,2,9,3,2,12,13,1,2,15,8,13,4,8,6,10,15,3,11,7,1,4,10,12,9,5,3,6,14,11,5,0,0,14,12,9,7,2,7,2,11,1,4,14,1,7,9,4,12,10,14,8,2,13,0,15,6,12,10,9,13,0,15,3,3,5,5,6,8,11];t.substitute=function(e,t){for(var r=0,i=0;i<4;i++){var o=e>>>18-6*i&63,a=n[64*i+o];r<<=4,r|=a}for(var i=0;i<4;i++){var o=t>>>18-6*i&63,a=n[256+64*i+o];r<<=4,r|=a}return r>>>0};var i=[16,25,12,11,3,20,4,15,31,17,9,6,27,14,1,22,30,24,8,18,0,5,29,23,13,19,2,26,10,21,28,7];t.permute=function(e){for(var t=0,r=0;r>>i[r]&1;return t>>>0},t.padSplit=function(e,t,r){for(var n=e.toString(2);n.lengthe;)r.ishrn(1);if(r.isEven()&&r.iadd(s),r.testn(1)||r.iadd(u),t.cmp(u)){if(!t.cmp(c))for(;r.mod(l).cmp(f);)r.iadd(h)}else for(;r.mod(o).cmp(d);)r.iadd(h);if(y(p=r.shrn(1))&&y(r)&&g(p)&&g(r)&&a.test(p)&&a.test(r))return r}}},949:function(e,t,r){"use strict";var n=t;n.version=r(2531).i8,n.utils=r(4401),n.rand=r(3500),n.curve=r(9359),n.curves=r(6226),n.ec=r(4088),n.eddsa=r(8511)},2727:function(e,t,r){"use strict";var n=r(711),i=r(4401),o=i.getNAF,a=i.getJSF,s=i.assert;function u(e,t){this.type=e,this.p=new n(t.p,16),this.red=t.prime?n.red(t.prime):n.mont(this.p),this.zero=new n(0).toRed(this.red),this.one=new n(1).toRed(this.red),this.two=new n(2).toRed(this.red),this.n=t.n&&new n(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=[,,,,],this._wnafT2=[,,,,],this._wnafT3=[,,,,],this._wnafT4=[,,,,],this._bitLength=this.n?this.n.bitLength():0;var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function c(e,t){this.curve=e,this.type=t,this.precomputed=null}e.exports=u,u.prototype.point=function(){throw Error("Not implemented")},u.prototype.validate=function(){throw Error("Not implemented")},u.prototype._fixedNafMul=function(e,t){s(e.precomputed);var r=e._getDoubles(),n=o(t,1,this._bitLength),i=(1<=u;t--)c=(c<<1)+n[t];a.push(c)}for(var l=this.jpoint(null,null,null),f=this.jpoint(null,null,null),d=i;d>0;d--){for(var u=0;u=0;c--){for(var t=0;c>=0&&0===a[c];c--)t++;if(c>=0&&t++,u=u.dblp(t),c<0)break;var l=a[c];s(0!==l),u="affine"===e.type?l>0?u.mixedAdd(i[l-1>>1]):u.mixedAdd(i[-l-1>>1].neg()):l>0?u.add(i[l-1>>1]):u.add(i[-l-1>>1].neg())}return"affine"===e.type?u.toP():u},u.prototype._wnafMulAdd=function(e,t,r,n,i){for(var s=this._wnafT1,u=this._wnafT2,c=this._wnafT3,l=0,f=0;f=1;f-=2){var p=f-1,m=f;if(1!==s[p]||1!==s[m]){c[p]=o(r[p],s[p],this._bitLength),c[m]=o(r[m],s[m],this._bitLength),l=Math.max(c[p].length,l),l=Math.max(c[m].length,l);continue}var y=[t[p],null,null,t[m]];0===t[p].y.cmp(t[m].y)?(y[1]=t[p].add(t[m]),y[2]=t[p].toJ().mixedAdd(t[m].neg())):0===t[p].y.cmp(t[m].y.redNeg())?(y[1]=t[p].toJ().mixedAdd(t[m]),y[2]=t[p].add(t[m].neg())):(y[1]=t[p].toJ().mixedAdd(t[m]),y[2]=t[p].toJ().mixedAdd(t[m].neg()));var g=[-3,-1,-5,-7,0,7,5,1,3],b=a(r[p],r[m]);l=Math.max(b[0].length,l),c[p]=Array(l),c[m]=Array(l);for(var v=0;v=0;f--){for(var T=0;f>=0;){for(var x=!0,v=0;v=0&&T++,E=E.dblp(T),f<0)break;for(var v=0;v0?d=u[v][A-1>>1]:A<0&&(d=u[v][-A-1>>1].neg()),E="affine"===d.type?E.mixedAdd(d):E.add(d))}}for(var f=0;f=Math.ceil((e.bitLength()+1)/t.step)},c.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],n=this,i=0;i":""},c.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},c.prototype._extDbl=function(){var e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr();r=r.redIAdd(r);var n=this.curve._mulA(e),i=this.x.redAdd(this.y).redSqr().redISub(e).redISub(t),o=n.redAdd(t),a=o.redSub(r),s=n.redSub(t),u=i.redMul(a),c=o.redMul(s),l=i.redMul(s),f=a.redMul(o);return this.curve.point(u,c,f,l)},c.prototype._projDbl=function(){var e,t,r,n=this.x.redAdd(this.y).redSqr(),i=this.x.redSqr(),o=this.y.redSqr();if(this.curve.twisted){var a=this.curve._mulA(i),s=a.redAdd(o);if(this.zOne)e=n.redSub(i).redSub(o).redMul(s.redSub(this.curve.two)),t=s.redMul(a.redSub(o)),r=s.redSqr().redSub(s).redSub(s);else{var u=this.z.redSqr(),c=s.redSub(u).redISub(u);e=n.redSub(i).redISub(o).redMul(c),t=s.redMul(a.redSub(o)),r=s.redMul(c)}}else{var a=i.redAdd(o),u=this.curve._mulC(this.z).redSqr(),c=a.redSub(u).redSub(u);e=this.curve._mulC(n.redISub(a)).redMul(c),t=this.curve._mulC(a).redMul(i.redISub(o)),r=a.redMul(c)}return this.curve.point(e,t,r)},c.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},c.prototype._extAdd=function(e){var t=this.y.redSub(this.x).redMul(e.y.redSub(e.x)),r=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),n=this.t.redMul(this.curve.dd).redMul(e.t),i=this.z.redMul(e.z.redAdd(e.z)),o=r.redSub(t),a=i.redSub(n),s=i.redAdd(n),u=r.redAdd(t),c=o.redMul(a),l=s.redMul(u),f=o.redMul(u),d=a.redMul(s);return this.curve.point(c,l,d,f)},c.prototype._projAdd=function(e){var t,r,n=this.z.redMul(e.z),i=n.redSqr(),o=this.x.redMul(e.x),a=this.y.redMul(e.y),s=this.curve.d.redMul(o).redMul(a),u=i.redSub(s),c=i.redAdd(s),l=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(o).redISub(a),f=n.redMul(u).redMul(l);return this.curve.twisted?(t=n.redMul(c).redMul(a.redSub(this.curve._mulA(o))),r=u.redMul(c)):(t=n.redMul(c).redMul(a.redSub(o)),r=this.curve._mulC(u).redMul(c)),this.curve.point(f,t,r)},c.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},c.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},c.prototype.mulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!1)},c.prototype.jmulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!0)},c.prototype.normalize=function(){if(this.zOne)return this;var e=this.z.redInvm();return this.x=this.x.redMul(e),this.y=this.y.redMul(e),this.t&&(this.t=this.t.redMul(e)),this.z=this.curve.one,this.zOne=!0,this},c.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},c.prototype.getX=function(){return this.normalize(),this.x.fromRed()},c.prototype.getY=function(){return this.normalize(),this.y.fromRed()},c.prototype.eq=function(e){return this===e||0===this.getX().cmp(e.getX())&&0===this.getY().cmp(e.getY())},c.prototype.eqXToP=function(e){var t=e.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(t))return!0;for(var r=e.clone(),n=this.curve.redN.redMul(this.z);;){if(r.iadd(this.curve.n),r.cmp(this.curve.p)>=0)return!1;if(t.redIAdd(n),0===this.x.cmp(t))return!0}},c.prototype.toP=c.prototype.normalize,c.prototype.mixedAdd=c.prototype.add},9359:function(e,t,r){"use strict";var n=t;n.base=r(2727),n.short=r(4720),n.mont=r(6653),n.edwards=r(2705)},6653:function(e,t,r){"use strict";var n=r(711),i=r(3782),o=r(2727),a=r(4401);function s(e){o.call(this,"mont",e),this.a=new n(e.a,16).toRed(this.red),this.b=new n(e.b,16).toRed(this.red),this.i4=new n(4).toRed(this.red).redInvm(),this.two=new n(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function u(e,t,r){o.BasePoint.call(this,e,"projective"),null===t&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new n(t,16),this.z=new n(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}i(s,o),e.exports=s,s.prototype.validate=function(e){var t=e.normalize().x,r=t.redSqr(),n=r.redMul(t).redAdd(r.redMul(this.a)).redAdd(t);return 0===n.redSqrt().redSqr().cmp(n)},i(u,o.BasePoint),s.prototype.decodePoint=function(e,t){return this.point(a.toArray(e,t),1)},s.prototype.point=function(e,t){return new u(this,e,t)},s.prototype.pointFromJSON=function(e){return u.fromJSON(this,e)},u.prototype.precompute=function(){},u.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},u.fromJSON=function(e,t){return new u(e,t[0],t[1]||e.one)},u.prototype.inspect=function(){return this.isInfinity()?"":""},u.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},u.prototype.dbl=function(){var e=this.x.redAdd(this.z).redSqr(),t=this.x.redSub(this.z).redSqr(),r=e.redSub(t),n=e.redMul(t),i=r.redMul(t.redAdd(this.curve.a24.redMul(r)));return this.curve.point(n,i)},u.prototype.add=function(){throw Error("Not supported on Montgomery curve")},u.prototype.diffAdd=function(e,t){var r=this.x.redAdd(this.z),n=this.x.redSub(this.z),i=e.x.redAdd(e.z),o=e.x.redSub(e.z).redMul(r),a=i.redMul(n),s=t.z.redMul(o.redAdd(a).redSqr()),u=t.x.redMul(o.redISub(a).redSqr());return this.curve.point(s,u)},u.prototype.mul=function(e){for(var t=e.clone(),r=this,n=this.curve.point(null,null),i=this,o=[];0!==t.cmpn(0);t.iushrn(1))o.push(t.andln(1));for(var a=o.length-1;a>=0;a--)0===o[a]?(r=r.diffAdd(n,i),n=n.dbl()):(n=r.diffAdd(n,i),r=r.dbl());return n},u.prototype.mulAdd=function(){throw Error("Not supported on Montgomery curve")},u.prototype.jumlAdd=function(){throw Error("Not supported on Montgomery curve")},u.prototype.eq=function(e){return 0===this.getX().cmp(e.getX())},u.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},u.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},4720:function(e,t,r){"use strict";var n=r(4401),i=r(711),o=r(3782),a=r(2727),s=n.assert;function u(e){a.call(this,"short",e),this.a=new i(e.a,16).toRed(this.red),this.b=new i(e.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(e),this._endoWnafT1=[,,,,],this._endoWnafT2=[,,,,]}function c(e,t,r,n){a.BasePoint.call(this,e,"affine"),null===t&&null===r?(this.x=null,this.y=null,this.inf=!0):(this.x=new i(t,16),this.y=new i(r,16),n&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function l(e,t,r,n){a.BasePoint.call(this,e,"jacobian"),null===t&&null===r&&null===n?(this.x=this.curve.one,this.y=this.curve.one,this.z=new i(0)):(this.x=new i(t,16),this.y=new i(r,16),this.z=new i(n,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}o(u,a),e.exports=u,u.prototype._getEndomorphism=function(e){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){if(e.beta)t=new i(e.beta,16).toRed(this.red);else{var t,r,n,o=this._getEndoRoots(this.p);t=(t=0>o[0].cmp(o[1])?o[0]:o[1]).toRed(this.red)}if(e.lambda)r=new i(e.lambda,16);else{var a=this._getEndoRoots(this.n);0===this.g.mul(a[0]).x.cmp(this.g.x.redMul(t))?r=a[0]:(r=a[1],s(0===this.g.mul(r).x.cmp(this.g.x.redMul(t))))}return n=e.basis?e.basis.map(function(e){return{a:new i(e.a,16),b:new i(e.b,16)}}):this._getEndoBasis(r),{beta:t,lambda:r,basis:n}}},u.prototype._getEndoRoots=function(e){var t=e===this.p?this.red:i.mont(e),r=new i(2).toRed(t).redInvm(),n=r.redNeg(),o=new i(3).toRed(t).redNeg().redSqrt().redMul(r);return[n.redAdd(o).fromRed(),n.redSub(o).fromRed()]},u.prototype._getEndoBasis=function(e){for(var t,r,n,o,a,s,u,c,l,f=this.n.ushrn(Math.floor(this.n.bitLength()/2)),d=e,h=this.n.clone(),p=new i(1),m=new i(0),y=new i(0),g=new i(1),b=0;0!==d.cmpn(0);){var v=h.div(d);c=h.sub(v.mul(d)),l=y.sub(v.mul(p));var _=g.sub(v.mul(m));if(!n&&0>c.cmp(f))t=u.neg(),r=p,n=c.neg(),o=l;else if(n&&2==++b)break;u=c,h=d,d=c,y=p,p=l,g=m,m=_}a=c.neg(),s=l;var S=n.sqr().add(o.sqr());return a.sqr().add(s.sqr()).cmp(S)>=0&&(a=t,s=r),n.negative&&(n=n.neg(),o=o.neg()),a.negative&&(a=a.neg(),s=s.neg()),[{a:n,b:o},{a:a,b:s}]},u.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],n=t[1],i=n.b.mul(e).divRound(this.n),o=r.b.neg().mul(e).divRound(this.n),a=i.mul(r.a),s=o.mul(n.a),u=i.mul(r.b),c=o.mul(n.b);return{k1:e.sub(a).sub(s),k2:u.add(c).neg()}},u.prototype.pointFromX=function(e,t){(e=new i(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),n=r.redSqrt();if(0!==n.redSqr().redSub(r).cmp(this.zero))throw Error("invalid point");var o=n.fromRed().isOdd();return(t&&!o||!t&&o)&&(n=n.redNeg()),this.point(e,n)},u.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,r=e.y,n=this.a.redMul(t),i=t.redSqr().redMul(t).redIAdd(n).redIAdd(this.b);return 0===r.redSqr().redISub(i).cmpn(0)},u.prototype._endoWnafMulAdd=function(e,t,r){for(var n=this._endoWnafT1,i=this._endoWnafT2,o=0;o":""},c.prototype.isInfinity=function(){return this.inf},c.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e)||0===this.x.cmp(e.x))return this.curve.point(null,null);var t=this.y.redSub(e.y);0!==t.cmpn(0)&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var r=t.redSqr().redISub(this.x).redISub(e.x),n=t.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,n)},c.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var t=this.curve.a,r=this.x.redSqr(),n=e.redInvm(),i=r.redAdd(r).redIAdd(r).redIAdd(t).redMul(n),o=i.redSqr().redISub(this.x.redAdd(this.x)),a=i.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,a)},c.prototype.getX=function(){return this.x.fromRed()},c.prototype.getY=function(){return this.y.fromRed()},c.prototype.mul=function(e){return(e=new i(e,16),this.isInfinity())?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},c.prototype.mulAdd=function(e,t,r){var n=[this,t],i=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i):this.curve._wnafMulAdd(1,n,i,2)},c.prototype.jmulAdd=function(e,t,r){var n=[this,t],i=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i,!0):this.curve._wnafMulAdd(1,n,i,2,!0)},c.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||0===this.x.cmp(e.x)&&0===this.y.cmp(e.y))},c.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var r=this.precomputed,n=function(e){return e.neg()};t.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(n)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(n)}}}return t},c.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},o(l,a.BasePoint),u.prototype.jpoint=function(e,t,r){return new l(this,e,t,r)},l.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),r=this.x.redMul(t),n=this.y.redMul(t).redMul(e);return this.curve.point(r,n)},l.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},l.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),r=this.z.redSqr(),n=this.x.redMul(t),i=e.x.redMul(r),o=this.y.redMul(t.redMul(e.z)),a=e.y.redMul(r.redMul(this.z)),s=n.redSub(i),u=o.redSub(a);if(0===s.cmpn(0))if(0!==u.cmpn(0))return this.curve.jpoint(null,null,null);else return this.dbl();var c=s.redSqr(),l=c.redMul(s),f=n.redMul(c),d=u.redSqr().redIAdd(l).redISub(f).redISub(f),h=u.redMul(f.redISub(d)).redISub(o.redMul(l)),p=this.z.redMul(e.z).redMul(s);return this.curve.jpoint(d,h,p)},l.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),r=this.x,n=e.x.redMul(t),i=this.y,o=e.y.redMul(t).redMul(this.z),a=r.redSub(n),s=i.redSub(o);if(0===a.cmpn(0))if(0!==s.cmpn(0))return this.curve.jpoint(null,null,null);else return this.dbl();var u=a.redSqr(),c=u.redMul(a),l=r.redMul(u),f=s.redSqr().redIAdd(c).redISub(l).redISub(l),d=s.redMul(l.redISub(f)).redISub(i.redMul(c)),h=this.z.redMul(a);return this.curve.jpoint(f,d,h)},l.prototype.dblp=function(e){if(0===e||this.isInfinity())return this;if(!e)return this.dbl();if(this.curve.zeroA||this.curve.threeA){for(var t=this,r=0;r=0)return!1;if(r.redIAdd(i),0===this.x.cmp(r))return!0}},l.prototype.inspect=function(){return this.isInfinity()?"":""},l.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},6226:function(e,t,r){"use strict";var n,i=t,o=r(7028),a=r(9359),s=r(4401).assert;function u(e){"short"===e.type?this.curve=new a.short(e):"edwards"===e.type?this.curve=new a.edwards(e):this.curve=new a.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,s(this.g.validate(),"Invalid curve"),s(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function c(e,t){Object.defineProperty(i,e,{configurable:!0,enumerable:!0,get:function(){var r=new u(t);return Object.defineProperty(i,e,{configurable:!0,enumerable:!0,value:r}),r}})}i.PresetCurve=u,c("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:o.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),c("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:o.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),c("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:o.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),c("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:o.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),c("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:o.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),c("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:o.sha256,gRed:!1,g:["9"]}),c("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:o.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{n=r(9702)}catch(e){n=void 0}c("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:o.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",n]})},4088:function(e,t,r){"use strict";var n=r(711),i=r(4910),o=r(4401),a=r(6226),s=r(3500),u=o.assert,c=r(4724),l=r(7526);function f(e){if(!(this instanceof f))return new f(e);"string"==typeof e&&(u(a.hasOwnProperty(e),"Unknown curve "+e),e=a[e]),e instanceof a.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}e.exports=f,f.prototype.keyPair=function(e){return new c(this,e)},f.prototype.keyFromPrivate=function(e,t){return c.fromPrivate(this,e,t)},f.prototype.keyFromPublic=function(e,t){return c.fromPublic(this,e,t)},f.prototype.genKeyPair=function(e){e||(e={});for(var t=new i({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||s(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),o=this.n.sub(new n(2));;){var a=new n(t.generate(r));if(!(a.cmp(o)>0))return a.iaddn(1),this.keyFromPrivate(a)}},f.prototype._truncateToN=function(e,t){var r=8*e.byteLength()-this.n.bitLength();return(r>0&&(e=e.ushrn(r)),!t&&e.cmp(this.n)>=0)?e.sub(this.n):e},f.prototype.sign=function(e,t,r,o){"object"==typeof r&&(o=r,r=null),o||(o={}),t=this.keyFromPrivate(t,r),e=this._truncateToN(new n(e,16));for(var a=this.n.byteLength(),s=t.getPrivate().toArray("be",a),u=e.toArray("be",a),c=new i({hash:this.hash,entropy:s,nonce:u,pers:o.pers,persEnc:o.persEnc||"utf8"}),f=this.n.sub(new n(1)),d=0;;d++){var h=o.k?o.k(d):new n(c.generate(this.n.byteLength()));if(0>=(h=this._truncateToN(h,!0)).cmpn(1)||h.cmp(f)>=0)continue;var p=this.g.mul(h);if(!p.isInfinity()){var m=p.getX(),y=m.umod(this.n);if(0!==y.cmpn(0)){var g=h.invm(this.n).mul(y.mul(t.getPrivate()).iadd(e));if(0!==(g=g.umod(this.n)).cmpn(0)){var b=!!p.getY().isOdd()|2*(0!==m.cmp(y));return o.canonical&&g.cmp(this.nh)>0&&(g=this.n.sub(g),b^=1),new l({r:y,s:g,recoveryParam:b})}}}}},f.prototype.verify=function(e,t,r,i){e=this._truncateToN(new n(e,16)),r=this.keyFromPublic(r,i);var o=(t=new l(t,"hex")).r,a=t.s;if(0>o.cmpn(1)||o.cmp(this.n)>=0||0>a.cmpn(1)||a.cmp(this.n)>=0)return!1;var s=a.invm(this.n),u=s.mul(e).umod(this.n),c=s.mul(o).umod(this.n);if(!this.curve._maxwellTrick){var f=this.g.mulAdd(u,r.getPublic(),c);return!f.isInfinity()&&0===f.getX().umod(this.n).cmp(o)}var f=this.g.jmulAdd(u,r.getPublic(),c);return!f.isInfinity()&&f.eqXToP(o)},f.prototype.recoverPubKey=function(e,t,r,i){u((3&r)===r,"The recovery param is more than two bits"),t=new l(t,i);var o=this.n,a=new n(e),s=t.r,c=t.s,f=1&r,d=r>>1;if(s.cmp(this.curve.p.umod(this.curve.n))>=0&&d)throw Error("Unable to find sencond key candinate");s=d?this.curve.pointFromX(s.add(this.curve.n),f):this.curve.pointFromX(s,f);var h=t.r.invm(o),p=o.sub(a).mul(h).umod(o),m=c.mul(h).umod(o);return this.g.mulAdd(p,s,m)},f.prototype.getKeyRecoveryParam=function(e,t,r,n){if(null!==(t=new l(t,n)).recoveryParam)return t.recoveryParam;for(var i,o=0;o<4;o++){try{i=this.recoverPubKey(e,t,o)}catch(e){continue}if(i.eq(r))return o}throw Error("Unable to find valid recovery factor")}},4724:function(e,t,r){"use strict";var n=r(711),i=r(4401).assert;function o(e,t){this.ec=e,this.priv=null,this.pub=null,t.priv&&this._importPrivate(t.priv,t.privEnc),t.pub&&this._importPublic(t.pub,t.pubEnc)}e.exports=o,o.fromPublic=function(e,t,r){return t instanceof o?t:new o(e,{pub:t,pubEnc:r})},o.fromPrivate=function(e,t,r){return t instanceof o?t:new o(e,{priv:t,privEnc:r})},o.prototype.validate=function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},o.prototype.getPublic=function(e,t){return("string"==typeof e&&(t=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),t)?this.pub.encode(t,e):this.pub},o.prototype.getPrivate=function(e){return"hex"===e?this.priv.toString(16,2):this.priv},o.prototype._importPrivate=function(e,t){this.priv=new n(e,t||16),this.priv=this.priv.umod(this.ec.curve.n)},o.prototype._importPublic=function(e,t){if(e.x||e.y){"mont"===this.ec.curve.type?i(e.x,"Need x coordinate"):("short"===this.ec.curve.type||"edwards"===this.ec.curve.type)&&i(e.x&&e.y,"Need both x and y coordinate"),this.pub=this.ec.curve.point(e.x,e.y);return}this.pub=this.ec.curve.decodePoint(e,t)},o.prototype.derive=function(e){return e.mul(this.priv).getX()},o.prototype.sign=function(e,t,r){return this.ec.sign(e,this,t,r)},o.prototype.verify=function(e,t){return this.ec.verify(e,t,this)},o.prototype.inspect=function(){return""}},7526:function(e,t,r){"use strict";var n=r(711),i=r(4401),o=i.assert;function a(e,t){if(e instanceof a)return e;this._importDER(e,t)||(o(e.r&&e.s,"Signature without r or s"),this.r=new n(e.r,16),this.s=new n(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}function s(){this.place=0}function u(e,t){var r=e[t.place++];if(!(128&r))return r;var n=15&r;if(0===n||n>4)return!1;for(var i=0,o=0,a=t.place;o>>=0;return!(i<=127)&&(t.place=a,i)}function c(e){for(var t=0,r=e.length-1;!e[t]&&!(128&e[t+1])&&t>>3);for(e.push(128|r);--r;)e.push(t>>>(r<<3)&255);e.push(t)}e.exports=a,a.prototype._importDER=function(e,t){e=i.toArray(e,t);var r=new s;if(48!==e[r.place++])return!1;var o=u(e,r);if(!1===o||o+r.place!==e.length||2!==e[r.place++])return!1;var a=u(e,r);if(!1===a)return!1;var c=e.slice(r.place,a+r.place);if(r.place+=a,2!==e[r.place++])return!1;var l=u(e,r);if(!1===l||e.length!==l+r.place)return!1;var f=e.slice(r.place,l+r.place);if(0===c[0])if(!(128&c[1]))return!1;else c=c.slice(1);if(0===f[0])if(!(128&f[1]))return!1;else f=f.slice(1);return this.r=new n(c),this.s=new n(f),this.recoveryParam=null,!0},a.prototype.toDER=function(e){var t=this.r.toArray(),r=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&r[0]&&(r=[0].concat(r)),t=c(t),r=c(r);!r[0]&&!(128&r[1]);)r=r.slice(1);var n=[2];l(n,t.length),(n=n.concat(t)).push(2),l(n,r.length);var o=n.concat(r),a=[48];return l(a,o.length),a=a.concat(o),i.encode(a,e)}},8511:function(e,t,r){"use strict";var n=r(7028),i=r(6226),o=r(4401),a=o.assert,s=o.parseBytes,u=r(9917),c=r(9314);function l(e){if(a("ed25519"===e,"only tested with ed25519 so far"),!(this instanceof l))return new l(e);var e=i[e].curve;this.curve=e,this.g=e.g,this.g.precompute(e.n.bitLength()+1),this.pointClass=e.point().constructor,this.encodingLength=Math.ceil(e.n.bitLength()/8),this.hash=n.sha512}e.exports=l,l.prototype.sign=function(e,t){e=s(e);var r=this.keyFromSecret(t),n=this.hashInt(r.messagePrefix(),e),i=this.g.mul(n),o=this.encodePoint(i),a=this.hashInt(o,r.pubBytes(),e).mul(r.priv()),u=n.add(a).umod(this.curve.n);return this.makeSignature({R:i,S:u,Rencoded:o})},l.prototype.verify=function(e,t,r){e=s(e),t=this.makeSignature(t);var n=this.keyFromPublic(r),i=this.hashInt(t.Rencoded(),n.pubBytes(),e),o=this.g.mul(t.S());return t.R().add(n.pub().mul(i)).eq(o)},l.prototype.hashInt=function(){for(var e=this.hash(),t=0;t(i>>1)-1?(i>>1)-u:u,o.isubn(s)):s=0,n[a]=s,o.iushrn(1)}return n},n.getJSF=function(e,t){var r=[[],[]];e=e.clone(),t=t.clone();for(var n=0,i=0;e.cmpn(-n)>0||t.cmpn(-i)>0;){var o,a,s=e.andln(3)+n&3,u=t.andln(3)+i&3;if(3===s&&(s=-1),3===u&&(u=-1),(1&s)==0)o=0;else{var c=e.andln(7)+n&7;o=(3===c||5===c)&&2===u?-s:s}if(r[0].push(o),(1&u)==0)a=0;else{var c=t.andln(7)+i&7;a=(3===c||5===c)&&2===s?-u:u}r[1].push(a),2*n===o+1&&(n=1-n),2*i===a+1&&(i=1-i),e.iushrn(1),t.iushrn(1)}return r},n.cachedProperty=function(e,t,r){var n="_"+t;e.prototype[t]=function(){return void 0!==this[n]?this[n]:this[n]=r.call(this)}},n.parseBytes=s,n.intFromLE=function(e){return new i(e,"hex","le")}},8368:function(e,t,r){var n=r(6911).Buffer,i=r(3533);e.exports=function(e,t,r,o){if(n.isBuffer(e)||(e=n.from(e,"binary")),t&&(n.isBuffer(t)||(t=n.from(t,"binary")),8!==t.length))throw RangeError("salt should be Buffer with 8 byte length");for(var a=r/8,s=n.alloc(a),u=n.alloc(o||0),c=n.alloc(0);a>0||o>0;){var l=new i;l.update(c),l.update(e),t&&l.update(t),c=l.digest();var f=0;if(a>0){var d=s.length-a;f=Math.min(a,c.length),c.copy(s,d,0,f),a-=f}if(f0){var h=u.length-o,p=Math.min(o,c.length-f);c.copy(u,h,f,f+p),o-=p}}return c.fill(0),{key:s,iv:u}}},9029:function(e,t,r){"use strict";var n=r(6911).Buffer,i=r(3726).Transform;function o(e,t){if(!n.isBuffer(e)&&"string"!=typeof e)throw TypeError(t+" must be a string or a buffer")}function a(e){i.call(this),this._block=n.allocUnsafe(e),this._blockSize=e,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}r(3782)(a,i),a.prototype._transform=function(e,t,r){var n=null;try{this.update(e,t)}catch(e){n=e}r(n)},a.prototype._flush=function(e){var t=null;try{this.push(this.digest())}catch(e){t=e}e(t)},a.prototype.update=function(e,t){if(o(e,"Data"),this._finalized)throw Error("Digest already called");n.isBuffer(e)||(e=n.from(e,t));for(var r=this._block,i=0;this._blockOffset+e.length-i>=this._blockSize;){for(var a=this._blockOffset;a0;++s)this._length[s]+=u,(u=this._length[s]/0x100000000|0)>0&&(this._length[s]-=0x100000000*u);return this},a.prototype._update=function(){throw Error("_update is not implemented")},a.prototype.digest=function(e){if(this._finalized)throw Error("Digest already called");this._finalized=!0;var t=this._digest();void 0!==e&&(t=t.toString(e)),this._block.fill(0),this._blockOffset=0;for(var r=0;r<4;++r)this._length[r]=0;return t},a.prototype._digest=function(){throw Error("_digest is not implemented")},e.exports=a},7028:function(e,t,r){var n=t;n.utils=r(263),n.common=r(1330),n.sha=r(301),n.ripemd=r(3079),n.hmac=r(3092),n.sha1=n.sha.sha1,n.sha256=n.sha.sha256,n.sha224=n.sha.sha224,n.sha384=n.sha.sha384,n.sha512=n.sha.sha512,n.ripemd160=n.ripemd.ripemd160},1330:function(e,t,r){"use strict";var n=r(263),i=r(3523);function o(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}t.BlockHash=o,o.prototype.update=function(e,t){if(e=n.toArray(e,t),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){var r=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-r,e.length),0===this.pending.length&&(this.pending=null),e=n.join32(e,0,e.length-r,this.endian);for(var i=0;i>>24&255,n[i++]=e>>>16&255,n[i++]=e>>>8&255,n[i++]=255&e}else for(o=8,n[i++]=255&e,n[i++]=e>>>8&255,n[i++]=e>>>16&255,n[i++]=e>>>24&255,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0;othis.blockSize&&(e=(new this.Hash).update(e).digest()),i(e.length<=this.blockSize);for(var t=e.length;t>>3},t.g1_256=function(e){return n(e,17)^n(e,19)^e>>>10}},263:function(e,t,r){"use strict";var n=r(3523);function i(e,t){return(64512&e.charCodeAt(t))==55296&&!(t<0)&&!(t+1>=e.length)&&(64512&e.charCodeAt(t+1))==56320}function o(e){return(e>>>24|e>>>8&65280|e<<8&0xff0000|(255&e)<<24)>>>0}function a(e){return 1===e.length?"0"+e:e}function s(e){if(7===e.length)return"0"+e;if(6===e.length)return"00"+e;if(5===e.length)return"000"+e;if(4===e.length)return"0000"+e;if(3===e.length)return"00000"+e;else if(2===e.length)return"000000"+e;else if(1===e.length)return"0000000"+e;else return e}t.inherits=r(3782),t.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"==typeof e)if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),o=0;o>6|192:(i(e,o)?(a=65536+((1023&a)<<10)+(1023&e.charCodeAt(++o)),r[n++]=a>>18|240,r[n++]=a>>12&63|128):r[n++]=a>>12|224,r[n++]=a>>6&63|128),r[n++]=63&a|128)}else for(o=0;o>>0;return s},t.split32=function(e,t){for(var r=Array(4*e.length),n=0,i=0;n>>24,r[i+1]=o>>>16&255,r[i+2]=o>>>8&255,r[i+3]=255&o):(r[i+3]=o>>>24,r[i+2]=o>>>16&255,r[i+1]=o>>>8&255,r[i]=255&o)}return r},t.rotr32=function(e,t){return e>>>t|e<<32-t},t.rotl32=function(e,t){return e<>>32-t},t.sum32=function(e,t){return e+t>>>0},t.sum32_3=function(e,t,r){return e+t+r>>>0},t.sum32_4=function(e,t,r,n){return e+t+r+n>>>0},t.sum32_5=function(e,t,r,n,i){return e+t+r+n+i>>>0},t.sum64=function(e,t,r,n){var i=e[t],o=n+e[t+1]>>>0,a=+(o>>0,e[t+1]=o},t.sum64_hi=function(e,t,r,n){return+(t+n>>>0>>0},t.sum64_lo=function(e,t,r,n){return t+n>>>0},t.sum64_4_hi=function(e,t,r,n,i,o,a,s){var u,c=t;return e+r+i+a+(u=0+ +((c=c+n>>>0)>>0)>>0)>>0},t.sum64_4_lo=function(e,t,r,n,i,o,a,s){return t+n+o+s>>>0},t.sum64_5_hi=function(e,t,r,n,i,o,a,s,u,c){var l,f=t;return e+r+i+a+u+(l=0+ +((f=f+n>>>0)>>0)>>0)>>0)>>0},t.sum64_5_lo=function(e,t,r,n,i,o,a,s,u,c){return t+n+o+s+c>>>0},t.rotr64_hi=function(e,t,r){return(t<<32-r|e>>>r)>>>0},t.rotr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0},t.shr64_hi=function(e,t,r){return e>>>r},t.shr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0}},4910:function(e,t,r){"use strict";var n=r(7028),i=r(6545),o=r(3523);function a(e){if(!(this instanceof a))return new a(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=i.toArray(e.entropy,e.entropyEnc||"hex"),r=i.toArray(e.nonce,e.nonceEnc||"hex"),n=i.toArray(e.pers,e.persEnc||"hex");o(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,n)}e.exports=a,a.prototype._init=function(e,t,r){var n=e.concat(t).concat(r);this.K=Array(this.outLen/8),this.V=Array(this.outLen/8);for(var i=0;i=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(r||[])),this._reseed=1},a.prototype.generate=function(e,t,r,n){if(this._reseed>this.reseedInterval)throw Error("Reseed is required");"string"!=typeof t&&(n=r,r=t,t=null),r&&(r=i.toArray(r,n||"hex"),this._update(r));for(var o=[];o.length>>32-t}function c(e,t,r,n,i,o,a){return u(e+(t&r|~t&n)+i+o|0,a)+t|0}function l(e,t,r,n,i,o,a){return u(e+(t&n|r&~n)+i+o|0,a)+t|0}function f(e,t,r,n,i,o,a){return u(e+(t^r^n)+i+o|0,a)+t|0}function d(e,t,r,n,i,o,a){return u(e+(r^(t|~n))+i+o|0,a)+t|0}n(s,i),s.prototype._update=function(){for(var e=a,t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);var r=this._a,n=this._b,i=this._c,o=this._d;r=c(r,n,i,o,e[0],0xd76aa478,7),o=c(o,r,n,i,e[1],0xe8c7b756,12),i=c(i,o,r,n,e[2],0x242070db,17),n=c(n,i,o,r,e[3],0xc1bdceee,22),r=c(r,n,i,o,e[4],0xf57c0faf,7),o=c(o,r,n,i,e[5],0x4787c62a,12),i=c(i,o,r,n,e[6],0xa8304613,17),n=c(n,i,o,r,e[7],0xfd469501,22),r=c(r,n,i,o,e[8],0x698098d8,7),o=c(o,r,n,i,e[9],0x8b44f7af,12),i=c(i,o,r,n,e[10],0xffff5bb1,17),n=c(n,i,o,r,e[11],0x895cd7be,22),r=c(r,n,i,o,e[12],0x6b901122,7),o=c(o,r,n,i,e[13],0xfd987193,12),i=c(i,o,r,n,e[14],0xa679438e,17),n=c(n,i,o,r,e[15],0x49b40821,22),r=l(r,n,i,o,e[1],0xf61e2562,5),o=l(o,r,n,i,e[6],0xc040b340,9),i=l(i,o,r,n,e[11],0x265e5a51,14),n=l(n,i,o,r,e[0],0xe9b6c7aa,20),r=l(r,n,i,o,e[5],0xd62f105d,5),o=l(o,r,n,i,e[10],0x2441453,9),i=l(i,o,r,n,e[15],0xd8a1e681,14),n=l(n,i,o,r,e[4],0xe7d3fbc8,20),r=l(r,n,i,o,e[9],0x21e1cde6,5),o=l(o,r,n,i,e[14],0xc33707d6,9),i=l(i,o,r,n,e[3],0xf4d50d87,14),n=l(n,i,o,r,e[8],0x455a14ed,20),r=l(r,n,i,o,e[13],0xa9e3e905,5),o=l(o,r,n,i,e[2],0xfcefa3f8,9),i=l(i,o,r,n,e[7],0x676f02d9,14),n=l(n,i,o,r,e[12],0x8d2a4c8a,20),r=f(r,n,i,o,e[5],0xfffa3942,4),o=f(o,r,n,i,e[8],0x8771f681,11),i=f(i,o,r,n,e[11],0x6d9d6122,16),n=f(n,i,o,r,e[14],0xfde5380c,23),r=f(r,n,i,o,e[1],0xa4beea44,4),o=f(o,r,n,i,e[4],0x4bdecfa9,11),i=f(i,o,r,n,e[7],0xf6bb4b60,16),n=f(n,i,o,r,e[10],0xbebfbc70,23),r=f(r,n,i,o,e[13],0x289b7ec6,4),o=f(o,r,n,i,e[0],0xeaa127fa,11),i=f(i,o,r,n,e[3],0xd4ef3085,16),n=f(n,i,o,r,e[6],0x4881d05,23),r=f(r,n,i,o,e[9],0xd9d4d039,4),o=f(o,r,n,i,e[12],0xe6db99e5,11),i=f(i,o,r,n,e[15],0x1fa27cf8,16),n=f(n,i,o,r,e[2],0xc4ac5665,23),r=d(r,n,i,o,e[0],0xf4292244,6),o=d(o,r,n,i,e[7],0x432aff97,10),i=d(i,o,r,n,e[14],0xab9423a7,15),n=d(n,i,o,r,e[5],0xfc93a039,21),r=d(r,n,i,o,e[12],0x655b59c3,6),o=d(o,r,n,i,e[3],0x8f0ccc92,10),i=d(i,o,r,n,e[10],0xffeff47d,15),n=d(n,i,o,r,e[1],0x85845dd1,21),r=d(r,n,i,o,e[8],0x6fa87e4f,6),o=d(o,r,n,i,e[15],0xfe2ce6e0,10),i=d(i,o,r,n,e[6],0xa3014314,15),n=d(n,i,o,r,e[13],0x4e0811a1,21),r=d(r,n,i,o,e[4],0xf7537e82,6),o=d(o,r,n,i,e[11],0xbd3af235,10),i=d(i,o,r,n,e[2],0x2ad7d2bb,15),n=d(n,i,o,r,e[9],0xeb86d391,21),this._a=this._a+r|0,this._b=this._b+n|0,this._c=this._c+i|0,this._d=this._d+o|0},s.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var e=o.allocUnsafe(16);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e},e.exports=s},1354:function(e,t,r){var n=r(711),i=r(3500);function o(e){this.rand=e||new i.Rand}e.exports=o,o.create=function(e){return new o(e)},o.prototype._randbelow=function(e){var t=Math.ceil(e.bitLength()/8);do var r=new n(this.rand.generate(t));while(r.cmp(e)>=0);return r},o.prototype._randrange=function(e,t){var r=t.sub(e);return e.add(this._randbelow(r))},o.prototype.test=function(e,t,r){var i=e.bitLength(),o=n.mont(e),a=new n(1).toRed(o);t||(t=Math.max(1,i/48|0));for(var s=e.subn(1),u=0;!s.testn(u);u++);for(var c=e.shrn(u),l=s.toRed(o),f=!0;t>0;t--){var d=this._randrange(new n(2),s);r&&r(d);var h=d.toRed(o).redPow(c);if(0!==h.cmp(a)&&0!==h.cmp(l)){for(var p=1;p0;t--){var l=this._randrange(new n(2),a),f=e.gcd(l);if(0!==f.cmpn(1))return f;var d=l.toRed(i).redPow(u);if(0!==d.cmp(o)&&0!==d.cmp(c)){for(var h=1;h>8,a=255&i;o?r.push(o,a):r.push(a)}return r},r.zero2=n,r.toHex=i,r.encode=function(e,t){return"hex"===t?i(e):e}},8687:function(e,t,r){"use strict";var n=r(7160);t.certificate=r(8782),t.RSAPrivateKey=n.define("RSAPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("modulus").int(),this.key("publicExponent").int(),this.key("privateExponent").int(),this.key("prime1").int(),this.key("prime2").int(),this.key("exponent1").int(),this.key("exponent2").int(),this.key("coefficient").int())}),t.RSAPublicKey=n.define("RSAPublicKey",function(){this.seq().obj(this.key("modulus").int(),this.key("publicExponent").int())}),t.PublicKey=n.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(i),this.key("subjectPublicKey").bitstr())});var i=n.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid(),this.key("none").null_().optional(),this.key("curve").objid().optional(),this.key("params").seq().obj(this.key("p").int(),this.key("q").int(),this.key("g").int()).optional())});t.PrivateKey=n.define("PrivateKeyInfo",function(){this.seq().obj(this.key("version").int(),this.key("algorithm").use(i),this.key("subjectPrivateKey").octstr())}),t.EncryptedPrivateKey=n.define("EncryptedPrivateKeyInfo",function(){this.seq().obj(this.key("algorithm").seq().obj(this.key("id").objid(),this.key("decrypt").seq().obj(this.key("kde").seq().obj(this.key("id").objid(),this.key("kdeparams").seq().obj(this.key("salt").octstr(),this.key("iters").int())),this.key("cipher").seq().obj(this.key("algo").objid(),this.key("iv").octstr()))),this.key("subjectPrivateKey").octstr())}),t.DSAPrivateKey=n.define("DSAPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("p").int(),this.key("q").int(),this.key("g").int(),this.key("pub_key").int(),this.key("priv_key").int())}),t.DSAparam=n.define("DSAparam",function(){this.int()}),t.ECPrivateKey=n.define("ECPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("privateKey").octstr(),this.key("parameters").optional().explicit(0).use(o),this.key("publicKey").optional().explicit(1).bitstr())});var o=n.define("ECParameters",function(){this.choice({namedCurve:this.objid()})});t.signature=n.define("signature",function(){this.seq().obj(this.key("r").int(),this.key("s").int())})},8782:function(e,t,r){"use strict";var n=r(7160),i=n.define("Time",function(){this.choice({utcTime:this.utctime(),generalTime:this.gentime()})}),o=n.define("AttributeTypeValue",function(){this.seq().obj(this.key("type").objid(),this.key("value").any())}),a=n.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid(),this.key("parameters").optional(),this.key("curve").objid().optional())}),s=n.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(a),this.key("subjectPublicKey").bitstr())}),u=n.define("RelativeDistinguishedName",function(){this.setof(o)}),c=n.define("RDNSequence",function(){this.seqof(u)}),l=n.define("Name",function(){this.choice({rdnSequence:this.use(c)})}),f=n.define("Validity",function(){this.seq().obj(this.key("notBefore").use(i),this.key("notAfter").use(i))}),d=n.define("Extension",function(){this.seq().obj(this.key("extnID").objid(),this.key("critical").bool().def(!1),this.key("extnValue").octstr())}),h=n.define("TBSCertificate",function(){this.seq().obj(this.key("version").explicit(0).int().optional(),this.key("serialNumber").int(),this.key("signature").use(a),this.key("issuer").use(l),this.key("validity").use(f),this.key("subject").use(l),this.key("subjectPublicKeyInfo").use(s),this.key("issuerUniqueID").implicit(1).bitstr().optional(),this.key("subjectUniqueID").implicit(2).bitstr().optional(),this.key("extensions").explicit(3).seqof(d).optional())});e.exports=n.define("X509Certificate",function(){this.seq().obj(this.key("tbsCertificate").use(h),this.key("signatureAlgorithm").use(a),this.key("signatureValue").bitstr())})},6501:function(e,t,r){var n=/Proc-Type: 4,ENCRYPTED[\n\r]+DEK-Info: AES-((?:128)|(?:192)|(?:256))-CBC,([0-9A-H]+)[\n\r]+([0-9A-z\n\r\+\/\=]+)[\n\r]+/m,i=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----/m,o=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----([0-9A-z\n\r\+\/\=]+)-----END \1-----$/m,a=r(8368),s=r(6594),u=r(6911).Buffer;e.exports=function(e,t){var r,c=e.toString(),l=c.match(n);if(l){var f="aes"+l[1],d=u.from(l[2],"hex"),h=u.from(l[3].replace(/[\r\n]/g,""),"base64"),p=a(t,d.slice(0,8),parseInt(l[1],10)).key,m=[],y=s.createDecipheriv(f,p,d);m.push(y.update(h)),m.push(y.final()),r=u.concat(m)}else r=new u(c.match(o)[2].replace(/[\r\n]/g,""),"base64");return{tag:c.match(i)[1],data:r}}},9902:function(e,t,r){var n=r(8687),i=r(2510),o=r(6501),a=r(6594),s=r(4978),u=r(6911).Buffer;function c(e){"object"!=typeof e||u.isBuffer(e)||(t=e.passphrase,e=e.key),"string"==typeof e&&(e=u.from(e));var t,r,i,a=o(e,t),s=a.tag,c=a.data;switch(s){case"CERTIFICATE":i=n.certificate.decode(c,"der").tbsCertificate.subjectPublicKeyInfo;case"PUBLIC KEY":switch(!i&&(i=n.PublicKey.decode(c,"der")),r=i.algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return n.RSAPublicKey.decode(i.subjectPublicKey.data,"der");case"1.2.840.10045.2.1":return i.subjectPrivateKey=i.subjectPublicKey,{type:"ec",data:i};case"1.2.840.10040.4.1":return i.algorithm.params.pub_key=n.DSAparam.decode(i.subjectPublicKey.data,"der"),{type:"dsa",data:i.algorithm.params};default:throw Error("unknown key id "+r)}case"ENCRYPTED PRIVATE KEY":c=l(c=n.EncryptedPrivateKey.decode(c,"der"),t);case"PRIVATE KEY":switch(r=(i=n.PrivateKey.decode(c,"der")).algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return n.RSAPrivateKey.decode(i.subjectPrivateKey,"der");case"1.2.840.10045.2.1":return{curve:i.algorithm.curve,privateKey:n.ECPrivateKey.decode(i.subjectPrivateKey,"der").privateKey};case"1.2.840.10040.4.1":return i.algorithm.params.priv_key=n.DSAparam.decode(i.subjectPrivateKey,"der"),{type:"dsa",params:i.algorithm.params};default:throw Error("unknown key id "+r)}case"RSA PUBLIC KEY":return n.RSAPublicKey.decode(c,"der");case"RSA PRIVATE KEY":return n.RSAPrivateKey.decode(c,"der");case"DSA PRIVATE KEY":return{type:"dsa",params:n.DSAPrivateKey.decode(c,"der")};case"EC PRIVATE KEY":return{curve:(c=n.ECPrivateKey.decode(c,"der")).parameters.value,privateKey:c.privateKey};default:throw Error("unknown key type "+s)}}function l(e,t){var r=e.algorithm.decrypt.kde.kdeparams.salt,n=parseInt(e.algorithm.decrypt.kde.kdeparams.iters.toString(),10),o=i[e.algorithm.decrypt.cipher.algo.join(".")],c=e.algorithm.decrypt.cipher.iv,l=e.subjectPrivateKey,f=parseInt(o.split("-")[1],10)/8,d=s.pbkdf2Sync(t,r,n,f,"sha1"),h=a.createDecipheriv(o,d,c),p=[];return p.push(h.update(l)),p.push(h.final()),u.concat(p)}e.exports=c,c.signature=n.signature},4978:function(e,t,r){var n=r(6113),i=r(5349),o=r(7007),a=r(5407);function s(e,t,r,s,u,c){if(i(r,s),e=a(e,o,"Password"),t=a(t,o,"Salt"),"function"==typeof u&&(c=u,u="sha1"),"function"!=typeof c)throw Error("No callback provided to pbkdf2");return n.pbkdf2(e,t,r,s,u,c)}function u(e,t,r,s,u){return i(r,s),e=a(e,o,"Password"),t=a(t,o,"Salt"),u=u||"sha1",n.pbkdf2Sync(e,t,r,s,u)}n.pbkdf2Sync&&-1!==n.pbkdf2Sync.toString().indexOf("keylen, digest")?(t.pbkdf2Sync=u,t.pbkdf2=s):(t.pbkdf2Sync=r(2127),t.pbkdf2=r(9601))},9601:function(e,t,n){var i,a=n(6911).Buffer,s=n(5349),u=n(7007),c=n(2127),l=n(5407),f=r.g.crypto&&r.g.crypto.subtle,d={sha:"SHA-1","sha-1":"SHA-1",sha1:"SHA-1",sha256:"SHA-256","sha-256":"SHA-256",sha384:"SHA-384","sha-384":"SHA-384","sha-512":"SHA-512",sha512:"SHA-512"},h=[];function p(e){if(r.g.process&&!r.g.process.browser||!f||!f.importKey||!f.deriveBits)return Promise.resolve(!1);if(void 0!==h[e])return h[e];var t=m(i=i||a.alloc(8),i,10,128,e).then(function(){return!0}).catch(function(){return!1});return h[e]=t,t}function m(e,t,r,n,i){return f.importKey("raw",e,{name:"PBKDF2"},!1,["deriveBits"]).then(function(e){return f.deriveBits({name:"PBKDF2",salt:t,iterations:r,hash:{name:i}},e,n<<3)}).then(function(e){return a.from(e)})}function y(e,t){e.then(function(e){o.nextTick(function(){t(null,e)})},function(e){o.nextTick(function(){t(e)})})}e.exports=function(e,t,n,i,a,f){"function"==typeof a&&(f=a,a=void 0);var h=d[(a=a||"sha1").toLowerCase()];if(!h||"function"!=typeof r.g.Promise)return o.nextTick(function(){var r;try{r=c(e,t,n,i,a)}catch(e){return f(e)}f(null,r)});if(s(n,i),e=l(e,u,"Password"),t=l(t,u,"Salt"),"function"!=typeof f)throw Error("No callback provided to pbkdf2");y(p(h).then(function(r){return r?m(e,t,n,i,h):c(e,t,n,i,a)}),f)}},7007:function(e){e.exports="utf-8"},5349:function(e){var t=0x3fffffff;e.exports=function(e,r){if("number"!=typeof e)throw TypeError("Iterations not a number");if(e<0)throw TypeError("Bad iterations");if("number"!=typeof r)throw TypeError("Key length not a number");if(r<0||r>t||r!=r)throw TypeError("Bad key length")}},2127:function(e,t,r){var n={md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,rmd160:20,ripemd160:20},i=r(4873),o=r(6911).Buffer,a=r(5349),s=r(7007),u=r(5407);e.exports=function(e,t,r,c,l){a(r,c),e=u(e,s,"Password"),t=u(t,s,"Salt"),l=l||"sha1";var f=o.allocUnsafe(c),d=o.allocUnsafe(t.length+4);t.copy(d,0,0,t.length);for(var h=0,p=n[l],m=Math.ceil(c/p),y=1;y<=m;y++){d.writeUInt32BE(y,t.length);for(var g=i(l,e).update(d).digest(),b=g,v=1;v=t.length){o++;break}var a=t.slice(2,i-1);if(("0002"!==n.toString("hex")&&!r||"0001"!==n.toString("hex")&&r)&&o++,a.length<8&&o++,o)throw Error("decryption error");return t.slice(i)}function h(e,t){e=l.from(e),t=l.from(t);var r=0,n=e.length;e.length!==t.length&&(r++,n=Math.min(e.length,t.length));for(var i=-1;++ih||new a(t).cmp(u.modulus)>=0)throw Error("decryption error");i=r?c(new a(t),u):s(t,u);var p=l.alloc(h-i.length);if(i=l.concat([p,i],h),4===o)return f(u,i);if(1===o)return d(u,i,r);if(3===o)return i;throw Error("unknown padding")}},3995:function(e,t,r){var n=r(9902),i=r(7223),o=r(9739),a=r(5520),s=r(6386),u=r(711),c=r(1607),l=r(7166),f=r(6911).Buffer;function d(e,t){var r=e.modulus.byteLength(),n=t.length,c=o("sha1").update(f.alloc(0)).digest(),l=c.length,d=2*l;if(n>r-d-2)throw Error("message too long");var h=f.alloc(r-n-d-2),p=r-l-1,m=i(l),y=s(f.concat([c,h,f.alloc(1,1),t],p),a(m,p)),g=s(m,a(y,l));return new u(f.concat([f.alloc(1),g,y],r))}function h(e,t,r){var n,i=t.length,o=e.modulus.byteLength();if(i>o-11)throw Error("message too long");return n=r?f.alloc(o-i-3,255):p(o-i-3),new u(f.concat([f.from([0,r?1:2]),n,f.alloc(1),t],o))}function p(e){for(var t,r=f.allocUnsafe(e),n=0,o=i(2*e),a=0;n=0)throw Error("data too long for modulus")}else throw Error("unknown padding");return r?l(i,a):c(i,a)}},1607:function(e,t,r){var n=r(711),i=r(6911).Buffer;e.exports=function(e,t){return i.from(e.toRed(n.mont(t.modulus)).redPow(new n(t.publicExponent)).fromRed().toArray())}},6386:function(e){e.exports=function(e,t){for(var r=e.length,n=-1;++na)throw RangeError("requested too many random bytes");var r=u.allocUnsafe(e);if(e>0)if(e>i)for(var n=0;nl||e<0)throw TypeError("offset must be a uint32");if(e>u||e>t)throw RangeError("offset out of range")}function d(e,t,r){if("number"!=typeof e||e!=e)throw TypeError("size must be a number");if(e>l||e<0)throw TypeError("size must be a uint32");if(e+t>r||e>u)throw RangeError("buffer too small")}function h(e,t,n,i){if(!s.isBuffer(e)&&!(e instanceof r.g.Uint8Array))throw TypeError('"buf" argument must be a Buffer or Uint8Array');if("function"==typeof t)i=t,t=0,n=e.length;else if("function"==typeof n)i=n,n=e.length-t;else if("function"!=typeof i)throw TypeError('"cb" argument must be a function');return f(t,e.length),d(n,t,e.length),p(e,t,n,i)}function p(e,t,r,n){var i=new Uint8Array(e.buffer,t,r);return(c.getRandomValues(i),n)?void o.nextTick(function(){n(null,e)}):e}function m(e,t,n){if(void 0===t&&(t=0),!s.isBuffer(e)&&!(e instanceof r.g.Uint8Array))throw TypeError('"buf" argument must be a Buffer or Uint8Array');return f(t,e.length),void 0===n&&(n=e.length-t),d(n,t,e.length),p(e,t,n)}c&&c.getRandomValues?(t.randomFill=h,t.randomFillSync=m):(t.randomFill=i,t.randomFillSync=i)},4646:function(e){"use strict";let t={};function r(e,r,n){function i(e,t,n){return"string"==typeof r?r:r(e,t,n)}n||(n=Error);class o extends n{constructor(e,t,r){super(i(e,t,r))}}o.prototype.name=n.name,o.prototype.code=e,t[e]=o}function n(e,t){if(!Array.isArray(e))return`of ${t} ${String(e)}`;{let r=e.length;return(e=e.map(e=>String(e)),r>2)?`one of ${t} ${e.slice(0,r-1).join(", ")}, or `+e[r-1]:2===r?`one of ${t} ${e[0]} or ${e[1]}`:`of ${t} ${e[0]}`}}function i(e,t,r){return e.substr(!r||r<0?0:+r,t.length)===t}function o(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}function a(e,t,r){return"number"!=typeof r&&(r=0),!(r+t.length>e.length)&&-1!==e.indexOf(t,r)}r("ERR_INVALID_OPT_VALUE",function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'},TypeError),r("ERR_INVALID_ARG_TYPE",function(e,t,r){let s,u;if("string"==typeof t&&i(t,"not ")?(s="must not be",t=t.replace(/^not /,"")):s="must be",o(e," argument"))u=`The ${e} ${s} ${n(t,"type")}`;else{let r=a(e,".")?"property":"argument";u=`The "${e}" ${r} ${s} ${n(t,"type")}`}return u+`. Received type ${typeof r}`},TypeError),r("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),r("ERR_METHOD_NOT_IMPLEMENTED",function(e){return"The "+e+" method is not implemented"}),r("ERR_STREAM_PREMATURE_CLOSE","Premature close"),r("ERR_STREAM_DESTROYED",function(e){return"Cannot call "+e+" after a stream was destroyed"}),r("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),r("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),r("ERR_STREAM_WRITE_AFTER_END","write after end"),r("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),r("ERR_UNKNOWN_ENCODING",function(e){return"Unknown encoding: "+e},TypeError),r("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.q=t},2403:function(e,t,r){"use strict";var n=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};e.exports=l;var i=r(1709),a=r(7337);r(3782)(l,i);for(var s=n(a.prototype),u=0;u0)if("string"==typeof t||s.objectMode||Object.getPrototypeOf(t)===d.prototype||(t=p(t)),n)s.endEmitted?x(e,new T):I(e,s,t,!0);else if(s.ended)x(e,new E);else{if(s.destroyed)return!1;s.reading=!1,s.decoder&&!r?(t=s.decoder.write(t),s.objectMode||0!==t.length?I(e,s,t,!1):B(e,s)):I(e,s,t,!1)}else n||(s.reading=!1,B(e,s));return!s.ended&&(s.length=P?e=P:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}function D(e,t){if(e<=0||0===t.length&&t.ended)return 0;if(t.objectMode)return 1;if(e!=e)if(t.flowing&&t.length)return t.buffer.head.data.length;else return t.length;return(e>t.highWaterMark&&(t.highWaterMark=k(e)),e<=t.length)?e:t.ended?t.length:(t.needReadable=!0,0)}function L(e,t){if(a("onEofChunk"),!t.ended){if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,t.sync?j(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,U(e)))}}function j(e){var t=e._readableState;a("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(a("emitReadable",t.flowing),t.emittedReadable=!0,o.nextTick(U,e))}function U(e){var t=e._readableState;a("emitReadable_",t.destroyed,t.length,t.ended),!t.destroyed&&(t.length||t.ended)&&(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,H(e)}function B(e,t){t.readingMore||(t.readingMore=!0,o.nextTick(F,e,t))}function F(e,t){for(;!t.reading&&!t.ended&&(t.length0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function V(e){a("readable nexttick read 0"),e.read(0)}function Y(e,t){t.resumeScheduled||(t.resumeScheduled=!0,o.nextTick(q,e,t))}function q(e,t){a("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),H(e),t.flowing&&!t.reading&&e.read(0)}function H(e){var t=e._readableState;for(a("flow",t.flowing);t.flowing&&null!==e.read(););}function W(e,t){var r;return 0===t.length?null:(t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r)}function G(e){var t=e._readableState;a("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,o.nextTick(Z,t,e))}function Z(e,t){if(a("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var r=t._writableState;(!r||r.autoDestroy&&r.finished)&&t.destroy()}}function K(e,t){for(var r=0,n=e.length;r=r.highWaterMark:r.length>0)||r.ended))return a("read: emitReadable",r.length,r.ended),0===r.length&&r.ended?G(this):j(this),null;if(0===(e=D(e,r))&&r.ended)return 0===r.length&&G(this),null;var i=r.needReadable;return a("need readable",i),(0===r.length||r.length-e0?W(e,r):null)?(r.needReadable=r.length<=r.highWaterMark,e=0):(r.length-=e,r.awaitDrain=0),0===r.length&&(r.ended||(r.needReadable=!0),n!==e&&r.ended&&G(this)),null!==t&&this.emit("data",t),t},R.prototype._read=function(e){x(this,new w("_read()"))},R.prototype.pipe=function(e,t){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=e;break;case 1:n.pipes=[n.pipes,e];break;default:n.pipes.push(e)}n.pipesCount+=1,a("pipe count=%d opts=%j",n.pipesCount,t);var i=t&&!1===t.end||e===o.stdout||e===o.stderr?g:u;function s(e,t){a("onunpipe"),e===r&&t&&!1===t.hasUnpiped&&(t.hasUnpiped=!0,d())}function u(){a("onend"),e.end()}n.endEmitted?o.nextTick(i):r.once("end",i),e.on("unpipe",s);var c=z(r);e.on("drain",c);var f=!1;function d(){a("cleanup"),e.removeListener("close",m),e.removeListener("finish",y),e.removeListener("drain",c),e.removeListener("error",p),e.removeListener("unpipe",s),r.removeListener("end",u),r.removeListener("end",g),r.removeListener("data",h),f=!0,n.awaitDrain&&(!e._writableState||e._writableState.needDrain)&&c()}function h(t){a("ondata");var i=e.write(t);a("dest.write",i),!1===i&&((1===n.pipesCount&&n.pipes===e||n.pipesCount>1&&-1!==K(n.pipes,e))&&!f&&(a("false write response, pause",n.awaitDrain),n.awaitDrain++),r.pause())}function p(t){a("onerror",t),g(),e.removeListener("error",p),0===l(e,"error")&&x(e,t)}function m(){e.removeListener("finish",y),g()}function y(){a("onfinish"),e.removeListener("close",m),g()}function g(){a("unpipe"),r.unpipe(e)}return r.on("data",h),O(e,"error",p),e.once("close",m),e.once("finish",y),e.emit("pipe",r),n.flowing||(a("pipe resume"),r.resume()),e},R.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r)),this;if(!e){var n=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var o=0;o0,!1!==n.flowing&&this.resume()):"readable"!==e||n.endEmitted||n.readableListening||(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,a("on readable",n.length,n.reading),n.length?j(this):n.reading||o.nextTick(V,this)),r},R.prototype.addListener=R.prototype.on,R.prototype.removeListener=function(e,t){var r=f.prototype.removeListener.call(this,e,t);return"readable"===e&&o.nextTick($,this),r},R.prototype.removeAllListeners=function(e){var t=f.prototype.removeAllListeners.apply(this,arguments);return("readable"===e||void 0===e)&&o.nextTick($,this),t},R.prototype.resume=function(){var e=this._readableState;return e.flowing||(a("resume"),e.flowing=!e.readableListening,Y(this,e)),e.paused=!1,this},R.prototype.pause=function(){return a("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(a("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},R.prototype.wrap=function(e){var t=this,r=this._readableState,n=!1;for(var i in e.on("end",function(){if(a("wrapped end"),r.decoder&&!r.ended){var e=r.decoder.end();e&&e.length&&t.push(e)}t.push(null)}),e.on("data",function(i){a("wrapped data"),r.decoder&&(i=r.decoder.write(i)),r.objectMode&&null==i||(r.objectMode||i&&i.length)&&(t.push(i)||(n=!0,e.pause()))}),e)void 0===this[i]&&"function"==typeof e[i]&&(this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i));for(var o=0;o-1))throw new T(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(M.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(M.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),M.prototype._write=function(e,t,r){r(new b("_write()"))},M.prototype._writev=null,M.prototype.end=function(e,t,r){var n=this._writableState;return"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!=e&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||Y(this,n,r),this},Object.defineProperty(M.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(M.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),M.prototype.destroy=p.destroy,M.prototype._undestroy=p.undestroy,M.prototype._destroy=function(e,t){t(e)}},6871:function(e,t,r){"use strict";function n(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var i,a=r(9698),s=Symbol("lastResolve"),u=Symbol("lastReject"),c=Symbol("error"),l=Symbol("ended"),f=Symbol("lastPromise"),d=Symbol("handlePromise"),h=Symbol("stream");function p(e,t){return{value:e,done:t}}function m(e){var t=e[s];if(null!==t){var r=e[h].read();null!==r&&(e[f]=null,e[s]=null,e[u]=null,t(p(r,!1)))}}function y(e){o.nextTick(m,e)}function g(e,t){return function(r,n){e.then(function(){t[l]?r(p(void 0,!0)):t[d](r,n)},n)}}var b=Object.getPrototypeOf(function(){}),v=Object.setPrototypeOf((n(i={get stream(){return this[h]},next:function(){var e,t=this,r=this[c];if(null!==r)return Promise.reject(r);if(this[l])return Promise.resolve(p(void 0,!0));if(this[h].destroyed)return new Promise(function(e,r){o.nextTick(function(){t[c]?r(t[c]):e(p(void 0,!0))})});var n=this[f];if(n)e=new Promise(g(n,this));else{var i=this[h].read();if(null!==i)return Promise.resolve(p(i,!1));e=new Promise(this[d])}return this[f]=e,e}},Symbol.asyncIterator,function(){return this}),n(i,"return",function(){var e=this;return new Promise(function(t,r){e[h].destroy(null,function(e){e?r(e):t(p(void 0,!0))})})}),i),b);e.exports=function(e){var t,r=Object.create(v,(n(t={},h,{value:e,writable:!0}),n(t,s,{value:null,writable:!0}),n(t,u,{value:null,writable:!0}),n(t,c,{value:null,writable:!0}),n(t,l,{value:e._readableState.endEmitted,writable:!0}),n(t,d,{value:function(e,t){var n=r[h].read();n?(r[f]=null,r[s]=null,r[u]=null,e(p(n,!1))):(r[s]=e,r[u]=t)},writable:!0}),t));return r[f]=null,a(e,function(e){if(e&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code){var t=r[u];null!==t&&(r[f]=null,r[s]=null,r[u]=null,t(e)),r[c]=e;return}var n=r[s];null!==n&&(r[f]=null,r[s]=null,r[u]=null,n(p(void 0,!0))),r[l]=!0}),e.on("readable",y.bind(null,r)),r}},4379:function(e,t,r){"use strict";function n(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function i(e){for(var t=1;t0?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:"unshift",value:function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}},{key:"shift",value:function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r}},{key:"concat",value:function(e){if(0===this.length)return c.alloc(0);for(var t=c.allocUnsafe(e>>>0),r=this.head,n=0;r;)d(r.data,t,n),n+=r.data.length,r=r.next;return t}},{key:"consume",value:function(e,t){var r;return ei.length?i.length:e;if(o===i.length?n+=i:n+=i.slice(0,e),0==(e-=o)){o===i.length?(++r,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=i.slice(o));break}++r}return this.length-=r,n}},{key:"_getBuffer",value:function(e){var t=c.allocUnsafe(e),r=this.head,n=1;for(r.data.copy(t),e-=r.data.length;r=r.next;){var i=r.data,o=e>i.length?i.length:e;if(i.copy(t,t.length-e,0,o),0==(e-=o)){o===i.length?(++n,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=i.slice(o));break}++n}return this.length-=n,t}},{key:f,value:function(e,t){return l(this,i({},t,{depth:0,customInspect:!1}))}}]),e}()},7025:function(e){"use strict";function t(e,t){n(e,t),r(e)}function r(e){e._writableState&&!e._writableState.emitClose||(!e._readableState||e._readableState.emitClose)&&e.emit("close")}function n(e,t){e.emit("error",t)}e.exports={destroy:function(e,i){var a=this,s=this._readableState&&this._readableState.destroyed,u=this._writableState&&this._writableState.destroyed;return s||u?i?i(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,o.nextTick(n,this,e)):o.nextTick(n,this,e)):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(e){!i&&e?a._writableState?a._writableState.errorEmitted?o.nextTick(r,a):(a._writableState.errorEmitted=!0,o.nextTick(t,a,e)):o.nextTick(t,a,e):i?(o.nextTick(r,a),i(e)):o.nextTick(r,a)})),this},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(e,t){var r=e._readableState,n=e._writableState;r&&r.autoDestroy||n&&n.autoDestroy?e.destroy(t):e.emit("error",t)}}},9698:function(e,t,r){"use strict";var n=r(4646).q.ERR_STREAM_PREMATURE_CLOSE;function i(e){var t=!1;return function(){if(!t){t=!0;for(var r=arguments.length,n=Array(r),i=0;i0,function(t){e||(e=t),t&&o.forEach(f),a||(o.forEach(f),i(e))})});return r.reduce(d)}},6776:function(e,t,r){"use strict";var n=r(4646).q.ERR_INVALID_OPT_VALUE;function i(e,t,r){return null!=e.highWaterMark?e.highWaterMark:t?e[r]:null}e.exports={getHighWaterMark:function(e,t,r,o){var a=i(t,o,r);if(null!=a){if(!(isFinite(a)&&Math.floor(a)===a)||a<0)throw new n(o?r:"highWaterMark",a);return Math.floor(a)}return e.objectMode?16:16384}}},4678:function(e,t,r){e.exports=r(2781)},3726:function(e,t,r){var n=r(2781);"disable"===o.env.READABLE_STREAM&&n?(e.exports=n.Readable,Object.assign(e.exports,n),e.exports.Stream=n):((t=e.exports=r(1709)).Stream=n||t,t.Readable=t,t.Writable=r(7337),t.Duplex=r(2403),t.Transform=r(1170),t.PassThrough=r(7889),t.finished=r(9698),t.pipeline=r(8442))},3225:function(e,t,r){"use strict";var n=r(4300).Buffer,i=r(3782),o=r(9029),a=Array(16),s=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],u=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],c=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],l=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11],f=[0,0x5a827999,0x6ed9eba1,0x8f1bbcdc,0xa953fd4e],d=[0x50a28be6,0x5c4dd124,0x6d703ef3,0x7a6d76e9,0];function h(){o.call(this,64),this._a=0x67452301,this._b=0xefcdab89,this._c=0x98badcfe,this._d=0x10325476,this._e=0xc3d2e1f0}function p(e,t){return e<>>32-t}function m(e,t,r,n,i,o,a,s){return p(e+(t^r^n)+o+a|0,s)+i|0}function y(e,t,r,n,i,o,a,s){return p(e+(t&r|~t&n)+o+a|0,s)+i|0}function g(e,t,r,n,i,o,a,s){return p(e+((t|~r)^n)+o+a|0,s)+i|0}function b(e,t,r,n,i,o,a,s){return p(e+(t&n|r&~n)+o+a|0,s)+i|0}function v(e,t,r,n,i,o,a,s){return p(e+(t^(r|~n))+o+a|0,s)+i|0}i(h,o),h.prototype._update=function(){for(var e,t,r=a,n=0;n<16;++n)r[n]=this._block.readInt32LE(4*n);for(var i=0|this._a,o=0|this._b,h=0|this._c,_=0|this._d,S=0|this._e,E=0|this._a,w=0|this._b,T=0|this._c,x=0|this._d,A=0|this._e,O=0;O<80;O+=1)O<16?(e=m(i,o,h,_,S,r[s[O]],f[0],c[O]),t=v(E,w,T,x,A,r[u[O]],d[0],l[O])):O<32?(e=y(i,o,h,_,S,r[s[O]],f[1],c[O]),t=b(E,w,T,x,A,r[u[O]],d[1],l[O])):O<48?(e=g(i,o,h,_,S,r[s[O]],f[2],c[O]),t=g(E,w,T,x,A,r[u[O]],d[2],l[O])):O<64?(e=b(i,o,h,_,S,r[s[O]],f[3],c[O]),t=y(E,w,T,x,A,r[u[O]],d[3],l[O])):(e=v(i,o,h,_,S,r[s[O]],f[4],c[O]),t=m(E,w,T,x,A,r[u[O]],d[4],l[O])),i=S,S=_,_=p(h,10),h=o,o=e,E=A,A=x,x=p(T,10),T=w,w=t;var M=this._b+h+x|0;this._b=this._c+_+A|0,this._c=this._d+S+E|0,this._d=this._e+i+w|0,this._e=this._a+o+T|0,this._a=M},h.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var e=n.alloc?n.alloc(20):new n(20);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e.writeInt32LE(this._e,16),e},e.exports=h},5055:function(e,t,r){var n=r(4300),i=n.Buffer;function o(e,t){for(var r in e)t[r]=e[r]}function a(e,t,r){return i(e,t,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=n:(o(n,t),t.Buffer=a),a.prototype=Object.create(i.prototype),o(i,a),a.from=function(e,t,r){if("number"==typeof e)throw TypeError("Argument must not be a number");return i(e,t,r)},a.alloc=function(e,t,r){if("number"!=typeof e)throw TypeError("Argument must be a number");var n=i(e);return void 0!==t?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},a.allocUnsafe=function(e){if("number"!=typeof e)throw TypeError("Argument must be a number");return i(e)},a.allocUnsafeSlow=function(e){if("number"!=typeof e)throw TypeError("Argument must be a number");return n.SlowBuffer(e)}},6911:function(e,t,r){var n=r(4300),i=n.Buffer;function o(e,t){for(var r in e)t[r]=e[r]}function a(e,t,r){return i(e,t,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=n:(o(n,t),t.Buffer=a),a.prototype=Object.create(i.prototype),o(i,a),a.from=function(e,t,r){if("number"==typeof e)throw TypeError("Argument must not be a number");return i(e,t,r)},a.alloc=function(e,t,r){if("number"!=typeof e)throw TypeError("Argument must be a number");var n=i(e);return void 0!==t?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},a.allocUnsafe=function(e){if("number"!=typeof e)throw TypeError("Argument must be a number");return i(e)},a.allocUnsafeSlow=function(e){if("number"!=typeof e)throw TypeError("Argument must be a number");return n.SlowBuffer(e)}},2858:function(e,t,r){var n=r(6911).Buffer;function i(e,t){this._block=n.alloc(e),this._finalSize=t,this._blockSize=e,this._len=0}i.prototype.update=function(e,t){"string"==typeof e&&(t=t||"utf8",e=n.from(e,t));for(var r=this._block,i=this._blockSize,o=e.length,a=this._len,s=0;s=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=8*this._len;if(r<=0xffffffff)this._block.writeUInt32BE(r,this._blockSize-4);else{var n=r>>>0,i=(r-n)/0x100000000;this._block.writeUInt32BE(i,this._blockSize-8),this._block.writeUInt32BE(n,this._blockSize-4)}this._update(this._block);var o=this._hash();return e?o.toString(e):o},i.prototype._update=function(){throw Error("_update must be implemented by subclass")},e.exports=i},4371:function(e,t,r){var n=e.exports=function(e){var t=n[e=e.toLowerCase()];if(!t)throw Error(e+" is not supported (we accept pull requests)");return new t};n.sha=r(4018),n.sha1=r(4179),n.sha224=r(532),n.sha256=r(1843),n.sha384=r(7455),n.sha512=r(9934)},4018:function(e,t,r){var n=r(3782),i=r(2858),o=r(6911).Buffer,a=[0x5a827999,0x6ed9eba1,-0x70e44324,-0x359d3e2a],s=Array(80);function u(){this.init(),this._w=s,i.call(this,64,56)}function c(e){return e<<5|e>>>27}function l(e){return e<<30|e>>>2}function f(e,t,r,n){return 0===e?t&r|~t&n:2===e?t&r|t&n|r&n:t^r^n}n(u,i),u.prototype.init=function(){return this._a=0x67452301,this._b=0xefcdab89,this._c=0x98badcfe,this._d=0x10325476,this._e=0xc3d2e1f0,this},u.prototype._update=function(e){for(var t=this._w,r=0|this._a,n=0|this._b,i=0|this._c,o=0|this._d,s=0|this._e,u=0;u<16;++u)t[u]=e.readInt32BE(4*u);for(;u<80;++u)t[u]=t[u-3]^t[u-8]^t[u-14]^t[u-16];for(var d=0;d<80;++d){var h=~~(d/20),p=c(r)+f(h,n,i,o)+s+t[d]+a[h]|0;s=o,o=i,i=l(n),n=r,r=p}this._a=r+this._a|0,this._b=n+this._b|0,this._c=i+this._c|0,this._d=o+this._d|0,this._e=s+this._e|0},u.prototype._hash=function(){var e=o.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},e.exports=u},4179:function(e,t,r){var n=r(3782),i=r(2858),o=r(6911).Buffer,a=[0x5a827999,0x6ed9eba1,-0x70e44324,-0x359d3e2a],s=Array(80);function u(){this.init(),this._w=s,i.call(this,64,56)}function c(e){return e<<1|e>>>31}function l(e){return e<<5|e>>>27}function f(e){return e<<30|e>>>2}function d(e,t,r,n){return 0===e?t&r|~t&n:2===e?t&r|t&n|r&n:t^r^n}n(u,i),u.prototype.init=function(){return this._a=0x67452301,this._b=0xefcdab89,this._c=0x98badcfe,this._d=0x10325476,this._e=0xc3d2e1f0,this},u.prototype._update=function(e){for(var t=this._w,r=0|this._a,n=0|this._b,i=0|this._c,o=0|this._d,s=0|this._e,u=0;u<16;++u)t[u]=e.readInt32BE(4*u);for(;u<80;++u)t[u]=c(t[u-3]^t[u-8]^t[u-14]^t[u-16]);for(var h=0;h<80;++h){var p=~~(h/20),m=l(r)+d(p,n,i,o)+s+t[h]+a[p]|0;s=o,o=i,i=f(n),n=r,r=m}this._a=r+this._a|0,this._b=n+this._b|0,this._c=i+this._c|0,this._d=o+this._d|0,this._e=s+this._e|0},u.prototype._hash=function(){var e=o.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},e.exports=u},532:function(e,t,r){var n=r(3782),i=r(1843),o=r(2858),a=r(6911).Buffer,s=Array(64);function u(){this.init(),this._w=s,o.call(this,64,56)}n(u,i),u.prototype.init=function(){return this._a=0xc1059ed8,this._b=0x367cd507,this._c=0x3070dd17,this._d=0xf70e5939,this._e=0xffc00b31,this._f=0x68581511,this._g=0x64f98fa7,this._h=0xbefa4fa4,this},u.prototype._hash=function(){var e=a.allocUnsafe(28);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e},e.exports=u},1843:function(e,t,r){var n=r(3782),i=r(2858),o=r(6911).Buffer,a=[0x428a2f98,0x71374491,0xb5c0fbcf,0xe9b5dba5,0x3956c25b,0x59f111f1,0x923f82a4,0xab1c5ed5,0xd807aa98,0x12835b01,0x243185be,0x550c7dc3,0x72be5d74,0x80deb1fe,0x9bdc06a7,0xc19bf174,0xe49b69c1,0xefbe4786,0xfc19dc6,0x240ca1cc,0x2de92c6f,0x4a7484aa,0x5cb0a9dc,0x76f988da,0x983e5152,0xa831c66d,0xb00327c8,0xbf597fc7,0xc6e00bf3,0xd5a79147,0x6ca6351,0x14292967,0x27b70a85,0x2e1b2138,0x4d2c6dfc,0x53380d13,0x650a7354,0x766a0abb,0x81c2c92e,0x92722c85,0xa2bfe8a1,0xa81a664b,0xc24b8b70,0xc76c51a3,0xd192e819,0xd6990624,0xf40e3585,0x106aa070,0x19a4c116,0x1e376c08,0x2748774c,0x34b0bcb5,0x391c0cb3,0x4ed8aa4a,0x5b9cca4f,0x682e6ff3,0x748f82ee,0x78a5636f,0x84c87814,0x8cc70208,0x90befffa,0xa4506ceb,0xbef9a3f7,0xc67178f2],s=Array(64);function u(){this.init(),this._w=s,i.call(this,64,56)}function c(e,t,r){return r^e&(t^r)}function l(e,t,r){return e&t|r&(e|t)}function f(e){return(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10)}function d(e){return(e>>>6|e<<26)^(e>>>11|e<<21)^(e>>>25|e<<7)}function h(e){return(e>>>7|e<<25)^(e>>>18|e<<14)^e>>>3}function p(e){return(e>>>17|e<<15)^(e>>>19|e<<13)^e>>>10}n(u,i),u.prototype.init=function(){return this._a=0x6a09e667,this._b=0xbb67ae85,this._c=0x3c6ef372,this._d=0xa54ff53a,this._e=0x510e527f,this._f=0x9b05688c,this._g=0x1f83d9ab,this._h=0x5be0cd19,this},u.prototype._update=function(e){for(var t=this._w,r=0|this._a,n=0|this._b,i=0|this._c,o=0|this._d,s=0|this._e,u=0|this._f,m=0|this._g,y=0|this._h,g=0;g<16;++g)t[g]=e.readInt32BE(4*g);for(;g<64;++g)t[g]=p(t[g-2])+t[g-7]+h(t[g-15])+t[g-16]|0;for(var b=0;b<64;++b){var v=y+d(s)+c(s,u,m)+a[b]+t[b]|0,_=f(r)+l(r,n,i)|0;y=m,m=u,u=s,s=o+v|0,o=i,i=n,n=r,r=v+_|0}this._a=r+this._a|0,this._b=n+this._b|0,this._c=i+this._c|0,this._d=o+this._d|0,this._e=s+this._e|0,this._f=u+this._f|0,this._g=m+this._g|0,this._h=y+this._h|0},u.prototype._hash=function(){var e=o.allocUnsafe(32);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e.writeInt32BE(this._h,28),e},e.exports=u},7455:function(e,t,r){var n=r(3782),i=r(9934),o=r(2858),a=r(6911).Buffer,s=Array(160);function u(){this.init(),this._w=s,o.call(this,128,112)}n(u,i),u.prototype.init=function(){return this._ah=0xcbbb9d5d,this._bh=0x629a292a,this._ch=0x9159015a,this._dh=0x152fecd8,this._eh=0x67332667,this._fh=0x8eb44a87,this._gh=0xdb0c2e0d,this._hh=0x47b5481d,this._al=0xc1059ed8,this._bl=0x367cd507,this._cl=0x3070dd17,this._dl=0xf70e5939,this._el=0xffc00b31,this._fl=0x68581511,this._gl=0x64f98fa7,this._hl=0xbefa4fa4,this},u.prototype._hash=function(){var e=a.allocUnsafe(48);function t(t,r,n){e.writeInt32BE(t,n),e.writeInt32BE(r,n+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),e},e.exports=u},9934:function(e,t,r){var n=r(3782),i=r(2858),o=r(6911).Buffer,a=[0x428a2f98,0xd728ae22,0x71374491,0x23ef65cd,0xb5c0fbcf,0xec4d3b2f,0xe9b5dba5,0x8189dbbc,0x3956c25b,0xf348b538,0x59f111f1,0xb605d019,0x923f82a4,0xaf194f9b,0xab1c5ed5,0xda6d8118,0xd807aa98,0xa3030242,0x12835b01,0x45706fbe,0x243185be,0x4ee4b28c,0x550c7dc3,0xd5ffb4e2,0x72be5d74,0xf27b896f,0x80deb1fe,0x3b1696b1,0x9bdc06a7,0x25c71235,0xc19bf174,0xcf692694,0xe49b69c1,0x9ef14ad2,0xefbe4786,0x384f25e3,0xfc19dc6,0x8b8cd5b5,0x240ca1cc,0x77ac9c65,0x2de92c6f,0x592b0275,0x4a7484aa,0x6ea6e483,0x5cb0a9dc,0xbd41fbd4,0x76f988da,0x831153b5,0x983e5152,0xee66dfab,0xa831c66d,0x2db43210,0xb00327c8,0x98fb213f,0xbf597fc7,0xbeef0ee4,0xc6e00bf3,0x3da88fc2,0xd5a79147,0x930aa725,0x6ca6351,0xe003826f,0x14292967,0xa0e6e70,0x27b70a85,0x46d22ffc,0x2e1b2138,0x5c26c926,0x4d2c6dfc,0x5ac42aed,0x53380d13,0x9d95b3df,0x650a7354,0x8baf63de,0x766a0abb,0x3c77b2a8,0x81c2c92e,0x47edaee6,0x92722c85,0x1482353b,0xa2bfe8a1,0x4cf10364,0xa81a664b,0xbc423001,0xc24b8b70,0xd0f89791,0xc76c51a3,0x654be30,0xd192e819,0xd6ef5218,0xd6990624,0x5565a910,0xf40e3585,0x5771202a,0x106aa070,0x32bbd1b8,0x19a4c116,0xb8d2d0c8,0x1e376c08,0x5141ab53,0x2748774c,0xdf8eeb99,0x34b0bcb5,0xe19b48a8,0x391c0cb3,0xc5c95a63,0x4ed8aa4a,0xe3418acb,0x5b9cca4f,0x7763e373,0x682e6ff3,0xd6b2b8a3,0x748f82ee,0x5defb2fc,0x78a5636f,0x43172f60,0x84c87814,0xa1f0ab72,0x8cc70208,0x1a6439ec,0x90befffa,0x23631e28,0xa4506ceb,0xde82bde9,0xbef9a3f7,0xb2c67915,0xc67178f2,0xe372532b,0xca273ece,0xea26619c,0xd186b8c7,0x21c0c207,0xeada7dd6,0xcde0eb1e,0xf57d4f7f,0xee6ed178,0x6f067aa,0x72176fba,0xa637dc5,0xa2c898a6,0x113f9804,0xbef90dae,0x1b710b35,0x131c471b,0x28db77f5,0x23047d84,0x32caab7b,0x40c72493,0x3c9ebe0a,0x15c9bebc,0x431d67c4,0x9c100d4c,0x4cc5d4be,0xcb3e42b6,0x597f299c,0xfc657e2a,0x5fcb6fab,0x3ad6faec,0x6c44198c,0x4a475817],s=Array(160);function u(){this.init(),this._w=s,i.call(this,128,112)}function c(e,t,r){return r^e&(t^r)}function l(e,t,r){return e&t|r&(e|t)}function f(e,t){return(e>>>28|t<<4)^(t>>>2|e<<30)^(t>>>7|e<<25)}function d(e,t){return(e>>>14|t<<18)^(e>>>18|t<<14)^(t>>>9|e<<23)}function h(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^e>>>7}function p(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^(e>>>7|t<<25)}function m(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^e>>>6}function y(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^(e>>>6|t<<26)}function g(e,t){return+(e>>>0>>0)}n(u,i),u.prototype.init=function(){return this._ah=0x6a09e667,this._bh=0xbb67ae85,this._ch=0x3c6ef372,this._dh=0xa54ff53a,this._eh=0x510e527f,this._fh=0x9b05688c,this._gh=0x1f83d9ab,this._hh=0x5be0cd19,this._al=0xf3bcc908,this._bl=0x84caa73b,this._cl=0xfe94f82b,this._dl=0x5f1d36f1,this._el=0xade682d1,this._fl=0x2b3e6c1f,this._gl=0xfb41bd6b,this._hl=0x137e2179,this},u.prototype._update=function(e){for(var t=this._w,r=0|this._ah,n=0|this._bh,i=0|this._ch,o=0|this._dh,s=0|this._eh,u=0|this._fh,b=0|this._gh,v=0|this._hh,_=0|this._al,S=0|this._bl,E=0|this._cl,w=0|this._dl,T=0|this._el,x=0|this._fl,A=0|this._gl,O=0|this._hl,M=0;M<32;M+=2)t[M]=e.readInt32BE(4*M),t[M+1]=e.readInt32BE(4*M+4);for(;M<160;M+=2){var R=t[M-30],C=t[M-30+1],I=h(R,C),N=p(C,R),P=m(R=t[M-4],C=t[M-4+1]),k=y(C,R),D=t[M-14],L=t[M-14+1],j=t[M-32],U=t[M-32+1],B=N+L|0,F=I+D+g(B,N)|0;F=(F=F+P+g(B=B+k|0,k)|0)+j+g(B=B+U|0,U)|0,t[M]=F,t[M+1]=B}for(var z=0;z<160;z+=2){F=t[z],B=t[z+1];var $=l(r,n,i),V=l(_,S,E),Y=f(r,_),q=f(_,r),H=d(s,T),W=d(T,s),G=a[z],Z=a[z+1],K=c(s,u,b),X=c(T,x,A),J=O+W|0,Q=v+H+g(J,O)|0;Q=(Q=(Q=Q+K+g(J=J+X|0,X)|0)+G+g(J=J+Z|0,Z)|0)+F+g(J=J+B|0,B)|0;var ee=q+V|0,et=Y+$+g(ee,q)|0;v=b,O=A,b=u,A=x,u=s,x=T,s=o+Q+g(T=w+J|0,w)|0,o=i,w=E,i=n,E=S,n=r,S=_,r=Q+et+g(_=J+ee|0,J)|0}this._al=this._al+_|0,this._bl=this._bl+S|0,this._cl=this._cl+E|0,this._dl=this._dl+w|0,this._el=this._el+T|0,this._fl=this._fl+x|0,this._gl=this._gl+A|0,this._hl=this._hl+O|0,this._ah=this._ah+r+g(this._al,_)|0,this._bh=this._bh+n+g(this._bl,S)|0,this._ch=this._ch+i+g(this._cl,E)|0,this._dh=this._dh+o+g(this._dl,w)|0,this._eh=this._eh+s+g(this._el,T)|0,this._fh=this._fh+u+g(this._fl,x)|0,this._gh=this._gh+b+g(this._gl,A)|0,this._hh=this._hh+v+g(this._hl,O)|0},u.prototype._hash=function(){var e=o.allocUnsafe(64);function t(t,r,n){e.writeInt32BE(t,n),e.writeInt32BE(r,n+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),t(this._gh,this._gl,48),t(this._hh,this._hl,56),e},e.exports=u},3704:function(e,t,r){"use strict";var n=r(5055).Buffer,i=n.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function o(e){var t;if(!e)return"utf8";for(;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}function a(e){var t=o(e);if("string"!=typeof t&&(n.isEncoding===i||!i(e)))throw Error("Unknown encoding: "+e);return t||e}function s(e){var t;switch(this.encoding=a(e),this.encoding){case"utf16le":this.text=p,this.end=m,t=4;break;case"utf8":this.fillLast=f,t=4;break;case"base64":this.text=y,this.end=g,t=3;break;default:this.write=b,this.end=v;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(t)}function u(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function c(e,t,r){var n=t.length-1;if(n=0?(i>0&&(e.lastNeed=i-1),i):--n=0?(i>0&&(e.lastNeed=i-2),i):--n=0?(i>0&&(2===i?i=0:e.lastNeed=i-3),i):0}function l(e,t,r){if((192&t[0])!=128)return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if((192&t[1])!=128)return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&(192&t[2])!=128)return e.lastNeed=2,"�"}}function f(e){var t=this.lastTotal-this.lastNeed,r=l(this,e,t);return void 0!==r?r:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):void(e.copy(this.lastChar,t,0,e.length),this.lastNeed-=e.length)}function d(e,t){var r=c(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)}function h(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t}function p(e,t){if((e.length-t)%2==0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function m(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function y(e,t){var r=(e.length-t)%3;return 0===r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function g(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function b(e){return e.toString(this.encoding)}function v(e){return e&&e.length?this.write(e):""}t.s=s,s.prototype.write=function(e){var t,r;if(0===e.length)return"";if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r{"use strict";r.d(t,{P:()=>o,y:()=>i});var n=r(55729);function i(e){let t=e,r=!1,n=new Set;return{getState:()=>t,updateState(e){t="function"==typeof e?e(t):e},setState(e){this.updateState(e),n.forEach(e=>e(t))},initialize(e){r||(t=e,r=!0)},subscribe:e=>(n.add(e),()=>n.delete(e))}}function o(e){return(0,n.useSyncExternalStore)(e.subscribe,()=>e.getState(),()=>e.getState())}},63085:(e,t,r)=>{"use strict";r.d(t,{m:()=>W});var n=r(6029),i=r(55729),o=r(50212),a=r(56655),s=r(30342),u=r(69626),c=r(76),l=r(97504),f=r(5618),d=r(66404),h=r(80616),p=r(37666),m=r(60481),y=r(43016),g=r(52432),b=r(49628),v=r(93955),_=r(33903),S=r(56738);let E={duration:100,transition:"fade"};function w(e,t){return{...E,...t,...e}}var T=r(15862),x=r(36504),A=r(75096),O=r(92309),M=r(78761);function R({offset:e,position:t,defaultOpened:r}){let[n,o]=(0,i.useState)(r),a=(0,i.useRef)(null),{x:s,y:u,elements:c,refs:l,update:f,placement:d}=(0,A.we)({placement:t,middleware:[(0,O.BN)({crossAxis:!0,padding:5,rootBoundary:"document"})]}),h=d.includes("right")?e:t.includes("left")?-1*e:0,p=d.includes("bottom")?e:t.includes("top")?-1*e:0,m=(0,i.useCallback)(({clientX:e,clientY:t})=>{l.setPositionReference({getBoundingClientRect:()=>({width:0,height:0,x:e,y:t,left:e+h,top:t+p,right:e,bottom:t})})},[c.reference]);return(0,i.useEffect)(()=>{if(l.floating.current){let e=a.current;e.addEventListener("mousemove",m);let t=(0,M.v9)(l.floating.current);return t.forEach(e=>{e.addEventListener("scroll",f)}),()=>{e.removeEventListener("mousemove",m),t.forEach(e=>{e.removeEventListener("scroll",f)})}}},[c.reference,l.floating.current,f,m,n]),{handleMouseMove:m,x:s,y:u,opened:n,setOpened:o,boundaryRef:a,floating:l.setFloating}}var C={tooltip:"m_1b3c8819",arrow:"m_f898399f"};let I={refProp:"ref",withinPortal:!0,offset:10,defaultOpened:!1,position:"right",zIndex:(0,u.I)("popover")},N=(0,f.V)((e,{radius:t,color:r})=>({tooltip:{"--tooltip-radius":void 0===t?void 0:(0,c.nJ)(t),"--tooltip-bg":r?(0,d.r)(r,e):void 0,"--tooltip-color":r?"var(--mantine-color-white)":void 0}})),P=(0,y.P9)((e,t)=>{let r=(0,h.Y)("TooltipFloating",I,e),{children:o,refProp:u,withinPortal:c,style:f,className:d,classNames:y,styles:g,unstyled:b,radius:v,color:S,label:E,offset:w,position:A,multiline:O,zIndex:M,disabled:P,defaultOpened:k,variant:D,vars:L,portalProps:j,...U}=r,B=(0,T.xd)(),F=(0,p.I)({name:"TooltipFloating",props:r,classes:C,className:d,style:f,classNames:y,styles:g,unstyled:b,rootSelector:"tooltip",vars:L,varsResolver:N}),{handleMouseMove:z,x:$,y:V,opened:Y,boundaryRef:q,floating:H,setOpened:W}=R({offset:w,position:A,defaultOpened:k});if(!(0,s.v)(o))throw Error("[@mantine/core] Tooltip.Floating component children should be an element or a component that accepts ref, fragments, strings, numbers and other primitive values are not supported");let G=(0,a.pc)(q,(0,l.x)(o),t),Z=o.props,K=e=>{Z.onMouseEnter?.(e),z(e),W(!0)},X=e=>{Z.onMouseLeave?.(e),W(!1)};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(_.r,{...j,withinPortal:c,children:(0,n.jsx)(m.a,{...U,...F("tooltip",{style:{...(0,x.X)(f,B),zIndex:M,display:!P&&Y?"block":"none",top:(V&&Math.round(V))??"",left:($&&Math.round($))??""}}),variant:D,ref:H,mod:{multiline:O},children:E})}),(0,i.cloneElement)(o,{...Z,[u]:G,onMouseEnter:K,onMouseLeave:X})]})});P.classes=C,P.displayName="@mantine/core/TooltipFloating";let k=(0,i.createContext)(!1),D=k.Provider,L=()=>(0,i.useContext)(k),j={openDelay:0,closeDelay:0};function U(e){let{openDelay:t,closeDelay:r,children:i}=(0,h.Y)("TooltipGroup",j,e);return(0,n.jsx)(D,{value:!0,children:(0,n.jsx)(A.T3,{delay:{open:t,close:r},children:i})})}U.displayName="@mantine/core/TooltipGroup",U.extend=e=>e;var B=r(60466),F=r(3465),z=r(29499);function $(e){if(void 0===e)return{shift:!0,flip:!0};let t={...e};return void 0===e.shift&&(t.shift=!0),void 0===e.flip&&(t.flip=!0),t}function V(e){let t=$(e.middlewares),r=[(0,O.cY)(e.offset)];return t.shift&&r.push((0,O.BN)("boolean"==typeof t.shift?{padding:8}:{padding:8,...t.shift})),t.flip&&r.push("boolean"==typeof t.flip?(0,O.UU)():(0,O.UU)(t.flip)),r.push((0,O.UE)({element:e.arrowRef,padding:e.arrowOffset})),t.inline?r.push("boolean"==typeof t.inline?(0,O.mG)():(0,O.mG)(t.inline)):e.inline&&r.push((0,O.mG)()),r}function Y(e){let[t,r]=(0,i.useState)(e.defaultOpened),n="boolean"==typeof e.opened?e.opened:t,o=L(),a=(0,B.B)(),s=(0,i.useCallback)(e=>{r(e),e&&b(a)},[a]),{x:u,y:c,context:l,refs:f,update:d,placement:h,middlewareData:{arrow:{x:p,y:m}={}}}=(0,A.we)({strategy:e.strategy,placement:e.position,open:n,onOpenChange:s,middleware:V(e)}),{delay:y,currentId:g,setCurrentId:b}=(0,A.ck)(l,{id:a}),{getReferenceProps:v,getFloatingProps:_}=(0,A.bv)([(0,A.Mk)(l,{enabled:e.events?.hover,delay:o?y:{open:e.openDelay,close:e.closeDelay},mouseOnly:!e.events?.touch}),(0,A.iQ)(l,{enabled:e.events?.focus,visibleOnly:!0}),(0,A.It)(l,{role:"tooltip"}),(0,A.s9)(l,{enabled:void 0===e.opened})]);(0,z.Q)({opened:n,position:e.position,positionDependencies:e.positionDependencies,floating:{refs:f,update:d}}),(0,F.C)(()=>{e.onPositionChange?.(h)},[h]);let S=n&&g&&g!==a;return{x:u,y:c,arrowX:p,arrowY:m,reference:f.setReference,floating:f.setFloating,getFloatingProps:_,getReferenceProps:v,isGroupPhase:S,opened:n,placement:h}}let q={position:"top",refProp:"ref",withinPortal:!0,inline:!1,defaultOpened:!1,arrowSize:4,arrowOffset:5,arrowRadius:0,arrowPosition:"side",offset:5,transitionProps:{duration:100,transition:"fade"},events:{hover:!0,focus:!1,touch:!1},zIndex:(0,u.I)("popover"),positionDependencies:[],middlewares:{flip:!0,shift:!0,inline:!1}},H=(0,f.V)((e,{radius:t,color:r})=>({tooltip:{"--tooltip-radius":void 0===t?void 0:(0,c.nJ)(t),"--tooltip-bg":r?(0,d.r)(r,e):void 0,"--tooltip-color":r?"var(--mantine-color-white)":void 0}})),W=(0,y.P9)((e,t)=>{let r=(0,h.Y)("Tooltip",q,e),{children:u,position:c,refProp:f,label:d,openDelay:y,closeDelay:E,onPositionChange:T,opened:x,defaultOpened:A,withinPortal:O,radius:M,color:R,classNames:I,styles:N,unstyled:P,style:k,className:D,withArrow:L,arrowSize:j,arrowOffset:U,arrowRadius:B,arrowPosition:F,offset:z,transitionProps:$,multiline:V,events:W,zIndex:G,disabled:Z,positionDependencies:K,onClick:X,onMouseEnter:J,onMouseLeave:Q,inline:ee,variant:et,keepMounted:er,vars:en,portalProps:ei,mod:eo,floatingStrategy:ea,middlewares:es,...eu}=(0,h.Y)("Tooltip",q,r),{dir:ec}=(0,g.jH)(),el=(0,i.useRef)(null),ef=Y({position:(0,b.Q)(ec,c),closeDelay:E,openDelay:y,onPositionChange:T,opened:x,defaultOpened:A,events:W,arrowRef:el,arrowOffset:U,offset:"number"==typeof z?z+(L?j/2:0):z,positionDependencies:[...K,u],inline:ee,strategy:ea,middlewares:es}),ed=(0,p.I)({name:"Tooltip",props:r,classes:C,className:D,style:k,classNames:I,styles:N,unstyled:P,rootSelector:"tooltip",vars:en,varsResolver:H});if(!(0,s.v)(u))throw Error("[@mantine/core] Tooltip component children should be an element or a component that accepts ref, fragments, strings, numbers and other primitive values are not supported");let eh=(0,a.pc)(ef.reference,(0,l.x)(u),t),ep=w($,{duration:100,transition:"fade"}),em=u.props;return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(_.r,{...ei,withinPortal:O,children:(0,n.jsx)(S.e,{...ep,keepMounted:er,mounted:!Z&&!!ef.opened,duration:ef.isGroupPhase?10:ep.duration,children:e=>(0,n.jsxs)(m.a,{...eu,"data-fixed":"fixed"===ea||void 0,variant:et,mod:[{multiline:V},eo],...ef.getFloatingProps({ref:ef.floating,className:ed("tooltip").className,style:{...ed("tooltip").style,...e,zIndex:G,top:ef.y??0,left:ef.x??0}}),children:[d,(0,n.jsx)(v.i,{ref:el,arrowX:ef.arrowX,arrowY:ef.arrowY,visible:L,position:ef.placement,arrowSize:j,arrowOffset:U,arrowRadius:B,arrowPosition:F,...ed("arrow")})]})})}),(0,i.cloneElement)(u,ef.getReferenceProps({onClick:X,onMouseEnter:J,onMouseLeave:Q,onMouseMove:r.onMouseMove,onPointerDown:r.onPointerDown,onPointerEnter:r.onPointerEnter,className:(0,o.A)(D,em.className),...em,[f]:eh}))]})});W.classes=C,W.displayName="@mantine/core/Tooltip",W.Floating=P,W.Group=U},63531:(e,t,r)=>{"use strict";function n(e){return"string"==typeof e?{value:e,label:e}:"value"in e&&!("label"in e)?{value:e.value,label:e.value,disabled:e.disabled}:"number"==typeof e?{value:e.toString(),label:e.toString()}:"group"in e?{group:e.group,items:e.items.map(e=>n(e))}:e}function i(e){return e?e.map(e=>n(e)):[]}r.d(t,{d:()=>i})},63826:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});var n=r(80577),i=r(74391),o=r(89250);function a(e,t){(0,o.A)(2,arguments);var r=(0,n.A)(t);return(0,i.A)(e,-r)}},63863:(e,t,r)=>{"use strict";r.d(t,{v:()=>a});var n=r(6029),i=r(55729),o=r(43016);function a(e){let t=(0,i.forwardRef)(e);return t.withProps=e=>{let r=(0,i.forwardRef)((r,i)=>(0,n.jsx)(t,{...e,...r,ref:i}));return r.extend=t.extend,r.displayName=`WithProps(${t.displayName})`,r},t.extend=o.D_,t}},64402:(e,t,r)=>{"use strict";function n(e){return e?parseInt(e,10):0}r.d(t,{R:()=>n})},64488:(e,t,r)=>{"use strict";r.d(t,{t:()=>N});var n=r(6029),i=r(60466),o=r(3001);r(55729);var a=r(6406),s=r(76),u=r(5618),c=r(66404),l=r(92096),f=r(35192),d=r(80616),h=r(37666),p=r(60481),m=r(43016);let[y,g]=(0,r(36254).F)("Tabs component was not found in the tree");var b={root:"m_89d60db1","list--default":"m_576c9d4",list:"m_89d33d6d",panel:"m_b0c91715",tab:"m_4ec4dce6",tabSection:"m_fc420b1f","tab--default":"m_539e827b","list--outline":"m_6772fbd5","tab--outline":"m_b59ab47c","tab--pills":"m_c3381914"};let v={},_=(0,m.P9)((e,t)=>{let r=(0,d.Y)("TabsList",v,e),{children:i,className:o,grow:a,justify:s,classNames:u,styles:c,style:l,mod:f,...h}=r,m=g();return(0,n.jsx)(p.a,{...h,...m.getStyles("list",{className:o,style:l,classNames:u,styles:c,props:r,variant:m.variant}),ref:t,role:"tablist",variant:m.variant,mod:[{grow:a,orientation:m.orientation,placement:"vertical"===m.orientation&&m.placement,inverted:m.inverted},f],"aria-orientation":m.orientation,__vars:{"--tabs-justify":s},children:i})});_.classes=b,_.displayName="@mantine/core/TabsList";let S={},E=(0,m.P9)((e,t)=>{let r=(0,d.Y)("TabsPanel",S,e),{children:i,className:o,value:a,classNames:s,styles:u,style:c,mod:l,keepMounted:f,...h}=r,m=g(),y=m.value===a,b=m.keepMounted||f||y?i:null;return(0,n.jsx)(p.a,{...h,...m.getStyles("panel",{className:o,classNames:s,styles:u,style:[c,y?void 0:{display:"none"}],props:r}),ref:t,mod:[{orientation:m.orientation},l],role:"tabpanel",id:m.getPanelId(a),"aria-labelledby":m.getTabId(a),children:b})});E.classes=b,E.displayName="@mantine/core/TabsPanel";var w=r(66062),T=r(15862),x=r(52432),A=r(8737);let O={},M=(0,m.P9)((e,t)=>{let r=(0,d.Y)("TabsTab",O,e),{className:i,children:o,rightSection:a,leftSection:s,value:u,onClick:l,onKeyDown:f,disabled:h,color:p,style:m,classNames:y,styles:b,vars:v,mod:_,tabIndex:S,...E}=r,M=(0,T.xd)(),{dir:R}=(0,x.jH)(),C=g(),I=u===C.value,N=e=>{C.onChange(C.allowTabDeactivation&&u===C.value?null:u),l?.(e)},P={classNames:y,styles:b,props:r};return(0,n.jsxs)(A.N,{...E,...C.getStyles("tab",{className:i,style:m,variant:C.variant,...P}),disabled:h,unstyled:C.unstyled,variant:C.variant,mod:[{active:I,disabled:h,orientation:C.orientation,inverted:C.inverted,placement:"vertical"===C.orientation&&C.placement},_],ref:t,role:"tab",id:C.getTabId(u),"aria-selected":I,tabIndex:void 0!==S?S:I||null===C.value?0:-1,"aria-controls":C.getPanelId(u),onClick:N,__vars:{"--tabs-color":p?(0,c.r)(p,M):void 0},onKeyDown:(0,w.Y)({siblingSelector:'[role="tab"]',parentSelector:'[role="tablist"]',activateOnFocus:C.activateTabWithKeyboard,loop:C.loop,orientation:C.orientation||"horizontal",dir:R,onKeyDown:f}),children:[s&&(0,n.jsx)("span",{...C.getStyles("tabSection",P),"data-position":"left",children:s}),o&&(0,n.jsx)("span",{...C.getStyles("tabLabel",P),children:o}),a&&(0,n.jsx)("span",{...C.getStyles("tabSection",P),"data-position":"right",children:a})]})});M.classes=b,M.displayName="@mantine/core/TabsTab";let R="Tabs.Tab or Tabs.Panel component was rendered with invalid value or without value",C={keepMounted:!0,orientation:"horizontal",loop:!0,activateTabWithKeyboard:!0,allowTabDeactivation:!1,unstyled:!1,inverted:!1,variant:"default",placement:"left"},I=(0,u.V)((e,{radius:t,color:r,autoContrast:n})=>({root:{"--tabs-radius":(0,s.nJ)(t),"--tabs-color":(0,c.r)(r,e),"--tabs-text-color":(0,f.v)(n,e)?(0,l.w)({color:r,theme:e,autoContrast:n}):void 0}})),N=(0,m.P9)((e,t)=>{let r=(0,d.Y)("Tabs",C,e),{defaultValue:s,value:u,onChange:c,orientation:l,children:f,loop:m,id:g,activateTabWithKeyboard:v,allowTabDeactivation:_,variant:S,color:E,radius:w,inverted:T,placement:x,keepMounted:A,classNames:O,styles:M,unstyled:N,className:P,style:k,vars:D,autoContrast:L,mod:j,...U}=r,B=(0,i.B)(g),[F,z]=(0,o.Z)({value:u,defaultValue:s,finalValue:null,onChange:c}),$=(0,h.I)({name:"Tabs",props:r,classes:b,className:P,style:k,classNames:O,styles:M,unstyled:N,vars:D,varsResolver:I});return(0,n.jsx)(y,{value:{placement:x,value:F,orientation:l,id:B,loop:m,activateTabWithKeyboard:v,getTabId:(0,a.r)(`${B}-tab`,R),getPanelId:(0,a.r)(`${B}-panel`,R),onChange:z,allowTabDeactivation:_,variant:S,color:E,radius:w,inverted:T,keepMounted:A,unstyled:N,getStyles:$},children:(0,n.jsx)(p.a,{ref:t,id:B,variant:S,mod:[{orientation:l,inverted:"horizontal"===l&&T,placement:"vertical"===l&&x},j],...$("root"),...U,children:f})})});N.classes=b,N.displayName="@mantine/core/Tabs",N.Tab=M,N.Panel=E,N.List=_},64560:e=>{"use strict";let t=(function*(){}).constructor;e.exports=()=>t},64892:(e,t,r)=>{"use strict";r.d(t,{G:()=>a,WI:()=>o,eq:()=>i});var n=r(45859);let i=n.ZS.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),o=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:");class a extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}format(e){let t=e||function(e){return e.message},r={_errors:[]},n=e=>{for(let i of e.issues)if("invalid_union"===i.code)i.unionErrors.map(n);else if("invalid_return_type"===i.code)n(i.returnTypeError);else if("invalid_arguments"===i.code)n(i.argumentsError);else if(0===i.path.length)r._errors.push(t(i));else{let e=r,n=0;for(;ne.message){let t={},r=[];for(let n of this.issues)if(n.path.length>0){let r=n.path[0];t[r]=t[r]||[],t[r].push(e(n))}else r.push(e(n));return{formErrors:r,fieldErrors:t}}get formErrors(){return this.flatten()}}a.create=e=>new a(e)},65342:(e,t,r)=>{"use strict";r.d(t,{BM:()=>v,Cg:()=>a,GW:()=>o,Ki:()=>i,Mf:()=>b,Z7:()=>_,_m:()=>u,bF:()=>m,e8:()=>d,gs:()=>h,h:()=>n,hq:()=>g,l5:()=>l,pe:()=>y,rI:()=>f,s0:()=>s,tF:()=>p,uL:()=>c});var n=7,i=365.2425,o=864e13,a=6e4,s=36e5,u=1e3,c=-864e13,l=60,f=3,d=12,h=4,p=3600,m=60,y=86400,g=604800,b=0x1e18558,v=2629746,_=7889238},65658:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=c;var n=u(r(97102)),i=u(r(88015)),o=u(r(93441)),a=u(r(11827)),s=u(r(26193));function u(e){return e&&e.__esModule?e:{default:e}}function c(e,t,r){if("string"==typeof e&&!e.match(o.default)){var u=(0,n.default)(r);return u.timeZone=t,(0,i.default)(e,u)}var c=(0,i.default)(e,r),l=(0,s.default)(c.getFullYear(),c.getMonth(),c.getDate(),c.getHours(),c.getMinutes(),c.getSeconds(),c.getMilliseconds()).getTime(),f=(0,a.default)(t,new Date(l));return new Date(l+f)}e.exports=t.default},65837:(e,t,r)=>{"use strict";r.d(t,{v:()=>l});var n=r(6029),i=r(55729),o=r(50212),a=r(60481),s=r(15242);function u(){let e=(0,s.x)();return(0,i.useEffect)(()=>(e.setBodyMounted(!0),()=>e.setBodyMounted(!1)),[]),e.getBodyId()}var c=r(31188);let l=(0,i.forwardRef)(({className:e,...t},r)=>{let i=u(),l=(0,s.x)();return(0,n.jsx)(a.a,{ref:r,...t,id:i,className:(0,o.A)({[c.A.body]:!l.unstyled},e)})});l.displayName="@mantine/core/ModalBaseBody"},66062:(e,t,r)=>{"use strict";r.d(t,{Y:()=>s});var n=r(78526);function i(e,t,r){for(let r=e-1;r>=0;r-=1)if(!t[r].disabled)return r;if(r){for(let e=t.length-1;e>-1;e-=1)if(!t[e].disabled)return e}return e}function o(e,t,r){for(let r=e+1;r{r?.(f);let d=Array.from((0,n.P)(f.currentTarget,e)?.querySelectorAll(t)||[]).filter(t=>a(f.currentTarget,t,e)),h=d.findIndex(e=>f.currentTarget===e),p=o(h,d,s),m=i(h,d,s),y="rtl"===c?m:p,g="rtl"===c?p:m;switch(f.key){case"ArrowRight":"horizontal"===l&&(f.stopPropagation(),f.preventDefault(),d[y].focus(),u&&d[y].click());break;case"ArrowLeft":"horizontal"===l&&(f.stopPropagation(),f.preventDefault(),d[g].focus(),u&&d[g].click());break;case"ArrowUp":"vertical"===l&&(f.stopPropagation(),f.preventDefault(),d[m].focus(),u&&d[m].click());break;case"ArrowDown":"vertical"===l&&(f.stopPropagation(),f.preventDefault(),d[p].focus(),u&&d[p].click());break;case"Home":f.stopPropagation(),f.preventDefault(),d[0].disabled||d[0].focus();break;case"End":{f.stopPropagation(),f.preventDefault();let e=d.length-1;d[e].disabled||d[e].focus()}}}}},66085:(e,t,r)=>{"use strict";r.d(t,{i:()=>m});var n=r(6029),i=r(50212),o=r(39467),a=r(53993),s=r(46084);function u(e){return"group"in e}function c({options:e,search:t,limit:r}){let n=t.trim().toLowerCase(),i=[];for(let o=0;o0)return!1;return!0}function f(e,t=new Set){if(Array.isArray(e))for(let r of e)if(u(r))f(r.items,t);else{if(void 0===r.value)throw Error("[@mantine/core] Each option must have value property");if("string"!=typeof r.value)throw Error(`[@mantine/core] Option value must be a string, other data formats are not supported, got ${typeof r.value}`);if(t.has(r.value))throw Error(`[@mantine/core] Duplicate options are not supported. Option with value "${r.value}" was provided more than once`);t.add(r.value)}}var d=r(49264);function h(e,t){return Array.isArray(e)?e.includes(t):e===t}function p({data:e,withCheckIcon:t,value:r,checkIconPosition:a,unstyled:c,renderOption:l}){if(!u(e)){let u=h(r,e.value),f=t&&u&&(0,n.jsx)(o.S,{className:d.A.optionsDropdownCheckIcon}),p=(0,n.jsxs)(n.Fragment,{children:["left"===a&&f,(0,n.jsx)("span",{children:e.label}),"right"===a&&f]});return(0,n.jsx)(s.G.Option,{value:e.value,disabled:e.disabled,className:(0,i.A)({[d.A.optionsDropdownOption]:!c}),"data-reverse":"right"===a||void 0,"data-checked":u||void 0,"aria-selected":u,active:u,children:"function"==typeof l?l({option:e,checked:u}):p})}let f=e.items.map(e=>(0,n.jsx)(p,{data:e,value:r,unstyled:c,withCheckIcon:t,checkIconPosition:a,renderOption:l},e.value));return(0,n.jsx)(s.G.Group,{label:e.group,children:f})}function m({data:e,hidden:t,hiddenWhenEmpty:r,filter:i,search:o,limit:d,maxDropdownHeight:h,withScrollArea:m=!0,filterOptions:y=!0,withCheckIcon:g=!1,value:b,checkIconPosition:v,nothingFoundMessage:_,unstyled:S,labelId:E,renderOption:w,scrollAreaProps:T,"aria-label":x}){f(e);let A="string"==typeof o?(i||c)({options:e,search:y?o:"",limit:d??1/0}):e,O=l(A),M=A.map(e=>(0,n.jsx)(p,{data:e,withCheckIcon:g,value:b,checkIconPosition:v,unstyled:S,renderOption:w},u(e)?e.group:e.value));return(0,n.jsx)(s.G.Dropdown,{hidden:t||r&&O,"data-composed":!0,children:(0,n.jsxs)(s.G.Options,{labelledBy:E,"aria-label":x,children:[m?(0,n.jsx)(a.F.Autosize,{mah:h??220,type:"scroll",scrollbarSize:"var(--combobox-padding)",offsetScrollbars:"y",...T,children:M}):M,O&&_&&(0,n.jsx)(s.G.Empty,{children:_})]})})}},66152:(e,t,r)=>{"use strict";r.d(t,{h:()=>y});var n=r(6029),i=r(26615);r(55729);var o=r(69626),a=r(76),s=r(5618),u=r(43910),c=r(80616),l=r(37666),f=r(60481),d=r(63863),h={root:"m_9814e45f"};let p={zIndex:(0,o.I)("modal")},m=(0,s.V)((e,{gradient:t,color:r,backgroundOpacity:n,blur:o,radius:s,zIndex:c})=>({root:{"--overlay-bg":t||(void 0!==r||void 0!==n)&&(0,u.B)(r||"#000",n??.6)||void 0,"--overlay-filter":o?`blur(${(0,i.D)(o)})`:void 0,"--overlay-radius":void 0===s?void 0:(0,a.nJ)(s),"--overlay-z-index":c?.toString()}})),y=(0,d.v)((e,t)=>{let r=(0,c.Y)("Overlay",p,e),{classNames:i,className:o,style:a,styles:s,unstyled:u,vars:d,fixed:y,center:g,children:b,radius:v,zIndex:_,gradient:S,blur:E,color:w,backgroundOpacity:T,mod:x,...A}=r,O=(0,l.I)({name:"Overlay",props:r,classes:h,className:o,style:a,classNames:i,styles:s,unstyled:u,vars:d,varsResolver:m});return(0,n.jsx)(f.a,{ref:t,...O("root"),mod:[{center:g,fixed:y},x],...A,children:b})});y.classes=h,y.displayName="@mantine/core/Overlay"},66404:(e,t,r)=>{"use strict";r.d(t,{r:()=>i});var n=r(41375);function i(e,t){let r=(0,n.g)({color:e||t.primaryColor,theme:t});return r.variable?`var(${r.variable})`:e}},66631:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});var n=r(41742),i=r(89250);function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function a(e){var t,r;if((0,i.A)(1,arguments),e&&"function"==typeof e.forEach)t=e;else{if("object"!==o(e)||null===e)return new Date(NaN);t=Array.prototype.slice.call(e)}return t.forEach(function(e){var t=(0,n.A)(e);(void 0===r||r>t||isNaN(t.getDate()))&&(r=t)}),r||new Date(NaN)}},66918:(e,t)=>{"use strict";function r(e){return function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=t.width?String(t.width):e.defaultWidth;return e.formats[r]||e.formats[e.defaultWidth]}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=r,e.exports=t.default},66951:(e,t,r)=>{"use strict";r.d(t,{$:()=>l});var n=r(6029),i=r(55729),o=r(50212),a=r(60481),s=r(15242);function u(){let e=(0,s.x)();return(0,i.useEffect)(()=>(e.setTitleMounted(!0),()=>e.setTitleMounted(!1)),[]),e.getTitleId()}var c=r(31188);let l=(0,i.forwardRef)(({className:e,...t},r)=>{let i=u(),l=(0,s.x)();return(0,n.jsx)(a.a,{component:"h2",ref:r,className:(0,o.A)({[c.A.title]:!l.unstyled},e),...t,id:i})});l.displayName="@mantine/core/ModalBaseTitle"},66957:(e,t,r)=>{"use strict";var n=r(3194),i=function(){return!!n};i.hasArrayLengthDefineBug=function(){if(!n)return null;try{return 1!==n([],"length",{value:1}).length}catch(e){return!0}},e.exports=i},67012:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});var n=r(65342),i=r(34405),o=r(89250),a=r(23714);function s(e,t,r){(0,o.A)(2,arguments);var s=(0,i.A)(e,t)/n.s0;return(0,a.u)(null==r?void 0:r.roundingMethod)(s)}},67093:(e,t,r)=>{"use strict";r.d(t,{A:()=>o});var n=r(87354),i=r(89250);function o(e,t){return(0,i.A)(1,arguments),(0,n.A)(e,Date.now(),t)}},67264:e=>{var t=1e3,r=6e4,n=36e5,i=864e5,o=6048e5,a=315576e5;function s(e){if(!((e=String(e)).length>100)){var s=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(s){var u=parseFloat(s[1]),c=(s[2]||"ms").toLowerCase();switch(c){case"years":case"year":case"yrs":case"yr":case"y":return u*a;case"weeks":case"week":case"w":return u*o;case"days":case"day":case"d":return u*i;case"hours":case"hour":case"hrs":case"hr":case"h":return u*n;case"minutes":case"minute":case"mins":case"min":case"m":return u*r;case"seconds":case"second":case"secs":case"sec":case"s":return u*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return u;default:return}}}}function u(e){var o=Math.abs(e);return o>=i?Math.round(e/i)+"d":o>=n?Math.round(e/n)+"h":o>=r?Math.round(e/r)+"m":o>=t?Math.round(e/t)+"s":e+"ms"}function c(e){var o=Math.abs(e);return o>=i?l(e,o,i,"day"):o>=n?l(e,o,n,"hour"):o>=r?l(e,o,r,"minute"):o>=t?l(e,o,t,"second"):e+" ms"}function l(e,t,r,n){var i=t>=1.5*r;return Math.round(e/r)+" "+n+(i?"s":"")}e.exports=function(e,t){t=t||{};var r=typeof e;if("string"===r&&e.length>0)return s(e);if("number"===r&&isFinite(e))return t.long?c(e):u(e);throw Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},67305:(e,t,r)=>{"use strict";r.d(t,{X:()=>s,k:()=>u});var n=r(4308),i=r(95913),o=r(43064),a=r(77332),s=class extends a.k{#b;#v;#_;#o;#d;#S;constructor(e){super(),this.#S=!1,this.#d=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#_=e.cache,this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#b=c(this.options),this.state=e.state??this.#b,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#o?.promise}setOptions(e){this.options={...this.#d,...e},this.updateGcTime(this.options.gcTime)}optionalRemove(){this.observers.length||"idle"!==this.state.fetchStatus||this.#_.remove(this)}setData(e,t){let r=(0,n.pl)(this.state.data,e,this.options);return this.#a({data:r,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),r}setState(e,t){this.#a({type:"setState",state:e,setStateOptions:t})}cancel(e){let t=this.#o?.promise;return this.#o?.cancel(e),t?t.then(n.lQ).catch(n.lQ):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#b)}isActive(){return this.observers.some(e=>!1!==(0,n.Eh)(e.options.enabled,this))}isDisabled(){return this.getObserversCount()>0&&!this.isActive()}isStale(){return!!this.state.isInvalidated||(this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):void 0===this.state.data)}isStaleByTime(e=0){return this.state.isInvalidated||void 0===this.state.data||!(0,n.j3)(this.state.dataUpdatedAt,e)}onFocus(){let e=this.observers.find(e=>e.shouldFetchOnWindowFocus());e?.refetch({cancelRefetch:!1}),this.#o?.continue()}onOnline(){let e=this.observers.find(e=>e.shouldFetchOnReconnect());e?.refetch({cancelRefetch:!1}),this.#o?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#_.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#o&&(this.#S?this.#o.cancel({revert:!0}):this.#o.cancelRetry()),this.scheduleGc()),this.#_.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#a({type:"invalidate"})}fetch(e,t){if("idle"!==this.state.fetchStatus){if(void 0!==this.state.data&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#o)return this.#o.continueRetry(),this.#o.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let r=new AbortController,i=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#S=!0,r.signal)})},a=()=>{let e=(0,n.ZM)(this.options,t),r={queryKey:this.queryKey,meta:this.meta};return(i(r),this.#S=!1,this.options.persister)?this.options.persister(e,r,this):e(r)},s={fetchOptions:t,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:a};i(s),this.options.behavior?.onFetch(s,this),this.#v=this.state,("idle"===this.state.fetchStatus||this.state.fetchMeta!==s.fetchOptions?.meta)&&this.#a({type:"fetch",meta:s.fetchOptions?.meta});let u=e=>{(0,o.wm)(e)&&e.silent||this.#a({type:"error",error:e}),(0,o.wm)(e)||(this.#_.config.onError?.(e,this),this.#_.config.onSettled?.(this.state.data,e,this)),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1};return this.#o=(0,o.II)({initialPromise:t?.initialPromise,fn:s.fetchFn,abort:r.abort.bind(r),onSuccess:e=>{if(void 0===e)return void u(Error(`${this.queryHash} data is undefined`));try{this.setData(e)}catch(e){u(e);return}this.#_.config.onSuccess?.(e,this),this.#_.config.onSettled?.(e,this.state.error,this),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1},onError:u,onFail:(e,t)=>{this.#a({type:"failed",failureCount:e,error:t})},onPause:()=>{this.#a({type:"pause"})},onContinue:()=>{this.#a({type:"continue"})},retry:s.options.retry,retryDelay:s.options.retryDelay,networkMode:s.options.networkMode,canRun:()=>!0}),this.#o.start()}#a(e){let t=t=>{switch(e.type){case"failed":return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...t,fetchStatus:"paused"};case"continue":return{...t,fetchStatus:"fetching"};case"fetch":return{...t,...u(t.data,this.options),fetchMeta:e.meta??null};case"success":return{...t,data:e.data,dataUpdateCount:t.dataUpdateCount+1,dataUpdatedAt:e.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":let r=e.error;if((0,o.wm)(r)&&r.revert&&this.#v)return{...this.#v,fetchStatus:"idle"};return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:"idle",status:"error"};case"invalidate":return{...t,isInvalidated:!0};case"setState":return{...t,...e.state}}};this.state=t(this.state),i.j.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#_.notify({query:this,type:"updated",action:e})})}};function u(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:(0,o.v_)(t.networkMode)?"fetching":"paused",...void 0===e&&{error:null,status:"pending"}}}function c(e){let t="function"==typeof e.initialData?e.initialData():e.initialData,r=void 0!==t,n=r?"function"==typeof e.initialDataUpdatedAt?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:r?n??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}},67549:(e,t,r)=>{"use strict";r.d(t,{Kq:()=>s,Pj:()=>a,Xr:()=>f,fp:()=>d,md:()=>l});var n=r(55729),i=r(70921);let o=(0,n.createContext)(void 0),a=e=>{let t=(0,n.useContext)(o);return(null==e?void 0:e.store)||t||(0,i.zp)()},s=({children:e,store:t})=>{let r=(0,n.useRef)();return t||r.current||(r.current=(0,i.y$)()),(0,n.createElement)(o.Provider,{value:t||r.current},e)},u=e=>"function"==typeof(null==e?void 0:e.then),c=n.use||(e=>{if("pending"===e.status)throw e;if("fulfilled"===e.status)return e.value;if("rejected"===e.status)throw e.reason;throw e.status="pending",e.then(t=>{e.status="fulfilled",e.value=t},t=>{e.status="rejected",e.reason=t}),e});function l(e,t){let r=a(t),[[i,o,s],l]=(0,n.useReducer)(t=>{let n=r.get(e);return Object.is(t[0],n)&&t[1]===r&&t[2]===e?t:[n,r,e]},void 0,()=>[r.get(e),r,e]),f=i;(o!==r||s!==e)&&(l(),f=r.get(e));let d=null==t?void 0:t.delay;return(0,n.useEffect)(()=>{let t=r.sub(e,()=>{"number"==typeof d?setTimeout(l,d):l()});return l(),t},[r,e,d]),(0,n.useDebugValue)(f),u(f)?c(f):f}function f(e,t){let r=a(t);return(0,n.useCallback)((...t)=>{if(!("write"in e))throw Error("not writable atom");return r.set(e,...t)},[r,e])}function d(e,t){return[l(e,t),f(e,t)]}},67843:(e,t,r)=>{"use strict";function n(e){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;n3?t.i-4:t.i:Array.isArray(e)?1:d(e)?2:3*!!h(e)}function u(e,t){return 2===s(e)?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function c(e,t){return 2===s(e)?e.get(t):e[t]}function l(e,t,r){var n=s(e);2===n?e.set(t,r):3===n?e.add(r):e[t]=r}function f(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function d(e){return $&&e instanceof Map}function h(e){return V&&e instanceof Set}function p(e){return e.o||e.t}function m(e){if(Array.isArray(e))return Array.prototype.slice.call(e);var t=X(e);delete t[W];for(var r=K(t),n=0;n1&&(e.set=e.add=e.clear=e.delete=g),Object.freeze(e),t&&a(e,function(e,t){return y(t,!0)},!0)),e}function g(){n(2)}function b(e){return null==e||"object"!=typeof e||Object.isFrozen(e)}function v(e){var t=J[e];return t||n(18,e),t}function _(e,t){J[e]||(J[e]=t)}function S(){return F}function E(e,t){t&&(v("Patches"),e.u=[],e.s=[],e.v=t)}function w(e){T(e),e.p.forEach(A),e.p=null}function T(e){e===F&&(F=e.l)}function x(e){return F={p:[],l:F,h:e,m:!0,_:0}}function A(e){var t=e[W];0===t.i||1===t.i?t.j():t.g=!0}function O(e,t){t._=t.p.length;var r=t.p[0],i=void 0!==e&&e!==r;return t.h.O||v("ES5").S(t,e,i),i?(r[W].P&&(w(t),n(4)),o(e)&&(e=M(t,e),t.l||C(t,e)),t.u&&v("Patches").M(r[W].t,e,t.u,t.s)):e=M(t,r,[]),w(t),t.u&&t.v(t.u,t.s),e!==q?e:void 0}function M(e,t,r){if(b(t))return t;var n=t[W];if(!n)return a(t,function(i,o){return R(e,n,t,i,o,r)},!0),t;if(n.A!==e)return t;if(!n.P)return C(e,n.t,!0),n.t;if(!n.I){n.I=!0,n.A._--;var i=4===n.i||5===n.i?n.o=m(n.k):n.o,o=i,s=!1;3===n.i&&(o=new Set(i),i.clear(),s=!0),a(o,function(t,o){return R(e,n,i,t,o,r,s)}),C(e,i,!1),r&&e.u&&v("Patches").N(n,r,e.u,e.s)}return n.o}function R(e,t,r,n,a,s,c){if(i(a)){var f=M(e,a,s&&t&&3!==t.i&&!u(t.R,n)?s.concat(n):void 0);if(l(r,n,f),!i(f))return;e.m=!1}else c&&r.add(a);if(o(a)&&!b(a)){if(!e.h.D&&e._<1)return;M(e,a),t&&t.A.l||C(e,a)}}function C(e,t,r){void 0===r&&(r=!1),!e.l&&e.h.D&&e.m&&y(t,r)}function I(e,t){var r=e[W];return(r?p(r):e)[t]}function N(e,t){if(t in e)for(var r=Object.getPrototypeOf(e);r;){var n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=Object.getPrototypeOf(r)}}function P(e){e.P||(e.P=!0,e.l&&P(e.l))}function k(e){e.o||(e.o=m(e.t))}function D(e,t,r){var n=d(t)?v("MapSet").F(t,r):h(t)?v("MapSet").T(t,r):e.O?function(e,t){var r=Array.isArray(e),n={i:+!!r,A:t?t.A:S(),P:!1,I:!1,R:{},l:t,t:e,k:null,o:null,j:null,C:!1},i=n,o=Q;r&&(i=[n],o=ee);var a=Proxy.revocable(i,o),s=a.revoke,u=a.proxy;return n.k=u,n.j=s,u}(t,r):v("ES5").J(t,r);return(r?r.A:S()).p.push(n),n}function L(e){return i(e)||n(22,e),function e(t){if(!o(t))return t;var r,n=t[W],i=s(t);if(n){if(!n.P&&(n.i<4||!v("ES5").K(n)))return n.t;n.I=!0,r=j(t,i),n.I=!1}else r=j(t,i);return a(r,function(t,i){n&&c(n.t,t)===i||l(r,t,e(i))}),3===i?new Set(r):r}(e)}function j(e,t){switch(t){case 2:return new Map(e);case 3:return Array.from(e)}return m(e)}function U(){function e(e,t){function r(){this.constructor=e}s(e,t),r.prototype=t.prototype,e.prototype=new r}function t(e){e.o||(e.R=new Map,e.o=new Map(e.t))}function r(e){e.o||(e.o=new Set,e.t.forEach(function(t){if(o(t)){var r=D(e.A.h,t,e);e.p.set(t,r),e.o.add(r)}else e.o.add(t)}))}function i(e){e.g&&n(3,JSON.stringify(p(e)))}var s=function(e,t){return(s=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},u=function(){function r(e,t){return this[W]={i:2,l:t,A:t?t.A:S(),P:!1,I:!1,o:void 0,R:void 0,t:e,k:this,C:!1,g:!1},this}e(r,Map);var n=r.prototype;return Object.defineProperty(n,"size",{get:function(){return p(this[W]).size}}),n.has=function(e){return p(this[W]).has(e)},n.set=function(e,r){var n=this[W];return i(n),p(n).has(e)&&p(n).get(e)===r||(t(n),P(n),n.R.set(e,!0),n.o.set(e,r),n.R.set(e,!0)),this},n.delete=function(e){if(!this.has(e))return!1;var r=this[W];return i(r),t(r),P(r),r.t.has(e)?r.R.set(e,!1):r.R.delete(e),r.o.delete(e),!0},n.clear=function(){var e=this[W];i(e),p(e).size&&(t(e),P(e),e.R=new Map,a(e.t,function(t){e.R.set(t,!1)}),e.o.clear())},n.forEach=function(e,t){var r=this;p(this[W]).forEach(function(n,i){e.call(t,r.get(i),i,r)})},n.get=function(e){var r=this[W];i(r);var n=p(r).get(e);if(r.I||!o(n)||n!==r.t.get(e))return n;var a=D(r.A.h,n,r);return t(r),r.o.set(e,a),a},n.keys=function(){return p(this[W]).keys()},n.values=function(){var e,t=this,r=this.keys();return(e={})[G]=function(){return t.values()},e.next=function(){var e=r.next();return e.done?e:{done:!1,value:t.get(e.value)}},e},n.entries=function(){var e,t=this,r=this.keys();return(e={})[G]=function(){return t.entries()},e.next=function(){var e=r.next();if(e.done)return e;var n=t.get(e.value);return{done:!1,value:[e.value,n]}},e},n[G]=function(){return this.entries()},r}(),c=function(){function t(e,t){return this[W]={i:3,l:t,A:t?t.A:S(),P:!1,I:!1,o:void 0,t:e,k:this,p:new Map,g:!1,C:!1},this}e(t,Set);var n=t.prototype;return Object.defineProperty(n,"size",{get:function(){return p(this[W]).size}}),n.has=function(e){var t=this[W];return i(t),t.o?!!t.o.has(e)||!(!t.p.has(e)||!t.o.has(t.p.get(e))):t.t.has(e)},n.add=function(e){var t=this[W];return i(t),this.has(e)||(r(t),P(t),t.o.add(e)),this},n.delete=function(e){if(!this.has(e))return!1;var t=this[W];return i(t),r(t),P(t),t.o.delete(e)||!!t.p.has(e)&&t.o.delete(t.p.get(e))},n.clear=function(){var e=this[W];i(e),p(e).size&&(r(e),P(e),e.o.clear())},n.values=function(){var e=this[W];return i(e),r(e),e.o.values()},n.entries=function(){var e=this[W];return i(e),r(e),e.o.entries()},n.keys=function(){return this.values()},n[G]=function(){return this.values()},n.forEach=function(e,t){for(var r=this.values(),n=r.next();!n.done;)e.call(t,n.value,n.value,this),n=r.next()},t}();_("MapSet",{F:function(e,t){return new u(e,t)},T:function(e,t){return new c(e,t)}})}r.d(t,{Ay:()=>en,IP:()=>U});var B,F,z="u">typeof Symbol&&"symbol"==typeof Symbol("x"),$="u">typeof Map,V="u">typeof Set,Y="u">typeof Proxy&&void 0!==Proxy.revocable&&"u">typeof Reflect,q=z?Symbol.for("immer-nothing"):((B={})["immer-nothing"]=!0,B),H=z?Symbol.for("immer-draftable"):"__$immer_draftable",W=z?Symbol.for("immer-state"):"__$immer_state",G="u">typeof Symbol&&Symbol.iterator||"@@iterator",Z=""+Object.prototype.constructor,K="u">typeof Reflect&&Reflect.ownKeys?Reflect.ownKeys:void 0!==Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames,X=Object.getOwnPropertyDescriptors||function(e){var t={};return K(e).forEach(function(r){t[r]=Object.getOwnPropertyDescriptor(e,r)}),t},J={},Q={get:function(e,t){if(t===W)return e;var r=p(e);if(!u(r,t))return function(e,t,r){var n,i=N(t,r);return i?"value"in i?i.value:null==(n=i.get)?void 0:n.call(e.k):void 0}(e,r,t);var n=r[t];return e.I||!o(n)?n:n===I(e.t,t)?(k(e),e.o[t]=D(e.A.h,n,e)):n},has:function(e,t){return t in p(e)},ownKeys:function(e){return Reflect.ownKeys(p(e))},set:function(e,t,r){var n=N(p(e),t);if(null==n?void 0:n.set)return n.set.call(e.k,r),!0;if(!e.P){var i=I(p(e),t),o=null==i?void 0:i[W];if(o&&o.t===r)return e.o[t]=r,e.R[t]=!1,!0;if(f(r,i)&&(void 0!==r||u(e.t,t)))return!0;k(e),P(e)}return e.o[t]===r&&(void 0!==r||t in e.o)||Number.isNaN(r)&&Number.isNaN(e.o[t])||(e.o[t]=r,e.R[t]=!0),!0},deleteProperty:function(e,t){return void 0!==I(e.t,t)||t in e.t?(e.R[t]=!1,k(e),P(e)):delete e.R[t],e.o&&delete e.o[t],!0},getOwnPropertyDescriptor:function(e,t){var r=p(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n?{writable:!0,configurable:1!==e.i||"length"!==t,enumerable:n.enumerable,value:r[t]}:n},defineProperty:function(){n(11)},getPrototypeOf:function(e){return Object.getPrototypeOf(e.t)},setPrototypeOf:function(){n(12)}},ee={};a(Q,function(e,t){ee[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}}),ee.deleteProperty=function(e,t){return ee.set.call(this,e,t,void 0)},ee.set=function(e,t,r){return Q.set.call(this,e[0],t,r,e[0])};var et=new(function(){function e(e){var t=this;this.O=Y,this.D=!0,this.produce=function(e,r,i){if("function"==typeof e&&"function"!=typeof r){var a,s=r;r=e;var u=t;return function(e){var t=this;void 0===e&&(e=s);for(var n=arguments.length,i=Array(n>1?n-1:0),o=1;otypeof Promise&&a instanceof Promise?a.then(function(e){return E(c,i),O(e,c)},function(e){throw w(c),e}):(E(c,i),O(a,c))}if(!e||"object"!=typeof e){if(void 0===(a=r(e))&&(a=e),a===q&&(a=void 0),t.D&&y(a,!0),i){var d=[],h=[];v("Patches").M(e,a,d,h),i(d,h)}return a}n(21,e)},this.produceWithPatches=function(e,r){if("function"==typeof e)return function(r){for(var n=arguments.length,i=Array(n>1?n-1:0),o=1;otypeof Promise&&o instanceof Promise?o.then(function(e){return[e,n,i]}):[o,n,i]},"boolean"==typeof(null==e?void 0:e.useProxies)&&this.setUseProxies(e.useProxies),"boolean"==typeof(null==e?void 0:e.autoFreeze)&&this.setAutoFreeze(e.autoFreeze)}var t=e.prototype;return t.createDraft=function(e){o(e)||n(8),i(e)&&(e=L(e));var t=x(this),r=D(this,e,void 0);return r[W].C=!0,T(t),r},t.finishDraft=function(e,t){var r=(e&&e[W]).A;return E(r,t),O(void 0,r)},t.setAutoFreeze=function(e){this.D=e},t.setUseProxies=function(e){e&&!Y&&n(20),this.O=e},t.applyPatches=function(e,t){for(r=t.length-1;r>=0;r--){var r,n=t[r];if(0===n.path.length&&"replace"===n.op){e=n.value;break}}r>-1&&(t=t.slice(r+1));var o=v("Patches").$;return i(e)?o(e,t):this.produce(e,function(e){return o(e,t)})},e}()),er=et.produce;et.produceWithPatches.bind(et),et.setAutoFreeze.bind(et),et.setUseProxies.bind(et),et.applyPatches.bind(et),et.createDraft.bind(et),et.finishDraft.bind(et);let en=er},67988:e=>{"use strict";e.exports=function(){return Object.assign}},68373:(e,t,r)=>{"use strict";r.d(t,{F:()=>c});var n=r(6029),i=r(55729),o=r(50212),a=r(20158),s=r(15242),u=r(31188);let c=(0,i.forwardRef)(({className:e,onClick:t,...r},i)=>{let c=(0,s.x)();return(0,n.jsx)(a.J,{ref:i,...r,onClick:e=>{c.onClose(),t?.(e)},className:(0,o.A)({[u.A.close]:!c.unstyled},e),unstyled:c.unstyled})});c.displayName="@mantine/core/ModalBaseCloseButton"},69497:e=>{"use strict";e.exports=SyntaxError},69626:(e,t,r)=>{"use strict";r.d(t,{I:()=>i});let n={app:100,modal:200,popover:300,overlay:400,max:9999};function i(e){return n[e]}},70441:(e,t,r)=>{"use strict";var n,i,o=r(29143);function a(e){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function s(e,t){for(var r=0;r1?r-1:0),i=1;i1?r-1:0),i=1;i1?r-1:0),i=1;i1?r-1:0),i=1;i{"use strict";function n(e){return"string"==typeof e&&e.includes("var(--mantine-scale)")?e.match(/^calc\((.*?)\)$/)?.[1].split("*")[0].trim():e}function i(e){let t=n(e);return"number"==typeof t?t:"string"==typeof t?t.includes("calc")||t.includes("var")?t:t.includes("px")?Number(t.replace("px","")):t.includes("rem")?16*Number(t.replace("rem","")):t.includes("em")?16*Number(t.replace("em","")):Number(t):NaN}r.d(t,{px:()=>i})},70841:(e,t,r)=>{"use strict";r.d(t,{A:()=>c});var n=r(41742),i=r(74934),o=r(94170),a=r(89250);function s(e){(0,a.A)(1,arguments);var t=(0,o.A)(e),r=new Date(0);return r.setUTCFullYear(t,0,4),r.setUTCHours(0,0,0,0),(0,i.A)(r)}var u=6048e5;function c(e){(0,a.A)(1,arguments);var t=(0,n.A)(e);return Math.round(((0,i.A)(t).getTime()-s(t).getTime())/u)+1}},70921:(e,t,r)=>{"use strict";let n;r.d(t,{eU:()=>o,y$:()=>v,zp:()=>_});let i=0;function o(e,t){let r=`atom${++i}`,n={toString:()=>r};return"function"==typeof e?n.read=e:(n.init=e,n.read=function(e){return e(this)},n.write=function(e,t,r){return t(this,"function"==typeof r?r(e(this)):r)}),t&&(n.write=t),n}let a=e=>"init"in e,s=e=>!!e.write,u=new WeakMap,c=(e,t)=>{u.set(e,t),e.catch(()=>{}).finally(()=>u.delete(e))},l=(e,t)=>{let r=u.get(e);r&&(u.delete(e),r(t))},f=(e,t)=>{e.status="fulfilled",e.value=t},d=(e,t)=>{e.status="rejected",e.reason=t},h=e=>"function"==typeof(null==e?void 0:e.then),p=(e,t)=>!!e&&"v"in e&&"v"in t&&Object.is(e.v,t.v),m=(e,t)=>!!e&&"e"in e&&"e"in t&&Object.is(e.e,t.e),y=e=>!!e&&"v"in e&&e.v instanceof Promise,g=(e,t)=>"v"in e&&"v"in t&&e.v.orig&&e.v.orig===t.v.orig,b=e=>{if("e"in e)throw e.e;return e.v},v=()=>{let e,t,r=new WeakMap,n=new WeakMap,i=new Map;e=new Set,t=new Set;let o=e=>r.get(e),u=(e,t)=>{Object.freeze(t);let n=r.get(e);if(r.set(e,t),i.has(e)||i.set(e,n),y(n)){let e="v"in t?t.v instanceof Promise?t.v:Promise.resolve(t.v):Promise.reject(t.e);n.v!==e&&l(n.v,e)}},v=(e,t,r)=>{let n=new Map,i=!1;r.forEach((r,o)=>{r||o!==e||(r=t),r?(n.set(o,r),t.d.get(o)!==r&&(i=!0)):console.warn("[Bug] atom state not found")}),(i||t.d.size!==n.size)&&(t.d=n)},_=(e,t,r)=>{let n=o(e),i={d:(null==n?void 0:n.d)||new Map,v:t};if(r&&v(e,i,r),p(n,i)&&n.d===i.d)return n;if(y(n)&&y(i)&&g(n,i))if(n.d===i.d)return n;else i.v=n.v;return u(e,i),i},S=(e,t,r,i)=>{if(h(t)){let a,s=()=>{let t=o(e);if(!y(t)||t.v!==u)return;let i=_(e,u,r);n.has(e)&&t.d!==i.d&&N(e,i,t.d)},u=new Promise((e,r)=>{let n=!1;t.then(t=>{n||(n=!0,f(u,t),e(t),s())},e=>{n||(n=!0,d(u,e),r(e),s())}),a=t=>{n||(n=!0,t.then(e=>f(u,e),e=>d(u,e)),e(t))}});return u.orig=t,u.status="pending",c(u,e=>{e&&a(e),null==i||i()}),_(e,u,r)}return _(e,t,r)},E=(e,t,r)=>{let n=o(e),i={d:(null==n?void 0:n.d)||new Map,e:t};return(r&&v(e,i,r),m(n,i)&&n.d===i.d)?n:(u(e,i),i)},w=(e,t)=>{let r,i,u=o(e);if(!t&&u&&(n.has(e)||Array.from(u.d).every(([t,r])=>{if(t===e)return!0;let n=w(t);return n===r||p(n,r)})))return u;let c=new Map,l=!0,f=t=>{if(t===e){let e=o(t);if(e)return c.set(t,e),b(e);if(a(t))return c.set(t,void 0),t.init;throw Error("no atom init")}let r=w(t);return c.set(t,r),b(r)},d={get signal(){return r||(r=new AbortController),r.signal},get setSelf(){return s(e)||console.warn("setSelf function cannot be used with read-only atom"),!i&&s(e)&&(i=(...t)=>{if(l&&console.warn("setSelf function cannot be called in sync"),!l)return R(e,...t)}),i}};try{let t=e.read(f,d);return S(e,t,c,()=>null==r?void 0:r.abort())}catch(t){return E(e,t,c)}finally{l=!1}},T=e=>{let t=n.get(e);return t||(t=C(e)),t},x=(e,t)=>!t.l.size&&(!t.t.size||1===t.t.size&&t.t.has(e)),A=e=>{let t=n.get(e);t&&x(e,t)&&I(e)},O=e=>{let t=new Map,r=new WeakMap,a=e=>{var t;let r=new Set(null==(t=n.get(e))?void 0:t.t);return i.forEach((t,n)=>{var i;(null==(i=o(n))?void 0:i.d.has(e))&&r.add(n)}),r},s=e=>{a(e).forEach(n=>{n!==e&&(t.set(n,(t.get(n)||new Set).add(e)),r.set(n,(r.get(n)||0)+1),s(n))})};s(e);let u=e=>{a(e).forEach(n=>{var i;if(n!==e){let e=r.get(n);if(e&&r.set(n,--e),!e){let e=!!(null==(i=t.get(n))?void 0:i.size);e&&(e=!p(o(n),w(n,!0))),e||t.forEach(e=>e.delete(n))}u(n)}})};u(e)},M=(t,...r)=>{let n=!0,i=e=>b(w(e)),s=(r,...i)=>{let s;if(r===t){if(!a(r))throw Error("atom not writable");p(o(r),S(r,i[0]))||O(r)}else s=M(r,...i);if(!n){let t=P();e.forEach(e=>e({type:"async-write",flushed:t}))}return s},u=t.write(i,s,...r);return n=!1,u},R=(t,...r)=>{let n=M(t,...r),i=P();return e.forEach(e=>e({type:"write",flushed:i})),n},C=(e,r,i)=>{var a;let u=i||[];null==(a=o(e))||a.d.forEach((t,r)=>{let i=n.get(r);i?i.t.add(e):r!==e&&C(r,e,u)}),w(e);let c={t:new Set(r&&[r]),l:new Set};if(n.set(e,c),t.add(e),s(e)&&e.onMount){let{onMount:t}=e;u.push(()=>{let r=t((...t)=>R(e,...t));r&&(c.u=r)})}return i||u.forEach(e=>e()),c},I=e=>{var r;let i=null==(r=n.get(e))?void 0:r.u;i&&i(),n.delete(e),t.delete(e);let a=o(e);a?(y(a)&&l(a.v),a.d.forEach((t,r)=>{if(r!==e){let t=n.get(r);t&&(t.t.delete(e),x(r,t)&&I(r))}})):console.warn("[Bug] could not find atom state to unmount",e)},N=(e,t,r)=>{let i=new Set(t.d.keys());null==r||r.forEach((t,r)=>{if(i.has(r))return void i.delete(r);let o=n.get(r);o&&(o.t.delete(e),x(r,o)&&I(r))}),i.forEach(t=>{let r=n.get(t);r?r.t.add(e):n.has(e)&&C(t,e)})},P=()=>{let e;for(e=new Set;i.size;){let t=Array.from(i);i.clear(),t.forEach(([t,r])=>{let i=o(t);if(i){let o=n.get(t);o&&i.d!==(null==r?void 0:r.d)&&N(t,i,null==r?void 0:r.d),o&&!(!y(r)&&(p(r,i)||m(r,i)))&&(o.l.forEach(e=>e()),e.add(t))}else console.warn("[Bug] no atom state to flush")})}return e};return{get:e=>b(w(e)),set:R,sub:(t,r)=>{let n=T(t),i=P(),o=n.l;return o.add(r),e.forEach(e=>e({type:"sub",flushed:i})),()=>{o.delete(r),A(t),e.forEach(e=>e({type:"unsub"}))}},dev_subscribe_store:(t,r)=>{if(2!==r)throw Error("The current StoreListener revision is 2.");return e.add(t),()=>{e.delete(t)}},dev_get_mounted_atoms:()=>t.values(),dev_get_atom_state:e=>r.get(e),dev_get_mounted:e=>n.get(e),dev_restore_atoms:t=>{for(let[e,r]of t)a(e)&&(S(e,r),O(e));let r=P();e.forEach(e=>e({type:"restore",flushed:r}))}}};"number"==typeof globalThis.__NUMBER_OF_JOTAI_INSTANCES__?++globalThis.__NUMBER_OF_JOTAI_INSTANCES__:globalThis.__NUMBER_OF_JOTAI_INSTANCES__=1;let _=()=>(n||(1!==globalThis.__NUMBER_OF_JOTAI_INSTANCES__&&console.warn("Detected multiple Jotai instances. It may cause unexpected behavior with the default store. https://github.com/pmndrs/jotai/discussions/2044"),n=v()),n)},71775:(e,t,r)=>{"use strict";r.d(t,{UE:()=>eM,ll:()=>ew,rD:()=>eI,UU:()=>eA,mG:()=>eR,ER:()=>eC,cY:()=>eT,BN:()=>ex,Ej:()=>eO});let n=Math.min,i=Math.max,o=Math.round,a=Math.floor,s=e=>({x:e,y:e}),u={left:"right",right:"left",bottom:"top",top:"bottom"},c={start:"end",end:"start"};function l(e,t,r){return i(e,n(t,r))}function f(e,t){return"function"==typeof e?e(t):e}function d(e){return e.split("-")[0]}function h(e){return e.split("-")[1]}function p(e){return"x"===e?"y":"x"}function m(e){return"y"===e?"height":"width"}let y=new Set(["top","bottom"]);function g(e){return y.has(d(e))?"y":"x"}function b(e){return p(g(e))}function v(e,t,r){void 0===r&&(r=!1);let n=h(e),i=b(e),o=m(i),a="x"===i?n===(r?"end":"start")?"right":"left":"start"===n?"bottom":"top";return t.reference[o]>t.floating[o]&&(a=M(a)),[a,M(a)]}function _(e){let t=M(e);return[S(e),t,S(t)]}function S(e){return e.replace(/start|end/g,e=>c[e])}let E=["left","right"],w=["right","left"],T=["top","bottom"],x=["bottom","top"];function A(e,t,r){switch(e){case"top":case"bottom":if(r)return t?w:E;return t?E:w;case"left":case"right":return t?T:x;default:return[]}}function O(e,t,r,n){let i=h(e),o=A(d(e),"start"===r,n);return i&&(o=o.map(e=>e+"-"+i),t&&(o=o.concat(o.map(S)))),o}function M(e){return e.replace(/left|right|bottom|top/g,e=>u[e])}function R(e){return{top:0,right:0,bottom:0,left:0,...e}}function C(e){return"number"!=typeof e?R(e):{top:e,right:e,bottom:e,left:e}}function I(e){let{x:t,y:r,width:n,height:i}=e;return{width:n,height:i,top:r,left:t,right:t+n,bottom:r+i,x:t,y:r}}function N(e,t,r){let n,{reference:i,floating:o}=e,a=g(t),s=b(t),u=m(s),c=d(t),l="y"===a,f=i.x+i.width/2-o.width/2,p=i.y+i.height/2-o.height/2,y=i[u]/2-o[u]/2;switch(c){case"top":n={x:f,y:i.y-o.height};break;case"bottom":n={x:f,y:i.y+i.height};break;case"right":n={x:i.x+i.width,y:p};break;case"left":n={x:i.x-o.width,y:p};break;default:n={x:i.x,y:i.y}}switch(h(t)){case"start":n[s]-=y*(r&&l?-1:1);break;case"end":n[s]+=y*(r&&l?-1:1)}return n}let P=async(e,t,r)=>{let{placement:n="bottom",strategy:i="absolute",middleware:o=[],platform:a}=r,s=o.filter(Boolean),u=await (null==a.isRTL?void 0:a.isRTL(t)),c=await a.getElementRects({reference:e,floating:t,strategy:i}),{x:l,y:f}=N(c,n,u),d=n,h={},p=0;for(let r=0;r({name:"arrow",options:e,async fn(t){let{x:r,y:i,placement:o,rects:a,platform:s,elements:u,middlewareData:c}=t,{element:d,padding:p=0}=f(e,t)||{};if(null==d)return{};let y=C(p),g={x:r,y:i},v=b(o),_=m(v),S=await s.getDimensions(d),E="y"===v,w=E?"top":"left",T=E?"bottom":"right",x=E?"clientHeight":"clientWidth",A=a.reference[_]+a.reference[v]-g[v]-a.floating[_],O=g[v]-a.reference[v],M=await (null==s.getOffsetParent?void 0:s.getOffsetParent(d)),R=M?M[x]:0;R&&await (null==s.isElement?void 0:s.isElement(M))||(R=u.floating[x]||a.floating[_]);let I=A/2-O/2,N=R/2-S[_]/2-1,P=n(y[w],N),k=n(y[T],N),D=P,L=R-S[_]-k,j=R/2-S[_]/2+I,U=l(D,j,L),B=!c.arrow&&null!=h(o)&&j!==U&&a.reference[_]/2-(je<=0)){let e=((null==(i=u.flip)?void 0:i.index)||0)+1,t=P[e];if(t&&("alignment"!==y||A===g(t)||j.every(e=>g(e.placement)!==A||e.overflows[0]>0)))return{data:{index:e,overflows:j},reset:{placement:t}};let r=null==(o=j.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:o.placement;if(!r)switch(S){case"bestFit":{let e=null==(a=j.filter(e=>{if(N){let t=g(e.placement);return t===A||"y"===t}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0])?void 0:a[0];e&&(r=e);break}case"initialPlacement":r=l}if(s!==r)return{reset:{placement:r}}}return{}}}};function j(e){let t=n(...e.map(e=>e.left)),r=n(...e.map(e=>e.top));return{x:t,y:r,width:i(...e.map(e=>e.right))-t,height:i(...e.map(e=>e.bottom))-r}}function U(e){let t=e.slice().sort((e,t)=>e.y-t.y),r=[],n=null;for(let e=0;en.height/2?r.push([i]):r[r.length-1].push(i),n=i}return r.map(e=>I(j(e)))}let B=function(e){return void 0===e&&(e={}),{name:"inline",options:e,async fn(t){let{placement:r,elements:o,rects:a,platform:s,strategy:u}=t,{padding:c=2,x:l,y:h}=f(e,t),p=Array.from(await (null==s.getClientRects?void 0:s.getClientRects(o.reference))||[]),m=U(p),y=I(j(p)),b=C(c);function v(){if(2===m.length&&m[0].left>m[1].right&&null!=l&&null!=h)return m.find(e=>l>e.left-b.left&&le.top-b.top&&h=2){if("y"===g(r)){let e=m[0],t=m[m.length-1],n="top"===d(r),i=e.top,o=t.bottom,a=n?e.left:t.left,s=n?e.right:t.right,u=s-a,c=o-i;return{top:i,bottom:o,left:a,right:s,width:u,height:c,x:a,y:i}}let e="left"===d(r),t=i(...m.map(e=>e.right)),o=n(...m.map(e=>e.left)),a=m.filter(r=>e?r.left===o:r.right===t),s=a[0].top,u=a[a.length-1].bottom,c=o,l=t,f=l-c,h=u-s;return{top:s,bottom:u,left:c,right:l,width:f,height:h,x:c,y:s}}return y}let _=await s.getElementRects({reference:{getBoundingClientRect:v},floating:o.floating,strategy:u});return a.reference.x!==_.reference.x||a.reference.y!==_.reference.y||a.reference.width!==_.reference.width||a.reference.height!==_.reference.height?{reset:{rects:_}}:{}}}},F=new Set(["left","top"]);async function z(e,t){let{placement:r,platform:n,elements:i}=e,o=await (null==n.isRTL?void 0:n.isRTL(i.floating)),a=d(r),s=h(r),u="y"===g(r),c=F.has(a)?-1:1,l=o&&u?-1:1,p=f(t,e),{mainAxis:m,crossAxis:y,alignmentAxis:b}="number"==typeof p?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return s&&"number"==typeof b&&(y="end"===s?-1*b:b),u?{x:y*l,y:m*c}:{x:m*c,y:y*l}}let $=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var r,n;let{x:i,y:o,placement:a,middlewareData:s}=t,u=await z(t,e);return a===(null==(r=s.offset)?void 0:r.placement)&&null!=(n=s.arrow)&&n.alignmentOffset?{}:{x:i+u.x,y:o+u.y,data:{...u,placement:a}}}}},V=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){let{x:r,y:n,placement:i}=t,{mainAxis:o=!0,crossAxis:a=!1,limiter:s={fn:e=>{let{x:t,y:r}=e;return{x:t,y:r}}},...u}=f(e,t),c={x:r,y:n},h=await k(t,u),m=g(d(i)),y=p(m),b=c[y],v=c[m];if(o){let e="y"===y?"top":"left",t="y"===y?"bottom":"right",r=b+h[e],n=b-h[t];b=l(r,b,n)}if(a){let e="y"===m?"top":"left",t="y"===m?"bottom":"right",r=v+h[e],n=v-h[t];v=l(r,v,n)}let _=s.fn({...t,[y]:b,[m]:v});return{..._,data:{x:_.x-r,y:_.y-n,enabled:{[y]:o,[m]:a}}}}}},Y=function(e){return void 0===e&&(e={}),{options:e,fn(t){let{x:r,y:n,placement:i,rects:o,middlewareData:a}=t,{offset:s=0,mainAxis:u=!0,crossAxis:c=!0}=f(e,t),l={x:r,y:n},h=g(i),m=p(h),y=l[m],b=l[h],v=f(s,t),_="number"==typeof v?{mainAxis:v,crossAxis:0}:{mainAxis:0,crossAxis:0,...v};if(u){let e="y"===m?"height":"width",t=o.reference[m]-o.floating[e]+_.mainAxis,r=o.reference[m]+o.reference[e]-_.mainAxis;yr&&(y=r)}if(c){var S,E;let e="y"===m?"width":"height",t=F.has(d(i)),r=o.reference[h]-o.floating[e]+(t&&(null==(S=a.offset)?void 0:S[h])||0)+(t?0:_.crossAxis),n=o.reference[h]+o.reference[e]+(t?0:(null==(E=a.offset)?void 0:E[h])||0)-(t?_.crossAxis:0);bn&&(b=n)}return{[m]:y,[h]:b}}}},q=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){var r,o;let a,s,{placement:u,rects:c,platform:l,elements:p}=t,{apply:m=()=>{},...y}=f(e,t),b=await k(t,y),v=d(u),_=h(u),S="y"===g(u),{width:E,height:w}=c.floating;"top"===v||"bottom"===v?(a=v,s=_===(await (null==l.isRTL?void 0:l.isRTL(p.floating))?"start":"end")?"left":"right"):(s=v,a="end"===_?"top":"bottom");let T=w-b.top-b.bottom,x=E-b.left-b.right,A=n(w-b[a],T),O=n(E-b[s],x),M=!t.middlewareData.shift,R=A,C=O;if(null!=(r=t.middlewareData.shift)&&r.enabled.x&&(C=x),null!=(o=t.middlewareData.shift)&&o.enabled.y&&(R=T),M&&!_){let e=i(b.left,0),t=i(b.right,0),r=i(b.top,0),n=i(b.bottom,0);S?C=E-2*(0!==e||0!==t?e+t:i(b.left,b.right)):R=w-2*(0!==r||0!==n?r+n:i(b.top,b.bottom))}await m({...t,availableWidth:C,availableHeight:R});let I=await l.getDimensions(p.floating);return E!==I.width||w!==I.height?{reset:{rects:!0}}:{}}}};var H=r(78761);function W(e){let t=(0,H.L9)(e),r=parseFloat(t.width)||0,n=parseFloat(t.height)||0,i=(0,H.sb)(e),a=i?e.offsetWidth:r,s=i?e.offsetHeight:n,u=o(r)!==a||o(n)!==s;return u&&(r=a,n=s),{width:r,height:n,$:u}}function G(e){return(0,H.vq)(e)?e:e.contextElement}function Z(e){let t=G(e);if(!(0,H.sb)(t))return s(1);let r=t.getBoundingClientRect(),{width:n,height:i,$:a}=W(t),u=(a?o(r.width):r.width)/n,c=(a?o(r.height):r.height)/i;return u&&Number.isFinite(u)||(u=1),c&&Number.isFinite(c)||(c=1),{x:u,y:c}}let K=s(0);function X(e){let t=(0,H.zk)(e);return(0,H.Tc)()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:K}function J(e,t,r){return void 0===t&&(t=!1),!!r&&(!t||r===(0,H.zk)(e))&&t}function Q(e,t,r,n){void 0===t&&(t=!1),void 0===r&&(r=!1);let i=e.getBoundingClientRect(),o=G(e),a=s(1);t&&(n?(0,H.vq)(n)&&(a=Z(n)):a=Z(e));let u=J(o,r,n)?X(o):s(0),c=(i.left+u.x)/a.x,l=(i.top+u.y)/a.y,f=i.width/a.x,d=i.height/a.y;if(o){let e=(0,H.zk)(o),t=n&&(0,H.vq)(n)?(0,H.zk)(n):n,r=e,i=(0,H._m)(r);for(;i&&n&&t!==r;){let e=Z(i),t=i.getBoundingClientRect(),n=(0,H.L9)(i),o=t.left+(i.clientLeft+parseFloat(n.paddingLeft))*e.x,a=t.top+(i.clientTop+parseFloat(n.paddingTop))*e.y;c*=e.x,l*=e.y,f*=e.x,d*=e.y,c+=o,l+=a,r=(0,H.zk)(i),i=(0,H._m)(r)}}return I({width:f,height:d,x:c,y:l})}function ee(e,t){let r=(0,H.CP)(e).scrollLeft;return t?t.left+r:Q((0,H.ep)(e)).left+r}function et(e,t){let r=e.getBoundingClientRect();return{x:r.left+t.scrollLeft-ee(e,r),y:r.top+t.scrollTop}}function er(e){let{elements:t,rect:r,offsetParent:n,strategy:i}=e,o="fixed"===i,a=(0,H.ep)(n),u=!!t&&(0,H.Tf)(t.floating);if(n===a||u&&o)return r;let c={scrollLeft:0,scrollTop:0},l=s(1),f=s(0),d=(0,H.sb)(n);if((d||!d&&!o)&&(("body"!==(0,H.mq)(n)||(0,H.ZU)(a))&&(c=(0,H.CP)(n)),(0,H.sb)(n))){let e=Q(n);l=Z(n),f.x=e.x+n.clientLeft,f.y=e.y+n.clientTop}let h=!a||d||o?s(0):et(a,c);return{width:r.width*l.x,height:r.height*l.y,x:r.x*l.x-c.scrollLeft*l.x+f.x+h.x,y:r.y*l.y-c.scrollTop*l.y+f.y+h.y}}function en(e){return Array.from(e.getClientRects())}function ei(e){let t=(0,H.ep)(e),r=(0,H.CP)(e),n=e.ownerDocument.body,o=i(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),a=i(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight),s=-r.scrollLeft+ee(e),u=-r.scrollTop;return"rtl"===(0,H.L9)(n).direction&&(s+=i(t.clientWidth,n.clientWidth)-o),{width:o,height:a,x:s,y:u}}let eo=25;function ea(e,t){let r=(0,H.zk)(e),n=(0,H.ep)(e),i=r.visualViewport,o=n.clientWidth,a=n.clientHeight,s=0,u=0;if(i){o=i.width,a=i.height;let e=(0,H.Tc)();(!e||e&&"fixed"===t)&&(s=i.offsetLeft,u=i.offsetTop)}let c=ee(n);if(c<=0){let e=n.ownerDocument,t=e.body,r=getComputedStyle(t),i="CSS1Compat"===e.compatMode&&parseFloat(r.marginLeft)+parseFloat(r.marginRight)||0,a=Math.abs(n.clientWidth-t.clientWidth-i);a<=eo&&(o-=a)}else c<=eo&&(o+=c);return{width:o,height:a,x:s,y:u}}let es=new Set(["absolute","fixed"]);function eu(e,t){let r=Q(e,!0,"fixed"===t),n=r.top+e.clientTop,i=r.left+e.clientLeft,o=(0,H.sb)(e)?Z(e):s(1),a=e.clientWidth*o.x,u=e.clientHeight*o.y;return{width:a,height:u,x:i*o.x,y:n*o.y}}function ec(e,t,r){let n;if("viewport"===t)n=ea(e,r);else if("document"===t)n=ei((0,H.ep)(e));else if((0,H.vq)(t))n=eu(t,r);else{let r=X(e);n={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return I(n)}function el(e,t){let r=(0,H.$4)(e);return!(r===t||!(0,H.vq)(r)||(0,H.eu)(r))&&("fixed"===(0,H.L9)(r).position||el(r,t))}function ef(e,t){let r=t.get(e);if(r)return r;let n=(0,H.v9)(e,[],!1).filter(e=>(0,H.vq)(e)&&"body"!==(0,H.mq)(e)),i=null,o="fixed"===(0,H.L9)(e).position,a=o?(0,H.$4)(e):e;for(;(0,H.vq)(a)&&!(0,H.eu)(a);){let t=(0,H.L9)(a),r=(0,H.sQ)(a);r||"fixed"!==t.position||(i=null),(o?!r&&!i:!r&&"static"===t.position&&!!i&&es.has(i.position)||(0,H.ZU)(a)&&!r&&el(e,a))?n=n.filter(e=>e!==a):i=t,a=(0,H.$4)(a)}return t.set(e,n),n}function ed(e){let{element:t,boundary:r,rootBoundary:o,strategy:a}=e,s=[..."clippingAncestors"===r?(0,H.Tf)(t)?[]:ef(t,this._c):[].concat(r),o],u=s[0],c=s.reduce((e,r)=>{let o=ec(t,r,a);return e.top=i(o.top,e.top),e.right=n(o.right,e.right),e.bottom=n(o.bottom,e.bottom),e.left=i(o.left,e.left),e},ec(t,u,a));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function eh(e){let{width:t,height:r}=W(e);return{width:t,height:r}}function ep(e,t,r){let n=(0,H.sb)(t),i=(0,H.ep)(t),o="fixed"===r,a=Q(e,!0,o,t),u={scrollLeft:0,scrollTop:0},c=s(0);function l(){c.x=ee(i)}if(n||!n&&!o)if(("body"!==(0,H.mq)(t)||(0,H.ZU)(i))&&(u=(0,H.CP)(t)),n){let e=Q(t,!0,o,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else i&&l();o&&!n&&i&&l();let f=!i||n||o?s(0):et(i,u);return{x:a.left+u.scrollLeft-c.x-f.x,y:a.top+u.scrollTop-c.y-f.y,width:a.width,height:a.height}}function em(e){return"static"===(0,H.L9)(e).position}function ey(e,t){if(!(0,H.sb)(e)||"fixed"===(0,H.L9)(e).position)return null;if(t)return t(e);let r=e.offsetParent;return(0,H.ep)(e)===r&&(r=r.ownerDocument.body),r}function eg(e,t){let r=(0,H.zk)(e);if((0,H.Tf)(e))return r;if(!(0,H.sb)(e)){let t=(0,H.$4)(e);for(;t&&!(0,H.eu)(t);){if((0,H.vq)(t)&&!em(t))return t;t=(0,H.$4)(t)}return r}let n=ey(e,t);for(;n&&(0,H.Lv)(n)&&em(n);)n=ey(n,t);return n&&(0,H.eu)(n)&&em(n)&&!(0,H.sQ)(n)?r:n||(0,H.gJ)(e)||r}let eb=async function(e){let t=this.getOffsetParent||eg,r=this.getDimensions,n=await r(e.floating);return{reference:ep(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function ev(e){return"rtl"===(0,H.L9)(e).direction}let e_={convertOffsetParentRelativeRectToViewportRelativeRect:er,getDocumentElement:H.ep,getClippingRect:ed,getOffsetParent:eg,getElementRects:eb,getClientRects:en,getDimensions:eh,getScale:Z,isElement:H.vq,isRTL:ev};function eS(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function eE(e,t){let r,o=null,s=(0,H.ep)(e);function u(){var e;clearTimeout(r),null==(e=o)||e.disconnect(),o=null}function c(l,f){void 0===l&&(l=!1),void 0===f&&(f=1),u();let d=e.getBoundingClientRect(),{left:h,top:p,width:m,height:y}=d;if(l||t(),!m||!y)return;let g={rootMargin:-a(p)+"px "+-a(s.clientWidth-(h+m))+"px "+-a(s.clientHeight-(p+y))+"px "+-a(h)+"px",threshold:i(0,n(1,f))||1},b=!0;function v(t){let n=t[0].intersectionRatio;if(n!==f){if(!b)return c();n?c(!1,n):r=setTimeout(()=>{c(!1,1e-7)},1e3)}1!==n||eS(d,e.getBoundingClientRect())||c(),b=!1}try{o=new IntersectionObserver(v,{...g,root:s.ownerDocument})}catch(e){o=new IntersectionObserver(v,g)}o.observe(e)}return c(!0),u}function ew(e,t,r,n){let i;void 0===n&&(n={});let{ancestorScroll:o=!0,ancestorResize:a=!0,elementResize:s="function"==typeof ResizeObserver,layoutShift:u="function"==typeof IntersectionObserver,animationFrame:c=!1}=n,l=G(e),f=o||a?[...l?(0,H.v9)(l):[],...(0,H.v9)(t)]:[];f.forEach(e=>{o&&e.addEventListener("scroll",r,{passive:!0}),a&&e.addEventListener("resize",r)});let d=l&&u?eE(l,r):null,h=-1,p=null;s&&(p=new ResizeObserver(e=>{let[n]=e;n&&n.target===l&&p&&(p.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var e;null==(e=p)||e.observe(t)})),r()}),l&&!c&&p.observe(l),p.observe(t));let m=c?Q(e):null;function y(){let t=Q(e);m&&!eS(m,t)&&r(),m=t,i=requestAnimationFrame(y)}return c&&y(),r(),()=>{var e;f.forEach(e=>{o&&e.removeEventListener("scroll",r),a&&e.removeEventListener("resize",r)}),null==d||d(),null==(e=p)||e.disconnect(),p=null,c&&cancelAnimationFrame(i)}}let eT=$,ex=V,eA=L,eO=q,eM=D,eR=B,eC=Y,eI=(e,t,r)=>{let n=new Map,i={platform:e_,...r},o={...i.platform,_c:n};return P(e,t,{...i,platform:o})}},71963:(e,t,r)=>{"use strict";e.exports={format:r(9617),formatInTimeZone:r(48289),getTimezoneOffset:r(59012),toDate:r(88015),utcToZonedTime:r(40740),zonedTimeToUtc:r(65658)}},72206:e=>{"use strict";e.exports=TypeError},72562:(e,t,r)=>{"use strict";var n="u">typeof Symbol&&Symbol,i=r(47684);e.exports=function(){return"function"==typeof n&&"function"==typeof Symbol&&"symbol"==typeof n("foo")&&"symbol"==typeof Symbol("bar")&&i()}},72959:()=>{},73399:function(e,t,r){!function(t,r){e.exports=r()}(0,function(){"use strict";let e,t,n;var i="u">typeof globalThis?globalThis:"u">typeof window?window:void 0!==r.g?r.g:"u">typeof self?self:{};function o(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var a,s,u,c,l={languageTag:"en-US",delimiters:{thousands:",",decimal:"."},abbreviations:{thousand:"k",million:"m",billion:"b",trillion:"t"},spaceSeparated:!1,ordinal:function(e){let t=e%10;return 1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th"},bytes:{binarySuffixes:["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],decimalSuffixes:["B","KB","MB","GB","TB","PB","EB","ZB","YB"]},currency:{symbol:"$",position:"prefix",code:"USD"},currencyFormat:{thousandSeparated:!0,totalLength:4,spaceSeparated:!0,spaceSeparatedCurrency:!0},formats:{fourDigits:{totalLength:4,spaceSeparated:!0},fullWithTwoDecimals:{output:"currency",thousandSeparated:!0,mantissa:2},fullWithTwoDecimalsNoCurrency:{thousandSeparated:!0,mantissa:2},fullWithNoDecimals:{output:"currency",thousandSeparated:!0,mantissa:0}}};function f(){if(s)return a;s=1;let e=[{key:"ZiB",factor:11805916207174113e5},{key:"ZB",factor:1e21},{key:"YiB",factor:12089258196146292e8},{key:"YB",factor:1e24},{key:"TiB",factor:0x10000000000},{key:"TB",factor:1e12},{key:"PiB",factor:0x4000000000000},{key:"PB",factor:1e15},{key:"MiB",factor:1048576},{key:"MB",factor:1e6},{key:"KiB",factor:1024},{key:"KB",factor:1e3},{key:"GiB",factor:0x40000000},{key:"GB",factor:1e9},{key:"EiB",factor:0x1000000000000000},{key:"EB",factor:1e18},{key:"B",factor:1}];function t(e){return e.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}function r(n,i,o,a,s,u,c){if(!isNaN(+n))return+n;let l="",f=n.replace(/(^[^(]*)\((.*)\)([^)]*$)/,"$1$2$3");if(f!==n)return -1*r(f,i,o,a,s,u);for(let t=0;t{p[u[e]]=e});let m=Object.keys(p).sort().reverse(),y=m.length;for(let e=0;e"byte"===t.output,message:"`base` must be provided only when the output is `byte`",mandatory:e=>"byte"===e.output},characteristic:{type:"number",restriction:e=>e>=0,message:"value must be positive"},prefix:"string",postfix:"string",forceAverage:{type:"string",validValues:["trillion","billion","million","thousand"]},average:"boolean",lowPrecision:{type:"boolean",restriction:(e,t)=>!0===t.average,message:"`lowPrecision` must be provided only when the option `average` is set"},currencyPosition:{type:"string",validValues:["prefix","infix","postfix"]},currencySymbol:"string",totalLength:{type:"number",restrictions:[{restriction:e=>e>=0,message:"value must be positive"},{restriction:(e,t)=>!t.exponential,message:"`totalLength` is incompatible with `exponential`"}]},mantissa:{type:"number",restriction:e=>e>=0,message:"value must be positive"},optionalMantissa:"boolean",trimMantissa:"boolean",roundingFunction:"function",optionalCharacteristic:"boolean",thousandSeparated:"boolean",spaceSeparated:"boolean",spaceSeparatedCurrency:"boolean",spaceSeparatedAbbreviation:"boolean",abbreviations:{type:"object",children:{thousand:"string",million:"string",billion:"string",trillion:"string"}},negative:{type:"string",validValues:["sign","parenthesis"]},forceSign:"boolean",exponential:{type:"boolean"},prefixSymbol:{type:"boolean",restriction:(e,t)=>"percent"===t.output,message:"`prefixSymbol` can be provided only when the output is `percent`"}},n={languageTag:{type:"string",mandatory:!0,restriction:e=>e.match(t),message:"the language tag must follow the BCP 47 specification (see https://tools.ieft.org/html/bcp47)"},delimiters:{type:"object",children:{thousands:"string",decimal:"string",thousandsSize:"number"},mandatory:!0},abbreviations:{type:"object",children:{thousand:{type:"string",mandatory:!0},million:{type:"string",mandatory:!0},billion:{type:"string",mandatory:!0},trillion:{type:"string",mandatory:!0}},mandatory:!0},spaceSeparated:"boolean",spaceSeparatedCurrency:"boolean",ordinal:{type:"function",mandatory:!0},bytes:{type:"object",children:{binarySuffixes:"object",decimalSuffixes:"object"}},currency:{type:"object",children:{symbol:"string",position:"string",code:"string"},mandatory:!0},defaults:"format",ordinalFormat:"format",byteFormat:"format",percentageFormat:"format",currencyFormat:"format",timeDefaults:"format",formats:{type:"object",children:{fourDigits:{type:"format",mandatory:!0},fullWithTwoDecimals:{type:"format",mandatory:!0},fullWithTwoDecimalsNoCurrency:{type:"format",mandatory:!0},fullWithNoDecimals:{type:"format",mandatory:!0}}}};function i(t){return void 0!==e.unformat(t)}function o(e,t,n,i=!1){let a=Object.keys(e).map(i=>{if(!t[i])return console.error(`${n} Invalid key: ${i}`),!1;let a=e[i],s=t[i];if("string"==typeof s&&(s={type:s}),"format"===s.type){if(!o(a,r,`[Validate ${i}]`,!0))return!1}else if(typeof a!==s.type)return console.error(`${n} ${i} type mismatched: "${s.type}" expected, "${typeof a}" provided`),!1;if(s.restrictions&&s.restrictions.length){let t=s.restrictions.length;for(let r=0;r{let i=t[r];if("string"==typeof i&&(i={type:i}),i.mandatory){let t=i.mandatory;if("function"==typeof t&&(t=t(e)),t&&void 0===e[r])return console.error(`${n} Missing mandatory key "${r}"`),!1}return!0})),a.reduce((e,t)=>e&&t,!0)}function a(e){return o(e,r,"[Validate format]")}return u={validate:function(e,t){let r=i(e),n=a(t);return r&&n},validateFormat:a,validateInput:i,validateLanguage:function(e){return o(e,n,"[Validate language]")}}}var h,p,m={parseFormat:function(e,t={}){return"string"!=typeof e?e:(function(e,t){if(-1===e.indexOf("$")){if(-1===e.indexOf("%"))return -1!==e.indexOf("bd")?(t.output="byte",t.base="general"):-1!==e.indexOf("b")?(t.output="byte",t.base="binary"):-1!==e.indexOf("d")?(t.output="byte",t.base="decimal"):-1===e.indexOf(":")?-1!==e.indexOf("o")&&(t.output="ordinal"):t.output="time";t.output="percent"}else t.output="currency"}(e=function(e,t){let r=e.match(/{([^}]*)}$/);return r?(t.postfix=r[1],e.slice(0,-r[0].length)):e}(e=function(e,t){let r=e.match(/^{([^}]*)}/);return r?(t.prefix=r[1],e.slice(r[0].length)):e}(e,t),t),t),function(e,t){let r=e.match(/[1-9]+[0-9]*/);r&&(t.totalLength=+r[0])}(e,t),function(e,t){let r=e.split(".")[0].match(/0+/);r&&(t.characteristic=r[0].length)}(e,t),function(e,t){-1!==e.indexOf(".")&&(t.optionalCharacteristic=-1===e.split(".")[0].indexOf("0"))}(e,t),function(e,t){-1!==e.indexOf("a")&&(t.average=!0)}(e,t),function(e,t){-1!==e.indexOf("K")?t.forceAverage="thousand":-1!==e.indexOf("M")?t.forceAverage="million":-1!==e.indexOf("B")?t.forceAverage="billion":-1!==e.indexOf("T")&&(t.forceAverage="trillion")}(e,t),function(e,t){let r=e.split(".")[1];if(r){let e=r.match(/0+/);e&&(t.mantissa=e[0].length)}}(e,t),function(e,t){e.match(/\[\.]/)?t.optionalMantissa=!0:e.match(/\./)&&(t.optionalMantissa=!1)}(e,t),function(e,t){let r=e.split(".")[1];r&&(t.trimMantissa=-1!==r.indexOf("["))}(e,t),function(e,t){-1!==e.indexOf(",")&&(t.thousandSeparated=!0)}(e,t),function(e,t){-1!==e.indexOf(" ")&&(t.spaceSeparated=!0,t.spaceSeparatedCurrency=!0,(t.average||t.forceAverage)&&(t.spaceSeparatedAbbreviation=!0))}(e,t),function(e,t){e.match(/^\+?\([^)]*\)$/)&&(t.negative="parenthesis"),e.match(/^\+?-/)&&(t.negative="sign")}(e,t),function(e,t){e.match(/^\+/)&&(t.forceSign=!0)}(e,t),t)}};function y(){if(p)return h;p=1;let e=l,t=d(),r=m,n,i={},o={},a=null,s={};function u(e){n=e}function c(){return o[n]}return i.languages=()=>Object.assign({},o),i.currentLanguage=()=>n,i.currentBytes=()=>c().bytes||{},i.currentCurrency=()=>c().currency,i.currentAbbreviations=()=>c().abbreviations,i.currentDelimiters=()=>c().delimiters,i.currentOrdinal=()=>c().ordinal,i.currentDefaults=()=>Object.assign({},c().defaults,s),i.currentOrdinalDefaultFormat=()=>Object.assign({},i.currentDefaults(),c().ordinalFormat),i.currentByteDefaultFormat=()=>Object.assign({},i.currentDefaults(),c().byteFormat),i.currentPercentageDefaultFormat=()=>Object.assign({},i.currentDefaults(),c().percentageFormat),i.currentCurrencyDefaultFormat=()=>Object.assign({},i.currentDefaults(),c().currencyFormat),i.currentTimeDefaultFormat=()=>Object.assign({},i.currentDefaults(),c().timeFormat),i.setDefaults=e=>{e=r.parseFormat(e),t.validateFormat(e)&&(s=e)},i.getZeroFormat=()=>a,i.setZeroFormat=e=>a="string"==typeof e?e:null,i.hasZeroFormat=()=>null!==a,i.languageData=e=>{if(e){if(o[e])return o[e];throw Error(`Unknown tag "${e}"`)}return c()},i.registerLanguage=(e,r=!1)=>{if(!t.validateLanguage(e))throw Error("Invalid language data");o[e.languageTag]=e,r&&u(e.languageTag)},i.setLanguage=(t,r=e.languageTag)=>{if(!o[t]){let e=t.split("-")[0],n=Object.keys(o).find(t=>t.split("-")[0]===e);return o[n]?void u(n):void u(r)}u(t)},i.registerLanguage(e),n=e.languageTag,h=i}function g(e,t){e.forEach(e=>{let r;try{r=function(e){throw Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}(`../languages/${e}`)}catch(t){console.error(`Unable to load "${e}". No matching language file found.`)}r&&t.registerLanguage(r)})}var b={exports:{}};!function(e){!function(t){var r,n=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,i=Math.ceil,o=Math.floor,a="[BigNumber Error] ",s=a+"Number primitive has more than 15 significant digits: ",u=1e14,c=14,l=0x1fffffffffffff,f=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],d=1e7,h=1e9;function p(e){var t=0|e;return e>0||e===t?t:t-1}function m(e){for(var t,r,n=1,i=e.length,o=e[0]+"";nc^r?1:-1;for(s=(u=i.length)<(c=o.length)?u:c,a=0;ao[a]^r?1:-1;return u==c?0:u>c^r?1:-1}function g(e,t,r,n){if(er||e!==o(e))throw Error(a+(n||"Argument")+("number"==typeof e?er?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function b(e){var t=e.c.length-1;return p(e.e/c)==t&&e.c[t]%2!=0}function v(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function _(e,t,r){var n,i;if(t<0){for(i=r+".";++t;i+=r);e=i+e}else if(++t>(n=e.length)){for(i=r,t-=n;--t;i+=r);e+=i}else tj?m.c=m.e=null:e.e=10;f/=10,u++);return void(u>j?m.c=m.e=null:(m.e=u,m.c=[e]))}p=String(e)}else{if(!n.test(p=String(e)))return E(m,p,d);m.s=45==p.charCodeAt(0)?(p=p.slice(1),-1):1}(u=p.indexOf("."))>-1&&(p=p.replace(".","")),(f=p.search(/e/i))>0?(u<0&&(u=f),u+=+p.slice(f+1),p=p.substring(0,f)):u<0&&(u=p.length)}else{if(g(t,2,$.length,"Base"),10==t&&V)return G(m=new Y(e),N+m.e+1,P);if(p=String(e),d="number"==typeof e){if(0*e!=0)return E(m,p,d,t);if(m.s=1/e<0?(p=p.slice(1),-1):1,Y.DEBUG&&p.replace(/^0\.0*|\./,"").length>15)throw Error(s+e)}else m.s=45===p.charCodeAt(0)?(p=p.slice(1),-1):1;for(r=$.slice(0,t),u=f=0,h=p.length;fr.indexOf(i=p.charAt(f))){if("."==i){if(f>u){u=h;continue}}else if(!a&&(p==p.toUpperCase()&&(p=p.toLowerCase())||p==p.toLowerCase()&&(p=p.toUpperCase()))){a=!0,f=-1,u=0;continue}return E(m,String(e),d,t)}d=!1,(u=(p=S(p,t,10,m.s)).indexOf("."))>-1?p=p.replace(".",""):u=p.length}for(f=0;48===p.charCodeAt(f);f++);for(h=p.length;48===p.charCodeAt(--h););if(p=p.slice(f,++h)){if(h-=f,d&&Y.DEBUG&&h>15&&(e>l||e!==o(e)))throw Error(s+m.s*e);if((u=u-f-1)>j)m.c=m.e=null;else if(u=D)?v(u,a):_(u,a,"0");else if(o=(e=G(new Y(e),t,r)).e,s=(u=m(e.c)).length,1==n||2==n&&(t<=o||o<=k)){for(;ss){if(--t>0)for(u+=".";t--;u+="0");}else if((t+=o-s)>0)for(o+1==s&&(u+=".");t--;u+="0");return e.s<0&&i?"-"+u:u}function H(e,t){for(var r,n,i=1,o=new Y(e[0]);i=10;i/=10,n++);return(r=n+r*c-1)>j?e.c=e.e=null:r=10;d/=10,a++);if((s=t-a)<0)s+=c,l=t,m=o((h=y[p=0])/g[a-l-1]%10);else if((p=i((s+1)/c))>=y.length){if(!n)break t;for(;y.length<=p;y.push(0));h=m=0,a=1,l=(s%=c)-c+1}else{for(h=d=y[p],a=1;d>=10;d/=10,a++);m=(l=(s%=c)-c+a)<0?0:o(h/g[a-l-1]%10)}if(n=n||t<0||null!=y[p+1]||(l<0?h:h%g[a-l-1]),n=r<4?(m||n)&&(0==r||r==(e.s<0?3:2)):m>5||5==m&&(4==r||n||6==r&&(s>0?l>0?h/g[a-l]:0:y[p-1])%10&1||r==(e.s<0?8:7)),t<1||!y[0])return y.length=0,n?(t-=e.e+1,y[0]=g[(c-t%c)%c],e.e=-t||0):y[0]=e.e=0,e;if(0==s?(y.length=p,d=1,p--):(y.length=p+1,d=g[c-s],y[p]=l>0?o(h/g[a-l]%g[l])*d:0),n)for(;;){if(0==p){for(s=1,l=y[0];l>=10;l/=10,s++);for(l=y[0]+=d,d=1;l>=10;l/=10,d++);s!=d&&(e.e++,y[0]==u&&(y[0]=1));break}if(y[p]+=d,y[p]!=u)break;y[p--]=0,d=1}for(s=y.length;0===y[--s];y.pop());}e.e>j?e.c=e.e=null:e.e=D?v(t,r):_(t,r,"0"),e.s<0?"-"+t:t)}return Y.clone=e,Y.ROUND_UP=0,Y.ROUND_DOWN=1,Y.ROUND_CEIL=2,Y.ROUND_FLOOR=3,Y.ROUND_HALF_UP=4,Y.ROUND_HALF_DOWN=5,Y.ROUND_HALF_EVEN=6,Y.ROUND_HALF_CEIL=7,Y.ROUND_HALF_FLOOR=8,Y.EUCLID=9,Y.config=Y.set=function(e){var t,r;if(null!=e){if("object"!=typeof e)throw Error(a+"Object expected: "+e);if(e.hasOwnProperty(t="DECIMAL_PLACES")&&(g(r=e[t],0,h,t),N=r),e.hasOwnProperty(t="ROUNDING_MODE")&&(g(r=e[t],0,8,t),P=r),e.hasOwnProperty(t="EXPONENTIAL_AT")&&((r=e[t])&&r.pop?(g(r[0],-h,0,t),g(r[1],0,h,t),k=r[0],D=r[1]):(g(r,-h,h,t),k=-(D=r<0?-r:r))),e.hasOwnProperty(t="RANGE"))if((r=e[t])&&r.pop)g(r[0],-h,-1,t),g(r[1],1,h,t),L=r[0],j=r[1];else{if(g(r,-h,h,t),!r)throw Error(a+t+" cannot be zero: "+r);L=-(j=r<0?-r:r)}if(e.hasOwnProperty(t="CRYPTO")){if((r=e[t])!==!!r)throw Error(a+t+" not true or false: "+r);if(r){if("u"=-h&&i<=h&&i===o(i)){if(0===n[0]){if(0===i&&1===n.length)return!0;break t}if((t=(i+1)%c)<1&&(t+=c),String(n[0]).length==t){for(t=0;t=u||r!==o(r))break t;if(0!==r)return!0}}}else if(null===n&&null===i&&(null===s||1===s||-1===s))return!0;throw Error(a+"Invalid BigNumber: "+e)},Y.maximum=Y.max=function(){return H(arguments,-1)},Y.minimum=Y.min=function(){return H(arguments,1)},T=Math.random()*(w=0x20000000000000)&2097151?function(){return o(Math.random()*w)}:function(){return 8388608*(0x40000000*Math.random()|0)+(8388608*Math.random()|0)},Y.random=function(e){var t,r,n,s,u,l=0,d=[],p=new Y(I);if(null==e?e=N:g(e,0,h),s=i(e/c),U)if(crypto.getRandomValues){for(t=crypto.getRandomValues(new Uint32Array(s*=2));l>>11))>=9e15?(r=crypto.getRandomValues(new Uint32Array(2)),t[l]=r[0],t[l+1]=r[1]):(d.push(u%1e14),l+=2);l=s/2}else{if(!crypto.randomBytes)throw U=!1,Error(a+"crypto unavailable");for(t=crypto.randomBytes(s*=7);l=9e15?crypto.randomBytes(7).copy(t,l):(d.push(u%1e14),l+=7);l=s/7}if(!U)for(;l=10;u/=10,l++);lr-1&&(null==a[i+1]&&(a[i+1]=0),a[i+1]+=a[i]/r|0,a[i]%=r)}return a.reverse()}return function(n,i,o,a,s){var u,c,l,f,d,h,p,y,g=n.indexOf("."),b=N,v=P;for(g>=0&&(f=F,F=0,n=n.replace(".",""),h=(y=new Y(i)).pow(n.length-g),F=f,y.c=t(_(m(h.c),h.e,"0"),10,o,e),y.e=y.c.length),l=f=(p=t(n,i,o,s?(u=$,e):(u=e,$))).length;0==p[--f];p.pop());if(!p[0])return u.charAt(0);if(g<0?--l:(h.c=p,h.e=l,h.s=a,p=(h=r(h,y,b,v,o)).c,d=h.r,l=h.e),g=p[c=l+b+1],f=o/2,d=d||c<0||null!=p[c+1],d=v<4?(null!=g||d)&&(0==v||v==(h.s<0?3:2)):g>f||g==f&&(4==v||d||6==v&&1&p[c-1]||v==(h.s<0?8:7)),c<1||!p[0])n=d?_(u.charAt(1),-b,u.charAt(0)):u.charAt(0);else{if(p.length=c,d)for(--o;++p[--c]>o;)p[c]=0,c||(++l,p=[1].concat(p));for(f=p.length;!p[--f];);for(g=0,n="";g<=f;n+=u.charAt(p[g++]));n=_(n,l,u.charAt(0))}return n}}(),r=function(){function e(e,t,r){var n,i,o,a,s=0,u=e.length,c=t%d,l=t/d|0;for(e=e.slice();u--;)s=((i=c*(o=e[u]%d)+(n=l*o+(a=e[u]/d|0)*c)%d*d+s)/r|0)+(n/d|0)+l*a,e[u]=i%r;return s&&(e=[s].concat(e)),e}function t(e,t,r,n){var i,o;if(r!=n)o=r>n?1:-1;else for(i=o=0;it[i]?1:-1;break}return o}function r(e,t,r,n){for(var i=0;r--;)e[r]-=i,i=+(e[r]1;e.splice(0,1));}return function(n,i,a,s,l){var f,d,h,m,y,g,b,v,_,S,E,w,T,x,A,O,M,R=n.s==i.s?1:-1,C=n.c,I=i.c;if(!(C&&C[0]&&I&&I[0]))return new Y(n.s&&i.s&&(C?!I||C[0]!=I[0]:I)?C&&0==C[0]||!I?0*R:R/0:NaN);for(_=(v=new Y(R)).c=[],R=a+(d=n.e-i.e)+1,l||(l=u,d=p(n.e/c)-p(i.e/c),R=R/c|0),h=0;I[h]==(C[h]||0);h++);if(I[h]>(C[h]||0)&&d--,R<0)_.push(1),m=!0;else{for(x=C.length,O=I.length,h=0,R+=2,(y=o(l/(I[0]+1)))>1&&(I=e(I,y,l),C=e(C,y,l),O=I.length,x=C.length),T=O,E=(S=C.slice(0,O)).length;E=l/2&&A++;do{if(y=0,(f=t(I,S,O,E))<0){if(w=S[0],O!=E&&(w=w*l+(S[1]||0)),(y=o(w/A))>1)for(y>=l&&(y=l-1),b=(g=e(I,y,l)).length,E=S.length;1==t(g,S,b,E);)y--,r(g,Ot(I,S,O,E);)y++,r(S,O=10;R/=10,h++);G(v,a+(v.e=h+d*c-1)+1,s,m)}else v.e=d,v.r=+m;return v}}(),x=/^(-?)0([xbo])(?=\w[\w.]*$)/i,A=/^([^.]+)\.$/,O=/^\.([^.]+)$/,M=/^-?(Infinity|NaN)$/,R=/^\s*\+(?=[\w.])|^\s+|\s+$/g,E=function(e,t,r,n){var i,o=r?t:t.replace(R,"");if(M.test(o))e.s=isNaN(o)?null:o<0?-1:1;else{if(!r&&(o=o.replace(x,function(e,t,r){return i="x"==(r=r.toLowerCase())?16:"b"==r?2:8,n&&n!=i?e:t}),n&&(i=n,o=o.replace(A,"$1").replace(O,"0.$1")),t!=o))return new Y(o,i);if(Y.DEBUG)throw Error(a+"Not a"+(n?" base "+n:"")+" number: "+t);e.s=null}e.c=e.e=null},C.absoluteValue=C.abs=function(){var e=new Y(this);return e.s<0&&(e.s=1),e},C.comparedTo=function(e,t){return y(this,new Y(e,t))},C.decimalPlaces=C.dp=function(e,t){var r,n,i,o=this;if(null!=e)return g(e,0,h),null==t?t=P:g(t,0,8),G(new Y(o),e+o.e+1,t);if(!(r=o.c))return null;if(n=((i=r.length-1)-p(this.e/c))*c,i=r[i])for(;i%10==0;i/=10,n--);return n<0&&(n=0),n},C.dividedBy=C.div=function(e,t){return r(this,new Y(e,t),N,P)},C.dividedToIntegerBy=C.idiv=function(e,t){return r(this,new Y(e,t),0,1)},C.exponentiatedBy=C.pow=function(e,t){var r,n,s,u,l,f,d,h,p=this;if((e=new Y(e)).c&&!e.isInteger())throw Error(a+"Exponent not an integer: "+Z(e));if(null!=t&&(t=new Y(t)),l=e.e>14,!p.c||!p.c[0]||1==p.c[0]&&!p.e&&1==p.c.length||!e.c||!e.c[0])return h=new Y(Math.pow(+Z(p),l?e.s*(2-b(e)):+Z(e))),t?h.mod(t):h;if(f=e.s<0,t){if(t.c?!t.c[0]:!t.s)return new Y(NaN);(n=!f&&p.isInteger()&&t.isInteger())&&(p=p.mod(t))}else{if(e.e>9&&(p.e>0||p.e<-1||(0==p.e?p.c[0]>1||l&&p.c[1]>=24e7:p.c[0]<8e13||l&&p.c[0]<=9999975e7)))return u=p.s<0&&b(e)?-0:0,p.e>-1&&(u=1/u),new Y(f?1/u:u);F&&(u=i(F/c+2))}for(l?(r=new Y(.5),f&&(e.s=1),d=b(e)):d=(s=Math.abs(+Z(e)))%2,h=new Y(I);;){if(d){if(!(h=h.times(p)).c)break;u?h.c.length>u&&(h.c.length=u):n&&(h=h.mod(t))}if(s){if(0===(s=o(s/2)))break;d=s%2}else if(G(e=e.times(r),e.e+1,1),e.e>14)d=b(e);else{if(0==(s=+Z(e)))break;d=s%2}p=p.times(p),u?p.c&&p.c.length>u&&(p.c.length=u):n&&(p=p.mod(t))}return n?h:(f&&(h=I.div(h)),t?h.mod(t):u?G(h,F,P,void 0):h)},C.integerValue=function(e){var t=new Y(this);return null==e?e=P:g(e,0,8),G(t,t.e+1,e)},C.isEqualTo=C.eq=function(e,t){return 0===y(this,new Y(e,t))},C.isFinite=function(){return!!this.c},C.isGreaterThan=C.gt=function(e,t){return y(this,new Y(e,t))>0},C.isGreaterThanOrEqualTo=C.gte=function(e,t){return 1===(t=y(this,new Y(e,t)))||0===t},C.isInteger=function(){return!!this.c&&p(this.e/c)>this.c.length-2},C.isLessThan=C.lt=function(e,t){return 0>y(this,new Y(e,t))},C.isLessThanOrEqualTo=C.lte=function(e,t){return -1===(t=y(this,new Y(e,t)))||0===t},C.isNaN=function(){return!this.s},C.isNegative=function(){return this.s<0},C.isPositive=function(){return this.s>0},C.isZero=function(){return!!this.c&&0==this.c[0]},C.minus=function(e,t){var r,n,i,o,a=this,s=a.s;if(t=(e=new Y(e,t)).s,!s||!t)return new Y(NaN);if(s!=t)return e.s=-t,a.plus(e);var l=a.e/c,f=e.e/c,d=a.c,h=e.c;if(!l||!f){if(!d||!h)return d?(e.s=-t,e):new Y(h?a:NaN);if(!d[0]||!h[0])return h[0]?(e.s=-t,e):new Y(d[0]?a:3==P?-0:0)}if(l=p(l),f=p(f),d=d.slice(),s=l-f){for((o=s<0)?(s=-s,i=d):(f=l,i=h),i.reverse(),t=s;t--;i.push(0));i.reverse()}else for(n=(o=(s=d.length)<(t=h.length))?s:t,s=t=0;t0)for(;t--;d[r++]=0);for(t=u-1;n>s;){if(d[--n]=0;){for(r=0,y=w[i]%_,g=w[i]/_|0,o=i+(a=l);o>i;)r=((f=y*(f=E[--a]%_)+(s=g*f+(h=E[a]/_|0)*y)%_*_+b[o]+r)/v|0)+(s/_|0)+g*h,b[o--]=f%v;b[o]=r}return r?++n:b.splice(0,1),W(e,b,n)},C.negated=function(){var e=new Y(this);return e.s=-e.s||null,e},C.plus=function(e,t){var r,n=this,i=n.s;if(t=(e=new Y(e,t)).s,!i||!t)return new Y(NaN);if(i!=t)return e.s=-t,n.minus(e);var o=n.e/c,a=e.e/c,s=n.c,l=e.c;if(!o||!a){if(!s||!l)return new Y(i/0);if(!s[0]||!l[0])return l[0]?e:new Y(s[0]?n:0*i)}if(o=p(o),a=p(a),s=s.slice(),i=o-a){for(i>0?(a=o,r=l):(i=-i,r=s),r.reverse();i--;r.push(0));r.reverse()}for((i=s.length)-(t=l.length)<0&&(r=l,l=s,s=r,t=i),i=0;t;)i=(s[--t]=s[t]+l[t]+i)/u|0,s[t]=u===s[t]?0:s[t]%u;return i&&(s=[i].concat(s),++a),W(e,s,a)},C.precision=C.sd=function(e,t){var r,n,i,o=this;if(null!=e&&!!e!==e)return g(e,1,h),null==t?t=P:g(t,0,8),G(new Y(o),e,t);if(!(r=o.c))return null;if(n=(i=r.length-1)*c+1,i=r[i]){for(;i%10==0;i/=10,n--);for(i=r[0];i>=10;i/=10,n++);}return e&&o.e+1>n&&(n=o.e+1),n},C.shiftedBy=function(e){return g(e,-0x1fffffffffffff,l),this.times("1e"+e)},C.squareRoot=C.sqrt=function(){var e,t,n,i,o,a=this,s=a.c,u=a.s,c=a.e,l=N+4,f=new Y("0.5");if(1!==u||!s||!s[0])return new Y(!u||u<0&&(!s||s[0])?NaN:s?a:1/0);if(0==(u=Math.sqrt(+Z(a)))||u==1/0?(((t=m(s)).length+c)%2==0&&(t+="0"),u=Math.sqrt(+t),c=p((c+1)/2)-(c<0||c%2),n=new Y(t=u==1/0?"5e"+c:(t=u.toExponential()).slice(0,t.indexOf("e")+1)+c)):n=new Y(u+""),n.c[0]){for((u=(c=n.e)+l)<3&&(u=0);;)if(o=n,n=f.times(o.plus(r(a,o,l,1))),m(o.c).slice(0,u)===(t=m(n.c)).slice(0,u)){if(n.e0&&m>0){for(o=m%u||u,f=p.substr(0,o);o0&&(f+=l+p.slice(o)),h&&(f="-"+f)}n=d?f+(r.decimalSeparator||"")+((c=+r.fractionGroupSize)?d.replace(RegExp("\\d{"+c+"}\\B","g"),"$&"+(r.fractionGroupSeparator||"")):d):f}return(r.prefix||"")+n+(r.suffix||"")},C.toFraction=function(e){var t,n,i,o,s,u,l,d,h,p,y,g,b=this,v=b.c;if(null!=e&&(!(l=new Y(e)).isInteger()&&(l.c||1!==l.s)||l.lt(I)))throw Error(a+"Argument "+(l.isInteger()?"out of range: ":"not an integer: ")+Z(l));if(!v)return new Y(b);for(t=new Y(I),h=n=new Y(I),i=d=new Y(I),g=m(v),s=t.e=g.length-b.e-1,t.c[0]=f[(u=s%c)<0?c+u:u],e=!e||l.comparedTo(t)>0?s>0?t:h:l,u=j,j=1/0,l=new Y(g),d.c[0]=0;p=r(l,t,0,1),1!=(o=n.plus(p.times(i))).comparedTo(e);)n=i,i=o,h=d.plus(p.times(o=h)),d=o,t=l.minus(p.times(o=t)),l=o;return o=r(e.minus(n),i,0,1),d=d.plus(o.times(h)),n=n.plus(o.times(i)),d.s=h.s=b.s,y=1>r(h,i,s*=2,P).minus(b).abs().comparedTo(r(d,n,s,P).minus(b).abs())?[h,i]:[d,n],j=u,y},C.toNumber=function(){return+Z(this)},C.toPrecision=function(e,t){return null!=e&&g(e,1,h),q(this,e,t,2)},C.toString=function(e){var t,r=this,n=r.s,i=r.e;return null===i?n?(t="Infinity",n<0&&(t="-"+t)):t="NaN":(null==e?t=i<=k||i>=D?v(m(r.c),i):_(m(r.c),i,"0"):10===e&&V?t=_(m((r=G(new Y(r),N+i+1,P)).c),r.e,"0"):(g(e,2,$.length,"Base"),t=S(_(m(r.c),i,"0"),10,e,n,!0)),n<0&&r.c[0]&&(t="-"+t)),t},C.valueOf=C.toJSON=function(){return Z(this)},C._isBigNumber=!0,null!=t&&Y.set(t),Y}()).default=r.BigNumber=r,e.exports?e.exports=r:(t||(t="u">typeof self&&self?self:window),t.BigNumber=r)}(i)}(b);var v=b.exports;let _=y(),S=d(),E=m,w=v,T={trillion:1e12,billion:1e9,million:1e6,thousand:1e3},x={totalLength:0,characteristic:0,forceAverage:!1,average:!1,mantissa:-1,optionalMantissa:!0,thousandSeparated:!1,spaceSeparated:!1,negative:"sign",forceSign:!1,roundingFunction:Math.round,spaceSeparatedAbbreviation:!1},{binarySuffixes:A,decimalSuffixes:O}=_.currentBytes(),M={scale:1024,suffixes:O,marker:"bd"},R={scale:1024,suffixes:A,marker:"b"},C={scale:1e3,suffixes:O,marker:"d"};function I(e,t={},r){if("string"==typeof t&&(t=E.parseFormat(t)),!S.validateFormat(t))return"ERROR: invalid format";let n=t.prefix||"",i=t.postfix||"",o=function(e,t,r){switch(t.output){case"currency":return function(e,t,r){let n=r.currentCurrency(),i,o=Object.assign({},t),a=Object.assign({},x,o),s="",u=!!a.totalLength||!!a.forceAverage||a.average,c=o.currencyPosition||n.position,l=o.currencySymbol||n.symbol,f=void 0!==a.spaceSeparatedCurrency?a.spaceSeparatedCurrency:a.spaceSeparated;void 0===o.lowPrecision&&(o.lowPrecision=!1),f&&(s=" "),"infix"===c&&(i=s+l+s);let d=D({instance:e,providedFormat:o,state:r,decimalSeparator:i});return"prefix"===c&&(d=e._value<0&&"sign"===a.negative?`-${s}${l}${d.slice(1)}`:e._value>0&&a.forceSign?`+${s}${l}${d.slice(1)}`:l+s+d),c&&"postfix"!==c||(d=d+(s=!a.spaceSeparatedAbbreviation&&u?"":s)+l),d}(e,t=L(t,_.currentCurrencyDefaultFormat()),_);case"percent":return function(e,t,r,n){let i=t.prefixSymbol,o=D({instance:n(100*e._value),providedFormat:t,state:r}),a=Object.assign({},x,t);return i?`%${a.spaceSeparated?" ":""}${o}`:`${o}${a.spaceSeparated?" ":""}%`}(e,t=L(t,_.currentPercentageDefaultFormat()),_,r);case"byte":return function(e,t,r,n){let i=t.base||"binary",o=Object.assign({},x,t),{binarySuffixes:a,decimalSuffixes:s}=r.currentBytes(),u={general:{scale:1024,suffixes:s||O,marker:"bd"},binary:{scale:1024,suffixes:a||A,marker:"b"},decimal:{scale:1e3,suffixes:s||O,marker:"d"}}[i],{value:c,suffix:l}=N(e._value,u.suffixes,u.scale),f=D({instance:n(c),providedFormat:t,state:r,defaults:r.currentByteDefaultFormat()});return`${f}${o.spaceSeparated?" ":""}${l}`}(e,t=L(t,_.currentByteDefaultFormat()),_,r);case"time":return t=L(t,_.currentTimeDefaultFormat()),function(e){let t=Math.floor(e._value/60/60),r=Math.floor((e._value-60*t*60)/60),n=Math.round(e._value-60*t*60-60*r);return`${t}:${r<10?"0":""}${r}:${n<10?"0":""}${n}`}(e);case"ordinal":return function(e,t,r){let n=r.currentOrdinal(),i=Object.assign({},x,t),o=D({instance:e,providedFormat:t,state:r}),a=n(e._value);return`${o}${i.spaceSeparated?" ":""}${a}`}(e,t=L(t,_.currentOrdinalDefaultFormat()),_);default:return D({instance:e,providedFormat:t,numbro:r})}}(e,t,r);return(o=n+o)+i}function N(e,t,r){let n=t[0],i=Math.abs(e);if(i>=r){for(let o=1;o=a&&i