-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy path5211.0f8cf670.bundle.js
2 lines (2 loc) · 287 KB
/
5211.0f8cf670.bundle.js
1
2
/*! For license information please see 5211.0f8cf670.bundle.js.LICENSE.txt */
(self.webpackChunkbingo_frontend=self.webpackChunkbingo_frontend||[]).push([[5211],{98099:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=r(97117);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 l(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 f(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 p(t,e,r){return void 0===e&&(e=new Uint8Array(8)),void 0===r&&(r=0),l(t>>>0,e,r),l(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=l,e.writeInt32LE=l,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=f,e.writeInt64BE=f,e.writeUint64LE=p,e.writeInt64LE=p,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 bitLength");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}},25439:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=r(98099),n=r(17309);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],l=r[15]<<24|r[14]<<16|r[13]<<8|r[12],f=r[19]<<24|r[18]<<16|r[17]<<8|r[16],p=r[23]<<24|r[22]<<16|r[21]<<8|r[20],d=r[27]<<24|r[26]<<16|r[25]<<8|r[24],g=r[31]<<24|r[30]<<16|r[29]<<8|r[28],y=e[3]<<24|e[2]<<16|e[1]<<8|e[0],v=e[7]<<24|e[6]<<16|e[5]<<8|e[4],_=e[11]<<24|e[10]<<16|e[9]<<8|e[8],m=e[15]<<24|e[14]<<16|e[13]<<8|e[12],b=n,w=s,E=o,S=a,I=c,P=h,O=u,A=l,N=f,R=p,x=d,C=g,T=y,U=v,j=_,L=m,M=0;M<20;M+=2)I=(I^=N=N+(T=(T^=b=b+I|0)>>>16|T<<16)|0)>>>20|I<<12,P=(P^=R=R+(U=(U^=w=w+P|0)>>>16|U<<16)|0)>>>20|P<<12,O=(O^=x=x+(j=(j^=E=E+O|0)>>>16|j<<16)|0)>>>20|O<<12,A=(A^=C=C+(L=(L^=S=S+A|0)>>>16|L<<16)|0)>>>20|A<<12,O=(O^=x=x+(j=(j^=E=E+O|0)>>>24|j<<8)|0)>>>25|O<<7,A=(A^=C=C+(L=(L^=S=S+A|0)>>>24|L<<8)|0)>>>25|A<<7,P=(P^=R=R+(U=(U^=w=w+P|0)>>>24|U<<8)|0)>>>25|P<<7,I=(I^=N=N+(T=(T^=b=b+I|0)>>>24|T<<8)|0)>>>25|I<<7,P=(P^=x=x+(L=(L^=b=b+P|0)>>>16|L<<16)|0)>>>20|P<<12,O=(O^=C=C+(T=(T^=w=w+O|0)>>>16|T<<16)|0)>>>20|O<<12,A=(A^=N=N+(U=(U^=E=E+A|0)>>>16|U<<16)|0)>>>20|A<<12,I=(I^=R=R+(j=(j^=S=S+I|0)>>>16|j<<16)|0)>>>20|I<<12,A=(A^=N=N+(U=(U^=E=E+A|0)>>>24|U<<8)|0)>>>25|A<<7,I=(I^=R=R+(j=(j^=S=S+I|0)>>>24|j<<8)|0)>>>25|I<<7,O=(O^=C=C+(T=(T^=w=w+O|0)>>>24|T<<8)|0)>>>25|O<<7,P=(P^=x=x+(L=(L^=b=b+P|0)>>>24|L<<8)|0)>>>25|P<<7;i.writeUint32LE(b+n|0,t,0),i.writeUint32LE(w+s|0,t,4),i.writeUint32LE(E+o|0,t,8),i.writeUint32LE(S+a|0,t,12),i.writeUint32LE(I+c|0,t,16),i.writeUint32LE(P+h|0,t,20),i.writeUint32LE(O+u|0,t,24),i.writeUint32LE(A+l|0,t,28),i.writeUint32LE(N+f|0,t,32),i.writeUint32LE(R+p|0,t,36),i.writeUint32LE(x+d|0,t,40),i.writeUint32LE(C+g|0,t,44),i.writeUint32LE(T+y|0,t,48),i.writeUint32LE(U+v|0,t,52),i.writeUint32LE(j+_|0,t,56),i.writeUint32LE(L+m|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),l=0;l<r.length;l+=64){s(u,c,t);for(var f=l;f<l+64&&f<r.length;f++)i[f]=r[f]^u[f-l];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++;if(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)}},15501:(t,e,r)=>{"use strict";var i=r(25439),n=r(63027),s=r(17309),o=r(98099),a=r(4153);e.Cv=32,e.WH=12,e.pg=16;var c=new Uint8Array(16),h=function(){function t(t){if(this.nonceLength=e.WH,this.tagLength=e.pg,t.length!==e.Cv)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,l=e.length-this.tagLength;if(n){if(n.length!==l)throw new Error("ChaCha20Poly1305: incorrect destination length");u=n}else u=new Uint8Array(l);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(),l=0;l<u.length;l++)t[l]=u[l];a.clean(),s.wipe(u),s.wipe(h)},t}();e.OK=h},4153:(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)}},31050:(t,e,r)=>{"use strict";e.Xx=e._w=e.aP=e.KS=e.jQ=void 0;const i=r(31416),n=r(93350),s=r(17309);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.jQ=64,e.KS=64,e.aP=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]),l=o([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),f=o([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),p=o([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function d(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 y(t,e,r){const i=~(r-1);for(let r=0;r<16;r++){const n=i&(t[r]^e[r]);t[r]^=n,e[r]^=n}}function v(t,e){const r=o(),i=o();for(let t=0;t<16;t++)i[t]=e[t];g(i),g(i),g(i);for(let t=0;t<2;t++){r[0]=i[0]-65517;for(let t=1;t<15;t++)r[t]=i[t]-65535-(r[t-1]>>16&1),r[t-1]&=65535;r[15]=i[15]-32767-(r[14]>>16&1);const t=r[15]>>16&1;r[14]&=65535,y(i,r,1-t)}for(let e=0;e<16;e++)t[2*e]=255&i[e],t[2*e+1]=i[e]>>8}function _(t,e){let r=0;for(let i=0;i<32;i++)r|=t[i]^e[i];return(1&r-1>>>8)-1}function m(t,e){const r=new Uint8Array(32),i=new Uint8Array(32);return v(r,t),v(i,e),_(r,i)}function b(t){const e=new Uint8Array(32);return v(e,t),1&e[0]}function w(t,e,r){for(let i=0;i<16;i++)t[i]=e[i]+r[i]}function E(t,e,r){for(let i=0;i<16;i++)t[i]=e[i]-r[i]}function S(t,e,r){let i,n,s=0,o=0,a=0,c=0,h=0,u=0,l=0,f=0,p=0,d=0,g=0,y=0,v=0,_=0,m=0,b=0,w=0,E=0,S=0,I=0,P=0,O=0,A=0,N=0,R=0,x=0,C=0,T=0,U=0,j=0,L=0,M=r[0],D=r[1],k=r[2],z=r[3],$=r[4],q=r[5],H=r[6],V=r[7],K=r[8],B=r[9],F=r[10],W=r[11],G=r[12],J=r[13],Y=r[14],X=r[15];i=e[0],s+=i*M,o+=i*D,a+=i*k,c+=i*z,h+=i*$,u+=i*q,l+=i*H,f+=i*V,p+=i*K,d+=i*B,g+=i*F,y+=i*W,v+=i*G,_+=i*J,m+=i*Y,b+=i*X,i=e[1],o+=i*M,a+=i*D,c+=i*k,h+=i*z,u+=i*$,l+=i*q,f+=i*H,p+=i*V,d+=i*K,g+=i*B,y+=i*F,v+=i*W,_+=i*G,m+=i*J,b+=i*Y,w+=i*X,i=e[2],a+=i*M,c+=i*D,h+=i*k,u+=i*z,l+=i*$,f+=i*q,p+=i*H,d+=i*V,g+=i*K,y+=i*B,v+=i*F,_+=i*W,m+=i*G,b+=i*J,w+=i*Y,E+=i*X,i=e[3],c+=i*M,h+=i*D,u+=i*k,l+=i*z,f+=i*$,p+=i*q,d+=i*H,g+=i*V,y+=i*K,v+=i*B,_+=i*F,m+=i*W,b+=i*G,w+=i*J,E+=i*Y,S+=i*X,i=e[4],h+=i*M,u+=i*D,l+=i*k,f+=i*z,p+=i*$,d+=i*q,g+=i*H,y+=i*V,v+=i*K,_+=i*B,m+=i*F,b+=i*W,w+=i*G,E+=i*J,S+=i*Y,I+=i*X,i=e[5],u+=i*M,l+=i*D,f+=i*k,p+=i*z,d+=i*$,g+=i*q,y+=i*H,v+=i*V,_+=i*K,m+=i*B,b+=i*F,w+=i*W,E+=i*G,S+=i*J,I+=i*Y,P+=i*X,i=e[6],l+=i*M,f+=i*D,p+=i*k,d+=i*z,g+=i*$,y+=i*q,v+=i*H,_+=i*V,m+=i*K,b+=i*B,w+=i*F,E+=i*W,S+=i*G,I+=i*J,P+=i*Y,O+=i*X,i=e[7],f+=i*M,p+=i*D,d+=i*k,g+=i*z,y+=i*$,v+=i*q,_+=i*H,m+=i*V,b+=i*K,w+=i*B,E+=i*F,S+=i*W,I+=i*G,P+=i*J,O+=i*Y,A+=i*X,i=e[8],p+=i*M,d+=i*D,g+=i*k,y+=i*z,v+=i*$,_+=i*q,m+=i*H,b+=i*V,w+=i*K,E+=i*B,S+=i*F,I+=i*W,P+=i*G,O+=i*J,A+=i*Y,N+=i*X,i=e[9],d+=i*M,g+=i*D,y+=i*k,v+=i*z,_+=i*$,m+=i*q,b+=i*H,w+=i*V,E+=i*K,S+=i*B,I+=i*F,P+=i*W,O+=i*G,A+=i*J,N+=i*Y,R+=i*X,i=e[10],g+=i*M,y+=i*D,v+=i*k,_+=i*z,m+=i*$,b+=i*q,w+=i*H,E+=i*V,S+=i*K,I+=i*B,P+=i*F,O+=i*W,A+=i*G,N+=i*J,R+=i*Y,x+=i*X,i=e[11],y+=i*M,v+=i*D,_+=i*k,m+=i*z,b+=i*$,w+=i*q,E+=i*H,S+=i*V,I+=i*K,P+=i*B,O+=i*F,A+=i*W,N+=i*G,R+=i*J,x+=i*Y,C+=i*X,i=e[12],v+=i*M,_+=i*D,m+=i*k,b+=i*z,w+=i*$,E+=i*q,S+=i*H,I+=i*V,P+=i*K,O+=i*B,A+=i*F,N+=i*W,R+=i*G,x+=i*J,C+=i*Y,T+=i*X,i=e[13],_+=i*M,m+=i*D,b+=i*k,w+=i*z,E+=i*$,S+=i*q,I+=i*H,P+=i*V,O+=i*K,A+=i*B,N+=i*F,R+=i*W,x+=i*G,C+=i*J,T+=i*Y,U+=i*X,i=e[14],m+=i*M,b+=i*D,w+=i*k,E+=i*z,S+=i*$,I+=i*q,P+=i*H,O+=i*V,A+=i*K,N+=i*B,R+=i*F,x+=i*W,C+=i*G,T+=i*J,U+=i*Y,j+=i*X,i=e[15],b+=i*M,w+=i*D,E+=i*k,S+=i*z,I+=i*$,P+=i*q,O+=i*H,A+=i*V,N+=i*K,R+=i*B,x+=i*F,C+=i*W,T+=i*G,U+=i*J,j+=i*Y,L+=i*X,s+=38*w,o+=38*E,a+=38*S,c+=38*I,h+=38*P,u+=38*O,l+=38*A,f+=38*N,p+=38*R,d+=38*x,g+=38*C,y+=38*T,v+=38*U,_+=38*j,m+=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=l+n+65535,n=Math.floor(i/65536),l=i-65536*n,i=f+n+65535,n=Math.floor(i/65536),f=i-65536*n,i=p+n+65535,n=Math.floor(i/65536),p=i-65536*n,i=d+n+65535,n=Math.floor(i/65536),d=i-65536*n,i=g+n+65535,n=Math.floor(i/65536),g=i-65536*n,i=y+n+65535,n=Math.floor(i/65536),y=i-65536*n,i=v+n+65535,n=Math.floor(i/65536),v=i-65536*n,i=_+n+65535,n=Math.floor(i/65536),_=i-65536*n,i=m+n+65535,n=Math.floor(i/65536),m=i-65536*n,i=b+n+65535,n=Math.floor(i/65536),b=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=l+n+65535,n=Math.floor(i/65536),l=i-65536*n,i=f+n+65535,n=Math.floor(i/65536),f=i-65536*n,i=p+n+65535,n=Math.floor(i/65536),p=i-65536*n,i=d+n+65535,n=Math.floor(i/65536),d=i-65536*n,i=g+n+65535,n=Math.floor(i/65536),g=i-65536*n,i=y+n+65535,n=Math.floor(i/65536),y=i-65536*n,i=v+n+65535,n=Math.floor(i/65536),v=i-65536*n,i=_+n+65535,n=Math.floor(i/65536),_=i-65536*n,i=m+n+65535,n=Math.floor(i/65536),m=i-65536*n,i=b+n+65535,n=Math.floor(i/65536),b=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]=l,t[7]=f,t[8]=p,t[9]=d,t[10]=g,t[11]=y,t[12]=v,t[13]=_,t[14]=m,t[15]=b}function I(t,e){S(t,e,e)}function P(t,e){const r=o();let i;for(i=0;i<16;i++)r[i]=e[i];for(i=253;i>=0;i--)I(r,r),2!==i&&4!==i&&S(r,r,e);for(i=0;i<16;i++)t[i]=r[i]}function O(t,e){const r=o(),i=o(),n=o(),s=o(),a=o(),c=o(),h=o(),l=o(),f=o();E(r,t[1],t[0]),E(f,e[1],e[0]),S(r,r,f),w(i,t[0],t[1]),w(f,e[0],e[1]),S(i,i,f),S(n,t[3],e[3]),S(n,n,u),S(s,t[2],e[2]),w(s,s,s),E(a,i,r),E(c,s,n),w(h,s,n),w(l,i,r),S(t[0],a,c),S(t[1],l,h),S(t[2],h,c),S(t[3],a,l)}function A(t,e,r){for(let i=0;i<4;i++)y(t[i],e[i],r)}function N(t,e){const r=o(),i=o(),n=o();P(n,e[2]),S(r,e[0],n),S(i,e[1],n),v(t,i),t[31]^=b(r)<<7}function R(t,e,r){d(t[0],a),d(t[1],c),d(t[2],c),d(t[3],a);for(let i=255;i>=0;--i){const n=r[i/8|0]>>(7&i)&1;A(t,e,n),O(e,t),O(t,t),A(t,e,n)}}function x(t,e){const r=[o(),o(),o(),o()];d(r[0],l),d(r[1],f),d(r[2],c),S(r[3],l,f),R(t,r,e)}function C(t){if(t.length!==e.aP)throw new Error(`ed25519: seed must be ${e.aP} 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()];x(s,r),N(i,s);const a=new Uint8Array(64);return a.set(t),a.set(i,32),{publicKey:i,secretKey:a}}e._w=C;const T=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 U(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]*T[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)*T[n],r=e[n]>>8,e[n]&=255;for(n=0;n<32;n++)e[n]-=r*T[n];for(i=0;i<32;i++)e[i+1]+=e[i]>>8,t[i]=255&e[i]}function j(t){const e=new Float64Array(64);for(let r=0;r<64;r++)e[r]=t[r];for(let e=0;e<64;e++)t[e]=0;U(t,e)}function L(t,e){const r=o(),i=o(),n=o(),s=o(),u=o(),l=o(),f=o();return d(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),I(n,t[1]),S(s,n,h),E(n,n,t[2]),w(s,t[2],s),I(u,s),I(l,u),S(f,l,u),S(r,f,n),S(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--)I(r,r),1!==i&&S(r,r,e);for(i=0;i<16;i++)t[i]=r[i]}(r,r),S(r,r,n),S(r,r,s),S(r,r,s),S(t[0],r,s),I(i,t[0]),S(i,i,s),m(i,n)&&S(t[0],t[0],p),I(i,t[0]),S(i,i,s),m(i,n)?-1:(b(t[0])===e[31]>>7&&E(t[0],a,t[0]),S(t[3],t[0],t[1]),0)}e.Xx=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(),j(h),x(i,h),N(a,i),c.reset(),c.update(a.subarray(0,32)),c.update(t.subarray(32)),c.update(e);const u=c.digest();j(u);for(let t=0;t<32;t++)r[t]=h[t];for(let t=0;t<32;t++)for(let e=0;e<32;e++)r[t+e]+=u[t]*s[e];return U(a.subarray(32),r),a}},79984:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.isSerializableHash=function(t){return void 0!==t.saveState&&void 0!==t.restoreState&&void 0!==t.cleanSavedState}},512:(t,e,r)=>{"use strict";var i=r(25629),n=r(17309),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.t=s},25629:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=r(79984),n=r(4153),s=r(17309),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},97117:(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}},63027:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=r(4153),n=r(17309);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],l=this._h[7],f=this._h[8],p=this._h[9],d=this._r[0],g=this._r[1],y=this._r[2],v=this._r[3],_=this._r[4],m=this._r[5],b=this._r[6],w=this._r[7],E=this._r[8],S=this._r[9];r>=16;){var I=t[e+0]|t[e+1]<<8;n+=8191&I;var P=t[e+2]|t[e+3]<<8;s+=8191&(I>>>13|P<<3);var O=t[e+4]|t[e+5]<<8;o+=8191&(P>>>10|O<<6);var A=t[e+6]|t[e+7]<<8;a+=8191&(O>>>7|A<<9);var N=t[e+8]|t[e+9]<<8;c+=8191&(A>>>4|N<<12),h+=N>>>1&8191;var R=t[e+10]|t[e+11]<<8;u+=8191&(N>>>14|R<<2);var x=t[e+12]|t[e+13]<<8;l+=8191&(R>>>11|x<<5);var C=t[e+14]|t[e+15]<<8,T=0,U=T;U+=n*d,U+=s*(5*S),U+=o*(5*E),U+=a*(5*w),T=(U+=c*(5*b))>>>13,U&=8191,U+=h*(5*m),U+=u*(5*_),U+=l*(5*v),U+=(f+=8191&(x>>>8|C<<8))*(5*y);var j=T+=(U+=(p+=C>>>5|i)*(5*g))>>>13;j+=n*g,j+=s*d,j+=o*(5*S),j+=a*(5*E),T=(j+=c*(5*w))>>>13,j&=8191,j+=h*(5*b),j+=u*(5*m),j+=l*(5*_),j+=f*(5*v),T+=(j+=p*(5*y))>>>13,j&=8191;var L=T;L+=n*y,L+=s*g,L+=o*d,L+=a*(5*S),T=(L+=c*(5*E))>>>13,L&=8191,L+=h*(5*w),L+=u*(5*b),L+=l*(5*m),L+=f*(5*_);var M=T+=(L+=p*(5*v))>>>13;M+=n*v,M+=s*y,M+=o*g,M+=a*d,T=(M+=c*(5*S))>>>13,M&=8191,M+=h*(5*E),M+=u*(5*w),M+=l*(5*b),M+=f*(5*m);var D=T+=(M+=p*(5*_))>>>13;D+=n*_,D+=s*v,D+=o*y,D+=a*g,T=(D+=c*d)>>>13,D&=8191,D+=h*(5*S),D+=u*(5*E),D+=l*(5*w),D+=f*(5*b);var k=T+=(D+=p*(5*m))>>>13;k+=n*m,k+=s*_,k+=o*v,k+=a*y,T=(k+=c*g)>>>13,k&=8191,k+=h*d,k+=u*(5*S),k+=l*(5*E),k+=f*(5*w);var z=T+=(k+=p*(5*b))>>>13;z+=n*b,z+=s*m,z+=o*_,z+=a*v,T=(z+=c*y)>>>13,z&=8191,z+=h*g,z+=u*d,z+=l*(5*S),z+=f*(5*E);var $=T+=(z+=p*(5*w))>>>13;$+=n*w,$+=s*b,$+=o*m,$+=a*_,T=($+=c*v)>>>13,$&=8191,$+=h*y,$+=u*g,$+=l*d,$+=f*(5*S);var q=T+=($+=p*(5*E))>>>13;q+=n*E,q+=s*w,q+=o*b,q+=a*m,T=(q+=c*_)>>>13,q&=8191,q+=h*v,q+=u*y,q+=l*g,q+=f*d;var H=T+=(q+=p*(5*S))>>>13;H+=n*S,H+=s*E,H+=o*w,H+=a*b,T=(H+=c*m)>>>13,H&=8191,H+=h*_,H+=u*v,H+=l*y,H+=f*g,n=U=8191&(T=(T=((T+=(H+=p*d)>>>13)<<2)+T|0)+(U&=8191)|0),s=j+=T>>>=13,o=L&=8191,a=M&=8191,c=D&=8191,h=k&=8191,u=z&=8191,l=$&=8191,f=q&=8191,p=H&=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]=l,this._h[8]=f,this._h[9]=p},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)}},31416:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.randomStringForEntropy=e.randomString=e.randomUint32=e.randomBytes=e.defaultRandomSource=void 0;const i=r(46008),n=r(98099),s=r(17309);function o(t,r=e.defaultRandomSource){return r.randomBytes(t)}e.defaultRandomSource=new i.SystemRandomSource,e.randomBytes=o,e.randomUint32=function(t=e.defaultRandomSource){const r=o(4,t),i=(0,n.readUint32LE)(r);return(0,s.wipe)(r),i};const a="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";function c(t,r=a,i=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,r=a,i=e.defaultRandomSource){return c(Math.ceil(t/(Math.log(r.length)/Math.LN2)),r,i)}},75455:(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 t=0;t<e.length;t+=65536)this._crypto.getRandomValues(e.subarray(t,t+Math.min(e.length-t,65536)));return e}}},58871:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.NodeRandomSource=void 0;const i=r(17309);e.NodeRandomSource=class{constructor(){this.isAvailable=!1,this.isInstantiated=!1;{const t=r(45876);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 t=0;t<r.length;t++)r[t]=e[t];return(0,i.wipe)(e),r}}},46008:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SystemRandomSource=void 0;const i=r(75455),n=r(58871);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)}}},73294:(t,e,r)=>{"use strict";var i=r(98099),n=r(17309);e.k=32,e.cn=64;var s=function(){function t(){this.digestLength=e.k,this.blockSize=e.cn,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.mE=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,2756734187,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],l=e[4],f=e[5],p=e[6],d=e[7],g=0;g<16;g++){var y=n+4*g;t[g]=i.readUint32BE(r,y)}for(g=16;g<64;g++){var v=t[g-2],_=(v>>>17|v<<15)^(v>>>19|v<<13)^v>>>10,m=((v=t[g-15])>>>7|v<<25)^(v>>>18|v<<14)^v>>>3;t[g]=(_+t[g-7]|0)+(m+t[g-16]|0)}for(g=0;g<64;g++){_=(((l>>>6|l<<26)^(l>>>11|l<<21)^(l>>>25|l<<7))+(l&f^~l&p)|0)+(d+(o[g]+t[g]|0)|0)|0,m=((a>>>2|a<<30)^(a>>>13|a<<19)^(a>>>22|a<<10))+(a&c^a&h^c&h)|0;d=p,p=f,f=l,l=u+_|0,u=h,h=c,c=a,a=_+m|0}e[0]+=a,e[1]+=c,e[2]+=h,e[3]+=u,e[4]+=l,e[5]+=f,e[6]+=p,e[7]+=d,n+=64,s-=64}return n}e.vp=function(t){var e=new s;e.update(t);var r=e.digest();return e.clean(),r}},93350:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=r(98099),n=r(17309);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,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,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591]);function a(t,e,r,n,s,a,c){for(var h,u,l,f,p,d,g,y,v=r[0],_=r[1],m=r[2],b=r[3],w=r[4],E=r[5],S=r[6],I=r[7],P=n[0],O=n[1],A=n[2],N=n[3],R=n[4],x=n[5],C=n[6],T=n[7];c>=128;){for(var U=0;U<16;U++){var j=8*U+a;t[U]=i.readUint32BE(s,j),e[U]=i.readUint32BE(s,j+4)}for(U=0;U<80;U++){var L,M,D=v,k=_,z=m,$=b,q=w,H=E,V=S,K=P,B=O,F=A,W=N,G=R,J=x,Y=C;if(p=65535&(u=T),d=u>>>16,g=65535&(h=I),y=h>>>16,p+=65535&(u=(R>>>14|w<<18)^(R>>>18|w<<14)^(w>>>9|R<<23)),d+=u>>>16,g+=65535&(h=(w>>>14|R<<18)^(w>>>18|R<<14)^(R>>>9|w<<23)),y+=h>>>16,p+=65535&(u=R&x^~R&C),d+=u>>>16,g+=65535&(h=w&E^~w&S),y+=h>>>16,h=o[2*U],p+=65535&(u=o[2*U+1]),d+=u>>>16,g+=65535&h,y+=h>>>16,h=t[U%16],d+=(u=e[U%16])>>>16,g+=65535&h,y+=h>>>16,g+=(d+=(p+=65535&u)>>>16)>>>16,p=65535&(u=f=65535&p|d<<16),d=u>>>16,g=65535&(h=l=65535&g|(y+=g>>>16)<<16),y=h>>>16,p+=65535&(u=(P>>>28|v<<4)^(v>>>2|P<<30)^(v>>>7|P<<25)),d+=u>>>16,g+=65535&(h=(v>>>28|P<<4)^(P>>>2|v<<30)^(P>>>7|v<<25)),y+=h>>>16,d+=(u=P&O^P&A^O&A)>>>16,g+=65535&(h=v&_^v&m^_&m),y+=h>>>16,L=65535&(g+=(d+=(p+=65535&u)>>>16)>>>16)|(y+=g>>>16)<<16,M=65535&p|d<<16,p=65535&(u=W),d=u>>>16,g=65535&(h=$),y=h>>>16,d+=(u=f)>>>16,g+=65535&(h=l),y+=h>>>16,_=D,m=k,b=z,w=$=65535&(g+=(d+=(p+=65535&u)>>>16)>>>16)|(y+=g>>>16)<<16,E=q,S=H,I=V,v=L,O=K,A=B,N=F,R=W=65535&p|d<<16,x=G,C=J,T=Y,P=M,U%16==15)for(j=0;j<16;j++)h=t[j],p=65535&(u=e[j]),d=u>>>16,g=65535&h,y=h>>>16,h=t[(j+9)%16],p+=65535&(u=e[(j+9)%16]),d+=u>>>16,g+=65535&h,y+=h>>>16,l=t[(j+1)%16],p+=65535&(u=((f=e[(j+1)%16])>>>1|l<<31)^(f>>>8|l<<24)^(f>>>7|l<<25)),d+=u>>>16,g+=65535&(h=(l>>>1|f<<31)^(l>>>8|f<<24)^l>>>7),y+=h>>>16,l=t[(j+14)%16],d+=(u=((f=e[(j+14)%16])>>>19|l<<13)^(l>>>29|f<<3)^(f>>>6|l<<26))>>>16,g+=65535&(h=(l>>>19|f<<13)^(f>>>29|l<<3)^l>>>6),y+=h>>>16,y+=(g+=(d+=(p+=65535&u)>>>16)>>>16)>>>16,t[j]=65535&g|y<<16,e[j]=65535&p|d<<16}p=65535&(u=P),d=u>>>16,g=65535&(h=v),y=h>>>16,h=r[0],d+=(u=n[0])>>>16,g+=65535&h,y+=h>>>16,y+=(g+=(d+=(p+=65535&u)>>>16)>>>16)>>>16,r[0]=v=65535&g|y<<16,n[0]=P=65535&p|d<<16,p=65535&(u=O),d=u>>>16,g=65535&(h=_),y=h>>>16,h=r[1],d+=(u=n[1])>>>16,g+=65535&h,y+=h>>>16,y+=(g+=(d+=(p+=65535&u)>>>16)>>>16)>>>16,r[1]=_=65535&g|y<<16,n[1]=O=65535&p|d<<16,p=65535&(u=A),d=u>>>16,g=65535&(h=m),y=h>>>16,h=r[2],d+=(u=n[2])>>>16,g+=65535&h,y+=h>>>16,y+=(g+=(d+=(p+=65535&u)>>>16)>>>16)>>>16,r[2]=m=65535&g|y<<16,n[2]=A=65535&p|d<<16,p=65535&(u=N),d=u>>>16,g=65535&(h=b),y=h>>>16,h=r[3],d+=(u=n[3])>>>16,g+=65535&h,y+=h>>>16,y+=(g+=(d+=(p+=65535&u)>>>16)>>>16)>>>16,r[3]=b=65535&g|y<<16,n[3]=N=65535&p|d<<16,p=65535&(u=R),d=u>>>16,g=65535&(h=w),y=h>>>16,h=r[4],d+=(u=n[4])>>>16,g+=65535&h,y+=h>>>16,y+=(g+=(d+=(p+=65535&u)>>>16)>>>16)>>>16,r[4]=w=65535&g|y<<16,n[4]=R=65535&p|d<<16,p=65535&(u=x),d=u>>>16,g=65535&(h=E),y=h>>>16,h=r[5],d+=(u=n[5])>>>16,g+=65535&h,y+=h>>>16,y+=(g+=(d+=(p+=65535&u)>>>16)>>>16)>>>16,r[5]=E=65535&g|y<<16,n[5]=x=65535&p|d<<16,p=65535&(u=C),d=u>>>16,g=65535&(h=S),y=h>>>16,h=r[6],d+=(u=n[6])>>>16,g+=65535&h,y+=h>>>16,y+=(g+=(d+=(p+=65535&u)>>>16)>>>16)>>>16,r[6]=S=65535&g|y<<16,n[6]=C=65535&p|d<<16,p=65535&(u=T),d=u>>>16,g=65535&(h=I),y=h>>>16,h=r[7],d+=(u=n[7])>>>16,g+=65535&h,y+=h>>>16,y+=(g+=(d+=(p+=65535&u)>>>16)>>>16)>>>16,r[7]=I=65535&g|y<<16,n[7]=T=65535&p|d<<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}},17309:(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}},57664:(t,e,r)=>{"use strict";e.gi=e.Au=e.KS=e.kz=void 0;const i=r(31416),n=r(17309);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.kz=32,e.KS=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 r=0;r<16;r++){const n=i&(t[r]^e[r]);t[r]^=n,e[r]^=n}}function u(t,e,r){for(let i=0;i<16;i++)t[i]=e[i]+r[i]}function l(t,e,r){for(let i=0;i<16;i++)t[i]=e[i]-r[i]}function f(t,e,r){let i,n,s=0,o=0,a=0,c=0,h=0,u=0,l=0,f=0,p=0,d=0,g=0,y=0,v=0,_=0,m=0,b=0,w=0,E=0,S=0,I=0,P=0,O=0,A=0,N=0,R=0,x=0,C=0,T=0,U=0,j=0,L=0,M=r[0],D=r[1],k=r[2],z=r[3],$=r[4],q=r[5],H=r[6],V=r[7],K=r[8],B=r[9],F=r[10],W=r[11],G=r[12],J=r[13],Y=r[14],X=r[15];i=e[0],s+=i*M,o+=i*D,a+=i*k,c+=i*z,h+=i*$,u+=i*q,l+=i*H,f+=i*V,p+=i*K,d+=i*B,g+=i*F,y+=i*W,v+=i*G,_+=i*J,m+=i*Y,b+=i*X,i=e[1],o+=i*M,a+=i*D,c+=i*k,h+=i*z,u+=i*$,l+=i*q,f+=i*H,p+=i*V,d+=i*K,g+=i*B,y+=i*F,v+=i*W,_+=i*G,m+=i*J,b+=i*Y,w+=i*X,i=e[2],a+=i*M,c+=i*D,h+=i*k,u+=i*z,l+=i*$,f+=i*q,p+=i*H,d+=i*V,g+=i*K,y+=i*B,v+=i*F,_+=i*W,m+=i*G,b+=i*J,w+=i*Y,E+=i*X,i=e[3],c+=i*M,h+=i*D,u+=i*k,l+=i*z,f+=i*$,p+=i*q,d+=i*H,g+=i*V,y+=i*K,v+=i*B,_+=i*F,m+=i*W,b+=i*G,w+=i*J,E+=i*Y,S+=i*X,i=e[4],h+=i*M,u+=i*D,l+=i*k,f+=i*z,p+=i*$,d+=i*q,g+=i*H,y+=i*V,v+=i*K,_+=i*B,m+=i*F,b+=i*W,w+=i*G,E+=i*J,S+=i*Y,I+=i*X,i=e[5],u+=i*M,l+=i*D,f+=i*k,p+=i*z,d+=i*$,g+=i*q,y+=i*H,v+=i*V,_+=i*K,m+=i*B,b+=i*F,w+=i*W,E+=i*G,S+=i*J,I+=i*Y,P+=i*X,i=e[6],l+=i*M,f+=i*D,p+=i*k,d+=i*z,g+=i*$,y+=i*q,v+=i*H,_+=i*V,m+=i*K,b+=i*B,w+=i*F,E+=i*W,S+=i*G,I+=i*J,P+=i*Y,O+=i*X,i=e[7],f+=i*M,p+=i*D,d+=i*k,g+=i*z,y+=i*$,v+=i*q,_+=i*H,m+=i*V,b+=i*K,w+=i*B,E+=i*F,S+=i*W,I+=i*G,P+=i*J,O+=i*Y,A+=i*X,i=e[8],p+=i*M,d+=i*D,g+=i*k,y+=i*z,v+=i*$,_+=i*q,m+=i*H,b+=i*V,w+=i*K,E+=i*B,S+=i*F,I+=i*W,P+=i*G,O+=i*J,A+=i*Y,N+=i*X,i=e[9],d+=i*M,g+=i*D,y+=i*k,v+=i*z,_+=i*$,m+=i*q,b+=i*H,w+=i*V,E+=i*K,S+=i*B,I+=i*F,P+=i*W,O+=i*G,A+=i*J,N+=i*Y,R+=i*X,i=e[10],g+=i*M,y+=i*D,v+=i*k,_+=i*z,m+=i*$,b+=i*q,w+=i*H,E+=i*V,S+=i*K,I+=i*B,P+=i*F,O+=i*W,A+=i*G,N+=i*J,R+=i*Y,x+=i*X,i=e[11],y+=i*M,v+=i*D,_+=i*k,m+=i*z,b+=i*$,w+=i*q,E+=i*H,S+=i*V,I+=i*K,P+=i*B,O+=i*F,A+=i*W,N+=i*G,R+=i*J,x+=i*Y,C+=i*X,i=e[12],v+=i*M,_+=i*D,m+=i*k,b+=i*z,w+=i*$,E+=i*q,S+=i*H,I+=i*V,P+=i*K,O+=i*B,A+=i*F,N+=i*W,R+=i*G,x+=i*J,C+=i*Y,T+=i*X,i=e[13],_+=i*M,m+=i*D,b+=i*k,w+=i*z,E+=i*$,S+=i*q,I+=i*H,P+=i*V,O+=i*K,A+=i*B,N+=i*F,R+=i*W,x+=i*G,C+=i*J,T+=i*Y,U+=i*X,i=e[14],m+=i*M,b+=i*D,w+=i*k,E+=i*z,S+=i*$,I+=i*q,P+=i*H,O+=i*V,A+=i*K,N+=i*B,R+=i*F,x+=i*W,C+=i*G,T+=i*J,U+=i*Y,j+=i*X,i=e[15],b+=i*M,w+=i*D,E+=i*k,S+=i*z,I+=i*$,P+=i*q,O+=i*H,A+=i*V,N+=i*K,R+=i*B,x+=i*F,C+=i*W,T+=i*G,U+=i*J,j+=i*Y,L+=i*X,s+=38*w,o+=38*E,a+=38*S,c+=38*I,h+=38*P,u+=38*O,l+=38*A,f+=38*N,p+=38*R,d+=38*x,g+=38*C,y+=38*T,v+=38*U,_+=38*j,m+=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=l+n+65535,n=Math.floor(i/65536),l=i-65536*n,i=f+n+65535,n=Math.floor(i/65536),f=i-65536*n,i=p+n+65535,n=Math.floor(i/65536),p=i-65536*n,i=d+n+65535,n=Math.floor(i/65536),d=i-65536*n,i=g+n+65535,n=Math.floor(i/65536),g=i-65536*n,i=y+n+65535,n=Math.floor(i/65536),y=i-65536*n,i=v+n+65535,n=Math.floor(i/65536),v=i-65536*n,i=_+n+65535,n=Math.floor(i/65536),_=i-65536*n,i=m+n+65535,n=Math.floor(i/65536),m=i-65536*n,i=b+n+65535,n=Math.floor(i/65536),b=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=l+n+65535,n=Math.floor(i/65536),l=i-65536*n,i=f+n+65535,n=Math.floor(i/65536),f=i-65536*n,i=p+n+65535,n=Math.floor(i/65536),p=i-65536*n,i=d+n+65535,n=Math.floor(i/65536),d=i-65536*n,i=g+n+65535,n=Math.floor(i/65536),g=i-65536*n,i=y+n+65535,n=Math.floor(i/65536),y=i-65536*n,i=v+n+65535,n=Math.floor(i/65536),v=i-65536*n,i=_+n+65535,n=Math.floor(i/65536),_=i-65536*n,i=m+n+65535,n=Math.floor(i/65536),m=i-65536*n,i=b+n+65535,n=Math.floor(i/65536),b=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]=l,t[7]=f,t[8]=p,t[9]=d,t[10]=g,t[11]=y,t[12]=v,t[13]=_,t[14]=m,t[15]=b}function p(t,e){f(t,e,e)}function d(t,e){const r=new Uint8Array(32),i=new Float64Array(80),n=s(),o=s(),d=s(),g=s(),y=s(),v=s();for(let e=0;e<31;e++)r[e]=t[e];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 t=0;t<16;t++)o[t]=i[t];n[0]=g[0]=1;for(let t=254;t>=0;--t){const e=r[t>>>3]>>>(7&t)&1;h(n,o,e),h(d,g,e),u(y,n,d),l(n,n,d),u(d,o,g),l(o,o,g),p(g,y),p(v,n),f(n,d,n),f(d,o,y),u(y,n,d),l(n,n,d),p(o,n),l(d,g,v),f(n,d,a),u(n,n,g),f(d,d,n),f(n,g,v),f(g,o,i),p(o,y),h(n,o,e),h(d,g,e)}for(let t=0;t<16;t++)i[t+16]=n[t],i[t+32]=d[t],i[t+48]=o[t],i[t+64]=g[t];const _=i.subarray(32),m=i.subarray(16);!function(t,e){const r=s();for(let t=0;t<16;t++)r[t]=e[t];for(let t=253;t>=0;t--)p(r,r),2!==t&&4!==t&&f(r,r,e);for(let e=0;e<16;e++)t[e]=r[e]}(_,_),f(m,m,_);const b=new Uint8Array(32);return function(t,e){const r=s(),i=s();for(let t=0;t<16;t++)i[t]=e[t];c(i),c(i),c(i);for(let t=0;t<2;t++){r[0]=i[0]-65517;for(let t=1;t<15;t++)r[t]=i[t]-65535-(r[t-1]>>16&1),r[t-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 e=0;e<16;e++)t[2*e]=255&i[e],t[2*e+1]=i[e]>>8}(b,m),b}function g(t){return d(t,o)}function y(t){if(t.length!==e.KS)throw new Error(`x25519: seed must be ${e.KS} bytes`);const r=new Uint8Array(t);return{publicKey:g(r),secretKey:r}}e.Au=function(t){const e=(0,i.randomBytes)(32,t),r=y(e);return(0,n.wipe)(e),r},e.gi=function(t,r,i=!1){if(t.length!==e.kz)throw new Error("X25519: incorrect secret key length");if(r.length!==e.kz)throw new Error("X25519: incorrect public key length");const n=d(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}},85211:(t,e,r)=>{"use strict";r.r(e),r.d(e,{EthereumProvider:()=>va,OPTIONAL_EVENTS:()=>na,OPTIONAL_METHODS:()=>ra,REQUIRED_EVENTS:()=>ia,REQUIRED_METHODS:()=>ea,default:()=>ya});var i={};r.r(i),r.d(i,{identity:()=>k});var n={};r.r(n),r.d(n,{base2:()=>z});var s={};r.r(s),r.d(s,{base8:()=>$});var o={};r.r(o),r.d(o,{base10:()=>q});var a={};r.r(a),r.d(a,{base16:()=>H,base16upper:()=>V});var c={};r.r(c),r.d(c,{base32:()=>K,base32hex:()=>G,base32hexpad:()=>Y,base32hexpadupper:()=>X,base32hexupper:()=>J,base32pad:()=>F,base32padupper:()=>W,base32upper:()=>B,base32z:()=>Z});var h={};r.r(h),r.d(h,{base36:()=>Q,base36upper:()=>tt});var u={};r.r(u),r.d(u,{base58btc:()=>et,base58flickr:()=>rt});var l={};r.r(l),r.d(l,{base64:()=>it,base64pad:()=>nt,base64url:()=>st,base64urlpad:()=>ot});var f={};r.r(f),r.d(f,{base256emoji:()=>ut});var p={};r.r(p),r.d(p,{sha256:()=>Ct,sha512:()=>Tt});var d={};r.r(d),r.d(d,{identity:()=>jt});var g={};r.r(g),r.d(g,{code:()=>Mt,decode:()=>kt,encode:()=>Dt,name:()=>Lt});var y={};r.r(y),r.d(y,{code:()=>Ht,decode:()=>Kt,encode:()=>Vt,name:()=>qt});var v=r(17187),_=r.n(v),m=r(15501),b=r(512),w=r(31416),E=r(73294),S=r(57664);function I(t){return null!=globalThis.Buffer?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):t}function P(t=0){return null!=globalThis.Buffer&&null!=globalThis.Buffer.allocUnsafe?I(globalThis.Buffer.allocUnsafe(t)):new Uint8Array(t)}function O(t,e){e||(e=t.reduce(((t,e)=>t+e.length),0));const r=P(e);let i=0;for(const e of t)r.set(e,i),i+=e.length;return I(r)}var A=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 l(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 l=0,f=s-1;(0!==u||l<n)&&-1!==f;f--,l++)u+=a*o[f]>>>0,o[f]=u%256>>>0,u=u/256>>>0;if(0!==u)throw new Error("Non-zero carry");n=l,e++}if(" "!==t[e]){for(var p=s-n;p!==s&&0===o[p];)p++;for(var d=new Uint8Array(i+(s-p)),g=i;p!==s;)d[g++]=o[p++];return d}}}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 l=e[n],f=0,p=o-1;(0!==l||f<i)&&-1!==p;p--,f++)l+=256*h[p]>>>0,h[p]=l%a>>>0,l=l/a>>>0;if(0!==l)throw new Error("Non-zero carry");i=f,n++}for(var d=o-i;d!==o&&0===h[d];)d++;for(var g=c.repeat(r);d<o;++d)g+=t.charAt(h[d]);return g},decodeUnsafe:l,decode:function(t){var r=l(t);if(r)return r;throw new Error(`Non-${e} character`)}}};const N=A,R=(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 x{constructor(t,e,r){this.name=t,this.prefix=e,this.baseEncode=r}encode(t){if(t instanceof Uint8Array)return`${this.prefix}${this.baseEncode(t)}`;throw Error("Unknown type, must be binary type")}}class C{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 ${JSON.stringify(t)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(t.slice(this.prefix.length))}throw Error("Can only multibase decode strings")}or(t){return U(this,t)}}class T{constructor(t){this.decoders=t}or(t){return U(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 ${JSON.stringify(t)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const U=(t,e)=>new T({...t.decoders||{[t.prefix]:t},...e.decoders||{[e.prefix]:e}});class j{constructor(t,e,r,i){this.name=t,this.prefix=e,this.baseEncode=r,this.baseDecode=i,this.encoder=new x(t,e,r),this.decoder=new C(t,e,i)}encode(t){return this.encoder.encode(t)}decode(t){return this.decoder.decode(t)}}const L=({name:t,prefix:e,encode:r,decode:i})=>new j(t,e,r,i),M=({prefix:t,name:e,alphabet:r})=>{const{encode:i,decode:n}=N(r,e);return L({prefix:t,name:e,encode:i,decode:t=>R(n(t))})},D=({name:t,prefix:e,bitsPerChar:r,alphabet:i})=>L({prefix:e,name:t,encode:t=>((t,e,r)=>{const i="="===e[e.length-1],n=(1<<r)-1;let s="",o=0,a=0;for(let i=0;i<t.length;++i)for(a=a<<8|t[i],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,i,r),decode:e=>((t,e,r,i)=>{const n={};for(let t=0;t<e.length;++t)n[e[t]]=t;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 e=0;e<s;++e){const s=n[t[e]];if(void 0===s)throw new SyntaxError(`Non-${i} character`);c=c<<r|s,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})(e,i,r,t)}),k=L({prefix:"\0",name:"identity",encode:t=>(t=>(new TextDecoder).decode(t))(t),decode:t=>(t=>(new TextEncoder).encode(t))(t)}),z=D({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1}),$=D({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3}),q=M({prefix:"9",name:"base10",alphabet:"0123456789"}),H=D({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),V=D({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4}),K=D({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),B=D({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),F=D({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),W=D({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),G=D({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),J=D({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),Y=D({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),X=D({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),Z=D({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),Q=M({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),tt=M({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"}),et=M({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),rt=M({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"}),it=D({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),nt=D({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),st=D({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),ot=D({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6}),at=Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"),ct=at.reduce(((t,e,r)=>(t[r]=e,t)),[]),ht=at.reduce(((t,e,r)=>(t[e.codePointAt(0)]=r,t)),[]);const ut=L({prefix:"🚀",name:"base256emoji",encode:function(t){return t.reduce(((t,e)=>t+=ct[e]),"")},decode:function(t){const e=[];for(const r of t){const t=ht[r.codePointAt(0)];if(void 0===t)throw new Error(`Non-base256emoji character: ${r}`);e.push(t)}return new Uint8Array(e)}});var lt=function t(e,r,i){r=r||[];var n=i=i||0;for(;e>=ft;)r[i++]=255&e|128,e/=128;for(;-128&e;)r[i++]=255&e|128,e>>>=7;return r[i]=0|e,t.bytes=i-n+1,r},ft=Math.pow(2,31);var pt=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?(127&i)<<s:(127&i)*Math.pow(2,s),s+=7}while(i>=128);return t.bytes=o-r,n};var dt=Math.pow(2,7),gt=Math.pow(2,14),yt=Math.pow(2,21),vt=Math.pow(2,28),_t=Math.pow(2,35),mt=Math.pow(2,42),bt=Math.pow(2,49),wt=Math.pow(2,56),Et=Math.pow(2,63);const St={encode:lt,decode:pt,encodingLength:function(t){return t<dt?1:t<gt?2:t<yt?3:t<vt?4:t<_t?5:t<mt?6:t<bt?7:t<wt?8:t<Et?9:10}},It=(t,e,r=0)=>(St.encode(t,e,r),e),Pt=t=>St.encodingLength(t),Ot=(t,e)=>{const r=e.byteLength,i=Pt(t),n=i+Pt(r),s=new Uint8Array(n+r);return It(t,s,0),It(r,s,i),s.set(e,n),new At(t,r,e,s)};class At{constructor(t,e,r,i){this.code=t,this.size=e,this.digest=r,this.bytes=i}}const Nt=({name:t,code:e,encode:r})=>new Rt(t,e,r);class Rt{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?Ot(this.code,e):e.then((t=>Ot(this.code,t)))}throw Error("Unknown type, must be binary type")}}const xt=t=>async e=>new Uint8Array(await crypto.subtle.digest(t,e)),Ct=Nt({name:"sha2-256",code:18,encode:xt("SHA-256")}),Tt=Nt({name:"sha2-512",code:19,encode:xt("SHA-512")}),Ut=R,jt={code:0,name:"identity",encode:Ut,digest:t=>Ot(0,Ut(t))},Lt="raw",Mt=85,Dt=t=>R(t),kt=t=>R(t),zt=new TextEncoder,$t=new TextDecoder,qt="json",Ht=512,Vt=t=>zt.encode(JSON.stringify(t)),Kt=t=>JSON.parse($t.decode(t));Symbol.toStringTag,Symbol.for("nodejs.util.inspect.custom");Symbol.for("@ipld/js-cid/CID");const Bt={...i,...n,...s,...o,...a,...c,...h,...u,...l,...f};function Ft(t,e,r,i){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:r},decoder:{decode:i}}}const Wt=Ft("utf8","u",(t=>"u"+new TextDecoder("utf8").decode(t)),(t=>(new TextEncoder).encode(t.substring(1)))),Gt=Ft("ascii","a",(t=>{let e="a";for(let r=0;r<t.length;r++)e+=String.fromCharCode(t[r]);return e}),(t=>{const e=P((t=t.substring(1)).length);for(let r=0;r<t.length;r++)e[r]=t.charCodeAt(r);return e})),Jt={utf8:Wt,"utf-8":Wt,hex:Bt.base16,latin1:Gt,ascii:Gt,binary:Gt,...Bt};function Yt(t,e="utf8"){const r=Jt[e];if(!r)throw new Error(`Unsupported encoding "${e}"`);return"utf8"!==e&&"utf-8"!==e||null==globalThis.Buffer||null==globalThis.Buffer.from?r.decoder.decode(`${r.prefix}${t}`):I(globalThis.Buffer.from(t,"utf-8"))}function Xt(t,e="utf8"){const r=Jt[e];if(!r)throw new Error(`Unsupported encoding "${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 Zt=r(43631),Qt=r(66736),te=r(62873),ee=r(65755),re=r(69528);r(61882);const ie={waku:{publish:"waku_publish",batchPublish:"waku_batchPublish",subscribe:"waku_subscribe",batchSubscribe:"waku_batchSubscribe",subscription:"waku_subscription",unsubscribe:"waku_unsubscribe",batchUnsubscribe:"waku_batchUnsubscribe"},irn:{publish:"irn_publish",batchPublish:"irn_batchPublish",subscribe:"irn_subscribe",batchSubscribe:"irn_batchSubscribe",subscription:"irn_subscription",unsubscribe:"irn_unsubscribe",batchUnsubscribe:"irn_batchUnsubscribe"},iridium:{publish:"iridium_publish",batchPublish:"iridium_batchPublish",subscribe:"iridium_subscribe",batchSubscribe:"iridium_batchSubscribe",subscription:"iridium_subscription",unsubscribe:"iridium_unsubscribe",batchUnsubscribe:"iridium_batchUnsubscribe"}};function ne(t,e){return t.includes(":")?[t]:e.chains||[]}const se="base10",oe="base16",ae="base64pad",ce="utf8";function he(){return Xt((0,w.randomBytes)(32),oe)}function ue(t){return Xt((0,E.vp)(Yt(t,ce)),oe)}function le(t){return Number(Xt(t,se))}function fe(t){const e=function(t){return Yt(`${t}`,se)}(typeof t.type<"u"?t.type:0);if(1===le(e)&&typeof t.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");const r=typeof t.senderPublicKey<"u"?Yt(t.senderPublicKey,oe):void 0,i=typeof t.iv<"u"?Yt(t.iv,oe):(0,w.randomBytes)(12);return function(t){if(1===le(t.type)){if(typeof t.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");return Xt(O([t.type,t.senderPublicKey,t.iv,t.sealed]),ae)}return Xt(O([t.type,t.iv,t.sealed]),ae)}({type:e,sealed:new m.OK(Yt(t.symKey,oe)).seal(i,Yt(t.message,ce)),iv:i,senderPublicKey:r})}function pe(t){const e=Yt(t,ae),r=e.slice(0,1);if(1===le(r)){const t=33,i=t+12,n=e.slice(1,t),s=e.slice(t,i);return{type:r,sealed:e.slice(i),iv:s,senderPublicKey:n}}const i=e.slice(1,13);return{type:r,sealed:e.slice(13),iv:i}}function de(t){const e=t?.type||0;if(1===e){if(typeof t?.senderPublicKey>"u")throw new Error("missing sender public key");if(typeof t?.receiverPublicKey>"u")throw new Error("missing receiver public key")}return{type:e,senderPublicKey:t?.senderPublicKey,receiverPublicKey:t?.receiverPublicKey}}function ge(t){return 1===t.type&&"string"==typeof t.senderPublicKey&&"string"==typeof t.receiverPublicKey}var ye=Object.defineProperty,ve=Object.getOwnPropertySymbols,_e=Object.prototype.hasOwnProperty,me=Object.prototype.propertyIsEnumerable,be=(t,e,r)=>e in t?ye(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,we=(t,e)=>{for(var r in e||(e={}))_e.call(e,r)&&be(t,r,e[r]);if(ve)for(var r of ve(e))me.call(e,r)&&be(t,r,e[r]);return t};const Ee="react-native",Se="node",Ie="browser",Pe="unknown",Oe="js";function Ae(){return typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.node<"u"}function Ne(){return!(0,te.getDocument)()&&!!(0,te.getNavigator)()&&"ReactNative"===navigator.product}function Re(){return!Ae()&&!!(0,te.getNavigator)()}function xe(){return Ne()?Ee:Ae()?Se:Re()?Ie:Pe}function Ce(t,e,r){const i=function(){const t=(0,Zt.qY)();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("-")}(),n=function(){var t;const e=xe();return e===Ie?[e,(null==(t=(0,te.getLocation)())?void 0:t.host)||"unknown"].join(":"):e}();return[[t,e].join("-"),[Oe,r].join("-"),i,n].join("/")}function Te({protocol:t,version:e,relayUrl:r,sdkVersion:i,auth:n,projectId:s,useOnCloseEvent:o}){const a=r.split("?"),c={auth:n,ua:Ce(t,e,i),projectId:s,useOnCloseEvent:o||void 0},h=function(t,e){let r=re.parse(t);return r=we(we({},r),e),re.stringify(r)}(a[1]||"",c);return a[0]+"?"+h}function Ue(t,e){return t.filter((t=>e.includes(t))).length===t.length}function je(t){return Object.fromEntries(t.entries())}function Le(t){return new Map(Object.entries(t))}function Me(t=Qt.FIVE_MINUTES,e){const r=(0,Qt.toMiliseconds)(t||Qt.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 De(t,e,r){return new Promise((async(i,n)=>{const s=setTimeout((()=>n(new Error(r))),e);try{i(await t)}catch(t){n(t)}clearTimeout(s)}))}function ke(t,e){if("string"==typeof e&&e.startsWith(`${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:${e}`}if("id"===t.toLowerCase()){if("number"!=typeof e)throw new Error('Value must be "number" for expirer target type: id');return`id:${e}`}throw new Error(`Unknown expirer target type: ${t}`)}function ze(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 ${e}:${r}`);i.id=Number(r)}return i}function $e(t,e){return(0,Qt.fromMiliseconds)((e||Date.now())+(0,Qt.toMiliseconds)(t))}function qe(t){return Date.now()>=(0,Qt.toMiliseconds)(t)}function He(t,e){return`${t}${e?`:${e}`:""}`}function Ve(t=[],e=[]){return[...new Set([...t,...e])]}function Ke(t){return t?.relay||{protocol:"irn"}}function Be(t){const e=ie[t];if(typeof e>"u")throw new Error(`Relay Protocol not supported: ${t}`);return e}var Fe=Object.defineProperty,We=Object.getOwnPropertySymbols,Ge=Object.prototype.hasOwnProperty,Je=Object.prototype.propertyIsEnumerable,Ye=(t,e,r)=>e in t?Fe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;function Xe(t,e="-"){const r={},i="relay"+e;return Object.keys(t).forEach((e=>{if(e.startsWith(i)){const n=e.replace(i,""),s=t[e];r[n]=s}})),r}function Ze(t){return t.startsWith("//")?t.substring(2):t}function Qe(t){return`${t.protocol}:${t.topic}@${t.version}?`+re.stringify(((t,e)=>{for(var r in e||(e={}))Ge.call(e,r)&&Ye(t,r,e[r]);if(We)for(var r of We(e))Je.call(e,r)&&Ye(t,r,e[r]);return t})({symKey:t.symKey},function(t,e="-"){const r={};return Object.keys(t).forEach((i=>{const n="relay"+e+i;t[i]&&(r[n]=t[i])})),r}(t.relay)))}Object.defineProperty,Object.defineProperties,Object.getOwnPropertyDescriptors,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;function tr(t){const e=[];return t.forEach((t=>{const[r,i]=t.split(":");e.push(`${r}:${i}`)})),e}function er(t){return t.includes(":")}function rr(t){return er(t)?t.split(":")[0]:t}const ir={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}},nr={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 sr(t,e){const{message:r,code:i}=nr[t];return{message:e?`${r} ${e}`:r,code:i}}function or(t,e){const{message:r,code:i}=ir[t];return{message:e?`${r} ${e}`:r,code:i}}function ar(t,e){return!!Array.isArray(t)&&(!(typeof e<"u"&&t.length)||t.every(e))}function cr(t){return Object.getPrototypeOf(t)===Object.prototype&&Object.keys(t).length}function hr(t){return typeof t>"u"}function ur(t,e){return!(!e||!hr(t))||"string"==typeof t&&!!t.trim().length}function lr(t,e){return!(!e||!hr(t))||"number"==typeof t&&!isNaN(t)}function fr(t){return!(!ur(t,!1)||!t.includes(":"))&&2===t.split(":").length}function pr(t){let e=!0;return ar(t)?t.length&&(e=t.every((t=>ur(t,!1)))):e=!1,e}function dr(t,e){let r=null;return Object.entries(t).forEach((([t,i])=>{if(r)return;const n=function(t,e,r){let i=null;return ar(e)?e.forEach((e=>{i||(!fr(e)||!e.includes(t))&&(i=or("UNSUPPORTED_CHAINS",`${r}, chain ${e} should be a string and conform to "namespace:chainId" format`))})):i=or("UNSUPPORTED_CHAINS",`${r}, chains ${e} should be an array of strings conforming to "namespace:chainId" format`),i}(t,ne(t,i),`${e} requiredNamespace`);n&&(r=n)})),r}function gr(t,e){let r=null;return ar(t)?t.forEach((t=>{r||function(t){if(ur(t,!1)&&t.includes(":")){const e=t.split(":");if(3===e.length){const t=e[0]+":"+e[1];return!!e[2]&&fr(t)}}return!1}(t)||(r=or("UNSUPPORTED_ACCOUNTS",`${e}, account ${t} should be a string and conform to "namespace:chainId:address" format`))})):r=or("UNSUPPORTED_ACCOUNTS",`${e}, accounts should be an array of strings conforming to "namespace:chainId:address" format`),r}function yr(t,e){let r=null;return Object.values(t).forEach((t=>{if(r)return;const i=function(t,e){let r=null;return pr(t?.methods)?pr(t?.events)||(r=or("UNSUPPORTED_EVENTS",`${e}, events should be an array of strings or empty array for no events`)):r=or("UNSUPPORTED_METHODS",`${e}, methods should be an array of strings or empty array for no methods`),r}(t,`${e}, namespace`);i&&(r=i)})),r}function vr(t,e){let r=null;if(t&&cr(t)){const i=yr(t,e);i&&(r=i);const n=function(t,e){let r=null;return Object.values(t).forEach((t=>{if(r)return;const i=gr(t?.accounts,`${e} namespace`);i&&(r=i)})),r}(t,e);n&&(r=n)}else r=sr("MISSING_OR_INVALID",`${e}, namespaces should be an object with data`);return r}function _r(t){return ur(t.protocol,!0)}function mr(t){return typeof t<"u"&&null!==typeof t}function br(t,e){return!(!fr(e)||!function(t){const e=[];return Object.values(t).forEach((t=>{e.push(...tr(t.accounts))})),e}(t).includes(e))}function wr(t,e,r){return!!ur(r,!1)&&function(t,e){const r=[];return Object.values(t).forEach((t=>{tr(t.accounts).includes(e)&&r.push(...t.methods)})),r}(t,e).includes(r)}function Er(t,e,r){return!!ur(r,!1)&&function(t,e){const r=[];return Object.values(t).forEach((t=>{tr(t.accounts).includes(e)&&r.push(...t.events)})),r}(t,e).includes(r)}function Sr(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{tr(t[r].accounts)?.forEach((i=>{e[i]={accounts:t[r].accounts.filter((t=>t.includes(`${i}:`))),methods:t[r].methods,events:t[r].events}}))}})),e}(e),o=Object.keys(n),a=Object.keys(s),c=Ir(Object.keys(t)),h=Ir(Object.keys(e)),u=c.filter((t=>!h.includes(t)));return u.length&&(i=sr("NON_CONFORMING_NAMESPACES",`${r} namespaces keys don't satisfy requiredNamespaces.\n Required: ${u.toString()}\n Received: ${Object.keys(e).toString()}`)),Ue(o,a)||(i=sr("NON_CONFORMING_NAMESPACES",`${r} namespaces chains don't satisfy required namespaces.\n Required: ${o.toString()}\n Approved: ${a.toString()}`)),Object.keys(e).forEach((t=>{if(!t.includes(":")||i)return;const n=tr(e[t].accounts);n.includes(t)||(i=sr("NON_CONFORMING_NAMESPACES",`${r} namespaces accounts don't satisfy namespace accounts for ${t}\n Required: ${t}\n Approved: ${n.toString()}`))})),o.forEach((t=>{i||(Ue(n[t].methods,s[t].methods)?Ue(n[t].events,s[t].events)||(i=sr("NON_CONFORMING_NAMESPACES",`${r} namespaces events don't satisfy namespace events for ${t}`)):i=sr("NON_CONFORMING_NAMESPACES",`${r} namespaces methods don't satisfy namespace methods for ${t}`))})),i}function Ir(t){return[...new Set(t.map((t=>t.includes(":")?t.split(":")[0]:t)))]}var Pr=r(85150),Or=r(90772),Ar=r(9107),Nr=r(38200);class Rr extends Nr.q{constructor(t){super(),this.opts=t,this.protocol="wc",this.version=2}}class xr extends Nr.q{constructor(t,e){super(),this.core=t,this.logger=e,this.records=new Map}}class Cr extends Nr.q{constructor(t,e){super(),this.relayer=t,this.logger=e}}class Tr extends Nr.q{constructor(t){super()}}class Ur extends Nr.q{constructor(t,e){super(),this.relayer=t,this.logger=e}}class jr extends Nr.q{constructor(t,e){super(),this.core=t,this.logger=e}}var Lr=r(85094),Mr=r(31050);const Dr="base64url",kr="did",zr="key",$r="base58btc";function qr(t){return Xt(Yt((0,Lr.u)(t),"utf8"),Dr)}function Hr(t){const e="z"+Xt(O([Yt("K36",$r),t]),$r);return[kr,zr,e].join(":")}function Vr(t=(0,w.randomBytes)(32)){return Mr._w(t)}async function Kr(t,e,r,i,n=(0,Qt.fromMiliseconds)(Date.now())){const s={alg:"EdDSA",typ:"JWT"},o={iss:Hr(i.publicKey),sub:t,aud:e,iat:n,exp:n+r},a=Yt([qr((c={header:s,payload:o}).header),qr(c.payload)].join("."),"utf8");var c;return function(t){return[qr(t.header),qr(t.payload),(e=t.signature,Xt(e,Dr))].join(".");var e}({header:s,payload:o,signature:Mr.Xx(i.secretKey,a)})}r(43014);var Br=r(19303),Fr=r(56186);const Wr=t=>t.split("?")[0],Gr=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(57026);class Jr{constructor(t){if(this.url=t,this.events=new v.EventEmitter,this.registering=!1,!(0,Fr.isWsUrl)(t))throw new Error(`Provided URL is not compatible with WebSocket connection: ${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(t=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((0,Lr.u)(t))}catch(e){this.onError(t.id,e)}}register(t=this.url){if(!(0,Fr.isWsUrl)(t))throw new Error(`Provided URL is not compatible with WebSocket connection: ${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,Fr.isReactNative)()?{headers:{origin:n}}:{rejectUnauthorized:!(0,Fr.isLocalhostUrl)(t)},o=new Gr(t,[],s);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?(0,Lr.D)(t.data):t.data;this.events.emit("payload",e)}onError(t,e){const r=this.parseError(e),i=r.message||r.toString(),n=(0,Fr.formatJsonRpcError)(t,i);this.events.emit("payload",n)}parseError(t,e=this.url){return(0,Fr.CX)(t,Wr(e),"WS")}resetMaxListeners(){this.events.getMaxListeners()>10&&this.events.setMaxListeners(10)}emitError(t){const e=this.parseError(new Error(t?.message||`WebSocket connection failed for host: ${Wr(this.url)}`));return this.events.emit("register_error",e),e}}var Yr=r(72307),Xr=r.n(Yr);var Zr=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 l(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 l=0,f=s-1;(0!==u||l<n)&&-1!==f;f--,l++)u+=a*o[f]>>>0,o[f]=u%256>>>0,u=u/256>>>0;if(0!==u)throw new Error("Non-zero carry");n=l,e++}if(" "!==t[e]){for(var p=s-n;p!==s&&0===o[p];)p++;for(var d=new Uint8Array(i+(s-p)),g=i;p!==s;)d[g++]=o[p++];return d}}}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 l=e[n],f=0,p=o-1;(0!==l||f<i)&&-1!==p;p--,f++)l+=256*h[p]>>>0,h[p]=l%a>>>0,l=l/a>>>0;if(0!==l)throw new Error("Non-zero carry");i=f,n++}for(var d=o-i;d!==o&&0===h[d];)d++;for(var g=c.repeat(r);d<o;++d)g+=t.charAt(h[d]);return g},decodeUnsafe:l,decode:function(t){var r=l(t);if(r)return r;throw new Error(`Non-${e} character`)}}},Qr=Zr;const ti=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 ei{constructor(t,e,r){this.name=t,this.prefix=e,this.baseEncode=r}encode(t){if(t instanceof Uint8Array)return`${this.prefix}${this.baseEncode(t)}`;throw Error("Unknown type, must be binary type")}}class ri{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 ${JSON.stringify(t)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(t.slice(this.prefix.length))}throw Error("Can only multibase decode strings")}or(t){return ni(this,t)}}class ii{constructor(t){this.decoders=t}or(t){return ni(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 ${JSON.stringify(t)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const ni=(t,e)=>new ii({...t.decoders||{[t.prefix]:t},...e.decoders||{[e.prefix]:e}});class si{constructor(t,e,r,i){this.name=t,this.prefix=e,this.baseEncode=r,this.baseDecode=i,this.encoder=new ei(t,e,r),this.decoder=new ri(t,e,i)}encode(t){return this.encoder.encode(t)}decode(t){return this.decoder.decode(t)}}const oi=({name:t,prefix:e,encode:r,decode:i})=>new si(t,e,r,i),ai=({prefix:t,name:e,alphabet:r})=>{const{encode:i,decode:n}=Qr(r,e);return oi({prefix:t,name:e,encode:i,decode:t=>ti(n(t))})},ci=({name:t,prefix:e,bitsPerChar:r,alphabet:i})=>oi({prefix:e,name:t,encode:t=>((t,e,r)=>{const i="="===e[e.length-1],n=(1<<r)-1;let s="",o=0,a=0;for(let i=0;i<t.length;++i)for(a=a<<8|t[i],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,i,r),decode:e=>((t,e,r,i)=>{const n={};for(let t=0;t<e.length;++t)n[e[t]]=t;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 e=0;e<s;++e){const s=n[t[e]];if(void 0===s)throw new SyntaxError(`Non-${i} character`);c=c<<r|s,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})(e,i,r,t)}),hi=oi({prefix:"\0",name:"identity",encode:t=>(t=>(new TextDecoder).decode(t))(t),decode:t=>(t=>(new TextEncoder).encode(t))(t)});var ui=Object.freeze({__proto__:null,identity:hi});const li=ci({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var fi=Object.freeze({__proto__:null,base2:li});const pi=ci({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var di=Object.freeze({__proto__:null,base8:pi});const gi=ai({prefix:"9",name:"base10",alphabet:"0123456789"});var yi=Object.freeze({__proto__:null,base10:gi});const vi=ci({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),_i=ci({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var mi=Object.freeze({__proto__:null,base16:vi,base16upper:_i});const bi=ci({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),wi=ci({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),Ei=ci({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),Si=ci({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),Ii=ci({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),Pi=ci({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),Oi=ci({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),Ai=ci({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),Ni=ci({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var Ri=Object.freeze({__proto__:null,base32:bi,base32upper:wi,base32pad:Ei,base32padupper:Si,base32hex:Ii,base32hexupper:Pi,base32hexpad:Oi,base32hexpadupper:Ai,base32z:Ni});const xi=ai({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),Ci=ai({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var Ti=Object.freeze({__proto__:null,base36:xi,base36upper:Ci});const Ui=ai({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),ji=ai({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var Li=Object.freeze({__proto__:null,base58btc:Ui,base58flickr:ji});const Mi=ci({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),Di=ci({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),ki=ci({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),zi=ci({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var $i=Object.freeze({__proto__:null,base64:Mi,base64pad:Di,base64url:ki,base64urlpad:zi});const qi=Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"),Hi=qi.reduce(((t,e,r)=>(t[r]=e,t)),[]),Vi=qi.reduce(((t,e,r)=>(t[e.codePointAt(0)]=r,t)),[]);const Ki=oi({prefix:"🚀",name:"base256emoji",encode:function(t){return t.reduce(((t,e)=>t+=Hi[e]),"")},decode:function(t){const e=[];for(const r of t){const t=Vi[r.codePointAt(0)];if(void 0===t)throw new Error(`Non-base256emoji character: ${r}`);e.push(t)}return new Uint8Array(e)}});var Bi=Object.freeze({__proto__:null,base256emoji:Ki}),Fi=function t(e,r,i){r=r||[];for(var n=i=i||0;e>=Wi;)r[i++]=255&e|128,e/=128;for(;-128&e;)r[i++]=255&e|128,e>>>=7;return r[i]=0|e,t.bytes=i-n+1,r},Wi=Math.pow(2,31);var Gi=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?(127&i)<<s:(127&i)*Math.pow(2,s),s+=7}while(i>=128);return t.bytes=o-r,n};var Ji=Math.pow(2,7),Yi=Math.pow(2,14),Xi=Math.pow(2,21),Zi=Math.pow(2,28),Qi=Math.pow(2,35),tn=Math.pow(2,42),en=Math.pow(2,49),rn=Math.pow(2,56),nn=Math.pow(2,63),sn={encode:Fi,decode:Gi,encodingLength:function(t){return t<Ji?1:t<Yi?2:t<Xi?3:t<Zi?4:t<Qi?5:t<tn?6:t<en?7:t<rn?8:t<nn?9:10}};const on=(t,e,r=0)=>(sn.encode(t,e,r),e),an=t=>sn.encodingLength(t),cn=(t,e)=>{const r=e.byteLength,i=an(t),n=i+an(r),s=new Uint8Array(n+r);return on(t,s,0),on(r,s,i),s.set(e,n),new hn(t,r,e,s)};class hn{constructor(t,e,r,i){this.code=t,this.size=e,this.digest=r,this.bytes=i}}const un=({name:t,code:e,encode:r})=>new ln(t,e,r);class ln{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?cn(this.code,e):e.then((t=>cn(this.code,t)))}throw Error("Unknown type, must be binary type")}}const fn=t=>async e=>new Uint8Array(await crypto.subtle.digest(t,e)),pn=un({name:"sha2-256",code:18,encode:fn("SHA-256")}),dn=un({name:"sha2-512",code:19,encode:fn("SHA-512")});Object.freeze({__proto__:null,sha256:pn,sha512:dn});const gn=ti,yn={code:0,name:"identity",encode:gn,digest:t=>cn(0,gn(t))};Object.freeze({__proto__:null,identity:yn});new TextEncoder,new TextDecoder;const vn={...ui,...fi,...di,...yi,...mi,...Ri,...Ti,...Li,...$i,...Bi};function _n(t){return null!=globalThis.Buffer?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):t}function mn(t,e,r,i){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:r},decoder:{decode:i}}}const bn=mn("utf8","u",(t=>"u"+new TextDecoder("utf8").decode(t)),(t=>(new TextEncoder).encode(t.substring(1)))),wn=mn("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(t=0){return null!=globalThis.Buffer&&null!=globalThis.Buffer.allocUnsafe?_n(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})),En={utf8:bn,"utf-8":bn,hex:vn.base16,latin1:wn,ascii:wn,binary:wn,...vn};const Sn="core",In="wc@2:core:",Pn="error",On={database:":memory:"},An="client_ed25519_seed",Nn=Qt.ONE_DAY,Rn=Qt.SIX_HOURS,xn="wss://relay.walletconnect.com",Cn="relayer_message",Tn="relayer_message_ack",Un="relayer_connect",jn="relayer_disconnect",Ln="relayer_error",Mn="relayer_connection_stalled",Dn="relayer_transport_closed",kn="relayer_publish",zn="payload",$n="connect",qn="disconnect",Hn="error",Vn=Qt.ONE_SECOND/2,Kn="subscription_created",Bn="subscription_deleted",Fn="subscription_sync",Wn="subscription_resubscribed",Gn=1e3*Qt.FIVE_SECONDS,Jn={wc_pairingDelete:{req:{ttl:Qt.ONE_DAY,prompt:!1,tag:1e3},res:{ttl:Qt.ONE_DAY,prompt:!1,tag:1001}},wc_pairingPing:{req:{ttl:Qt.THIRTY_SECONDS,prompt:!1,tag:1002},res:{ttl:Qt.THIRTY_SECONDS,prompt:!1,tag:1003}},unregistered_method:{req:{ttl:Qt.ONE_DAY,prompt:!1,tag:0},res:{ttl:Qt.ONE_DAY,prompt:!1,tag:0}}},Yn="history_created",Xn="history_updated",Zn="history_deleted",Qn="history_sync",ts="expirer_created",es="expirer_deleted",rs="expirer_expired",is="expirer_sync",ns="verify-api",ss="https://verify.walletconnect.com";class os{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=In,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}=sr("NO_MATCHING_KEY",`${this.name}: ${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=(0,Ar.generateChildLogger)(e,this.name)}get context(){return(0,Ar.getLoggerContext)(this.logger)}get storageKey(){return this.storagePrefix+this.version+"//"+this.name}async setKeyChain(t){await this.core.storage.setItem(this.storageKey,je(t))}async getKeyChain(){const t=await this.core.storage.getItem(this.storageKey);return typeof t<"u"?Le(t):void 0}async persist(){await this.setKeyChain(this.keychain)}isInitialized(){if(!this.initialized){const{message:t}=sr("NOT_INITIALIZED",this.name);throw new Error(t)}}}class as{constructor(t,e,r){this.core=t,this.logger=e,this.name="crypto",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 Hr(Vr(await this.getClientSeed()).publicKey)},this.generateKeyPair=()=>{this.isInitialized();const t=function(){const t=S.Au();return{privateKey:Xt(t.secretKey,oe),publicKey:Xt(t.publicKey,oe)}}();return this.setPrivateKey(t.publicKey,t.privateKey)},this.signJWT=async t=>{this.isInitialized();const e=Vr(await this.getClientSeed()),r=he(),i=Nn;return await Kr(r,t,i,e)},this.generateSharedKey=(t,e,r)=>{this.isInitialized();const i=function(t,e){const r=S.gi(Yt(t,oe),Yt(e,oe));return Xt(new b.t(E.mE,r).expand(32),oe)}(this.getPrivateKey(t),e);return this.setSymKey(i,r)},this.setSymKey=async(t,e)=>{this.isInitialized();const r=e||function(t){return Xt((0,E.vp)(Yt(t,oe)),oe)}(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=de(r),n=(0,Lr.u)(e);if(ge(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 fe({type:o,symKey:s,message:n,senderPublicKey:a})},this.decode=async(t,e,r)=>{this.isInitialized();const i=function(t,e){const r=pe(t);return de({type:le(r.type),senderPublicKey:typeof r.senderPublicKey<"u"?Xt(r.senderPublicKey,oe):void 0,receiverPublicKey:e?.receiverPublicKey})}(e,r);if(ge(i)){const e=i.receiverPublicKey,r=i.senderPublicKey;t=await this.generateSharedKey(e,r)}const n=function(t){const e=new m.OK(Yt(t.symKey,oe)),{sealed:r,iv:i}=pe(t.encoded),n=e.open(i,r);if(null===n)throw new Error("Failed to decrypt");return Xt(n,ce)}({symKey:this.getSymKey(t),encoded:e});return(0,Lr.D)(n)},this.getPayloadType=t=>le(pe(t).type),this.getPayloadSenderPublicKey=t=>{const e=pe(t);return e.senderPublicKey?Xt(e.senderPublicKey,oe):void 0},this.core=t,this.logger=(0,Ar.generateChildLogger)(e,this.name),this.keychain=r||new os(this.core,this.logger)}get context(){return(0,Ar.getLoggerContext)(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(An)}catch{t=he(),await this.keychain.set(An,t)}return function(t,e="utf8"){const r=En[e];if(!r)throw new Error(`Unsupported encoding "${e}"`);return"utf8"!==e&&"utf-8"!==e||null==globalThis.Buffer||null==globalThis.Buffer.from?r.decoder.decode(`${r.prefix}${t}`):_n(globalThis.Buffer.from(t,"utf-8"))}(t,"base16")}getSymKey(t){return this.keychain.get(t)}isInitialized(){if(!this.initialized){const{message:t}=sr("NOT_INITIALIZED",this.name);throw new Error(t)}}}class cs extends class{constructor(t,e){this.logger=t,this.core=e}}{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=In,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 ${this.name}`),this.logger.trace({type:"method",method:"restore",size:this.messages.size})}catch(t){this.logger.debug(`Failed to Restore records for ${this.name}`),this.logger.error(t)}finally{this.initialized=!0}}},this.set=async(t,e)=>{this.isInitialized();const r=ue(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)[ue(e)]<"u"},this.del=async t=>{this.isInitialized(),this.messages.delete(t),await this.persist()},this.logger=(0,Ar.generateChildLogger)(t,this.name),this.core=e}get context(){return(0,Ar.getLoggerContext)(this.logger)}get storageKey(){return this.storagePrefix+this.version+"//"+this.name}async setRelayerMessages(t){await this.core.storage.setItem(this.storageKey,je(t))}async getRelayerMessages(){const t=await this.core.storage.getItem(this.storageKey);return typeof t<"u"?Le(t):void 0}async persist(){await this.setRelayerMessages(this.messages)}isInitialized(){if(!this.initialized){const{message:t}=sr("NOT_INITIALIZED",this.name);throw new Error(t)}}}class hs extends Cr{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=1e4,this.publish=async(t,e,r)=>{this.logger.debug("Publishing Payload"),this.logger.trace({type:"method",method:"publish",params:{topic:t,message:e,opts:r}});try{const i=r?.ttl||Rn,n=Ke(r),s=r?.prompt||!1,o=r?.tag||0,a=r?.id||(0,Fr.getBigIntRpcId)().toString(),c={topic:t,message:e,opts:{ttl:i,relay:n,prompt:s,tag:o,id:a}};this.queue.set(a,c);try{await await De(this.rpcPublish(t,e,i,n,s,o,a),this.publishTimeout),this.relayer.events.emit(kn,c)}catch{return this.logger.debug("Publishing Payload stalled"),void this.relayer.events.emit(Mn)}this.logger.debug("Successfully Published Payload"),this.logger.trace({type:"method",method:"publish",params:{topic:t,message:e,opts:r}})}catch(t){throw this.logger.debug("Failed to Publish Payload"),this.logger.error(t),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.relayer=t,this.logger=(0,Ar.generateChildLogger)(e,this.name),this.registerEventListeners()}get context(){return(0,Ar.getLoggerContext)(this.logger)}rpcPublish(t,e,r,i,n,s,o){var a,c,h,u;const l={method:Be(i.protocol).publish,params:{topic:t,message:e,ttl:r,prompt:n,tag:s},id:o};return hr(null==(a=l.params)?void 0:a.prompt)&&(null==(c=l.params)||delete c.prompt),hr(null==(h=l.params)?void 0:h.tag)&&(null==(u=l.params)||delete u.tag),this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"message",direction:"outgoing",request:l}),this.relayer.request(l)}onPublish(t){this.queue.delete(t)}checkQueue(){this.queue.forEach((async t=>{const{topic:e,message:r,opts:i}=t;await this.publish(e,r,i)}))}registerEventListeners(){this.relayer.core.heartbeat.on(Or.HEARTBEAT_EVENTS.pulse,(()=>{this.checkQueue()})),this.relayer.on(Tn,(t=>{this.onPublish(t.id.toString())}))}}class us{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 ls=Object.defineProperty,fs=Object.defineProperties,ps=Object.getOwnPropertyDescriptors,ds=Object.getOwnPropertySymbols,gs=Object.prototype.hasOwnProperty,ys=Object.prototype.propertyIsEnumerable,vs=(t,e,r)=>e in t?ls(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,_s=(t,e)=>{for(var r in e||(e={}))gs.call(e,r)&&vs(t,r,e[r]);if(ds)for(var r of ds(e))ys.call(e,r)&&vs(t,r,e[r]);return t},ms=(t,e)=>fs(t,ps(e));class bs extends Ur{constructor(t,e){super(t,e),this.relayer=t,this.logger=e,this.subscriptions=new Map,this.topicMap=new us,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=In,this.subscribeTimeout=1e4,this.restartInProgress=!1,this.batchSubscribeTopicsLimit=500,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restart(),this.registerEventListeners(),this.onEnable(),this.clientId=await this.relayer.core.crypto.getClientId())},this.subscribe=async(t,e)=>{await this.restartToComplete(),this.isInitialized(),this.logger.debug("Subscribing Topic"),this.logger.trace({type:"method",method:"subscribe",params:{topic:t,opts:e}});try{const r=Ke(e),i={topic:t,relay:r};this.pending.set(t,i);const n=await this.rpcSubscribe(t,r);return this.onSubscribe(n,i),this.logger.debug("Successfully Subscribed Topic"),this.logger.trace({type:"method",method:"subscribe",params:{topic:t,opts:e}}),n}catch(t){throw this.logger.debug("Failed to Subscribe Topic"),this.logger.error(t),t}},this.unsubscribe=async(t,e)=>{await this.restartToComplete(),this.isInitialized(),typeof e?.id<"u"?await this.unsubscribeById(t,e.id,e):await this.unsubscribeByTopic(t,e)},this.isSubscribed=async t=>!!this.topics.includes(t)||await new Promise(((e,r)=>{const i=new Qt.Watch;i.start(this.pendingSubscriptionWatchLabel);const n=setInterval((()=>{!this.pending.has(t)&&this.topics.includes(t)&&(clearInterval(n),i.stop(this.pendingSubscriptionWatchLabel),e(!0)),i.elapsed(this.pendingSubscriptionWatchLabel)>=Gn&&(clearInterval(n),i.stop(this.pendingSubscriptionWatchLabel),r(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.restart=async()=>{this.restartInProgress=!0,await this.restore(),await this.reset(),this.restartInProgress=!1},this.relayer=t,this.logger=(0,Ar.generateChildLogger)(e,this.name),this.clientId=""}get context(){return(0,Ar.getLoggerContext)(this.logger)}get storageKey(){return this.storagePrefix+this.version+"//"+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{}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,id:e,opts:r}});try{const i=Ke(r);await this.rpcUnsubscribe(t,e,i);const n=or("USER_DISCONNECTED",`${this.name}, ${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(t){throw this.logger.debug("Failed to Unsubscribe Topic"),this.logger.error(t),t}}async rpcSubscribe(t,e){const r={method:Be(e.protocol).subscribe,params:{topic:t}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:r});try{await await De(this.relayer.request(r),this.subscribeTimeout)}catch{this.logger.debug("Outgoing Relay Subscribe Payload stalled"),this.relayer.events.emit(Mn)}return ue(t+this.clientId)}async rpcBatchSubscribe(t){if(!t.length)return;const e={method:Be(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 De(this.relayer.request(e),this.subscribeTimeout)}catch{this.logger.debug("Outgoing Relay Payload stalled"),this.relayer.events.emit(Mn)}}rpcUnsubscribe(t,e,r){const i={method:Be(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,ms(_s({},e),{id:t})),this.pending.delete(e.topic)}onBatchSubscribe(t){t.length&&t.forEach((t=>{this.setSubscription(t.id,_s({},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.subscriptions.has(t)||(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,_s({},e)),this.topicMap.set(e.topic,t),this.events.emit(Kn,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}=sr("NO_MATCHING_KEY",`${this.name}: ${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(Bn,ms(_s({},r),{reason:e}))}async persist(){await this.setRelayerSubscriptions(this.values),this.events.emit(Fn)}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.batchSubscribe(t)}}this.events.emit(Wn)}async restore(){try{const t=await this.getRelayerSubscriptions();if(typeof t>"u"||!t.length)return;if(this.subscriptions.size){const{message:t}=sr("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(t),this.logger.error(`${this.name}: ${JSON.stringify(this.values)}`),new Error(t)}this.cached=t,this.logger.debug(`Successfully Restored subscriptions for ${this.name}`),this.logger.trace({type:"method",method:"restore",subscriptions:this.values})}catch(t){this.logger.debug(`Failed to Restore subscriptions for ${this.name}`),this.logger.error(t)}}async batchSubscribe(t){if(!t.length)return;const e=await this.rpcBatchSubscribe(t);ar(e)&&this.onBatchSubscribe(e.map(((e,r)=>ms(_s({},t[r]),{id:e}))))}async onConnect(){this.restartInProgress||(await this.restart(),this.onEnable())}onDisconnect(){this.onDisable()}async checkPending(){if(this.relayer.transportExplicitlyClosed)return;const t=[];this.pending.forEach((e=>{t.push(e)})),await this.batchSubscribe(t)}registerEventListeners(){this.relayer.core.heartbeat.on(Or.HEARTBEAT_EVENTS.pulse,(async()=>{await this.checkPending()})),this.relayer.on(Un,(async()=>{await this.onConnect()})),this.relayer.on(jn,(()=>{this.onDisconnect()})),this.events.on(Kn,(async t=>{const e=Kn;this.logger.info(`Emitting ${e}`),this.logger.debug({type:"event",event:e,data:t}),await this.persist()})),this.events.on(Bn,(async t=>{const e=Bn;this.logger.info(`Emitting ${e}`),this.logger.debug({type:"event",event:e,data:t}),await this.persist()}))}isInitialized(){if(!this.initialized){const{message:t}=sr("NOT_INITIALIZED",this.name);throw new Error(t)}}async restartToComplete(){this.restartInProgress&&await new Promise((t=>{const e=setInterval((()=>{this.restartInProgress||(clearInterval(e),t())}),this.pollingInterval)}))}}var ws=Object.defineProperty,Es=Object.getOwnPropertySymbols,Ss=Object.prototype.hasOwnProperty,Is=Object.prototype.propertyIsEnumerable,Ps=(t,e,r)=>e in t?ws(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;class Os extends Tr{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.reconnecting=!1,this.connectionStatusPollingInterval=20,this.staleConnectionErrors=["socket hang up","socket stalled"],this.request=async t=>{this.logger.debug("Publishing Request Payload");try{return await this.toEstablishConnection(),await this.provider.request(t)}catch(t){throw this.logger.debug("Failed to Publish Request"),this.logger.error(t),t}},this.core=t.core,this.logger=typeof t.logger<"u"&&"string"!=typeof t.logger?(0,Ar.generateChildLogger)(t.logger,this.name):(0,Ar.pino)((0,Ar.getDefaultLoggerOptions)({level:t.logger||"error"})),this.messages=new cs(this.logger,t.core),this.subscriber=new bs(this,this.logger),this.publisher=new hs(this,this.logger),this.relayUrl=t?.relayUrl||xn,this.projectId=t.projectId,this.provider={}}async init(){this.logger.trace("Initialized"),await this.createProvider(),await Promise.all([this.messages.init(),this.transportOpen(),this.subscriber.init()]),this.registerEventListeners(),this.initialized=!0,setTimeout((async()=>{0===this.subscriber.topics.length&&(this.logger.info("No topics subscribted to after init, closing transport"),await this.transportClose(),this.transportExplicitlyClosed=!1)}),1e4)}get context(){return(0,Ar.getLoggerContext)(this.logger)}get connected(){return this.provider.connection.connected}get connecting(){return this.provider.connection.connecting}async publish(t,e,r){this.isInitialized(),await this.publisher.publish(t,e,r),await this.recordMessageEvent({topic:t,message:e,publishedAt:Date.now()})}async subscribe(t,e){var r;this.isInitialized();let i=(null==(r=this.subscriber.topicMap.get(t))?void 0:r[0])||"";return i||(await Promise.all([new Promise((e=>{this.subscriber.once(Kn,(r=>{r.topic===t&&e()}))})),new Promise((async r=>{i=await this.subscriber.subscribe(t,e),r()}))]),i)}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 transportClose(){this.transportExplicitlyClosed=!0,this.connected&&(await this.provider.disconnect(),this.events.emit(Dn))}async transportOpen(t){if(this.transportExplicitlyClosed=!1,!this.reconnecting){this.relayUrl=t||this.relayUrl,this.reconnecting=!0;try{await Promise.all([new Promise((t=>{this.initialized||t(),this.subscriber.once(Wn,(()=>{t()}))})),await Promise.race([new Promise((async(t,e)=>{await De(this.provider.connect(),5e3,"socket stalled").catch((t=>e(t))).then((()=>t())).finally((()=>this.removeListener(Dn,this.rejectTransportOpen)))})),new Promise((t=>this.once(Dn,this.rejectTransportOpen)))])])}catch(t){this.logger.error(t);const e=t;if(!this.isConnectionStalled(e.message))throw t;this.events.emit(Dn)}finally{this.reconnecting=!1}}}async restartTransport(t){this.transportExplicitlyClosed||this.reconnecting||(this.relayUrl=t||this.relayUrl,this.connected&&await Promise.all([new Promise((t=>{this.provider.once(qn,(()=>{t()}))})),this.transportClose()]),await this.createProvider(),await this.transportOpen())}isConnectionStalled(t){return this.staleConnectionErrors.some((e=>t.includes(e)))}rejectTransportOpen(){throw new Error("closeTransport called before connection was established")}async createProvider(){const t=await this.core.crypto.signJWT(this.relayUrl);this.provider=new Br.r(new Jr(Te({sdkVersion:"2.8.1",protocol:this.protocol,version:this.version,relayUrl:this.relayUrl,projectId:this.projectId,auth:t,useOnCloseEvent:!0}))),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;return!await this.subscriber.isSubscribed(e)||this.messages.has(e,r)}async onProviderPayload(t){if(this.logger.debug("Incoming Relay Payload"),this.logger.trace({type:"payload",direction:"incoming",payload:t}),(0,Fr.isJsonRpcRequest)(t)){if(!t.method.endsWith("_subscription"))return;const e=t.params,{topic:r,message:i,publishedAt:n}=e.data,s={topic:r,message:i,publishedAt:n};this.logger.debug("Emitting Relayer Payload"),this.logger.trace(((t,e)=>{for(var r in e||(e={}))Ss.call(e,r)&&Ps(t,r,e[r]);if(Es)for(var r of Es(e))Is.call(e,r)&&Ps(t,r,e[r]);return t})({type:"event",event:e.id},s)),this.events.emit(e.id,s),await this.acknowledgePayload(t),await this.onMessageEvent(s)}else(0,Fr.isJsonRpcResponse)(t)&&this.events.emit(Tn,t)}async onMessageEvent(t){await this.shouldIgnoreMessageEvent(t)||(this.events.emit(Cn,t),await this.recordMessageEvent(t))}async acknowledgePayload(t){const e=(0,Fr.formatJsonRpcResult)(t.id,!0);await this.provider.connection.send(e)}registerProviderListeners(){this.provider.on(zn,(t=>this.onProviderPayload(t))),this.provider.on($n,(()=>{this.events.emit(Un)})),this.provider.on(qn,(()=>{this.onProviderDisconnect()})),this.provider.on(Hn,(t=>{this.logger.error(t),this.events.emit(Ln,t)}))}registerEventListeners(){this.events.on(Mn,(async()=>{await this.restartTransport()}))}onProviderDisconnect(){this.events.emit(jn),this.attemptToReconnect()}attemptToReconnect(){this.transportExplicitlyClosed||setTimeout((async()=>{await this.restartTransport()}),(0,Qt.toMiliseconds)(Vn))}isInitialized(){if(!this.initialized){const{message:t}=sr("NOT_INITIALIZED",this.name);throw new Error(t)}}async toEstablishConnection(){if(!this.connected){if(this.connecting)return await new Promise((t=>{const e=setInterval((()=>{this.connected&&(clearInterval(e),t())}),this.connectionStatusPollingInterval)}));await this.restartTransport()}}}var As=Object.defineProperty,Ns=Object.getOwnPropertySymbols,Rs=Object.prototype.hasOwnProperty,xs=Object.prototype.propertyIsEnumerable,Cs=(t,e,r)=>e in t?As(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Ts=(t,e)=>{for(var r in e||(e={}))Rs.call(e,r)&&Cs(t,r,e[r]);if(Ns)for(var r of Ns(e))xs.call(e,r)&&Cs(t,r,e[r]);return t};class Us extends class{constructor(t,e,r,i){this.core=t,this.logger=e,this.name=r}}{constructor(t,e,r,i=In,n){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=In,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach((t=>{this.getKey&&null!==t&&!hr(t)?this.map.set(this.getKey(t),t):function(t){var e;return null==(e=t?.proposer)?void 0:e.publicKey}(t)?this.map.set(t.id,t):function(t){return 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=>Xr()(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=Ts(Ts({},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),await this.persist())},this.logger=(0,Ar.generateChildLogger)(e,this.name),this.storagePrefix=i,this.getKey=n}get context(){return(0,Ar.getLoggerContext)(this.logger)}get storageKey(){return this.storagePrefix+this.version+"//"+this.name}get length(){return this.map.size}get keys(){return Array.from(this.map.keys())}get values(){return Array.from(this.map.values())}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){const{message:e}=sr("NO_MATCHING_KEY",`${this.name}: ${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}=sr("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(t),new Error(t)}this.cached=t,this.logger.debug(`Successfully Restored value for ${this.name}`),this.logger.trace({type:"method",method:"restore",value:this.values})}catch(t){this.logger.debug(`Failed to Restore value for ${this.name}`),this.logger.error(t)}}isInitialized(){if(!this.initialized){const{message:t}=sr("NOT_INITIALIZED",this.name);throw new Error(t)}}}class js{constructor(t,e){this.core=t,this.logger=e,this.name="pairing",this.version="0.3",this.events=new(_()),this.initialized=!1,this.storagePrefix=In,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=({methods:t})=>{this.isInitialized(),this.registeredMethods=[...new Set([...this.registeredMethods,...t])]},this.create=async()=>{this.isInitialized();const t=he(),e=await this.core.crypto.setSymKey(t),r=$e(Qt.FIVE_MINUTES),i={protocol:"irn"},n={topic:e,expiry:r,relay:i,active:!1},s=Qe({protocol:this.core.protocol,version:this.core.version,topic:e,symKey:t,relay:i});return await this.pairings.set(e,n),await this.core.relayer.subscribe(e),this.core.expirer.set(e,r),{topic:e,uri:s}},this.pair=async t=>{this.isInitialized(),this.isValidPair(t);const{topic:e,symKey:r,relay:i}=function(t){const e=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=re.parse(s);return{protocol:i,topic:Ze(n[0]),version:parseInt(n[1],10),symKey:o.symKey,relay:Xe(o)}}(t.uri);if(this.pairings.keys.includes(e))throw new Error(`Pairing already exists: ${e}`);if(this.core.crypto.hasKeys(e))throw new Error(`Keychain already exists: ${e}`);const n=$e(Qt.FIVE_MINUTES),s={topic:e,relay:i,expiry:n,active:!1};return await this.pairings.set(e,s),await this.core.crypto.setSymKey(r,e),await this.core.relayer.subscribe(e,{relay:i}),this.core.expirer.set(e,n),t.activatePairing&&await this.activate({topic:e}),s},this.activate=async({topic:t})=>{this.isInitialized();const e=$e(Qt.THIRTY_DAYS);await this.pairings.update(t,{active:!0,expiry:e}),this.core.expirer.set(t,e)},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}=Me();this.events.once(He("pairing_ping",t),(({error:t})=>{t?n(t):i()})),await r()}},this.updateExpiry=async({topic:t,expiry:e})=>{this.isInitialized(),await this.pairings.update(t,{expiry:e})},this.updateMetadata=async({topic:t,metadata:e})=>{this.isInitialized(),await this.pairings.update(t,{peerMetadata:e})},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",or("USER_DISCONNECTED")),await this.deletePairing(e))},this.sendRequest=async(t,e,r)=>{const i=(0,Fr.formatJsonRpcRequest)(e,r),n=await this.core.crypto.encode(t,i),s=Jn[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=(0,Fr.formatJsonRpcResult)(t,r),n=await this.core.crypto.encode(e,i),s=await this.core.history.get(e,t),o=Jn[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=(0,Fr.formatJsonRpcError)(t,r),n=await this.core.crypto.encode(e,i),s=await this.core.history.get(e,t),o=Jn[s.request.method]?Jn[s.request.method].res:Jn.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,or("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=>qe(t.expiry)));await Promise.all(t.map((t=>this.deletePairing(t.topic))))},this.onRelayEventRequest=t=>{const{topic:e,payload:r}=t,i=r.method;if(this.pairings.keys.includes(e))switch(i){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;if(this.pairings.keys.includes(e)){if("wc_pairingPing"===i)return this.onPairingPingResponse(e,r);return 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("pairing_ping",{id:r,topic:t})}catch(e){await this.sendError(r,t,e),this.logger.error(e)}},this.onPairingPingResponse=(t,e)=>{const{id:r}=e;setTimeout((()=>{(0,Fr.isJsonRpcResult)(e)?this.events.emit(He("pairing_ping",r),{}):(0,Fr.isJsonRpcError)(e)&&this.events.emit(He("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("pairing_delete",{id:r,topic:t})}catch(e){await this.sendError(r,t,e),this.logger.error(e)}},this.onUnknownRpcMethodRequest=async(t,e)=>{const{id:r,method:i}=e;try{if(this.registeredMethods.includes(i))return;const e=or("WC_METHOD_UNSUPPORTED",i);await this.sendError(r,t,e),this.logger.error(e)}catch(e){await this.sendError(r,t,e),this.logger.error(e)}},this.onUnknownRpcMethodResponse=t=>{this.registeredMethods.includes(t)||this.logger.error(or("WC_METHOD_UNSUPPORTED",t))},this.isValidPair=t=>{if(!mr(t)){const{message:e}=sr("MISSING_OR_INVALID",`pair() params: ${t}`);throw new Error(e)}if(!function(t){if(ur(t,!1))try{return typeof new URL(t)<"u"}catch{return!1}return!1}(t.uri)){const{message:e}=sr("MISSING_OR_INVALID",`pair() uri: ${t.uri}`);throw new Error(e)}},this.isValidPing=async t=>{if(!mr(t)){const{message:e}=sr("MISSING_OR_INVALID",`ping() params: ${t}`);throw new Error(e)}const{topic:e}=t;await this.isValidPairingTopic(e)},this.isValidDisconnect=async t=>{if(!mr(t)){const{message:e}=sr("MISSING_OR_INVALID",`disconnect() params: ${t}`);throw new Error(e)}const{topic:e}=t;await this.isValidPairingTopic(e)},this.isValidPairingTopic=async t=>{if(!ur(t,!1)){const{message:e}=sr("MISSING_OR_INVALID",`pairing topic should be a string: ${t}`);throw new Error(e)}if(!this.pairings.keys.includes(t)){const{message:e}=sr("NO_MATCHING_KEY",`pairing topic doesn't exist: ${t}`);throw new Error(e)}if(qe(this.pairings.get(t).expiry)){await this.deletePairing(t);const{message:e}=sr("EXPIRED",`pairing topic: ${t}`);throw new Error(e)}},this.core=t,this.logger=(0,Ar.generateChildLogger)(e,this.name),this.pairings=new Us(this.core,this.logger,this.name,this.storagePrefix)}get context(){return(0,Ar.getLoggerContext)(this.logger)}isInitialized(){if(!this.initialized){const{message:t}=sr("NOT_INITIALIZED",this.name);throw new Error(t)}}registerRelayerEvents(){this.core.relayer.on(Cn,(async t=>{const{topic:e,message:r}=t;if(this.ignoredPayloadTypes.includes(this.core.crypto.getPayloadType(r)))return;const i=await this.core.crypto.decode(e,r);(0,Fr.isJsonRpcRequest)(i)?(this.core.history.set(e,i),this.onRelayEventRequest({topic:e,payload:i})):(0,Fr.isJsonRpcResponse)(i)&&(await this.core.history.resolve(i),this.onRelayEventResponse({topic:e,payload:i}))}))}registerExpirerEvents(){this.core.expirer.on(rs,(async t=>{const{topic:e}=ze(t.target);e&&this.pairings.keys.includes(e)&&(await this.deletePairing(e,!0),this.events.emit("pairing_expire",{topic:e}))}))}}class Ls extends xr{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=In,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),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};this.records.set(i.id,i),this.events.emit(Yn,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=(0,Fr.isJsonRpcError)(t)?{error:t.error}:{result:t.result},this.records.set(e.id,e),this.events.emit(Xn,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(Zn,r)}}))},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=(0,Ar.generateChildLogger)(e,this.name)}get context(){return(0,Ar.getLoggerContext)(this.logger)}get storageKey(){return this.storagePrefix+this.version+"//"+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:(0,Fr.formatJsonRpcRequest)(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}=sr("NO_MATCHING_KEY",`${this.name}: ${t}`);throw new Error(e)}return e}async persist(){await this.setJsonRpcRecords(this.values),this.events.emit(Qn)}async restore(){try{const t=await this.getJsonRpcRecords();if(typeof t>"u"||!t.length)return;if(this.records.size){const{message:t}=sr("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(t),new Error(t)}this.cached=t,this.logger.debug(`Successfully Restored records for ${this.name}`),this.logger.trace({type:"method",method:"restore",records:this.values})}catch(t){this.logger.debug(`Failed to Restore records for ${this.name}`),this.logger.error(t)}}registerEventListeners(){this.events.on(Yn,(t=>{const e=Yn;this.logger.info(`Emitting ${e}`),this.logger.debug({type:"event",event:e,record:t}),this.persist()})),this.events.on(Xn,(t=>{const e=Xn;this.logger.info(`Emitting ${e}`),this.logger.debug({type:"event",event:e,record:t}),this.persist()})),this.events.on(Zn,(t=>{const e=Zn;this.logger.info(`Emitting ${e}`),this.logger.debug({type:"event",event:e,record:t}),this.persist()}))}isInitialized(){if(!this.initialized){const{message:t}=sr("NOT_INITIALIZED",this.name);throw new Error(t)}}}class Ms extends jr{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=In,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),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{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(ts,{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(es,{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=(0,Ar.generateChildLogger)(e,this.name)}get context(){return(0,Ar.getLoggerContext)(this.logger)}get storageKey(){return this.storagePrefix+this.version+"//"+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 ke("topic",t)}(t);if("number"==typeof t)return function(t){return ke("id",t)}(t);const{message:e}=sr("UNKNOWN_TYPE","Target type: "+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(is)}async restore(){try{const t=await this.getExpirations();if(typeof t>"u"||!t.length)return;if(this.expirations.size){const{message:t}=sr("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(t),new Error(t)}this.cached=t,this.logger.debug(`Successfully Restored expirations for ${this.name}`),this.logger.trace({type:"method",method:"restore",expirations:this.values})}catch(t){this.logger.debug(`Failed to Restore expirations for ${this.name}`),this.logger.error(t)}}getExpiration(t){const e=this.expirations.get(t);if(!e){const{message:e}=sr("NO_MATCHING_KEY",`${this.name}: ${t}`);throw this.logger.error(e),new Error(e)}return e}checkExpiry(t,e){const{expiry:r}=e;(0,Qt.toMiliseconds)(r)-Date.now()<=0&&this.expire(t,e)}expire(t,e){this.expirations.delete(t),this.events.emit(rs,{target:t,expiration:e})}checkExpirations(){this.core.relayer.connected&&this.expirations.forEach(((t,e)=>this.checkExpiry(e,t)))}registerEventListeners(){this.core.heartbeat.on(Or.HEARTBEAT_EVENTS.pulse,(()=>this.checkExpirations())),this.events.on(ts,(t=>{const e=ts;this.logger.info(`Emitting ${e}`),this.logger.debug({type:"event",event:e,data:t}),this.persist()})),this.events.on(rs,(t=>{const e=rs;this.logger.info(`Emitting ${e}`),this.logger.debug({type:"event",event:e,data:t}),this.persist()})),this.events.on(es,(t=>{const e=es;this.logger.info(`Emitting ${e}`),this.logger.debug({type:"event",event:e,data:t}),this.persist()}))}isInitialized(){if(!this.initialized){const{message:t}=sr("NOT_INITIALIZED",this.name);throw new Error(t)}}}class Ds extends class{constructor(t,e){this.projectId=t,this.logger=e}}{constructor(t,e){super(t,e),this.projectId=t,this.logger=e,this.name=ns,this.initialized=!1,this.init=async t=>{Ne()||!Re()||(this.verifyUrl=t?.verifyUrl||ss,await this.createIframe())},this.register=async t=>{var e;this.initialized||await this.init(),this.iframe&&(null==(e=this.iframe.contentWindow)||e.postMessage(t.attestationId,this.verifyUrl),this.logger.info(`postMessage sent: ${t.attestationId} ${this.verifyUrl}`))},this.resolve=async t=>{var e;if(this.isDevEnv)return"";this.logger.info(`resolving attestation: ${t.attestationId}`);const r=this.startAbortTimer(Qt.FIVE_SECONDS),i=await fetch(`${this.verifyUrl}/attestation/${t.attestationId}`,{signal:this.abortController.signal});return clearTimeout(r),200===i.status?null==(e=await i.json())?void 0:e.origin:""},this.createIframe=async()=>{try{await Promise.race([new Promise(((t,e)=>{if(document.getElementById(ns))return t();const r=document.createElement("iframe");r.setAttribute("id",ns),r.setAttribute("src",`${this.verifyUrl}/${this.projectId}`),r.style.display="none",r.addEventListener("load",(()=>{this.initialized=!0,t()})),r.addEventListener("error",(t=>{e(t)})),document.body.append(r),this.iframe=r})),new Promise((t=>{setTimeout((()=>t("iframe load timeout")),(0,Qt.toMiliseconds)(Qt.ONE_SECOND/2))}))])}catch(t){this.logger.error(`Verify iframe failed to load: ${this.verifyUrl}`),this.logger.error(t)}},this.logger=(0,Ar.generateChildLogger)(e,this.name),this.verifyUrl=ss,this.abortController=new AbortController,this.isDevEnv=Ae()&&process.env.IS_VITEST}get context(){return(0,Ar.getLoggerContext)(this.logger)}startAbortTimer(t){return setTimeout((()=>this.abortController.abort()),(0,Qt.toMiliseconds)(t))}}var ks=Object.defineProperty,zs=Object.getOwnPropertySymbols,$s=Object.prototype.hasOwnProperty,qs=Object.prototype.propertyIsEnumerable,Hs=(t,e,r)=>e in t?ks(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Vs=(t,e)=>{for(var r in e||(e={}))$s.call(e,r)&&Hs(t,r,e[r]);if(zs)for(var r of zs(e))qs.call(e,r)&&Hs(t,r,e[r]);return t};class Ks extends Rr{constructor(t){super(t),this.protocol="wc",this.version=2,this.name=Sn,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.projectId=t?.projectId,this.relayUrl=t?.relayUrl||xn;const e=typeof t?.logger<"u"&&"string"!=typeof t?.logger?t.logger:(0,Ar.pino)((0,Ar.getDefaultLoggerOptions)({level:t?.logger||Pn}));this.logger=(0,Ar.generateChildLogger)(e,this.name),this.heartbeat=new Or.HeartBeat,this.crypto=new as(this,this.logger,t?.keychain),this.history=new Ls(this,this.logger),this.expirer=new Ms(this,this.logger),this.storage=null!=t&&t.storage?t.storage:new Pr.ZP(Vs(Vs({},On),t?.storageOptions)),this.relayer=new Os({core:this,logger:this.logger,relayUrl:this.relayUrl,projectId:this.projectId}),this.pairing=new js(this,this.logger),this.verify=new Ds(this.projectId||"",this.logger)}static async init(t){const e=new Ks(t);await e.initialize();const r=await e.crypto.getClientId();return await e.storage.setItem("WALLETCONNECT_CLIENT_ID",r),e}get context(){return(0,Ar.getLoggerContext)(this.logger)}async start(){this.initialized||await this.initialize()}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.initialized=!0,this.logger.info("Core Initialization Success")}catch(t){throw this.logger.warn(`Core Initialization Failure at epoch ${Date.now()}`,t),this.logger.error(t.message),t}}}const Bs=Ks,Fs="client",Ws="wc@2:client:",Gs=Fs,Js="error",Ys="Proposal expired",Xs=Qt.SEVEN_DAYS,Zs={wc_sessionPropose:{req:{ttl:Qt.FIVE_MINUTES,prompt:!0,tag:1100},res:{ttl:Qt.FIVE_MINUTES,prompt:!1,tag:1101}},wc_sessionSettle:{req:{ttl:Qt.FIVE_MINUTES,prompt:!1,tag:1102},res:{ttl:Qt.FIVE_MINUTES,prompt:!1,tag:1103}},wc_sessionUpdate:{req:{ttl:Qt.ONE_DAY,prompt:!1,tag:1104},res:{ttl:Qt.ONE_DAY,prompt:!1,tag:1105}},wc_sessionExtend:{req:{ttl:Qt.ONE_DAY,prompt:!1,tag:1106},res:{ttl:Qt.ONE_DAY,prompt:!1,tag:1107}},wc_sessionRequest:{req:{ttl:Qt.FIVE_MINUTES,prompt:!0,tag:1108},res:{ttl:Qt.FIVE_MINUTES,prompt:!1,tag:1109}},wc_sessionEvent:{req:{ttl:Qt.FIVE_MINUTES,prompt:!0,tag:1110},res:{ttl:Qt.FIVE_MINUTES,prompt:!1,tag:1111}},wc_sessionDelete:{req:{ttl:Qt.ONE_DAY,prompt:!1,tag:1112},res:{ttl:Qt.ONE_DAY,prompt:!1,tag:1113}},wc_sessionPing:{req:{ttl:Qt.THIRTY_SECONDS,prompt:!1,tag:1114},res:{ttl:Qt.THIRTY_SECONDS,prompt:!1,tag:1115}}},Qs={min:Qt.FIVE_MINUTES,max:Qt.SEVEN_DAYS},to=["wc_sessionPropose","wc_sessionRequest","wc_authRequest"];var eo=Object.defineProperty,ro=Object.defineProperties,io=Object.getOwnPropertyDescriptors,no=Object.getOwnPropertySymbols,so=Object.prototype.hasOwnProperty,oo=Object.prototype.propertyIsEnumerable,ao=(t,e,r)=>e in t?eo(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,co=(t,e)=>{for(var r in e||(e={}))so.call(e,r)&&ao(t,r,e[r]);if(no)for(var r of no(e))oo.call(e,r)&&ao(t,r,e[r]);return t},ho=(t,e)=>ro(t,io(e));class uo extends class{constructor(t){this.client=t}}{constructor(t){super(t),this.name="engine",this.events=new(_()),this.initialized=!1,this.ignoredPayloadTypes=[1],this.init=async()=>{this.initialized||(await this.cleanup(),this.registerRelayerEvents(),this.registerExpirerEvents(),this.client.core.pairing.register({methods:Object.keys(Zs)}),this.initialized=!0)},this.connect=async t=>{this.isInitialized();const e=ho(co({},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;if(c&&(h=this.client.core.pairing.pairings.get(c).active),!c||!h){const{topic:t,uri:e}=await this.client.core.pairing.create();c=t,a=e}const u=await this.client.core.crypto.generateKeyPair(),l=co({requiredNamespaces:i,optionalNamespaces:n,relays:o??[{protocol:"irn"}],proposer:{publicKey:u,metadata:this.client.metadata}},s&&{sessionProperties:s}),{reject:f,resolve:p,done:d}=Me(Qt.FIVE_MINUTES,Ys);if(this.events.once(He("session_connect"),(async({error:t,session:e})=>{if(t)f(t);else if(e){e.self.publicKey=u;const t=ho(co({},e),{requiredNamespaces:e.requiredNamespaces,optionalNamespaces:e.optionalNamespaces});await this.client.session.set(e.topic,t),await this.setExpiry(e.topic,e.expiry),c&&await this.client.core.pairing.updateMetadata({topic:c,metadata:e.peer.metadata}),p(t)}})),!c){const{message:t}=sr("NO_MATCHING_KEY",`connect() pairing topic: ${c}`);throw new Error(t)}const g=await this.sendRequest(c,"wc_sessionPropose",l),y=$e(Qt.FIVE_MINUTES);return await this.setProposal(g,co({id:g,expiry:y},l)),{uri:a,approval:d}},this.pair=async t=>(this.isInitialized(),await this.client.core.pairing.pair(t)),this.approve=async t=>{this.isInitialized(),await this.isValidApprove(t);const{id:e,relayProtocol:r,namespaces:i,sessionProperties:n}=t,s=this.client.proposal.get(e);let{pairingTopic:o,proposer:a,requiredNamespaces:c,optionalNamespaces:h}=s;o=o||"",cr(c)||(c=function(t,e){const r=vr(t,e);if(r)throw new Error(r.message);const i={};for(const[e,r]of Object.entries(t))i[e]={methods:r.methods,events:r.events,chains:r.accounts.map((t=>`${t.split(":")[0]}:${t.split(":")[1]}`))};return i}(i,"approve()"));const u=await this.client.core.crypto.generateKeyPair(),l=a.publicKey,f=await this.client.core.crypto.generateSharedKey(u,l);o&&e&&(await this.client.core.pairing.updateMetadata({topic:o,metadata:a.metadata}),await this.sendResult(e,o,{relay:{protocol:r??"irn"},responderPublicKey:u}),await this.client.proposal.delete(e,or("USER_DISCONNECTED")),await this.client.core.pairing.activate({topic:o}));const p=co({relay:{protocol:r??"irn"},namespaces:i,requiredNamespaces:c,optionalNamespaces:h,pairingTopic:o,controller:{publicKey:u,metadata:this.client.metadata},expiry:$e(Xs)},n&&{sessionProperties:n});await this.client.core.relayer.subscribe(f),await this.sendRequest(f,"wc_sessionSettle",p);const d=ho(co({},p),{topic:f,pairingTopic:o,acknowledged:!1,self:p.controller,peer:{publicKey:a.publicKey,metadata:a.metadata},controller:u});return await this.client.session.set(f,d),await this.setExpiry(f,$e(Xs)),{topic:f,acknowledged:()=>new Promise((t=>setTimeout((()=>t(this.client.session.get(f))),500)))}},this.reject=async t=>{this.isInitialized(),await this.isValidReject(t);const{id:e,reason:r}=t,{pairingTopic:i}=this.client.proposal.get(e);i&&(await this.sendError(e,i,r),await this.client.proposal.delete(e,or("USER_DISCONNECTED")))},this.update=async t=>{this.isInitialized(),await this.isValidUpdate(t);const{topic:e,namespaces:r}=t,i=await this.sendRequest(e,"wc_sessionUpdate",{namespaces:r}),{done:n,resolve:s,reject:o}=Me();return this.events.once(He("session_update",i),(({error:t})=>{t?o(t):s()})),await this.client.session.update(e,{namespaces:r}),{acknowledged:n}},this.extend=async t=>{this.isInitialized(),await this.isValidExtend(t);const{topic:e}=t,r=await this.sendRequest(e,"wc_sessionExtend",{}),{done:i,resolve:n,reject:s}=Me();return this.events.once(He("session_extend",r),(({error:t})=>{t?s(t):n()})),await this.setExpiry(e,$e(Xs)),{acknowledged:i}},this.request=async t=>{this.isInitialized(),await this.isValidRequest(t);const{chainId:e,request:i,topic:n,expiry:s}=t,o=await this.sendRequest(n,"wc_sessionRequest",{request:i,chainId:e},s),{done:a,resolve:c,reject:h}=Me(s);this.events.once(He("session_request",o),(({error:t,result:e})=>{t?h(t):c(e)})),this.client.events.emit("session_request_sent",{topic:n,request:i,chainId:e,id:o});return async function({id:t,topic:e,wcDeepLink:i}){try{if(!i)return;let n=("string"==typeof i?JSON.parse(i):i)?.href;if("string"!=typeof n)return;n.endsWith("/")&&(n=n.slice(0,-1));const s=`${n}/wc?requestId=${t}&sessionTopic=${e}`,o=xe();o===Ie?window.open(s,"_self","noreferrer noopener"):o===Ee&&typeof(null==r.g?void 0:r.g.Linking)<"u"&&await r.g.Linking.openURL(s)}catch(t){console.error(t)}}({id:o,topic:n,wcDeepLink:await this.client.core.storage.getItem("WALLETCONNECT_DEEPLINK_CHOICE")}),await a()},this.respond=async t=>{this.isInitialized(),await this.isValidRespond(t);const{topic:e,response:r}=t,{id:i}=r;(0,Fr.isJsonRpcResult)(r)?await this.sendResult(i,e,r.result):(0,Fr.isJsonRpcError)(r)&&await this.sendError(i,e,r.error),this.deletePendingSessionRequest(t.response.id,{message:"fulfilled",code:0})},this.ping=async t=>{this.isInitialized(),await this.isValidPing(t);const{topic:e}=t;if(this.client.session.keys.includes(e)){const t=await this.sendRequest(e,"wc_sessionPing",{}),{done:r,resolve:i,reject:n}=Me();this.events.once(He("session_ping",t),(({error:t})=>{t?n(t):i()})),await r()}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.isValidEmit(t);const{topic:e,event:r,chainId:i}=t;await this.sendRequest(e,"wc_sessionEvent",{event:r,chainId:i})},this.disconnect=async t=>{this.isInitialized(),await this.isValidDisconnect(t);const{topic:e}=t;if(this.client.session.keys.includes(e)){const t=(0,Fr.getBigIntRpcId)().toString();let r;const i=e=>{e?.id.toString()===t&&(this.client.core.relayer.events.removeListener(Tn,i),r())};await Promise.all([new Promise((t=>{r=t,this.client.core.relayer.on(Tn,i)})),this.sendRequest(e,"wc_sessionDelete",or("USER_DISCONNECTED"),void 0,t)]),await this.deleteSession(e)}else 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!!Ue(n,i)&&(i.forEach((e=>{const{accounts:i,methods:n,events:o}=t.namespaces[e],a=tr(i),c=r[e];Ue(ne(e,c),a)&&Ue(c.methods,n)&&Ue(c.events,o)||(s=!1)})),s)}(e,t)))),this.getPendingSessionRequests=()=>(this.isInitialized(),this.client.pendingRequest.getAll()),this.cleanupDuplicatePairings=async t=>{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 ${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(t){this.client.logger.error(t)}},this.deleteSession=async(t,e)=>{const{self:r}=this.client.session.get(t);await this.client.core.relayer.unsubscribe(t),this.client.session.delete(t,or("USER_DISCONNECTED")),this.client.core.crypto.keychain.has(r.publicKey)&&await this.client.core.crypto.deleteKeyPair(r.publicKey),this.client.core.crypto.keychain.has(t)&&await this.client.core.crypto.deleteSymKey(t),e||this.client.core.expirer.del(t)},this.deleteProposal=async(t,e)=>{await Promise.all([this.client.proposal.delete(t,or("USER_DISCONNECTED")),e?Promise.resolve():this.client.core.expirer.del(t)])},this.deletePendingSessionRequest=async(t,e,r=!1)=>{await Promise.all([this.client.pendingRequest.delete(t,e),r?Promise.resolve():this.client.core.expirer.del(t)])},this.setExpiry=async(t,e)=>{this.client.session.keys.includes(t)&&await this.client.session.update(t,{expiry:e}),this.client.core.expirer.set(t,e)},this.setProposal=async(t,e)=>{await this.client.proposal.set(t,e),this.client.core.expirer.set(t,e.expiry)},this.setPendingSessionRequest=async t=>{const e=Zs.wc_sessionRequest.req.ttl,{id:r,topic:i,params:n}=t;await this.client.pendingRequest.set(r,{id:r,topic:i,params:n}),e&&this.client.core.expirer.set(r,$e(e))},this.sendRequest=async(t,e,r,i,n)=>{const s=(0,Fr.formatJsonRpcRequest)(e,r);if(Re()&&to.includes(e)){const t=ue(JSON.stringify(s));await this.client.core.verify.register({attestationId:t})}const o=await this.client.core.crypto.encode(t,s),a=Zs[e].req;return i&&(a.ttl=i),n&&(a.id=n),this.client.core.history.set(t,s),this.client.core.relayer.publish(t,o,a),s.id},this.sendResult=async(t,e,r)=>{const i=(0,Fr.formatJsonRpcResult)(t,r),n=await this.client.core.crypto.encode(e,i),s=await this.client.core.history.get(e,t),o=Zs[s.request.method].res;this.client.core.relayer.publish(e,n,o),await this.client.core.history.resolve(i)},this.sendError=async(t,e,r)=>{const i=(0,Fr.formatJsonRpcError)(t,r),n=await this.client.core.crypto.encode(e,i),s=await this.client.core.history.get(e,t),o=Zs[s.request.method].res;this.client.core.relayer.publish(e,n,o),await this.client.core.history.resolve(i)},this.cleanup=async()=>{const t=[],e=[];this.client.session.getAll().forEach((e=>{qe(e.expiry)&&t.push(e.topic)})),this.client.proposal.getAll().forEach((t=>{qe(t.expiry)&&e.push(t.id)})),await Promise.all([...t.map((t=>this.deleteSession(t))),...e.map((t=>this.deleteProposal(t)))])},this.onRelayEventRequest=t=>{const{topic:e,payload:r}=t,i=r.method;switch(i){case"wc_sessionPropose":return this.onSessionProposeRequest(e,r);case"wc_sessionSettle":return this.onSessionSettleRequest(e,r);case"wc_sessionUpdate":return this.onSessionUpdateRequest(e,r);case"wc_sessionExtend":return this.onSessionExtendRequest(e,r);case"wc_sessionPing":return this.onSessionPingRequest(e,r);case"wc_sessionDelete":return this.onSessionDeleteRequest(e,r);case"wc_sessionRequest":return this.onSessionRequest(e,r);case"wc_sessionEvent":return this.onSessionEventRequest(e,r);default:return this.client.logger.info(`Unsupported request method ${i}`)}},this.onRelayEventResponse=async t=>{const{topic:e,payload:r}=t,i=(await this.client.core.history.get(e,r.id)).request.method;switch(i){case"wc_sessionPropose":return this.onSessionProposeResponse(e,r);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);default:return this.client.logger.info(`Unsupported response method ${i}`)}},this.onRelayEventUnknownPayload=t=>{const{topic:e}=t,{message:r}=sr("MISSING_OR_INVALID",`Decoded payload on topic ${e} is not identifiable as a JSON-RPC request or a response.`);throw new Error(r)},this.onSessionProposeRequest=async(t,e)=>{const{params:r,id:i}=e;try{this.isValidConnect(co({},e.params));const n=$e(Qt.FIVE_MINUTES),s=co({id:i,pairingTopic:t,expiry:n},r);await this.setProposal(i,s);const o=ue(JSON.stringify(e)),a=await this.getVerifyContext(o,s.proposer.metadata);this.client.events.emit("session_proposal",{id:i,params:s,verifyContext:a})}catch(e){await this.sendError(i,t,e),this.client.logger.error(e)}},this.onSessionProposeResponse=async(t,e)=>{const{id:r}=e;if((0,Fr.isJsonRpcResult)(e)){const{result:i}=e;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",result:i});const n=this.client.proposal.get(r);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",proposal:n});const s=n.proposer.publicKey;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",selfPublicKey:s});const o=i.responderPublicKey;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",peerPublicKey:o});const a=await this.client.core.crypto.generateSharedKey(s,o);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",sessionTopic:a});const c=await this.client.core.relayer.subscribe(a);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",subscriptionId:c}),await this.client.core.pairing.activate({topic:t})}else(0,Fr.isJsonRpcError)(e)&&(await this.client.proposal.delete(r,or("USER_DISCONNECTED")),this.events.emit(He("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,requiredNamespaces:a,optionalNamespaces:c,sessionProperties:h,pairingTopic:u}=e.params,l=co({topic:t,relay:r,expiry:s,namespaces:o,acknowledged:!0,pairingTopic:u,requiredNamespaces:a,optionalNamespaces:c,controller:n.publicKey,self:{publicKey:"",metadata:this.client.metadata},peer:{publicKey:n.publicKey,metadata:n.metadata}},h&&{sessionProperties:h});await this.sendResult(e.id,t,!0),this.events.emit(He("session_connect"),{session:l}),this.cleanupDuplicatePairings(l)}catch(e){await this.sendError(r,t,e),this.client.logger.error(e)}},this.onSessionSettleResponse=async(t,e)=>{const{id:r}=e;(0,Fr.isJsonRpcResult)(e)?(await this.client.session.update(t,{acknowledged:!0}),this.events.emit(He("session_approve",r),{})):(0,Fr.isJsonRpcError)(e)&&(await this.client.session.delete(t,or("USER_DISCONNECTED")),this.events.emit(He("session_approve",r),{error:e.error}))},this.onSessionUpdateRequest=async(t,e)=>{const{params:r,id:i}=e;try{this.isValidUpdate(co({topic:t},r)),await this.client.session.update(t,{namespaces:r.namespaces}),await this.sendResult(i,t,!0),this.client.events.emit("session_update",{id:i,topic:t,params:r})}catch(e){await this.sendError(i,t,e),this.client.logger.error(e)}},this.onSessionUpdateResponse=(t,e)=>{const{id:r}=e;(0,Fr.isJsonRpcResult)(e)?this.events.emit(He("session_update",r),{}):(0,Fr.isJsonRpcError)(e)&&this.events.emit(He("session_update",r),{error:e.error})},this.onSessionExtendRequest=async(t,e)=>{const{id:r}=e;try{this.isValidExtend({topic:t}),await this.setExpiry(t,$e(Xs)),await this.sendResult(r,t,!0),this.client.events.emit("session_extend",{id:r,topic:t})}catch(e){await this.sendError(r,t,e),this.client.logger.error(e)}},this.onSessionExtendResponse=(t,e)=>{const{id:r}=e;(0,Fr.isJsonRpcResult)(e)?this.events.emit(He("session_extend",r),{}):(0,Fr.isJsonRpcError)(e)&&this.events.emit(He("session_extend",r),{error:e.error})},this.onSessionPingRequest=async(t,e)=>{const{id:r}=e;try{this.isValidPing({topic:t}),await this.sendResult(r,t,!0),this.client.events.emit("session_ping",{id:r,topic:t})}catch(e){await this.sendError(r,t,e),this.client.logger.error(e)}},this.onSessionPingResponse=(t,e)=>{const{id:r}=e;setTimeout((()=>{(0,Fr.isJsonRpcResult)(e)?this.events.emit(He("session_ping",r),{}):(0,Fr.isJsonRpcError)(e)&&this.events.emit(He("session_ping",r),{error:e.error})}),500)},this.onSessionDeleteRequest=async(t,e)=>{const{id:r}=e;try{this.isValidDisconnect({topic:t,reason:e.params}),await Promise.all([new Promise((e=>{this.client.core.relayer.once(kn,(async()=>{e(await this.deleteSession(t))}))})),this.sendResult(r,t,!0)]),this.client.events.emit("session_delete",{id:r,topic:t})}catch(t){this.client.logger.error(t)}},this.onSessionRequest=async(t,e)=>{const{id:r,params:i}=e;try{this.isValidRequest(co({topic:t},i)),await this.setPendingSessionRequest({id:r,topic:t,params:i});const n=ue(JSON.stringify(e)),s=this.client.session.get(t),o=await this.getVerifyContext(n,s.peer.metadata);this.client.events.emit("session_request",{id:r,topic:t,params:i,verifyContext:o})}catch(e){await this.sendError(r,t,e),this.client.logger.error(e)}},this.onSessionRequestResponse=(t,e)=>{const{id:r}=e;(0,Fr.isJsonRpcResult)(e)?this.events.emit(He("session_request",r),{result:e.result}):(0,Fr.isJsonRpcError)(e)&&this.events.emit(He("session_request",r),{error:e.error})},this.onSessionEventRequest=async(t,e)=>{const{id:r,params:i}=e;try{this.isValidEmit(co({topic:t},i)),this.client.events.emit("session_event",{id:r,topic:t,params:i})}catch(e){await this.sendError(r,t,e),this.client.logger.error(e)}},this.isValidConnect=async t=>{if(!mr(t)){const{message:e}=sr("MISSING_OR_INVALID",`connect() params: ${JSON.stringify(t)}`);throw new Error(e)}const{pairingTopic:e,requiredNamespaces:r,optionalNamespaces:i,sessionProperties:n,relays:s}=t;if(hr(e)||await this.isValidPairingTopic(e),!function(t,e){let r=!1;return e&&!t?r=!0:t&&ar(t)&&t.length&&t.forEach((t=>{r=_r(t)})),r}(s,!0)){const{message:t}=sr("MISSING_OR_INVALID",`connect() relays: ${s}`);throw new Error(t)}!hr(r)&&0!==cr(r)&&this.validateNamespaces(r,"requiredNamespaces"),!hr(i)&&0!==cr(i)&&this.validateNamespaces(i,"optionalNamespaces"),hr(n)||this.validateSessionProps(n,"sessionProperties")},this.validateNamespaces=(t,e)=>{const r=function(t,e,r){let i=null;if(t&&cr(t)){const r=yr(t,e);r&&(i=r);const n=dr(t,e);n&&(i=n)}else i=sr("MISSING_OR_INVALID",`${e}, ${r} should be an object with data`);return i}(t,"connect()",e);if(r)throw new Error(r.message)},this.isValidApprove=async t=>{if(!mr(t))throw new Error(sr("MISSING_OR_INVALID",`approve() params: ${t}`).message);const{id:e,namespaces:r,relayProtocol:i,sessionProperties:n}=t;await this.isValidProposalId(e);const s=this.client.proposal.get(e),o=vr(r,"approve()");if(o)throw new Error(o.message);const a=Sr(s.requiredNamespaces,r,"approve()");if(a)throw new Error(a.message);if(!ur(i,!0)){const{message:t}=sr("MISSING_OR_INVALID",`approve() relayProtocol: ${i}`);throw new Error(t)}hr(n)||this.validateSessionProps(n,"sessionProperties")},this.isValidReject=async t=>{if(!mr(t)){const{message:e}=sr("MISSING_OR_INVALID",`reject() params: ${t}`);throw new Error(e)}const{id:e,reason:r}=t;if(await this.isValidProposalId(e),!function(t){return!!(t&&"object"==typeof t&&t.code&&lr(t.code,!1)&&t.message&&ur(t.message,!1))}(r)){const{message:t}=sr("MISSING_OR_INVALID",`reject() reason: ${JSON.stringify(r)}`);throw new Error(t)}},this.isValidSessionSettleRequest=t=>{if(!mr(t)){const{message:e}=sr("MISSING_OR_INVALID",`onSessionSettleRequest() params: ${t}`);throw new Error(e)}const{relay:e,controller:r,namespaces:i,expiry:n}=t;if(!_r(e)){const{message:t}=sr("MISSING_OR_INVALID","onSessionSettleRequest() relay protocol should be a string");throw new Error(t)}const s=function(t,e){let r=null;return ur(t?.publicKey,!1)||(r=sr("MISSING_OR_INVALID",`${e} controller public key should be a string`)),r}(r,"onSessionSettleRequest()");if(s)throw new Error(s.message);const o=vr(i,"onSessionSettleRequest()");if(o)throw new Error(o.message);if(qe(n)){const{message:t}=sr("EXPIRED","onSessionSettleRequest()");throw new Error(t)}},this.isValidUpdate=async t=>{if(!mr(t)){const{message:e}=sr("MISSING_OR_INVALID",`update() params: ${t}`);throw new Error(e)}const{topic:e,namespaces:r}=t;await this.isValidSessionTopic(e);const i=this.client.session.get(e),n=vr(r,"update()");if(n)throw new Error(n.message);const s=Sr(i.requiredNamespaces,r,"update()");if(s)throw new Error(s.message)},this.isValidExtend=async t=>{if(!mr(t)){const{message:e}=sr("MISSING_OR_INVALID",`extend() params: ${t}`);throw new Error(e)}const{topic:e}=t;await this.isValidSessionTopic(e)},this.isValidRequest=async t=>{if(!mr(t)){const{message:e}=sr("MISSING_OR_INVALID",`request() params: ${t}`);throw new Error(e)}const{topic:e,request:r,chainId:i,expiry:n}=t;await this.isValidSessionTopic(e);const{namespaces:s}=this.client.session.get(e);if(!br(s,i)){const{message:t}=sr("MISSING_OR_INVALID",`request() chainId: ${i}`);throw new Error(t)}if(!function(t){return!(hr(t)||!ur(t.method,!1))}(r)){const{message:t}=sr("MISSING_OR_INVALID",`request() ${JSON.stringify(r)}`);throw new Error(t)}if(!wr(s,i,r.method)){const{message:t}=sr("MISSING_OR_INVALID",`request() method: ${r.method}`);throw new Error(t)}if(n&&!function(t,e){return lr(t,!1)&&t<=e.max&&t>=e.min}(n,Qs)){const{message:t}=sr("MISSING_OR_INVALID",`request() expiry: ${n}. Expiry must be a number (in seconds) between ${Qs.min} and ${Qs.max}`);throw new Error(t)}},this.isValidRespond=async t=>{if(!mr(t)){const{message:e}=sr("MISSING_OR_INVALID",`respond() params: ${t}`);throw new Error(e)}const{topic:e,response:r}=t;if(await this.isValidSessionTopic(e),!function(t){return!(hr(t)||hr(t.result)&&hr(t.error)||!lr(t.id,!1)||!ur(t.jsonrpc,!1))}(r)){const{message:t}=sr("MISSING_OR_INVALID",`respond() response: ${JSON.stringify(r)}`);throw new Error(t)}},this.isValidPing=async t=>{if(!mr(t)){const{message:e}=sr("MISSING_OR_INVALID",`ping() params: ${t}`);throw new Error(e)}const{topic:e}=t;await this.isValidSessionOrPairingTopic(e)},this.isValidEmit=async t=>{if(!mr(t)){const{message:e}=sr("MISSING_OR_INVALID",`emit() params: ${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(!br(n,i)){const{message:t}=sr("MISSING_OR_INVALID",`emit() chainId: ${i}`);throw new Error(t)}if(!function(t){return!(hr(t)||!ur(t.name,!1))}(r)){const{message:t}=sr("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(r)}`);throw new Error(t)}if(!Er(n,i,r.name)){const{message:t}=sr("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(r)}`);throw new Error(t)}},this.isValidDisconnect=async t=>{if(!mr(t)){const{message:e}=sr("MISSING_OR_INVALID",`disconnect() params: ${t}`);throw new Error(e)}const{topic:e}=t;await this.isValidSessionOrPairingTopic(e)},this.getVerifyContext=async(t,e)=>{const r={verified:{verifyUrl:e.verifyUrl||"",validation:"UNKNOWN",origin:e.url||""}};try{const i=await this.client.core.verify.resolve({attestationId:t,verifyUrl:e.verifyUrl});i&&(r.verified.origin=i,r.verified.validation=i===e.url?"VALID":"INVALID")}catch(t){this.client.logger.error(t)}return this.client.logger.info(`Verify context: ${JSON.stringify(r)}`),r},this.validateSessionProps=(t,e)=>{Object.values(t).forEach((t=>{if(!ur(t,!1)){const{message:r}=sr("MISSING_OR_INVALID",`${e} must be in Record<string, string> format. Received: ${JSON.stringify(t)}`);throw new Error(r)}}))}}isInitialized(){if(!this.initialized){const{message:t}=sr("NOT_INITIALIZED",this.name);throw new Error(t)}}registerRelayerEvents(){this.client.core.relayer.on(Cn,(async t=>{const{topic:e,message:r}=t;if(this.ignoredPayloadTypes.includes(this.client.core.crypto.getPayloadType(r)))return;const i=await this.client.core.crypto.decode(e,r);(0,Fr.isJsonRpcRequest)(i)?(this.client.core.history.set(e,i),this.onRelayEventRequest({topic:e,payload:i})):(0,Fr.isJsonRpcResponse)(i)?(await this.client.core.history.resolve(i),this.onRelayEventResponse({topic:e,payload:i})):this.onRelayEventUnknownPayload({topic:e,payload:i})}))}registerExpirerEvents(){this.client.core.expirer.on(rs,(async t=>{const{topic:e,id:r}=ze(t.target);if(r&&this.client.pendingRequest.keys.includes(r))return await this.deletePendingSessionRequest(r,sr("EXPIRED"),!0);e?this.client.session.keys.includes(e)&&(await this.deleteSession(e,!0),this.client.events.emit("session_expire",{topic:e})):r&&(await this.deleteProposal(r,!0),this.client.events.emit("proposal_expire",{id:r}))}))}isValidPairingTopic(t){if(!ur(t,!1)){const{message:e}=sr("MISSING_OR_INVALID",`pairing topic should be a string: ${t}`);throw new Error(e)}if(!this.client.core.pairing.pairings.keys.includes(t)){const{message:e}=sr("NO_MATCHING_KEY",`pairing topic doesn't exist: ${t}`);throw new Error(e)}if(qe(this.client.core.pairing.pairings.get(t).expiry)){const{message:e}=sr("EXPIRED",`pairing topic: ${t}`);throw new Error(e)}}async isValidSessionTopic(t){if(!ur(t,!1)){const{message:e}=sr("MISSING_OR_INVALID",`session topic should be a string: ${t}`);throw new Error(e)}if(!this.client.session.keys.includes(t)){const{message:e}=sr("NO_MATCHING_KEY",`session topic doesn't exist: ${t}`);throw new Error(e)}if(qe(this.client.session.get(t).expiry)){await this.deleteSession(t);const{message:e}=sr("EXPIRED",`session topic: ${t}`);throw new Error(e)}}async isValidSessionOrPairingTopic(t){if(this.client.session.keys.includes(t))await this.isValidSessionTopic(t);else{if(!this.client.core.pairing.pairings.keys.includes(t)){if(ur(t,!1)){const{message:e}=sr("NO_MATCHING_KEY",`session or pairing topic doesn't exist: ${t}`);throw new Error(e)}{const{message:e}=sr("MISSING_OR_INVALID",`session or pairing topic should be a string: ${t}`);throw new Error(e)}}this.isValidPairingTopic(t)}}async isValidProposalId(t){if("number"!=typeof t){const{message:e}=sr("MISSING_OR_INVALID",`proposal id should be a number: ${t}`);throw new Error(e)}if(!this.client.proposal.keys.includes(t)){const{message:e}=sr("NO_MATCHING_KEY",`proposal id doesn't exist: ${t}`);throw new Error(e)}if(qe(this.client.proposal.get(t).expiry)){await this.deleteProposal(t);const{message:e}=sr("EXPIRED",`proposal id: ${t}`);throw new Error(e)}}}class lo extends Us{constructor(t,e){super(t,e,"proposal",Ws),this.core=t,this.logger=e}}class fo extends Us{constructor(t,e){super(t,e,"session",Ws),this.core=t,this.logger=e}}class po extends Us{constructor(t,e){super(t,e,"request",Ws,(t=>t.id)),this.core=t,this.logger=e}}class go extends class{constructor(t){this.opts=t,this.protocol="wc",this.version=2}}{constructor(t){super(t),this.protocol="wc",this.version=2,this.name=Gs,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(t){throw this.logger.error(t.message),t}},this.pair=async t=>{try{return await this.engine.pair(t)}catch(t){throw this.logger.error(t.message),t}},this.approve=async t=>{try{return await this.engine.approve(t)}catch(t){throw this.logger.error(t.message),t}},this.reject=async t=>{try{return await this.engine.reject(t)}catch(t){throw this.logger.error(t.message),t}},this.update=async t=>{try{return await this.engine.update(t)}catch(t){throw this.logger.error(t.message),t}},this.extend=async t=>{try{return await this.engine.extend(t)}catch(t){throw this.logger.error(t.message),t}},this.request=async t=>{try{return await this.engine.request(t)}catch(t){throw this.logger.error(t.message),t}},this.respond=async t=>{try{return await this.engine.respond(t)}catch(t){throw this.logger.error(t.message),t}},this.ping=async t=>{try{return await this.engine.ping(t)}catch(t){throw this.logger.error(t.message),t}},this.emit=async t=>{try{return await this.engine.emit(t)}catch(t){throw this.logger.error(t.message),t}},this.disconnect=async t=>{try{return await this.engine.disconnect(t)}catch(t){throw this.logger.error(t.message),t}},this.find=t=>{try{return this.engine.find(t)}catch(t){throw this.logger.error(t.message),t}},this.getPendingSessionRequests=()=>{try{return this.engine.getPendingSessionRequests()}catch(t){throw this.logger.error(t.message),t}},this.name=t?.name||Gs,this.metadata=t?.metadata||(0,ee.D)()||{name:"",description:"",url:"",icons:[""]};const e=typeof t?.logger<"u"&&"string"!=typeof t?.logger?t.logger:(0,Ar.pino)((0,Ar.getDefaultLoggerOptions)({level:t?.logger||Js}));this.core=t?.core||new Bs(t),this.logger=(0,Ar.generateChildLogger)(e,this.name),this.session=new fo(this.core,this.logger),this.proposal=new lo(this.core,this.logger),this.pendingRequest=new po(this.core,this.logger),this.engine=new uo(this)}static async init(t){const e=new go(t);return await e.initialize(),e}get context(){return(0,Ar.getLoggerContext)(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.engine.init(),this.core.verify.init({verifyUrl:this.metadata.verifyUrl}),this.logger.info("SignClient Initialization Success")}catch(t){throw this.logger.info("SignClient Initialization Failure"),this.logger.error(t.message),t}}}var yo=r(84497);const vo="error",_o="wc@2:universal_provider:",mo="default_chain_changed";var bo=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof r.g<"u"?r.g:typeof self<"u"?self:{},wo={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,l=1/0,f=9007199254740991,p=NaN,d=4294967295,g=[["ary",h],["bind",1],["bindKey",2],["curry",8],["curryRight",o],["flip",512],["partial",a],["partialRight",c],["rearg",u]],y="[object Arguments]",v="[object Array]",_="[object Boolean]",m="[object Date]",b="[object Error]",w="[object Function]",E="[object GeneratorFunction]",S="[object Map]",I="[object Number]",P="[object Object]",O="[object Promise]",A="[object RegExp]",N="[object Set]",R="[object String]",x="[object Symbol]",C="[object WeakMap]",T="[object ArrayBuffer]",U="[object DataView]",j="[object Float32Array]",L="[object Float64Array]",M="[object Int8Array]",D="[object Int16Array]",k="[object Int32Array]",z="[object Uint8Array]",$="[object Uint8ClampedArray]",q="[object Uint16Array]",H="[object Uint32Array]",V=/\b__p \+= '';/g,K=/\b(__p \+=) '' \+/g,B=/(__e\(.*?\)|\b__t\)) \+\n'';/g,F=/&(?:amp|lt|gt|quot|#39);/g,W=/[&<>"']/g,G=RegExp(F.source),J=RegExp(W.source),Y=/<%-([\s\S]+?)%>/g,X=/<%([\s\S]+?)%>/g,Z=/<%=([\s\S]+?)%>/g,Q=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,tt=/^\w*$/,et=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,rt=/[\\^$.*+?()[\]{}|]/g,it=RegExp(rt.source),nt=/^\s+/,st=/\s/,ot=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,at=/\{\n\/\* \[wrapped with (.+)\] \*/,ct=/,? & /,ht=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ut=/[()=,{}\[\]\/\s]/,lt=/\\(\\)?/g,ft=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,pt=/\w*$/,dt=/^[-+]0x[0-9a-f]+$/i,gt=/^0b[01]+$/i,yt=/^\[object .+?Constructor\]$/,vt=/^0o[0-7]+$/i,_t=/^(?:0|[1-9]\d*)$/,mt=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,bt=/($^)/,wt=/['\n\r\u2028\u2029\\]/g,Et="\\ud800-\\udfff",St="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",It="\\u2700-\\u27bf",Pt="a-z\\xdf-\\xf6\\xf8-\\xff",Ot="A-Z\\xc0-\\xd6\\xd8-\\xde",At="\\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="['’]",xt="["+Et+"]",Ct="["+Nt+"]",Tt="["+St+"]",Ut="\\d+",jt="["+It+"]",Lt="["+Pt+"]",Mt="[^"+Et+Nt+Ut+It+Pt+Ot+"]",Dt="\\ud83c[\\udffb-\\udfff]",kt="[^"+Et+"]",zt="(?:\\ud83c[\\udde6-\\uddff]){2}",$t="[\\ud800-\\udbff][\\udc00-\\udfff]",qt="["+Ot+"]",Ht="\\u200d",Vt="(?:"+Lt+"|"+Mt+")",Kt="(?:"+qt+"|"+Mt+")",Bt="(?:['’](?:d|ll|m|re|s|t|ve))?",Ft="(?:['’](?:D|LL|M|RE|S|T|VE))?",Wt="(?:"+Tt+"|"+Dt+")"+"?",Gt="["+At+"]?",Jt=Gt+Wt+("(?:\\u200d(?:"+[kt,zt,$t].join("|")+")"+Gt+Wt+")*"),Yt="(?:"+[jt,zt,$t].join("|")+")"+Jt,Xt="(?:"+[kt+Tt+"?",Tt,zt,$t,xt].join("|")+")",Zt=RegExp(Rt,"g"),Qt=RegExp(Tt,"g"),te=RegExp(Dt+"(?="+Dt+")|"+Xt+Jt,"g"),ee=RegExp([qt+"?"+Lt+"+"+Bt+"(?="+[Ct,qt,"$"].join("|")+")",Kt+"+"+Ft+"(?="+[Ct,qt+Vt,"$"].join("|")+")",qt+"?"+Vt+"+"+Bt,qt+"+"+Ft,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Ut,Yt].join("|"),"g"),re=RegExp("["+Ht+Et+St+At+"]"),ie=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,ne=["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"],se=-1,oe={};oe[j]=oe[L]=oe[M]=oe[D]=oe[k]=oe[z]=oe[$]=oe[q]=oe[H]=!0,oe[y]=oe[v]=oe[T]=oe[_]=oe[U]=oe[m]=oe[b]=oe[w]=oe[S]=oe[I]=oe[P]=oe[A]=oe[N]=oe[R]=oe[C]=!1;var ae={};ae[y]=ae[v]=ae[T]=ae[U]=ae[_]=ae[m]=ae[j]=ae[L]=ae[M]=ae[D]=ae[k]=ae[S]=ae[I]=ae[P]=ae[A]=ae[N]=ae[R]=ae[x]=ae[z]=ae[$]=ae[q]=ae[H]=!0,ae[b]=ae[w]=ae[C]=!1;var ce={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},he=parseFloat,ue=parseInt,le="object"==typeof bo&&bo&&bo.Object===Object&&bo,fe="object"==typeof self&&self&&self.Object===Object&&self,pe=le||fe||Function("return this")(),de=e&&!e.nodeType&&e,ge=de&&t&&!t.nodeType&&t,ye=ge&&ge.exports===de,ve=ye&&le.process,_e=function(){try{return ge&&ge.require&&ge.require("util").types||ve&&ve.binding&&ve.binding("util")}catch{}}(),me=_e&&_e.isArrayBuffer,be=_e&&_e.isDate,we=_e&&_e.isMap,Ee=_e&&_e.isRegExp,Se=_e&&_e.isSet,Ie=_e&&_e.isTypedArray;function Pe(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 Oe(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 Ae(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 xe(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 Ce(t,e){return!!(null==t?0:t.length)&&qe(t,e,0)>-1}function Te(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 Ue(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 je(t,e){for(var r=-1,i=e.length,n=t.length;++r<i;)t[n+r]=e[r];return t}function Le(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 Me(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 De(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 ke=Be("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 $e(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 qe(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):$e(t,Ve,r)}function He(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 Ke(t,e){var r=null==t?0:t.length;return r?Ge(t,e)/r:p}function Be(t){return function(e){return null==e?r:e[t]}}function Fe(t){return function(e){return null==t?r:t[e]}}function We(t,e,r,i,n){return n(t,(function(t,n,s){r=i?(i=!1,t):e(r,t,n,s)})),r}function Ge(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 Je(t,e){for(var r=-1,i=Array(t);++r<t;)i[r]=e(r);return i}function Ye(t){return t&&t.slice(0,pr(t)+1).replace(nt,"")}function Xe(t){return function(e){return t(e)}}function Ze(t,e){return Ue(e,(function(e){return t[e]}))}function Qe(t,e){return t.has(e)}function tr(t,e){for(var r=-1,i=t.length;++r<i&&qe(e,t[r],0)>-1;);return r}function er(t,e){for(var r=t.length;r--&&qe(e,t[r],0)>-1;);return r}function rr(t,e){for(var r=t.length,i=0;r--;)t[r]===e&&++i;return i}var ir=Fe({À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"}),nr=Fe({"&":"&","<":"<",">":">",'"':""","'":"'"});function sr(t){return"\\"+ce[t]}function or(t){return re.test(t)}function ar(t){var e=-1,r=Array(t.size);return t.forEach((function(t,i){r[++e]=[i,t]})),r}function cr(t,e){return function(r){return t(e(r))}}function hr(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 ur(t){var e=-1,r=Array(t.size);return t.forEach((function(t){r[++e]=t})),r}function lr(t){return or(t)?function(t){for(var e=te.lastIndex=0;te.test(t);)++e;return e}(t):ke(t)}function fr(t){return or(t)?function(t){return t.match(te)||[]}(t):function(t){return t.split("")}(t)}function pr(t){for(var e=t.length;e--&&st.test(t.charAt(e)););return e}var dr=Fe({"&":"&","<":"<",">":">",""":'"',"'":"'"});var gr=function t(e){var st=(e=null==e?pe:gr.defaults(pe.Object(),e,gr.pick(pe,ne))).Array,Et=e.Date,St=e.Error,It=e.Function,Pt=e.Math,Ot=e.Object,At=e.RegExp,Nt=e.String,Rt=e.TypeError,xt=st.prototype,Ct=It.prototype,Tt=Ot.prototype,Ut=e["__core-js_shared__"],jt=Ct.toString,Lt=Tt.hasOwnProperty,Mt=0,Dt=function(){var t=/[^.]+$/.exec(Ut&&Ut.keys&&Ut.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}(),kt=Tt.toString,zt=jt.call(Ot),$t=pe._,qt=At("^"+jt.call(Lt).replace(rt,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ht=ye?e.Buffer:r,Vt=e.Symbol,Kt=e.Uint8Array,Bt=Ht?Ht.allocUnsafe:r,Ft=cr(Ot.getPrototypeOf,Ot),Wt=Ot.create,Gt=Tt.propertyIsEnumerable,Jt=xt.splice,Yt=Vt?Vt.isConcatSpreadable:r,Xt=Vt?Vt.iterator:r,te=Vt?Vt.toStringTag:r,re=function(){try{var t=ls(Ot,"defineProperty");return t({},"",{}),t}catch{}}(),ce=e.clearTimeout!==pe.clearTimeout&&e.clearTimeout,le=Et&&Et.now!==pe.Date.now&&Et.now,fe=e.setTimeout!==pe.setTimeout&&e.setTimeout,de=Pt.ceil,ge=Pt.floor,ve=Ot.getOwnPropertySymbols,_e=Ht?Ht.isBuffer:r,ke=e.isFinite,Fe=xt.join,yr=cr(Ot.keys,Ot),vr=Pt.max,_r=Pt.min,mr=Et.now,br=e.parseInt,wr=Pt.random,Er=xt.reverse,Sr=ls(e,"DataView"),Ir=ls(e,"Map"),Pr=ls(e,"Promise"),Or=ls(e,"Set"),Ar=ls(e,"WeakMap"),Nr=ls(Ot,"create"),Rr=Ar&&new Ar,xr={},Cr=ks(Sr),Tr=ks(Ir),Ur=ks(Pr),jr=ks(Or),Lr=ks(Ar),Mr=Vt?Vt.prototype:r,Dr=Mr?Mr.valueOf:r,kr=Mr?Mr.toString:r;function zr(t){if(ra(t)&&!Bo(t)&&!(t instanceof Vr)){if(t instanceof Hr)return t;if(Lt.call(t,"__wrapped__"))return zs(t)}return new Hr(t)}var $r=function(){function t(){}return function(e){if(!ea(e))return{};if(Wt)return Wt(e);t.prototype=e;var i=new t;return t.prototype=r,i}}();function qr(){}function Hr(t,e){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!e,this.__index__=0,this.__values__=r}function Vr(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=d,this.__views__=[]}function Kr(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 Br(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 Fr(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.__data__=new Fr;++e<r;)this.add(t[e])}function Gr(t){var e=this.__data__=new Br(t);this.size=e.size}function Jr(t,e){var r=Bo(t),i=!r&&Ko(t),n=!r&&!i&&Jo(t),s=!r&&!i&&!n&&ua(t),o=r||i||n||s,a=o?Je(t.length,Nt):[],c=a.length;for(var h in t)(e||Lt.call(t,h))&&(!o||!("length"==h||n&&("offset"==h||"parent"==h)||s&&("buffer"==h||"byteLength"==h||"byteOffset"==h)||_s(h,c)))&&a.push(h);return a}function Yr(t){var e=t.length;return e?t[Wi(0,e-1)]:r}function Xr(t,e){return Ls(Rn(t),oi(e,0,t.length))}function Zr(t){return Ls(Rn(t))}function Qr(t,e,i){(i!==r&&!qo(t[e],i)||i===r&&!(e in t))&&ni(t,e,i)}function ti(t,e,i){var n=t[e];(!Lt.call(t,e)||!qo(n,i)||i===r&&!(e in t))&&ni(t,e,i)}function ei(t,e){for(var r=t.length;r--;)if(qo(t[r][0],e))return r;return-1}function ri(t,e,r,i){return li(t,(function(t,n,s){e(i,t,r(t),s)})),i}function ii(t,e){return t&&xn(e,Ta(e),t)}function ni(t,e,r){"__proto__"==e&&re?re(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}function si(t,e){for(var i=-1,n=e.length,s=st(n),o=null==t;++i<n;)s[i]=o?r:Aa(t,e[i]);return s}function oi(t,e,i){return t==t&&(i!==r&&(t=t<=i?t:i),e!==r&&(t=t>=e?t:e)),t}function ai(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;if(!ea(t))return t;var l=Bo(t);if(l){if(a=function(t){var e=t.length,r=new t.constructor(e);return e&&"string"==typeof t[0]&&Lt.call(t,"index")&&(r.index=t.index,r.input=t.input),r}(t),!c)return Rn(t,a)}else{var f=ds(t),p=f==w||f==E;if(Jo(t))return Sn(t,c);if(f==P||f==y||p&&!s){if(a=h||p?{}:ys(t),!c)return h?function(t,e){return xn(t,ps(t),e)}(t,function(t,e){return t&&xn(e,Ua(e),t)}(a,t)):function(t,e){return xn(t,fs(t),e)}(t,ii(a,t))}else{if(!ae[f])return s?t:{};a=function(t,e,r){var i=t.constructor;switch(e){case T:return In(t);case _:case m:return new i(+t);case U:return function(t,e){var r=e?In(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)}(t,r);case j:case L:case M:case D:case k:case z:case $:case q:case H:return Pn(t,r);case S:return new i;case I:case R:return new i(t);case A:return function(t){var e=new t.constructor(t.source,pt.exec(t));return e.lastIndex=t.lastIndex,e}(t);case N:return new i;case x:return function(t){return Dr?Ot(Dr.call(t)):{}}(t)}}(t,f,c)}}o||(o=new Gr);var d=o.get(t);if(d)return d;o.set(t,a),aa(t)?t.forEach((function(r){a.add(ai(r,e,i,r,t,o))})):ia(t)&&t.forEach((function(r,n){a.set(n,ai(r,e,i,n,t,o))}));var g=l?r:(u?h?ns:is:h?Ua:Ta)(t);return Ae(g||t,(function(r,n){g&&(r=t[n=r]),ti(a,n,ai(r,e,i,n,t,o))})),a}function ci(t,e,i){var n=i.length;if(null==t)return!n;for(t=Ot(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 hi(t,e,n){if("function"!=typeof t)throw new Rt(i);return Cs((function(){t.apply(r,n)}),e)}function ui(t,e,r,i){var n=-1,s=Ce,o=!0,a=t.length,c=[],h=e.length;if(!a)return c;r&&(e=Ue(e,Xe(r))),i?(s=Te,o=!1):e.length>=200&&(s=Qe,o=!1,e=new Wr(e));t:for(;++n<a;){var u=t[n],l=null==r?u:r(u);if(u=i||0!==u?u:0,o&&l==l){for(var f=h;f--;)if(e[f]===l)continue t;c.push(u)}else s(e,l,i)||c.push(u)}return c}zr.templateSettings={escape:Y,evaluate:X,interpolate:Z,variable:"",imports:{_:zr}},zr.prototype=qr.prototype,zr.prototype.constructor=zr,Hr.prototype=$r(qr.prototype),Hr.prototype.constructor=Hr,Vr.prototype=$r(qr.prototype),Vr.prototype.constructor=Vr,Kr.prototype.clear=function(){this.__data__=Nr?Nr(null):{},this.size=0},Kr.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},Kr.prototype.get=function(t){var e=this.__data__;if(Nr){var i=e[t];return i===n?r:i}return Lt.call(e,t)?e[t]:r},Kr.prototype.has=function(t){var e=this.__data__;return Nr?e[t]!==r:Lt.call(e,t)},Kr.prototype.set=function(t,e){var i=this.__data__;return this.size+=this.has(t)?0:1,i[t]=Nr&&e===r?n:e,this},Br.prototype.clear=function(){this.__data__=[],this.size=0},Br.prototype.delete=function(t){var e=this.__data__,r=ei(e,t);return!(r<0)&&(r==e.length-1?e.pop():Jt.call(e,r,1),--this.size,!0)},Br.prototype.get=function(t){var e=this.__data__,i=ei(e,t);return i<0?r:e[i][1]},Br.prototype.has=function(t){return ei(this.__data__,t)>-1},Br.prototype.set=function(t,e){var r=this.__data__,i=ei(r,t);return i<0?(++this.size,r.push([t,e])):r[i][1]=e,this},Fr.prototype.clear=function(){this.size=0,this.__data__={hash:new Kr,map:new(Ir||Br),string:new Kr}},Fr.prototype.delete=function(t){var e=hs(this,t).delete(t);return this.size-=e?1:0,e},Fr.prototype.get=function(t){return hs(this,t).get(t)},Fr.prototype.has=function(t){return hs(this,t).has(t)},Fr.prototype.set=function(t,e){var r=hs(this,t),i=r.size;return r.set(t,e),this.size+=r.size==i?0:1,this},Wr.prototype.add=Wr.prototype.push=function(t){return this.__data__.set(t,n),this},Wr.prototype.has=function(t){return this.__data__.has(t)},Gr.prototype.clear=function(){this.__data__=new Br,this.size=0},Gr.prototype.delete=function(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r},Gr.prototype.get=function(t){return this.__data__.get(t)},Gr.prototype.has=function(t){return this.__data__.has(t)},Gr.prototype.set=function(t,e){var r=this.__data__;if(r instanceof Br){var i=r.__data__;if(!Ir||i.length<199)return i.push([t,e]),this.size=++r.size,this;r=this.__data__=new Fr(i)}return r.set(t,e),this.size=r.size,this};var li=Un(mi),fi=Un(bi,!0);function pi(t,e){var r=!0;return li(t,(function(t,i,n){return r=!!e(t,i,n)})),r}function di(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 gi(t,e){var r=[];return li(t,(function(t,i,n){e(t,i,n)&&r.push(t)})),r}function yi(t,e,r,i,n){var s=-1,o=t.length;for(r||(r=vs),n||(n=[]);++s<o;){var a=t[s];e>0&&r(a)?e>1?yi(a,e-1,r,i,n):je(n,a):i||(n[n.length]=a)}return n}var vi=jn(),_i=jn(!0);function mi(t,e){return t&&vi(t,e,Ta)}function bi(t,e){return t&&_i(t,e,Ta)}function wi(t,e){return xe(e,(function(e){return Zo(t[e])}))}function Ei(t,e){for(var i=0,n=(e=mn(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 Bo(t)?i:je(i,r(t))}function Ii(t){return null==t?t===r?"[object Undefined]":"[object Null]":te&&te in Ot(t)?function(t){var e=Lt.call(t,te),i=t[te];try{t[te]=r;var n=!0}catch{}var s=kt.call(t);return n&&(e?t[te]=i:delete t[te]),s}(t):function(t){return kt.call(t)}(t)}function Pi(t,e){return t>e}function Oi(t,e){return null!=t&&Lt.call(t,e)}function Ai(t,e){return null!=t&&e in Ot(t)}function Ni(t,e,i){for(var n=i?Te:Ce,s=t[0].length,o=t.length,a=o,c=st(o),h=1/0,u=[];a--;){var l=t[a];a&&e&&(l=Ue(l,Xe(e))),h=_r(l.length,h),c[a]=!i&&(e||s>=120&&l.length>=120)?new Wr(a&&l):r}l=t[0];var f=-1,p=c[0];t:for(;++f<s&&u.length<h;){var d=l[f],g=e?e(d):d;if(d=i||0!==d?d:0,!(p?Qe(p,g):n(u,g,i))){for(a=o;--a;){var y=c[a];if(!(y?Qe(y,g):n(t[a],g,i)))continue t}p&&p.push(g),u.push(d)}}return u}function Ri(t,e,i){var n=null==(t=As(t,e=mn(e,t)))?t:t[Ds(Ys(e))];return null==n?r:Pe(n,t,i)}function xi(t){return ra(t)&&Ii(t)==y}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=Bo(t),c=Bo(e),h=a?v:ds(t),u=c?v:ds(e),l=(h=h==y?P:h)==P,f=(u=u==y?P:u)==P,p=h==u;if(p&&Jo(t)){if(!Jo(e))return!1;a=!0,l=!1}if(p&&!l)return o||(o=new Gr),a||ua(t)?es(t,e,i,n,s,o):function(t,e,r,i,n,s,o){switch(r){case U:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case T:return!(t.byteLength!=e.byteLength||!s(new Kt(t),new Kt(e)));case _:case m:case I:return qo(+t,+e);case b:return t.name==e.name&&t.message==e.message;case A:case R:return t==e+"";case S:var a=ar;case N:var c=1&i;if(a||(a=ur),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=es(a(t),a(e),i,n,s,o);return o.delete(t),u;case x:if(Dr)return Dr.call(t)==Dr.call(e)}return!1}(t,e,h,i,n,s,o);if(!(1&i)){var d=l&&Lt.call(t,"__wrapped__"),g=f&&Lt.call(e,"__wrapped__");if(d||g){var w=d?t.value():t,E=g?e.value():e;return o||(o=new Gr),s(w,E,i,n,o)}}return!!p&&(o||(o=new Gr),function(t,e,i,n,s,o){var a=1&i,c=is(t),h=c.length,u=is(e).length;if(h!=u&&!a)return!1;for(var l=h;l--;){var f=c[l];if(!(a?f in e:Lt.call(e,f)))return!1}var p=o.get(t),d=o.get(e);if(p&&d)return p==e&&d==t;var g=!0;o.set(t,e),o.set(e,t);for(var y=a;++l<h;){var v=t[f=c[l]],_=e[f];if(n)var m=a?n(_,v,f,e,t,o):n(v,_,f,t,e,o);if(!(m===r?v===_||s(v,_,i,n,o):m)){g=!1;break}y||(y="constructor"==f)}if(g&&!y){var b=t.constructor,w=e.constructor;b!=w&&"constructor"in t&&"constructor"in e&&!("function"==typeof b&&b instanceof b&&"function"==typeof w&&w instanceof w)&&(g=!1)}return o.delete(t),o.delete(e),g}(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=Ot(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],l=c[1];if(a&&c[2]){if(u===r&&!(h in t))return!1}else{var f=new Gr;if(n)var p=n(u,l,h,t,e,f);if(!(p===r?Ci(l,u,3,n,f):p))return!1}}return!0}function Ui(t){return!(!ea(t)||function(t){return!!Dt&&Dt in t}(t))&&(Zo(t)?qt:yt).test(ks(t))}function ji(t){return"function"==typeof t?t:null==t?nc:"object"==typeof t?Bo(t)?$i(t[0],t[1]):zi(t):pc(t)}function Li(t){if(!Ss(t))return yr(t);var e=[];for(var r in Ot(t))Lt.call(t,r)&&"constructor"!=r&&e.push(r);return e}function Mi(t){if(!ea(t))return function(t){var e=[];if(null!=t)for(var r in Ot(t))e.push(r);return e}(t);var e=Ss(t),r=[];for(var i in t)"constructor"==i&&(e||!Lt.call(t,i))||r.push(i);return r}function Di(t,e){return t<e}function ki(t,e){var r=-1,i=Wo(t)?st(t.length):[];return li(t,(function(t,n,s){i[++r]=e(t,n,s)})),i}function zi(t){var e=us(t);return 1==e.length&&e[0][2]?Ps(e[0][0],e[0][1]):function(r){return r===t||Ti(r,t,e)}}function $i(t,e){return bs(t)&&Is(e)?Ps(Ds(t),e):function(i){var n=Aa(i,t);return n===r&&n===e?Na(i,t):Ci(e,n,3)}}function qi(t,e,i,n,s){t!==e&&vi(e,(function(o,a){if(s||(s=new Gr),ea(o))!function(t,e,i,n,s,o,a){var c=Rs(t,i),h=Rs(e,i),u=a.get(h);if(u)return void Qr(t,i,u);var l=o?o(c,h,i+"",t,e,a):r,f=l===r;if(f){var p=Bo(h),d=!p&&Jo(h),g=!p&&!d&&ua(h);l=h,p||d||g?Bo(c)?l=c:Go(c)?l=Rn(c):d?(f=!1,l=Sn(h,!0)):g?(f=!1,l=Pn(h,!0)):l=[]:sa(h)||Ko(h)?(l=c,Ko(c)?l=_a(c):(!ea(c)||Zo(c))&&(l=ys(h))):f=!1}f&&(a.set(h,l),s(l,h,n,o,a),a.delete(h)),Qr(t,i,l)}(t,e,a,i,qi,n,s);else{var c=n?n(Rs(t,a),o,a+"",t,e,s):r;c===r&&(c=o),Qr(t,a,c)}}),Ua)}function Hi(t,e){var i=t.length;if(i)return _s(e+=e<0?i:0,i)?t[e]:r}function Vi(t,e,r){e=e.length?Ue(e,(function(t){return Bo(t)?function(e){return Ei(e,1===t.length?t[0]:t)}:t})):[nc];var i=-1;e=Ue(e,Xe(cs()));var n=ki(t,(function(t,r,n){var s=Ue(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=On(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 Ki(t,e,r){for(var i=-1,n=e.length,s={};++i<n;){var o=e[i],a=Ei(t,o);r(a,o)&&Zi(s,mn(o,t),a)}return s}function Bi(t,e,r,i){var n=i?He:qe,s=-1,o=e.length,a=t;for(t===e&&(e=Rn(e)),r&&(a=Ue(t,Xe(r)));++s<o;)for(var c=0,h=e[s],u=r?r(h):h;(c=n(a,u,c,i))>-1;)a!==t&&Jt.call(a,c,1),Jt.call(t,c,1);return t}function Fi(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;_s(n)?Jt.call(t,n,1):ln(t,n)}}return t}function Wi(t,e){return t+ge(wr()*(e-t+1))}function Gi(t,e){var r="";if(!t||e<1||e>f)return r;do{e%2&&(r+=t),(e=ge(e/2))&&(t+=t)}while(e);return r}function Ji(t,e){return Ts(Os(t,e,nc),t+"")}function Yi(t){return Yr(qa(t))}function Xi(t,e){var r=qa(t);return Ls(r,oi(e,0,r.length))}function Zi(t,e,i,n){if(!ea(t))return t;for(var s=-1,o=(e=mn(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 l=c[h];(u=n?n(l,h,c):r)===r&&(u=ea(l)?l:_s(e[s+1])?[]:{})}ti(c,h,u),c=c[h]}return t}var Qi=Rr?function(t,e){return Rr.set(t,e),t}:nc,tn=re?function(t,e){return re(t,"toString",{configurable:!0,enumerable:!1,value:ec(e),writable:!0})}:nc;function en(t){return Ls(qa(t))}function rn(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=st(n);++i<n;)s[i]=t[i+e];return s}function nn(t,e){var r;return li(t,(function(t,i,n){return!(r=e(t,i,n))})),!!r}function sn(t,e,r){var i=0,n=null==t?i:t.length;if("number"==typeof e&&e==e&&n<=2147483647){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 on(t,e,nc,r)}function on(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 l=ge((s+o)/2),f=i(t[l]),p=f!==r,d=null===f,g=f==f,y=ha(f);if(a)var v=n||g;else v=u?g&&(n||p):c?g&&p&&(n||!d):h?g&&p&&!d&&(n||!y):!d&&!y&&(n?f<=e:f<e);v?s=l+1:o=l}return _r(o,4294967294)}function an(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||!qo(a,c)){var c=a;s[n++]=0===o?0:o}}return s}function cn(t){return"number"==typeof t?t:ha(t)?p:+t}function hn(t){if("string"==typeof t)return t;if(Bo(t))return Ue(t,hn)+"";if(ha(t))return kr?kr.call(t):"";var e=t+"";return"0"==e&&1/t==-l?"-0":e}function un(t,e,r){var i=-1,n=Ce,s=t.length,o=!0,a=[],c=a;if(r)o=!1,n=Te;else if(s>=200){var h=e?null:Jn(t);if(h)return ur(h);o=!1,n=Qe,c=new Wr}else c=e?[]:a;t:for(;++i<s;){var u=t[i],l=e?e(u):u;if(u=r||0!==u?u:0,o&&l==l){for(var f=c.length;f--;)if(c[f]===l)continue t;e&&c.push(l),a.push(u)}else n(c,l,r)||(c!==a&&c.push(l),a.push(u))}return a}function ln(t,e){return null==(t=As(t,e=mn(e,t)))||delete t[Ds(Ys(e))]}function fn(t,e,r,i){return Zi(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?rn(t,i?0:s,i?s+1:n):rn(t,i?s+1:0,i?n:s)}function dn(t,e){var r=t;return r instanceof Vr&&(r=r.value()),Le(e,(function(t,e){return e.func.apply(e.thisArg,je([t],e.args))}),r)}function gn(t,e,r){var i=t.length;if(i<2)return i?un(t[0]):[];for(var n=-1,s=st(i);++n<i;)for(var o=t[n],a=-1;++a<i;)a!=n&&(s[n]=ui(s[n]||o,t[a],e,r));return un(yi(s,1),e,r)}function yn(t,e,i){for(var n=-1,s=t.length,o=e.length,a={};++n<s;){var c=n<o?e[n]:r;i(a,t[n],c)}return a}function vn(t){return Go(t)?t:[]}function _n(t){return"function"==typeof t?t:nc}function mn(t,e){return Bo(t)?t:bs(t,e)?[t]:Ms(ma(t))}var bn=Ji;function wn(t,e,i){var n=t.length;return i=i===r?n:i,!e&&i>=n?t:rn(t,e,i)}var En=ce||function(t){return pe.clearTimeout(t)};function Sn(t,e){if(e)return t.slice();var r=t.length,i=Bt?Bt(r):new t.constructor(r);return t.copy(i),i}function In(t){var e=new t.constructor(t.byteLength);return new Kt(e).set(new Kt(t)),e}function Pn(t,e){var r=e?In(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}function On(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 An(t,e,r,i){for(var n=-1,s=t.length,o=r.length,a=-1,c=e.length,h=vr(s-o,0),u=st(c+h),l=!i;++a<c;)u[a]=e[a];for(;++n<o;)(l||n<s)&&(u[r[n]]=t[n]);for(;h--;)u[a++]=t[n++];return u}function Nn(t,e,r,i){for(var n=-1,s=t.length,o=-1,a=r.length,c=-1,h=e.length,u=vr(s-a,0),l=st(u+h),f=!i;++n<u;)l[n]=t[n];for(var p=n;++c<h;)l[p+c]=e[c];for(;++o<a;)(f||n<s)&&(l[p+r[o]]=t[n++]);return l}function Rn(t,e){var r=-1,i=t.length;for(e||(e=st(i));++r<i;)e[r]=t[r];return e}function xn(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?ni(i,c,h):ti(i,c,h)}return i}function Cn(t,e){return function(r,i){var n=Bo(r)?Oe:ri,s=e?e():{};return n(r,t,cs(i,2),s)}}function Tn(t){return Ji((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&&ms(i[0],i[1],a)&&(o=s<3?r:o,s=1),e=Ot(e);++n<s;){var c=i[n];c&&t(e,c,n,o)}return e}))}function Un(t,e){return function(r,i){if(null==r)return r;if(!Wo(r))return t(r,i);for(var n=r.length,s=e?n:-1,o=Ot(r);(e?s--:++s<n)&&!1!==i(o[s],s,o););return r}}function jn(t){return function(e,r,i){for(var n=-1,s=Ot(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 Ln(t){return function(e){var i=or(e=ma(e))?fr(e):r,n=i?i[0]:e.charAt(0),s=i?wn(i,1).join(""):e.slice(1);return n[t]()+s}}function Mn(t){return function(e){return Le(Za(Ka(e).replace(Zt,"")),t,"")}}function Dn(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=$r(t.prototype),i=t.apply(r,e);return ea(i)?i:r}}function kn(t){return function(e,i,n){var s=Ot(e);if(!Wo(e)){var o=cs(i,3);e=Ta(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 zn(t){return rs((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"==os(a))var c=new Hr([],!0)}for(s=c?s:n;++s<n;){var h=os(a=e[s]),u="wrapper"==h?ss(a):r;c=u&&ws(u[0])&&424==u[1]&&!u[4].length&&1==u[9]?c[os(u[0])].apply(c,u[3]):1==a.length&&ws(a)?c[h]():c.thru(a)}return function(){var t=arguments,r=t[0];if(c&&1==t.length&&Bo(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 $n(t,e,i,n,s,o,a,c,u,l){var f=e&h,p=1&e,d=2&e,g=24&e,y=512&e,v=d?r:Dn(t);return function r(){for(var h=arguments.length,_=st(h),m=h;m--;)_[m]=arguments[m];if(g)var b=as(r),w=rr(_,b);if(n&&(_=An(_,n,s,g)),o&&(_=Nn(_,o,a,g)),h-=w,g&&h<l){var E=hr(_,b);return Wn(t,e,$n,r.placeholder,i,_,E,c,u,l-h)}var S=p?i:this,I=d?S[t]:t;return h=_.length,c?_=Ns(_,c):y&&h>1&&_.reverse(),f&&u<h&&(_.length=u),this&&this!==pe&&this instanceof r&&(I=v||Dn(I)),I.apply(S,_)}}function qn(t,e){return function(r,i){return function(t,e,r,i){return mi(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=hn(i),n=hn(n)):(i=cn(i),n=cn(n)),s=t(i,n)}return s}}function Vn(t){return rs((function(e){return e=Ue(e,Xe(cs())),Ji((function(r){var i=this;return t(e,(function(t){return Pe(t,i,r)}))}))}))}function Kn(t,e){var i=(e=e===r?" ":hn(e)).length;if(i<2)return i?Gi(e,t):e;var n=Gi(e,de(t/lr(e)));return or(e)?wn(fr(n),0,t).join(""):n.slice(0,t)}function Bn(t){return function(e,i,n){return n&&"number"!=typeof n&&ms(e,i,n)&&(i=n=r),e=da(e),i===r?(i=e,e=0):i=da(i),function(t,e,r,i){for(var n=-1,s=vr(de((e-t)/(r||1)),0),o=st(s);s--;)o[i?s:++n]=t,t+=r;return o}(e,i,n=n===r?e<i?1:-1:da(n),t)}}function Fn(t){return function(e,r){return"string"==typeof e&&"string"==typeof r||(e=va(e),r=va(r)),t(e,r)}}function Wn(t,e,i,n,s,o,h,u,l,f){var p=8&e;e|=p?a:c,4&(e&=~(p?c:a))||(e&=-4);var d=[t,e,s,p?o:r,p?h:r,p?r:o,p?r:h,u,l,f],g=i.apply(r,d);return ws(t)&&xs(g,d),g.placeholder=n,Us(g,t,e)}function Gn(t){var e=Pt[t];return function(t,r){if(t=va(t),(r=null==r?0:_r(ga(r),292))&&ke(t)){var i=(ma(t)+"e").split("e");return+((i=(ma(e(i[0]+"e"+(+i[1]+r)))+"e").split("e"))[0]+"e"+(+i[1]-r))}return e(t)}}var Jn=Or&&1/ur(new Or([,-0]))[1]==l?function(t){return new Or(t)}:hc;function Yn(t){return function(e){var r=ds(e);return r==S?ar(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 Ue(e,(function(e){return[e,t[e]]}))}(e,t(e))}}function Xn(t,e,n,l,f,p,d,g){var y=2&e;if(!y&&"function"!=typeof t)throw new Rt(i);var v=l?l.length:0;if(v||(e&=-97,l=f=r),d=d===r?d:vr(ga(d),0),g=g===r?g:ga(g),v-=f?f.length:0,e&c){var _=l,m=f;l=f=r}var b=y?r:ss(t),w=[t,e,n,l,f,_,m,p,d,g];if(b&&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 l=t[3];t[3]=l?An(l,c,e[4]):c,t[4]=l?hr(t[3],s):e[4]}(c=e[5])&&(l=t[5],t[5]=l?Nn(l,c,e[6]):c,t[6]=l?hr(t[5],s):e[6]),(c=e[7])&&(t[7]=c),i&h&&(t[8]=null==t[8]?e[8]:_r(t[8],e[8])),null==t[9]&&(t[9]=e[9]),t[0]=e[0],t[1]=n}(w,b),t=w[0],e=w[1],n=w[2],l=w[3],f=w[4],!(g=w[9]=w[9]===r?y?0:t.length:vr(w[9]-v,0))&&24&e&&(e&=-25),e&&1!=e)E=8==e||e==o?function(t,e,i){var n=Dn(t);return function s(){for(var o=arguments.length,a=st(o),c=o,h=as(s);c--;)a[c]=arguments[c];var u=o<3&&a[0]!==h&&a[o-1]!==h?[]:hr(a,h);return(o-=u.length)<i?Wn(t,e,$n,s.placeholder,r,a,u,r,r,i-o):Pe(this&&this!==pe&&this instanceof s?n:t,this,a)}}(t,e,g):e!=a&&33!=e||f.length?$n.apply(r,w):function(t,e,r,i){var n=1&e,s=Dn(t);return function e(){for(var o=-1,a=arguments.length,c=-1,h=i.length,u=st(h+a),l=this&&this!==pe&&this instanceof e?s:t;++c<h;)u[c]=i[c];for(;a--;)u[c++]=arguments[++o];return Pe(l,n?r:this,u)}}(t,e,n,l);else var E=function(t,e,r){var i=1&e,n=Dn(t);return function e(){return(this&&this!==pe&&this instanceof e?n:t).apply(i?r:this,arguments)}}(t,e,n);return Us((b?Qi:xs)(E,w),t,e)}function Zn(t,e,i,n){return t===r||qo(t,Tt[i])&&!Lt.call(n,i)?e:t}function Qn(t,e,i,n,s,o){return ea(t)&&ea(e)&&(o.set(e,t),qi(t,e,r,Qn,o),o.delete(e)),t}function ts(t){return sa(t)?r:t}function es(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),l=o.get(e);if(u&&l)return u==e&&l==t;var f=-1,p=!0,d=2&i?new Wr:r;for(o.set(t,e),o.set(e,t);++f<c;){var g=t[f],y=e[f];if(n)var v=a?n(y,g,f,e,t,o):n(g,y,f,t,e,o);if(v!==r){if(v)continue;p=!1;break}if(d){if(!De(e,(function(t,e){if(!Qe(d,e)&&(g===t||s(g,t,i,n,o)))return d.push(e)}))){p=!1;break}}else if(g!==y&&!s(g,y,i,n,o)){p=!1;break}}return o.delete(t),o.delete(e),p}function rs(t){return Ts(Os(t,r,Bs),t+"")}function is(t){return Si(t,Ta,fs)}function ns(t){return Si(t,Ua,ps)}var ss=Rr?function(t){return Rr.get(t)}:hc;function os(t){for(var e=t.name+"",r=xr[e],i=Lt.call(xr,e)?r.length:0;i--;){var n=r[i],s=n.func;if(null==s||s==t)return n.name}return e}function as(t){return(Lt.call(zr,"placeholder")?zr:t).placeholder}function cs(){var t=zr.iteratee||sc;return t=t===sc?ji:t,arguments.length?t(arguments[0],arguments[1]):t}function hs(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 us(t){for(var e=Ta(t),r=e.length;r--;){var i=e[r],n=t[i];e[r]=[i,n,Is(n)]}return e}function ls(t,e){var i=function(t,e){return null==t?r:t[e]}(t,e);return Ui(i)?i:r}var fs=ve?function(t){return null==t?[]:(t=Ot(t),xe(ve(t),(function(e){return Gt.call(t,e)})))}:yc,ps=ve?function(t){for(var e=[];t;)je(e,fs(t)),t=Ft(t);return e}:yc,ds=Ii;function gs(t,e,r){for(var i=-1,n=(e=mn(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)&&_s(o,n)&&(Bo(t)||Ko(t))}function ys(t){return"function"!=typeof t.constructor||Ss(t)?{}:$r(Ft(t))}function vs(t){return Bo(t)||Ko(t)||!!(Yt&&t&&t[Yt])}function _s(t,e){var r=typeof t;return!!(e=e??f)&&("number"==r||"symbol"!=r&&_t.test(t))&&t>-1&&t%1==0&&t<e}function ms(t,e,r){if(!ea(r))return!1;var i=typeof e;return!!("number"==i?Wo(r)&&_s(e,r.length):"string"==i&&e in r)&&qo(r[e],t)}function bs(t,e){if(Bo(t))return!1;var r=typeof t;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=t&&!ha(t))||(tt.test(t)||!Q.test(t)||null!=e&&t in Ot(e))}function ws(t){var e=os(t),r=zr[e];if("function"!=typeof r||!(e in Vr.prototype))return!1;if(t===r)return!0;var i=ss(r);return!!i&&t===i[0]}(Sr&&ds(new Sr(new ArrayBuffer(1)))!=U||Ir&&ds(new Ir)!=S||Pr&&ds(Pr.resolve())!=O||Or&&ds(new Or)!=N||Ar&&ds(new Ar)!=C)&&(ds=function(t){var e=Ii(t),i=e==P?t.constructor:r,n=i?ks(i):"";if(n)switch(n){case Cr:return U;case Tr:return S;case Ur:return O;case jr:return N;case Lr:return C}return e});var Es=Ut?Zo:vc;function Ss(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||Tt)}function Is(t){return t==t&&!ea(t)}function Ps(t,e){return function(i){return null!=i&&(i[t]===e&&(e!==r||t in Ot(i)))}}function Os(t,e,i){return e=vr(e===r?t.length-1:e,0),function(){for(var r=arguments,n=-1,s=vr(r.length-e,0),o=st(s);++n<s;)o[n]=r[e+n];n=-1;for(var a=st(e+1);++n<e;)a[n]=r[n];return a[e]=i(o),Pe(t,this,a)}}function As(t,e){return e.length<2?t:Ei(t,rn(e,0,-1))}function Ns(t,e){for(var i=t.length,n=_r(e.length,i),s=Rn(t);n--;){var o=e[n];t[n]=_s(o,i)?s[o]:r}return t}function Rs(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]}var xs=js(Qi),Cs=fe||function(t,e){return pe.setTimeout(t,e)},Ts=js(tn);function Us(t,e,r){var i=e+"";return Ts(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(ot,"{\n/* [wrapped with "+e+"] */\n")}(i,function(t,e){return Ae(g,(function(r){var i="_."+r[0];e&r[1]&&!Ce(t,i)&&t.push(i)})),t.sort()}(function(t){var e=t.match(at);return e?e[1].split(ct):[]}(i),r)))}function js(t){var e=0,i=0;return function(){var n=mr(),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=Wi(i,s),a=t[o];t[o]=t[i],t[i]=a}return t.length=e,t}var Ms=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(et,(function(t,r,i,n){e.push(i?n.replace(lt,"$1"):r||t)})),e}));function Ds(t){if("string"==typeof t||ha(t))return t;var e=t+"";return"0"==e&&1/t==-l?"-0":e}function ks(t){if(null!=t){try{return jt.call(t)}catch{}try{return t+""}catch{}}return""}function zs(t){if(t instanceof Vr)return t.clone();var e=new Hr(t.__wrapped__,t.__chain__);return e.__actions__=Rn(t.__actions__),e.__index__=t.__index__,e.__values__=t.__values__,e}var $s=Ji((function(t,e){return Go(t)?ui(t,yi(e,1,Go,!0)):[]})),qs=Ji((function(t,e){var i=Ys(e);return Go(i)&&(i=r),Go(t)?ui(t,yi(e,1,Go,!0),cs(i,2)):[]})),Hs=Ji((function(t,e){var i=Ys(e);return Go(i)&&(i=r),Go(t)?ui(t,yi(e,1,Go,!0),r,i):[]}));function Vs(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=vr(i+n,0)),$e(t,cs(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?vr(n+s,0):_r(s,n-1)),$e(t,cs(e,3),s,!0)}function Bs(t){return(null==t?0:t.length)?yi(t,1):[]}function Fs(t){return t&&t.length?t[0]:r}var Ws=Ji((function(t){var e=Ue(t,vn);return e.length&&e[0]===t[0]?Ni(e):[]})),Gs=Ji((function(t){var e=Ys(t),i=Ue(t,vn);return e===Ys(i)?e=r:i.pop(),i.length&&i[0]===t[0]?Ni(i,cs(e,2)):[]})),Js=Ji((function(t){var e=Ys(t),i=Ue(t,vn);return(e="function"==typeof e?e:r)&&i.pop(),i.length&&i[0]===t[0]?Ni(i,r,e):[]}));function Ys(t){var e=null==t?0:t.length;return e?t[e-1]:r}var Xs=Ji(Zs);function Zs(t,e){return t&&t.length&&e&&e.length?Bi(t,e):t}var Qs=rs((function(t,e){var r=null==t?0:t.length,i=si(t,e);return Fi(t,Ue(e,(function(t){return _s(t,r)?+t:t})).sort(On)),i}));function to(t){return null==t?t:Er.call(t)}var eo=Ji((function(t){return un(yi(t,1,Go,!0))})),ro=Ji((function(t){var e=Ys(t);return Go(e)&&(e=r),un(yi(t,1,Go,!0),cs(e,2))})),io=Ji((function(t){var e=Ys(t);return e="function"==typeof e?e:r,un(yi(t,1,Go,!0),r,e)}));function no(t){if(!t||!t.length)return[];var e=0;return t=xe(t,(function(t){if(Go(t))return e=vr(t.length,e),!0})),Je(e,(function(e){return Ue(t,Be(e))}))}function so(t,e){if(!t||!t.length)return[];var i=no(t);return null==e?i:Ue(i,(function(t){return Pe(e,r,t)}))}var oo=Ji((function(t,e){return Go(t)?ui(t,e):[]})),ao=Ji((function(t){return gn(xe(t,Go))})),co=Ji((function(t){var e=Ys(t);return Go(e)&&(e=r),gn(xe(t,Go),cs(e,2))})),ho=Ji((function(t){var e=Ys(t);return e="function"==typeof e?e:r,gn(xe(t,Go),r,e)})),uo=Ji(no);var lo=Ji((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 fo(t){var e=zr(t);return e.__chain__=!0,e}function po(t,e){return e(t)}var go=rs((function(t){var e=t.length,i=e?t[0]:0,n=this.__wrapped__,s=function(e){return si(e,t)};return!(e>1||this.__actions__.length)&&n instanceof Vr&&_s(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 yo=Cn((function(t,e,r){Lt.call(t,r)?++t[r]:ni(t,r,1)}));var vo=kn(Vs),_o=kn(Ks);function mo(t,e){return(Bo(t)?Ae:li)(t,cs(e,3))}function bo(t,e){return(Bo(t)?Ne:fi)(t,cs(e,3))}var wo=Cn((function(t,e,r){Lt.call(t,r)?t[r].push(e):ni(t,r,[e])}));var Eo=Ji((function(t,e,r){var i=-1,n="function"==typeof e,s=Wo(t)?st(t.length):[];return li(t,(function(t){s[++i]=n?Pe(e,t,r):Ri(t,e,r)})),s})),So=Cn((function(t,e,r){ni(t,r,e)}));function Io(t,e){return(Bo(t)?Ue:ki)(t,cs(e,3))}var Po=Cn((function(t,e,r){t[r?0:1].push(e)}),(function(){return[[],[]]}));var Oo=Ji((function(t,e){if(null==t)return[];var r=e.length;return r>1&&ms(t,e[0],e[1])?e=[]:r>2&&ms(e[0],e[1],e[2])&&(e=[e[0]]),Vi(t,yi(e,1),[])})),Ao=le||function(){return pe.Date.now()};function No(t,e,i){return e=i?r:e,e=t&&null==e?t.length:e,Xn(t,h,r,r,r,r,e)}function Ro(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 xo=Ji((function(t,e,r){var i=1;if(r.length){var n=hr(r,as(xo));i|=a}return Xn(t,i,e,r,n)})),Co=Ji((function(t,e,r){var i=3;if(r.length){var n=hr(r,as(Co));i|=a}return Xn(e,i,t,r,n)}));function To(t,e,n){var s,o,a,c,h,u,l=0,f=!1,p=!1,d=!0;if("function"!=typeof t)throw new Rt(i);function g(e){var i=s,n=o;return s=o=r,l=e,c=t.apply(n,i)}function y(t){return l=t,h=Cs(_,e),f?g(t):c}function v(t){var i=t-u;return u===r||i>=e||i<0||p&&t-l>=a}function _(){var t=Ao();if(v(t))return m(t);h=Cs(_,function(t){var r=e-(t-u);return p?_r(r,a-(t-l)):r}(t))}function m(t){return h=r,d&&s?g(t):(s=o=r,c)}function b(){var t=Ao(),i=v(t);if(s=arguments,o=this,u=t,i){if(h===r)return y(u);if(p)return En(h),h=Cs(_,e),g(u)}return h===r&&(h=Cs(_,e)),c}return e=va(e)||0,ea(n)&&(f=!!n.leading,a=(p="maxWait"in n)?vr(va(n.maxWait)||0,e):a,d="trailing"in n?!!n.trailing:d),b.cancel=function(){h!==r&&En(h),l=0,s=u=o=h=r},b.flush=function(){return h===r?c:m(Ao())},b}var Uo=Ji((function(t,e){return hi(t,1,e)})),jo=Ji((function(t,e,r){return hi(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||Fr),r}function Mo(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=Fr;var Do=bn((function(t,e){var r=(e=1==e.length&&Bo(e[0])?Ue(e[0],Xe(cs())):Ue(yi(e,1),Xe(cs()))).length;return Ji((function(i){for(var n=-1,s=_r(i.length,r);++n<s;)i[n]=e[n].call(this,i[n]);return Pe(t,this,i)}))})),ko=Ji((function(t,e){var i=hr(e,as(ko));return Xn(t,a,r,e,i)})),zo=Ji((function(t,e){var i=hr(e,as(zo));return Xn(t,c,r,e,i)})),$o=rs((function(t,e){return Xn(t,u,r,r,r,e)}));function qo(t,e){return t===e||t!=t&&e!=e}var Ho=Fn(Pi),Vo=Fn((function(t,e){return t>=e})),Ko=xi(function(){return arguments}())?xi:function(t){return ra(t)&&Lt.call(t,"callee")&&!Gt.call(t,"callee")},Bo=st.isArray,Fo=me?Xe(me):function(t){return ra(t)&&Ii(t)==T};function Wo(t){return null!=t&&ta(t.length)&&!Zo(t)}function Go(t){return ra(t)&&Wo(t)}var Jo=_e||vc,Yo=be?Xe(be):function(t){return ra(t)&&Ii(t)==m};function Xo(t){if(!ra(t))return!1;var e=Ii(t);return e==b||"[object DOMException]"==e||"string"==typeof t.message&&"string"==typeof t.name&&!sa(t)}function Zo(t){if(!ea(t))return!1;var e=Ii(t);return e==w||e==E||"[object AsyncFunction]"==e||"[object Proxy]"==e}function Qo(t){return"number"==typeof t&&t==ga(t)}function ta(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=f}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=we?Xe(we):function(t){return ra(t)&&ds(t)==S};function na(t){return"number"==typeof t||ra(t)&&Ii(t)==I}function sa(t){if(!ra(t)||Ii(t)!=P)return!1;var e=Ft(t);if(null===e)return!0;var r=Lt.call(e,"constructor")&&e.constructor;return"function"==typeof r&&r instanceof r&&jt.call(r)==zt}var oa=Ee?Xe(Ee):function(t){return ra(t)&&Ii(t)==A};var aa=Se?Xe(Se):function(t){return ra(t)&&ds(t)==N};function ca(t){return"string"==typeof t||!Bo(t)&&ra(t)&&Ii(t)==R}function ha(t){return"symbol"==typeof t||ra(t)&&Ii(t)==x}var ua=Ie?Xe(Ie):function(t){return ra(t)&&ta(t.length)&&!!oe[Ii(t)]};var la=Fn(Di),fa=Fn((function(t,e){return t<=e}));function pa(t){if(!t)return[];if(Wo(t))return ca(t)?fr(t):Rn(t);if(Xt&&t[Xt])return function(t){for(var e,r=[];!(e=t.next()).done;)r.push(e.value);return r}(t[Xt]());var e=ds(t);return(e==S?ar:e==N?ur:qa)(t)}function da(t){return t?(t=va(t))===l||t===-l?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0}function ga(t){var e=da(t),r=e%1;return e==e?r?e-r:e:0}function ya(t){return t?oi(ga(t),0,d):0}function va(t){if("number"==typeof t)return t;if(ha(t))return p;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=Ye(t);var r=gt.test(t);return r||vt.test(t)?ue(t.slice(2),r?2:8):dt.test(t)?p:+t}function _a(t){return xn(t,Ua(t))}function ma(t){return null==t?"":hn(t)}var ba=Tn((function(t,e){if(Ss(e)||Wo(e))xn(e,Ta(e),t);else for(var r in e)Lt.call(e,r)&&ti(t,r,e[r])})),wa=Tn((function(t,e){xn(e,Ua(e),t)})),Ea=Tn((function(t,e,r,i){xn(e,Ua(e),t,i)})),Sa=Tn((function(t,e,r,i){xn(e,Ta(e),t,i)})),Ia=rs(si);var Pa=Ji((function(t,e){t=Ot(t);var i=-1,n=e.length,s=n>2?e[2]:r;for(s&&ms(e[0],e[1],s)&&(n=1);++i<n;)for(var o=e[i],a=Ua(o),c=-1,h=a.length;++c<h;){var u=a[c],l=t[u];(l===r||qo(l,Tt[u])&&!Lt.call(t,u))&&(t[u]=o[u])}return t})),Oa=Ji((function(t){return t.push(r,Qn),Pe(La,r,t)}));function Aa(t,e,i){var n=null==t?r:Ei(t,e);return n===r?i:n}function Na(t,e){return null!=t&&gs(t,e,Ai)}var Ra=qn((function(t,e,r){null!=e&&"function"!=typeof e.toString&&(e=kt.call(e)),t[e]=r}),ec(nc)),xa=qn((function(t,e,r){null!=e&&"function"!=typeof e.toString&&(e=kt.call(e)),Lt.call(t,e)?t[e].push(r):t[e]=[r]}),cs),Ca=Ji(Ri);function Ta(t){return Wo(t)?Jr(t):Li(t)}function Ua(t){return Wo(t)?Jr(t,!0):Mi(t)}var ja=Tn((function(t,e,r){qi(t,e,r)})),La=Tn((function(t,e,r,i){qi(t,e,r,i)})),Ma=rs((function(t,e){var r={};if(null==t)return r;var i=!1;e=Ue(e,(function(e){return e=mn(e,t),i||(i=e.length>1),e})),xn(t,ns(t),r),i&&(r=ai(r,7,ts));for(var n=e.length;n--;)ln(r,e[n]);return r}));var Da=rs((function(t,e){return null==t?{}:function(t,e){return Ki(t,e,(function(e,r){return Na(t,r)}))}(t,e)}));function ka(t,e){if(null==t)return{};var r=Ue(ns(t),(function(t){return[t]}));return e=cs(e),Ki(t,r,(function(t,r){return e(t,r[0])}))}var za=Yn(Ta),$a=Yn(Ua);function qa(t){return null==t?[]:Ze(t,Ta(t))}var Ha=Mn((function(t,e,r){return e=e.toLowerCase(),t+(r?Va(e):e)}));function Va(t){return Xa(ma(t).toLowerCase())}function Ka(t){return(t=ma(t))&&t.replace(mt,ir).replace(Qt,"")}var Ba=Mn((function(t,e,r){return t+(r?"-":"")+e.toLowerCase()})),Fa=Mn((function(t,e,r){return t+(r?" ":"")+e.toLowerCase()})),Wa=Ln("toLowerCase");var Ga=Mn((function(t,e,r){return t+(r?"_":"")+e.toLowerCase()}));var Ja=Mn((function(t,e,r){return t+(r?" ":"")+Xa(e)}));var Ya=Mn((function(t,e,r){return t+(r?" ":"")+e.toUpperCase()})),Xa=Ln("toUpperCase");function Za(t,e,i){return t=ma(t),(e=i?r:e)===r?function(t){return ie.test(t)}(t)?function(t){return t.match(ee)||[]}(t):function(t){return t.match(ht)||[]}(t):t.match(e)||[]}var Qa=Ji((function(t,e){try{return Pe(t,r,e)}catch(t){return Xo(t)?t:new St(t)}})),tc=rs((function(t,e){return Ae(e,(function(e){e=Ds(e),ni(t,e,xo(t[e],t))})),t}));function ec(t){return function(){return t}}var rc=zn(),ic=zn(!0);function nc(t){return t}function sc(t){return ji("function"==typeof t?t:ai(t,1))}var oc=Ji((function(t,e){return function(r){return Ri(r,t,e)}})),ac=Ji((function(t,e){return function(r){return Ri(t,r,e)}}));function cc(t,e,r){var i=Ta(e),n=wi(e,i);null==r&&(!ea(e)||!n.length&&i.length)&&(r=e,e=t,t=this,n=wi(e,Ta(e)));var s=!(ea(r)&&"chain"in r&&!r.chain),o=Zo(t);return Ae(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__),n=r.__actions__=Rn(this.__actions__);return n.push({func:i,args:arguments,thisArg:t}),r.__chain__=e,r}return i.apply(t,je([this.value()],arguments))})})),t}function hc(){}var uc=Vn(Ue),lc=Vn(Re),fc=Vn(De);function pc(t){return bs(t)?Be(Ds(t)):function(t){return function(e){return Ei(e,t)}}(t)}var dc=Bn(),gc=Bn(!0);function yc(){return[]}function vc(){return!1}var _c=Hn((function(t,e){return t+e}),0),mc=Gn("ceil"),bc=Hn((function(t,e){return t/e}),1),wc=Gn("floor");var Ec=Hn((function(t,e){return t*e}),1),Sc=Gn("round"),Ic=Hn((function(t,e){return t-e}),0);return zr.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)}},zr.ary=No,zr.assign=ba,zr.assignIn=wa,zr.assignInWith=Ea,zr.assignWith=Sa,zr.at=Ia,zr.before=Ro,zr.bind=xo,zr.bindAll=tc,zr.bindKey=Co,zr.castArray=function(){if(!arguments.length)return[];var t=arguments[0];return Bo(t)?t:[t]},zr.chain=fo,zr.chunk=function(t,e,i){e=(i?ms(t,e,i):e===r)?1:vr(ga(e),0);var n=null==t?0:t.length;if(!n||e<1)return[];for(var s=0,o=0,a=st(de(n/e));s<n;)a[o++]=rn(t,s,s+=e);return a},zr.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},zr.concat=function(){var t=arguments.length;if(!t)return[];for(var e=st(t-1),r=arguments[0],i=t;i--;)e[i-1]=arguments[i];return je(Bo(r)?Rn(r):[r],yi(e,1))},zr.cond=function(t){var e=null==t?0:t.length,r=cs();return t=e?Ue(t,(function(t){if("function"!=typeof t[1])throw new Rt(i);return[r(t[0]),t[1]]})):[],Ji((function(r){for(var i=-1;++i<e;){var n=t[i];if(Pe(n[0],this,r))return Pe(n[1],this,r)}}))},zr.conforms=function(t){return function(t){var e=Ta(t);return function(r){return ci(r,t,e)}}(ai(t,1))},zr.constant=ec,zr.countBy=yo,zr.create=function(t,e){var r=$r(t);return null==e?r:ii(r,e)},zr.curry=function t(e,i,n){var s=Xn(e,8,r,r,r,r,r,i=n?r:i);return s.placeholder=t.placeholder,s},zr.curryRight=function t(e,i,n){var s=Xn(e,o,r,r,r,r,r,i=n?r:i);return s.placeholder=t.placeholder,s},zr.debounce=To,zr.defaults=Pa,zr.defaultsDeep=Oa,zr.defer=Uo,zr.delay=jo,zr.difference=$s,zr.differenceBy=qs,zr.differenceWith=Hs,zr.drop=function(t,e,i){var n=null==t?0:t.length;return n?rn(t,(e=i||e===r?1:ga(e))<0?0:e,n):[]},zr.dropRight=function(t,e,i){var n=null==t?0:t.length;return n?rn(t,0,(e=n-(e=i||e===r?1:ga(e)))<0?0:e):[]},zr.dropRightWhile=function(t,e){return t&&t.length?pn(t,cs(e,3),!0,!0):[]},zr.dropWhile=function(t,e){return t&&t.length?pn(t,cs(e,3),!0):[]},zr.fill=function(t,e,i,n){var s=null==t?0:t.length;return s?(i&&"number"!=typeof i&&ms(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:ya(n);i<n;)t[i++]=e;return t}(t,e,i,n)):[]},zr.filter=function(t,e){return(Bo(t)?xe:gi)(t,cs(e,3))},zr.flatMap=function(t,e){return yi(Io(t,e),1)},zr.flatMapDeep=function(t,e){return yi(Io(t,e),l)},zr.flatMapDepth=function(t,e,i){return i=i===r?1:ga(i),yi(Io(t,e),i)},zr.flatten=Bs,zr.flattenDeep=function(t){return(null==t?0:t.length)?yi(t,l):[]},zr.flattenDepth=function(t,e){return(null==t?0:t.length)?yi(t,e=e===r?1:ga(e)):[]},zr.flip=function(t){return Xn(t,512)},zr.flow=rc,zr.flowRight=ic,zr.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},zr.functions=function(t){return null==t?[]:wi(t,Ta(t))},zr.functionsIn=function(t){return null==t?[]:wi(t,Ua(t))},zr.groupBy=wo,zr.initial=function(t){return(null==t?0:t.length)?rn(t,0,-1):[]},zr.intersection=Ws,zr.intersectionBy=Gs,zr.intersectionWith=Js,zr.invert=Ra,zr.invertBy=xa,zr.invokeMap=Eo,zr.iteratee=sc,zr.keyBy=So,zr.keys=Ta,zr.keysIn=Ua,zr.map=Io,zr.mapKeys=function(t,e){var r={};return e=cs(e,3),mi(t,(function(t,i,n){ni(r,e(t,i,n),t)})),r},zr.mapValues=function(t,e){var r={};return e=cs(e,3),mi(t,(function(t,i,n){ni(r,i,e(t,i,n))})),r},zr.matches=function(t){return zi(ai(t,1))},zr.matchesProperty=function(t,e){return $i(t,ai(e,1))},zr.memoize=Lo,zr.merge=ja,zr.mergeWith=La,zr.method=oc,zr.methodOf=ac,zr.mixin=cc,zr.negate=Mo,zr.nthArg=function(t){return t=ga(t),Ji((function(e){return Hi(e,t)}))},zr.omit=Ma,zr.omitBy=function(t,e){return ka(t,Mo(cs(e)))},zr.once=function(t){return Ro(2,t)},zr.orderBy=function(t,e,i,n){return null==t?[]:(Bo(e)||(e=null==e?[]:[e]),Bo(i=n?r:i)||(i=null==i?[]:[i]),Vi(t,e,i))},zr.over=uc,zr.overArgs=Do,zr.overEvery=lc,zr.overSome=fc,zr.partial=ko,zr.partialRight=zo,zr.partition=Po,zr.pick=Da,zr.pickBy=ka,zr.property=pc,zr.propertyOf=function(t){return function(e){return null==t?r:Ei(t,e)}},zr.pull=Xs,zr.pullAll=Zs,zr.pullAllBy=function(t,e,r){return t&&t.length&&e&&e.length?Bi(t,e,cs(r,2)):t},zr.pullAllWith=function(t,e,i){return t&&t.length&&e&&e.length?Bi(t,e,r,i):t},zr.pullAt=Qs,zr.range=dc,zr.rangeRight=gc,zr.rearg=$o,zr.reject=function(t,e){return(Bo(t)?xe:gi)(t,Mo(cs(e,3)))},zr.remove=function(t,e){var r=[];if(!t||!t.length)return r;var i=-1,n=[],s=t.length;for(e=cs(e,3);++i<s;){var o=t[i];e(o,i,t)&&(r.push(o),n.push(i))}return Fi(t,n),r},zr.rest=function(t,e){if("function"!=typeof t)throw new Rt(i);return Ji(t,e=e===r?e:ga(e))},zr.reverse=to,zr.sampleSize=function(t,e,i){return e=(i?ms(t,e,i):e===r)?1:ga(e),(Bo(t)?Xr:Xi)(t,e)},zr.set=function(t,e,r){return null==t?t:Zi(t,e,r)},zr.setWith=function(t,e,i,n){return n="function"==typeof n?n:r,null==t?t:Zi(t,e,i,n)},zr.shuffle=function(t){return(Bo(t)?Zr:en)(t)},zr.slice=function(t,e,i){var n=null==t?0:t.length;return n?(i&&"number"!=typeof i&&ms(t,e,i)?(e=0,i=n):(e=null==e?0:ga(e),i=i===r?n:ga(i)),rn(t,e,i)):[]},zr.sortBy=Oo,zr.sortedUniq=function(t){return t&&t.length?an(t):[]},zr.sortedUniqBy=function(t,e){return t&&t.length?an(t,cs(e,2)):[]},zr.split=function(t,e,i){return i&&"number"!=typeof i&&ms(t,e,i)&&(e=i=r),(i=i===r?d:i>>>0)?(t=ma(t))&&("string"==typeof e||null!=e&&!oa(e))&&(!(e=hn(e))&&or(t))?wn(fr(t),0,i):t.split(e,i):[]},zr.spread=function(t,e){if("function"!=typeof t)throw new Rt(i);return e=null==e?0:vr(ga(e),0),Ji((function(r){var i=r[e],n=wn(r,0,e);return i&&je(n,i),Pe(t,this,n)}))},zr.tail=function(t){var e=null==t?0:t.length;return e?rn(t,1,e):[]},zr.take=function(t,e,i){return t&&t.length?rn(t,0,(e=i||e===r?1:ga(e))<0?0:e):[]},zr.takeRight=function(t,e,i){var n=null==t?0:t.length;return n?rn(t,(e=n-(e=i||e===r?1:ga(e)))<0?0:e,n):[]},zr.takeRightWhile=function(t,e){return t&&t.length?pn(t,cs(e,3),!1,!0):[]},zr.takeWhile=function(t,e){return t&&t.length?pn(t,cs(e,3)):[]},zr.tap=function(t,e){return e(t),t},zr.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),To(t,e,{leading:n,maxWait:e,trailing:s})},zr.thru=po,zr.toArray=pa,zr.toPairs=za,zr.toPairsIn=$a,zr.toPath=function(t){return Bo(t)?Ue(t,Ds):ha(t)?[t]:Rn(Ms(ma(t)))},zr.toPlainObject=_a,zr.transform=function(t,e,r){var i=Bo(t),n=i||Jo(t)||ua(t);if(e=cs(e,4),null==r){var s=t&&t.constructor;r=n?i?new s:[]:ea(t)&&Zo(s)?$r(Ft(t)):{}}return(n?Ae:mi)(t,(function(t,i,n){return e(r,t,i,n)})),r},zr.unary=function(t){return No(t,1)},zr.union=eo,zr.unionBy=ro,zr.unionWith=io,zr.uniq=function(t){return t&&t.length?un(t):[]},zr.uniqBy=function(t,e){return t&&t.length?un(t,cs(e,2)):[]},zr.uniqWith=function(t,e){return e="function"==typeof e?e:r,t&&t.length?un(t,r,e):[]},zr.unset=function(t,e){return null==t||ln(t,e)},zr.unzip=no,zr.unzipWith=so,zr.update=function(t,e,r){return null==t?t:fn(t,e,_n(r))},zr.updateWith=function(t,e,i,n){return n="function"==typeof n?n:r,null==t?t:fn(t,e,_n(i),n)},zr.values=qa,zr.valuesIn=function(t){return null==t?[]:Ze(t,Ua(t))},zr.without=oo,zr.words=Za,zr.wrap=function(t,e){return ko(_n(e),t)},zr.xor=ao,zr.xorBy=co,zr.xorWith=ho,zr.zip=uo,zr.zipObject=function(t,e){return yn(t||[],e||[],ti)},zr.zipObjectDeep=function(t,e){return yn(t||[],e||[],Zi)},zr.zipWith=lo,zr.entries=za,zr.entriesIn=$a,zr.extend=wa,zr.extendWith=Ea,cc(zr,zr),zr.add=_c,zr.attempt=Qa,zr.camelCase=Ha,zr.capitalize=Va,zr.ceil=mc,zr.clamp=function(t,e,i){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),oi(va(t),e,i)},zr.clone=function(t){return ai(t,4)},zr.cloneDeep=function(t){return ai(t,5)},zr.cloneDeepWith=function(t,e){return ai(t,5,e="function"==typeof e?e:r)},zr.cloneWith=function(t,e){return ai(t,4,e="function"==typeof e?e:r)},zr.conformsTo=function(t,e){return null==e||ci(t,e,Ta(e))},zr.deburr=Ka,zr.defaultTo=function(t,e){return null==t||t!=t?e:t},zr.divide=bc,zr.endsWith=function(t,e,i){t=ma(t),e=hn(e);var n=t.length,s=i=i===r?n:oi(ga(i),0,n);return(i-=e.length)>=0&&t.slice(i,s)==e},zr.eq=qo,zr.escape=function(t){return(t=ma(t))&&J.test(t)?t.replace(W,nr):t},zr.escapeRegExp=function(t){return(t=ma(t))&&it.test(t)?t.replace(rt,"\\$&"):t},zr.every=function(t,e,i){var n=Bo(t)?Re:pi;return i&&ms(t,e,i)&&(e=r),n(t,cs(e,3))},zr.find=vo,zr.findIndex=Vs,zr.findKey=function(t,e){return ze(t,cs(e,3),mi)},zr.findLast=_o,zr.findLastIndex=Ks,zr.findLastKey=function(t,e){return ze(t,cs(e,3),bi)},zr.floor=wc,zr.forEach=mo,zr.forEachRight=bo,zr.forIn=function(t,e){return null==t?t:vi(t,cs(e,3),Ua)},zr.forInRight=function(t,e){return null==t?t:_i(t,cs(e,3),Ua)},zr.forOwn=function(t,e){return t&&mi(t,cs(e,3))},zr.forOwnRight=function(t,e){return t&&bi(t,cs(e,3))},zr.get=Aa,zr.gt=Ho,zr.gte=Vo,zr.has=function(t,e){return null!=t&&gs(t,e,Oi)},zr.hasIn=Na,zr.head=Fs,zr.identity=nc,zr.includes=function(t,e,r,i){t=Wo(t)?t:qa(t),r=r&&!i?ga(r):0;var n=t.length;return r<0&&(r=vr(n+r,0)),ca(t)?r<=n&&t.indexOf(e,r)>-1:!!n&&qe(t,e,r)>-1},zr.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=vr(i+n,0)),qe(t,e,n)},zr.inRange=function(t,e,i){return e=da(e),i===r?(i=e,e=0):i=da(i),function(t,e,r){return t>=_r(e,r)&&t<vr(e,r)}(t=va(t),e,i)},zr.invoke=Ca,zr.isArguments=Ko,zr.isArray=Bo,zr.isArrayBuffer=Fo,zr.isArrayLike=Wo,zr.isArrayLikeObject=Go,zr.isBoolean=function(t){return!0===t||!1===t||ra(t)&&Ii(t)==_},zr.isBuffer=Jo,zr.isDate=Yo,zr.isElement=function(t){return ra(t)&&1===t.nodeType&&!sa(t)},zr.isEmpty=function(t){if(null==t)return!0;if(Wo(t)&&(Bo(t)||"string"==typeof t||"function"==typeof t.splice||Jo(t)||ua(t)||Ko(t)))return!t.length;var e=ds(t);if(e==S||e==N)return!t.size;if(Ss(t))return!Li(t).length;for(var r in t)if(Lt.call(t,r))return!1;return!0},zr.isEqual=function(t,e){return Ci(t,e)},zr.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},zr.isError=Xo,zr.isFinite=function(t){return"number"==typeof t&&ke(t)},zr.isFunction=Zo,zr.isInteger=Qo,zr.isLength=ta,zr.isMap=ia,zr.isMatch=function(t,e){return t===e||Ti(t,e,us(e))},zr.isMatchWith=function(t,e,i){return i="function"==typeof i?i:r,Ti(t,e,us(e),i)},zr.isNaN=function(t){return na(t)&&t!=+t},zr.isNative=function(t){if(Es(t))throw new St("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return Ui(t)},zr.isNil=function(t){return null==t},zr.isNull=function(t){return null===t},zr.isNumber=na,zr.isObject=ea,zr.isObjectLike=ra,zr.isPlainObject=sa,zr.isRegExp=oa,zr.isSafeInteger=function(t){return Qo(t)&&t>=-f&&t<=f},zr.isSet=aa,zr.isString=ca,zr.isSymbol=ha,zr.isTypedArray=ua,zr.isUndefined=function(t){return t===r},zr.isWeakMap=function(t){return ra(t)&&ds(t)==C},zr.isWeakSet=function(t){return ra(t)&&"[object WeakSet]"==Ii(t)},zr.join=function(t,e){return null==t?"":Fe.call(t,e)},zr.kebabCase=Ba,zr.last=Ys,zr.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?vr(n+s,0):_r(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):$e(t,Ve,s,!0)},zr.lowerCase=Fa,zr.lowerFirst=Wa,zr.lt=la,zr.lte=fa,zr.max=function(t){return t&&t.length?di(t,nc,Pi):r},zr.maxBy=function(t,e){return t&&t.length?di(t,cs(e,2),Pi):r},zr.mean=function(t){return Ke(t,nc)},zr.meanBy=function(t,e){return Ke(t,cs(e,2))},zr.min=function(t){return t&&t.length?di(t,nc,Di):r},zr.minBy=function(t,e){return t&&t.length?di(t,cs(e,2),Di):r},zr.stubArray=yc,zr.stubFalse=vc,zr.stubObject=function(){return{}},zr.stubString=function(){return""},zr.stubTrue=function(){return!0},zr.multiply=Ec,zr.nth=function(t,e){return t&&t.length?Hi(t,ga(e)):r},zr.noConflict=function(){return pe._===this&&(pe._=$t),this},zr.noop=hc,zr.now=Ao,zr.pad=function(t,e,r){t=ma(t);var i=(e=ga(e))?lr(t):0;if(!e||i>=e)return t;var n=(e-i)/2;return Kn(ge(n),r)+t+Kn(de(n),r)},zr.padEnd=function(t,e,r){t=ma(t);var i=(e=ga(e))?lr(t):0;return e&&i<e?t+Kn(e-i,r):t},zr.padStart=function(t,e,r){t=ma(t);var i=(e=ga(e))?lr(t):0;return e&&i<e?Kn(e-i,r)+t:t},zr.parseInt=function(t,e,r){return r||null==e?e=0:e&&(e=+e),br(ma(t).replace(nt,""),e||0)},zr.random=function(t,e,i){if(i&&"boolean"!=typeof i&&ms(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=da(t),e===r?(e=t,t=0):e=da(e)),t>e){var n=t;t=e,e=n}if(i||t%1||e%1){var s=wr();return _r(t+s*(e-t+he("1e-"+((s+"").length-1))),e)}return Wi(t,e)},zr.reduce=function(t,e,r){var i=Bo(t)?Le:We,n=arguments.length<3;return i(t,cs(e,4),r,n,li)},zr.reduceRight=function(t,e,r){var i=Bo(t)?Me:We,n=arguments.length<3;return i(t,cs(e,4),r,n,fi)},zr.repeat=function(t,e,i){return e=(i?ms(t,e,i):e===r)?1:ga(e),Gi(ma(t),e)},zr.replace=function(){var t=arguments,e=ma(t[0]);return t.length<3?e:e.replace(t[1],t[2])},zr.result=function(t,e,i){var n=-1,s=(e=mn(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},zr.round=Sc,zr.runInContext=t,zr.sample=function(t){return(Bo(t)?Yr:Yi)(t)},zr.size=function(t){if(null==t)return 0;if(Wo(t))return ca(t)?lr(t):t.length;var e=ds(t);return e==S||e==N?t.size:Li(t).length},zr.snakeCase=Ga,zr.some=function(t,e,i){var n=Bo(t)?De:nn;return i&&ms(t,e,i)&&(e=r),n(t,cs(e,3))},zr.sortedIndex=function(t,e){return sn(t,e)},zr.sortedIndexBy=function(t,e,r){return on(t,e,cs(r,2))},zr.sortedIndexOf=function(t,e){var r=null==t?0:t.length;if(r){var i=sn(t,e);if(i<r&&qo(t[i],e))return i}return-1},zr.sortedLastIndex=function(t,e){return sn(t,e,!0)},zr.sortedLastIndexBy=function(t,e,r){return on(t,e,cs(r,2),!0)},zr.sortedLastIndexOf=function(t,e){if(null==t?0:t.length){var r=sn(t,e,!0)-1;if(qo(t[r],e))return r}return-1},zr.startCase=Ja,zr.startsWith=function(t,e,r){return t=ma(t),r=null==r?0:oi(ga(r),0,t.length),e=hn(e),t.slice(r,r+e.length)==e},zr.subtract=Ic,zr.sum=function(t){return t&&t.length?Ge(t,nc):0},zr.sumBy=function(t,e){return t&&t.length?Ge(t,cs(e,2)):0},zr.template=function(t,e,i){var n=zr.templateSettings;i&&ms(t,e,i)&&(e=r),t=ma(t),e=Ea({},e,n,Zn);var s,o,a=Ea({},e.imports,n.imports,Zn),c=Ta(a),h=Ze(a,c),u=0,l=e.interpolate||bt,f="__p += '",p=At((e.escape||bt).source+"|"+l.source+"|"+(l===Z?ft:bt).source+"|"+(e.evaluate||bt).source+"|$","g"),d="//# sourceURL="+(Lt.call(e,"sourceURL")?(e.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++se+"]")+"\n";t.replace(p,(function(e,r,i,n,a,c){return i||(i=n),f+=t.slice(u,c).replace(wt,sr),r&&(s=!0,f+="' +\n__e("+r+") +\n'"),a&&(o=!0,f+="';\n"+a+";\n__p += '"),i&&(f+="' +\n((__t = ("+i+")) == null ? '' : __t) +\n'"),u=c+e.length,e})),f+="';\n";var g=Lt.call(e,"variable")&&e.variable;if(g){if(ut.test(g))throw new St("Invalid `variable` option passed into `_.template`")}else f="with (obj) {\n"+f+"\n}\n";f=(o?f.replace(V,""):f).replace(K,"$1").replace(B,"$1;"),f="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":";\n")+f+"return __p\n}";var y=Qa((function(){return It(c,d+"return "+f).apply(r,h)}));if(y.source=f,Xo(y))throw y;return y},zr.times=function(t,e){if((t=ga(t))<1||t>f)return[];var r=d,i=_r(t,d);e=cs(e),t-=d;for(var n=Je(i,e);++r<t;)e(r);return n},zr.toFinite=da,zr.toInteger=ga,zr.toLength=ya,zr.toLower=function(t){return ma(t).toLowerCase()},zr.toNumber=va,zr.toSafeInteger=function(t){return t?oi(ga(t),-f,f):0===t?t:0},zr.toString=ma,zr.toUpper=function(t){return ma(t).toUpperCase()},zr.trim=function(t,e,i){if((t=ma(t))&&(i||e===r))return Ye(t);if(!t||!(e=hn(e)))return t;var n=fr(t),s=fr(e);return wn(n,tr(n,s),er(n,s)+1).join("")},zr.trimEnd=function(t,e,i){if((t=ma(t))&&(i||e===r))return t.slice(0,pr(t)+1);if(!t||!(e=hn(e)))return t;var n=fr(t);return wn(n,0,er(n,fr(e))+1).join("")},zr.trimStart=function(t,e,i){if((t=ma(t))&&(i||e===r))return t.replace(nt,"");if(!t||!(e=hn(e)))return t;var n=fr(t);return wn(n,tr(n,fr(e))).join("")},zr.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?hn(e.omission):n}var o=(t=ma(t)).length;if(or(t)){var a=fr(t);o=a.length}if(i>=o)return t;var c=i-lr(n);if(c<1)return n;var h=a?wn(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,l=h;for(s.global||(s=At(s.source,ma(pt.exec(s))+"g")),s.lastIndex=0;u=s.exec(l);)var f=u.index;h=h.slice(0,f===r?c:f)}}else if(t.indexOf(hn(s),c)!=c){var p=h.lastIndexOf(s);p>-1&&(h=h.slice(0,p))}return h+n},zr.unescape=function(t){return(t=ma(t))&&G.test(t)?t.replace(F,dr):t},zr.uniqueId=function(t){var e=++Mt;return ma(t)+e},zr.upperCase=Ya,zr.upperFirst=Xa,zr.each=mo,zr.eachRight=bo,zr.first=Fs,cc(zr,function(){var t={};return mi(zr,(function(e,r){Lt.call(zr.prototype,r)||(t[r]=e)})),t}(),{chain:!1}),zr.VERSION="4.17.21",Ae(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(t){zr[t].placeholder=zr})),Ae(["drop","take"],(function(t,e){Vr.prototype[t]=function(i){i=i===r?1:vr(ga(i),0);var n=this.__filtered__&&!e?new Vr(this):this.clone();return n.__filtered__?n.__takeCount__=_r(i,n.__takeCount__):n.__views__.push({size:_r(i,d),type:t+(n.__dir__<0?"Right":"")}),n},Vr.prototype[t+"Right"]=function(e){return this.reverse()[t](e).reverse()}})),Ae(["filter","map","takeWhile"],(function(t,e){var r=e+1,i=1==r||3==r;Vr.prototype[t]=function(t){var e=this.clone();return e.__iteratees__.push({iteratee:cs(t,3),type:r}),e.__filtered__=e.__filtered__||i,e}})),Ae(["head","last"],(function(t,e){var r="take"+(e?"Right":"");Vr.prototype[t]=function(){return this[r](1).value()[0]}})),Ae(["initial","tail"],(function(t,e){var r="drop"+(e?"":"Right");Vr.prototype[t]=function(){return this.__filtered__?new Vr(this):this[r](1)}})),Vr.prototype.compact=function(){return this.filter(nc)},Vr.prototype.find=function(t){return this.filter(t).head()},Vr.prototype.findLast=function(t){return this.reverse().find(t)},Vr.prototype.invokeMap=Ji((function(t,e){return"function"==typeof t?new Vr(this):this.map((function(r){return Ri(r,t,e)}))})),Vr.prototype.reject=function(t){return this.filter(Mo(cs(t)))},Vr.prototype.slice=function(t,e){t=ga(t);var i=this;return i.__filtered__&&(t>0||e<0)?new Vr(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)},Vr.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},Vr.prototype.toArray=function(){return this.take(d)},mi(Vr.prototype,(function(t,e){var i=/^(?:filter|find|map|reject)|While$/.test(e),n=/^(?:head|last)$/.test(e),s=zr[n?"take"+("last"==e?"Right":""):e],o=n||/^find/.test(e);s&&(zr.prototype[e]=function(){var e=this.__wrapped__,a=n?[1]:arguments,c=e instanceof Vr,h=a[0],u=c||Bo(e),l=function(t){var e=s.apply(zr,je([t],a));return n&&f?e[0]:e};u&&i&&"function"==typeof h&&1!=h.length&&(c=u=!1);var f=this.__chain__,p=!!this.__actions__.length,d=o&&!f,g=c&&!p;if(!o&&u){e=g?e:new Vr(this);var y=t.apply(e,a);return y.__actions__.push({func:po,args:[l],thisArg:r}),new Hr(y,f)}return d&&g?t.apply(this,a):(y=this.thru(l),d?n?y.value()[0]:y.value():y)})})),Ae(["pop","push","shift","sort","splice","unshift"],(function(t){var e=xt[t],r=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",i=/^(?:pop|shift)$/.test(t);zr.prototype[t]=function(){var t=arguments;if(i&&!this.__chain__){var n=this.value();return e.apply(Bo(n)?n:[],t)}return this[r]((function(r){return e.apply(Bo(r)?r:[],t)}))}})),mi(Vr.prototype,(function(t,e){var r=zr[e];if(r){var i=r.name+"";Lt.call(xr,i)||(xr[i]=[]),xr[i].push({name:e,func:r})}})),xr[$n(r,2).name]=[{name:"wrapper",func:r}],Vr.prototype.clone=function(){var t=new Vr(this.__wrapped__);return t.__actions__=Rn(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=Rn(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=Rn(this.__views__),t},Vr.prototype.reverse=function(){if(this.__filtered__){var t=new Vr(this);t.__dir__=-1,t.__filtered__=!0}else(t=this.clone()).__dir__*=-1;return t},Vr.prototype.value=function(){var t=this.__wrapped__.value(),e=this.__dir__,r=Bo(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=_r(e,t+o);break;case"takeRight":t=vr(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__,l=u.length,f=0,p=_r(c,this.__takeCount__);if(!r||!i&&n==c&&p==c)return dn(t,this.__actions__);var d=[];t:for(;c--&&f<p;){for(var g=-1,y=t[h+=e];++g<l;){var v=u[g],_=v.iteratee,m=v.type,b=_(y);if(2==m)y=b;else if(!b){if(1==m)continue t;break t}}d[f++]=y}return d},zr.prototype.at=go,zr.prototype.chain=function(){return fo(this)},zr.prototype.commit=function(){return new Hr(this.value(),this.__chain__)},zr.prototype.next=function(){this.__values__===r&&(this.__values__=pa(this.value()));var t=this.__index__>=this.__values__.length;return{done:t,value:t?r:this.__values__[this.__index__++]}},zr.prototype.plant=function(t){for(var e,i=this;i instanceof qr;){var n=zs(i);n.__index__=0,n.__values__=r,e?s.__wrapped__=n:e=n;var s=n;i=i.__wrapped__}return s.__wrapped__=t,e},zr.prototype.reverse=function(){var t=this.__wrapped__;if(t instanceof Vr){var e=t;return this.__actions__.length&&(e=new Vr(this)),(e=e.reverse()).__actions__.push({func:po,args:[to],thisArg:r}),new Hr(e,this.__chain__)}return this.thru(to)},zr.prototype.toJSON=zr.prototype.valueOf=zr.prototype.value=function(){return dn(this.__wrapped__,this.__actions__)},zr.prototype.first=zr.prototype.head,Xt&&(zr.prototype[Xt]=function(){return this}),zr}();ge?((ge.exports=gr)._=gr,de._=gr):pe._=gr}).call(bo)}(wo,wo.exports);var Eo=Object.defineProperty,So=Object.defineProperties,Io=Object.getOwnPropertyDescriptors,Po=Object.getOwnPropertySymbols,Oo=Object.prototype.hasOwnProperty,Ao=Object.prototype.propertyIsEnumerable,No=(t,e,r)=>e in t?Eo(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Ro=(t,e)=>{for(var r in e||(e={}))Oo.call(e,r)&&No(t,r,e[r]);if(Po)for(var r of Po(e))Ao.call(e,r)&&No(t,r,e[r]);return t},xo=(t,e)=>So(t,Io(e));function Co(t,e,r){let i;const n=To(t);return e.rpcMap&&(i=e.rpcMap[n]),i||(i=`https://rpc.walletconnect.com/v1?chainId=eip155:${n}&projectId=${r}`),i}function To(t){return t.includes("eip155")?Number(t.split(":")[1]):Number(t)}function Uo(t){var e,r,i,n;const s={};if(!cr(t))return s;for(const[o,a]of Object.entries(t)){const t=er(o)?[o]:a.chains,c=a.methods||[],h=a.events||[],u=a.rpcMap||{},l=rr(o);s[l]=xo(Ro(Ro({},s[l]),a),{chains:Ve(t,null==(e=s[l])?void 0:e.chains),methods:Ve(c,null==(r=s[l])?void 0:r.methods),events:Ve(h,null==(i=s[l])?void 0:i.events),rpcMap:Ro(Ro({},u),null==(n=s[l])?void 0:n.rpcMap)})}return s}const jo={},Lo=t=>jo[t],Mo=(t,e)=>{jo[t]=e};class Do{constructor(t){this.name="polkadot",this.namespace=t.namespace,this.events=Lo("events"),this.client=Lo("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||Co(`${this.name}:${t}`,this.namespace);if(!r)throw new Error(`No RPC url provided for chainId: ${t}`);this.setHttpProvider(t,r)}this.events.emit(mo,`${this.name}:${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=`${this.name}:${this.chainId}`,e=this.httpProviders[t];if(typeof e>"u")throw new Error(`JSON-RPC provider for ${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||Co(t,this.namespace);return typeof r>"u"?void 0:new Br.r(new yo.Z(r,Lo("disableProviderPing")))}}class ko{constructor(t){this.name="eip155",this.namespace=t.namespace,this.events=Lo("events"),this.client=Lo("client"),this.httpProviders=this.createHttpProviders(),this.chainId=parseInt(this.getDefaultChain())}async request(t){var e;switch(t.request.method){case"eth_requestAccounts":case"eth_accounts":return this.getAccounts();case"wallet_switchEthereumChain":return this.handleSwitchChain(t.request.params?null==(e=t.request.params[0])?void 0:e.chainId:"0x0"),null;case"eth_chainId":return parseInt(this.getDefaultChain())}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){const r=To(t);if(!this.httpProviders[r]){const t=e||Co(`${this.name}:${r}`,this.namespace,this.client.core.projectId);if(!t)throw new Error(`No RPC url provided for chainId: ${r}`);this.setHttpProvider(r,t)}this.chainId=r,this.events.emit(mo,`${this.name}:${r}`)}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||Co(`${this.name}:${t}`,this.namespace,this.client.core.projectId);return typeof r>"u"?void 0:new Br.r(new yo.k(r,Lo("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=To(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 ${t} not found`);return e}handleSwitchChain(t){const e=parseInt(t,16);(function(t,e){if(!e.includes(t))throw new Error(`Chain '${t}' not approved. Please use one of the following: ${e.toString()}`)})(`${this.name}:${e}`,this.namespace.chains),this.setDefaultChain(`${e}`)}}class zo{constructor(t){this.name="solana",this.namespace=t.namespace,this.events=Lo("events"),this.client=Lo("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||Co(`${this.name}:${t}`,this.namespace,this.client.core.projectId);if(!r)throw new Error(`No RPC url provided for chainId: ${t}`);this.setHttpProvider(t,r)}this.chainId=t,this.events.emit(mo,`${this.name}:${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=`${this.name}:${this.chainId}`,e=this.httpProviders[t];if(typeof e>"u")throw new Error(`JSON-RPC provider for ${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||Co(t,this.namespace,this.client.core.projectId);return typeof r>"u"?void 0:new Br.r(new yo.Z(r,Lo("disableProviderPing")))}}class $o{constructor(t){this.name="cosmos",this.namespace=t.namespace,this.events=Lo("events"),this.client=Lo("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||Co(`${this.name}:${t}`,this.namespace,this.client.core.projectId);if(!r)throw new Error(`No RPC url provided for chainId: ${t}`);this.setHttpProvider(t,r)}this.events.emit(mo,`${this.name}:${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;t[e]=this.createHttpProvider(e,null==(r=this.namespace.rpcMap)?void 0:r[e])})),t}getHttpProvider(){const t=`${this.name}:${this.chainId}`,e=this.httpProviders[t];if(typeof e>"u")throw new Error(`JSON-RPC provider for ${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||Co(t,this.namespace,this.client.core.projectId);return typeof r>"u"?void 0:new Br.r(new yo.Z(r,Lo("disableProviderPing")))}}class qo{constructor(t){this.name="cip34",this.namespace=t.namespace,this.events=Lo("events"),this.client=Lo("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||this.getCardanoRPCUrl(t);if(!r)throw new Error(`No RPC url provided for chainId: ${t}`);this.setHttpProvider(t,r)}this.events.emit(mo,`${this.name}:${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);t[e]=this.createHttpProvider(e,r)})),t}getHttpProvider(){const t=`${this.name}:${this.chainId}`,e=this.httpProviders[t];if(typeof e>"u")throw new Error(`JSON-RPC provider for ${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);return typeof r>"u"?void 0:new Br.r(new yo.Z(r,Lo("disableProviderPing")))}}class Ho{constructor(t){this.name="elrond",this.namespace=t.namespace,this.events=Lo("events"),this.client=Lo("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||Co(`${this.name}:${t}`,this.namespace,this.client.core.projectId);if(!r)throw new Error(`No RPC url provided for chainId: ${t}`);this.setHttpProvider(t,r)}this.chainId=t,this.events.emit(mo,`${this.name}:${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=`${this.name}:${this.chainId}`,e=this.httpProviders[t];if(typeof e>"u")throw new Error(`JSON-RPC provider for ${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||Co(t,this.namespace,this.client.core.projectId);return typeof r>"u"?void 0:new Br.r(new yo.Z(r,Lo("disableProviderPing")))}}class Vo{constructor(t){this.name="multiversx",this.namespace=t.namespace,this.events=Lo("events"),this.client=Lo("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||Co(`${this.name}:${t}`,this.namespace,this.client.core.projectId);if(!r)throw new Error(`No RPC url provided for chainId: ${t}`);this.setHttpProvider(t,r)}this.chainId=t,this.events.emit(mo,`${this.name}:${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=`${this.name}:${this.chainId}`,e=this.httpProviders[t];if(typeof e>"u")throw new Error(`JSON-RPC provider for ${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||Co(t,this.namespace,this.client.core.projectId);return typeof r>"u"?void 0:new Br.r(new yo.Z(r,Lo("disableProviderPing")))}}var Ko=Object.defineProperty,Bo=Object.defineProperties,Fo=Object.getOwnPropertyDescriptors,Wo=Object.getOwnPropertySymbols,Go=Object.prototype.hasOwnProperty,Jo=Object.prototype.propertyIsEnumerable,Yo=(t,e,r)=>e in t?Ko(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Xo=(t,e)=>{for(var r in e||(e={}))Go.call(e,r)&&Yo(t,r,e[r]);if(Wo)for(var r of Wo(e))Jo.call(e,r)&&Yo(t,r,e[r]);return t},Zo=(t,e)=>Bo(t,Fo(e));class Qo{constructor(t){this.events=new(_()),this.rpcProviders={},this.shouldAbortPairingAttempt=!1,this.maxPairingAttempts=10,this.disableProviderPing=!1,this.providerOpts=t,this.logger=typeof t?.logger<"u"&&"string"!=typeof t?.logger?t.logger:(0,Ar.pino)((0,Ar.getDefaultLoggerOptions)({level:t?.logger||vo})),this.disableProviderPing=t?.disableProviderPing||!1}static async init(t){const e=new Qo(t);return await e.initialize(),e}async request(t,e){const[r,i]=this.validateChain(e);if(!this.session)throw new Error("Please call connect() before request()");return await this.getProvider(r).request({request:Xo({},t),chainId:`${r}:${i}`,topic:this.session.topic})}sendAsync(t,e,r){this.request(t,r).then((t=>e(null,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:or("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)}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})).catch((t=>{if(t.message!==Ys)throw t;e++}))}while(!this.session);return this.onConnect(),this.session}setDefaultChain(t,e){try{const[r,i]=this.validateChain(t);this.getProvider(r).setDefaultChain(i,e)}catch(t){if(!/Please call connect/.test(t.message))throw t}}async cleanupPendingPairings(t={}){this.logger.info("Cleaning up inactive pairings...");const e=this.client.pairing.getAll();if(ar(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: ${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 go.init({logger:this.providerOpts.logger||vo,relayUrl:this.providerOpts.relayUrl||"wss://relay.walletconnect.com",projectId:this.providerOpts.projectId,metadata:this.providerOpts.metadata,storageOptions:this.providerOpts.storageOptions,name:this.providerOpts.name}),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=>rr(t))))];Mo("client",this.client),Mo("events",this.events),Mo("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=function(t){return t.map((t=>`${t.split(":")[0]}:${t.split(":")[1]}`))}(e),i=function(t,e={}){const r=Uo(t),i=Uo(e);return wo.exports.merge(r,i)}(this.namespaces,this.optionalNamespaces),n=Zo(Xo({},i[t]),{accounts:e,chains:r});switch(t){case"eip155":this.rpcProviders[t]=new ko({namespace:n});break;case"solana":this.rpcProviders[t]=new zo({namespace:n});break;case"cosmos":this.rpcProviders[t]=new $o({namespace:n});break;case"polkadot":this.rpcProviders[t]=new Do({namespace:n});break;case"cip34":this.rpcProviders[t]=new qo({namespace:n});break;case"elrond":this.rpcProviders[t]=new Ho({namespace:n});break;case"multiversx":this.rpcProviders[t]=new Vo({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;"accountsChanged"===r.name?this.events.emit("accountsChanged",r.data):"chainChanged"===r.name?this.onChainChanged(e.chainId):this.events.emit(r.name,r.data),this.events.emit("session_event",t)})),this.client.on("session_update",(({topic:t,params:e})=>{var r;const{namespaces:i}=e,n=null==(r=this.client)?void 0:r.session.get(t);this.session=Zo(Xo({},n),{namespaces:i}),this.onSessionUpdate(),this.events.emit("session_update",{topic:t,params:e})})),this.client.on("session_delete",(async t=>{await this.cleanup(),this.events.emit("session_delete",t),this.events.emit("disconnect",Zo(Xo({},or("USER_DISCONNECTED")),{data:t.topic}))})),this.on(mo,(t=>{this.onChainChanged(t,!0)}))}getProvider(t){if(!this.rpcProviders[t])throw new Error(`Provider not found: ${t}`);return this.rpcProviders[t]}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;if(!e||!Object.keys(e).length)throw new Error("Namespaces must be not empty");this.namespaces=e,this.optionalNamespaces=r,this.sessionProperties=i,this.persist("namespaces",e),this.persist("optionalNamespaces",r)}validateChain(t){const[e,r]=t?.split(":")||["",""];if(e&&!Object.keys(this.namespaces).map((t=>rr(t))).includes(e))throw new Error(`Namespace '${e}' is not configured. Please call connect() first with namespace config.`);if(e&&r)return[e,r];const i=rr(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,e=!1){var r;const[i,n]=this.validateChain(t);e||this.getProvider(i).setDefaultChain(n),(null!=(r=this.namespaces[i])?r:this.namespaces[`${i}:${n}`]).defaultChain=n,this.persist("namespaces",this.namespaces),this.events.emit("chainChanged",n)}onConnect(){this.createProviders(),this.events.emit("connect",{session:this.session})}async cleanup(){this.session=void 0,await this.cleanupPendingPairings({deletePairings:!0})}persist(t,e){this.client.core.storage.setItem(`${_o}/${t}`,e)}async getFromStore(t){return await this.client.core.storage.getItem(`${_o}/${t}`)}}const ta=Qo,ea=["eth_sendTransaction","personal_sign"],ra=["eth_accounts","eth_requestAccounts","eth_sendRawTransaction","eth_sign","eth_signTransaction","eth_signTypedData","eth_signTypedData_v3","eth_signTypedData_v4","wallet_switchEthereumChain","wallet_addEthereumChain","wallet_getPermissions","wallet_requestPermissions","wallet_registerOnboarding","wallet_watchAsset","wallet_scanQRCode"],ia=["chainChanged","accountsChanged"],na=["message","disconnect","connect"];var sa=Object.defineProperty,oa=Object.defineProperties,aa=Object.getOwnPropertyDescriptors,ca=Object.getOwnPropertySymbols,ha=Object.prototype.hasOwnProperty,ua=Object.prototype.propertyIsEnumerable,la=(t,e,r)=>e in t?sa(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,fa=(t,e)=>{for(var r in e||(e={}))ha.call(e,r)&&la(t,r,e[r]);if(ca)for(var r of ca(e))ua.call(e,r)&&la(t,r,e[r]);return t},pa=(t,e)=>oa(t,aa(e));function da(t){return Number(t[0].split(":")[1])}function ga(t){return`0x${t.toString(16)}`}class ya{constructor(){this.events=new v.EventEmitter,this.namespace="eip155",this.accounts=[],this.chainId=1,this.STORAGE_KEY="wc@2:ethereum_provider:",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 ya;return await e.initialize(t),e}async request(t){return await this.signer.request(t,this.formatChainId(this.chainId))}sendAsync(t,e){this.signer.sendAsync(t,e,this.formatChainId(this.chainId))}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(!ar(e))throw new Error("Invalid chains");const c=e,h=i||ea,u=s||ia,l={chains:c,methods:h,events:u,rpcMap:{[da(c)]:a[da(c)]}},f=s?.filter((t=>!ia.includes(t))),p=i?.filter((t=>!ea.includes(t)));return r||o||n||null!=f&&f.length||null!=p&&p.length?{required:l,optional:{chains:[...new Set(f?.length&&p?.length||!r?c.concat(r||[]):r)],methods:[...new Set(h.concat(n||[]))],events:[...new Set(u.concat(o||[]))],rpcMap:a}}:{required:l}}(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(pa(fa({namespaces:{[this.namespace]:e}},r&&{optionalNamespaces:{[this.namespace]:r}}),{pairingTopic:t?.pairingTopic})).then((t=>{i(t)})).catch((t=>{n(new Error(t.message))}))}));if(!i)return;this.setChainIds(this.rpc.chains);const n=function(t,e=[]){const r=[];return Object.keys(t).forEach((i=>{if(e.length&&!e.includes(i))return;const n=t[i];r.push(...n.accounts)})),r}(i.namespaces,[this.namespace]);this.setAccounts(n),this.events.emit("connect",{chainId:ga(this.chainId)})}catch(t){throw this.signer.logger.error(t),t}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",ga(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",pa(fa({},or("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)}))}setHttpProvider(t){this.request({method:"wallet_switchEthereumChain",params:[{chainId:t.toString(16)}]})}isCompatibleChainId(t){return"string"==typeof t&&t.startsWith(`${this.namespace}:`)}formatChainId(t){return`${this.namespace}:${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",ga(this.chainId)),this.persist())}setChainId(t){if(this.isCompatibleChainId(t)){const e=this.parseChainId(t);this.chainId=e,this.setHttpProvider(e)}}parseAccountId(t){const[e,r,i]=t.split(":");return{chainId:`${e}:${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;return{chains:(null==(e=t.chains)?void 0:e.map((t=>this.formatChainId(t))))||[`${this.namespace}:1`],optionalChains:t.optionalChains?t.optionalChains.map((t=>this.formatChainId(t))):void 0,methods:t?.methods||ea,events:t?.events||ia,optionalMethods:t?.optionalMethods||[],optionalEvents:t?.optionalEvents||[],rpcMap:t?.rpcMap||this.buildRpcMap(t.chains.concat(t.optionalChains||[]),t.projectId),showQrModal:!(null==t||!t.showQrModal),qrModalOptions:null!=(r=t?.qrModalOptions)?r:void 0,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=da(this.rpc.chains),this.signer=await ta.init({projectId:this.rpc.projectId,metadata:this.rpc.metadata,disableProviderPing:t.disableProviderPing}),this.registerEventListeners(),await this.loadPersistedSession(),this.rpc.showQrModal){let t;try{const{WalletConnectModal:e}=await r.e(2545).then(r.bind(r,92545));t=e}catch{throw new Error("To use QR modal, please install @walletconnect/modal package")}if(t)try{this.modal=new t(fa({walletConnectVersion:2,projectId:this.rpc.projectId,standaloneChains:this.rpc.chains},this.rpc.qrModalOptions))}catch(t){throw this.signer.logger.error(t),new Error("Could not generate WalletConnectModal Instance")}}}loadConnectOpts(t){if(!t)return;const{chains:e,optionalChains:r,rpcMap:i}=t;e&&ar(e)&&(this.rpc.chains=e.map((t=>this.formatChainId(t))),e.forEach((t=>{this.rpc.rpcMap[t]=i?.[t]||this.getRpcUrl(t)}))),r&&ar(r)&&(this.rpc.optionalChains=[],this.rpc.optionalChains=r?.map((t=>this.formatChainId(t))),r.forEach((t=>{this.rpc.rpcMap[t]=i?.[t]||this.getRpcUrl(t)})))}getRpcUrl(t,e){var r;return(null==(r=this.rpc.rpcMap)?void 0:r[t])||`https://rpc.walletconnect.com/v1/?chainId=eip155:${t}&projectId=${e||this.rpc.projectId}`}async loadPersistedSession(){if(!this.session)return;const t=await this.signer.client.core.storage.getItem(`${this.STORAGE_KEY}/chainId`);this.setChainIds(t?[this.formatChainId(t)]:this.session.namespaces[this.namespace].accounts),this.setAccounts(this.session.namespaces[this.namespace].accounts)}reset(){this.chainId=1,this.accounts=[]}persist(){this.session&&this.signer.client.core.storage.setItem(`${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 va=ya},61429: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(t){}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 e={"%FE%FF":"��","%FF%FE":"��"},r=i.exec(t);r;){try{e[r[0]]=decodeURIComponent(r[0])}catch(t){var n=s(r[0]);n!==r[0]&&(e[r[0]]=n)}r=i.exec(t)}e["%C2"]="�";for(var o=Object.keys(e),a=0;a<o.length;a++){var c=o[a];t=t.replace(new RegExp(c,"g"),e[c])}return t}(t)}}},69528:(t,e,r)=>{"use strict";const i=r(70610),n=r(61429),s=r(80500),o=r(92806),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 l(t){return Array.isArray(t)?t.sort():"object"==typeof t?l(Object.keys(t)).sort(((t,e)=>Number(t)-Number(e))).map((e=>t[e])):t}function f(t){const e=t.indexOf("#");return-1!==e&&(t=t.slice(0,e)),t}function p(t){const e=(t=f(t)).indexOf("?");return-1===e?"":t.slice(e+1)}function d(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 t of Object.keys(i)){const r=i[t];if("object"==typeof r&&null!==r)for(const t of Object.keys(r))r[t]=d(r[t],e);else i[t]=d(r,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]=l(r):t[e]=r,t}),Object.create(null))}e.extract=p,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=>e.skipNull&&null==t[r]||e.skipEmptyString&&""===t[r],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 e of Object.keys(t))r(e)||(n[e]=t[e]);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(p(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=f(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=`?${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=`#${r[a]?h(t.fragmentIdentifier,r):t.fragmentIdentifier}`),`${i}${c}${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)}},38200:(t,e,r)=>{"use strict";r.d(e,{q:()=>i});class i{}},30997:(t,e,r)=>{"use strict";r.r(e),r.d(e,{IEvents:()=>i.q});var i=r(38200)},32568:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.HEARTBEAT_EVENTS=e.HEARTBEAT_INTERVAL=void 0;const i=r(66736);e.HEARTBEAT_INTERVAL=i.FIVE_SECONDS,e.HEARTBEAT_EVENTS={pulse:"heartbeat_pulse"}},53401:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});r(70655).__exportStar(r(32568),e)},38969:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.HeartBeat=void 0;const i=r(70655),n=r(17187),s=r(66736),o=r(1614),a=r(53401);class c extends o.IHeartBeat{constructor(t){super(t),this.events=new n.EventEmitter,this.interval=a.HEARTBEAT_INTERVAL,this.interval=(null==t?void 0:t.interval)||a.HEARTBEAT_INTERVAL}static init(t){return i.__awaiter(this,void 0,void 0,(function*(){const e=new c(t);return yield e.init(),e}))}init(){return i.__awaiter(this,void 0,void 0,(function*(){yield 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)}initialize(){return i.__awaiter(this,void 0,void 0,(function*(){this.intervalRef=setInterval((()=>this.pulse()),s.toMiliseconds(this.interval))}))}pulse(){this.events.emit(a.HEARTBEAT_EVENTS.pulse)}}e.HeartBeat=c},90772:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const i=r(70655);i.__exportStar(r(38969),e),i.__exportStar(r(1614),e),i.__exportStar(r(53401),e)},44174:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.IHeartBeat=void 0;const i=r(30997);class n extends i.IEvents{constructor(t){super()}}e.IHeartBeat=n},1614:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});r(70655).__exportStar(r(44174),e)},85150:(t,e,r)=>{"use strict";const i=r(70655),n=r(25095),s=i.__importDefault(r(30653)),o=r(59728);class a{constructor(){this.localStorage=s.default}getKeys(){return i.__awaiter(this,void 0,void 0,(function*(){return Object.keys(this.localStorage)}))}getEntries(){return i.__awaiter(this,void 0,void 0,(function*(){return Object.entries(this.localStorage).map(o.parseEntry)}))}getItem(t){return i.__awaiter(this,void 0,void 0,(function*(){const e=this.localStorage.getItem(t);if(null!==e)return n.safeJsonParse(e)}))}setItem(t,e){return i.__awaiter(this,void 0,void 0,(function*(){this.localStorage.setItem(t,n.safeJsonStringify(e))}))}removeItem(t){return i.__awaiter(this,void 0,void 0,(function*(){this.localStorage.removeItem(t)}))}}e.ZP=a},30653:(t,e,r)=>{"use strict";!function(){let e;function i(){}e=i,e.prototype.getItem=function(t){return this.hasOwnProperty(t)?String(this[t]):null},e.prototype.setItem=function(t,e){this[t]=String(e)},e.prototype.removeItem=function(t){delete this[t]},e.prototype.clear=function(){const t=this;Object.keys(t).forEach((function(e){t[e]=void 0,delete t[e]}))},e.prototype.key=function(t){return t=t||0,Object.keys(this)[t]},e.prototype.__defineGetter__("length",(function(){return Object.keys(this).length})),void 0!==r.g&&r.g.localStorage?t.exports=r.g.localStorage:"undefined"!=typeof window&&window.localStorage?t.exports=window.localStorage:t.exports=new i}()},59728:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const i=r(70655);i.__exportStar(r(39076),e),i.__exportStar(r(20496),e)},39076:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.IKeyValueStorage=void 0;e.IKeyValueStorage=class{}},20496:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.parseEntry=void 0;const i=r(25095);e.parseEntry=function(t){var e;return[t[0],i.safeJsonParse(null!==(e=t[1])&&void 0!==e?e:"")]}},65727:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.PINO_CUSTOM_CONTEXT_KEY=e.PINO_LOGGER_DEFAULTS=void 0,e.PINO_LOGGER_DEFAULTS={level:"info"},e.PINO_CUSTOM_CONTEXT_KEY="custom_context"},9107:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.pino=void 0;const i=r(70655),n=i.__importDefault(r(36559));Object.defineProperty(e,"pino",{enumerable:!0,get:function(){return n.default}}),i.__exportStar(r(65727),e),i.__exportStar(r(58048),e)},58048:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.generateChildLogger=e.formatChildLoggerContext=e.getLoggerContext=e.setBrowserLoggerContext=e.getBrowserLoggerContext=e.getDefaultLoggerOptions=void 0;const i=r(65727);function n(t,e=i.PINO_CUSTOM_CONTEXT_KEY){return t[e]||""}function s(t,e,r=i.PINO_CUSTOM_CONTEXT_KEY){return t[r]=e,t}function o(t,e=i.PINO_CUSTOM_CONTEXT_KEY){let r="";return r=void 0===t.bindings?n(t,e):t.bindings().context||"",r}function a(t,e,r=i.PINO_CUSTOM_CONTEXT_KEY){const n=o(t,r);return n.trim()?`${n}/${e}`:e}e.getDefaultLoggerOptions=function(t){return Object.assign(Object.assign({},t),{level:(null==t?void 0:t.level)||i.PINO_LOGGER_DEFAULTS.level})},e.getBrowserLoggerContext=n,e.setBrowserLoggerContext=s,e.getLoggerContext=o,e.formatChildLoggerContext=a,e.generateChildLogger=function(t,e,r=i.PINO_CUSTOM_CONTEXT_KEY){const n=a(t,e,r);return s(t.child({context:n}),n,r)}},61882:()=>{},43014:()=>{},36900:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const i=r(70655);i.__exportStar(r(46869),e),i.__exportStar(r(88033),e)},46869:(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},88033:(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},66736:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const i=r(70655);i.__exportStar(r(44273),e),i.__exportStar(r(47001),e),i.__exportStar(r(52939),e),i.__exportStar(r(36900),e)},52939:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});r(70655).__exportStar(r(88766),e)},88766:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.IWatch=void 0;e.IWatch=class{}},83207:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.fromMiliseconds=e.toMiliseconds=void 0;const i=r(36900);e.toMiliseconds=function(t){return t*i.ONE_THOUSAND},e.fromMiliseconds=function(t){return Math.floor(t/i.ONE_THOUSAND)}},83873:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.delay=void 0,e.delay=function(t){return new Promise((e=>{setTimeout((()=>{e(!0)}),t)}))}},44273:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const i=r(70655);i.__exportStar(r(83873),e),i.__exportStar(r(83207),e)},47001:(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: ${t}`);this.timestamps.set(t,{started:Date.now()})}stop(t){const e=this.get(t);if(void 0!==e.elapsed)throw new Error(`Watch already stopped for label: ${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(void 0===e)throw new Error(`No timestamp found for label: ${t}`);return e}elapsed(t){const e=this.get(t);return e.elapsed||Date.now()-e.started}}e.Watch=r,e.default=r},72307:(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]",l="[object Map]",f="[object Number]",p="[object Object]",d="[object Promise]",g="[object RegExp]",y="[object Set]",v="[object String]",_="[object Symbol]",m="[object WeakMap]",b="[object ArrayBuffer]",w="[object DataView]",E=/^\[object .+?Constructor\]$/,S=/^(?:0|[1-9]\d*)$/,I={};I["[object Float32Array]"]=I["[object Float64Array]"]=I["[object Int8Array]"]=I["[object Int16Array]"]=I["[object Int32Array]"]=I["[object Uint8Array]"]=I["[object Uint8ClampedArray]"]=I["[object Uint16Array]"]=I["[object Uint32Array]"]=!0,I[s]=I[o]=I[b]=I[a]=I[w]=I[c]=I[h]=I[u]=I[l]=I[f]=I[p]=I[g]=I[y]=I[v]=I[m]=!1;var P="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g,O="object"==typeof self&&self&&self.Object===Object&&self,A=P||O||Function("return this")(),N=e&&!e.nodeType&&e,R=N&&t&&!t.nodeType&&t,x=R&&R.exports===N,C=x&&P.process,T=function(){try{return C&&C.binding&&C.binding("util")}catch(t){}}(),U=T&&T.isTypedArray;function j(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 M(t){var e=-1,r=Array(t.size);return t.forEach((function(t){r[++e]=t})),r}var D,k,z,$=Array.prototype,q=Function.prototype,H=Object.prototype,V=A["__core-js_shared__"],K=q.toString,B=H.hasOwnProperty,F=(D=/[^.]+$/.exec(V&&V.keys&&V.keys.IE_PROTO||""))?"Symbol(src)_1."+D:"",W=H.toString,G=RegExp("^"+K.call(B).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),J=x?A.Buffer:void 0,Y=A.Symbol,X=A.Uint8Array,Z=H.propertyIsEnumerable,Q=$.splice,tt=Y?Y.toStringTag:void 0,et=Object.getOwnPropertySymbols,rt=J?J.isBuffer:void 0,it=(k=Object.keys,z=Object,function(t){return k(z(t))}),nt=Tt(A,"DataView"),st=Tt(A,"Map"),ot=Tt(A,"Promise"),at=Tt(A,"Set"),ct=Tt(A,"WeakMap"),ht=Tt(Object,"create"),ut=Mt(nt),lt=Mt(st),ft=Mt(ot),pt=Mt(at),dt=Mt(ct),gt=Y?Y.prototype:void 0,yt=gt?gt.valueOf:void 0;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 _t(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 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 bt(t){var e=-1,r=null==t?0:t.length;for(this.__data__=new mt;++e<r;)this.add(t[e])}function wt(t){var e=this.__data__=new _t(t);this.size=e.size}function Et(t,e){var r=zt(t),i=!r&&kt(t),n=!r&&!i&&$t(t),s=!r&&!i&&!n&&Bt(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&&!B.call(t,h)||o&&("length"==h||n&&("offset"==h||"parent"==h)||s&&("buffer"==h||"byteLength"==h||"byteOffset"==h)||Lt(h,c))||a.push(h);return a}function St(t,e){for(var r=t.length;r--;)if(Dt(t[r][0],e))return r;return-1}function It(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":tt&&tt in Object(t)?function(t){var e=B.call(t,tt),r=t[tt];try{t[tt]=void 0;var i=!0}catch(t){}var n=W.call(t);i&&(e?t[tt]=r:delete t[tt]);return n}(t):function(t){return W.call(t)}(t)}function Pt(t){return Kt(t)&&It(t)==s}function Ot(t,e,r,i,n){return t===e||(null==t||null==e||!Kt(t)&&!Kt(e)?t!=t&&e!=e:function(t,e,r,i,n,u){var d=zt(t),m=zt(e),E=d?o:jt(t),S=m?o:jt(e),I=(E=E==s?p:E)==p,P=(S=S==s?p:S)==p,O=E==S;if(O&&$t(t)){if(!$t(e))return!1;d=!0,I=!1}if(O&&!I)return u||(u=new wt),d||Bt(t)?Rt(t,e,r,i,n,u):function(t,e,r,i,n,s,o){switch(r){case w:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case b:return!(t.byteLength!=e.byteLength||!s(new X(t),new X(e)));case a:case c:case f:return Dt(+t,+e);case h:return t.name==e.name&&t.message==e.message;case g:case v:return t==e+"";case l:var u=L;case y:var p=1&i;if(u||(u=M),t.size!=e.size&&!p)return!1;var d=o.get(t);if(d)return d==e;i|=2,o.set(t,e);var m=Rt(u(t),u(e),i,n,s,o);return o.delete(t),m;case _:if(yt)return yt.call(t)==yt.call(e)}return!1}(t,e,E,r,i,n,u);if(!(1&r)){var A=I&&B.call(t,"__wrapped__"),N=P&&B.call(e,"__wrapped__");if(A||N){var R=A?t.value():t,x=N?e.value():e;return u||(u=new wt),n(R,x,r,i,u)}}if(!O)return!1;return u||(u=new wt),function(t,e,r,i,n,s){var o=1&r,a=xt(t),c=a.length,h=xt(e).length;if(c!=h&&!o)return!1;var u=c;for(;u--;){var l=a[u];if(!(o?l in e:B.call(e,l)))return!1}var f=s.get(t);if(f&&s.get(e))return f==e;var p=!0;s.set(t,e),s.set(e,t);var d=o;for(;++u<c;){var g=t[l=a[u]],y=e[l];if(i)var v=o?i(y,g,l,e,t,s):i(g,y,l,t,e,s);if(!(void 0===v?g===y||n(g,y,r,i,s):v)){p=!1;break}d||(d="constructor"==l)}if(p&&!d){var _=t.constructor,m=e.constructor;_==m||!("constructor"in t)||!("constructor"in e)||"function"==typeof _&&_ instanceof _&&"function"==typeof m&&m instanceof m||(p=!1)}return s.delete(t),s.delete(e),p}(t,e,r,i,n,u)}(t,e,r,i,Ot,n))}function At(t){return!(!Vt(t)||function(t){return!!F&&F in t}(t))&&(qt(t)?G:E).test(Mt(t))}function Nt(t){if(r=(e=t)&&e.constructor,i="function"==typeof r&&r.prototype||H,e!==i)return it(t);var e,r,i,n=[];for(var s in Object(t))B.call(t,s)&&"constructor"!=s&&n.push(s);return n}function Rt(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,l=!0,f=2&r?new bt:void 0;for(s.set(t,e),s.set(e,t);++u<a;){var p=t[u],d=e[u];if(i)var g=o?i(d,p,u,e,t,s):i(p,d,u,t,e,s);if(void 0!==g){if(g)continue;l=!1;break}if(f){if(!j(e,(function(t,e){if(o=e,!f.has(o)&&(p===t||n(p,t,r,i,s)))return f.push(e);var o}))){l=!1;break}}else if(p!==d&&!n(p,d,r,i,s)){l=!1;break}}return s.delete(t),s.delete(e),l}function xt(t){return function(t,e,r){var i=e(t);return zt(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,Ft,Ut)}function Ct(t,e){var r,i,n=t.__data__;return("string"==(i=typeof(r=e))||"number"==i||"symbol"==i||"boolean"==i?"__proto__"!==r:null===r)?n["string"==typeof e?"string":"hash"]:n.map}function Tt(t,e){var r=function(t,e){return null==t?void 0:t[e]}(t,e);return At(r)?r:void 0}vt.prototype.clear=function(){this.__data__=ht?ht(null):{},this.size=0},vt.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},vt.prototype.get=function(t){var e=this.__data__;if(ht){var r=e[t];return r===i?void 0:r}return B.call(e,t)?e[t]:void 0},vt.prototype.has=function(t){var e=this.__data__;return ht?void 0!==e[t]:B.call(e,t)},vt.prototype.set=function(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=ht&&void 0===e?i:e,this},_t.prototype.clear=function(){this.__data__=[],this.size=0},_t.prototype.delete=function(t){var e=this.__data__,r=St(e,t);return!(r<0)&&(r==e.length-1?e.pop():Q.call(e,r,1),--this.size,!0)},_t.prototype.get=function(t){var e=this.__data__,r=St(e,t);return r<0?void 0:e[r][1]},_t.prototype.has=function(t){return St(this.__data__,t)>-1},_t.prototype.set=function(t,e){var r=this.__data__,i=St(r,t);return i<0?(++this.size,r.push([t,e])):r[i][1]=e,this},mt.prototype.clear=function(){this.size=0,this.__data__={hash:new vt,map:new(st||_t),string:new vt}},mt.prototype.delete=function(t){var e=Ct(this,t).delete(t);return this.size-=e?1:0,e},mt.prototype.get=function(t){return Ct(this,t).get(t)},mt.prototype.has=function(t){return Ct(this,t).has(t)},mt.prototype.set=function(t,e){var r=Ct(this,t),i=r.size;return r.set(t,e),this.size+=r.size==i?0:1,this},bt.prototype.add=bt.prototype.push=function(t){return this.__data__.set(t,i),this},bt.prototype.has=function(t){return this.__data__.has(t)},wt.prototype.clear=function(){this.__data__=new _t,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 _t){var i=r.__data__;if(!st||i.length<199)return i.push([t,e]),this.size=++r.size,this;r=this.__data__=new mt(i)}return r.set(t,e),this.size=r.size,this};var Ut=et?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}(et(t),(function(e){return Z.call(t,e)})))}:function(){return[]},jt=It;function Lt(t,e){return!!(e=null==e?n:e)&&("number"==typeof t||S.test(t))&&t>-1&&t%1==0&&t<e}function Mt(t){if(null!=t){try{return K.call(t)}catch(t){}try{return t+""}catch(t){}}return""}function Dt(t,e){return t===e||t!=t&&e!=e}(nt&&jt(new nt(new ArrayBuffer(1)))!=w||st&&jt(new st)!=l||ot&&jt(ot.resolve())!=d||at&&jt(new at)!=y||ct&&jt(new ct)!=m)&&(jt=function(t){var e=It(t),r=e==p?t.constructor:void 0,i=r?Mt(r):"";if(i)switch(i){case ut:return w;case lt:return l;case ft:return d;case pt:return y;case dt:return m}return e});var kt=Pt(function(){return arguments}())?Pt:function(t){return Kt(t)&&B.call(t,"callee")&&!Z.call(t,"callee")},zt=Array.isArray;var $t=rt||function(){return!1};function qt(t){if(!Vt(t))return!1;var e=It(t);return e==u||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e}function Ht(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=n}function Vt(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function Kt(t){return null!=t&&"object"==typeof t}var Bt=U?function(t){return function(e){return t(e)}}(U):function(t){return Kt(t)&&Ht(t.length)&&!!I[It(t)]};function Ft(t){return null!=(e=t)&&Ht(e.length)&&!qt(e)?Et(t):Nt(t);var e}t.exports=function(t,e){return Ot(t,e)}},85346:t=>{"use strict";function e(t){try{return JSON.stringify(t)}catch(t){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,l=-1,f=t&&t.length||0,p=0;p<f;){if(37===t.charCodeAt(p)&&p+1<f){switch(l=l>-1?l:0,t.charCodeAt(p+1)){case 100:case 102:if(u>=c)break;if(null==r[u])break;l<p&&(h+=t.slice(l,p)),h+=Number(r[u]),l=p+2,p++;break;case 105:if(u>=c)break;if(null==r[u])break;l<p&&(h+=t.slice(l,p)),h+=Math.floor(Number(r[u])),l=p+2,p++;break;case 79:case 111:case 106:if(u>=c)break;if(void 0===r[u])break;l<p&&(h+=t.slice(l,p));var d=typeof r[u];if("string"===d){h+="'"+r[u]+"'",l=p+2,p++;break}if("function"===d){h+=r[u].name||"<anonymous>",l=p+2,p++;break}h+=n(r[u]),l=p+2,p++;break;case 115:if(u>=c)break;l<p&&(h+=t.slice(l,p)),h+=String(r[u]),l=p+2,p++;break;case 37:l<p&&(h+=t.slice(l,p)),h+="%",l=p+2,p++,u--}++u}++p}if(-1===l)return t;l<f&&(h+=t.slice(l));return h}},25095:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.safeJsonParse=function(t){if("string"!=typeof t)throw new Error("Cannot safe json parse value of type "+typeof t);try{return JSON.parse(t)}catch(e){return t}},e.safeJsonStringify=function(t){return"string"==typeof t?t:JSON.stringify(t,((t,e)=>void 0===e?null:e))}},36559:(t,e,r)=>{"use strict";const i=r(85346);t.exports=o;const n=function(){function t(t){return void 0!==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:d,mapHttpResponse:d,wrapRequestSerializer:g,wrapResponseSerializer:g,wrapErrorSerializer:g,req:d,res:d,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 c=t.browser.serialize;Array.isArray(t.browser.serialize)&&t.browser.serialize.indexOf("!stdSerializers.err")>-1&&(c=!1);"function"==typeof r&&(r.error=r.fatal=r.warn=r.info=r.debug=r.trace=r),!1===t.enabled&&(t.level="silent");const l=t.level||"info",d=Object.create(r);d.log||(d.log=y),Object.defineProperty(d,"levelVal",{get:function(){return"silent"===this.level?1/0:this.levels.values[this.level]}}),Object.defineProperty(d,"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(g,d,"error","log"),a(g,d,"fatal","error"),a(g,d,"warn","error"),a(g,d,"info","log"),a(g,d,"debug","log"),a(g,d,"trace","log")}});const g={transmit:e,serialize:s,asObject:t.browser.asObject,levels:["error","fatal","warn","info","debug","trace"],timestamp:p(t)};return d.levels=o.levels,d.level=l,d.setMaxListeners=d.getMaxListeners=d.emit=d.addListener=d.on=d.prependListener=d.once=d.prependOnceListener=d.removeListener=d.removeAllListeners=d.listeners=d.listenerCount=d.eventNames=d.write=d.flush=y,d.serializers=i,d._serialize=s,d._stdErrSerialize=c,d.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),c=!0===t.browser.serialize?Object.keys(a):s;delete r.serializers,h([r],c,a,this._stdErrSerialize)}function l(t){this._childLevel=1+(0|t._childLevel),this.error=u(t,r,"error"),this.fatal=u(t,r,"fatal"),this.warn=u(t,r,"warn"),this.info=u(t,r,"info"),this.debug=u(t,r,"debug"),this.trace=u(t,r,"trace"),a&&(this.serializers=a,this._serialize=c),e&&(this._logEvent=f([].concat(t._logEvent.bindings,r)))}return l.prototype=this,new l(this)},e&&(d._logEvent=f()),d}function a(t,e,r,i){const s=Object.getPrototypeOf(e);e[r]=e.levelVal>e.levels.values[r]?y:s[r]?s[r]:n[r]||n[i]||y,function(t,e,r){if(!t.transmit&&e[r]===y)return;e[r]=(i=e[r],function(){const s=t.timestamp(),a=new Array(arguments.length),u=Object.getPrototypeOf&&Object.getPrototypeOf(this)===n?n:this;for(var f=0;f<a.length;f++)a[f]=arguments[f];if(t.serialize&&!t.asObject&&h(a,this._serialize,this.serializers,this._stdErrSerialize),t.asObject?i.call(u,c(this,r,a,s)):i.apply(u,a),t.transmit){const i=t.transmit.level||e.level,n=o.levels.values[i],c=o.levels.values[r];if(c<n)return;l(this,{ts:s,methodLevel:r,methodValue:c,transmitLevel:i,transmitValue:o.levels.values[t.transmit.level||e.level],send:t.transmit.send,val:e.levelVal},a)}});var i}(t,e,r)}function c(t,e,r,n){t._serialize&&h(r,t._serialize,t.serializers,t._stdErrSerialize);const s=r.slice();let a=s[0];const c={};n&&(c.time=n),c.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(c,s.shift());a=s.length?i(s.shift(),s):void 0}else"string"==typeof a&&(a=i(s.shift(),s));return void 0!==a&&(c.msg=a),c}function h(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 u(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 l(t,e,r){const i=e.send,n=e.ts,s=e.methodLevel,o=e.methodValue,a=e.val,c=t._logEvent.bindings;h(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===c.indexOf(t)})),t._logEvent.level.label=s,t._logEvent.level.value=o,i(s,t._logEvent,a),t._logEvent=f(c)}function f(t){return{ts:0,messages:[],bindings:t||[],level:{label:"",value:0}}}function p(t){return"function"==typeof t.timestamp?t.timestamp:!1===t.timestamp?v:_}function d(){return{}}function g(t){return t}function y(){}function v(){return!1}function _(){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:v,epochTime:_,unixTime:function(){return Math.round(Date.now()/1e3)},isoTime:function(){return new Date(Date.now()).toISOString()}})}}]);