PageSourceSearch

https://pro.coincap.io/static/js/1206.1f0d3ce7.chunk.js

js coincap.io collected 2026-09-24 15:25:58 UTC 716,209 bytes, 3 lines download raw bytes

1/*! For license information please see 1206.1f0d3ce7.chunk.js.LICENSE.txt */
2(self.webpackChunkmy_app=self.webpackChunkmy_app||[]).push([[1206],{26785:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=r(17053);function n(t,e,r){return void 0===e&&(e=new Uint8Array(2)),void 0===r&&(r=0),e[r+0]=t>>>8,e[r+1]=t>>>0,e}function s(t,e,r){return void 0===e&&(e=new Uint8Array(2)),void 0===r&&(r=0),e[r+0]=t>>>0,e[r+1]=t>>>8,e}function o(t,e){return void 0===e&&(e=0),t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3]}function a(t,e){return void 0===e&&(e=0),(t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3])>>>0}function c(t,e){return void 0===e&&(e=0),t[e+3]<<24|t[e+2]<<16|t[e+1]<<8|t[e]}function h(t,e){return void 0===e&&(e=0),(t[e+3]<<24|t[e+2]<<16|t[e+1]<<8|t[e])>>>0}function u(t,e,r){return void 0===e&&(e=new Uint8Array(4)),void 0===r&&(r=0),e[r+0]=t>>>24,e[r+1]=t>>>16,e[r+2]=t>>>8,e[r+3]=t>>>0,e}function f(t,e,r){return void 0===e&&(e=new Uint8Array(4)),void 0===r&&(r=0),e[r+0]=t>>>0,e[r+1]=t>>>8,e[r+2]=t>>>16,e[r+3]=t>>>24,e}function l(t,e,r){return void 0===e&&(e=new Uint8Array(8)),void 0===r&&(r=0),u(t/4294967296>>>0,e,r),u(t>>>0,e,r+4),e}function d(t,e,r){return void 0===e&&(e=new Uint8Array(8)),void 0===r&&(r=0),f(t>>>0,e,r),f(t/4294967296>>>0,e,r+4),e}e.readInt16BE=function(t,e){return void 0===e&&(e=0),(t[e+0]<<8|t[e+1])<<16>>16},e.readUint16BE=function(t,e){return void 0===e&&(e=0),(t[e+0]<<8|t[e+1])>>>0},e.readInt16LE=function(t,e){return void 0===e&&(e=0),(t[e+1]<<8|t[e])<<16>>16},e.readUint16LE=function(t,e){return void 0===e&&(e=0),(t[e+1]<<8|t[e])>>>0},e.writeUint16BE=n,e.writeInt16BE=n,e.writeUint16LE=s,e.writeInt16LE=s,e.readInt32BE=o,e.readUint32BE=a,e.readInt32LE=c,e.readUint32LE=h,e.writeUint32BE=u,e.writeInt32BE=u,e.writeUint32LE=f,e.writeInt32LE=f,e.readInt64BE=function(t,e){void 0===e&&(e=0);var r=o(t,e),i=o(t,e+4);return 4294967296*r+i-4294967296*(i>>31)},e.readUint64BE=function(t,e){return void 0===e&&(e=0),4294967296*a(t,e)+a(t,e+4)},e.readInt64LE=function(t,e){void 0===e&&(e=0);var r=c(t,e);return 4294967296*c(t,e+4)+r-4294967296*(r>>31)},e.readUint64LE=function(t,e){void 0===e&&(e=0);var r=h(t,e);return 4294967296*h(t,e+4)+r},e.writeUint64BE=l,e.writeInt64BE=l,e.writeUint64LE=d,e.writeInt64LE=d,e.readUintBE=function(t,e,r){if(void 0===r&&(r=0),t%8!==0)throw new Error("readUintBE supports only bitLengths divisible by 8");if(t/8>e.length-r)throw new Error("readUintBE: array is too short for the given b
2itLength");for(var i=0,n=1,s=t/8+r-1;s>=r;s--)i+=e[s]*n,n*=256;return i},e.readUintLE=function(t,e,r){if(void 0===r&&(r=0),t%8!==0)throw new Error("readUintLE supports only bitLengths divisible by 8");if(t/8>e.length-r)throw new Error("readUintLE: array is too short for the given bitLength");for(var i=0,n=1,s=r;s<r+t/8;s++)i+=e[s]*n,n*=256;return i},e.writeUintBE=function(t,e,r,n){if(void 0===r&&(r=new Uint8Array(t/8)),void 0===n&&(n=0),t%8!==0)throw new Error("writeUintBE supports only bitLengths divisible by 8");if(!i.isSafeInteger(e))throw new Error("writeUintBE value must be an integer");for(var s=1,o=t/8+n-1;o>=n;o--)r[o]=e/s&255,s*=256;return r},e.writeUintLE=function(t,e,r,n){if(void 0===r&&(r=new Uint8Array(t/8)),void 0===n&&(n=0),t%8!==0)throw new Error("writeUintLE supports only bitLengths divisible by 8");if(!i.isSafeInteger(e))throw new Error("writeUintLE value must be an integer");for(var s=1,o=n;o<n+t/8;o++)r[o]=e/s&255,s*=256;return r},e.readFloat32BE=function(t,e){return void 0===e&&(e=0),new DataView(t.buffer,t.byteOffset,t.byteLength).getFloat32(e)},e.readFloat32LE=function(t,e){return void 0===e&&(e=0),new DataView(t.buffer,t.byteOffset,t.byteLength).getFloat32(e,!0)},e.readFloat64BE=function(t,e){return void 0===e&&(e=0),new DataView(t.buffer,t.byteOffset,t.byteLength).getFloat64(e)},e.readFloat64LE=function(t,e){return void 0===e&&(e=0),new DataView(t.buffer,t.byteOffset,t.byteLength).getFloat64(e,!0)},e.writeFloat32BE=function(t,e,r){return void 0===e&&(e=new Uint8Array(4)),void 0===r&&(r=0),new DataView(e.buffer,e.byteOffset,e.byteLength).setFloat32(r,t),e},e.writeFloat32LE=function(t,e,r){return void 0===e&&(e=new Uint8Array(4)),void 0===r&&(r=0),new DataView(e.buffer,e.byteOffset,e.byteLength).setFloat32(r,t,!0),e},e.writeFloat64BE=function(t,e,r){return void 0===e&&(e=new Uint8Array(8)),void 0===r&&(r=0),new DataView(e.buffer,e.byteOffset,e.byteLength).setFloat64(r,t),e},e.writeFloat64LE=function(t,e,r){return void 0===e&&(e=new Uint8Array(8)),void 0===r&&(r=0),new DataView(e.buffer,e.byteOffset,e.byteLength).setFloat64(r,t,!0),e}},44491:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=r(26785),n=r(56537);function s(t,e,r){for(var n=1634760805,s=857760878,o=2036477234,a=1797285236,c=r[3]<<24|r[2]<<16|r[1]<<8|r[0],h=r[7]<<24|r[6]<<16|r[5]<<8|r[4],u=r[11]<<24|r[10]<<16|r[9]<<8|r[8],f=r[15]<<24|r[14]<<16|r[13]<<8|r[12],l=r[19]<<24|r[18]<<16|r[17]<<8|r[16],d=r[23]<<24|r[22]<<16|r[21]<<8|r[20],p=r[27]<<24|r[26]<<16|r[25]<<8|r[24],g=r[31]<<24|r[30]<<16|r[29]<<8|r[28],m=e[3]<<24|e[2]<<16|e[1]<<8|e[0],v=e[7]<<24|e[6]<<16|e[5]<<8|e[4],b=e[11]<<24|e[10]<<16|e[9]<<8|e[8],y=e[15]<<24|e[14]<<16|e[13]<<8|e[12],w=n,_=s,A=o,E=a,S=c,M=h,I=u,x=f,P=l,O=d,N=p,R=g,C=m,T=v,k=b,L=y,q=0;q<20;q+=2)S=(S^=P=P+(C=(C^=w=w+S|0)>>>16|C<<16)|0)>>>20|S<<12,M=(M^=O=O+(T=(T^=_=_+M|0)>>>16|T<<16)|0)>>>20|M<<12,I=(I^=N=N+(k=(k^=A=A+I|0)>>>16|k<<16)|0)>>>20|I<<12,x=(x^=R=R+(L=(L^=E=E+x|0)>>>16|L<<16)|0)>>>20|x<<12,I=(I^=N=N+(k=(k^=A=A+I|0)>>>24|k<<8)|0)>>>25|I<<7,x=(x^=R=R+(L=(L^=E=E+x|0)>>>24|L<<8)|0)>>>25|x<<7,M=(M^=O=O+(T=(T^=_=_+M|0)>>>24|T<<8)|0)>>>25|M<<7,S=(S^=P=P+(C=(C^=w=w+S|0)>>>24|C<<8)|0)>>>25|S<<7,M=(M^=N=N+(L=(L^=w=w+M|0)>>>16|L<<16)|0)>>>20|M<<12,I=(I^=R=R+(C=(C^=_=_+I|0)>>>16|C<<16)|0)>>>20|I<<12,x=(x^=P=P+(T=(T^=A=A+x|0)>>>16|T<<16)|0)>>>20|x<<12,S=(S^=O=O+(k=(k^=E=E+S|0)>>>16|k<<16)|0)>>>20|S<<12,x=(x^=P=P+(T=(T^=A=A+x|0)>>>24|T<<8)|0)>>>25|x<<7,S=(S^=O=O+(k=(k^=E=E+S|0)>>>24|k<<8)|0)>>>25|S<<7,I=(I^=R=R+(C=(C^=_=_+I|0)>>>24|C<<8)|0)>>>25|I<<7,M=(M^=N=N+(L=(L^=w=w+M|0)>>>24|L<<8)|0)>>>25|M<<7;i.writeUint32LE(w+n|0,t,0),i.writeUint32LE(_+s|0,t,4),i.writeUint32LE(A+o|0,t,8),i.writeUint32LE(E+a|0,t,12),i.writeUint32LE(S+c|0,t,16),i.writeUint32LE(M+h|0,t,20),i.writeUint32LE(I+u|0,t,24),i.writeUint32LE(x+f|0,t,28),i.writeUint32LE(P+l|0,t,32),i.writeUint32LE(O+d|0,t,36),i.writeUint32LE(N+p|0,t,40),i.writeUint32LE(R+g|0,t,44),i.writeUint32LE(C+m|0,t,48),i.writeUint32LE(T+v|0,t,52),i.writeUint32LE(k+b|0,t,56),i.writeUint32LE(L+y|0,t,60)}function o(t,e,r,i,o){if(void 0===o&&(o=0),32!==t.length)throw new Error("ChaCha: key size must be 32 bytes");if(i.length<r.length)throw new Error("ChaCha: destination is shorter than source");var c,h;if(0===o){if(8!==e.length&&12!==e.length)throw new Error("ChaCha nonce must be 8 or 12 bytes");h=(c=new Uint8Array(16)).length-e.length,c.set(e,h)}else{if(16!==e.length)throw new Error("ChaCha nonce with counter must be 16 bytes");c=e,h=o}for(var u=new Uint8Array(64),f=0;f<r.length;f+=64){s(u,c,t);for(var l=f;l<f+64&&l<r.length;l++)i[l]=r[l]^u[l-f];a(c,0,h)}return n.wipe(u),0===o&&n.wipe(c),i}function a(t,e,r){for(var i=1;r--;)i=i+(255&t[e])|0,t[e]=255&i,i>>>=8,e++;
2if(i>0)throw new Error("ChaCha: counter overflow")}e.streamXOR=o,e.stream=function(t,e,r,i){return void 0===i&&(i=0),n.wipe(r),o(t,e,r,r,i)}},58953:(t,e,r)=>{"use strict";var i=r(44491),n=r(56657),s=r(56537),o=r(26785),a=r(60825);e.J4=32,e.PX=12,e.iW=16;var c=new Uint8Array(16),h=function(){function t(t){if(this.nonceLength=e.PX,this.tagLength=e.iW,t.length!==e.J4)throw new Error("ChaCha20Poly1305 needs 32-byte key");this._key=new Uint8Array(t)}return t.prototype.seal=function(t,e,r,n){if(t.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");var o=new Uint8Array(16);o.set(t,o.length-t.length);var a=new Uint8Array(32);i.stream(this._key,o,a,4);var c,h=e.length+this.tagLength;if(n){if(n.length!==h)throw new Error("ChaCha20Poly1305: incorrect destination length");c=n}else c=new Uint8Array(h);return i.streamXOR(this._key,o,e,c,4),this._authenticate(c.subarray(c.length-this.tagLength,c.length),a,c.subarray(0,c.length-this.tagLength),r),s.wipe(o),c},t.prototype.open=function(t,e,r,n){if(t.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");if(e.length<this.tagLength)return null;var o=new Uint8Array(16);o.set(t,o.length-t.length);var c=new Uint8Array(32);i.stream(this._key,o,c,4);var h=new Uint8Array(this.tagLength);if(this._authenticate(h,c,e.subarray(0,e.length-this.tagLength),r),!a.equal(h,e.subarray(e.length-this.tagLength,e.length)))return null;var u,f=e.length-this.tagLength;if(n){if(n.length!==f)throw new Error("ChaCha20Poly1305: incorrect destination length");u=n}else u=new Uint8Array(f);return i.streamXOR(this._key,o,e.subarray(0,e.length-this.tagLength),u,4),s.wipe(o),u},t.prototype.clean=function(){return s.wipe(this._key),this},t.prototype._authenticate=function(t,e,r,i){var a=new n.Poly1305(e);i&&(a.update(i),i.length%16>0&&a.update(c.subarray(i.length%16))),a.update(r),r.length%16>0&&a.update(c.subarray(r.length%16));var h=new Uint8Array(8);i&&o.writeUint64LE(i.length,h),a.update(h),o.writeUint64LE(r.length,h),a.update(h);for(var u=a.digest(),f=0;f<u.length;f++)t[f]=u[f];a.clean(),s.wipe(u),s.wipe(h)},t}();e.g6=h},60825:(t,e)=>{"use strict";function r(t,e){if(t.length!==e.length)return 0;for(var r=0,i=0;i<t.length;i++)r|=t[i]^e[i];return 1&r-1>>>8}Object.defineProperty(e,"__esModule",{value:!0}),e.select=function(t,e,r){return~(t-1)&e|t-1&r},e.lessOrEqual=function(t,e){return(0|t)-(0|e)-1>>>31&1},e.compare=r,e.equal=function(t,e){return 0!==t.length&&0!==e.length&&0!==r(t,e)}},43045:(t,e,r)=>{"use strict";e._S=e.K=e.TP=e.wE=e.Ee=void 0;const i=r(95473),n=r(70251),s=r(56537);function o(t){const e=new Float64Array(16);if(t)for(let r=0;r<t.length;r++)e[r]=t[r];return e}e.Ee=64,e.wE=64,e.TP=32;new Uint8Array(32)[0]=9;const a=o(),c=o([1]),h=o([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),u=o([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),f=o([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),l=o([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),d=o([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function p(t,e){for(let r=0;r<16;r++)t[r]=0|e[r]}function g(t){let e=1;for(let r=0;r<16;r++){let i=t[r]+e+65535;e=Math.floor(i/65536),t[r]=i-65536*e}t[0]+=e-1+37*(e-1)}function m(t,e,r){const i=~(r-1);for(let n=0;n<16;n++){const r=i&(t[n]^e[n]);t[n]^=r,e[n]^=r}}function v(t,e){const r=o(),i=o();for(let n=0;n<16;n++)i[n]=e[n];g(i),g(i),g(i);for(let n=0;n<2;n++){r[0]=i[0]-65517;for(let e=1;e<15;e++)r[e]=i[e]-65535-(r[e-1]>>16&1),r[e-1]&=65535;r[15]=i[15]-32767-(r[14]>>16&1);const t=r[15]>>16&1;r[14]&=65535,m(i,r,1-t)}for(let n=0;n<16;n++)t[2*n]=255&i[n],t[2*n+1]=i[n]>>8}function b(t,e){let r=0;for(let i=0;i<32;i++)r|=t[i]^e[i];return(1&r-1>>>8)-1}function y(t,e){const r=new Uint8Array(32),i=new Uint8Array(32);return v(r,t),v(i,e),b(r,i)}function w(t){const e=new Uint8Array(32);return v(e,t),1&e[0]}function _(t,e,r){for(let i=0;i<16;i++)t[i]=e[i]+r[i]}function A(t,e,r){for(let i=0;i<16;i++)t[i]=e[i]-r[i]}function E(t,e,r){let i,n,s=0,o=0,a=0,c=0,h=0,u=0,f=0,l=0,d=0,p=0,g=0,m=0,v=0,b=0,y=0,w=0,_=0,A=0,E=0,S=0,M=0,I=0,x=0,P=0,O=0,N=0,R=0,C=0,T=0,k=0,L=0,q=r[0],D=r[1],U=r[2],B=r[3],j=r[4],z=r[5],F=r[6],H=r[7],K=r[8],V=r[9],W=r[10],G=r[11],J=r[12],Y=r[13],Q=r[14],X=r[15];i=e[0],s+=i*q,o+=i*D,a+=i*U,c+=i*B,h+=i*j,u+=i*z,f+=i*F,l+=i*H,d+=i*K,p+=i*V,g+=i*W,m+=i*G,v+=i*J,b+=i*Y,y+=i*Q,w+=i*X,i=e[1],o+=i*q,a+=i*D,c+=i*U,h+=i*B,u+=i*j,f+=i*z,l+=i*F,d+=i*H,p+=i*K,g+=i*V,m+=i*W,v+=i*G,b+=i*J,
2y+=i*Y,w+=i*Q,_+=i*X,i=e[2],a+=i*q,c+=i*D,h+=i*U,u+=i*B,f+=i*j,l+=i*z,d+=i*F,p+=i*H,g+=i*K,m+=i*V,v+=i*W,b+=i*G,y+=i*J,w+=i*Y,_+=i*Q,A+=i*X,i=e[3],c+=i*q,h+=i*D,u+=i*U,f+=i*B,l+=i*j,d+=i*z,p+=i*F,g+=i*H,m+=i*K,v+=i*V,b+=i*W,y+=i*G,w+=i*J,_+=i*Y,A+=i*Q,E+=i*X,i=e[4],h+=i*q,u+=i*D,f+=i*U,l+=i*B,d+=i*j,p+=i*z,g+=i*F,m+=i*H,v+=i*K,b+=i*V,y+=i*W,w+=i*G,_+=i*J,A+=i*Y,E+=i*Q,S+=i*X,i=e[5],u+=i*q,f+=i*D,l+=i*U,d+=i*B,p+=i*j,g+=i*z,m+=i*F,v+=i*H,b+=i*K,y+=i*V,w+=i*W,_+=i*G,A+=i*J,E+=i*Y,S+=i*Q,M+=i*X,i=e[6],f+=i*q,l+=i*D,d+=i*U,p+=i*B,g+=i*j,m+=i*z,v+=i*F,b+=i*H,y+=i*K,w+=i*V,_+=i*W,A+=i*G,E+=i*J,S+=i*Y,M+=i*Q,I+=i*X,i=e[7],l+=i*q,d+=i*D,p+=i*U,g+=i*B,m+=i*j,v+=i*z,b+=i*F,y+=i*H,w+=i*K,_+=i*V,A+=i*W,E+=i*G,S+=i*J,M+=i*Y,I+=i*Q,x+=i*X,i=e[8],d+=i*q,p+=i*D,g+=i*U,m+=i*B,v+=i*j,b+=i*z,y+=i*F,w+=i*H,_+=i*K,A+=i*V,E+=i*W,S+=i*G,M+=i*J,I+=i*Y,x+=i*Q,P+=i*X,i=e[9],p+=i*q,g+=i*D,m+=i*U,v+=i*B,b+=i*j,y+=i*z,w+=i*F,_+=i*H,A+=i*K,E+=i*V,S+=i*W,M+=i*G,I+=i*J,x+=i*Y,P+=i*Q,O+=i*X,i=e[10],g+=i*q,m+=i*D,v+=i*U,b+=i*B,y+=i*j,w+=i*z,_+=i*F,A+=i*H,E+=i*K,S+=i*V,M+=i*W,I+=i*G,x+=i*J,P+=i*Y,O+=i*Q,N+=i*X,i=e[11],m+=i*q,v+=i*D,b+=i*U,y+=i*B,w+=i*j,_+=i*z,A+=i*F,E+=i*H,S+=i*K,M+=i*V,I+=i*W,x+=i*G,P+=i*J,O+=i*Y,N+=i*Q,R+=i*X,i=e[12],v+=i*q,b+=i*D,y+=i*U,w+=i*B,_+=i*j,A+=i*z,E+=i*F,S+=i*H,M+=i*K,I+=i*V,x+=i*W,P+=i*G,O+=i*J,N+=i*Y,R+=i*Q,C+=i*X,i=e[13],b+=i*q,y+=i*D,w+=i*U,_+=i*B,A+=i*j,E+=i*z,S+=i*F,M+=i*H,I+=i*K,x+=i*V,P+=i*W,O+=i*G,N+=i*J,R+=i*Y,C+=i*Q,T+=i*X,i=e[14],y+=i*q,w+=i*D,_+=i*U,A+=i*B,E+=i*j,S+=i*z,M+=i*F,I+=i*H,x+=i*K,P+=i*V,O+=i*W,N+=i*G,R+=i*J,C+=i*Y,T+=i*Q,k+=i*X,i=e[15],w+=i*q,_+=i*D,A+=i*U,E+=i*B,S+=i*j,M+=i*z,I+=i*F,x+=i*H,P+=i*K,O+=i*V,N+=i*W,R+=i*G,C+=i*J,T+=i*Y,k+=i*Q,L+=i*X,s+=38*_,o+=38*A,a+=38*E,c+=38*S,h+=38*M,u+=38*I,f+=38*x,l+=38*P,d+=38*O,p+=38*N,g+=38*R,m+=38*C,v+=38*T,b+=38*k,y+=38*L,n=1,i=s+n+65535,n=Math.floor(i/65536),s=i-65536*n,i=o+n+65535,n=Math.floor(i/65536),o=i-65536*n,i=a+n+65535,n=Math.floor(i/65536),a=i-65536*n,i=c+n+65535,n=Math.floor(i/65536),c=i-65536*n,i=h+n+65535,n=Math.floor(i/65536),h=i-65536*n,i=u+n+65535,n=Math.floor(i/65536),u=i-65536*n,i=f+n+65535,n=Math.floor(i/65536),f=i-65536*n,i=l+n+65535,n=Math.floor(i/65536),l=i-65536*n,i=d+n+65535,n=Math.floor(i/65536),d=i-65536*n,i=p+n+65535,n=Math.floor(i/65536),p=i-65536*n,i=g+n+65535,n=Math.floor(i/65536),g=i-65536*n,i=m+n+65535,n=Math.floor(i/65536),m=i-65536*n,i=v+n+65535,n=Math.floor(i/65536),v=i-65536*n,i=b+n+65535,n=Math.floor(i/65536),b=i-65536*n,i=y+n+65535,n=Math.floor(i/65536),y=i-65536*n,i=w+n+65535,n=Math.floor(i/65536),w=i-65536*n,s+=n-1+37*(n-1),n=1,i=s+n+65535,n=Math.floor(i/65536),s=i-65536*n,i=o+n+65535,n=Math.floor(i/65536),o=i-65536*n,i=a+n+65535,n=Math.floor(i/65536),a=i-65536*n,i=c+n+65535,n=Math.floor(i/65536),c=i-65536*n,i=h+n+65535,n=Math.floor(i/65536),h=i-65536*n,i=u+n+65535,n=Math.floor(i/65536),u=i-65536*n,i=f+n+65535,n=Math.floor(i/65536),f=i-65536*n,i=l+n+65535,n=Math.floor(i/65536),l=i-65536*n,i=d+n+65535,n=Math.floor(i/65536),d=i-65536*n,i=p+n+65535,n=Math.floor(i/65536),p=i-65536*n,i=g+n+65535,n=Math.floor(i/65536),g=i-65536*n,i=m+n+65535,n=Math.floor(i/65536),m=i-65536*n,i=v+n+65535,n=Math.floor(i/65536),v=i-65536*n,i=b+n+65535,n=Math.floor(i/65536),b=i-65536*n,i=y+n+65535,n=Math.floor(i/65536),y=i-65536*n,i=w+n+65535,n=Math.floor(i/65536),w=i-65536*n,s+=n-1+37*(n-1),t[0]=s,t[1]=o,t[2]=a,t[3]=c,t[4]=h,t[5]=u,t[6]=f,t[7]=l,t[8]=d,t[9]=p,t[10]=g,t[11]=m,t[12]=v,t[13]=b,t[14]=y,t[15]=w}function S(t,e){E(t,e,e)}function M(t,e){const r=o();let i;for(i=0;i<16;i++)r[i]=e[i];for(i=253;i>=0;i--)S(r,r),2!==i&&4!==i&&E(r,r,e);for(i=0;i<16;i++)t[i]=r[i]}function I(t,e){const r=o(),i=o(),n=o(),s=o(),a=o(),c=o(),h=o(),f=o(),l=o();A(r,t[1],t[0]),A(l,e[1],e[0]),E(r,r,l),_(i,t[0],t[1]),_(l,e[0],e[1]),E(i,i,l),E(n,t[3],e[3]),E(n,n,u),E(s,t[2],e[2]),_(s,s,s),A(a,i,r),A(c,s,n),_(h,s,n),_(f,i,r),E(t[0],a,c),E(t[1],f,h),E(t[2],h,c),E(t[3],a,f)}function x(t,e,r){for(let i=0;i<4;i++)m(t[i],e[i],r)}function P(t,e){const r=o(),i=o(),n=o();M(n,e[2]),E(r,e[0],n),E(i,e[1],n),v(t,i),t[31]^=w(r)<<7}function O(t,e,r){p(t[0],a),p(t[1],c),p(t[2],c),p(t[3],a);for(let i=255;i>=0;--i){const n=r[i/8|0]>>(7&i)&1;x(t,e,n),I(e,t),I(t,t),x(t,e,n)}}function N(t,e){const r=[o(),o(),o(),o()];p(r[0],f),p(r[1],l),p(r[2],c),E(r[3],f,l),O(t,r,e)}function R(t){if(t.length!==e.TP)throw new Error("ed25519: seed must be ".concat(e.TP," bytes"));const r=(0,n.hash)(t);r[0]&=248,r[31]&=127,r[31]|=64;const i=new Uint8Array(32),s=[o(),o(),o(),o()];N(s,r),P(i,s);const a=new Uint8Array(64);return a.set(t),a.set(i,32),{publicKey:i,secretKey:a}}e.K=R;const C=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function T(t,e){let r,i,n,s;for(i=63;i>=32;--i){for(r=0,n=i-32,s=i-12;n<s;++n)e[n]+=r-16*e[i]*C[n-(i-32)],r=Math.floor((e[n]+128)/256),e[n]-=256*r;e[n]+=r,e[i]=0}for(r=0,n=0;n<32;n++)e[n]+=r-(e[31]>>4)*C[n],r=e[n]>>8,e[n]&=255;for(n=0;n<32;n++)e[n]-=r*C[n];for(i=0;i<32;i++)e[i+1]+=e[i]>>8,t[i]=255&e[i]}function k(t){const e=new Float64Array(64);for(let r=0;r<64;r++)e[r]=t[r];for(let r=0;r<64;r++)t[r]=0;T(t,e)}function L(t,e){const r=o(),i=o(),n=o(),s=o(),u=o(),f=o(),l=o();return p(t[2],c),function(t,e){for(let r=0;r<16;r++)t[r]=e[2*r]+(e[2*r+1]<<8);t[15]&=32767}(t[1],e),S(n,t[1]),E(s,n,h),A(n,n,t[2]),_(s,t[2],s),S(u,s),S(f,u),E(l,f,u),E(r,l,n),E(r,r,s),function(t,e){const r=o();let i;for(i=0;i<16;i++)r[i]=e[i];for(i=250;i>=0;i--)S(r,r),1!==i&&E(r,r,e);for(i=0;i<16;i++)t[i]=r[i]}(r,r),E(r,r,n),E(r,r,s),E(r,r,s),E(t[0],r,s),S(i,t[0]),E(i,i,s),y(i,n)&&E(t[0],t[0],d),S(i,t[0]),E(i,i,s),y(i,n)?-1:(w(t[0])===e[31]>>7&&A(t[0],a,t[0]),E(t[3],t[0],t[1]),0)}e._S=function(t,e){const r=new Float64Array(64),i=[o(),o(),o(),o()],s=(0,n.hash)(t.subarray(0,32));s[0]&=248,s[31]&=127,s[31]|=64;const a=new Uint8Array(64);a.set(s.subarray(32),32);const c=new n.SHA512;c.update(a.subarray(32)),c.update(e);const h=c.digest();c.clean(),k(h),N(i,h),P(a,i),c.reset(),c.update(a.subarray(0,32)),c.update(t.subarray(32)),c.update(e);const u=c.digest();k(u);for(let n=0;n<32;n++)r[n]=h[n];for(let n=0;n<32;n++)for(let t=0;t<32;t++)r[n+t]+=u[n]*s[t];return T(a.subarray(32),r),a}},21348:(t,e)=>{"use strict";
2Object.defineProperty(e,"__esModule",{value:!0}),e.isSerializableHash=function(t){return"undefined"!==typeof t.saveState&&"undefined"!==typeof t.restoreState&&"undefined"!==typeof t.cleanSavedState}},10269:(t,e,r)=>{"use strict";var i=r(32553),n=r(56537),s=function(){function t(t,e,r,n){void 0===r&&(r=new Uint8Array(0)),this._counter=new Uint8Array(1),this._hash=t,this._info=n;var s=i.hmac(this._hash,r,e);this._hmac=new i.HMAC(t,s),this._buffer=new Uint8Array(this._hmac.digestLength),this._bufpos=this._buffer.length}return t.prototype._fillBuffer=function(){this._counter[0]++;var t=this._counter[0];if(0===t)throw new Error("hkdf: cannot expand more");this._hmac.reset(),t>1&&this._hmac.update(this._buffer),this._info&&this._hmac.update(this._info),this._hmac.update(this._counter),this._hmac.finish(this._buffer),this._bufpos=0},t.prototype.expand=function(t){for(var e=new Uint8Array(t),r=0;r<e.length;r++)this._bufpos===this._buffer.length&&this._fillBuffer(),e[r]=this._buffer[this._bufpos++];return e},t.prototype.clean=function(){this._hmac.clean(),n.wipe(this._buffer),n.wipe(this._counter),this._bufpos=0},t}();e.i=s},32553:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=r(21348),n=r(60825),s=r(56537),o=function(){function t(t,e){this._finished=!1,this._inner=new t,this._outer=new t,this.blockSize=this._outer.blockSize,this.digestLength=this._outer.digestLength;var r=new Uint8Array(this.blockSize);e.length>this.blockSize?this._inner.update(e).finish(r).clean():r.set(e);for(var n=0;n<r.length;n++)r[n]^=54;this._inner.update(r);for(n=0;n<r.length;n++)r[n]^=106;this._outer.update(r),i.isSerializableHash(this._inner)&&i.isSerializableHash(this._outer)&&(this._innerKeyedState=this._inner.saveState(),this._outerKeyedState=this._outer.saveState()),s.wipe(r)}return t.prototype.reset=function(){if(!i.isSerializableHash(this._inner)||!i.isSerializableHash(this._outer))throw new Error("hmac: can't reset() because hash doesn't implement restoreState()");return this._inner.restoreState(this._innerKeyedState),this._outer.restoreState(this._outerKeyedState),this._finished=!1,this},t.prototype.clean=function(){i.isSerializableHash(this._inner)&&this._inner.cleanSavedState(this._innerKeyedState),i.isSerializableHash(this._outer)&&this._outer.cleanSavedState(this._outerKeyedState),this._inner.clean(),this._outer.clean()},t.prototype.update=function(t){return this._inner.update(t),this},t.prototype.finish=function(t){return this._finished?(this._outer.finish(t),this):(this._inner.finish(t),this._outer.update(t.subarray(0,this.digestLength)).finish(t),this._finished=!0,this)},t.prototype.digest=function(){var t=new Uint8Array(this.digestLength);return this.finish(t),t},t.prototype.saveState=function(){if(!i.isSerializableHash(this._inner))throw new Error("hmac: can't saveState() because hash doesn't implement it");return this._inner.saveState()},t.prototype.restoreState=function(t){if(!i.isSerializableHash(this._inner)||!i.isSerializableHash(this._outer))throw new Error("hmac: can't restoreState() because hash doesn't implement it");return this._inner.restoreState(t),this._outer.restoreState(this._outerKeyedState),this._finished=!1,this},t.prototype.cleanSavedState=function(t){if(!i.isSerializableHash(this._inner))throw new Error("hmac: can't cleanSavedState() because hash doesn't implement it");this._inner.cleanSavedState(t)},t}();e.HMAC=o,e.hmac=function(t,e,r){var i=new o(t,e);i.update(r);var n=i.digest();return i.clean(),n},e.equal=n.equal},17053:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.mul=Math.imul||function(t,e){var r=65535&t,i=65535&e;return r*i+((t>>>16&65535)*i+r*(e>>>16&65535)<<16>>>0)|0},e.add=function(t,e){return t+e|0},e.sub=function(t,e){return t-e|0},e.rotl=function(t,e){return t<<e|t>>>32-e},e.rotr=function(t,e){return t<<32-e|t>>>e},e.isInteger=Number.isInteger||function(t){return"number"===typeof t&&isFinite(t)&&Math.floor(t)===t},e.MAX_SAFE_INTEGER=9007199254740991,e.isSafeInteger=function(t){return e.isInteger(t)&&t>=-e.MAX_SAFE_INTEGER&&t<=e.MAX_SAFE_INTEGER}},56657:(t,e,r)=>{"use strict";
2Object.defineProperty(e,"__esModule",{value:!0});var i=r(60825),n=r(56537);e.DIGEST_LENGTH=16;var s=function(){function t(t){this.digestLength=e.DIGEST_LENGTH,this._buffer=new Uint8Array(16),this._r=new Uint16Array(10),this._h=new Uint16Array(10),this._pad=new Uint16Array(8),this._leftover=0,this._fin=0,this._finished=!1;var r=t[0]|t[1]<<8;this._r[0]=8191&r;var i=t[2]|t[3]<<8;this._r[1]=8191&(r>>>13|i<<3);var n=t[4]|t[5]<<8;this._r[2]=7939&(i>>>10|n<<6);var s=t[6]|t[7]<<8;this._r[3]=8191&(n>>>7|s<<9);var o=t[8]|t[9]<<8;this._r[4]=255&(s>>>4|o<<12),this._r[5]=o>>>1&8190;var a=t[10]|t[11]<<8;this._r[6]=8191&(o>>>14|a<<2);var c=t[12]|t[13]<<8;this._r[7]=8065&(a>>>11|c<<5);var h=t[14]|t[15]<<8;this._r[8]=8191&(c>>>8|h<<8),this._r[9]=h>>>5&127,this._pad[0]=t[16]|t[17]<<8,this._pad[1]=t[18]|t[19]<<8,this._pad[2]=t[20]|t[21]<<8,this._pad[3]=t[22]|t[23]<<8,this._pad[4]=t[24]|t[25]<<8,this._pad[5]=t[26]|t[27]<<8,this._pad[6]=t[28]|t[29]<<8,this._pad[7]=t[30]|t[31]<<8}return t.prototype._blocks=function(t,e,r){for(var i=this._fin?0:2048,n=this._h[0],s=this._h[1],o=this._h[2],a=this._h[3],c=this._h[4],h=this._h[5],u=this._h[6],f=this._h[7],l=this._h[8],d=this._h[9],p=this._r[0],g=this._r[1],m=this._r[2],v=this._r[3],b=this._r[4],y=this._r[5],w=this._r[6],_=this._r[7],A=this._r[8],E=this._r[9];r>=16;){var S=t[e+0]|t[e+1]<<8;n+=8191&S;var M=t[e+2]|t[e+3]<<8;s+=8191&(S>>>13|M<<3);var I=t[e+4]|t[e+5]<<8;o+=8191&(M>>>10|I<<6);var x=t[e+6]|t[e+7]<<8;a+=8191&(I>>>7|x<<9);var P=t[e+8]|t[e+9]<<8;c+=8191&(x>>>4|P<<12),h+=P>>>1&8191;var O=t[e+10]|t[e+11]<<8;u+=8191&(P>>>14|O<<2);var N=t[e+12]|t[e+13]<<8;f+=8191&(O>>>11|N<<5);var R=t[e+14]|t[e+15]<<8,C=0,T=C;T+=n*p,T+=s*(5*E),T+=o*(5*A),T+=a*(5*_),C=(T+=c*(5*w))>>>13,T&=8191,T+=h*(5*y),T+=u*(5*b),T+=f*(5*v),T+=(l+=8191&(N>>>8|R<<8))*(5*m);var k=C+=(T+=(d+=R>>>5|i)*(5*g))>>>13;k+=n*g,k+=s*p,k+=o*(5*E),k+=a*(5*A),C=(k+=c*(5*_))>>>13,k&=8191,k+=h*(5*w),k+=u*(5*y),k+=f*(5*b),k+=l*(5*v),C+=(k+=d*(5*m))>>>13,k&=8191;var L=C;L+=n*m,L+=s*g,L+=o*p,L+=a*(5*E),C=(L+=c*(5*A))>>>13,L&=8191,L+=h*(5*_),L+=u*(5*w),L+=f*(5*y),L+=l*(5*b);var q=C+=(L+=d*(5*v))>>>13;q+=n*v,q+=s*m,q+=o*g,q+=a*p,C=(q+=c*(5*E))>>>13,q&=8191,q+=h*(5*A),q+=u*(5*_),q+=f*(5*w),q+=l*(5*y);var D=C+=(q+=d*(5*b))>>>13;D+=n*b,D+=s*v,D+=o*m,D+=a*g,C=(D+=c*p)>>>13,D&=8191,D+=h*(5*E),D+=u*(5*A),D+=f*(5*_),D+=l*(5*w);var U=C+=(D+=d*(5*y))>>>13;U+=n*y,U+=s*b,U+=o*v,U+=a*m,C=(U+=c*g)>>>13,U&=8191,U+=h*p,U+=u*(5*E),U+=f*(5*A),U+=l*(5*_);var B=C+=(U+=d*(5*w))>>>13;B+=n*w,B+=s*y,B+=o*b,B+=a*v,C=(B+=c*m)>>>13,B&=8191,B+=h*g,B+=u*p,B+=f*(5*E),B+=l*(5*A);var j=C+=(B+=d*(5*_))>>>13;j+=n*_,j+=s*w,j+=o*y,j+=a*b,C=(j+=c*v)>>>13,j&=8191,j+=h*m,j+=u*g,j+=f*p,j+=l*(5*E);var z=C+=(j+=d*(5*A))>>>13;z+=n*A,z+=s*_,z+=o*w,z+=a*y,C=(z+=c*b)>>>13,z&=8191,z+=h*v,z+=u*m,z+=f*g,z+=l*p;var F=C+=(z+=d*(5*E))>>>13;F+=n*E,F+=s*A,F+=o*_,F+=a*w,C=(F+=c*y)>>>13,F&=8191,F+=h*b,F+=u*v,F+=f*m,F+=l*g,n=T=8191&(C=(C=((C+=(F+=d*p)>>>13)<<2)+C|0)+(T&=8191)|0),s=k+=C>>>=13,o=L&=8191,a=q&=8191,c=D&=8191,h=U&=8191,u=B&=8191,f=j&=8191,l=z&=8191,d=F&=8191,e+=16,r-=16}this._h[0]=n,this._h[1]=s,this._h[2]=o,this._h[3]=a,this._h[4]=c,this._h[5]=h,this._h[6]=u,this._h[7]=f,this._h[8]=l,this._h[9]=d},t.prototype.finish=function(t,e){void 0===e&&(e=0);var r,i,n,s,o=new Uint16Array(10);if(this._leftover){for(s=this._leftover,this._buffer[s++]=1;s<16;s++)this._buffer[s]=0;this._fin=1,this._blocks(this._buffer,0,16)}for(r=this._h[1]>>>13,this._h[1]&=8191,s=2;s<10;s++)this._h[s]+=r,r=this._h[s]>>>13,this._h[s]&=8191;for(this._h[0]+=5*r,r=this._h[0]>>>13,this._h[0]&=8191,this._h[1]+=r,r=this._h[1]>>>13,this._h[1]&=8191,this._h[2]+=r,o[0]=this._h[0]+5,r=o[0]>>>13,o[0]&=8191,s=1;s<10;s++)o[s]=this._h[s]+r,r=o[s]>>>13,o[s]&=8191;for(o[9]-=8192,i=(1^r)-1,s=0;s<10;s++)o[s]&=i;for(i=~i,s=0;s<10;s++)this._h[s]=this._h[s]&i|o[s];for(this._h[0]=65535&(this._h[0]|this._h[1]<<13),this._h[1]=65535&(this._h[1]>>>3|this._h[2]<<10),this._h[2]=65535&(this._h[2]>>>6|this._h[3]<<7),this._h[3]=65535&(this._h[3]>>>9|this._h[4]<<4),this._h[4]=65535&(this._h[4]>>>12|this._h[5]<<1|this._h[6]<<14),this._h[5]=65535&(this._h[6]>>>2|this._h[7]<<11),this._h[6]=65535&(this._h[7]>>>5|this._h[8]<<8),this._h[7]=65535&(this._h[8]>>>8|this._h[9]<<5),n=this._h[0]+this._pad[0],this._h[0]=65535&n,s=1;s<8;s++)n=(this._h[s]+this._pad[s]|0)+(n>>>16)|0,this._h[s]=65535&n;return t[e+0]=this._h[0]>>>0,t[e+1]=this._h[0]>>>8,t[e+2]=this._h[1]>>>0,t[e+3]=this._h[1]>>>8,t[e+4]=this._h[2]>>>0,t[e+5]=this._h[2]>>>8,t[e+6]=this._h[3]>>>0,t[e+7]=this._h[3]>>>8,t[e+8]=this._h[4]>>>0,t[e+9]=this._h[4]>>>8,t[e+10]=this._h[5]>>>0,t[e+11]=this._h[5]>>>8,t[e+12]=this._h[6]>>>0,t[e+13]=this._h[6]>>>8,t[e+14]=this._h[7]>>>0,t[e+15]=this._h[7]>>>8,this._finished=!0,this},t.prototype.update=function(t){var e,r=0,i=t.length;if(this._leftover){(e=16-this._leftover)>i&&(e=i);for(var n=0;n<e;n++)this._buffer[this._leftover+n]=t[r+n];if(i-=e,r+=e,this._leftover+=e,this._leftover<16)return this;this._blocks(this._buffer,0,16),this._leftover=0}if(i>=16&&(e=i-i%16,this._blocks(t,r,e),r+=e,i-=e),i){for(n=0;n<i;n++)this._buffer[this._leftover+n]=t[r+n];this._leftover+=i}return this},t.prototype.digest=function(){if(this._finished)throw new Error("Poly1305 was finished");var t=new Uint8Array(16);return this.finish(t),t},t.prototype.clean=function(){return n.wipe(this._buffer),n.wipe(this._r),n.wipe(this._h),n.wipe(this._pad),this._leftover=0,this._fin=0,this._finished=!0,this},t}();e.Poly1305=s,e.oneTimeAuth=function(t,e){var r=new s(t);r.update(e);var i=r.digest();return r.clean(),i},e.equal=function(t,r){return t.length===e.DIGEST_LENGTH&&r.length===e.DIGEST_LENGTH&&i.equal(t,r)}},95473:(t,e,r)=>{"use strict";
2Object.defineProperty(e,"__esModule",{value:!0}),e.randomStringForEntropy=e.randomString=e.randomUint32=e.randomBytes=e.defaultRandomSource=void 0;const i=r(50015),n=r(26785),s=r(56537);function o(t){return(arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.defaultRandomSource).randomBytes(t)}e.defaultRandomSource=new i.SystemRandomSource,e.randomBytes=o,e.randomUint32=function(){const t=o(4,arguments.length>0&&void 0!==arguments[0]?arguments[0]:e.defaultRandomSource),r=(0,n.readUint32LE)(t);return(0,s.wipe)(t),r};const a="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";function c(t){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:a,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.defaultRandomSource;if(r.length<2)throw new Error("randomString charset is too short");if(r.length>256)throw new Error("randomString charset is too long");let n="";const c=r.length,h=256-256%c;for(;t>0;){const e=o(Math.ceil(256*t/h),i);for(let i=0;i<e.length&&t>0;i++){const s=e[i];s<h&&(n+=r.charAt(s%c),t--)}(0,s.wipe)(e)}return n}e.randomString=c,e.randomStringForEntropy=function(t){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:a,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.defaultRandomSource;return c(Math.ceil(t/(Math.log(r.length)/Math.LN2)),r,i)}},4968:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.BrowserRandomSource=void 0;e.BrowserRandomSource=class{constructor(){this.isAvailable=!1,this.isInstantiated=!1;const t="undefined"!==typeof self?self.crypto||self.msCrypto:null;t&&void 0!==t.getRandomValues&&(this._crypto=t,this.isAvailable=!0,this.isInstantiated=!0)}randomBytes(t){if(!this.isAvailable||!this._crypto)throw new Error("Browser random byte generator is not available.");const e=new Uint8Array(t);for(let r=0;r<e.length;r+=65536)this._crypto.getRandomValues(e.subarray(r,r+Math.min(e.length-r,65536)));return e}}},35786:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.NodeRandomSource=void 0;const i=r(56537);e.NodeRandomSource=class{constructor(){this.isAvailable=!1,this.isInstantiated=!1;{const t=r(99432);t&&t.randomBytes&&(this._crypto=t,this.isAvailable=!0,this.isInstantiated=!0)}}randomBytes(t){if(!this.isAvailable||!this._crypto)throw new Error("Node.js random byte generator is not available.");let e=this._crypto.randomBytes(t);if(e.length!==t)throw new Error("NodeRandomSource: got fewer bytes than requested");const r=new Uint8Array(t);for(let i=0;i<r.length;i++)r[i]=e[i];return(0,i.wipe)(e),r}}},50015:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SystemRandomSource=void 0;const i=r(4968),n=r(35786);e.SystemRandomSource=class{constructor(){return this.isAvailable=!1,this.name="",this._source=new i.BrowserRandomSource,this._source.isAvailable?(this.isAvailable=!0,void(this.name="Browser")):(this._source=new n.NodeRandomSource,this._source.isAvailable?(this.isAvailable=!0,void(this.name="Node")):void 0)}randomBytes(t){if(!this.isAvailable)throw new Error("System random byte generator is not available.");return this._source.randomBytes(t)}}},20153:(t,e,r)=>{"use strict";var i=r(26785),n=r(56537);e.On=32,e.cS=64;var s=function(){function t(){this.digestLength=e.On,this.blockSize=e.cS,this._state=new Int32Array(8),this._temp=new Int32Array(64),this._buffer=new Uint8Array(128),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this.reset()}return t.prototype._initState=function(){this._state[0]=1779033703,this._state[1]=3144134277,this._state[2]=1013904242,this._state[3]=2773480762,this._state[4]=1359893119,this._state[5]=2600822924,this._state[6]=528734635,this._state[7]=1541459225},t.prototype.reset=function(){return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this},t.prototype.clean=function(){n.wipe(this._buffer),n.wipe(this._temp),this.reset()},t.prototype.update=function(t,e){if(void 0===e&&(e=t.length),this._finished)throw new Error("SHA256: can't update because hash was finished.");var r=0;if(this._bytesHashed+=e,this._bufferLength>0){for(;this._bufferLength<this.blockSize&&e>0;)this._buffer[this._bufferLength++]=t[r++],e--;this._bufferLength===this.blockSize&&(a(this._temp,this._state,this._buffer,0,this.blockSize),this._bufferLength=0)}for(e>=this.blockSize&&(r=a(this._temp,this._state,t,r,e),e%=this.blockSize);e>0;)this._buffer[this._bufferLength++]=t[r++],e--;return this},t.prototype.finish=function(t){if(!this._finished){var e=this._bytesHashed,r=this._bufferLength,n=e/536870912|0,s=e<<3,o=e%64<56?64:128;this._buffer[r]=128;for(var c=r+1;c<o-8;c++)this._buffer[c]=0;i.writeUint32BE(n,this._buffer,o-8),i.writeUint32BE(s,this._buffer,o-4),a(this._temp,this._state,this._buffer,0,o),this._finished=!0}for(c=0;c<this.digestLength/4;c++)i.writeUint32BE(this._state[c],t,4*c);return this},t.prototype.digest=function(){var t=new Uint8Array(this.digestLength);return this.finish(t),t},t.prototype.saveState=function(){if(this._finished)throw new Error("SHA256: cannot save finished state");return{state:new Int32Array(this._state),buffer:this._bufferLength>0?new Uint8Array(this._buffer):void 0,bufferLength:this._bufferLength,bytesHashed:this._bytesHashed}},t.prototype.restoreState=function(t){return this._state.set(t.state),this._bufferLength=t.bufferLength,t.buffer&&this._buffer.set(t.buffer),this._bytesHashed=t.bytesHashed,this._finished=!1,this},t.prototype.cleanSavedState=function(t){n.wipe(t.state),t.buffer&&n.wipe(t.buffer),t.bufferLength=0,t.bytesHashed=0},t}();e.aD=s;var o=new Int32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756
2734187,3204031479,3329325298]);function a(t,e,r,n,s){for(;s>=64;){for(var a=e[0],c=e[1],h=e[2],u=e[3],f=e[4],l=e[5],d=e[6],p=e[7],g=0;g<16;g++){var m=n+4*g;t[g]=i.readUint32BE(r,m)}for(g=16;g<64;g++){var v=t[g-2],b=(v>>>17|v<<15)^(v>>>19|v<<13)^v>>>10,y=((v=t[g-15])>>>7|v<<25)^(v>>>18|v<<14)^v>>>3;t[g]=(b+t[g-7]|0)+(y+t[g-16]|0)}for(g=0;g<64;g++){b=(((f>>>6|f<<26)^(f>>>11|f<<21)^(f>>>25|f<<7))+(f&l^~f&d)|0)+(p+(o[g]+t[g]|0)|0)|0,y=((a>>>2|a<<30)^(a>>>13|a<<19)^(a>>>22|a<<10))+(a&c^a&h^c&h)|0;p=d,d=l,l=f,f=u+b|0,u=h,h=c,c=a,a=b+y|0}e[0]+=a,e[1]+=c,e[2]+=h,e[3]+=u,e[4]+=f,e[5]+=l,e[6]+=d,e[7]+=p,n+=64,s-=64}return n}e.tW=function(t){var e=new s;e.update(t);var r=e.digest();return e.clean(),r}},70251:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=r(26785),n=r(56537);e.DIGEST_LENGTH=64,e.BLOCK_SIZE=128;var s=function(){function t(){this.digestLength=e.DIGEST_LENGTH,this.blockSize=e.BLOCK_SIZE,this._stateHi=new Int32Array(8),this._stateLo=new Int32Array(8),this._tempHi=new Int32Array(16),this._tempLo=new Int32Array(16),this._buffer=new Uint8Array(256),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this.reset()}return t.prototype._initState=function(){this._stateHi[0]=1779033703,this._stateHi[1]=3144134277,this._stateHi[2]=1013904242,this._stateHi[3]=2773480762,this._stateHi[4]=1359893119,this._stateHi[5]=2600822924,this._stateHi[6]=528734635,this._stateHi[7]=1541459225,this._stateLo[0]=4089235720,this._stateLo[1]=2227873595,this._stateLo[2]=4271175723,this._stateLo[3]=1595750129,this._stateLo[4]=2917565137,this._stateLo[5]=725511199,this._stateLo[6]=4215389547,this._stateLo[7]=327033209},t.prototype.reset=function(){return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this},t.prototype.clean=function(){n.wipe(this._buffer),n.wipe(this._tempHi),n.wipe(this._tempLo),this.reset()},t.prototype.update=function(t,r){if(void 0===r&&(r=t.length),this._finished)throw new Error("SHA512: can't update because hash was finished.");var i=0;if(this._bytesHashed+=r,this._bufferLength>0){for(;this._bufferLength<e.BLOCK_SIZE&&r>0;)this._buffer[this._bufferLength++]=t[i++],r--;this._bufferLength===this.blockSize&&(a(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,this.blockSize),this._bufferLength=0)}for(r>=this.blockSize&&(i=a(this._tempHi,this._tempLo,this._stateHi,this._stateLo,t,i,r),r%=this.blockSize);r>0;)this._buffer[this._bufferLength++]=t[i++],r--;return this},t.prototype.finish=function(t){if(!this._finished){var e=this._bytesHashed,r=this._bufferLength,n=e/536870912|0,s=e<<3,o=e%128<112?128:256;this._buffer[r]=128;for(var c=r+1;c<o-8;c++)this._buffer[c]=0;i.writeUint32BE(n,this._buffer,o-8),i.writeUint32BE(s,this._buffer,o-4),a(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,o),this._finished=!0}for(c=0;c<this.digestLength/8;c++)i.writeUint32BE(this._stateHi[c],t,8*c),i.writeUint32BE(this._stateLo[c],t,8*c+4);return this},t.prototype.digest=function(){var t=new Uint8Array(this.digestLength);return this.finish(t),t},t.prototype.saveState=function(){if(this._finished)throw new Error("SHA256: cannot save finished state");return{stateHi:new Int32Array(this._stateHi),stateLo:new Int32Array(this._stateLo),buffer:this._bufferLength>0?new Uint8Array(this._buffer):void 0,bufferLength:this._bufferLength,bytesHashed:this._bytesHashed}},t.prototype.restoreState=function(t){return this._stateHi.set(t.stateHi),this._stateLo.set(t.stateLo),this._bufferLength=t.bufferLength,t.buffer&&this._buffer.set(t.buffer),this._bytesHashed=t.bytesHashed,this._finished=!1,this},t.prototype.cleanSavedState=function(t){n.wipe(t.stateHi),n.wipe(t.stateLo),t.buffer&&n.wipe(t.buffer),t.bufferLength=0,t.bytesHashed=0},t}();e.SHA512=s;var o=new Int32Array([1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,
21322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591]);function a(t,e,r,n,s,a,c){for(var h,u,f,l,d,p,g,m,v=r[0],b=r[1],y=r[2],w=r[3],_=r[4],A=r[5],E=r[6],S=r[7],M=n[0],I=n[1],x=n[2],P=n[3],O=n[4],N=n[5],R=n[6],C=n[7];c>=128;){for(var T=0;T<16;T++){var k=8*T+a;t[T]=i.readUint32BE(s,k),e[T]=i.readUint32BE(s,k+4)}for(T=0;T<80;T++){var L,q,D=v,U=b,B=y,j=w,z=_,F=A,H=E,K=M,V=I,W=x,G=P,J=O,Y=N,Q=R;if(d=65535&(u=C),p=u>>>16,g=65535&(h=S),m=h>>>16,d+=65535&(u=(O>>>14|_<<18)^(O>>>18|_<<14)^(_>>>9|O<<23)),p+=u>>>16,g+=65535&(h=(_>>>14|O<<18)^(_>>>18|O<<14)^(O>>>9|_<<23)),m+=h>>>16,d+=65535&(u=O&N^~O&R),p+=u>>>16,g+=65535&(h=_&A^~_&E),m+=h>>>16,h=o[2*T],d+=65535&(u=o[2*T+1]),p+=u>>>16,g+=65535&h,m+=h>>>16,h=t[T%16],p+=(u=e[T%16])>>>16,g+=65535&h,m+=h>>>16,g+=(p+=(d+=65535&u)>>>16)>>>16,d=65535&(u=l=65535&d|p<<16),p=u>>>16,g=65535&(h=f=65535&g|(m+=g>>>16)<<16),m=h>>>16,d+=65535&(u=(M>>>28|v<<4)^(v>>>2|M<<30)^(v>>>7|M<<25)),p+=u>>>16,g+=65535&(h=(v>>>28|M<<4)^(M>>>2|v<<30)^(M>>>7|v<<25)),m+=h>>>16,p+=(u=M&I^M&x^I&x)>>>16,g+=65535&(h=v&b^v&y^b&y),m+=h>>>16,L=65535&(g+=(p+=(d+=65535&u)>>>16)>>>16)|(m+=g>>>16)<<16,q=65535&d|p<<16,d=65535&(u=G),p=u>>>16,g=65535&(h=j),m=h>>>16,p+=(u=l)>>>16,g+=65535&(h=f),m+=h>>>16,b=D,y=U,w=B,_=j=65535&(g+=(p+=(d+=65535&u)>>>16)>>>16)|(m+=g>>>16)<<16,A=z,E=F,S=H,v=L,I=K,x=V,P=W,O=G=65535&d|p<<16,N=J,R=Y,C=Q,M=q,T%16===15)for(k=0;k<16;k++)h=t[k],d=65535&(u=e[k]),p=u>>>16,g=65535&h,m=h>>>16,h=t[(k+9)%16],d+=65535&(u=e[(k+9)%16]),p+=u>>>16,g+=65535&h,m+=h>>>16,f=t[(k+1)%16],d+=65535&(u=((l=e[(k+1)%16])>>>1|f<<31)^(l>>>8|f<<24)^(l>>>7|f<<25)),p+=u>>>16,g+=65535&(h=(f>>>1|l<<31)^(f>>>8|l<<24)^f>>>7),m+=h>>>16,f=t[(k+14)%16],p+=(u=((l=e[(k+14)%16])>>>19|f<<13)^(f>>>29|l<<3)^(l>>>6|f<<26))>>>16,g+=65535&(h=(f>>>19|l<<13)^(l>>>29|f<<3)^f>>>6),m+=h>>>16,m+=(g+=(p+=(d+=65535&u)>>>16)>>>16)>>>16,t[k]=65535&g|m<<16,e[k]=65535&d|p<<16}d=65535&(u=M),p=u>>>16,g=65535&(h=v),m=h>>>16,h=r[0],p+=(u=n[0])>>>16,g+=65535&h,m+=h>>>16,m+=(g+=(p+=(d+=65535&u)>>>16)>>>16)>>>16,r[0]=v=65535&g|m<<16,n[0]=M=65535&d|p<<16,d=65535&(u=I),p=u>>>16,g=65535&(h=b),m=h>>>16,h=r[1],p+=(u=n[1])>>>16,g+=65535&h,m+=h>>>16,m+=(g+=(p+=(d+=65535&u)>>>16)>>>16)>>>16,r[1]=b=65535&g|m<<16,n[1]=I=65535&d|p<<16,d=65535&(u=x),p=u>>>16,g=65535&(h=y),m=h>>>16,h=r[2],p+=(u=n[2])>>>16,g+=65535&h,m+=h>>>16,m+=(g+=(p+=(d+=65535&u)>>>16)>>>16)>>>16,r[2]=y=65535&g|m<<16,n[2]=x=65535&d|p<<16,d=65535&(u=P),p=u>>>16,g=65535&(h=w),m=h>>>16,h=r[3],p+=(u=n[3])>>>16,g+=65535&h,m+=h>>>16,m+=(g+=(p+=(d+=65535&u)>>>16)>>>16)>>>16,r[3]=w=65535&g|m<<16,n[3]=P=65535&d|p<<16,d=65535&(u=O),p=u>>>16,g=65535&(h=_),m=h>>>16,h=r[4],p+=(u=n[4])>>>16,g+=65535&h,m+=h>>>16,m+=(g+=(p+=(d+=65535&u)>>>16)>>>16)>>>16,r[4]=_=65535&g|m<<16,n[4]=O=65535&d|p<<16,d=65535&(u=N),p=u>>>16,g=65535&(h=A),m=h>>>16,h=r[5],p+=(u=n[5])>>>16,g+=65535&h,m+=h>>>16,m+=(g+=(p+=(d+=65535&u)>>>16)>>>16)>>>16,r[5]=A=65535&g|m<<16,n[5]=N=65535&d|p<<16,d=65535&(u=R),p=u>>>16,g=65535&(h=E),m=h>>>16,h=r[6],p+=(u=n[6])>>>16,g+=65535&h,m+=h>>>16,m+=(g+=(p+=(d+=65535&u)>>>16)>>>16)>>>16,r[6]=E=65535&g|m<<16,n[6]=R=65535&d|p<<16,d=65535&(u=C),p=u>>>16,g=65535&(h=S),m=h>>>16,h=r[7],p+=(u=n[7])>>>16,g+=65535&h,m+=h>>>16,m+=(g+=(p+=(d+=65535&u)>>>16)>>>16)>>>16,r[7]=S=65535&g|m<<16,n[7]=C=65535&d|p<<16,a+=128,c-=128}return a}e.hash=function(t){var e=new s;e.update(t);var r=e.digest();return e.clean(),r}},56537:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.wipe=function(t){for(var e=0;e<t.length;e++)t[e]=0;return t}},87887:(t,e,r)=>{"use strict";e.Tc=e.TZ=e.wE=e.Xx=void 0;const i=r(95473),n=r(56537);function s(t){const e=new Float64Array(16);if(t)for(let r=0;r<t.length;r++)e[r]=t[r];return e}e.Xx=32,e.wE=32;const o=new Uint8Array(32);o[0]=9;const a=s([56129,1]);function c(t){let e=1;for(let r=0;r<16;r++){let i=t[r]+e+65535;e=Math.floor(i/65536),t[r]=i-65536*e}t[0]+=e-1+37*(e-1)}function h(t,e,r){const i=~(r-1);for(let n=0;n<16;n++){const r=i&(t[n]^e[n]);t[n]^=r,e[n]^=r}}function u(t,e,r){for(let i=0;i<16;i++)t[i]=e[i]+r[i]}function f(t,e,r){for(let i=0;i<16;i++)t[i]=e[i]-r[i]}function l(t,e,r){let i,n,s=0,o=0,a=0,c=0,h=0,u=0,f=0,l=0,d=0,p=0,g=0,m=0,v=0,b=0,y=0,w=0,_=0,A=0,E=0,S=0,M=0,I=0,x=0,P=0,O=0,N=0,R=0,C=0,T=0,k=0,L=0,q=r[0],D=r[1],U=r[2],B=r[3],j=r[4],z=r[5],F=r[6],H=r[7],K=r[8],V=r[9],W=r[10],G=r[11],J=r[12],Y=r[13],Q=r[14],X=r[15];i=e[0],s+=i*q,o+=i*D,a+=i*U,c+=i*B,h+=i*j,u+=i*z,f+=i*F,l+=i*H,d+=i*K,p+=i*V,g+=i*W,m+=i*G,v+=i*J,b+=i*Y,y+=i*Q,w+=i*X,i=e[1],o+=i*q,a+=i*D,c+=i*U,h+=i*B,u+=i*j,f+=i*z,l+=i*F,d+=i*H,p+=i*K,g+=i*V,m+=i*W,v+=i*G,b+=i*J,
2y+=i*Y,w+=i*Q,_+=i*X,i=e[2],a+=i*q,c+=i*D,h+=i*U,u+=i*B,f+=i*j,l+=i*z,d+=i*F,p+=i*H,g+=i*K,m+=i*V,v+=i*W,b+=i*G,y+=i*J,w+=i*Y,_+=i*Q,A+=i*X,i=e[3],c+=i*q,h+=i*D,u+=i*U,f+=i*B,l+=i*j,d+=i*z,p+=i*F,g+=i*H,m+=i*K,v+=i*V,b+=i*W,y+=i*G,w+=i*J,_+=i*Y,A+=i*Q,E+=i*X,i=e[4],h+=i*q,u+=i*D,f+=i*U,l+=i*B,d+=i*j,p+=i*z,g+=i*F,m+=i*H,v+=i*K,b+=i*V,y+=i*W,w+=i*G,_+=i*J,A+=i*Y,E+=i*Q,S+=i*X,i=e[5],u+=i*q,f+=i*D,l+=i*U,d+=i*B,p+=i*j,g+=i*z,m+=i*F,v+=i*H,b+=i*K,y+=i*V,w+=i*W,_+=i*G,A+=i*J,E+=i*Y,S+=i*Q,M+=i*X,i=e[6],f+=i*q,l+=i*D,d+=i*U,p+=i*B,g+=i*j,m+=i*z,v+=i*F,b+=i*H,y+=i*K,w+=i*V,_+=i*W,A+=i*G,E+=i*J,S+=i*Y,M+=i*Q,I+=i*X,i=e[7],l+=i*q,d+=i*D,p+=i*U,g+=i*B,m+=i*j,v+=i*z,b+=i*F,y+=i*H,w+=i*K,_+=i*V,A+=i*W,E+=i*G,S+=i*J,M+=i*Y,I+=i*Q,x+=i*X,i=e[8],d+=i*q,p+=i*D,g+=i*U,m+=i*B,v+=i*j,b+=i*z,y+=i*F,w+=i*H,_+=i*K,A+=i*V,E+=i*W,S+=i*G,M+=i*J,I+=i*Y,x+=i*Q,P+=i*X,i=e[9],p+=i*q,g+=i*D,m+=i*U,v+=i*B,b+=i*j,y+=i*z,w+=i*F,_+=i*H,A+=i*K,E+=i*V,S+=i*W,M+=i*G,I+=i*J,x+=i*Y,P+=i*Q,O+=i*X,i=e[10],g+=i*q,m+=i*D,v+=i*U,b+=i*B,y+=i*j,w+=i*z,_+=i*F,A+=i*H,E+=i*K,S+=i*V,M+=i*W,I+=i*G,x+=i*J,P+=i*Y,O+=i*Q,N+=i*X,i=e[11],m+=i*q,v+=i*D,b+=i*U,y+=i*B,w+=i*j,_+=i*z,A+=i*F,E+=i*H,S+=i*K,M+=i*V,I+=i*W,x+=i*G,P+=i*J,O+=i*Y,N+=i*Q,R+=i*X,i=e[12],v+=i*q,b+=i*D,y+=i*U,w+=i*B,_+=i*j,A+=i*z,E+=i*F,S+=i*H,M+=i*K,I+=i*V,x+=i*W,P+=i*G,O+=i*J,N+=i*Y,R+=i*Q,C+=i*X,i=e[13],b+=i*q,y+=i*D,w+=i*U,_+=i*B,A+=i*j,E+=i*z,S+=i*F,M+=i*H,I+=i*K,x+=i*V,P+=i*W,O+=i*G,N+=i*J,R+=i*Y,C+=i*Q,T+=i*X,i=e[14],y+=i*q,w+=i*D,_+=i*U,A+=i*B,E+=i*j,S+=i*z,M+=i*F,I+=i*H,x+=i*K,P+=i*V,O+=i*W,N+=i*G,R+=i*J,C+=i*Y,T+=i*Q,k+=i*X,i=e[15],w+=i*q,_+=i*D,A+=i*U,E+=i*B,S+=i*j,M+=i*z,I+=i*F,x+=i*H,P+=i*K,O+=i*V,N+=i*W,R+=i*G,C+=i*J,T+=i*Y,k+=i*Q,L+=i*X,s+=38*_,o+=38*A,a+=38*E,c+=38*S,h+=38*M,u+=38*I,f+=38*x,l+=38*P,d+=38*O,p+=38*N,g+=38*R,m+=38*C,v+=38*T,b+=38*k,y+=38*L,n=1,i=s+n+65535,n=Math.floor(i/65536),s=i-65536*n,i=o+n+65535,n=Math.floor(i/65536),o=i-65536*n,i=a+n+65535,n=Math.floor(i/65536),a=i-65536*n,i=c+n+65535,n=Math.floor(i/65536),c=i-65536*n,i=h+n+65535,n=Math.floor(i/65536),h=i-65536*n,i=u+n+65535,n=Math.floor(i/65536),u=i-65536*n,i=f+n+65535,n=Math.floor(i/65536),f=i-65536*n,i=l+n+65535,n=Math.floor(i/65536),l=i-65536*n,i=d+n+65535,n=Math.floor(i/65536),d=i-65536*n,i=p+n+65535,n=Math.floor(i/65536),p=i-65536*n,i=g+n+65535,n=Math.floor(i/65536),g=i-65536*n,i=m+n+65535,n=Math.floor(i/65536),m=i-65536*n,i=v+n+65535,n=Math.floor(i/65536),v=i-65536*n,i=b+n+65535,n=Math.floor(i/65536),b=i-65536*n,i=y+n+65535,n=Math.floor(i/65536),y=i-65536*n,i=w+n+65535,n=Math.floor(i/65536),w=i-65536*n,s+=n-1+37*(n-1),n=1,i=s+n+65535,n=Math.floor(i/65536),s=i-65536*n,i=o+n+65535,n=Math.floor(i/65536),o=i-65536*n,i=a+n+65535,n=Math.floor(i/65536),a=i-65536*n,i=c+n+65535,n=Math.floor(i/65536),c=i-65536*n,i=h+n+65535,n=Math.floor(i/65536),h=i-65536*n,i=u+n+65535,n=Math.floor(i/65536),u=i-65536*n,i=f+n+65535,n=Math.floor(i/65536),f=i-65536*n,i=l+n+65535,n=Math.floor(i/65536),l=i-65536*n,i=d+n+65535,n=Math.floor(i/65536),d=i-65536*n,i=p+n+65535,n=Math.floor(i/65536),p=i-65536*n,i=g+n+65535,n=Math.floor(i/65536),g=i-65536*n,i=m+n+65535,n=Math.floor(i/65536),m=i-65536*n,i=v+n+65535,n=Math.floor(i/65536),v=i-65536*n,i=b+n+65535,n=Math.floor(i/65536),b=i-65536*n,i=y+n+65535,n=Math.floor(i/65536),y=i-65536*n,i=w+n+65535,n=Math.floor(i/65536),w=i-65536*n,s+=n-1+37*(n-1),t[0]=s,t[1]=o,t[2]=a,t[3]=c,t[4]=h,t[5]=u,t[6]=f,t[7]=l,t[8]=d,t[9]=p,t[10]=g,t[11]=m,t[12]=v,t[13]=b,t[14]=y,t[15]=w}function d(t,e){l(t,e,e)}function p(t,e){const r=new Uint8Array(32),i=new Float64Array(80),n=s(),o=s(),p=s(),g=s(),m=s(),v=s();for(let s=0;s<31;s++)r[s]=t[s];r[31]=127&t[31]|64,r[0]&=248,function(t,e){for(let r=0;r<16;r++)t[r]=e[2*r]+(e[2*r+1]<<8);t[15]&=32767}(i,e);for(let s=0;s<16;s++)o[s]=i[s];n[0]=g[0]=1;for(let s=254;s>=0;--s){const t=r[s>>>3]>>>(7&s)&1;h(n,o,t),h(p,g,t),u(m,n,p),f(n,n,p),u(p,o,g),f(o,o,g),d(g,m),d(v,n),l(n,p,n),l(p,o,m),u(m,n,p),f(n,n,p),d(o,n),f(p,g,v),l(n,p,a),u(n,n,g),l(p,p,n),l(n,g,v),l(g,o,i),d(o,m),h(n,o,t),h(p,g,t)}for(let s=0;s<16;s++)i[s+16]=n[s],i[s+32]=p[s],i[s+48]=o[s],i[s+64]=g[s];const b=i.subarray(32),y=i.subarray(16);!function(t,e){const r=s();for(let i=0;i<16;i++)r[i]=e[i];for(let i=253;i>=0;i--)d(r,r),2!==i&&4!==i&&l(r,r,e);for(let i=0;i<16;i++)t[i]=r[i]}(b,b),l(y,y,b);const w=new Uint8Array(32);return function(t,e){const r=s(),i=s();for(let n=0;n<16;n++)i[n]=e[n];c(i),c(i),c(i);for(let n=0;n<2;n++){r[0]=i[0]-65517;for(let e=1;e<15;e++)r[e]=i[e]-65535-(r[e-1]>>16&1),r[e-1]&=65535;r[15]=i[15]-32767-(r[14]>>16&1);const t=r[15]>>16&1;r[14]&=65535,h(i,r,1-t)}for(let n=0;n<16;n++)t[2*n]=255&i[n],t[2*n+1]=i[n]>>8}(w,y),w}function g(t){return p(t,o)}function m(t){if(t.length!==e.wE)throw new Error("x25519: seed must be ".concat(e.wE," bytes"));
2const r=new Uint8Array(t);return{publicKey:g(r),secretKey:r}}e.TZ=function(t){const e=(0,i.randomBytes)(32,t),r=m(e);return(0,n.wipe)(e),r},e.Tc=function(t,r){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(t.length!==e.Xx)throw new Error("X25519: incorrect secret key length");if(r.length!==e.Xx)throw new Error("X25519: incorrect public key length");const n=p(t,r);if(i){let t=0;for(let e=0;e<n.length;e++)t|=n[e];if(0===t)throw new Error("X25519: invalid shared key")}return n}},10364:(t,e,r)=>{"use strict";function i(){return(null===r.g||void 0===r.g?void 0:r.g.crypto)||(null===r.g||void 0===r.g?void 0:r.g.msCrypto)||{}}function n(){const t=i();return t.subtle||t.webkitSubtle}Object.defineProperty(e,"__esModule",{value:!0}),e.isBrowserCryptoAvailable=e.getSubtleCrypto=e.getBrowerCrypto=void 0,e.getBrowerCrypto=i,e.getSubtleCrypto=n,e.isBrowserCryptoAvailable=function(){return!!i()&&!!n()}},96454:(t,e)=>{"use strict";function r(){return"undefined"===typeof document&&"undefined"!==typeof navigator&&"ReactNative"===navigator.product}function i(){return"undefined"!==typeof process&&"undefined"!==typeof process.versions&&"undefined"!==typeof process.versions.node}Object.defineProperty(e,"__esModule",{value:!0}),e.isBrowser=e.isNode=e.isReactNative=void 0,e.isReactNative=r,e.isNode=i,e.isBrowser=function(){return!r()&&!i()}},8129:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const i=r(46613);i.__exportStar(r(10364),e),i.__exportStar(r(96454),e)},46613:(t,e,r)=>{"use strict";r.r(e),r.d(e,{__assign:()=>s,__asyncDelegator:()=>w,__asyncGenerator:()=>y,__asyncValues:()=>_,__await:()=>b,__awaiter:()=>u,__classPrivateFieldGet:()=>M,__classPrivateFieldSet:()=>I,__createBinding:()=>l,__decorate:()=>a,__exportStar:()=>d,__extends:()=>n,__generator:()=>f,__importDefault:()=>S,__importStar:()=>
vendor: 8,516 bytes, line 2
2E,__makeTemplateObject:()=>A,__metadata:()=>h,__param:()=>c,__read:()=>g,__rest:()=>o,__spread:()=>m,__spreadArrays:()=>v,__values:()=>p});var i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},i(t,e)};function n(t,e){function r(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}var s=function(){return s=Object.assign||function(t){for(var e,r=1,i=arguments.length;r<i;r++)for(var n in e=arguments[r])Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t},s.apply(this,arguments)};function o(t,e){var r={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(r[i]=t[i]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var n=0;for(i=Object.getOwnPropertySymbols(t);n<i.length;n++)e.indexOf(i[n])<0&&Object.prototype.propertyIsEnumerable.call(t,i[n])&&(r[i[n]]=t[i[n]])}return r}function a(t,e,r,i){var n,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,r):i;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)o=Reflect.decorate(t,e,r,i);else for(var a=t.length-1;a>=0;a--)(n=t[a])&&(o=(s<3?n(o):s>3?n(e,r,o):n(e,r))||o);return s>3&&o&&Object.defineProperty(e,r,o),o}function c(t,e){return function(r,i){e(r,i,t)}}function h(t,e){if("object"===typeof Reflect&&"function"===typeof Reflect.metadata)return Reflect.metadata(t,e)}function u(t,e,r,i){return new(r||(r=Promise))((function(n,s){function o(t){try{c(i.next(t))}catch(e){s(e)}}function a(t){try{c(i.throw(t))}catch(e){s(e)}}function c(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(o,a)}c((i=i.apply(t,e||[])).next())}))}function f(t,e){var r,i,n,s,o={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"===typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(s){return function(a){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;o;)try{if(r=1,i&&(n=2&s[0]?i.return:s[0]?i.throw||((n=i.return)&&n.call(i),0):i.next)&&!(n=n.call(i,s[1])).done)return n;switch(i=0,n&&(s=[2&s[0],n.value]),s[0]){case 0:case 1:n=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,i=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!(n=(n=o.trys).length>0&&n[n.length-1])&&(6===s[0]||2===s[0])){o=0;continue}if(3===s[0]&&(!n||s[1]>n[0]&&s[1]<n[3])){o.label=s[1];break}if(6===s[0]&&o.label<n[1]){o.label=n[1],n=s;break}if(n&&o.label<n[2]){o.label=n[2],o.ops.push(s);break}n[2]&&o.ops.pop(),o.trys.pop();continue}s=e.call(t,o)}catch(a){s=[6,a],i=0}finally{r=n=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,a])}}}function l(t,e,r,i){void 0===i&&(i=r),t[i]=e[r]}function d(t,e){for(var r in t)"default"===r||e.hasOwnProperty(r)||(e[r]=t[r])}function p(t){var e="function"===typeof Symbol&&Symbol.iterator,r=e&&t[e],i=0;if(r)return r.call(t);if(t&&"number"===typeof t.length)return{next:function(){return t&&i>=t.length&&(t=void 0),{value:t&&t[i++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function g(t,e){var r="function"===typeof Symbol&&t[Symbol.iterator];if(!r)return t;var i,n,s=r.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(i=s.next()).done;)o.push(i.value)}catch(a){n={error:a}}finally{try{i&&!i.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return o}function m(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(g(arguments[e]));return t}function v(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;var i=Array(t),n=0;for(e=0;e<r;e++)for(var s=arguments[e],o=0,a=s.length;o<a;o++,n++)i[n]=s[o];return i}function b(t){return this instanceof b?(this.v=t,this):new b(t)}function y(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i,n=r.apply(t,e||[]),s=[];return i={},o("next"),o("throw"),o("return"),i[Symbol.asyncIterator]=function(){return this},i;function o(t){n[t]&&(i[t]=function(e){return new Promise((function(r,i){s.push([t,e,r,i])>1||a(t,e)}))})}function a(t,e){try{(r=n[t](e)).value instanceof b?Promise.resolve(r.value.v).then(c,h):u(s[0][2],r)}catch(i){u(s[0][3],i)}var r}function c(t){a("next",t)}function h(t){a("throw",t)}function u(t,e){t(e),s.shift(),s.length&&a(s[0][0],s[0][1])}}function w(t){var e,r;return e={},i("next"),i("throw",(function(t){throw t})),i("return"),e[Symbol.iterator]=function(){return this},e;function i(i,n){e[i]=t[i]?function(e){return(r=!r)?{value:b(t[i](e)),done:"return"===i}:n?n(e):e}:n}}function _(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e,r=t[Symbol.asyncIterator];return r?r.call(t):(t=p(t),e={},i("next"),i("throw"),i("return"),e[Symbol.asyncIterator]=function(){return this},e);function i(r){e[r]=t[r]&&function(e){return new Promise((function(i,n){(function(t,e,r,i){Promise.resolve(i).then((function(e){t({value:e,done:r})}),e)})(i,n,(e=t[r](e)).done,e.value)}))}}}function A(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function E(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}function S(t){return t&&t.__esModule?t:{default:t}}function M(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}function I(t,e,r){if(!e.has(t))throw new TypeError("attempted to set private field on non-instance");return e.set(t,r),r}},51206:(t,e,r)=>{"use strict";r.d(e,{EthereumProvider:()=>Ym});var i={};r.r(i),r.d(i,{identity:()=>tt});var n={};r.r(n),r.d(n,{base2:()=>et});var s={};r.r(s),r.d(s,{base8:()=>rt});var o={};r.r(o),r.d(o,{base10:()=>it});var a={};r.r(a),r.d(a,{base16:()=>nt,base16upper:()=>st});var c={};r.r(c),r.d(c,{base32:()=>ot,base32hex:()=>ut,base32hexpad:()=>lt,base32hexpadupper:()=>dt,base32hexupper:()=>ft,base32pad:()=>ct,base32padupper:()=>ht,base32upper:()=>at,base32z:()=>pt});var h={};r.r(h),r.d(h,{base36:()=>gt,base36upper:()=>mt});var u={};r.r(u),r.d(u,{base58btc:()=>vt,base58flickr:()=>bt});var f={};r.r(f),r.d(f,{base64:()=>yt,base64pad:()=>wt,base64url:()=>_t,base64urlpad:()=>At});var l={};r.r(l),r.d(l,{base256emoji:()=>It});var d={};r.r(d),r.d(d,{sha256:()=>Xt,sha512:()=>Zt});var p={};r.r(p),r.d(p,{identity:()=>te});var g={};r.r(g),r.d(g,{code:()=>re,decode:()=>ne,encode:()=>ie,name:()=>ee});var m={};r.r(m),r.d(m,{code:()=>ce,decode:()=>ue,encode:()=>he,name:()=>ae});var v=r(27284),b=r.n(v),y=function(t,e,r){if(r||2===arguments.length)for(var i,n=0,s=e.length;n<s;n++)!i&&n in e||(i||(i=Array.prototype.slice.call(e,0,n)),i[n]=e[n]);return t.concat(i||Array.prototype.slice.call(e))},w=function(t,e,r){this.name=t,this.version=e,this.os=r,this.type="browser"},_=function(t){this.version=t,this.type="node",this.name="node",this.os=process.platform},A=function(t,e,r,i){this.name=t,this.version=e,this.os=r,this.bot=i,this.type="bot-device"},E=function(){this.type="bot",this.bot=!0,this.name="bot",this.version=null,this.os=null},S=function(){this.type="react-native",this.name="react-native",this.version=null,this.os=null},M=/(nuhk|curl|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/,I=[["aol",/AOLShield\/([0-9\._]+)/],["edge",/Edge\/([0-9\._]+)/],["edge-ios",/EdgiOS\/([0-9\._]+)/],["yandexbrowser",/YaBrowser\/([0-9\._]+)/],["kakaotalk",/KAKAOTALK\s([0-9\.]+)/],["samsung",/SamsungBrowser\/([0-9\.]+)/],["silk",/\bSilk\/([0-9._-]+)\b/],["miui",/MiuiBrowser\/([0-9\.]+)$/],["beaker",/BeakerBrowser\/([0-9\.]+)/],["edge-chromium",/EdgA?\/([0-9\.]+)/],["chromium-webview",/(?!Chrom.*OPR)wv\).*Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["chrome",/(?!Chrom.*OPR)Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["phantomjs",/PhantomJS\/([0-9\.]+)(:?\s|$)/],["crios",/CriOS\/([0-9\.]+)(:?\s|$)/],["firefox",/Firefox\/([0-9\.]+)(?:\s|$)/],["fxios",/FxiOS\/([0-9\.]+)/],["opera-mini",/Opera Mini.*Version\/([0-9\.]+)/],["opera",/Opera\/([0-9\.]+)(?:\s|$)/],["opera",/OPR\/([0-9\.]+)(:?\s|$)/],["pie",/^Microsoft Pocket Internet Explorer\/(\d+\.\d+)$/],["pie",/^Mozilla\/\d\.\d+\s\(compatible;\s(?:MSP?IE|MSInternet Explorer) (\d+\.\d+);.*Windows CE.*\)$/],["netfront",/^Mozilla\/\d\.\d+.*NetFront\/(\d.\d)/],["ie",/Trident\/7\.0.*rv\:([0-9\.]+).*\).*Gecko$/],["ie",/MSIE\s([0-9\.]+);.*Trident\/[4-7].0/],["ie",/MSIE\s(7\.0)/],["bb10",/BB10;
2\sTouch.*Version\/([0-9\.]+)/],["android",/Android\s([0-9\.]+)/],["ios",/Version\/([0-9\._]+).*Mobile.*Safari.*/],["safari",/Version\/([0-9\._]+).*Safari/],["facebook",/FB[AS]V\/([0-9\.]+)/],["instagram",/Instagram\s([0-9\.]+)/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Mobile/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Gecko\)$/],["curl",/^curl\/([0-9\.]+)$/],["searchbot",/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/]],x=[["iOS",/iP(hone|od|ad)/],["Android OS",/Android/],["BlackBerry OS",/BlackBerry|BB10/],["Windows Mobile",/IEMobile/],["Amazon OS",/Kindle/],["Windows 3.11",/Win16/],["Windows 95",/(Windows 95)|(Win95)|(Windows_95)/],["Windows 98",/(Windows 98)|(Win98)/],["Windows 2000",/(Windows NT 5.0)|(Windows 2000)/],["Windows XP",/(Windows NT 5.1)|(Windows XP)/],["Windows Server 2003",/(Windows NT 5.2)/],["Windows Vista",/(Windows NT 6.0)/],["Windows 7",/(Windows NT 6.1)/],["Windows 8",/(Windows NT 6.2)/],["Windows 8.1",/(Windows NT 6.3)/],["Windows 10",/(Windows NT 10.0)/],["Windows ME",/Windows ME/],["Windows CE",/Windows CE|WinCE|Microsoft Pocket Internet Explorer/],["Open BSD",/OpenBSD/],["Sun OS",/SunOS/],["Chrome OS",/CrOS/],["Linux",/(Linux)|(X11)/],["Mac OS",/(Mac_PowerPC)|(Macintosh)/],["QNX",/QNX/],["BeOS",/BeOS/],["OS/2",/OS\/2/]];function P(t){return t?N(t):"undefined"===typeof document&&"undefined"!==typeof navigator&&"ReactNative"===navigator.product?new S:"undefined"!==typeof navigator?N(navigator.userAgent):"undefined"!==typeof process&&process.version?new _(process.version.slice(1)):null}function O(t){return""!==t&&I.reduce((function(e,r){var i=r[0],n=r[1];if(e)return e;var s=n.exec(t);return!!s&&[i,s]}),!1)}function N(t){var e=O(t);if(!e)return null;var r=e[0],i=e[1];if("searchbot"===r)return new E;var n=i[1]&&i[1].split(".").join("_").split("_").slice(0,3);n?n.length<3&&(n=y(y([],n,!0),function(t){for(var e=[],r=0;r<t;r++)e.push("0");return e}(3-n.length),!0)):n=[];var s=n.join("."),o=function(t){for(var e=0,r=x.length;e<r;e++){var i=x[e],n=i[0];if(i[1].exec(t))return n}return null}(t),a=M.exec(t);return a&&a[1]?new A(r,s,o,a[1]):new w(r,s,o)}var R=r(33901),C=r(20033),T=r(39332),k=r(9370),L=r(58953),q=r(10269),D=r(95473),U=r(20153),B=r(87887);function j(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return null!=globalThis.Buffer&&null!=globalThis.Buffer.allocUnsafe?globalThis.Buffer.allocUnsafe(t):new Uint8Array(t)}function z(t,e){e||(e=t.reduce(((t,e)=>t+e.length),0));const r=j(e);let i=0;for(const n of t)r.set(n,i),i+=n.length;return r}var F=r(89379);var H=function(t,e){if(t.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),i=0;i<r.length;i++)r[i]=255;for(var n=0;n<t.length;n++){var s=t.charAt(n),o=s.charCodeAt(0);if(255!==r[o])throw new TypeError(s+" is ambiguous");r[o]=n}var a=t.length,c=t.charAt(0),h=Math.log(a)/Math.log(256),u=Math.log(256)/Math.log(a);function f(t){if("string"!==typeof t)throw new TypeError("Expected String");if(0===t.length)return new Uint8Array;var e=0;if(" "!==t[e]){for(var i=0,n=0;t[e]===c;)i++,e++;for(var s=(t.length-e)*h+1>>>0,o=new Uint8Array(s);t[e];){var u=r[t.charCodeAt(e)];if(255===u)return;for(var f=0,l=s-1;(0!==u||f<n)&&-1!==l;l--,f++)u+=a*o[l]>>>0,o[l]=u%256>>>0,u=u/256>>>0;if(0!==u)throw new Error("Non-zero carry");n=f,e++}if(" "!==t[e]){for(var d=s-n;d!==s&&0===o[d];)d++;for(var p=new Uint8Array(i+(s-d)),g=i;d!==s;)p[g++]=o[d++];return p}}}return{encode:function(e){if(e instanceof Uint8Array||(ArrayBuffer.isView(e)?e=new Uint8Array(e.buffer,e.byteOffset,e.byteLength):Array.isArray(e)&&(e=Uint8Array.from(e))),!(e instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(0===e.length)return"";for(var r=0,i=0,n=0,s=e.length;n!==s&&0===e[n];)n++,r++;for(var o=(s-n)*u+1>>>0,h=new Uint8Array(o);n!==s;){for(var f=e[n],l=0,d=o-1;(0!==f||l<i)&&-1!==d;d--,l++)f+=256*h[d]>>>0,h[d]=f%a>>>0,f=f/a>>>0;if(0!==f)throw new Error("Non-zero carry");i=l,n++}for(var p=o-i;p!==o&&0===h[p];)p++;for(var g=c.repeat(r);p<o;++p)g+=t.charAt(h[p]);return g},decodeUnsafe:f,decode:function(t){var r=f(t);if(r)return r;throw new Error("Non-".concat(e," character"))}}};const K=H,V=(new Uint8Array(0),t=>{if(t instanceof Uint8Array&&"Uint8Array"===t.constructor.name)return t;if(t instanceof ArrayBuffer)return new Uint8Array(t);if(ArrayBuffer.isView(t))return new Uint8Array(t.buffer,t.byteOffset,t.byteLength);throw new Error("Unknown type, must be binary type")});class W{constructor(t,e,r){this.name=t,this.prefix=e,this.baseEncode=r}encode(t){if(t instanceof Uint8Array)return"".concat(this.prefix).concat(this.baseEncode(t));throw Error("Unknown type, must be binary type")}}class G{constructor(t,e,r){if(this.name=t,this.prefix=e,void 0===e.codePointAt(0))throw new Error("Invalid prefix character");this.prefixCodePoint=e.codePointAt(0),this.baseDecode=r}decode(t){if("string"===typeof t){if(t.codePointAt(0)!==this.prefixCodePoint)throw Error("Unable to decode multibase string ".concat(JSON.stringify(t),", ").concat(this.name," decoder only supports input
2s prefixed with ").concat(this.prefix));return this.baseDecode(t.slice(this.prefix.length))}throw Error("Can only multibase decode strings")}or(t){return Y(this,t)}}class J{constructor(t){this.decoders=t}or(t){return Y(this,t)}decode(t){const e=t[0],r=this.decoders[e];if(r)return r.decode(t);throw RangeError("Unable to decode multibase string ".concat(JSON.stringify(t),", only inputs prefixed with ").concat(Object.keys(this.decoders)," are supported"))}}const Y=(t,e)=>new J((0,F.A)((0,F.A)({},t.decoders||{[t.prefix]:t}),e.decoders||{[e.prefix]:e}));class Q{constructor(t,e,r,i){this.name=t,this.prefix=e,this.baseEncode=r,this.baseDecode=i,this.encoder=new W(t,e,r),this.decoder=new G(t,e,i)}encode(t){return this.encoder.encode(t)}decode(t){return this.decoder.decode(t)}}const X=t=>{let{name:e,prefix:r,encode:i,decode:n}=t;return new Q(e,r,i,n)},Z=t=>{let{prefix:e,name:r,alphabet:i}=t;const{encode:n,decode:s}=K(i,r);return X({prefix:e,name:r,encode:n,decode:t=>V(s(t))})},$=t=>{let{name:e,prefix:r,bitsPerChar:i,alphabet:n}=t;return X({prefix:r,name:e,encode:t=>((t,e,r)=>{const i="="===e[e.length-1],n=(1<<r)-1;let s="",o=0,a=0;for(let c=0;c<t.length;++c)for(a=a<<8|t[c],o+=8;o>r;)o-=r,s+=e[n&a>>o];if(o&&(s+=e[n&a<<r-o]),i)for(;s.length*r&7;)s+="=";return s})(t,n,i),decode:t=>((t,e,r,i)=>{const n={};for(let u=0;u<e.length;++u)n[e[u]]=u;let s=t.length;for(;"="===t[s-1];)--s;const o=new Uint8Array(s*r/8|0);let a=0,c=0,h=0;for(let u=0;u<s;++u){const e=n[t[u]];if(void 0===e)throw new SyntaxError("Non-".concat(i," character"));c=c<<r|e,a+=r,a>=8&&(a-=8,o[h++]=255&c>>a)}if(a>=r||255&c<<8-a)throw new SyntaxError("Unexpected end of data");return o})(t,n,i,e)})},tt=X({prefix:"\0",name:"identity",encode:t=>(t=>(new TextDecoder).decode(t))(t),decode:t=>(t=>(new TextEncoder).encode(t))(t)}),et=$({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1}),rt=$({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3}),it=Z({prefix:"9",name:"base10",alphabet:"0123456789"}),nt=$({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),st=$({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4}),ot=$({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),at=$({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),ct=$({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),ht=$({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),ut=$({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),ft=$({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),lt=$({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),dt=$({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),pt=$({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),gt=Z({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),mt=Z({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"}),vt=Z({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),bt=Z({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"}),yt=$({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),wt=$({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),_t=$({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),At=$({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6}),Et=Array.from("\ud83d\ude80\ud83e\ude90\u2604\ud83d\udef0\ud83c\udf0c\ud83c\udf11\ud83c\udf12\ud83c\udf13\ud83c\udf14\ud83c\udf15\ud83c\udf16\ud83c\udf17\ud83c\udf18\ud83c\udf0d\ud83c\udf0f\ud83c\udf0e\ud83d\udc09\u2600\ud83d\udcbb\ud83d\udda5\ud83d\udcbe\ud83d\udcbf\ud83d\ude02\u2764\ud83d\ude0d\ud83e\udd23\ud83d\ude0a\ud83d\ude4f\ud83d\udc95\ud83d\ude2d\ud83d\ude18\ud83d\udc4d\ud83d\ude05\ud83d\udc4f\ud83d\ude01\ud83d\udd25\ud83e\udd70\ud83d\udc94\ud83d\udc96\ud83d\udc99\ud83d\ude22\ud83e\udd14\ud83d\ude06\ud83d\ude44\ud83d\udcaa\ud83d\ude09\u263a\ud83d\udc4c\ud83e\udd17\ud83d\udc9c\ud83d\ude14\ud83d\ude0e\ud83d\ude07\ud83c\udf39\ud83e\udd26\ud83c\udf89\ud83d\udc9e\u270c\u2728\ud83e\udd37\ud83d\ude31\ud83d\ude0c\ud83c\udf38\ud83d\ude4c\ud83d\ude0b\ud83d\udc97\ud83d\udc9a\ud83d\ude0f\ud83d\udc9b\ud83d\ude42\ud83d\udc93\ud83e\udd29\ud83d\ude04\ud83d\ude00\ud83d\udda4\ud83d\ude03\ud83d\udcaf\ud83d\ude48\ud83d\udc47\ud83c\udfb6\ud83d\ude12\ud83e\udd2d\u2763\ud83d\ude1c\ud83d\udc8b\ud83d\udc40\ud83d\ude2a\ud83d\ude11\ud83d\udca5\ud83d\ude4b\ud83d\ude1e\ud83d\ude29\ud83d\ude21\ud83e\udd2a\ud83d\udc4a\ud83e\udd73\ud83d\ude25\ud83e\udd24\ud83d\udc49\ud83d\udc83\ud83d\ude33\u270b\ud83d\ude1a\ud83d\ude1d\ud83d\ude34\ud83c\udf1f\ud83d\ude2c\ud83d\ude43\ud83c\udf40\ud83c\udf37\ud83d\ude3b\ud83d\ude13\u2b50\u2705\ud83e\udd7a\ud83c\udf08\ud83d\ude08\ud83e\udd18\ud83d\udca6\u2714\ud83d\ude23\ud83c\udfc3\ud83d\udc90\u2639\ud83c\udf8a\ud83d\udc98\ud83d\ude20\u261d\ud83d\ude15\ud83c\udf3a\ud83c\udf82\ud83c\udf3b\ud83d\ude10\ud83d\udd95\ud83d\udc9d\ud83d\ude4a\ud83d\ude39\ud83d\udde3\ud83d\udcab\ud83d\udc80\ud83d\udc51\ud83c\udfb5\ud83e\udd1e\ud83d\ude1b\ud83d\udd34\ud83d\ude24\ud83c\udf3c\ud83d\ude2b\u26bd\ud83e\udd19\u2615\ud83c\udfc6\ud83e\udd2b\ud83d\udc48\ud83d\ude2e\ud83d\ude46\ud83c\udf7b\ud83c\udf43\ud83d\udc36\ud83d\udc81\ud83d\ude32\ud83c\udf3f\ud83e\udde1\ud83c\udf81\u26a1\ud83c\udf1e\ud83c\udf88\u274c\u270a\ud83d\udc4b\ud83d\ude30\ud83e\udd28\ud83d\ude36\ud83e\udd1d\ud83d\udeb6\ud83d\udcb0\ud83c\udf53\ud83d\udca2\ud83e\udd1f\ud83d\ude41\ud83d\udea8\ud83d\udca8\ud83e\udd2c\u2708\ud83c\udf80\ud83c\udf7a\ud83e\udd13\ud83d\ude19\ud83d\udc9f\ud83c\udf31\ud83d\ude16\ud83d\udc76\ud83e\udd74\u25b6\u27a1\u2753\ud83d\udc8e\ud83d\udcb8\u2b07\ud83d\ude28\ud83c\udf1a\ud83e\udd8b\ud83d\ude37\ud83d\udd7a\u26a0\ud83d\ude45\ud83d\ude1f\ud83d\ude35\ud83d\udc4e\ud83e\udd32\ud83e\udd20\ud83e\udd27\ud83d\udccc\ud83d\udd35\ud83d\udc85\ud83e\uddd0\ud83d\udc3e\ud83c\udf52\ud83d\ude17\ud83e\udd11\ud83c\udf0a\ud83e\udd2f\ud83d\udc37\u260e\ud83d\udca7\ud83d\ude2f\ud83d\udc86\ud83d\udc46\ud83c\udfa4\ud83d\ude47\ud83c\udf51\u2744\ud83c\udf34\ud83d\udca3\ud83d\udc38\ud83d\udc8c\ud83d\udccd\ud83e\udd40\ud83e\udd22\ud83d\udc45\ud83d\udca1\ud83d\udca9\ud83d\udc50\ud83d\udcf8\ud83d\udc7b\ud83e\udd10\ud83e\udd2e\ud83c\udfbc\ud83e\udd75\ud83d\udea9\ud83c\udf4e\ud83c\udf4a\ud83d\udc7c\ud83d\udc8d\ud83d\udce3\ud83e\udd42"),St=Et.reduce(((t,e,r)=>(t[r]=e,t)),[]),Mt=Et.reduce(((t,e,r)=>(t[e.codePointAt(0)]=r,t)),[]);const It=X({prefix:"\ud83d\ude80",name:"base256emoji",encode:function(t){return t.reduce(((t,e)=>t+=St[e]),"")},decode:function(t){const e=[];for(const r of t){const t=Mt[r.codePointAt(0)];if(void 0===t)throw new Error("Non-base256emoji character: ".concat(r));e.push(t)}return new Uint8Array(e)}});var xt=function t(e,r,i){r=r||[];var n=i=i||0;for(;e>=Nt;)r[i++]=255&e|Pt,e/=128;for(;e&Ot;)r[i++]=255&e|Pt,e>>>=7;return r[i]=0|e,t.bytes=i-n+1,r},Pt=128,Ot=-128,Nt=Math.pow(2,31);var Rt=function t(e,r){var i,n=0,s=0,o=r=r||0,a=e.length;do{if(o>=a)throw t.bytes=0,new RangeError("Could not decode varint");i=e[o++],n+=s<28?(i&Tt)<<s:(i&Tt)*Math.pow(2,s),s+=7}while(i>=Ct);return t.bytes=o-r,n},Ct=128,Tt=127;var kt=Math.pow(2,7),Lt=Math.pow(2,14),qt=Math.pow(2,21),Dt=Math.pow(2,28),Ut=Math.pow(2,35),Bt=Math.pow(2,42),jt=Math.pow(2,49),zt=Math.pow(2,56),Ft=Math.pow(2,63);const Ht={encode:xt,decode:Rt,encodingLength:function(t){return t<kt?1:t<Lt?2:t<qt?3:t<Dt?4:t<Ut?5:t<Bt?6:t<jt?7:t<zt?8:t<Ft?9:10}},Kt=function(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return Ht.encode(t,e,r),e},Vt=t=>Ht.encodingLength(t),Wt=(t,e)=>{const r=e.byteLength,i=Vt(t),n=i+Vt(r),s=new Uint8Array(n+r);return Kt(t,s,0),Kt(r,s,i),s.set(e,n),new Gt(t,r,e,s)};
2class Gt{constructor(t,e,r,i){this.code=t,this.size=e,this.digest=r,this.bytes=i}}const Jt=t=>{let{name:e,code:r,encode:i}=t;return new Yt(e,r,i)};class Yt{constructor(t,e,r){this.name=t,this.code=e,this.encode=r}digest(t){if(t instanceof Uint8Array){const e=this.encode(t);return e instanceof Uint8Array?Wt(this.code,e):e.then((t=>Wt(this.code,t)))}throw Error("Unknown type, must be binary type")}}const Qt=t=>async e=>new Uint8Array(await crypto.subtle.digest(t,e)),Xt=Jt({name:"sha2-256",code:18,encode:Qt("SHA-256")}),Zt=Jt({name:"sha2-512",code:19,encode:Qt("SHA-512")}),$t=V,te={code:0,name:"identity",encode:$t,digest:t=>Wt(0,$t(t))},ee="raw",re=85,ie=t=>V(t),ne=t=>V(t),se=new TextEncoder,oe=new TextDecoder,ae="json",ce=512,he=t=>se.encode(JSON.stringify(t)),ue=t=>JSON.parse(oe.decode(t));Symbol.toStringTag,Symbol.for("nodejs.util.inspect.custom");Symbol.for("@ipld/js-cid/CID");const fe=(0,F.A)((0,F.A)((0,F.A)((0,F.A)((0,F.A)((0,F.A)((0,F.A)((0,F.A)((0,F.A)((0,F.A)({},i),n),s),o),a),c),h),u),f),l);(0,F.A)((0,F.A)({},d),p);function le(t,e,r,i){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:r},decoder:{decode:i}}}const de=le("utf8","u",(t=>"u"+new TextDecoder("utf8").decode(t)),(t=>(new TextEncoder).encode(t.substring(1)))),pe=le("ascii","a",(t=>{let e="a";for(let r=0;r<t.length;r++)e+=String.fromCharCode(t[r]);return e}),(t=>{const e=j((t=t.substring(1)).length);for(let r=0;r<t.length;r++)e[r]=t.charCodeAt(r);return e})),ge=(0,F.A)({utf8:de,"utf-8":de,hex:fe.base16,latin1:pe,ascii:pe,binary:pe},fe);function me(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"utf8";const r=ge[e];if(!r)throw new Error('Unsupported encoding "'.concat(e,'"'));return"utf8"!==e&&"utf-8"!==e||null==globalThis.Buffer||null==globalThis.Buffer.from?r.decoder.decode("".concat(r.prefix).concat(t)):globalThis.Buffer.from(t,"utf8")}function ve(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"utf8";const r=ge[e];if(!r)throw new Error('Unsupported encoding "'.concat(e,'"'));return"utf8"!==e&&"utf-8"!==e||null==globalThis.Buffer||null==globalThis.Buffer.from?r.encoder.encode(t).substring(1):globalThis.Buffer.from(t.buffer,t.byteOffset,t.byteLength).toString("utf8")}var be=r(38086),ye=r(43045);const we=".",_e="base64url",Ae="utf8",Ee="utf8",Se="did",Me="key",Ie="base58btc";function xe(t){return null!=globalThis.Buffer?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):t}function Pe(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return null!=globalThis.Buffer&&null!=globalThis.Buffer.allocUnsafe?xe(globalThis.Buffer.allocUnsafe(t)):new Uint8Array(t)}function Oe(t,e,r,i){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:r},decoder:{decode:i}}}const Ne=Oe("utf8","u",(t=>"u"+new TextDecoder("utf8").decode(t)),(t=>(new TextEncoder).encode(t.substring(1)))),Re=Oe("ascii","a",(t=>{let e="a";for(let r=0;r<t.length;r++)e+=String.fromCharCode(t[r]);return e}),(t=>{const e=Pe((t=t.substring(1)).length);for(let r=0;r<t.length;r++)e[r]=t.charCodeAt(r);return e})),Ce=(0,F.A)({utf8:Ne,"utf-8":Ne,hex:fe.base16,latin1:Re,ascii:Re,binary:Re},fe);function Te(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"utf8";const r=Ce[e];if(!r)throw new Error('Unsupported encoding "'.concat(e,'"'));return"utf8"!==e&&"utf-8"!==e||null==globalThis.Buffer||null==globalThis.Buffer.from?r.encoder.encode(t).substring(1):globalThis.Buffer.from(t.buffer,t.byteOffset,t.byteLength).toString("utf8")}function ke(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"utf8";const r=Ce[e];if(!r)throw new Error('Unsupported encoding "'.concat(e,'"'));return"utf8"!==e&&"utf-8"!==e||null==globalThis.Buffer||null==globalThis.Buffer.from?r.decoder.decode("".concat(r.prefix).concat(t)):xe(globalThis.Buffer.from(t,"utf-8"))}function Le(t){if("string"!==typeof t)throw new Error("Cannot safe json parse value of type ".concat(typeof t));try{return(t=>{const e=t.replace(/([\[:])?(\d{17,}|(?:[9](?:[1-9]07199254740991|0[1-9]7199254740991|00[8-9]199254740991|007[2-9]99254740991|007199[3-9]54740991|0071992[6-9]4740991|00719925[5-9]740991|007199254[8-9]40991|0071992547[5-9]0991|00719925474[1-9]991|00719925474099[2-9])))([,\}\]])/g,'$1"$2n"$3');return JSON.parse(e,((t,e)=>"string"===typeof e&&e.match(/^\d+n$/)?BigInt(e.substring(0,e.length-1)):e))})(t)}catch(Es){return t}}function qe(t){return"string"===typeof t?t:(e=t,JSON.stringify(e,((t,e)=>"bigint"===typeof e?e.toString()+"n":e))||"");var e}function De(t){return Le(Te(ke(t,_e),Ae))}function Ue(t){return Te(ke(qe(t),Ae),_e)}function Be(t){const e="z"+Te(function(t,e){e||(e=t.reduce(((t,e)=>t+e.length),0));const r=Pe(e);let i=0;for(const n of t)r.set(n,i),i+=n.length;return xe(r)}([ke("K36",Ie),t]),Ie);return[Se,Me,e].join(":")}function je(t){const e=t.split(we);return{header:De(e[0]),payload:De(e[1]),signature:ke(e[2],_e),data:ke(e.slice(0,2).join(we),Ee)}}function ze(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:(0,D.randomBytes)(32);return ye.K(t)}async function Fe(t,e,r,i){let n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:(0,R.fromMiliseconds)(Date.now());const s={alg:"EdDSA",typ:"JWT"},o={iss:Be(i.publicKey),sub:t,aud:e,iat:n,exp:n+r},a=ke([Ue((c={header:s,payload:o}).header),Ue(c.payload)].join(we),Ee);var c;return function(t){return[Ue(t.header),Ue(t.payload),(e=t.signature,Te(e,_e))].join(we);var e}({header:s,payload:o,signature:ye._S(i.secretKey,a)})}r(36388);const He={waku:{publish:"waku_publish",batchPublish:"waku_batchPublish",subscribe:"waku_subscribe",batchSubscribe:"waku_batchSubscribe",subscription:"waku_subscription",unsubscribe:"waku_unsubscribe",batchUnsubscribe:"waku_batchUnsubscribe",batchFetchMessages:"waku_batchFetchMessages"},irn:{publish:"irn_publish",batchPublish:"irn_batchPublish",subscribe:"irn_subscribe",batchSubscribe:"irn_batchSubscribe",subscription:"irn_subscription",unsubscribe:"irn_unsubscribe",batchUnsubscribe:"irn_batchUnsubscribe",batchFetchMessages:"irn_batchFetchMessages"},iridium:{publish:"iridium_publish",batchPublish:"iridium_batchPublish",subscribe:"iridium_subscribe",batchSubscribe:"iridium_batchSubscribe",subscription:"iridium_subscription",unsubscribe:"iridium_unsubscribe",batchUnsubscribe:"iridium_batchUnsubscribe",batchFetchMessages:"iridium_batchFetchMessages"}},Ke=":";function Ve(t){const[e,r]=t.split(Ke);return{namespace:e,reference:r}}function We(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];const r=[];return Object.keys(t).forEach((i=>{if(e.length&&!e.includes(i))return;const n=t[i];
2r.push(...n.accounts)})),r}function Ge(t,e){return t.includes(":")?[t]:e.chains||[]}var Je=Object.defineProperty,Ye=Object.getOwnPropertySymbols,Qe=Object.prototype.hasOwnProperty,Xe=Object.prototype.propertyIsEnumerable,Ze=(t,e,r)=>e in t?Je(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,$e=(t,e)=>{for(var r in e||(e={}))Qe.call(e,r)&&Ze(t,r,e[r]);if(Ye)for(var r of Ye(e))Xe.call(e,r)&&Ze(t,r,e[r]);return t};const tr="react-native",er="node",rr="browser",ir="unknown",nr="js";function sr(){return typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.node<"u"}function or(){return!(0,C.getDocument)()&&!!(0,C.getNavigator)()&&"ReactNative"===navigator.product}function ar(){return!sr()&&!!(0,C.getNavigator)()&&!!(0,C.getDocument)()}function cr(){return or()?tr:sr()?er:ar()?rr:ir}function hr(){return(0,T.g)()||{name:"",description:"",url:"",icons:[""]}}function ur(t,e,i){const n=function(){if(cr()===tr&&typeof r.g<"u"&&typeof(null==r.g?void 0:r.g.Platform)<"u"){const{OS:t,Version:e}=r.g.Platform;return[t,e].join("-")}const t=P();if(null===t)return"unknown";const e=t.os?t.os.replace(" ","").toLowerCase():"unknown";return"browser"===t.type?[e,t.name,t.version].join("-"):[e,t.version].join("-")}(),s=function(){var t;const e=cr();return e===rr?[e,(null==(t=(0,C.getLocation)())?void 0:t.host)||"unknown"].join(":"):e}();return[[t,e].join("-"),[nr,i].join("-"),n,s].join("/")}function fr(t){let{protocol:e,version:r,relayUrl:i,sdkVersion:n,auth:s,projectId:o,useOnCloseEvent:a,bundleId:c}=t;const h=i.split("?"),u={auth:s,ua:ur(e,r,n),projectId:o,useOnCloseEvent:a||void 0,origin:c||void 0},f=function(t,e){let r=k.parse(t);return r=$e($e({},r),e),k.stringify(r)}(h[1]||"",u);return h[0]+"?"+f}function lr(t,e){return t.filter((t=>e.includes(t))).length===t.length}function dr(t){return Object.fromEntries(t.entries())}function pr(t){return new Map(Object.entries(t))}function gr(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:R.FIVE_MINUTES,e=arguments.length>1?arguments[1]:void 0;const r=(0,R.toMiliseconds)(t||R.FIVE_MINUTES);let i,n,s;return{resolve:t=>{s&&i&&(clearTimeout(s),i(t))},reject:t=>{s&&n&&(clearTimeout(s),n(t))},done:()=>new Promise(((t,o)=>{s=setTimeout((()=>{o(new Error(e))}),r),i=t,n=o}))}}function mr(t,e,r){return new Promise((async(i,n)=>{const s=setTimeout((()=>n(new Error(r))),e);try{i(await t)}catch(o){n(o)}clearTimeout(s)}))}function vr(t,e){if("string"==typeof e&&e.startsWith("".concat(t,":")))return e;if("topic"===t.toLowerCase()){if("string"!=typeof e)throw new Error('Value must be "string" for expirer target type: topic');return"topic:".concat(e)}if("id"===t.toLowerCase()){if("number"!=typeof e)throw new Error('Value must be "number" for expirer target type: id');return"id:".concat(e)}throw new Error("Unknown expirer target type: ".concat(t))}function br(t){const[e,r]=t.split(":"),i={id:void 0,topic:void 0};if("topic"===e&&"string"==typeof r)i.topic=r;else{if("id"!==e||!Number.isInteger(Number(r)))throw new Error("Invalid target, expected id:number or topic:string, got ".concat(e,":").concat(r));i.id=Number(r)}return i}function yr(t,e){return(0,R.fromMiliseconds)((e||Date.now())+(0,R.toMiliseconds)(t))}function wr(t){return Date.now()>=(0,R.toMiliseconds)(t)}function _r(t,e){return"".concat(t).concat(e?":".concat(e):"")}function Ar(){return[...new Set([...arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],...arguments.length>1&&void 0!==arguments[1]?arguments[1]:[]])]}async function Er(t){let{id:e,topic:i,wcDeepLink:n}=t;var s;try{if(!n)return;const t="string"==typeof n?JSON.parse(n):n,o=null===t||void 0===t?void 0:t.href;if("string"!=typeof o)return;const a=function(t,e,r){const i="requestId=".concat(e,"&sessionTopic=").concat(r);t.endsWith("/")&&(t=t.slice(0,-1));let n="".concat(t);if(t.startsWith("https://t.me")){const e=t.includes("?")?"&startapp=":"?startapp=";n="".concat(n).concat(e).concat(function(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const r=Buffer.from(t).toString("base64");return e?r.replace(/[=]/g,""):r}(i,!0))}else n="".concat(n,"/wc?").concat(i);return n}(o,e,i),c=cr();if(c===rr){if(null==(s=(0,C.getDocument)())||!s.hasFocus())return void console.warn("Document does not have focus, skipping deeplink.");a.startsWith("https://")||a.startsWith("http://")?window.open(a,"_blank","noreferrer noopener"):window.open(a,typeof window<"u"&&(window.TelegramWebviewProxy||window.Telegram||window.TelegramWebviewProxyProto)?"_blank":"_self","noreferrer noopener")}else c===tr&&typeof(null==r.g?void 0:r.g.Linking)<"u"&&await r.g.Linking.openURL(a)}catch(o){console.error(o)}}function Sr(t,e){if(!t.includes(e))return null;const r=t.split(/([&,?,=])/),i=r.indexOf(e);return r[i+2]}function Mr(){return typeof crypto<"u"&&null!=crypto&&crypto.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(t=>{const e=16*Math.random()|0;return("x"===t?e:3&e|8).toString(16)}))}function Ir(){return typeof process<"u"&&"true"==={NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0}.IS_VITEST}function xr(t){return Buffer.from(t,"base64").toString("utf-8")}var Pr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof r.g<"u"?r.g:typeof self<"u"?self:{};var Or={exports:{}};
2!function(t){!function(){var e="input is invalid type",r="object"==typeof window,i=r?window:{};i.JS_SHA3_NO_WINDOW&&(r=!1);var n=!r&&"object"==typeof self;!i.JS_SHA3_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node?i=Pr:n&&(i=self);var s=!i.JS_SHA3_NO_COMMON_JS&&t.exports,o=!i.JS_SHA3_NO_ARRAY_BUFFER&&typeof ArrayBuffer<"u",a="0123456789abcdef".split(""),c=[4,1024,262144,67108864],h=[0,8,16,24],u=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],f=[224,256,384,512],l=[128,256],d=["hex","buffer","arrayBuffer","array","digest"],p={128:168,256:136};(i.JS_SHA3_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(t){return"[object Array]"===Object.prototype.toString.call(t)}),o&&(i.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(t){return"object"==typeof t&&t.buffer&&t.buffer.constructor===ArrayBuffer});for(var g=function(t,e,r){return function(i){return new N(t,e,t).update(i)[r]()}},m=function(t,e,r){return function(i,n){return new N(t,e,n).update(i)[r]()}},v=function(t,e,r){return function(e,i,n,s){return A["cshake"+t].update(e,i,n,s)[r]()}},b=function(t,e,r){return function(e,i,n,s){return A["kmac"+t].update(e,i,n,s)[r]()}},y=function(t,e,r,i){for(var n=0;n<d.length;++n){var s=d[n];t[s]=e(r,i,s)}return t},w=function(t,e){var r=g(t,e,"hex");return r.create=function(){return new N(t,e,t)},r.update=function(t){return r.create().update(t)},y(r,g,t,e)},_=[{name:"keccak",padding:[1,256,65536,16777216],bits:f,createMethod:w},{name:"sha3",padding:[6,1536,393216,100663296],bits:f,createMethod:w},{name:"shake",padding:[31,7936,2031616,520093696],bits:l,createMethod:function(t,e){var r=m(t,e,"hex");return r.create=function(r){return new N(t,e,r)},r.update=function(t,e){return r.create(e).update(t)},y(r,m,t,e)}},{name:"cshake",padding:c,bits:l,createMethod:function(t,e){var r=p[t],i=v(t,0,"hex");return i.create=function(i,n,s){return n||s?new N(t,e,i).bytepad([n,s],r):A["shake"+t].create(i)},i.update=function(t,e,r,n){return i.create(e,r,n).update(t)},y(i,v,t,e)}},{name:"kmac",padding:c,bits:l,createMethod:function(t,e){var r=p[t],i=b(t,0,"hex");return i.create=function(i,n,s){return new R(t,e,n).bytepad(["KMAC",s],r).bytepad([i],r)},i.update=function(t,e,r,n){return i.create(t,r,n).update(e)},y(i,b,t,e)}}],A={},E=[],S=0;S<_.length;++S)for(var M=_[S],I=M.bits,x=0;x<I.length;++x){var P=M.name+"_"+I[x];if(E.push(P),A[P]=M.createMethod(I[x],M.padding),"sha3"!==M.name){var O=M.name+I[x];E.push(O),A[O]=A[P]}}function N(t,e,r){this.blocks=[],this.s=[],this.padding=e,this.outputBits=r,this.reset=!0,this.finalized=!1,this.block=0,this.start=0,this.blockCount=1600-(t<<1)>>5,this.byteCount=this.blockCount<<2,this.outputBlocks=r>>5,this.extraBytes=(31&r)>>3;for(var i=0;i<50;++i)this.s[i]=0}function R(t,e,r){N.call(this,t,e,r)}N.prototype.update=function(t){if(this.finalized)throw new Error("finalize already called");var r,i=typeof t;if("string"!==i){if("object"!==i)throw new Error(e);
2if(null===t)throw new Error(e);if(o&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!Array.isArray(t)&&(!o||!ArrayBuffer.isView(t)))throw new Error(e);r=!0}for(var n,s,a=this.blocks,c=this.byteCount,u=t.length,f=this.blockCount,l=0,d=this.s;l<u;){if(this.reset)for(this.reset=!1,a[0]=this.block,n=1;n<f+1;++n)a[n]=0;if(r)for(n=this.start;l<u&&n<c;++l)a[n>>2]|=t[l]<<h[3&n++];else for(n=this.start;l<u&&n<c;++l)(s=t.charCodeAt(l))<128?a[n>>2]|=s<<h[3&n++]:s<2048?(a[n>>2]|=(192|s>>6)<<h[3&n++],a[n>>2]|=(128|63&s)<<h[3&n++]):s<55296||s>=57344?(a[n>>2]|=(224|s>>12)<<h[3&n++],a[n>>2]|=(128|s>>6&63)<<h[3&n++],a[n>>2]|=(128|63&s)<<h[3&n++]):(s=65536+((1023&s)<<10|1023&t.charCodeAt(++l)),a[n>>2]|=(240|s>>18)<<h[3&n++],a[n>>2]|=(128|s>>12&63)<<h[3&n++],a[n>>2]|=(128|s>>6&63)<<h[3&n++],a[n>>2]|=(128|63&s)<<h[3&n++]);if(this.lastByteIndex=n,n>=c){for(this.start=n-c,this.block=a[f],n=0;n<f;++n)d[n]^=a[n];C(d),this.reset=!0}else this.start=n}return this},N.prototype.encode=function(t,e){var r=255&t,i=1,n=[r];for(r=255&(t>>=8);r>0;)n.unshift(r),r=255&(t>>=8),++i;return e?n.push(i):n.unshift(i),this.update(n),n.length},N.prototype.encodeString=function(t){var r,i=typeof t;if("string"!==i){if("object"!==i)throw new Error(e);
2if(null===t)throw new Error(e);if(o&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!Array.isArray(t)&&(!o||!ArrayBuffer.isView(t)))throw new Error(e);r=!0}var n=0,s=t.length;if(r)n=s;else for(var a=0;a<t.length;++a){var c=t.charCodeAt(a);c<128?n+=1:c<2048?n+=2:c<55296||c>=57344?n+=3:(c=65536+((1023&c)<<10|1023&t.charCodeAt(++a)),n+=4)}return n+=this.encode(8*n),this.update(t),n},N.prototype.bytepad=function(t,e){for(var r=this.encode(e),i=0;i<t.length;++i)r+=this.encodeString(t[i]);var n=e-r%e,s=[];return s.length=n,this.update(s),this},N.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var t=this.blocks,e=this.lastByteIndex,r=this.blockCount,i=this.s;if(t[e>>2]|=this.padding[3&e],this.lastByteIndex===this.byteCount)for(t[0]=t[r],e=1;e<r+1;++e)t[e]=0;for(t[r-1]|=2147483648,e=0;e<r;++e)i[e]^=t[e];C(i)}},N.prototype.toString=N.prototype.hex=function(){this.finalize();for(var t,e=this.blockCount,r=this.s,i=this.outputBlocks,n=this.extraBytes,s=0,o=0,c="";o<i;){for(s=0;s<e&&o<i;++s,++o)t=r[s],c+=a[t>>4&15]+a[15&t]+a[t>>12&15]+a[t>>8&15]+a[t>>20&15]+a[t>>16&15]+a[t>>28&15]+a[t>>24&15];o%e===0&&(C(r),s=0)}return n&&(t=r[s],c+=a[t>>4&15]+a[15&t],n>1&&(c+=a[t>>12&15]+a[t>>8&15]),n>2&&(c+=a[t>>20&15]+a[t>>16&15])),c},N.prototype.arrayBuffer=function(){this.finalize();var t,e=this.blockCount,r=this.s,i=this.outputBlocks,n=this.extraBytes,s=0,o=0,a=this.outputBits>>3;t=n?new ArrayBuffer(i+1<<2):new ArrayBuffer(a);for(var c=new Uint32Array(t);o<i;){for(s=0;s<e&&o<i;++s,++o)c[o]=r[s];o%e===0&&C(r)}return n&&(c[s]=r[s],t=t.slice(0,a)),t},N.prototype.buffer=N.prototype.arrayBuffer,N.prototype.digest=N.prototype.array=function(){this.finalize();for(var t,e,r=this.blockCount,i=this.s,n=this.outputBlocks,s=this.extraBytes,o=0,a=0,c=[];a<n;){for(o=0;o<r&&a<n;++o,++a)t=a<<2,e=i[o],c[t]=255&e,c[t+1]=e>>8&255,c[t+2]=e>>16&255,c[t+3]=e>>24&255;a%r===0&&C(i)}return s&&(t=a<<2,e=i[o],c[t]=255&e,s>1&&(c[t+1]=e>>8&255),s>2&&(c[t+2]=e>>16&255)),c},R.prototype=new N,R.prototype.finalize=function(){return this.encode(this.outputBits,!0),N.prototype.finalize.call(this)};var C=function(t){var e,r,i,n,s,o,a,c,h,f,l,d,p,g,m,v,b,y,w,_,A,E,S,M,I,x,P,O,N,R,C,T,k,L,q,D,U,B,j,z,F,H,K,V,W,G,J,Y,Q,X,Z,$,tt,et,rt,it,nt,st,ot,at,ct,ht,ut;for(i=0;i<48;i+=2)n=t[0]^t[10]^t[20]^t[30]^t[40],s=t[1]^t[11]^t[21]^t[31]^t[41],o=t[2]^t[12]^t[22]^t[32]^t[42],a=t[3]^t[13]^t[23]^t[33]^t[43],c=t[4]^t[14]^t[24]^t[34]^t[44],h=t[5]^t[15]^t[25]^t[35]^t[45],f=t[6]^t[16]^t[26]^t[36]^t[46],l=t[7]^t[17]^t[27]^t[37]^t[47],e=(d=t[8]^t[18]^t[28]^t[38]^t[48])^(o<<1|a>>>31),r=(p=t[9]^t[19]^t[29]^t[39]^t[49])^(a<<1|o>>>31),t[0]^=e,t[1]^=r,t[10]^=e,t[11]^=r,t[20]^=e,t[21]^=r,t[30]^=e,t[31]^=r,t[40]^=e,t[41]^=r,e=n^(c<<1|h>>>31),r=s^(h<<1|c>>>31),t[2]^=e,t[3]^=r,t[12]^=e,t[13]^=r,t[22]^=e,t[23]^=r,t[32]^=e,t[33]^=r,t[42]^=e,t[43]^=r,e=o^(f<<1|l>>>31),r=a^(l<<1|f>>>31),t[4]^=e,t[5]^=r,t[14]^=e,t[15]^=r,t[24]^=e,t[25]^=r,t[34]^=e,t[35]^=r,t[44]^=e,t[45]^=r,e=c^(d<<1|p>>>31),r=h^(p<<1|d>>>31),t[6]^=e,t[7]^=r,t[16]^=e,t[17]^=r,t[26]^=e,t[27]^=r,t[36]^=e,t[37]^=r,t[46]^=e,t[47]^=r,e=f^(n<<1|s>>>31),r=l^(s<<1|n>>>31),t[8]^=e,t[9]^=r,t[18]^=e,t[19]^=r,t[28]^=e,t[29]^=r,t[38]^=e,t[39]^=r,t[48]^=e,t[49]^=r,g=t[0],m=t[1],G=t[11]<<4|t[10]>>>28,J=t[10]<<4|t[11]>>>28,O=t[20]<<3|t[21]>>>29,N=t[21]<<3|t[20]>>>29,at=t[31]<<9|t[30]>>>23,ct=t[30]<<9|t[31]>>>23,H=t[40]<<18|t[41]>>>14,K=t[41]<<18|t[40]>>>14,L=t[2]<<1|t[3]>>>31,q=t[3]<<1|t[2]>>>31,v=t[13]<<12|t[12]>>>20,b=t[12]<<12|t[13]>>>20,Y=t[22]<<10|t[23]>>>22,Q=t[23]<<10|t[22]>>>22,R=t[33]<<13|t[32]>>>19,C=t[32]<<13|t[33]>>>19,ht=t[42]<<2|t[43]>>>30,ut=t[43]<<2|t[42]>>>30,et=t[5]<<30|t[4]>>>2,rt=t[4]<<30|t[5]>>>2,D=t[14]<<6|t[15]>>>26,U=t[15]<<6|t[14]>>>26,y=t[25]<<11|t[24]>>>21,w=t[24]<<11|t[25]>>>21,X=t[34]<<15|t[35]>>>17,Z=t[35]<<15|t[34]>>>17,T=t[45]<<29|t[44]>>>3,k=t[44]<<29|t[45]>>>3,M=t[6]<<28|t[7]>>>4,I=t[7]<<28|t[6]>>>4,it=t[17]<<23|t[16]>>>9,nt=t[16]<<23|t[17]>>>9,B=t[26]<<25|t[27]>>>7,j=t[27]<<25|t[26]>>>7,_=t[36]<<21|t[37]>>>11,A=t[37]<<21|t[36]>>>11,$=t[47]<<24|t[46]>>>8,tt=t[46]<<24|t[47]>>>8,V=t[8]<<27|t[9]>>>5,W=t[9]<<27|t[8]>>>5,x=t[18]<<20|t[19]>>>12,P=t[19]<<20|t[18]>>>12,st=t[29]<<7|t[28]>>>25,ot=t[28]<<7|t[29]>>>25,z=t[38]<<8|t[39]>>>24,F=t[39]<<8|t[38]>>>24,E=t[48]<<14|t[49]>>>18,S=t[49]<<14|t[48]>>>18,t[0]=g^~v&y,t[1]=m^~b&w,t[10]=M^~x&O,t[11]=I^~P&N,t[20]=L^~D&B,t[21]=q^~U&j,t[30]=V^~G&Y,t[31]=W^~J&Q,t[40]=et^~it&st,t[41]=rt^~nt&ot,t[2]=v^~y&_,t[3]=b^~w&A,t[12]=x^~O&R,t[13]=P^~N&C,t[22]=D^~B&z,t[23]=U^~j&F,t[32]=G^~Y&X,t[33]=J^~Q&Z,t[42]=it^~st&at,t[43]=nt^~ot&ct,t[4]=y^~_&E,t[5]=w^~A&S,t[14]=O^~R&T,t[15]=N^~C&k,t[24]=B^~z&H,t[25]=j^~F&K,t[34]=Y^~X&$,t[35]=Q^~Z&tt,t[44]=st^~at&ht,t[45]=ot^~ct&ut,t[6]=_^~E&g,t[7]=A^~S&m,t[16]=R^~T&M,t[17]=C^~k&I,t[26]=z^~H&L,t[27]=F^~K&q,t[36]=X^~$&V,t[37]=Z^~tt&W,t[46]=at^~ht&et,t[47]=ct^~ut&rt,t[8]=E^~g&v,t[9]=S^~m&b,t[18]=T^~M&x,t[19]=k^~I&P,t[28]=H^~L&D,t[29]=K^~q&U,t[38]=$^~V&G,t[39]=tt^~W&J,t[48]=ht^~et&it,t[49]=ut^~rt&nt,t[0]^=u[i],t[1]^=u[i+1]};if(s)t.exports=A;else for(S=0;S<E.length;++S)i[E[S]]=A[E[S]]}()}(Or);var Nr=Or.exports;let Rr=!1,Cr=!1;const Tr={debug:1,default:2,info:2,warning:3,error:4,off:5};let kr=Tr.default,Lr=null;const qr=function(){try{const t=[];if(["NFD","NFC","NFKD","NFKC"].forEach((e=>{try{if("test"!=="test".normalize(e))throw new Error("bad normalize")}catch(r){t.push(e)}})),t.length)throw new Error("missing "+t.join(", "));if(String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw new Error("broken implementation")}catch(t){return t.message}return null}();var Dr,Ur;!function(t){t.DEBUG="DEBUG",t.INFO="INFO",t.WARNING="WARNING",t.ERROR="ERROR",t.OFF="OFF"}(Dr||(Dr={}
2)),function(t){t.UNKNOWN_ERROR="UNKNOWN_ERROR",t.NOT_IMPLEMENTED="NOT_IMPLEMENTED",t.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",t.NETWORK_ERROR="NETWORK_ERROR",t.SERVER_ERROR="SERVER_ERROR",t.TIMEOUT="TIMEOUT",t.BUFFER_OVERRUN="BUFFER_OVERRUN",t.NUMERIC_FAULT="NUMERIC_FAULT",t.MISSING_NEW="MISSING_NEW",t.INVALID_ARGUMENT="INVALID_ARGUMENT",t.MISSING_ARGUMENT="MISSING_ARGUMENT",t.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",t.CALL_EXCEPTION="CALL_EXCEPTION",t.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",t.NONCE_EXPIRED="NONCE_EXPIRED",t.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",t.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",t.TRANSACTION_REPLACED="TRANSACTION_REPLACED",t.ACTION_REJECTED="ACTION_REJECTED"}(Ur||(Ur={}));const Br="0123456789abcdef";class jr{constructor(t){Object.defineProperty(this,"version",{enumerable:!0,value:t,writable:!1})}_log(t,e){const r=t.toLowerCase();null==Tr[r]&&this.throwArgumentError("invalid log level name","logLevel",t),!(kr>Tr[r])&&console.log.apply(console,e)}debug(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];this._log(jr.levels.DEBUG,e)}info(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];this._log(jr.levels.INFO,e)}warn(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];this._log(jr.levels.WARNING,e)}makeError(t,e,r){if(Cr)return this.makeError("censored error",e,{});e||(e=jr.errors.UNKNOWN_ERROR),r||(r={});const i=[];Object.keys(r).forEach((t=>{const e=r[t];try{if(e instanceof Uint8Array){let r="";for(let t=0;t<e.length;t++)r+=Br[e[t]>>4],r+=Br[15&e[t]];i.push(t+"=Uint8Array(0x"+r+")")}else i.push(t+"="+JSON.stringify(e))}catch(n){i.push(t+"="+JSON.stringify(r[t].toString()))}})),i.push("code=".concat(e)),i.push("version=".concat(this.version));const n=t;let s="";switch(e){case Ur.NUMERIC_FAULT:{s="NUMERIC_FAULT";const e=t;switch(e){case"overflow":case"underflow":case"division-by-zero":s+="-"+e;break;case"negative-power":case"negative-width":s+="-unsupported";break;case"unbound-bitwise-result":s+="-unbound-result"}break}case Ur.CALL_EXCEPTION:case Ur.INSUFFICIENT_FUNDS:case Ur.MISSING_NEW:case Ur.NONCE_EXPIRED:case Ur.REPLACEMENT_UNDERPRICED:case Ur.TRANSACTION_REPLACED:case Ur.UNPREDICTABLE_GAS_LIMIT:s=e}s&&(t+=" [ See: https://links.ethers.org/v5-errors-"+s+" ]"),i.length&&(t+=" ("+i.join(", ")+")");const o=new Error(t);return o.reason=n,o.code=e,Object.keys(r).forEach((function(t){o[t]=r[t]})),o}throwError(t,e,r){throw this.makeError(t,e,r)}throwArgumentError(t,e,r){return this.throwError(t,jr.errors.INVALID_ARGUMENT,{argument:e,value:r})}assert(t,e,r,i){t||this.throwError(e,r,i)}assertArgument(t,e,r,i){t||this.throwArgumentError(e,r,i)}checkNormalize(t){qr&&this.throwError("platform missing String.prototype.normalize",jr.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:qr})}checkSafeUint53(t,e){"number"==typeof t&&(null==e&&(e="value not safe"),(t<0||t>=9007199254740991)&&this.throwError(e,jr.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:t}),t%1&&this.throwError(e,jr.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:t}))}checkArgumentCount(t,e,r){r=r?": "+r:"",t<e&&this.throwError("missing argument"+r,jr.errors.MISSING_ARGUMENT,{count:t,expectedCount:e}),t>e&&this.throwError("too many arguments"+r,jr.errors.UNEXPECTED_ARGUMENT,{count:t,expectedCount:e})}checkNew(t,e){(t===Object||null==t)&&this.throwError("missing new",jr.errors.MISSING_NEW,{name:e.name})}checkAbstract(t,e){t===e?this.throwError("cannot instantiate abstract class "+JSON.stringify(e.name)+" directly; use a sub-class",jr.errors.UNSUPPORTED_OPERATION,{name:t.name,operation:"new"}):(t===Object||null==t)&&this.throwError("missing new",jr.errors.MISSING_NEW,{name:e.name})}static globalLogger(){return Lr||(Lr=new jr("logger/5.7.0")),Lr}static setCensorship(t,e){if(!t&&e&&this.globalLogger().throwError("cannot permanently disable censorship",jr.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),Rr){if(!t)return;this.globalLogger().throwError("error censorship permanent",jr.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}Cr=!!t,Rr=!!e}static setLogLevel(t){const e=Tr[t.toLowerCase()];null!=e?kr=e:jr.globalLogger().warn("invalid log level - "+t)}static from(t){return new jr(t)}}jr.errors=Ur,jr.levels=Dr;const zr=new jr("bytes/5.7.0");function Fr(t){return!!t.toHexString}function Hr(t){return t.slice||(t.slice=function(){const e=Array.prototype.slice.call(arguments);return Hr(new Uint8Array(Array.prototype.slice.apply(t,e)))}),t}function Kr(t){return"number"==typeof t&&t==t&&t%1===0}function Vr(t){if(null==t)return!1;if(t.constructor===Uint8Array)return!0;
2if("string"==typeof t||!Kr(t.length)||t.length<0)return!1;for(let e=0;e<t.length;e++){const r=t[e];if(!Kr(r)||r<0||r>=256)return!1}return!0}function Wr(t,e){if(e||(e={}),"number"==typeof t){zr.checkSafeUint53(t,"invalid arrayify value");const e=[];for(;t;)e.unshift(255&t),t=parseInt(String(t/256));return 0===e.length&&e.push(0),Hr(new Uint8Array(e))}if(e.allowMissingPrefix&&"string"==typeof t&&"0x"!==t.substring(0,2)&&(t="0x"+t),Fr(t)&&(t=t.toHexString()),Gr(t)){let r=t.substring(2);r.length%2&&("left"===e.hexPad?r="0"+r:"right"===e.hexPad?r+="0":zr.throwArgumentError("hex data is odd-length","value",t));const i=[];for(let t=0;t<r.length;t+=2)i.push(parseInt(r.substring(t,t+2),16));return Hr(new Uint8Array(i))}return Vr(t)?Hr(new Uint8Array(t)):zr.throwArgumentError("invalid arrayify value","value",t)}function Gr(t,e){return!("string"!=typeof t||!t.match(/^0x[0-9A-Fa-f]*$/)||e&&t.length!==2+2*e)}const Jr="0123456789abcdef";function Yr(t,e){if(e||(e={}),"number"==typeof t){zr.checkSafeUint53(t,"invalid hexlify value");let e="";for(;t;)e=Jr[15&t]+e,t=Math.floor(t/16);return e.length?(e.length%2&&(e="0"+e),"0x"+e):"0x00"}if("bigint"==typeof t)return(t=t.toString(16)).length%2?"0x0"+t:"0x"+t;if(e.allowMissingPrefix&&"string"==typeof t&&"0x"!==t.substring(0,2)&&(t="0x"+t),Fr(t))return t.toHexString();if(Gr(t))return t.length%2&&("left"===e.hexPad?t="0x0"+t.substring(2):"right"===e.hexPad?t+="0":zr.throwArgumentError("hex data is odd-length","value",t)),t.toLowerCase();if(Vr(t)){let e="0x";for(let r=0;r<t.length;r++){let i=t[r];e+=Jr[(240&i)>>4]+Jr[15&i]}return e}return zr.throwArgumentError("invalid hexlify value","value",t)}function Qr(t,e,r){return"string"!=typeof t?t=Yr(t):(!Gr(t)||t.length%2)&&zr.throwArgumentError("invalid hexData","value",t),e=2+2*e,null!=r?"0x"+t.substring(e,2+2*r):"0x"+t.substring(e)}function Xr(t,e){for("string"!=typeof t?t=Yr(t):Gr(t)||zr.throwArgumentError("invalid hex string","value",t),t.length>2*e+2&&zr.throwArgumentError("value out of range","value",arguments[1]);t.length<2*e+2;)t="0x0"+t.substring(2);return t}function Zr(t){const e={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0,yParityAndS:"0x",compact:"0x"};if(function(t){return Gr(t)&&!(t.length%2)||Vr(t)}(t)){let r=Wr(t);64===r.length?(e.v=27+(r[32]>>7),r[32]&=127,e.r=Yr(r.slice(0,32)),e.s=Yr(r.slice(32,64))):65===r.length?(e.r=Yr(r.slice(0,32)),e.s=Yr(r.slice(32,64)),e.v=r[64]):zr.throwArgumentError("invalid signature string","signature",t),e.v<27&&(0===e.v||1===e.v?e.v+=27:zr.throwArgumentError("signature invalid v byte","signature",t)),e.recoveryParam=1-e.v%2,e.recoveryParam&&(r[32]|=128),e._vs=Yr(r.slice(32,64))}else{if(e.r=t.r,e.s=t.s,e.v=t.v,e.recoveryParam=t.recoveryParam,e._vs=t._vs,null!=e._vs){const r=function(t,e){(t=Wr(t)).length>e&&zr.throwArgumentError("value out of range","value",arguments[0]);const r=new Uint8Array(e);return r.set(t,e-t.length),Hr(r)}(Wr(e._vs),32);e._vs=Yr(r);const i=r[0]>=128?1:0;null==e.recoveryParam?e.recoveryParam=i:e.recoveryParam!==i&&zr.throwArgumentError("signature recoveryParam mismatch _vs","signature",t),r[0]&=127;const n=Yr(r);null==e.s?e.s=n:e.s!==n&&zr.throwArgumentError("signature v mismatch _vs","signature",t)}if(null==e.recoveryParam)null==e.v?zr.throwArgumentError("signature missing v and recoveryParam","signature",t):0===e.v||1===e.v?e.recoveryParam=e.v:e.recoveryParam=1-e.v%2;else if(null==e.v)e.v=27+e.recoveryParam;else{const r=0===e.v||1===e.v?e.v:1-e.v%2;e.recoveryParam!==r&&zr.throwArgumentError("signature recoveryParam mismatch v","signature",t)}null!=e.r&&Gr(e.r)?e.r=Xr(e.r,32):zr.throwArgumentError("signature missing or invalid r","signature",t),null!=e.s&&Gr(e.s)?e.s=Xr(e.s,32):zr.throwArgumentError("signature missing or invalid s","signature",t);const r=Wr(e.s);r[0]>=128&&zr.throwArgumentError("signature s out of range","signature",t),e.recoveryParam&&(r[0]|=128);const i=Yr(r);e._vs&&(Gr(e._vs)||zr.throwArgumentError("signature invalid _vs","signature",t),e._vs=Xr(e._vs,32)),null==e._vs?e._vs=i:e._vs!==i&&zr.throwArgumentError("signature _vs mismatch v and s","signature",t)}return e.yParityAndS=e._vs,e.compact=e.r+e.yParityAndS.substring(2),e}function $r(t){return"0x"+Nr.keccak_256(Wr(t))}var ti={exports:{}},ei=function(t){var e=t.default;if("function"==typeof e){var r=function(){return e.apply(this,arguments)};r.prototype=e.prototype}else r={};
vendor: 5,097 bytes, line 2
2return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(t).forEach((function(e){var i=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(r,e,i.get?i:{enumerable:!0,get:function(){return t[e]}})})),r}(Object.freeze({__proto__:null,default:{}}));!function(t){!function(t,e){function r(t,e){if(!t)throw new Error(e||"Assertion failed")}function i(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function n(t,e,r){if(n.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&(("le"===e||"be"===e)&&(r=e,e=10),this._init(t||0,e||10,r||"be"))}var s;"object"==typeof t?t.exports=n:e.BN=n,n.BN=n,n.wordSize=26;try{s=typeof window<"u"&&typeof window.Buffer<"u"?window.Buffer:ei.Buffer}catch(I){}function o(t,e){var i=t.charCodeAt(e);return i>=48&&i<=57?i-48:i>=65&&i<=70?i-55:i>=97&&i<=102?i-87:void r(!1,"Invalid character in "+t)}function a(t,e,r){var i=o(t,r);return r-1>=e&&(i|=o(t,r-1)<<4),i}function c(t,e,i,n){for(var s=0,o=0,a=Math.min(t.length,i),c=e;c<a;c++){var h=t.charCodeAt(c)-48;s*=n,o=h>=49?h-49+10:h>=17?h-17+10:h,r(h>=0&&o<n,"Invalid character"),s+=o}return s}function h(t,e){t.words=e.words,t.length=e.length,t.negative=e.negative,t.red=e.red}if(n.isBN=function(t){return t instanceof n||null!==t&&"object"==typeof t&&t.constructor.wordSize===n.wordSize&&Array.isArray(t.words)},n.max=function(t,e){return t.cmp(e)>0?t:e},n.min=function(t,e){return t.cmp(e)<0?t:e},n.prototype._init=function(t,e,i){if("number"==typeof t)return this._initNumber(t,e,i);if("object"==typeof t)return this._initArray(t,e,i);"hex"===e&&(e=16),r(e===(0|e)&&e>=2&&e<=36);var n=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(n++,this.negative=1),n<t.length&&(16===e?this._parseHex(t,n,i):(this._parseBase(t,e,n),"le"===i&&this._initArray(this.toArray(),e,i)))},n.prototype._initNumber=function(t,e,i){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(r(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===i&&this._initArray(this.toArray(),e,i)},n.prototype._initArray=function(t,e,i){if(r("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var s,o,a=0;if("be"===i)for(n=t.length-1,s=0;n>=0;n-=3)o=t[n]|t[n-1]<<8|t[n-2]<<16,this.words[s]|=o<<a&67108863,this.words[s+1]=o>>>26-a&67108863,(a+=24)>=26&&(a-=26,s++);else if("le"===i)for(n=0,s=0;n<t.length;n+=3)o=t[n]|t[n+1]<<8|t[n+2]<<16,this.words[s]|=o<<a&67108863,this.words[s+1]=o>>>26-a&67108863,(a+=24)>=26&&(a-=26,s++);return this._strip()},n.prototype._parseHex=function(t,e,r){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var n,s=0,o=0;if("be"===r)for(i=t.length-1;i>=e;i-=2)n=a(t,e,i)<<s,this.words[o]|=67108863&n,s>=18?(s-=18,o+=1,this.words[o]|=n>>>26):s+=8;else for(i=(t.length-e)%2===0?e+1:e;i<t.length;i+=2)n=a(t,e,i)<<s,this.words[o]|=67108863&n,s>=18?(s-=18,o+=1,this.words[o]|=n>>>26):s+=8;this._strip()},n.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var i=0,n=1;n<=67108863;n*=e)i++;i--,n=n/e|0;for(var s=t.length-r,o=s%i,a=Math.min(s,s-o)+r,h=0,u=r;u<a;u+=i)h=c(t,u,u+i,e),this.imuln(n),this.words[0]+h<67108864?this.words[0]+=h:this._iaddn(h);if(0!==o){var f=1;for(h=c(t,u,t.length,e),u=0;u<o;u++)f*=e;this.imuln(f),this.words[0]+h<67108864?this.words[0]+=h:this._iaddn(h)}this._strip()},n.prototype.copy=function(t){t.words=new Array(this.length);for(var e=0;e<this.length;e++)t.words[e]=this.words[e];t.length=this.length,t.negative=this.negative,t.red=this.red},n.prototype._move=function(t){h(t,this)},n.prototype.clone=function(){var t=new n(null);return this.copy(t),t},n.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},n.prototype._strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},n.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},typeof Symbol<"u"&&"function"==typeof Symbol.for)try{n.prototype[Symbol.for("nodejs.util.inspect.custom")]=u}catch(x){n.prototype.inspect=u}else n.prototype.inspect=u;function u(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var f=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],l=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],d=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16
vendor: 32,684 bytes, line 2
2777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];n.prototype.toString=function(t,e){var i;if(e=0|e||1,16===(t=t||10)||"hex"===t){i="";for(var n=0,s=0,o=0;o<this.length;o++){var a=this.words[o],c=(16777215&(a<<n|s)).toString(16);s=a>>>24-n&16777215,(n+=2)>=26&&(n-=26,o--),i=0!==s||o!==this.length-1?f[6-c.length]+c+i:c+i}for(0!==s&&(i=s.toString(16)+i);i.length%e!==0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}if(t===(0|t)&&t>=2&&t<=36){var h=l[t],u=d[t];i="";var p=this.clone();for(p.negative=0;!p.isZero();){var g=p.modrn(u).toString(t);i=(p=p.idivn(u)).isZero()?g+i:f[h-g.length]+g+i}for(this.isZero()&&(i="0"+i);i.length%e!==0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}r(!1,"Base should be between 2 and 36")},n.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},n.prototype.toJSON=function(){return this.toString(16,2)},s&&(n.prototype.toBuffer=function(t,e){return this.toArrayLike(s,t,e)}),n.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)};function p(t,e,r){r.negative=e.negative^t.negative;var i=t.length+e.length|0;r.length=i,i=i-1|0;var n=0|t.words[0],s=0|e.words[0],o=n*s,a=67108863&o,c=o/67108864|0;r.words[0]=a;for(var h=1;h<i;h++){for(var u=c>>>26,f=67108863&c,l=Math.min(h,e.length-1),d=Math.max(0,h-t.length+1);d<=l;d++){var p=h-d|0;u+=(o=(n=0|t.words[p])*(s=0|e.words[d])+f)/67108864|0,f=67108863&o}r.words[h]=0|f,c=0|u}return 0!==c?r.words[h]=0|c:r.length--,r._strip()}n.prototype.toArrayLike=function(t,e,i){this._strip();var n=this.byteLength(),s=i||Math.max(1,n);r(n<=s,"byte array longer than desired length"),r(s>0,"Requested array length <= 0");var o=function(t,e){return t.allocUnsafe?t.allocUnsafe(e):new t(e)}(t,s);return this["_toArrayLike"+("le"===e?"LE":"BE")](o,n),o},n.prototype._toArrayLikeLE=function(t,e){for(var r=0,i=0,n=0,s=0;n<this.length;n++){var o=this.words[n]<<s|i;t[r++]=255&o,r<t.length&&(t[r++]=o>>8&255),r<t.length&&(t[r++]=o>>16&255),6===s?(r<t.length&&(t[r++]=o>>24&255),i=0,s=0):(i=o>>>24,s+=2)}if(r<t.length)for(t[r++]=i;r<t.length;)t[r++]=0},n.prototype._toArrayLikeBE=function(t,e){for(var r=t.length-1,i=0,n=0,s=0;n<this.length;n++){var o=this.words[n]<<s|i;t[r--]=255&o,r>=0&&(t[r--]=o>>8&255),r>=0&&(t[r--]=o>>16&255),6===s?(r>=0&&(t[r--]=o>>24&255),i=0,s=0):(i=o>>>24,s+=2)}if(r>=0)for(t[r--]=i;r>=0;)t[r--]=0},Math.clz32?n.prototype._countBits=function(t){return 32-Math.clz32(t)}:n.prototype._countBits=function(t){var e=t,r=0;return e>=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},n.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 8191&e||(r+=13,e>>>=13),127&e||(r+=7,e>>>=7),15&e||(r+=4,e>>>=4),3&e||(r+=2,e>>>=2),1&e||r++,r},n.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},n.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;e<this.length;e++){var r=this._zeroBits(this.words[e]);if(t+=r,26!==r)break}return t},n.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},n.prototype.toTwos=function(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},n.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},n.prototype.isNeg=function(){return 0!==this.negative},n.prototype.neg=function(){return this.clone().ineg()},n.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},n.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var e=0;e<t.length;e++)this.words[e]=this.words[e]|t.words[e];return this._strip()},n.prototype.ior=function(t){return r(0===(this.negative|t.negative)),this.iuor(t)},n.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},n.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},n.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;r<e.length;r++)this.words[r]=this.words[r]&t.words[r];return this.length=e.length,this._strip()},n.prototype.iand=function(t){return r(0===(this.negative|t.negative)),this.iuand(t)},n.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},n.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},n.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var i=0;i<r.length;i++)this.words[i]=e.words[i]^r.words[i];if(this!==e)for(;i<e.length;i++)this.words[i]=e.words[i];return this.length=e.length,this._strip()},n.prototype.ixor=function(t){return r(0===(this.negative|t.negative)),this.iuxor(t)},n.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},n.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},n.prototype.inotn=function(t){r("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),i=t%26;this._expand(e),i>0&&e--;for(var n=0;n<e;n++)this.words[n]=67108863&~this.words[n];return i>0&&(this.words[n]=~this.words[n]&67108863>>26-i),this._strip()},n.prototype.notn=function(t){return this.clone().inotn(t)},n.prototype.setn=function(t,e){r("number"==typeof t&&t>=0);var i=t/26|0,n=t%26;return this._expand(i+1),this.words[i]=e?this.words[i]|1<<n:this.words[i]&~(1<<n),this._strip()},n.prototype.iadd=function(t){var e,r,i;if(0!==this.negative&&0===t.negative)return this.negative=0,e=this.isub(t),this.negative^=1,this._normSign();if(0===this.negative&&0!==t.negative)return t.negative=0,e=this.isub(t),t.negative=1,e._normSign();this.length>t.length?(r=this,i=t):(r=t,i=this);for(var n=0,s=0;s<i.length;s++)e=(0|r.words[s])+(0|i.words[s])+n,this.words[s]=67108863&e,n=e>>>26;for(;0!==n&&s<r.length;s++)e=(0|r.words[s])+n,this.words[s]=67108863&e,n=e>>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;s<r.length;s++)this.words[s]=r.words[s];return this},n.prototype.add=function(t){var e;return 0!==t.negative&&0===this.negative?(t.negative=0,e=this.sub(t),t.negative^=1,e):0===t.negative&&0!==this.negative?(this.negative=0,e=t.sub(this),this.negative=1,e):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},n.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,i,n=this.cmp(t);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(r=this,i=t):(r=t,i=this);for(var s=0,o=0;o<i.length;o++)s=(e=(0|r.words[o])-(0|i.words[o])+s)>>26,this.words[o]=67108863&e;for(;0!==s&&o<r.length;o++)s=(e=(0|r.words[o])+s)>>26,this.words[o]=67108863&e;if(0===s&&o<r.length&&r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this.length=Math.max(this.length,o),r!==this&&(this.negative=1),this._strip()},n.prototype.sub=function(t){return this.clone().isub(t)};var g=function(t,e,r){var i,n,s,o=t.words,a=e.words,c=r.words,h=0,u=0|o[0],f=8191&u,l=u>>>13,d=0|o[1],p=8191&d,g=d>>>13,m=0|o[2],v=8191&m,b=m>>>13,y=0|o[3],w=8191&y,_=y>>>13,A=0|o[4],E=8191&A,S=A>>>13,M=0|o[5],I=8191&M,x=M>>>13,P=0|o[6],O=8191&P,N=P>>>13,R=0|o[7],C=8191&R,T=R>>>13,k=0|o[8],L=8191&k,q=k>>>13,D=0|o[9],U=8191&D,B=D>>>13,j=0|a[0],z=8191&j,F=j>>>13,H=0|a[1],K=8191&H,V=H>>>13,W=0|a[2],G=8191&W,J=W>>>13,Y=0|a[3],Q=8191&Y,X=Y>>>13,Z=0|a[4],$=8191&Z,tt=Z>>>13,et=0|a[5],rt=8191&et,it=et>>>13,nt=0|a[6],st=8191&nt,ot=nt>>>13,at=0|a[7],ct=8191&at,ht=at>>>13,ut=0|a[8],ft=8191&ut,lt=ut>>>13,dt=0|a[9],pt=8191&dt,gt=dt>>>13;r.negative=t.negative^e.negative,r.length=19;var mt=(h+(i=Math.imul(f,z))|0)+((8191&(n=(n=Math.imul(f,F))+Math.imul(l,z)|0))<<13)|0;h=((s=Math.imul(l,F))+(n>>>13)|0)+(mt>>>26)|0,mt&=67108863,i=Math.imul(p,z),n=(n=Math.imul(p,F))+Math.imul(g,z)|0,s=Math.imul(g,F);var vt=(h+(i=i+Math.imul(f,K)|0)|0)+((8191&(n=(n=n+Math.imul(f,V)|0)+Math.imul(l,K)|0))<<13)|0;h=((s=s+Math.imul(l,V)|0)+(n>>>13)|0)+(vt>>>26)|0,vt&=67108863,i=Math.imul(v,z),n=(n=Math.imul(v,F))+Math.imul(b,z)|0,s=Math.imul(b,F),i=i+Math.imul(p,K)|0,n=(n=n+Math.imul(p,V)|0)+Math.imul(g,K)|0,s=s+Math.imul(g,V)|0;var bt=(h+(i=i+Math.imul(f,G)|0)|0)+((8191&(n=(n=n+Math.imul(f,J)|0)+Math.imul(l,G)|0))<<13)|0;h=((s=s+Math.imul(l,J)|0)+(n>>>13)|0)+(bt>>>26)|0,bt&=67108863,i=Math.imul(w,z),n=(n=Math.imul(w,F))+Math.imul(_,z)|0,s=Math.imul(_,F),i=i+Math.imul(v,K)|0,n=(n=n+Math.imul(v,V)|0)+Math.imul(b,K)|0,s=s+Math.imul(b,V)|0,i=i+Math.imul(p,G)|0,n=(n=n+Math.imul(p,J)|0)+Math.imul(g,G)|0,s=s+Math.imul(g,J)|0;var yt=(h+(i=i+Math.imul(f,Q)|0)|0)+((8191&(n=(n=n+Math.imul(f,X)|0)+Math.imul(l,Q)|0))<<13)|0;h=((s=s+Math.imul(l,X)|0)+(n>>>13)|0)+(yt>>>26)|0,yt&=67108863,i=Math.imul(E,z),n=(n=Math.imul(E,F))+Math.imul(S,z)|0,s=Math.imul(S,F),i=i+Math.imul(w,K)|0,n=(n=n+Math.imul(w,V)|0)+Math.imul(_,K)|0,s=s+Math.imul(_,V)|0,i=i+Math.imul(v,G)|0,n=(n=n+Math.imul(v,J)|0)+Math.imul(b,G)|0,s=s+Math.imul(b,J)|0,i=i+Math.imul(p,Q)|0,n=(n=n+Math.imul(p,X)|0)+Math.imul(g,Q)|0,s=s+Math.imul(g,X)|0;var wt=(h+(i=i+Math.imul(f,$)|0)|0)+((8191&(n=(n=n+Math.imul(f,tt)|0)+Math.imul(l,$)|0))<<13)|0;h=((s=s+Math.imul(l,tt)|0)+(n>>>13)|0)+(wt>>>26)|0,wt&=67108863,i=Math.imul(I,z),n=(n=Math.imul(I,F))+Math.imul(x,z)|0,s=Math.imul(x,F),i=i+Math.imul(E,K)|0,n=(n=n+Math.imul(E,V)|0)+Math.imul(S,K)|0,s=s+Math.imul(S,V)|0,i=i+Math.imul(w,G)|0,n=(n=n+Math.imul(w,J)|0)+Math.imul(_,G)|0,s=s+Math.imul(_,J)|0,i=i+Math.imul(v,Q)|0,n=(n=n+Math.imul(v,X)|0)+Math.imul(b,Q)|0,s=s+Math.imul(b,X)|0,i=i+Math.imul(p,$)|0,n=(n=n+Math.imul(p,tt)|0)+Math.imul(g,$)|0,s=s+Math.imul(g,tt)|0;var _t=(h+(i=i+Math.imul(f,rt)|0)|0)+((8191&(n=(n=n+Math.imul(f,it)|0)+Math.imul(l,rt)|0))<<13)|0;h=((s=s+Math.imul(l,it)|0)+(n>>>13)|0)+(_t>>>26)|0,_t&=67108863,i=Math.imul(O,z),n=(n=Math.imul(O,F))+Math.imul(N,z)|0,s=Math.imul(N,F),i=i+Math.imul(I,K)|0,n=(n=n+Math.imul(I,V)|0)+Math.imul(x,K)|0,s=s+Math.imul(x,V)|0,i=i+Math.imul(E,G)|0,n=(n=n+Math.imul(E,J)|0)+Math.imul(S,G)|0,s=s+Math.imul(S,J)|0,i=i+Math.imul(w,Q)|0,n=(n=n+Math.imul(w,X)|0)+Math.imul(_,Q)|0,s=s+Math.imul(_,X)|0,i=i+Math.imul(v,$)|0,n=(n=n+Math.imul(v,tt)|0)+Math.imul(b,$)|0,s=s+Math.imul(b,tt)|0,i=i+Math.imul(p,rt)|0,n=(n=n+Math.imul(p,it)|0)+Math.imul(g,rt)|0,s=s+Math.imul(g,it)|0;var At=(h+(i=i+Math.imul(f,st)|0)|0)+((8191&(n=(n=n+Math.imul(f,ot)|0)+Math.imul(l,st)|0))<<13)|0;h=((s=s+Math.imul(l,ot)|0)+(n>>>13)|0)+(At>>>26)|0,At&=67108863,i=Math.imul(C,z),n=(n=Math.imul(C,F))+Math.imul(T,z)|0,s=Math.imul(T,F),i=i+Math.imul(O,K)|0,n=(n=n+Math.imul(O,V)|0)+Math.imul(N,K)|0,s=s+Math.imul(N,V)|0,i=i+Math.imul(I,G)|0,n=(n=n+Math.imul(I,J)|0)+Math.imul(x,G)|0,s=s+Math.imul(x,J)|0,i=i+Math.imul(E,Q)|0,n=(n=n+Math.imul(E,X)|0)+Math.imul(S,Q)|0,s=s+Math.imul(S,X)|0,i=i+Math.imul(w,$)|0,n=(n=n+Math.imul(w,tt)|0)+Math.imul(_,$)|0,s=s+Math.imul(_,tt)|0,i=i+Math.imul(v,rt)|0,n=(n=n+Math.imul(v,it)|0)+Math.imul(b,rt)|0,s=s+Math.imul(b,it)|0,i=i+Math.imul(p,st)|0,n=(n=n+Math.imul(p,ot)|0)+Math.imul(g,st)|0,s=s+Math.imul(g,ot)|0;var Et=(h+(i=i+Math.imul(f,ct)|0)|0)+((8191&(n=(n=n+Math.imul(f,ht)|0)+Math.imul(l,ct)|0))<<13)|0;h=((s=s+Math.imul(l,ht)|0)+(n>>>13)|0)+(Et>>>26)|0,Et&=67108863,i=Math.imul(L,z),n=(n=Math.imul(L,F))+Math.imul(q,z)|0,s=Math.imul(q,F),i=i+Math.imul(C,K)|0,n=(n=n+Math.imul(C,V)|0)+Math.imul(T,K)|0,s=s+Math.imul(T,V)|0,i=i+Math.imul(O,G)|0,n=(n=n+Math.imul(O,J)|0)+Math.imul(N,G)|0,s=s+Math.imul(N,J)|0,i=i+Math.imul(I,Q)|0,n=(n=n+Math.imul(I,X)|0)+Math.imul(x,Q)|0,s=s+Math.imul(x,X)|0,i=i+Math.imul(E,$)|0,n=(n=n+Math.imul(E,tt)|0)+Math.imul(S,$)|0,s=s+Math.imul(S,tt)|0,i=i+Math.imul(w,rt)|0,n=(n=n+Math.imul(w,it)|0)+Math.imul(_,rt)|0,s=s+Math.imul(_,it)|0,i=i+Math.imul(v,st)|0,n=(n=n+Math.imul(v,ot)|0)+Math.imul(b,st)|0,s=s+Math.imul(b,ot)|0,i=i+Math.imul(p,ct)|0,n=(n=n+Math.imul(p,ht)|0)+Math.imul(g,ct)|0,s=s+Math.imul(g,ht)|0;var St=(h+(i=i+Math.imul(f,ft)|0)|0)+((8191&(n=(n=n+Math.imul(f,lt)|0)+Math.imul(l,ft)|0))<<13)|0;h=((s=s+Math.imul(l,lt)|0)+(n>>>13)|0)+(St>>>26)|0,St&=67108863,i=Math.imul(U,z),n=(n=Math.imul(U,F))+Math.imul(B,z)|0,s=Math.imul(B,F),i=i+Math.imul(L,K)|0,n=(n=n+Math.imul(L,V)|0)+Math.imul(q,K)|0,s=s+Math.imul(q,V)|0,i=i+Math.imul(C,G)|0,n=(n=n+Math.imul(C,J)|0)+Math.imul(T,G)|0,s=s+Math.imul(T,J)|0,i=i+Math.imul(O,Q)|0,n=(n=n+Math.imul(O,X)|0)+Math.imul(N,Q)|0,s=s+Math.imul(N,X)|0,i=i+Math.imul(I,$)|0,n=(n=n+Math.imul(I,tt)|0)+Math.imul(x,$)|0,s=s+Math.imul(x,tt)|0,i=i+Math.imul(E,rt)|0,n=(n=n+Math.imul(E,it)|0)+Math.imul(S,rt)|0,s=s+Math.imul(S,it)|0,i=i+Math.imul(w,st)|0,n=(n=n+Math.imul(w,ot)|0)+Math.imul(_,st)|0,s=s+Math.imul(_,ot)|0,i=i+Math.imul(v,ct)|0,n=(n=n+Math.imul(v,ht)|0)+Math.imul(b,ct)|0,s=s+Math.imul(b,ht)|0,i=i+Math.imul(p,ft)|0,n=(n=n+Math.imul(p,lt)|0)+Math.imul(g,ft)|0,s=s+Math.imul(g,lt)|0;var Mt=(h+(i=i+Math.imul(f,pt)|0)|0)+((8191&(n=(n=n+Math.imul(f,gt)|0)+Math.imul(l,pt)|0))<<13)|0;h=((s=s+Math.imul(l,gt)|0)+(n>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,i=Math.imul(U,K),n=(n=Math.imul(U,V))+Math.imul(B,K)|0,s=Math.imul(B,V),i=i+Math.imul(L,G)|0,n=(n=n+Math.imul(L,J)|0)+Math.imul(q,G)|0,s=s+Math.imul(q,J)|0,i=i+Math.imul(C,Q)|0,n=(n=n+Math.imul(C,X)|0)+Math.imul(T,Q)|0,s=s+Math.imul(T,X)|0,i=i+Math.imul(O,$)|0,n=(n=n+Math.imul(O,tt)|0)+Math.imul(N,$)|0,s=s+Math.imul(N,tt)|0,i=i+Math.imul(I,rt)|0,n=(n=n+Math.imul(I,it)|0)+Math.imul(x,rt)|0,s=s+Math.imul(x,it)|0,i=i+Math.imul(E,st)|0,n=(n=n+Math.imul(E,ot)|0)+Math.imul(S,st)|0,s=s+Math.imul(S,ot)|0,i=i+Math.imul(w,ct)|0,n=(n=n+Math.imul(w,ht)|0)+Math.imul(_,ct)|0,s=s+Math.imul(_,ht)|0,i=i+Math.imul(v,ft)|0,n=(n=n+Math.imul(v,lt)|0)+Math.imul(b,ft)|0,s=s+Math.imul(b,lt)|0;var It=(h+(i=i+Math.imul(p,pt)|0)|0)+((8191&(n=(n=n+Math.imul(p,gt)|0)+Math.imul(g,pt)|0))<<13)|0;h=((s=s+Math.imul(g,gt)|0)+(n>>>13)|0)+(It>>>26)|0,It&=67108863,i=Math.imul(U,G),n=(n=Math.imul(U,J))+Math.imul(B,G)|0,s=Math.imul(B,J),i=i+Math.imul(L,Q)|0,n=(n=n+Math.imul(L,X)|0)+Math.imul(q,Q)|0,s=s+Math.imul(q,X)|0,i=i+Math.imul(C,$)|0,n=(n=n+Math.imul(C,tt)|0)+Math.imul(T,$)|0,s=s+Math.imul(T,tt)|0,i=i+Math.imul(O,rt)|0,n=(n=n+Math.imul(O,it)|0)+Math.imul(N,rt)|0,s=s+Math.imul(N,it)|0,i=i+Math.imul(I,st)|0,n=(n=n+Math.imul(I,ot)|0)+Math.imul(x,st)|0,s=s+Math.imul(x,ot)|0,i=i+Math.imul(E,ct)|0,n=(n=n+Math.imul(E,ht)|0)+Math.imul(S,ct)|0,s=s+Math.imul(S,ht)|0,i=i+Math.imul(w,ft)|0,n=(n=n+Math.imul(w,lt)|0)+Math.imul(_,ft)|0,s=s+Math.imul(_,lt)|0;var xt=(h+(i=i+Math.imul(v,pt)|0)|0)+((8191&(n=(n=n+Math.imul(v,gt)|0)+Math.imul(b,pt)|0))<<13)|0;h=((s=s+Math.imul(b,gt)|0)+(n>>>13)|0)+(xt>>>26)|0,xt&=67108863,i=Math.imul(U,Q),n=(n=Math.imul(U,X))+Math.imul(B,Q)|0,s=Math.imul(B,X),i=i+Math.imul(L,$)|0,n=(n=n+Math.imul(L,tt)|0)+Math.imul(q,$)|0,s=s+Math.imul(q,tt)|0,i=i+Math.imul(C,rt)|0,n=(n=n+Math.imul(C,it)|0)+Math.imul(T,rt)|0,s=s+Math.imul(T,it)|0,i=i+Math.imul(O,st)|0,n=(n=n+Math.imul(O,ot)|0)+Math.imul(N,st)|0,s=s+Math.imul(N,ot)|0,i=i+Math.imul(I,ct)|0,n=(n=n+Math.imul(I,ht)|0)+Math.imul(x,ct)|0,s=s+Math.imul(x,ht)|0,i=i+Math.imul(E,ft)|0,n=(n=n+Math.imul(E,lt)|0)+Math.imul(S,ft)|0,s=s+Math.imul(S,lt)|0;var Pt=(h+(i=i+Math.imul(w,pt)|0)|0)+((8191&(n=(n=n+Math.imul(w,gt)|0)+Math.imul(_,pt)|0))<<13)|0;h=((s=s+Math.imul(_,gt)|0)+(n>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,i=Math.imul(U,$),n=(n=Math.imul(U,tt))+Math.imul(B,$)|0,s=Math.imul(B,tt),i=i+Math.imul(L,rt)|0,n=(n=n+Math.imul(L,it)|0)+Math.imul(q,rt)|0,s=s+Math.imul(q,it)|0,i=i+Math.imul(C,st)|0,n=(n=n+Math.imul(C,ot)|0)+Math.imul(T,st)|0,s=s+Math.imul(T,ot)|0,i=i+Math.imul(O,ct)|0,n=(n=n+Math.imul(O,ht)|0)+Math.imul(N,ct)|0,s=s+Math.imul(N,ht)|0,i=i+Math.imul(I,ft)|0,n=(n=n+Math.imul(I,lt)|0)+Math.imul(x,ft)|0,s=s+Math.imul(x,lt)|0;var Ot=(h+(i=i+Math.imul(E,pt)|0)|0)+((8191&(n=(n=n+Math.imul(E,gt)|0)+Math.imul(S,pt)|0))<<13)|0;h=((s=s+Math.imul(S,gt)|0)+(n>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,i=Math.imul(U,rt),n=(n=Math.imul(U,it))+Math.imul(B,rt)|0,s=Math.imul(B,it),i=i+Math.imul(L,st)|0,n=(n=n+Math.imul(L,ot)|0)+Math.imul(q,st)|0,s=s+Math.imul(q,ot)|0,i=i+Math.imul(C,ct)|0,n=(n=n+Math.imul(C,ht)|0)+Math.imul(T,ct)|0,s=s+Math.imul(T,ht)|0,i=i+Math.imul(O,ft)|0,n=(n=n+Math.imul(O,lt)|0)+Math.imul(N,ft)|0,s=s+Math.imul(N,lt)|0;var Nt=(h+(i=i+Math.imul(I,pt)|0)|0)+((8191&(n=(n=n+Math.imul(I,gt)|0)+Math.imul(x,pt)|0))<<13)|0;h=((s=s+Math.imul(x,gt)|0)+(n>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,i=Math.imul(U,st),n=(n=Math.imul(U,ot))+Math.imul(B,st)|0,s=Math.imul(B,ot),i=i+Math.imul(L,ct)|0,n=(n=n+Math.imul(L,ht)|0)+Math.imul(q,ct)|0,s=s+Math.imul(q,ht)|0,i=i+Math.imul(C,ft)|0,n=(n=n+Math.imul(C,lt)|0)+Math.imul(T,ft)|0,s=s+Math.imul(T,lt)|0;var Rt=(h+(i=i+Math.imul(O,pt)|0)|0)+((8191&(n=(n=n+Math.imul(O,gt)|0)+Math.imul(N,pt)|0))<<13)|0;h=((s=s+Math.imul(N,gt)|0)+(n>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,i=Math.imul(U,ct),n=(n=Math.imul(U,ht))+Math.imul(B,ct)|0,s=Math.imul(B,ht),i=i+Math.imul(L,ft)|0,n=(n=n+Math.imul(L,lt)|0)+Math.imul(q,ft)|0,s=s+Math.imul(q,lt)|0;var Ct=(h+(i=i+Math.imul(C,pt)|0)|0)+((8191&(n=(n=n+Math.imul(C,gt)|0)+Math.imul(T,pt)|0))<<13)|0;h=((s=s+Math.imul(T,gt)|0)+(n>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,i=Math.imul(U,ft),n=(n=Math.imul(U,lt))+Math.imul(B,ft)|0,s=Math.imul(B,lt);var Tt=(h+(i=i+Math.imul(L,pt)|0)|0)+((8191&(n=(n=n+Math.imul(L,gt)|0)+Math.imul(q,pt)|0))<<13)|0;h=((s=s+Math.imul(q,gt)|0)+(n>>>13)|0)+(Tt>>>26)|0,Tt&=67108863;var kt=(h+(i=Math.imul(U,pt))|0)+((8191&(n=(n=Math.imul(U,gt))+Math.imul(B,pt)|0))<<13)|0;return h=((s=Math.imul(B,gt))+(n>>>13)|0)+(kt>>>26)|0,kt&=67108863,c[0]=mt,c[1]=vt,c[2]=bt,c[3]=yt,c[4]=wt,c[5]=_t,c[6]=At,c[7]=Et,c[8]=St,c[9]=Mt,c[10]=It,c[11]=xt,c[12]=Pt,c[13]=Ot,c[14]=Nt,c[15]=Rt,c[16]=Ct,c[17]=Tt,c[18]=kt,0!==h&&(c[19]=h,r.length++),r};function m(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var i=0,n=0,s=0;s<r.length-1;s++){var o=n;n=0;for(var a=67108863&i,c=Math.min(s,e.length-1),h=Math.max(0,s-t.length+1);h<=c;h++){var u=s-h,f=(0|t.words[u])*(0|e.words[h]),l=67108863&f;a=67108863&(l=l+a|0),n+=(o=(o=o+(f/67108864|0)|0)+(l>>>26)|0)>>>26,o&=67108863}r.words[s]=a,i=o,o=n}return 0!==i?r.words[s]=i:r.length--,r._strip()}function v(t,e,r){return m(t,e,r)}Math.imul||(g=p),n.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?g(this,t,e):r<63?p(this,t,e):r<1024?m(this,t,e):v(this,t,e)},n.prototype.mul=function(t){var e=new n(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},n.prototype.mulf=function(t){var e=new n(null);return e.words=new Array(this.length+t.length),v(this,t,e)},n.prototype.imul=function(t){return this.clone().mulTo(t,this)},n.prototype.imuln=function(t){var e=t<0;e&&(t=-t),r("number"==typeof t),r(t<67108864);for(var i=0,n=0;n<this.length;n++){var s=(0|this.words[n])*t,o=(67108863&s)+(67108863&i);i>>=26,i+=s/67108864|0,i+=o>>>26,this.words[n]=67108863&o}return 0!==i&&(this.words[n]=i,this.length++),e?this.ineg():this},n.prototype.muln=function(t){return this.clone().imuln(t)},n.prototype.sqr=function(){return this.mul(this)},n.prototype.isqr=function(){return this.imul(this.clone())},n.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r<e.length;r++){var i=r/26|0,n=r%26;e[r]=t.words[i]>>>n&1}return e}(t);if(0===e.length)return new n(1);for(var r=this,i=0;i<e.length&&0===e[i];i++,r=r.sqr());if(++i<e.length)for(var s=r.sqr();i<e.length;i++,s=s.sqr())0!==e[i]&&(r=r.mul(s));return r},n.prototype.iushln=function(t){r("number"==typeof t&&t>=0);var e,i=t%26,n=(t-i)/26,s=67108863>>>26-i<<26-i;if(0!==i){var o=0;for(e=0;e<this.length;e++){var a=this.words[e]&s,c=(0|this.words[e])-a<<i;this.words[e]=c|o,o=a>>>26-i}o&&(this.words[e]=o,this.length++)}if(0!==n){for(e=this.length-1;e>=0;e--)this.words[e+n]=this.words[e];for(e=0;e<n;e++)this.words[e]=0;this.length+=n}return this._strip()},n.prototype.ishln=function(t){return r(0===this.negative),this.iushln(t)},n.prototype.iushrn=function(t,e,i){var n;r("number"==typeof t&&t>=0),n=e?(e-e%26)/26:0;var s=t%26,o=Math.min((t-s)/26,this.length),a=67108863^67108863>>>s<<s,c=i;if(n-=o,n=Math.max(0,n),c){for(var h=0;h<o;h++)c.words[h]=this.words[h];c.length=o}if(0!==o)if(this.length>o)for(this.length-=o,h=0;h<this.length;h++)this.words[h]=this.words[h+o];else this.words[0]=0,this.length=1;var u=0;for(h=this.length-1;h>=0&&(0!==u||h>=n);h--){var f=0|this.words[h];this.words[h]=u<<26-s|f>>>s,u=f&a}return c&&0!==u&&(c.words[c.length++]=u),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},n.prototype.ishrn=function(t,e,i){return r(0===this.negative),this.iushrn(t,e,i)},n.prototype.shln=function(t){return this.clone().ishln(t)},n.prototype.ushln=function(t){return this.clone().iushln(t)},n.prototype.shrn=function(t){return this.clone().ishrn(t)},n.prototype.ushrn=function(t){return this.clone().iushrn(t)},n.prototype.testn=function(t){r("number"==typeof t&&t>=0);var e=t%26,i=(t-e)/26,n=1<<e;return!(this.length<=i)&&!!(this.words[i]&n)},n.prototype.imaskn=function(t){r("number"==typeof t&&t>=0);var e=t%26,i=(t-e)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=i)return this;if(0!==e&&i++,this.length=Math.min(i,this.length),0!==e){var n=67108863^67108863>>>e<<e;this.words[this.length-1]&=n}return this._strip()},n.prototype.maskn=function(t){return this.clone().imaskn(t)},n.prototype.iaddn=function(t){return r("number"==typeof t),r(t<67108864),t<0?this.isubn(-t):0!==this.negative?1===this.length&&(0|this.words[0])<=t?(this.words[0]=t-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(t),this.negative=1,this):this._iaddn(t)},n.prototype._iaddn=function(t){this.words[0]+=t;for(var e=0;e<this.length&&this.words[e]>=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},n.prototype.isubn=function(t){if(r("number"==typeof t),r(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e<this.length&&this.words[e]<0;e++)this.words[e]+=67108864,this.words[e+1]-=1;return this._strip()},n.prototype.addn=function(t){return this.clone().iaddn(t)},n.prototype.subn=function(t){return this.clone().isubn(t)},n.prototype.iabs=function(){return this.negative=0,this},n.prototype.abs=function(){return this.clone().iabs()},n.prototype._ishlnsubmul=function(t,e,i){var n,s=t.length+i;this._expand(s);var o,a=0;for(n=0;n<t.length;n++){o=(0|this.words[n+i])+a;var c=(0|t.words[n])*e;a=((o-=67108863&c)>>26)-(c/67108864|0),this.words[n+i]=67108863&o}for(;n<this.length-i;n++)a=(o=(0|this.words[n+i])+a)>>26,this.words[n+i]=67108863&o;if(0===a)return this._strip();for(r(-1===a),a=0,n=0;n<this.length;n++)a=(o=-(0|this.words[n])+a)>>26,this.words[n]=67108863&o;return this.negative=1,this._strip()},n.prototype._wordDiv=function(t,e){var r=(this.length,t.length),i=this.clone(),s=t,o=0|s.words[s.length-1];0!==(r=26-this._countBits(o))&&(s=s.ushln(r),i.iushln(r),o=0|s.words[s.length-1]);var a,c=i.length-s.length;if("mod"!==e){(a=new n(null)).length=c+1,a.words=new Array(a.length);for(var h=0;h<a.length;h++)a.words[h]=0}var u=i.clone()._ishlnsubmul(s,1,c);0===u.negative&&(i=u,a&&(a.words[c]=1));for(var f=c-1;f>=0;f--){var l=67108864*(0|i.words[s.length+f])+(0|i.words[s.length+f-1]);for(l=Math.min(l/o|0,67108863),i._ishlnsubmul(s,l,f);0!==i.negative;)l--,i.negative=0,i._ishlnsubmul(s,1,f),i.isZero()||(i.negative^=1);a&&(a.words[f]=l)}return a&&a._strip(),i._strip(),"div"!==e&&0!==r&&i.iushrn(r),{div:a||null,mod:i}},n.prototype.divmod=function(t,e,i){return r(!t.isZero()),this.isZero()?{div:new n(0),mod:new n(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(s=a.div.neg()),"div"!==e&&(o=a.mod.neg(),i&&0!==o.negative&&o.iadd(t)),{div:s,mod:o}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(s=a.div.neg()),{div:s,mod:a.mod}):this.negative&t.negative?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(o=a.mod.neg(),i&&0!==o.negative&&o.isub(t)),{div:a.div,mod:o}):t.length>this.length||this.cmp(t)<0?{div:new n(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new n(this.modrn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new n(this.modrn(t.words[0]))}:this._wordDiv(t,e);var s,o,a},n.prototype.div=function(t){return this.divmod(t,"div",!1).div},n.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},n.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},n.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,i=t.ushrn(1),n=t.andln(1),s=r.cmp(i);return s<0||1===n&&0===s?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},n.prototype.modrn=function(t){var e=t<0;e&&(t=-t),r(t<=67108863);for(var i=(1<<26)%t,n=0,s=this.length-1;s>=0;s--)n=(i*n+(0|this.words[s]))%t;return e?-n:n},n.prototype.modn=function(t){return this.modrn(t)},n.prototype.idivn=function(t){var e=t<0;e&&(t=-t),r(t<=67108863);for(var i=0,n=this.length-1;n>=0;n--){var s=(0|this.words[n])+67108864*i;this.words[n]=s/t|0,i=s%t}return this._strip(),e?this.ineg():this},n.prototype.divn=function(t){return this.clone().idivn(t)},n.prototype.egcd=function(t){r(0===t.negative),r(!t.isZero());var e=this,i=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var s=new n(1),o=new n(0),a=new n(0),c=new n(1),h=0;e.isEven()&&i.isEven();)e.iushrn(1),i.iushrn(1),++h;for(var u=i.clone(),f=e.clone();!e.isZero();){for(var l=0,d=1;!(e.words[0]&d)&&l<26;++l,d<<=1);if(l>0)for(e.iushrn(l);l-- >0;)(s.isOdd()||o.isOdd())&&(s.iadd(u),o.isub(f)),s.iushrn(1),o.iushrn(1);for(var p=0,g=1;!(i.words[0]&g)&&p<26;++p,g<<=1);if(p>0)for(i.iushrn(p);p-- >0;)(a.isOdd()||c.isOdd())&&(a.iadd(u),c.isub(f)),a.iushrn(1),c.iushrn(1);e.cmp(i)>=0?(e.isub(i),s.isub(a),o.isub(c)):(i.isub(e),a.isub(s),c.isub(o))}return{a:a,b:c,gcd:i.iushln(h)}},n.prototype._invmp=function(t){r(0===t.negative),r(!t.isZero());var e,i=this,s=t.clone();i=0!==i.negative?i.umod(t):i.clone();for(var o=new n(1),a=new n(0),c=s.clone();i.cmpn(1)>0&&s.cmpn(1)>0;){for(var h=0,u=1;!(i.words[0]&u)&&h<26;++h,u<<=1);if(h>0)for(i.iushrn(h);h-- >0;)o.isOdd()&&o.iadd(c),o.iushrn(1);for(var f=0,l=1;!(s.words[0]&l)&&f<26;++f,l<<=1);if(f>0)for(s.iushrn(f);f-- >0;)a.isOdd()&&a.iadd(c),a.iushrn(1);i.cmp(s)>=0?(i.isub(s),o.isub(a)):(s.isub(i),a.isub(o))}return(e=0===i.cmpn(1)?o:a).cmpn(0)<0&&e.iadd(t),e},n.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var i=0;e.isEven()&&r.isEven();i++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var n=e.cmp(r);if(n<0){var s=e;e=r,r=s}else if(0===n||0===r.cmpn(1))break;e.isub(r)}return r.iushln(i)},n.prototype.invm=function(t){return this.egcd(t).a.umod(t)},n.prototype.isEven=function(){return 0===(1&this.words[0])},n.prototype.isOdd=function(){return 1===(1&this.words[0])},n.prototype.andln=function(t){return this.words[0]&t},n.prototype.bincn=function(t){r("number"==typeof t);var e=t%26,i=(t-e)/26,n=1<<e;if(this.length<=i)return this._expand(i+1),this.words[i]|=n,this;for(var s=n,o=i;0!==s&&o<this.length;o++){var a=0|this.words[o];s=(a+=s)>>>26,a&=67108863,this.words[o]=a}return 0!==s&&(this.words[o]=s,this.length++),this},n.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},n.prototype.cmpn=function(t){var e,i=t<0;if(0!==this.negative&&!i)return-1;if(0===this.negative&&i)return 1;if(this._strip(),this.length>1)e=1;else{i&&(t=-t),r(t<=67108863,"Number is too big");var n=0|this.words[0];e=n===t?0:n<t?-1:1}return 0!==this.negative?0|-e:e},n.prototype.cmp=function(t){if(0!==this.negative&&0===t.negative)return-1;if(0===this.negative&&0!==t.negative)return 1;var e=this.ucmp(t);return 0!==this.negative?0|-e:e},n.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var e=0,r=this.length-1;r>=0;r--){var i=0|this.words[r],n=0|t.words[r];if(i!==n){i<n?e=-1:i>n&&(e=1);break}}return e},n.prototype.gtn=function(t){return 1===this.cmpn(t)},n.prototype.gt=function(t){return 1===this.cmp(t)},n.prototype.gten=function(t){return this.cmpn(t)>=0},n.prototype.gte=function(t){return this.cmp(t)>=0},n.prototype.ltn=function(t){return-1===this.cmpn(t)},n.prototype.lt=function(t){return-1===this.cmp(t)},n.prototype.lten=function(t){return this.cmpn(t)<=0},n.prototype.lte=function(t){return this.cmp(t)<=0},n.prototype.eqn=function(t){return 0===this.cmpn(t)},n.prototype.eq=function(t){return 0===this.cmp(t)},n.red=function(t){return new S(t)},n.prototype.toRed=function(t){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},n.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},n.prototype._forceRed=function(t){return this.red=t,this},n.prototype.forceRed=function(t){return r(!this.red,"Already a number in reduction context"),this._forceRed(t)},n.prototype.redAdd=function(t){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},n.prototype.redIAdd=function(t){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},n.prototype.redSub=function(t){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},n.prototype.redISub=function(t){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},n.prototype.redShl=function(t){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},n.prototype.redMul=function(t){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},n.prototype.redIMul=function(t){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},n.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},n.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},n.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},n.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},n.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},n.prototype.redPow=function(t){return r(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var b={k256:null,p224:null,p192:null,p25519:null};function y(t,e){this.name=t,this.p=new n(e,16),this.n=this.p.bitLength(),this.k=new n(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function w(){y.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function _(){y.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function A(){y.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function E(){y.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function S(t){if("string"==typeof t){var e=n._prime(t);this.m=e.p,this.prime=e}else r(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function M(t){S.call(this,t),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new n(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}y.prototype._tmp=function(){var t=new n(null);return t.words=new Array(Math.ceil(this.n/13)),t},y.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var i=e<this.n?-1:r.ucmp(this.p);return 0===i?(r.words[0]=0,r.length=1):i>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},y.prototype.split=function(t,e){t.iushrn(this.n,0,e)},y.prototype.imulK=function(t){return t.imul(this.k)},i(w,y),w.prototype.split=function(t,e){for(var r=4194303,i=Math.min(t.length,9),n=0;n<i;
2n++)e.words[n]=t.words[n];if(e.length=i,t.length<=9)return t.words[0]=0,void(t.length=1);var s=t.words[9];for(e.words[e.length++]=s&r,n=10;n<t.length;n++){var o=0|t.words[n];t.words[n-10]=(o&r)<<4|s>>>22,s=o}s>>>=22,t.words[n-10]=s,0===s&&t.length>10?t.length-=10:t.length-=9},w.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r<t.length;r++){var i=0|t.words[r];e+=977*i,t.words[r]=67108863&e,e=64*i+(e/67108864|0)}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},i(_,y),i(A,y),i(E,y),E.prototype.imulK=function(t){for(var e=0,r=0;r<t.length;r++){var i=19*(0|t.words[r])+e,n=67108863&i;i>>>=26,t.words[r]=n,e=i}return 0!==e&&(t.words[t.length++]=e),t},n._prime=function(t){if(b[t])return b[t];var e;if("k256"===t)e=new w;else if("p224"===t)e=new _;else if("p192"===t)e=new A;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new E}return b[t]=e,e},S.prototype._verify1=function(t){r(0===t.negative,"red works only with positives"),r(t.red,"red works only with red numbers")},S.prototype._verify2=function(t,e){r(0===(t.negative|e.negative),"red works only with positives"),r(t.red&&t.red===e.red,"red works only with red numbers")},S.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):(h(t,t.umod(this.m)._forceRed(this)),t)},S.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},S.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},S.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},S.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},S.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},S.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},S.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},S.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},S.prototype.isqr=function(t){return this.imul(t,t.clone())},S.prototype.sqr=function(t){return this.mul(t,t)},S.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(r(e%2===1),3===e){var i=this.m.add(new n(1)).iushrn(2);return this.pow(t,i)}for(var s=this.m.subn(1),o=0;!s.isZero()&&0===s.andln(1);)o++,s.iushrn(1);r(!s.isZero());var a=new n(1).toRed(this),c=a.redNeg(),h=this.m.subn(1).iushrn(1),u=this.m.bitLength();for(u=new n(2*u*u).toRed(this);0!==this.pow(u,h).cmp(c);)u.redIAdd(c);for(var f=this.pow(u,s),l=this.pow(t,s.addn(1).iushrn(1)),d=this.pow(t,s),p=o;0!==d.cmp(a);){for(var g=d,m=0;0!==g.cmp(a);m++)g=g.redSqr();r(m<p);var v=this.pow(f,new n(1).iushln(p-m-1));l=l.redMul(v),f=v.redSqr(),d=d.redMul(f),p=m}return l},S.prototype.invm=function(t){var e=t._invmp(this.m);return 0!==e.negative?(e.negative=0,this.imod(e).redNeg()):this.imod(e)},S.prototype.pow=function(t,e){if(e.isZero())return new n(1).toRed(this);if(0===e.cmpn(1))return t.clone();var r=new Array(16);r[0]=new n(1).toRed(this),r[1]=t;for(var i=2;i<r.length;i++)r[i]=this.mul(r[i-1],t);var s=r[0],o=0,a=0,c=e.bitLength()%26;for(0===c&&(c=26),i=e.length-1;i>=0;i--){for(var h=e.words[i],u=c-1;u>=0;u--){var f=h>>u&1;(s!==r[0]&&(s=this.sqr(s)),0!==f||0!==o)?(o<<=1,o|=f,(4===++a||0===i&&0===u)&&(s=this.mul(s,r[o]),a=0,o=0)):a=0}c=26}return s},S.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},S.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},n.mont=function(t){return new M(t)},i(M,S),M.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},M.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},M.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),s=n;return n.cmp(this.m)>=0?s=n.isub(this.m):n.cmpn(0)<0&&(s=n.iadd(this.m)),s._forceRed(this)},M.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new n(0)._forceRed(this);var r=t.mul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),s=r.isub(i).iushrn(this.shift),o=s;return s.cmp(this.m)>=0?o=s.isub(this.m):s.cmpn(0)<0&&(o=s.iadd(this.m)),o._forceRed(this)},M.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t,Pr)}(ti);var ri=ti.exports;const ii="bignumber/5.7.0";var ni=ri.BN;const si=new jr(ii),oi={},ai=9007199254740991;let ci=!1;class hi{constructor(t,e){t!==oi&&si.throwError("cannot call constructor directly; use BigNumber.from",jr.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"}),this._hex=e,this._isBigNumber=!0,Object.freeze(this)}fromTwos(t){return fi(li(this).fromTwos(t))}toTwos(t){return fi(li(this).toTwos(t))}abs(){return"-"===this._hex[0]?hi.from(this._hex.substring(1)):this}add(t){return fi(li(this).add(li(t)))}sub(t){return fi(li(this).sub(li(t)))}div(t){return hi.from(t).isZero()&&di("division-by-zero","div"),fi(li(this).div(li(t)))}mul(t){return fi(li(this).mul(li(t)))}mod(t){const e=li(t);return e.isNeg()&&di("division-by-zero","mod"),fi(li(this).umod(e))}pow(t){const e=li(t);return e.isNeg()&&di("negative-power","pow"),fi(li(this).pow(e))}and(t){const e=li(t);return(this.isNegative()||e.isNeg())&&di("unbound-bitwise-result","and"),fi(li(this).and(e))}or(t){const e=li(t);return(this.isNegative()||e.isNeg())&&di("unbound-bitwise-result","or"),fi(li(this).or(e))}xor(t){const e=li(t);return(this.isNegative()||e.isNeg())&&di("unbound-bitwise-result","xor"),fi(li(this).xor(e))}mask(t){return(this.isNegative()||t<0)&&di("negative-width","mask"),fi(li(this).maskn(t))}shl(t){return(this.isNegative()||t<0)&&di("negative-width","shl"),fi(li(this).shln(t))}shr(t){return(this.isNegative()||t<0)&&di("negative-width","shr"),fi(li(this).shrn(t))}eq(t){return li(this).eq(li(t))}lt(t){return li(this).lt(li(t))}lte(t){return li(this).lte(li(t))}gt(t){return li(this).gt(li(t))}gte(t){return li(this).gte(li(t))}isNegative(){return"-"===this._hex[0]}isZero(){return li(this).isZero()}toNumber(){try{return li(this).toNumber()}catch(t){di("overflow","toNumber",this.toString())}return null}toBigInt(){try{return BigInt(this.toString())}catch(t){}return si.throwError("this platform does not support BigInt",jr.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}toString(){return arguments.length>0&&(10===arguments[0]?ci||(ci=!0,si.warn("BigNumber.toString does not accept any parameters;
2 base-10 is assumed")):16===arguments[0]?si.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",jr.errors.UNEXPECTED_ARGUMENT,{}):si.throwError("BigNumber.toString does not accept parameters",jr.errors.UNEXPECTED_ARGUMENT,{})),li(this).toString(10)}toHexString(){return this._hex}toJSON(t){return{type:"BigNumber",hex:this.toHexString()}}static from(t){if(t instanceof hi)return t;if("string"==typeof t)return t.match(/^-?0x[0-9a-f]+$/i)?new hi(oi,ui(t)):t.match(/^-?[0-9]+$/)?new hi(oi,ui(new ni(t))):si.throwArgumentError("invalid BigNumber string","value",t);if("number"==typeof t)return t%1&&di("underflow","BigNumber.from",t),(t>=ai||t<=-ai)&&di("overflow","BigNumber.from",t),hi.from(String(t));const e=t;if("bigint"==typeof e)return hi.from(e.toString());if(Vr(e))return hi.from(Yr(e));if(e)if(e.toHexString){const t=e.toHexString();if("string"==typeof t)return hi.from(t)}else{let t=e._hex;if(null==t&&"BigNumber"===e.type&&(t=e.hex),"string"==typeof t&&(Gr(t)||"-"===t[0]&&Gr(t.substring(1))))return hi.from(t)}return si.throwArgumentError("invalid BigNumber value","value",t)}static isBigNumber(t){return!(!t||!t._isBigNumber)}}function ui(t){if("string"!=typeof t)return ui(t.toString(16));if("-"===t[0])return"-"===(t=t.substring(1))[0]&&si.throwArgumentError("invalid hex","value",t),"0x00"===(t=ui(t))?t:"-"+t;if("0x"!==t.substring(0,2)&&(t="0x"+t),"0x"===t)return"0x00";for(t.length%2&&(t="0x0"+t.substring(2));t.length>4&&"0x00"===t.substring(0,4);)t="0x"+t.substring(4);return t}function fi(t){return hi.from(ui(t))}function li(t){const e=hi.from(t).toHexString();return"-"===e[0]?new ni("-"+e.substring(3),16):new ni(e.substring(2),16)}function di(t,e,r){const i={fault:t,operation:e};return null!=r&&(i.value=r),si.throwError(t,jr.errors.NUMERIC_FAULT,i)}const pi=new jr(ii),gi={},mi=hi.from(0),vi=hi.from(-1);function bi(t,e,r,i){const n={fault:e,operation:r};return void 0!==i&&(n.value=i),pi.throwError(t,jr.errors.NUMERIC_FAULT,n)}let yi="0";for(;yi.length<256;)yi+=yi;function wi(t){if("number"!=typeof t)try{t=hi.from(t).toNumber()}catch(e){}return"number"==typeof t&&t>=0&&t<=256&&!(t%1)?"1"+yi.substring(0,t):pi.throwArgumentError("invalid decimal size","decimals",t)}function _i(t,e){null==e&&(e=0);const r=wi(e),i=(t=hi.from(t)).lt(mi);i&&(t=t.mul(vi));let n=t.mod(r).toString();for(;n.length<r.length-1;)n="0"+n;n=n.match(/^([0-9]*[1-9]|0)(0*)/)[1];const s=t.div(r).toString();return t=1===r.length?s:s+"."+n,i&&(t="-"+t),t}function Ai(t,e){null==e&&(e=0);const r=wi(e);("string"!=typeof t||!t.match(/^-?[0-9.]+$/))&&pi.throwArgumentError("invalid decimal value","value",t);const i="-"===t.substring(0,1);i&&(t=t.substring(1)),"."===t&&pi.throwArgumentError("missing value","value",t);const n=t.split(".");n.length>2&&pi.throwArgumentError("too many decimal points","value",t);let s=n[0],o=n[1];for(s||(s="0"),o||(o="0");"0"===o[o.length-1];)o=o.substring(0,o.length-1);for(o.length>r.length-1&&bi("fractional component exceeds decimals","underflow","parseFixed"),""===o&&(o="0");o.length<r.length-1;)o+="0";const a=hi.from(s),c=hi.from(o);let h=a.mul(r).add(c);return i&&(h=h.mul(vi)),h}class Ei{constructor(t,e,r,i){t!==gi&&pi.throwError("cannot use FixedFormat constructor; use FixedFormat.from",jr.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.signed=e,this.width=r,this.decimals=i,this.name=(e?"":"u")+"fixed"+String(r)+"x"+String(i),this._multiplier=wi(i),Object.freeze(this)}static from(t){if(t instanceof Ei)return t;"number"==typeof t&&(t="fixed128x".concat(t));let e=!0,r=128,i=18;if("string"==typeof t){if("fixed"!==t)if("ufixed"===t)e=!1;else{const n=t.match(/^(u?)fixed([0-9]+)x([0-9]+)$/);n||pi.throwArgumentError("invalid fixed format","format",t),e="u"!==n[1],r=parseInt(n[2]),i=parseInt(n[3])}}else if(t){const n=(e,r,i)=>null==t[e]?i:(typeof t[e]!==r&&pi.throwArgumentError("invalid fixed format ("+e+" not "+r+")","format."+e,t[e]),t[e]);e=n("signed","boolean",e),r=n("width","number",r),i=n("decimals","number",i)}return r%8&&pi.throwArgumentError("invalid fixed format width (not byte aligned)","format.width",r),i>80&&pi.throwArgumentError("invalid fixed format (decimals too large)","format.decimals",i),new Ei(gi,e,r,i)}}class Si{constructor(t,e,r,i){t!==gi&&pi.throwError("cannot use FixedNumber constructor; use FixedNumber.from",jr.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.format=i,this._hex=e,this._value=r,this._isFixedNumber=!0,Object.freeze(this)}_checkFormat(t){this.format.name!==t.format.name&&pi.throwArgumentError("incompatible format; use fixedNumber.toFormat","other",t)}addUnsafe(t){this._checkFormat(t);const e=Ai(this._value,this.format.decimals),r=Ai(t._value,t.format.decimals);return Si.fromValue(e.add(r),this.format.decimals,this.format)}subUnsafe(t){this._checkFormat(t);const e=Ai(this._value,this.format.decimals),r=Ai(t._value,t.format.decimals);return Si.fromValue(e.sub(r),this.format.decimals,this.format)}mulUnsafe(t){this._checkFormat(t);const e=Ai(this._value,this.format.decimals),r=Ai(t._value,t.format.decimals);return Si.fromValue(e.mul(r).div(this.format._multiplier),this.format.decimals,this.format)}divUnsafe(t){this._checkFormat(t);const e=Ai(this._value,this.format.decimals),r=Ai(t._value,t.format.decimals);return Si.fromValue(e.mul(this.format._multiplier).div(r),this.format.decimals,this.format)}floor(){const t=this.toString().split(".");1===t.length&&t.push("0");let e=Si.from(t[0],this.format);const r=!t[1].match(/^(0*)$/);return this.isNegative()&&r&&(e=e.subUnsafe(Mi.toFormat(e.format))),e}ceiling(){const t=this.toString().split(".");1===t.length&&t.push("0");let e=Si.from(t[0],this.format);const r=!t[1].match(/^(0*)$/);return!this.isNegative()&&r&&(e=e.addUnsafe(Mi.toFormat(e.format))),e}round(t){null==t&&(t=0);const e=this.toString().split(".");if(1===e.length&&e.push("0"),(t<0||t>80||t%1)&&pi.throwArgumentError("invalid decimal count","decimals",t),e[1].length<=t)return this;const r=Si.from("1"+yi.substring(0,t),this.format),i=Ii.toFormat(this.format);return this.mulUnsafe(r).addUnsafe(i).floor().divUnsafe(r)}isZero(){return"0.0"===this._value||"0"===this._value}isNegative(){return"-"===this._value[0]}toString(){return this._value}toHexString(t){if(null==t)return this._hex;t%8&&pi.throwArgumentError("invalid byte width","width",t);return Xr(hi.from(this._hex).fromTwos(this.format.width).toTwos(t).toHexString(),t/8)}toUnsafeFloat(){return parseFloat(this.toString())}toFormat(t){return Si.fromString(this._value,t)}static fromValue(t,e,r){return null==r&&null!=e&&!function(t){return null!=t&&(hi.isBigNumber(t)||"number"==typeof t&&t%1===0||"string"==typeof t&&!!t.match(/^-?[0-9]+$/)||Gr(t)||"bigint"==typeof t||Vr(t))}(e)&&(r=e,e=null),null==e&&(e=0),null==r&&(r="fixed"),Si.fromString(_i(t,e),Ei.from(r))}static fromString(t,e){null==e&&(e="fixed");const r=Ei.from(e),i=Ai(t,r.decimals);!r.signed&&i.lt(mi)&&bi("unsigned value cannot be negative","overflow","value",t);let n=null;r.signed?n=i.toTwos(r.width).toHexString():(n=i.toHexString(),n=Xr(n,r.width/8));const s=_i(i,r.decimals);return new Si(gi,n,s,r)}static fromBytes(t,e){null==e&&(e="fixed");const r=Ei.from(e);if(Wr(t).length>r.width/8)throw new Error("overflow");let i=hi.from(t);r.signed&&(i=i.fromTwos(r.width));const n=i.toTwos((r.signed?0:1)+r.width).toHexString(),s=_i(i,r.decimals);return new Si(gi,n,s,r)}static from(t,e){if("string"==typeof t)return Si.fromString(t,e);if(Vr(t))return Si.fromBytes(t,e);try{return Si.fromValue(t,0,e)}catch(Ih){if(Ih.code!==jr.errors.INVALID_ARGUMENT)throw Ih}return pi.throwArgumentError("invalid FixedNumber value","value",t)}static isFixedNumber(t){return!(!t||!t._isFixedNumber)}}const Mi=Si.from(1),Ii=Si.from("0.5"),xi=new jr("strings/5.7.0");var Pi,Oi;function Ni(t,e,r,i,n){if(t===Oi.BAD_PREFIX||t===Oi.UNEXPECTED_CONTINUE){let t=0;for(let i=e+1;i<r.length&&r[i]>>6===2;i++)t++;return t}return t===Oi.OVERRUN?r.length-e-1:0}function Ri(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Pi.current;e!=Pi.current&&(xi.checkNormalize(),t=t.normalize(e));let r=[];for(let i=0;i<t.length;i++){const e=t.charCodeAt(i);if(e<128)r.push(e);else if(e<2048)r.push(e>>6|192),r.push(63&e|128);else if(55296==(64512&e)){i++;const n=t.charCodeAt(i);if(i>=t.length||56320!==(64512&n))throw new Error("invalid utf-8 string");const s=65536+((1023&e)<<10)+(1023&n);r.push(s>>18|240),r.push(s>>12&63|128),r.push(s>>6&63|128),r.push(63&s|128)}else r.push(e>>12|224),r.push(e>>6&63|128),r.push(63&e|128)}return Wr(r)}function Ci(t,e){e||(e=function(t){return[parseInt(t,16)]});let r=0,i={};return t.split(",").forEach((t=>{let n=t.split(":");r+=parseInt(n[0],16),i[r]=e(n[1])})),i}function Ti(t){let e=0;return t.split(",").map((t=>{let r=t.split("-");1===r.length?r[1]="0":""===r[1]&&(r[1]="1");let i=e+parseInt(r[0],16);return e=parseInt(r[1],16),{l:i,h:e}}))}!function(t){t.current="",t.NFC="NFC",t.NFD="NFD",t.NFKC="NFKC",t.NFKD="NFKD"}(Pi||(Pi={})),function(t){t.UNEXPECTED_CONTINUE="unexpected continuation byte",t.BAD_PREFIX="bad codepoint prefix",t.OVERRUN="string overrun",t.MISSING_CONTINUE="missing continuation byte",t.OUT_OF_RANGE="out of UTF-8 range",t.UTF16_SURROGATE="UTF-16 surrogate",t.OVERLONG="overlong representation"}(Oi||(Oi={})),Object.freeze({error:function(t,e,r,i,n){return xi.throwArgumentError("invalid codepoint at offset ".concat(e,"; ").concat(t),"bytes",r)},ignore:Ni,replace:function(t,e,r,i,n){return t===Oi.OVERLONG?(i.push(n),0):(i.push(65533),Ni(t,e,r))}}),Ti("221,13-1b,5f-,40-10,51-f,11-3,3-3,2-2,2-4,8,2,15,2d,28-8,88,48,27-,3-5,11-20,27-,8,28,3-5,12,18,b-a,1c-4,6-16,2-d,2-2,2,1b-4,17-9,8f-,10,f,1f-2,1c-34,33-14e,4,36-,13-,6-2,1a-f,4,9-,3-,17,8,2-2,5-,2,8-,3-,4-8,2-3,3,6-,16-6,2-,7-3,3-,17,8,3,3,3-,2,6-3,3-,4-a,5,2-6,10-b,4,8,2,4,17,8,3,6-,b,4,4-,2-e,2-4,b-10,4,9-,3-,17,8,3-,5-,9-2,3-,4-7,3-3,3,4-3,c-10,3,7-2,4,5-2,3,2,3-2,3-2,4-2,9,4-3,6-2,4,5-8,2-e,d-d,4,9,4,18,b,6-3,8,4,5-6,3-8,3-3,b-11,3,9,4,18,b,6-3,8,4,5-6,3-6,2,3-3,b-11,3,9,4,18,11-3,7-,4,5-8,2-7,3-3,b-11,3,13-2,19,a,2-,8-2,2-3,7,2,9-11,4-b,3b-3,1e-24,3,2-,3,2-,2-5,5,8,4,2,2-,3,e,4-,6,2,7-,b-,3-21,49,23-5,1c-3,9,25,10-,2-2f,23,6,3,8-2,5-5,1b-45,27-9,2a-,2-3,5b-4,45-4,53-5,8,40,2,5-,8,2,5-,28,2,5-,20,2,5-,8,2,5-,8,8,18,20,2,5-,8,28,14-5,1d-22,56-b,277-8,1e-2,52-e,e,8-a,18-8,15-b,e,4,3-b,5e-2,b-15,10,b-5,59-7,2b-555,9d-3,5b-5,17-,7-,27-,7-,9,2,2,2,20-,36,10,f-,7,14-,4,a,54-3,2-6,6-5,9-,1c-10,13-1d,1c-14,3c-,10-6,32-b,240-30,28-18,c-14,a0,
2115-,3,66-,b-76,5,5-,1d,24,2,5-2,2,8-,35-2,19,f-10,1d-3,311-37f,1b,5a-b,d7-19,d-3,41,57-,68-4,29-3,5f,29-37,2e-2,25-c,2c-2,4e-3,30,78-3,64-,20,19b7-49,51a7-59,48e-2,38-738,2ba5-5b,222f-,3c-94,8-b,6-4,1b,6,2,3,3,6d-20,16e-f,41-,37-7,2e-2,11-f,5-b,18-,b,14,5-3,6,88-,2,bf-2,7-,7-,7-,4-2,8,8-9,8-2ff,20,5-b,1c-b4,27-,27-cbb1,f7-9,28-2,b5-221,56,48,3-,2-,3-,5,d,2,5,3,42,5-,9,8,1d,5,6,2-2,8,153-3,123-3,33-27fd,a6da-5128,21f-5df,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3,2-1d,61-ff7d"),"ad,34f,1806,180b,180c,180d,200b,200c,200d,2060,feff".split(",").map((t=>parseInt(t,16))),Ci("b5:3bc,c3:ff,7:73,2:253,5:254,3:256,1:257,5:259,1:25b,3:260,1:263,2:269,1:268,5:26f,1:272,2:275,7:280,3:283,5:288,3:28a,1:28b,5:292,3f:195,1:1bf,29:19e,125:3b9,8b:3b2,1:3b8,1:3c5,3:3c6,1:3c0,1a:3ba,1:3c1,1:3c3,2:3b8,1:3b5,1bc9:3b9,1c:1f76,1:1f77,f:1f7a,1:1f7b,d:1f78,1:1f79,1:1f7c,1:1f7d,107:63,5:25b,4:68,1:68,1:68,3:69,1:69,1:6c,3:6e,4:70,1:71,1:72,1:72,1:72,7:7a,2:3c9,2:7a,2:6b,1:e5,1:62,1:63,3:65,1:66,2:6d,b:3b3,1:3c0,6:64,1b574:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3"),Ci("179:1,2:1,2:1,5:1,2:1,a:4f,a:1,8:1,2:1,2:1,3:1,5:1,3:1,4:1,2:1,3:1,4:1,8:2,1:1,2:2,1:1,2:2,27:2,195:26,2:25,1:25,1:25,2:40,2:3f,1:3f,33:1,11:-6,1:-9,1ac7:-3a,6d:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,b:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,c:-8,2:-8,2:-8,2:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,49:-8,1:-8,1:-4a,1:-4a,d:-56,1:-56,1:-56,1:-56,d:-8,1:-8,f:-8,1:-8,3:-7"),Ci("df:00730073,51:00690307,19:02BC006E,a7:006A030C,18a:002003B9,16:03B903080301,20:03C503080301,1d7:05650582,190f:00680331,1:00740308,1:0077030A,1:0079030A,1:006102BE,b6:03C50313,2:03C503130300,2:03C503130301,2:03C503130342,2a:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,3:1F7003B9,1:03B103B9,1:03AC03B9,2:03B10342,1:03B1034203B9,5:03B103B9,6:1F7403B9,1:03B703B9,1:03AE03B9,2:03B70342,1:03B7034203B9,5:03B703B9,6:03B903080300,1:03B903080301,3:03B90342,1:03B903080342,b:03C503080300,1:03C503080301,1:03C10313,2:03C50342,1:03C503080342,b:1F7C03B9,1:03C903B9,1:03CE03B9,2:03C90342,1:03C9034203B9,5:03C903B9,ac:00720073,5b:00B00063,6:00B00066,d:006E006F,a:0073006D,1:00740065006C,1:0074006D,124f:006800700061,2:00610075,2:006F0076,b:00700061,1:006E0061,1:03BC0061,1:006D0061,1:006B0061,1:006B0062,1:006D0062,1:00670062,3:00700066,1:006E0066,1:03BC0066,4:0068007A,1:006B0068007A,1:006D0068007A,1:00670068007A,1:00740068007A,15:00700061,1:006B00700061,1:006D00700061,1:006700700061,8:00700076,1:006E0076,1:03BC0076,1:006D0076,1:006B0076,1:006D0076,1:00700077,1:006E0077,1:03BC0077,1:006D0077,1:006B0077,1:006D0077,1:006B03C9,1:006D03C9,2:00620071,3:00632215006B0067,1:0063006F002E,1:00640062,1:00670079,2:00680070,2:006B006B,1:006B006D,9:00700068,2:00700070006D,1:00700072,2:00730076,1:00770062,c723:00660066,1:00660069,1:0066006C,1:006600660069,1:00660066006C,1:00730074,1:00730074,d:05740576,1:05740565,1:0574056B,1:057E0576,1:0574056D",(function(t){if(t.length%4!==0)throw new Error("bad data");let e=[];for(let r=0;r<t.length;r+=4)e.push(parseInt(t.substring(r,r+4),16));return e})),Ti("80-20,2a0-,39c,32,f71,18e,7f2-f,19-7,30-4,7-5,f81-b,5,a800-20ff,4d1-1f,110,fa-6,d174-7,2e84-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,2,1f-5f,ff7f-20001");const ki="hash/5.7.0";function Li(t,e){null==e&&(e=1);const r=[],i=r.forEach,n=function(t,e){i.call(t,(function(t){e>0&&Array.isArray(t)?n(t,e-1):r.push(t)}))};return n(t,e),r}function qi(t){return function(t){let e=0;return()=>t[e++]}(function(t){let e=0;function r(){return t[e++]<<8|t[e++]}let i=r(),n=1,s=[0,1];for(let w=1;w<i;w++)s.push(n+=r());
2let o=r(),a=e;e+=o;let c=0,h=0;function u(){return 0==c&&(h=h<<8|t[e++],c=8),h>>--c&1}const f=Math.pow(2,31),l=f>>>1,d=l>>1,p=f-1;let g=0;for(let w=0;w<31;w++)g=g<<1|u();let m=[],v=0,b=f;for(;;){let t=Math.floor(((g-v+1)*n-1)/b),e=0,r=i;for(;r-e>1;){let i=e+r>>>1;t<s[i]?r=i:e=i}if(0==e)break;m.push(e);let o=v+Math.floor(b*s[e]/n),a=v+Math.floor(b*s[e+1]/n)-1;for(;!((o^a)&l);)g=g<<1&p|u(),o=o<<1&p,a=a<<1&p|1;for(;o&~a&d;)g=g&l|g<<1&p>>>1|u(),o=o<<1^l,a=(a^l)<<1|l|1;v=o,b=1+a-o}let y=i-4;return m.map((e=>{switch(e-y){case 3:return y+65792+(t[a++]<<16|t[a++]<<8|t[a++]);case 2:return y+256+(t[a++]<<8|t[a++]);case 1:return y+t[a++];default:return e-1}}))}(t))}function Di(t){return 1&t?~t>>1:t>>1}function Ui(t,e){let r=Array(t);for(let i=0,n=-1;i<t;i++)r[i]=n+=1+e();return r}function Bi(t,e){let r=Array(t);for(let i=0,n=0;i<t;i++)r[i]=n+=Di(e());return r}function ji(t,e){let r=Ui(t(),t),i=t(),n=Ui(i,t),s=function(t,e){let r=Array(t);for(let i=0;i<t;i++)r[i]=1+e();return r}(i,t);for(let o=0;o<i;o++)for(let t=0;t<s[o];t++)r.push(n[o]+t);return e?r.map((t=>e[t])):r}function zi(t,e,r){let i=Array(t).fill(void 0).map((()=>[]));for(let n=0;n<e;n++)Bi(t,r).forEach(((t,e)=>i[e].push(t)));return i}function Fi(t,e){let r=1+e(),i=e(),n=function(t){let e=[];for(;;){let r=t();if(0==r)break;e.push(r)}return e}(e);return Li(zi(n.length,1+t,e).map(((t,e)=>{const s=t[0],o=t.slice(1);return Array(n[e]).fill(void 0).map(((t,e)=>{let n=e*i;return[s+e*r,o.map((t=>t+n))]}))})))}function Hi(t,e){return zi(1+e(),1+t,e).map((t=>[t[0],t.slice(1)]))}const Ki=qi(function(t){t=atob(t);const e=[];for(let r=0;r<t.length;r++)e.push(t.charCodeAt(r));return Wr(e)}("AEQF2AO2DEsA2wIrAGsBRABxAN8AZwCcAEwAqgA0AGwAUgByADcATAAVAFYAIQAyACEAKAAYAFgAGwAjABQAMAAmADIAFAAfABQAKwATACoADgAbAA8AHQAYABoAGQAxADgALAAoADwAEwA9ABMAGgARAA4ADwAWABMAFgAIAA8AHgQXBYMA5BHJAS8JtAYoAe4AExozi0UAH21tAaMnBT8CrnIyhrMDhRgDygIBUAEHcoFHUPe8AXBjAewCjgDQR8IICIcEcQLwATXCDgzvHwBmBoHNAqsBdBcUAykgDhAMShskMgo8AY8jqAQfAUAfHw8BDw87MioGlCIPBwZCa4ELatMAAMspJVgsDl8AIhckSg8XAHdvTwBcIQEiDT4OPhUqbyECAEoAS34Aej8Ybx83JgT/Xw8gHxZ/7w8RICxPHA9vBw+Pfw8PHwAPFv+fAsAvCc8vEr8ivwD/EQ8Bol8OEBa/A78hrwAPCU8vESNvvwWfHwNfAVoDHr+ZAAED34YaAdJPAK7PLwSEgDLHAGo1Pz8Pvx9fUwMrpb8O/58VTzAPIBoXIyQJNF8hpwIVAT8YGAUADDNBaX3RAMomJCg9EhUeA29MABsZBTMNJipjOhc19gcIDR8bBwQHEggCWi6DIgLuAQYA+BAFCha3A5XiAEsqM7UFFgFLhAMjFTMYE1Klnw74nRVBG/ASCm0BYRN/BrsU3VoWy+S0vV8LQx+vN8gF2AC2AK5EAWwApgYDKmAAroQ0NDQ0AT+OCg7wAAIHRAbpNgVcBV0APTA5BfbPFgMLzcYL/QqqA82eBALKCjQCjqYCht0/k2+OAsXQAoP3ASTKDgDw6ACKAUYCMpIKJpRaAE4A5womABzZvs0REEKiACIQAd5QdAECAj4Ywg/wGqY2AVgAYADYvAoCGAEubA0gvAY2ALAAbpbvqpyEAGAEpgQAJgAG7gAgAEACmghUFwCqAMpAINQIwC4DthRAAPcycKgApoIdABwBfCisABoATwBqASIAvhnSBP8aH/ECeAKXAq40NjgDBTwFYQU6AXs3oABgAD4XNgmcCY1eCl5tIFZeUqGgyoNHABgAEQAaABNwWQAmABMATPMa3T34ADldyprmM1M2XociUQgLzvwAXT3xABgAEQAaABNwIGFAnADD8AAgAD4BBJWzaCcIAIEBFMAWwKoAAdq9BWAF5wLQpALEtQAKUSGkahR4GnJM+gsAwCgeFAiUAECQ0BQuL8AAIAAAADKeIheclvFqQAAETr4iAMxIARMgAMIoHhQIAn0E0pDQFC4HhznoAAAAIAI2C0/4lvFqQAAETgBJJwYCAy4ABgYAFAA8MBKYEH4eRhTkAjYeFcgACAYAeABsOqyQ5gRwDayqugEgaIIAtgoACgDmEABmBAWGme5OBJJA2m4cDeoAmITWAXwrMgOgAGwBCh6CBXYF1Tzg1wKAAFdiuABRAFwAXQBsAG8AdgBrAHYAbwCEAHEwfxQBVE5TEQADVFhTBwBDANILAqcCzgLTApQCrQL6vAAMAL8APLhNBKkE6glGKTAU4Dr4N2EYEwBCkABKk8rHAbYBmwIoAiU4Ajf/Aq4CowCAANIChzgaNBsCsTgeODcFXrgClQKdAqQBiQGYAqsCsjTsNHsfNPA0ixsAWTWiOAMFPDQSNCk2BDZHNow2TTZUNhk28Jk9VzI3QkEoAoICoQKwAqcAQAAxBV4FXbS9BW47YkIXP1ciUqs05DS/FwABUwJW11e6nHuYZmSh/RAYA8oMKvZ8KASoUAJYWAJ6ILAsAZSoqjpgA0ocBIhmDgDWAAawRDQoAAcuAj5iAHABZiR2AIgiHgCaAU68ACxuHAG0ygM8MiZIAlgBdF4GagJqAPZOHAMuBgoATkYAsABiAHgAMLoGDPj0HpKEBAAOJgAuALggTAHWAeAMEDbd20Uege0ADwAWADkAQgA9OHd+2MUQZBBhBgNNDkxxPxUQArEPqwvqERoM1irQ090ANK4H8ANYB/ADWANYB/AH8ANYB/ADWANYA1gDWBwP8B/YxRBkD00EcgWTBZAE2wiIJk4RhgctCNdUEnQjHEwDSgEBIypJITuYMxAlR0wRTQgIATZHbKx9PQNMMbBU+pCnA9AyVDlxBgMedhKlAC8PeCE1uk6DekxxpQpQT7NX9wBFBgASqwAS5gBJDSgAUCwGPQBI4zTYABNGAE2bAE3KAExdGABKaAbgAFBXAFCOAFBJABI2SWdObALDOq0//QomCZhvwHdTBkIQHCemEPgMNAG2ATwN7kvZBPIGPATKH34ZGg/OlZ0Ipi3eDO4m5C6igFsj9iqEBe5L9TzeC05RaQ9aC2YJ5DpkgU8DIgEOIowK3g06CG4Q9ArKbA3mEUYHOgPWSZsApgcCCxIdNhW2JhFirQsKOXgG/Br3C5AmsBMqev0F1BoiBk4BKhsAANAu6IWxWjJcHU9gBgQLJiPIFKlQIQ0mQLh4SRocBxYlqgKSQ3FKiFE3HpQh9zw+DWcuFFF9B/Y8BhlQC4I8n0asRQ8R0z6OPUkiSkwtBDaALDAnjAnQD4YMunxzAVoJIgmyDHITMhEYN8YIOgcaLpclJxYIIkaWYJsE+KAD9BPSAwwFQAlCBxQDthwuEy8VKgUOgSXYAvQ21i60ApBWgQEYBcwPJh/gEFFH4Q7qCJwCZgOEJewALhUiABginAhEZABgj9lTBi7MCMhqbSN1A2gU6GIRdAeSDlgHqBw0FcAc4nDJXgyGCSiksAlcAXYJmgFgBOQICjVcjKEgQmdUi1kYnCBiQUBd/QIyDGYVoES+h3kCjA9sEhwBNgF0BzoNAgJ4Ee4RbBCWCOyGBTW2M/k6JgRQIYQgEgooA1BszwsoJvoM+WoBpBJjAw00PnfvZ6xgtyUX/gcaMsZBYSHyC5NPzgydGsIYQ1QvGeUHwAP0GvQn60FYBgADpAQUOk4z7wS+C2oIjAlAAEoOpBgH2BhrCnKM0QEyjAG4mgNYkoQCcJAGOAcMAGgMiAV65gAeAqgIpAAGANADWAA6Aq4HngAaAIZCAT4DKDABIuYCkAOUCDLMAZYwAfQqBBzEDBYA+DhuSwLDsgKAa2ajBd5ZAo8CSjYBTiYEBk9IUgOwcuIA3ABMBhTgSAEWrEvMG+REAeBwLADIAPwABjYHBkIBzgH0bgC4AWALMgmjtLYBTuoqAIQAFmwB2AKKAN4ANgCA8gFUAE4FWvoF1AJQSgESMhksWGIBvAMgATQBDgB6BsyOpsoIIARuB9QCEBwV4gLvLwe2AgMi4BPOQsYCvd9WADIXUu5eZwqoCqdeaAC0YTQHMnM9UQAPH6k+yAdy/BZIiQImSwBQ5gBQQzSaNTFWSTYBpwGqKQK38AFtqwBI/wK37gK3rQK3sAK6280C0gK33AK3zxAAUEIAUD9SklKDArekArw5AEQAzAHCO147WTteO1k7XjtZO147WTteO1kDmChYI03AVU0oJqkKbV9GYewMpw3VRMk6ShPcYFJgMxPJLbgUwhXPJVcZPhq9JwYl5VUKDwUt1GYxCC00dhe9AEApaYNCY4ceMQpMHOhTklT5LRwAskujM7ANrRsWREEFSHXuYisWDwojAmSCAmJDXE6wXDchAqH4AmiZAmYKAp+FOBwMAmY8AmYnBG8EgAN/FAN+kzkHOXgYOYM6JCQCbB4CMjc4CwJtyAJtr/CLADRoRiwBaADfAOIASwYHmQyOAP8MwwAOtgJ3MAJ2o0ACeUxEAni7Hl3cRa9G9AJ8QAJ6yQJ9CgJ88UgBSH5kJQAsFklZSlwWGErNAtECAtDNSygDiFADh+dExpEzAvKiXQQDA69Lz0wuJgTQTU1NsAKL
2QAKK2cIcCB5EaAa4Ao44Ao5dQZiCAo7aAo5deVG1UzYLUtVUhgKT/AKTDQDqAB1VH1WwVdEHLBwplocy4nhnRTw6ApegAu+zWCKpAFomApaQApZ9nQCqWa1aCoJOADwClrYClk9cRVzSApnMApllXMtdCBoCnJw5wzqeApwXAp+cAp65iwAeEDIrEAKd8gKekwC2PmE1YfACntQCoG8BqgKeoCACnk+mY8lkKCYsAiewAiZ/AqD8AqBN2AKmMAKlzwKoAAB+AqfzaH1osgAESmodatICrOQCrK8CrWgCrQMCVx4CVd0CseLYAx9PbJgCsr4OArLpGGzhbWRtSWADJc4Ctl08QG6RAylGArhfArlIFgK5K3hwN3DiAr0aAy2zAzISAr6JcgMDM3ICvhtzI3NQAsPMAsMFc4N0TDZGdOEDPKgDPJsDPcACxX0CxkgCxhGKAshqUgLIRQLJUALJLwJkngLd03h6YniveSZL0QMYpGcDAmH1GfSVJXsMXpNevBICz2wCz20wTFTT9BSgAMeuAs90ASrrA04TfkwGAtwoAtuLAtJQA1JdA1NgAQIDVY2AikABzBfuYUZ2AILPg44C2sgC2d+EEYRKpz0DhqYAMANkD4ZyWvoAVgLfZgLeuXR4AuIw7RUB8zEoAfScAfLTiALr9ALpcXoAAur6AurlAPpIAboC7ooC652Wq5cEAu5AA4XhmHpw4XGiAvMEAGoDjheZlAL3FAORbwOSiAL3mQL52gL4Z5odmqy8OJsfA52EAv77ARwAOp8dn7QDBY4DpmsDptoA0sYDBmuhiaIGCgMMSgFgASACtgNGAJwEgLpoBgC8BGzAEowcggCEDC6kdjoAJAM0C5IKRoABZCgiAIzw3AYBLACkfng9ogigkgNmWAN6AEQCvrkEVqTGAwCsBRbAA+4iQkMCHR072jI2PTbUNsk2RjY5NvA23TZKNiU3EDcZN5I+RTxDRTBCJkK5VBYKFhZfwQCWygU3AJBRHpu+OytgNxa61A40GMsYjsn7BVwFXQVcBV0FaAVdBVwFXQVcBV0FXAVdBVwFXUsaCNyKAK4AAQUHBwKU7oICoW1e7jAEzgPxA+YDwgCkBFDAwADABKzAAOxFLhitA1UFTDeyPkM+bj51QkRCuwTQWWQ8X+0AWBYzsACNA8xwzAGm7EZ/QisoCTAbLDs6fnLfb8H2GccsbgFw13M1HAVkBW/Jxsm9CNRO8E8FDD0FBQw9FkcClOYCoMFegpDfADgcMiA2AJQACB8AsigKAIzIEAJKeBIApY5yPZQIAKQiHb4fvj5BKSRPQrZCOz0oXyxgOywfKAnGbgMClQaCAkILXgdeCD9IIGUgQj5fPoY+dT52Ao5CM0dAX9BTVG9SDzFwWTQAbxBzJF/lOEIQQglCCkKJIAls5AcClQICoKPMODEFxhi6KSAbiyfIRrMjtCgdWCAkPlFBIitCsEJRzAbMAV/OEyQzDg0OAQQEJ36i328/Mk9AybDJsQlq3tDRApUKAkFzXf1d/j9uALYP6hCoFgCTGD8kPsFKQiobrm0+zj0KSD8kPnVCRBwMDyJRTHFgMTJa5rwXQiQ2YfI/JD7BMEJEHGINTw4TOFlIRzwJO0icMQpyPyQ+wzJCRBv6DVgnKB01NgUKj2bwYzMqCoBkznBgEF+zYDIocwRIX+NgHj4HICNfh2C4CwdwFWpTG/lgUhYGAwRfv2Ts8mAaXzVgml/XYIJfuWC4HI1gUF9pYJZgMR6ilQHMAOwLAlDRefC0in4AXAEJA6PjCwc0IamOANMMCAECRQDFNRTZBgd+CwQlRA+r6+gLBDEFBnwUBXgKATIArwAGRAAHA3cDdAN2A3kDdwN9A3oDdQN7A30DfAN4A3oDfQAYEAAlAtYASwMAUAFsAHcKAHcAmgB3AHUAdQB2AHVu8UgAygDAAHcAdQB1AHYAdQALCgB3AAsAmgB3AAsCOwB3AAtu8UgAygDAAHgKAJoAdwB3AHUAdQB2AHUAeAB1AHUAdgB1bvFIAMoAwAALCgCaAHcACwB3AAsCOwB3AAtu8UgAygDAAH4ACwGgALcBpwC6AahdAu0COwLtbvFIAMoAwAALCgCaAu0ACwLtAAsCOwLtAAtu8UgAygDAA24ACwNvAAu0VsQAAzsAABCkjUIpAAsAUIusOggWcgMeBxVsGwL67U/2HlzmWOEeOgALASvuAAseAfpKUpnpGgYJDCIZM6YyARUE9ThqAD5iXQgnAJYJPnOzw0ZAEZxEKsIAkA4DhAHnTAIDxxUDK0lxCQlPYgIvIQVYJQBVqE1GakUAKGYiDToSBA1EtAYAXQJYAIF8GgMHRyAAIAjOe9YncekRAA0KACUrjwE7Ayc6AAYWAqaiKG4McEcqANoN3+Mg9TwCBhIkuCny+JwUQ29L008JluRxu3K+oAdqiHOqFH0AG5SUIfUJ5SxCGfxdipRzqTmT4V5Zb+r1Uo4Vm+NqSSEl2mNvR2JhIa8SpYO6ntdwFXHCWTCK8f2+Hxo7uiG3drDycAuKIMP5bhi06ACnqArH1rz4Rqg//lm6SgJGEVbF9xJHISaR6HxqxSnkw6shDnelHKNEfGUXSJRJ1GcsmtJw25xrZMDK9gXSm1/YMkdX4/6NKYOdtk/NQ3/NnDASjTc3fPjIjW/5sVfVObX2oTDWkr1dF9f3kxBsD3/3aQO8hPfRz+e0uEiJqt1161griu7gz8hDDwtpy+F+BWtefnKHZPAxcZoWbnznhJpy0e842j36bcNzGnIEusgGX0a8ZxsnjcSsPDZ09yZ36fCQbriHeQ72JRMILNl6ePPf2HWoVwgWAm1fb3V2sAY0+B6rAXqSwPBgseVmoqsBTSrm91+XasMYYySI8eeRxH3ZvHkMz3BQ5aJ3iUVbYPNM3/7emRtjlsMgv/9VyTsyt/mK+8fgWeT6SoFaclXqn42dAIsvAarF5vNNWHzKSkKQ/8Hfk5ZWK7r9yliOsooyBjRhfkHP4Q2DkWXQi6FG/9r/IwbmkV5T7JSopHKn1pJwm9tb5Ot0oyN1Z2mPpKXHTxx2nlK08fKk1hEYA8WgVVWL5lgx0iTv+KdojJeU23ZDjmiubXOxVXJKKi2Wjuh2HLZOFLiSC7Tls5SMh4f+Pj6xUSrNjFqLGehRNB8lC0QSLNmkJJx/wSG3MnjE9T1CkPwJI0wH2lfzwETIiVqUxg0dfu5q39Gt+hwdcxkhhNvQ4TyrBceof3Mhs/IxFci1HmHr4FMZgXEEczPiGCx0HRwzAqDq2j9AVm1kwN0mRVLWLylgtoPNapF5cY4Y1wJh/e0BBwZj44YgZrDNqvD/9Hv7GFYdUQeDJuQ3EWI4HaKqavU1XjC/n41kT4L79kqGq0kLhdTZvgP3TA3fS0ozVz+5piZsoOtIvBUFoMKbNcmBL6YxxaUAusHB38XrS8dQMnQwJfUUkpRoGr5AUeWicvBTzyK9g77+yCkf5PAysL7r/JjcZgrbvRpMW9iyaxZvKO6ceZN2EwIxKwVFPuvFuiEPGCoagbMo+SpydLrXqBzNCDGFCrO/rkcwa2xhokQZ5CdZ0AsU3JfSqJ6n5I14YA+P/uAgfhPU84Tlw7cEFfp7AEE8ey4sP12PTt4Cods1GRgDOB5xvyiR5m+Bx8O5nBCNctU8BevfV5A08x6RHd5jcwPTMDSZJOedIZ1cGQ704lxbAzqZOP05ZxaOghzSdvFBHYqomATARyAADK4elP8Ly3IrUZKfWh23Xy20uBUmLS4Pfagu9+oyVa2iPgqRP3F2CTUsvJ7+RYnN8fFZbU/HVvxvcFFDKkiTqV5UBZ3Gz54JAKByi9hkKMZJvuGgcSYXFmw08UyoQyVdfTD1/dMkCHXcTGAKeROgArsvmRrQTLUOXioOHGK2QkjHuoYFgXciZoTJd6Fs5q1QX1G+p/e26hYsEf7QZD1nnIyl/SFkNtYYmmBhpBrxl9WbY0YpHWRuw2Ll/tj9mD8P4snVzJl4F9J+1arVeTb9E5r2ILH04qStjxQNwn3m4YNqxmaNbLAqW2TN6LidwuJRqS+NXbtqxoeDXpxeGWmxzSkWxjkyCkX4NQRme6q5SAcC+M7+9ETfA/EwrzQajKakCwYyeunP6ZFlxU2oMEn1Pz31zeStW74G406ZJFCl1wAXIoUKkWotYEpOuXB1uVNxJ63dpJEqfxBeptwIHNrPz8BllZoIcBoXwgfJ+8VAUnVPvRvexnw0Ma/WiGYuJO5y8QTvEYBigFmhUxY5RqzE8OcywN/8m4UYrlaniJO75XQ6KSo9+tWHlu+hMi0UVdiKQp7NelnoZUzNaIyBPVeOwK6GNp+FfHuPOoyhaWuNvTYFkvxscMQWDh+zeFCFkgwbXftiV23ywJ4+uwRqmg9k3KzwIQpzppt8DBBOMbrqwQM5Gb05sEwdKzMiAqOloaA/lr0KA+1pr0/+HiWoiIjHA/wir2nIuS3PeU/ji3O6ZwoxcR1SZ9FhtLC5S0FIzFhbBWcGVP/KpxOPSiUoAdWUpqKH++6Scz507iCcxYI6rdMBICPJZea7OcmeFw5mObJSiqpjg2UoWNIs+cFhyDSt6geV5qgi3FunmwwDoGSMgerFOZGX1m0dMCYo5XOruxO063dwENK9DbnVM9wYFREzh4vyU1WYYJ/LRRp6oxgjqP/X5a8/4Af6p6NWkQferzBmXme0zY/4nwMJm/wd1tIqSwGz+E3xPEAOoZlJit3XddD7/BT1pllzOx+8bmQtANQ/S6fZexc6qi3W+Q2xcmXTUhuS5mpHQRvcxZUN0S5+PL9lXWUAaRZhEH8hTdAcuNMMCuVNKTEGtSUKNi3O6KhSaTzck8csZ2vWRZ+d7mW8c4IKwXIYd25S/zIftPkwPzufjEvOHWVD1m+FjpDVUTV0DGDuHj6QnaEwLu/dEgdLQOg9E1Sro9XHJ8ykLAwtPu+pxqKDuFexqON1sKQm7rwbE1E68UCfA/erovrTCG+DBSNg0l4goDQvZN6uNlbyLpcZAwj2UclycvLpIZMgv4yRlpb3YuMftozorbcGVHt/VeDV3+Fdf1TP0iuaCsPi2G4XeGhsyF1ubVDxkoJhmniQ0/jSg/eYML9KLfnCFgISWkp91eauR3IQvED0nAPXK+6hPCYs+n3+hCZbiskmVMG2da+0EsZPonUeIY8EbfusQXjsK/eFDaosbPjEfQS0RKG7yj5GG69M7MeO1HmiUYocgygJHL6M1qzUDDwUSmr99V7Sdr2F3JjQAJY+F0yH33Iv3+C9M38eML7gTgmNu/r2bUMiPvpYbZ6v1/IaESirBHNa7mPKn4dEmYg7v/+HQgPN1G79jBQ1+soydfDC2r+h2Bl/KIc5KjMK7OH6nb1jLsNf0EHVe2KBiE51ox636uyG6Lho0t3J34L5QY/ilE3mikaF4HKXG1mG1rCevT1Vv6GavltxoQe/bMrpZvRggnBxSEPEeEzkEdOxTnPXHVjUYdw8JYvjB/o7Eegc3Ma+NUxLLnsK0kJlinPmUHzHGtrk5+CAbVzFOBqpyy3QVUnzTDfC/0XD94/okH+OB+i7g9lolhWIjSnfIb+Eq43ZXOWmwvjyV/qqD+t0e+7mTEM74qP/Ozt8nmC7mRpyu63OB4KnUzFc074SqoyPUAgM+/TJGFo6T44EHnQU4X4z6qannVqgw/U7zCpwcmXV1AubIrvOmkKHazJAR55ePjp5tLBsN8vAqs3NAHdcEHOR2xQ0lsNAFzSUuxFQCFYvXLZJdOj9p4fNq6p0HBGUik2YzaI4xySy91KzhQ0+q1hjxvImRwPRf76tChlRkhRCi74NXZ9qUNeIwP+s5p+3m5nwPdNOHgSLD79n7O9m1n1uDHiMntq4nkYwV5OZ1ENbXxFd4PgrlvavZsyUO4MqYlqqn1O8W/I1dEZq5dXhrbETLaZIbC2Kj/Aa/QM+fqUOHdf0tXAQ1huZ3cmWECWSXy/43j35+Mvq9xws7JKseriZ1pEWKc8qlzNrGPUGcVgOa9cPJYIJsGnJTAUsEcDOEVULO5x0rXBijc1lgXEzQQKhROf8zIV82w8eswc78YX11KYLWQRcgHNJElBxfXr72lS2RBSl07qTKorO2uUDZr3sFhYsvnhLZn0A94KRzJ/7DEGIAhW5ZWFpL8gEwu1aLA9MuWZzNwl8Oze9Y+bX+v9gywRVnoB5I/8kXTXU3141yRLYrIOOz6SOnyHNy4SieqzkBXharjfjqq1q6tklaEbA8Qfm2DaIPs7OTq/nvJBjKfO2H9bH2cCMh1+5gspfycu8f/cuuRmtDjyqZ7uCIMyjdV3a+p3fqmXsRx4C8lujezIFHnQiVTXLXuI1XrwN3+siYYj2HHTvESUx8DlOTXpak9qFRK+L3mgJ1WsD7F4cu1aJoFoYQnu+wGDMOjJM3kiBQWHCcvhJ/HRdxodOQp45YZaOTA22Nb4XKCVxqkbwMYFhzYQYIAnCW8FW14uf98jhUG2zrKhQQ0q0CEq0t5nXyvUyvR8DvD69LU+g3i+HFWQMQ8PqZuHD+sNKAV0+M6EJC0szq7rEr7B5bQ8BcNHzvDMc9eqB5ZCQdTf80Obn4uzjwpYU7SISdtV0QGa9D3Wrh2BDQtpBKxaNFV+/Cy2P/Sv+8s7Ud0Fd74X4+o/TNztWgETUapy+majNQ68Lq3ee0ZO48VEbTZYiH1Co4OlfWef82RWeyUXo7woM03PyapGfikTnQinoNq5z5veLpeMV3HCAMTaZmA1oGLAn7XS3XYsz+XK7VMQsc4XKrmDXOLU/pSXVNUq8dIqTba///3x6LiLS6xs1xuCAYSfcQ3+rQgmu7uvf3THKt5Ooo97TqcbRqxx7EASizaQCBQllG/rYxVapMLgtLbZS64w1MDBMXX+PQpBKNwqUKOf2DDRDUXQf9EhOS0Qj4nTmlA8dzSLz/G1d+Ud8MTy/6ghhdiLpeerGY/UlDOfiuqFsMUU5/UYlP+BAmgRLuNpvrUaLlVkrqDievNVEAwF+4CoM1MZTmjxjJMsKJq+u8Zd7tNCUFy6LiyYXRJQ4VyvEQFFaCGKsxIwQkk7EzZ6LTJq2hUuPhvAW+gQnSG6J+MszC+7QCRHcnqDdyNRJ6T9xyS87A6MDutbzKGvGktpbXqtzWtXb9HsfK2cBMomjN9a4y+TaJLnXxAeX/HWzmf4cR4vALt/P4w4qgKY04ml4ZdLOinFYS6cup3G/1ie4+t1eOnpBNlqGqs75ilzkT4+DsZQxNvaSKJ//6zIbbk/M7LOhFmRc/1R+kBtz7JFGdZm/COotIdvQoXpTqP/1uqEUmCb/QWoGLMwO5ANcHzxdY48IGP5+J+zKOTBFZ4Pid+GTM+Wq12MV/H86xEJptBa6T+p3kgpwLedManBHC2GgNrFpoN2xnrMz9WFWX/8/ygSBkavq2Uv7FdCsLEYLu9LLIvAU0bNRDtzYl
2+/vXmjpIvuJFYjmI0im6QEYqnIeMsNjXG4vIutIGHijeAG/9EDBozKV5cldkHbLxHh25vT+ZEzbhXlqvpzKJwcEgfNwLAKFeo0/pvEE10XDB+EXRTXtSzJozQKFFAJhMxYkVaCW+E9AL7tMeU8acxidHqzb6lX4691UsDpy/LLRmT+epgW56+5Cw8tB4kMUv6s9lh3eRKbyGs+H/4mQMaYzPTf2OOdokEn+zzgvoD3FqNKk8QqGAXVsqcGdXrT62fSPkR2vROFi68A6se86UxRUk4cajfPyCC4G5wDhD+zNq4jodQ4u4n/m37Lr36n4LIAAsVr02dFi9AiwA81MYs2rm4eDlDNmdMRvEKRHfBwW5DdMNp0jPFZMeARqF/wL4XBfd+EMLBfMzpH5GH6NaW+1vrvMdg+VxDzatk3MXgO3ro3P/DpcC6+Mo4MySJhKJhSR01SGGGp5hPWmrrUgrv3lDnP+HhcI3nt3YqBoVAVTBAQT5iuhTg8nvPtd8ZeYj6w1x6RqGUBrSku7+N1+BaasZvjTk64RoIDlL8brpEcJx3OmY7jLoZsswdtmhfC/G21llXhITOwmvRDDeTTPbyASOa16cF5/A1fZAidJpqju3wYAy9avPR1ya6eNp9K8XYrrtuxlqi+bDKwlfrYdR0RRiKRVTLOH85+ZY7XSmzRpfZBJjaTa81VDcJHpZnZnSQLASGYW9l51ZV/h7eVzTi3Hv6hUsgc/51AqJRTkpbFVLXXszoBL8nBX0u/0jBLT8nH+fJePbrwURT58OY+UieRjd1vs04w0VG5VN2U6MoGZkQzKN/ptz0Q366dxoTGmj7i1NQGHi9GgnquXFYdrCfZBmeb7s0T6yrdlZH5cZuwHFyIJ/kAtGsTg0xH5taAAq44BAk1CPk9KVVbqQzrCUiFdF/6gtlPQ8bHHc1G1W92MXGZ5HEHftyLYs8mbD/9xYRUWkHmlM0zC2ilJlnNgV4bfALpQghxOUoZL7VTqtCHIaQSXm+YUMnpkXybnV+A6xlm2CVy8fn0Xlm2XRa0+zzOa21JWWmixfiPMSCZ7qA4rS93VN3pkpF1s5TonQjisHf7iU9ZGvUPOAKZcR1pbeVf/Ul7OhepGCaId9wOtqo7pJ7yLcBZ0pFkOF28y4zEI/kcUNmutBHaQpBdNM8vjCS6HZRokkeo88TBAjGyG7SR+6vUgTcyK9Imalj0kuxz0wmK+byQU11AiJFk/ya5dNduRClcnU64yGu/ieWSeOos1t3ep+RPIWQ2pyTYVbZltTbsb7NiwSi3AV+8KLWk7LxCnfZUetEM8ThnsSoGH38/nyAwFguJp8FjvlHtcWZuU4hPva0rHfr0UhOOJ/F6vS62FW7KzkmRll2HEc7oUq4fyi5T70Vl7YVIfsPHUCdHesf9Lk7WNVWO75JDkYbMI8TOW8JKVtLY9d6UJRITO8oKo0xS+o99Yy04iniGHAaGj88kEWgwv0OrHdY/nr76DOGNS59hXCGXzTKUvDl9iKpLSWYN1lxIeyywdNpTkhay74w2jFT6NS8qkjo5CxA1yfSYwp6AJIZNKIeEK5PJAW7ORgWgwp0VgzYpqovMrWxbu+DGZ6Lhie1RAqpzm8VUzKJOH3mCzWuTOLsN3VT/dv2eeYe9UjbR8YTBsLz7q60VN1sU51k+um1f8JxD5pPhbhSC8rRaB454tmh6YUWrJI3+GWY0qeWioj/tbkYITOkJaeuGt4JrJvHA+l0Gu7kY7XOaa05alMnRWVCXqFgLIwSY4uF59Ue5SU4QKuc/HamDxbr0x6csCetXGoP7Qn1Bk/J9DsynO/UD6iZ1Hyrz+jit0hDCwi/E9OjgKTbB3ZQKQ/0ZOvevfNHG0NK4Aj3Cp7NpRk07RT1i/S0EL93Ag8GRgKI9CfpajKyK6+Jj/PI1KO5/85VAwz2AwzP8FTBb075IxCXv6T9RVvWT2tUaqxDS92zrGUbWzUYk9mSs82pECH+fkqsDt93VW++4YsR/dHCYcQSYTO/KaBMDj9LSD/J/+z20Kq8XvZUAIHtm9hRPP3ItbuAu2Hm5lkPs92pd7kCxgRs0xOVBnZ13ccdA0aunrwv9SdqElJRC3g+oCu+nXyCgmXUs9yMjTMAIHfxZV+aPKcZeUBWt057Xo85Ks1Ir5gzEHCWqZEhrLZMuF11ziGtFQUds/EESajhagzcKsxamcSZxGth4UII+adPhQkUnx2WyN+4YWR+r3f8MnkyGFuR4zjzxJS8WsQYR5PTyRaD9ixa6Mh741nBHbzfjXHskGDq179xaRNrCIB1z1xRfWfjqw2pHc1zk9xlPpL8sQWAIuETZZhbnmL54rceXVNRvUiKrrqIkeogsl0XXb17ylNb0f4GA9Wd44vffEG8FSZGHEL2fbaTGRcSiCeA8PmA/f6Hz8HCS76fXUHwgwkzSwlI71ekZ7Fapmlk/KC+Hs8hUcw3N2LN5LhkVYyizYFl/uPeVP5lsoJHhhfWvvSWruCUW1ZcJOeuTbrDgywJ/qG07gZJplnTvLcYdNaH0KMYOYMGX+rB4NGPFmQsNaIwlWrfCezxre8zXBrsMT+edVLbLqN1BqB76JH4BvZTqUIMfGwPGEn+EnmTV86fPBaYbFL3DFEhjB45CewkXEAtJxk4/Ms2pPXnaRqdky0HOYdcUcE2zcXq4vaIvW2/v0nHFJH2XXe22ueDmq/18XGtELSq85j9X8q0tcNSSKJIX8FTuJF/Pf8j5PhqG2u+osvsLxYrvvfeVJL+4tkcXcr9JV7v0ERmj/X6fM3NC4j6dS1+9Umr2oPavqiAydTZPLMNRGY23LO9zAVDly7jD+70G5TPPLdhRIl4WxcYjLnM+SNcJ26FOrkrISUtPObIz5Zb3AG612krnpy15RMW+1cQjlnWFI6538qky9axd2oJmHIHP08KyP0ubGO+TQNOYuv2uh17yCIvR8VcStw7o1g0NM60sk+8Tq7YfIBJrtp53GkvzXH7OA0p8/n/u1satf/VJhtR1l8Wa6Gmaug7haSpaCaYQax6ta0mkutlb+eAOSG1aobM81D9A4iS1RRlzBBoVX6tU1S6WE2N9ORY6DfeLRC4l9Rvr5h95XDWB2mR1d4WFudpsgVYwiTwT31ljskD8ZyDOlm5DkGh9N/UB/0AI5Xvb8ZBmai2hQ4BWMqFwYnzxwB26YHSOv9WgY3JXnvoN+2R4rqGVh/LLDMtpFP+SpMGJNWvbIl5SOodbCczW2RKleksPoUeGEzrjtKHVdtZA+kfqO+rVx/iclCqwoopepvJpSTDjT+b9GWylGRF8EDbGlw6eUzmJM95Ovoz+kwLX3c2fTjFeYEsE7vUZm3mqdGJuKh2w9/QGSaqRHs99aScGOdDqkFcACoqdbBoQqqjamhH6Q9ng39JCg3lrGJwd50Qk9ovnqBTr8MME7Ps2wiVfygUmPoUBJJfJWX5Nda0nuncbFkA=="));new Set(ji(Ki)),new Set(ji(Ki)),function(t){let e=[];for(;;){let r=t();if(0==r)break;e.push(Fi(r,t))}for(;;){let r=t()-1;if(r<0)break;e.push(Hi(r,t))}(function(t){const e={};for(let r=0;r<t.length;r++){const i=t[r];e[i[0]]=i[1]}})(Li(e))}(Ki),function(t){let e=ji(t).sort(((t,e)=>t-e));(function r(){let i=[];for(;;){let n=ji(t,e);if(0==n.length)break;i.push({set:new Set(n),node:r()})}i.sort(((t,e)=>e.set.size-t.set.size));let n=t(),s=n%3;n=n/3|0;let o=!!(1&n);n>>=1;let a=1==n,c=2==n;return{branches:i,valid:s,fe0f:o,save:a,check:c}})()}(Ki),new jr(ki);new Uint8Array(32).fill(0);function Vi(t){return"string"==typeof t&&(t=Ri(t)),$r(function(t){const e=t.map((t=>
2Wr(t))),r=e.reduce(((t,e)=>t+e.length),0),i=new Uint8Array(r);return e.reduce(((t,e)=>(i.set(e,t),t+e.length)),0),Hr(i)}([Ri("\x19Ethereum Signed Message:\n"),Ri(String(t.length)),t]))}new jr("rlp/5.7.0");const Wi=new jr("address/5.7.0");function Gi(t){Gr(t,20)||Wi.throwArgumentError("invalid address","address",t);const e=(t=t.toLowerCase()).substring(2).split(""),r=new Uint8Array(40);for(let n=0;n<40;n++)r[n]=e[n].charCodeAt(0);const i=Wr($r(r));for(let n=0;n<40;n+=2)i[n>>1]>>4>=8&&(e[n]=e[n].toUpperCase()),(15&i[n>>1])>=8&&(e[n+1]=e[n+1].toUpperCase());return"0x"+e.join("")}const Ji={};for(let Qm=0;Qm<10;Qm++)Ji[String(Qm)]=String(Qm);for(let Qm=0;Qm<26;Qm++)Ji[String.fromCharCode(65+Qm)]=String(10+Qm);const Yi=Math.floor(function(t){return Math.log10?Math.log10(t):Math.log(t)/Math.LN10}(9007199254740991));function Qi(t){let e=null;if("string"!=typeof t&&Wi.throwArgumentError("invalid address","address",t),t.match(/^(0x)?[0-9a-fA-F]{40}$/))"0x"!==t.substring(0,2)&&(t="0x"+t),e=Gi(t),t.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&e!==t&&Wi.throwArgumentError("bad address checksum","address",t);else if(t.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(t.substring(2,4)!==function(t){let e=(t=(t=t.toUpperCase()).substring(4)+t.substring(0,2)+"00").split("").map((t=>Ji[t])).join("");for(;e.length>=Yi;){let t=e.substring(0,Yi);e=parseInt(t,10)%97+e.substring(t.length)}let r=String(98-parseInt(e,10)%97);for(;r.length<2;)r="0"+r;return r}(t)&&Wi.throwArgumentError("bad icap checksum","address",t),e=function(t){return new ni(t,36).toString(16)}(t.substring(4));e.length<40;)e="0"+e;e=Gi("0x"+e)}else Wi.throwArgumentError("invalid address","address",t);return e}function Xi(t,e,r){Object.defineProperty(t,e,{enumerable:!0,value:r,writable:!1})}new jr("properties/5.7.0"),new jr(ki);new Uint8Array(32).fill(0),hi.from(-1);const Zi=hi.from(0),$i=hi.from(1);hi.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),Xr($i.toHexString(),32),Xr(Zi.toHexString(),32);var tn={},en={},rn=nn;function nn(t,e){if(!t)throw new Error(e||"Assertion failed")}nn.equal=function(t,e,r){if(t!=e)throw new Error(r||"Assertion failed: "+t+" != "+e)};var sn={exports:{}};"function"==typeof Object.create?sn.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:sn.exports=function(t,e){if(e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}};var on=rn,an=sn.exports;function cn(t,e){return!(55296!==(64512&t.charCodeAt(e))||e<0||e+1>=t.length)&&56320===(64512&t.charCodeAt(e+1))}function hn(t){return(t>>>24|t>>>8&65280|t<<8&16711680|(255&t)<<24)>>>0}function un(t){return 1===t.length?"0"+t:t}function fn(t){return 7===t.length?"0"+t:6===t.length?"00"+t:5===t.length?"000"+t:4===t.length?"0000"+t:3===t.length?"00000"+t:2===t.length?"000000"+t:1===t.length?"0000000"+t:t}en.inherits=an,en.toArray=function(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var r=[];if("string"==typeof t)if(e){if("hex"===e)for((t=t.replace(/[^a-z0-9]+/gi,"")).length%2!==0&&(t="0"+t),n=0;n<t.length;n+=2)r.push(parseInt(t[n]+t[n+1],16))}else for(var i=0,n=0;n<t.length;n++){var s=t.charCodeAt(n);s<128?r[i++]=s:s<2048?(r[i++]=s>>6|192,r[i++]=63&s|128):cn(t,n)?(s=65536+((1023&s)<<10)+(1023&t.charCodeAt(++n)),r[i++]=s>>18|240,r[i++]=s>>12&63|128,r[i++]=s>>6&63|128,r[i++]=63&s|128):(r[i++]=s>>12|224,r[i++]=s>>6&63|128,r[i++]=63&s|128)}else for(n=0;n<t.length;n++)r[n]=0|t[n];return r},en.toHex=function(t){for(var e="",r=0;r<t.length;r++)e+=un(t[r].toString(16));return e},en.htonl=hn,en.toHex32=function(t,e){for(var r="",i=0;i<t.length;i++){var n=t[i];"little"===e&&(n=hn(n)),r+=fn(n.toString(16))}return r},en.zero2=un,en.zero8=fn,en.join32=function(t,e,r,i){var n=r-e;on(n%4===0);for(var s=new Array(n/4),o=0,a=e;o<s.length;o++,a+=4){var c;c="big"===i?t[a]<<24|t[a+1]<<16|t[a+2]<<8|t[a+3]:t[a+3]<<24|t[a+2]<<16|t[a+1]<<8|t[a],s[o]=c>>>0}return s},en.split32=function(t,e){for(var r=new Array(4*t.length),i=0,n=0;i<t.length;i++,n+=4){var s=t[i];"big"===e?(r[n]=s>>>24,r[n+1]=s>>>16&255,r[n+2]=s>>>8&255,r[n+3]=255&s):(r[n+3]=s>>>24,r[n+2]=s>>>16&255,r[n+1]=s>>>8&255,r[n]=255&s)}return r},en.rotr32=function(t,e){return t>>>e|t<<32-e},en.rotl32=function(t,e){return t<<e|t>>>32-e},en.sum32=function(t,e){return t+e>>>0},en.sum32_3=function(t,e,r){return t+e+r>>>0},en.sum32_4=function(t,e,r,i){return t+e+r+i>>>0},en.sum32_5=function(t,e,r,i,n){return t+e+r+i+n>>>0},en.sum64=function(t,e,r,i){var n=t[e],s=i+t[e+1]>>>0,o=(s<i?1:0)+r+n;t[e]=o>>>0,t[e+1]=s},en.sum64_hi=function(t,e,r,i){return(e+i>>>0<e?1:0)+t+r>>>0},en.sum64_lo=function(t,e,r,i){return e+i>>>0},en.sum64_4_hi=function(t,e,r,i,n,s,o,a){var c=0,h=e;return c+=(h=h+i>>>0)<e?1:0,c+=(h=h+s>>>0)<s?1:0,t+r+n+o+(c+=(h=h+a>>>0)<a?1:0)>>>0},en.sum64_4_lo=function(t,e,r,i,n,s,o,a){return e+i+s+a>>>0},en.sum64_5_hi=function(t,e,r,i,n,s,o,a,c,h){var u=0,f=e;return u+=(f=f+i>>>0)<e?1:0,u+=(f=f+s>>>0)<s?1:0,u+=(f=f+a>>>0)<a?1:0,t+r+n+o+c+(u+=(f=f+h>>>0)<h?1:0)>>>0},en.sum64_5_lo=function(t,e,r,i,n,s,o,a,c,h){return e+i+s+a+h>>>0},en.rotr64_hi=function(t,e,r){return(e<<32-r|t>>>r)>>>0},en.rotr64_lo=function(t,e,r){return(t<<32-r|e>>
vendor: 6,967 bytes, line 2
2>r)>>>0},en.shr64_hi=function(t,e,r){return t>>>r},en.shr64_lo=function(t,e,r){return(t<<32-r|e>>>r)>>>0};var ln={},dn=en,pn=rn;function gn(){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}ln.BlockHash=gn,gn.prototype.update=function(t,e){if(t=dn.toArray(t,e),this.pending?this.pending=this.pending.concat(t):this.pending=t,this.pendingTotal+=t.length,this.pending.length>=this._delta8){var r=(t=this.pending).length%this._delta8;this.pending=t.slice(t.length-r,t.length),0===this.pending.length&&(this.pending=null),t=dn.join32(t,0,t.length-r,this.endian);for(var i=0;i<t.length;i+=this._delta32)this._update(t,i,i+this._delta32)}return this},gn.prototype.digest=function(t){return this.update(this._pad()),pn(null===this.pending),this._digest(t)},gn.prototype._pad=function(){var t=this.pendingTotal,e=this._delta8,r=e-(t+this.padLength)%e,i=new Array(r+this.padLength);i[0]=128;for(var n=1;n<r;n++)i[n]=0;if(t<<=3,"big"===this.endian){for(var s=8;s<this.padLength;s++)i[n++]=0;i[n++]=0,i[n++]=0,i[n++]=0,i[n++]=0,i[n++]=t>>>24&255,i[n++]=t>>>16&255,i[n++]=t>>>8&255,i[n++]=255&t}else for(i[n++]=255&t,i[n++]=t>>>8&255,i[n++]=t>>>16&255,i[n++]=t>>>24&255,i[n++]=0,i[n++]=0,i[n++]=0,i[n++]=0,s=8;s<this.padLength;s++)i[n++]=0;return i};var mn={},vn={},bn=en.rotr32;function yn(t,e,r){return t&e^~t&r}function wn(t,e,r){return t&e^t&r^e&r}function _n(t,e,r){return t^e^r}vn.ft_1=function(t,e,r,i){return 0===t?yn(e,r,i):1===t||3===t?_n(e,r,i):2===t?wn(e,r,i):void 0},vn.ch32=yn,vn.maj32=wn,vn.p32=_n,vn.s0_256=function(t){return bn(t,2)^bn(t,13)^bn(t,22)},vn.s1_256=function(t){return bn(t,6)^bn(t,11)^bn(t,25)},vn.g0_256=function(t){return bn(t,7)^bn(t,18)^t>>>3},vn.g1_256=function(t){return bn(t,17)^bn(t,19)^t>>>10};var An=en,En=ln,Sn=vn,Mn=An.rotl32,In=An.sum32,xn=An.sum32_5,Pn=Sn.ft_1,On=En.BlockHash,Nn=[1518500249,1859775393,2400959708,3395469782];function Rn(){if(!(this instanceof Rn))return new Rn;On.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}An.inherits(Rn,On);var Cn=Rn;Rn.blockSize=512,Rn.outSize=160,Rn.hmacStrength=80,Rn.padLength=64,Rn.prototype._update=function(t,e){for(var r=this.W,i=0;i<16;i++)r[i]=t[e+i];for(;i<r.length;i++)r[i]=Mn(r[i-3]^r[i-8]^r[i-14]^r[i-16],1);var n=this.h[0],s=this.h[1],o=this.h[2],a=this.h[3],c=this.h[4];for(i=0;i<r.length;i++){var h=~~(i/20),u=xn(Mn(n,5),Pn(h,s,o,a),c,r[i],Nn[h]);c=a,a=o,o=Mn(s,30),s=n,n=u}this.h[0]=In(this.h[0],n),this.h[1]=In(this.h[1],s),this.h[2]=In(this.h[2],o),this.h[3]=In(this.h[3],a),this.h[4]=In(this.h[4],c)},Rn.prototype._digest=function(t){return"hex"===t?An.toHex32(this.h,"big"):An.split32(this.h,"big")};var Tn=en,kn=ln,Ln=vn,qn=rn,Dn=Tn.sum32,Un=Tn.sum32_4,Bn=Tn.sum32_5,jn=Ln.ch32,zn=Ln.maj32,Fn=Ln.s0_256,Hn=Ln.s1_256,Kn=Ln.g0_256,Vn=Ln.g1_256,Wn=kn.BlockHash,Gn=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function Jn(){if(!(this instanceof Jn))return new Jn;Wn.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=Gn,this.W=new Array(64)}Tn.inherits(Jn,Wn);var Yn=Jn;Jn.blockSize=512,Jn.outSize=256,Jn.hmacStrength=192,Jn.padLength=64,Jn.prototype._update=function(t,e){for(var r=this.W,i=0;i<16;i++)r[i]=t[e+i];for(;i<r.length;i++)r[i]=Un(Vn(r[i-2]),r[i-7],Kn(r[i-15]),r[i-16]);var n=this.h[0],s=this.h[1],o=this.h[2],a=this.h[3],c=this.h[4],h=this.h[5],u=this.h[6],f=this.h[7];for(qn(this.k.length===r.length),i=0;i<r.length;i++){var l=Bn(f,Hn(c),jn(c,h,u),this.k[i],r[i]),d=Dn(Fn(n),zn(n,s,o));f=u,u=h,h=c,c=Dn(a,l),a=o,o=s,s=n,n=Dn(l,d)}this.h[0]=Dn(this.h[0],n),this.h[1]=Dn(this.h[1],s),this.h[2]=Dn(this.h[2],o),this.h[3]=Dn(this.h[3],a),this.h[4]=Dn(this.h[4],c),this.h[5]=Dn(this.h[5],h),this.h[6]=Dn(this.h[6],u),this.h[7]=Dn(this.h[7],f)},Jn.prototype._digest=function(t){return"hex"===t?Tn.toHex32(this.h,"big"):Tn.split32(this.h,"big")};var Qn=en,Xn=Yn;function Zn(){if(!(this instanceof Zn))return new Zn;Xn.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}Qn.inherits(Zn,Xn);var $n=Zn;Zn.blockSize=512,Zn.outSize=224,Zn.hmacStrength=192,Zn.padLength=64,Zn.prototype._digest=function(t){return"hex"===t?Qn.toHex32(this.h.slice(0,7),"big"):Qn.split32(this.h.slice(0,7),"big")};var ts=en,es=ln,rs=rn,is=ts.rotr64_hi,ns=ts.rotr64_lo,ss=ts.shr64_hi,os=ts.shr64_lo,as=ts.sum64,cs=ts.sum64_hi,hs=ts.sum64_lo,us=ts.sum64_4_hi,fs=ts.sum64_4_lo,ls=ts.sum64_5_hi,ds=ts.sum64_5_lo,ps=es.BlockHash,gs=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,
vendor: 1,679 bytes, line 2
21126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function ms(){if(!(this instanceof ms))return new ms;ps.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=gs,this.W=new Array(160)}ts.inherits(ms,ps);var vs=ms;function bs(t,e,r,i,n){var s=t&r^~t&n;return s<0&&(s+=4294967296),s}function ys(t,e,r,i,n,s){var o=e&i^~e&s;return o<0&&(o+=4294967296),o}function ws(t,e,r,i,n){var s=t&r^t&n^r&n;return s<0&&(s+=4294967296),s}function _s(t,e,r,i,n,s){var o=e&i^e&s^i&s;return o<0&&(o+=4294967296),o}function As(t,e){var r=is(t,e,28)^is(e,t,2)^is(e,t,7);return r<0&&(r+=4294967296),r}function Es(t,e){var r=ns(t,e,28)^ns(e,t,2)^ns(e,t,7);return r<0&&(r+=4294967296),r}function Ss(t,e){var r=is(t,e,14)^is(t,e,18)^is(e,t,9);return r<0&&(r+=4294967296),r}function Ms(t,e){var r=ns(t,e,14)^ns(t,e,18)^ns(e,t,9);return r<0&&(r+=4294967296),r}function Is(t,e){var r=is(t,e,1)^is(t,e,8)^ss(t,e,7);return r<0&&(r+=4294967296),r}function xs(t,e){var r=ns(t,e,1)^ns(t,e,8)^os(t,e,7);return r<0&&(r+=4294967296),r}function Ps(t,e){var r=is(t,e,19)^is(e,t,29)^ss(t,e,6);return r<0&&(r+=4294967296),r}function Os(t,e){var r=ns(t,e,19)^ns(e,t,29)^os(t,e,6);return r<0&&(r+=4294967296),r}ms.blockSize=1024,ms.outSize=512,ms.hmacStrength=192,ms.padLength=128,ms.prototype._prepareBlock=function(t,e){for(var r=this.W,i=0;i<32;i++)r[i]=t[e+i];for(;i<r.length;i+=2){var n=Ps(r[i-4],r[i-3]),s=Os(r[i-4],r[i-3]),o=r[i-14],a=r[i-13],c=Is(r[i-30],r[i-29]),h=xs(r[i-30],r[i-29]),u=r[i-32],f=r[i-31];
vendor: 38,060 bytes, line 2
2r[i]=us(n,s,o,a,c,h,u,f),r[i+1]=fs(n,s,o,a,c,h,u,f)}},ms.prototype._update=function(t,e){this._prepareBlock(t,e);var r=this.W,i=this.h[0],n=this.h[1],s=this.h[2],o=this.h[3],a=this.h[4],c=this.h[5],h=this.h[6],u=this.h[7],f=this.h[8],l=this.h[9],d=this.h[10],p=this.h[11],g=this.h[12],m=this.h[13],v=this.h[14],b=this.h[15];rs(this.k.length===r.length);for(var y=0;y<r.length;y+=2){var w=v,_=b,A=Ss(f,l),E=Ms(f,l),S=bs(f,l,d,p,g),M=ys(f,l,d,p,g,m),I=this.k[y],x=this.k[y+1],P=r[y],O=r[y+1],N=ls(w,_,A,E,S,M,I,x,P,O),R=ds(w,_,A,E,S,M,I,x,P,O);w=As(i,n),_=Es(i,n),A=ws(i,n,s,o,a),E=_s(i,n,s,o,a,c);var C=cs(w,_,A,E),T=hs(w,_,A,E);v=g,b=m,g=d,m=p,d=f,p=l,f=cs(h,u,N,R),l=hs(u,u,N,R),h=a,u=c,a=s,c=o,s=i,o=n,i=cs(N,R,C,T),n=hs(N,R,C,T)}as(this.h,0,i,n),as(this.h,2,s,o),as(this.h,4,a,c),as(this.h,6,h,u),as(this.h,8,f,l),as(this.h,10,d,p),as(this.h,12,g,m),as(this.h,14,v,b)},ms.prototype._digest=function(t){return"hex"===t?ts.toHex32(this.h,"big"):ts.split32(this.h,"big")};var Ns=en,Rs=vs;function Cs(){if(!(this instanceof Cs))return new Cs;Rs.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}Ns.inherits(Cs,Rs);var Ts=Cs;Cs.blockSize=1024,Cs.outSize=384,Cs.hmacStrength=192,Cs.padLength=128,Cs.prototype._digest=function(t){return"hex"===t?Ns.toHex32(this.h.slice(0,12),"big"):Ns.split32(this.h.slice(0,12),"big")},mn.sha1=Cn,mn.sha224=$n,mn.sha256=Yn,mn.sha384=Ts,mn.sha512=vs;var ks={},Ls=en,qs=ln,Ds=Ls.rotl32,Us=Ls.sum32,Bs=Ls.sum32_3,js=Ls.sum32_4,zs=qs.BlockHash;function Fs(){if(!(this instanceof Fs))return new Fs;zs.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}function Hs(t,e,r,i){return t<=15?e^r^i:t<=31?e&r|~e&i:t<=47?(e|~r)^i:t<=63?e&i|r&~i:e^(r|~i)}function Ks(t){return t<=15?0:t<=31?1518500249:t<=47?1859775393:t<=63?2400959708:2840853838}function Vs(t){return t<=15?1352829926:t<=31?1548603684:t<=47?1836072691:t<=63?2053994217:0}Ls.inherits(Fs,zs),ks.ripemd160=Fs,Fs.blockSize=512,Fs.outSize=160,Fs.hmacStrength=192,Fs.padLength=64,Fs.prototype._update=function(t,e){for(var r=this.h[0],i=this.h[1],n=this.h[2],s=this.h[3],o=this.h[4],a=r,c=i,h=n,u=s,f=o,l=0;l<80;l++){var d=Us(Ds(js(r,Hs(l,i,n,s),t[Ws[l]+e],Ks(l)),Js[l]),o);r=o,o=s,s=Ds(n,10),n=i,i=d,d=Us(Ds(js(a,Hs(79-l,c,h,u),t[Gs[l]+e],Vs(l)),Ys[l]),f),a=f,f=u,u=Ds(h,10),h=c,c=d}d=Bs(this.h[1],n,u),this.h[1]=Bs(this.h[2],s,f),this.h[2]=Bs(this.h[3],o,a),this.h[3]=Bs(this.h[4],r,c),this.h[4]=Bs(this.h[0],i,h),this.h[0]=d},Fs.prototype._digest=function(t){return"hex"===t?Ls.toHex32(this.h,"little"):Ls.split32(this.h,"little")};var Ws=[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],Gs=[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],Js=[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],Ys=[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],Qs=en,Xs=rn;function Zs(t,e,r){if(!(this instanceof Zs))return new Zs(t,e,r);this.Hash=t,this.blockSize=t.blockSize/8,this.outSize=t.outSize/8,this.inner=null,this.outer=null,this._init(Qs.toArray(e,r))}var $s=Zs;function to(t,e,r){return r={path:e,exports:{},require:function(t,e){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null!==e&&void 0!==e||r.path)}},t(r,r.exports),r.exports}Zs.prototype._init=function(t){t.length>this.blockSize&&(t=(new this.Hash).update(t).digest()),Xs(t.length<=this.blockSize);for(var e=t.length;e<this.blockSize;e++)t.push(0);for(e=0;e<t.length;e++)t[e]^=54;for(this.inner=(new this.Hash).update(t),e=0;e<t.length;e++)t[e]^=106;this.outer=(new this.Hash).update(t)},Zs.prototype.update=function(t,e){return this.inner.update(t,e),this},Zs.prototype.digest=function(t){return this.outer.update(this.inner.digest()),this.outer.digest(t)},function(t){var e=t;e.utils=en,e.common=ln,e.sha=mn,e.ripemd=ks,e.hmac=$s,e.sha1=e.sha.sha1,e.sha256=e.sha.sha256,e.sha224=e.sha.sha224,e.sha384=e.sha.sha384,e.sha512=e.sha.sha512,e.ripemd160=e.ripemd.ripemd160}(tn);var eo=ro;function ro(t,e){if(!t)throw new Error(e||"Assertion failed")}ro.equal=function(t,e,r){if(t!=e)throw new Error(r||"Assertion failed: "+t+" != "+e)};var io=to((function(t,e){var r=e;function i(t){return 1===t.length?"0"+t:t}function n(t){for(var e="",r=0;r<t.length;r++)e+=i(t[r].toString(16));return e}r.toArray=function(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var r=[];if("string"!=typeof t){for(var i=0;i<t.length;i++)r[i]=0|t[i];return r}if("hex"===e){(t=t.replace(/[^a-z0-9]+/gi,"")).length%2!==0&&(t="0"+t);for(i=0;i<t.length;i+=2)r.push(parseInt(t[i]+t[i+1],16))}else for(i=0;i<t.length;i++){var n=t.charCodeAt(i),s=n>>8,o=255&n;s?r.push(s,o):r.push(o)}return r},r.zero2=i,r.toHex=n,r.encode=function(t,e){return"hex"===e?n(t):t}})),no=to((function(t,e){var r=e;r.assert=eo,r.toArray=io.toArray,r.zero2=io.zero2,r.toHex=io.toHex,r.encode=io.encode,r.getNAF=function(t,e,r){var i=new Array(Math.max(t.bitLength(),r)+1);i.fill(0);for(var n=1<<e+1,s=t.clone(),o=0;o<i.length;o++){var a,c=s.andln(n-1);s.isOdd()?(a=c>(n>>1)-1?(n>>1)-c:c,s.isubn(a)):a=0,i[o]=a,s.iushrn(1)}return i},r.getJSF=function(t,e){var r=[[],[]];t=t.clone(),e=e.clone();for(var i,n=0,s=0;t.cmpn(-n)>0||e.cmpn(-s)>0;){var o,a,c=t.andln(3)+n&3,h=e.andln(3)+s&3;3===c&&(c=-1),3===h&&(h=-1),1&c?o=3!==(i=t.andln(7)+n&7)&&5!==i||2!==h?c:-c:o=0,r[0].push(o),1&h?a=3!==(i=e.andln(7)+s&7)&&5!==i||2!==c?h:-h:a=0,r[1].push(a),2*n===o+1&&(n=1-n),2*s===a+1&&(s=1-s),t.iushrn(1),e.iushrn(1)}return r},r.cachedProperty=function(t,e,r){var i="_"+e;t.prototype[e]=function(){return void 0!==this[i]?this[i]:this[i]=r.call(this)}},r.parseBytes=function(t){return"string"==typeof t?r.toArray(t,"hex"):t},r.intFromLE=function(t){return new ri(t,"hex","le")}})),so=no.getNAF,oo=no.getJSF,ao=no.assert;function co(t,e){this.type=t,this.p=new ri(e.p,16),this.red=e.prime?ri.red(e.prime):ri.mont(this.p),this.zero=new ri(0).toRed(this.red),this.one=new ri(1).toRed(this.red),this.two=new ri(2).toRed(this.red),this.n=e.n&&new ri(e.n,16),this.g=e.g&&this.pointFromJSON(e.g,e.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),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))}var ho=co;function uo(t,e){this.curve=t,this.type=e,this.precomputed=null}co.prototype.point=function(){throw new Error("Not implemented")},co.prototype.validate=function(){throw new Error("Not implemented")},co.prototype._fixedNafMul=function(t,e){ao(t.precomputed);var r=t._getDoubles(),i=so(e,1,this._bitLength),n=(1<<r.step+1)-(r.step%2===0?2:1);n/=3;var s,o,a=[];for(s=0;s<i.length;s+=r.step){o=0;for(var c=s+r.step-1;c>=s;c--)o=(o<<1)+i[c];a.push(o)}for(var h=this.jpoint(null,null,null),u=this.jpoint(null,null,null),f=n;f>0;f--){for(s=0;s<a.length;s++)(o=a[s])===f?u=u.mixedAdd(r.points[s]):o===-f&&(u=u.mixedAdd(r.points[s].neg()));h=h.add(u)}return h.toP()},co.prototype._wnafMul=function(t,e){var r=4,i=t._getNAFPoints(r);r=i.wnd;for(var n=i.points,s=so(e,r,this._bitLength),o=this.jpoint(null,null,null),a=s.length-1;a>=0;a--){for(var c=0;a>=0&&0===s[a];a--)c++;if(a>=0&&c++,o=o.dblp(c),a<0)break;var h=s[a];ao(0!==h),o="affine"===t.type?h>0?o.mixedAdd(n[h-1>>1]):o.mixedAdd(n[-h-1>>1].neg()):h>0?o.add(n[h-1>>1]):o.add(n[-h-1>>1].neg())}return"affine"===t.type?o.toP():o},co.prototype._wnafMulAdd=function(t,e,r,i,n){var s,o,a,c=this._wnafT1,h=this._wnafT2,u=this._wnafT3,f=0;for(s=0;s<i;s++){var l=(a=e[s])._getNAFPoints(t);c[s]=l.wnd,h[s]=l.points}for(s=i-1;s>=1;s-=2){var d=s-1,p=s;if(1===c[d]&&1===c[p]){var g=[e[d],null,null,e[p]];0===e[d].y.cmp(e[p].y)?(g[1]=e[d].add(e[p]),g[2]=e[d].toJ().mixedAdd(e[p].neg())):0===e[d].y.cmp(e[p].y.redNeg())?(g[1]=e[d].toJ().mixedAdd(e[p]),g[2]=e[d].add(e[p].neg())):(g[1]=e[d].toJ().mixedAdd(e[p]),g[2]=e[d].toJ().mixedAdd(e[p].neg()));var m=[-3,-1,-5,-7,0,7,5,1,3],v=oo(r[d],r[p]);for(f=Math.max(v[0].length,f),u[d]=new Array(f),u[p]=new Array(f),o=0;o<f;o++){var b=0|v[0][o],y=0|v[1][o];u[d][o]=m[3*(b+1)+(y+1)],u[p][o]=0,h[d]=g}}else u[d]=so(r[d],c[d],this._bitLength),u[p]=so(r[p],c[p],this._bitLength),f=Math.max(u[d].length,f),f=Math.max(u[p].length,f)}var w=this.jpoint(null,null,null),_=this._wnafT4;for(s=f;s>=0;s--){for(var A=0;s>=0;){var E=!0;for(o=0;o<i;o++)_[o]=0|u[o][s],0!==_[o]&&(E=!1);if(!E)break;A++,s--}if(s>=0&&A++,w=w.dblp(A),s<0)break;for(o=0;o<i;o++){var S=_[o];0!==S&&(S>0?a=h[o][S-1>>1]:S<0&&(a=h[o][-S-1>>1].neg()),w="affine"===a.type?w.mixedAdd(a):w.add(a))}}for(s=0;s<i;s++)h[s]=null;return n?w:w.toP()},co.BasePoint=uo,uo.prototype.eq=function(){throw new Error("Not implemented")},uo.prototype.validate=function(){return this.curve.validate(this)},co.prototype.decodePoint=function(t,e){t=no.toArray(t,e);var r=this.p.byteLength();if((4===t[0]||6===t[0]||7===t[0])&&t.length-1===2*r)return 6===t[0]?ao(t[t.length-1]%2===0):7===t[0]&&ao(t[t.length-1]%2===1),this.point(t.slice(1,1+r),t.slice(1+r,1+2*r));if((2===t[0]||3===t[0])&&t.length-1===r)return this.pointFromX(t.slice(1,1+r),3===t[0]);throw new Error("Unknown point format")},uo.prototype.encodeCompressed=function(t){return this.encode(t,!0)},uo.prototype._encode=function(t){var e=this.curve.p.byteLength(),r=this.getX().toArray("be",e);return t?[this.getY().isEven()?2:3].concat(r):[4].concat(r,this.getY().toArray("be",e))},uo.prototype.encode=function(t,e){return no.encode(this._encode(e),t)},uo.prototype.precompute=function(t){if(this.precomputed)return this;var e={doubles:null,naf:null,beta:null};return e.naf=this._getNAFPoints(8),e.doubles=this._getDoubles(4,t),e.beta=this._getBeta(),this.precomputed=e,this},uo.prototype._hasDoubles=function(t){if(!this.precomputed)return!1;var e=this.precomputed.doubles;return!!e&&e.points.length>=Math.ceil((t.bitLength()+1)/e.step)},uo.prototype._getDoubles=function(t,e){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],i=this,n=0;n<e;n+=t){for(var s=0;s<t;s++)i=i.dbl();r.push(i)}return{step:t,points:r}},uo.prototype._getNAFPoints=function(t){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var e=[this],r=(1<<t)-1,i=1===r?null:this.dbl(),n=1;n<r;n++)e[n]=e[n-1].add(i);return{wnd:t,points:e}},uo.prototype._getBeta=function(){return null},uo.prototype.dblp=function(t){for(var e=this,r=0;r<t;r++)e=e.dbl();return e};var fo=to((function(t){"function"==typeof Object.create?t.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(t,e){if(e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}}})),lo=no.assert;function po(t){ho.call(this,"short",t),this.a=new ri(t.a,16).toRed(this.red),this.b=new ri(t.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(t),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}fo(po,ho);var go=po;function mo(t,e,r,i){ho.BasePoint.call(this,t,"affine"),null===e&&null===r?(this.x=null,this.y=null,this.inf=!0):(this.x=new ri(e,16),this.y=new ri(r,16),i&&(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 vo(t,e,r,i){ho.BasePoint.call(this,t,"jacobian"),null===e&&null===r&&null===i?(this.x=this.curve.one,this.y=this.curve.one,this.z=new ri(0)):(this.x=new ri(e,16),this.y=new ri(r,16),this.z=new ri(i,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}po.prototype._getEndomorphism=function(t){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var e,r,i;if(t.beta)e=new ri(t.beta,16).toRed(this.red);else{var n=this._getEndoRoots(this.p);e=(e=n[0].cmp(n[1])<0?n[0]:n[1]).toRed(this.red)}if(t.lambda)r=new ri(t.lambda,16);else{var s=this._getEndoRoots(this.n);0===this.g.mul(s[0]).x.cmp(this.g.x.redMul(e))?r=s[0]:(r=s[1],lo(0===this.g.mul(r).x.cmp(this.g.x.redMul(e))))}return i=t.basis?t.basis.map((function(t){return{a:new ri(t.a,16),b:new ri(t.b,16)}})):this._getEndoBasis(r),{beta:e,lambda:r,basis:i}}},po.prototype._getEndoRoots=function(t){var e=t===this.p?this.red:ri.mont(t),r=new ri(2).toRed(e).redInvm(),i=r.redNeg(),n=new ri(3).toRed(e).redNeg().redSqrt().redMul(r);return[i.redAdd(n).fromRed(),i.redSub(n).fromRed()]},po.prototype._getEndoBasis=function(t){for(var e,r,i,n,s,o,a,c,h,u=this.n.ushrn(Math.floor(this.n.bitLength()/2)),f=t,l=this.n.clone(),d=new ri(1),p=new ri(0),g=new ri(0),m=new ri(1),v=0;0!==f.cmpn(0);){var b=l.div(f);c=l.sub(b.mul(f)),h=g.sub(b.mul(d));var y=m.sub(b.mul(p));if(!i&&c.cmp(u)<0)e=a.neg(),r=d,i=c.neg(),n=h;else if(i&&2===++v)break;a=c,l=f,f=c,g=d,d=h,m=p,p=y}s=c.neg(),o=h;var w=i.sqr().add(n.sqr());return s.sqr().add(o.sqr()).cmp(w)>=0&&(s=e,o=r),i.negative&&(i=i.neg(),n=n.neg()),s.negative&&(s=s.neg(),o=o.neg()),[{a:i,b:n},{a:s,b:o}]},po.prototype._endoSplit=function(t){var e=this.endo.basis,r=e[0],i=e[1],n=i.b.mul(t).divRound(this.n),s=r.b.neg().mul(t).divRound(this.n),o=n.mul(r.a),a=s.mul(i.a),c=n.mul(r.b),h=s.mul(i.b);return{k1:t.sub(o).sub(a),k2:c.add(h).neg()}},po.prototype.pointFromX=function(t,e){(t=new ri(t,16)).red||(t=t.toRed(this.red));var r=t.redSqr().redMul(t).redIAdd(t.redMul(this.a)).redIAdd(this.b),i=r.redSqrt();if(0!==i.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var n=i.fromRed().isOdd();return(e&&!n||!e&&n)&&(i=i.redNeg()),this.point(t,i)},po.prototype.validate=function(t){if(t.inf)return!0;var e=t.x,r=t.y,i=this.a.redMul(e),n=e.redSqr().redMul(e).redIAdd(i).redIAdd(this.b);return 0===r.redSqr().redISub(n).cmpn(0)},po.prototype._endoWnafMulAdd=function(t,e,r){for(var i=this._endoWnafT1,n=this._endoWnafT2,s=0;s<t.length;s++){var o=this._endoSplit(e[s]),a=t[s],c=a._getBeta();o.k1.negative&&(o.k1.ineg(),a=a.neg(!0)),o.k2.negative&&(o.k2.ineg(),c=c.neg(!0)),i[2*s]=a,i[2*s+1]=c,n[2*s]=o.k1,n[2*s+1]=o.k2}for(var h=this._wnafMulAdd(1,i,n,2*s,r),u=0;u<2*s;u++)i[u]=null,n[u]=null;return h},fo(mo,ho.BasePoint),po.prototype.point=function(t,e,r){return new mo(this,t,e,r)},po.prototype.pointFromJSON=function(t,e){return mo.fromJSON(this,t,e)},mo.prototype._getBeta=function(){if(this.curve.endo){var t=this.precomputed;if(t&&t.beta)return t.beta;var e=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(t){var r=this.curve,i=function(t){return r.point(t.x.redMul(r.endo.beta),t.y)};t.beta=e,e.precomputed={beta:null,naf:t.naf&&{wnd:t.naf.wnd,points:t.naf.points.map(i)},doubles:t.doubles&&{step:t.doubles.step,points:t.doubles.points.map(i)}}}return e}},mo.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]},mo.fromJSON=function(t,e,r){"string"==typeof e&&(e=JSON.parse(e));var i=t.point(e[0],e[1],r);if(!e[2])return i;function n(e){return t.point(e[0],e[1],r)}var s=e[2];return i.precomputed={beta:null,doubles:s.doubles&&{step:s.doubles.step,points:[i].concat(s.doubles.points.map(n))},naf:s.naf&&{wnd:s.naf.wnd,points:[i].concat(s.naf.points.map(n))}},i},mo.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},mo.prototype.isInfinity=function(){return this.inf},mo.prototype.add=function(t){if(this.inf)return t;if(t.inf)return this;if(this.eq(t))return this.dbl();if(this.neg().eq(t))return this.curve.point(null,null);if(0===this.x.cmp(t.x))return this.curve.point(null,null);var e=this.y.redSub(t.y);0!==e.cmpn(0)&&(e=e.redMul(this.x.redSub(t.x).redInvm()));var r=e.redSqr().redISub(this.x).redISub(t.x),i=e.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,i)},mo.prototype.dbl=function(){if(this.inf)return this;var t=this.y.redAdd(this.y);if(0===t.cmpn(0))return this.curve.point(null,null);var e=this.curve.a,r=this.x.redSqr(),i=t.redInvm(),n=r.redAdd(r).redIAdd(r).redIAdd(e).redMul(i),s=n.redSqr().redISub(this.x.redAdd(this.x)),o=n.redMul(this.x.redSub(s)).redISub(this.y);return this.curve.point(s,o)},mo.prototype.getX=function(){return this.x.fromRed()},mo.prototype.getY=function(){return this.y.fromRed()},mo.prototype.mul=function(t){return t=new ri(t,16),this.isInfinity()?this:this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve.endo?this.curve._endoWnafMulAdd([this],[t]):this.curve._wnafMul(this,t)},mo.prototype.mulAdd=function(t,e,r){var i=[this,e],n=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(i,n):this.curve._wnafMulAdd(1,i,n,2)},mo.prototype.jmulAdd=function(t,e,r){var i=[this,e],n=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(i,n,!0):this.curve._wnafMulAdd(1,i,n,2,!0)},mo.prototype.eq=function(t){return this===t||this.inf===t.inf&&(this.inf||0===this.x.cmp(t.x)&&0===this.y.cmp(t.y))},mo.prototype.neg=function(t){if(this.inf)return this;var e=this.curve.point(this.x,this.y.redNeg());if(t&&this.precomputed){var r=this.precomputed,i=function(t){return t.neg()};e.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(i)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(i)}}}return e},mo.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},fo(vo,ho.BasePoint),po.prototype.jpoint=function(t,e,r){return new vo(this,t,e,r)},vo.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var t=this.z.redInvm(),e=t.redSqr(),r=this.x.redMul(e),i=this.y.redMul(e).redMul(t);return this.curve.point(r,i)},vo.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},vo.prototype.add=function(t){if(this.isInfinity())return t;if(t.isInfinity())return this;var e=t.z.redSqr(),r=this.z.redSqr(),i=this.x.redMul(e),n=t.x.redMul(r),s=this.y.redMul(e.redMul(t.z)),o=t.y.redMul(r.redMul(this.z)),a=i.redSub(n),c=s.redSub(o);if(0===a.cmpn(0))return 0!==c.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var h=a.redSqr(),u=h.redMul(a),f=i.redMul(h),l=c.redSqr().redIAdd(u).redISub(f).redISub(f),d=c.redMul(f.redISub(l)).redISub(s.redMul(u)),p=this.z.redMul(t.z).redMul(a);return this.curve.jpoint(l,d,p)},vo.prototype.mixedAdd=function(t){if(this.isInfinity())return t.toJ();if(t.isInfinity())return this;var e=this.z.redSqr(),r=this.x,i=t.x.redMul(e),n=this.y,s=t.y.redMul(e).redMul(this.z),o=r.redSub(i),a=n.redSub(s);if(0===o.cmpn(0))return 0!==a.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=o.redSqr(),h=c.redMul(o),u=r.redMul(c),f=a.redSqr().redIAdd(h).redISub(u).redISub(u),l=a.redMul(u.redISub(f)).redISub(n.redMul(h)),d=this.z.redMul(o);return this.curve.jpoint(f,l,d)},vo.prototype.dblp=function(t){if(0===t)return this;if(this.isInfinity())return this;if(!t)return this.dbl();var e;if(this.curve.zeroA||this.curve.threeA){var r=this;for(e=0;e<t;e++)r=r.dbl();return r}var i=this.curve.a,n=this.curve.tinv,s=this.x,o=this.y,a=this.z,c=a.redSqr().redSqr(),h=o.redAdd(o);for(e=0;e<t;e++){var u=s.redSqr(),f=h.redSqr(),l=f.redSqr(),d=u.redAdd(u).redIAdd(u).redIAdd(i.redMul(c)),p=s.redMul(f),g=d.redSqr().redISub(p.redAdd(p)),m=p.redISub(g),v=d.redMul(m);v=v.redIAdd(v).redISub(l);var b=h.redMul(a);e+1<t&&(c=c.redMul(l)),s=g,a=b,h=v}return this.curve.jpoint(s,h.redMul(n),a)},vo.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},vo.prototype._zeroDbl=function(){var t,e,r;if(this.zOne){var i=this.x.redSqr(),n=this.y.redSqr(),s=n.redSqr(),o=this.x.redAdd(n).redSqr().redISub(i).redISub(s);o=o.redIAdd(o);var a=i.redAdd(i).redIAdd(i),c=a.redSqr().redISub(o).redISub(o),h=s.redIAdd(s);h=(h=h.redIAdd(h)).redIAdd(h),t=c,e=a.redMul(o.redISub(c)).redISub(h),r=this.y.redAdd(this.y)}else{var u=this.x.redSqr(),f=this.y.redSqr(),l=f.redSqr(),d=this.x.redAdd(f).redSqr().redISub(u).redISub(l);d=d.redIAdd(d);var p=u.redAdd(u).redIAdd(u),g=p.redSqr(),m=l.redIAdd(l);m=(m=m.redIAdd(m)).redIAdd(m),t=g.redISub(d).redISub(d),e=p.redMul(d.redISub(t)).redISub(m),r=(r=this.y.redMul(this.z)).redIAdd(r)}return this.curve.jpoint(t,e,r)},vo.prototype._threeDbl=function(){var t,e,r;if(this.zOne){var i=this.x.redSqr(),n=this.y.redSqr(),s=n.redSqr(),o=this.x.redAdd(n).redSqr().redISub(i).redISub(s);o=o.redIAdd(o);var a=i.redAdd(i).redIAdd(i).redIAdd(this.curve.a),c=a.redSqr().redISub(o).redISub(o);t=c;var h=s.redIAdd(s);h=(h=h.redIAdd(h)).redIAdd(h),e=a.redMul(o.redISub(c)).redISub(h),r=this.y.redAdd(this.y)}else{var u=this.z.redSqr(),f=this.y.redSqr(),l=this.x.redMul(f),d=this.x.redSub(u).redMul(this.x.redAdd(u));d=d.redAdd(d).redIAdd(d);var p=l.redIAdd(l),g=(p=p.redIAdd(p)).redAdd(p);t=d.redSqr().redISub(g),r=this.y.redAdd(this.z).redSqr().redISub(f).redISub(u);var m=f.redSqr();m=(m=(m=m.redIAdd(m)).redIAdd(m)).redIAdd(m),e=d.redMul(p.redISub(t)).redISub(m)}return this.curve.jpoint(t,e,r)},vo.prototype._dbl=function(){var t=this.curve.a,e=this.x,r=this.y,i=this.z,n=i.redSqr().redSqr(),s=e.redSqr(),o=r.redSqr(),a=s.redAdd(s).redIAdd(s).redIAdd(t.redMul(n)),c=e.redAdd(e),h=(c=c.redIAdd(c)).redMul(o),u=a.redSqr().redISub(h.redAdd(h)),f=h.redISub(u),l=o.redSqr();l=(l=(l=l.redIAdd(l)).redIAdd(l)).redIAdd(l);var d=a.redMul(f).redISub(l),p=r.redAdd(r).redMul(i);return this.curve.jpoint(u,d,p)},vo.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var t=this.x.redSqr(),e=this.y.redSqr(),r=this.z.redSqr(),i=e.redSqr(),n=t.redAdd(t).redIAdd(t),s=n.redSqr(),o=this.x.redAdd(e).redSqr().redISub(t).redISub(i),a=(o=(o=(o=o.redIAdd(o)).redAdd(o).redIAdd(o)).redISub(s)).redSqr(),c=i.redIAdd(i);c=(c=(c=c.redIAdd(c)).redIAdd(c)).redIAdd(c);var h=n.redIAdd(o).redSqr().redISub(s).redISub(a).redISub(c),u=e.redMul(h);u=(u=u.redIAdd(u)).redIAdd(u);var f=this.x.redMul(a).redISub(u);f=(f=f.redIAdd(f)).redIAdd(f);var l=this.y.redMul(h.redMul(c.redISub(h)).redISub(o.redMul(a)));l=(l=(l=l.redIAdd(l)).redIAdd(l)).redIAdd(l);var d=this.z.redAdd(o).redSqr().redISub(r).redISub(a);return this.curve.jpoint(f,l,d)},vo.prototype.mul=function(t,e){return t=new ri(t,e),this.curve._wnafMul(this,t)},vo.prototype.eq=function(t){if("affine"===t.type)return this.eq(t.toJ());if(this===t)return!0;var e=this.z.redSqr(),r=t.z.redSqr();if(0!==this.x.redMul(r).redISub(t.x.redMul(e)).cmpn(0))return!1;var i=e.redMul(this.z),n=r.redMul(t.z);return 0===this.y.redMul(n).redISub(t.y.redMul(i)).cmpn(0)},vo.prototype.eqXToP=function(t){var e=this.z.redSqr(),r=t.toRed(this.curve.red).redMul(e);if(0===this.x.cmp(r))return!0;for(var i=t.clone(),n=this.curve.redN.redMul(e);;){if(i.iadd(this.curve.n),i.cmp(this.curve.p)>=0)return!1;if(r.redIAdd(n),0===this.x.cmp(r))return!0}},vo.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},vo.prototype.isInfinity=function(){return 0===this.z.cmpn(0)};var bo=to((function(t,e){var r=e;r.base=ho,r.short=go,r.mont=null,r.edwards=null})),yo=to((function(t,e){var r,i=e,n=no.assert;function s(t){"short"===t.type?this.curve=new bo.short(t):"edwards"===t.type?this.curve=new bo.edwards(t):this.curve=new bo.mont(t),this.g=this.curve.g,this.n=this.curve.n,this.hash=t.hash,n(this.g.validate(),"Invalid curve"),n(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function o(t,e){Object.defineProperty(i,t,{configurable:!0,enumerable:!0,get:function(){var r=new s(e);return Object.defineProperty(i,t,{configurable:!0,enumerable:!0,value:r}),r}})}i.PresetCurve=s,o("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:tn.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),o("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:tn.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),o("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:tn.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),o("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:tn.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"]}),o("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:tn.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"]}),o("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:tn.sha256,gRed:!1,g:["9"]}),o("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:tn.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{r=null.crash()}catch(a){r=void 0}o("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:tn.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",r]})}));function wo(t){if(!(this instanceof wo))return new wo(t);this.hash=t.hash,this.predResist=!!t.predResist,this.outLen=this.hash.outSize,this.minEntropy=t.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var e=io.toArray(t.entropy,t.entropyEnc||"hex"),r=io.toArray(t.nonce,t.nonceEnc||"hex"),i=io.toArray(t.pers,t.persEnc||"hex");eo(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,r,i)}var _o=wo;wo.prototype._init=function(t,e,r){var i=t.concat(e).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var n=0;n<this.V.length;n++)this.K[n]=0,this.V[n]=1;this._update(i),this._reseed=1,this.reseedInterval=281474976710656},wo.prototype._hmac=function(){return new tn.hmac(this.hash,this.K)},wo.prototype._update=function(t){var e=this._hmac().update(this.V).update([0]);t&&(e=e.update(t)),this.K=e.digest(),this.V=this._hmac().update(this.V).digest(),t&&(this.K=this._hmac().update(this.V).update([1]).update(t).digest(),this.V=this._hmac().update(this.V).digest())},wo.prototype.reseed=function(t,e,r,i){"string"!=typeof e&&(i=r,r=e,e=null),t=io.toArray(t,e),r=io.toArray(r,i),eo(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(t.concat(r||[])),this._reseed=1},wo.prototype.generate=function(t,e,r,i){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof e&&(i=r,r=e,e=null),r&&(r=io.toArray(r,i||"hex"),this._update(r));for(var n=[];n.length<t;)this.V=this._hmac().update(this.V).digest(),n=n.concat(this.V);var s=n.slice(0,t);return this._update(r),this._reseed++,io.encode(s,e)};var Ao=no.assert;function Eo(t,e){this.ec=t,this.priv=null,this.pub=null,e.priv&&this._importPrivate(e.priv,e.privEnc),e.pub&&this._importPublic(e.pub,e.pubEnc)}var So=Eo;Eo.fromPublic=function(t,e,r){return e instanceof Eo?e:new Eo(t,{pub:e,pubEnc:r})},Eo.fromPrivate=function(t,e,r){return e instanceof Eo?e:new Eo(t,{priv:e,privEnc:r})},Eo.prototype.validate=function(){var t=this.getPublic();return t.isInfinity()?{result:!1,reason:"Invalid public key"}:t.validate()?t.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"}},Eo.prototype.getPublic=function(t,e){return"string"==typeof t&&(e=t,t=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),e?this.pub.encode(e,t):this.pub},Eo.prototype.getPrivate=function(t){return"hex"===t?this.priv.toString(16,2):this.priv},Eo.prototype._importPrivate=function(t,e){this.priv=new ri(t,e||16),this.priv=this.priv.umod(this.ec.curve.n)},Eo.prototype._importPublic=function(t,e){if(t.x||t.y)return"mont"===this.ec.curve.type?Ao(t.x,"Need x coordinate"):("short"===this.ec.curve.type||"edwards"===this.ec.curve.type)&&Ao(t.x&&t.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(t.x,t.y));this.pub=this.ec.curve.decodePoint(t,e)},Eo.prototype.derive=function(t){return t.validate()||Ao(t.validate(),"public point not validated"),t.mul(this.priv).getX()},Eo.prototype.sign=function(t,e,r){return this.ec.sign(t,this,e,r)},Eo.prototype.verify=function(t,e){return this.ec.verify(t,e,this)},Eo.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"};var Mo=no.assert;function Io(t,e){if(t instanceof Io)return t;this._importDER(t,e)||(Mo(t.r&&t.s,"Signature without r or s"),this.r=new ri(t.r,16),this.s=new ri(t.s,16),void 0===t.recoveryParam?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}var xo=Io;function Po(){this.place=0}function Oo(t,e){var r=t[e.place++];if(!(128&r))return r;var i=15&r;if(0===i||i>4)return!1;for(var n=0,s=0,o=e.place;s<i;s++,o++)n<<=8,n|=t[o],n>>>=0;return!(n<=127)&&(e.place=o,n)}function No(t){for(var e=0,r=t.length-1;!t[e]&&!(128&t[e+1])&&e<r;)e++;return 0===e?t:t.slice(e)}function Ro(t,e){if(e<128)t.push(e);else{var r=1+(Math.log(e)/Math.LN2>>>3);for(t.push(128|r);--r;)t.push(e>>>(r<<3)&255);t.push(e)}}Io.prototype._importDER=function(t,e){t=no.toArray(t,e);var r=new Po;if(48!==t[r.place++])return!1;var i=Oo(t,r);if(!1===i||i+r.place!==t.length||2!==t[r.place++])return!1;var n=Oo(t,r);if(!1===n)return!1;var s=t.slice(r.place,n+r.place);if(r.place+=n,2!==t[r.place++])return!1;var o=Oo(t,r);if(!1===o||t.length!==o+r.place)return!1;var a=t.slice(r.place,o+r.place);if(0===s[0]){if(!(128&s[1]))return!1;s=s.slice(1)}if(0===a[0]){if(!(128&a[1]))return!1;a=a.slice(1)}return this.r=new ri(s),this.s=new ri(a),this.recoveryParam=null,!0},Io.prototype.toDER=function(t){var e=this.r.toArray(),r=this.s.toArray();for(128&e[0]&&(e=[0].concat(e)),128&r[0]&&(r=[0].concat(r)),e=No(e),r=No(r);!r[0]&&!(128&r[1]);)r=r.slice(1);var i=[2];Ro(i,e.length),(i=i.concat(e)).push(2),Ro(i,r.length);var n=i.concat(r),s=[48];return Ro(s,n.length),s=s.concat(n),no.encode(s,t)};var Co=function(){throw new Error("unsupported")},To=no.assert;function ko(t){if(!(this instanceof ko))return new ko(t);"string"==typeof t&&(To(Object.prototype.hasOwnProperty.call(yo,t),"Unknown curve "+t),t=yo[t]),t instanceof yo.PresetCurve&&(t={curve:t}),this.curve=t.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=t.curve.g,this.g.precompute(t.curve.n.bitLength()+1),this.hash=t.hash||t.curve.hash}var Lo=ko;ko.prototype.keyPair=function(t){return new So(this,t)},ko.prototype.keyFromPrivate=function(t,e){return So.fromPrivate(this,t,e)},ko.prototype.keyFromPublic=function(t,e){return So.fromPublic(this,t,e)},ko.prototype.genKeyPair=function(t){t||(t={});for(var e=new _o({hash:this.hash,pers:t.pers,persEnc:t.persEnc||"utf8",entropy:t.entropy||Co(this.hash.hmacStrength),entropyEnc:t.entropy&&t.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),i=this.n.sub(new ri(2));;){var n=new ri(e.generate(r));if(!(n.cmp(i)>0))return n.iaddn(1),this.keyFromPrivate(n)}},ko.prototype._truncateToN=function(t,e){var r=8*t.byteLength()-this.n.bitLength();return r>0&&(t=t.ushrn(r)),!e&&t.cmp(this.n)>=0?t.sub(this.n):t},ko.prototype.sign=function(t,e,r,i){"object"==typeof r&&(i=r,r=null),i||(i={}),e=this.keyFromPrivate(e,r),t=this._truncateToN(new ri(t,16));for(var n=this.n.byteLength(),s=e.getPrivate().toArray("be",n),o=t.toArray("be",n),a=new _o({hash:this.hash,entropy:s,nonce:o,pers:i.pers,persEnc:i.persEnc||"utf8"}),c=this.n.sub(new ri(1)),h=0;;h++){var u=i.k?i.k(h):new ri(a.generate(this.n.byteLength()));if(!((u=this._truncateToN(u,!0)).cmpn(1)<=0||u.cmp(c)>=0)){var f=this.g.mul(u);if(!f.isInfinity()){var l=f.getX(),d=l.umod(this.n);if(0!==d.cmpn(0)){var p=u.invm(this.n).mul(d.mul(e.getPrivate()).iadd(t));if(0!==(p=p.umod(this.n)).cmpn(0)){var g=(f.getY().isOdd()?1:0)|(0!==l.cmp(d)?2:0);return i.canonical&&p.cmp(this.nh)>0&&(p=this.n.sub(p),g^=1),new xo({r:d,s:p,recoveryParam:g})}}}}}},ko.prototype.verify=function(t,e,r,i){t=this._truncateToN(new ri(t,16)),r=this.keyFromPublic(r,i);var n=(e=new xo(e,"hex")).r,s=e.s;if(n.cmpn(1)<0||n.cmp(this.n)>=0||s.cmpn(1)<0||s.cmp(this.n)>=0)return!1;var o,a=s.invm(this.n),c=a.mul(t).umod(this.n),h=a.mul(n).umod(this.n);return this.curve._maxwellTrick?!(o=this.g.jmulAdd(c,r.getPublic(),h)).isInfinity()&&o.eqXToP(n):!(o=this.g.mulAdd(c,r.getPublic(),h)).isInfinity()&&0===o.getX().umod(this.n).cmp(n)},ko.prototype.recoverPubKey=function(t,e,r,i){To((3&r)===r,"The recovery param is more than two bits"),e=new xo(e,i);var n=this.n,s=new ri(t),o=e.r,a=e.s,c=1&r,h=r>>1;if(o.cmp(this.curve.p.umod(this.curve.n))>=0&&h)throw new Error("Unable to find sencond key candinate");o=h?this.curve.pointFromX(o.add(this.curve.n),c):this.curve.pointFromX(o,c);var u=e.r.invm(n),f=n.sub(s).mul(u).umod(n),l=a.mul(u).umod(n);return this.g.mulAdd(f,o,l)},ko.prototype.getKeyRecoveryParam=function(t,e,r,i){if(null!==(e=new xo(e,i)).recoveryParam)return e.recoveryParam;for(var n=0;n<4;n++){var s;try{s=this.recoverPubKey(t,e,n)}catch(o){continue}if(s.eq(r))return n}throw new Error("Unable to find valid recovery factor")};var qo=to((function(t,e){var r=e;r.version="6.5.4",r.utils=no,r.rand=function(){throw new Error("unsupported")},r.curve=bo,r.curves=yo,r.ec=Lo,r.eddsa=null})),Do=qo.ec;const Uo=new jr("signing-key/5.7.0");let Bo=null;function jo(){return Bo||(Bo=new Do("secp256k1")),Bo}class zo{constructor(t){Xi(this,"curve","secp256k1"),Xi(this,"privateKey",Yr(t)),32!==function(t){if("string"!=typeof t)t=Yr(t);else if(!Gr(t)||t.length%2)return null;return(t.length-2)/2}(this.privateKey)&&Uo.throwArgumentError("invalid private key","privateKey","[[ REDACTED ]]");const e=jo().keyFromPrivate(Wr(this.privateKey));Xi(this,"publicKey","0x"+e.getPublic(!1,"hex")),Xi(this,"compressedPublicKey","0x"+e.getPublic(!0,"hex")),Xi(this,"_isSigningKey",!0)}_addPoint(t){const e=jo().keyFromPublic(Wr(this.publicKey)),r=jo().keyFromPublic(Wr(t));return"0x"+e.pub.add(r.pub).encodeCompressed("hex")}
2signDigest(t){const e=jo().keyFromPrivate(Wr(this.privateKey)),r=Wr(t);32!==r.length&&Uo.throwArgumentError("bad digest length","digest",t);const i=e.sign(r,{canonical:!0});return Zr({recoveryParam:i.recoveryParam,r:Xr("0x"+i.r.toString(16),32),s:Xr("0x"+i.s.toString(16),32)})}computeSharedSecret(t){const e=jo().keyFromPrivate(Wr(this.privateKey)),r=jo().keyFromPublic(Wr(Fo(t)));return Xr("0x"+e.derive(r.getPublic()).toString(16),32)}static isSigningKey(t){return!(!t||!t._isSigningKey)}}function Fo(t,e){const r=Wr(t);if(32===r.length){const t=new zo(r);return e?"0x"+jo().keyFromPrivate(r).getPublic(!0,"hex"):t.publicKey}return 33===r.length?e?Yr(r):"0x"+jo().keyFromPublic(r).getPublic(!1,"hex"):65===r.length?e?"0x"+jo().keyFromPublic(r).getPublic(!0,"hex"):Yr(r):Uo.throwArgumentError("invalid public or private key","key","[REDACTED]")}var Ho;function Ko(t,e){return function(t){return Qi(Qr($r(Qr(Fo(t),1)),12))}(function(t,e){const r=Zr(e),i={r:Wr(r.r),s:Wr(r.s)};return"0x"+jo().recoverPubKey(Wr(t),i,r.recoveryParam).encode("hex",!1)}(Wr(t),e))}new jr("transactions/5.7.0"),function(t){t[t.legacy=0]="legacy",t[t.eip2930=1]="eip2930",t[t.eip1559=2]="eip1559"}(Ho||(Ho={}));const Vo="https://rpc.walletconnect.org/v1";async function Wo(t,e,r,i,n,s){switch(r.t){case"eip191":return function(t,e,r){return Ko(Vi(e),r).toLowerCase()===t.toLowerCase()}(t,e,r.s);case"eip1271":return await async function(t,e,r,i,n,s){try{const o="0x1626ba7e",a="0000000000000000000000000000000000000000000000000000000000000040",c="0000000000000000000000000000000000000000000000000000000000000041",h=r.substring(2),u=o+Vi(e).substring(2)+a+c+h,f=await fetch("".concat(s||Vo,"/?chainId=").concat(i,"&projectId=").concat(n),{method:"POST",body:JSON.stringify({id:Go(),jsonrpc:"2.0",method:"eth_call",params:[{to:t,data:u},"latest"]})}),{result:l}=await f.json();return!!l&&l.slice(0,o.length).toLowerCase()===o.toLowerCase()}catch(o){return console.error("isValidEip1271Signature: ",o),!1}}(t,e,r.s,i,n,s);default:throw new Error("verifySignature failed: Attempted to verify CacaoSignature with unknown type: ".concat(r.t))}}function Go(){return Date.now()+Math.floor(1e3*Math.random())}var Jo=Object.defineProperty,Yo=Object.defineProperties,Qo=Object.getOwnPropertyDescriptors,Xo=Object.getOwnPropertySymbols,Zo=Object.prototype.hasOwnProperty,$o=Object.prototype.propertyIsEnumerable,ta=(t,e,r)=>e in t?Jo(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,ea=(t,e)=>{for(var r in e||(e={}))Zo.call(e,r)&&ta(t,r,e[r]);if(Xo)for(var r of Xo(e))$o.call(e,r)&&ta(t,r,e[r]);return t},ra=(t,e)=>Yo(t,Qo(e));const ia=t=>null===t||void 0===t?void 0:t.split(":"),na=t=>{const e=t&&ia(t);if(e)return t.includes("did:pkh:")?e[3]:e[1]},sa=t=>{const e=t&&ia(t);if(e)return e[2]+":"+e[3]},oa=t=>{const e=t&&ia(t);if(e)return e.pop()};async function aa(t){const{cacao:e,projectId:r}=t,{s:i,p:n}=e,s=ca(n,n.iss),o=oa(n.iss);return await Wo(o,s,i,na(n.iss),r)}const ca=(t,e)=>{const r="".concat(t.domain," wants you to sign in with your Ethereum account:"),i=oa(e);if(!t.aud&&!t.uri)throw new Error("Either `aud` or `uri` is required to construct the message");let n=t.statement||void 0;const s="URI: ".concat(t.aud||t.uri),o="Version: ".concat(t.version),a="Chain ID: ".concat(na(e)),c="Nonce: ".concat(t.nonce),h="Issued At: ".concat(t.iat),u=t.exp?"Expiration Time: ".concat(t.exp):void 0,f=t.nbf?"Not Before: ".concat(t.nbf):void 0,l=t.requestId?"Request ID: ".concat(t.requestId):void 0,d=t.resources?"Resources:".concat(t.resources.map((t=>"\n- ".concat(t))).join("")):void 0,p=ya(t.resources);if(p){n=ma(n,la(p))}return[r,i,"",n,"",s,o,a,c,h,u,f,l,d].filter((t=>null!=t)).join("\n")};function ha(t){if(!t)throw new Error("No recap provided, value is undefined");if(!t.att)throw new Error("No `att` property found");const e=Object.keys(t.att);if(null==e||!e.length)throw new Error("No resources found in `att` property");e.forEach((e=>{const r=t.att[e];if(Array.isArray(r))throw new Error("Resource must be an object: ".concat(e));if("object"!=typeof r)throw new Error("Resource must be an object: ".concat(e));if(!Object.keys(r).length)throw new Error("Resource object is empty: ".concat(e));Object.keys(r).forEach((t=>{const e=r[t];if(!Array.isArray(e))throw new Error("Ability limits ".concat(t," must be an array of objects, found: ").concat(e));if(!e.length)throw new Error("Value of ".concat(t," is empty array, must be an array with objects"));e.forEach((e=>{if("object"!=typeof e)throw new Error("Ability limits (".concat(t,") must be an array of objects, found: ").concat(e))}))}))}))}function ua(t,e){var r;let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};e=null===(r=e)||void 0===r?void 0:r.sort(((t,e)=>t.localeCompare(e)));const n=e.map((e=>
2({["".concat(t,"/").concat(e)]:[i]})));return Object.assign({},...n)}function fa(t){return ha(t),"urn:recap:".concat(function(t){return Buffer.from(JSON.stringify(t)).toString("base64")}(t).replace(/=/g,""))}function la(t){const e=function(t){return JSON.parse(Buffer.from(t,"base64").toString("utf-8"))}(t.replace("urn:recap:",""));return ha(e),e}function da(t,e,r){const i=function(t,e,r){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return null!==r&&void 0!==r&&r.sort(((t,e)=>t.localeCompare(e))),{att:{[t]:ua(e,r,i)}}}(t,e,r);return fa(i)}function pa(t){return t&&t.includes("urn:recap:")}function ga(t,e){const r=function(t,e){ha(t),ha(e);const r=Object.keys(t.att).concat(Object.keys(e.att)).sort(((t,e)=>t.localeCompare(e))),i={att:{}};return r.forEach((r=>{var n,s;Object.keys((null==(n=t.att)?void 0:n[r])||{}).concat(Object.keys((null==(s=e.att)?void 0:s[r])||{})).sort(((t,e)=>t.localeCompare(e))).forEach((n=>{var s,o;i.att[r]=ra(ea({},i.att[r]),{[n]:(null==(s=t.att[r])?void 0:s[n])||(null==(o=e.att[r])?void 0:o[n])})}))})),i}(la(t),la(e));return fa(r)}function ma(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",e=arguments.length>1?arguments[1]:void 0;ha(e);const r="I further authorize the stated URI to perform the following actions on my behalf: ";if(t.includes(r))return t;const i=[];let n=0;Object.keys(e.att).forEach((t=>{const r=Object.keys(e.att[t]).map((t=>({ability:t.split("/")[0],action:t.split("/")[1]})));r.sort(((t,e)=>t.action.localeCompare(e.action)));const s={};r.forEach((t=>{s[t.ability]||(s[t.ability]=[]),s[t.ability].push(t.action)}));const o=Object.keys(s).map((e=>(n++,"(".concat(n,") '").concat(e,"': '").concat(s[e].join("', '"),"' for '").concat(t,"'."))));i.push(o.join(", ").replace(".,","."))}));const s=i.join(" "),o="".concat(r).concat(s);return"".concat(t?t+" ":"").concat(o)}function va(t){var e;const r=la(t);ha(r);const i=null==(e=r.att)?void 0:e.eip155;return i?Object.keys(i).map((t=>t.split("/")[1])):[]}function ba(t){const e=la(t);ha(e);const r=[];return Object.values(e.att).forEach((t=>{Object.values(t).forEach((t=>{var e;null!=(e=null===t||void 0===t?void 0:t[0])&&e.chains&&r.push(t[0].chains)}))})),[...new Set(r.flat())]}function ya(t){if(!t)return;const e=null===t||void 0===t?void 0:t[t.length-1];return pa(e)?e:void 0}const wa="base10",_a="base16",Aa="base64pad",Ea="base64url",Sa="utf8";function Ma(){return ve((0,D.randomBytes)(32),_a)}function Ia(t){return ve((0,U.tW)(me(t,_a)),_a)}function xa(t){return ve((0,U.tW)(me(t,Sa)),_a)}function Pa(t){return me("".concat(t),wa)}function Oa(t){return Number(ve(t,wa))}function Na(t){const{encoding:e=Aa}=t;if(2===Oa(t.type))return ve(z([t.type,t.sealed]),e);if(1===Oa(t.type)){if(typeof t.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");return ve(z([t.type,t.senderPublicKey,t.iv,t.sealed]),e)}return ve(z([t.type,t.iv,t.sealed]),e)}function Ra(t){const{encoded:e,encoding:r=Aa}=t,i=me(e,r),n=i.slice(0,1);if(1===Oa(n)){const t=33,e=t+12,r=i.slice(1,t),s=i.slice(t,e);return{type:n,sealed:i.slice(e),iv:s,senderPublicKey:r}}if(2===Oa(n)){return{type:n,sealed:i.slice(1),iv:(0,D.randomBytes)(12)}}const s=i.slice(1,13);return{type:n,sealed:i.slice(13),iv:s}}function Ca(t){const e=(null===t||void 0===t?void 0:t.type)||0;if(1===e){if(typeof(null===t||void 0===t?void 0:t.senderPublicKey)>"u")throw new Error("missing sender public key");if(typeof(null===t||void 0===t?void 0:t.receiverPublicKey)>"u")throw new Error("missing receiver public key")}return{type:e,senderPublicKey:null===t||void 0===t?void 0:t.senderPublicKey,receiverPublicKey:null===t||void 0===t?void 0:t.receiverPublicKey}}function Ta(t){return 1===t.type&&"string"==typeof t.senderPublicKey&&"string"==typeof t.receiverPublicKey}function ka(t){return 2===t.type}function La(t,e){const[r,i,n]=t.split("."),s=function(t){return Buffer.from(function(t){let e=t.replace(/-/g,"+").replace(/_/g,"/");const r=e.length%4;return r>0&&(e+="=".repeat(4-r)),e}(t),"base64")}(n);if(64!==s.length)throw new Error("Invalid signature length");const o=s.slice(0,32).toString("hex"),a=s.slice(32,64).toString("hex"),c="".concat(r,".").concat(i),h=(new U.aD).update(Buffer.from(c)).digest(),u=function(t){return new be.ec("p256").keyFromPublic({x:Buffer.from(t.x,"base64").toString("hex"),y:Buffer.from(t.y,"base64").toString("hex")},"hex")}(e),f=Buffer.from(h).toString("hex");
2if(!u.verify(f,{r:o,s:a}))throw new Error("Invalid signature");return je(t).payload}function qa(t){return(null===t||void 0===t?void 0:t.relay)||{protocol:"irn"}}function Da(t){const e=He[t];if(typeof e>"u")throw new Error("Relay Protocol not supported: ".concat(t));return e}var Ua=Object.defineProperty,Ba=Object.defineProperties,ja=Object.getOwnPropertyDescriptors,za=Object.getOwnPropertySymbols,Fa=Object.prototype.hasOwnProperty,Ha=Object.prototype.propertyIsEnumerable,Ka=(t,e,r)=>e in t?Ua(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Va=(t,e)=>{for(var r in e||(e={}))Fa.call(e,r)&&Ka(t,r,e[r]);if(za)for(var r of za(e))Ha.call(e,r)&&Ka(t,r,e[r]);return t};function Wa(t){const e={},r="relay"+(arguments.length>1&&void 0!==arguments[1]?arguments[1]:"-");return Object.keys(t).forEach((i=>{if(i.startsWith(r)){const n=i.replace(r,""),s=t[i];e[n]=s}})),e}function Ga(t){if(!t.includes("wc:")){const e=xr(t);null!=e&&e.includes("wc:")&&(t=e)}const e=(t=(t=t.includes("wc://")?t.replace("wc://",""):t).includes("wc:")?t.replace("wc:",""):t).indexOf(":"),r=-1!==t.indexOf("?")?t.indexOf("?"):void 0,i=t.substring(0,e),n=t.substring(e+1,r).split("@"),s=typeof r<"u"?t.substring(r):"",o=k.parse(s),a="string"==typeof o.methods?o.methods.split(","):void 0;return{protocol:i,topic:Ja(n[0]),version:parseInt(n[1],10),symKey:o.symKey,relay:Wa(o),methods:a,expiryTimestamp:o.expiryTimestamp?parseInt(o.expiryTimestamp,10):void 0}}function Ja(t){return t.startsWith("//")?t.substring(2):t}function Ya(t){return"".concat(t.protocol,":").concat(t.topic,"@").concat(t.version,"?")+k.stringify(Va(((t,e)=>Ba(t,ja(e)))(Va({symKey:t.symKey},function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"-";const r={};return Object.keys(t).forEach((i=>{const n="relay"+e+i;t[i]&&(r[n]=t[i])})),r}(t.relay)),{expiryTimestamp:t.expiryTimestamp}),t.methods?{methods:t.methods.join(",")}:{}))}function Qa(t,e,r){return"".concat(t,"?wc_ev=").concat(r,"&topic=").concat(e)}Object.defineProperty,Object.defineProperties,Object.getOwnPropertyDescriptors,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;function Xa(t){const e=[];return t.forEach((t=>{const[r,i]=t.split(":");e.push("".concat(r,":").concat(i))})),e}function Za(t){return t.includes(":")}function $a(t){return Za(t)?t.split(":")[0]:t}function tc(t,e){e=e.map((t=>t.replace("did:pkh:","")));const r=function(t){const e={};return null!==t&&void 0!==t&&t.forEach((t=>{const[r,i]=t.split(":");e[r]||(e[r]={accounts:[],chains:[],events:[]}),e[r].accounts.push(t),e[r].chains.push("".concat(r,":").concat(i))})),e}(e);for(const[i,n]of Object.entries(r))n.methods?n.methods=Ar(n.methods,t):n.methods=t,n.events=["chainChanged","accountsChanged"];return r}const ec={INVALID_METHOD:{message:"Invalid method.",code:1001},INVALID_EVENT:{message:"Invalid event.",code:1002},INVALID_UPDATE_REQUEST:{message:"Invalid update request.",code:1003},INVALID_EXTEND_REQUEST:{message:"Invalid extend request.",code:1004},INVALID_SESSION_SETTLE_REQUEST:{message:"Invalid session settle request.",code:1005},UNAUTHORIZED_METHOD:{message:"Unauthorized method.",code:3001},UNAUTHORIZED_EVENT:{message:"Unauthorized event.",code:3002},UNAUTHORIZED_UPDATE_REQUEST:{message:"Unauthorized update request.",code:3003},UNAUTHORIZED_EXTEND_REQUEST:{message:"Unauthorized extend request.",code:3004},USER_REJECTED:{message:"User rejected.",code:5e3},USER_REJECTED_CHAINS:{message:"User rejected chains.",code:5001},USER_REJECTED_METHODS:{message:"User rejected methods.",code:5002},USER_REJECTED_EVENTS:{message:"User rejected events.",code:5003},UNSUPPORTED_CHAINS:{message:"Unsupported chains.",code:5100},UNSUPPORTED_METHODS:{message:"Unsupported methods.",code:5101},UNSUPPORTED_EVENTS:{message:"Unsupported events.",code:5102},UNSUPPORTED_ACCOUNTS:{message:"Unsupported accounts.",code:5103},UNSUPPORTED_NAMESPACE_KEY:{message:"Unsupported namespace key.",code:5104},USER_DISCONNECTED:{message:"User disconnected.",code:6e3},SESSION_SETTLEMENT_FAILED:{message:"Session settlement failed.",code:7e3},WC_METHOD_UNSUPPORTED:{message:"Unsupported wc_ method.",code:10001}},rc={NOT_INITIALIZED:{message:"Not initialized.",code:1},NO_MATCHING_KEY:{message:"No matching key.",code:2},RESTORE_WILL_OVERRIDE:{message:"Restore will override.",code:3},RESUBSCRIBED:{message:"Resubscribed.",code:4},MISSING_OR_INVALID:{message:"Missing or invalid.",code:5},EXPIRED:{message:"Expired.",code:6},UNKNOWN_TYPE:{message:"Unknown type.",code:7},MISMATCHED_TOPIC:{message:"Mismatched topic.",code:8},NON_CONFORMING_NAMESPACES:{message:"Non conforming namespaces.",code:9}};function ic(t,e){const{message:r,code:i}=rc[t];return{message:e?"".concat(r," ").concat(e):r,code:i}}function nc(t,e){const{message:r,code:i}=ec[t];return{message:e?"".concat(r," ").concat(e):r,code:i}}function sc(t,e){return!!Array.isArray(t)&&(!(typeof e<"u"&&t.length)||t.every(e))}function oc(t){return Object.getPrototypeOf(t)===Object.prototype&&Object.keys(t).length}function ac(t){return typeof t>"u"}function cc(t,e){return!(!e||!ac(t))||"string"==typeof t&&!!t.trim().length}function hc(t,e){return!(!e||!ac(t))||"number"==typeof t&&!isNaN(t)}function uc(t){return!(!cc(t,!1)||!t.includes(":"))&&2===t.split(":").length}function fc(t){let e=!0;return sc(t)?t.length&&(e=t.every((t=>cc(t,!1)))):e=!1,e}function lc(t,e,r){let i=null;return Object.entries(t).forEach((t=>{let[n,s]=t;if(i)return;const o=function(t,e,r){let i=null;return sc(e)&&e.length?e.forEach((t=>{i||uc(t)||(i=nc("UNSUPPORTED_CHAINS","".concat(r,", chain ").concat(t,' should be a string and conform to "namespace:chainId" format')))})):uc(t)||(i=nc("UNSUPPORTED_CHAINS","".concat(r,', chains must be defined as "namespace:chainId" e.g. "eip155:1": {...} in the namespace key OR as an array of CAIP-2 chainIds e.g. eip155: { chains: ["eip155:1", "eip155:
25"] }'))),i}(n,Ge(n,s),"".concat(e," ").concat(r));o&&(i=o)})),i}function dc(t,e){let r=null;return sc(t)?t.forEach((t=>{r||function(t){if(cc(t,!1)&&t.includes(":")){const e=t.split(":");if(3===e.length){const t=e[0]+":"+e[1];return!!e[2]&&uc(t)}}return!1}(t)||(r=nc("UNSUPPORTED_ACCOUNTS","".concat(e,", account ").concat(t,' should be a string and conform to "namespace:chainId:address" format')))})):r=nc("UNSUPPORTED_ACCOUNTS","".concat(e,', accounts should be an array of strings conforming to "namespace:chainId:address" format')),r}function pc(t,e){let r=null;return Object.values(t).forEach((t=>{if(r)return;const i=function(t,e){let r=null;return fc(null===t||void 0===t?void 0:t.methods)?fc(null===t||void 0===t?void 0:t.events)||(r=nc("UNSUPPORTED_EVENTS","".concat(e,", events should be an array of strings or empty array for no events"))):r=nc("UNSUPPORTED_METHODS","".concat(e,", methods should be an array of strings or empty array for no methods")),r}(t,"".concat(e,", namespace"));i&&(r=i)})),r}function gc(t,e){let r=null;if(t&&oc(t)){const i=pc(t,e);i&&(r=i);const n=function(t,e){let r=null;return Object.values(t).forEach((t=>{if(r)return;const i=dc(null===t||void 0===t?void 0:t.accounts,"".concat(e," namespace"));i&&(r=i)})),r}(t,e);n&&(r=n)}else r=ic("MISSING_OR_INVALID","".concat(e,", namespaces should be an object with data"));return r}function mc(t){return cc(t.protocol,!0)}function vc(t){return typeof t<"u"&&null!==typeof t}function bc(t,e){return!(!uc(e)||!function(t){const e=[];return Object.values(t).forEach((t=>{e.push(...Xa(t.accounts))})),e}(t).includes(e))}function yc(t,e,r){return!!cc(r,!1)&&function(t,e){const r=[];return Object.values(t).forEach((t=>{Xa(t.accounts).includes(e)&&r.push(...t.methods)})),r}(t,e).includes(r)}function wc(t,e,r){return!!cc(r,!1)&&function(t,e){const r=[];return Object.values(t).forEach((t=>{Xa(t.accounts).includes(e)&&r.push(...t.events)})),r}(t,e).includes(r)}function _c(t,e,r){let i=null;const n=function(t){const e={};return Object.keys(t).forEach((r=>{var i;r.includes(":")?e[r]=t[r]:null==(i=t[r].chains)||i.forEach((i=>{e[i]={methods:t[r].methods,events:t[r].events}}))})),e}(t),s=function(t){const e={};return Object.keys(t).forEach((r=>{if(r.includes(":"))e[r]=t[r];else{const i=Xa(t[r].accounts);null===i||void 0===i||i.forEach((i=>{e[i]={accounts:t[r].accounts.filter((t=>t.includes("".concat(i,":")))),methods:t[r].methods,events:t[r].events}}))}})),e}(e),o=Object.keys(n),a=Object.keys(s),c=Ac(Object.keys(t)),h=Ac(Object.keys(e)),u=c.filter((t=>!h.includes(t)));return u.length&&(i=ic("NON_CONFORMING_NAMESPACES","".concat(r," namespaces keys don't satisfy requiredNamespaces.\n      Required: ").concat(u.toString(),"\n      Received: ").concat(Object.keys(e).toString()))),lr(o,a)||(i=ic("NON_CONFORMING_NAMESPACES","".concat(r," namespaces chains don't satisfy required namespaces.\n      Required: ").concat(o.toString(),"\n      Approved: ").concat(a.toString()))),Object.keys(e).forEach((t=>{if(!t.includes(":")||i)return;const n=Xa(e[t].accounts);n.includes(t)||(i=ic("NON_CONFORMING_NAMESPACES","".concat(r," namespaces accounts don't satisfy namespace accounts for ").concat(t,"\n        Required: ").concat(t,"\n        Approved: ").concat(n.toString())))})),o.forEach((t=>{i||(lr(n[t].methods,s[t].methods)?lr(n[t].events,s[t].events)||(i=ic("NON_CONFORMING_NAMESPACES","".concat(r," namespaces events don't satisfy namespace events for ").concat(t))):i=ic("NON_CONFORMING_NAMESPACES","".concat(r," namespaces methods don't satisfy namespace methods for ").concat(t)))})),i}function Ac(t){return[...new Set(t.map((t=>t.includes(":")?t.split(":")[0]:t)))]}function Ec(){const t=cr();return new Promise((e=>{switch(t){case rr:e(function(){var t;return ar()&&(null===(t=navigator)||void 0===t?void 0:t.onLine)}());break;case tr:e(async function(){if(or()&&typeof r.g<"u"&&null!=r.g&&r.g.NetInfo){const t=await(null==r.g?void 0:r.g.NetInfo.fetch());return null===t||void 0===t?void 0:t.isConnected}return!0}());break;default:e(!0)}}))}function Sc(t){switch(cr()){case rr:!function(t){!or()&&ar()&&(window.addEventListener("online",(()=>t(!0))),window.addEventListener("offline",(()=>t(!1))))}(t);break;case tr:!function(t){var e;or()&&typeof r.g<"u"&&null!=r.g&&r.g.NetInfo&&(null===(e=r.g)||void 0===e||e.NetInfo.addEventListener((e=>t(null===e||void 0===e?void 0:e.isConnected))))}(t)}}const Mc={};class Ic{static get(t){return Mc[t]}static set(t,e){Mc[t]=e}static delete(t){delete Mc[t]}}class xc{}class Pc extends xc{constructor(t){super()}}const Oc=R.FIVE_SECONDS,Nc="heartbeat_pulse";class Rc extends Pc{constructor(t){super(t),this.events=new v.EventEmitter,this.interval=Oc,this.interval=(null===t||void 0===t?void 0:t.interval)||Oc}static async init(t){const e=new Rc(t);
2return await e.init(),e}async init(){await this.initialize()}stop(){clearInterval(this.intervalRef)}on(t,e){this.events.on(t,e)}once(t,e){this.events.once(t,e)}off(t,e){this.events.off(t,e)}removeListener(t,e){this.events.removeListener(t,e)}async initialize(){this.intervalRef=setInterval((()=>this.pulse()),(0,R.toMiliseconds)(this.interval))}pulse(){this.events.emit(Nc)}}const Cc=/"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,Tc=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,kc=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/;function Lc(t,e){if(!("__proto__"===t||"constructor"===t&&e&&"object"===typeof e&&"prototype"in e))return e;!function(t){console.warn('[destr] Dropping "'.concat(t,'" key to prevent prototype pollution.'))}(t)}function qc(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if("string"!==typeof t)return t;const r=t.trim();if('"'===t[0]&&t.endsWith('"')&&!t.includes("\\"))return r.slice(1,-1);if(r.length<=9){const t=r.toLowerCase();if("true"===t)return!0;if("false"===t)return!1;if("undefined"===t)return;if("null"===t)return null;if("nan"===t)return Number.NaN;if("infinity"===t)return Number.POSITIVE_INFINITY;if("-infinity"===t)return Number.NEGATIVE_INFINITY}if(!kc.test(t)){if(e.strict)throw new SyntaxError("[destr] Invalid JSON");return t}try{if(Cc.test(t)||Tc.test(t)){if(e.strict)throw new Error("[destr] Possible prototype pollution");return JSON.parse(t,Lc)}return JSON.parse(t)}catch(i){if(e.strict)throw i;return t}}function Dc(t){try{for(var e=arguments.length,r=new Array(e>1?e-1:0),i=1;i<e;i++)r[i-1]=arguments[i];return(n=t(...r))&&"function"===typeof n.then?n:Promise.resolve(n)}catch(s){return Promise.reject(s)}var n}function Uc(t){if(function(t){const e=typeof t;return null===t||"object"!==e&&"function"!==e}(t))return String(t);if(function(t){const e=Object.getPrototypeOf(t);return!e||e.isPrototypeOf(Object)}(t)||Array.isArray(t))return JSON.stringify(t);if("function"===typeof t.toJSON)return Uc(t.toJSON());throw new Error("[unstorage] Cannot stringify value!")}const Bc="base64:";function jc(t){return"string"===typeof t?t:Bc+function(t){if(globalThis.Buffer)return Buffer.from(t).toString("base64");return globalThis.btoa(String.fromCodePoint(...t))}(t)}function zc(t){return"string"!==typeof t?t:t.startsWith(Bc)?function(t){if(globalThis.Buffer)return Buffer.from(t,"base64");return Uint8Array.from(globalThis.atob(t),(t=>t.codePointAt(0)))}(t.slice(7)):t}function Fc(t){var e;return t&&(null===(e=t.split("?")[0])||void 0===e?void 0:e.replace(/[/\\]/g,":").replace(/:+/g,":").replace(/^:|:$/g,""))||""}function Hc(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return Fc(e.join(":"))}function Kc(t){return(t=Fc(t))?t+":":""}const Vc=()=>{const t=new Map;return{name:"memory",getInstance:()=>t,hasItem:e=>t.has(e),getItem(e){var r;return null!==(r=t.get(e))&&void 0!==r?r:null},getItemRaw(e){var r;return null!==(r=t.get(e))&&void 0!==r?r:null},setItem(e,r){t.set(e,r)},setItemRaw(e,r){t.set(e,r)},removeItem(e){t.delete(e)},getKeys:()=>[...t.keys()],clear(){t.clear()},dispose(){t.clear()}}};function Wc(){const t={mounts:{"":(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).driver||Vc()},mountpoints:[""],watching:!1,watchListeners:[],unwatch:{}},e=e=>{for(const r of t.mountpoints)if(e.startsWith(r))return{base:r,relativeKey:e.slice(r.length),driver:t.mounts[r]};return{base:"",relativeKey:e,driver:t.mounts[""]}},r=(e,r)=>t.mountpoints.filter((t=>t.startsWith(e)||r&&e.startsWith(t))).map((r=>({relativeBase:e.length>r.length?e.slice(r.length):void 0,mountpoint:r,driver:t.mounts[r]}))),i=(e,r)=>{if(t.watching){r=Fc(r);for(const i of t.watchListeners)i(e,r)}},n=async()=>{if(t.watching){for(const e in t.unwatch)await t.unwatch[e]();t.unwatch={},t.watching=!1}},s=(t,r,i)=>{const n=new Map,s=t=>{let e=n.get(t.base);return e||(e={driver:t.driver,base:t.base,items:[]},n.set(t.base,e)),e};for(const o of t){const t="string"===typeof o,i=Fc(t?o:o.key),n=t?void 0:o.value,a=t||!o.options?r:(0,F.A)((0,F.A)({},r),o.options),c=e(i);s(c).items.push({key:i,value:n,relativeKey:c.relativeKey,options:a})}return Promise.all([...n.values()].map((t=>i(t)))).then((t=>t.flat()))},o={hasItem(t){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t=Fc(t);const{relativeKey:i,driver:n}=e(t);return Dc(n.hasItem,i,r)},getItem(t){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t=Fc(t);const{relativeKey:i,driver:n}=e(t);return Dc(n.getItem,i,r).then((t=>qc(t)))},getItems(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return s(t,e,(t=>t.driver.getItems?Dc(t.driver.getItems,t.items.map((t=>({key:t.relativeKey,options:t.options}))),e).then((e=>e.map((e=>({key:Hc(t.base,e.key),value:qc(e.value)}))))):Promise.all(t.items.map((e=>Dc(t.driver.getItem,e.relativeKey,e.options).then((t=>({key:e.key,value:qc(t)}))))))))},getItemRaw(t){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t=Fc(t);const{relativeKey:i,driver:n}=e(t);return n.getItemRaw?Dc(n.getItemRaw,i,r):Dc(n.getItem,i,r).then((t=>zc(t)))},async setItem(t,r){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(void 0===r)return o.removeItem(t);t=Fc(t);const{relativeKey:s,driver:a}=e(t);
2a.setItem&&(await Dc(a.setItem,s,Uc(r),n),a.watch||i("update",t))},async setItems(t,e){await s(t,e,(async t=>{if(t.driver.setItems)return Dc(t.driver.setItems,t.items.map((t=>({key:t.relativeKey,value:Uc(t.value),options:t.options}))),e);t.driver.setItem&&await Promise.all(t.items.map((e=>Dc(t.driver.setItem,e.relativeKey,Uc(e.value),e.options))))}))},async setItemRaw(t,r){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(void 0===r)return o.removeItem(t,n);t=Fc(t);const{relativeKey:s,driver:a}=e(t);if(a.setItemRaw)await Dc(a.setItemRaw,s,r,n);else{if(!a.setItem)return;await Dc(a.setItem,s,jc(r),n)}a.watch||i("update",t)},async removeItem(t){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};"boolean"===typeof r&&(r={removeMeta:r}),t=Fc(t);const{relativeKey:n,driver:s}=e(t);s.removeItem&&(await Dc(s.removeItem,n,r),(r.removeMeta||r.removeMata)&&await Dc(s.removeItem,n+"$",r),s.watch||i("remove",t))},async getMeta(t){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};"boolean"===typeof r&&(r={nativeOnly:r}),t=Fc(t);const{relativeKey:i,driver:n}=e(t),s=Object.create(null);if(n.getMeta&&Object.assign(s,await Dc(n.getMeta,i,r)),!r.nativeOnly){const t=await Dc(n.getItem,i+"$",r).then((t=>qc(t)));t&&"object"===typeof t&&("string"===typeof t.atime&&(t.atime=new Date(t.atime)),"string"===typeof t.mtime&&(t.mtime=new Date(t.mtime)),Object.assign(s,t))}return s},setMeta(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.setItem(t+"$",e,r)},removeMeta(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.removeItem(t+"$",e)},async getKeys(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t=Kc(t);const i=r(t,!0);let n=[];const s=[];for(const r of i){const t=await Dc(r.driver.getKeys,r.relativeBase,e);for(const e of t){const t=r.mountpoint+Fc(e);n.some((e=>t.startsWith(e)))||s.push(t)}n=[r.mountpoint,...n.filter((t=>!t.startsWith(r.mountpoint)))]}return t?s.filter((e=>e.startsWith(t)&&"$"!==e[e.length-1])):s.filter((t=>"$"!==t[t.length-1]))},async clear(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t=Kc(t),await Promise.all(r(t,!1).map((async t=>{if(t.driver.clear)return Dc(t.driver.clear,t.relativeBase,e);if(t.driver.removeItem){const r=await t.driver.getKeys(t.relativeBase||"",e);return Promise.all(r.map((r=>t.driver.removeItem(r,e))))}})))},async dispose(){await Promise.all(Object.values(t.mounts).map((t=>Jc(t))))},watch:async e=>(await(async()=>{if(!t.watching){t.watching=!0;for(const e in t.mounts)t.unwatch[e]=await Gc(t.mounts[e],i,e)}})(),t.watchListeners.push(e),async()=>{t.watchListeners=t.watchListeners.filter((t=>t!==e)),0===t.watchListeners.length&&await n()}),async unwatch(){t.watchListeners=[],await n()},mount(e,r){if((e=Kc(e))&&t.mounts[e])throw new Error("already mounted at ".concat(e));return e&&(t.mountpoints.push(e),t.mountpoints.sort(((t,e)=>e.length-t.length))),t.mounts[e]=r,t.watching&&Promise.resolve(Gc(r,i,e)).then((r=>{t.unwatch[e]=r})).catch(console.error),o},async unmount(e){let r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if((e=Kc(e))&&t.mounts[e]){var i,n;if(t.watching&&e in t.unwatch)null===(i=(n=t.unwatch)[e])||void 0===i||i.call(n),delete t.unwatch[e];r&&await Jc(t.mounts[e]),t.mountpoints=t.mountpoints.filter((t=>t!==e)),delete t.mounts[e]}},getMount(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";t=Fc(t)+":";const r=e(t);return{driver:r.driver,base:r.base}},getMounts(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t=Fc(t);return r(t,e.parents).map((t=>({driver:t.driver,base:t.mountpoint})))},keys:function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return o.getKeys(t,e)},get:function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return o.getItem(t,e)},set:function(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return o.setItem(t,e,r)},has:function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return o.hasItem(t,e)},del:function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return o.removeItem(t,e)},remove:function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return o.removeItem(t,e)}};return o}function Gc(t,e,r){return t.watch?t.watch(((t,i)=>e(t,r+i))):()=>{}}
2async function Jc(t){"function"===typeof t.dispose&&await Dc(t.dispose)}function Yc(t){return new Promise(((e,r)=>{t.oncomplete=t.onsuccess=()=>e(t.result),t.onabort=t.onerror=()=>r(t.error)}))}function Qc(t,e){const r=indexedDB.open(t);r.onupgradeneeded=()=>r.result.createObjectStore(e);const i=Yc(r);return(t,r)=>i.then((i=>r(i.transaction(e,t).objectStore(e))))}let Xc;function Zc(){return Xc||(Xc=Qc("keyval-store","keyval")),Xc}function $c(t){return(arguments.length>1&&void 0!==arguments[1]?arguments[1]:Zc())("readonly",(e=>Yc(e.get(t))))}function th(t,e){return t.openCursor().onsuccess=function(){this.result&&(e(this.result),this.result.continue())},Yc(t.transaction)}var eh=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const e=t.base&&t.base.length>0?"".concat(t.base,":"):"",r=t=>e+t;let i;return t.dbName&&t.storeName&&(i=Qc(t.dbName,t.storeName)),{name:"idb-keyval",options:t,hasItem:async t=>!(typeof await $c(r(t),i)>"u"),async getItem(t){var e;return null!==(e=await $c(r(t),i))&&void 0!==e?e:null},setItem:(t,e)=>function(t,e){return(arguments.length>2&&void 0!==arguments[2]?arguments[2]:Zc())("readwrite",(r=>(r.put(e,t),Yc(r.transaction))))}(r(t),e,i),removeItem:t=>function(t){return(arguments.length>1&&void 0!==arguments[1]?arguments[1]:Zc())("readwrite",(e=>(e.delete(t),Yc(e.transaction))))}(r(t),i),getKeys:()=>function(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:Zc())("readonly",(t=>{if(t.getAllKeys)return Yc(t.getAllKeys());const e=[];return th(t,(t=>e.push(t.key))).then((()=>e))}))}(i),clear:()=>function(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:Zc())("readwrite",(t=>(t.clear(),Yc(t.transaction))))}(i)}};class rh{constructor(){this.indexedDb=Wc({driver:eh({dbName:"WALLET_CONNECT_V2_INDEXED_DB",storeName:"keyvaluestorage"})})}async getKeys(){return this.indexedDb.getKeys()}async getEntries(){return(await this.indexedDb.getItems(await this.indexedDb.getKeys())).map((t=>[t.key,t.value]))}async getItem(t){const e=await this.indexedDb.getItem(t);if(null!==e)return e}async setItem(t,e){await this.indexedDb.setItem(t,qe(e))}async removeItem(t){await this.indexedDb.removeItem(t)}}var ih=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof r.g<"u"?r.g:typeof self<"u"?self:{},nh={exports:{}};function sh(t){var e;return[t[0],Le(null!=(e=t[1])?e:"")]}!function(){let t;function e(){}t=e,t.prototype.getItem=function(t){return this.hasOwnProperty(t)?String(this[t]):null},t.prototype.setItem=function(t,e){this[t]=String(e)},t.prototype.removeItem=function(t){delete this[t]},t.prototype.clear=function(){const t=this;Object.keys(t).forEach((function(e){t[e]=void 0,delete t[e]}))},t.prototype.key=function(t){return t=t||0,Object.keys(this)[t]},t.prototype.__defineGetter__("length",(function(){return Object.keys(this).length})),typeof ih<"u"&&ih.localStorage?nh.exports=ih.localStorage:typeof window<"u"&&window.localStorage?nh.exports=window.localStorage:nh.exports=new e}();class oh{constructor(){this.localStorage=nh.exports}async getKeys(){return Object.keys(this.localStorage)}async getEntries(){return Object.entries(this.localStorage).map(sh)}async getItem(t){const e=this.localStorage.getItem(t);if(null!==e)return Le(e)}async setItem(t,e){this.localStorage.setItem(t,qe(e))}async removeItem(t){this.localStorage.removeItem(t)}}const ah=async(t,e)=>{e.length&&e.forEach((async e=>{await t.removeItem(e)}))};class ch{constructor(){this.initialized=!1,this.setInitialized=t=>{this.storage=t,this.initialized=!0};const t=new oh;this.storage=t;try{(async(t,e,r)=>{const i="wc_storage_version",n=await e.getItem(i);if(n&&n>=1)return void r(e);const s=await t.getKeys();if(!s.length)return void r(e);const o=[];for(;s.length;){const r=s.shift();if(!r)continue;const i=r.toLowerCase();if(i.includes("wc@")||i.includes("walletconnect")||i.includes("wc_")||i.includes("wallet_connect")){const i=await t.getItem(r);await e.setItem(r,i),o.push(r)}}await e.setItem(i,1),r(e),ah(t,o)})(t,new rh,this.setInitialized)}catch(e){this.initialized=!0}}async getKeys(){return await this.initialize(),this.storage.getKeys()}async getEntries(){return await this.initialize(),this.storage.getEntries()}async getItem(t){return await this.initialize(),this.storage.getItem(t)}async setItem(t,e){return await this.initialize(),this.storage.setItem(t,e)}async removeItem(t){return await this.initialize(),this.storage.removeItem(t)}async initialize(){this.initialized||await new Promise((t=>{const e=setInterval((()=>{this.initialized&&(clearInterval(e),t())}),20)}))}}var hh=r(25711),uh=r.n(hh);const fh="info",lh="custom_context",dh=1024e3;class ph{constructor(t){this.nodeValue=t,this.sizeInBytes=(new TextEncoder).encode(this.nodeValue).length,this.next=null}get value(){return this.nodeValue}get size(){return this.sizeInBytes}}class gh{constructor(t){this.head=null,this.tail=null,this.lengthInNodes=0,this.maxSizeInBytes=t,this.sizeInBytes=0}append(t){const e=new ph(t);if(e.size>this.maxSizeInBytes)throw new Error("[LinkedList] Value too big to insert into list: ".concat(t," with size ").concat(e.size));for(;this.size+e.size>this.maxSizeInBytes;)this.shift();this.head?(this.tail&&(this.tail.next=e),this.tail=e):(this.head=e,this.tail=e),this.lengthInNodes++,this.sizeInBytes+=e.size}shift(){if(!this.head)return;const t=this.head;this.head=this.head.next,this.head||(this.tail=null),this.lengthInNodes--,this.sizeInBytes-=t.size}toArray(){const t=[];let e=this.head;for(;null!==e;)t.push(e.value),e=e.next;return t}get length(){return this.lengthInNodes}get size(){return this.sizeInBytes}toOrderedArray(){return Array.from(this)}[Symbol.iterator](){let t=this.head;return{next:()=>{if(!t)return{done:!0,value:null};const e=t.value;return t=t.next,{done:!1,value:e}}}}}class mh{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:dh;this.level=null!==t&&void 0!==t?t:"error",this.levelValue=hh.levels.values[this.level],this.MAX_LOG_SIZE_IN_BYTES=e,this.logs=new gh(this.MAX_LOG_SIZE_IN_BYTES)}forwardToConsole(t,e){e===hh.levels.values.error?console.error(t):e===hh.levels.values.warn?console.warn(t):e===hh.levels.values.debug?console.debug(t):e===hh.levels.values.trace?console.trace(t):console.log(t)}appendToLogs(t){this.logs.append(qe({timestamp:(new Date).toISOString(),log:t}));const e="string"==typeof t?JSON.parse(t).level:t.level;e>=this.levelValue&&this.forwardToConsole(t,e)}getLogs(){return this.logs}clearLogs(){this.logs=new gh(this.MAX_LOG_SIZE_IN_BYTES)}getLogArray(){return Array.from(this.logs)}logsToBlob(t){const e=this.getLogArray();return e.push(qe({extraMetadata:t})),new Blob(e,{type:"application/json"})}}class vh{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:dh;this.baseChunkLogger=new mh(t,e)}write(t){this.baseChunkLogger.appendToLogs(t)}getLogs(){return this.baseChunkLogger.getLogs()}clearLogs(){this.baseChunkLogger.clearLogs()}getLogArray(){return this.baseChunkLogger.getLogArray()}logsToBlob(t){return this.baseChunkLogger.logsToBlob(t)}downloadLogsBlobInBrowser(t){const e=URL.createObjectURL(this.logsToBlob(t)),r=document.createElement("a");r.href=e,r.download="walletconnect-logs-".concat((new Date).toISOString(),".txt"),document.body.appendChild(r),r.click(),document.body.removeChild(r),URL.revokeObjectURL(e)}}class bh{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:dh;this.baseChunkLogger=new mh(t,e)}write(t){this.baseChunkLogger.appendToLogs(t)}getLogs(){return this.baseChunkLogger.getLogs()}clearLogs(){this.baseChunkLogger.clearLogs()}getLogArray(){return this.baseChunkLogger.getLogArray()}logsToBlob(t){return this.baseChunkLogger.logsToBlob(t)}}var yh=Object.defineProperty,wh=Object.defineProperties,_h=Object.getOwnPropertyDescriptors,Ah=Object.getOwnPropertySymbols,Eh=Object.prototype.hasOwnProperty,Sh=Object.prototype.propertyIsEnumerable,Mh=(t,e,r)=>e in t?yh(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Ih=(t,e)=>{for(var r in e||(e={}))Eh.call(e,r)&&Mh(t,r,e[r]);if(Ah)for(var r of Ah(e))Sh.call(e,r)&&Mh(t,r,e[r]);return t},xh=(t,e)=>wh(t,_h(e));function Ph(t){return xh(Ih({},t),{level:(null===t||void 0===t?void 0:t.level)||fh})}function Oh(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:lh,r="";return r=typeof t.bindings>"u"?function(t){return t[arguments.length>1&&void 0!==arguments[1]?arguments[1]:lh]||""}(t,e):t.bindings().context||"",r}function Nh(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:lh;const i=function(t,e){const r=Oh(t,arguments.length>2&&void 0!==arguments[2]?arguments[2]:lh);return r.trim()?"".concat(r,"/").concat(e):e}(t,e,r);return function(t,e){return t[arguments.length>2&&void 0!==arguments[2]?arguments[2]:lh]=e,t}(t.child({context:i}),i,r)}function Rh(t){return typeof t.loggerOverride<"u"&&"string"!=typeof t.loggerOverride?{logger:t.loggerOverride,chunkLoggerController:null}:typeof window<"u"?function(t){var e,r;const i=new vh(null==(e=t.opts)?void 0:e.level,t.maxSizeInBytes);return{logger:uh()(xh(Ih({},t.opts),{level:"trace",browser:xh(Ih({},null==(r=t.opts)?void 0:r.browser),{write:t=>i.write(t)})})),chunkLoggerController:i}}(t):function(t){var e;const r=new bh(null==(e=t.opts)?void 0:e.level,t.maxSizeInBytes);return{logger:uh()(xh(Ih({},t.opts),{level:"trace"}),r),chunkLoggerController:r}}(t)}class Ch extends xc{constructor(t){super(),this.opts=t,this.protocol="wc",this.version=2}}class Th extends xc{constructor(t,e){super(),this.core=t,this.logger=e,this.records=new Map}}class kh{constructor(t,e){this.logger=t,this.core=e}}class Lh extends xc{constructor(t,e){super(),this.relayer=t,this.logger=e}}class qh extends xc{constructor(t){super()}}class Dh{constructor(t,e,r,i){this.core=t,this.logger=e,this.name=r}}class Uh extends xc{constructor(t,e){super(),this.relayer=t,this.logger=e}}class Bh extends xc{constructor(t,e){super(),this.core=t,this.logger=e}}class jh{constructor(t,e,r){this.core=t,this.logger=e,this.store=r}}class zh{constructor(t,e){this.projectId=t,this.logger=e}}class Fh{constructor(t,e,r){this.core=t,this.logger=e,this.telemetryEnabled=r}}b();class Hh{constructor(t){this.opts=t,this.protocol="wc",this.version=2}}v.EventEmitter;class Kh{constructor(t){this.client=t}}const Vh="PARSE_ERROR",Wh="INVALID_REQUEST",Gh="METHOD_NOT_FOUND",Jh="INVALID_PARAMS",Yh="INTERNAL_ERROR",Qh="SERVER_ERROR",Xh=[-32700,-32600,-32601,-32602,-32603],Zh={[Vh]:{code:-32700,message:"Parse error"},[Wh]:{code:-32600,message:"Invalid Request"},[Gh]:{code:-32601,message:"Method not found"},[Jh]:{code:-32602,message:"Invalid params"},[Yh]:{code:-32603,message:"Internal error"},[Qh]:{code:-32e3,message:"Server error"}},$h=Qh;function tu(t){return Xh.includes(t)}function eu(t){return Object.keys(Zh).includes(t)?Zh[t]:Zh[$h]}function ru(t){const e=Object.values(Zh).find((e=>e.code===t));return e||Zh[$h]}function iu(t,e,r){return t.message.includes("getaddrinfo ENOTFOUND")||t.message.includes("connect ECONNREFUSED")?new Error("Unavailable ".concat(r," RPC url at ").concat(e)):t}var nu=r(8129);function su(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:3;
2return Date.now()*Math.pow(10,t)+Math.floor(Math.random()*Math.pow(10,t))}function ou(){return BigInt(su(arguments.length>0&&void 0!==arguments[0]?arguments[0]:6))}function au(t,e,r){return{id:r||su(),jsonrpc:"2.0",method:t,params:e}}function cu(t,e){return{id:t,jsonrpc:"2.0",result:e}}function hu(t,e,r){return{id:t,jsonrpc:"2.0",error:uu(e,r)}}function uu(t,e){return"undefined"===typeof t?eu(Yh):("string"===typeof t&&(t=Object.assign(Object.assign({},eu(Qh)),{message:t})),"undefined"!==typeof e&&(t.data=e),tu(t.code)&&(t=ru(t.code)),t)}class fu{}class lu extends fu{constructor(){super()}}class du extends lu{constructor(t){super()}}function pu(t,e){const r=function(t){const e=t.match(new RegExp(/^\w+:/,"gi"));if(e&&e.length)return e[0]}(t);return"undefined"!==typeof r&&new RegExp(e).test(r)}function gu(t){return pu(t,"^https?:")}function mu(t){return pu(t,"^wss?:")}function vu(t){return"object"===typeof t&&"id"in t&&"jsonrpc"in t&&"2.0"===t.jsonrpc}function bu(t){return vu(t)&&"method"in t}function yu(t){return vu(t)&&(wu(t)||_u(t))}function wu(t){return"result"in t}function _u(t){return"error"in t}class Au extends du{constructor(t){super(t),this.events=new v.EventEmitter,this.hasRegisteredEventListeners=!1,this.connection=this.setConnection(t),this.connection.connected&&this.registerEventListeners()}async connect(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.connection;await this.open(t)}async disconnect(){await this.close()}on(t,e){this.events.on(t,e)}once(t,e){this.events.once(t,e)}off(t,e){this.events.off(t,e)}removeListener(t,e){this.events.removeListener(t,e)}async request(t,e){return this.requestStrict(au(t.method,t.params||[],t.id||ou().toString()),e)}async requestStrict(t,e){return new Promise((async(r,i)=>{if(!this.connection.connected)try{await this.open()}catch(n){i(n)}this.events.on("".concat(t.id),(t=>{_u(t)?i(t.error):r(t.result)}));try{await this.connection.send(t,e)}catch(n){i(n)}}))}setConnection(){return arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.connection}onPayload(t){this.events.emit("payload",t),yu(t)?this.events.emit("".concat(t.id),t):this.events.emit("message",{type:t.method,data:t.params})}onClose(t){t&&3e3===t.code&&this.events.emit("error",new Error("WebSocket connection closed abnormally with code: ".concat(t.code," ").concat(t.reason?"(".concat(t.reason,")"):""))),this.events.emit("disconnect")}async open(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.connection;this.connection===t&&this.connection.connected||(this.connection.connected&&this.close(),"string"==typeof t&&(await this.connection.open(t),t=this.connection),this.connection=this.setConnection(t),await this.connection.open(),this.registerEventListeners(),this.events.emit("connect"))}async close(){await this.connection.close()}registerEventListeners(){this.hasRegisteredEventListeners||(this.connection.on("payload",(t=>this.onPayload(t))),this.connection.on("close",(t=>this.onClose(t))),this.connection.on("error",(t=>this.events.emit("error",t))),this.connection.on("register_error",(t=>this.onClose())),this.hasRegisteredEventListeners=!0)}}const Eu=t=>t.split("?")[0],Su=typeof WebSocket<"u"?WebSocket:typeof r.g<"u"&&typeof r.g.WebSocket<"u"?r.g.WebSocket:typeof window<"u"&&typeof window.WebSocket<"u"?window.WebSocket:typeof self<"u"&&typeof self.WebSocket<"u"?self.WebSocket:r(32909);class Mu{constructor(t){if(this.url=t,this.events=new v.EventEmitter,this.registering=!1,!mu(t))throw new Error("Provided URL is not compatible with WebSocket connection: ".concat(t));this.url=t}get connected(){return typeof this.socket<"u"}get connecting(){return this.registering}on(t,e){this.events.on(t,e)}once(t,e){this.events.once(t,e)}off(t,e){this.events.off(t,e)}removeListener(t,e){this.events.removeListener(t,e)}async open(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.url;await this.register(t)}async close(){return new Promise(((t,e)=>{typeof this.socket>"u"?e(new Error("Connection already closed")):(this.socket.onclose=e=>{this.onClose(e),t()},this.socket.close())}))}async send(t){typeof this.socket>"u"&&(this.socket=await this.register());try{this.socket.send(qe(t))}catch(e){this.onError(t.id,e)}}register(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.url;if(!mu(t))throw new Error("Provided URL is not compatible with WebSocket connection: ".concat(t));if(this.registering){const t=this.events.getMaxListeners();return(this.events.listenerCount("register_error")>=t||this.events.listenerCount("open")>=t)&&this.events.setMaxListeners(t+1),new Promise(((t,e)=>{this.events.once("register_error",(t=>{this.resetMaxListeners(),e(t)})),this.events.once("open",(()=>{if(this.resetMaxListeners(),typeof this.socket>"u")return e(new Error("WebSocket connection is missing or invalid"));t(this.socket)}))}))}return this.url=t,this.registering=!0,new Promise(((e,i)=>{const n=new URLSearchParams(t).get("origin"),s=(0,nu.isReactNative)()?{headers:{origin:n}}:{rejectUnauthorized:(a=t,!new RegExp("wss?://localhost(:d{2,5})?").test(a))},o=new Su(t,[],s);var a;typeof WebSocket<"u"||typeof r.g<"u"&&typeof r.g.WebSocket<"u"||typeof window<"u"&&typeof window.WebSocket<"u"||typeof self<"u"&&typeof self.WebSocket<"u"?o.onerror=t=>{const e=t;i(this.emitError(e.error))}:o.on("error",(t=>{i(this.emitError(t))})),o.onopen=()=>{this.onOpen(o),e(o)}}))}onOpen(t){t.onmessage=t=>this.onPayload(t),t.onclose=t=>this.onClose(t),this.socket=t,this.registering=!1,this.events.emit("open")}onClose(t){this.socket=void 0,this.registering=!1,this.events.emit("close",t)}onPayload(t){if(typeof t.data>"u")return;const e="string"==typeof t.data?Le(t.data):t.data;this.events.emit("payload",e)}onError(t,e){const r=this.parseError(e),i=hu(t,r.message||r.toString());this.events.emit("payload",i)}parseError(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.url;return iu(t,Eu(e),"WS")}
2resetMaxListeners(){this.events.getMaxListeners()>10&&this.events.setMaxListeners(10)}emitError(t){const e=this.parseError(new Error((null===t||void 0===t?void 0:t.message)||"WebSocket connection failed for host: ".concat(Eu(this.url))));return this.events.emit("register_error",e),e}}var Iu=r(20067),xu=r.n(Iu);const Pu="core",Ou="".concat("wc","@2:").concat(Pu,":"),Nu="error",Ru={database:":memory:"},Cu="client_ed25519_seed",Tu=R.ONE_DAY,ku=R.SIX_HOURS,Lu="wss://relay.walletconnect.org",qu="relayer_message",Du="relayer_message_ack",Uu="relayer_connect",Bu="relayer_disconnect",ju="relayer_error",zu="relayer_connection_stalled",Fu="relayer_publish",Hu="payload",Ku="connect",Vu="disconnect",Wu="error",Gu="2.17.0",Ju={link_mode:"link_mode",relay:"relay"},Yu="WALLETCONNECT_LINK_MODE_APPS",Qu="subscription_created",Xu="subscription_deleted",Zu="subscription_sync",$u="subscription_resubscribed",tf=1e3*R.FIVE_SECONDS,ef={wc_pairingDelete:{req:{ttl:R.ONE_DAY,prompt:!1,tag:1e3},res:{ttl:R.ONE_DAY,prompt:!1,tag:1001}},wc_pairingPing:{req:{ttl:R.THIRTY_SECONDS,prompt:!1,tag:1002},res:{ttl:R.THIRTY_SECONDS,prompt:!1,tag:1003}},unregistered_method:{req:{ttl:R.ONE_DAY,prompt:!1,tag:0},res:{ttl:R.ONE_DAY,prompt:!1,tag:0}}},rf="pairing_create",nf="pairing_expire",sf="pairing_delete",of="pairing_ping",af="history_created",cf="history_updated",hf="history_deleted",uf="history_sync",ff="expirer_created",lf="expirer_deleted",df="expirer_expired",pf="expirer_sync",gf="https://verify.walletconnect.org",mf=gf,vf="".concat(mf,"/v3"),bf=["https://verify.walletconnect.com",gf],yf="pairing_started",wf="pairing_uri_validation_success",_f="pairing_uri_not_expired",Af="store_new_pairing",Ef="subscribing_pairing_topic",Sf="subscribe_pairing_topic_success",Mf="existing_pairing",If="pairing_not_expired",xf="emit_inactive_pairing",Pf="emit_session_proposal",Of="no_internet_connection",Nf="malformed_pairing_uri",Rf="active_pairing_already_exists",Cf="subscribe_pairing_topic_failure",Tf="pairing_expired",kf="proposal_listener_not_found",Lf="session_approve_started",qf="session_namespaces_validation_success",Df="subscribing_session_topic",Uf="subscribe_session_topic_success",Bf="publishing_session_approve",jf="session_approve_publish_success",zf="store_session",Ff="publishing_session_settle",Hf="session_settle_publish_success",Kf="no_internet_connection",Vf="proposal_expired",Wf="subscribe_session_topic_failure",Gf="session_approve_publish_failure",Jf="session_settle_publish_failure",Yf="session_approve_namespace_validation_failure",Qf="proposal_not_found",Xf="authenticated_session_approve_started",Zf="create_authenticated_session_topic",$f="cacaos_verified",tl="store_authenticated_session",el="subscribing_authenticated_session_topic",rl="subscribe_authenticated_session_topic_success",il="publishing_authenticated_session_approve",nl="no_internet_connection",sl="invalid_cacao",ol="subscribe_authenticated_session_topic_failure",al="authenticated_session_approve_publish_failure",cl="authenticated_session_pending_request_not_found";var hl=function(t,e){if(t.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),i=0;i<r.length;i++)r[i]=255;for(var n=0;n<t.length;n++){var s=t.charAt(n),o=s.charCodeAt(0);if(255!==r[o])throw new TypeError(s+" is ambiguous");r[o]=n}var a=t.length,c=t.charAt(0),h=Math.log(a)/Math.log(256),u=Math.log(256)/Math.log(a);function f(t){if("string"!=typeof t)throw new TypeError("Expected String");if(0===t.length)return new Uint8Array;var e=0;if(" "!==t[e]){for(var i=0,n=0;t[e]===c;)i++,e++;for(var s=(t.length-e)*h+1>>>0,o=new Uint8Array(s);t[e];){var u=r[t.charCodeAt(e)];if(255===u)return;for(var f=0,l=s-1;(0!==u||f<n)&&-1!==l;l--,f++)u+=a*o[l]>>>0,o[l]=u%256>>>0,u=u/256>>>0;if(0!==u)throw new Error("Non-zero carry");n=f,e++}if(" "!==t[e]){for(var d=s-n;d!==s&&0===o[d];)d++;for(var p=new Uint8Array(i+(s-d)),g=i;d!==s;)p[g++]=o[d++];return p}}}return{encode:function(e){if(e instanceof Uint8Array||(ArrayBuffer.isView(e)?e=new Uint8Array(e.buffer,e.byteOffset,e.byteLength):Array.isArray(e)&&(e=Uint8Array.from(e))),!(e instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(0===e.length)return"";for(var r=0,i=0,n=0,s=e.length;n!==s&&0===e[n];)n++,r++;for(var o=(s-n)*u+1>>>0,h=new Uint8Array(o);n!==s;){for(var f=e[n],l=0,d=o-1;(0!==f||l<i)&&-1!==d;d--,l++)f+=256*h[d]>>>0,h[d]=f%a>>>0,f=f/a>>>0;if(0!==f)throw new Error("Non-zero carry");i=l,n++}for(var p=o-i;p!==o&&0===h[p];)p++;for(var g=c.repeat(r);p<o;++p)g+=t.charAt(h[p]);return g},decodeUnsafe:f,decode:function(t){var r=f(t);if(r)return r;throw new Error("Non-".concat(e," character"))}}},ul=hl;const fl=t=>{if(t instanceof Uint8Array&&"Uint8Array"===t.constructor.name)return t;if(t instanceof ArrayBuffer)return new Uint8Array(t);if(ArrayBuffer.isView(t))return new Uint8Array(t.buffer,t.byteOffset,t.byteLength);throw new Error("Unknown type, must be binary type")};class ll{constructor(t,e,r){this.name=t,this.prefix=e,this.baseEncode=r}encode(t){if(t instanceof Uint8Array)return"".concat(this.prefix).concat(this.baseEncode(t));throw Error("Unknown type, must be binary type")}}class dl{constructor(t,e,r){if(this.name=t,this.prefix=e,void 0===e.codePointAt(0))throw new Error("Invalid prefix character");this.prefixCodePoint=e.codePointAt(0),this.baseDecode=r}decode(t){if("string"==typeof t){if(t.codePointAt(0)!==this.prefixCodePoint)throw Error("Unable to decode multibase string ".concat(JSON.stringify(t),", ").concat(this.name," decoder only supports input
2s prefixed with ").concat(this.prefix));return this.baseDecode(t.slice(this.prefix.length))}throw Error("Can only multibase decode strings")}or(t){return gl(this,t)}}class pl{constructor(t){this.decoders=t}or(t){return gl(this,t)}decode(t){const e=t[0],r=this.decoders[e];if(r)return r.decode(t);throw RangeError("Unable to decode multibase string ".concat(JSON.stringify(t),", only inputs prefixed with ").concat(Object.keys(this.decoders)," are supported"))}}const gl=(t,e)=>new pl((0,F.A)((0,F.A)({},t.decoders||{[t.prefix]:t}),e.decoders||{[e.prefix]:e}));class ml{constructor(t,e,r,i){this.name=t,this.prefix=e,this.baseEncode=r,this.baseDecode=i,this.encoder=new ll(t,e,r),this.decoder=new dl(t,e,i)}encode(t){return this.encoder.encode(t)}decode(t){return this.decoder.decode(t)}}const vl=t=>{let{name:e,prefix:r,encode:i,decode:n}=t;return new ml(e,r,i,n)},bl=t=>{let{prefix:e,name:r,alphabet:i}=t;const{encode:n,decode:s}=ul(i,r);return vl({prefix:e,name:r,encode:n,decode:t=>fl(s(t))})},yl=t=>{let{name:e,prefix:r,bitsPerChar:i,alphabet:n}=t;return vl({prefix:r,name:e,encode:t=>((t,e,r)=>{const i="="===e[e.length-1],n=(1<<r)-1;let s="",o=0,a=0;for(let c=0;c<t.length;++c)for(a=a<<8|t[c],o+=8;o>r;)o-=r,s+=e[n&a>>o];if(o&&(s+=e[n&a<<r-o]),i)for(;s.length*r&7;)s+="=";return s})(t,n,i),decode:t=>((t,e,r,i)=>{const n={};for(let u=0;u<e.length;++u)n[e[u]]=u;let s=t.length;for(;"="===t[s-1];)--s;const o=new Uint8Array(s*r/8|0);let a=0,c=0,h=0;for(let u=0;u<s;++u){const e=n[t[u]];if(void 0===e)throw new SyntaxError("Non-".concat(i," character"));c=c<<r|e,a+=r,a>=8&&(a-=8,o[h++]=255&c>>a)}if(a>=r||255&c<<8-a)throw new SyntaxError("Unexpected end of data");return o})(t,n,i,e)})},wl=vl({prefix:"\0",name:"identity",encode:t=>(t=>(new TextDecoder).decode(t))(t),decode:t=>(t=>(new TextEncoder).encode(t))(t)});var _l=Object.freeze({__proto__:null,identity:wl});const Al=yl({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var El=Object.freeze({__proto__:null,base2:Al});const Sl=yl({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var Ml=Object.freeze({__proto__:null,base8:Sl});const Il=bl({prefix:"9",name:"base10",alphabet:"0123456789"});var xl=Object.freeze({__proto__:null,base10:Il});const Pl=yl({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),Ol=yl({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var Nl=Object.freeze({__proto__:null,base16:Pl,base16upper:Ol});const Rl=yl({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),Cl=yl({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),Tl=yl({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),kl=yl({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),Ll=yl({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),ql=yl({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),Dl=yl({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),Ul=yl({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),Bl=yl({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var jl=Object.freeze({__proto__:null,base32:Rl,base32upper:Cl,base32pad:Tl,base32padupper:kl,base32hex:Ll,base32hexupper:ql,base32hexpad:Dl,base32hexpadupper:Ul,base32z:Bl});const zl=bl({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),Fl=bl({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var Hl=Object.freeze({__proto__:null,base36:zl,base36upper:Fl});const Kl=bl({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),Vl=bl({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var Wl=Object.freeze({__proto__:null,base58btc:Kl,base58flickr:Vl});const Gl=yl({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789
2+/",bitsPerChar:6}),Jl=yl({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),Yl=yl({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),Ql=yl({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var Xl=Object.freeze({__proto__:null,base64:Gl,base64pad:Jl,base64url:Yl,base64urlpad:Ql});const Zl=Array.from("\ud83d\ude80\ud83e\ude90\u2604\ud83d\udef0\ud83c\udf0c\ud83c\udf11\ud83c\udf12\ud83c\udf13\ud83c\udf14\ud83c\udf15\ud83c\udf16\ud83c\udf17\ud83c\udf18\ud83c\udf0d\ud83c\udf0f\ud83c\udf0e\ud83d\udc09\u2600\ud83d\udcbb\ud83d\udda5\ud83d\udcbe\ud83d\udcbf\ud83d\ude02\u2764\ud83d\ude0d\ud83e\udd23\ud83d\ude0a\ud83d\ude4f\ud83d\udc95\ud83d\ude2d\ud83d\ude18\ud83d\udc4d\ud83d\ude05\ud83d\udc4f\ud83d\ude01\ud83d\udd25\ud83e\udd70\ud83d\udc94\ud83d\udc96\ud83d\udc99\ud83d\ude22\ud83e\udd14\ud83d\ude06\ud83d\ude44\ud83d\udcaa\ud83d\ude09\u263a\ud83d\udc4c\ud83e\udd17\ud83d\udc9c\ud83d\ude14\ud83d\ude0e\ud83d\ude07\ud83c\udf39\ud83e\udd26\ud83c\udf89\ud83d\udc9e\u270c\u2728\ud83e\udd37\ud83d\ude31\ud83d\ude0c\ud83c\udf38\ud83d\ude4c\ud83d\ude0b\ud83d\udc97\ud83d\udc9a\ud83d\ude0f\ud83d\udc9b\ud83d\ude42\ud83d\udc93\ud83e\udd29\ud83d\ude04\ud83d\ude00\ud83d\udda4\ud83d\ude03\ud83d\udcaf\ud83d\ude48\ud83d\udc47\ud83c\udfb6\ud83d\ude12\ud83e\udd2d\u2763\ud83d\ude1c\ud83d\udc8b\ud83d\udc40\ud83d\ude2a\ud83d\ude11\ud83d\udca5\ud83d\ude4b\ud83d\ude1e\ud83d\ude29\ud83d\ude21\ud83e\udd2a\ud83d\udc4a\ud83e\udd73\ud83d\ude25\ud83e\udd24\ud83d\udc49\ud83d\udc83\ud83d\ude33\u270b\ud83d\ude1a\ud83d\ude1d\ud83d\ude34\ud83c\udf1f\ud83d\ude2c\ud83d\ude43\ud83c\udf40\ud83c\udf37\ud83d\ude3b\ud83d\ude13\u2b50\u2705\ud83e\udd7a\ud83c\udf08\ud83d\ude08\ud83e\udd18\ud83d\udca6\u2714\ud83d\ude23\ud83c\udfc3\ud83d\udc90\u2639\ud83c\udf8a\ud83d\udc98\ud83d\ude20\u261d\ud83d\ude15\ud83c\udf3a\ud83c\udf82\ud83c\udf3b\ud83d\ude10\ud83d\udd95\ud83d\udc9d\ud83d\ude4a\ud83d\ude39\ud83d\udde3\ud83d\udcab\ud83d\udc80\ud83d\udc51\ud83c\udfb5\ud83e\udd1e\ud83d\ude1b\ud83d\udd34\ud83d\ude24\ud83c\udf3c\ud83d\ude2b\u26bd\ud83e\udd19\u2615\ud83c\udfc6\ud83e\udd2b\ud83d\udc48\ud83d\ude2e\ud83d\ude46\ud83c\udf7b\ud83c\udf43\ud83d\udc36\ud83d\udc81\ud83d\ude32\ud83c\udf3f\ud83e\udde1\ud83c\udf81\u26a1\ud83c\udf1e\ud83c\udf88\u274c\u270a\ud83d\udc4b\ud83d\ude30\ud83e\udd28\ud83d\ude36\ud83e\udd1d\ud83d\udeb6\ud83d\udcb0\ud83c\udf53\ud83d\udca2\ud83e\udd1f\ud83d\ude41\ud83d\udea8\ud83d\udca8\ud83e\udd2c\u2708\ud83c\udf80\ud83c\udf7a\ud83e\udd13\ud83d\ude19\ud83d\udc9f\ud83c\udf31\ud83d\ude16\ud83d\udc76\ud83e\udd74\u25b6\u27a1\u2753\ud83d\udc8e\ud83d\udcb8\u2b07\ud83d\ude28\ud83c\udf1a\ud83e\udd8b\ud83d\ude37\ud83d\udd7a\u26a0\ud83d\ude45\ud83d\ude1f\ud83d\ude35\ud83d\udc4e\ud83e\udd32\ud83e\udd20\ud83e\udd27\ud83d\udccc\ud83d\udd35\ud83d\udc85\ud83e\uddd0\ud83d\udc3e\ud83c\udf52\ud83d\ude17\ud83e\udd11\ud83c\udf0a\ud83e\udd2f\ud83d\udc37\u260e\ud83d\udca7\ud83d\ude2f\ud83d\udc86\ud83d\udc46\ud83c\udfa4\ud83d\ude47\ud83c\udf51\u2744\ud83c\udf34\ud83d\udca3\ud83d\udc38\ud83d\udc8c\ud83d\udccd\ud83e\udd40\ud83e\udd22\ud83d\udc45\ud83d\udca1\ud83d\udca9\ud83d\udc50\ud83d\udcf8\ud83d\udc7b\ud83e\udd10\ud83e\udd2e\ud83c\udfbc\ud83e\udd75\ud83d\udea9\ud83c\udf4e\ud83c\udf4a\ud83d\udc7c\ud83d\udc8d\ud83d\udce3\ud83e\udd42"),$l=Zl.reduce(((t,e,r)=>(t[r]=e,t)),[]),td=Zl.reduce(((t,e,r)=>(t[e.codePointAt(0)]=r,t)),[]);const ed=vl({prefix:"\ud83d\ude80",name:"base256emoji",encode:function(t){return t.reduce(((t,e)=>t+=$l[e]),"")},decode:function(t){const e=[];for(const r of t){const t=td[r.codePointAt(0)];if(void 0===t)throw new Error("Non-base256emoji character: ".concat(r));e.push(t)}return new Uint8Array(e)}});var rd=Object.freeze({__proto__:null,base256emoji:ed}),id=function t(e,r,i){r=r||[];for(var n=i=i||0;e>=od;)r[i++]=255&e|nd,e/=128;for(;e&sd;)r[i++]=255&e|nd,e>>>=7;return r[i]=0|e,t.bytes=i-n+1,r},nd=128,sd=-128,od=Math.pow(2,31);var ad=function t(e,r){var i,n=0,s=(r=r||0,0),o=r,a=e.length;do{if(o>=a)throw t.bytes=0,new RangeError("Could not decode varint");i=e[o++],n+=s<28?(i&hd)<<s:(i&hd)*Math.pow(2,s),s+=7}while(i>=cd);return t.bytes=o-r,n},cd=128,hd=127;var ud=Math.pow(2,7),fd=Math.pow(2,14),ld=Math.pow(2,21),dd=Math.pow(2,28),pd=Math.pow(2,35),gd=Math.pow(2,42),md=Math.pow(2,49),vd=Math.pow(2,56),bd=Math.pow(2,63),yd={encode:id,decode:ad,encodingLength:function(t){return t<ud?1:t<fd?2:t<ld?3:t<dd?4:t<pd?5:t<gd?6:t<md?7:t<vd?8:t<bd?9:10}},wd=yd;const _d=function(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return wd.encode(t,e,r),e},Ad=t=>wd.encodingLength(t),Ed=(t,e)=>{const r=e.byteLength,i=Ad(t),n=i+Ad(r),s=new Uint8Array(n+r);return _d(t,s,0),_d(r,s,i),s.set(e,n),new Sd(t,r,e,s)};
2class Sd{constructor(t,e,r,i){this.code=t,this.size=e,this.digest=r,this.bytes=i}}const Md=t=>{let{name:e,code:r,encode:i}=t;return new Id(e,r,i)};class Id{constructor(t,e,r){this.name=t,this.code=e,this.encode=r}digest(t){if(t instanceof Uint8Array){const e=this.encode(t);return e instanceof Uint8Array?Ed(this.code,e):e.then((t=>Ed(this.code,t)))}throw Error("Unknown type, must be binary type")}}const xd=t=>async e=>new Uint8Array(await crypto.subtle.digest(t,e)),Pd=Md({name:"sha2-256",code:18,encode:xd("SHA-256")}),Od=Md({name:"sha2-512",code:19,encode:xd("SHA-512")});var Nd=Object.freeze({__proto__:null,sha256:Pd,sha512:Od});const Rd=fl,Cd={code:0,name:"identity",encode:Rd,digest:t=>Ed(0,Rd(t))};var Td=Object.freeze({__proto__:null,identity:Cd});new TextEncoder,new TextDecoder;const kd=(0,F.A)((0,F.A)((0,F.A)((0,F.A)((0,F.A)((0,F.A)((0,F.A)((0,F.A)((0,F.A)((0,F.A)({},_l),El),Ml),xl),Nl),jl),Hl),Wl),Xl),rd);function Ld(t,e,r,i){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:r},decoder:{decode:i}}}(0,F.A)((0,F.A)({},Nd),Td);const qd=Ld("utf8","u",(t=>"u"+new TextDecoder("utf8").decode(t)),(t=>(new TextEncoder).encode(t.substring(1)))),Dd=Ld("ascii","a",(t=>{let e="a";for(let r=0;r<t.length;r++)e+=String.fromCharCode(t[r]);return e}),(t=>{const e=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return null!=globalThis.Buffer&&null!=globalThis.Buffer.allocUnsafe?globalThis.Buffer.allocUnsafe(t):new Uint8Array(t)}((t=t.substring(1)).length);for(let r=0;r<t.length;r++)e[r]=t.charCodeAt(r);return e})),Ud=(0,F.A)({utf8:qd,"utf-8":qd,hex:kd.base16,latin1:Dd,ascii:Dd,binary:Dd},kd);class Bd{constructor(t,e){this.core=t,this.logger=e,this.keychain=new Map,this.name="keychain",this.version="0.3",this.initialized=!1,this.storagePrefix=Ou,this.init=async()=>{if(!this.initialized){const t=await this.getKeyChain();typeof t<"u"&&(this.keychain=t),this.initialized=!0}},this.has=t=>(this.isInitialized(),this.keychain.has(t)),this.set=async(t,e)=>{this.isInitialized(),this.keychain.set(t,e),await this.persist()},this.get=t=>{this.isInitialized();const e=this.keychain.get(t);if(typeof e>"u"){const{message:e}=ic("NO_MATCHING_KEY","".concat(this.name,": ").concat(t));throw new Error(e)}return e},this.del=async t=>{this.isInitialized(),this.keychain.delete(t),await this.persist()},this.core=t,this.logger=Nh(e,this.name)}get context(){return Oh(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}async setKeyChain(t){await this.core.storage.setItem(this.storageKey,dr(t))}async getKeyChain(){const t=await this.core.storage.getItem(this.storageKey);return typeof t<"u"?pr(t):void 0}async persist(){await this.setKeyChain(this.keychain)}isInitialized(){if(!this.initialized){const{message:t}=ic("NOT_INITIALIZED",this.name);throw new Error(t)}}}class jd{constructor(t,e,r){this.core=t,this.logger=e,this.name="crypto",this.randomSessionIdentifier=Ma(),this.initialized=!1,this.init=async()=>{this.initialized||(await this.keychain.init(),this.initialized=!0)},this.hasKeys=t=>(this.isInitialized(),this.keychain.has(t)),this.getClientId=async()=>{this.isInitialized();return Be(ze(await this.getClientSeed()).publicKey)},this.generateKeyPair=()=>{this.isInitialized();const t=function(){const t=B.TZ();return{privateKey:ve(t.secretKey,_a),publicKey:ve(t.publicKey,_a)}}();return this.setPrivateKey(t.publicKey,t.privateKey)},this.signJWT=async t=>{this.isInitialized();const e=ze(await this.getClientSeed()),r=this.randomSessionIdentifier,i=Tu;return await Fe(r,t,i,e)},this.generateSharedKey=(t,e,r)=>{this.isInitialized();const i=function(t,e){const r=B.Tc(me(t,_a),me(e,_a),!0);return ve(new q.i(U.aD,r).expand(32),_a)}(this.getPrivateKey(t),e);return this.setSymKey(i,r)},this.setSymKey=async(t,e)=>{this.isInitialized();const r=e||Ia(t);return await this.keychain.set(r,t),r},this.deleteKeyPair=async t=>{this.isInitialized(),await this.keychain.del(t)},this.deleteSymKey=async t=>{this.isInitialized(),await this.keychain.del(t)},this.encode=async(t,e,r)=>{this.isInitialized();const i=Ca(r),n=qe(e);
2if(ka(i))return function(t,e){const r=Pa(2),i=(0,D.randomBytes)(12);return Na({type:r,sealed:me(t,Sa),iv:i,encoding:e})}(n,null===r||void 0===r?void 0:r.encoding);if(Ta(i)){const e=i.senderPublicKey,r=i.receiverPublicKey;t=await this.generateSharedKey(e,r)}const s=this.getSymKey(t),{type:o,senderPublicKey:a}=i;return function(t){const e=Pa(typeof t.type<"u"?t.type:0);if(1===Oa(e)&&typeof t.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");const r=typeof t.senderPublicKey<"u"?me(t.senderPublicKey,_a):void 0,i=typeof t.iv<"u"?me(t.iv,_a):(0,D.randomBytes)(12);return Na({type:e,sealed:new L.g6(me(t.symKey,_a)).seal(i,me(t.message,Sa)),iv:i,senderPublicKey:r,encoding:t.encoding})}({type:o,symKey:s,message:n,senderPublicKey:a,encoding:null===r||void 0===r?void 0:r.encoding})},this.decode=async(t,e,r)=>{this.isInitialized();const i=function(t,e){const r=Ra({encoded:t,encoding:null===e||void 0===e?void 0:e.encoding});return Ca({type:Oa(r.type),senderPublicKey:typeof r.senderPublicKey<"u"?ve(r.senderPublicKey,_a):void 0,receiverPublicKey:null===e||void 0===e?void 0:e.receiverPublicKey})}(e,r);if(ka(i)){const t=function(t,e){const{sealed:r}=Ra({encoded:t,encoding:e});return ve(r,Sa)}(e,null===r||void 0===r?void 0:r.encoding);return Le(t)}if(Ta(i)){const e=i.receiverPublicKey,r=i.senderPublicKey;t=await this.generateSharedKey(e,r)}try{const i=function(t){const e=new L.g6(me(t.symKey,_a)),{sealed:r,iv:i}=Ra({encoded:t.encoded,encoding:null===t||void 0===t?void 0:t.encoding}),n=e.open(i,r);if(null===n)throw new Error("Failed to decrypt");return ve(n,Sa)}({symKey:this.getSymKey(t),encoded:e,encoding:null===r||void 0===r?void 0:r.encoding});return Le(i)}catch(n){this.logger.error("Failed to decode message from topic: '".concat(t,"', clientId: '").concat(await this.getClientId(),"'")),this.logger.error(n)}},this.getPayloadType=function(t){return Oa(Ra({encoded:t,encoding:arguments.length>1&&void 0!==arguments[1]?arguments[1]:Aa}).type)},this.getPayloadSenderPublicKey=function(t){const e=Ra({encoded:t,encoding:arguments.length>1&&void 0!==arguments[1]?arguments[1]:Aa});return e.senderPublicKey?ve(e.senderPublicKey,_a):void 0},this.core=t,this.logger=Nh(e,this.name),this.keychain=r||new Bd(this.core,this.logger)}get context(){return Oh(this.logger)}async setPrivateKey(t,e){return await this.keychain.set(t,e),t}getPrivateKey(t){return this.keychain.get(t)}async getClientSeed(){let t="";try{t=this.keychain.get(Cu)}catch(e){t=Ma(),await this.keychain.set(Cu,t)}return function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"utf8";const r=Ud[e];if(!r)throw new Error('Unsupported encoding "'.concat(e,'"'));return"utf8"!==e&&"utf-8"!==e||null==globalThis.Buffer||null==globalThis.Buffer.from?r.decoder.decode("".concat(r.prefix).concat(t)):globalThis.Buffer.from(t,"utf8")}(t,"base16")}getSymKey(t){return this.keychain.get(t)}isInitialized(){if(!this.initialized){const{message:t}=ic("NOT_INITIALIZED",this.name);throw new Error(t)}}}class zd extends kh{constructor(t,e){super(t,e),this.logger=t,this.core=e,this.messages=new Map,this.name="messages",this.version="0.3",this.initialized=!1,this.storagePrefix=Ou,this.init=async()=>{if(!this.initialized){this.logger.trace("Initialized");try{const t=await this.getRelayerMessages();typeof t<"u"&&(this.messages=t),this.logger.debug("Successfully Restored records for ".concat(this.name)),this.logger.trace({type:"method",method:"restore",size:this.messages.size})}catch(Oc){this.logger.debug("Failed to Restore records for ".concat(this.name)),this.logger.error(Oc)}finally{this.initialized=!0}}},this.set=async(t,e)=>{this.isInitialized();const r=xa(e);let i=this.messages.get(t);return typeof i>"u"&&(i={}),typeof i[r]<"u"||(i[r]=e,this.messages.set(t,i),await this.persist()),r},this.get=t=>{this.isInitialized();let e=this.messages.get(t);return typeof e>"u"&&(e={}),e},this.has=(t,e)=>{this.isInitialized();return typeof this.get(t)[xa(e)]<"u"},this.del=async t=>{this.isInitialized(),this.messages.delete(t),await this.persist()},this.logger=Nh(t,this.name),this.core=e}get context(){return Oh(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}async setRelayerMessages(t){await this.core.storage.setItem(this.storageKey,dr(t))}async getRelayerMessages(){const t=await this.core.storage.getItem(this.storageKey);return typeof t<"u"?pr(t):void 0}async persist(){await this.setRelayerMessages(this.messages)}isInitialized(){if(!this.initialized){const{message:t}=ic("NOT_INITIALIZED",this.name);throw new Error(t)}}}class Fd extends Lh{constructor(t,e){super(t,e),this.relayer=t,this.logger=e,this.events=new v.EventEmitter,this.name="publisher",this.queue=new Map,this.publishTimeout=(0,R.toMiliseconds)(R.ONE_MINUTE),this.failedPublishTimeout=(0,R.toMiliseconds)(R.ONE_SECOND),this.needsTransportRestart=!1,this.publish=async(t,e,r)=>{var i;this.logger.debug("Publishing Payload"),this.logger.trace({type:"method",method:"publish",params:{topic:t,message:e,opts:r}});const n=(null===r||void 0===r?void 0:r.ttl)||ku,s=qa(r),o=(null===r||void 0===r?void 0:r.prompt)||!1,a=(null===r||void 0===r?void 0:r.tag)||0,c=(null===r||void 0===r?void 0:r.id)||ou().toString(),h={topic:t,message:e,opts:{ttl:n,relay:s,prompt:o,tag:a,id:c,attestation:null===r||void 0===r?void 0:r.attestation}},u="Failed to publish payload, please try again. id:".concat(c," tag:").concat(a),f=Date.now();let l,d=1;try{for(;void 0===l;){if(Date.now()-f>this.publishTimeout)throw new Error(u);this.logger.trace({id:c,attempts:d},"publisher.publish - attempt ".concat(d)),l=await await mr(this.rpcPublish(t,e,n,s,o,a,c,null===r||void 0===r?void 0:r.attestation).catch((t=>this.logger.warn(t))),this.publishTimeout,u),d++,l||await new Promise((t=>setTimeout(t,this.failedPublishTimeout)))}this.relayer.events.emit(Fu,h),this.logger.debug("Successfully Published Payload"),this.logger.trace({type:"method",method:"publish",params:{id:c,topic:t,message:e,opts:r}})}catch(p){if(this.logger.debug("Failed to Publish Payload"),this.logger.error(p),null!=(i=null===r||void 0===r?void 0:r.internal)&&i.throwOnFailedPublish)throw p;this.queue.set(c,h)}},this.on=(t,e)=>{this.events.on(t,e)},this.once=(t,e)=>{this.events.once(t,e)},this.off=(t,e)=>{this.events.off(t,e)},this.removeListener=(t,e)=>{this.events.removeListener(t,e)},this.relayer=t,this.logger=Nh(e,this.name),this.registerEventListeners()}get context(){return Oh(this.logger)}rpcPublish(t,e,r,i,n,s,o,a){var c,h,u,f;const l={method:Da(i.protocol).publish,params:{topic:t,message:e,ttl:r,prompt:n,tag:s,attestation:a},id:o};return ac(null==(c=l.params)?void 0:c.prompt)&&(null==(h=l.params)||delete h.prompt),ac(null==(u=l.params)?void 0:u.tag)&&(null==(f=l.params)||delete f.tag),this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"message",direction:"outgoing",request:l}),this.relayer.request(l)}removeRequestFromQueue(t){this.queue.delete(t)}checkQueue(){this.queue.forEach((async t=>{const{topic:e,message:r,opts:i}=t;
2await this.publish(e,r,i)}))}registerEventListeners(){this.relayer.core.heartbeat.on(Nc,(()=>{if(this.needsTransportRestart)return this.needsTransportRestart=!1,void this.relayer.events.emit(zu);this.checkQueue()})),this.relayer.on(Du,(t=>{this.removeRequestFromQueue(t.id.toString())}))}}class Hd{constructor(){this.map=new Map,this.set=(t,e)=>{const r=this.get(t);this.exists(t,e)||this.map.set(t,[...r,e])},this.get=t=>this.map.get(t)||[],this.exists=(t,e)=>this.get(t).includes(e),this.delete=(t,e)=>{if(typeof e>"u")return void this.map.delete(t);if(!this.map.has(t))return;const r=this.get(t);if(!this.exists(t,e))return;const i=r.filter((t=>t!==e));i.length?this.map.set(t,i):this.map.delete(t)},this.clear=()=>{this.map.clear()}}get topics(){return Array.from(this.map.keys())}}var Kd=Object.defineProperty,Vd=Object.defineProperties,Wd=Object.getOwnPropertyDescriptors,Gd=Object.getOwnPropertySymbols,Jd=Object.prototype.hasOwnProperty,Yd=Object.prototype.propertyIsEnumerable,Qd=(t,e,r)=>e in t?Kd(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Xd=(t,e)=>{for(var r in e||(e={}))Jd.call(e,r)&&Qd(t,r,e[r]);if(Gd)for(var r of Gd(e))Yd.call(e,r)&&Qd(t,r,e[r]);return t},Zd=(t,e)=>Vd(t,Wd(e));class $d extends Uh{constructor(t,e){super(t,e),this.relayer=t,this.logger=e,this.subscriptions=new Map,this.topicMap=new Hd,this.events=new v.EventEmitter,this.name="subscription",this.version="0.3",this.pending=new Map,this.cached=[],this.initialized=!1,this.pendingSubscriptionWatchLabel="pending_sub_watch_label",this.pollingInterval=20,this.storagePrefix=Ou,this.subscribeTimeout=(0,R.toMiliseconds)(R.ONE_MINUTE),this.restartInProgress=!1,this.batchSubscribeTopicsLimit=500,this.pendingBatchMessages=[],this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),this.registerEventListeners(),this.clientId=await this.relayer.core.crypto.getClientId(),await this.restore()),this.initialized=!0},this.subscribe=async(t,e)=>{this.isInitialized(),this.logger.debug("Subscribing Topic"),this.logger.trace({type:"method",method:"subscribe",params:{topic:t,opts:e}});try{const r=qa(e),i={topic:t,relay:r,transportType:null===e||void 0===e?void 0:e.transportType};this.pending.set(t,i);const n=await this.rpcSubscribe(t,r,null===e||void 0===e?void 0:e.transportType);return"string"==typeof n&&(this.onSubscribe(n,i),this.logger.debug("Successfully Subscribed Topic"),this.logger.trace({type:"method",method:"subscribe",params:{topic:t,opts:e}})),n}catch(r){throw this.logger.debug("Failed to Subscribe Topic"),this.logger.error(r),r}},this.unsubscribe=async(t,e)=>{await this.restartToComplete(),this.isInitialized(),typeof(null===e||void 0===e?void 0:e.id)<"u"?await this.unsubscribeById(t,e.id,e):await this.unsubscribeByTopic(t,e)},this.isSubscribed=async t=>{if(this.topics.includes(t))return!0;const e="".concat(this.pendingSubscriptionWatchLabel,"_").concat(t);return await new Promise(((r,i)=>{const n=new R.Watch;n.start(e);const s=setInterval((()=>{!this.pending.has(t)&&this.topics.includes(t)&&(clearInterval(s),n.stop(e),r(!0)),n.elapsed(e)>=tf&&(clearInterval(s),n.stop(e),i(new Error("Subscription resolution timeout")))}),this.pollingInterval)})).catch((()=>!1))},this.on=(t,e)=>{this.events.on(t,e)},this.once=(t,e)=>{this.events.once(t,e)},this.off=(t,e)=>{this.events.off(t,e)},this.removeListener=(t,e)=>{this.events.removeListener(t,e)},this.start=async()=>{await this.onConnect()},this.stop=async()=>{await this.onDisconnect()},this.restart=async()=>{this.restartInProgress=!0,await this.restore(),await this.reset(),this.restartInProgress=!1},this.relayer=t,this.logger=Nh(e,this.name),this.clientId=""}get context(){return Oh(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.relayer.core.customStoragePrefix+"//"+this.name}get length(){return this.subscriptions.size}get ids(){return Array.from(this.subscriptions.keys())}get values(){return Array.from(this.subscriptions.values())}get topics(){return this.topicMap.topics}hasSubscription(t,e){let r=!1;try{r=this.getSubscription(t).topic===e}catch(i){}return r}onEnable(){this.cached=[],this.initialized=!0}onDisable(){this.cached=this.values,this.subscriptions.clear(),this.topicMap.clear()}async unsubscribeByTopic(t,e){const r=this.topicMap.get(t);await Promise.all(r.map((async r=>await this.unsubscribeById(t,r,e))))}async unsubscribeById(t,e,r){this.logger.debug("Unsubscribing Topic"),this.logger.trace({type:"method",method:"unsubscribe",params:{topic:t,i
2d:e,opts:r}});try{const i=qa(r);await this.rpcUnsubscribe(t,e,i);const n=nc("USER_DISCONNECTED","".concat(this.name,", ").concat(t));await this.onUnsubscribe(t,e,n),this.logger.debug("Successfully Unsubscribed Topic"),this.logger.trace({type:"method",method:"unsubscribe",params:{topic:t,id:e,opts:r}})}catch(Ih){throw this.logger.debug("Failed to Unsubscribe Topic"),this.logger.error(Ih),Ih}}async rpcSubscribe(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Ju.relay;r===Ju.relay&&await this.restartToComplete();const i={method:Da(e.protocol).subscribe,params:{topic:t}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:i});try{const e=xa(t+this.clientId);return r===Ju.link_mode?(setTimeout((()=>{(this.relayer.connected||this.relayer.connecting)&&this.relayer.request(i).catch((t=>this.logger.warn(t)))}),(0,R.toMiliseconds)(R.ONE_SECOND)),e):await await mr(this.relayer.request(i).catch((t=>this.logger.warn(t))),this.subscribeTimeout)?e:null}catch(n){this.logger.debug("Outgoing Relay Subscribe Payload stalled"),this.relayer.events.emit(zu)}return null}async rpcBatchSubscribe(t){if(!t.length)return;const e={method:Da(t[0].relay.protocol).batchSubscribe,params:{topics:t.map((t=>t.topic))}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:e});try{return await await mr(this.relayer.request(e).catch((t=>this.logger.warn(t))),this.subscribeTimeout)}catch(r){this.relayer.events.emit(zu)}}async rpcBatchFetchMessages(t){if(!t.length)return;const e={method:Da(t[0].relay.protocol).batchFetchMessages,params:{topics:t.map((t=>t.topic))}};let r;this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:e});try{r=await await mr(this.relayer.request(e).catch((t=>this.logger.warn(t))),this.subscribeTimeout)}catch(i){this.relayer.events.emit(zu)}return r}rpcUnsubscribe(t,e,r){const i={method:Da(r.protocol).unsubscribe,params:{topic:t,id:e}};return this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:i}),this.relayer.request(i)}onSubscribe(t,e){this.setSubscription(t,Zd(Xd({},e),{id:t})),this.pending.delete(e.topic)}onBatchSubscribe(t){t.length&&t.forEach((t=>{this.setSubscription(t.id,Xd({},t)),this.pending.delete(t.topic)}))}async onUnsubscribe(t,e,r){this.events.removeAllListeners(e),this.hasSubscription(e,t)&&this.deleteSubscription(e,r),await this.relayer.messages.del(t)}async setRelayerSubscriptions(t){await this.relayer.core.storage.setItem(this.storageKey,t)}async getRelayerSubscriptions(){return await this.relayer.core.storage.getItem(this.storageKey)}setSubscription(t,e){this.logger.debug("Setting subscription"),this.logger.trace({type:"method",method:"setSubscription",id:t,subscription:e}),this.addSubscription(t,e)}addSubscription(t,e){this.subscriptions.set(t,Xd({},e)),this.topicMap.set(e.topic,t),this.events.emit(Qu,e)}getSubscription(t){this.logger.debug("Getting subscription"),this.logger.trace({type:"method",method:"getSubscription",id:t});const e=this.subscriptions.get(t);if(!e){const{message:e}=ic("NO_MATCHING_KEY","".concat(this.name,": ").concat(t));throw new Error(e)}return e}deleteSubscription(t,e){this.logger.debug("Deleting subscription"),this.logger.trace({type:"method",method:"deleteSubscription",id:t,reason:e});const r=this.getSubscription(t);this.subscriptions.delete(t),this.topicMap.delete(r.topic,t),this.events.emit(Xu,Zd(Xd({},r),{reason:e}))}async persist(){await this.setRelayerSubscriptions(this.values),this.events.emit(Zu)}async reset(){if(this.cached.length){const t=Math.ceil(this.cached.length/this.batchSubscribeTopicsLimit);for(let e=0;e<t;e++){const t=this.cached.splice(0,this.batchSubscribeTopicsLimit);await this.batchFetchMessages(t),await this.batchSubscribe(t)}}this.events.emit($u)}async restore(){try{const t=await this.getRelayerSubscriptions();if(typeof t>"u"||!t.length)return;if(this.subscriptions.size){const{message:t}=ic("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(t),this.logger.error("".concat(this.name,": ").concat(JSON.stringify(this.values))),new Error(t)}this.cached=t,this.logger.debug("Successfully Restored subscriptions for ".concat(this.name)),this.logger.trace({type:"method",method:"restore",subscriptions:this.values})}catch(t){this.logger.debug("Failed to Restore subscriptions for ".concat(this.name)),this.logger.error(t)}}async batchSubscribe(t){if(!t.length)return;const e=await this.rpcBatchSubscribe(t);sc(e)&&this.onBatchSubscribe(e.map(((e,r)=>Zd(Xd({},t[r]),{id:e}))))}async batchFetchMessages(t){if(!t.length)return;this.logger.trace("Fetching batch messages for ".concat(t.length," subscriptions"));const e=await this.rpcBatchFetchMessages(t);e&&e.messages&&(this.pendingBatchMessages=this.pendingBatchMessages.concat(e.messages))}async onConnect(){await this.restart(),this.onEnable()}onDisconnect(){this.onDisable()}async checkPending(){if(!this.initialized||!this.relayer.connected)return;const t=[];this.pending.forEach((e=>{t.push(e)})),await this.batchSubscribe(t),this.pendingBatchMessages.length&&(await this.relayer.handleBatchMessageEvents(this.pendingBatchMessages),this.pendingBatchMessages=[])}registerEventListeners(){this.relayer.core.heartbeat.on(Nc,(async()=>{await this.checkPending()})),this.events.on(Qu,(async t=>{const e=Qu;this.logger.info("Emitting ".concat(e)),this.logger.debug({type:"event",event:e,data:t}),await this.persist()})),this.events.on(Xu,(async t=>{const e=Xu;this.logger.info("Emitting ".concat(e)),this.logger.debug({type:"event",event:e,data:t}),await this.persist()}))}isInitialized(){if(!this.initialized){const{message:t}=ic("NOT_INITIALIZED",this.name);throw new Error(t)}}async restartToComplete(){!this.relayer.connected&&!this.relayer.connecting&&await this.relayer.transportOpen(),this.restartInProgress&&await new Promise((t=>{const e=setInterval((()=>{this.restartInProgress||(clearInterval(e),t())}),this.pollingInterval)}))}}var tp=Object.defineProperty,ep=Object.getOwnPropertySymbols,rp=Object.prototype.hasOwnProperty,ip=Object.prototype.propertyIsEnumerable,np=(t,e,r)=>e in t?tp(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;class sp extends qh{constructor(t){super(t),this.protocol="wc",this.version=2,this.events=new v.EventEmitter,this.name="relayer",this.transportExplicitlyClosed=!1,this.initialized=!1,this.connectionAttemptInProgress=!1,this.connectionStatusPollingInterval=20,this.staleConnectionErrors=["s
2ocket hang up","stalled","interrupted"],this.hasExperiencedNetworkDisruption=!1,this.requestsInFlight=new Map,this.heartBeatTimeout=(0,R.toMiliseconds)(R.THIRTY_SECONDS+R.ONE_SECOND),this.request=async t=>{var e,r;this.logger.debug("Publishing Request Payload");const i=t.id||ou().toString();await this.toEstablishConnection();try{const n=this.provider.request(t);this.requestsInFlight.set(i,{promise:n,request:t}),this.logger.trace({id:i,method:t.method,topic:null==(e=t.params)?void 0:e.topic},"relayer.request - attempt to publish...");const s=await new Promise((async(t,e)=>{const r=()=>{e(new Error("relayer.request - publish interrupted, id: ".concat(i)))};this.provider.on(Vu,r);const s=await n;this.provider.off(Vu,r),t(s)}));return this.logger.trace({id:i,method:t.method,topic:null==(r=t.params)?void 0:r.topic},"relayer.request - published"),s}catch(n){throw this.logger.debug("Failed to Publish Request: ".concat(i)),n}finally{this.requestsInFlight.delete(i)}},this.resetPingTimeout=()=>{if(sr())try{clearTimeout(this.pingTimeout),this.pingTimeout=setTimeout((()=>{var t,e,r;null==(r=null==(e=null==(t=this.provider)?void 0:t.connection)?void 0:e.socket)||r.terminate()}),this.heartBeatTimeout)}catch(t){this.logger.warn(t)}},this.onPayloadHandler=t=>{this.onProviderPayload(t),this.resetPingTimeout()},this.onConnectHandler=()=>{this.logger.trace("relayer connected"),this.startPingTimeout(),this.events.emit(Uu)},this.onDisconnectHandler=()=>{this.logger.trace("relayer disconnected"),this.onProviderDisconnect()},this.onProviderErrorHandler=t=>{this.logger.error(t),this.events.emit(ju,t),this.logger.info("Fatal socket error received, closing transport"),this.transportClose()},this.registerProviderListeners=()=>{this.provider.on(Hu,this.onPayloadHandler),this.provider.on(Ku,this.onConnectHandler),this.provider.on(Vu,this.onDisconnectHandler),this.provider.on(Wu,this.onProviderErrorHandler)},this.core=t.core,this.logger=typeof t.logger<"u"&&"string"!=typeof t.logger?Nh(t.logger,this.name):uh()(Ph({level:t.logger||"error"})),this.messages=new zd(this.logger,t.core),this.subscriber=new $d(this,this.logger),this.publisher=new Fd(this,this.logger),this.relayUrl=(null===t||void 0===t?void 0:t.relayUrl)||Lu,this.projectId=t.projectId,this.bundleId=function(){var t;try{return or()&&typeof r.g<"u"&&typeof(null==r.g?void 0:r.g.Application)<"u"?null==(t=r.g.Application)?void 0:t.applicationId:void 0}catch(e){return}}(),this.provider={}}
2async init(){if(this.logger.trace("Initialized"),this.registerEventListeners(),await Promise.all([this.messages.init(),this.subscriber.init()]),this.initialized=!0,this.subscriber.cached.length>0)try{await this.transportOpen()}catch(t){this.logger.warn(t)}}get context(){return Oh(this.logger)}get connected(){var t,e,r;return 1===(null==(r=null==(e=null==(t=this.provider)?void 0:t.connection)?void 0:e.socket)?void 0:r.readyState)}get connecting(){var t,e,r;return 0===(null==(r=null==(e=null==(t=this.provider)?void 0:t.connection)?void 0:e.socket)?void 0:r.readyState)}async publish(t,e,r){this.isInitialized(),await this.publisher.publish(t,e,r),await this.recordMessageEvent({topic:t,message:e,publishedAt:Date.now(),transportType:Ju.relay})}async subscribe(t,e){var r;this.isInitialized(),"relay"===(null===e||void 0===e?void 0:e.transportType)&&await this.toEstablishConnection();let i,n=(null==(r=this.subscriber.topicMap.get(t))?void 0:r[0])||"";const s=e=>{e.topic===t&&(this.subscriber.off(Qu,s),i())};return await Promise.all([new Promise((t=>{i=t,this.subscriber.on(Qu,s)})),new Promise((async r=>{n=await this.subscriber.subscribe(t,e)||n,r()}))]),n}async unsubscribe(t,e){this.isInitialized(),await this.subscriber.unsubscribe(t,e)}on(t,e){this.events.on(t,e)}once(t,e){this.events.once(t,e)}off(t,e){this.events.off(t,e)}removeListener(t,e){this.events.removeListener(t,e)}async transportDisconnect(){if(!this.hasExperiencedNetworkDisruption&&this.connected&&this.requestsInFlight.size>0)try{await Promise.all(Array.from(this.requestsInFlight.values()).map((t=>t.promise)))}catch(t){this.logger.warn(t)}this.hasExperiencedNetworkDisruption||this.connected?await mr(this.provider.disconnect(),2e3,"provider.disconnect()").catch((()=>this.onProviderDisconnect())):this.onProviderDisconnect()}async transportClose(){this.transportExplicitlyClosed=!0,await this.transportDisconnect()}async transportOpen(t){await this.confirmOnlineStateOrThrow(),t&&t!==this.relayUrl&&(this.relayUrl=t,await this.transportDisconnect()),await this.createProvider(),this.connectionAttemptInProgress=!0,this.transportExplicitlyClosed=!1;try{await new Promise((async(t,e)=>{const r=()=>{this.provider.off(Vu,r),e(new Error("Connection interrupted while trying to subscribe"))};this.provider.on(Vu,r),await mr(this.provider.connect(),(0,R.toMiliseconds)(R.ONE_MINUTE),"Socket stalled when trying to connect to ".concat(this.relayUrl)).catch((t=>{e(t)})).finally((()=>{clearTimeout(this.reconnectTimeout),this.reconnectTimeout=void 0})),this.subscriber.start().catch((t=>{this.logger.error(t),this.onDisconnectHandler()})),this.hasExperiencedNetworkDisruption=!1,t()}))}catch(e){this.logger.error(e);const t=e;if(this.hasExperiencedNetworkDisruption=!0,!this.isConnectionStalled(t.message))throw e}finally{this.connectionAttemptInProgress=!1}}async restartTransport(t){this.connectionAttemptInProgress||(this.relayUrl=t||this.relayUrl,await this.confirmOnlineStateOrThrow(),await this.transportClose(),await this.transportOpen())}async confirmOnlineStateOrThrow(){if(!await Ec())throw new Error("No internet connection detected. Please restart your network and try again.")}async handleBatchMessageEvents(t){if(0===(null===t||void 0===t?void 0:t.length))return void this.logger.trace("Batch message events is empty. Ignoring...");const e=t.sort(((t,e)=>t.publishedAt-e.publishedAt));this.logger.trace("Batch of ".concat(e.length," message events sorted"));for(const r of e)try{await this.onMessageEvent(r)}catch(Ih){this.logger.warn(Ih)}this.logger.trace("Batch of ".concat(e.length," message events processed"))}async onLinkMessageEvent(t,e){const{topic:r}=t;if(!e.sessionExists){const t={topic:r,expiry:yr(R.FIVE_MINUTES),relay:{protocol:"irn"},active:!1};await this.core.pairing.pairings.set(r,t)}this.events.emit(qu,t),await this.recordMessageEvent(t)}startPingTimeout(){var t,e,r,i,n;if(sr())try{null!=(e=null==(t=this.provider)?void 0:t.connection)&&e.socket&&(null==(n=null==(i=null==(r=this.provider)?void 0:r.connection)?void 0:i.socket)||n.once("ping",(()=>{this.resetPingTimeout()}))),this.resetPingTimeout()}catch(s){this.logger.warn(s)}}isConnectionStalled(t){return this.staleConnectionErrors.some((e=>t.includes(e)))}async createProvider(){this.provider.connection&&this.unregisterProviderListeners();const t=await this.core.crypto.signJWT(this.relayUrl);this.provider=new Au(new Mu(fr({sdkVersion:Gu,protocol:this.protocol,version:this.version,relayUrl:this.relayUrl,projectId:this.projectId,auth:t,useOnCloseEvent:!0,bundleId:this.bundleId}))),this.registerProviderListeners()}async recordMessageEvent(t){const{topic:e,message:r}=t;await this.messages.set(e,r)}async shouldIgnoreMessageEvent(t){const{topic:e,message:r}=t;if(!r||0===r.length)return this.logger.debug("Ignoring invalid/empty message: ".concat(r)),!0;if(!await this.subscriber.isSubscribed(e))return this.logger.debug("Ignoring message for non-subscribed topic ".concat(e)),!0;const i=this.messages.has(e,r);return i&&this.logger.debug("Ignoring duplicate message: ".concat(r)),i}async onProviderPayload(t){if(this.logger.debug("Incoming Relay Payload"),this.logger.trace({type:"payload",direction:"incoming",payload:t}),bu(t)){if(!t.method.endsWith("_subscription"))return;const e=t.params,{topic:r,message:i,publishedAt:n,attestation:s}=e.data,o={topic:r,message:i,publishedAt:n,transportType:Ju.relay,attestation:s};this.logger.debug("Emitting Relayer Payload"),this.logger.trace(((t,e)=>{for(var r in e||(e={}))rp.call(e,r)&&np(t,r,e[r]);if(ep)for(var r of ep(e))ip.call(e,r)&&np(t,r,e[r]);return t})({type:"event",event:e.id},o)),this.events.emit(e.id,o),await this.acknowledgePayload(t),await this.onMessageEvent(o)}else yu(t)&&this.events.emit(Du,t)}async onMessageEvent(t){await this.shouldIgnoreMessageEvent(t)||(this.events.emit(qu,t),await this.recordMessageEvent(t))}async acknowledgePayload(t){const e=cu(t.id,!0);await this.provider.connection.send(e)}unregisterProviderListeners(){this.provider.off(Hu,this.onPayloadHandler),this.provider.off(Ku,this.onConnectHandler),this.provider.off(Vu,this.onDisconnectHandler),this.provider.off(Wu,this.onProviderErrorHandler),clearTimeout(this.pingTimeout)}async registerEventListeners(){let t=await Ec();Sc((async e=>{t!==e&&(t=e,e?await this.restartTransport().catch((t=>this.logger.error(t))):(this.hasExperiencedNetworkDisruption=!0,await this.transportDisconnect(),this.transportExplicitlyClosed=!1))}))}async onProviderDisconnect(){await this.subscriber.stop(),this.requestsInFlight.clear(),clearTimeout(this.pingTimeout),this.events.emit(Bu),this.connectionAttemptInProgress=!1,!this.transportExplicitlyClosed&&(this.reconnectTimeout||(this.reconnectTimeout=setTimeout((async()=>{await this.transportOpen().catch((t=>this.logger.error(t)))}),(0,R.toMiliseconds)(.1))))}isInitialized(){if(!this.initialized){const{message:t}=ic("NOT_INITIALIZED",this.name);throw new Error(t)}}async toEstablishConnection(){await this.confirmOnlineStateOrThrow(),!this.connected&&(this.connectionAttemptInProgress&&await new Promise((t=>{const e=setInterval((()=>{this.connected&&(clearInterval(e),t())}),this.connectionStatusPollingInterval)})),await this.transportOpen())}}var op=Object.defineProperty,ap=Object.getOwnPropertySymbols,cp=Object.prototype.hasOwnProperty,hp=Object.prototype.propertyIsEnumerable,up=(t,e,r)=>e in t?op(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,fp=(t,e)=>{for(var r in e||(e={}))cp.call(e,r)&&up(t,r,e[r]);if(ap)for(var r of ap(e))hp.call(e,r)&&up(t,r,e[r]);return t};class lp extends Dh{constructor(t,e,r){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Ou,n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:void 0;super(t,e,r,i),this.core=t,this.logger=e,this.name=r,this.map=new Map,this.version="0.3",this.cached=[],this.initialized=!1,this.storagePrefix=Ou,this.recentlyDeleted=[],this.recentlyDeletedLimit=200,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(
2),this.cached.forEach((t=>{this.getKey&&null!==t&&!ac(t)?this.map.set(this.getKey(t),t):function(t){var e;return null==(e=null===t||void 0===t?void 0:t.proposer)?void 0:e.publicKey}(t)?this.map.set(t.id,t):function(t){return null===t||void 0===t?void 0:t.topic}(t)&&this.map.set(t.topic,t)})),this.cached=[],this.initialized=!0)},this.set=async(t,e)=>{this.isInitialized(),this.map.has(t)?await this.update(t,e):(this.logger.debug("Setting value"),this.logger.trace({type:"method",method:"set",key:t,value:e}),this.map.set(t,e),await this.persist())},this.get=t=>(this.isInitialized(),this.logger.debug("Getting value"),this.logger.trace({type:"method",method:"get",key:t}),this.getData(t)),this.getAll=t=>(this.isInitialized(),t?this.values.filter((e=>Object.keys(t).every((r=>xu()(e[r],t[r]))))):this.values),this.update=async(t,e)=>{this.isInitialized(),this.logger.debug("Updating value"),this.logger.trace({type:"method",method:"update",key:t,update:e});const r=fp(fp({},this.getData(t)),e);this.map.set(t,r),await this.persist()},this.delete=async(t,e)=>{this.isInitialized(),this.map.has(t)&&(this.logger.debug("Deleting value"),this.logger.trace({type:"method",method:"delete",key:t,reason:e}),this.map.delete(t),this.addToRecentlyDeleted(t),await this.persist())},this.logger=Nh(e,this.name),this.storagePrefix=i,this.getKey=n}get context(){return Oh(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get length(){return this.map.size}get keys(){return Array.from(this.map.keys())}get values(){return Array.from(this.map.values())}addToRecentlyDeleted(t){this.recentlyDeleted.push(t),this.recentlyDeleted.length>=this.recentlyDeletedLimit&&this.recentlyDeleted.splice(0,this.recentlyDeletedLimit/2)}async setDataStore(t){await this.core.storage.setItem(this.storageKey,t)}async getDataStore(){return await this.core.storage.getItem(this.storageKey)}getData(t){const e=this.map.get(t);if(!e){if(this.recentlyDeleted.includes(t)){const{message:e}=ic("MISSING_OR_INVALID","Record was recently deleted - ".concat(this.name,": ").concat(t));throw this.logger.error(e),new Error(e)}const{message:e}=ic("NO_MATCHING_KEY","".concat(this.name,": ").concat(t));throw this.logger.error(e),new Error(e)}return e}async persist(){await this.setDataStore(this.values)}async restore(){try{const t=await this.getDataStore();if(typeof t>"u"||!t.length)return;if(this.map.size){const{message:t}=ic("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(t),new Error(t)}this.cached=t,this.logger.debug("Successfully Restored value for ".concat(this.name)),this.logger.trace({type:"method",method:"restore",value:this.values})}catch(t){this.logger.debug("Failed to Restore value for ".concat(this.name)),this.logger.error(t)}}isInitialized(){if(!this.initialized){const{message:t}=ic("NOT_INITIALIZED",this.name);throw new Error(t)}}}class dp{constructor(t,e){this.core=t,this.logger=e,this.name="pairing",this.version="0.3",this.events=new(b()),this.initialized=!1,this.storagePrefix=Ou,this.ignoredPayloadTypes=[1],this.registeredMethods=[],this.init=async()=>{this.initialized||(await this.pairings.init(),await this.cleanup(),this.registerRelayerEvents(),this.registerExpirerEvents(),this.initialized=!0,this.logger.trace("Initialized"))},this.register=t=>{let{methods:e}=t;this.isInitialized(),this.registeredMethods=[...new Set([...this.registeredMethods,...e])]},this.create=async t=>{this.isInitialized();const e=Ma(),r=await this.core.crypto.setSymKey(e),i=yr(R.FIVE_MINUTES),n={protocol:"irn"},s={topic:r,expiry:i,relay:n,active:!1,methods:null===t||void 0===t?void 0:t.methods},o=Ya({protocol:this.core.protocol,version:this.core.version,topic:r,symKey:e,relay:n,expiryTimestamp:i,methods:null===t||void 0===t?void 0:t.methods});return this.events.emit(rf,s),this.core.expirer.set(r,i),await this.pairings.set(r,s),await this.core.relayer.subscribe(r,{transportType:null===t||void 0===t?void 0:t.transportType}),{topic:r,uri:o}},this.pair=async t=>{this.isInitialized();const e=this.core.eventClient.createEvent({properties:{topic:null===t||void 0===t?void 0:t.uri,trace:[yf]}});this.isValidPair(t,e);const{topic:r,symKey:i,relay:n,expiryTimestamp:s,methods:o}=Ga(t.uri);let a;if(e.props.properties.topic=r,e.addTrace(wf),e.addTrace(_f),this.pairings.keys.includes(r)){if(a=this.pairings.get(r),e.addTrace(Mf),a.active)throw e.setError(Rf),new Error("Pairing already exists: ".concat(r,". Please try again with a new connection URI."));e.addTrace(If)}const c=s||yr(R.FIVE_MINUTES),h={topic:r,relay:n,expiry:c,active:!1,methods:o};this.core.expirer.set(r,c),await this.pairings.set(r,h),e.addTrace(Af),t.activatePairing&&await this.activate({topic:r}),this.events.emit(rf,h),e.addTrace(xf),this.core.crypto.keychain.has(r)||await this.core.crypto.setSymKey(i,r),e.addTrace(Ef);try{await this.core.relayer.confirmOnlineStateOrThrow()}catch(u){e.setError(Of)}try{await this.core.relayer.subscribe(r,{relay:n})}catch(f){throw e.setError(Cf),f}return e.addTrace(Sf),h},this.activate=async t=>{let{topic:e}=t;this.isInitialized();const r=yr(R.THIRTY_DAYS);this.core.expirer.set(e,r),await this.pairings.update(e,{active:!0,expiry:r})},this.ping=async t=>{this.isInitialized(),await this.isValidPing(t);const{topic:e}=t;if(this.pairings.keys.includes(e)){const t=await this.sendRequest(e,"wc_pairingPing",{}),{done:r,resolve:i,reject:n}=gr();this.events.once(_r("pairing_ping",t),(t=>{let{error:e}=t;e?n(e):i()})),await r()}},this.updateExpiry=async t=>{let{topic:e,expiry:r}=t;this.isInitialized(),await this.pairings.update(e,{expiry:r})},this.updateMetadata=async t=>{let{topic:e,metadata:r}=t;this.isInitialized(),await this.pairings.update(e,{peerMetadata:r})},this.getPairings=()=>(this.isInitialized(),this.pairings.values),this.disconnect=async t=>{this.isInitialized(),await this.isValidDisconnect(t);const{topic:e}=t;this.pairings.keys.includes(e)&&(await this.sendRequest(e,"wc_pairingDelete",nc("USER_DISCONNECTED")),await this.deletePairing(e))},this.formatUriFromPairing=t=>{this.isInitialized();const{topic:e,relay:r,expiry:i,methods:n}=t,s=this.core.crypto.keychain.get(e);return Ya({protocol:this.core.protocol,version:this.core.version,topic:e,symKey:s,relay:r,expiryTimestamp:i,methods:n})},this.sendRequest=async(t,e,r)=>{const i=au(e,r),n=await this.core.crypto.encode(t,i),s=ef[e].req;return this.core.history.set(t,i),this.core.relayer.publish(t,n,s),i.id},this.sendResult=async(t,e,r)=>{const i=cu(t,r),n=await this.core.crypto.encode(e,i),s=await this.core.history.get(e,t),o=ef[s.request.method].res;await this.core.relayer.publish(e,n,o),await this.core.history.resolve(i)},this.sendError=async(t,e,r)=>{const i=hu(t,r),n=await this.core.crypto.encode(e,i),s=await this.core.history.get(e,t),o=ef[s.request.method]?ef[s.request.method].res:ef.unregistered_method.res;await this.core.relayer.publish(e,n,o),await this.core.history.resolve(i)},this.deletePairing=async(t,e)=>{await this.core.relayer.unsubscribe(t),await Promise.all([this.pairings.delete(t,nc("USER_DISCONNECTED")),this.core.crypto.deleteSymKey(t),e?Promise.resolve():this.core.expirer.del(t)])},this.cleanup=async()=>{const t=this.pairings.getAll().filter((t=>wr(t.expiry)));await Promise.all(t.map((t=>this.deletePairing(t.topic))))},this.onRelayEventRequest=t=>{const{topic:e,payload:r}=t;switch(r.method){case"wc_pairingPing":return this.onPairingPingRequest(e,r);case"wc_pairingDelete":return this.onPairingDeleteRequest(e,r);default:return this.onUnknownRpcMethodRequest(e,r)}},this.onRelayEventResponse=async t=>{const{topic:e,payload:r}=t,i=(await this.core.history.get(e,r.id)).request.method;return"wc_pairingPing"===i?this.onPairingPingResponse(e,r):this.onUnknownRpcMethodResponse(i)},this.onPairingPingRequest=async(t,e)=>{const{id:r}=e;try{this.isValidPing({topic:t}),await this.sendResult(r,t,!0),this.events.emit(of,{id:r,topic:t})}catch(i){await this.sendError(r,t,i),this.logger.error(i)}},this.onPairingPingResponse=(t,e)=>{const{id:r}=e;setTimeout((()=>{wu(e)?this.events.emit(_r("pairing_ping",r),{}):_u(e)&&this.events.emit(_r("pairing_ping",r),{error:e.error})}),500)},this.onPairingDeleteRequest=async(t,e)=>{const{id:r}=e;try{this.isValidDisconnect({topic:t}),await this.deletePairing(t),this.events.emit(sf,{id:r,topic:t})}catch(i){await this.sendError(r,t,i),this.logger.error(i)}},this.onUnknownRpcMethodRequest=async(t,e)=>{const{id:r,method:i}=e;try{if(this.registeredMethods.includes(i))return;const e=nc("WC_METHOD_UNSUPPORTED",i);await this.sendError(r,t,e),this.logger.error(e)}catch(n){await this.sendError(r,t,n),this.logger.error(n)}},this.onUnknownRpcMethodResponse=t=>{this.registeredMethods.includes(t)||this.logger.error(nc("WC_METHOD_UNSUPPORTED",t))},this.isValidPair=(t,e)=>{var r;if(!vc(t)){const{message:r}=ic("MISSING_OR_INVALID","pair() params: ".concat(t));throw e.setError(Nf),new Error(r)}if(!function(t){function e(t){try{return typeof new URL(t)<"u"}catch(e){return!1}}try{if(cc(t,!1))return!!e(t)||e(xr(t))}catch(r){}return!1}(t.uri)){const{message:r}=ic("MISSING_OR_INVALID","pair() uri: ".concat(t.uri));throw e.setError(Nf),new Error(r)}const i=Ga(null===t||void 0===t?void 0:t.uri);if(null==(r=null===i||void 0===i?void 0:i.relay)||!r.protocol){const{message:t}=ic("MISSING_OR_INVALID","pair() uri#relay-protocol");throw e.setError(Nf),new Error(t)}if(null==i||!i.symKey){const{message:t}=ic("MISSING_OR_INVALID","pair() uri#symKey");throw e.setError(Nf),new Error(t)}if(null!=i&&i.expiryTimestamp&&(0,R.toMiliseconds)(null===i||void 0===i?void 0:i.expiryTimestamp)<Date.now()){e.setError(Tf);const{message:t}=ic("EXPIRED","pair() URI has expired. Please try again with a new connection URI.");throw new Error(t)}},this.isValidPing=async t=>{if(!vc(t)){const{message:e}=ic("MISSING_OR_INVALID","ping() params: ".concat(t));throw new Error(e)}const{topic:e}=t;await this.isValidPairingTopic(e)},this.isValidDisconnect=async t=>{if(!vc(t)){const{message:e}=ic("MISSING_OR_INVALID","disconnect() params: ".concat(t));throw new Error(e)}const{topic:e}=t;await this.isValidPairingTopic(e)},this.isValidPairingTopic=async t=>{if(!cc(t,!1)){const{message:e}=ic("MISSING_OR_INVALID","pairing topic should be a string: ".concat(t));throw new Error(e)}if(!this.pairings.keys.includes(t)){const{message:e}=ic("NO_MATCHING_KEY","pairing topic doesn't exist: ".concat(t));throw new Error(e)}if(wr(this.pairings.get(t).expiry)){await this.deletePairing(t);const{message:e}=ic("EXPIRED","pairing topic: ".concat(t));throw new Error(e)}},this.core=t,this.logger=Nh(e,this.name),this.pairings=new lp(this.core,this.logger,this.name,this.storagePrefix)}get context(){return Oh(this.logger)}isInitialized(){if(!this.initialized){const{message:t}=ic("NOT_INITIALIZED",this.name);throw new Error(t)}}registerRelayerEvents(){this.core.relayer.on(qu,(async t=>{const{topic:e,message:r,transportType:i}=t;if(!this.pairings.keys.includes(e)||i===Ju.link_mode||this.ignoredPayloadTypes.includes(this.core.crypto.getPayloadType(r)))return;const n=await this.core.crypto.decode(e,r);try{bu(n)?(this.core.history.set(e,n),this.onRelayEventRequest({topic:e,payload:n})):yu(n)&&(await this.core.history.resolve(n),await this.onRelayEventResponse({topic:e,payload:n}),this.core.history.delete(e,n.id))}catch(s){this.logger.error(s)}}))}registerExpirerEvents(){this.core.expirer.on(df,(async t=>{const{topic:e}=br(t.target);e&&this.pairings.keys.includes(e)&&(await this.deletePairing(e,!0),this.events.emit(nf,{topic:e}))}))}}class pp extends Th{constructor(t,e){super(t,e),this.core=t,this.logger=e,this.records=new Map,this.events=new v.EventEmitter,this.name="history",this.version="0.3",this.cached=[],this.initialized=!1,this.storagePrefix=Ou,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(
2),this.cached.forEach((t=>this.records.set(t.id,t))),this.cached=[],this.registerEventListeners(),this.initialized=!0)},this.set=(t,e,r)=>{if(this.isInitialized(),this.logger.debug("Setting JSON-RPC request history record"),this.logger.trace({type:"method",method:"set",topic:t,request:e,chainId:r}),this.records.has(e.id))return;const i={id:e.id,topic:t,request:{method:e.method,params:e.params||null},chainId:r,expiry:yr(R.THIRTY_DAYS)};this.records.set(i.id,i),this.persist(),this.events.emit(af,i)},this.resolve=async t=>{if(this.isInitialized(),this.logger.debug("Updating JSON-RPC response history record"),this.logger.trace({type:"method",method:"update",response:t}),!this.records.has(t.id))return;const e=await this.getRecord(t.id);typeof e.response>"u"&&(e.response=_u(t)?{error:t.error}:{result:t.result},this.records.set(e.id,e),this.persist(),this.events.emit(cf,e))},this.get=async(t,e)=>(this.isInitialized(),this.logger.debug("Getting record"),this.logger.trace({type:"method",method:"get",topic:t,id:e}),await this.getRecord(e)),this.delete=(t,e)=>{this.isInitialized(),this.logger.debug("Deleting record"),this.logger.trace({type:"method",method:"delete",id:e}),this.values.forEach((r=>{if(r.topic===t){if(typeof e<"u"&&r.id!==e)return;this.records.delete(r.id),this.events.emit(hf,r)}})),this.persist()},this.exists=async(t,e)=>(this.isInitialized(),!!this.records.has(e)&&(await this.getRecord(e)).topic===t),this.on=(t,e)=>{this.events.on(t,e)},this.once=(t,e)=>{this.events.once(t,e)},this.off=(t,e)=>{this.events.off(t,e)},this.removeListener=(t,e)=>{this.events.removeListener(t,e)},this.logger=Nh(e,this.name)}get context(){return Oh(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get size(){return this.records.size}get keys(){return Array.from(this.records.keys())}get values(){return Array.from(this.records.values())}get pending(){const t=[];return this.values.forEach((e=>{if(typeof e.response<"u")return;const r={topic:e.topic,request:au(e.request.method,e.request.params,e.id),chainId:e.chainId};return t.push(r)})),t}async setJsonRpcRecords(t){await this.core.storage.setItem(this.storageKey,t)}async getJsonRpcRecords(){return await this.core.storage.getItem(this.storageKey)}getRecord(t){this.isInitialized();const e=this.records.get(t);if(!e){const{message:e}=ic("NO_MATCHING_KEY","".concat(this.name,": ").concat(t));throw new Error(e)}return e}async persist(){await this.setJsonRpcRecords(this.values),this.events.emit(uf)}async restore(){try{const t=await this.getJsonRpcRecords();if(typeof t>"u"||!t.length)return;if(this.records.size){const{message:t}=ic("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(t),new Error(t)}this.cached=t,this.logger.debug("Successfully Restored records for ".concat(this.name)),this.logger.trace({type:"method",method:"restore",records:this.values})}catch(t){this.logger.debug("Failed to Restore records for ".concat(this.name)),this.logger.error(t)}}registerEventListeners(){this.events.on(af,(t=>{const e=af;this.logger.info("Emitting ".concat(e)),this.logger.debug({type:"event",event:e,record:t})})),this.events.on(cf,(t=>{const e=cf;this.logger.info("Emitting ".concat(e)),this.logger.debug({type:"event",event:e,record:t})})),this.events.on(hf,(t=>{const e=hf;this.logger.info("Emitting ".concat(e)),this.logger.debug({type:"event",event:e,record:t})})),this.core.heartbeat.on(Nc,(()=>{this.cleanup()}))}cleanup(){try{this.isInitialized();let t=!1;this.records.forEach((e=>{(0,R.toMiliseconds)(e.expiry||0)-Date.now()<=0&&(this.logger.info("Deleting expired history log: ".concat(e.id)),this.records.delete(e.id),this.events.emit(hf,e,!1),t=!0)})),t&&this.persist()}catch(t){this.logger.warn(t)}}isInitialized(){if(!this.initialized){const{message:t}=ic("NOT_INITIALIZED",this.name);throw new Error(t)}}}class gp extends Bh{constructor(t,e){super(t,e),this.core=t,this.logger=e,this.expirations=new Map,this.events=new v.EventEmitter,this.name="expirer",this.version="0.3",this.cached=[],this.initialized=!1,this.storagePrefix=Ou,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(
2),this.cached.forEach((t=>this.expirations.set(t.target,t))),this.cached=[],this.registerEventListeners(),this.initialized=!0)},this.has=t=>{try{const e=this.formatTarget(t);return typeof this.getExpiration(e)<"u"}catch(e){return!1}},this.set=(t,e)=>{this.isInitialized();const r=this.formatTarget(t),i={target:r,expiry:e};this.expirations.set(r,i),this.checkExpiry(r,i),this.events.emit(ff,{target:r,expiration:i})},this.get=t=>{this.isInitialized();const e=this.formatTarget(t);return this.getExpiration(e)},this.del=t=>{if(this.isInitialized(),this.has(t)){const e=this.formatTarget(t),r=this.getExpiration(e);this.expirations.delete(e),this.events.emit(lf,{target:e,expiration:r})}},this.on=(t,e)=>{this.events.on(t,e)},this.once=(t,e)=>{this.events.once(t,e)},this.off=(t,e)=>{this.events.off(t,e)},this.removeListener=(t,e)=>{this.events.removeListener(t,e)},this.logger=Nh(e,this.name)}get context(){return Oh(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get length(){return this.expirations.size}get keys(){return Array.from(this.expirations.keys())}get values(){return Array.from(this.expirations.values())}formatTarget(t){if("string"==typeof t)return function(t){return vr("topic",t)}(t);if("number"==typeof t)return function(t){return vr("id",t)}(t);const{message:e}=ic("UNKNOWN_TYPE","Target type: ".concat(typeof t));throw new Error(e)}async setExpirations(t){await this.core.storage.setItem(this.storageKey,t)}async getExpirations(){return await this.core.storage.getItem(this.storageKey)}async persist(){await this.setExpirations(this.values),this.events.emit(pf)}async restore(){try{const t=await this.getExpirations();if(typeof t>"u"||!t.length)return;if(this.expirations.size){const{message:t}=ic("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(t),new Error(t)}this.cached=t,this.logger.debug("Successfully Restored expirations for ".concat(this.name)),this.logger.trace({type:"method",method:"restore",expirations:this.values})}catch(t){this.logger.debug("Failed to Restore expirations for ".concat(this.name)),this.logger.error(t)}}getExpiration(t){const e=this.expirations.get(t);if(!e){const{message:e}=ic("NO_MATCHING_KEY","".concat(this.name,": ").concat(t));throw this.logger.warn(e),new Error(e)}return e}checkExpiry(t,e){const{expiry:r}=e;(0,R.toMiliseconds)(r)-Date.now()<=0&&this.expire(t,e)}expire(t,e){this.expirations.delete(t),this.events.emit(df,{target:t,expiration:e})}checkExpirations(){this.core.relayer.connected&&this.expirations.forEach(((t,e)=>this.checkExpiry(e,t)))}registerEventListeners(){this.core.heartbeat.on(Nc,(()=>this.checkExpirations())),this.events.on(ff,(t=>{const e=ff;this.logger.info("Emitting ".concat(e)),this.logger.debug({type:"event",event:e,data:t}),this.persist()})),this.events.on(df,(t=>{const e=df;this.logger.info("Emitting ".concat(e)),this.logger.debug({type:"event",event:e,data:t}),this.persist()})),this.events.on(lf,(t=>{const e=lf;this.logger.info("Emitting ".concat(e)),this.logger.debug({type:"event",event:e,data:t}),this.persist()}))}isInitialized(){if(!this.initialized){const{message:t}=ic("NOT_INITIALIZED",this.name);throw new Error(t)}}}var mp={};function vp(t){let e;return typeof window<"u"&&typeof window[t]<"u"&&(e=window[t]),e}function bp(t){const e=vp(t);if(!e)throw new Error("".concat(t," is not defined in Window"));return e}Object.defineProperty(mp,"__esModule",{value:!0}),mp.getLocalStorage=mp.getLocalStorageOrThrow=mp.getCrypto=mp.getCryptoOrThrow=mp.getLocation=mp.getLocationOrThrow=mp.getNavigator=mp.getNavigatorOrThrow=yp=mp.getDocument=mp.getDocumentOrThrow=mp.getFromWindowOrThrow=mp.getFromWindow=void 0,mp.getFromWindow=vp,mp.getFromWindowOrThrow=bp,mp.getDocumentOrThrow=function(){return bp("document")};var yp=mp.getDocument=function(){return vp("document")};mp.getNavigatorOrThrow=function(){return bp("navigator")},mp.getNavigator=function(){return vp("navigator")},mp.getLocationOrThrow=function(){return bp("location")},mp.getLocation=function(){return vp("location")},mp.getCryptoOrThrow=function(){return bp("crypto")},mp.getCrypto=function(){return vp("crypto")},mp.getLocalStorageOrThrow=function(){return bp("localStorage")},mp.getLocalStorage=function(){return vp("localStorage")};class wp extends jh{constructor(t,e,r){super(t,e,r),this.core=t,this.logger=e,this.store=r,this.name="verify-api",this.verifyUrlV3=vf,this.storagePrefix=Ou,this.version=2,this.init=async()=>{var t;this.isDevEnv||(this.publicKey=await this.store.getItem(this.storeKey),this.publicKey&&(0,R.toMiliseconds)(null==(t=this.publicKey)?void 0:t.expiresAt)<Date.now()&&(this.logger.debug("verify v2 public key expired"),await this.removePublicKey()))},this.register=async t=>{if(!ar()||this.isDevEnv)return;const e=window.location.origin,{id:r,decryptedId:i}=t,n="".concat(this.verifyUrlV3,"/attestation?projectId=").concat(this.core.projectId,"&origin=").concat(e,"&id=").concat(r,"&decryptedId=").concat(i);try{const t=yp(),e=this.startAbortTimer(5*R.ONE_SECOND),i=await new Promise(((i,s)=>{const o=()=>{window.removeEventListener("message",c),t.body.removeChild(a),s("attestation aborted")};this.abortController.signal.addEventListener("abort",o);const a=t.createElement("iframe");a.src=n,a.style.display="none",a.addEventListener("error",o,{signal:this.abortController.signal});const c=n=>{if(n.data&&"string"==typeof n.data)try{const s=JSON.parse(n.data);if("verify_attestation"===s.type){if(je(s.attestation).payload.id!==r)return;clearInterval(e),t.body.removeChild(a),this.abortController.signal.removeEventListener("abort",o),window.removeEventListener("message",c),i(null===s.attestation?"":s.attestation)}}catch(s){this.logger.warn(s)}};t.body.appendChild(a),window.addEventListener("message",c,{signal:this.abortController.signal})}));return this.logger.debug("jwt attestation",i),i}catch(s){this.logger.warn(s)}return""},this.resolve=async t=>{if(this.isDevEnv)return"";const{attestationId:e,hash:r,encryptedId:i}=t;if(""===e)return void this.logger.debug("resolve: attestationId is empty, skipping");if(e){if(je(e).payload.id!==i)return;const t=await this.isValidJwtAttestation(e);if(t)return t.isVerified?t:void this.logger.warn("resolve: jwt attestation: origin url not verified")}if(!r)return;const n=this.getVerifyUrl(null===t||void 0===t?void 0:t.verifyUrl);return this.fetchAttestation(r,n)},this.fetchAttestation=async(t,e)=>{this.logger.debug("resolving attestation: ".concat(t," from url: ").concat(e));const r=this.startAbortTimer(5*R.ONE_SECOND),i=await fetch("".concat(e,"/attestation/").concat(t,"?v2Supported=true"),{signal:this.abortController.signal});return clearTimeout(r),200===i.status?await i.json():void 0},this.getVerifyUrl=t=>{let e=t||mf;return bf.includes(e)||(this.logger.info("verify url: ".concat(e,", not included in trusted list, assigning default: ").concat(mf)),e=mf),e},this.fetchPublicKey=async()=>{try{this.logger.debug("fetching public key from: ".concat(this.verifyUrlV3));const t=this.startAbortTimer(R.FIVE_SECONDS),e=await fetch("".concat(this.verifyUrlV3,"/public-key"),{signal:this.abortController.signal});return clearTimeout(t),await e.json()}catch(Ih){this.logger.warn(Ih)}},this.persistPublicKey=async t=>{this.logger.debug("persisting public key to local storage",t),await this.store.setItem(this.storeKey,t),this.publicKey=t},this.removePublicKey=async()=>{this.logger.debug("removing verify v2 public key from storage"),await this.store.removeItem(this.storeKey),this.publicKey=void 0},this.isValidJwtAttestation=async t=>{const e=await this.getPublicKey();try{if(e)return this.validateAttestation(t,e)}catch(i){this.logger.error(i),this.logger.warn("error validating attestation")}const r=await this.fetchAndPersistPublicKey();try{if(r)return this.validateAttestation(t,r)}catch(i){this.logger.error(i),this.logger.warn("error validating attestation")}},this.getPublicKey=async()=>this.publicKey?this.publicKey:await this.fetchAndPersistPublicKey(),this.fetchAndPersistPublicKey=async()=>
2{if(this.fetchPromise)return await this.fetchPromise,this.publicKey;this.fetchPromise=new Promise((async t=>{const e=await this.fetchPublicKey();e&&(await this.persistPublicKey(e),t(e))}));const t=await this.fetchPromise;return this.fetchPromise=void 0,t},this.validateAttestation=(t,e)=>{const r=La(t,e.publicKey),i={hasExpired:(0,R.toMiliseconds)(r.exp)<Date.now(),payload:r};if(i.hasExpired)throw this.logger.warn("resolve: jwt attestation expired"),new Error("JWT attestation expired");return{origin:i.payload.origin,isScam:i.payload.isScam,isVerified:i.payload.isVerified}},this.logger=Nh(e,this.name),this.abortController=new AbortController,this.isDevEnv=Ir(),this.init()}get storeKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//verify:public:key"}get context(){return Oh(this.logger)}startAbortTimer(t){return this.abortController=new AbortController,setTimeout((()=>this.abortController.abort()),(0,R.toMiliseconds)(t))}}class _p extends zh{constructor(t,e){super(t,e),this.projectId=t,this.logger=e,this.context="echo",this.registerDeviceToken=async t=>{const{clientId:e,token:r,notificationType:i,enableEncrypted:n=!1}=t,s="".concat("https://echo.walletconnect.com","/").concat(this.projectId,"/clients");await fetch(s,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({client_id:e,type:i,token:r,always_raw:n})})},this.logger=Nh(e,this.context)}}var Ap=Object.defineProperty,Ep=Object.getOwnPropertySymbols,Sp=Object.prototype.hasOwnProperty,Mp=Object.prototype.propertyIsEnumerable,Ip=(t,e,r)=>e in t?Ap(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,xp=(t,e)=>{for(var r in e||(e={}))Sp.call(e,r)&&Ip(t,r,e[r]);if(Ep)for(var r of Ep(e))Mp.call(e,r)&&Ip(t,r,e[r]);return t};class Pp extends Fh{constructor(t,e){let r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];super(t,e,r),this.core=t,this.logger=e,this.context="event-client",this.storagePrefix=Ou,this.storageVersion=.1,this.events=new Map,this.shouldPersist=!1,this.init=async()=>{if(!Ir())try{const t={eventId:Mr(),timestamp:Date.now(),domain:this.getAppDomain(),props:{event:"INIT",type:"",properties:{client_id:await this.core.crypto.getClientId(),user_agent:ur(this.core.relayer.protocol,this.core.relayer.version,Gu)}}};await this.sendEvent([t])}catch(Ih){this.logger.warn(Ih)}},this.createEvent=t=>{const{event:e="ERROR",type:r="",properties:{topic:i,trace:n}}=t,s=Mr(),o=this.core.projectId||"",a=Date.now(),c=xp({eventId:s,timestamp:a,props:{event:e,type:r,properties:{topic:i,trace:n}},bundleId:o,domain:this.getAppDomain()},this.setMethods(s));return this.telemetryEnabled&&(this.events.set(s,c),this.shouldPersist=!0),c},this.getEvent=t=>{const{eventId:e,topic:r}=t;if(e)return this.events.get(e);const i=Array.from(this.events.values()).find((t=>t.props.properties.topic===r));return i?xp(xp({},i),this.setMethods(i.eventId)):void 0},this.deleteEvent=t=>{const{eventId:e}=t;this.events.delete(e),this.shouldPersist=!0},this.setEventListeners=()=>{this.core.heartbeat.on(Nc,(async()=>{this.shouldPersist&&await this.persist(),this.events.forEach((t=>{(0,R.fromMiliseconds)(Date.now())-(0,R.fromMiliseconds)(t.timestamp)>86400&&(this.events.delete(t.eventId),this.shouldPersist=!0)}))}))},this.setMethods=t=>({addTrace:e=>this.addTrace(t,e),setError:e=>this.setError(t,e)}),this.addTrace=(t,e)=>{const r=this.events.get(t);r&&(r.props.properties.trace.push(e),this.events.set(t,r),this.shouldPersist=!0)},this.setError=(t,e)=>{const r=this.events.get(t);r&&(r.props.type=e,r.timestamp=Date.now(),this.events.set(t,r),this.shouldPersist=!0)},this.persist=async()=>{await this.core.storage.setItem(this.storageKey,Array.from(this.events.values())),this.shouldPersist=!1},this.restore=async()=>{try{const t=await this.core.storage.getItem(this.storageKey)||[];if(!t.length)return;t.forEach((t=>{this.events.set(t.eventId,xp(xp({},t),this.setMethods(t.eventId)))}))}catch(Ih){this.logger.warn(Ih)}},this.submit=async()=>{if(!this.telemetryEnabled||0===this.events.size)return;const t=[];for(const[r,i]of this.events)i.props.type&&t.push(i);if(0!==t.length)try{if((await this.sendEvent(t)).ok)for(const e of t)this.events.delete(e.eventId),this.shouldPersist=!0}catch(e){this.logger.warn(e)}},this.sendEvent=async t=>{const e=this.getAppDomain()?"":"&sp=desktop";return await fetch("".concat("https://pulse.walletconnect.org/batch","?projectId=").concat(this.core.projectId,"&st=events_sdk&sv=js-").concat(Gu).concat(e),{method:"POST",body:JSON.stringify(t)})},this.getAppDomain=()=>hr().url,this.logger=Nh(e,this.context),this.telemetryEnabled=r,r?this.restore(
2).then((async()=>{await this.submit(),this.setEventListeners()})):this.persist()}get storageKey(){return this.storagePrefix+this.storageVersion+this.core.customStoragePrefix+"//"+this.context}}var Op=Object.defineProperty,Np=Object.getOwnPropertySymbols,Rp=Object.prototype.hasOwnProperty,Cp=Object.prototype.propertyIsEnumerable,Tp=(t,e,r)=>e in t?Op(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,kp=(t,e)=>{for(var r in e||(e={}))Rp.call(e,r)&&Tp(t,r,e[r]);if(Np)for(var r of Np(e))Cp.call(e,r)&&Tp(t,r,e[r]);return t};class Lp extends Ch{constructor(t){var e;super(t),this.protocol="wc",this.version=2,this.name=Pu,this.events=new v.EventEmitter,this.initialized=!1,this.on=(t,e)=>this.events.on(t,e),this.once=(t,e)=>this.events.once(t,e),this.off=(t,e)=>this.events.off(t,e),this.removeListener=(t,e)=>this.events.removeListener(t,e),this.dispatchEnvelope=t=>{let{topic:e,message:r,sessionExists:i}=t;if(!e||!r)return;const n={topic:e,message:r,publishedAt:Date.now(),transportType:Ju.link_mode};this.relayer.onLinkMessageEvent(n,{sessionExists:i})},this.projectId=null===t||void 0===t?void 0:t.projectId,this.relayUrl=(null===t||void 0===t?void 0:t.relayUrl)||Lu,this.customStoragePrefix=null!=t&&t.customStoragePrefix?":".concat(t.customStoragePrefix):"";const r=Ph({level:"string"==typeof(null===t||void 0===t?void 0:t.logger)&&t.logger?t.logger:Nu}),{logger:i,chunkLoggerController:n}=Rh({opts:r,maxSizeInBytes:null===t||void 0===t?void 0:t.maxLogBlobSizeInBytes,loggerOverride:null===t||void 0===t?void 0:t.logger});this.logChunkController=n,null!=(e=this.logChunkController)&&e.downloadLogsBlobInBrowser&&(window.downloadLogsBlobInBrowser=async()=>{var t,e;null!=(t=this.logChunkController)&&t.downloadLogsBlobInBrowser&&(null==(e=this.logChunkController)||e.downloadLogsBlobInBrowser({clientId:await this.crypto.getClientId()}))}),this.logger=Nh(i,this.name),this.heartbeat=new Rc,this.crypto=new jd(this,this.logger,null===t||void 0===t?void 0:t.keychain),this.history=new pp(this,this.logger),this.expirer=new gp(this,this.logger),this.storage=null!=t&&t.storage?t.storage:new ch(kp(kp({},Ru),null===t||void 0===t?void 0:t.storageOptions)),this.relayer=new sp({core:this,logger:this.logger,relayUrl:this.relayUrl,projectId:this.projectId}),this.pairing=new dp(this,this.logger),this.verify=new wp(this,this.logger,this.storage),this.echoClient=new _p(this.projectId||"",this.logger),this.linkModeSupportedApps=[],this.eventClient=new Pp(this,this.logger,null===t||void 0===t?void 0:t.telemetryEnabled)}static async init(t){const e=new Lp(t);await e.initialize();const r=await e.crypto.getClientId();return await e.storage.setItem("WALLETCONNECT_CLIENT_ID",r),e}get context(){return Oh(this.logger)}async start(){this.initialized||await this.initialize()}async getLogsBlob(){var t;return null==(t=this.logChunkController)?void 0:t.logsToBlob({clientId:await this.crypto.getClientId()})}async addLinkModeSupportedApp(t){this.linkModeSupportedApps.includes(t)||(this.linkModeSupportedApps.push(t),await this.storage.setItem(Yu,this.linkModeSupportedApps))}async initialize(){this.logger.trace("Initialized");try{await this.crypto.init(),await this.history.init(),await this.expirer.init(),await this.relayer.init(),await this.heartbeat.init(),await this.pairing.init(),this.eventClient.init(),this.linkModeSupportedApps=await this.storage.getItem(Yu)||[],this.initialized=!0,this.logger.info("Core Initialization Success")}catch(t){throw this.logger.warn("Core Initialization Failure at epoch ".concat(Date.now()),t),this.logger.error(t.message),t}}}const qp=Lp,Dp="client",Up="".concat("wc","@").concat(2,":").concat(Dp,":"),Bp=Dp,jp="error",zp="WALLETCONNECT_DEEPLINK_CHOICE",Fp="Proposal expired",Hp=R.SEVEN_DAYS,Kp={wc_sessionPropose:{req:{ttl:R.FIVE_MINUTES,prompt:!0,tag:1100},res:{ttl:R.FIVE_MINUTES,prompt:!1,tag:1101},reject:{ttl:R.FIVE_MINUTES,prompt:!1,tag:1120},autoReject:{ttl:R.FIVE_MINUTES,prompt:!1,tag:1121}},wc_sessionSettle:{req:{ttl:R.FIVE_MINUTES,prompt:!1,tag:1102},res:{ttl:R.FIVE_MINUTES,prompt:!1,tag:1103}},wc_sessionUpdate:{req:{ttl:R.ONE_DAY,prompt:!1,tag:1104},res:{ttl:R.ONE_DAY,prompt:!1,tag:1105}},wc_sessionExtend:{req:{ttl:R.ONE_DAY,prompt:!1,tag:1106},res:{ttl:R.ONE_DAY,prompt:!1,tag:1107}},wc_sessionRequest:{req:{ttl:R.FIVE_MINUTES,prompt:!0,tag:1108},res:{ttl:R.FIVE_MINUTES,prompt:!1,tag:1109}},wc_sessionEvent:{req:{ttl:R.FIVE_MINUTES,prompt:!0,tag:1110},res:{ttl:R.FIVE_MINUTES,prompt:!1,tag:1111}},wc_sessionDelete:{req:{ttl:R.ONE_DAY,prompt:!1,tag:1112},res:{ttl:R.ONE_DAY,prompt:!1,tag:1113}},wc_sessionPing:{req:{ttl:R.ONE_DAY,prompt:!1,tag:1114},res:{ttl:R.ONE_DAY,prompt:!1,tag:1115}},wc_sessionAuthenticate:{req:{ttl:R.ONE_HOUR,prompt:!0,tag:1116},res:{ttl:R.ONE_HOUR,prompt:!1,tag:1117},reject:{ttl:R.FIVE_MINUTES,prompt:!1,tag:1118},autoReject:{ttl:R.FIVE_MINUTES,prompt:!1,tag:1119}}},Vp={min:R.FIVE_MINUTES,max:R.SEVEN_DAYS},Wp="IDLE",Gp="ACTIVE",Jp=["wc_sessionPropose","wc_sessionRequest","wc_authRequest","wc_sessionAuthenticate"],Yp="".concat("wc","@",1.5,":").concat("auth",":"),Qp="".concat(Yp,":PUB_KEY");var Xp=Object.defineProperty,Zp=Object.defineProperties,$p=Object.getOwnPropertyDescriptors,tg=Object.getOwnPropertySymbols,eg=Object.prototype.hasOwnProperty,rg=Object.prototype.propertyIsEnumerable,ig=(t,e,r)=>e in t?Xp(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,ng=(t,e)=>{for(var r in e||(e={}))eg.call(e,r)&&ig(t,r,e[r]);if(tg)for(var r of tg(e))rg.call(e,r)&&ig(t,r,e[r]);return t},sg=(t,e)=>Zp(t,$p(e));class og extends Kh{constructor(t){var e;super(t),e=this,this.name="engine",this.events=new(b()),this.initialized=!1,this.requestQueue={state:Wp,queue:[]},this.sessionRequestQueue={state:Wp,queue:[]},this.requestQueueDelay=R.ONE_SECOND,this.expectedPairingMethodMap=new Map,this.recentlyDeletedMap=new Map,this.recentlyDeletedLimit=200,this.relayMessageCache=[],this.init=async()=>{this.initialized||(await this.cleanup(),this.registerRelayerEvents(),this.registerExpirerEvents(),this.registerPairingEvents(),await this.registerLinkModeListeners(),this.client.core.pairing.register({methods:Object.keys(Kp)}),this.initialized=!0,setTimeout((()=>{this.sessionRequestQueue.queue=this.getPendingSessionRequests(),this.processSessionRequestQueue()}),(0,R.toMiliseconds)(this.requestQueueDelay)))},this.connect=async t=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();const e=sg(ng({},t),{requiredNamespaces:t.requiredNamespaces||{},optionalNamespaces:t.optionalNamespaces||{}});await this.isValidConnect(e);const{pairingTopic:r,requiredNamespaces:i,optionalNamespaces:n,sessionProperties:s,relays:o}=e;let a,c=r,h=!1;try{c&&(h=this.client.core.pairing.pairings.get(c).active)}catch(b){throw this.client.logger.error("connect() -> pairing.get(".concat(c,") failed")),b}if(!c||!h){const{topic:t,uri:e}=await this.client.core.pairing.create();c=t,a=e}if(!c){const{message:t}=ic("NO_MATCHING_KEY","connect() pairing topic: ".concat(c));throw new Error(t)}const u=await this.client.core.crypto.generateKeyPair(),f=Kp.wc_sessionPropose.req.ttl||R.FIVE_MINUTES,l=yr(f),d=ng({requiredNamespaces:i,optionalNamespaces:n,relays:null!==o&&void 0!==o?o:[{protocol:"irn"}],proposer:{publicKey:u,metadata:this.client.metadata},expiryTimestamp:l,pairingTopic:c},s&&{sessionProperties:s}),{reject:p,resolve:g,done:m}=gr(f,Fp);this.events.once(_r("session_connect"),(async t=>{let{error:e,session:r}=t;if(e)p(e);else if(r){r.self.publicKey=u;const t=sg(ng({},r),{pairingTopic:d.pairingTopic,requiredNamespaces:d.requiredNamespaces,optionalNamespaces:d.optionalNamespaces,transportType:Ju.relay});await this.client.session.set(r.topic,t),await this.setExpiry(r.topic,r.expiry),c&&await this.client.core.pairing.updateMetadata({topic:c,metadata:r.peer.metadata}
2),this.cleanupDuplicatePairings(t),g(t)}}));const v=await this.sendRequest({topic:c,method:"wc_sessionPropose",params:d,throwOnFailedPublish:!0});return await this.setProposal(v,ng({id:v},d)),{uri:a,approval:m}},this.pair=async t=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{return await this.client.core.pairing.pair(t)}catch(e){throw this.client.logger.error("pair() failed"),e}},this.approve=async t=>{var e,r,i;const n=this.client.core.eventClient.createEvent({properties:{topic:null==(e=null===t||void 0===t?void 0:t.id)?void 0:e.toString(),trace:[Lf]}});try{this.isInitialized(),await this.confirmOnlineStateOrThrow()}catch(A){throw n.setError(Kf),A}try{await this.isValidProposalId(null===t||void 0===t?void 0:t.id)}catch(A){throw this.client.logger.error("approve() -> proposal.get(".concat(null===t||void 0===t?void 0:t.id,") failed")),n.setError(Qf),A}try{await this.isValidApprove(t)}catch(A){throw this.client.logger.error("approve() -> isValidApprove() failed"),n.setError(Yf),A}const{id:s,relayProtocol:o,namespaces:a,sessionProperties:c,sessionConfig:h}=t,u=this.client.proposal.get(s);this.client.core.eventClient.deleteEvent({eventId:n.eventId});const{pairingTopic:f,proposer:l,requiredNamespaces:d,optionalNamespaces:p}=u;let g=null==(r=this.client.core.eventClient)?void 0:r.getEvent({topic:f});g||(g=null==(i=this.client.core.eventClient)?void 0:i.createEvent({type:Lf,properties:{topic:f,trace:[Lf,qf]}}));const m=await this.client.core.crypto.generateKeyPair(),v=l.publicKey,b=await this.client.core.crypto.generateSharedKey(m,v),y=ng(ng({relay:{protocol:null!==o&&void 0!==o?o:"irn"},namespaces:a,controller:{publicKey:m,metadata:this.client.metadata},expiry:yr(Hp)},c&&{sessionProperties:c}),h&&{sessionConfig:h}),w=Ju.relay;g.addTrace(Df);try{await this.client.core.relayer.subscribe(b,{transportType:w})}catch(A){throw g.setError(Wf),A}g.addTrace(Uf);const _=sg(ng({},y),{topic:b,requiredNamespaces:d,optionalNamespaces:p,pairingTopic:f,acknowledged:!1,self:y.controller,peer:{publicKey:l.publicKey,metadata:l.metadata},controller:m,transportType:Ju.relay});await this.client.session.set(b,_),g.addTrace(zf);try{g.addTrace(Ff),await this.sendRequest({topic:b,method:"wc_sessionSettle",params:y,throwOnFailedPublish:!0}).catch((t=>{var e;throw null!==(e=g)&&void 0!==e&&e.setError(Jf),t})),g.addTrace(Hf),g.addTrace(Bf),await this.sendResult({id:s,topic:f,result:{relay:{protocol:null!==o&&void 0!==o?o:"irn"},responderPublicKey:m},throwOnFailedPublish:!0}).catch((t=>{var e;throw null!==(e=g)&&void 0!==e&&e.setError(Gf),t})),g.addTrace(jf)}catch(A){throw this.client.logger.error(A),this.client.session.delete(b,nc("USER_DISCONNECTED")),await this.client.core.relayer.unsubscribe(b),A}return this.client.core.eventClient.deleteEvent({eventId:g.eventId}),await this.client.core.pairing.updateMetadata({topic:f,metadata:l.metadata}),await this.client.proposal.delete(s,nc("USER_DISCONNECTED")),await this.client.core.pairing.activate({topic:f}),await this.setExpiry(b,yr(Hp)),{topic:b,acknowledged:()=>Promise.resolve(this.client.session.get(b))}},this.reject=async t=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidReject(t)}catch(n){throw this.client.logger.error("reject() -> isValidReject() failed"),n}const{id:e,reason:r}=t;let i;try{i=this.client.proposal.get(e).pairingTopic}catch(n){throw this.client.logger.error("reject() -> proposal.get(".concat(e,") failed")),n}i&&(await this.sendError({id:e,topic:i,error:r,rpcOpts:Kp.wc_sessionPropose.reject}),await this.client.proposal.delete(e,nc("USER_DISCONNECTED")))},this.update=async t=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidUpdate(t)}catch(h){throw this.client.logger.error("update() -> isValidUpdate() failed"),h}const{topic:e,namespaces:r}=t,{done:i,resolve:n,reject:s}=gr(),o=su(),a=ou().toString(),c=this.client.session.get(e).namespaces;return this.events.once(_r("session_update",o),(t=>{let{error:e}=t;e?s(e):n()})),await this.client.session.update(e,{namespaces:r}),await this.sendRequest({topic:e,method:"wc_sessionUpdate",params:{namespaces:r},throwOnFailedPublish:!0,clientRpcId:o,relayRpcId:a}).catch((t=>{this.client.logger.error(t),this.client.session.update(e,{namespaces:c}),s(t)})),{acknowledged:i}},this.extend=async t=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidExtend(t)}catch(o){throw this.client.logger.error("extend() -> isValidExtend() failed"),o}const{topic:e}=t,r=su(),{done:i,resolve:n,reject:s}=gr();return this.events.once(_r("session_extend",r),(t=>{let{error:e}=t;e?s(e):n()})),await this.setExpiry(e,yr(Hp)),this.sendRequest({topic:e,method:"wc_sessionExtend",params:{},clientRpcId:r,throwOnFailedPublish:!0}).catch((t=>{s(t)})),{acknowledged:i}},this.request=async t=>{this.isInitialized();try{await this.isValidRequest(t)}catch(l){throw this.client.logger.error("request() -> isValidRequest() failed"),l}const{chainId:e,request:r,topic:i,expiry:n=Kp.wc_sessionRequest.req.ttl}=t,s=this.client.session.get(i);(null===s||void 0===s?void 0:s.transportType)===Ju.relay&&await this.confirmOnlineStateOrThrow();const o=su(),a=ou().toString(),{done:c,resolve:h,reject:u}=gr(n,"Request expired. Please try again.");this.events.once(_r("session_request",o),(t=>{let{error:e,result:r}=t;e?u(e):h(r)}));const f=this.getAppLinkIfEnabled(s.peer.metadata,s.transportType);return f?(await this.sendRequest({clientRpcId:o,relayRpcId:a,topic:i,method:"wc_sessionRequest",params:{request:sg(ng({},r),{expiryTimestamp:yr(n)}),chainId:e},expiry:n,throwOnFailedPublish:!0,appLink:f}).catch((t=>u(t))),this.client.events.emit("session_request_sent",{topic:i,request:r,chainId:e,id:o}),await c()):await Promise.all([new Promise((async t=>{await this.sendRequest({clientRpcId:o,relayRpcId:a,topic:i,method:"wc_sessionRequest",params:{request:sg(ng({},r),{expiryTimestamp:yr(n)}),chainId:e},expiry:n,throwOnFailedPublish:!0}).catch((t=>u(t))),this.client.events.emit("session_request_sent",{topic:i,request:r,chainId:e,id:o}),t()})),new Promise((async t=>{var e;if(null==(e=s.sessionConfig)||!e.disableDeepLink){const t=await async function(t,e){let r="";try{if(ar()&&(r=localStorage.getItem(e),r))return r;r=await t.getItem(e)}catch(i){console.error(i)}return r}(this.client.core.storage,zp);await Er({id:o,topic:i,wcDeepLink:t})}t()})),c()]).then((t=>t[2]))},this.respond=async t=>{this.isInitialized(),await this.isValidRespond(t);const{topic:e,response:r}=t,{id:i}=r,n=this.client.session.get(e);n.transportType===Ju.relay&&await this.confirmOnlineStateOrThrow();const s=this.getAppLinkIfEnabled(n.peer.metadata,n.transportType);wu(r)?await this.sendResult({id:i,topic:e,result:r.result,throwOnFailedPublish:!0,appLink:s}
2):_u(r)&&await this.sendError({id:i,topic:e,error:r.error,appLink:s}),this.cleanupAfterResponse(t)},this.ping=async t=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidPing(t)}catch(Oc){throw this.client.logger.error("ping() -> isValidPing() failed"),Oc}const{topic:e}=t;if(this.client.session.keys.includes(e)){const t=su(),r=ou().toString(),{done:i,resolve:n,reject:s}=gr();this.events.once(_r("session_ping",t),(t=>{let{error:e}=t;e?s(e):n()})),await Promise.all([this.sendRequest({topic:e,method:"wc_sessionPing",params:{},throwOnFailedPublish:!0,clientRpcId:t,relayRpcId:r}),i()])}else this.client.core.pairing.pairings.keys.includes(e)&&await this.client.core.pairing.ping({topic:e})},this.emit=async t=>{this.isInitialized(),await this.confirmOnlineStateOrThrow(),await this.isValidEmit(t);const{topic:e,event:r,chainId:i}=t,n=ou().toString();await this.sendRequest({topic:e,method:"wc_sessionEvent",params:{event:r,chainId:i},throwOnFailedPublish:!0,relayRpcId:n})},this.disconnect=async t=>{this.isInitialized(),await this.confirmOnlineStateOrThrow(),await this.isValidDisconnect(t);const{topic:e}=t;if(this.client.session.keys.includes(e))await this.sendRequest({topic:e,method:"wc_sessionDelete",params:nc("USER_DISCONNECTED"),throwOnFailedPublish:!0}),await this.deleteSession({topic:e,emitEvent:!1});else{if(!this.client.core.pairing.pairings.keys.includes(e)){const{message:t}=ic("MISMATCHED_TOPIC","Session or pairing topic not found: ".concat(e));throw new Error(t)}await this.client.core.pairing.disconnect({topic:e})}},this.find=t=>(this.isInitialized(),this.client.session.getAll().filter((e=>function(t,e){const{requiredNamespaces:r}=e,i=Object.keys(t.namespaces),n=Object.keys(r);let s=!0;return!!lr(n,i)&&(i.forEach((e=>{const{accounts:i,methods:n,events:o}=t.namespaces[e],a=Xa(i),c=r[e];(!lr(Ge(e,c),a)||!lr(c.methods,n)||!lr(c.events,o))&&(s=!1)})),s)}(e,t)))),this.getPendingSessionRequests=()=>this.client.pendingRequest.getAll(),this.authenticate=async(t,e)=>{var r,i;this.isInitialized(),this.isValidAuthenticate(t);const n=e&&this.client.core.linkModeSupportedApps.includes(e)&&(null==(i=this.client.metadata.redirect)?void 0:i.linkMode),s=n?Ju.link_mode:Ju.relay;s===Ju.relay&&await this.confirmOnlineStateOrThrow();const{chains:o,statement:a="",uri:c,domain:h,nonce:u,type:f,exp:l,nbf:d,methods:p=[],expiry:g}=t,m=[...t.resources||[]],{topic:v,uri:b}=await this.client.core.pairing.create({methods:["wc_sessionAuthenticate"],transportType:s});this.client.logger.info({message:"Generated new pairing",pairing:{topic:v,uri:b}});const y=await this.client.core.crypto.generateKeyPair(),w=Ia(y);if(await Promise.all([this.client.auth.authKeys.set(Qp,{responseTopic:w,publicKey:y}),this.client.auth.pairingTopics.set(w,{topic:w,pairingTopic:v})]),await this.client.core.relayer.subscribe(w,{transportType:s}),this.client.logger.info("sending request to new pairing topic: ".concat(v)),p.length>0){const{namespace:t}=Ve(o[0]);let e=da(t,"request",p);ya(m)&&(e=ga(e,m.pop())),m.push(e)}const _=g&&g>Kp.wc_sessionAuthenticate.req.ttl?g:Kp.wc_sessionAuthenticate.req.ttl,A={authPayload:{type:null!==f&&void 0!==f?f:"caip122",chains:o,statement:a,aud:c,domain:h,version:"1",nonce:u,iat:(new Date).toISOString(),exp:l,nbf:d,resources:m},requester:{publicKey:y,metadata:this.client.metadata},expiryTimestamp:yr(_)},E={requiredNamespaces:{},optionalNamespaces:{eip155:{chains:o,methods:[...new Set(["personal_sign",...p])],events:["chainChanged","accountsChanged"]}},relays:[{protocol:"irn"}],pairingTopic:v,proposer:{publicKey:y,metadata:this.client.metadata},expiryTimestamp:yr(Kp.wc_sessionPropose.req.ttl)},{done:S,resolve:M,reject:I}=gr(_,"Request expired"),x=async t=>{let{error:e,session:r}=t;if(this.events.off(_r("session_request",O),P),e)I(e);else if(r){r.self.publicKey=y,await this.client.session.set(r.topic,r),await this.setExpiry(r.topic,r.expiry),v&&await this.client.core.pairing.updateMetadata({topic:v,metadata:r.peer.metadata});const t=this.client.session.get(r.topic);await this.deleteProposal(N),M({session:t})}},P=async t=>{var r,i,n;if(await this.deletePendingAuthRequest(O,{message:"fulfilled",code:0}),t.error){const e=nc("WC_METHOD_UNSUPPORTED","wc_sessionAuthenticate");return t.error.code===e.code?void 0:(this.events.off(_r("session_connect"),x),I(t.error.message))}await this.deleteProposal(N),this.events.off(_r("session_connect"),x);const{cacaos:o,responder:a}=t.result,c=[],h=[];for(const e of o){await aa({cacao:e,projectId:this.client.core.projectId})||(this.client.logger.error(e,"Signature verification failed"),I(nc("SESSION_SETTLEMENT_FAILED","Signature verification failed")));const{p:t}=e,r=ya(t.resources),i=[sa(t.iss)],n=oa(t.iss);if(r){const t=va(r),e=ba(r);c.push(...t),i.push(...e)}for(const e of i)h.push("".concat(e,":").concat(n))}const u=await this.client.core.crypto.generateSharedKey(y,a.publicKey);let f;c.length>0&&(f={topic:u,acknowledged:!0,self:{publicKey:y,metadata:this.client.metadata},peer:a,controller:a.publicKey,expiry:yr(Hp),requiredNamespaces:{},optionalNamespaces:{},relay:{protocol:"irn"},pairingTopic:v,namespaces:tc([...new Set(c)],[...new Set(h)]),transportType:s},await this.client.core.relayer.subscribe(u,{transportType:s}),await this.client.session.set(u,f),v&&await this.client.core.pairing.updateMetadata({topic:v,metadata:a.metadata}),f=this.client.session.get(u)),null!=(r=this.client.metadata.redirect)&&r.linkMode&&null!=(i=a.metadata.redirect)&&i.linkMode&&null!=(n=a.metadata.redirect)&&n.universal&&e&&(this.client.core.addLinkModeSupportedApp(a.metadata.redirect.universal),this.client.session.update(u,{transportType:Ju.link_mode})),M({auths:o,session:f})},O=su(),N=su();let R;this.events.once(_r("session_connect"),x),this.events.once(_r("session_request",O),P);try{if(n){const t=au("wc_sessionAuthenticate",A,O);this.client.core.history.set(v,t);const r=await this.client.core.crypto.encode("",t,{type:2,encoding:Ea});R=Qa(e,v,r)}else await Promise.all([this.sendRequest({topic:v,method:"wc_sessionAuthenticate",params:A,expiry:t.expiry,throwOnFailedPublish:!0,clientRpcId:O}),this.sendRequest({topic:v,method:"wc_sessionPropose",params:E,expiry:Kp.wc_sessionPropose.req.ttl,throwOnFailedPublish:!0,clientRpcId:N})])}catch(C){throw this.events.off(_r("session_connect"),x),this.events.off(_r("session_request",O),P),C}return await this.setProposal(N,ng({id:N},E)),await this.setAuthRequest(O,{request:sg(ng({},A),{verifyContext:{}}),pairingTopic:v,transportType:s}),{uri:null!==(r=R)&&void 0!==r?r:b,response:S}},this.approveSessionAuthenticate=async t=>{const{id:e,auths:r}=t,i=this.client.core.eventClient.createEvent({properties:{topic:e.toString(),trace:[Xf]}});try{this.isInitialized()}catch(p){throw i.setError(nl),p}const n=this.getPendingAuthRequest(e);
2if(!n)throw i.setError(cl),new Error("Could not find pending auth request with id ".concat(e));const s=n.transportType||Ju.relay;s===Ju.relay&&await this.confirmOnlineStateOrThrow();const o=n.requester.publicKey,a=await this.client.core.crypto.generateKeyPair(),c=Ia(o),h={type:1,receiverPublicKey:o,senderPublicKey:a},u=[],f=[];for(const g of r){if(!await aa({cacao:g,projectId:this.client.core.projectId})){i.setError(sl);const t=nc("SESSION_SETTLEMENT_FAILED","Signature verification failed");throw await this.sendError({id:e,topic:c,error:t,encodeOpts:h}),new Error(t.message)}i.addTrace($f);const{p:t}=g,r=ya(t.resources),n=[sa(t.iss)],s=oa(t.iss);if(r){const t=va(r),e=ba(r);u.push(...t),n.push(...e)}for(const e of n)f.push("".concat(e,":").concat(s))}const l=await this.client.core.crypto.generateSharedKey(a,o);let d;if(i.addTrace(Zf),(null===u||void 0===u?void 0:u.length)>0){d={topic:l,acknowledged:!0,self:{publicKey:a,metadata:this.client.metadata},peer:{publicKey:o,metadata:n.requester.metadata},controller:o,expiry:yr(Hp),authentication:r,requiredNamespaces:{},optionalNamespaces:{},relay:{protocol:"irn"},pairingTopic:n.pairingTopic,namespaces:tc([...new Set(u)],[...new Set(f)]),transportType:s},i.addTrace(el);try{await this.client.core.relayer.subscribe(l,{transportType:s})}catch(p){throw i.setError(ol),p}i.addTrace(rl),await this.client.session.set(l,d),i.addTrace(tl),await this.client.core.pairing.updateMetadata({topic:n.pairingTopic,metadata:n.requester.metadata})}i.addTrace(il);try{await this.sendResult({topic:c,id:e,result:{cacaos:r,responder:{publicKey:a,metadata:this.client.metadata}},encodeOpts:h,throwOnFailedPublish:!0,appLink:this.getAppLinkIfEnabled(n.requester.metadata,s)})}catch(p){throw i.setError(al),p}return await this.client.auth.requests.delete(e,{message:"fulfilled",code:0}),await this.client.core.pairing.activate({topic:n.pairingTopic}),this.client.core.eventClient.deleteEvent({eventId:i.eventId}),{session:d}},this.rejectSessionAuthenticate=async t=>{this.isInitialized();const{id:e,reason:r}=t,i=this.getPendingAuthRequest(e);if(!i)throw new Error("Could not find pending auth request with id ".concat(e));i.transportType===Ju.relay&&await this.confirmOnlineStateOrThrow();const n=i.requester.publicKey,s=await this.client.core.crypto.generateKeyPair(),o=Ia(n),a={type:1,receiverPublicKey:n,senderPublicKey:s};await this.sendError({id:e,topic:o,error:r,encodeOpts:a,rpcOpts:Kp.wc_sessionAuthenticate.reject,appLink:this.getAppLinkIfEnabled(i.requester.metadata,i.transportType)}),await this.client.auth.requests.delete(e,{message:"rejected",code:0}),await this.client.proposal.delete(e,nc("USER_DISCONNECTED"))},this.formatAuthMessage=t=>{this.isInitialized();const{request:e,iss:r}=t;return ca(e,r)},this.processRelayMessageCache=()=>{setTimeout((async()=>{if(0!==this.relayMessageCache.length)for(;this.relayMessageCache.length>0;)try{const t=this.relayMessageCache.shift();t&&await this.onRelayMessage(t)}catch(t){this.client.logger.error(t)}}),50)},this.cleanupDuplicatePairings=async t=>{if(t.pairingTopic)try{const e=this.client.core.pairing.pairings.get(t.pairingTopic),r=this.client.core.pairing.pairings.getAll().filter((r=>{var i,n;return(null==(i=r.peerMetadata)?void 0:i.url)&&(null==(n=r.peerMetadata)?void 0:n.url)===t.peer.metadata.url&&r.topic&&r.topic!==e.topic}));if(0===r.length)return;this.client.logger.info("Cleaning up ".concat(r.length," duplicate pairing(s)")),await Promise.all(r.map((t=>this.client.core.pairing.disconnect({topic:t.topic})))),this.client.logger.info("Duplicate pairings clean up finished")}catch(e){this.client.logger.error(e)}},this.deleteSession=async t=>{var e;const{topic:r,expirerHasDeleted:i=!1,emitEvent:n=!0,id:s=0}=t,{self:o}=this.client.session.get(r);await this.client.core.relayer.unsubscribe(r),await this.client.session.delete(r,nc("USER_DISCONNECTED")),this.addToRecentlyDeleted(r,"session"),this.client.core.crypto.keychain.has(o.publicKey)&&await this.client.core.crypto.deleteKeyPair(o.publicKey),this.client.core.crypto.keychain.has(r)&&await this.client.core.crypto.deleteSymKey(r),i||this.client.core.expirer.del(r),this.client.core.storage.removeItem(zp).catch((t=>this.client.logger.warn(t))),this.getPendingSessionRequests().forEac
2h((t=>{t.topic===r&&this.deletePendingSessionRequest(t.id,nc("USER_DISCONNECTED"))})),r===(null==(e=this.sessionRequestQueue.queue[0])?void 0:e.topic)&&(this.sessionRequestQueue.state=Wp),n&&this.client.events.emit("session_delete",{id:s,topic:r})},this.deleteProposal=async(t,e)=>{if(e)try{const e=this.client.proposal.get(t),r=this.client.core.eventClient.getEvent({topic:e.pairingTopic});null===r||void 0===r||r.setError(Vf)}catch(r){}await Promise.all([this.client.proposal.delete(t,nc("USER_DISCONNECTED")),e?Promise.resolve():this.client.core.expirer.del(t)]),this.addToRecentlyDeleted(t,"proposal")},this.deletePendingSessionRequest=async function(t,r){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];await Promise.all([e.client.pendingRequest.delete(t,r),i?Promise.resolve():e.client.core.expirer.del(t)]),e.addToRecentlyDeleted(t,"request"),e.sessionRequestQueue.queue=e.sessionRequestQueue.queue.filter((e=>e.id!==t)),i&&(e.sessionRequestQueue.state=Wp,e.client.events.emit("session_request_expire",{id:t}))},this.deletePendingAuthRequest=async function(t,r){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];await Promise.all([e.client.auth.requests.delete(t,r),i?Promise.resolve():e.client.core.expirer.del(t)])},this.setExpiry=async(t,e)=>{this.client.session.keys.includes(t)&&(this.client.core.expirer.set(t,e),await this.client.session.update(t,{expiry:e}))},this.setProposal=async(t,e)=>{this.client.core.expirer.set(t,yr(Kp.wc_sessionPropose.req.ttl)),await this.client.proposal.set(t,e)},this.setAuthRequest=async(t,e)=>{const{request:r,pairingTopic:i,transportType:n=Ju.relay}=e;this.client.core.expirer.set(t,r.expiryTimestamp),await this.client.auth.requests.set(t,{authPayload:r.authPayload,requester:r.requester,expiryTimestamp:r.expiryTimestamp,id:t,pairingTopic:i,verifyContext:r.verifyContext,transportType:n})},this.setPendingSessionRequest=async t=>{const{id:e,topic:r,params:i,verifyContext:n}=t,s=i.request.expiryTimestamp||yr(Kp.wc_sessionRequest.req.ttl);this.client.core.expirer.set(e,s),await this.client.pendingRequest.set(e,{id:e,topic:r,params:i,verifyContext:n})},this.sendRequest=async t=>{const{topic:e,method:i,params:n,expiry:s,relayRpcId:o,clientRpcId:a,throwOnFailedPublish:c,appLink:h}=t,u=au(i,n,a);let f;const l=!!h;try{const t=l?Ea:Aa;f=await this.client.core.crypto.encode(e,u,{encoding:t})}catch(g){throw await this.cleanup(),this.client.logger.error("sendRequest() -> core.crypto.encode() for topic ".concat(e," failed")),g}let d;if(Jp.includes(i)){const t=xa(JSON.stringify(u)),e=xa(f);d=await this.client.core.verify.register({id:e,decryptedId:t})}const p=Kp[i].req;if(p.attestation=d,s&&(p.ttl=s),o&&(p.id=o),this.client.core.history.set(e,u),l){const t=Qa(h,e,f);await r.g.Linking.openURL(t,this.client.name)}else{const t=Kp[i].req;s&&(t.ttl=s),o&&(t.id=o),c?(t.internal=sg(ng({},t.internal),{throwOnFailedPublish:!0}),await this.client.core.relayer.publish(e,f,t)):this.client.core.relayer.publish(e,f,t).catch((t=>this.client.logger.error(t)))}return u.id},this.sendResult=async t=>{const{id:e,topic:i,result:n,throwOnFailedPublish:s,encodeOpts:o,appLink:a}=t,c=cu(e,n);let h;const u=a&&typeof(null==r.g?void 0:r.g.Linking)<"u";try{const t=u?Ea:Aa;h=await this.client.core.crypto.encode(i,c,sg(ng({},o||{}),{encoding:t}))}catch(l){throw await this.cleanup(),this.client.logger.error("sendResult() -> core.crypto.encode() for topic ".concat(i," failed")),l}let f;try{f=await this.client.core.history.get(i,e)}catch(l){throw this.client.logger.error("sendResult() -> history.get(".concat(i,", ").concat(e,") failed")),l}if(u){const t=Qa(a,i,h);await r.g.Linking.openURL(t,this.client.name)}else{const t=Kp[f.request.method].res;s?(t.internal=sg(ng({},t.internal),{throwOnFailedPublish:!0}),await this.client.core.relayer.publish(i,h,t)):this.client.core.relayer.publish(i,h,t).catch((t=>this.client.logger.error(t)))}await this.client.core.history.resolve(c)},this.sendError=async t=>{const{id:e,topic:i,error:n,encodeOpts:s,rpcOpts:o,appLink:a}=t,c=hu(e,n);let h;const u=a&&typeof(null==r.g?void 0:r.g.Linking)<"u";try{const t=u?Ea:Aa;h=await this.client.core.crypto.encode(i,c,sg(ng({},s||{}),{encoding:t}))}catch(l){throw await this.cleanup(),this.client.logger.error("sendError() -> core.crypto.encode() for topic ".concat(i," failed")),l}let f;try{f=await this.client.core.history.get(i,e)}catch(l){throw this.client.logger.error("sendError() -> history.get(".concat(i,", ").concat(e,") failed")),l}if(u){const t=Qa(a,i,h);await r.g.Linking.openURL(t,this.client.name)}else{const t=o||Kp[f.request.method].res;this.client.core.relayer.publish(i,h,t)}await this.client.core.history.resolve(c)},this.cleanup=async()=>{const t=[],e=[];
2this.client.session.getAll().forEach((e=>{let r=!1;wr(e.expiry)&&(r=!0),this.client.core.crypto.keychain.has(e.topic)||(r=!0),r&&t.push(e.topic)})),this.client.proposal.getAll().forEach((t=>{wr(t.expiryTimestamp)&&e.push(t.id)})),await Promise.all([...t.map((t=>this.deleteSession({topic:t}))),...e.map((t=>this.deleteProposal(t)))])},this.onRelayEventRequest=async t=>{this.requestQueue.queue.push(t),await this.processRequestsQueue()},this.processRequestsQueue=async()=>{if(this.requestQueue.state!==Gp){for(this.client.logger.info("Request queue starting with ".concat(this.requestQueue.queue.length," requests"));this.requestQueue.queue.length>0;){this.requestQueue.state=Gp;const e=this.requestQueue.queue.shift();if(e)try{await this.processRequest(e)}catch(t){this.client.logger.warn(t)}}this.requestQueue.state=Wp}else this.client.logger.info("Request queue already active, skipping...")},this.processRequest=async t=>{const{topic:e,payload:r,attestation:i,transportType:n,encryptedId:s}=t,o=r.method;if(!this.shouldIgnorePairingRequest({topic:e,requestMethod:o}))switch(o){case"wc_sessionPropose":return await this.onSessionProposeRequest
2({topic:e,payload:r,attestation:i,encryptedId:s});case"wc_sessionSettle":return await this.onSessionSettleRequest(e,r);case"wc_sessionUpdate":return await this.onSessionUpdateRequest(e,r);case"wc_sessionExtend":return await this.onSessionExtendRequest(e,r);case"wc_sessionPing":return await this.onSessionPingRequest(e,r);case"wc_sessionDelete":return await this.onSessionDeleteRequest(e,r);case"wc_sessionRequest":return await this.onSessionRequest({topic:e,payload:r,attestation:i,encryptedId:s,transportType:n});case"wc_sessionEvent":return await this.onSessionEventRequest(e,r);case"wc_sessionAuthenticate":return await this.onSessionAuthenticateRequest({topic:e,payload:r,attestation:i,encryptedId:s,transportType:n});default:return this.client.logger.info("Unsupported request method ".concat(o))}},this.onRelayEventResponse=async t=>{const{topic:e,payload:r,transportType:i}=t,n=(await this.client.core.history.get(e,r.id)).request.method;switch(n){case"wc_sessionPropose":return this.onSessionProposeResponse(e,r,i);case"wc_sessionSettle":return this.onSessionSettleResponse(e,r);case"wc_sessionUpdate":return this.onSessionUpdateResponse(e,r);case"wc_sessionExtend":return this.onSessionExtendResponse(e,r);case"wc_sessionPing":return this.onSessionPingResponse(e,r);case"wc_sessionRequest":return this.onSessionRequestResponse(e,r);case"wc_sessionAuthenticate":return this.onSessionAuthenticateResponse(e,r);default:return this.client.logger.info("Unsupported response method ".concat(n))}},this.onRelayEventUnknownPayload=t=>{const{topic:e}=t,{message:r}=ic("MISSING_OR_INVALID","Decoded payload on topic ".concat(e," is not identifiable as a JSON-RPC request or a response."));throw new Error(r)},this.shouldIgnorePairingRequest=t=>{const{topic:e,requestMethod:r}=t,i=this.expectedPairingMethodMap.get(e);return!(!i||i.includes(r))&&!!(i.includes("wc_sessionAuthenticate")&&this.client.events.listenerCount("session_authenticate")>0)},this.onSessionProposeRequest=async t=>{const{topic:e,payload:r,attestation:i,encryptedId:n}=t,{params:s,id:o}=r;try{const t=this.client.core.eventClient.getEvent({topic:e});this.isValidConnect(ng({},r.params));const a=s.expiryTimestamp||yr(Kp.wc_sessionPropose.req.ttl),c=ng({id:o,pairingTopic:e,expiryTimestamp:a},s);await this.setProposal(o,c);const h=await this.getVerifyContext({attestationId:i,hash:xa(JSON.stringify(r)),encryptedId:n,metadata:c.proposer.metadata});0===this.client.events.listenerCount("session_proposal")&&(console.warn("No listener for session_proposal event"),null!==t&&void 0!==t&&t.setError(kf)),null!==t&&void 0!==t&&t.addTrace(Pf),this.client.events.emit("session_proposal",{id:o,params:c,verifyContext:h})}catch(a){await this.sendError({id:o,topic:e,error:a,rpcOpts:Kp.wc_sessionPropose.autoReject}),this.client.logger.error(a)}},this.onSessionProposeResponse=async(t,e,r)=>{const{id:i}=e;if(wu(e)){const{result:n}=e;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",result:n});const s=this.client.proposal.get(i);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",proposal:s});const o=s.proposer.publicKey;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",selfPublicKey:o});const a=n.responderPublicKey;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",peerPublicKey:a});const c=await this.client.core.crypto.generateSharedKey(o,a);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",sessionTopic:c});const h=await this.client.core.relayer.subscribe(c,{transportType:r});this.client.logger.trace({type:"method",method:"onSessionProposeResponse",subscriptionId:h}),await this.client.core.pairing.activate({topic:t})}else if(_u(e)){await this.client.proposal.delete(i,nc("USER_DISCONNECTED"));const t=_r("session_connect");if(0===this.events.listenerCount(t))throw new Error("emitting ".concat(t," without any listeners, 954"));this.events.emit(_r("session_connect"),{error:e.error})}},this.onSessionSettleRequest=async(t,e)=>{const{id:r,params:i}=e;try{this.isValidSessionSettleRequest(i);const{relay:r,controller:n,expiry:s,namespaces:o,sessionProperties:a,sessionConfig:c}=e.params,h=sg(ng(ng({topic:t,relay:r,expiry:s,namespaces:o,acknowledged:!0,pairingTopic:"",requiredNamespaces:{},optionalNamespaces:{},controller:n.publicKey,self:{publicKey:"",metadata:this.client.metadata},peer:{publicKey:n.publicKey,metadata:n.metadata}},a&&{sessionProperties:a}),c&&{sessionConfig:c}
2),{transportType:Ju.relay}),u=_r("session_connect");if(0===this.events.listenerCount(u))throw new Error("emitting ".concat(u," without any listeners 997"));this.events.emit(_r("session_connect"),{session:h}),await this.sendResult({id:e.id,topic:t,result:!0,throwOnFailedPublish:!0})}catch(n){await this.sendError({id:r,topic:t,error:n}),this.client.logger.error(n)}},this.onSessionSettleResponse=async(t,e)=>{const{id:r}=e;wu(e)?(await this.client.session.update(t,{acknowledged:!0}),this.events.emit(_r("session_approve",r),{})):_u(e)&&(await this.client.session.delete(t,nc("USER_DISCONNECTED")),this.events.emit(_r("session_approve",r),{error:e.error}))},this.onSessionUpdateRequest=async(t,e)=>{const{params:r,id:i}=e;try{const e="".concat(t,"_session_update"),s=Ic.get(e);if(s&&this.isRequestOutOfSync(s,i))return this.client.logger.info("Discarding out of sync request - ".concat(i)),void this.sendError({id:i,topic:t,error:nc("INVALID_UPDATE_REQUEST")});this.isValidUpdate(ng({topic:t},r));try{Ic.set(e,i),await this.client.session.update(t,{namespaces:r.namespaces}),await this.sendResult({id:i,topic:t,result:!0,throwOnFailedPublish:!0})}catch(n){throw Ic.delete(e),n}this.client.events.emit("session_update",{id:i,topic:t,params:r})}catch(s){await this.sendError({id:i,topic:t,error:s}),this.client.logger.error(s)}},this.isRequestOutOfSync=(t,e)=>parseInt(e.toString().slice(0,-3))<=parseInt(t.toString().slice(0,-3)),this.onSessionUpdateResponse=(t,e)=>{const{id:r}=e,i=_r("session_update",r);if(0===this.events.listenerCount(i))throw new Error("emitting ".concat(i," without any listeners"));wu(e)?this.events.emit(_r("session_update",r),{}):_u(e)&&this.events.emit(_r("session_update",r),{error:e.error})},this.onSessionExtendRequest=async(t,e)=>{const{id:r}=e;try{this.isValidExtend({topic:t}),await this.setExpiry(t,yr(Hp)),await this.sendResult({id:r,topic:t,result:!0,throwOnFailedPublish:!0}),this.client.events.emit("session_extend",{id:r,topic:t})}catch(Ih){await this.sendError({id:r,topic:t,error:Ih}),this.client.logger.error(Ih)}},this.onSessionExtendResponse=(t,e)=>{const{id:r}=e,i=_r("session_extend",r);if(0===this.events.listenerCount(i))throw new Error("emitting ".concat(i," without any listeners"));wu(e)?this.events.emit(_r("session_extend",r),{}):_u(e)&&this.events.emit(_r("session_extend",r),{error:e.error})},this.onSessionPingRequest=async(t,e)=>{const{id:r}=e;try{this.isValidPing({topic:t}),await this.sendResult({id:r,topic:t,result:!0,throwOnFailedPublish:!0}),this.client.events.emit("session_ping",{id:r,topic:t})}catch(Ih){await this.sendError({id:r,topic:t,error:Ih}),this.client.logger.error(Ih)}},this.onSessionPingResponse=(t,e)=>{const{id:r}=e,i=_r("session_ping",r);if(0===this.events.listenerCount(i))throw new Error("emitting ".concat(i," without any listeners"));setTimeout((()=>{wu(e)?this.events.emit(_r("session_ping",r),{}):_u(e)&&this.events.emit(_r("session_ping",r),{error:e.error})}),500)},this.onSessionDeleteRequest=async(t,e)=>{const{id:r}=e;try{this.isValidDisconnect({topic:t,reason:e.params}),Promise.all([new Promise((e=>{this.client.core.relayer.once(Fu,(async()=>{e(await this.deleteSession({topic:t,id:r}))}))})),this.sendResult({id:r,topic:t,result:!0,throwOnFailedPublish:!0}),this.cleanupPendingSentRequestsForTopic({topic:t,error:nc("USER_DISCONNECTED")})]).catch((t=>this.client.logger.error(t)))}catch(Ih){this.client.logger.error(Ih)}},this.onSessionRequest=async t=>{var e,r,i;const{topic:n,payload:s,attestation:o,encryptedId:a,transportType:c}=t,{id:h,params:u}=s;try{await this.isValidRequest(ng({topic:n},u));const t=this.client.session.get(n),s={id:h,topic:n,params:u,verifyContext:await this.getVerifyContext({attestationId:o,hash:xa(JSON.stringify(au("wc_sessionRequest",u,h))),encryptedId:a,metadata:t.peer.metadata,transportType:c})};await this.setPendingSessionRequest(s),c===Ju.link_mode&&null!=(e=t.peer.metadata.redirect)&&e.universal&&this.client.core.addLinkModeSupportedApp(null==(r=t.peer.metadata.redirect)?void 0:r.universal),null!=(i=this.client.signConfig)&&i.disableRequestQueue?this.emitSessionRequest(s):(this.addSessionRequestToSessionRequestQueue(s),this.processSessionRequestQueue())}
2catch(f){await this.sendError({id:h,topic:n,error:f}),this.client.logger.error(f)}},this.onSessionRequestResponse=(t,e)=>{const{id:r}=e,i=_r("session_request",r);if(0===this.events.listenerCount(i))throw new Error("emitting ".concat(i," without any listeners"));wu(e)?this.events.emit(_r("session_request",r),{result:e.result}):_u(e)&&this.events.emit(_r("session_request",r),{error:e.error})},this.onSessionEventRequest=async(t,e)=>{const{id:r,params:i}=e;try{const e="".concat(t,"_session_event_").concat(i.event.name),n=Ic.get(e);if(n&&this.isRequestOutOfSync(n,r))return void this.client.logger.info("Discarding out of sync request - ".concat(r));this.isValidEmit(ng({topic:t},i)),this.client.events.emit("session_event",{id:r,topic:t,params:i}),Ic.set(e,r)}catch(n){await this.sendError({id:r,topic:t,error:n}),this.client.logger.error(n)}},this.onSessionAuthenticateResponse=(t,e)=>{const{id:r}=e;this.client.logger.trace({type:"method",method:"onSessionAuthenticateResponse",topic:t,payload:e}),wu(e)?this.events.emit(_r("session_request",r),{result:e.result}):_u(e)&&this.events.emit(_r("session_request",r),{error:e.error})},this.onSessionAuthenticateRequest=async t=>{var e;const{topic:r,payload:i,attestation:n,encryptedId:s,transportType:o}=t;try{const{requester:t,authPayload:a,expiryTimestamp:c}=i.params,h=await this.getVerifyContext({attestationId:n,hash:xa(JSON.stringify(i)),encryptedId:s,metadata:t.metadata,transportType:o}),u={requester:t,pairingTopic:r,id:i.id,authPayload:a,verifyContext:h,expiryTimestamp:c};await this.setAuthRequest(i.id,{request:u,pairingTopic:r,transportType:o}),o===Ju.link_mode&&null!=(e=t.metadata.redirect)&&e.universal&&this.client.core.addLinkModeSupportedApp(t.metadata.redirect.universal),this.client.events.emit("session_authenticate",{topic:r,params:i.params,id:i.id,verifyContext:h})}catch(a){this.client.logger.error(a);const t=i.params.requester.publicKey,e=await this.client.core.crypto.generateKeyPair(),n=this.getAppLinkIfEnabled(i.params.requester.metadata,o),s={type:1,receiverPublicKey:t,senderPublicKey:e};await this.sendError({id:i.id,topic:r,error:a,encodeOpts:s,rpcOpts:Kp.wc_sessionAuthenticate.autoReject,appLink:n})}},this.addSessionRequestToSessionRequestQueue=t=>{this.sessionRequestQueue.queue.push(t)},this.cleanupAfterResponse=t=>{this.deletePendingSessionRequest(t.response.id,{message:"fulfilled",code:0}),setTimeout((()=>{this.sessionRequestQueue.state=Wp,this.processSessionRequestQueue()}),(0,R.toMiliseconds)(this.requestQueueDelay))},this.cleanupPendingSentRequestsForTopic=t=>{let{topic:e,error:r}=t;const i=this.client.core.history.pending;i.length>0&&i.filter((t=>t.topic===e&&"wc_sessionRequest"===t.request.method)).forEach((t=>{const e=_r("session_request",t.request.id);if(0===this.events.listenerCount(e))throw new Error("emitting ".concat(e," without any listeners"));this.events.emit(_r("session_request",t.request.id),{error:r})}))},this.processSessionRequestQueue=()=>{if(this.sessionRequestQueue.state===Gp)return void this.client.logger.info("session request queue is already active.");const t=this.sessionRequestQueue.queue[0];if(t)try{this.sessionRequestQueue.state=Gp,this.emitSessionRequest(t)}catch(e){this.client.logger.error(e)}else this.client.logger.info("session request queue is empty.")},this.emitSessionRequest=t=>{this.client.events.emit("session_request",t)},this.onPairingCreated=t=>{if(t.methods&&this.expectedPairingMethodMap.set(t.topic,t.methods),t.active)return;const e=this.client.proposal.getAll().find((e=>e.pairingTopic===t.topic));
2e&&this.onSessionProposeRequest({topic:t.topic,payload:au("wc_sessionPropose",{requiredNamespaces:e.requiredNamespaces,optionalNamespaces:e.optionalNamespaces,relays:e.relays,proposer:e.proposer,sessionProperties:e.sessionProperties},e.id)})},this.isValidConnect=async t=>{if(!vc(t)){const{message:e}=ic("MISSING_OR_INVALID","connect() params: ".concat(JSON.stringify(t)));throw new Error(e)}const{pairingTopic:e,requiredNamespaces:r,optionalNamespaces:i,sessionProperties:n,relays:s}=t;if(ac(e)||await this.isValidPairingTopic(e),!function(t,e){let r=!1;return e&&!t?r=!0:t&&sc(t)&&t.length&&t.forEach((t=>{r=mc(t)})),r}(s,!0)){const{message:t}=ic("MISSING_OR_INVALID","connect() relays: ".concat(s));throw new Error(t)}!ac(r)&&0!==oc(r)&&this.validateNamespaces(r,"requiredNamespaces"),!ac(i)&&0!==oc(i)&&this.validateNamespaces(i,"optionalNamespaces"),ac(n)||this.validateSessionProps(n,"sessionProperties")},this.validateNamespaces=(t,e)=>{const r=function(t,e,r){let i=null;if(t&&oc(t)){const n=pc(t,e);n&&(i=n);const s=lc(t,e,r);s&&(i=s)}else i=ic("MISSING_OR_INVALID","".concat(e,", ").concat(r," should be an object with data"));return i}(t,"connect()",e);if(r)throw new Error(r.message)},this.isValidApprove=async t=>{if(!vc(t))throw new Error(ic("MISSING_OR_INVALID","approve() params: ".concat(t)).message);const{id:e,namespaces:r,relayProtocol:i,sessionProperties:n}=t;this.checkRecentlyDeleted(e),await this.isValidProposalId(e);const s=this.client.proposal.get(e),o=gc(r,"approve()");if(o)throw new Error(o.message);const a=_c(s.requiredNamespaces,r,"approve()");if(a)throw new Error(a.message);if(!cc(i,!0)){const{message:t}=ic("MISSING_OR_INVALID","approve() relayProtocol: ".concat(i));throw new Error(t)}ac(n)||this.validateSessionProps(n,"sessionProperties")},this.isValidReject=async t=>{if(!vc(t)){const{message:e}=ic("MISSING_OR_INVALID","reject() params: ".concat(t));throw new Error(e)}const{id:e,reason:r}=t;if(this.checkRecentlyDeleted(e),await this.isValidProposalId(e),!function(t){return!(!t||"object"!=typeof t||!t.code||!hc(t.code,!1)||!t.message||!cc(t.message,!1))}(r)){const{message:t}=ic("MISSING_OR_INVALID","reject() reason: ".concat(JSON.stringify(r)));throw new Error(t)}},this.isValidSessionSettleRequest=t=>{if(!vc(t)){const{message:e}=ic("MISSING_OR_INVALID","onSessionSettleRequest() params: ".concat(t));throw new Error(e)}
2const{relay:e,controller:r,namespaces:i,expiry:n}=t;if(!mc(e)){const{message:t}=ic("MISSING_OR_INVALID","onSessionSettleRequest() relay protocol should be a string");throw new Error(t)}const s=function(t,e){let r=null;return cc(null===t||void 0===t?void 0:t.publicKey,!1)||(r=ic("MISSING_OR_INVALID","".concat(e," controller public key should be a string"))),r}(r,"onSessionSettleRequest()");if(s)throw new Error(s.message);const o=gc(i,"onSessionSettleRequest()");if(o)throw new Error(o.message);if(wr(n)){const{message:t}=ic("EXPIRED","onSessionSettleRequest()");throw new Error(t)}},this.isValidUpdate=async t=>{if(!vc(t)){const{message:e}=ic("MISSING_OR_INVALID","update() params: ".concat(t));throw new Error(e)}const{topic:e,namespaces:r}=t;this.checkRecentlyDeleted(e),await this.isValidSessionTopic(e);const i=this.client.session.get(e),n=gc(r,"update()");if(n)throw new Error(n.message);const s=_c(i.requiredNamespaces,r,"update()");if(s)throw new Error(s.message)},this.isValidExtend=async t=>{if(!vc(t)){const{message:e}=ic("MISSING_OR_INVALID","extend() params: ".concat(t));throw new Error(e)}const{topic:e}=t;this.checkRecentlyDeleted(e),await this.isValidSessionTopic(e)},this.isValidRequest=async t=>{if(!vc(t)){const{message:e}=ic("MISSING_OR_INVALID","request() params: ".concat(t));throw new Error(e)}const{topic:e,request:r,chainId:i,expiry:n}=t;this.checkRecentlyDeleted(e),await this.isValidSessionTopic(e);const{namespaces:s}=this.client.session.get(e);if(!bc(s,i)){const{message:t}=ic("MISSING_OR_INVALID","request() chainId: ".concat(i));throw new Error(t)}if(!function(t){return!(ac(t)||!cc(t.method,!1))}(r)){const{message:t}=ic("MISSING_OR_INVALID","request() ".concat(JSON.stringify(r)));throw new Error(t)}if(!yc(s,i,r.method)){const{message:t}=ic("MISSING_OR_INVALID","request() method: ".concat(r.method));throw new Error(t)}if(n&&!function(t,e){return hc(t,!1)&&t<=e.max&&t>=e.min}(n,Vp)){const{message:t}=ic("MISSING_OR_INVALID","request() expiry: ".concat(n,". Expiry must be a number (in seconds) between ").concat(Vp.min," and ").concat(Vp.max));throw new Error(t)}},this.isValidRespond=async t=>{var e;if(!vc(t)){const{message:e}=ic("MISSING_OR_INVALID","respond() params: ".concat(t));throw new Error(e)}const{topic:r,response:i}=t;try{await this.isValidSessionTopic(r)}catch(n){throw null!=(e=null===t||void 0===t?void 0:t.response)&&e.id&&this.cleanupAfterResponse(t),n}if(!function(t){return!(ac(t)||ac(t.result)&&ac(t.error)||!hc(t.id,!1)||!cc(t.jsonrpc,!1))}(i)){const{message:t}=ic("MISSING_OR_INVALID","respond() response: ".concat(JSON.stringify(i)));throw new Error(t)}},this.isValidPing=async t=>{if(!vc(t)){const{message:e}=ic("MISSING_OR_INVALID","ping() params: ".concat(t));throw new Error(e)}const{topic:e}=t;await this.isValidSessionOrPairingTopic(e)},this.isValidEmit=async t=>{if(!vc(t)){const{message:e}=ic("MISSING_OR_INVALID","emit() params: ".concat(t));throw new Error(e)}const{topic:e,event:r,chainId:i}=t;await this.isValidSessionTopic(e);const{namespaces:n}=this.client.session.get(e);if(!bc(n,i)){const{message:t}=ic("MISSING_OR_INVALID","emit() chainId: ".concat(i));throw new Error(t)}if(!function(t){return!(ac(t)||!cc(t.name,!1))}(r)){const{message:t}=ic("MISSING_OR_INVALID","emit() event: ".concat(JSON.stringify(r)));throw new Error(t)}if(!wc(n,i,r.name)){const{message:t}=ic("MISSING_OR_INVALID","emit() event: ".concat(JSON.stringify(r)));throw new Error(t)}},this.isValidDisconnect=async t=>{if(!vc(t)){const{message:e}=ic("MISSING_OR_INVALID","disconnect() params: ".concat(t));throw new Error(e)}const{topic:e}=t;await this.isValidSessionOrPairingTopic(e)},this.isValidAuthenticate=t=>{const{chains:e,uri:r,domain:i,nonce:n}=t;if(!Array.isArray(e)||0===e.length)throw new Error("chains is required and must be a non-empty array");if(!cc(r,!1))throw new Error("uri is required parameter");if(!cc(i,!1))throw new Error("domain is required parameter");if(!cc(n,!1))throw new Error("nonce is required parameter");if([...new Set(e.map((t=>Ve(t).namespace)))].length>1)throw new Error("Multi-namespace requests are not supported. Please request single namespace only.");const{namespace:s}=Ve(e[0]);if("eip155"!==s)throw new Error("Only eip155 namespace is supported for authenticated sessions. Please use .connect() for non-eip155 chains.")},this.getVerifyContext=async t=>{const{attestationId:e,hash:r,encryptedId:i,metadata:n,transportType:s}=t,o={verified:{verifyUrl:n.verifyUrl||mf,validation:"UNKNOWN",origin:n.url||""}};try{if(s===Ju.link_mode){const t=this.getAppLinkIfEnabled(n,s);return o.verified.validation=t&&new URL(t).origin===new URL(n.url).origin?"VALID":"INVALID",o}const t=await this.client.core.verify.resolve({attestationId:e,hash:r,encryptedId:i,verifyUrl:n.verifyUrl});t&&(o.verified.origin=t.origin,o.verified.isScam=t.isScam,o.verified.validation=t.origin===new URL(n.url).origin?"VALID":"INVALID")}catch(a){this.client.logger.warn(a)}return this.client.logger.debug("Verify context: ".concat(JSON.stringify(o))),o},this.validateSessionProps=(t,e)=>{Object.values(t).forEach((t=>{if(!cc(t,!1)){const{message:r}=ic("MISSING_OR_INVALID","".concat(e," must be in Record<string, string> format. Received: ").concat(JSON.stringify(t)));throw new Error(r)}}))},this.getPendingAuthRequest=t=>{const e=this.client.auth.requests.get(t);return"object"==typeof e?e:void 0},this.addToRecentlyDeleted=(t,e)=>{if(this.recentlyDeletedMap.set(t,e),this.recentlyDeletedMap.size>=this.recentlyDeletedLimit){let t=0;const e=this.recentlyDeletedLimit/2;
2for(const r of this.recentlyDeletedMap.keys()){if(t++>=e)break;this.recentlyDeletedMap.delete(r)}}},this.checkRecentlyDeleted=t=>{const e=this.recentlyDeletedMap.get(t);if(e){const{message:r}=ic("MISSING_OR_INVALID","Record was recently deleted - ".concat(e,": ").concat(t));throw new Error(r)}},this.isLinkModeEnabled=(t,e)=>{var i,n,s,o,a,c,h,u,f;return!(!t||e!==Ju.link_mode)&&(!0===(null==(n=null==(i=this.client.metadata)?void 0:i.redirect)?void 0:n.linkMode)&&void 0!==(null==(o=null==(s=this.client.metadata)?void 0:s.redirect)?void 0:o.universal)&&""!==(null==(c=null==(a=this.client.metadata)?void 0:a.redirect)?void 0:c.universal)&&void 0!==(null==(h=null===t||void 0===t?void 0:t.redirect)?void 0:h.universal)&&""!==(null==(u=null===t||void 0===t?void 0:t.redirect)?void 0:u.universal)&&!0===(null==(f=null===t||void 0===t?void 0:t.redirect)?void 0:f.linkMode)&&this.client.core.linkModeSupportedApps.includes(t.redirect.universal)&&typeof(null==r.g?void 0:r.g.Linking)<"u")},this.getAppLinkIfEnabled=(t,e)=>{var r;return this.isLinkModeEnabled(t,e)?null==(r=null===t||void 0===t?void 0:t.redirect)?void 0:r.universal:void 0},this.handleLinkModeMessage=t=>{let{url:e}=t;if(!e||!e.includes("wc_ev")||!e.includes("topic"))return;const r=Sr(e,"topic")||"",i=decodeURIComponent(Sr(e,"wc_ev")||""),n=this.client.session.keys.includes(r);n&&this.client.session.update(r,{transportType:Ju.link_mode}),this.client.core.dispatchEnvelope({topic:r,message:i,sessionExists:n})},this.registerLinkModeListeners=async()=>{var t;if(Ir()||or()&&null!=(t=this.client.metadata.redirect)&&t.linkMode){const t=null==r.g?void 0:r.g.Linking;if(typeof t<"u"){t.addEventListener("url",this.handleLinkModeMessage,this.client.name);const e=await t.getInitialURL();e&&setTimeout((()=>{this.handleLinkModeMessage({url:e})}),50)}}}}isInitialized(){if(!this.initialized){const{message:t}=ic("NOT_INITIALIZED",this.name);throw new Error(t)}}async confirmOnlineStateOrThrow(){await this.client.core.relayer.confirmOnlineStateOrThrow()}registerRelayerEvents(){this.client.core.relayer.on(qu,(t=>{!this.initialized||this.relayMessageCache.length>0?this.relayMessageCache.push(t):this.onRelayMessage(t)}))}async onRelayMessage(t){const{topic:e,message:r,attestation:i,transportType:n}=t,{publicKey:s}=this.client.auth.authKeys.keys.includes(Qp)?this.client.auth.authKeys.get(Qp):{responseTopic:void 0,publicKey:void 0},o=await this.client.core.crypto.decode(e,r,{receiverPublicKey:s,encoding:n===Ju.link_mode?Ea:Aa});try{bu(o)?(this.client.core.history.set(e,o),this.onRelayEventRequest({topic:e,payload:o,attestation:i,transportType:n,encryptedId:xa(r)})):yu(o)?(await this.client.core.history.resolve(o),await this.onRelayEventResponse({topic:e,payload:o,transportType:n}),this.client.core.history.delete(e,o.id)):this.onRelayEventUnknownPayload({topic:e,payload:o,transportType:n})}catch(a){this.client.logger.error(a)}}registerExpirerEvents(){this.client.core.expirer.on(df,(async t=>{const{topic:e,id:r}=br(t.target);return r&&this.client.pendingRequest.keys.includes(r)?await this.deletePendingSessionRequest(r,ic("EXPIRED"),!0):r&&this.client.auth.requests.keys.includes(r)?await this.deletePendingAuthRequest(r,ic("EXPIRED"),!0):void(e?this.client.session.keys.includes(e)&&(await this.deleteSession({topic:e,expirerHasDeleted:!0}),this.client.events.emit("session_expire",{topic:e})):r&&(await this.deleteProposal(r,!0),this.client.events.emit("proposal_expire",{id:r})))}))}registerPairingEvents(){this.client.core.pairing.events.on(rf,(t=>this.onPairingCreated(t))),this.client.core.pairing.events.on(sf,(t=>{this.addToRecentlyDeleted(t.topic,"pairing")}))}isValidPairingTopic(t){if(!cc(t,!1)){const{message:e}=ic("MISSING_OR_INVALID","pairing topic should be a string: ".concat(t));throw new Error(e)}if(!this.client.core.pairing.pairings.keys.includes(t)){const{message:e}=ic("NO_MATCHING_KEY","pairing topic doesn't exist: ".concat(t));throw new Error(e)}if(wr(this.client.core.pairing.pairings.get(t).expiry)){const{message:e}=ic("EXPIRED","pairing topic: ".concat(t));throw new Error(e)}}async isValidSessionTopic(t){if(!cc(t,!1)){const{message:e}=ic("MISSING_OR_INVALID","session topic should be a string: ".concat(t));throw new Error(e)}if(this.checkRecentlyDeleted(t),!this.client.session.keys.includes(t)){const{message:e}=ic("NO_MATCHING_KEY","session topic doesn't exist: ".concat(t));throw new Error(e)}if(wr(this.client.session.get(t).expiry)){await this.deleteSession({topic:t});const{message:e}=ic("EXPIRED","session topic: ".concat(t));throw new Error(e)}if(!this.client.core.crypto.keychain.has(t)){const{message:e}=ic("MISSING_OR_INVALID","session topic does not exist in keychain: ".concat(t));throw await this.deleteSession({topic:t}),new Error(e)}}async isValidSessionOrPairingTopic(t){if(this.checkRecentlyDeleted(t),this.client.session.keys.includes(t))await this.isValidSessionTopic(t);else{if(!this.client.core.pairing.pairings.keys.includes(t)){if(cc(t,!1)){const{message:e}=ic("NO_MATCHING_KEY","session or pairing topic doesn't exist: ".concat(t));throw new Error(e)}{const{message:e}=ic("MISSING_OR_INVALID","session or pairing topic should be a string: ".concat(t));throw new Error(e)}}this.isValidPairingTopic(t)}}async isValidProposalId(t){if(!function(t){return"number"==typeof t}(t)){const{message:e}=ic("MISSING_OR_INVALID","proposal id should be a number: ".concat(t));throw new Error(e)}if(!this.client.proposal.keys.includes(t)){const{message:e}=ic("NO_MATCHING_KEY","proposal id doesn't exist: ".concat(t));throw new Error(e)}if(wr(this.client.proposal.get(t).expiryTimestamp)){await this.deleteProposal(t);const{message:e}=ic("EXPIRED","proposal id: ".concat(t));throw new Error(e)}}}class ag extends lp{constructor(t,e){super(t,e,"proposal",Up),this.core=t,this.logger=e}}class cg extends lp{constructor(t,e){super(t,e,"session",Up),this.core=t,this.logger=e}}class hg extends lp{constructor(t,e){super(t,e,"request",Up,(t=>t.id)),this.core=t,this.logger=e}}class ug extends lp{constructor(t,e){super(t,e,"authKeys",Yp,(()=>Qp)),this.core=t,this.logger=e}}class fg extends lp{constructor(t,e){super(t,e,"pairingTopics",Yp),this.core=t,this.logger=e}}class lg extends lp{constructor(t,e){super(t,e,"requests",Yp,(t=>t.id)),this.core=t,this.logger=e}}class dg{constructor(t,e){this.core=t,this.logger=e,this.authKeys=new ug(this.core,this.logger),this.pairingTopics=new fg(this.core,this.logger),this.requests=new lg(this.core,this.logger)}
2async init(){await this.authKeys.init(),await this.pairingTopics.init(),await this.requests.init()}}class pg extends Hh{constructor(t){super(t),this.protocol="wc",this.version=2,this.name=Bp,this.events=new v.EventEmitter,this.on=(t,e)=>this.events.on(t,e),this.once=(t,e)=>this.events.once(t,e),this.off=(t,e)=>this.events.off(t,e),this.removeListener=(t,e)=>this.events.removeListener(t,e),this.removeAllListeners=t=>this.events.removeAllListeners(t),this.connect=async t=>{try{return await this.engine.connect(t)}catch(Oc){throw this.logger.error(Oc.message),Oc}},this.pair=async t=>{try{return await this.engine.pair(t)}catch(Oc){throw this.logger.error(Oc.message),Oc}},this.approve=async t=>{try{return await this.engine.approve(t)}catch(Oc){throw this.logger.error(Oc.message),Oc}},this.reject=async t=>{try{return await this.engine.reject(t)}catch(Oc){throw this.logger.error(Oc.message),Oc}},this.update=async t=>{try{return await this.engine.update(t)}catch(Oc){throw this.logger.error(Oc.message),Oc}},this.extend=async t=>{try{return await this.engine.extend(t)}catch(Oc){throw this.logger.error(Oc.message),Oc}},this.request=async t=>{try{return await this.engine.request(t)}catch(Oc){throw this.logger.error(Oc.message),Oc}},this.respond=async t=>{try{return await this.engine.respond(t)}catch(Oc){throw this.logger.error(Oc.message),Oc}},this.ping=async t=>{try{return await this.engine.ping(t)}catch(Oc){throw this.logger.error(Oc.message),Oc}},this.emit=async t=>{try{return await this.engine.emit(t)}catch(Oc){throw this.logger.error(Oc.message),Oc}},this.disconnect=async t=>{try{return await this.engine.disconnect(t)}catch(Oc){throw this.logger.error(Oc.message),Oc}},this.find=t=>{try{return this.engine.find(t)}catch(Oc){throw this.logger.error(Oc.message),Oc}},this.getPendingSessionRequests=()=>{try{return this.engine.getPendingSessionRequests()}catch(t){throw this.logger.error(t.message),t}},this.authenticate=async(t,e)=>{try{return await this.engine.authenticate(t,e)}catch(Ih){throw this.logger.error(Ih.message),Ih}},this.formatAuthMessage=t=>{try{return this.engine.formatAuthMessage(t)}catch(Oc){throw this.logger.error(Oc.message),Oc}},this.approveSessionAuthenticate=async t=>{try{return await this.engine.approveSessionAuthenticate(t)}catch(Oc){throw this.logger.error(Oc.message),Oc}},this.rejectSessionAuthenticate=async t=>{try{return await this.engine.rejectSessionAuthenticate(t)}catch(Oc){throw this.logger.error(Oc.message),Oc}},this.name=(null===t||void 0===t?void 0:t.name)||Bp,this.metadata=(null===t||void 0===t?void 0:t.metadata)||hr(),this.signConfig=null===t||void 0===t?void 0:t.signConfig;const e=typeof(null===t||void 0===t?void 0:t.logger)<"u"&&"string"!=typeof(null===t||void 0===t?void 0:t.logger)?t.logger:uh()(Ph({level:(null===t||void 0===t?void 0:t.logger)||jp}));this.core=(null===t||void 0===t?void 0:t.core)||new qp(t),this.logger=Nh(e,this.name),this.session=new cg(this.core,this.logger),this.proposal=new ag(this.core,this.logger),this.pendingRequest=new hg(this.core,this.logger),this.engine=new og(this),this.auth=new dg(this.core,this.logger)}static async init(t){const e=new pg(t);return await e.initialize(),e}get context(){return Oh(this.logger)}get pairing(){return this.core.pairing.pairings}async initialize(){this.logger.trace("Initialized");try{await this.core.start(),await this.session.init(),await this.proposal.init(),await this.pendingRequest.init(),await this.auth.init(),await this.engine.init(),this.logger.info("SignClient Initialization Success"),this.engine.processRelayMessageCache()}catch(t){throw this.logger.info("SignClient Initialization Failure"),this.logger.error(t.message),t}}}var gg=r(6177),mg=r.n(gg),vg=Object.defineProperty,bg=Object.defineProperties,yg=Object.getOwnPropertyDescriptors,wg=Object.getOwnPropertySymbols,_g=Object.prototype.hasOwnProperty,Ag=Object.prototype.propertyIsEnumerable,Eg=(t,e,r)=>e in t?vg(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Sg=(t,e)=>{for(var r in e||(e={}))_g.call(e,r)&&Eg(t,r,e[r]);if(wg)for(var r of wg(e))Ag.call(e,r)&&Eg(t,r,e[r]);return t},Mg=(t,e)=>bg(t,yg(e));const Ig={headers:{Accept:"application/json","Content-Type":"application/json"},method:"POST"};class xg{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(this.url=t,this.disableProviderPing=e,this.events=new v.EventEmitter,this.isAvailable=!1,this.registering=!1,!gu(t))throw new Error("Provided URL is not compatible with HTTP connection: ".concat(t));this.url=t,this.disableProviderPing=e}get connected(){return this.isAvailable}get connecting(){return this.registering}on(t,e){this.events.on(t,e)}once(t,e){this.events.once(t,e)}off(t,e){this.events.off(t,e)}removeListener(t,e){this.events.removeListener(t,e)}async open(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.url;await this.register(t)}async close(){if(!this.isAvailable)throw new Error("Connection already closed");this.onClose()}async send(t){this.isAvailable||await this.register();try{const e=qe(t),r=await(await mg()(this.url,Mg(Sg({},Ig),{body:e}))).json();this.onPayload({data:r})}catch(e){this.onError(t.id,e)}}async register(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.url;if(!gu(t))throw new Error("Provided URL is not compatible with HTTP connection: ".concat(t));if(this.registering){const t=this.events.getMaxListeners();return(this.events.listenerCount("register_error")>=t||this.events.listenerCount("open")>=t)&&this.events.setMaxListeners(t+1),new Promise(((t,e)=>{this.events.once("register_error",(t=>{this.resetMaxListeners(),e(t)})),this.events.once("open",(()=>{if(this.resetMaxListeners(),typeof this.isAvailable>"u")return e(new Error("HTTP connection is missing or invalid"));t()}))}))}this.url=t,this.registering=!0;
2try{if(!this.disableProviderPing){const e=qe({id:1,jsonrpc:"2.0",method:"test",params:[]});await mg()(t,Mg(Sg({},Ig),{body:e}))}this.onOpen()}catch(e){const t=this.parseError(e);throw this.events.emit("register_error",t),this.onClose(),t}}onOpen(){this.isAvailable=!0,this.registering=!1,this.events.emit("open")}onClose(){this.isAvailable=!1,this.registering=!1,this.events.emit("close")}onPayload(t){if(typeof t.data>"u")return;const e="string"==typeof t.data?Le(t.data):t.data;this.events.emit("payload",e)}onError(t,e){const r=this.parseError(e),i=hu(t,r.message||r.toString());this.events.emit("payload",i)}parseError(t){return iu(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.url,"HTTP")}resetMaxListeners(){this.events.getMaxListeners()>10&&this.events.setMaxListeners(10)}}const Pg="error",Og="".concat("wc","@2:").concat("universal_provider",":"),Ng="https://rpc.walletconnect.org/v1/",Rg="generic",Cg="".concat(Ng,"bundler"),Tg="default_chain_changed";var kg=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof r.g<"u"?r.g:typeof self<"u"?self:{},Lg={exports:{}};!function(t,e){(function(){var r,i="Expected a function",n="__lodash_hash_undefined__",s="__lodash_placeholder__",o=16,a=32,c=64,h=128,u=256,f=1/0,l=9007199254740991,d=NaN,p=4294967295,g=p-1,m=p>>>1,v=[["ary",h],["bind",1],["bindKey",2],["curry",8],["curryRight",o],["flip",512],["partial",a],["partialRight",c],["rearg",u]],b="[object Arguments]",y="[object Array]",w="[object Boolean]",_="[object Date]",A="[object Error]",E="[object Function]",S="[object GeneratorFunction]",M="[object Map]",I="[object Number]",x="[object Object]",P="[object Promise]",O="[object RegExp]",N="[object Set]",R="[object String]",C="[object Symbol]",T="[object WeakMap]",k="[object ArrayBuffer]",L="[object DataView]",q="[object Float32Array]",D="[object Float64Array]",U="[object Int8Array]",B="[object Int16Array]",j="[object Int32Array]",z="[object Uint8Array]",F="[object Uint8ClampedArray]",H="[object Uint16Array]",K="[object Uint32Array]",V=/\b__p \+= '';/g,W=/\b(__p \+=) '' \+/g,G=/(__e\(.*?\)|\b__t\)) \+\n'';/g,J=/&(?:amp|lt|gt|quot|#39);/g,Y=/[&<>"']/g,Q=RegExp(J.source),X=RegExp(Y.source),Z=/<%-([\s\S]+?)%>/g,$=/<%([\s\S]+?)%>/g,tt=/<%=([\s\S]+?)%>/g,et=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,rt=/^\w*$/,it=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,nt=/[\\^$.*+?()[\]{}|]/g,st=RegExp(nt.source),ot=/^\s+/,at=/\s/,ct=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,ht=/\{\n\/\* \[wrapped with (.+)\] \*/,ut=/,? & /,ft=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,lt=/[()=,{}\[\]\/\s]/,dt=/\\(\\)?/g,pt=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,gt=/\w*$/,mt=/^[-+]0x[0-9a-f]+$/i,vt=/^0b[01]+$/i,bt=/^\[object .+?Constructor\]$/,yt=/^0o[0-7]+$/i,wt=/^(?:0|[1-9]\d*)$/,_t=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u01
vendor: 4,534 bytes, line 2
27f]/g,At=/($^)/,Et=/['\n\r\u2028\u2029\\]/g,St="\\ud800-\\udfff",Mt="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",It="\\u2700-\\u27bf",xt="a-z\\xdf-\\xf6\\xf8-\\xff",Pt="A-Z\\xc0-\\xd6\\xd8-\\xde",Ot="\\ufe0e\\ufe0f",Nt="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Rt="['\u2019]",Ct="["+St+"]",Tt="["+Nt+"]",kt="["+Mt+"]",Lt="\\d+",qt="["+It+"]",Dt="["+xt+"]",Ut="[^"+St+Nt+Lt+It+xt+Pt+"]",Bt="\\ud83c[\\udffb-\\udfff]",jt="[^"+St+"]",zt="(?:\\ud83c[\\udde6-\\uddff]){2}",Ft="[\\ud800-\\udbff][\\udc00-\\udfff]",Ht="["+Pt+"]",Kt="\\u200d",Vt="(?:"+Dt+"|"+Ut+")",Wt="(?:"+Ht+"|"+Ut+")",Gt="(?:['\u2019](?:d|ll|m|re|s|t|ve))?",Jt="(?:['\u2019](?:D|LL|M|RE|S|T|VE))?",Yt="(?:"+kt+"|"+Bt+")"+"?",Qt="["+Ot+"]?",Xt=Qt+Yt+("(?:"+Kt+"(?:"+[jt,zt,Ft].join("|")+")"+Qt+Yt+")*"),Zt="(?:"+[qt,zt,Ft].join("|")+")"+Xt,$t="(?:"+[jt+kt+"?",kt,zt,Ft,Ct].join("|")+")",te=RegExp(Rt,"g"),ee=RegExp(kt,"g"),re=RegExp(Bt+"(?="+Bt+")|"+$t+Xt,"g"),ie=RegExp([Ht+"?"+Dt+"+"+Gt+"(?="+[Tt,Ht,"$"].join("|")+")",Wt+"+"+Jt+"(?="+[Tt,Ht+Vt,"$"].join("|")+")",Ht+"?"+Vt+"+"+Gt,Ht+"+"+Jt,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Lt,Zt].join("|"),"g"),ne=RegExp("["+Kt+St+Mt+Ot+"]"),se=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,oe=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],ae=-1,ce={};ce[q]=ce[D]=ce[U]=ce[B]=ce[j]=ce[z]=ce[F]=ce[H]=ce[K]=!0,ce[b]=ce[y]=ce[k]=ce[w]=ce[L]=ce[_]=ce[A]=ce[E]=ce[M]=ce[I]=ce[x]=ce[O]=ce[N]=ce[R]=ce[T]=!1;var he={};he[b]=he[y]=he[k]=he[L]=he[w]=he[_]=he[q]=he[D]=he[U]=he[B]=he[j]=he[M]=he[I]=he[x]=he[O]=he[N]=he[R]=he[C]=he[z]=he[F]=he[H]=he[K]=!0,he[A]=he[E]=he[T]=!1;var ue={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},fe=parseFloat,le=parseInt,de="object"==typeof kg&&kg&&kg.Object===Object&&kg,pe="object"==typeof self&&self&&self.Object===Object&&self,ge=de||pe||Function("return this")(),me=e&&!e.nodeType&&e,ve=me&&t&&!t.nodeType&&t,be=ve&&ve.exports===me,ye=be&&de.process,we=function(){try{return ve&&ve.require&&ve.require("util").types||ye&&ye.binding&&ye.binding("util")}catch(t){}}(),_e=we&&we.isArrayBuffer,Ae=we&&we.isDate,Ee=we&&we.isMap,Se=we&&we.isRegExp,Me=we&&we.isSet,Ie=we&&we.isTypedArray;function xe(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}function Pe(t,e,r,i){for(var n=-1,s=null==t?0:t.length;++n<s;){var o=t[n];e(i,o,r(o),t)}return i}function Oe(t,e){for(var r=-1,i=null==t?0:t.length;++r<i&&!1!==e(t[r],r,t););return t}function Ne(t,e){for(var r=null==t?0:t.length;r--&&!1!==e(t[r],r,t););return t}function Re(t,e){for(var r=-1,i=null==t?0:t.length;++r<i;)if(!e(t[r],r,t))return!1;return!0}function Ce(t,e){for(var r=-1,i=null==t?0:t.length,n=0,s=[];++r<i;){var o=t[r];e(o,r,t)&&(s[n++]=o)}return s}function Te(t,e){return!!(null==t?0:t.length)&&He(t,e,0)>-1}function ke(t,e,r){for(var i=-1,n=null==t?0:t.length;++i<n;)if(r(e,t[i]))return!0;return!1}function Le(t,e){for(var r=-1,i=null==t?0:t.length,n=Array(i);++r<i;)n[r]=e(t[r],r,t);return n}function qe(t,e){for(var r=-1,i=e.length,n=t.length;++r<i;)t[n+r]=e[r];return t}function De(t,e,r,i){var n=-1,s=null==t?0:t.length;for(i&&s&&(r=t[++n]);++n<s;)r=e(r,t[n],n,t);return r}function Ue(t,e,r,i){var n=null==t?0:t.length;for(i&&n&&(r=t[--n]);n--;)r=e(r,t[n],n,t);return r}function Be(t,e){for(var r=-1,i=null==t?0:t.length;++r<i;)if(e(t[r],r,t))return!0;return!1}var je=Ge("length");function ze(t,e,r){var i;return r(t,(function(t,r,n){if(e(t,r,n))return i=r,!1})),i}function Fe(t,e,r,i){for(var n=t.length,s=r+(i?1:-1);i?s--:++s<n;)if(e(t[s],s,t))return s;return-1}function He(t,e,r){return e===e?function(t,e,r){for(var i=r-1,n=t.length;++i<n;)if(t[i]===e)return i;return-1}(t,e,r):Fe(t,Ve,r)}function Ke(t,e,r,i){for(var n=r-1,s=t.length;++n<s;)if(i(t[n],e))return n;return-1}function Ve(t){return t!==t}function We(t,e){var r=null==t?0:t.length;return r?Qe(t,e)/r:d}function Ge(t){return function(e){return null==e?r:e[t]}
vendor: 4,198 bytes, line 2
2}function Je(t){return function(e){return null==t?r:t[e]}}function Ye(t,e,r,i,n){return n(t,(function(t,n,s){r=i?(i=!1,t):e(r,t,n,s)})),r}function Qe(t,e){for(var i,n=-1,s=t.length;++n<s;){var o=e(t[n]);o!==r&&(i=i===r?o:i+o)}return i}function Xe(t,e){for(var r=-1,i=Array(t);++r<t;)i[r]=e(r);return i}function Ze(t){return t&&t.slice(0,pr(t)+1).replace(ot,"")}function $e(t){return function(e){return t(e)}}function tr(t,e){return Le(e,(function(e){return t[e]}))}function er(t,e){return t.has(e)}function rr(t,e){for(var r=-1,i=t.length;++r<i&&He(e,t[r],0)>-1;);return r}function ir(t,e){for(var r=t.length;r--&&He(e,t[r],0)>-1;);return r}var nr=Je({"\xc0":"A","\xc1":"A","\xc2":"A","\xc3":"A","\xc4":"A","\xc5":"A","\xe0":"a","\xe1":"a","\xe2":"a","\xe3":"a","\xe4":"a","\xe5":"a","\xc7":"C","\xe7":"c","\xd0":"D","\xf0":"d","\xc8":"E","\xc9":"E","\xca":"E","\xcb":"E","\xe8":"e","\xe9":"e","\xea":"e","\xeb":"e","\xcc":"I","\xcd":"I","\xce":"I","\xcf":"I","\xec":"i","\xed":"i","\xee":"i","\xef":"i","\xd1":"N","\xf1":"n","\xd2":"O","\xd3":"O","\xd4":"O","\xd5":"O","\xd6":"O","\xd8":"O","\xf2":"o","\xf3":"o","\xf4":"o","\xf5":"o","\xf6":"o","\xf8":"o","\xd9":"U","\xda":"U","\xdb":"U","\xdc":"U","\xf9":"u","\xfa":"u","\xfb":"u","\xfc":"u","\xdd":"Y","\xfd":"y","\xff":"y","\xc6":"Ae","\xe6":"ae","\xde":"Th","\xfe":"th","\xdf":"ss","\u0100":"A","\u0102":"A","\u0104":"A","\u0101":"a","\u0103":"a","\u0105":"a","\u0106":"C","\u0108":"C","\u010a":"C","\u010c":"C","\u0107":"c","\u0109":"c","\u010b":"c","\u010d":"c","\u010e":"D","\u0110":"D","\u010f":"d","\u0111":"d","\u0112":"E","\u0114":"E","\u0116":"E","\u0118":"E","\u011a":"E","\u0113":"e","\u0115":"e","\u0117":"e","\u0119":"e","\u011b":"e","\u011c":"G","\u011e":"G","\u0120":"G","\u0122":"G","\u011d":"g","\u011f":"g","\u0121":"g","\u0123":"g","\u0124":"H","\u0126":"H","\u0125":"h","\u0127":"h","\u0128":"I","\u012a":"I","\u012c":"I","\u012e":"I","\u0130":"I","\u0129":"i","\u012b":"i","\u012d":"i","\u012f":"i","\u0131":"i","\u0134":"J","\u0135":"j","\u0136":"K","\u0137":"k","\u0138":"k","\u0139":"L","\u013b":"L","\u013d":"L","\u013f":"L","\u0141":"L","\u013a":"l","\u013c":"l","\u013e":"l","\u0140":"l","\u0142":"l","\u0143":"N","\u0145":"N","\u0147":"N","\u014a":"N","\u0144":"n","\u0146":"n","\u0148":"n","\u014b":"n","\u014c":"O","\u014e":"O","\u0150":"O","\u014d":"o","\u014f":"o","\u0151":"o","\u0154":"R","\u0156":"R","\u0158":"R","\u0155":"r","\u0157":"r","\u0159":"r","\u015a":"S","\u015c":"S","\u015e":"S","\u0160":"S","\u015b":"s","\u015d":"s","\u015f":"s","\u0161":"s","\u0162":"T","\u0164":"T","\u0166":"T","\u0163":"t","\u0165":"t","\u0167":"t","\u0168":"U","\u016a":"U","\u016c":"U","\u016e":"U","\u0170":"U","\u0172":"U","\u0169":"u","\u016b":"u","\u016d":"u","\u016f":"u","\u0171":"u","\u0173":"u","\u0174":"W","\u0175":"w","\u0176":"Y","\u0177":"y","\u0178":"Y","\u0179":"Z","\u017b":"Z","\u017d":"Z","\u017a":"z","\u017c":"z","\u017e":"z","\u0132":"IJ","\u0133":"ij","\u0152":"Oe","\u0153":"oe","\u0149":"'n","\u017f":"s"}),sr=Je({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"});function or(t){return"\\"+ue[t]}function ar(t){return ne.test(t)}function cr(t){var e=-1,r=Array(t.size);return t.forEach((function(t,i){r[++e]=[i,t]})),r}function hr(t,e){return function(r){return t(e(r))}}function ur(t,e){for(var r=-1,i=t.length,n=0,o=[];++r<i;){var a=t[r];(a===e||a===s)&&(t[r]=s,o[n++]=r)}return o}function fr(t){var e=-1,r=Array(t.size);return t.forEach((function(t){r[++e]=t})),r}function lr(t){return ar(t)?function(t){for(var e=re.lastIndex=0;re.test(t);)++e;return e}(t):je(t)}function dr(t){return ar(t)?function(t){return t.match(re)||[]}(t):function(t){return t.split("")}(t)}function pr(t){for(var e=t.length;e--&&at.test(t.charAt(e)););return e}var gr=Je({"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"});var mr=function t(e){var at=(e=null==e?ge:mr.defaults(ge.Object(),e,mr.pick(ge,oe))).Array,St=e.Date,Mt=e.Error,It=e.Function,xt=e.Math,Pt=e.Object,Ot=e.RegExp,Nt=e.String,Rt=e.TypeError,Ct=at.prototype,Tt=It.prototype,kt=Pt.prototype,Lt=e["__core-js_shared__"],qt=Tt.toString,Dt=kt.hasOwnProperty,Ut=0,Bt=function(){var t=/[^.]+$/.exec(Lt&&Lt.keys&&Lt.keys.IE_PROTO||"");
vendor: 3,207 bytes, line 2
2return t?"Symbol(src)_1."+t:""}(),jt=kt.toString,zt=qt.call(Pt),Ft=ge._,Ht=Ot("^"+qt.call(Dt).replace(nt,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Kt=be?e.Buffer:r,Vt=e.Symbol,Wt=e.Uint8Array,Gt=Kt?Kt.allocUnsafe:r,Jt=hr(Pt.getPrototypeOf,Pt),Yt=Pt.create,Qt=kt.propertyIsEnumerable,Xt=Ct.splice,Zt=Vt?Vt.isConcatSpreadable:r,$t=Vt?Vt.iterator:r,re=Vt?Vt.toStringTag:r,ne=function(){try{var t=ls(Pt,"defineProperty");return t({},"",{}),t}catch(e){}}(),ue=e.clearTimeout!==ge.clearTimeout&&e.clearTimeout,de=St&&St.now!==ge.Date.now&&St.now,pe=e.setTimeout!==ge.setTimeout&&e.setTimeout,me=xt.ceil,ve=xt.floor,ye=Pt.getOwnPropertySymbols,we=Kt?Kt.isBuffer:r,je=e.isFinite,Je=Ct.join,vr=hr(Pt.keys,Pt),br=xt.max,yr=xt.min,wr=St.now,_r=e.parseInt,Ar=xt.random,Er=Ct.reverse,Sr=ls(e,"DataView"),Mr=ls(e,"Map"),Ir=ls(e,"Promise"),xr=ls(e,"Set"),Pr=ls(e,"WeakMap"),Or=ls(Pt,"create"),Nr=Pr&&new Pr,Rr={},Cr=Us(Sr),Tr=Us(Mr),kr=Us(Ir),Lr=Us(xr),qr=Us(Pr),Dr=Vt?Vt.prototype:r,Ur=Dr?Dr.valueOf:r,Br=Dr?Dr.toString:r;function jr(t){if(ra(t)&&!Vo(t)&&!(t instanceof Kr)){if(t instanceof Hr)return t;if(Dt.call(t,"__wrapped__"))return Bs(t)}return new Hr(t)}var zr=function(){function t(){}return function(e){if(!ea(e))return{};if(Yt)return Yt(e);t.prototype=e;var i=new t;return t.prototype=r,i}}();function Fr(){}function Hr(t,e){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!e,this.__index__=0,this.__values__=r}function Kr(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=p,this.__views__=[]}function Vr(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var i=t[e];this.set(i[0],i[1])}}function Wr(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var i=t[e];this.set(i[0],i[1])}}function Gr(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var i=t[e];this.set(i[0],i[1])}}function Jr(t){var e=-1,r=null==t?0:t.length;for(this.__data__=new Gr;++e<r;)this.add(t[e])}function Yr(t){var e=this.__data__=new Wr(t);this.size=e.size}function Qr(t,e){var r=Vo(t),i=!r&&Ko(t),n=!r&&!i&&Yo(t),s=!r&&!i&&!n&&ua(t),o=r||i||n||s,a=o?Xe(t.length,Nt):[],c=a.length;for(var h in t)(e||Dt.call(t,h))&&(!o||!("length"==h||n&&("offset"==h||"parent"==h)||s&&("buffer"==h||"byteLength"==h||"byteOffset"==h)||ys(h,c)))&&a.push(h);return a}function Xr(t){var e=t.length;return e?t[Ji(0,e-1)]:r}function Zr(t,e){return Ls(Nn(t),ai(e,0,t.length))}function $r(t){return Ls(Nn(t))}function ti(t,e,i){(i!==r&&!zo(t[e],i)||i===r&&!(e in t))&&si(t,e,i)}function ei(t,e,i){var n=t[e];(!Dt.call(t,e)||!zo(n,i)||i===r&&!(e in t))&&si(t,e,i)}function ri(t,e){for(var r=t.length;r--;)if(zo(t[r][0],e))return r;return-1}function ii(t,e,r,i){return li(t,(function(t,n,s){e(i,t,r(t),s)})),i}function ni(t,e){return t&&Rn(e,Ca(e),t)}function si(t,e,r){"__proto__"==e&&ne?ne(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}function oi(t,e){for(var i=-1,n=e.length,s=at(n),o=null==t;++i<n;)s[i]=o?r:xa(t,e[i]);return s}function ai(t,e,i){return t===t&&(i!==r&&(t=t<=i?t:i),e!==r&&(t=t>=e?t:e)),t}function ci(t,e,i,n,s,o){var a,c=1&e,h=2&e,u=4&e;if(i&&(a=s?i(t,n,s,o):i(t)),a!==r)return a;
vendor: 12,937 bytes, line 2
2if(!ea(t))return t;var f=Vo(t);if(f){if(a=function(t){var e=t.length,r=new t.constructor(e);return e&&"string"==typeof t[0]&&Dt.call(t,"index")&&(r.index=t.index,r.input=t.input),r}(t),!c)return Nn(t,a)}else{var l=gs(t),d=l==E||l==S;if(Yo(t))return Sn(t,c);if(l==x||l==b||d&&!s){if(a=h||d?{}:vs(t),!c)return h?function(t,e){return Rn(t,ps(t),e)}(t,function(t,e){return t&&Rn(e,Ta(e),t)}(a,t)):function(t,e){return Rn(t,ds(t),e)}(t,ni(a,t))}else{if(!he[l])return s?t:{};a=function(t,e,r){var i=t.constructor;switch(e){case k:return Mn(t);case w:case _:return new i(+t);case L:return function(t,e){var r=e?Mn(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)}(t,r);case q:case D:case U:case B:case j:case z:case F:case H:case K:return In(t,r);case M:return new i;case I:case R:return new i(t);case O:return function(t){var e=new t.constructor(t.source,gt.exec(t));return e.lastIndex=t.lastIndex,e}(t);case N:return new i;case C:return function(t){return Ur?Pt(Ur.call(t)):{}}(t)}}(t,l,c)}}o||(o=new Yr);var p=o.get(t);if(p)return p;o.set(t,a),aa(t)?t.forEach((function(r){a.add(ci(r,e,i,r,t,o))})):ia(t)&&t.forEach((function(r,n){a.set(n,ci(r,e,i,n,t,o))}));var g=f?r:(u?h?ss:ns:h?Ta:Ca)(t);return Oe(g||t,(function(r,n){g&&(r=t[n=r]),ei(a,n,ci(r,e,i,n,t,o))})),a}function hi(t,e,i){var n=i.length;if(null==t)return!n;for(t=Pt(t);n--;){var s=i[n],o=e[s],a=t[s];if(a===r&&!(s in t)||!o(a))return!1}return!0}function ui(t,e,n){if("function"!=typeof t)throw new Rt(i);return Rs((function(){t.apply(r,n)}),e)}function fi(t,e,r,i){var n=-1,s=Te,o=!0,a=t.length,c=[],h=e.length;if(!a)return c;r&&(e=Le(e,$e(r))),i?(s=ke,o=!1):e.length>=200&&(s=er,o=!1,e=new Jr(e));t:for(;++n<a;){var u=t[n],f=null==r?u:r(u);if(u=i||0!==u?u:0,o&&f===f){for(var l=h;l--;)if(e[l]===f)continue t;c.push(u)}else s(e,f,i)||c.push(u)}return c}jr.templateSettings={escape:Z,evaluate:$,interpolate:tt,variable:"",imports:{_:jr}},jr.prototype=Fr.prototype,jr.prototype.constructor=jr,Hr.prototype=zr(Fr.prototype),Hr.prototype.constructor=Hr,Kr.prototype=zr(Fr.prototype),Kr.prototype.constructor=Kr,Vr.prototype.clear=function(){this.__data__=Or?Or(null):{},this.size=0},Vr.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},Vr.prototype.get=function(t){var e=this.__data__;if(Or){var i=e[t];return i===n?r:i}return Dt.call(e,t)?e[t]:r},Vr.prototype.has=function(t){var e=this.__data__;return Or?e[t]!==r:Dt.call(e,t)},Vr.prototype.set=function(t,e){var i=this.__data__;return this.size+=this.has(t)?0:1,i[t]=Or&&e===r?n:e,this},Wr.prototype.clear=function(){this.__data__=[],this.size=0},Wr.prototype.delete=function(t){var e=this.__data__,r=ri(e,t);return!(r<0)&&(r==e.length-1?e.pop():Xt.call(e,r,1),--this.size,!0)},Wr.prototype.get=function(t){var e=this.__data__,i=ri(e,t);return i<0?r:e[i][1]},Wr.prototype.has=function(t){return ri(this.__data__,t)>-1},Wr.prototype.set=function(t,e){var r=this.__data__,i=ri(r,t);return i<0?(++this.size,r.push([t,e])):r[i][1]=e,this},Gr.prototype.clear=function(){this.size=0,this.__data__={hash:new Vr,map:new(Mr||Wr),string:new Vr}},Gr.prototype.delete=function(t){var e=us(this,t).delete(t);return this.size-=e?1:0,e},Gr.prototype.get=function(t){return us(this,t).get(t)},Gr.prototype.has=function(t){return us(this,t).has(t)},Gr.prototype.set=function(t,e){var r=us(this,t),i=r.size;return r.set(t,e),this.size+=r.size==i?0:1,this},Jr.prototype.add=Jr.prototype.push=function(t){return this.__data__.set(t,n),this},Jr.prototype.has=function(t){return this.__data__.has(t)},Yr.prototype.clear=function(){this.__data__=new Wr,this.size=0},Yr.prototype.delete=function(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r},Yr.prototype.get=function(t){return this.__data__.get(t)},Yr.prototype.has=function(t){return this.__data__.has(t)},Yr.prototype.set=function(t,e){var r=this.__data__;if(r instanceof Wr){var i=r.__data__;if(!Mr||i.length<199)return i.push([t,e]),this.size=++r.size,this;r=this.__data__=new Gr(i)}return r.set(t,e),this.size=r.size,this};var li=kn(wi),di=kn(_i,!0);function pi(t,e){var r=!0;return li(t,(function(t,i,n){return r=!!e(t,i,n)})),r}function gi(t,e,i){for(var n=-1,s=t.length;++n<s;){var o=t[n],a=e(o);if(null!=a&&(c===r?a===a&&!ha(a):i(a,c)))var c=a,h=o}return h}function mi(t,e){var r=[];return li(t,(function(t,i,n){e(t,i,n)&&r.push(t)})),r}function vi(t,e,r,i,n){var s=-1,o=t.length;for(r||(r=bs),n||(n=[]);++s<o;){var a=t[s];e>0&&r(a)?e>1?vi(a,e-1,r,i,n):qe(n,a):i||(n[n.length]=a)}return n}var bi=Ln(),yi=Ln(!0);function wi(t,e){return t&&bi(t,e,Ca)}function _i(t,e){return t&&yi(t,e,Ca)}function Ai(t,e){return Ce(e,(function(e){return Zo(t[e])}))}function Ei(t,e){for(var i=0,n=(e=wn(e,t)).length;null!=t&&i<n;)t=t[Ds(e[i++])];return i&&i==n?t:r}function Si(t,e,r){var i=e(t);return Vo(t)?i:qe(i,r(t))}function Mi(t){return null==t?t===r?"[object Undefined]":"[object Null]":re&&re in Pt(t)?function(t){var e=Dt.call(t,re),i=t[re];try{t[re]=r;var n=!0}catch(o){}var s=jt.call(t);return n&&(e?t[re]=i:delete t[re]),s}(t):function(t){return jt.call(t)}(t)}function Ii(t,e){return t>e}function xi(t,e){return null!=t&&Dt.call(t,e)}function Pi(t,e){return null!=t&&e in Pt(t)}function Oi(t,e,i){for(var n=i?ke:Te,s=t[0].length,o=t.length,a=o,c=at(o),h=1/0,u=[];a--;){var f=t[a];a&&e&&(f=Le(f,$e(e))),h=yr(f.length,h),c[a]=!i&&(e||s>=120&&f.length>=120)?new Jr(a&&f):r}f=t[0];var l=-1,d=c[0];t:for(;++l<s&&u.length<h;){var p=f[l],g=e?e(p):p;if(p=i||0!==p?p:0,!(d?er(d,g):n(u,g,i))){for(a=o;--a;){var m=c[a];if(!(m?er(m,g):n(t[a],g,i)))continue t}d&&d.push(g),u.push(p)}}return u}function Ni(t,e,i){var n=null==(t=Ps(t,e=wn(e,t)))?t:t[Ds(Qs(e))];return null==n?r:xe(n,t,i)}function Ri(t){return ra(t)&&Mi(t)==b}function Ci(t,e,i,n,s){return t===e||(null==t||null==e||!ra(t)&&!ra(e)?t!==t&&e!==e:function(t,e,i,n,s,o){var a=Vo(t),c=Vo(e),h=a?y:gs(t),u=c?y:gs(e);h=h==b?x:h,u=u==b?x:u;var f=h==x,l=u==x,d=h==u;if(d&&Yo(t)){if(!Yo(e))return!1;a=!0,f=!1}if(d&&!f)return o||(o=new Yr),a||ua(t)?rs(t,e,i,n,s,o):function(t,e,r,i,n,s,o){switch(r){case L:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case k:return!(t.byteLength!=e.byteLength||!s(new Wt(t),new Wt(e)));case w:case _:case I:return zo(+t,+e);case A:return t.name==e.name&&t.message==e.message;case O:case R:return t==e+"";case M:var a=cr;case N:var c=1&i;if(a||(a=fr),t.size!=e.size&&!c)return!1;var h=o.get(t);if(h)return h==e;i|=2,o.set(t,e);var u=rs(a(t),a(e),i,n,s,o);return o.delete(t),u;case C:if(Ur)return Ur.call(t)==Ur.call(e)}return!1}(t,e,h,i,n,s,o);if(!(1&i)){var p=f&&Dt.call(t,"__wrapped__"),g=l&&Dt.call(e,"__wrapped__");if(p||g){var m=p?t.value():t,v=g?e.value():e;return o||(o=new Yr),s(m,v,i,n,o)}}return!!d&&(o||(o=new Yr),function(t,e,i,n,s,o){var a=1&i,c=ns(t),h=c.length,u=ns(e),f=u.length;if(h!=f&&!a)return!1;for(var l=h;l--;){var d=c[l];if(!(a?d in e:Dt.call(e,d)))return!1}var p=o.get(t),g=o.get(e);if(p&&g)return p==e&&g==t;var m=!0;o.set(t,e),o.set(e,t);for(var v=a;++l<h;){var b=t[d=c[l]],y=e[d];if(n)var w=a?n(y,b,d,e,t,o):n(b,y,d,t,e,o);if(!(w===r?b===y||s(b,y,i,n,o):w)){m=!1;break}v||(v="constructor"==d)}if(m&&!v){var _=t.constructor,A=e.constructor;_!=A&&"constructor"in t&&"constructor"in e&&!("function"==typeof _&&_ instanceof _&&"function"==typeof A&&A instanceof A)&&(m=!1)}return o.delete(t),o.delete(e),m}(t,e,i,n,s,o))}(t,e,i,n,Ci,s))}function Ti(t,e,i,n){var s=i.length,o=s,a=!n;if(null==t)return!o;for(t=Pt(t);s--;){var c=i[s];if(a&&c[2]?c[1]!==t[c[0]]:!(c[0]in t))return!1}for(;++s<o;){var h=(c=i[s])[0],u=t[h],f=c[1];if(a&&c[2]){if(u===r&&!(h in t))return!1}else{var l=new Yr;if(n)var d=n(u,f,h,t,e,l);if(!(d===r?Ci(f,u,3,n,l):d))return!1}}return!0}function ki(t){return!(!ea(t)||function(t){return!!Bt&&Bt in t}(t))&&(Zo(t)?Ht:bt).test(Us(t))}function Li(t){return"function"==typeof t?t:null==t?nc:"object"==typeof t?Vo(t)?zi(t[0],t[1]):ji(t):dc(t)}function qi(t){if(!Ss(t))return vr(t);var e=[];for(var r in Pt(t))Dt.call(t,r)&&"constructor"!=r&&e.push(r);return e}function Di(t){if(!ea(t))return function(t){var e=[];if(null!=t)for(var r in Pt(t))e.push(r);return e}(t);var e=Ss(t),r=[];for(var i in t)"constructor"==i&&(e||!Dt.call(t,i))||r.push(i);return r}function Ui(t,e){return t<e}function Bi(t,e){var r=-1,i=Go(t)?at(t.length):[];return li(t,(function(t,n,s){i[++r]=e(t,n,s)})),i}function ji(t){var e=fs(t);return 1==e.length&&e[0][2]?Is(e[0][0],e[0][1]):function(r){return r===t||Ti(r,t,e)}}function zi(t,e){return _s(t)&&Ms(e)?Is(Ds(t),e):function(i){var n=xa(i,t);return n===r&&n===e?Pa(i,t):Ci(e,n,3)}}function Fi(t,e,i,n,s){t!==e&&bi(e,(function(o,a){if(s||(s=new Yr),ea(o))!function(t,e,i,n,s,o,a){var c=Os(t,i),h=Os(e,i),u=a.get(h);if(u)return void ti(t,i,u);var f=o?o(c,h,i+"",t,e,a):r,l=f===r;if(l){var d=Vo(h),p=!d&&Yo(h),g=!d&&!p&&ua(h);f=h,d||p||g?Vo(c)?f=c:Jo(c)?f=Nn(c):p?(l=!1,f=Sn(h,!0)):g?(l=!1,f=In(h,!0)):f=[]:sa(h)||Ko(h)?(f=c,Ko(c)?f=ba(c):(!ea(c)||Zo(c))&&(f=vs(h))):l=!1}l&&(a.set(h,f),s(f,h,n,o,a),a.delete(h)),ti(t,i,f)}(t,e,a,i,Fi,n,s);else{var c=n?n(Os(t,a),o,a+"",t,e,s):r;c===r&&(c=o),ti(t,a,c)}}),Ta)}function Hi(t,e){var i=t.length;if(i)return ys(e+=e<0?i:0,i)?t[e]:r}function Ki(t,e,r){e=e.length?Le(e,(function(t){return Vo(t)?function(e){return Ei(e,1===t.length?t[0]:t)}:t})):[nc];var i=-1;e=Le(e,$e(hs()));var n=Bi(t,(function(t,r,n){var s=Le(e,(function(e){return e(t)}));return{criteria:s,index:++i,value:t}}));return function(t,e){var r=t.length;for(t.sort(e);r--;)t[r]=t[r].value;return t}(n,(function(t,e){return function(t,e,r){for(var i=-1,n=t.criteria,s=e.criteria,o=n.length,a=r.length;++i<o;){var c=xn(n[i],s[i]);if(c)return i>=a?c:c*("desc"==r[i]?-1:1)}return t.index-e.index}(t,e,r)}))}function Vi(t,e,r){for(var i=-1,n=e.length,s={};++i<n;){var o=e[i],a=Ei(t,o);r(a,o)&&$i(s,wn(o,t),a)}return s}function Wi(t,e,r,i){var n=i?Ke:He,s=-1,o=e.length,a=t;for(t===e&&(e=Nn(e)),r&&(a=Le(t,$e(r)));++s<o;)for(var c=0,h=e[s],u=r?r(h):h;(c=n(a,u,c,i))>-1;)a!==t&&Xt.call(a,c,1),Xt.call(t,c,1);return t}function Gi(t,e){for(var r=t?e.length:0,i=r-1;r--;){var n=e[r];if(r==i||n!==s){var s=n;ys(n)?Xt.call(t,n,1):ln(t,n)}}return t}function Ji(t,e){return t+ve(Ar()*(e-t+1))}function Yi(t,e){var r="";if(!t||e<1||e>l)return r;do{e%2&&(r+=t),(e=ve(e/2))&&(t+=t)}while(e);return r}function Qi(t,e){return Cs(xs(t,e,nc),t+"")}function Xi(t){return Xr(za(t))}function Zi(t,e){var r=za(t);return Ls(r,ai(e,0,r.length))}function $i(t,e,i,n){if(!ea(t))return t;for(var s=-1,o=(e=wn(e,t)).length,a=o-1,c=t;null!=c&&++s<o;){var h=Ds(e[s]),u=i;if("__proto__"===h||"constructor"===h||"prototype"===h)return t;if(s!=a){var f=c[h];(u=n?n(f,h,c):r)===r&&(u=ea(f)?f:ys(e[s+1])?[]:{})}ei(c,h,u),c=c[h]}return t}var tn=Nr?function(t,e){return Nr.set(t,e),t}:nc,en=ne?function(t,e){return ne(t,"toString",{configurable:!0,enumerable:!1,value:ec(e),writable:!0})}:nc;function rn(t){return Ls(za(t))}function nn(t,e,r){var i=-1,n=t.length;e<0&&(e=-e>n?0:n+e),(r=r>n?n:r)<0&&(r+=n),n=e>r?0:r-e>>>0,e>>>=0;for(var s=at(n);++i<n;)s[i]=t[i+e];return s}function sn(t,e){var r;return li(t,(function(t,i,n){return!(r=e(t,i,n))})),!!r}function on(t,e,r){var i=0,n=null==t?i:t.length;if("number"==typeof e&&e===e&&n<=m){for(;i<n;){var s=i+n>>>1,o=t[s];null!==o&&!ha(o)&&(r?o<=e:o<e)?i=s+1:n=s}return n}return an(t,e,nc,r)}function an(t,e,i,n){var s=0,o=null==t?0:t.length;if(0===o)return 0;for(var a=(e=i(e))!==e,c=null===e,h=ha(e),u=e===r;s<o;){var f=ve((s+o)/2),l=i(t[f]),d=l!==r,p=null===l,m=l===l,v=ha(l);if(a)var b=n||m;else b=u?m&&(n||d):c?m&&d&&(n||!p):h?m&&d&&!p&&(n||!v):!p&&!v&&(n?l<=e:l<e);b?s=f+1:o=f}return yr(o,g)}function cn(t,e){for(var r=-1,i=t.length,n=0,s=[];++r<i;){var o=t[r],a=e?e(o):o;if(!r||!zo(a,c)){var c=a;s[n++]=0===o?0:o}}return s}function hn(t){return"number"==typeof t?t:ha(t)?d:+t}function un(t){if("string"==typeof t)return t;if(Vo(t))return Le(t,un)+"";if(ha(t))return Br?Br.call(t):"";var e=t+"";return"0"==e&&1/t==-f?"-0":e}function fn(t,e,r){var i=-1,n=Te,s=t.length,o=!0,a=[],c=a;if(r)o=!1,n=ke;else if(s>=200){var h=e?null:Qn(t);if(h)return fr(h);o=!1,n=er,c=new Jr}else c=e?[]:a;t:for(;++i<s;){var u=t[i],f=e?e(u):u;if(u=r||0!==u?u:0,o&&f===f){for(var l=c.length;l--;)if(c[l]===f)continue t;e&&c.push(f),a.push(u)}else n(c,f,r)||(c!==a&&c.push(f),a.push(u))}return a}function ln(t,e){return null==(t=Ps(t,e=wn(e,t)))||delete t[Ds(Qs(e))]}function dn(t,e,r,i){return $i(t,e,r(Ei(t,e)),i)}function pn(t,e,r,i){for(var n=t.length,s=i?n:-1;(i?s--:++s<n)&&e(t[s],s,t););return r?nn(t,i?0:s,i?s+1:n):nn(t,i?s+1:0,i?n:s)}function gn(t,e){var r=t;return r instanceof Kr&&(r=r.value()),De(e,(function(t,e){return e.func.apply(e.thisArg,qe([t],e.args))}),r)}function mn(t,e,r){var i=t.length;if(i<2)return i?fn(t[0]):[];for(var n=-1,s=at(i);++n<i;)for(var o=t[n],a=-1;++a<i;)a!=n&&(s[n]=fi(s[n]||o,t[a],e,r));return fn(vi(s,1),e,r)}function vn(t,e,i){for(var n=-1,s=t.length,o=e.length,a={};++n<s;){var c=n<o?e[n]:r;
vendor: 4,816 bytes, line 2
2i(a,t[n],c)}return a}function bn(t){return Jo(t)?t:[]}function yn(t){return"function"==typeof t?t:nc}function wn(t,e){return Vo(t)?t:_s(t,e)?[t]:qs(ya(t))}var _n=Qi;function An(t,e,i){var n=t.length;return i=i===r?n:i,!e&&i>=n?t:nn(t,e,i)}var En=ue||function(t){return ge.clearTimeout(t)};function Sn(t,e){if(e)return t.slice();var r=t.length,i=Gt?Gt(r):new t.constructor(r);return t.copy(i),i}function Mn(t){var e=new t.constructor(t.byteLength);return new Wt(e).set(new Wt(t)),e}function In(t,e){var r=e?Mn(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}function xn(t,e){if(t!==e){var i=t!==r,n=null===t,s=t===t,o=ha(t),a=e!==r,c=null===e,h=e===e,u=ha(e);if(!c&&!u&&!o&&t>e||o&&a&&h&&!c&&!u||n&&a&&h||!i&&h||!s)return 1;if(!n&&!o&&!u&&t<e||u&&i&&s&&!n&&!o||c&&i&&s||!a&&s||!h)return-1}return 0}function Pn(t,e,r,i){for(var n=-1,s=t.length,o=r.length,a=-1,c=e.length,h=br(s-o,0),u=at(c+h),f=!i;++a<c;)u[a]=e[a];for(;++n<o;)(f||n<s)&&(u[r[n]]=t[n]);for(;h--;)u[a++]=t[n++];return u}function On(t,e,r,i){for(var n=-1,s=t.length,o=-1,a=r.length,c=-1,h=e.length,u=br(s-a,0),f=at(u+h),l=!i;++n<u;)f[n]=t[n];for(var d=n;++c<h;)f[d+c]=e[c];for(;++o<a;)(l||n<s)&&(f[d+r[o]]=t[n++]);return f}function Nn(t,e){var r=-1,i=t.length;for(e||(e=at(i));++r<i;)e[r]=t[r];return e}function Rn(t,e,i,n){var s=!i;i||(i={});for(var o=-1,a=e.length;++o<a;){var c=e[o],h=n?n(i[c],t[c],c,i,t):r;h===r&&(h=t[c]),s?si(i,c,h):ei(i,c,h)}return i}function Cn(t,e){return function(r,i){var n=Vo(r)?Pe:ii,s=e?e():{};return n(r,t,hs(i,2),s)}}function Tn(t){return Qi((function(e,i){var n=-1,s=i.length,o=s>1?i[s-1]:r,a=s>2?i[2]:r;for(o=t.length>3&&"function"==typeof o?(s--,o):r,a&&ws(i[0],i[1],a)&&(o=s<3?r:o,s=1),e=Pt(e);++n<s;){var c=i[n];c&&t(e,c,n,o)}return e}))}function kn(t,e){return function(r,i){if(null==r)return r;if(!Go(r))return t(r,i);for(var n=r.length,s=e?n:-1,o=Pt(r);(e?s--:++s<n)&&!1!==i(o[s],s,o););return r}}function Ln(t){return function(e,r,i){for(var n=-1,s=Pt(e),o=i(e),a=o.length;a--;){var c=o[t?a:++n];if(!1===r(s[c],c,s))break}return e}}function qn(t){return function(e){var i=ar(e=ya(e))?dr(e):r,n=i?i[0]:e.charAt(0),s=i?An(i,1).join(""):e.slice(1);return n[t]()+s}}function Dn(t){return function(e){return De(Za(Ka(e).replace(te,"")),t,"")}}function Un(t){return function(){var e=arguments;switch(e.length){case 0:return new t;case 1:return new t(e[0]);case 2:return new t(e[0],e[1]);case 3:return new t(e[0],e[1],e[2]);case 4:return new t(e[0],e[1],e[2],e[3]);case 5:return new t(e[0],e[1],e[2],e[3],e[4]);case 6:return new t(e[0],e[1],e[2],e[3],e[4],e[5]);case 7:return new t(e[0],e[1],e[2],e[3],e[4],e[5],e[6])}var r=zr(t.prototype),i=t.apply(r,e);return ea(i)?i:r}}function Bn(t){return function(e,i,n){var s=Pt(e);if(!Go(e)){var o=hs(i,3);e=Ca(e),i=function(t){return o(s[t],t,s)}}var a=t(e,i,n);return a>-1?s[o?e[a]:a]:r}}function jn(t){return is((function(e){var n=e.length,s=n,o=Hr.prototype.thru;for(t&&e.reverse();s--;){var a=e[s];if("function"!=typeof a)throw new Rt(i);if(o&&!c&&"wrapper"==as(a))var c=new Hr([],!0)}for(s=c?s:n;++s<n;){var h=as(a=e[s]),u="wrapper"==h?os(a):r;c=u&&As(u[0])&&424==u[1]&&!u[4].length&&1==u[9]?c[as(u[0])].apply(c,u[3]):1==a.length&&As(a)?c[h]():c.thru(a)}return function(){var t=arguments,r=t[0];if(c&&1==t.length&&Vo(r))return c.plant(r).value();for(var i=0,s=n?e[i].apply(this,t):r;++i<n;)s=e[i].call(this,s);return s}}))}function zn(t,e,i,n,s,o,a,c,u,f){var l=e&h,d=1&e,p=2&e,g=24&e,m=512&e,v=p?r:Un(t);return function h(){for(var b=arguments.length,y=at(b),w=b;w--;)y[w]=arguments[w];if(g)var _=cs(h),A=function(t,e){for(var r=t.length,i=0;r--;)t[r]===e&&++i;return i}(y,_);if(n&&(y=Pn(y,n,s,g)),o&&(y=On(y,o,a,g)),b-=A,g&&b<f){var E=ur(y,_);return Jn(t,e,zn,h.placeholder,i,y,E,c,u,f-b)}var S=d?i:this,M=p?S[t]:t;return b=y.length,c?y=function(t,e){for(var i=t.length,n=yr(e.length,i),s=Nn(t);n--;){var o=e[n];t[n]=ys(o,i)?s[o]:r}return t}(y,c):m&&b>1&&y.reverse(),l&&u<b&&(y.length=u),this&&this!==ge&&this instanceof h&&(M=v||Un(M)),M.apply(S,y)}}function Fn(t,e){return function(r,i){return function(t,e,r,i){return wi(t,(function(t,n,s){e(i,r(t),n,s)})),i}(r,t,e(i),{})}}function Hn(t,e){return function(i,n){var s;if(i===r&&n===r)return e;if(i!==r&&(s=i),n!==r){if(s===r)return n;"string"==typeof i||"string"==typeof n?(i=un(i),n=un(n)):(i=hn(i),n=hn(n)),s=t(i,n)}return s}}function Kn(t){return is((function(e){return e=Le(e,$e(hs())),Qi((function(r){var i=this;return t(e,(function(t){return xe(t,i,r)}))}))}))}function Vn(t,e){var i=(e=e===r?" ":un(e)).length;if(i<2)return i?Yi(e,t):e;var n=Yi(e,me(t/lr(e)));return ar(e)?An(dr(n),0,t).join(""):n.slice(0,t)}function Wn(t){return function(e,i,n){return n&&"number"!=typeof n&&ws(e,i,n)&&(i=n=r),e=pa(e),i===r?(i=e,e=0):i=pa(i),function(t,e,r,i){for(var n=-1,s=br(me((e-t)/(r||1)),0),o=at
vendor: 5,587 bytes, line 2
2(s);s--;)o[i?s:++n]=t,t+=r;return o}(e,i,n=n===r?e<i?1:-1:pa(n),t)}}function Gn(t){return function(e,r){return"string"==typeof e&&"string"==typeof r||(e=va(e),r=va(r)),t(e,r)}}function Jn(t,e,i,n,s,o,h,u,f,l){var d=8&e;e|=d?a:c,4&(e&=~(d?c:a))||(e&=-4);var p=[t,e,s,d?o:r,d?h:r,d?r:o,d?r:h,u,f,l],g=i.apply(r,p);return As(t)&&Ns(g,p),g.placeholder=n,Ts(g,t,e)}function Yn(t){var e=xt[t];return function(t,r){if(t=va(t),(r=null==r?0:yr(ga(r),292))&&je(t)){var i=(ya(t)+"e").split("e");return+((i=(ya(e(i[0]+"e"+(+i[1]+r)))+"e").split("e"))[0]+"e"+(+i[1]-r))}return e(t)}}var Qn=xr&&1/fr(new xr([,-0]))[1]==f?function(t){return new xr(t)}:hc;function Xn(t){return function(e){var r=gs(e);return r==M?cr(e):r==N?function(t){var e=-1,r=Array(t.size);return t.forEach((function(t){r[++e]=[t,t]})),r}(e):function(t,e){return Le(e,(function(e){return[e,t[e]]}))}(e,t(e))}}function Zn(t,e,n,f,l,d,p,g){var m=2&e;if(!m&&"function"!=typeof t)throw new Rt(i);var v=f?f.length:0;if(v||(e&=-97,f=l=r),p=p===r?p:br(ga(p),0),g=g===r?g:ga(g),v-=l?l.length:0,e&c){var b=f,y=l;f=l=r}var w=m?r:os(t),_=[t,e,n,f,l,b,y,d,p,g];if(w&&function(t,e){var r=t[1],i=e[1],n=r|i,o=n<131,a=i==h&&8==r||i==h&&r==u&&t[7].length<=e[8]||384==i&&e[7].length<=e[8]&&8==r;if(!o&&!a)return t;1&i&&(t[2]=e[2],n|=1&r?0:4);var c=e[3];if(c){var f=t[3];t[3]=f?Pn(f,c,e[4]):c,t[4]=f?ur(t[3],s):e[4]}c=e[5],c&&(f=t[5],t[5]=f?On(f,c,e[6]):c,t[6]=f?ur(t[5],s):e[6]),c=e[7],c&&(t[7]=c),i&h&&(t[8]=null==t[8]?e[8]:yr(t[8],e[8])),null==t[9]&&(t[9]=e[9]),t[0]=e[0],t[1]=n}(_,w),t=_[0],e=_[1],n=_[2],f=_[3],l=_[4],!(g=_[9]=_[9]===r?m?0:t.length:br(_[9]-v,0))&&24&e&&(e&=-25),e&&1!=e)A=8==e||e==o?function(t,e,i){var n=Un(t);return function s(){for(var o=arguments.length,a=at(o),c=o,h=cs(s);c--;)a[c]=arguments[c];var u=o<3&&a[0]!==h&&a[o-1]!==h?[]:ur(a,h);return(o-=u.length)<i?Jn(t,e,zn,s.placeholder,r,a,u,r,r,i-o):xe(this&&this!==ge&&this instanceof s?n:t,this,a)}}(t,e,g):e!=a&&33!=e||l.length?zn.apply(r,_):function(t,e,r,i){var n=1&e,s=Un(t);return function e(){for(var o=-1,a=arguments.length,c=-1,h=i.length,u=at(h+a),f=this&&this!==ge&&this instanceof e?s:t;++c<h;)u[c]=i[c];for(;a--;)u[c++]=arguments[++o];return xe(f,n?r:this,u)}}(t,e,n,f);else var A=function(t,e,r){var i=1&e,n=Un(t);return function e(){return(this&&this!==ge&&this instanceof e?n:t).apply(i?r:this,arguments)}}(t,e,n);return Ts((w?tn:Ns)(A,_),t,e)}function $n(t,e,i,n){return t===r||zo(t,kt[i])&&!Dt.call(n,i)?e:t}function ts(t,e,i,n,s,o){return ea(t)&&ea(e)&&(o.set(e,t),Fi(t,e,r,ts,o),o.delete(e)),t}function es(t){return sa(t)?r:t}function rs(t,e,i,n,s,o){var a=1&i,c=t.length,h=e.length;if(c!=h&&!(a&&h>c))return!1;var u=o.get(t),f=o.get(e);if(u&&f)return u==e&&f==t;var l=-1,d=!0,p=2&i?new Jr:r;for(o.set(t,e),o.set(e,t);++l<c;){var g=t[l],m=e[l];if(n)var v=a?n(m,g,l,e,t,o):n(g,m,l,t,e,o);if(v!==r){if(v)continue;d=!1;break}if(p){if(!Be(e,(function(t,e){if(!er(p,e)&&(g===t||s(g,t,i,n,o)))return p.push(e)}))){d=!1;break}}else if(g!==m&&!s(g,m,i,n,o)){d=!1;break}}return o.delete(t),o.delete(e),d}function is(t){return Cs(xs(t,r,Vs),t+"")}function ns(t){return Si(t,Ca,ds)}function ss(t){return Si(t,Ta,ps)}var os=Nr?function(t){return Nr.get(t)}:hc;function as(t){for(var e=t.name+"",r=Rr[e],i=Dt.call(Rr,e)?r.length:0;i--;){var n=r[i],s=n.func;if(null==s||s==t)return n.name}return e}function cs(t){return(Dt.call(jr,"placeholder")?jr:t).placeholder}function hs(){var t=jr.iteratee||sc;return t=t===sc?Li:t,arguments.length?t(arguments[0],arguments[1]):t}function us(t,e){var r=t.__data__;return function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t}(e)?r["string"==typeof e?"string":"hash"]:r.map}function fs(t){for(var e=Ca(t),r=e.length;r--;){var i=e[r],n=t[i];e[r]=[i,n,Ms(n)]}return e}function ls(t,e){var i=function(t,e){return null==t?r:t[e]}(t,e);return ki(i)?i:r}var ds=ye?function(t){return null==t?[]:(t=Pt(t),Ce(ye(t),(function(e){return Qt.call(t,e)})))}:mc,ps=ye?function(t){for(var e=[];t;)qe(e,ds(t)),t=Jt(t);return e}:mc,gs=Mi;function ms(t,e,r){for(var i=-1,n=(e=wn(e,t)).length,s=!1;++i<n;){var o=Ds(e[i]);if(!(s=null!=t&&r(t,o)))break;t=t[o]}return s||++i!=n?s:!!(n=null==t?0:t.length)&&ta(n)&&ys(o,n)&&(Vo(t)||Ko(t))}function vs(t){return"function"!=typeof t.constructor||Ss(t)?{}:zr(Jt(t))}function bs(t){return Vo(t)||Ko(t)||!!(Zt&&t&&t[Zt])}function ys(t,e){var r,i=typeof t;return!!(e=null!==(r=e)&&void 0!==r?r:l)&&("number"==i||"symbol"!=i&&wt.test(t))&&t>-1&&t%1==0&&t<e}function ws(t,e,r){if(!ea(r))return!1;var i=typeof e;return!!("number"==i?Go(r)&&ys(e,r.length):"string"==i&&e in r)&&zo(r[e],t)}function _s(t,e){if(Vo(t))return!1;var r=typeof t;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=t&&!ha(t))||(rt.test(t)||!et.test(t)||null!=e&&t in Pt(e))}function As(t){var e=as(t),r=jr[e];if("function"!=typeof r||!(e in Kr.prototype))return!1;if(t===r)return!0;var i=os(r);return!!i&&t===i[0]}(Sr&&gs(new Sr(new ArrayBuffer(1)))!=L||Mr&&gs(new Mr)!=M||Ir&&gs(Ir.resolve())!=P||xr&&gs(new xr)!=N||Pr&&gs(new Pr)!=T)&&(gs=function(t){var e=Mi(t),i=e==x?t.constructor:r,n=i?Us(i):"";if(n)switch(n){case Cr:return L;case Tr:return M;case kr:return P;case Lr:return N;case qr:return T}return e});var Es=Lt?Zo:vc;function Ss(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||kt)}function Ms(t){return t===t&&!ea(t)}function Is(t,e){return function(i){return null!=i&&(i[t]===e&&(e!==r||t in Pt(i)))}}function xs(t,e,i){return e=br(e===r?t.length-1:e,0),function(){for(var r=arguments,n=-1,s=br(r.length-e,0),o=at(s);++n<s;)o[n]=r[e+n];n=-1;
vendor: 15,714 bytes, line 2
2for(var a=at(e+1);++n<e;)a[n]=r[n];return a[e]=i(o),xe(t,this,a)}}function Ps(t,e){return e.length<2?t:Ei(t,nn(e,0,-1))}function Os(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]}var Ns=ks(tn),Rs=pe||function(t,e){return ge.setTimeout(t,e)},Cs=ks(en);function Ts(t,e,r){var i=e+"";return Cs(t,function(t,e){var r=e.length;if(!r)return t;var i=r-1;return e[i]=(r>1?"& ":"")+e[i],e=e.join(r>2?", ":" "),t.replace(ct,"{\n/* [wrapped with "+e+"] */\n")}(i,function(t,e){return Oe(v,(function(r){var i="_."+r[0];e&r[1]&&!Te(t,i)&&t.push(i)})),t.sort()}(function(t){var e=t.match(ht);return e?e[1].split(ut):[]}(i),r)))}function ks(t){var e=0,i=0;return function(){var n=wr(),s=16-(n-i);if(i=n,s>0){if(++e>=800)return arguments[0]}else e=0;return t.apply(r,arguments)}}function Ls(t,e){var i=-1,n=t.length,s=n-1;for(e=e===r?n:e;++i<e;){var o=Ji(i,s),a=t[o];t[o]=t[i],t[i]=a}return t.length=e,t}var qs=function(t){var e=Lo(t,(function(t){return 500===r.size&&r.clear(),t})),r=e.cache;return e}((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(it,(function(t,r,i,n){e.push(i?n.replace(dt,"$1"):r||t)})),e}));function Ds(t){if("string"==typeof t||ha(t))return t;var e=t+"";return"0"==e&&1/t==-f?"-0":e}function Us(t){if(null!=t){try{return qt.call(t)}catch(e){}try{return t+""}catch(r){}}return""}function Bs(t){if(t instanceof Kr)return t.clone();var e=new Hr(t.__wrapped__,t.__chain__);return e.__actions__=Nn(t.__actions__),e.__index__=t.__index__,e.__values__=t.__values__,e}var js=Qi((function(t,e){return Jo(t)?fi(t,vi(e,1,Jo,!0)):[]})),zs=Qi((function(t,e){var i=Qs(e);return Jo(i)&&(i=r),Jo(t)?fi(t,vi(e,1,Jo,!0),hs(i,2)):[]})),Fs=Qi((function(t,e){var i=Qs(e);return Jo(i)&&(i=r),Jo(t)?fi(t,vi(e,1,Jo,!0),r,i):[]}));function Hs(t,e,r){var i=null==t?0:t.length;if(!i)return-1;var n=null==r?0:ga(r);return n<0&&(n=br(i+n,0)),Fe(t,hs(e,3),n)}function Ks(t,e,i){var n=null==t?0:t.length;if(!n)return-1;var s=n-1;return i!==r&&(s=ga(i),s=i<0?br(n+s,0):yr(s,n-1)),Fe(t,hs(e,3),s,!0)}function Vs(t){return(null==t?0:t.length)?vi(t,1):[]}function Ws(t){return t&&t.length?t[0]:r}var Gs=Qi((function(t){var e=Le(t,bn);return e.length&&e[0]===t[0]?Oi(e):[]})),Js=Qi((function(t){var e=Qs(t),i=Le(t,bn);return e===Qs(i)?e=r:i.pop(),i.length&&i[0]===t[0]?Oi(i,hs(e,2)):[]})),Ys=Qi((function(t){var e=Qs(t),i=Le(t,bn);return(e="function"==typeof e?e:r)&&i.pop(),i.length&&i[0]===t[0]?Oi(i,r,e):[]}));function Qs(t){var e=null==t?0:t.length;return e?t[e-1]:r}var Xs=Qi(Zs);function Zs(t,e){return t&&t.length&&e&&e.length?Wi(t,e):t}var $s=is((function(t,e){var r=null==t?0:t.length,i=oi(t,e);return Gi(t,Le(e,(function(t){return ys(t,r)?+t:t})).sort(xn)),i}));function to(t){return null==t?t:Er.call(t)}var eo=Qi((function(t){return fn(vi(t,1,Jo,!0))})),ro=Qi((function(t){var e=Qs(t);return Jo(e)&&(e=r),fn(vi(t,1,Jo,!0),hs(e,2))})),io=Qi((function(t){var e=Qs(t);return e="function"==typeof e?e:r,fn(vi(t,1,Jo,!0),r,e)}));function no(t){if(!t||!t.length)return[];var e=0;return t=Ce(t,(function(t){if(Jo(t))return e=br(t.length,e),!0})),Xe(e,(function(e){return Le(t,Ge(e))}))}function so(t,e){if(!t||!t.length)return[];var i=no(t);return null==e?i:Le(i,(function(t){return xe(e,r,t)}))}var oo=Qi((function(t,e){return Jo(t)?fi(t,e):[]})),ao=Qi((function(t){return mn(Ce(t,Jo))})),co=Qi((function(t){var e=Qs(t);return Jo(e)&&(e=r),mn(Ce(t,Jo),hs(e,2))})),ho=Qi((function(t){var e=Qs(t);return e="function"==typeof e?e:r,mn(Ce(t,Jo),r,e)})),uo=Qi(no);var fo=Qi((function(t){var e=t.length,i=e>1?t[e-1]:r;return i="function"==typeof i?(t.pop(),i):r,so(t,i)}));function lo(t){var e=jr(t);return e.__chain__=!0,e}function po(t,e){return e(t)}var go=is((function(t){var e=t.length,i=e?t[0]:0,n=this.__wrapped__,s=function(e){return oi(e,t)};return!(e>1||this.__actions__.length)&&n instanceof Kr&&ys(i)?((n=n.slice(i,+i+(e?1:0))).__actions__.push({func:po,args:[s],thisArg:r}),new Hr(n,this.__chain__).thru((function(t){return e&&!t.length&&t.push(r),t}))):this.thru(s)}));var mo=Cn((function(t,e,r){Dt.call(t,r)?++t[r]:si(t,r,1)}));var vo=Bn(Hs),bo=Bn(Ks);function yo(t,e){return(Vo(t)?Oe:li)(t,hs(e,3))}function wo(t,e){return(Vo(t)?Ne:di)(t,hs(e,3))}var _o=Cn((function(t,e,r){Dt.call(t,r)?t[r].push(e):si(t,r,[e])}));var Ao=Qi((function(t,e,r){var i=-1,n="function"==typeof e,s=Go(t)?at(t.length):[];return li(t,(function(t){s[++i]=n?xe(e,t,r):Ni(t,e,r)})),s})),Eo=Cn((function(t,e,r){si(t,r,e)}));function So(t,e){return(Vo(t)?Le:Bi)(t,hs(e,3))}var Mo=Cn((function(t,e,r){t[r?0:1].push(e)}),(function(){return[[],[]]}));var Io=Qi((function(t,e){if(null==t)return[];var r=e.length;return r>1&&ws(t,e[0],e[1])?e=[]:r>2&&ws(e[0],e[1],e[2])&&(e=[e[0]]),Ki(t,vi(e,1),[])})),xo=de||function(){return ge.Date.now()};function Po(t,e,i){return e=i?r:e,e=t&&null==e?t.length:e,Zn(t,h,r,r,r,r,e)}function Oo(t,e){var n;if("function"!=typeof e)throw new Rt(i);return t=ga(t),function(){return--t>0&&(n=e.apply(this,arguments)),t<=1&&(e=r),n}}var No=Qi((function(t,e,r){var i=1;if(r.length){var n=ur(r,cs(No));i|=a}return Zn(t,i,e,r,n)})),Ro=Qi((function(t,e,r){var i=3;if(r.length){var n=ur(r,cs(Ro));i|=a}return Zn(e,i,t,r,n)}));function Co(t,e,n){var s,o,a,c,h,u,f=0,l=!1,d=!1,p=!0;if("function"!=typeof t)throw new Rt(i);function g(e){var i=s,n=o;return s=o=r,f=e,c=t.apply(n,i)}function m(t){var i=t-u;return u===r||i>=e||i<0||d&&t-f>=a}function v(){var t=xo();if(m(t))return b(t);h=Rs(v,function(t){var r=e-(t-u);return d?yr(r,a-(t-f)):r}(t))}function b(t){return h=r,p&&s?g(t):(s=o=r,c)}function y(){var t=xo(),i=m(t);if(s=arguments,o=this,u=t,i){if(h===r)return function(t){return f=t,h=Rs(v,e),l?g(t):c}(u);if(d)return En(h),h=Rs(v,e),g(u)}return h===r&&(h=Rs(v,e)),c}return e=va(e)||0,ea(n)&&(l=!!n.leading,a=(d="maxWait"in n)?br(va(n.maxWait)||0,e):a,p="trailing"in n?!!n.trailing:p),y.cancel=function(){h!==r&&En(h),f=0,s=u=o=h=r},y.flush=function(){return h===r?c:b(xo())},y}var To=Qi((function(t,e){return ui(t,1,e)})),ko=Qi((function(t,e,r){return ui(t,va(e)||0,r)}));function Lo(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new Rt(i);var r=function(){var i=arguments,n=e?e.apply(this,i):i[0],s=r.cache;if(s.has(n))return s.get(n);var o=t.apply(this,i);return r.cache=s.set(n,o)||s,o};return r.cache=new(Lo.Cache||Gr),r}function qo(t){if("function"!=typeof t)throw new Rt(i);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}Lo.Cache=Gr;var Do=_n((function(t,e){var r=(e=1==e.length&&Vo(e[0])?Le(e[0],$e(hs())):Le(vi(e,1),$e(hs()))).length;return Qi((function(i){for(var n=-1,s=yr(i.length,r);++n<s;)i[n]=e[n].call(this,i[n]);return xe(t,this,i)}))})),Uo=Qi((function(t,e){var i=ur(e,cs(Uo));return Zn(t,a,r,e,i)})),Bo=Qi((function(t,e){var i=ur(e,cs(Bo));return Zn(t,c,r,e,i)})),jo=is((function(t,e){return Zn(t,u,r,r,r,e)}));function zo(t,e){return t===e||t!==t&&e!==e}var Fo=Gn(Ii),Ho=Gn((function(t,e){return t>=e})),Ko=Ri(function(){return arguments}())?Ri:function(t){return ra(t)&&Dt.call(t,"callee")&&!Qt.call(t,"callee")},Vo=at.isArray,Wo=_e?$e(_e):function(t){return ra(t)&&Mi(t)==k};function Go(t){return null!=t&&ta(t.length)&&!Zo(t)}function Jo(t){return ra(t)&&Go(t)}var Yo=we||vc,Qo=Ae?$e(Ae):function(t){return ra(t)&&Mi(t)==_};function Xo(t){if(!ra(t))return!1;var e=Mi(t);return e==A||"[object DOMException]"==e||"string"==typeof t.message&&"string"==typeof t.name&&!sa(t)}function Zo(t){if(!ea(t))return!1;var e=Mi(t);return e==E||e==S||"[object AsyncFunction]"==e||"[object Proxy]"==e}function $o(t){return"number"==typeof t&&t==ga(t)}function ta(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=l}function ea(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function ra(t){return null!=t&&"object"==typeof t}var ia=Ee?$e(Ee):function(t){return ra(t)&&gs(t)==M};function na(t){return"number"==typeof t||ra(t)&&Mi(t)==I}function sa(t){if(!ra(t)||Mi(t)!=x)return!1;var e=Jt(t);if(null===e)return!0;var r=Dt.call(e,"constructor")&&e.constructor;return"function"==typeof r&&r instanceof r&&qt.call(r)==zt}var oa=Se?$e(Se):function(t){return ra(t)&&Mi(t)==O};var aa=Me?$e(Me):function(t){return ra(t)&&gs(t)==N};function ca(t){return"string"==typeof t||!Vo(t)&&ra(t)&&Mi(t)==R}function ha(t){return"symbol"==typeof t||ra(t)&&Mi(t)==C}var ua=Ie?$e(Ie):function(t){return ra(t)&&ta(t.length)&&!!ce[Mi(t)]};var fa=Gn(Ui),la=Gn((function(t,e){return t<=e}));function da(t){if(!t)return[];if(Go(t))return ca(t)?dr(t):Nn(t);if($t&&t[$t])return function(t){for(var e,r=[];!(e=t.next()).done;)r.push(e.value);return r}(t[$t]());var e=gs(t);return(e==M?cr:e==N?fr:za)(t)}function pa(t){return t?(t=va(t))===f||t===-f?17976931348623157e292*(t<0?-1:1):t===t?t:0:0===t?t:0}function ga(t){var e=pa(t),r=e%1;return e===e?r?e-r:e:0}function ma(t){return t?ai(ga(t),0,p):0}function va(t){if("number"==typeof t)return t;if(ha(t))return d;if(ea(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=ea(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=Ze(t);var r=vt.test(t);return r||yt.test(t)?le(t.slice(2),r?2:8):mt.test(t)?d:+t}function ba(t){return Rn(t,Ta(t))}function ya(t){return null==t?"":un(t)}var wa=Tn((function(t,e){if(Ss(e)||Go(e))Rn(e,Ca(e),t);else for(var r in e)Dt.call(e,r)&&ei(t,r,e[r])})),_a=Tn((function(t,e){Rn(e,Ta(e),t)})),Aa=Tn((function(t,e,r,i){Rn(e,Ta(e),t,i)})),Ea=Tn((function(t,e,r,i){Rn(e,Ca(e),t,i)})),Sa=is(oi);var Ma=Qi((function(t,e){t=Pt(t);var i=-1,n=e.length,s=n>2?e[2]:r;for(s&&ws(e[0],e[1],s)&&(n=1);++i<n;)for(var o=e[i],a=Ta(o),c=-1,h=a.length;++c<h;){var u=a[c],f=t[u];(f===r||zo(f,kt[u])&&!Dt.call(t,u))&&(t[u]=o[u])}return t})),Ia=Qi((function(t){return t.push(r,ts),xe(La,r,t)}));function xa(t,e,i){var n=null==t?r:Ei(t,e);return n===r?i:n}function Pa(t,e){return null!=t&&ms(t,e,Pi)}var Oa=Fn((function(t,e,r){null!=e&&"function"!=typeof e.toString&&(e=jt.call(e)),t[e]=r}),ec(nc)),Na=Fn((function(t,e,r){null!=e&&"function"!=typeof e.toString&&(e=jt.call(e)),Dt.call(t,e)?t[e].push(r):t[e]=[r]}),hs),Ra=Qi(Ni);function Ca(t){return Go(t)?Qr(t):qi(t)}function Ta(t){return Go(t)?Qr(t,!0):Di(t)}var ka=Tn((function(t,e,r){Fi(t,e,r)})),La=Tn((function(t,e,r,i){Fi(t,e,r,i)})),qa=is((function(t,e){var r={};if(null==t)return r;var i=!1;e=Le(e,(function(e){return e=wn(e,t),i||(i=e.length>1),e})),Rn(t,ss(t),r),i&&(r=ci(r,7,es));for(var n=e.length;n--;)ln(r,e[n]);return r}));var Da=is((function(t,e){return null==t?{}:function(t,e){return Vi(t,e,(function(e,r){return Pa(t,r)}))}(t,e)}));function Ua(t,e){if(null==t)return{};var r=Le(ss(t),(function(t){return[t]}));return e=hs(e),Vi(t,r,(function(t,r){return e(t,r[0])}))}var Ba=Xn(Ca),ja=Xn(Ta);function za(t){return null==t?[]:tr(t,Ca(t))}var Fa=Dn((function(t,e,r){return e=e.toLowerCase(),t+(r?Ha(e):e)}));function Ha(t){return Xa(ya(t).toLowerCase())}function Ka(t){return(t=ya(t))&&t.replace(_t,nr).replace(ee,"")}var Va=Dn((function(t,e,r){return t+(r?"-":"")+e.toLowerCase()})),Wa=Dn((function(t,e,r){return t+(r?" ":"")+e.toLowerCase()})),Ga=qn("toLowerCase");var Ja=Dn((function(t,e,r){return t+(r?"_":"")+e.toLowerCase()}));var Ya=Dn((function(t,e,r){return t+(r?" ":"")+Xa(e)}));var Qa=Dn((function(t,e,r){return t+(r?" ":"")+e.toUpperCase()})),Xa=qn("toUpperCase");function Za(t,e,i){return t=ya(t),(e=i?r:e)===r?function(t){return se.test(t)}(t)?function(t){return t.match(ie)||[]}(t):function(t){return t.match(ft)||[]}(t):t.match(e)||[]}var $a=Qi((function(t,e){try{return xe(t,r,e)}catch(i){return Xo(i)?i:new Mt(i)}})),tc=is((function(t,e){return Oe(e,(function(e){e=Ds(e),si(t,e,No(t[e],t))})),t}));function ec(t){return function(){return t}}var rc=jn(),ic=jn(!0);function nc(t){return t}function sc(t){return Li("function"==typeof t?t:ci(t,1))}var oc=Qi((function(t,e){return function(r){return Ni(r,t,e)}})),ac=Qi((function(t,e){return function(r){return Ni(t,r,e)}}));function cc(t,e,r){var i=Ca(e),n=Ai(e,i);null==r&&(!ea(e)||!n.length&&i.length)&&(r=e,e=t,t=this,n=Ai(e,Ca(e)));var s=!(ea(r)&&"chain"in r)||!!r.chain,o=Zo(t);return Oe(n,(function(r){var i=e[r];t[r]=i,o&&(t.prototype[r]=function(){var e=this.__chain__;if(s||e){var r=t(this.__wrapped__);return(r.__actions__=Nn(this.__actions__)).push({func:i,args:arguments,thisArg:t}),r.__chain__=e,r}return i.apply(t,qe([this.value()],arguments))})})),t}function hc(){}var uc=Kn(Le),fc=Kn(Re),lc=Kn(Be);function dc(t){return _s(t)?Ge(Ds(t)):function(t){return function(e){return Ei(e,t)}}(t)}var pc=Wn(),gc=Wn(!0);function mc(){return[]}function vc(){return!1}var bc=Hn((function(t,e){return t+e}),0),yc=Yn("ceil"),wc=Hn((function(t,e){return t/e}),1),_c=Yn("floor");var Ac=Hn((function(t,e){return t*e}),1),Ec=Yn("round"),Sc=Hn((function(t,e){return t-e}),0);return jr.after=function(t,e){if("function"!=typeof e)throw new Rt(i);return t=ga(t),function(){if(--t<1)return e.apply(this,arguments)}},jr.ary=Po,jr.assign=wa,jr.assignIn=_a,jr.assignInWith=Aa,jr.assignWith=Ea,jr.at=Sa,jr.before=Oo,jr.bind=No,jr.bindAll=tc,jr.bindKey=Ro,jr.castArray=function(){if(!arguments.length)return[];var t=arguments[0];return Vo(t)?t:[t]},jr.chain=lo,jr.chunk=function(t,e,i){e=(i?ws(t,e,i):e===r)?1:br(ga(e),0);var n=null==t?0:t.length;if(!n||e<1)return[];for(var s=0,o=0,a=at(me(n/e));s<n;)a[o++]=nn(t,s,s+=e);return a},jr.compact=function(t){for(var e=-1,r=null==t?0:t.length,i=0,n=[];++e<r;){var s=t[e];s&&(n[i++]=s)}return n},jr.concat=function(){var t=arguments.length;if(!t)return[];for(var e=at(t-1),r=arguments[0],i=t;i--;)e[i-1]=arguments[i];return qe(Vo(r)?Nn(r):[r],vi(e,1))},jr.cond=function(t){var e=null==t?0:t.length,r=hs();return t=e?Le(t,(function(t){if("function"!=typeof t[1])throw new Rt(i);return[r(t[0]),t[1]]})):[],Qi((function(r){for(var i=-1;++i<e;){var n=t[i];if(xe(n[0],this,r))return xe(n[1],this,r)}}))},jr.conforms=function(t){return function(t){var e=Ca(t);return function(r){return hi(r,t,e)}}(ci(t,1))},jr.constant=ec,jr.countBy=mo,jr.create=function(t,e){var r=zr(t);return null==e?r:ni(r,e)},jr.curry=function t(e,i,n){var s=Zn(e,8,r,r,r,r,r,i=n?r:i);return s.placeholder=t.placeholder,s},jr.curryRight=function t(e,i,n){var s=Zn(e,o,r,r,r,r,r,i=n?r:i);return s.placeholder=t.placeholder,s},jr.debounce=Co,jr.defaults=Ma,jr.defaultsDeep=Ia,jr.defer=To,jr.delay=ko,jr.difference=js,jr.differenceBy=zs,jr.differenceWith=Fs,jr.drop=function(t,e,i){var n=null==t?0:t.length;return n?nn(t,(e=i||e===r?1:ga(e))<0?0:e,n):[]},jr.dropRight=function(t,e,i){var n=null==t?0:t.length;return n?nn(t,0,(e=n-(e=i||e===r?1:ga(e)))<0?0:e):[]},jr.dropRightWhile=function(t,e){return t&&t.length?pn(t,hs(e,3),!0,!0):[]},jr.dropWhile=function(t,e){return t&&t.length?pn(t,hs(e,3),!0):[]},jr.fill=function(t,e,i,n){var s=null==t?0:t.length;return s?(i&&"number"!=typeof i&&ws(t,e,i)&&(i=0,n=s),function(t,e,i,n){var s=t.length;for((i=ga(i))<0&&(i=-i>s?0:s+i),(n=n===r||n>s?s:ga(n))<0&&(n+=s),n=i>n?0:ma(n);i<n;)t[i++]=e;return t}(t,e,i,n)):[]},jr.filter=function(t,e){return(Vo(t)?Ce:mi)(t,hs(e,3))},jr.flatMap=function(t,e){return vi(So(t,e),1)},jr.flatMapDeep=function(t,e){return vi(So(t,e),f)},jr.flatMapDepth=function(t,e,i){return i=i===r?1:ga(i),vi(So(t,e),i)},jr.flatten=Vs,jr.flattenDeep=function(t){return(null==t?0:t.length)?vi(t,f):[]},jr.flattenDepth=function(t,e){return(null==t?0:t.length)?vi(t,e=e===r?1:ga(e)):[]},jr.flip=function(t){return Zn(t,512)},jr.flow=rc,jr.flowRight=ic,jr.fromPairs=function(t){for(var e=-1,r=null==t?0:t.length,i={};++e<r;){var n=t[e];i[n[0]]=n[1]}return i},jr.functions=function(t){return null==t?[]:Ai(t,Ca(t))},jr.functionsIn=function(t){return null==t?[]:Ai(t,Ta(t))},jr.groupBy=_o,jr.initial=function(t){return(null==t?0:t.length)?nn(t,0,-1):[]}
vendor: 4,503 bytes, line 2
2,jr.intersection=Gs,jr.intersectionBy=Js,jr.intersectionWith=Ys,jr.invert=Oa,jr.invertBy=Na,jr.invokeMap=Ao,jr.iteratee=sc,jr.keyBy=Eo,jr.keys=Ca,jr.keysIn=Ta,jr.map=So,jr.mapKeys=function(t,e){var r={};return e=hs(e,3),wi(t,(function(t,i,n){si(r,e(t,i,n),t)})),r},jr.mapValues=function(t,e){var r={};return e=hs(e,3),wi(t,(function(t,i,n){si(r,i,e(t,i,n))})),r},jr.matches=function(t){return ji(ci(t,1))},jr.matchesProperty=function(t,e){return zi(t,ci(e,1))},jr.memoize=Lo,jr.merge=ka,jr.mergeWith=La,jr.method=oc,jr.methodOf=ac,jr.mixin=cc,jr.negate=qo,jr.nthArg=function(t){return t=ga(t),Qi((function(e){return Hi(e,t)}))},jr.omit=qa,jr.omitBy=function(t,e){return Ua(t,qo(hs(e)))},jr.once=function(t){return Oo(2,t)},jr.orderBy=function(t,e,i,n){return null==t?[]:(Vo(e)||(e=null==e?[]:[e]),Vo(i=n?r:i)||(i=null==i?[]:[i]),Ki(t,e,i))},jr.over=uc,jr.overArgs=Do,jr.overEvery=fc,jr.overSome=lc,jr.partial=Uo,jr.partialRight=Bo,jr.partition=Mo,jr.pick=Da,jr.pickBy=Ua,jr.property=dc,jr.propertyOf=function(t){return function(e){return null==t?r:Ei(t,e)}},jr.pull=Xs,jr.pullAll=Zs,jr.pullAllBy=function(t,e,r){return t&&t.length&&e&&e.length?Wi(t,e,hs(r,2)):t},jr.pullAllWith=function(t,e,i){return t&&t.length&&e&&e.length?Wi(t,e,r,i):t},jr.pullAt=$s,jr.range=pc,jr.rangeRight=gc,jr.rearg=jo,jr.reject=function(t,e){return(Vo(t)?Ce:mi)(t,qo(hs(e,3)))},jr.remove=function(t,e){var r=[];if(!t||!t.length)return r;var i=-1,n=[],s=t.length;for(e=hs(e,3);++i<s;){var o=t[i];e(o,i,t)&&(r.push(o),n.push(i))}return Gi(t,n),r},jr.rest=function(t,e){if("function"!=typeof t)throw new Rt(i);return Qi(t,e=e===r?e:ga(e))},jr.reverse=to,jr.sampleSize=function(t,e,i){return e=(i?ws(t,e,i):e===r)?1:ga(e),(Vo(t)?Zr:Zi)(t,e)},jr.set=function(t,e,r){return null==t?t:$i(t,e,r)},jr.setWith=function(t,e,i,n){return n="function"==typeof n?n:r,null==t?t:$i(t,e,i,n)},jr.shuffle=function(t){return(Vo(t)?$r:rn)(t)},jr.slice=function(t,e,i){var n=null==t?0:t.length;return n?(i&&"number"!=typeof i&&ws(t,e,i)?(e=0,i=n):(e=null==e?0:ga(e),i=i===r?n:ga(i)),nn(t,e,i)):[]},jr.sortBy=Io,jr.sortedUniq=function(t){return t&&t.length?cn(t):[]},jr.sortedUniqBy=function(t,e){return t&&t.length?cn(t,hs(e,2)):[]},jr.split=function(t,e,i){return i&&"number"!=typeof i&&ws(t,e,i)&&(e=i=r),(i=i===r?p:i>>>0)?(t=ya(t))&&("string"==typeof e||null!=e&&!oa(e))&&(!(e=un(e))&&ar(t))?An(dr(t),0,i):t.split(e,i):[]},jr.spread=function(t,e){if("function"!=typeof t)throw new Rt(i);return e=null==e?0:br(ga(e),0),Qi((function(r){var i=r[e],n=An(r,0,e);return i&&qe(n,i),xe(t,this,n)}))},jr.tail=function(t){var e=null==t?0:t.length;return e?nn(t,1,e):[]},jr.take=function(t,e,i){return t&&t.length?nn(t,0,(e=i||e===r?1:ga(e))<0?0:e):[]},jr.takeRight=function(t,e,i){var n=null==t?0:t.length;return n?nn(t,(e=n-(e=i||e===r?1:ga(e)))<0?0:e,n):[]},jr.takeRightWhile=function(t,e){return t&&t.length?pn(t,hs(e,3),!1,!0):[]},jr.takeWhile=function(t,e){return t&&t.length?pn(t,hs(e,3)):[]},jr.tap=function(t,e){return e(t),t},jr.throttle=function(t,e,r){var n=!0,s=!0;if("function"!=typeof t)throw new Rt(i);return ea(r)&&(n="leading"in r?!!r.leading:n,s="trailing"in r?!!r.trailing:s),Co(t,e,{leading:n,maxWait:e,trailing:s})},jr.thru=po,jr.toArray=da,jr.toPairs=Ba,jr.toPairsIn=ja,jr.toPath=function(t){return Vo(t)?Le(t,Ds):ha(t)?[t]:Nn(qs(ya(t)))},jr.toPlainObject=ba,jr.transform=function(t,e,r){var i=Vo(t),n=i||Yo(t)||ua(t);if(e=hs(e,4),null==r){var s=t&&t.constructor;r=n?i?new s:[]:ea(t)&&Zo(s)?zr(Jt(t)):{}}return(n?Oe:wi)(t,(function(t,i,n){return e(r,t,i,n)})),r},jr.unary=function(t){return Po(t,1)},jr.union=eo,jr.unionBy=ro,jr.unionWith=io,jr.uniq=function(t){return t&&t.length?fn(t):[]},jr.uniqBy=function(t,e){return t&&t.length?fn(t,hs(e,2)):[]},jr.uniqWith=function(t,e){return e="function"==typeof e?e:r,t&&t.length?fn(t,r,e):[]},jr.unset=function(t,e){return null==t||ln(t,e)},jr.unzip=no,jr.unzipWith=so,jr.update=function(t,e,r){return null==t?t:dn(t,e,yn(r))},jr.updateWith=function(t,e,i,n){return n="function"==typeof n?n:r,null==t?t:dn(t,e,yn(i),n)},jr.values=za,jr.valuesIn=function(t){return null==t?[]:tr(t,Ta(t))},jr.without=oo,jr.words=Za,jr.wrap=function(t,e){return Uo(yn(e),t)},jr.xor=ao,jr.xorBy=co,jr.xorWith=ho,jr.zip=uo,jr.zipObject=function(t,e){return vn(t||[],e||[],ei)},jr.zipObjectDeep=function(t,e){return vn(t||[],e||[],$i)},jr.zipWith=fo,jr.entries=Ba,jr.entriesIn=ja,jr.extend=_a,jr.extendWith=Aa,cc(jr,jr),jr.add=bc,jr.attempt=$a,jr.camelCase=Fa,jr.capitalize=Ha,jr.ceil=yc,jr.clamp=function(t,e,
vendor: 3,108 bytes, line 2
2i){return i===r&&(i=e,e=r),i!==r&&(i=(i=va(i))===i?i:0),e!==r&&(e=(e=va(e))===e?e:0),ai(va(t),e,i)},jr.clone=function(t){return ci(t,4)},jr.cloneDeep=function(t){return ci(t,5)},jr.cloneDeepWith=function(t,e){return ci(t,5,e="function"==typeof e?e:r)},jr.cloneWith=function(t,e){return ci(t,4,e="function"==typeof e?e:r)},jr.conformsTo=function(t,e){return null==e||hi(t,e,Ca(e))},jr.deburr=Ka,jr.defaultTo=function(t,e){return null==t||t!==t?e:t},jr.divide=wc,jr.endsWith=function(t,e,i){t=ya(t),e=un(e);var n=t.length,s=i=i===r?n:ai(ga(i),0,n);return(i-=e.length)>=0&&t.slice(i,s)==e},jr.eq=zo,jr.escape=function(t){return(t=ya(t))&&X.test(t)?t.replace(Y,sr):t},jr.escapeRegExp=function(t){return(t=ya(t))&&st.test(t)?t.replace(nt,"\\$&"):t},jr.every=function(t,e,i){var n=Vo(t)?Re:pi;return i&&ws(t,e,i)&&(e=r),n(t,hs(e,3))},jr.find=vo,jr.findIndex=Hs,jr.findKey=function(t,e){return ze(t,hs(e,3),wi)},jr.findLast=bo,jr.findLastIndex=Ks,jr.findLastKey=function(t,e){return ze(t,hs(e,3),_i)},jr.floor=_c,jr.forEach=yo,jr.forEachRight=wo,jr.forIn=function(t,e){return null==t?t:bi(t,hs(e,3),Ta)},jr.forInRight=function(t,e){return null==t?t:yi(t,hs(e,3),Ta)},jr.forOwn=function(t,e){return t&&wi(t,hs(e,3))},jr.forOwnRight=function(t,e){return t&&_i(t,hs(e,3))},jr.get=xa,jr.gt=Fo,jr.gte=Ho,jr.has=function(t,e){return null!=t&&ms(t,e,xi)},jr.hasIn=Pa,jr.head=Ws,jr.identity=nc,jr.includes=function(t,e,r,i){t=Go(t)?t:za(t),r=r&&!i?ga(r):0;var n=t.length;return r<0&&(r=br(n+r,0)),ca(t)?r<=n&&t.indexOf(e,r)>-1:!!n&&He(t,e,r)>-1},jr.indexOf=function(t,e,r){var i=null==t?0:t.length;if(!i)return-1;var n=null==r?0:ga(r);return n<0&&(n=br(i+n,0)),He(t,e,n)},jr.inRange=function(t,e,i){return e=pa(e),i===r?(i=e,e=0):i=pa(i),function(t,e,r){return t>=yr(e,r)&&t<br(e,r)}(t=va(t),e,i)},jr.invoke=Ra,jr.isArguments=Ko,jr.isArray=Vo,jr.isArrayBuffer=Wo,jr.isArrayLike=Go,jr.isArrayLikeObject=Jo,jr.isBoolean=function(t){return!0===t||!1===t||ra(t)&&Mi(t)==w},jr.isBuffer=Yo,jr.isDate=Qo,jr.isElement=function(t){return ra(t)&&1===t.nodeType&&!sa(t)},jr.isEmpty=function(t){if(null==t)return!0;if(Go(t)&&(Vo(t)||"string"==typeof t||"function"==typeof t.splice||Yo(t)||ua(t)||Ko(t)))return!t.length;var e=gs(t);if(e==M||e==N)return!t.size;if(Ss(t))return!qi(t).length;for(var r in t)if(Dt.call(t,r))return!1;return!0},jr.isEqual=function(t,e){return Ci(t,e)},jr.isEqualWith=function(t,e,i){var n=(i="function"==typeof i?i:r)?i(t,e):r;return n===r?Ci(t,e,r,i):!!n},jr.isError=Xo,jr.isFinite=function(t){return"number"==typeof t&&je(t)},jr.isFunction=Zo,jr.isInteger=$o,jr.isLength=ta,jr.isMap=ia,jr.isMatch=function(t,e){return t===e||Ti(t,e,fs(e))},jr.isMatchWith=function(t,e,i){return i="function"==typeof i?i:r,Ti(t,e,fs(e),i)},jr.isNaN=function(t){return na(t)&&t!=+t},jr.isNative=function(t){if(Es(t))throw new Mt("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return ki(t)},jr.isNil=function(t){return null==t},jr.isNull=function(t){return null===t},jr.isNumber=na,jr.isObject=ea,jr.isObjectLike=ra,jr.isPlainObject=sa,jr.isRegExp=oa,jr.isSafeInteger=function(t){return $o(t)&&t>=-l&&t<=l}
vendor: 4,466 bytes, line 2
2,jr.isSet=aa,jr.isString=ca,jr.isSymbol=ha,jr.isTypedArray=ua,jr.isUndefined=function(t){return t===r},jr.isWeakMap=function(t){return ra(t)&&gs(t)==T},jr.isWeakSet=function(t){return ra(t)&&"[object WeakSet]"==Mi(t)},jr.join=function(t,e){return null==t?"":Je.call(t,e)},jr.kebabCase=Va,jr.last=Qs,jr.lastIndexOf=function(t,e,i){var n=null==t?0:t.length;if(!n)return-1;var s=n;return i!==r&&(s=(s=ga(i))<0?br(n+s,0):yr(s,n-1)),e===e?function(t,e,r){for(var i=r+1;i--;)if(t[i]===e)return i;return i}(t,e,s):Fe(t,Ve,s,!0)},jr.lowerCase=Wa,jr.lowerFirst=Ga,jr.lt=fa,jr.lte=la,jr.max=function(t){return t&&t.length?gi(t,nc,Ii):r},jr.maxBy=function(t,e){return t&&t.length?gi(t,hs(e,2),Ii):r},jr.mean=function(t){return We(t,nc)},jr.meanBy=function(t,e){return We(t,hs(e,2))},jr.min=function(t){return t&&t.length?gi(t,nc,Ui):r},jr.minBy=function(t,e){return t&&t.length?gi(t,hs(e,2),Ui):r},jr.stubArray=mc,jr.stubFalse=vc,jr.stubObject=function(){return{}},jr.stubString=function(){return""},jr.stubTrue=function(){return!0},jr.multiply=Ac,jr.nth=function(t,e){return t&&t.length?Hi(t,ga(e)):r},jr.noConflict=function(){return ge._===this&&(ge._=Ft),this},jr.noop=hc,jr.now=xo,jr.pad=function(t,e,r){t=ya(t);var i=(e=ga(e))?lr(t):0;if(!e||i>=e)return t;var n=(e-i)/2;return Vn(ve(n),r)+t+Vn(me(n),r)},jr.padEnd=function(t,e,r){t=ya(t);var i=(e=ga(e))?lr(t):0;return e&&i<e?t+Vn(e-i,r):t},jr.padStart=function(t,e,r){t=ya(t);var i=(e=ga(e))?lr(t):0;return e&&i<e?Vn(e-i,r)+t:t},jr.parseInt=function(t,e,r){return r||null==e?e=0:e&&(e=+e),_r(ya(t).replace(ot,""),e||0)},jr.random=function(t,e,i){if(i&&"boolean"!=typeof i&&ws(t,e,i)&&(e=i=r),i===r&&("boolean"==typeof e?(i=e,e=r):"boolean"==typeof t&&(i=t,t=r)),t===r&&e===r?(t=0,e=1):(t=pa(t),e===r?(e=t,t=0):e=pa(e)),t>e){var n=t;t=e,e=n}if(i||t%1||e%1){var s=Ar();return yr(t+s*(e-t+fe("1e-"+((s+"").length-1))),e)}return Ji(t,e)},jr.reduce=function(t,e,r){var i=Vo(t)?De:Ye,n=arguments.length<3;return i(t,hs(e,4),r,n,li)},jr.reduceRight=function(t,e,r){var i=Vo(t)?Ue:Ye,n=arguments.length<3;return i(t,hs(e,4),r,n,di)},jr.repeat=function(t,e,i){return e=(i?ws(t,e,i):e===r)?1:ga(e),Yi(ya(t),e)},jr.replace=function(){var t=arguments,e=ya(t[0]);return t.length<3?e:e.replace(t[1],t[2])},jr.result=function(t,e,i){var n=-1,s=(e=wn(e,t)).length;for(s||(s=1,t=r);++n<s;){var o=null==t?r:t[Ds(e[n])];o===r&&(n=s,o=i),t=Zo(o)?o.call(t):o}return t},jr.round=Ec,jr.runInContext=t,jr.sample=function(t){return(Vo(t)?Xr:Xi)(t)},jr.size=function(t){if(null==t)return 0;if(Go(t))return ca(t)?lr(t):t.length;var e=gs(t);return e==M||e==N?t.size:qi(t).length},jr.snakeCase=Ja,jr.some=function(t,e,i){var n=Vo(t)?Be:sn;return i&&ws(t,e,i)&&(e=r),n(t,hs(e,3))},jr.sortedIndex=function(t,e){return on(t,e)},jr.sortedIndexBy=function(t,e,r){return an(t,e,hs(r,2))},jr.sortedIndexOf=function(t,e){var r=null==t?0:t.length;if(r){var i=on(t,e);if(i<r&&zo(t[i],e))return i}return-1},jr.sortedLastIndex=function(t,e){return on(t,e,!0)},jr.sortedLastIndexBy=function(t,e,r){return an(t,e,hs(r,2),!0)},jr.sortedLastIndexOf=function(t,e){if(null==t?0:t.length){var r=on(t,e,!0)-1;if(zo(t[r],e))return r}return-1},jr.startCase=Ya,jr.startsWith=function(t,e,r){return t=ya(t),r=null==r?0:ai(ga(r),0,t.length),e=un(e),t.slice(r,r+e.length)==e},jr.subtract=Sc,jr.sum=function(t){return t&&t.length?Qe(t,nc):0},jr.sumBy=function(t,e){return t&&t.length?Qe(t,hs(e,2)):0},jr.template=function(t,e,i){var n=jr.templateSettings;i&&ws(t,e,i)&&(e=r),t=ya(t),e=Aa({},e,n,$n);var s,o,a=Aa({},e.imports,n.imports,$n),c=Ca(a),h=tr(a,c),u=0,f=e.interpolate||At,l="__p += '",d=Ot((e.escape||At).source+"|"+f.source+"|"+(f===tt?pt:At).source+"|"+(e.evaluate||At).source+"|$","g"),p="//# sourceURL="+(Dt.call(e,"sourceURL")?(e.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++ae+"]")+"\n";t.replace(d,(function(e,r,i,n,a,c){return i||(i=n),l+=t.slice(u,c).replace(Et,or),r&&(s=!0,l+="' +\n__e("+r+") +\n'"),a&&(o=!0,l+="';\n"+a+";\n__p += '"),i&&(l+="' +\n((__t = ("+i+")) == null ? '' : __t) +\n'"),u=c+e.length,e})),l+="';\n";var g=Dt.call(e,"variable")&&e.variable;if(g){if(lt.test(g))throw new Mt("Invalid `variable` option passed into `_.template`")}else l="with (obj) {\n"+l+"\n}\n";l=(o?l.replace(V,""):l).replace(W,"$1").replace(G,"$1;"),l="function("+(g||"obj")+") {\n"+(g?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(s?", __e = _.escape":"")+(o?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";
2\n")+l+"return __p\n}";var m=$a((function(){return It(c,p+"return "+l).apply(r,h)}));if(m.source=l,Xo(m))throw m;return m},jr.times=function(t,e){if((t=ga(t))<1||t>l)return[];var r=p,i=yr(t,p);e=hs(e),t-=p;for(var n=Xe(i,e);++r<t;)e(r);return n},jr.toFinite=pa,jr.toInteger=ga,jr.toLength=ma,jr.toLower=function(t){return ya(t).toLowerCase()},jr.toNumber=va,jr.toSafeInteger=function(t){return t?ai(ga(t),-l,l):0===t?t:0},jr.toString=ya,jr.toUpper=function(t){return ya(t).toUpperCase()},jr.trim=function(t,e,i){if((t=ya(t))&&(i||e===r))return Ze(t);if(!t||!(e=un(e)))return t;var n=dr(t),s=dr(e);return An(n,rr(n,s),ir(n,s)+1).join("")},jr.trimEnd=function(t,e,i){if((t=ya(t))&&(i||e===r))return t.slice(0,pr(t)+1);if(!t||!(e=un(e)))return t;var n=dr(t);return An(n,0,ir(n,dr(e))+1).join("")},jr.trimStart=function(t,e,i){if((t=ya(t))&&(i||e===r))return t.replace(ot,"");if(!t||!(e=un(e)))return t;var n=dr(t);return An(n,rr(n,dr(e))).join("")},jr.truncate=function(t,e){var i=30,n="...";if(ea(e)){var s="separator"in e?e.separator:s;i="length"in e?ga(e.length):i,n="omission"in e?un(e.omission):n}var o=(t=ya(t)).length;if(ar(t)){var a=dr(t);o=a.length}if(i>=o)return t;var c=i-lr(n);if(c<1)return n;var h=a?An(a,0,c).join(""):t.slice(0,c);if(s===r)return h+n;if(a&&(c+=h.length-c),oa(s)){if(t.slice(c).search(s)){var u,f=h;for(s.global||(s=Ot(s.source,ya(gt.exec(s))+"g")),s.lastIndex=0;u=s.exec(f);)var l=u.index;h=h.slice(0,l===r?c:l)}}else if(t.indexOf(un(s),c)!=c){var d=h.lastIndexOf(s);d>-1&&(h=h.slice(0,d))}return h+n},jr.unescape=function(t){return(t=ya(t))&&Q.test(t)?t.replace(J,gr):t},jr.uniqueId=function(t){var e=++Ut;return ya(t)+e},jr.upperCase=Qa,jr.upperFirst=Xa,jr.each=yo,jr.eachRight=wo,jr.first=Ws,cc(jr,function(){var t={};return wi(jr,(function(e,r){Dt.call(jr.prototype,r)||(t[r]=e)})),t}(),{chain:!1}),jr.VERSION="4.17.21",Oe(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(t){jr[t].placeholder=jr})),Oe(["drop","take"],(function(t,e){Kr.prototype[t]=function(i){i=i===r?1:br(ga(i),0);var n=this.__filtered__&&!e?new Kr(this):this.clone();return n.__filtered__?n.__takeCount__=yr(i,n.__takeCount__):n.__views__.push({size:yr(i,p),type:t+(n.__dir__<0?"Right":"")}),n},Kr.prototype[t+"Right"]=function(e){return this.reverse()[t](e).reverse()}})),Oe(["filter","map","takeWhile"],(function(t,e){var r=e+1,i=1==r||3==r;Kr.prototype[t]=function(t){var e=this.clone();return e.__iteratees__.push({iteratee:hs(t,3),type:r}),e.__filtered__=e.__filtered__||i,e}})),Oe(["head","last"],(function(t,e){var r="take"+(e?"Right":"");Kr.prototype[t]=function(){return this[r](1).value()[0]}})),Oe(["initial","tail"],(function(t,e){var r="drop"+(e?"":"Right");Kr.prototype[t]=function(){return this.__filtered__?new Kr(this):this[r](1)}})),Kr.prototype.compact=function(){return this.filter(nc)},Kr.prototype.find=function(t){return this.filter(t).head()},Kr.prototype.findLast=function(t){return this.reverse().find(t)},Kr.prototype.invokeMap=Qi((function(t,e){return"function"==typeof t?new Kr(this):this.map((function(r){return Ni(r,t,e)}))})),Kr.prototype.reject=function(t){return this.filter(qo(hs(t)))},Kr.prototype.slice=function(t,e){t=ga(t);var i=this;return i.__filtered__&&(t>0||e<0)?new Kr(i):(t<0?i=i.takeRight(-t):t&&(i=i.drop(t)),e!==r&&(i=(e=ga(e))<0?i.dropRight(-e):i.take(e-t)),i)},Kr.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},Kr.prototype.toArray=function(){return this.take(p)},wi(Kr.prototype,(function(t,e){var i=/^(?:filter|find|map|reject)|While$/.test(e),n=/^(?:head|last)$/.test(e),s=jr[n?"take"+("last"==e?"Right":""):e],o=n||/^find/.test(e);s&&(jr.prototype[e]=function(){var e=this.__wrapped__,a=n?[1]:arguments,c=e instanceof Kr,h=a[0],u=c||Vo(e),f=function(t){var e=s.apply(jr,qe([t],a));return n&&l?e[0]:e};u&&i&&"function"==typeof h&&1!=h.length&&(c=u=!1);var l=this.__chain__,d=!!this.__actions__.length,p=o&&!l,g=c&&!d;if(!o&&u){e=g?e:new Kr(this);var m=t.apply(e,a);return m.__actions__.push({func:po,args:[f],thisArg:r}),new Hr(m,l)}return p&&g?t.apply(this,a):(m=this.thru(f),p?n?m.value()[0]:m.value():m)})})),Oe(["pop","push","shift","sort","splice","unshift"],(function(t){var e=Ct[t],r=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",i=/^(?:pop|shift)$/.test(t);jr.prototype[t]=function(){var t=arguments;if(i&&!this.__chain__){var n=this.value();return e.apply(Vo(n)?n:[],t)}return this[r]((function(r){return e.apply(Vo(r)?r:[],t)}))}})),wi(Kr.prototype,(function(t,e){var r=jr[e];if(r){var i=r.name+"";Dt.call(Rr,i)||(Rr[i]=[]),Rr[i].push({name:e,func:r})}})),Rr[zn(r,2).name]=[{name:"wrapper",func:r}],Kr.prototype.clone=function(){var t=new Kr(this.__wrapped__);return t.__actions__=Nn(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=Nn(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=Nn(this.__views__),t},Kr.prototype.reverse=function(){if(this.__filtered__){var t=new Kr(this);t.__dir__=-1,t.__filtered__=!0}else(t=this.clone()).__dir__*=-1;return t},Kr.prototype.value=function(){var t=this.__wrapped__.value(),e=this.__dir__,r=Vo(t),i=e<0,n=r?t.length:0,s=function(t,e,r){for(var i=-1,n=r.length;++i<n;){var s=r[i],o=s.size;switch(s.type){case"drop":t+=o;break;case"dropRight":e-=o;break;case"take":e=yr(e,t+o);break;case"takeRight":t=br(t,e-o)}}return{start:t,end:e}}(0,n,this.__views__),o=s.start,a=s.end,c=a-o,h=i?a:o-1,u=this.__iteratees__,f=u.length,l=0,d=yr(c,this.__takeCount__);if(!r||!i&&n==c&&d==c)return gn(t,this.__actions__);var p=[];t:for(;c--&&l<d;){for(var g=-1,m=t[h+=e];++g<f;){var v=u[g],b=v.iteratee,y=v.type,w=b(m);if(2==y)m=w;else if(!w){if(1==y)continue t;break t}}p[l++]=m}return p},jr.prototype.at=go,jr.prototype.chain=function(){return lo(this)},jr.prototype.commit=function(){return new Hr(this.value(),this.__chain__)},jr.prototype.next=function(){this.__values__===r&&(this.__values__=da(this.value()));var t=this.__index__>=this.__values__.length;return{done:t,value:t?r:this.__values__[this.__index__++]}},jr.prototype.plant=function(t){for(var e,i=this;i instanceof Fr;){var n=Bs(i);n.__index__=0,n.__values__=r,e?s.__wrapped__=n:e=n;var s=n;i=i.__wrapped__}return s.__wrapped__=t,e},jr.prototype.reverse=function(){var t=this.__wrapped__;if(t instanceof Kr){var e=t;return this.__actions__.length&&(e=new Kr(this)),(e=e.reverse()).__actions__.push({func:po,args:[to],thisArg:r}),new Hr(e,this.__chain__)}return this.thru(to)},jr.prototype.toJSON=jr.prototype.valueOf=jr.prototype.value=function(){return gn(this.__wrapped__,this.__actions__)},jr.prototype.first=jr.prototype.head,$t&&(jr.prototype[$t]=function(){return this}),jr}();ve?((ve.exports=mr)._=mr,me._=mr):ge._=mr}).call(kg)}(Lg,Lg.exports);var qg=Object.defineProperty,Dg=Object.defineProperties,Ug=Object.getOwnPropertyDescriptors,Bg=Object.getOwnPropertySymbols,jg=Object.prototype.hasOwnProperty,zg=Object.prototype.propertyIsEnumerable,Fg=(t,e,r)=>e in t?qg(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Hg=(t,e)=>{for(var r in e||(e={}))jg.call(e,r)&&Fg(t,r,e[r]);if(Bg)for(var r of Bg(e))zg.call(e,r)&&Fg(t,r,e[r]);return t},Kg=(t,e)=>Dg(t,Ug(e));function Vg(t,e,r){var i;const n=Ve(t);return(null==(i=e.rpcMap)?void 0:i[n.reference])||"".concat(Ng,"?chainId=").concat(n.namespace,":").concat(n.reference,"&projectId=").concat(r)}function Wg(t){return t.includes(":")?t.split(":")[1]:t}function Gg(t){return t.map((t=>"".concat(t.split(":")[0],":").concat(t.split(":")[1])))}function Jg(){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const e=Yg(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),r=Yg(t);return Lg.exports.merge(e,r)}function Yg(t){var e,r,i,n;const s={};if(!oc(t))return s;for(const[o,a]of Object.entries(t)){const t=Za(o)?[o]:a.chains,c=a.methods||[],h=a.events||[],u=a.rpcMap||{},f=$a(o);s[f]=Kg(Hg(Hg({},s[f]),a),{chains:Ar(t,null==(e=s[f])?void 0:e.chains),methods:Ar(c,null==(r=s[f])?void 0:r.methods),events:Ar(h,null==(i=s[f])?void 0:i.events),rpcMap:Hg(Hg({},u),null==(n=s[f])?void 0:n.rpcMap)})}return s}function Qg(t){return t.includes(":")?t.split(":")[2]:t}function Xg(t){const e={};for(const[r,i]of Object.entries(t)){const t=i.methods||[],n=i.events||[],s=i.accounts||[],o=Za(r)?[r]:i.chains?i.chains:Gg(i.accounts);e[r]={chains:o,methods:t,events:n,accounts:s}}return e}function Zg(t){return"number"==typeof t?t:t.includes("0x")?parseInt(t,16):(t=t.includes(":")?t.split(":")[1]:t,isNaN(Number(t))?t:Number(t))}const $g={},tm=t=>$g[t],em=(t,e)=>{$g[t]=e};class rm{constructor(t){this.name="polkadot",this.namespace=t.namespace,this.events=tm("events"),this.client=tm("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(t){this.namespace=Object.assign(this.namespace,t)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const t=this.namespace.chains[0];if(!t)throw new Error("ChainId not found");return t.split(":")[1]}request(t){return this.namespace.methods.includes(t.request.method)?this.client.request(t):this.getHttpProvider().request(t.request)}setDefaultChain(t,e){this.httpProviders[t]||this.setHttpProvider(t,e),this.chainId=t,this.events.emit(Tg,"".concat(this.name,":").concat(t))}getAccounts(){const t=this.namespace.accounts;return t&&t.filter((t=>t.split(":")[1]===this.chainId.toString())).map((t=>t.split(":")[2]))||[]}createHttpProviders(){const t={};return this.namespace.chains.forEach((e=>{var r;const i=Wg(e);t[i]=this.createHttpProvider(i,null==(r=this.namespace.rpcMap)?void 0:r[e])})),t}getHttpProvider(){const t="".concat(this.name,":").concat(this.chainId),e=this.httpProviders[t];if(typeof e>"u")throw new Error("JSON-RPC provider for ".concat(t," not found"));return e}setHttpProvider(t,e){const r=this.createHttpProvider(t,e);r&&(this.httpProviders[t]=r)}createHttpProvider(t,e){const r=e||Vg(t,this.namespace,this.client.core.projectId);if(!r)throw new Error("No RPC url provided for chainId: ".concat(t));return new Au(new xg(r,tm("disableProviderPing")))}}var im=Object.defineProperty,nm=Object.defineProperties,sm=Object.getOwnPropertyDescriptors,om=Object.getOwnPropertySymbols,am=Object.prototype.hasOwnProperty,cm=Object.prototype.propertyIsEnumerable,hm=(t,e,r)=>e in t?im(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,um=(t,e)=>{for(var r in e||(e={}))am.call(e,r)&&hm(t,r,e[r]);if(om)for(var r of om(e))cm.call(e,r)&&hm(t,r,e[r]);return t},fm=(t,e)=>nm(t,sm(e));class lm{constructor(t){this.name="eip155",this.namespace=t.namespace,this.events=tm("events"),this.client=tm("client"),this.httpProviders=this.createHttpProviders(),this.chainId=parseInt(this.getDefaultChain())}async request(t){switch(t.request.method){case"eth_requestAccounts":case"eth_accounts":return this.getAccounts();case"wallet_switchEthereumChain":return await this.handleSwitchChain(t);case"eth_chainId":return parseInt(this.getDefaultChain());case"wallet_getCapabilities":return await this.getCapabilities(t);case"wallet_getCallsStatus":return await this.getCallStatus(t)}return this.namespace.methods.includes(t.request.method)?await this.client.request(t):this.getHttpProvider().request(t.request)}updateNamespace(t){this.namespace=Object.assign(this.namespace,t)}setDefaultChain(t,e){this.httpProviders[t]||this.setHttpProvider(parseInt(t),e),this.chainId=parseInt(t),this.events.emit(Tg,"".concat(this.name,":").concat(t))}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId.toString();if(this.namespace.defaultChain)return this.namespace.defaultChain;const t=this.namespace.chains[0];if(!t)throw new Error("ChainId not found");return t.split(":")[1]}createHttpProvider(t,e){const r=e||Vg("".concat(this.name,":").concat(t),this.namespace,this.client.core.projectId);if(!r)throw new Error("No RPC url provided for chainId: ".concat(t));return new Au(new xg(r,tm("disableProviderPing")))}setHttpProvider(t,e){const r=this.createHttpProvider(t,e);r&&(this.httpProviders[t]=r)}createHttpProviders(){const t={};return this.namespace.chains.forEach((e=>{var r;const i=parseInt(Wg(e));t[i]=this.createHttpProvider(i,null==(r=this.namespace.rpcMap)?void 0:r[e])})),t}getAccounts(){const t=this.namespace.accounts;return t?[...new Set(t.filter((t=>t.split(":")[1]===this.chainId.toString())).map((t=>t.split(":")[2])))]:[]}getHttpProvider(){const t=this.chainId,e=this.httpProviders[t];if(typeof e>"u")throw new Error("JSON-RPC provider for ".concat(t," not found"));return e}async handleSwitchChain(t){var e,r;let i=t.request.params?null==(e=t.request.params[0])?void 0:e.chainId:"0x0";i=i.startsWith("0x")?i:"0x".concat(i);const n=parseInt(i,16);if(this.isChainApproved(n))this.setDefaultChain("".concat(n));else{if(!this.namespace.methods.includes("wallet_switchEthereumChain"))throw new Error("Failed to switch to chain 'eip155:".concat(n,"'. The chain is not approved or the wallet does not support 'wallet_switchEthereumChain' method."));
2await this.client.request({topic:t.topic,request:{method:t.request.method,params:[{chainId:i}]},chainId:null==(r=this.namespace.chains)?void 0:r[0]}),this.setDefaultChain("".concat(n))}return null}isChainApproved(t){return this.namespace.chains.includes("".concat(this.name,":").concat(t))}async getCapabilities(t){var e,r,i;const n=null==(r=null==(e=t.request)?void 0:e.params)?void 0:r[0];if(!n)throw new Error("Missing address parameter in `wallet_getCapabilities` request");const s=this.client.session.get(t.topic),o=(null==(i=null===s||void 0===s?void 0:s.sessionProperties)?void 0:i.capabilities)||{};if(null!=o&&o[n])return null===o||void 0===o?void 0:o[n];const a=await this.client.request(t);try{await this.client.session.update(t.topic,{sessionProperties:fm(um({},s.sessionProperties||{}),{capabilities:fm(um({},o||{}),{[n]:a})})})}catch(c){console.warn("Failed to update session with capabilities",c)}return a}async getCallStatus(t){var e,r;const i=this.client.session.get(t.topic),n=null==(e=i.sessionProperties)?void 0:e.bundler_name;if(n){const e=this.getBundlerUrl(t.chainId,n);try{return await this.getUserOperationReceipt(e,t)}catch(pi){console.warn("Failed to fetch call status from bundler",pi,e)}}const s=null==(r=i.sessionProperties)?void 0:r.bundler_url;if(s)try{return await this.getUserOperationReceipt(s,t)}catch(o){console.warn("Failed to fetch call status from custom bundler",o,s)}if(this.namespace.methods.includes(t.request.method))return await this.client.request(t);throw new Error("Fetching call status not approved by the wallet.")}async getUserOperationReceipt(t,e){var r;const i=new URL(t),n=await fetch(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(au("eth_getUserOperationReceipt",[null==(r=e.request.params)?void 0:r[0]]))});if(!n.ok)throw new Error("Failed to fetch user operation receipt - ".concat(n.status));return await n.json()}getBundlerUrl(t,e){return"".concat(Cg,"?projectId=").concat(this.client.core.projectId,"&chainId=").concat(t,"&bundler=").concat(e)}}class dm{constructor(t){this.name="solana",this.namespace=t.namespace,this.events=tm("events"),this.client=tm("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(t){this.namespace=Object.assign(this.namespace,t)}requestAccounts(){return this.getAccounts()}request(t){return this.namespace.methods.includes(t.request.method)?this.client.request(t):this.getHttpProvider().request(t.request)}setDefaultChain(t,e){this.httpProviders[t]||this.setHttpProvider(t,e),this.chainId=t,this.events.emit(Tg,"".concat(this.name,":").concat(t))}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const t=this.namespace.chains[0];if(!t)throw new Error("ChainId not found");return t.split(":")[1]}getAccounts(){const t=this.namespace.accounts;return t?[...new Set(t.filter((t=>t.split(":")[1]===this.chainId.toString())).map((t=>t.split(":")[2])))]:[]}createHttpProviders(){const t={};return this.namespace.chains.forEach((e=>{var r;const i=Wg(e);t[i]=this.createHttpProvider(i,null==(r=this.namespace.rpcMap)?void 0:r[e])})),t}getHttpProvider(){const t="".concat(this.name,":").concat(this.chainId),e=this.httpProviders[t];if(typeof e>"u")throw new Error("JSON-RPC provider for ".concat(t," not found"));return e}setHttpProvider(t,e){const r=this.createHttpProvider(t,e);r&&(this.httpProviders[t]=r)}createHttpProvider(t,e){const r=e||Vg(t,this.namespace,this.client.core.projectId);if(!r)throw new Error("No RPC url provided for chainId: ".concat(t));return new Au(new xg(r,tm("disableProviderPing")))}}class pm{constructor(t){this.name="cosmos",this.namespace=t.namespace,this.events=tm("events"),this.client=tm("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(t){this.namespace=Object.assign(this.namespace,t)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const t=this.namespace.chains[0];if(!t)throw new Error("ChainId not found");return t.split(":")[1]}request(t){return this.namespace.methods.includes(t.request.method)?this.client.request(t):this.getHttpProvider().request(t.request)}setDefaultChain(t,e){this.httpProviders[t]||this.setHttpProvider(t,e),this.chainId=t,this.events.emit(Tg,"".concat(this.name,":").concat(this.chainId))}getAccounts(){const t=this.namespace.accounts;return t?[...new Set(t.filter((t=>t.split(":")[1]===this.chainId.toString())).map((t=>t.split(":")[2])))]:[]}createHttpProviders(){const t={};return this.namespace.chains.forEach((e=>{var r;const i=Wg(e);t[i]=this.createHttpProvider(i,null==(r=this.namespace.rpcMap)?void 0:r[e])})),t}getHttpProvider(){const t="".concat(this.name,":").concat(this.chainId),e=this.httpProviders[t];if(typeof e>"u")throw new Error("JSON-RPC provider for ".concat(t," not found"));return e}setHttpProvider(t,e){const r=this.createHttpProvider(t,e);r&&(this.httpProviders[t]=r)}createHttpProvider(t,e){const r=e||Vg(t,this.namespace,this.client.core.projectId);if(!r)throw new Error("No RPC url provided for chainId: ".concat(t));return new Au(new xg(r,tm("disableProviderPing")))}}class gm{constructor(t){this.name="algorand",this.namespace=t.namespace,this.events=tm("events"),this.client=tm("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(t){this.namespace=Object.assign(this.namespace,t)}requestAccounts(){return this.getAccounts()}request(t){return this.namespace.methods.includes(t.request.method)?this.client.request(t):this.getHttpProvider().request(t.request)}setDefaultChain(t,e){if(!this.httpProviders[t]){const r=e||Vg("".concat(this.name,":").concat(t),this.namespace,this.client.core.projectId);if(!r)throw new Error("No RPC url provided for chainId: ".concat(t));this.setHttpProvider(t,r)}this.chainId=t,this.events.emit(Tg,"".concat(this.name,":").concat(this.chainId))}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const t=this.namespace.chains[0];if(!t)throw new Error("ChainId not found");return t.split(":")[1]}getAccounts(){const t=this.namespace.accounts;return t?[...new Set(t.filter((t=>t.split(":")[1]===this.chainId.toString())).map((t=>t.split(":")[2])))]:[]}createHttpProviders(){const t={};return this.namespace.chains.forEach((e=>{var r;t[e]=this.createHttpProvider(e,null==(r=this.namespace.rpcMap)?void 0:r[e])})),t}getHttpProvider(){const t="".concat(this.name,":").concat(this.chainId),e=this.httpProviders[t];if(typeof e>"u")throw new Error("JSON-RPC provider for ".concat(t," not found"));return e}setHttpProvider(t,e){const r=this.createHttpProvider(t,e);r&&(this.httpProviders[t]=r)}createHttpProvider(t,e){const r=e||Vg(t,this.namespace,this.client.core.projectId);return typeof r>"u"?void 0:new Au(new xg(r,tm("disableProviderPing")))}}class mm{constructor(t){this.name="cip34",this.namespace=t.namespace,this.events=tm("events"),this.client=tm("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(t){this.namespace=Object.assign(this.namespace,t)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const t=this.namespace.chains[0];if(!t)throw new Error("ChainId not found");return t.split(":")[1]}request(t){return this.namespace.methods.includes(t.request.method)?this.client.request(t):this.getHttpProvider().request(t.request)}setDefaultChain(t,e){this.httpProviders[t]||this.setHttpProvider(t,e),this.chainId=t,this.events.emit(Tg,"".concat(this.name,":").concat(this.chainId))}getAccounts(){const t=this.namespace.accounts;return t?[...new Set(t.filter((t=>t.split(":")[1]===this.chainId.toString())).map((t=>t.split(":")[2])))]:[]}createHttpProviders(){const t={};return this.namespace.chains.forEach((e=>{const r=this.getCardanoRPCUrl(e),i=Wg(e);t[i]=this.createHttpProvider(i,r)})),t}getHttpProvider(){const t="".concat(this.name,":").concat(this.chainId),e=this.httpProviders[t];if(typeof e>"u")throw new Error("JSON-RPC provider for ".concat(t," not found"));return e}getCardanoRPCUrl(t){const e=this.namespace.rpcMap;if(e)return e[t]}setHttpProvider(t,e){const r=this.createHttpProvider(t,e);r&&(this.httpProviders[t]=r)}createHttpProvider(t,e){const r=e||this.getCardanoRPCUrl(t);if(!r)throw new Error("No RPC url provided for chainId: ".concat(t));return new Au(new xg(r,tm("disableProviderPing")))}}class vm{constructor(t){this.name="elrond",this.namespace=t.namespace,this.events=tm("events"),this.client=tm("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(t){this.namespace=Object.assign(this.namespace,t)}requestAccounts(){return this.getAccounts()}request(t){return this.namespace.methods.includes(t.request.method)?this.client.request(t):this.getHttpProvider().request(t.request)}setDefaultChain(t,e){this.httpProviders[t]||this.setHttpProvider(t,e),this.chainId=t,this.events.emit(Tg,"".concat(this.name,":").concat(t))}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const t=this.namespace.chains[0];if(!t)throw new Error("ChainId not found");return t.split(":")[1]}getAccounts(){const t=this.namespace.accounts;return t?[...new Set(t.filter((t=>t.split(":")[1]===this.chainId.toString())).map((t=>t.split(":")[2])))]:[]}createHttpProviders(){const t={};return this.namespace.chains.forEach((e=>{var r;const i=Wg(e);t[i]=this.createHttpProvider(i,null==(r=this.namespace.rpcMap)?void 0:r[e])})),t}getHttpProvider(){const t="".concat(this.name,":").concat(this.chainId),e=this.httpProviders[t];if(typeof e>"u")throw new Error("JSON-RPC provider for ".concat(t," not found"));return e}setHttpProvider(t,e){const r=this.createHttpProvider(t,e);r&&(this.httpProviders[t]=r)}createHttpProvider(t,e){const r=e||Vg(t,this.namespace,this.client.core.projectId);if(!r)throw new Error("No RPC url provided for chainId: ".concat(t));return new Au(new xg(r,tm("disableProviderPing")))}}class bm{constructor(t){this.name="multiversx",this.namespace=t.namespace,this.events=tm("events"),this.client=tm("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(t){this.namespace=Object.assign(this.namespace,t)}requestAccounts(){return this.getAccounts()}request(t){return this.namespace.methods.includes(t.request.method)?this.client.request(t):this.getHttpProvider().request(t.request)}setDefaultChain(t,e){this.httpProviders[t]||this.setHttpProvider(t,e),this.chainId=t,this.events.emit(Tg,"".concat(this.name,":").concat(t))}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const t=this.namespace.chains[0];if(!t)throw new Error("ChainId not found");return t.split(":")[1]}getAccounts(){const t=this.namespace.accounts;return t?[...new Set(t.filter((t=>t.split(":")[1]===this.chainId.toString())).map((t=>t.split(":")[2])))]:[]}createHttpProviders(){const t={};return this.namespace.chains.forEach((e=>{var r;const i=Wg(e);t[i]=this.createHttpProvider(i,null==(r=this.namespace.rpcMap)?void 0:r[e])})),t}getHttpProvider(){const t="".concat(this.name,":").concat(this.chainId),e=this.httpProviders[t];if(typeof e>"u")throw new Error("JSON-RPC provider for ".concat(t," not found"));return e}setHttpProvider(t,e){const r=this.createHttpProvider(t,e);r&&(this.httpProviders[t]=r)}createHttpProvider(t,e){const r=e||Vg(t,this.namespace,this.client.core.projectId);if(!r)throw new Error("No RPC url provided for chainId: ".concat(t));return new Au(new xg(r,tm("disableProviderPing")))}}class ym{constructor(t){this.name="near",this.namespace=t.namespace,this.events=tm("events"),this.client=tm("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(t){this.namespace=Object.assign(this.namespace,t)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const t=this.namespace.chains[0];if(!t)throw new Error("ChainId not found");return t.split(":")[1]}request(t){return this.namespace.methods.includes(t.request.method)?this.client.request(t):this.getHttpProvider().request(t.request)}setDefaultChain(t,e){if(this.chainId=t,!this.httpProviders[t]){const r=e||Vg("".concat(this.name,":").concat(t),this.namespace);if(!r)throw new Error("No RPC url provided for chainId: ".concat(t));this.setHttpProvider(t,r)}this.events.emit(Tg,"".concat(this.name,":").concat(this.chainId))}getAccounts(){const t=this.namespace.accounts;return t&&t.filter((t=>t.split(":")[1]===this.chainId.toString())).map((t=>t.split(":")[2]))||[]}createHttpProviders(){const t={};return this.namespace.chains.forEach((e=>{var r;t[e]=this.createHttpProvider(e,null==(r=this.namespace.rpcMap)?void 0:r[e])})),t}getHttpProvider(){const t="".concat(this.name,":").concat(this.chainId),e=this.httpProviders[t];if(typeof e>"u")throw new Error("JSON-RPC provider for ".concat(t," not found"));return e}setHttpProvider(t,e){const r=this.createHttpProvider(t,e);r&&(this.httpProviders[t]=r)}createHttpProvider(t,e){const r=e||Vg(t,this.namespace);return typeof r>"u"?void 0:new Au(new xg(r,tm("disableProviderPing")))}}class wm{constructor(t){this.name=Rg,this.namespace=t.namespace,this.events=tm("events"),this.client=tm("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(t){this.namespace.chains=[...new Set((this.namespace.chains||[]).concat(t.chains||[]))],this.namespace.accounts=[...new Set((this.namespace.accounts||[]).concat(t.accounts||[]))],this.namespace.methods=[...new Set((this.namespace.methods||[]).concat(t.methods||[]))],this.namespace.events=[...new Set((this.namespace.events||[]).concat(t.events||[]))],this.httpProviders=this.createHttpProviders()}requestAccounts(){return this.getAccounts()}request(t){return this.namespace.methods.includes(t.request.method)?this.client.request(t):this.getHttpProvider(t.chainId).request(t.request)}setDefaultChain(t,e){this.httpProviders[t]||this.setHttpProvider(t,e),this.chainId=t,this.events.emit(Tg,"".concat(this.name,":").concat(t))}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const t=this.namespace.chains[0];if(!t)throw new Error("ChainId not found");return t.split(":")[1]}getAccounts(){const t=this.namespace.accounts;return t?[...new Set(t.filter((t=>t.split(":")[1]===this.chainId.toString())).map((t=>t.split(":")[2])))]:[]}createHttpProviders(){var t,e;const r={};return null==(e=null==(t=this.namespace)?void 0:t.accounts)||e.forEach((t=>{const e=Ve(t);r["".concat(e.namespace,":").concat(e.reference)]=this.createHttpProvider(t)})),r}getHttpProvider(t){const e=this.httpProviders[t];if(typeof e>"u")throw new Error("JSON-RPC provider for ".concat(t," not found"));return e}setHttpProvider(t,e){const r=this.createHttpProvider(t,e);r&&(this.httpProviders[t]=r)}createHttpProvider(t,e){const r=e||Vg(t,this.namespace,this.client.core.projectId);if(!r)throw new Error("No RPC url provided for chainId: ".concat(t));return new Au(new xg(r,tm("disableProviderPing")))}}var _m=Object.defineProperty,Am=Object.defineProperties,Em=Object.getOwnPropertyDescriptors,Sm=Object.getOwnPropertySymbols,Mm=Object.prototype.hasOwnProperty,Im
2=Object.prototype.propertyIsEnumerable,xm=(t,e,r)=>e in t?_m(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Pm=(t,e)=>{for(var r in e||(e={}))Mm.call(e,r)&&xm(t,r,e[r]);if(Sm)for(var r of Sm(e))Im.call(e,r)&&xm(t,r,e[r]);return t},Om=(t,e)=>Am(t,Em(e));class Nm{constructor(t){this.events=new(b()),this.rpcProviders={},this.shouldAbortPairingAttempt=!1,this.maxPairingAttempts=10,this.disableProviderPing=!1,this.providerOpts=t,this.logger=typeof(null===t||void 0===t?void 0:t.logger)<"u"&&"string"!=typeof(null===t||void 0===t?void 0:t.logger)?t.logger:uh()(Ph({level:(null===t||void 0===t?void 0:t.logger)||Pg})),this.disableProviderPing=(null===t||void 0===t?void 0:t.disableProviderPing)||!1}static async init(t){const e=new Nm(t);return await e.initialize(),e}async request(t,e,r){const[i,n]=this.validateChain(e);if(!this.session)throw new Error("Please call connect() before request()");return await this.getProvider(i).request({request:Pm({},t),chainId:"".concat(i,":").concat(n),topic:this.session.topic,expiry:r})}sendAsync(t,e,r,i){const n=(new Date).getTime();this.request(t,r,i).then((t=>e(null,cu(n,t)))).catch((t=>e(t,void 0)))}async enable(){if(!this.client)throw new Error("Sign Client not initialized");return this.session||await this.connect({namespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties}),await this.requestAccounts()}async disconnect(){var t;if(!this.session)throw new Error("Please call connect() before enable()");await this.client.disconnect({topic:null==(t=this.session)?void 0:t.topic,reason:nc("USER_DISCONNECTED")}),await this.cleanup()}async connect(t){if(!this.client)throw new Error("Sign Client not initialized");if(this.setNamespaces(t),await this.cleanupPendingPairings(),!t.skipPairing)return await this.pair(t.pairingTopic)}async authenticate(t,e){if(!this.client)throw new Error("Sign Client not initialized");this.setNamespaces(t),await this.cleanupPendingPairings();const{uri:r,response:i}=await this.client.authenticate(t,e);r&&(this.uri=r,this.events.emit("display_uri",r));const n=await i();if(this.session=n.session,this.session){const t=Xg(this.session.namespaces);this.namespaces=Jg(this.namespaces,t),this.persist("namespaces",this.namespaces),this.onConnect()}return n}on(t,e){this.events.on(t,e)}once(t,e){this.events.once(t,e)}removeListener(t,e){this.events.removeListener(t,e)}off(t,e){this.events.off(t,e)}get isWalletConnect(){return!0}async pair(t){this.shouldAbortPairingAttempt=!1;let e=0;do{if(this.shouldAbortPairingAttempt)throw new Error("Pairing aborted");if(e>=this.maxPairingAttempts)throw new Error("Max auto pairing attempts reached");const{uri:r,approval:i}=await this.client.connect({pairingTopic:t,requiredNamespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties});r&&(this.uri=r,this.events.emit("display_uri",r)),await i().then((t=>{this.session=t;const e=Xg(t.namespaces);this.namespaces=Jg(this.namespaces,e),this.persist("namespaces",this.namespaces)})).catch((t=>{if(t.message!==Fp)throw t;e++}))}while(!this.session);return this.onConnect(),this.session}setDefaultChain(t,e){try{if(!this.session)return;const[r,i]=this.validateChain(t),n=this.getProvider(r);n.name===Rg?n.setDefaultChain("".concat(r,":").concat(i),e):n.setDefaultChain(i,e)}catch(r){if(!/Please call connect/.test(r.message))throw r}}async cleanupPendingPairings(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.logger.info("Cleaning up inactive pairings...");const e=this.client.pairing.getAll();if(sc(e)){for(const r of e)t.deletePairings?this.client.core.expirer.set(r.topic,0):await this.client.core.relayer.subscriber.unsubscribe(r.topic);this.logger.info("Inactive pairings cleared: ".concat(e.length))}}abortPairingAttempt(){this.shouldAbortPairingAttempt=!0}async checkStorage(){if(this.namespaces=await this.getFromStore("namespaces"),this.optionalNamespaces=await this.getFromStore("optionalNamespaces")||{},this.client.session.length){const t=this.client.session.keys.length-1;this.session=this.client.session.get(this.client.session.keys[t]),this.createProviders()}}async initialize(){this.logger.trace("Initialized"),await this.createClient(),await this.checkStorage(),this.registerEventListeners()}async createClient(){this.client=this.providerOpts.client||await pg.init({core:this.providerOpts.core,logger:this.providerOpts.logger||Pg,relayUrl:this.providerOpts.relayUrl||"wss://relay.walletconnect.org",projectId:this.providerOpts.projectId,metadata:this.providerOpts.metadata,storageOptions:this.providerOpts.storageOptions,storage:this.providerOpts.storage,name:this.providerOpts.name,customStoragePrefix:this.providerOpts.customStoragePrefix,telemetryEnabled:this.providerOpts.telemetryEnabled}),this.logger.trace("SignClient Initialized")}createProviders(){if(!this.client)throw new Error("Sign Client not initialized");if(!this.session)throw new Error("Session not initialized. Please call connect() before enable()");const t=[...new Set(Object.keys(this.session.namespaces).map((t=>$a(t))))];em("client",this.client),em("events",this.events),em("disableProviderPing",this.disableProviderPing),t.forEach((t=>{if(!this.session)return;const e=function(t,e){const r=Object.keys(e.namespaces).filter((e=>e.includes(t)));if(!r.length)return[];const i=[];return r.forEach((t=>{const r=e.namespaces[t].accounts;i.push(...r)})),i}(t,this.session),r=Gg(e),i=Jg(this.namespaces,this.optionalNamespaces),n=Om(Pm({},i[t]),{accounts:e,chains:r});switch(t){case"eip155":this.rpcProviders[t]=new lm({namespace:n});break;case"algorand":this.rpcProviders[t]=new gm({namespace:n});break;case"solana":this.rpcProviders[t]=new dm({namespace:n});break;case"cosmos":this.rpcProviders[t]=new pm({namespace:n});break;case"polkadot":this.rpcProviders[t]=new rm({namespace:n});break;case"cip34":this.rpcProviders[t]=new mm({namespace:n});break;case"elrond":this.rpcProviders[t]=new vm({namespace:n});break;case"multiversx":this.rpcProviders[t]=new bm({namespace:n});break;case"near":this.rpcProviders[t]=new ym({namespace:n});break;default:this.rpcProviders[Rg]?this.rpcProviders[Rg].updateNamespace(n):this.rpcProviders[Rg]=new wm({namespace:n})}}))}registerEventListeners(){if(typeof this.client>"u")throw new Error("Sign Client is not initialized");this.client.on("session_ping",(t=>{this.events.emit("session_ping",t)})),this.client.on("session_event",(t=>{const{params:e}=t,{event:r}=e;
2if("accountsChanged"===r.name){const t=r.data;t&&sc(t)&&this.events.emit("accountsChanged",t.map(Qg))}else if("chainChanged"===r.name){const t=e.chainId,r=e.event.data,i=$a(t),n=Zg(t)!==Zg(r)?"".concat(i,":").concat(Zg(r)):t;this.onChainChanged(n)}else this.events.emit(r.name,r.data);this.events.emit("session_event",t)})),this.client.on("session_update",(t=>{let{topic:e,params:r}=t;var i;const{namespaces:n}=r,s=null==(i=this.client)?void 0:i.session.get(e);this.session=Om(Pm({},s),{namespaces:n}),this.onSessionUpdate(),this.events.emit("session_update",{topic:e,params:r})})),this.client.on("session_delete",(async t=>{await this.cleanup(),this.events.emit("session_delete",t),this.events.emit("disconnect",Om(Pm({},nc("USER_DISCONNECTED")),{data:t.topic}))})),this.on(Tg,(t=>{this.onChainChanged(t,!0)}))}getProvider(t){return this.rpcProviders[t]||this.rpcProviders[Rg]}onSessionUpdate(){Object.keys(this.rpcProviders).forEach((t=>{var e;this.getProvider(t).updateNamespace(null==(e=this.session)?void 0:e.namespaces[t])}))}setNamespaces(t){const{namespaces:e,optionalNamespaces:r,sessionProperties:i}=t;e&&Object.keys(e).length&&(this.namespaces=e),r&&Object.keys(r).length&&(this.optionalNamespaces=r),this.sessionProperties=i,this.persist("namespaces",e),this.persist("optionalNamespaces",r)}validateChain(t){const[e,r]=(null===t||void 0===t?void 0:t.split(":"))||["",""];if(!this.namespaces||!Object.keys(this.namespaces).length)return[e,r];if(e&&!Object.keys(this.namespaces||{}).map((t=>$a(t))).includes(e))throw new Error("Namespace '".concat(e,"' is not configured. Please call connect() first with namespace config."));if(e&&r)return[e,r];const i=$a(Object.keys(this.namespaces)[0]);return[i,this.rpcProviders[i].getDefaultChain()]}async requestAccounts(){const[t]=this.validateChain();return await this.getProvider(t).requestAccounts()}onChainChanged(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!this.namespaces)return;const[r,i]=this.validateChain(t);i&&(e||this.getProvider(r).setDefaultChain(i),this.namespaces[r]?this.namespaces[r].defaultChain=i:this.namespaces["".concat(r,":").concat(i)]?this.namespaces["".concat(r,":").concat(i)].defaultChain=i:this.namespaces["".concat(r,":").concat(i)]={defaultChain:i},this.persist("namespaces",this.namespaces),this.events.emit("chainChanged",i))}onConnect(){this.createProviders(),this.events.emit("connect",{session:this.session})}async cleanup(){this.session=void 0,this.namespaces=void 0,this.optionalNamespaces=void 0,this.sessionProperties=void 0,this.persist("namespaces",void 0),this.persist("optionalNamespaces",void 0),this.persist("sessionProperties",void 0),await this.cleanupPendingPairings({deletePairings:!0})}persist(t,e){this.client.core.storage.setItem("".concat(Og,"/").concat(t),e)}async getFromStore(t){return await this.client.core.storage.getItem("".concat(Og,"/").concat(t))}}const Rm=Nm,Cm="".concat("wc","@2:").concat("ethereum_provider",":"),Tm=["eth_sendTransaction","personal_sign"],km=["eth_accounts","eth_requestAccounts","eth_sendRawTransaction","eth_sign","eth_signTransaction","eth_signTypedData","eth_signTypedData_v3","eth_signTypedData_v4","eth_sendTransaction","personal_sign","wallet_switchEthereumChain","wallet_addEthereumChain","wallet_getPermissions","wallet_requestPermissions","wallet_registerOnboarding","wallet_watchAsset","wallet_scanQRCode","wallet_sendCalls","wallet_getCapabilities","wallet_getCallsStatus","wallet_showCallsStatus"],Lm=["chainChanged","accountsChanged"],qm=["chainChanged","accountsChanged","message","disconnect","connect"];var Dm=Object.defineProperty,Um=Object.defineProperties,Bm=Object.getOwnPropertyDescriptors,jm=Object.getOwnPropertySymbols,zm=Object.prototype.hasOwnProperty,Fm=Object.prototype.propertyIsEnumerable,Hm=(t,e,r)=>e in t?Dm(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Km=(t,e)=>{for(var r in e||(e={}))zm.call(e,r)&&Hm(t,r,e[r]);if(jm)for(var r of jm(e))Fm.call(e,r)&&Hm(t,r,e[r]);return t},Vm=(t,e)=>Um(t,Bm(e));function Wm(t){return Number(t[0].split(":")[1])}function Gm(t){return"0x".concat(t.toString(16))}class Jm{constructor(){this.events=new v.EventEmitter,this.namespace="eip155",this.accounts=[],this.chainId=1,this.STORAGE_KEY=Cm,this.on=(t,e)=>(this.events.on(t,e),this),this.once=(t,e)=>(this.events.once(t,e),this),this.removeListener=(t,e)=>(this.events.removeListener(t,e),this),this.off=(t,e)=>(this.events.off(t,e),this),this.parseAccount=t=>this.isCompatibleChainId(t)?this.parseAccountId(t).address:t,this.signer={},this.rpc={}}static async init(t){const e=new Jm;return await e.initialize(t),e}async request(t,e){return await this.signer.request(t,this.formatChainId(this.chainId),e)}
2sendAsync(t,e,r){this.signer.sendAsync(t,e,this.formatChainId(this.chainId),r)}get connected(){return!!this.signer.client&&this.signer.client.core.relayer.connected}get connecting(){return!!this.signer.client&&this.signer.client.core.relayer.connecting}async enable(){return this.session||await this.connect(),await this.request({method:"eth_requestAccounts"})}async connect(t){if(!this.signer.client)throw new Error("Provider not initialized. Call init() first");this.loadConnectOpts(t);const{required:e,optional:r}=function(t){const{chains:e,optionalChains:r,methods:i,optionalMethods:n,events:s,optionalEvents:o,rpcMap:a}=t;if(!sc(e))throw new Error("Invalid chains");const c={chains:e,methods:i||Tm,events:s||Lm,rpcMap:Km({},e.length?{[Wm(e)]:a[Wm(e)]}:{})},h=null===s||void 0===s?void 0:s.filter((t=>!Lm.includes(t))),u=null===i||void 0===i?void 0:i.filter((t=>!Tm.includes(t)));if(!r&&!o&&!n&&(null==h||!h.length)&&(null==u||!u.length))return{required:e.length?c:void 0};const f=(null===h||void 0===h?void 0:h.length)&&(null===u||void 0===u?void 0:u.length)||!r,l={chains:[...new Set(f?c.chains.concat(r||[]):r)],methods:[...new Set(c.methods.concat(null!=n&&n.length?n:km))],events:[...new Set(c.events.concat(null!=o&&o.length?o:qm))],rpcMap:a};return{required:e.length?c:void 0,optional:r.length?l:void 0}}(this.rpc);try{const i=await new Promise((async(i,n)=>{var s;this.rpc.showQrModal&&(null==(s=this.modal)||s.subscribeModal((t=>{!t.open&&!this.signer.session&&(this.signer.abortPairingAttempt(),n(new Error("Connection request reset. Please try again.")))}))),await this.signer.connect(Vm(Km({namespaces:Km({},e&&{[this.namespace]:e})},r&&{optionalNamespaces:{[this.namespace]:r}}),{pairingTopic:null===t||void 0===t?void 0:t.pairingTopic})).then((t=>{i(t)})).catch((t=>{n(new Error(t.message))}))}));if(!i)return;const n=We(i.namespaces,[this.namespace]);this.setChainIds(this.rpc.chains.length?this.rpc.chains:n),this.setAccounts(n),this.events.emit("connect",{chainId:Gm(this.chainId)})}catch(i){throw this.signer.logger.error(i),i}finally{this.modal&&this.modal.closeModal()}}async authenticate(t,e){if(!this.signer.client)throw new Error("Provider not initialized. Call init() first");this.loadConnectOpts({chains:null===t||void 0===t?void 0:t.chains});try{const r=await new Promise((async(r,i)=>{var n;this.rpc.showQrModal&&(null==(n=this.modal)||n.subscribeModal((t=>{!t.open&&!this.signer.session&&(this.signer.abortPairingAttempt(),i(new Error("Connection request reset. Please try again.")))}))),await this.signer.authenticate(Vm(Km({},t),{chains:this.rpc.chains}),e).then((t=>{r(t)})).catch((t=>{i(new Error(t.message))}))})),i=r.session;if(i){const t=We(i.namespaces,[this.namespace]);this.setChainIds(this.rpc.chains.length?this.rpc.chains:t),this.setAccounts(t),this.events.emit("connect",{chainId:Gm(this.chainId)})}return r}catch(Ih){throw this.signer.logger.error(Ih),Ih}finally{this.modal&&this.modal.closeModal()}}async disconnect(){this.session&&await this.signer.disconnect(),this.reset()}get isWalletConnect(){return!0}get session(){return this.signer.session}registerEventListeners(){this.signer.on("session_event",(t=>{const{params:e}=t,{event:r}=e;"accountsChanged"===r.name?(this.accounts=this.parseAccounts(r.data),this.events.emit("accountsChanged",this.accounts)):"chainChanged"===r.name?this.setChainId(this.formatChainId(r.data)):this.events.emit(r.name,r.data),this.events.emit("session_event",t)})),this.signer.on("chainChanged",(t=>{const e=parseInt(t);this.chainId=e,this.events.emit("chainChanged",Gm(this.chainId)),this.persist()})),this.signer.on("session_update",(t=>{this.events.emit("session_update",t)})),this.signer.on("session_delete",(t=>{this.reset(),this.events.emit("session_delete",t),this.events.emit("disconnect",Vm(Km({},nc("USER_DISCONNECTED")),{data:t.topic,name:"USER_DISCONNECTED"}))})),this.signer.on("display_uri",(t=>{var e,r;this.rpc.showQrModal&&(null==(e=this.modal)||e.closeModal(),null==(r=this.modal)||r.openModal({uri:t})),this.events.emit("display_uri",t)}))}switchEthereumChain(t){this.request({method:"wallet_switchEthereumChain",params:[{chainId:t.toString(16)}]})}isCompatibleChainId(t){return"string"==typeof t&&t.startsWith("".concat(this.namespace,":"))}formatChainId(t){return"".concat(this.namespace,":").concat(t)}parseChainId(t){return Number(t.split(":")[1])}setChainIds(t){const e=t.filter((t=>this.isCompatibleChainId(t))).map((t=>this.parseChainId(t)));e.length&&(this.chainId=e[0],this.events.emit("chainChanged",Gm(this.chainId)),this.persist())}setChainId(t){if(this.isCompatibleChainId(t)){const e=this.parseChainId(t);this.chainId=e,this.switchEthereumChain(e)}}parseAccountId(t){const[e,r,i]=t.split(":");return{chainId:"".concat(e,":").concat(r),address:i}}setAccounts(t){this.accounts=t.filter((t=>this.parseChainId(this.parseAccountId(t).chainId)===this.chainId)).map((t=>this.parseAccountId(t).address)),this.events.emit("accountsChanged",this.accounts)}getRpcConfig(t){var e,r;const i=null!=(e=null===t||void 0===t?void 0:t.chains)?e:[],n=null!=(r=null===t||void 0===t?void 0:t.optionalChains)?r:[],s=i.concat(n);if(!s.length)throw new Error("No chains specified in either `chains` or `optionalChains`");const o=i.length?(null===t||void 0===t?void 0:t.methods)||Tm:[],a=i.length?(null===t||void 0===t?void 0:t.events)||Lm:[],c=(null===t||void 0===t?void 0:t.optionalMethods)||[],h=(null===t||void 0===t?void 0:t.optionalEvents)||[],u=(null===t||void 0===t?void 0:t.rpcMap)||this.buildRpcMap(s,t.projectId),f=(null===t||void 0===t?void 0:t.qrModalOptions)||void 0;return{chains:null===i||void 0===i?void 0:i.map((t=>this.formatChainId(t))),optionalChains:n.map((t=>this.formatChainId(t))),methods:o,events:a,optionalMethods:c,optionalEvents:h,rpcMap:u,showQrModal:!(null==t||!t.showQrModal),qrModalOptions:f,projectId:t.projectId,metadata:t.metadata}}buildRpcMap(t,e){const r={};return t.forEach((t=>{r[t]=this.getRpcUrl(t,e)})),r}async initialize(t){if(this.rpc=this.getRpcConfig(t),this.chainId=this.rpc.chains.length?Wm(this.rpc.chains):Wm(this.rpc.optionalChains),this.signer=await Rm.init({projectId:this.rpc.projectId,metadata:this.rpc.metadata,disableProviderPing:t.disableProviderPing,relayUrl:t.relayUrl,storageOptions:t.storageOptions,customStoragePrefix:t.customStoragePrefix,telemetryEnabled:t.telemetryEnabled}),this.registerEventListeners(),await this.loadPersistedSession(),this.rpc.showQrModal){let t;
2try{const{WalletConnectModal:e}=await r.e(7171).then(r.bind(r,67171));t=e}catch(e){throw new Error("To use QR modal, please install @walletconnect/modal package")}if(t)try{this.modal=new t(Km({projectId:this.rpc.projectId},this.rpc.qrModalOptions))}catch(Ih){throw this.signer.logger.error(Ih),new Error("Could not generate WalletConnectModal Instance")}}}loadConnectOpts(t){if(!t)return;const{chains:e,optionalChains:r,rpcMap:i}=t;e&&sc(e)&&(this.rpc.chains=e.map((t=>this.formatChainId(t))),e.forEach((t=>{this.rpc.rpcMap[t]=(null===i||void 0===i?void 0:i[t])||this.getRpcUrl(t)}))),r&&sc(r)&&(this.rpc.optionalChains=[],this.rpc.optionalChains=null===r||void 0===r?void 0:r.map((t=>this.formatChainId(t))),r.forEach((t=>{this.rpc.rpcMap[t]=(null===i||void 0===i?void 0:i[t])||this.getRpcUrl(t)})))}getRpcUrl(t,e){var r;return(null==(r=this.rpc.rpcMap)?void 0:r[t])||"".concat("https://rpc.walletconnect.org/v1/","?chainId=eip155:").concat(t,"&projectId=").concat(e||this.rpc.projectId)}async loadPersistedSession(){if(this.session)try{const t=await this.signer.client.core.storage.getItem("".concat(this.STORAGE_KEY,"/chainId")),e=this.session.namespaces["".concat(this.namespace,":").concat(t)]?this.session.namespaces["".concat(this.namespace,":").concat(t)]:this.session.namespaces[this.namespace];this.setChainIds(t?[this.formatChainId(t)]:null===e||void 0===e?void 0:e.accounts),this.setAccounts(null===e||void 0===e?void 0:e.accounts)}catch(t){this.signer.logger.error("Failed to load persisted session, clearing state..."),this.signer.logger.error(t),await this.disconnect().catch((t=>this.signer.logger.warn(t)))}}reset(){this.chainId=1,this.accounts=[]}persist(){this.session&&this.signer.client.core.storage.setItem("".concat(this.STORAGE_KEY,"/chainId"),this.chainId)}parseAccounts(t){return"string"==typeof t||t instanceof String?[this.parseAccount(t)]:t.map((t=>this.parseAccount(t)))}}const Ym=Jm},6177:(t,e,r)=>{var i="undefined"!==typeof globalThis&&globalThis||"undefined"!==typeof self&&self||"undefined"!==typeof r.g&&r.g,n=function(){function t(){this.fetch=!1,this.DOMException=i.DOMException}return t.prototype=i,new t}();!function(t){!function(e){var i="undefined"!==typeof t&&t||"undefined"!==typeof self&&self||"undefined"!==typeof r.g&&r.g||{},n="URLSearchParams"in i,s="Symbol"in i&&"iterator"in Symbol,o="FileReader"in i&&"Blob"in i&&function(){try{return new Blob,!0}catch(t){return!1}}(),a="FormData"in i,c="ArrayBuffer"in i;if(c)var h=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],u=ArrayBuffer.isView||function(t){return t&&h.indexOf(Object.prototype.toString.call(t))>-1};function f(t){if("string"!==typeof t&&(t=String(t)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(t)||""===t)throw new TypeError('Invalid character in header field name: "'+t+'"');return t.toLowerCase()}function l(t){return"string"!==typeof t&&(t=String(t)),t}function d(t){var e={next:function(){var e=t.shift();return{done:void 0===e,value:e}}};return s&&(e[Symbol.iterator]=function(){return e}),e}function p(t){this.map={},t instanceof p?t.forEach((function(t,e){this.append(e,t)}),this):Array.isArray(t)?t.forEach((function(t){if(2!=t.length)throw new TypeError("Headers constructor: expected name/value pair to be length 2, found"+t.length);this.append(t[0],t[1])}),this):t&&Object.getOwnPropertyNames(t).forEach((function(e){this.append(e,t[e])}),this)}function g(t){if(!t._noBody)return t.bodyUsed?Promise.reject(new TypeError("Already read")):void(t.bodyUsed=!0)}function m(t){return new Promise((function(e,r){t.onload=function(){e(t.result)},t.onerror=function(){r(t.error)}}))}function v(t){var e=new FileReader,r=m(e);return e.readAsArrayBuffer(t),r}function b(t){if(t.slice)return t.slice(0);var e=new Uint8Array(t.byteLength);return e.set(new Uint8Array(t)),e.buffer}function y(){return this.bodyUsed=!1,this._initBody=function(t){var e;this.bodyUsed=this.bodyUsed,this._bodyInit=t,t?"string"===typeof t?this._bodyText=t:o&&Blob.prototype.isPrototypeOf(t)?this._bodyBlob=t:a&&FormData.prototype.isPrototypeOf(t)?this._bodyFormData=t:n&&URLSearchParams.prototype.isPrototypeOf(t)?this._bodyText=t.toString():c&&o&&((e=t)&&DataView.prototype.isPrototypeOf(e))?(this._bodyArrayBuffer=b(t.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):c&&(ArrayBuffer.prototype.isPrototypeOf(t)||u(t))?this._bodyArrayBuffer=b(t):this._bodyText=t=Object.prototype.toString.call(t):(this._noBody=!0,this._bodyText=""),this.headers.get("content-type")||("string"===typeof t?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):n&&URLSearchParams.prototype.isPrototypeOf(t)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},o&&(this.blob=function(){var t=g(this);if(t)return t;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))}),this.arrayBuffer=function(){if(this._bodyArrayBuffer){var t=g(this);return t||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}if(o)return this.blob().then(v);throw new Error("could not read as ArrayBuffer")},this.text=function(){var t=g(this);if(t)return t;if(this._bodyBlob)return function(t){var e=new FileReader,r=m(e),i=/charset=([A-Za-z0-9_-]+)/.exec(t.type),n=i?i[1]:"utf-8";return e.readAsText(t,n),r}(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(function(t){for(var e=new Uint8Array(t),r=new Array(e.length),i=0;i<e.length;i++)r[i]=String.fromCharCode(e[i]);return r.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},a&&(this.formData=function(){return this.text().then(A)}),this.json=function(){return this.text().then(JSON.parse)},this}p.prototype.append=function(t,e){t=f(t),e=l(e);var r=this.map[t];this.map[t]=r?r+", "+e:e},p.prototype.delete=function(t){delete this.map[f(t)]},p.prototype.get=function(t){return t=f(t),this.has(t)?this.map[t]:null},p.prototype.has=function(t){return this.map.hasOwnProperty(f(t))},p.prototype.set=function(t,e){this.map[f(t)]=l(e)},p.prototype.forEach=function(t,e){for(var r in this.map)this.map.hasOwnProperty(r)&&t.call(e,this.map[r],r,this)},p.prototype.keys=function(){var t=[];return this.forEach((function(e,r){t.push(r)})),d(t)},p.prototype.values=function(){var t=[];return this.forEach((function(e){t.push(e)})),d(t)},p.prototype.entries=function(){var t=[];return this.forEach((function(e,r){t.push([r,e])})),d(t)},s&&(p.prototype[Symbol.iterator]=p.prototype.entries);var w=["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"];function _(t,e){if(!(this instanceof _))throw new TypeError('Please use the "new" operator, this DOM object c
2onstructor cannot be called as a function.');var r=(e=e||{}).body;if(t instanceof _){if(t.bodyUsed)throw new TypeError("Already read");this.url=t.url,this.credentials=t.credentials,e.headers||(this.headers=new p(t.headers)),this.method=t.method,this.mode=t.mode,this.signal=t.signal,r||null==t._bodyInit||(r=t._bodyInit,t.bodyUsed=!0)}else this.url=String(t);if(this.credentials=e.credentials||this.credentials||"same-origin",!e.headers&&this.headers||(this.headers=new p(e.headers)),this.method=function(t){var e=t.toUpperCase();return w.indexOf(e)>-1?e:t}(e.method||this.method||"GET"),this.mode=e.mode||this.mode||null,this.signal=e.signal||this.signal||function(){if("AbortController"in i)return(new AbortController).signal}(),this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&r)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(r),("GET"===this.method||"HEAD"===this.method)&&("no-store"===e.cache||"no-cache"===e.cache)){var n=/([?&])_=[^&]*/;if(n.test(this.url))this.url=this.url.replace(n,"$1_="+(new Date).getTime());else{this.url+=(/\?/.test(this.url)?"&":"?")+"_="+(new Date).getTime()}}}function A(t){var e=new FormData;return t.trim().split("&").forEach((function(t){if(t){var r=t.split("="),i=r.shift().replace(/\+/g," "),n=r.join("=").replace(/\+/g," ");e.append(decodeURIComponent(i),decodeURIComponent(n))}})),e}function E(t){var e=new p;return t.replace(/\r?\n[\t ]+/g," ").split("\r").map((function(t){return 0===t.indexOf("\n")?t.substr(1,t.length):t})).forEach((function(t){var r=t.split(":"),i=r.shift().trim();if(i){var n=r.join(":").trim();try{e.append(i,n)}catch(s){console.warn("Response "+s.message)}}})),e}function S(t,e){if(!(this instanceof S))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');if(e||(e={}),this.type="default",this.status=void 0===e.status?200:e.status,this.status<200||this.status>599)throw new RangeError("Failed to construct 'Response': The status provided (0) is outside the range [200, 599].");this.ok=this.status>=200&&this.status<300,this.statusText=void 0===e.statusText?"":""+e.statusText,this.headers=new p(e.headers),this.url=e.url||"",this._initBody(t)}_.prototype.clone=function(){return new _(this,{body:this._bodyInit})},y.call(_.prototype),y.call(S.prototype),S.prototype.clone=function(){return new S(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new p(this.headers),url:this.url})},S.error=function(){var t=new S(null,{status:200,statusText:""});return t.ok=!1,t.status=0,t.type="error",t};var M=[301,302,303,307,308];S.redirect=function(t,e){if(-1===M.indexOf(e))throw new RangeError("Invalid status code");return new S(null,{status:e,headers:{location:t}})},e.DOMException=i.DOMException;try{new e.DOMException}catch(x){e.DOMException=function(t,e){this.message=t,this.name=e;var r=Error(t);this.stack=r.stack},e.DOMException.prototype=Object.create(Error.prototype),e.DOMException.prototype.constructor=e.DOMException}function I(t,r){return new Promise((function(n,s){var a=new _(t,r);
2if(a.signal&&a.signal.aborted)return s(new e.DOMException("Aborted","AbortError"));var h=new XMLHttpRequest;function u(){h.abort()}if(h.onload=function(){var t={statusText:h.statusText,headers:E(h.getAllResponseHeaders()||"")};0===a.url.indexOf("file://")&&(h.status<200||h.status>599)?t.status=200:t.status=h.status,t.url="responseURL"in h?h.responseURL:t.headers.get("X-Request-URL");var e="response"in h?h.response:h.responseText;setTimeout((function(){n(new S(e,t))}),0)},h.onerror=function(){setTimeout((function(){s(new TypeError("Network request failed"))}),0)},h.ontimeout=function(){setTimeout((function(){s(new TypeError("Network request timed out"))}),0)},h.onabort=function(){setTimeout((function(){s(new e.DOMException("Aborted","AbortError"))}),0)},h.open(a.method,function(t){try{return""===t&&i.location.href?i.location.href:t}catch(e){return t}}(a.url),!0),"include"===a.credentials?h.withCredentials=!0:"omit"===a.credentials&&(h.withCredentials=!1),"responseType"in h&&(o?h.responseType="blob":c&&(h.responseType="arraybuffer")),r&&"object"===typeof r.headers&&!(r.headers instanceof p||i.Headers&&r.headers instanceof i.Headers)){var d=[];Object.getOwnPropertyNames(r.headers).forEach((function(t){d.push(f(t)),h.setRequestHeader(t,l(r.headers[t]))})),a.headers.forEach((function(t,e){-1===d.indexOf(e)&&h.setRequestHeader(e,t)}))}else a.headers.forEach((function(t,e){h.setRequestHeader(e,t)}));a.signal&&(a.signal.addEventListener("abort",u),h.onreadystatechange=function(){4===h.readyState&&a.signal.removeEventListener("abort",u)}),h.send("undefined"===typeof a._bodyInit?null:a._bodyInit)}))}I.polyfill=!0,i.fetch||(i.fetch=I,i.Headers=p,i.Request=_,i.Response=S),e.Headers=p,e.Request=_,e.Response=S,e.fetch=I,Object.defineProperty(e,"__esModule",{value:!0})}({})}(n),n.fetch.ponyfill=!0,delete n.fetch.polyfill;var s=i.fetch?i:n;(e=s.fetch).default=s.fetch,e.fetch=s.fetch,e.Headers=s.Headers,e.Request=s.Request,e.Response=s.Response,t.exports=e},32909:t=>{"use strict";t.exports=function(){throw new Error("ws does not work in the browser. Browser clients must use the native WebSocket object")}},36388:()=>{},48251:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const i=r(56121);i.__exportStar(r(8951),e),i.__exportStar(r(45746),e)},8951:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ONE_THOUSAND=e.ONE_HUNDRED=void 0,e.ONE_HUNDRED=100,e.ONE_THOUSAND=1e3},45746:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ONE_YEAR=e.FOUR_WEEKS=e.THREE_WEEKS=e.TWO_WEEKS=e.ONE_WEEK=e.THIRTY_DAYS=e.SEVEN_DAYS=e.FIVE_DAYS=e.THREE_DAYS=e.ONE_DAY=e.TWENTY_FOUR_HOURS=e.TWELVE_HOURS=e.SIX_HOURS=e.THREE_HOURS=e.ONE_HOUR=e.SIXTY_MINUTES=e.THIRTY_MINUTES=e.TEN_MINUTES=e.FIVE_MINUTES=e.ONE_MINUTE=e.SIXTY_SECONDS=e.THIRTY_SECONDS=e.TEN_SECONDS=e.FIVE_SECONDS=e.ONE_SECOND=void 0,e.ONE_SECOND=1,e.FIVE_SECONDS=5,e.TEN_SECONDS=10,e.THIRTY_SECONDS=30,e.SIXTY_SECONDS=60,e.ONE_MINUTE=e.SIXTY_SECONDS,e.FIVE_MINUTES=5*e.ONE_MINUTE,e.TEN_MINUTES=10*e.ONE_MINUTE,e.THIRTY_MINUTES=30*e.ONE_MINUTE,e.SIXTY_MINUTES=60*e.ONE_MINUTE,e.ONE_HOUR=e.SIXTY_MINUTES,e.THREE_HOURS=3*e.ONE_HOUR,e.SIX_HOURS=6*e.ONE_HOUR,e.TWELVE_HOURS=12*e.ONE_HOUR,e.TWENTY_FOUR_HOURS=24*e.ONE_HOUR,e.ONE_DAY=e.TWENTY_FOUR_HOURS,e.THREE_DAYS=3*e.ONE_DAY,e.FIVE_DAYS=5*e.ONE_DAY,e.SEVEN_DAYS=7*e.ONE_DAY,e.THIRTY_DAYS=30*e.ONE_DAY,e.ONE_WEEK=e.SEVEN_DAYS,e.TWO_WEEKS=2*e.ONE_WEEK,e.THREE_WEEKS=3*e.ONE_WEEK,e.FOUR_WEEKS=4*e.ONE_WEEK,e.ONE_YEAR=365*e.ONE_DAY},33901:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const i=r(56121);i.__exportStar(r(65871),e),i.__exportStar(r(71822),e),i.__exportStar(r(1067),e),i.__exportStar(r(48251),e)},1067:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});r(56121).__exportStar(r(40656),e)},40656:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.IWatch=void 0;e.IWatch=class{}},568:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.fromMiliseconds=e.toMiliseconds=void 0;const i=r(48251);e.toMiliseconds=function(t){return t*i.ONE_THOUSAND},e.fromMiliseconds=function(t){return Math.floor(t/i.ONE_THOUSAND)}},30296:(t,e)=>{"use strict";
2Object.defineProperty(e,"__esModule",{value:!0}),e.delay=void 0,e.delay=function(t){return new Promise((e=>{setTimeout((()=>{e(!0)}),t)}))}},65871:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const i=r(56121);i.__exportStar(r(30296),e),i.__exportStar(r(568),e)},71822:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Watch=void 0;class r{constructor(){this.timestamps=new Map}start(t){if(this.timestamps.has(t))throw new Error("Watch already started for label: ".concat(t));this.timestamps.set(t,{started:Date.now()})}stop(t){const e=this.get(t);if("undefined"!==typeof e.elapsed)throw new Error("Watch already stopped for label: ".concat(t));const r=Date.now()-e.started;this.timestamps.set(t,{started:e.started,elapsed:r})}get(t){const e=this.timestamps.get(t);if("undefined"===typeof e)throw new Error("No timestamp found for label: ".concat(t));return e}elapsed(t){const e=this.get(t);return e.elapsed||Date.now()-e.started}}e.Watch=r,e.default=r},56121:(t,e,r)=>{"use strict";r.r(e),r.d(e,{__assign:()=>s,__asyncDelegator:()=>w,__asyncGenerator:()=>y,__asyncValues:()=>_,__await:()=>b,__awaiter:()=>u,__classPrivateFieldGet:()=>M,__classPrivateFieldSet:()=>I,__createBinding:()=>l,__decorate:()=>a,__exportStar:()=>d,__extends:()=>n,__generator:()=>f,__importDefault:()=>S,__importStar:()=>
vendor: 5,888 bytes, line 2
2E,__makeTemplateObject:()=>A,__metadata:()=>h,__param:()=>c,__read:()=>g,__rest:()=>o,__spread:()=>m,__spreadArrays:()=>v,__values:()=>p});var i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},i(t,e)};function n(t,e){function r(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}var s=function(){return s=Object.assign||function(t){for(var e,r=1,i=arguments.length;r<i;r++)for(var n in e=arguments[r])Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t},s.apply(this,arguments)};function o(t,e){var r={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(r[i]=t[i]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var n=0;for(i=Object.getOwnPropertySymbols(t);n<i.length;n++)e.indexOf(i[n])<0&&Object.prototype.propertyIsEnumerable.call(t,i[n])&&(r[i[n]]=t[i[n]])}return r}function a(t,e,r,i){var n,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,r):i;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)o=Reflect.decorate(t,e,r,i);else for(var a=t.length-1;a>=0;a--)(n=t[a])&&(o=(s<3?n(o):s>3?n(e,r,o):n(e,r))||o);return s>3&&o&&Object.defineProperty(e,r,o),o}function c(t,e){return function(r,i){e(r,i,t)}}function h(t,e){if("object"===typeof Reflect&&"function"===typeof Reflect.metadata)return Reflect.metadata(t,e)}function u(t,e,r,i){return new(r||(r=Promise))((function(n,s){function o(t){try{c(i.next(t))}catch(e){s(e)}}function a(t){try{c(i.throw(t))}catch(e){s(e)}}function c(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(o,a)}c((i=i.apply(t,e||[])).next())}))}function f(t,e){var r,i,n,s,o={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"===typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(s){return function(a){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;o;)try{if(r=1,i&&(n=2&s[0]?i.return:s[0]?i.throw||((n=i.return)&&n.call(i),0):i.next)&&!(n=n.call(i,s[1])).done)return n;switch(i=0,n&&(s=[2&s[0],n.value]),s[0]){case 0:case 1:n=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,i=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!(n=(n=o.trys).length>0&&n[n.length-1])&&(6===s[0]||2===s[0])){o=0;continue}if(3===s[0]&&(!n||s[1]>n[0]&&s[1]<n[3])){o.label=s[1];break}if(6===s[0]&&o.label<n[1]){o.label=n[1],n=s;break}if(n&&o.label<n[2]){o.label=n[2],o.ops.push(s);break}n[2]&&o.ops.pop(),o.trys.pop();continue}s=e.call(t,o)}catch(a){s=[6,a],i=0}finally{r=n=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,a])}}}function l(t,e,r,i){void 0===i&&(i=r),t[i]=e[r]}function d(t,e){for(var r in t)"default"===r||e.hasOwnProperty(r)||(e[r]=t[r])}function p(t){var e="function"===typeof Symbol&&Symbol.iterator,r=e&&t[e],i=0;if(r)return r.call(t);if(t&&"number"===typeof t.length)return{next:function(){return t&&i>=t.length&&(t=void 0),{value:t&&t[i++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function g(t,e){var r="function"===typeof Symbol&&t[Symbol.iterator];if(!r)return t;var i,n,s=r.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(i=s.next()).done;)o.push(i.value)}catch(a){n={error:a}}finally{try{i&&!i.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return o}function m(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(g(arguments[e]));return t}function v(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;var i=Array(t),n=0;for(e=0;e<r;e++)for(var s=arguments[e],o=0,a=s.length;o<a;o++,n++)i[n]=s[o];return i}function b(t){return this instanceof b?(this.v=t,this):new b(t)}function y(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i,n=r.apply(t,e||[]),s=[];return i={},o("next"),o("throw"),o("return"),i[Symbol.asyncIterator]=function(){return this},i;function o(t){n[t]&&(i[t]=function(e){return new Promise((function(r,i){s.push([t,e,r,i])>1||a(t,e)}))})}function a(t,e){try{(r=n[t](e)).value instanceof b?Promise.resolve(r.value.v).then(c,h):u(s[0][2],r)}catch(i){u(s[0][3],i)}var r}function c(t){a("next",t)}function h(t){a("throw",t)}function u(t,e){t(e),s.shift(),s.length&&a(s[0][0],s[0][1])}}function w(t){var e,r;return e={},i("next"),i("throw",(function(t){throw t})),i("return"),e[Symbol.iterator]=function(){return this},e;function i(i,n){e[i]=t[i]?function(e){return(r=!r)?{value:b(t[i](e)),done:"return"===i}:n?n(e):e}:n}}function _(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e,r=t[Symbol.asyncIterator];return r?r.call(t):(t=p(t),e={},i("next"),i("throw"),i("return"),e[Symbol.asyncIterator]=function(){return this},e);function i(r){e[r]=t[r]&&function(e){return new Promise((function(i,n){(function(t,e,r,i){Promise.resolve(i).then((function(e){t({value:e,done:r})}),e)})(i,n,(e=t[r](e)).done,e.value)}))}}}function A(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function E(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}function S(t){return t&&t.__esModule?t:{default:t}}function M(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}function I(t,e,r){if(!e.has(t))throw new TypeError("attempted to set private field on non-instance");return e.set(t,r),r}},20033:(t,e)=>{"use strict";function r(t){let e;return"undefined"!==typeof window&&"undefined"!==typeof window[t]&&(e=window[t]),e}function i(t){const e=r(t);if(!e)throw new Error("".concat(t," is not defined in Window"));return e}
2Object.defineProperty(e,"__esModule",{value:!0}),e.getLocalStorage=e.getLocalStorageOrThrow=e.getCrypto=e.getCryptoOrThrow=e.getLocation=e.getLocationOrThrow=e.getNavigator=e.getNavigatorOrThrow=e.getDocument=e.getDocumentOrThrow=e.getFromWindowOrThrow=e.getFromWindow=void 0,e.getFromWindow=r,e.getFromWindowOrThrow=i,e.getDocumentOrThrow=function(){return i("document")},e.getDocument=function(){return r("document")},e.getNavigatorOrThrow=function(){return i("navigator")},e.getNavigator=function(){return r("navigator")},e.getLocationOrThrow=function(){return i("location")},e.getLocation=function(){return r("location")},e.getCryptoOrThrow=function(){return i("crypto")},e.getCrypto=function(){return r("crypto")},e.getLocalStorageOrThrow=function(){return i("localStorage")},e.getLocalStorage=function(){return r("localStorage")}},39332:(t,e,r)=>{"use strict";e.g=void 0;const i=r(20033);e.g=function(){let t,e;try{t=i.getDocumentOrThrow(),e=i.getLocationOrThrow()}catch(s){return null}function r(){for(var e=arguments.length,r=new Array(e),i=0;i<e;i++)r[i]=arguments[i];const n=t.getElementsByTagName("meta");for(let t=0;t<n.length;t++){const e=n[t],i=["itemprop","property","name"].map((t=>e.getAttribute(t))).filter((t=>!!t&&r.includes(t)));if(i.length&&i){const t=e.getAttribute("content");if(t)return t}}return""}const n=function(){let e=r("name","og:site_name","og:title","twitter:title");return e||(e=t.title),e}();return{description:r("description","og:description","twitter:description","keywords"),url:e.origin,icons:function(){const r=t.getElementsByTagName("link"),i=[];for(let t=0;t<r.length;t++){const n=r[t],s=n.getAttribute("rel");if(s&&s.toLowerCase().indexOf("icon")>-1){const t=n.getAttribute("href");if(t)if(-1===t.toLowerCase().indexOf("https:")&&-1===t.toLowerCase().indexOf("http:")&&0!==t.indexOf("//")){let r=e.protocol+"//"+e.host;if(0===t.indexOf("/"))r+=t;else{const i=e.pathname.split("/");i.pop();r+=i.join("/")+"/"+t}i.push(r)}else if(0===t.indexOf("//")){const r=e.protocol+t;i.push(r)}else i.push(t)}}return i}(),name:n}}},88462:(t,e,r)=>{var i;function n(t){this.rand=t}if(t.exports=function(t){return i||(i=new n(null)),i.generate(t)},t.exports.Rand=n,n.prototype.generate=function(t){return this._rand(t)},n.prototype._rand=function(t){if(this.rand.getBytes)return this.rand.getBytes(t);for(var e=new Uint8Array(t),r=0;r<e.length;r++)e[r]=this.rand.getByte();return e},"object"===typeof self)self.crypto&&self.crypto.getRandomValues?n.prototype._rand=function(t){var e=new Uint8Array(t);return self.crypto.getRandomValues(e),e}:self.msCrypto&&self.msCrypto.getRandomValues?n.prototype._rand=function(t){var e=new Uint8Array(t);return self.msCrypto.getRandomValues(e),e}:"object"===typeof window&&(n.prototype._rand=function(){throw new Error("Not implemented yet")});else try{var s=r(73776);if("function"!==typeof s.randomBytes)throw new Error("Not supported");n.prototype._rand=function(t){return s.randomBytes(t)}}catch(o){}},95707:t=>{"use strict";var e="%[a-f0-9]{2}",r=new RegExp("("+e+")|([^%]+?)","gi"),i=new RegExp("("+e+")+","gi");function n(t,e){try{return[decodeURIComponent(t.join(""))]}catch(s){}if(1===t.length)return t;e=e||1;var r=t.slice(0,e),i=t.slice(e);return Array.prototype.concat.call([],n(r),n(i))}function s(t){try{return decodeURIComponent(t)}catch(s){for(var e=t.match(r)||[],i=1;i<e.length;i++)e=(t=n(e,i).join("")).match(r)||[];return t}}t.exports=function(t){if("string"!==typeof t)throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof t+"`");try{return t=t.replace(/\+/g," "),decodeURIComponent(t)}catch(e){return function(t){for(var r={"%FE%FF":"\ufffd\ufffd","%FF%FE":"\ufffd\ufffd"},n=i.exec(t);n;){try{r[n[0]]=decodeURIComponent(n[0])}catch(e){var o=s(n[0]);o!==n[0]&&(r[n[0]]=o)}n=i.exec(t)}r["%C2"]="\ufffd";for(var a=Object.keys(r),c=0;c<a.length;c++){var h=a[c];t=t.replace(new RegExp(h,"g"),r[h])}return t}(t)}}},38086:(t,e,r)=>{"use strict";var i=e;i.version=r(1636).rE,i.utils=r(86864),i.rand=r(88462),i.curve=r(87849),i.curves=r(36697),i.ec=r(77794),i.eddsa=r(24661)},66588:(t,e,r)=>{"use strict";var i=r(52835),n=r(86864),s=n.getNAF,o=n.getJSF,a=n.assert;function c(t,e){this.type=t,this.p=new i(e.p,16),this.red=e.prime?i.red(e.prime):i.mont(this.p),this.zero=new i(0).toRed(this.red),this.one=new i(1).toRed(this.red),this.two=new i(2).toRed(this.red),this.n=e.n&&new i(e.n,16),this.g=e.g&&this.pointFromJSON(e.g,e.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),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))}
vendor: 11,530 bytes, line 2
2function h(t,e){this.curve=t,this.type=e,this.precomputed=null}t.exports=c,c.prototype.point=function(){throw new Error("Not implemented")},c.prototype.validate=function(){throw new Error("Not implemented")},c.prototype._fixedNafMul=function(t,e){a(t.precomputed);var r=t._getDoubles(),i=s(e,1,this._bitLength),n=(1<<r.step+1)-(r.step%2===0?2:1);n/=3;var o,c,h=[];for(o=0;o<i.length;o+=r.step){c=0;for(var u=o+r.step-1;u>=o;u--)c=(c<<1)+i[u];h.push(c)}for(var f=this.jpoint(null,null,null),l=this.jpoint(null,null,null),d=n;d>0;d--){for(o=0;o<h.length;o++)(c=h[o])===d?l=l.mixedAdd(r.points[o]):c===-d&&(l=l.mixedAdd(r.points[o].neg()));f=f.add(l)}return f.toP()},c.prototype._wnafMul=function(t,e){var r=4,i=t._getNAFPoints(r);r=i.wnd;for(var n=i.points,o=s(e,r,this._bitLength),c=this.jpoint(null,null,null),h=o.length-1;h>=0;h--){for(var u=0;h>=0&&0===o[h];h--)u++;if(h>=0&&u++,c=c.dblp(u),h<0)break;var f=o[h];a(0!==f),c="affine"===t.type?f>0?c.mixedAdd(n[f-1>>1]):c.mixedAdd(n[-f-1>>1].neg()):f>0?c.add(n[f-1>>1]):c.add(n[-f-1>>1].neg())}return"affine"===t.type?c.toP():c},c.prototype._wnafMulAdd=function(t,e,r,i,n){var a,c,h,u=this._wnafT1,f=this._wnafT2,l=this._wnafT3,d=0;for(a=0;a<i;a++){var p=(h=e[a])._getNAFPoints(t);u[a]=p.wnd,f[a]=p.points}for(a=i-1;a>=1;a-=2){var g=a-1,m=a;if(1===u[g]&&1===u[m]){var v=[e[g],null,null,e[m]];0===e[g].y.cmp(e[m].y)?(v[1]=e[g].add(e[m]),v[2]=e[g].toJ().mixedAdd(e[m].neg())):0===e[g].y.cmp(e[m].y.redNeg())?(v[1]=e[g].toJ().mixedAdd(e[m]),v[2]=e[g].add(e[m].neg())):(v[1]=e[g].toJ().mixedAdd(e[m]),v[2]=e[g].toJ().mixedAdd(e[m].neg()));var b=[-3,-1,-5,-7,0,7,5,1,3],y=o(r[g],r[m]);for(d=Math.max(y[0].length,d),l[g]=new Array(d),l[m]=new Array(d),c=0;c<d;c++){var w=0|y[0][c],_=0|y[1][c];l[g][c]=b[3*(w+1)+(_+1)],l[m][c]=0,f[g]=v}}else l[g]=s(r[g],u[g],this._bitLength),l[m]=s(r[m],u[m],this._bitLength),d=Math.max(l[g].length,d),d=Math.max(l[m].length,d)}var A=this.jpoint(null,null,null),E=this._wnafT4;for(a=d;a>=0;a--){for(var S=0;a>=0;){var M=!0;for(c=0;c<i;c++)E[c]=0|l[c][a],0!==E[c]&&(M=!1);if(!M)break;S++,a--}if(a>=0&&S++,A=A.dblp(S),a<0)break;for(c=0;c<i;c++){var I=E[c];0!==I&&(I>0?h=f[c][I-1>>1]:I<0&&(h=f[c][-I-1>>1].neg()),A="affine"===h.type?A.mixedAdd(h):A.add(h))}}for(a=0;a<i;a++)f[a]=null;return n?A:A.toP()},c.BasePoint=h,h.prototype.eq=function(){throw new Error("Not implemented")},h.prototype.validate=function(){return this.curve.validate(this)},c.prototype.decodePoint=function(t,e){t=n.toArray(t,e);var r=this.p.byteLength();if((4===t[0]||6===t[0]||7===t[0])&&t.length-1===2*r)return 6===t[0]?a(t[t.length-1]%2===0):7===t[0]&&a(t[t.length-1]%2===1),this.point(t.slice(1,1+r),t.slice(1+r,1+2*r));if((2===t[0]||3===t[0])&&t.length-1===r)return this.pointFromX(t.slice(1,1+r),3===t[0]);throw new Error("Unknown point format")},h.prototype.encodeCompressed=function(t){return this.encode(t,!0)},h.prototype._encode=function(t){var e=this.curve.p.byteLength(),r=this.getX().toArray("be",e);return t?[this.getY().isEven()?2:3].concat(r):[4].concat(r,this.getY().toArray("be",e))},h.prototype.encode=function(t,e){return n.encode(this._encode(e),t)},h.prototype.precompute=function(t){if(this.precomputed)return this;var e={doubles:null,naf:null,beta:null};return e.naf=this._getNAFPoints(8),e.doubles=this._getDoubles(4,t),e.beta=this._getBeta(),this.precomputed=e,this},h.prototype._hasDoubles=function(t){if(!this.precomputed)return!1;var e=this.precomputed.doubles;return!!e&&e.points.length>=Math.ceil((t.bitLength()+1)/e.step)},h.prototype._getDoubles=function(t,e){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],i=this,n=0;n<e;n+=t){for(var s=0;s<t;s++)i=i.dbl();r.push(i)}return{step:t,points:r}},h.prototype._getNAFPoints=function(t){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var e=[this],r=(1<<t)-1,i=1===r?null:this.dbl(),n=1;n<r;n++)e[n]=e[n-1].add(i);return{wnd:t,points:e}},h.prototype._getBeta=function(){return null},h.prototype.dblp=function(t){for(var e=this,r=0;r<t;r++)e=e.dbl();return e}},45697:(t,e,r)=>{"use strict";var i=r(86864),n=r(52835),s=r(56329),o=r(66588),a=i.assert;function c(t){this.twisted=1!==(0|t.a),this.mOneA=this.twisted&&-1===(0|t.a),this.extended=this.mOneA,o.call(this,"edwards",t),this.a=new n(t.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new n(t.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new n(t.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),a(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1===(0|t.c)}function h(t,e,r,i,s){o.BasePoint.call(this,t,"projective"),null===e&&null===r&&null===i?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new n(e,16),this.y=new n(r,16),this.z=i?new n(i,16):this.curve.one,this.t=s&&new n(s,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.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}s(c,o),t.exports=c,c.prototype._mulA=function(t){return this.mOneA?t.redNeg():this.a.redMul(t)},c.prototype._mulC=function(t){return this.oneC?t:this.c.redMul(t)},c.prototype.jpoint=function(t,e,r,i){return this.point(t,e,r,i)},c.prototype.pointFromX=function(t,e){(t=new n(t,16)).red||(t=t.toRed(this.red));var r=t.redSqr(),i=this.c2.redSub(this.a.redMul(r)),s=this.one.redSub(this.c2.redMul(this.d).redMul(r)),o=i.redMul(s.redInvm()),a=o.redSqrt();if(0!==a.redSqr().redSub(o).cmp(this.zero))throw new Error("invalid point");var c=a.fromRed().isOdd();return(e&&!c||!e&&c)&&(a=a.redNeg()),this.point(t,a)},c.prototype.pointFromY=function(t,e){(t=new n(t,16)).red||(t=t.toRed(this.red));var r=t.redSqr(),i=r.redSub(this.c2),s=r.redMul(this.d).redMul(this.c2).redSub(this.a),o=i.redMul(s.redInvm());if(0===o.cmp(this.zero)){if(e)throw new Error("invalid point");return this.point(this.zero,t)}var a=o.redSqrt();if(0!==a.redSqr().redSub(o).cmp(this.zero))throw new Error("invalid point");return a.fromRed().isOdd()!==e&&(a=a.redNeg()),this.point(a,t)},c.prototype.validate=function(t){if(t.isInfinity())return!0;t.normalize();var e=t.x.redSqr(),r=t.y.redSqr(),i=e.redMul(this.a).redAdd(r),n=this.c2.redMul(this.one.redAdd(this.d.redMul(e).redMul(r)));return 0===i.cmp(n)},s(h,o.BasePoint),c.prototype.pointFromJSON=function(t){return h.fromJSON(this,t)},c.prototype.point=function(t,e,r,i){return new h(this,t,e,r,i)},h.fromJSON=function(t,e){return new h(t,e[0],e[1],e[2])},h.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},h.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},h.prototype._extDbl=function(){var t=this.x.redSqr(),e=this.y.redSqr(),r=this.z.redSqr();r=r.redIAdd(r);var i=this.curve._mulA(t),n=this.x.redAdd(this.y).redSqr().redISub(t).redISub(e),s=i.redAdd(e),o=s.redSub(r),a=i.redSub(e),c=n.redMul(o),h=s.redMul(a),u=n.redMul(a),f=o.redMul(s);return this.curve.point(c,h,f,u)},h.prototype._projDbl=function(){var t,e,r,i,n,s,o=this.x.redAdd(this.y).redSqr(),a=this.x.redSqr(),c=this.y.redSqr();if(this.curve.twisted){var h=(i=this.curve._mulA(a)).redAdd(c);this.zOne?(t=o.redSub(a).redSub(c).redMul(h.redSub(this.curve.two)),e=h.redMul(i.redSub(c)),r=h.redSqr().redSub(h).redSub(h)):(n=this.z.redSqr(),s=h.redSub(n).redISub(n),t=o.redSub(a).redISub(c).redMul(s),e=h.redMul(i.redSub(c)),r=h.redMul(s))}else i=a.redAdd(c),n=this.curve._mulC(this.z).redSqr(),s=i.redSub(n).redSub(n),t=this.curve._mulC(o.redISub(i)).redMul(s),e=this.curve._mulC(i).redMul(a.redISub(c)),r=i.redMul(s);return this.curve.point(t,e,r)},h.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},h.prototype._extAdd=function(t){var e=this.y.redSub(this.x).redMul(t.y.redSub(t.x)),r=this.y.redAdd(this.x).redMul(t.y.redAdd(t.x)),i=this.t.redMul(this.curve.dd).redMul(t.t),n=this.z.redMul(t.z.redAdd(t.z)),s=r.redSub(e),o=n.redSub(i),a=n.redAdd(i),c=r.redAdd(e),h=s.redMul(o),u=a.redMul(c),f=s.redMul(c),l=o.redMul(a);return this.curve.point(h,u,l,f)},h.prototype._projAdd=function(t){var e,r,i=this.z.redMul(t.z),n=i.redSqr(),s=this.x.redMul(t.x),o=this.y.redMul(t.y),a=this.curve.d.redMul(s).redMul(o),c=n.redSub(a),h=n.redAdd(a),u=this.x.redAdd(this.y).redMul(t.x.redAdd(t.y)).redISub(s).redISub(o),f=i.redMul(c).redMul(u);return this.curve.twisted?(e=i.redMul(h).redMul(o.redSub(this.curve._mulA(s))),r=c.redMul(h)):(e=i.redMul(h).redMul(o.redSub(s)),r=this.curve._mulC(c).redMul(h)),this.curve.point(f,e,r)},h.prototype.add=function(t){return this.isInfinity()?t:t.isInfinity()?this:this.curve.extended?this._extAdd(t):this._projAdd(t)},h.prototype.mul=function(t){return this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve._wnafMul(this,t)},h.prototype.mulAdd=function(t,e,r){return this.curve._wnafMulAdd(1,[this,e],[t,r],2,!1)},h.prototype.jmulAdd=function(t,e,r){return this.curve._wnafMulAdd(1,[this,e],[t,r],2,!0)},h.prototype.normalize=function(){if(this.zOne)return this;var t=this.z.redInvm();return this.x=this.x.redMul(t),this.y=this.y.redMul(t),this.t&&(this.t=this.t.redMul(t)),this.z=this.curve.one,this.zOne=!0,this},h.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},h.prototype.getX=function(){return this.normalize(),this.x.fromRed()},h.prototype.getY=function(){return this.normalize(),this.y.fromRed()},h.prototype.eq=function(t){return this===t||0===this.getX().cmp(t.getX())&&0===this.getY().cmp(t.getY())},h.prototype.eqXToP=function(t){var e=t.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(e))return!0;for(var r=t.clone(),i=this.curve.redN.redMul(this.z);;){if(r.iadd(this.curve.n),r.cmp(this.curve.p)>=0)return!1;if(e.redIAdd(i),0===this.x.cmp(e))return!0}},h.prototype.toP=h.prototype.normalize,h.prototype.mixedAdd=h.prototype.add},87849:(t,e,r)=>{"use strict";var i=e;i.base=r(66588),i.short=r(68475),i.mont=r(67043),i.edwards=r(45697)},67043:(t,e,r)=>{"use strict";var i=r(52835),n=r(56329),s=r(66588),o=r(86864);function a(t){s.call(this,"mont",t),this.a=new i(t.a,16).toRed(this.red),this.b=new i(t.b,16).toRed(this.red),this.i4=new i(4).toRed(this.red).redInvm(),this.two=new i(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function c(t,e,r){s.BasePoint.call(this,t,"projective"),null===e&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new i(e,16),this.z=new i(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}n(a,s),t.exports=a,a.prototype.validate=function(t){var e=t.normalize().x,r=e.redSqr(),i=r.redMul(e).redAdd(r.redMul(this.a)).redAdd(e);return 0===i.redSqrt().redSqr().cmp(i)},n(c,s.BasePoint),a.prototype.decodePoint=function(t,e){return this.point(o.toArray(t,e),1)},a.prototype.point=function(t,e){return new c(this,t,e)},a.prototype.pointFromJSON=function(t){return c.fromJSON(this,t)},c.prototype.precompute=function(){},c.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},c.fromJSON=function(t,e){return new c(t,e[0],e[1]||t.one)},c.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>
2":"<EC Point x: "+this.x.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},c.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},c.prototype.dbl=function(){var t=this.x.redAdd(this.z).redSqr(),e=this.x.redSub(this.z).redSqr(),r=t.redSub(e),i=t.redMul(e),n=r.redMul(e.redAdd(this.curve.a24.redMul(r)));return this.curve.point(i,n)},c.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},c.prototype.diffAdd=function(t,e){var r=this.x.redAdd(this.z),i=this.x.redSub(this.z),n=t.x.redAdd(t.z),s=t.x.redSub(t.z).redMul(r),o=n.redMul(i),a=e.z.redMul(s.redAdd(o).redSqr()),c=e.x.redMul(s.redISub(o).redSqr());return this.curve.point(a,c)},c.prototype.mul=function(t){for(var e=t.clone(),r=this,i=this.curve.point(null,null),n=[];0!==e.cmpn(0);e.iushrn(1))n.push(e.andln(1));for(var s=n.length-1;s>=0;s--)0===n[s]?(r=r.diffAdd(i,this),i=i.dbl()):(i=r.diffAdd(i,this),r=r.dbl());return i},c.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},c.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},c.prototype.eq=function(t){return 0===this.getX().cmp(t.getX())},c.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},c.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},68475:(t,e,r)=>{"use strict";var i=r(86864),n=r(52835),s=r(56329),o=r(66588),a=i.assert;function c(t){o.call(this,"short",t),this.a=new n(t.a,16).toRed(this.red),this.b=new n(t.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(t),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function h(t,e,r,i){o.BasePoint.call(this,t,"affine"),null===e&&null===r?(this.x=null,this.y=null,this.inf=!0):(this.x=new n(e,16),this.y=new n(r,16),i&&(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 u(t,e,r,i){o.BasePoint.call(this,t,"jacobian"),null===e&&null===r&&null===i?(this.x=this.curve.one,this.y=this.curve.one,this.z=new n(0)):(this.x=new n(e,16),this.y=new n(r,16),this.z=new n(i,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}s(c,o),t.exports=c,c.prototype._getEndomorphism=function(t){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var e,r;if(t.beta)e=new n(t.beta,16).toRed(this.red);else{var i=this._getEndoRoots(this.p);e=(e=i[0].cmp(i[1])<0?i[0]:i[1]).toRed(this.red)}if(t.lambda)r=new n(t.lambda,16);else{var s=this._getEndoRoots(this.n);0===this.g.mul(s[0]).x.cmp(this.g.x.redMul(e))?r=s[0]:(r=s[1],a(0===this.g.mul(r).x.cmp(this.g.x.redMul(e))))}return{beta:e,lambda:r,basis:t.basis?t.basis.map((function(t){return{a:new n(t.a,16),b:new n(t.b,16)}})):this._getEndoBasis(r)}}},c.prototype._getEndoRoots=function(t){var e=t===this.p?this.red:n.mont(t),r=new n(2).toRed(e).redInvm(),i=r.redNeg(),s=new n(3).toRed(e).redNeg().redSqrt().redMul(r);return[i.redAdd(s).fromRed(),i.redSub(s).fromRed()]},c.prototype._getEndoBasis=function(t){for(var e,r,i,s,o,a,c,h,u,f=this.n.ushrn(Math.floor(this.n.bitLength()/2)),l=t,d=this.n.clone(),p=new n(1),g=new n(0),m=new n(0),v=new n(1),b=0;0!==l.cmpn(0);){var y=d.div(l);h=d.sub(y.mul(l)),u=m.sub(y.mul(p));var w=v.sub(y.mul(g));if(!i&&h.cmp(f)<0)e=c.neg(),r=p,i=h.neg(),s=u;else if(i&&2===++b)break;c=h,d=l,l=h,m=p,p=u,v=g,g=w}o=h.neg(),a=u;var _=i.sqr().add(s.sqr());return o.sqr().add(a.sqr()).cmp(_)>=0&&(o=e,a=r),i.negative&&(i=i.neg(),s=s.neg()),o.negative&&(o=o.neg(),a=a.neg()),[{a:i,b:s},{a:o,b:a}]},c.prototype._endoSplit=function(t){var e=this.endo.basis,r=e[0],i=e[1],n=i.b.mul(t).divRound(this.n),s=r.b.neg().mul(t).divRound(this.n),o=n.mul(r.a),a=s.mul(i.a),c=n.mul(r.b),h=s.mul(i.b);return{k1:t.sub(o).sub(a),k2:c.add(h).neg()}},c.prototype.pointFromX=function(t,e){(t=new n(t,16)).red||(t=t.toRed(this.red));var r=t.redSqr().redMul(t).redIAdd(t.redMul(this.a)).redIAdd(this.b),i=r.redSqrt();if(0!==i.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var s=i.fromRed().isOdd();return(e&&!s||!e&&s)&&(i=i.redNeg()),this.point(t,i)},c.prototype.validate=function(t){if(t.inf)return!0;var e=t.x,r=t.y,i=this.a.redMul(e),n=e.redSqr().redMul(e).redIAdd(i).redIAdd(this.b);return 0===r.redSqr().redISub(n).cmpn(0)},c.prototype._endoWnafMulAdd=function(t,e,r){for(var i=this._endoWnafT1,n=this._endoWnafT2,s=0;s<t.length;s++){var o=this._endoSplit(e[s]),a=t[s],c=a._getBeta();o.k1.negative&&(o.k1.ineg(),a=a.neg(!0)),o.k2.negative&&(o.k2.ineg(),c=c.neg(!0)),i[2*s]=a,i[2*s+1]=c,n[2*s]=o.k1,n[2*s+1]=o.k2}for(var h=this._wnafMulAdd(1,i,n,2*s,r),u=0;u<2*s;u++)i[u]=null,n[u]=null;return h},s(h,o.BasePoint),c.prototype.point=function(t,e,r){return new h(this,t,e,r)},c.prototype.pointFromJSON=function(t,e){return h.fromJSON(this,t,e)},h.prototype._getBeta=function(){if(this.curve.endo){var t=this.prec
vendor: 7,261 bytes, line 2
2omputed;if(t&&t.beta)return t.beta;var e=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(t){var r=this.curve,i=function(t){return r.point(t.x.redMul(r.endo.beta),t.y)};t.beta=e,e.precomputed={beta:null,naf:t.naf&&{wnd:t.naf.wnd,points:t.naf.points.map(i)},doubles:t.doubles&&{step:t.doubles.step,points:t.doubles.points.map(i)}}}return e}},h.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]},h.fromJSON=function(t,e,r){"string"===typeof e&&(e=JSON.parse(e));var i=t.point(e[0],e[1],r);if(!e[2])return i;function n(e){return t.point(e[0],e[1],r)}var s=e[2];return i.precomputed={beta:null,doubles:s.doubles&&{step:s.doubles.step,points:[i].concat(s.doubles.points.map(n))},naf:s.naf&&{wnd:s.naf.wnd,points:[i].concat(s.naf.points.map(n))}},i},h.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},h.prototype.isInfinity=function(){return this.inf},h.prototype.add=function(t){if(this.inf)return t;if(t.inf)return this;if(this.eq(t))return this.dbl();if(this.neg().eq(t))return this.curve.point(null,null);if(0===this.x.cmp(t.x))return this.curve.point(null,null);var e=this.y.redSub(t.y);0!==e.cmpn(0)&&(e=e.redMul(this.x.redSub(t.x).redInvm()));var r=e.redSqr().redISub(this.x).redISub(t.x),i=e.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,i)},h.prototype.dbl=function(){if(this.inf)return this;var t=this.y.redAdd(this.y);if(0===t.cmpn(0))return this.curve.point(null,null);var e=this.curve.a,r=this.x.redSqr(),i=t.redInvm(),n=r.redAdd(r).redIAdd(r).redIAdd(e).redMul(i),s=n.redSqr().redISub(this.x.redAdd(this.x)),o=n.redMul(this.x.redSub(s)).redISub(this.y);return this.curve.point(s,o)},h.prototype.getX=function(){return this.x.fromRed()},h.prototype.getY=function(){return this.y.fromRed()},h.prototype.mul=function(t){return t=new n(t,16),this.isInfinity()?this:this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve.endo?this.curve._endoWnafMulAdd([this],[t]):this.curve._wnafMul(this,t)},h.prototype.mulAdd=function(t,e,r){var i=[this,e],n=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(i,n):this.curve._wnafMulAdd(1,i,n,2)},h.prototype.jmulAdd=function(t,e,r){var i=[this,e],n=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(i,n,!0):this.curve._wnafMulAdd(1,i,n,2,!0)},h.prototype.eq=function(t){return this===t||this.inf===t.inf&&(this.inf||0===this.x.cmp(t.x)&&0===this.y.cmp(t.y))},h.prototype.neg=function(t){if(this.inf)return this;var e=this.curve.point(this.x,this.y.redNeg());if(t&&this.precomputed){var r=this.precomputed,i=function(t){return t.neg()};e.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(i)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(i)}}}return e},h.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},s(u,o.BasePoint),c.prototype.jpoint=function(t,e,r){return new u(this,t,e,r)},u.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var t=this.z.redInvm(),e=t.redSqr(),r=this.x.redMul(e),i=this.y.redMul(e).redMul(t);return this.curve.point(r,i)},u.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},u.prototype.add=function(t){if(this.isInfinity())return t;if(t.isInfinity())return this;var e=t.z.redSqr(),r=this.z.redSqr(),i=this.x.redMul(e),n=t.x.redMul(r),s=this.y.redMul(e.redMul(t.z)),o=t.y.redMul(r.redMul(this.z)),a=i.redSub(n),c=s.redSub(o);if(0===a.cmpn(0))return 0!==c.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var h=a.redSqr(),u=h.redMul(a),f=i.redMul(h),l=c.redSqr().redIAdd(u).redISub(f).redISub(f),d=c.redMul(f.redISub(l)).redISub(s.redMul(u)),p=this.z.redMul(t.z).redMul(a);return this.curve.jpoint(l,d,p)},u.prototype.mixedAdd=function(t){if(this.isInfinity())return t.toJ();if(t.isInfinity())return this;var e=this.z.redSqr(),r=this.x,i=t.x.redMul(e),n=this.y,s=t.y.redMul(e).redMul(this.z),o=r.redSub(i),a=n.redSub(s);if(0===o.cmpn(0))return 0!==a.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=o.redSqr(),h=c.redMul(o),u=r.redMul(c),f=a.redSqr().redIAdd(h).redISub(u).redISub(u),l=a.redMul(u.redISub(f)).redISub(n.redMul(h)),d=this.z.redMul(o);return this.curve.jpoint(f,l,d)},u.prototype.dblp=function(t){if(0===t)return this;if(this.isInfinity())return this;if(!t)return this.dbl();var e;if(this.curve.zeroA||this.curve.threeA){var r=this;for(e=0;e<t;e++)r=r.dbl();return r}var i=this.curve.a,n=this.curve.tinv,s=this.x,o=this.y,a=this.z,c=a.redSqr().redSqr(),h=o.redAdd(o);for(e=0;e<t;e++){var u=s.redSqr(),f=h.redSqr(),l=f.redSqr(),d=u.redAdd(u).redIAdd(u).redIAdd(i.redMul(c)),p=s.redMul(f),g=d.redSqr().redISub(p.redAdd(p)),m=p.redISub(g),v=d.redMul(m);v=v.redIAdd(v).redISub(l);var b=h.redMul(a);e+1<t&&(c=c.redMul(l)),s=g,a=b,h=v}return this.curve.jpoint(s,h.redMul(n),a)},u.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},u.prototype._zeroDbl=function(){var t,e,r;if(this.zOne){var i=this.x.redSqr(),n=this.y.redSqr(),s=n.redSqr(),o=this.x.redAdd(n).redSqr().redISub(i).redISub(s);o=o.redIAdd(o);var a=i.redAdd(i).redIAdd(i),c=a.redSqr().redISub(o).redISub(o),h=s.redIAdd(s);h=(h=h.redIAdd(h)).redIAdd(h),t=c,e=a.redMul(o.redISub(c)).redISub(h),r=this.y.redAdd(this.y)}else{var u=this.x.redSqr(),f=this.y.redSqr(),l=f.redSqr(),d=this.x.redAdd(f).redSqr().redISub(u).redISub(l);d=d.redIAdd(d);var p=u.redAdd(u).redIAdd(u),g=p.redSqr(),m=l.redIAdd(l);m=(m=m.redIAdd(m)).redIAdd(m),t=g.redISub(d).redISub(d),e=p.redMul(d.redISub(t)).redISub(m),r=(r=this.y.redMul(this.z)).redIAdd(r)}return this.curve.jpoint(t,e,r)},u.prototype._threeDbl=function(){var t,e,r;if(this.zOne){var i=this.x.redSqr(),n=this.y.redSqr(),s=n.redSqr(),o=this.x.redAdd(n).redSqr().redISub(i).redISub(s);o=o.redIAdd(o);var a=i.redAdd(i).redIAdd(i).redIAdd(this.curve.a),c=a.redSqr().redISub(o).redISub(o);t=c;var h=s.redIAdd(s);h=(h=h.redIAdd(h)).redIAdd(h),e=a.redMul(o.redISub(c)).redISub(h),r=this.y.redAdd(this.y)}else{var u=this.z.redSqr(),f=this.y.redSqr(),l=this.x.redMul(f),d=this.x.redSub(u).redMul(this.x.redAdd(u));d=d.redAdd(d).redIAdd(d);var p=l.redIAdd(l),g=(p=p.redIAdd(p)).redAdd(p);t=d.redSqr().redISub(g),r=this.y.redAdd(this.z).redSqr().redISub(f).redISub(u);var m=f.redSqr();m=(m=(m=m.redIAdd(m)).redIAdd(m)).redIAdd(m),e=d.redMul(p.redISub(t)).redISub(m)}return this.curve.jpoint(t,e,r)},u.prototype._dbl=function(){var t=this.curve.a,e=this.x,r=this.y,i=this.z,n=i.redSqr().redSqr(),s=e.redSqr(),o=r.redSqr(),a=s.redAdd(s).redIAdd(s).redIAdd(t.redMul(n)),c=e.redAdd(e),h=(c=c.redIAdd(c)).redMul(o),u=a.redSqr().redISub(h.redAdd(h)),f=h.redISub(u),l=o.redSqr();l=(l=(l=l.redIAdd(l)).redIAdd(l)).redIAdd(l);var d=a.redMul(f).redISub(l),p=r.redAdd(r).redMul(i);return this.curve.jpoint(u,d,p)},u.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);
vendor: 6,370 bytes, line 2
2var t=this.x.redSqr(),e=this.y.redSqr(),r=this.z.redSqr(),i=e.redSqr(),n=t.redAdd(t).redIAdd(t),s=n.redSqr(),o=this.x.redAdd(e).redSqr().redISub(t).redISub(i),a=(o=(o=(o=o.redIAdd(o)).redAdd(o).redIAdd(o)).redISub(s)).redSqr(),c=i.redIAdd(i);c=(c=(c=c.redIAdd(c)).redIAdd(c)).redIAdd(c);var h=n.redIAdd(o).redSqr().redISub(s).redISub(a).redISub(c),u=e.redMul(h);u=(u=u.redIAdd(u)).redIAdd(u);var f=this.x.redMul(a).redISub(u);f=(f=f.redIAdd(f)).redIAdd(f);var l=this.y.redMul(h.redMul(c.redISub(h)).redISub(o.redMul(a)));l=(l=(l=l.redIAdd(l)).redIAdd(l)).redIAdd(l);var d=this.z.redAdd(o).redSqr().redISub(r).redISub(a);return this.curve.jpoint(f,l,d)},u.prototype.mul=function(t,e){return t=new n(t,e),this.curve._wnafMul(this,t)},u.prototype.eq=function(t){if("affine"===t.type)return this.eq(t.toJ());if(this===t)return!0;var e=this.z.redSqr(),r=t.z.redSqr();if(0!==this.x.redMul(r).redISub(t.x.redMul(e)).cmpn(0))return!1;var i=e.redMul(this.z),n=r.redMul(t.z);return 0===this.y.redMul(n).redISub(t.y.redMul(i)).cmpn(0)},u.prototype.eqXToP=function(t){var e=this.z.redSqr(),r=t.toRed(this.curve.red).redMul(e);if(0===this.x.cmp(r))return!0;for(var i=t.clone(),n=this.curve.redN.redMul(e);;){if(i.iadd(this.curve.n),i.cmp(this.curve.p)>=0)return!1;if(r.redIAdd(n),0===this.x.cmp(r))return!0}},u.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},u.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},36697:(t,e,r)=>{"use strict";var i,n=e,s=r(73697),o=r(87849),a=r(86864).assert;function c(t){"short"===t.type?this.curve=new o.short(t):"edwards"===t.type?this.curve=new o.edwards(t):this.curve=new o.mont(t),this.g=this.curve.g,this.n=this.curve.n,this.hash=t.hash,a(this.g.validate(),"Invalid curve"),a(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function h(t,e){Object.defineProperty(n,t,{configurable:!0,enumerable:!0,get:function(){var r=new c(e);return Object.defineProperty(n,t,{configurable:!0,enumerable:!0,value:r}),r}})}n.PresetCurve=c,h("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:s.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),h("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:s.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),h("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:s.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),h("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:s.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"]}),h("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:s.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"]}),h("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:s.sha256,gRed:!1,g:["9"]}),h("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:s.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{i=r(19112)}catch(u){i=void 0}h("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:s.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"}
vendor: 10,773 bytes, line 2
2,{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",i]})},77794:(t,e,r)=>{"use strict";var i=r(52835),n=r(31172),s=r(86864),o=r(36697),a=r(88462),c=s.assert,h=r(60109),u=r(69300);function f(t){if(!(this instanceof f))return new f(t);"string"===typeof t&&(c(Object.prototype.hasOwnProperty.call(o,t),"Unknown curve "+t),t=o[t]),t instanceof o.PresetCurve&&(t={curve:t}),this.curve=t.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=t.curve.g,this.g.precompute(t.curve.n.bitLength()+1),this.hash=t.hash||t.curve.hash}t.exports=f,f.prototype.keyPair=function(t){return new h(this,t)},f.prototype.keyFromPrivate=function(t,e){return h.fromPrivate(this,t,e)},f.prototype.keyFromPublic=function(t,e){return h.fromPublic(this,t,e)},f.prototype.genKeyPair=function(t){t||(t={});for(var e=new n({hash:this.hash,pers:t.pers,persEnc:t.persEnc||"utf8",entropy:t.entropy||a(this.hash.hmacStrength),entropyEnc:t.entropy&&t.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),s=this.n.sub(new i(2));;){var o=new i(e.generate(r));if(!(o.cmp(s)>0))return o.iaddn(1),this.keyFromPrivate(o)}},f.prototype._truncateToN=function(t,e,r){var n;if(i.isBN(t)||"number"===typeof t)n=(t=new i(t,16)).byteLength();else if("object"===typeof t)n=t.length,t=new i(t,16);else{var s=t.toString();n=s.length+1>>>1,t=new i(s,16)}"number"!==typeof r&&(r=8*n);var o=r-this.n.bitLength();return o>0&&(t=t.ushrn(o)),!e&&t.cmp(this.n)>=0?t.sub(this.n):t},f.prototype.sign=function(t,e,r,s){if("object"===typeof r&&(s=r,r=null),s||(s={}),"string"!==typeof t&&"number"!==typeof t&&!i.isBN(t)){c("object"===typeof t&&t&&"number"===typeof t.length,"Expected message to be an array-like, a hex string, or a BN instance"),c(t.length>>>0===t.length);for(var o=0;o<t.length;o++)c((255&t[o])===t[o])}e=this.keyFromPrivate(e,r),t=this._truncateToN(t,!1,s.msgBitLength),c(!t.isNeg(),"Can not sign a negative message");var a=this.n.byteLength(),h=e.getPrivate().toArray("be",a),f=t.toArray("be",a);c(new i(f).eq(t),"Can not sign message");for(var l=new n({hash:this.hash,entropy:h,nonce:f,pers:s.pers,persEnc:s.persEnc||"utf8"}),d=this.n.sub(new i(1)),p=0;;p++){var g=s.k?s.k(p):new i(l.generate(this.n.byteLength()));if(!((g=this._truncateToN(g,!0)).cmpn(1)<=0||g.cmp(d)>=0)){var m=this.g.mul(g);if(!m.isInfinity()){var v=m.getX(),b=v.umod(this.n);if(0!==b.cmpn(0)){var y=g.invm(this.n).mul(b.mul(e.getPrivate()).iadd(t));if(0!==(y=y.umod(this.n)).cmpn(0)){var w=(m.getY().isOdd()?1:0)|(0!==v.cmp(b)?2:0);return s.canonical&&y.cmp(this.nh)>0&&(y=this.n.sub(y),w^=1),new u({r:b,s:y,recoveryParam:w})}}}}}},f.prototype.verify=function(t,e,r,i,n){n||(n={}),t=this._truncateToN(t,!1,n.msgBitLength),r=this.keyFromPublic(r,i);var s=(e=new u(e,"hex")).r,o=e.s;if(s.cmpn(1)<0||s.cmp(this.n)>=0)return!1;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;var a,c=o.invm(this.n),h=c.mul(t).umod(this.n),f=c.mul(s).umod(this.n);return this.curve._maxwellTrick?!(a=this.g.jmulAdd(h,r.getPublic(),f)).isInfinity()&&a.eqXToP(s):!(a=this.g.mulAdd(h,r.getPublic(),f)).isInfinity()&&0===a.getX().umod(this.n).cmp(s)},f.prototype.recoverPubKey=function(t,e,r,n){c((3&r)===r,"The recovery param is more than two bits"),e=new u(e,n);var s=this.n,o=new i(t),a=e.r,h=e.s,f=1&r,l=r>>1;if(a.cmp(this.curve.p.umod(this.curve.n))>=0&&l)throw new Error("Unable to find sencond key candinate");a=l?this.curve.pointFromX(a.add(this.curve.n),f):this.curve.pointFromX(a,f);var d=e.r.invm(s),p=s.sub(o).mul(d).umod(s),g=h.mul(d).umod(s);return this.g.mulAdd(p,a,g)},f.prototype.getKeyRecoveryParam=function(t,e,r,i){if(null!==(e=new u(e,i)).recoveryParam)return e.recoveryParam;for(var n=0;n<4;n++){var s;try{s=this.recoverPubKey(t,e,n)}catch(t){continue}if(s.eq(r))return n}throw new Error("Unable to find valid recovery factor")}},60109:(t,e,r)=>{"use strict";var i=r(52835),n=r(86864).assert;function s(t,e){this.ec=t,this.priv=null,this.pub=null,e.priv&&this._importPrivate(e.priv,e.privEnc),e.pub&&this._importPublic(e.pub,e.pubEnc)}t.exports=s,s.fromPublic=function(t,e,r){return e instanceof s?e:new s(t,{pub:e,pubEnc:r})},s.fromPrivate=function(t,e,r){return e instanceof s?e:new s(t,{priv:e,privEnc:r})},s.prototype.validate=function(){var t=this.getPublic();return t.isInfinity()?{result:!1,reason:"Invalid public key"}:t.validate()?t.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"}},s.prototype.getPublic=function(t,e){return"string"===typeof t&&(e=t,t=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),e?this.pub.encode(e,t):this.pub},s.prototype.getPrivate=function(t){return"hex"===t?this.priv.toString(16,2):this.priv},s.prototype._importPrivate=function(t,e){this.priv=new i(t,e||16),this.priv=this.priv.umod(this.ec.curve.n)},s.prototype._importPublic=function(t,e){if(t.x||t.y)return"mont"===this.ec.curve.type?n(t.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||n(t.x&&t.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(t.x,t.y));this.pub=this.ec.curve.decodePoint(t,e)},s.prototype.derive=function(t){return t.validate()||n(t.validate(),"public point not validated"),t.mul(this.priv).getX()},s.prototype.sign=function(t,e,r){return this.ec.sign(t,this,e,r)},s.prototype.verify=function(t,e,r){return this.ec.verify(t,e,this,void 0,r)},s.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"}},69300:(t,e,r)=>{"use strict";var i=r(52835),n=r(86864),s=n.assert;function o(t,e){if(t instanceof o)return t;this._importDER(t,e)||(s(t.r&&t.s,"Signature without r or s"),this.r=new i(t.r,16),this.s=new i(t.s,16),void 0===t.recoveryParam?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}function a(){this.place=0}function c(t,e){var r=t[e.place++];if(!(128&r))return r;var i=15&r;if(0===i||i>4)return!1;if(0===t[e.place])return!1;for(var n=0,s=0,o=e.place;s<i;s++,o++)n<<=8,n|=t[o],n>>>=0;return!(n<=127)&&(e.place=o,n)}function h(t){for(var e=0,r=t.length-1;!t[e]&&!(128&t[e+1])&&e<r;)e++;return 0===e?t:t.slice(e)}function u(t,e){if(e<128)t.push(e);else{var r=1+(Math.log(e)/Math.LN2>>>3);for(t.push(128|r);--r;)t.push(e>>>(r<<3)&255);t.push(e)}}t.exports=o,o.prototype._importDER=function(t,e){t=n.toArray(t,e);var r=new a;if(48!==t[r.place++])return!1;var s=c(t,r);if(!1===s)return!1;if(s+r.place!==t.length)return!1;if(2!==t[r.place++])return!1;var o=c(t,r);if(!1===o)return!1;if(0!==(128&t[r.place]))return!1;var h=t.slice(r.place,o+r.place);if(r.place+=o,2!==t[r.place++])return!1;var u=c(t,r);if(!1===u)return!1;if(t.length!==u+r.place)return!1;if(0!==(128&t[r.place]))return!1;var f=t.slice(r.place,u+r.place);if(0===h[0]){if(!(128&h[1]))return!1;h=h.slice(1)}if(0===f[0]){if(!(128&f[1]))return!1;f=f.slice(1)}return this.r=new i(h),this.s=new i(f),this.recoveryParam=null,!0},o.prototype.toDER=function(t){var e=this.r.toArray(),r=this.s.toArray();for(128&e[0]&&(e=[0].concat(e)),128&r[0]&&(r=[0].concat(r)),e=h(e),r=h(r);!r[0]&&!(128&r[1]);)r=r.slice(1);var i=[2];u(i,e.length),(i=i.concat(e)).push(2),u(i,r.length);var s=i.concat(r),o=[48];return u(o,s.length),o=o.concat(s),n.encode(o,t)}},24661:(t,e,r)=>{"use strict";var i=r(73697),n=r(36697),s=r(86864),o=s.assert,a=s.parseBytes,c=r(95206),h=r(83035);function u(t){if(o("ed25519"===t,"only tested with ed25519 so far"),!(this instanceof u))return new u(t);t=n[t].curve,this.curve=t,this.g=t.g,this.g.precompute(t.n.bitLength()+1),this.pointClass=t.point().constructor,this.encodingLength=Math.ceil(t.n.bitLength()/8),this.hash=i.sha512}t.exports=u,u.prototype.sign=function(t,e){t=a(t);var r=this.keyFromSecret(e),i=this.hashInt(r.messagePrefix(),t),n=this.g.mul(i),s=this.encodePoint(n),o=this.hashInt(s,r.pubBytes(),t).mul(r.priv()),c=i.add(o).umod(this.curve.n);return this.makeSignature({R:n,S:c,Rencoded:s})},u.prototype.verify=function(t,e,r){if(t=a(t),(e=this.makeSignature(e)).S().gte(e.eddsa.curve.n)||e.S().isNeg())return!1;var i=this.keyFromPublic(r),n=this.hashInt(e.Rencoded(),i.pubBytes(),t),s=this.g.mul(e.S());return e.R().add(i.pub().mul(n)).eq(s)},u.prototype.hashInt=function(){for(var t=this.hash(),e=0;e<arguments.length;e++)t.update(arguments[e]);return s.intFromLE(t.digest()).umod(this.curve.n)},u.prototype.keyFromPublic=function(t){return c.fromPublic(this,t)},u.prototype.keyFromSecret=function(t){return c.fromSecret(this,t)},u.prototype.makeSignature=function(t){return t instanceof h?t:new h(this,t)},u.prototype.encodePoint=function(t){var e=t.getY().toArray("le",this.encodingLength);return e[this.encodingLength-1]|=t.getX().isOdd()?128:0,e},u.prototype.decodePoint=function(t){var e=(t=s.parseBytes(t)).length-1,r=t.slice(0,e).concat(-129&t[e]),i=0!==(128&t[e]),n=s.intFromLE(r);return this.curve.pointFromY(n,i)},u.prototype.encodeInt=function(t){return t.toArray("le",this.encodingLength)},u.prototype.decodeInt=function(t){return s.intFromLE(t)},u.prototype.isPoint=function(t){return t instanceof this.pointClass}},95206:(t,e,r)=>{"use strict";var i=r(86864),n=i.assert,s=i.parseBytes,o=i.cachedProperty;function a(t,e){this.eddsa=t,this._secret=s(e.secret),t.isPoint(e.pub)?this._pub=e.pub:this._pubBytes=s(e.pub)}a.fromPublic=function(t,e){return e instanceof a?e:new a(t,{pub:e})},a.fromSecret=function(t,e){return e instanceof a?e:new a(t,{secret:e})},a.prototype.secret=function(){return this._secret},o(a,"pubBytes",(function(){return this.eddsa.encodePoint(this.pub())})),o(a,"pub",(function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())})),o(a,"privBytes",(function(){var t=this.eddsa,e=this.hash(),r=t.encodingLength-1,i=e.slice(0,t.encodingLength);return i[0]&=248,i[r]&=127,i[r]|=64,i})),o(a,"priv",(function(){return this.eddsa.decodeInt(this.privBytes())})),o(a,"hash",(function(){return this.eddsa.hash().update(this.secret()).digest()})),o(a,"messagePrefix",(function(){return this.hash().slice(this.eddsa.encodingLength)})),a.prototype.sign=function(t){return n(this._secret,"KeyPair can only verify"),this.eddsa.sign(t,this)},a.prototype.verify=function(t,e){return this.eddsa.verify(t,e,this)},a.prototype.getSecret=function(t){return n(this._secret,"KeyPair is public only"),i.encode(this.secret(),t)},a.prototype.getPublic=function(t){return i.encode(this.pubBytes(),t)},t.exports=a},83035:(t,e,r)=>{"use strict";var i=r(52835),n=r(86864),s=n.assert,o=n.cachedProperty,a=n.parseBytes;function c(t,e){this.eddsa=t,"object"!==typeof e&&(e=a(e)),Array.isArray(e)&&(s(e.length===2*t.encodingLength,"Signature has invali
2d size"),e={R:e.slice(0,t.encodingLength),S:e.slice(t.encodingLength)}),s(e.R&&e.S,"Signature without R or S"),t.isPoint(e.R)&&(this._R=e.R),e.S instanceof i&&(this._S=e.S),this._Rencoded=Array.isArray(e.R)?e.R:e.Rencoded,this._Sencoded=Array.isArray(e.S)?e.S:e.Sencoded}o(c,"S",(function(){return this.eddsa.decodeInt(this.Sencoded())})),o(c,"R",(function(){return this.eddsa.decodePoint(this.Rencoded())})),o(c,"Rencoded",(function(){return this.eddsa.encodePoint(this.R())})),o(c,"Sencoded",(function(){return this.eddsa.encodeInt(this.S())})),c.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},c.prototype.toHex=function(){return n.encode(this.toBytes(),"hex").toUpperCase()},t.exports=c},19112:t=>{t
vendor: 26,137 bytes, line 2
2.exports={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}}},
vendor: 39,717 bytes, line 2
286864:(t,e,r)=>{"use strict";var i=e,n=r(52835),s=r(75482),o=r(49848);i.assert=s,i.toArray=o.toArray,i.zero2=o.zero2,i.toHex=o.toHex,i.encode=o.encode,i.getNAF=function(t,e,r){var i,n=new Array(Math.max(t.bitLength(),r)+1);for(i=0;i<n.length;i+=1)n[i]=0;var s=1<<e+1,o=t.clone();for(i=0;i<n.length;i++){var a,c=o.andln(s-1);o.isOdd()?(a=c>(s>>1)-1?(s>>1)-c:c,o.isubn(a)):a=0,n[i]=a,o.iushrn(1)}return n},i.getJSF=function(t,e){var r=[[],[]];t=t.clone(),e=e.clone();for(var i,n=0,s=0;t.cmpn(-n)>0||e.cmpn(-s)>0;){var o,a,c=t.andln(3)+n&3,h=e.andln(3)+s&3;3===c&&(c=-1),3===h&&(h=-1),o=0===(1&c)?0:3!==(i=t.andln(7)+n&7)&&5!==i||2!==h?c:-c,r[0].push(o),a=0===(1&h)?0:3!==(i=e.andln(7)+s&7)&&5!==i||2!==c?h:-h,r[1].push(a),2*n===o+1&&(n=1-n),2*s===a+1&&(s=1-s),t.iushrn(1),e.iushrn(1)}return r},i.cachedProperty=function(t,e,r){var i="_"+e;t.prototype[e]=function(){return void 0!==this[i]?this[i]:this[i]=r.call(this)}},i.parseBytes=function(t){return"string"===typeof t?i.toArray(t,"hex"):t},i.intFromLE=function(t){return new n(t,"hex","le")}},52835:function(t,e,r){!function(t,e){"use strict";function i(t,e){if(!t)throw new Error(e||"Assertion failed")}function n(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function s(t,e,r){if(s.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var o;"object"===typeof t?t.exports=s:e.BN=s,s.BN=s,s.wordSize=26;try{o="undefined"!==typeof window&&"undefined"!==typeof window.Buffer?window.Buffer:r(79368).Buffer}catch(M){}function a(t,e){var r=t.charCodeAt(e);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function c(t,e,r){var i=a(t,r);return r-1>=e&&(i|=a(t,r-1)<<4),i}function h(t,e,r,i){for(var n=0,s=Math.min(t.length,r),o=e;o<s;o++){var a=t.charCodeAt(o)-48;n*=i,n+=a>=49?a-49+10:a>=17?a-17+10:a}return n}s.isBN=function(t){return t instanceof s||null!==t&&"object"===typeof t&&t.constructor.wordSize===s.wordSize&&Array.isArray(t.words)},s.max=function(t,e){return t.cmp(e)>0?t:e},s.min=function(t,e){return t.cmp(e)<0?t:e},s.prototype._init=function(t,e,r){if("number"===typeof t)return this._initNumber(t,e,r);if("object"===typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),i(e===(0|e)&&e>=2&&e<=36);var n=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(n++,this.negative=1),n<t.length&&(16===e?this._parseHex(t,n,r):(this._parseBase(t,e,n),"le"===r&&this._initArray(this.toArray(),e,r)))},s.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(i(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},s.prototype._initArray=function(t,e,r){if(i("number"===typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var s,o,a=0;if("be"===r)for(n=t.length-1,s=0;n>=0;n-=3)o=t[n]|t[n-1]<<8|t[n-2]<<16,this.words[s]|=o<<a&67108863,this.words[s+1]=o>>>26-a&67108863,(a+=24)>=26&&(a-=26,s++);else if("le"===r)for(n=0,s=0;n<t.length;n+=3)o=t[n]|t[n+1]<<8|t[n+2]<<16,this.words[s]|=o<<a&67108863,this.words[s+1]=o>>>26-a&67108863,(a+=24)>=26&&(a-=26,s++);return this.strip()},s.prototype._parseHex=function(t,e,r){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var n,s=0,o=0;if("be"===r)for(i=t.length-1;i>=e;i-=2)n=c(t,e,i)<<s,this.words[o]|=67108863&n,s>=18?(s-=18,o+=1,this.words[o]|=n>>>26):s+=8;else for(i=(t.length-e)%2===0?e+1:e;i<t.length;i+=2)n=c(t,e,i)<<s,this.words[o]|=67108863&n,s>=18?(s-=18,o+=1,this.words[o]|=n>>>26):s+=8;this.strip()},s.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var i=0,n=1;n<=67108863;n*=e)i++;i--,n=n/e|0;for(var s=t.length-r,o=s%i,a=Math.min(s,s-o)+r,c=0,u=r;u<a;u+=i)c=h(t,u,u+i,e),this.imuln(n),this.words[0]+c<67108864?this.words[0]+=c:this._iaddn(c);if(0!==o){var f=1;for(c=h(t,u,t.length,e),u=0;u<o;u++)f*=e;this.imuln(f),this.words[0]+c<67108864?this.words[0]+=c:this._iaddn(c)}this.strip()},s.prototype.copy=function(t){t.words=new Array(this.length);for(var e=0;e<this.length;e++)t.words[e]=this.words[e];t.length=this.length,t.negative=this.negative,t.red=this.red},s.prototype.clone=function(){var t=new s(null);return this.copy(t),t},s.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},s.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},s.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},s.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var u=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],f=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],l=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function d(t,e,r){r.negative=e.negative^t.negative;var i=t.length+e.length|0;r.length=i,i=i-1|0;var n=0|t.words[0],s=0|e.words[0],o=n*s,a=67108863&o,c=o/67108864|0;r.words[0]=a;for(var h=1;h<i;h++){for(var u=c>>>26,f=67108863&c,l=Math.min(h,e.length-1),d=Math.max(0,h-t.length+1);d<=l;d++){var p=h-d|0;u+=(o=(n=0|t.words[p])*(s=0|e.words[d])+f)/67108864|0,f=67108863&o}r.words[h]=0|f,c=0|u}return 0!==c?r.words[h]=0|c:r.length--,r.strip()}s.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var n=0,s=0,o=0;o<this.length;o++){var a=this.words[o],c=(16777215&(a<<n|s)).toString(16);s=a>>>24-n&16777215,(n+=2)>=26&&(n-=26,o--),r=0!==s||o!==this.length-1?u[6-c.length]+c+r:c+r}for(0!==s&&(r=s.toString(16)+r);r.length%e!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var h=f[t],d=l[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var g=p.modn(d).toString(t);r=(p=p.idivn(d)).isZero()?g+r:u[h-g.length]+g+r}for(this.isZero()&&(r="0"+r);r.length%e!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}i(!1,"Base should be between 2 and 36")},s.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},s.prototype.toJSON=function(){return this.toString(16)},s.prototype.toBuffer=function(t,e){return i("undefined"!==typeof o),this.toArrayLike(o,t,e)},s.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},s.prototype.toArrayLike=function(t,e,r){var n=this.byteLength(),s=r||Math.max(1,n);i(n<=s,"byte array longer than desired length"),i(s>0,"Requested array length <= 0"),this.strip();var o,a,c="le"===e,h=new t(s),u=this.clone();if(c){for(a=0;!u.isZero();a++)o=u.andln(255),u.iushrn(8),h[a]=o;for(;a<s;a++)h[a]=0}else{for(a=0;a<s-n;a++)h[a]=0;for(a=0;!u.isZero();a++)o=u.andln(255),u.iushrn(8),h[s-a-1]=o}return h},Math.clz32?s.prototype._countBits=function(t){return 32-Math.clz32(t)}:s.prototype._countBits=function(t){var e=t,r=0;return e>=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},s.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0===(8191&e)&&(r+=13,e>>>=13),0===(127&e)&&(r+=7,e>>>=7),0===(15&e)&&(r+=4,e>>>=4),0===(3&e)&&(r+=2,e>>>=2),0===(1&e)&&r++,r},s.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;e<this.length;e++){var r=this._zeroBits(this.words[e]);if(t+=r,26!==r)break}return t},s.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},s.prototype.toTwos=function(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},s.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},s.prototype.isNeg=function(){return 0!==this.negative},s.prototype.neg=function(){return this.clone().ineg()},s.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},s.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var e=0;e<t.length;e++)this.words[e]=this.words[e]|t.words[e];return this.strip()},s.prototype.ior=function(t){return i(0===(this.negative|t.negative)),this.iuor(t)},s.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},s.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},s.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;r<e.length;r++)this.words[r]=this.words[r]&t.words[r];return this.length=e.length,this.strip()},s.prototype.iand=function(t){return i(0===(this.negative|t.negative)),this.iuand(t)},s.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},s.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},s.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var i=0;i<r.length;i++)this.words[i]=e.words[i]^r.words[i];if(this!==e)for(;i<e.length;i++)this.words[i]=e.words[i];return this.length=e.length,this.strip()},s.prototype.ixor=function(t){return i(0===(this.negative|t.negative)),this.iuxor(t)},s.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},s.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},s.prototype.inotn=function(t){i("number"===typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var n=0;n<e;n++)this.words[n]=67108863&~this.words[n];return r>0&&(this.words[n]=~this.words[n]&67108863>>26-r),this.strip()},s.prototype.notn=function(t){return this.clone().inotn(t)},s.prototype.setn=function(t,e){i("number"===typeof t&&t>=0);var r=t/26|0,n=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<<n:this.words[r]&~(1<<n),this.strip()},s.prototype.iadd=function(t){var e,r,i;if(0!==this.negative&&0===t.negative)return this.negative=0,e=this.isub(t),this.negative^=1,this._normSign();if(0===this.negative&&0!==t.negative)return t.negative=0,e=this.isub(t),t.negative=1,e._normSign();this.length>t.length?(r=this,i=t):(r=t,i=this);for(var n=0,s=0;s<i.length;s++)e=(0|r.words[s])+(0|i.words[s])+n,this.words[s]=67108863&e,n=e>>>26;for(;0!==n&&s<r.length;s++)e=(0|r.words[s])+n,this.words[s]=67108863&e,n=e>>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;s<r.length;s++)this.words[s]=r.words[s];return this},s.prototype.add=function(t){var e;return 0!==t.negative&&0===this.negative?(t.negative=0,e=this.sub(t),t.negative^=1,e):0===t.negative&&0!==this.negative?(this.negative=0,e=t.sub(this),this.negative=1,e):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},s.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,i,n=this.cmp(t);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(r=this,i=t):(r=t,i=this);for(var s=0,o=0;o<i.length;o++)s=(e=(0|r.words[o])-(0|i.words[o])+s)>>26,this.words[o]=67108863&e;for(;0!==s&&o<r.length;o++)s=(e=(0|r.words[o])+s)>>26,this.words[o]=67108863&e;if(0===s&&o<r.length&&r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this.length=Math.max(this.length,o),r!==this&&(this.negative=1),this.strip()},s.prototype.sub=function(t){return this.clone().isub(t)};var p=function(t,e,r){var i,n,s,o=t.words,a=e.words,c=r.words,h=0,u=0|o[0],f=8191&u,l=u>>>13,d=0|o[1],p=8191&d,g=d>>>13,m=0|o[2],v=8191&m,b=m>>>13,y=0|o[3],w=8191&y,_=y>>>13,A=0|o[4],E=8191&A,S=A>>>13,M=0|o[5],I=8191&M,x=M>>>13,P=0|o[6],O=8191&P,N=P>>>13,R=0|o[7],C=8191&R,T=R>>>13,k=0|o[8],L=8191&k,q=k>>>13,D=0|o[9],U=8191&D,B=D>>>13,j=0|a[0],z=8191&j,F=j>>>13,H=0|a[1],K=8191&H,V=H>>>13,W=0|a[2],G=8191&W,J=W>>>13,Y=0|a[3],Q=8191&Y,X=Y>>>13,Z=0|a[4],$=8191&Z,tt=Z>>>13,et=0|a[5],rt=8191&et,it=et>>>13,nt=0|a[6],st=8191&nt,ot=nt>>>13,at=0|a[7],ct=8191&at,ht=at>>>13,ut=0|a[8],ft=8191&ut,lt=ut>>>13,dt=0|a[9],pt=8191&dt,gt=dt>>>13;r.negative=t.negative^e.negative,r.length=19;var mt=(h+(i=Math.imul(f,z))|0)+((8191&(n=(n=Math.imul(f,F))+Math.imul(l,z)|0))<<13)|0;h=((s=Math.imul(l,F))+(n>>>13)|0)+(mt>>>26)|0,mt&=67108863,i=Math.imul(p,z),n=(n=Math.imul(p,F))+Math.imul(g,z)|0,s=Math.imul(g,F);var vt=(h+(i=i+Math.imul(f,K)|0)|0)+((8191&(n=(n=n+Math.imul(f,V)|0)+Math.imul(l,K)|0))<<13)|0;h=((s=s+Math.imul(l,V)|0)+(n>>>13)|0)+(vt>>>26)|0,vt&=67108863,i=Math.imul(v,z),n=(n=Math.imul(v,F))+Math.imul(b,z)|0,s=Math.imul(b,F),i=i+Math.imul(p,K)|0,n=(n=n+Math.imul(p,V)|0)+Math.imul(g,K)|0,s=s+Math.imul(g,V)|0;var bt=(h+(i=i+Math.imul(f,G)|0)|0)+((8191&(n=(n=n+Math.imul(f,J)|0)+Math.imul(l,G)|0))<<13)|0;h=((s=s+Math.imul(l,J)|0)+(n>>>13)|0)+(bt>>>26)|0,bt&=67108863,i=Math.imul(w,z),n=(n=Math.imul(w,F))+Math.imul(_,z)|0,s=Math.imul(_,F),i=i+Math.imul(v,K)|0,n=(n=n+Math.imul(v,V)|0)+Math.imul(b,K)|0,s=s+Math.imul(b,V)|0,i=i+Math.imul(p,G)|0,n=(n=n+Math.imul(p,J)|0)+Math.imul(g,G)|0,s=s+Math.imul(g,J)|0;var yt=(h+(i=i+Math.imul(f,Q)|0)|0)+((8191&(n=(n=n+Math.imul(f,X)|0)+Math.imul(l,Q)|0))<<13)|0;h=((s=s+Math.imul(l,X)|0)+(n>>>13)|0)+(yt>>>26)|0,yt&=67108863,i=Math.imul(E,z),n=(n=Math.imul(E,F))+Math.imul(S,z)|0,s=Math.imul(S,F),i=i+Math.imul(w,K)|0,n=(n=n+Math.imul(w,V)|0)+Math.imul(_,K)|0,s=s+Math.imul(_,V)|0,i=i+Math.imul(v,G)|0,n=(n=n+Math.imul(v,J)|0)+Math.imul(b,G)|0,s=s+Math.imul(b,J)|0,i=i+Math.imul(p,Q)|0,n=(n=n+Math.imul(p,X)|0)+Math.imul(g,Q)|0,s=s+Math.imul(g,X)|0;var wt=(h+(i=i+Math.imul(f,$)|0)|0)+((8191&(n=(n=n+Math.imul(f,tt)|0)+Math.imul(l,$)|0))<<13)|0;h=((s=s+Math.imul(l,tt)|0)+(n>>>13)|0)+(wt>>>26)|0,wt&=67108863,i=Math.imul(I,z),n=(n=Math.imul(I,F))+Math.imul(x,z)|0,s=Math.imul(x,F),i=i+Math.imul(E,K)|0,n=(n=n+Math.imul(E,V)|0)+Math.imul(S,K)|0,s=s+Math.imul(S,V)|0,i=i+Math.imul(w,G)|0,n=(n=n+Math.imul(w,J)|0)+Math.imul(_,G)|0,s=s+Math.imul(_,J)|0,i=i+Math.imul(v,Q)|0,n=(n=n+Math.imul(v,X)|0)+Math.imul(b,Q)|0,s=s+Math.imul(b,X)|0,i=i+Math.imul(p,$)|0,n=(n=n+Math.imul(p,tt)|0)+Math.imul(g,$)|0,s=s+Math.imul(g,tt)|0;var _t=(h+(i=i+Math.imul(f,rt)|0)|0)+((8191&(n=(n=n+Math.imul(f,it)|0)+Math.imul(l,rt)|0))<<13)|0;h=((s=s+Math.imul(l,it)|0)+(n>>>13)|0)+(_t>>>26)|0,_t&=67108863,i=Math.imul(O,z),n=(n=Math.imul(O,F))+Math.imul(N,z)|0,s=Math.imul(N,F),i=i+Math.imul(I,K)|0,n=(n=n+Math.imul(I,V)|0)+Math.imul(x,K)|0,s=s+Math.imul(x,V)|0,i=i+Math.imul(E,G)|0,n=(n=n+Math.imul(E,J)|0)+Math.imul(S,G)|0,s=s+Math.imul(S,J)|0,i=i+Math.imul(w,Q)|0,n=(n=n+Math.imul(w,X)|0)+Math.imul(_,Q)|0,s=s+Math.imul(_,X)|0,i=i+Math.imul(v,$)|0,n=(n=n+Math.imul(v,tt)|0)+Math.imul(b,$)|0,s=s+Math.imul(b,tt)|0,i=i+Math.imul(p,rt)|0,n=(n=n+Math.imul(p,it)|0)+Math.imul(g,rt)|0,s=s+Math.imul(g,it)|0;var At=(h+(i=i+Math.imul(f,st)|0)|0)+((8191&(n=(n=n+Math.imul(f,ot)|0)+Math.imul(l,st)|0))<<13)|0;h=((s=s+Math.imul(l,ot)|0)+(n>>>13)|0)+(At>>>26)|0,At&=67108863,i=Math.imul(C,z),n=(n=Math.imul(C,F))+Math.imul(T,z)|0,s=Math.imul(T,F),i=i+Math.imul(O,K)|0,n=(n=n+Math.imul(O,V)|0)+Math.imul(N,K)|0,s=s+Math.imul(N,V)|0,i=i+Math.imul(I,G)|0,n=(n=n+Math.imul(I,J)|0)+Math.imul(x,G)|0,s=s+Math.imul(x,J)|0,i=i+Math.imul(E,Q)|0,n=(n=n+Math.imul(E,X)|0)+Math.imul(S,Q)|0,s=s+Math.imul(S,X)|0,i=i+Math.imul(w,$)|0,n=(n=n+Math.imul(w,tt)|0)+Math.imul(_,$)|0,s=s+Math.imul(_,tt)|0,i=i+Math.imul(v,rt)|0,n=(n=n+Math.imul(v,it)|0)+Math.imul(b,rt)|0,s=s+Math.imul(b,it)|0,i=i+Math.imul(p,st)|0,n=(n=n+Math.imul(p,ot)|0)+Math.imul(g,st)|0,s=s+Math.imul(g,ot)|0;var Et=(h+(i=i+Math.imul(f,ct)|0)|0)+((8191&(n=(n=n+Math.imul(f,ht)|0)+Math.imul(l,ct)|0))<<13)|0;h=((s=s+Math.imul(l,ht)|0)+(n>>>13)|0)+(Et>>>26)|0,Et&=67108863,i=Math.imul(L,z),n=(n=Math.imul(L,F))+Math.imul(q,z)|0,s=Math.imul(q,F),i=i+Math.imul(C,K)|0,n=(n=n+Math.imul(C,V)|0)+Math.imul(T,K)|0,s=s+Math.imul(T,V)|0,i=i+Math.imul(O,G)|0,n=(n=n+Math.imul(O,J)|0)+Math.imul(N,G)|0,s=s+Math.imul(N,J)|0,i=i+Math.imul(I,Q)|0,n=(n=n+Math.imul(I,X)|0)+Math.imul(x,Q)|0,s=s+Math.imul(x,X)|0,i=i+Math.imul(E,$)|0,n=(n=n+Math.imul(E,tt)|0)+Math.imul(S,$)|0,s=s+Math.imul(S,tt)|0,i=i+Math.imul(w,rt)|0,n=(n=n+Math.imul(w,it)|0)+Math.imul(_,rt)|0,s=s+Math.imul(_,it)|0,i=i+Math.imul(v,st)|0,n=(n=n+Math.imul(v,ot)|0)+Math.imul(b,st)|0,s=s+Math.imul(b,ot)|0,i=i+Math.imul(p,ct)|0,n=(n=n+Math.imul(p,ht)|0)+Math.imul(g,ct)|0,s=s+Math.imul(g,ht)|0;var St=(h+(i=i+Math.imul(f,ft)|0)|0)+((8191&(n=(n=n+Math.imul(f,lt)|0)+Math.imul(l,ft)|0))<<13)|0;h=((s=s+Math.imul(l,lt)|0)+(n>>>13)|0)+(St>>>26)|0,St&=67108863,i=Math.imul(U,z),n=(n=Math.imul(U,F))+Math.imul(B,z)|0,s=Math.imul(B,F),i=i+Math.imul(L,K)|0,n=(n=n+Math.imul(L,V)|0)+Math.imul(q,K)|0,s=s+Math.imul(q,V)|0,i=i+Math.imul(C,G)|0,n=(n=n+Math.imul(C,J)|0)+Math.imul(T,G)|0,s=s+Math.imul(T,J)|0,i=i+Math.imul(O,Q)|0,n=(n=n+Math.imul(O,X)|0)+Math.imul(N,Q)|0,s=s+Math.imul(N,X)|0,i=i+Math.imul(I,$)|0,n=(n=n+Math.imul(I,tt)|0)+Math.imul(x,$)|0,s=s+Math.imul(x,tt)|0,i=i+Math.imul(E,rt)|0,n=(n=n+Math.imul(E,it)|0)+Math.imul(S,rt)|0,s=s+Math.imul(S,it)|0,i=i+Math.imul(w,st)|0,n=(n=n+Math.imul(w,ot)|0)+Math.imul(_,st)|0,s=s+Math.imul(_,ot)|0,i=i+Math.imul(v,ct)|0,n=(n=n+Math.imul(v,ht)|0)+Math.imul(b,ct)|0,s=s+Math.imul(b,ht)|0,i=i+Math.imul(p,ft)|0,n=(n=n+Math.imul(p,lt)|0)+Math.imul(g,ft)|0,s=s+Math.imul(g,lt)|0;var Mt=(h+(i=i+Math.imul(f,pt)|0)|0)+((8191&(n=(n=n+Math.imul(f,gt)|0)+Math.imul(l,pt)|0))<<13)|0;h=((s=s+Math.imul(l,gt)|0)+(n>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,i=Math.imul(U,K),n=(n=Math.imul(U,V))+Math.imul(B,K)|0,s=Math.imul(B,V),i=i+Math.imul(L,G)|0,n=(n=n+Math.imul(L,J)|0)+Math.imul(q,G)|0,s=s+Math.imul(q,J)|0,i=i+Math.imul(C,Q)|0,n=(n=n+Math.imul(C,X)|0)+Math.imul(T,Q)|0,s=s+Math.imul(T,X)|0,i=i+Math.imul(O,$)|0,n=(n=n+Math.imul(O,tt)|0)+Math.imul(N,$)|0,s=s+Math.imul(N,tt)|0,i=i+Math.imul(I,rt)|0,n=(n=n+Math.imul(I,it)|0)+Math.imul(x,rt)|0,s=s+Math.imul(x,it)|0,i=i+Math.imul(E,st)|0,n=(n=n+Math.imul(E,ot)|0)+Math.imul(S,st)|0,s=s+Math.imul(S,ot)|0,i=i+Math.imul(w,ct)|0,n=(n=n+Math.imul(w,ht)|0)+Math.imul(_,ct)|0,s=s+Math.imul(_,ht)|0,i=i+Math.imul(v,ft)|0,n=(n=n+Math.imul(v,lt)|0)+Math.imul(b,ft)|0,s=s+Math.imul(b,lt)|0;var It=(h+(i=i+Math.imul(p,pt)|0)|0)+((8191&(n=(n=n+Math.imul(p,gt)|0)+Math.imul(g,pt)|0))<<13)|0;h=((s=s+Math.imul(g,gt)|0)+(n>>>13)|0)+(It>>>26)|0,It&=67108863,i=Math.imul(U,G),n=(n=Math.imul(U,J))+Math.imul(B,G)|0,s=Math.imul(B,J),i=i+Math.imul(L,Q)|0,n=(n=n+Math.imul(L,X)|0)+Math.imul(q,Q)|0,s=s+Math.imul(q,X)|0,i=i+Math.imul(C,$)|0,n=(n=n+Math.imul(C,tt)|0)+Math.imul(T,$)|0,s=s+Math.imul(T,tt)|0,i=i+Math.imul(O,rt)|0,n=(n=n+Math.imul(O,it)|0)+Math.imul(N,rt)|0,s=s+Math.imul(N,it)|0,i=i+Math.imul(I,st)|0,n=(n=n+Math.imul(I,ot)|0)+Math.imul(x,st)|0,s=s+Math.imul(x,ot)|0,i=i+Math.imul(E,ct)|0,n=(n=n+Math.imul(E,ht)|0)+Math.imul(S,ct)|0,s=s+Math.imul(S,ht)|0,i=i+Math.imul(w,ft)|0,n=(n=n+Math.imul(w,lt)|0)+Math.imul(_,ft)|0,s=s+Math.imul(_,lt)|0;var xt=(h+(i=i+Math.imul(v,pt)|0)|0)+((8191&(n=(n=n+Math.imul(v,gt)|0)+Math.imul(b,pt)|0))<<13)|0;h=((s=s+Math.imul(b,gt)|0)+(n>>>13)|0)+(xt>>>26)|0,xt&=67108863,i=Math.imul(U,Q),n=(n=Math.imul(U,X))+Math.imul(B,Q)|0,s=Math.imul(B,X),i=i+Math.imul(L,$)|0,n=(n=n+Math.imul(L,tt)|0)+Math.imul(q,$)|0,s=s+Math.imul(q,tt)|0,i=i+Math.imul(C,rt)|0,n=(n=n+Math.imul(C,it)|0)+Math.imul(T,rt)|0,s=s+Math.imul(T,it)|0,i=i+Math.imul(O,st)|0,n=(n=n+Math.imul(O,ot)|0)+Math.imul(N,st)|0,s=s+Math.imul(N,ot)|0,i=i+Math.imul(I,ct)|0,n=(n=n+Math.imul(I,ht)|0)+Math.imul(x,ct)|0,s=s+Math.imul(x,ht)|0,i=i+Math.imul(E,ft)|0,n=(n=n+Math.imul(E,lt)|0)+Math.imul(S,ft)|0,s=s+Math.imul(S,lt)|0;var Pt=(h+(i=i+Math.imul(w,pt)|0)|0)+((8191&(n=(n=n+Math.imul(w,gt)|0)+Math.imul(_,pt)|0))<<13)|0;h=((s=s+Math.imul(_,gt)|0)+(n>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,i=Math.imul(U,$),n=(n=Math.imul(U,tt))+Math.imul(B,$)|0,s=Math.imul(B,tt),i=i+Math.imul(L,rt)|0,n=(n=n+Math.imul(L,it)|0)+Math.imul(q,rt)|0,s=s+Math.imul(q,it)|0,i=i+Math.imul(C,st)|0,n=(n=n+Math.imul(C,ot)|0)+Math.imul(T,st)|0,s=s+Math.imul(T,ot)|0,i=i+Math.imul(O,ct)|0,n=(n=n+Math.imul(O,ht)|0)+Math.imul(N,ct)|0,s=s+Math.imul(N,ht)|0,i=i+Math.imul(I,ft)|0,n=(n=n+Math.imul(I,lt)|0)+Math.imul(x,ft)|0,s=s+Math.imul(x,lt)|0;var Ot=(h+(i=i+Math.imul(E,pt)|0)|0)+((8191&(n=(n=n+Math.imul(E,gt)|0)+Math.imul(S,pt)|0))<<13)|0;h=((s=s+Math.imul(S,gt)|0)+(n>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,i=Math.imul(U,rt),n=(n=Math.imul(U,it))+Math.imul(B,rt)|0,s=Math.imul(B,it),i=i+Math.imul(L,st)|0,n=(n=n+Math.imul(L,ot)|0)+Math.imul(q,st)|0,s=s+Math.imul(q,ot)|0,i=i+Math.imul(C,ct)|0,n=(n=n+Math.imul(C,ht)|0)+Math.imul(T,ct)|0,s=s+Math.imul(T,ht)|0,i=i+Math.imul(O,ft)|0,n=(n=n+Math.imul(O,lt)|0)+Math.imul(N,ft)|0,s=s+Math.imul(N,lt)|0;var Nt=(h+(i=i+Math.imul(I,pt)|0)|0)+((8191&(n=(n=n+Math.imul(I,gt)|0)+Math.imul(x,pt)|0))<<13)|0;h=((s=s+Math.imul(x,gt)|0)+(n>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,i=Math.imul(U,st),n=(n=Math.imul(U,ot))+Math.imul(B,st)|0,s=Math.imul(B,ot),i=i+Math.imul(L,ct)|0,n=(n=n+Math.imul(L,ht)|0)+Math.imul(q,ct)|0,s=s+Math.imul(q,ht)|0,i=i+Math.imul(C,ft)|0,n=(n=n+Math.imul(C,lt)|0)+Math.imul(T,ft)|0,s=s+Math.imul(T,lt)|0;var Rt=(h+(i=i+Math.imul(O,pt)|0)|0)+((8191&(n=(n=n+Math.imul(O,gt)|0)+Math.imul(N,pt)|0))<<13)|0;h=((s=s+Math.imul(N,gt)|0)+(n>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,i=Math.imul(U,ct),n=(n=Math.imul(U,ht))+Math.imul(B,ct)|0,s=Math.imul(B,ht),i=i+Math.imul(L,ft)|0,n=(n=n+Math.imul(L,lt)|0)+Math.imul(q,ft)|0,s=s+Math.imul(q,lt)|0;var Ct=(h+(i=i+Math.imul(C,pt)|0)|0)+((8191&(n=(n=n+Math.imul(C,gt)|0)+Math.imul(T,pt)|0))<<13)|0;h=((s=s+Math.imul(T,gt)|0)+(n>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,i=Math.imul(U,ft),n=(n=Math.imul(U,lt))+Math.imul(B,ft)|0,s=Math.imul(B,lt);var Tt=(h+(i=i+Math.imul(L,pt)|0)|0)+((8191&(n=(n=n+Math.imul(L,gt)|0)+Math.imul(q,pt)|0))<<13)|0;h=((s=s+Math.imul(q,gt)|0)+(n>>>13)|0)+(Tt>>>26)|0,Tt&=67108863;var kt=(h+(i=Math.imul(U,pt))|0)+((8191&(n=(n=Math.imul(U,gt))+Math.imul(B,pt)|0))<<13)|0;return h=((s=Math.imul(B,gt))+(n>>>13)|0)+(kt>>>26)|0,kt&=67108863,c[0]=mt,c[1]=vt,c[2]=bt,c[3]=yt,c[4]=wt,c[5]=_t,c[6]=At,c[7]=Et,c[8]=St,c[9]=Mt,c[10]=It,c[11]=xt,c[12]=Pt,c[13]=Ot,c[14]=Nt,c[15]=Rt,c[16]=Ct,c[17]=Tt,c[18]=kt,0!==h&&(c[19]=h,r.length++),r};function g(t,e,r){return(new m).mulp(t,e,r)}function m(t,e){this.x=t,this.y=e}Math.imul||(p=d),s.prototype.mulTo=function(t,e){var r,i=this.length+t.length;return r=10===this.length&&10===t.length?p(this,t,e):i<63?d(this,t,e):i<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var i=0,n=0,s=0;s<r.length-1;s++){var o=n;n=0;for(var a=67108863&i,c=Math.min(s,e.length-1),h=Math.max(0,s-t.length+1);h<=c;h++){var u=s-h,f=(0|t.words[u])*(0|e.words[h]),l=67108863&f;a=67108863&(l=l+a|0),n+=(o=(o=o+(f/67108864|0)|0)+(l>>>26)|0)>>>26,o&=67108863}r.words[s]=a,i=o,o=n}return 0!==i?r.words[s]=i:r.length--,r.strip()}(this,t,e):g(this,t,e),r},m.prototype.makeRBT=function(t){for(var e=new Array(t),r=s.prototype._countBits(t)-1,i=0;i<t;i++)e[i]=this.revBin(i,r,t);return e},m.prototype.revBin=function(t,e,r){if(0===t||t===r-1)return t;for(var i=0,n=0;n<e;n++)i|=(1&t)<<e-n-1,t>>=1;return i},m.prototype.permute=function(t,e,r,i,n,s){for(var o=0;o<s;o++)i[o]=e[t[o]],n[o]=r[t[o]]},m.prototype.transform=function(t,e,r,i,n,s){this.permute(s,t,e,r,i,n);for(var o=1;o<n;o<<=1)for(var a=o<<1,c=Math.cos(2*Math.PI/a),h=Math.sin(2*Math.PI/a),u=0;u<n;u+=a)for(var f=c,l=h,d=0;d<o;d++){var p=r[u+d],g=i[u+d],m=r[u+d+o],v=i[u+d+o],b=f*m-l*v;v=f*v+l*m,m=b,r[u+d]=p+m,i[u+d]=g+v,r[u+d+o]=p-m,i[u+d+o]=g-v,d!==a&&(b=c*f-h*l,l=c*l+h*f,f=b)}},m.prototype.guessLen13b=function(t,e){var r=1|Math.max(e,t),i=1&r,n=0;for(r=r/2|0;r;r>>>=1)n++;return 1<<n+1+i},m.prototype.conjugate=function(t,e,r){if(!(r<=1))for(var i=0;i<r/2;i++){var n=t[i];t[i]=t[r-i-1],t[r-i-1]=n,n=e[i],e[i]=-e[r-i-1],e[r-i-1]=-n}},m.prototype.normalize13b=function(t,e){for(var r=0,i=0;i<e/2;i++){var n=8192*Math.round(t[2*i+1]/e)+Math.round(t[2*i]/e)+r;t[i]=67108863&n,r=n<67108864?0:n/67108864|0}return t},m.prototype.convert13b=function(t,e,r,n){for(var s=0,o=0;o<e;o++)s+=0|t[o],r[2*o]=8191&s,s>>>=13,r[2*o+1]=8191&s,s>>>=13;for(o=2*e;o<n;++o)r[o]=0;i(0===s),i(0===(-8192&s))},m.prototype.stub=function(t){for(var e=new Array(t),r=0;r<t;r++)e[r]=0;return e},m.prototype.mulp=function(t,e,r){var i=2*this.guessLen13b(t.length,e.length),n=this.makeRBT(i),s=this.stub(i),o=new Array(i),a=new Array(i),c=new Array(i),h=new Array(i),u=new Array(i),f=new Array(i),l=r.words;l.length=i,this.convert13b(t.words,t.length,o,i),this.convert13b(e.words,e.length,h,i),this.transform(o,s,a,c,i,n),this.transform(h,s,u,f,i,n);for(var d=0;d<i;d++){var p=a[d]*u[d]-c[d]*f[d];c[d]=a[d]*f[d]+c[d]*u[d],a[d]=p}return this.conjugate(a,c,i),this.transform(a,c,l,s,i,n),this.conjugate(l,s,i),this.normalize13b(l,i),r.negative=t.negative^e.negative,r.length=t.length+e.length,r.strip()},s.prototype.mul=function(t){var e=new s(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},s.prototype.mulf=function(t){var e=new s(null);return e.words=new Array(this.length+t.length),g(this,t,e)},s.prototype.imul=function(t){return this.clone().mulTo(t,this)},s.prototype.imuln=function(t){i("number"===typeof t),i(t<67108864);for(var e=0,r=0;r<this.length;r++){var n=(0|this.words[r])*t,s=(67108863&n)+(67108863&e);e>>=26,e+=n/67108864|0,e+=s>>>26,this.words[r]=67108863&s}return 0!==e&&(this.words[r]=e,this.length++),this},s.prototype.muln=function(t){return this.clone().imuln(t)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r<e.length;r++){var i=r/26|0,n=r%26;e[r]=(t.words[i]&1<<n)>>>n}return e}(t);if(0===e.length)return new s(1);for(var r=this,i=0;i<e.length&&0===e[i];i++,r=r.sqr());if(++i<e.length)for(var n=r.sqr();i<e.length;i++,n=n.sqr())0!==e[i]&&(r=r.mul(n));return r},s.prototype.iushln=function(t){i("number"===typeof t&&t>=0);var e,r=t%26,n=(t-r)/26,s=67108863>>>26-r<<26-r;if(0!==r){var o=0;for(e=0;e<this.length;e++){var a=this.words[e]&s,c=(0|this.words[e])-a<<r;this.words[e]=c|o,o=a>>>26-r}o&&(this.words[e]=o,this.length++)}if(0!==n){for(e=this.length-1;e>=0;e--)this.words[e+n]=this.words[e];for(e=0;e<n;e++)this.words[e]=0;this.length+=n}return this.strip()},s.prototype.ishln=function(t){return i(0===this.negative),this.iushln(t)},s.prototype.iushrn=function(t,e,r){var n;i("number"===typeof t&&t>=0),n=e?(e-e%26)/26:0;var s=t%26,o=Math.min((t-s)/26,this.length),a=67108863^67108863>>>s<<s,c=r;if(n-=o,n=Math.max(0,n),c){for(var h=0;h<o;h++)c.words[h]=this.words[h];c.length=o}if(0===o);else if(this.length>o)for(this.length-=o,h=0;h<this.length;h++)this.words[h]=this.words[h+o];else this.words[0]=0,this.length=1;var u=0;for(h=this.length-1;h>=0&&(0!==u||h>=n);h--){var f=0|this.words[h];this.words[h]=u<<26-s|f>>>s,u=f&a}return c&&0!==u&&(c.words[c.length++]=u),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},s.prototype.ishrn=function(t,e,r){return i(0===this.negative),this.iushrn(t,e,r)},s.prototype.shln=function(t){return this.clone().ishln(t)},s.prototype.ushln=function(t){return this.clone().iushln(t)},s.prototype.shrn=function(t){return this.clone().ishrn(t)},s.prototype.ushrn=function(t){return this.clone().iushrn(t)},s.prototype.testn=function(t){i("number"===typeof t&&t>=0);var e=t%26,r=(t-e)/26,n=1<<e;return!(this.length<=r)&&!!(this.words[r]&n)},s.prototype.imaskn=function(t){i("number"===typeof t&&t>=0);var e=t%26,r=(t-e)/26;if(i(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var n=67108863^67108863>>>e<<e;this.words[this.length-1]&=n}return this.strip()},s.prototype.maskn=function(t){return this.clone().imaskn(t)},s.prototype.iaddn=function(t){return i("number"===typeof t),i(t<67108864),t<0?this.isubn(-t):0!==this.negative?1===this.length&&(0|this.words[0])<t?(this.words[0]=t-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(t),this.negative=1,this):this._iaddn(t)},s.prototype._iaddn=function(t){this.words[0]+=t;for(var e=0;e<this.length&&this.words[e]>=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},s.prototype.isubn=function(t){if(i("number"===typeof t),i(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e<this.length&&this.words[e]<0;e++)this.words[e]+=67108864,this.words[e+1]-=1;return this.strip()},s.prototype.addn=function(t){return this.clone().iaddn(t)},s.prototype.subn=function(t){return this.clone().isubn(t)},s.prototype.iabs=function(){return this.negative=0,this},s.prototype.abs=function(){return this.clone().iabs()},s.prototype._ishlnsubmul=function(t,e,r){var n,s,o=t.length+r;this._expand(o);var a=0;for(n=0;n<t.length;n++){s=(0|this.words[n+r])+a;var c=(0|t.words[n])*e;a=((s-=67108863&c)>>26)-(c/67108864|0),this.words[n+r]=67108863&s}for(;n<this.length-r;n++)a=(s=(0|this.words[n+r])+a)>>26,this.words[n+r]=67108863&s;if(0===a)return this.strip();for(i(-1===a),a=0,n=0;n<this.length;n++)a=(s=-(0|this.words[n])+a)>>26,this.words[n]=67108863&s;return this.negative=1,this.strip()},s.prototype._wordDiv=function(t,e){var r=(this.length,t.length),i=this.clone(),n=t,o=0|n.words[n.length-1];0!==(r=26-this._countBits(o))&&(n=n.ushln(r),i.iushln(r),o=0|n.words[n.length-1]);var a,c=i.length-n.length;if("mod"!==e){(a=new s(null)).length=c+1,a.words=new Array(a.length);for(var h=0;h<a.length;h++)a.words[h]=0}var u=i.clone()._ishlnsubmul(n,1,c);0===u.negative&&(i=u,a&&(a.words[c]=1));for(var f=c-1;f>=0;f--){var l=67108864*(0|i.words[n.length+f])+(0|i.words[n.length+f-1]);for(l=Math.min(l/o|0,67108863),i._ishlnsubmul(n,l,f);0!==i.negative;)l--,i.negative=0,i._ishlnsubmul(n,1,f),i.isZero()||(i.negative^=1);a&&(a.words[f]=l)}return a&&a.strip(),i.strip(),"div"!==e&&0!==r&&i.iushrn(r),{div:a||null,mod:i}},s.prototype.divmod=function(t,e,r){return i(!t.isZero()),this.isZero()?{div:new s(0),mod:new s(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(n=a.div.neg()),"div"!==e&&(o=a.mod.neg(),r&&0!==o.negative&&o.iadd(t)),{div:n,mod:o}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(n=a.div.neg()),{div:n,mod:a.mod}):0!==(this.negative&t.negative)?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(o=a.mod.neg(),r&&0!==o.negative&&o.isub(t)),{div:a.div,mod:o}):t.length>this.length||this.cmp(t)<0?{div:new s(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new s(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new s(this.modn(t.words[0]))}:this._wordDiv(t,e);var n,o,a},s.prototype.div=function(t){return this.divmod(t,"div",!1).div},s.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},s.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},s.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,i=t.ushrn(1),n=t.andln(1),s=r.cmp(i);return s<0||1===n&&0===s?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},s.prototype.modn=function(t){i(t<=67108863);for(var e=(1<<26)%t,r=0,n=this.length-1;n>=0;n--)r=(e*r+(0|this.words[n]))%t;return r},s.prototype.idivn=function(t){i(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var n=(0|this.words[r])+67108864*e;this.words[r]=n/t|0,e=n%t}return this.strip()},s.prototype.divn=function(t){return this.clone().idivn(t)},s.prototype.egcd=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n=new s(1),o=new s(0),a=new s(0),c=new s(1),h=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++h;for(var u=r.clone(),f=e.clone();!e.isZero();){for(var l=0,d=1;0===(e.words[0]&d)&&l<26;++l,d<<=1);if(l>0)for(e.iushrn(l);l-- >0;)(n.isOdd()||o.isOdd())&&(n.iadd(u),o.isub(f)),n.iushrn(1),o.iushrn(1);for(var p=0,g=1;0===(r.words[0]&g)&&p<26;++p,g<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||c.isOdd())&&(a.iadd(u),c.isub(f)),a.iushrn(1),c.iushrn(1);e.cmp(r)>=0?(e.isub(r),n.isub(a),o.isub(c)):(r.isub(e),a.isub(n),c.isub(o))}return{a:a,b:c,gcd:r.iushln(h)}},s.prototype._invmp=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n,o=new s(1),a=new s(0),c=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var h=0,u=1;0===(e.words[0]&u)&&h<26;++h,u<<=1);if(h>0)for(e.iushrn(h);h-- >0;)o.isOdd()&&o.iadd(c),o.iushrn(1);for(var f=0,l=1;0===(r.words[0]&l)&&f<26;++f,l<<=1);if(f>0)for(r.iushrn(f);f-- >0;)a.isOdd()&&a.iadd(c),a.iushrn(1);e.cmp(r)>=0?(e.isub(r),o.isub(a)):(r.isub(e),a.isub(o))}return(n=0===e.cmpn(1)?o:a).cmpn(0)<0&&n.iadd(t),n},s.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var i=0;e.isEven()&&r.isEven();i++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var n=e.cmp(r);if(n<0){var s=e;e=r,r=s}else if(0===n||0===r.cmpn(1))break;e.isub(r)}return r.iushln(i)},s.prototype.invm=function(t){return this.egcd(t).a.umod(t)},s.prototype.isEven=function(){return 0===(1&this.words[0])},s.prototype.isOdd=function(){return 1===(1&this.words[0])},s.prototype.andln=function(t){return this.words[0]&t},s.prototype.bincn=function(t){i("number"===typeof t);var e=t%26,r=(t-e)/26,n=1<<e;if(this.length<=r)return this._expand(r+1),this.words[r]|=n,this;for(var s=n,o=r;0!==s&&o<this.length;o++){var a=0|this.words[o];s=(a+=s)>>>26,a&=67108863,this.words[o]=a}return 0!==s&&(this.words[o]=s,this.length++),this},s.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},s.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)e=1;else{r&&(t=-t),i(t<=67108863,"Number is too big");var n=0|this.words[0];e=n===t?0:n<t?-1:1}return 0!==this.negative?0|-e:e},s.prototype.cmp=function(t){if(0!==this.negative&&0===t.negative)return-1;if(0===this.negative&&0!==t.negative)return 1;var e=this.ucmp(t);return 0!==this.negative?0|-e:e},s.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var e=0,r=this.length-1;r>=0;r--){var i=0|this.words[r],n=0|t.words[r];if(i!==n){i<n?e=-1:i>n&&(e=1);break}}return e},s.prototype.gtn=function(t){return 1===this.cmpn(t)},s.prototype.gt=function(t){return 1===this.cmp(t)},s.prototype.gten=function(t){return this.cmpn(t)>=0},s.prototype.gte=function(t){return this.cmp(t)>=0},s.prototype.ltn=function(t){return-1===this.cmpn(t)},s.prototype.lt=function(t){return-1===this.cmp(t)},s.prototype.lten=function(t){return this.cmpn(t)<=0},s.prototype.lte=function(t){return this.cmp(t)<=0},s.prototype.eqn=function(t){return 0===this.cmpn(t)},s.prototype.eq=function(t){return 0===this.cmp(t)},s.red=function(t){return new E(t)},s.prototype.toRed=function(t){return i(!this.red,"Already a number in reduction context"),i(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},s.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(t){return this.red=t,this},s.prototype.forceRed=function(t){return i(!this.red,"Already a number in reduction context"),this._forceRed(t)},s.prototype.redAdd=function(t){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},s.prototype.redIAdd=function(t){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},s.prototype.redSub=function(t){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},s.prototype.redISub=function(t){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},s.prototype.redShl=function(t){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},s.prototype.redMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},s.prototype.redIMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},s.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},s.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},s.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},s.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},s.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},s.prototype.redPow=function(t){return i(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var v={k256:null,p224:null,p192:null,p25519:null};function b(t,e){this.name=t,this.p=new s(e,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function y(){b.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){b.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function _(){b.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function A(){b.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function E(t){if("string"===typeof t){var e=s._prime(t);this.m=e.p,this.prime=e}else i(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function S(t){E.call(this,t),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new s(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)}b.prototype._tmp=function(){var t=new s(null);return t.words=new Array(Math.ceil(this.n/13)),t},b.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var i=e<this.n?-1:r.ucmp(this.p);return 0===i?(r.words[0]=0,r.length=1):i>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},b.prototype.split=function(t,e){t.iushrn(this.n,0,e)},b.prototype.imulK=function(t){return t.imul(this.k)},n(y,b),y.prototype.split=function(t,e){for(var r=4194303,i=Math.min(t.length,9),n=0;n<i;
vendor: 13,900 bytes, line 2
2n++)e.words[n]=t.words[n];if(e.length=i,t.length<=9)return t.words[0]=0,void(t.length=1);var s=t.words[9];for(e.words[e.length++]=s&r,n=10;n<t.length;n++){var o=0|t.words[n];t.words[n-10]=(o&r)<<4|s>>>22,s=o}s>>>=22,t.words[n-10]=s,0===s&&t.length>10?t.length-=10:t.length-=9},y.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r<t.length;r++){var i=0|t.words[r];e+=977*i,t.words[r]=67108863&e,e=64*i+(e/67108864|0)}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},n(w,b),n(_,b),n(A,b),A.prototype.imulK=function(t){for(var e=0,r=0;r<t.length;r++){var i=19*(0|t.words[r])+e,n=67108863&i;i>>>=26,t.words[r]=n,e=i}return 0!==e&&(t.words[t.length++]=e),t},s._prime=function(t){if(v[t])return v[t];var e;if("k256"===t)e=new y;else if("p224"===t)e=new w;else if("p192"===t)e=new _;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new A}return v[t]=e,e},E.prototype._verify1=function(t){i(0===t.negative,"red works only with positives"),i(t.red,"red works only with red numbers")},E.prototype._verify2=function(t,e){i(0===(t.negative|e.negative),"red works only with positives"),i(t.red&&t.red===e.red,"red works only with red numbers")},E.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},E.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},E.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},E.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},E.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},E.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},E.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},E.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},E.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},E.prototype.isqr=function(t){return this.imul(t,t.clone())},E.prototype.sqr=function(t){return this.mul(t,t)},E.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(i(e%2===1),3===e){var r=this.m.add(new s(1)).iushrn(2);return this.pow(t,r)}for(var n=this.m.subn(1),o=0;!n.isZero()&&0===n.andln(1);)o++,n.iushrn(1);i(!n.isZero());var a=new s(1).toRed(this),c=a.redNeg(),h=this.m.subn(1).iushrn(1),u=this.m.bitLength();for(u=new s(2*u*u).toRed(this);0!==this.pow(u,h).cmp(c);)u.redIAdd(c);for(var f=this.pow(u,n),l=this.pow(t,n.addn(1).iushrn(1)),d=this.pow(t,n),p=o;0!==d.cmp(a);){for(var g=d,m=0;0!==g.cmp(a);m++)g=g.redSqr();i(m<p);var v=this.pow(f,new s(1).iushln(p-m-1));l=l.redMul(v),f=v.redSqr(),d=d.redMul(f),p=m}return l},E.prototype.invm=function(t){var e=t._invmp(this.m);return 0!==e.negative?(e.negative=0,this.imod(e).redNeg()):this.imod(e)},E.prototype.pow=function(t,e){if(e.isZero())return new s(1).toRed(this);if(0===e.cmpn(1))return t.clone();var r=new Array(16);r[0]=new s(1).toRed(this),r[1]=t;for(var i=2;i<r.length;i++)r[i]=this.mul(r[i-1],t);var n=r[0],o=0,a=0,c=e.bitLength()%26;for(0===c&&(c=26),i=e.length-1;i>=0;i--){for(var h=e.words[i],u=c-1;u>=0;u--){var f=h>>u&1;n!==r[0]&&(n=this.sqr(n)),0!==f||0!==o?(o<<=1,o|=f,(4===++a||0===i&&0===u)&&(n=this.mul(n,r[o]),a=0,o=0)):a=0}c=26}return n},E.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},E.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},s.mont=function(t){return new S(t)},n(S,E),S.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},S.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},S.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),s=n;return n.cmp(this.m)>=0?s=n.isub(this.m):n.cmpn(0)<0&&(s=n.iadd(this.m)),s._forceRed(this)},S.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new s(0)._forceRed(this);var r=t.mul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},S.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t=r.nmd(t),this)},27284:t=>{"use strict";var e,r="object"===typeof Reflect?Reflect:null,i=r&&"function"===typeof r.apply?r.apply:function(t,e,r){return Function.prototype.apply.call(t,e,r)};e=r&&"function"===typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var n=Number.isNaN||function(t){return t!==t};function s(){s.init.call(this)}t.exports=s,t.exports.once=function(t,e){return new Promise((function(r,i){function n(r){t.removeListener(e,s),i(r)}function s(){"function"===typeof t.removeListener&&t.removeListener("error",n),r([].slice.call(arguments))}g(t,e,s,{once:!0}),"error"!==e&&function(t,e,r){"function"===typeof t.on&&g(t,"error",e,r)}(t,n,{once:!0})}))},s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var o=10;function a(t){if("function"!==typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function c(t){return void 0===t._maxListeners?s.defaultMaxListeners:t._maxListeners}function h(t,e,r,i){var n,s,o,h;if(a(r),void 0===(s=t._events)?(s=t._events=Object.create(null),t._eventsCount=0):(void 0!==s.newListener&&(t.emit("newListener",e,r.listener?r.listener:r),s=t._events),o=s[e]),void 0===o)o=s[e]=r,++t._eventsCount;else if("function"===typeof o?o=s[e]=i?[r,o]:[o,r]:i?o.unshift(r):o.push(r),(n=c(t))>0&&o.length>n&&!o.warned){o.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=t,u.type=e,u.count=o.length,h=u,console&&console.warn&&console.warn(h)}return t}function u(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function f(t,e,r){var i={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},n=u.bind(i);return n.listener=r,i.wrapFn=n,n}function l(t,e,r){var i=t._events;if(void 0===i)return[];var n=i[e];return void 0===n?[]:"function"===typeof n?r?[n.listener||n]:[n]:r?function(t){for(var e=new Array(t.length),r=0;r<e.length;++r)e[r]=t[r].listener||t[r];return e}(n):p(n,n.length)}function d(t){var e=this._events;if(void 0!==e){var r=e[t];if("function"===typeof r)return 1;if(void 0!==r)return r.length}return 0}function p(t,e){for(var r=new Array(e),i=0;i<e;++i)r[i]=t[i];return r}function g(t,e,r,i){if("function"===typeof t.on)i.once?t.once(e,r):t.on(e,r);else{if("function"!==typeof t.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof t);t.addEventListener(e,(function n(s){i.once&&t.removeEventListener(e,n),r(s)}))}}Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return o},set:function(t){if("number"!==typeof t||t<0||n(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");o=t}}),s.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},s.prototype.setMaxListeners=function(t){if("number"!==typeof t||t<0||n(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this},s.prototype.getMaxListeners=function(){return c(this)},s.prototype.emit=function(t){for(var e=[],r=1;r<arguments.length;r++)e.push(arguments[r]);var n="error"===t,s=this._events;if(void 0!==s)n=n&&void 0===s.error;else if(!n)return!1;if(n){var o;if(e.length>0&&(o=e[0]),o instanceof Error)throw o;var a=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw a.context=o,a}var c=s[t];if(void 0===c)return!1;if("function"===typeof c)i(c,this,e);else{var h=c.length,u=p(c,h);for(r=0;r<h;++r)i(u[r],this,e)}return!0},s.prototype.addListener=function(t,e){return h(this,t,e,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(t,e){return h(this,t,e,!0)},s.prototype.once=function(t,e){return a(e),this.on(t,f(this,t,e)),this},s.prototype.prependOnceListener=function(t,e){return a(e),this.prependListener(t,f(this,t,e)),this},s.prototype.removeListener=function(t,e){var r,i,n,s,o;if(a(e),void 0===(i=this._events))return this;if(void 0===(r=i[t]))return this;if(r===e||r.listener===e)0===--this._eventsCount?this._events=Object.create(null):(delete i[t],i.removeListener&&this.emit("removeListener",t,r.listener||e));else if("function"!==typeof r){for(n=-1,s=r.length-1;s>=0;s--)if(r[s]===e||r[s].listener===e){o=r[s].listener,n=s;break}if(n<0)return this;0===n?r.shift():function(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}(r,n),1===r.length&&(i[t]=r[0]),void 0!==i.removeListener&&this.emit("removeListener",t,o||e)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(t){var e,r,i;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[t]&&(0===--this._eventsCount?this._events=Object.create(null):delete r[t]),this;if(0===arguments.length){var n,s=Object.keys(r);for(i=0;i<s.length;++i)"removeListener"!==(n=s[i])&&this.removeAllListeners(n);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"===typeof(e=r[t]))this.removeListener(t,e);else if(void 0!==e)for(i=e.length-1;i>=0;i--)this.removeListener(t,e[i]);return this},s.prototype.listeners=function(t){return l(this,t,!0)},s.prototype.rawListeners=function(t){return l(this,t,!1)},s.listenerCount=function(t,e){return"function"===typeof t.listenerCount?t.listenerCount(e):d.call(t,e)},s.prototype.listenerCount=d,s.prototype.eventNames=function(){return this._eventsCount>0?e(this._events):[]}},10038:t=>{"use strict";t.exports=function(t,e){for(var r={},i=Object.keys(t),n=Array.isArray(e),s=0;s<i.length;s++){var o=i[s],a=t[o];(n?-1!==e.indexOf(o):e(o,a,t))&&(r[o]=a)}return r}},73697:(t,e,r)=>{var i=e;i.utils=r(97643),i.common=r(12629),i.sha=r(52624),i.ripemd=r(1859),i.hmac=r(67355),i.sha1=i.sha.sha1,i.sha256=i.sha.sha256,i.sha224=i.sha.sha224,i.sha384=i.sha.sha384,i.sha512=i.sha.sha512,i.ripemd160=i.ripemd.ripemd160},12629:(t,e,r)=>{"use strict";var i=r(97643),n=r(75482);function s(){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}e.BlockHash=s,s.prototype.update=function(t,e){if(t=i.toArray(t,e),this.pending?this.pending=this.pending.concat(t):this.pending=t,this.pendingTotal+=t.length,this.pending.length>=this._delta8){var r=(t=this.pending).length%this._delta8;this.pending=t.slice(t.length-r,t.length),0===this.pending.length&&(this.pending=null),t=i.join32(t,0,t.length-r,this.endian);for(var n=0;n<t.length;n+=this._delta32)this._update(t,n,n+this._delta32)}return this},s.prototype.digest=function(t){return this.update(this._pad()),n(null===this.pending),this._digest(t)},s.prototype._pad=function(){var t=this.pendingTotal,e=this._delta8,r=e-(t+this.padLength)%e,i=new Array(r+this.padLength);i[0]=128;for(var n=1;n<r;n++)i[n]=0;if(t<<=3,"big"===this.endian){for(var s=8;s<this.padLength;s++)i[n++]=0;i[n++]=0,i[n++]=0,i[n++]=0,i[n++]=0,i[n++]=t>>>24&255,i[n++]=t>>>16&255,i[n++]=t>>>8&255,i[n++]=255&t}else for(i[n++]=255&t,i[n++]=t>>>8&255,i[n++]=t>>>16&255,i[n++]=t>>>24&255,i[n++]=0,i[n++]=0,i[n++]=0,i[n++]=0,s=8;s<this.padLength;s++)i[n++]=0;return i}},67355:(t,e,r)=>{"use strict";var i=r(97643),n=r(75482);function s(t,e,r){if(!(this instanceof s))return new s(t,e,r);this.Hash=t,this.blockSize=t.blockSize/8,this.outSize=t.outSize/8,this.inner=null,this.outer=null,this._init(i.toArray(e,r))}t.exports=s,s.prototype._init=function(t){t.length>this.blockSize&&(t=(new this.Hash).update(t).digest()),n(t.length<=this.blockSize);for(var e=t.length;e<this.blockSize;e++)t.push(0);for(e=0;e<t.length;e++)t[e]^=54;for(this.inner=(new this.Hash).update(t),e=0;e<t.length;e++)t[e]^=106;this.outer=(new this.Hash).update(t)},s.prototype.update=function(t,e){return this.inner.update(t,e),this},s.prototype.digest=function(t){return this.outer.update(this.inner.digest()),this.outer.digest(t)}},1859:(t,e,r)=>{"use strict";var i=r(97643),n=r(12629),s=i.rotl32,o=i.sum32,a=i.sum32_3,c=i.sum32_4,h=n.BlockHash;function u(){if(!(this instanceof u))return new u;h.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}function f(t,e,r,i){return t<=15?e^r^i:t<=31?e&r|~e&i:t<=47?(e|~r)^i:t<=63?e&i|r&~i:e^(r|~i)}function l(t){return t<=15?0:t<=31?1518500249:t<=47?1859775393:t<=63?2400959708:2840853838}function d(t){return t<=15?1352829926:t<=31?1548603684:t<=47?1836072691:t<=63?2053994217:0}i.inherits(u,h),e.ripemd160=u,u.blockSize=512,u.outSize=160,u.hmacStrength=192,u.padLength=64,u.prototype._update=function(t,e){for(var r=this.h[0],i=this.h[1],n=this.h[2],h=this.h[3],u=this.h[4],b=r,y=i,w=n,_=h,A=u,E=0;
2E<80;E++){var S=o(s(c(r,f(E,i,n,h),t[p[E]+e],l(E)),m[E]),u);r=u,u=h,h=s(n,10),n=i,i=S,S=o(s(c(b,f(79-E,y,w,_),t[g[E]+e],d(E)),v[E]),A),b=A,A=_,_=s(w,10),w=y,y=S}S=a(this.h[1],n,_),this.h[1]=a(this.h[2],h,A),this.h[2]=a(this.h[3],u,b),this.h[3]=a(this.h[4],r,y),this.h[4]=a(this.h[0],i,w),this.h[0]=S},u.prototype._digest=function(t){return"hex"===t?i.toHex32(this.h,"little"):i.split32(this.h,"little")};var p=[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],g=[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],m=[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],v=[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]},52624:(t,e,r)=>{"use strict";e.sha1=r(52236),e.sha224=r(93291),e.sha256=r(83410),e.sha384=r(44282),e.sha512=r(12155)},52236:(t,e,r)=>{"use strict";var i=r(97643),n=r(12629),s=r(61510),o=i.rotl32,a=i.sum32,c=i.sum32_5,h=s.ft_1,u=n.BlockHash,f=[1518500249,1859775393,2400959708,3395469782];function l(){if(!(this instanceof l))return new l;u.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}
vendor: 5,255 bytes, line 2
2i.inherits(l,u),t.exports=l,l.blockSize=512,l.outSize=160,l.hmacStrength=80,l.padLength=64,l.prototype._update=function(t,e){for(var r=this.W,i=0;i<16;i++)r[i]=t[e+i];for(;i<r.length;i++)r[i]=o(r[i-3]^r[i-8]^r[i-14]^r[i-16],1);var n=this.h[0],s=this.h[1],u=this.h[2],l=this.h[3],d=this.h[4];for(i=0;i<r.length;i++){var p=~~(i/20),g=c(o(n,5),h(p,s,u,l),d,r[i],f[p]);d=l,l=u,u=o(s,30),s=n,n=g}this.h[0]=a(this.h[0],n),this.h[1]=a(this.h[1],s),this.h[2]=a(this.h[2],u),this.h[3]=a(this.h[3],l),this.h[4]=a(this.h[4],d)},l.prototype._digest=function(t){return"hex"===t?i.toHex32(this.h,"big"):i.split32(this.h,"big")}},93291:(t,e,r)=>{"use strict";var i=r(97643),n=r(83410);function s(){if(!(this instanceof s))return new s;n.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}i.inherits(s,n),t.exports=s,s.blockSize=512,s.outSize=224,s.hmacStrength=192,s.padLength=64,s.prototype._digest=function(t){return"hex"===t?i.toHex32(this.h.slice(0,7),"big"):i.split32(this.h.slice(0,7),"big")}},83410:(t,e,r)=>{"use strict";var i=r(97643),n=r(12629),s=r(61510),o=r(75482),a=i.sum32,c=i.sum32_4,h=i.sum32_5,u=s.ch32,f=s.maj32,l=s.s0_256,d=s.s1_256,p=s.g0_256,g=s.g1_256,m=n.BlockHash,v=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function b(){if(!(this instanceof b))return new b;m.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=v,this.W=new Array(64)}i.inherits(b,m),t.exports=b,b.blockSize=512,b.outSize=256,b.hmacStrength=192,b.padLength=64,b.prototype._update=function(t,e){for(var r=this.W,i=0;i<16;i++)r[i]=t[e+i];for(;i<r.length;i++)r[i]=c(g(r[i-2]),r[i-7],p(r[i-15]),r[i-16]);var n=this.h[0],s=this.h[1],m=this.h[2],v=this.h[3],b=this.h[4],y=this.h[5],w=this.h[6],_=this.h[7];for(o(this.k.length===r.length),i=0;i<r.length;i++){var A=h(_,d(b),u(b,y,w),this.k[i],r[i]),E=a(l(n),f(n,s,m));_=w,w=y,y=b,b=a(v,A),v=m,m=s,s=n,n=a(A,E)}this.h[0]=a(this.h[0],n),this.h[1]=a(this.h[1],s),this.h[2]=a(this.h[2],m),this.h[3]=a(this.h[3],v),this.h[4]=a(this.h[4],b),this.h[5]=a(this.h[5],y),this.h[6]=a(this.h[6],w),this.h[7]=a(this.h[7],_)},b.prototype._digest=function(t){return"hex"===t?i.toHex32(this.h,"big"):i.split32(this.h,"big")}},44282:(t,e,r)=>{"use strict";var i=r(97643),n=r(12155);function s(){if(!(this instanceof s))return new s;n.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}i.inherits(s,n),t.exports=s,s.blockSize=1024,s.outSize=384,s.hmacStrength=192,s.padLength=128,s.prototype._digest=function(t){return"hex"===t?i.toHex32(this.h.slice(0,12),"big"):i.split32(this.h.slice(0,12),"big")}},12155:(t,e,r)=>{"use strict";var i=r(97643),n=r(12629),s=r(75482),o=i.rotr64_hi,a=i.rotr64_lo,c=i.shr64_hi,h=i.shr64_lo,u=i.sum64,f=i.sum64_hi,l=i.sum64_lo,d=i.sum64_4_hi,p=i.sum64_4_lo,g=i.sum64_5_hi,m=i.sum64_5_lo,v=n.BlockHash,b=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,
vendor: 11,045 bytes, line 2
21126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function y(){if(!(this instanceof y))return new y;v.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=b,this.W=new Array(160)}function w(t,e,r,i,n){var s=t&r^~t&n;return s<0&&(s+=4294967296),s}function _(t,e,r,i,n,s){var o=e&i^~e&s;return o<0&&(o+=4294967296),o}function A(t,e,r,i,n){var s=t&r^t&n^r&n;return s<0&&(s+=4294967296),s}function E(t,e,r,i,n,s){var o=e&i^e&s^i&s;return o<0&&(o+=4294967296),o}function S(t,e){var r=o(t,e,28)^o(e,t,2)^o(e,t,7);return r<0&&(r+=4294967296),r}function M(t,e){var r=a(t,e,28)^a(e,t,2)^a(e,t,7);return r<0&&(r+=4294967296),r}function I(t,e){var r=o(t,e,14)^o(t,e,18)^o(e,t,9);return r<0&&(r+=4294967296),r}function x(t,e){var r=a(t,e,14)^a(t,e,18)^a(e,t,9);return r<0&&(r+=4294967296),r}function P(t,e){var r=o(t,e,1)^o(t,e,8)^c(t,e,7);return r<0&&(r+=4294967296),r}function O(t,e){var r=a(t,e,1)^a(t,e,8)^h(t,e,7);return r<0&&(r+=4294967296),r}function N(t,e){var r=o(t,e,19)^o(e,t,29)^c(t,e,6);return r<0&&(r+=4294967296),r}function R(t,e){var r=a(t,e,19)^a(e,t,29)^h(t,e,6);return r<0&&(r+=4294967296),r}i.inherits(y,v),t.exports=y,y.blockSize=1024,y.outSize=512,y.hmacStrength=192,y.padLength=128,y.prototype._prepareBlock=function(t,e){for(var r=this.W,i=0;i<32;i++)r[i]=t[e+i];for(;i<r.length;i+=2){var n=N(r[i-4],r[i-3]),s=R(r[i-4],r[i-3]),o=r[i-14],a=r[i-13],c=P(r[i-30],r[i-29]),h=O(r[i-30],r[i-29]),u=r[i-32],f=r[i-31];r[i]=d(n,s,o,a,c,h,u,f),r[i+1]=p(n,s,o,a,c,h,u,f)}},y.prototype._update=function(t,e){this._prepareBlock(t,e);var r=this.W,i=this.h[0],n=this.h[1],o=this.h[2],a=this.h[3],c=this.h[4],h=this.h[5],d=this.h[6],p=this.h[7],v=this.h[8],b=this.h[9],y=this.h[10],P=this.h[11],O=this.h[12],N=this.h[13],R=this.h[14],C=this.h[15];s(this.k.length===r.length);for(var T=0;T<r.length;T+=2){var k=R,L=C,q=I(v,b),D=x(v,b),U=w(v,b,y,P,O),B=_(v,b,y,P,O,N),j=this.k[T],z=this.k[T+1],F=r[T],H=r[T+1],K=g(k,L,q,D,U,B,j,z,F,H),V=m(k,L,q,D,U,B,j,z,F,H);k=S(i,n),L=M(i,n),q=A(i,n,o,a,c),D=E(i,n,o,a,c,h);var W=f(k,L,q,D),G=l(k,L,q,D);R=O,C=N,O=y,N=P,y=v,P=b,v=f(d,p,K,V),b=l(p,p,K,V),d=c,p=h,c=o,h=a,o=i,a=n,i=f(K,V,W,G),n=l(K,V,W,G)}u(this.h,0,i,n),u(this.h,2,o,a),u(this.h,4,c,h),u(this.h,6,d,p),u(this.h,8,v,b),u(this.h,10,y,P),u(this.h,12,O,N),u(this.h,14,R,C)},y.prototype._digest=function(t){return"hex"===t?i.toHex32(this.h,"big"):i.split32(this.h,"big")}},61510:(t,e,r)=>{"use strict";var i=r(97643).rotr32;function n(t,e,r){return t&e^~t&r}function s(t,e,r){return t&e^t&r^e&r}function o(t,e,r){return t^e^r}e.ft_1=function(t,e,r,i){return 0===t?n(e,r,i):1===t||3===t?o(e,r,i):2===t?s(e,r,i):void 0},e.ch32=n,e.maj32=s,e.p32=o,e.s0_256=function(t){return i(t,2)^i(t,13)^i(t,22)},e.s1_256=function(t){return i(t,6)^i(t,11)^i(t,25)},e.g0_256=function(t){return i(t,7)^i(t,18)^t>>>3},e.g1_256=function(t){return i(t,17)^i(t,19)^t>>>10}},97643:(t,e,r)=>{"use strict";var i=r(75482),n=r(56329);function s(t,e){return 55296===(64512&t.charCodeAt(e))&&(!(e<0||e+1>=t.length)&&56320===(64512&t.charCodeAt(e+1)))}function o(t){return(t>>>24|t>>>8&65280|t<<8&16711680|(255&t)<<24)>>>0}function a(t){return 1===t.length?"0"+t:t}function c(t){return 7===t.length?"0"+t:6===t.length?"00"+t:5===t.length?"000"+t:4===t.length?"0000"+t:3===t.length?"00000"+t:2===t.length?"000000"+t:1===t.length?"0000000"+t:t}e.inherits=n,e.toArray=function(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var r=[];if("string"===typeof t)if(e){if("hex"===e)for((t=t.replace(/[^a-z0-9]+/gi,"")).length%2!==0&&(t="0"+t),n=0;n<t.length;n+=2)r.push(parseInt(t[n]+t[n+1],16))}else for(var i=0,n=0;n<t.length;n++){var o=t.charCodeAt(n);o<128?r[i++]=o:o<2048?(r[i++]=o>>6|192,r[i++]=63&o|128):s(t,n)?(o=65536+((1023&o)<<10)+(1023&t.charCodeAt(++n)),r[i++]=o>>18|240,r[i++]=o>>12&63|128,r[i++]=o>>6&63|128,r[i++]=63&o|128):(r[i++]=o>>12|224,r[i++]=o>>6&63|128,r[i++]=63&o|128)}else for(n=0;n<t.length;n++)r[n]=0|t[n];return r},e.toHex=function(t){for(var e="",r=0;r<t.length;r++)e+=a(t[r].toString(16));return e},e.htonl=o,e.toHex32=function(t,e){for(var r="",i=0;i<t.length;i++){var n=t[i];"little"===e&&(n=o(n)),r+=c(n.toString(16))}return r},e.zero2=a,e.zero8=c,e.join32=function(t,e,r,n){var s=r-e;i(s%4===0);for(var o=new Array(s/4),a=0,c=e;a<o.length;a++,c+=4){var h;h="big"===n?t[c]<<24|t[c+1]<<16|t[c+2]<<8|t[c+3]:t[c+3]<<24|t[c+2]<<16|t[c+1]<<8|t[c],o[a]=h>>>0}return o},e.split32=function(t,e){for(var r=new Array(4*t.length),i=0,n=0;i<t.length;i++,n+=4){var s=t[i];"big"===e?(r[n]=s>>>24,r[n+1]=s>>>16&255,r[n+2]=s>>>8&255,r[n+3]=255&s):(r[n+3]=s>>>24,r[n+2]=s>>>16&255,r[n+1]=s>>>8&255,r[n]=255&s)}return r},e.rotr32=function(t,e){return t>>>e|t<<32-e},e.rotl32=function(t,e){return t<<e|t>>>32-e},e.sum32=function(t,e){return t+e>>>0},e.sum32_3=function(t,e,r){return t+e+r>>>0},e.sum32_4=function(t,e,r,i){return t+e+r+i>>>0},e.sum32_5=function(t,e,r,i,n){return t+e+r+i+n>>>0},e.sum64=function(t,e,r,i){var n=t[e],s=i+t[e+1]>>>0,o=(s<i?1:0)+r+n;t[e]=o>>>0,t[e+1]=s},e.sum64_hi=function(t,e,r,i){return(e+i>>>0<e?1:0)+t+r>>>0},e.sum64_lo=function(t,e,r,i){return e+i>>>0},e.sum64_4_hi=function(t,e,r,i,n,s,o,a){var c=0,h=e;return c+=(h=h+i>>>0)<e?1:0,c+=(h=h+s>>>0)<s?1:0,t+r+n+o+(c+=(h=h+a>>>0)<a?1:0)>>>0},e.sum64_4_lo=function(t,e,r,i,n,s,o,a){return e+i+s+a>>>0},e.sum64_5_hi=function(t,e,r,i,n,s,o,a,c,h){var u=0,f=e;return u+=(f=f+i>>>0)<e?1:0,u+=(f=f+s>>>0)<s?1:0,u+=(f=f+a>>>0)<a?1:0,t+r+n+o+c+(u+=(f=f+h>>>0)<h?1:0)>>>0},e.sum64_5_lo=function(t,e,r,i,n,s,o,a,c,h){return e+i+s+a+h>>>0},e.rotr64_hi=function(t,e,r){return(e<<32-r|t>>>r)>>>0},e.rotr64_lo=function(t,e,r){return(t<<32-r|e>>>r)>>>0},e.shr64_hi=function(t,e,r){return t>>>r},e.shr64_lo=function(t,e,r){return(t<<32-r|e>>>r)>>>0}},31172:(t,e,r)=>{"use strict";var i=r(73697),n=r(49848),s=r(75482);function o(t){if(!(this instanceof o))return new o(t);this.hash=t.hash,this.predResist=!!t.predResist,this.outLen=this.hash.outSize,this.minEntropy=t.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var e=n.toArray(t.entropy,t.entropyEnc||"hex"),r=n.toArray(t.nonce,t.nonceEnc||"hex"),i=n.toArray(t.pers,t.persEnc||"hex");s(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,r,i)}t.exports=o,o.prototype._init=function(t,e,r){var i=t.concat(e).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var n=0;n<this.V.length;n++)this.K[n]=0,this.V[n]=1;this._update(i),this._reseed=1,this.reseedInterval=281474976710656},o.prototype._hmac=function(){return new i.hmac(this.hash,this.K)},o.prototype._update=function(t){var e=this._hmac().update(this.V).update([0]);t&&(e=e.update(t)),this.K=e.digest(),this.V=this._hmac().update(this.V).digest(),t&&(this.K=this._hmac().update(this.V).update([1]).update(t).digest(),this.V=this._hmac().update(this.V).digest())},o.prototype.reseed=function(t,e,r,i){"string"!==typeof e&&(i=r,r=e,e=null),t=n.toArray(t,e),r=n.toArray(r,i),s(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(t.concat(r||[])),this._reseed=1},o.prototype.generate=function(t,e,r,i){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!==typeof e&&(i=r,r=e,e=null),r&&(r=n.toArray(r,i||"hex"),this._update(r));for(var s=[];s.length<t;)this.V=this._hmac().update(this.V).digest(),s=s.concat(this.V);var o=s.slice(0,t);return this._update(r),this._reseed++,n.encode(o,e)}},56329:t=>{"function"===typeof Object.create?t.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(t,e){if(e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}}},20067:(t,e,r)=>{t=r.nmd(t);var i="__lodash_hash_undefined__",n=9007199254740991,s="[object Arguments]",o="[object Array]",a="[object Boolean]",c="[object Date]",h="[object Error]",u="[object Function]",f="[object Map]",l="[object Number]",d="[object Object]",p="[object Promise]",g="[object RegExp]",m="[object Set]",v="[object String]",b="[object Symbol]",y="[object WeakMap]",w="[object ArrayBuffer]",_="[object DataView]",A=/^\[object .+?Constructor\]$/,E=/^(?:0|[1-9]\d*)$/,S={};S["[object Float32Array]"]=S["[object Float64Array]"]=S["[object Int8Array]"]=S["[object Int16Array]"]=S["[object Int32Array]"]=S["[object Uint8Array]"]=S["[object Uint8ClampedArray]"]=S["[object Uint16Array]"]=S["[object Uint32Array]"]=!0,S[s]=S[o]=S[w]=S[a]=S[_]=S[c]=S[h]=S[u]=S[f]=S[l]=S[d]=S[g]=S[m]=S[v]=S[y]=!1;var M="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g,I="object"==typeof self&&self&&self.Object===Object&&self,x=M||I||Function("return this")(),P=e&&!e.nodeType&&e,O=P&&t&&!t.nodeType&&t,N=O&&O.exports===P,R=N&&M.process,C=function(){try{return R&&R.binding&&R.binding("util")}catch(t){}}(),T=C&&C.isTypedArray;function k(t,e){for(var r=-1,i=null==t?0:t.length;++r<i;)if(e(t[r],r,t))return!0;return!1}function L(t){var e=-1,r=Array(t.size);return t.forEach((function(t,i){r[++e]=[i,t]})),r}function q(t){var e=-1,r=Array(t.size);return t.forEach((function(t){r[++e]=t})),r}var D,U,B=Array.prototype,j=Function.prototype,z=Object.prototype,F=x["__core-js_shared__"],H=j.toString,K=z.hasOwnProperty,V=function(){var t=/[^.]+$/.exec(F&&F.keys&&F.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}(),W=z.toString,G=RegExp("^"+H.call(K).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),J=N?x.Buffer:void 0,Y=x.Symbol,Q=x.Uint8Array,X=z.propertyIsEnumerable,Z=B.splice,$=Y?Y.toStringTag:void 0,tt=Object.getOwnPropertySymbols,et=J?J.isBuffer:void 0,rt=(D=Object.keys,U=Object,function(t){return D(U(t))}),it=Rt(x,"DataView"),nt=Rt(x,"Map"),st=Rt(x,"Promise"),ot=Rt(x,"Set"),at=Rt(x,"WeakMap"),ct=Rt(Object,"create"),ht=Lt(it),ut=Lt(nt),ft=Lt(st),lt=Lt(ot),dt=Lt(at),pt=Y?Y.prototype:void 0,gt=pt?pt.valueOf:void 0;function mt(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var i=t[e];this.set(i[0],i[1])}}function vt(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var i=t[e];this.set(i[0],i[1])}}function bt(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var i=t[e];this.set(i[0],i[1])}}function yt(t){var e=-1,r=null==t?0:t.length;for(this.__data__=new bt;++e<r;)this.add(t[e])}function wt(t){var e=this.__data__=new vt(t);this.size=e.size}function _t(t,e){var r=Ut(t),i=!r&&Dt(t),n=!r&&!i&&Bt(t),s=!r&&!i&&!n&&Kt(t),o=r||i||n||s,a=o?function(t,e){for(var r=-1,i=Array(t);++r<t;)i[r]=e(r);return i}(t.length,String):[],c=a.length;for(var h in t)!e&&!K.call(t,h)||o&&("length"==h||n&&("offset"==h||"parent"==h)||s&&("buffer"==h||"byteLength"==h||"byteOffset"==h)||kt(h,c))||a.push(h);return a}function At(t,e){for(var r=t.length;r--;)if(qt(t[r][0],e))return r;return-1}
vendor: 1,208 bytes, line 2
2function Et(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":$&&$ in Object(t)?function(t){var e=K.call(t,$),r=t[$];try{t[$]=void 0;var i=!0}catch(s){}var n=W.call(t);i&&(e?t[$]=r:delete t[$]);return n}(t):function(t){return W.call(t)}(t)}function St(t){return Ht(t)&&Et(t)==s}function Mt(t,e,r,i,n){return t===e||(null==t||null==e||!Ht(t)&&!Ht(e)?t!==t&&e!==e:function(t,e,r,i,n,u){var p=Ut(t),y=Ut(e),A=p?o:Tt(t),E=y?o:Tt(e),S=(A=A==s?d:A)==d,M=(E=E==s?d:E)==d,I=A==E;if(I&&Bt(t)){if(!Bt(e))return!1;p=!0,S=!1}if(I&&!S)return u||(u=new wt),p||Kt(t)?Pt(t,e,r,i,n,u):function(t,e,r,i,n,s,o){switch(r){case _:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case w:return!(t.byteLength!=e.byteLength||!s(new Q(t),new Q(e)));case a:case c:case l:return qt(+t,+e);case h:return t.name==e.name&&t.message==e.message;case g:case v:return t==e+"";case f:var u=L;case m:var d=1&i;if(u||(u=q),t.size!=e.size&&!d)return!1;var p=o.get(t);if(p)return p==e;i|=2,o.set(t,e);var y=Pt(u(t),u(e),i,n,s,o);return o.delete(t),y;case b:if(gt)return gt.call(t)==gt.call(e)}return!1}(t,e,A,r,i,n,u);if(!(1&r)){var x=S&&K.call(t,"__wrapped__"),P=M&&K.call(e,"__wrapped__");
vendor: 4,423 bytes, line 2
2if(x||P){var O=x?t.value():t,N=P?e.value():e;return u||(u=new wt),n(O,N,r,i,u)}}if(!I)return!1;return u||(u=new wt),function(t,e,r,i,n,s){var o=1&r,a=Ot(t),c=a.length,h=Ot(e),u=h.length;if(c!=u&&!o)return!1;var f=c;for(;f--;){var l=a[f];if(!(o?l in e:K.call(e,l)))return!1}var d=s.get(t);if(d&&s.get(e))return d==e;var p=!0;s.set(t,e),s.set(e,t);var g=o;for(;++f<c;){var m=t[l=a[f]],v=e[l];if(i)var b=o?i(v,m,l,e,t,s):i(m,v,l,t,e,s);if(!(void 0===b?m===v||n(m,v,r,i,s):b)){p=!1;break}g||(g="constructor"==l)}if(p&&!g){var y=t.constructor,w=e.constructor;y==w||!("constructor"in t)||!("constructor"in e)||"function"==typeof y&&y instanceof y&&"function"==typeof w&&w instanceof w||(p=!1)}return s.delete(t),s.delete(e),p}(t,e,r,i,n,u)}(t,e,r,i,Mt,n))}function It(t){return!(!Ft(t)||function(t){return!!V&&V in t}(t))&&(jt(t)?G:A).test(Lt(t))}function xt(t){if(!function(t){var e=t&&t.constructor,r="function"==typeof e&&e.prototype||z;return t===r}(t))return rt(t);var e=[];for(var r in Object(t))K.call(t,r)&&"constructor"!=r&&e.push(r);return e}function Pt(t,e,r,i,n,s){var o=1&r,a=t.length,c=e.length;if(a!=c&&!(o&&c>a))return!1;var h=s.get(t);if(h&&s.get(e))return h==e;var u=-1,f=!0,l=2&r?new yt:void 0;for(s.set(t,e),s.set(e,t);++u<a;){var d=t[u],p=e[u];if(i)var g=o?i(p,d,u,e,t,s):i(d,p,u,t,e,s);if(void 0!==g){if(g)continue;f=!1;break}if(l){if(!k(e,(function(t,e){if(o=e,!l.has(o)&&(d===t||n(d,t,r,i,s)))return l.push(e);var o}))){f=!1;break}}else if(d!==p&&!n(d,p,r,i,s)){f=!1;break}}return s.delete(t),s.delete(e),f}function Ot(t){return function(t,e,r){var i=e(t);return Ut(t)?i:function(t,e){for(var r=-1,i=e.length,n=t.length;++r<i;)t[n+r]=e[r];return t}(i,r(t))}(t,Vt,Ct)}function Nt(t,e){var r=t.__data__;return function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t}(e)?r["string"==typeof e?"string":"hash"]:r.map}function Rt(t,e){var r=function(t,e){return null==t?void 0:t[e]}(t,e);return It(r)?r:void 0}mt.prototype.clear=function(){this.__data__=ct?ct(null):{},this.size=0},mt.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},mt.prototype.get=function(t){var e=this.__data__;if(ct){var r=e[t];return r===i?void 0:r}return K.call(e,t)?e[t]:void 0},mt.prototype.has=function(t){var e=this.__data__;return ct?void 0!==e[t]:K.call(e,t)},mt.prototype.set=function(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=ct&&void 0===e?i:e,this},vt.prototype.clear=function(){this.__data__=[],this.size=0},vt.prototype.delete=function(t){var e=this.__data__,r=At(e,t);return!(r<0)&&(r==e.length-1?e.pop():Z.call(e,r,1),--this.size,!0)},vt.prototype.get=function(t){var e=this.__data__,r=At(e,t);return r<0?void 0:e[r][1]},vt.prototype.has=function(t){return At(this.__data__,t)>-1},vt.prototype.set=function(t,e){var r=this.__data__,i=At(r,t);return i<0?(++this.size,r.push([t,e])):r[i][1]=e,this},bt.prototype.clear=function(){this.size=0,this.__data__={hash:new mt,map:new(nt||vt),string:new mt}},bt.prototype.delete=function(t){var e=Nt(this,t).delete(t);return this.size-=e?1:0,e},bt.prototype.get=function(t){return Nt(this,t).get(t)},bt.prototype.has=function(t){return Nt(this,t).has(t)},bt.prototype.set=function(t,e){var r=Nt(this,t),i=r.size;return r.set(t,e),this.size+=r.size==i?0:1,this},yt.prototype.add=yt.prototype.push=function(t){return this.__data__.set(t,i),this},yt.prototype.has=function(t){return this.__data__.has(t)},wt.prototype.clear=function(){this.__data__=new vt,this.size=0},wt.prototype.delete=function(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r},wt.prototype.get=function(t){return this.__data__.get(t)},wt.prototype.has=function(t){return this.__data__.has(t)},wt.prototype.set=function(t,e){var r=this.__data__;if(r instanceof vt){var i=r.__data__;if(!nt||i.length<199)return i.push([t,e]),this.size=++r.size,this;r=this.__data__=new bt(i)}return r.set(t,e),this.size=r.size,this};var Ct=tt?function(t){return null==t?[]:(t=Object(t),function(t,e){for(var r=-1,i=null==t?0:t.length,n=0,s=[];++r<i;){var o=t[r];e(o,r,t)&&(s[n++]=o)}return s}(tt(t),(function(e){return X.call(t,e)})))}:function(){return[]},Tt=Et;function kt(t,e){return!!(e=null==e?n:e)&&("number"==typeof t||E.test(t))&&t>-1&&t%1==0&&t<e}function Lt(t){if(null!=t){try{return H.call(t)}catch(e){}try{return t+""}catch(e){}}return""}function qt(t,e){return t===e||t!==t&&e!==e}
2(it&&Tt(new it(new ArrayBuffer(1)))!=_||nt&&Tt(new nt)!=f||st&&Tt(st.resolve())!=p||ot&&Tt(new ot)!=m||at&&Tt(new at)!=y)&&(Tt=function(t){var e=Et(t),r=e==d?t.constructor:void 0,i=r?Lt(r):"";if(i)switch(i){case ht:return _;case ut:return f;case ft:return p;case lt:return m;case dt:return y}return e});var Dt=St(function(){return arguments}())?St:function(t){return Ht(t)&&K.call(t,"callee")&&!X.call(t,"callee")},Ut=Array.isArray;var Bt=et||function(){return!1};function jt(t){if(!Ft(t))return!1;var e=Et(t);return e==u||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e}function zt(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=n}function Ft(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function Ht(t){return null!=t&&"object"==typeof t}var Kt=T?function(t){return function(e){return t(e)}}(T):function(t){return Ht(t)&&zt(t.length)&&!!S[Et(t)]};function Vt(t){return null!=(e=t)&&zt(e.length)&&!jt(e)?_t(t):xt(t);var e}t.exports=function(t,e){return Mt(t,e)}},75482:t=>{function e(t,e){if(!t)throw new Error(e||"Assertion failed")}t.exports=e,e.equal=function(t,e,r){if(t!=e)throw new Error(r||"Assertion failed: "+t+" != "+e)}},49848:(t,e)=>{"use strict";var r=e;function i(t){return 1===t.length?"0"+t:t}function n(t){for(var e="",r=0;r<t.length;r++)e+=i(t[r].toString(16));return e}r.toArray=function(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var r=[];if("string"!==typeof t){for(var i=0;i<t.length;i++)r[i]=0|t[i];return r}if("hex"===e){(t=t.replace(/[^a-z0-9]+/gi,"")).length%2!==0&&(t="0"+t);for(i=0;i<t.length;i+=2)r.push(parseInt(t[i]+t[i+1],16))}else for(i=0;i<t.length;i++){var n=t.charCodeAt(i),s=n>>8,o=255&n;s?r.push(s,o):r.push(o)}return r},r.zero2=i,r.toHex=n,r.encode=function(t,e){return"hex"===e?n(t):t}},9370:(t,e,r)=>{"use strict";const i=r(67491),n=r(95707),s=r(71289),o=r(10038),a=Symbol("encodeFragmentIdentifier");function c(t){if("string"!==typeof t||1!==t.length)throw new TypeError("arrayFormatSeparator must be single character string")}function h(t,e){return e.encode?e.strict?i(t):encodeURIComponent(t):t}function u(t,e){return e.decode?n(t):t}function f(t){return Array.isArray(t)?t.sort():"object"===typeof t?f(Object.keys(t)).sort(((t,e)=>Number(t)-Number(e))).map((e=>t[e])):t}function l(t){const e=t.indexOf("#");return-1!==e&&(t=t.slice(0,e)),t}function d(t){const e=(t=l(t)).indexOf("?");return-1===e?"":t.slice(e+1)}function p(t,e){return e.parseNumbers&&!Number.isNaN(Number(t))&&"string"===typeof t&&""!==t.trim()?t=Number(t):!e.parseBooleans||null===t||"true"!==t.toLowerCase()&&"false"!==t.toLowerCase()||(t="true"===t.toLowerCase()),t}function g(t,e){c((e=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},e)).arrayFormatSeparator);const r=function(t){let e;switch(t.arrayFormat){case"index":return(t,r,i)=>{e=/\[(\d*)\]$/.exec(t),t=t.replace(/\[\d*\]$/,""),e?(void 0===i[t]&&(i[t]={}),i[t][e[1]]=r):i[t]=r};case"bracket":return(t,r,i)=>{e=/(\[\])$/.exec(t),t=t.replace(/\[\]$/,""),e?void 0!==i[t]?i[t]=[].concat(i[t],r):i[t]=[r]:i[t]=r};case"colon-list-separator":return(t,r,i)=>{e=/(:list)$/.exec(t),t=t.replace(/:list$/,""),e?void 0!==i[t]?i[t]=[].concat(i[t],r):i[t]=[r]:i[t]=r};case"comma":case"separator":return(e,r,i)=>{const n="string"===typeof r&&r.includes(t.arrayFormatSeparator),s="string"===typeof r&&!n&&u(r,t).includes(t.arrayFormatSeparator);r=s?u(r,t):r;const o=n||s?r.split(t.arrayFormatSeparator).map((e=>u(e,t))):null===r?r:u(r,t);i[e]=o};case"bracket-separator":return(e,r,i)=>{const n=/(\[\])$/.test(e);if(e=e.replace(/\[\]$/,""),!n)return void(i[e]=r?u(r,t):r);const s=null===r?[]:r.split(t.arrayFormatSeparator).map((e=>u(e,t)));void 0!==i[e]?i[e]=[].concat(i[e],s):i[e]=s};default:return(t,e,r)=>{void 0!==r[t]?r[t]=[].concat(r[t],e):r[t]=e}}}(e),i=Object.create(null);if("string"!==typeof t)return i;if(!(t=t.trim().replace(/^[?#&]/,"")))return i;for(const n of t.split("&")){if(""===n)continue;let[t,o]=s(e.decode?n.replace(/\+/g," "):n,"=");o=void 0===o?null:["comma","separator","bracket-separator"].includes(e.arrayFormat)?o:u(o,e),r(u(t,e),o,i)}for(const n of Object.keys(i)){const t=i[n];if("object"===typeof t&&null!==t)for(const r of Object.keys(t))t[r]=p(t[r],e);else i[n]=p(t,e)}return!1===e.sort?i:(!0===e.sort?Object.keys(i).sort():Object.keys(i).sort(e.sort)).reduce(((t,e)=>{const r=i[e];return Boolean(r)&&"object"===typeof r&&!Array.isArray(r)?t[e]=f(r):t[e]=r,t}),Object.create(null))}
2e.extract=d,e.parse=g,e.stringify=(t,e)=>{if(!t)return"";c((e=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},e)).arrayFormatSeparator);const r=r=>{return e.skipNull&&(null===(i=t[r])||void 0===i)||e.skipEmptyString&&""===t[r];var i},i=function(t){switch(t.arrayFormat){case"index":return e=>(r,i)=>{const n=r.length;return void 0===i||t.skipNull&&null===i||t.skipEmptyString&&""===i?r:null===i?[...r,[h(e,t),"[",n,"]"].join("")]:[...r,[h(e,t),"[",h(n,t),"]=",h(i,t)].join("")]};case"bracket":return e=>(r,i)=>void 0===i||t.skipNull&&null===i||t.skipEmptyString&&""===i?r:null===i?[...r,[h(e,t),"[]"].join("")]:[...r,[h(e,t),"[]=",h(i,t)].join("")];case"colon-list-separator":return e=>(r,i)=>void 0===i||t.skipNull&&null===i||t.skipEmptyString&&""===i?r:null===i?[...r,[h(e,t),":list="].join("")]:[...r,[h(e,t),":list=",h(i,t)].join("")];case"comma":case"separator":case"bracket-separator":{const e="bracket-separator"===t.arrayFormat?"[]=":"=";return r=>(i,n)=>void 0===n||t.skipNull&&null===n||t.skipEmptyString&&""===n?i:(n=null===n?"":n,0===i.length?[[h(r,t),e,h(n,t)].join("")]:[[i,h(n,t)].join(t.arrayFormatSeparator)])}default:return e=>(r,i)=>void 0===i||t.skipNull&&null===i||t.skipEmptyString&&""===i?r:null===i?[...r,h(e,t)]:[...r,[h(e,t),"=",h(i,t)].join("")]}}(e),n={};for(const o of Object.keys(t))r(o)||(n[o]=t[o]);const s=Object.keys(n);return!1!==e.sort&&s.sort(e.sort),s.map((r=>{const n=t[r];return void 0===n?"":null===n?h(r,e):Array.isArray(n)?0===n.length&&"bracket-separator"===e.arrayFormat?h(r,e)+"[]":n.reduce(i(r),[]).join("&"):h(r,e)+"="+h(n,e)})).filter((t=>t.length>0)).join("&")},e.parseUrl=(t,e)=>{e=Object.assign({decode:!0},e);const[r,i]=s(t,"#");return Object.assign({url:r.split("?")[0]||"",query:g(d(t),e)},e&&e.parseFragmentIdentifier&&i?{fragmentIdentifier:u(i,e)}:{})},e.stringifyUrl=(t,r)=>{r=Object.assign({encode:!0,strict:!0,[a]:!0},r);const i=l(t.url).split("?")[0]||"",n=e.extract(t.url),s=e.parse(n,{sort:!1}),o=Object.assign(s,t.query);let c=e.stringify(o,r);c&&(c="?".concat(c));let u=function(t){let e="";const r=t.indexOf("#");return-1!==r&&(e=t.slice(r)),e}(t.url);return t.fragmentIdentifier&&(u="#".concat(r[a]?h(t.fragmentIdentifier,r):t.fragmentIdentifier)),"".concat(i).concat(c).concat(u)},e.pick=(t,r,i)=>{i=Object.assign({parseFragmentIdentifier:!0,[a]:!1},i);const{url:n,query:s,fragmentIdentifier:c}=e.parseUrl(t,i);return e.stringifyUrl({url:n,query:o(s,r),fragmentIdentifier:c},i)},e.exclude=(t,r,i)=>{const n=Array.isArray(r)?t=>!r.includes(t):(t,e)=>!r(t,e);return e.pick(t,n,i)}},75984:t=>{"use strict";function e(t){try{return JSON.stringify(t)}catch(e){return'"[Circular]"'}}t.exports=function(t,r,i){var n=i&&i.stringify||e;if("object"===typeof t&&null!==t){var s=r.length+1;if(1===s)return t;var o=new Array(s);o[0]=n(t);for(var a=1;a<s;a++)o[a]=n(r[a]);return o.join(" ")}if("string"!==typeof t)return t;var c=r.length;if(0===c)return t;for(var h="",u=0,f=-1,l=t&&t.length||0,d=0;d<l;){if(37===t.charCodeAt(d)&&d+1<l){switch(f=f>-1?f:0,t.charCodeAt(d+1)){case 100:case 102:if(u>=c)break;if(null==r[u])break;f<d&&(h+=t.slice(f,d)),h+=Number(r[u]),f=d+2,d++;break;case 105:if(u>=c)break;if(null==r[u])break;f<d&&(h+=t.slice(f,d)),h+=Math.floor(Number(r[u])),f=d+2,d++;break;case 79:case 111:case 106:if(u>=c)break;if(void 0===r[u])break;f<d&&(h+=t.slice(f,d));var p=typeof r[u];if("string"===p){h+="'"+r[u]+"'",f=d+2,d++;break}if("function"===p){h+=r[u].name||"<anonymous>",f=d+2,d++;break}h+=n(r[u]),f=d+2,d++;break;case 115:if(u>=c)break;f<d&&(h+=t.slice(f,d)),h+=String(r[u]),f=d+2,d++;break;case 37:f<d&&(h+=t.slice(f,d)),h+="%",f=d+2,d++,u--}++u}++d}if(-1===f)return t;f<l&&(h+=t.slice(f));return h}},71289:t=>{"use strict";t.exports=(t,e)=>{if("string"!==typeof t||"string"!==typeof e)throw new TypeError("Expected the arguments to be of type `string`");if(""===e)return[t];const r=t.indexOf(e);return-1===r?[t]:[t.slice(0,r),t.slice(r+e.length)]}},67491:t=>{"use strict";t.exports=t=>encodeURIComponent(t).replace(/[!'()*]/g,(t=>"%".concat(t.charCodeAt(0).toString(16).toUpperCase())))},25711:(t,e,r)=>{"use strict";const i=r(75984);t.exports=o;const n=function(){function t(t){return"undefined"!==typeof t&&t}try{return"undefined"!==typeof globalThis||Object.defineProperty(Object.prototype,"globalThis",{get:function(){return delete Object.prototype.globalThis,this.globalThis=this},configurable:!0}),globalThis}catch(e){return t(self)||t(window)||t(this)||{}}}().console||{},s={mapHttpRequest:l,mapHttpResponse:l,wrapRequestSerializer:d,wrapResponseSerializer:d,wrapErrorSerializer:d,req:l,res:l,err:function(t){const e={type:t.constructor.name,msg:t.message,stack:t.stack};for(const r in t)void 0===e[r]&&(e[r]=t[r]);return e}};function o(t){(t=t||{}).browser=t.browser||{};const e=t.browser.transmit;if(e&&"function"!==typeof e.send)throw Error("pino: transmit option must have a send function");const r=t.browser.write||n;t.browser.write&&(t.browser.asObject=!0);const i=t.serializers||{},s=function(t,e){if(Array.isArray(t))return t.filter((function(t){return"!stdSerializers.err"!==t}));return!0===t&&Object.keys(e)}(t.browser.serialize,i);let l=t.browser.serialize;Array.isArray(t.browser.serialize)&&t.browser.serialize.indexOf("!stdSerializers.err")>-1&&(l=!1);"function"===typeof r&&(r.error=r.fatal=r.warn=r.info=r.debug=r.trace=r),!1===t.enabled&&(t.level="silent");const d=t.level||"info",g=Object.create(r);g.log||(g.log=p),Object.defineProperty(g,"levelVal",{get:function(){return"silent"===this.level?1/0:this.levels.values[this.level]}}),Object.defineProperty(g,"level",{get:function(){return this._level},set:function(t){if("silent"!==t&&!this.levels.values[t])throw Error("unknown level "+t);this._level=t,a(m,g,"error","log"),a(m,g,"fatal","error"),a(m,g,"warn","error"),a(m,g,"info","log"),a(m,g,"debug","log"),a(m,g,"trace","log")}});const m={transmit:e,serialize:s,asObject:t.browser.asObject,levels:["error","fatal","warn","info","debug","trace"],timestamp:f(t)};return g.levels=o.levels,g.level=d,g.setMaxListeners=g.getMaxListeners=g.emit=g.addListener=g.on=g.prependListener=g.once=g.prepe
2ndOnceListener=g.removeListener=g.removeAllListeners=g.listeners=g.listenerCount=g.eventNames=g.write=g.flush=p,g.serializers=i,g._serialize=s,g._stdErrSerialize=l,g.child=function(r,n){if(!r)throw new Error("missing bindings for child Pino");n=n||{},s&&r.serializers&&(n.serializers=r.serializers);const o=n.serializers;if(s&&o){var a=Object.assign({},i,o),f=!0===t.browser.serialize?Object.keys(a):s;delete r.serializers,c([r],f,a,this._stdErrSerialize)}function l(t){this._childLevel=1+(0|t._childLevel),this.error=h(t,r,"error"),this.fatal=h(t,r,"fatal"),this.warn=h(t,r,"warn"),this.info=h(t,r,"info"),this.debug=h(t,r,"debug"),this.trace=h(t,r,"trace"),a&&(this.serializers=a,this._serialize=f),e&&(this._logEvent=u([].concat(t._logEvent.bindings,r)))}return l.prototype=this,new l(this)},e&&(g._logEvent=u()),g}function a(t,e,r,s){const a=Object.getPrototypeOf(e);e[r]=e.levelVal>e.levels.values[r]?p:a[r]?a[r]:n[r]||n[s]||p,function(t,e,r){if(!t.transmit&&e[r]===p)return;e[r]=(s=e[r],function(){const a=t.timestamp(),h=new Array(arguments.length),f=Object.getPrototypeOf&&Object.getPrototypeOf(this)===n?n:this;for(var l=0;l<h.length;l++)h[l]=arguments[l];if(t.serialize&&!t.asObject&&c(h,this._serialize,this.serializers,this._stdErrSerialize),t.asObject?s.call(f,function(t,e,r,n){t._serialize&&c(r,t._serialize,t.serializers,t._stdErrSerialize);const s=r.slice();let a=s[0];const h={};n&&(h.time=n),h.level=o.levels.values[e];let u=1+(0|t._childLevel);if(u<1&&(u=1),null!==a&&"object"===typeof a){for(;u--&&"object"===typeof s[0];)Object.assign(h,s.shift());a=s.length?i(s.shift(),s):void 0}else"string"===typeof a&&(a=i(s.shift(),s));return void 0!==a&&(h.msg=a),h}(this,r,h,a)):s.apply(f,h),t.transmit){const i=t.transmit.level||e.level,n=o.levels.values[i],s=o.levels.values[r];if(s<n)return;!function(t,e,r){const i=e.send,n=e.ts,s=e.methodLevel,o=e.methodValue,a=e.val,h=t._logEvent.bindings;c(r,t._serialize||Object.keys(t.serializers),t.serializers,void 0===t._stdErrSerialize||t._stdErrSerialize),t._logEvent.ts=n,t._logEvent.messages=r.filter((function(t){return-1===h.indexOf(t)})),t._logEvent.level.label=s,t._logEvent.level.value=o,i(s,t._logEvent,a),t._logEvent=u(h)}(this,{ts:a,methodLevel:r,methodValue:s,transmitLevel:i,transmitValue:o.levels.values[t.transmit.level||e.level],send:t.transmit.send,val:e.levelVal},h)}});var s}(t,e,r)}function c(t,e,r,i){for(const n in t)if(i&&t[n]instanceof Error)t[n]=o.stdSerializers.err(t[n]);else if("object"===typeof t[n]&&!Array.isArray(t[n]))for(const i in t[n])e&&e.indexOf(i)>-1&&i in r&&(t[n][i]=r[i](t[n][i]))}function h(t,e,r){return function(){const i=new Array(1+arguments.length);i[0]=e;for(var n=1;n<i.length;n++)i[n]=arguments[n-1];return t[r].apply(this,i)}}function u(t){return{ts:0,messages:[],bindings:t||[],level:{label:"",value:0}}}function f(t){return"function"===typeof t.timestamp?t.timestamp:!1===t.timestamp?g:m}function l(){return{}}function d(t){return t}function p(){}function g(){return!1}function m(){return Date.now()}o.levels={values:{fatal:60,error:50,warn:40,info:30,debug:20,trace:10},labels:{10:"trace",20:"debug",30:"info",40:"warn",50:"error",60:"fatal"}},o.stdSerializers=s,o.stdTimeFunctions=Object.assign({},{nullTime:g,epochTime:m,unixTime:function(){return Math.round(Date.now()/1e3)},isoTime:function(){return new Date(Date.now()).toISOString()}})},1636:t=>{"use strict";t.exports={rE:"6.6.1"}}}]);
3//# sourceMappingURL=1206.1f0d3ce7.chunk.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.