(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1885],{18862:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=i(53756);function n(e,t,i){return void 0===t&&(t=new Uint8Array(2)),void 0===i&&(i=0),t[i+0]=e>>>8,t[i+1]=e>>>0,t}function a(e,t,i){return void 0===t&&(t=new Uint8Array(2)),void 0===i&&(i=0),t[i+0]=e>>>0,t[i+1]=e>>>8,t}function o(e,t){return void 0===t&&(t=0),e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3]}function s(e,t){return void 0===t&&(t=0),(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}function c(e,t){return void 0===t&&(t=0),e[t+3]<<24|e[t+2]<<16|e[t+1]<<8|e[t]}function l(e,t){return void 0===t&&(t=0),(e[t+3]<<24|e[t+2]<<16|e[t+1]<<8|e[t])>>>0}function u(e,t,i){return void 0===t&&(t=new Uint8Array(4)),void 0===i&&(i=0),t[i+0]=e>>>24,t[i+1]=e>>>16,t[i+2]=e>>>8,t[i+3]=e>>>0,t}function d(e,t,i){return void 0===t&&(t=new Uint8Array(4)),void 0===i&&(i=0),t[i+0]=e>>>0,t[i+1]=e>>>8,t[i+2]=e>>>16,t[i+3]=e>>>24,t}function h(e,t,i){return void 0===t&&(t=new Uint8Array(8)),void 0===i&&(i=0),u(e/0x100000000>>>0,t,i),u(e>>>0,t,i+4),t}function p(e,t,i){return void 0===t&&(t=new Uint8Array(8)),void 0===i&&(i=0),d(e>>>0,t,i),d(e/0x100000000>>>0,t,i+4),t}t.readInt16BE=function(e,t){return void 0===t&&(t=0),(e[t+0]<<8|e[t+1])<<16>>16},t.readUint16BE=function(e,t){return void 0===t&&(t=0),(e[t+0]<<8|e[t+1])>>>0},t.readInt16LE=function(e,t){return void 0===t&&(t=0),(e[t+1]<<8|e[t])<<16>>16},t.readUint16LE=function(e,t){return void 0===t&&(t=0),(e[t+1]<<8|e[t])>>>0},t.writeUint16BE=n,t.writeInt16BE=n,t.writeUint16LE=a,t.writeInt16LE=a,t.readInt32BE=o,t.readUint32BE=s,t.readInt32LE=c,t.readUint32LE=l,t.writeUint32BE=u,t.writeInt32BE=u,t.writeUint32LE=d,t.writeInt32LE=d,t.readInt64BE=function(e,t){void 0===t&&(t=0);var i=o(e,t),r=o(e,t+4);return 0x100000000*i+r-(r>>31)*0x100000000},t.readUint64BE=function(e,t){return void 0===t&&(t=0),0x100000000*s(e,t)+s(e,t+4)},t.readInt64LE=function(e,t){void 0===t&&(t=0);var i=c(e,t);return 0x100000000*c(e,t+4)+i-(i>>31)*0x100000000},t.readUint64LE=function(e,t){void 0===t&&(t=0);var i=l(e,t);return 0x100000000*l(e,t+4)+i},t.writeUint64BE=h,t.writeInt64BE=h,t.writeUint64LE=p,t.writeInt64LE=p,t.readUintBE=function(e,t,i){if(void 0===i&&(i=0),e%8!=0)throw Error("readUintBE supports only bitLengths divisible by 8");if(e/8>t.length-i)throw Error("readUintBE: array is too short for the given bitLength");for(var r=0,n=1,a=e/8+i-1;a>=i;a--)r+=t[a]*n,n*=256;return r},t.readUintLE=function(e,t,i){if(void 0===i&&(i=0),e%8!=0)throw Error("readUintLE supports only bitLengths divisible by 8");if(e/8>t.length-i)throw Error("readUintLE: array is too short for the given bitLength");for(var r=0,n=1,a=i;a=n;o--)i[o]=t/a&255,a*=256;return i},t.writeUintLE=function(e,t,i,n){if(void 0===i&&(i=new Uint8Array(e/8)),void 0===n&&(n=0),e%8!=0)throw Error("writeUintLE supports only bitLengths divisible by 8");if(!r.isSafeInteger(t))throw Error("writeUintLE value must be an integer");for(var a=1,o=n;o{"use strict";var r=i(37625),n=i(29410),a=i(612),o=i(18862),s=i(4763);t.J4=32,t.PX=12,t.iW=16;var c=new Uint8Array(16),l=function(){function e(e){if(this.nonceLength=t.PX,this.tagLength=t.iW,e.length!==t.J4)throw Error("ChaCha20Poly1305 needs 32-byte key");this._key=new Uint8Array(e)}return e.prototype.seal=function(e,t,i,n){if(e.length>16)throw Error("ChaCha20Poly1305: incorrect nonce length");var o,s=new Uint8Array(16);s.set(e,s.length-e.length);var c=new Uint8Array(32);r.stream(this._key,s,c,4);var l=t.length+this.tagLength;if(n){if(n.length!==l)throw Error("ChaCha20Poly1305: incorrect destination length");o=n}else o=new Uint8Array(l);return r.streamXOR(this._key,s,t,o,4),this._authenticate(o.subarray(o.length-this.tagLength,o.length),c,o.subarray(0,o.length-this.tagLength),i),a.wipe(s),o},e.prototype.open=function(e,t,i,n){if(e.length>16)throw Error("ChaCha20Poly1305: incorrect nonce length");if(t.length0&&s.update(c.subarray(r.length%16))),s.update(i),i.length%16>0&&s.update(c.subarray(i.length%16));var l=new Uint8Array(8);r&&o.writeUint64LE(r.length,l),s.update(l),o.writeUint64LE(i.length,l),s.update(l);for(var u=s.digest(),d=0;d{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=i(18862),n=i(612);function a(e,t,i,a,o){if(void 0===o&&(o=0),32!==e.length)throw Error("ChaCha: key size must be 32 bytes");if(a.length>>16|S<<16)|0,y=y>>>20|y<<12,T^=m=m+x|0,x^=_=_+(T=T>>>16|T<<16)|0,x=x>>>20|x<<12,N^=b=b+C|0,C^=k=k+(N=N>>>16|N<<16)|0,C=C>>>20|C<<12,P^=v=v+A|0,A^=I=I+(P=P>>>16|P<<16)|0,A=A>>>20|A<<12,N^=b=b+C|0,C^=k=k+(N=N>>>24|N<<8)|0,C=C>>>25|C<<7,P^=v=v+A|0,A^=I=I+(P=P>>>24|P<<8)|0,A=A>>>25|A<<7,T^=m=m+x|0,x^=_=_+(T=T>>>24|T<<8)|0,x=x>>>25|x<<7,S^=w=w+y|0,y^=E=E+(S=S>>>24|S<<8)|0,y=y>>>25|y<<7,P^=w=w+x|0,x^=k=k+(P=P>>>16|P<<16)|0,x=x>>>20|x<<12,S^=m=m+C|0,C^=I=I+(S=S>>>16|S<<16)|0,C=C>>>20|C<<12,T^=b=b+A|0,A^=E=E+(T=T>>>16|T<<16)|0,A=A>>>20|A<<12,N^=v=v+y|0,y^=_=_+(N=N>>>16|N<<16)|0,y=y>>>20|y<<12,T^=b=b+A|0,A^=E=E+(T=T>>>24|T<<8)|0,A=A>>>25|A<<7,N^=v=v+y|0,y^=_=_+(N=N>>>24|N<<8)|0,y=y>>>25|y<<7,S^=m=m+C|0,C^=I=I+(S=S>>>24|S<<8)|0,C=C>>>25|C<<7,P^=w=w+x|0,x^=k=k+(P=P>>>24|P<<8)|0,x=x>>>25|x<<7;r.writeUint32LE(w+0x61707865|0,e,0),r.writeUint32LE(m+0x3320646e|0,e,4),r.writeUint32LE(b+0x79622d32|0,e,8),r.writeUint32LE(v+0x6b206574|0,e,12),r.writeUint32LE(y+n|0,e,16),r.writeUint32LE(x+a|0,e,20),r.writeUint32LE(C+o|0,e,24),r.writeUint32LE(A+s|0,e,28),r.writeUint32LE(E+c|0,e,32),r.writeUint32LE(_+l|0,e,36),r.writeUint32LE(k+u|0,e,40),r.writeUint32LE(I+d|0,e,44),r.writeUint32LE(S+h|0,e,48),r.writeUint32LE(T+p|0,e,52),r.writeUint32LE(N+f|0,e,56),r.writeUint32LE(P+g|0,e,60)}(l,s,e);for(var d=u;d>>=8,t++;if(r>0)throw Error("ChaCha: counter overflow")}(s,0,c)}return n.wipe(l),0===o&&n.wipe(s),a}t.streamXOR=a,t.stream=function(e,t,i,r){return void 0===r&&(r=0),n.wipe(i),a(e,t,i,i,r)}},4763:(e,t)=>{"use strict";function i(e,t){if(e.length!==t.length)return 0;for(var i=0,r=0;r>>8}Object.defineProperty(t,"__esModule",{value:!0}),t.select=function(e,t,i){return~(e-1)&t|e-1&i},t.lessOrEqual=function(e,t){return(0|e)-(0|t)-1>>>31&1},t.compare=i,t.equal=function(e,t){return 0!==e.length&&0!==t.length&&0!==i(e,t)}},19854:(e,t,i)=>{"use strict";t._S=t.K=t.TP=t.wE=t.Ee=void 0,i(78133);let r=i(93899);function n(e){let t=new Float64Array(16);if(e)for(let i=0;i>16&1),i[e-1]&=65535;i[15]=r[15]-32767-(i[14]>>16&1);let e=i[15]>>16&1;i[14]&=65535,h(r,i,1-e)}for(let t=0;t<16;t++)e[2*t]=255&r[t],e[2*t+1]=r[t]>>8}n([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function f(e,t,i){for(let r=0;r<16;r++)e[r]=t[r]+i[r]}function g(e,t,i){for(let r=0;r<16;r++)e[r]=t[r]-i[r]}function w(e,t,i){let r,n,a=0,o=0,s=0,c=0,l=0,u=0,d=0,h=0,p=0,f=0,g=0,w=0,m=0,b=0,v=0,y=0,x=0,C=0,A=0,E=0,_=0,k=0,I=0,S=0,T=0,N=0,P=0,R=0,O=0,M=0,D=0,U=i[0],$=i[1],L=i[2],j=i[3],B=i[4],W=i[5],q=i[6],H=i[7],z=i[8],F=i[9],Z=i[10],V=i[11],K=i[12],G=i[13],J=i[14],Y=i[15];a+=(r=t[0])*U,o+=r*$,s+=r*L,c+=r*j,l+=r*B,u+=r*W,d+=r*q,h+=r*H,p+=r*z,f+=r*F,g+=r*Z,w+=r*V,m+=r*K,b+=r*G,v+=r*J,y+=r*Y,o+=(r=t[1])*U,s+=r*$,c+=r*L,l+=r*j,u+=r*B,d+=r*W,h+=r*q,p+=r*H,f+=r*z,g+=r*F,w+=r*Z,m+=r*V,b+=r*K,v+=r*G,y+=r*J,x+=r*Y,s+=(r=t[2])*U,c+=r*$,l+=r*L,u+=r*j,d+=r*B,h+=r*W,p+=r*q,f+=r*H,g+=r*z,w+=r*F,m+=r*Z,b+=r*V,v+=r*K,y+=r*G,x+=r*J,C+=r*Y,c+=(r=t[3])*U,l+=r*$,u+=r*L,d+=r*j,h+=r*B,p+=r*W,f+=r*q,g+=r*H,w+=r*z,m+=r*F,b+=r*Z,v+=r*V,y+=r*K,x+=r*G,C+=r*J,A+=r*Y,l+=(r=t[4])*U,u+=r*$,d+=r*L,h+=r*j,p+=r*B,f+=r*W,g+=r*q,w+=r*H,m+=r*z,b+=r*F,v+=r*Z,y+=r*V,x+=r*K,C+=r*G,A+=r*J,E+=r*Y,u+=(r=t[5])*U,d+=r*$,h+=r*L,p+=r*j,f+=r*B,g+=r*W,w+=r*q,m+=r*H,b+=r*z,v+=r*F,y+=r*Z,x+=r*V,C+=r*K,A+=r*G,E+=r*J,_+=r*Y,d+=(r=t[6])*U,h+=r*$,p+=r*L,f+=r*j,g+=r*B,w+=r*W,m+=r*q,b+=r*H,v+=r*z,y+=r*F,x+=r*Z,C+=r*V,A+=r*K,E+=r*G,_+=r*J,k+=r*Y,h+=(r=t[7])*U,p+=r*$,f+=r*L,g+=r*j,w+=r*B,m+=r*W,b+=r*q,v+=r*H,y+=r*z,x+=r*F,C+=r*Z,A+=r*V,E+=r*K,_+=r*G,k+=r*J,I+=r*Y,p+=(r=t[8])*U,f+=r*$,g+=r*L,w+=r*j,m+=r*B,b+=r*W,v+=r*q,y+=r*H,x+=r*z,C+=r*F,A+=r*Z,E+=r*V,_+=r*K,k+=r*G,I+=r*J,S+=r*Y,f+=(r=t[9])*U,g+=r*$,w+=r*L,m+=r*j,b+=r*B,v+=r*W,y+=r*q,x+=r*H,C+=r*z,A+=r*F,E+=r*Z,_+=r*V,k+=r*K,I+=r*G,S+=r*J,T+=r*Y,g+=(r=t[10])*U,w+=r*$,m+=r*L,b+=r*j,v+=r*B,y+=r*W,x+=r*q,C+=r*H,A+=r*z,E+=r*F,_+=r*Z,k+=r*V,I+=r*K,S+=r*G,T+=r*J,N+=r*Y,w+=(r=t[11])*U,m+=r*$,b+=r*L,v+=r*j,y+=r*B,x+=r*W,C+=r*q,A+=r*H,E+=r*z,_+=r*F,k+=r*Z,I+=r*V,S+=r*K,T+=r*G,N+=r*J,P+=r*Y,m+=(r=t[12])*U,b+=r*$,v+=r*L,y+=r*j,x+=r*B,C+=r*W,A+=r*q,E+=r*H,_+=r*z,k+=r*F,I+=r*Z,S+=r*V,T+=r*K,N+=r*G,P+=r*J,R+=r*Y,b+=(r=t[13])*U,v+=r*$,y+=r*L,x+=r*j,C+=r*B,A+=r*W,E+=r*q,_+=r*H,k+=r*z,I+=r*F,S+=r*Z,T+=r*V,N+=r*K,P+=r*G,R+=r*J,O+=r*Y,v+=(r=t[14])*U,y+=r*$,x+=r*L,C+=r*j,A+=r*B,E+=r*W,_+=r*q,k+=r*H,I+=r*z,S+=r*F,T+=r*Z,N+=r*V,P+=r*K,R+=r*G,O+=r*J,M+=r*Y,y+=(r=t[15])*U,x+=r*$,C+=r*L,A+=r*j,E+=r*B,_+=r*W,k+=r*q,I+=r*H,S+=r*z,T+=r*F,N+=r*Z,P+=r*V,R+=r*K,O+=r*G,M+=r*J,D+=r*Y,a+=38*x,o+=38*C,s+=38*A,c+=38*E,l+=38*_,u+=38*k,d+=38*I,h+=38*S,p+=38*T,f+=38*N,g+=38*P,w+=38*R,m+=38*O,b+=38*M,v+=38*D,n=Math.floor((r=a+(n=1)+65535)/65536),a=r-65536*n,n=Math.floor((r=o+n+65535)/65536),o=r-65536*n,n=Math.floor((r=s+n+65535)/65536),s=r-65536*n,n=Math.floor((r=c+n+65535)/65536),c=r-65536*n,n=Math.floor((r=l+n+65535)/65536),l=r-65536*n,n=Math.floor((r=u+n+65535)/65536),u=r-65536*n,n=Math.floor((r=d+n+65535)/65536),d=r-65536*n,n=Math.floor((r=h+n+65535)/65536),h=r-65536*n,n=Math.floor((r=p+n+65535)/65536),p=r-65536*n,n=Math.floor((r=f+n+65535)/65536),f=r-65536*n,n=Math.floor((r=g+n+65535)/65536),g=r-65536*n,n=Math.floor((r=w+n+65535)/65536),w=r-65536*n,n=Math.floor((r=m+n+65535)/65536),m=r-65536*n,n=Math.floor((r=b+n+65535)/65536),b=r-65536*n,n=Math.floor((r=v+n+65535)/65536),v=r-65536*n,n=Math.floor((r=y+n+65535)/65536),y=r-65536*n,a+=n-1+37*(n-1),n=Math.floor((r=a+(n=1)+65535)/65536),a=r-65536*n,n=Math.floor((r=o+n+65535)/65536),o=r-65536*n,n=Math.floor((r=s+n+65535)/65536),s=r-65536*n,n=Math.floor((r=c+n+65535)/65536),c=r-65536*n,n=Math.floor((r=l+n+65535)/65536),l=r-65536*n,n=Math.floor((r=u+n+65535)/65536),u=r-65536*n,n=Math.floor((r=d+n+65535)/65536),d=r-65536*n,n=Math.floor((r=h+n+65535)/65536),h=r-65536*n,n=Math.floor((r=p+n+65535)/65536),p=r-65536*n,n=Math.floor((r=f+n+65535)/65536),f=r-65536*n,n=Math.floor((r=g+n+65535)/65536),g=r-65536*n,n=Math.floor((r=w+n+65535)/65536),w=r-65536*n,n=Math.floor((r=m+n+65535)/65536),m=r-65536*n,n=Math.floor((r=b+n+65535)/65536),b=r-65536*n,n=Math.floor((r=v+n+65535)/65536),v=r-65536*n,n=Math.floor((r=y+n+65535)/65536),y=r-65536*n,a+=n-1+37*(n-1),e[0]=a,e[1]=o,e[2]=s,e[3]=c,e[4]=l,e[5]=u,e[6]=d,e[7]=h,e[8]=p,e[9]=f,e[10]=g,e[11]=w,e[12]=m,e[13]=b,e[14]=v,e[15]=y}function m(e,t){let i=n(),r=n(),a=n(),o=n(),c=n(),l=n(),u=n(),d=n(),h=n();g(i,e[1],e[0]),g(h,t[1],t[0]),w(i,i,h),f(r,e[0],e[1]),f(h,t[0],t[1]),w(r,r,h),w(a,e[3],t[3]),w(a,a,s),w(o,e[2],t[2]),f(o,o,o),g(c,r,i),g(l,o,a),f(u,o,a),f(d,r,i),w(e[0],c,l),w(e[1],d,u),w(e[2],u,l),w(e[3],c,d)}function b(e,t,i){for(let r=0;r<4;r++)h(e[r],t[r],i)}function v(e,t){let i=n(),r=n(),a=n();(function(e,t){let i;let r=n();for(i=0;i<16;i++)r[i]=t[i];for(i=253;i>=0;i--)w(r,r,r),2!==i&&4!==i&&w(r,r,t);for(i=0;i<16;i++)e[i]=r[i]})(a,t[2]),w(i,t[0],a),w(r,t[1],a),p(e,r),e[31]^=function(e){let t=new Uint8Array(32);return p(t,e),1&t[0]}(i)<<7}function y(e,t){let i=[n(),n(),n(),n()];u(i[0],c),u(i[1],l),u(i[2],o),w(i[3],c,l),function(e,t,i){u(e[0],a),u(e[1],o),u(e[2],o),u(e[3],a);for(let r=255;r>=0;--r){let n=i[r/8|0]>>(7&r)&1;b(e,t,n),m(t,e),m(e,e),b(e,t,n)}}(e,i,t)}t.K=function(e){if(e.length!==t.TP)throw Error(`ed25519: seed must be ${t.TP} bytes`);let i=(0,r.hash)(e);i[0]&=248,i[31]&=127,i[31]|=64;let a=new Uint8Array(32),o=[n(),n(),n(),n()];y(o,i),v(a,o);let s=new Uint8Array(64);return s.set(e),s.set(a,32),{publicKey:a,secretKey:s}};let x=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 C(e,t){let i,r,n,a;for(r=63;r>=32;--r){for(i=0,n=r-32,a=r-12;n>4)*x[n],i=t[n]>>8,t[n]&=255;for(n=0;n<32;n++)t[n]-=i*x[n];for(r=0;r<32;r++)t[r+1]+=t[r]>>8,e[r]=255&t[r]}function A(e){let t=new Float64Array(64);for(let i=0;i<64;i++)t[i]=e[i];for(let t=0;t<64;t++)e[t]=0;C(e,t)}t._S=function(e,t){let i=new Float64Array(64),a=[n(),n(),n(),n()],o=(0,r.hash)(e.subarray(0,32));o[0]&=248,o[31]&=127,o[31]|=64;let s=new Uint8Array(64);s.set(o.subarray(32),32);let c=new r.SHA512;c.update(s.subarray(32)),c.update(t);let l=c.digest();c.clean(),A(l),y(a,l),v(s,a),c.reset(),c.update(s.subarray(0,32)),c.update(e.subarray(32)),c.update(t);let u=c.digest();A(u);for(let e=0;e<32;e++)i[e]=l[e];for(let e=0;e<32;e++)for(let t=0;t<32;t++)i[e+t]+=u[e]*o[t];return C(s.subarray(32),i),s}},22985:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isSerializableHash=function(e){return void 0!==e.saveState&&void 0!==e.restoreState&&void 0!==e.cleanSavedState}},39464:(e,t,i)=>{"use strict";var r=i(14368),n=i(612),a=function(){function e(e,t,i,n){void 0===i&&(i=new Uint8Array(0)),this._counter=new Uint8Array(1),this._hash=e,this._info=n;var a=r.hmac(this._hash,i,t);this._hmac=new r.HMAC(e,a),this._buffer=new Uint8Array(this._hmac.digestLength),this._bufpos=this._buffer.length}return e.prototype._fillBuffer=function(){this._counter[0]++;var e=this._counter[0];if(0===e)throw Error("hkdf: cannot expand more");this._hmac.reset(),e>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},e.prototype.expand=function(e){for(var t=new Uint8Array(e),i=0;i{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=i(22985),n=i(4763),a=i(612),o=function(){function e(e,t){this._finished=!1,this._inner=new e,this._outer=new e,this.blockSize=this._outer.blockSize,this.digestLength=this._outer.digestLength;var i=new Uint8Array(this.blockSize);t.length>this.blockSize?this._inner.update(t).finish(i).clean():i.set(t);for(var n=0;n{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mul=Math.imul||function(e,t){var i=65535&e,r=65535&t;return i*r+((e>>>16&65535)*r+i*(t>>>16&65535)<<16>>>0)|0},t.add=function(e,t){return e+t|0},t.sub=function(e,t){return e-t|0},t.rotl=function(e,t){return e<>>32-t},t.rotr=function(e,t){return e<<32-t|e>>>t},t.isInteger=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e},t.MAX_SAFE_INTEGER=0x1fffffffffffff,t.isSafeInteger=function(e){return t.isInteger(e)&&e>=-t.MAX_SAFE_INTEGER&&e<=t.MAX_SAFE_INTEGER}},29410:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=i(4763),n=i(612);t.DIGEST_LENGTH=16;var a=function(){function e(e){this.digestLength=t.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 i=e[0]|e[1]<<8;this._r[0]=8191&i;var r=e[2]|e[3]<<8;this._r[1]=(i>>>13|r<<3)&8191;var n=e[4]|e[5]<<8;this._r[2]=(r>>>10|n<<6)&7939;var a=e[6]|e[7]<<8;this._r[3]=(n>>>7|a<<9)&8191;var o=e[8]|e[9]<<8;this._r[4]=(a>>>4|o<<12)&255,this._r[5]=o>>>1&8190;var s=e[10]|e[11]<<8;this._r[6]=(o>>>14|s<<2)&8191;var c=e[12]|e[13]<<8;this._r[7]=(s>>>11|c<<5)&8065;var l=e[14]|e[15]<<8;this._r[8]=(c>>>8|l<<8)&8191,this._r[9]=l>>>5&127,this._pad[0]=e[16]|e[17]<<8,this._pad[1]=e[18]|e[19]<<8,this._pad[2]=e[20]|e[21]<<8,this._pad[3]=e[22]|e[23]<<8,this._pad[4]=e[24]|e[25]<<8,this._pad[5]=e[26]|e[27]<<8,this._pad[6]=e[28]|e[29]<<8,this._pad[7]=e[30]|e[31]<<8}return e.prototype._blocks=function(e,t,i){for(var r=this._fin?0:2048,n=this._h[0],a=this._h[1],o=this._h[2],s=this._h[3],c=this._h[4],l=this._h[5],u=this._h[6],d=this._h[7],h=this._h[8],p=this._h[9],f=this._r[0],g=this._r[1],w=this._r[2],m=this._r[3],b=this._r[4],v=this._r[5],y=this._r[6],x=this._r[7],C=this._r[8],A=this._r[9];i>=16;){var E,_=e[t+0]|e[t+1]<<8;n+=8191&_;var k=e[t+2]|e[t+3]<<8;a+=(_>>>13|k<<3)&8191;var I=e[t+4]|e[t+5]<<8;o+=(k>>>10|I<<6)&8191;var S=e[t+6]|e[t+7]<<8;s+=(I>>>7|S<<9)&8191;var T=e[t+8]|e[t+9]<<8;c+=(S>>>4|T<<12)&8191,l+=T>>>1&8191;var N=e[t+10]|e[t+11]<<8;u+=(T>>>14|N<<2)&8191;var P=e[t+12]|e[t+13]<<8;d+=(N>>>11|P<<5)&8191;var R=e[t+14]|e[t+15]<<8;h+=(P>>>8|R<<8)&8191,p+=R>>>5|r;var O=0;O=(E=0+n*f+5*A*a+5*C*o+5*x*s+5*y*c)>>>13,E&=8191,E+=5*v*l+5*b*u+5*m*d+5*w*h+5*g*p,O+=E>>>13,E&=8191;var M=O;M+=n*g,M+=a*f,M+=5*A*o,M+=5*C*s,M+=5*x*c,O=M>>>13,M&=8191,M+=5*y*l,M+=5*v*u,M+=5*b*d,M+=5*m*h,M+=5*w*p,O+=M>>>13,M&=8191;var D=O;D+=n*w,D+=a*g,D+=o*f,D+=5*A*s,D+=5*C*c,O=D>>>13,D&=8191,D+=5*x*l,D+=5*y*u,D+=5*v*d,D+=5*b*h,D+=5*m*p,O+=D>>>13,D&=8191;var U=O;U+=n*m,U+=a*w,U+=o*g,U+=s*f,U+=5*A*c,O=U>>>13,U&=8191,U+=5*C*l,U+=5*x*u,U+=5*y*d,U+=5*v*h,U+=5*b*p,O+=U>>>13,U&=8191;var $=O;$+=n*b,$+=a*m,$+=o*w,$+=s*g,$+=c*f,O=$>>>13,$&=8191,$+=5*A*l,$+=5*C*u,$+=5*x*d,$+=5*y*h,$+=5*v*p,O+=$>>>13,$&=8191;var L=O;L+=n*v,L+=a*b,L+=o*m,L+=s*w,L+=c*g,O=L>>>13,L&=8191,L+=l*f,L+=5*A*u,L+=5*C*d,L+=5*x*h,L+=5*y*p,O+=L>>>13,L&=8191;var j=O;j+=n*y,j+=a*v,j+=o*b,j+=s*m,j+=c*w,O=j>>>13,j&=8191,j+=l*g,j+=u*f,j+=5*A*d,j+=5*C*h,j+=5*x*p,O+=j>>>13,j&=8191;var B=O;B+=n*x,B+=a*y,B+=o*v,B+=s*b,B+=c*m,O=B>>>13,B&=8191,B+=l*w,B+=u*g,B+=d*f,B+=5*A*h,B+=5*C*p,O+=B>>>13,B&=8191;var W=O;W+=n*C,W+=a*x,W+=o*y,W+=s*v,W+=c*b,O=W>>>13,W&=8191,W+=l*m,W+=u*w,W+=d*g,W+=h*f,W+=5*A*p,O+=W>>>13,W&=8191;var q=O;q+=n*A,q+=a*C,q+=o*x,q+=s*y,q+=c*v,O=q>>>13,q&=8191,q+=l*b,q+=u*m,q+=d*w,q+=h*g,q+=p*f,O+=q>>>13,q&=8191,E=8191&(O=(O=(O<<2)+O|0)+E|0),O>>>=13,M+=O,n=E,a=M,o=D,s=U,c=$,l=L,u=j,d=B,h=W,p=q,t+=16,i-=16}this._h[0]=n,this._h[1]=a,this._h[2]=o,this._h[3]=s,this._h[4]=c,this._h[5]=l,this._h[6]=u,this._h[7]=d,this._h[8]=h,this._h[9]=p},e.prototype.finish=function(e,t){void 0===t&&(t=0);var i,r,n,a,o=new Uint16Array(10);if(this._leftover){for(a=this._leftover,this._buffer[a++]=1;a<16;a++)this._buffer[a]=0;this._fin=1,this._blocks(this._buffer,0,16)}for(i=this._h[1]>>>13,this._h[1]&=8191,a=2;a<10;a++)this._h[a]+=i,i=this._h[a]>>>13,this._h[a]&=8191;for(this._h[0]+=5*i,i=this._h[0]>>>13,this._h[0]&=8191,this._h[1]+=i,i=this._h[1]>>>13,this._h[1]&=8191,this._h[2]+=i,o[0]=this._h[0]+5,i=o[0]>>>13,o[0]&=8191,a=1;a<10;a++)o[a]=this._h[a]+i,i=o[a]>>>13,o[a]&=8191;for(o[9]-=8192,r=(1^i)-1,a=0;a<10;a++)o[a]&=r;for(a=0,r=~r;a<10;a++)this._h[a]=this._h[a]&r|o[a];for(a=1,this._h[0]=(this._h[0]|this._h[1]<<13)&65535,this._h[1]=(this._h[1]>>>3|this._h[2]<<10)&65535,this._h[2]=(this._h[2]>>>6|this._h[3]<<7)&65535,this._h[3]=(this._h[3]>>>9|this._h[4]<<4)&65535,this._h[4]=(this._h[4]>>>12|this._h[5]<<1|this._h[6]<<14)&65535,this._h[5]=(this._h[6]>>>2|this._h[7]<<11)&65535,this._h[6]=(this._h[7]>>>5|this._h[8]<<8)&65535,this._h[7]=(this._h[8]>>>8|this._h[9]<<5)&65535,n=this._h[0]+this._pad[0],this._h[0]=65535&n;a<8;a++)n=(this._h[a]+this._pad[a]|0)+(n>>>16)|0,this._h[a]=65535&n;return e[t+0]=this._h[0]>>>0,e[t+1]=this._h[0]>>>8,e[t+2]=this._h[1]>>>0,e[t+3]=this._h[1]>>>8,e[t+4]=this._h[2]>>>0,e[t+5]=this._h[2]>>>8,e[t+6]=this._h[3]>>>0,e[t+7]=this._h[3]>>>8,e[t+8]=this._h[4]>>>0,e[t+9]=this._h[4]>>>8,e[t+10]=this._h[5]>>>0,e[t+11]=this._h[5]>>>8,e[t+12]=this._h[6]>>>0,e[t+13]=this._h[6]>>>8,e[t+14]=this._h[7]>>>0,e[t+15]=this._h[7]>>>8,this._finished=!0,this},e.prototype.update=function(e){var t,i=0,r=e.length;if(this._leftover){(t=16-this._leftover)>r&&(t=r);for(var n=0;n=16&&(t=r-r%16,this._blocks(e,i,t),i+=t,r-=t),r){for(var n=0;n{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.randomStringForEntropy=t.randomString=t.randomUint32=t.randomBytes=t.defaultRandomSource=void 0;let r=i(93677),n=i(18862),a=i(612);function o(e,i=t.defaultRandomSource){return i.randomBytes(e)}t.defaultRandomSource=new r.SystemRandomSource,t.randomBytes=o,t.randomUint32=function(e=t.defaultRandomSource){let i=o(4,e),r=(0,n.readUint32LE)(i);return(0,a.wipe)(i),r};let s="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";function c(e,i=s,r=t.defaultRandomSource){if(i.length<2)throw Error("randomString charset is too short");if(i.length>256)throw Error("randomString charset is too long");let n="",l=i.length,u=256-256%l;for(;e>0;){let t=o(Math.ceil(256*e/u),r);for(let r=0;r0;r++){let a=t[r];a{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BrowserRandomSource=void 0;class i{constructor(){this.isAvailable=!1,this.isInstantiated=!1;let e="undefined"!=typeof self?self.crypto||self.msCrypto:null;e&&void 0!==e.getRandomValues&&(this._crypto=e,this.isAvailable=!0,this.isInstantiated=!0)}randomBytes(e){if(!this.isAvailable||!this._crypto)throw Error("Browser random byte generator is not available.");let t=new Uint8Array(e);for(let e=0;e{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NodeRandomSource=void 0;let r=i(612);class n{constructor(){this.isAvailable=!1,this.isInstantiated=!1;{let e=i(69147);e&&e.randomBytes&&(this._crypto=e,this.isAvailable=!0,this.isInstantiated=!0)}}randomBytes(e){if(!this.isAvailable||!this._crypto)throw Error("Node.js random byte generator is not available.");let t=this._crypto.randomBytes(e);if(t.length!==e)throw Error("NodeRandomSource: got fewer bytes than requested");let i=new Uint8Array(e);for(let e=0;e{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SystemRandomSource=void 0;let r=i(5476),n=i(66236);class a{constructor(){if(this.isAvailable=!1,this.name="",this._source=new r.BrowserRandomSource,this._source.isAvailable){this.isAvailable=!0,this.name="Browser";return}if(this._source=new n.NodeRandomSource,this._source.isAvailable){this.isAvailable=!0,this.name="Node";return}}randomBytes(e){if(!this.isAvailable)throw Error("System random byte generator is not available.");return this._source.randomBytes(e)}}t.SystemRandomSource=a},65904:(e,t,i)=>{"use strict";var r=i(18862),n=i(612);t.On=32,t.cS=64;var a=function(){function e(){this.digestLength=t.On,this.blockSize=t.cS,this._state=new Int32Array(8),this._temp=new Int32Array(64),this._buffer=new Uint8Array(128),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this.reset()}return e.prototype._initState=function(){this._state[0]=0x6a09e667,this._state[1]=0xbb67ae85,this._state[2]=0x3c6ef372,this._state[3]=0xa54ff53a,this._state[4]=0x510e527f,this._state[5]=0x9b05688c,this._state[6]=0x1f83d9ab,this._state[7]=0x5be0cd19},e.prototype.reset=function(){return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this},e.prototype.clean=function(){n.wipe(this._buffer),n.wipe(this._temp),this.reset()},e.prototype.update=function(e,t){if(void 0===t&&(t=e.length),this._finished)throw Error("SHA256: can't update because hash was finished.");var i=0;if(this._bytesHashed+=t,this._bufferLength>0){for(;this._bufferLength0;)this._buffer[this._bufferLength++]=e[i++],t--;this._bufferLength===this.blockSize&&(s(this._temp,this._state,this._buffer,0,this.blockSize),this._bufferLength=0)}for(t>=this.blockSize&&(i=s(this._temp,this._state,e,i,t),t%=this.blockSize);t>0;)this._buffer[this._bufferLength++]=e[i++],t--;return this},e.prototype.finish=function(e){if(!this._finished){var t=this._bytesHashed,i=this._bufferLength,n=t%64<56?64:128;this._buffer[i]=128;for(var a=i+1;a0?new Uint8Array(this._buffer):void 0,bufferLength:this._bufferLength,bytesHashed:this._bytesHashed}},e.prototype.restoreState=function(e){return this._state.set(e.state),this._bufferLength=e.bufferLength,e.buffer&&this._buffer.set(e.buffer),this._bytesHashed=e.bytesHashed,this._finished=!1,this},e.prototype.cleanSavedState=function(e){n.wipe(e.state),e.buffer&&n.wipe(e.buffer),e.bufferLength=0,e.bytesHashed=0},e}();t.aD=a;var o=new Int32Array([0x428a2f98,0x71374491,0xb5c0fbcf,0xe9b5dba5,0x3956c25b,0x59f111f1,0x923f82a4,0xab1c5ed5,0xd807aa98,0x12835b01,0x243185be,0x550c7dc3,0x72be5d74,0x80deb1fe,0x9bdc06a7,0xc19bf174,0xe49b69c1,0xefbe4786,0xfc19dc6,0x240ca1cc,0x2de92c6f,0x4a7484aa,0x5cb0a9dc,0x76f988da,0x983e5152,0xa831c66d,0xb00327c8,0xbf597fc7,0xc6e00bf3,0xd5a79147,0x6ca6351,0x14292967,0x27b70a85,0x2e1b2138,0x4d2c6dfc,0x53380d13,0x650a7354,0x766a0abb,0x81c2c92e,0x92722c85,0xa2bfe8a1,0xa81a664b,0xc24b8b70,0xc76c51a3,0xd192e819,0xd6990624,0xf40e3585,0x106aa070,0x19a4c116,0x1e376c08,0x2748774c,0x34b0bcb5,0x391c0cb3,0x4ed8aa4a,0x5b9cca4f,0x682e6ff3,0x748f82ee,0x78a5636f,0x84c87814,0x8cc70208,0x90befffa,0xa4506ceb,0xbef9a3f7,0xc67178f2]);function s(e,t,i,n,a){for(;a>=64;){for(var s=t[0],c=t[1],l=t[2],u=t[3],d=t[4],h=t[5],p=t[6],f=t[7],g=0;g<16;g++){var w=n+4*g;e[g]=r.readUint32BE(i,w)}for(var g=16;g<64;g++){var m=e[g-2],b=(m>>>17|m<<15)^(m>>>19|m<<13)^m>>>10,v=((m=e[g-15])>>>7|m<<25)^(m>>>18|m<<14)^m>>>3;e[g]=(b+e[g-7]|0)+(v+e[g-16]|0)}for(var g=0;g<64;g++){var b=(((d>>>6|d<<26)^(d>>>11|d<<21)^(d>>>25|d<<7))+(d&h^~d&p)|0)+(f+(o[g]+e[g]|0)|0)|0,v=((s>>>2|s<<30)^(s>>>13|s<<19)^(s>>>22|s<<10))+(s&c^s&l^c&l)|0;f=p,p=h,h=d,d=u+b|0,u=l,l=c,c=s,s=b+v|0}t[0]+=s,t[1]+=c,t[2]+=l,t[3]+=u,t[4]+=d,t[5]+=h,t[6]+=p,t[7]+=f,n+=64,a-=64}return n}t.tW=function(e){var t=new a;t.update(e);var i=t.digest();return t.clean(),i}},93899:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=i(18862),n=i(612);t.DIGEST_LENGTH=64,t.BLOCK_SIZE=128;var a=function(){function e(){this.digestLength=t.DIGEST_LENGTH,this.blockSize=t.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 e.prototype._initState=function(){this._stateHi[0]=0x6a09e667,this._stateHi[1]=0xbb67ae85,this._stateHi[2]=0x3c6ef372,this._stateHi[3]=0xa54ff53a,this._stateHi[4]=0x510e527f,this._stateHi[5]=0x9b05688c,this._stateHi[6]=0x1f83d9ab,this._stateHi[7]=0x5be0cd19,this._stateLo[0]=0xf3bcc908,this._stateLo[1]=0x84caa73b,this._stateLo[2]=0xfe94f82b,this._stateLo[3]=0x5f1d36f1,this._stateLo[4]=0xade682d1,this._stateLo[5]=0x2b3e6c1f,this._stateLo[6]=0xfb41bd6b,this._stateLo[7]=0x137e2179},e.prototype.reset=function(){return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this},e.prototype.clean=function(){n.wipe(this._buffer),n.wipe(this._tempHi),n.wipe(this._tempLo),this.reset()},e.prototype.update=function(e,i){if(void 0===i&&(i=e.length),this._finished)throw Error("SHA512: can't update because hash was finished.");var r=0;if(this._bytesHashed+=i,this._bufferLength>0){for(;this._bufferLength0;)this._buffer[this._bufferLength++]=e[r++],i--;this._bufferLength===this.blockSize&&(s(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,this.blockSize),this._bufferLength=0)}for(i>=this.blockSize&&(r=s(this._tempHi,this._tempLo,this._stateHi,this._stateLo,e,r,i),i%=this.blockSize);i>0;)this._buffer[this._bufferLength++]=e[r++],i--;return this},e.prototype.finish=function(e){if(!this._finished){var t=this._bytesHashed,i=this._bufferLength,n=t%128<112?128:256;this._buffer[i]=128;for(var a=i+1;a0?new Uint8Array(this._buffer):void 0,bufferLength:this._bufferLength,bytesHashed:this._bytesHashed}},e.prototype.restoreState=function(e){return this._stateHi.set(e.stateHi),this._stateLo.set(e.stateLo),this._bufferLength=e.bufferLength,e.buffer&&this._buffer.set(e.buffer),this._bytesHashed=e.bytesHashed,this._finished=!1,this},e.prototype.cleanSavedState=function(e){n.wipe(e.stateHi),n.wipe(e.stateLo),e.buffer&&n.wipe(e.buffer),e.bufferLength=0,e.bytesHashed=0},e}();t.SHA512=a;var o=new Int32Array([0x428a2f98,0xd728ae22,0x71374491,0x23ef65cd,0xb5c0fbcf,0xec4d3b2f,0xe9b5dba5,0x8189dbbc,0x3956c25b,0xf348b538,0x59f111f1,0xb605d019,0x923f82a4,0xaf194f9b,0xab1c5ed5,0xda6d8118,0xd807aa98,0xa3030242,0x12835b01,0x45706fbe,0x243185be,0x4ee4b28c,0x550c7dc3,0xd5ffb4e2,0x72be5d74,0xf27b896f,0x80deb1fe,0x3b1696b1,0x9bdc06a7,0x25c71235,0xc19bf174,0xcf692694,0xe49b69c1,0x9ef14ad2,0xefbe4786,0x384f25e3,0xfc19dc6,0x8b8cd5b5,0x240ca1cc,0x77ac9c65,0x2de92c6f,0x592b0275,0x4a7484aa,0x6ea6e483,0x5cb0a9dc,0xbd41fbd4,0x76f988da,0x831153b5,0x983e5152,0xee66dfab,0xa831c66d,0x2db43210,0xb00327c8,0x98fb213f,0xbf597fc7,0xbeef0ee4,0xc6e00bf3,0x3da88fc2,0xd5a79147,0x930aa725,0x6ca6351,0xe003826f,0x14292967,0xa0e6e70,0x27b70a85,0x46d22ffc,0x2e1b2138,0x5c26c926,0x4d2c6dfc,0x5ac42aed,0x53380d13,0x9d95b3df,0x650a7354,0x8baf63de,0x766a0abb,0x3c77b2a8,0x81c2c92e,0x47edaee6,0x92722c85,0x1482353b,0xa2bfe8a1,0x4cf10364,0xa81a664b,0xbc423001,0xc24b8b70,0xd0f89791,0xc76c51a3,0x654be30,0xd192e819,0xd6ef5218,0xd6990624,0x5565a910,0xf40e3585,0x5771202a,0x106aa070,0x32bbd1b8,0x19a4c116,0xb8d2d0c8,0x1e376c08,0x5141ab53,0x2748774c,0xdf8eeb99,0x34b0bcb5,0xe19b48a8,0x391c0cb3,0xc5c95a63,0x4ed8aa4a,0xe3418acb,0x5b9cca4f,0x7763e373,0x682e6ff3,0xd6b2b8a3,0x748f82ee,0x5defb2fc,0x78a5636f,0x43172f60,0x84c87814,0xa1f0ab72,0x8cc70208,0x1a6439ec,0x90befffa,0x23631e28,0xa4506ceb,0xde82bde9,0xbef9a3f7,0xb2c67915,0xc67178f2,0xe372532b,0xca273ece,0xea26619c,0xd186b8c7,0x21c0c207,0xeada7dd6,0xcde0eb1e,0xf57d4f7f,0xee6ed178,0x6f067aa,0x72176fba,0xa637dc5,0xa2c898a6,0x113f9804,0xbef90dae,0x1b710b35,0x131c471b,0x28db77f5,0x23047d84,0x32caab7b,0x40c72493,0x3c9ebe0a,0x15c9bebc,0x431d67c4,0x9c100d4c,0x4cc5d4be,0xcb3e42b6,0x597f299c,0xfc657e2a,0x5fcb6fab,0x3ad6faec,0x6c44198c,0x4a475817]);function s(e,t,i,n,a,s,c){for(var l,u,d,h,p,f,g,w,m=i[0],b=i[1],v=i[2],y=i[3],x=i[4],C=i[5],A=i[6],E=i[7],_=n[0],k=n[1],I=n[2],S=n[3],T=n[4],N=n[5],P=n[6],R=n[7];c>=128;){for(var O=0;O<16;O++){var M=8*O+s;e[O]=r.readUint32BE(a,M),t[O]=r.readUint32BE(a,M+4)}for(var O=0;O<80;O++){var D=m,U=b,$=v,L=y,j=x,B=C,W=A,q=E,H=_,z=k,F=I,Z=S,V=T,K=N,G=P,J=R;if(l=E,p=65535&(u=R),f=u>>>16,g=65535&l,w=l>>>16,l=(x>>>14|T<<18)^(x>>>18|T<<14)^(T>>>9|x<<23),p+=65535&(u=(T>>>14|x<<18)^(T>>>18|x<<14)^(x>>>9|T<<23)),f+=u>>>16,g+=65535&l,w+=l>>>16,l=x&C^~x&A,p+=65535&(u=T&N^~T&P),f+=u>>>16,g+=65535&l,w+=l>>>16,l=o[2*O],p+=65535&(u=o[2*O+1]),f+=u>>>16,g+=65535&l,w+=l>>>16,l=e[O%16],p+=65535&(u=t[O%16]),f+=u>>>16,g+=65535&l,w+=l>>>16,f+=p>>>16,g+=f>>>16,w+=g>>>16,d=65535&g|w<<16,h=65535&p|f<<16,l=d,p=65535&(u=h),f=u>>>16,g=65535&l,w=l>>>16,l=(m>>>28|_<<4)^(_>>>2|m<<30)^(_>>>7|m<<25),p+=65535&(u=(_>>>28|m<<4)^(m>>>2|_<<30)^(m>>>7|_<<25)),f+=u>>>16,g+=65535&l,w+=l>>>16,l=m&b^m&v^b&v,p+=65535&(u=_&k^_&I^k&I),f+=u>>>16,g+=65535&l,w+=l>>>16,f+=p>>>16,g+=f>>>16,w+=g>>>16,q=65535&g|w<<16,J=65535&p|f<<16,l=L,p=65535&(u=Z),f=u>>>16,g=65535&l,w=l>>>16,l=d,p+=65535&(u=h),f+=u>>>16,g+=65535&l,w+=l>>>16,f+=p>>>16,g+=f>>>16,w+=g>>>16,L=65535&g|w<<16,Z=65535&p|f<<16,b=D,v=U,y=$,x=L,C=j,A=B,E=W,m=q,k=H,I=z,S=F,T=Z,N=V,P=K,R=G,_=J,O%16==15)for(var M=0;M<16;M++)l=e[M],p=65535&(u=t[M]),f=u>>>16,g=65535&l,w=l>>>16,l=e[(M+9)%16],p+=65535&(u=t[(M+9)%16]),f+=u>>>16,g+=65535&l,w+=l>>>16,l=((d=e[(M+1)%16])>>>1|(h=t[(M+1)%16])<<31)^(d>>>8|h<<24)^d>>>7,p+=65535&(u=(h>>>1|d<<31)^(h>>>8|d<<24)^(h>>>7|d<<25)),f+=u>>>16,g+=65535&l,w+=l>>>16,l=((d=e[(M+14)%16])>>>19|(h=t[(M+14)%16])<<13)^(h>>>29|d<<3)^d>>>6,p+=65535&(u=(h>>>19|d<<13)^(d>>>29|h<<3)^(h>>>6|d<<26)),f+=u>>>16,g+=65535&l,w+=l>>>16,f+=p>>>16,g+=f>>>16,w+=g>>>16,e[M]=65535&g|w<<16,t[M]=65535&p|f<<16}l=m,p=65535&(u=_),f=u>>>16,g=65535&l,w=l>>>16,l=i[0],p+=65535&(u=n[0]),f+=u>>>16,g+=65535&l,w+=l>>>16,f+=p>>>16,g+=f>>>16,w+=g>>>16,i[0]=m=65535&g|w<<16,n[0]=_=65535&p|f<<16,l=b,p=65535&(u=k),f=u>>>16,g=65535&l,w=l>>>16,l=i[1],p+=65535&(u=n[1]),f+=u>>>16,g+=65535&l,w+=l>>>16,f+=p>>>16,g+=f>>>16,w+=g>>>16,i[1]=b=65535&g|w<<16,n[1]=k=65535&p|f<<16,l=v,p=65535&(u=I),f=u>>>16,g=65535&l,w=l>>>16,l=i[2],p+=65535&(u=n[2]),f+=u>>>16,g+=65535&l,w+=l>>>16,f+=p>>>16,g+=f>>>16,w+=g>>>16,i[2]=v=65535&g|w<<16,n[2]=I=65535&p|f<<16,l=y,p=65535&(u=S),f=u>>>16,g=65535&l,w=l>>>16,l=i[3],p+=65535&(u=n[3]),f+=u>>>16,g+=65535&l,w+=l>>>16,f+=p>>>16,g+=f>>>16,w+=g>>>16,i[3]=y=65535&g|w<<16,n[3]=S=65535&p|f<<16,l=x,p=65535&(u=T),f=u>>>16,g=65535&l,w=l>>>16,l=i[4],p+=65535&(u=n[4]),f+=u>>>16,g+=65535&l,w+=l>>>16,f+=p>>>16,g+=f>>>16,w+=g>>>16,i[4]=x=65535&g|w<<16,n[4]=T=65535&p|f<<16,l=C,p=65535&(u=N),f=u>>>16,g=65535&l,w=l>>>16,l=i[5],p+=65535&(u=n[5]),f+=u>>>16,g+=65535&l,w+=l>>>16,f+=p>>>16,g+=f>>>16,w+=g>>>16,i[5]=C=65535&g|w<<16,n[5]=N=65535&p|f<<16,l=A,p=65535&(u=P),f=u>>>16,g=65535&l,w=l>>>16,l=i[6],p+=65535&(u=n[6]),f+=u>>>16,g+=65535&l,w+=l>>>16,f+=p>>>16,g+=f>>>16,w+=g>>>16,i[6]=A=65535&g|w<<16,n[6]=P=65535&p|f<<16,l=E,p=65535&(u=R),f=u>>>16,g=65535&l,w=l>>>16,l=i[7],p+=65535&(u=n[7]),f+=u>>>16,g+=65535&l,w+=l>>>16,f+=p>>>16,g+=f>>>16,w+=g>>>16,i[7]=E=65535&g|w<<16,n[7]=R=65535&p|f<<16,s+=128,c-=128}return s}t.hash=function(e){var t=new a;t.update(e);var i=t.digest();return t.clean(),i}},612:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.wipe=function(e){for(var t=0;t{"use strict";t.Tc=t.TZ=t.wE=t.Xx=void 0;let r=i(78133),n=i(612);function a(e){let t=new Float64Array(16);if(e)for(let i=0;i=0;--e){let t=i[e>>>3]>>>(7&e)&1;l(n,o,t),l(p,f,t),u(g,n,p),d(n,n,p),u(p,o,f),d(o,o,f),h(f,g,g),h(w,n,n),h(n,p,n),h(p,o,g),u(g,n,p),d(n,n,p),h(o,n,n),d(p,f,w),h(n,p,s),u(n,n,f),h(p,p,n),h(n,f,w),h(f,o,r),h(o,g,g),l(n,o,t),l(p,f,t)}for(let e=0;e<16;e++)r[e+16]=n[e],r[e+32]=p[e],r[e+48]=o[e],r[e+64]=f[e];let m=r.subarray(32),b=r.subarray(16);!function(e,t){let i=a();for(let e=0;e<16;e++)i[e]=t[e];for(let e=253;e>=0;e--)h(i,i,i),2!==e&&4!==e&&h(i,i,t);for(let t=0;t<16;t++)e[t]=i[t]}(m,m),h(b,b,m);let v=new Uint8Array(32);return!function(e,t){let i=a(),r=a();for(let e=0;e<16;e++)r[e]=t[e];c(r),c(r),c(r);for(let e=0;e<2;e++){i[0]=r[0]-65517;for(let e=1;e<15;e++)i[e]=r[e]-65535-(i[e-1]>>16&1),i[e-1]&=65535;i[15]=r[15]-32767-(i[14]>>16&1);let e=i[15]>>16&1;i[14]&=65535,l(r,i,1-e)}for(let t=0;t<16;t++)e[2*t]=255&r[t],e[2*t+1]=r[t]>>8}(v,b),v}t.TZ=function(e){let i=(0,r.randomBytes)(32,e),a=function(e){if(e.length!==t.wE)throw Error(`x25519: seed must be ${t.wE} bytes`);let i=new Uint8Array(e);return{publicKey:p(i,o),secretKey:i}}(i);return(0,n.wipe)(i),a},t.Tc=function(e,i,r=!1){if(e.length!==t.Xx)throw Error("X25519: incorrect secret key length");if(i.length!==t.Xx)throw Error("X25519: incorrect public key length");let n=p(e,i);if(r){let e=0;for(let t=0;t{"use strict";function r(){return(null===i.g||void 0===i.g?void 0:i.g.crypto)||(null===i.g||void 0===i.g?void 0:i.g.msCrypto)||{}}function n(){let e=r();return e.subtle||e.webkitSubtle}Object.defineProperty(t,"__esModule",{value:!0}),t.isBrowserCryptoAvailable=t.getSubtleCrypto=t.getBrowerCrypto=void 0,t.getBrowerCrypto=r,t.getSubtleCrypto=n,t.isBrowserCryptoAvailable=function(){return!!r()&&!!n()}},13170:(e,t,i)=>{"use strict";var r=i(18596);function n(){return"undefined"==typeof document&&"undefined"!=typeof navigator&&"ReactNative"===navigator.product}function a(){return void 0!==r&&void 0!==r.versions&&void 0!==r.versions.node}Object.defineProperty(t,"__esModule",{value:!0}),t.isBrowser=t.isNode=t.isReactNative=void 0,t.isReactNative=n,t.isNode=a,t.isBrowser=function(){return!n()&&!a()}},32105:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});let r=i(50752);r.__exportStar(i(57414),t),r.__exportStar(i(13170),t)},52027:(e,t,i)=>{"use strict";i.d(t,{D5:()=>_,U5:()=>E,h6:()=>n.a,iP:()=>C,oI:()=>A});var r=i(87960),n=i.n(r),a=i(3619);let o={level:"info"},s="custom_context";class c{constructor(e){this.nodeValue=e,this.sizeInBytes=new TextEncoder().encode(this.nodeValue).length,this.next=null}get value(){return this.nodeValue}get size(){return this.sizeInBytes}}class l{constructor(e){this.head=null,this.tail=null,this.lengthInNodes=0,this.maxSizeInBytes=e,this.sizeInBytes=0}append(e){let t=new c(e);if(t.size>this.maxSizeInBytes)throw Error(`[LinkedList] Value too big to insert into list: ${e} with size ${t.size}`);for(;this.size+t.size>this.maxSizeInBytes;)this.shift();this.head?this.tail&&(this.tail.next=t):this.head=t,this.tail=t,this.lengthInNodes++,this.sizeInBytes+=t.size}shift(){if(!this.head)return;let e=this.head;this.head=this.head.next,this.head||(this.tail=null),this.lengthInNodes--,this.sizeInBytes-=e.size}toArray(){let e=[],t=this.head;for(;null!==t;)e.push(t.value),t=t.next;return e}get length(){return this.lengthInNodes}get size(){return this.sizeInBytes}toOrderedArray(){return Array.from(this)}[Symbol.iterator](){let e=this.head;return{next:()=>{if(!e)return{done:!0,value:null};let t=e.value;return e=e.next,{done:!1,value:t}}}}}class u{constructor(e,t=1024e3){this.level=e??"error",this.levelValue=r.levels.values[this.level],this.MAX_LOG_SIZE_IN_BYTES=t,this.logs=new l(this.MAX_LOG_SIZE_IN_BYTES)}forwardToConsole(e,t){t===r.levels.values.error?console.error(e):t===r.levels.values.warn?console.warn(e):t===r.levels.values.debug?console.debug(e):t===r.levels.values.trace?console.trace(e):console.log(e)}appendToLogs(e){this.logs.append((0,a.h)({timestamp:new Date().toISOString(),log:e}));let t="string"==typeof e?JSON.parse(e).level:e.level;t>=this.levelValue&&this.forwardToConsole(e,t)}getLogs(){return this.logs}clearLogs(){this.logs=new l(this.MAX_LOG_SIZE_IN_BYTES)}getLogArray(){return Array.from(this.logs)}logsToBlob(e){let t=this.getLogArray();return t.push((0,a.h)({extraMetadata:e})),new Blob(t,{type:"application/json"})}}class d{constructor(e,t=1024e3){this.baseChunkLogger=new u(e,t)}write(e){this.baseChunkLogger.appendToLogs(e)}getLogs(){return this.baseChunkLogger.getLogs()}clearLogs(){this.baseChunkLogger.clearLogs()}getLogArray(){return this.baseChunkLogger.getLogArray()}logsToBlob(e){return this.baseChunkLogger.logsToBlob(e)}downloadLogsBlobInBrowser(e){let t=URL.createObjectURL(this.logsToBlob(e)),i=document.createElement("a");i.href=t,i.download=`walletconnect-logs-${new Date().toISOString()}.txt`,document.body.appendChild(i),i.click(),document.body.removeChild(i),URL.revokeObjectURL(t)}}class h{constructor(e,t=1024e3){this.baseChunkLogger=new u(e,t)}write(e){this.baseChunkLogger.appendToLogs(e)}getLogs(){return this.baseChunkLogger.getLogs()}clearLogs(){this.baseChunkLogger.clearLogs()}getLogArray(){return this.baseChunkLogger.getLogArray()}logsToBlob(e){return this.baseChunkLogger.logsToBlob(e)}}var p=Object.defineProperty,f=Object.defineProperties,g=Object.getOwnPropertyDescriptors,w=Object.getOwnPropertySymbols,m=Object.prototype.hasOwnProperty,b=Object.prototype.propertyIsEnumerable,v=(e,t,i)=>t in e?p(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,y=(e,t)=>{for(var i in t||(t={}))m.call(t,i)&&v(e,i,t[i]);if(w)for(var i of w(t))b.call(t,i)&&v(e,i,t[i]);return e},x=(e,t)=>f(e,g(t));function C(e){return x(y({},e),{level:e?.level||o.level})}function A(e,t=s){return typeof e.bindings>"u"?function(e,t=s){return e[t]||""}(e,t):e.bindings().context||""}function E(e,t,i=s){let r=function(e,t,i=s){let r=A(e,i);return r.trim()?`${r}/${t}`:t}(e,t,i);return function(e,t,i=s){return e[i]=t,e}(e.child({context:r}),r,i)}function _(e){return"u">typeof e.loggerOverride&&"string"!=typeof e.loggerOverride?{logger:e.loggerOverride,chunkLoggerController:null}:"u">typeof window?function(e){var t,i;let r=new d(null==(t=e.opts)?void 0:t.level,e.maxSizeInBytes);return{logger:n()(x(y({},e.opts),{level:"trace",browser:x(y({},null==(i=e.opts)?void 0:i.browser),{write:e=>r.write(e)})})),chunkLoggerController:r}}(e):function(e){var t;let i=new h(null==(t=e.opts)?void 0:t.level,e.maxSizeInBytes);return{logger:n()(x(y({},e.opts),{level:"trace"}),i),chunkLoggerController:i}}(e)}},84673:(e,t,i)=>{"use strict";i.d(t,{CG:()=>r});let r={waku:{publish:"waku_publish",batchPublish:"waku_batchPublish",subscribe:"waku_subscribe",batchSubscribe:"waku_batchSubscribe",subscription:"waku_subscription",unsubscribe:"waku_unsubscribe",batchUnsubscribe:"waku_batchUnsubscribe",batchFetchMessages:"waku_batchFetchMessages"},irn:{publish:"irn_publish",batchPublish:"irn_batchPublish",subscribe:"irn_subscribe",batchSubscribe:"irn_batchSubscribe",subscription:"irn_subscription",unsubscribe:"irn_unsubscribe",batchUnsubscribe:"irn_batchUnsubscribe",batchFetchMessages:"irn_batchFetchMessages"},iridium:{publish:"iridium_publish",batchPublish:"iridium_batchPublish",subscribe:"iridium_subscribe",batchSubscribe:"iridium_batchSubscribe",subscription:"iridium_subscription",unsubscribe:"iridium_unsubscribe",batchUnsubscribe:"iridium_batchUnsubscribe",batchFetchMessages:"iridium_batchFetchMessages"}}},68678:(e,t,i)=>{"use strict";i.d(t,{decodeJWT:()=>A,encodeIss:()=>C,generateKeyPair:()=>E,signJWT:()=>_});var r=i(19854),n=i(78133),a=i(71606);let o="base64url",s="utf8",c="utf8",l="base58btc";function u(e){return null!=globalThis.Buffer?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e}function d(e=0){return null!=globalThis.Buffer&&null!=globalThis.Buffer.allocUnsafe?u(globalThis.Buffer.allocUnsafe(e)):new Uint8Array(e)}var h=i(27095);function p(e,t,i,r){return{name:e,prefix:t,encoder:{name:e,prefix:t,encode:i},decoder:{decode:r}}}let f=p("utf8","u",e=>"u"+new TextDecoder("utf8").decode(e),e=>new TextEncoder().encode(e.substring(1))),g=p("ascii","a",e=>{let t="a";for(let i=0;i{let t=d((e=e.substring(1)).length);for(let i=0;ie+t.length,0));let i=d(t),r=0;for(let t of e)i.set(t,r),r+=t.length;return u(i)}([b("K36",l),e]),l)].join(":")}function A(e){let t=e.split("."),i=y(t[0]);return{header:i,payload:y(t[1]),signature:b(t[2],o),data:b(t.slice(0,2).join("."),c)}}function E(e=(0,n.randomBytes)(32)){return r.K(e)}async function _(e,t,i,n,s=(0,a.fromMiliseconds)(Date.now())){var l,u;let d={alg:"EdDSA",typ:"JWT"},h={iss:C(n.publicKey),sub:e,aud:t,iat:s,exp:s+i},p=b([x((l={header:d,payload:h}).header),x(l.payload)].join("."),c);return[x((u={header:d,payload:h,signature:r._S(n.secretKey,p)}).header),x(u.payload),m(u.signature,o)].join(".")}i(70790)},70790:()=>{},3619:(e,t,i)=>{"use strict";i.d(t,{h:()=>o,j:()=>a});let r=e=>JSON.stringify(e,(e,t)=>"bigint"==typeof t?t.toString()+"n":t),n=e=>JSON.parse(e.replace(/([\[:])?(\d{17,}|(?:[9](?:[1-9]07199254740991|0[1-9]7199254740991|00[8-9]199254740991|007[2-9]99254740991|007199[3-9]54740991|0071992[6-9]4740991|00719925[5-9]740991|007199254[8-9]40991|0071992547[5-9]0991|00719925474[1-9]991|00719925474099[2-9])))([,\}\]])/g,'$1"$2n"$3'),(e,t)=>"string"==typeof t&&t.match(/^\d+n$/)?BigInt(t.substring(0,t.length-1)):t);function a(e){if("string"!=typeof e)throw Error(`Cannot safe json parse value of type ${typeof e}`);try{return n(e)}catch(t){return e}}function o(e){return"string"==typeof e?e:r(e)||""}},91464:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});let r=i(50752);r.__exportStar(i(78116),t),r.__exportStar(i(29089),t)},78116:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ONE_THOUSAND=t.ONE_HUNDRED=void 0,t.ONE_HUNDRED=100,t.ONE_THOUSAND=1e3},29089:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ONE_YEAR=t.FOUR_WEEKS=t.THREE_WEEKS=t.TWO_WEEKS=t.ONE_WEEK=t.THIRTY_DAYS=t.SEVEN_DAYS=t.FIVE_DAYS=t.THREE_DAYS=t.ONE_DAY=t.TWENTY_FOUR_HOURS=t.TWELVE_HOURS=t.SIX_HOURS=t.THREE_HOURS=t.ONE_HOUR=t.SIXTY_MINUTES=t.THIRTY_MINUTES=t.TEN_MINUTES=t.FIVE_MINUTES=t.ONE_MINUTE=t.SIXTY_SECONDS=t.THIRTY_SECONDS=t.TEN_SECONDS=t.FIVE_SECONDS=t.ONE_SECOND=void 0,t.ONE_SECOND=1,t.FIVE_SECONDS=5,t.TEN_SECONDS=10,t.THIRTY_SECONDS=30,t.SIXTY_SECONDS=60,t.ONE_MINUTE=t.SIXTY_SECONDS,t.FIVE_MINUTES=5*t.ONE_MINUTE,t.TEN_MINUTES=10*t.ONE_MINUTE,t.THIRTY_MINUTES=30*t.ONE_MINUTE,t.SIXTY_MINUTES=60*t.ONE_MINUTE,t.ONE_HOUR=t.SIXTY_MINUTES,t.THREE_HOURS=3*t.ONE_HOUR,t.SIX_HOURS=6*t.ONE_HOUR,t.TWELVE_HOURS=12*t.ONE_HOUR,t.TWENTY_FOUR_HOURS=24*t.ONE_HOUR,t.ONE_DAY=t.TWENTY_FOUR_HOURS,t.THREE_DAYS=3*t.ONE_DAY,t.FIVE_DAYS=5*t.ONE_DAY,t.SEVEN_DAYS=7*t.ONE_DAY,t.THIRTY_DAYS=30*t.ONE_DAY,t.ONE_WEEK=t.SEVEN_DAYS,t.TWO_WEEKS=2*t.ONE_WEEK,t.THREE_WEEKS=3*t.ONE_WEEK,t.FOUR_WEEKS=4*t.ONE_WEEK,t.ONE_YEAR=365*t.ONE_DAY},71606:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});let r=i(50752);r.__exportStar(i(99200),t),r.__exportStar(i(68349),t),r.__exportStar(i(73140),t),r.__exportStar(i(91464),t)},73140:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),i(50752).__exportStar(i(39183),t)},39183:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IWatch=void 0;class i{}t.IWatch=i},93771:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.fromMiliseconds=t.toMiliseconds=void 0;let r=i(91464);t.toMiliseconds=function(e){return e*r.ONE_THOUSAND},t.fromMiliseconds=function(e){return Math.floor(e/r.ONE_THOUSAND)}},46167:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.delay=void 0,t.delay=function(e){return new Promise(t=>{setTimeout(()=>{t(!0)},e)})}},99200:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});let r=i(50752);r.__exportStar(i(46167),t),r.__exportStar(i(93771),t)},68349:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Watch=void 0;class i{constructor(){this.timestamps=new Map}start(e){if(this.timestamps.has(e))throw Error(`Watch already started for label: ${e}`);this.timestamps.set(e,{started:Date.now()})}stop(e){let t=this.get(e);if(void 0!==t.elapsed)throw Error(`Watch already stopped for label: ${e}`);let i=Date.now()-t.started;this.timestamps.set(e,{started:t.started,elapsed:i})}get(e){let t=this.timestamps.get(e);if(void 0===t)throw Error(`No timestamp found for label: ${e}`);return t}elapsed(e){let t=this.get(e);return t.elapsed||Date.now()-t.started}}t.Watch=i,t.default=i},27258:(e,t,i)=>{"use strict";let r;i.d(t,{l:()=>no,A:()=>na});var n=i(31670),a=i.n(n),o=i(71606);class s{}class c extends s{constructor(e){super()}}let l=o.FIVE_SECONDS,u={pulse:"heartbeat_pulse"};class d extends c{constructor(e){super(e),this.events=new n.EventEmitter,this.interval=l,this.interval=e?.interval||l}static async init(e){let t=new d(e);return await t.init(),t}async init(){await this.initialize()}stop(){clearInterval(this.intervalRef)}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}off(e,t){this.events.off(e,t)}removeListener(e,t){this.events.removeListener(e,t)}async initialize(){this.intervalRef=setInterval(()=>this.pulse(),(0,o.toMiliseconds)(this.interval))}pulse(){this.events.emit(u.pulse)}}var h=i(99102),p=i(41562).Buffer;function f(e,...t){try{var i;return(i=e(...t))&&"function"==typeof i.then?i:Promise.resolve(i)}catch(e){return Promise.reject(e)}}function g(e){if(function(e){let t=typeof e;return null===e||"object"!==t&&"function"!==t}(e))return String(e);if(function(e){let t=Object.getPrototypeOf(e);return!t||t.isPrototypeOf(Object)}(e)||Array.isArray(e))return JSON.stringify(e);if("function"==typeof e.toJSON)return g(e.toJSON());throw Error("[unstorage] Cannot stringify value!")}function w(){if(void 0===p)throw TypeError("[unstorage] Buffer is not supported!")}let m="base64:";function b(e){return e?e.split("?")[0].replace(/[/\\]/g,":").replace(/:+/g,":").replace(/^:|:$/g,""):""}function v(e){return(e=b(e))?e+":":""}let y=()=>{let e=new Map;return{name:"memory",getInstance:()=>e,hasItem:t=>e.has(t),getItem:t=>e.get(t)??null,getItemRaw:t=>e.get(t)??null,setItem(t,i){e.set(t,i)},setItemRaw(t,i){e.set(t,i)},removeItem(t){e.delete(t)},getKeys:()=>[...e.keys()],clear(){e.clear()},dispose(){e.clear()}}};function x(e,t,i){return e.watch?e.watch((e,r)=>t(e,i+r)):()=>{}}async function C(e){"function"==typeof e.dispose&&await f(e.dispose)}function A(e){return new Promise((t,i)=>{e.oncomplete=e.onsuccess=()=>t(e.result),e.onabort=e.onerror=()=>i(e.error)})}function E(e,t){let i=indexedDB.open(e);i.onupgradeneeded=()=>i.result.createObjectStore(t);let r=A(i);return(e,i)=>r.then(r=>i(r.transaction(t,e).objectStore(t)))}function _(){return r||(r=E("keyval-store","keyval")),r}function k(e,t=_()){return t("readonly",t=>A(t.get(e)))}var I=i(3619),S=(e={})=>{let t;let i=e.base&&e.base.length>0?`${e.base}:`:"",r=e=>i+e;return e.dbName&&e.storeName&&(t=E(e.dbName,e.storeName)),{name:"idb-keyval",options:e,hasItem:async e=>!(typeof await k(r(e),t)>"u"),getItem:async e=>await k(r(e),t)??null,setItem:(e,i)=>(function(e,t,i=_()){return i("readwrite",i=>(i.put(t,e),A(i.transaction)))})(r(e),i,t),removeItem:e=>(function(e,t=_()){return t("readwrite",t=>(t.delete(e),A(t.transaction)))})(r(e),t),getKeys:()=>(function(e=_()){return e("readonly",e=>{var t;if(e.getAllKeys)return A(e.getAllKeys());let i=[];return(t=e=>i.push(e.key),e.openCursor().onsuccess=function(){this.result&&(t(this.result),this.result.continue())},A(e.transaction)).then(()=>i)})})(t),clear:()=>(function(e=_()){return e("readwrite",e=>(e.clear(),A(e.transaction)))})(t)}};class T{constructor(){this.indexedDb=function(e={}){let t={mounts:{"":e.driver||y()},mountpoints:[""],watching:!1,watchListeners:[],unwatch:{}},i=e=>{for(let i of t.mountpoints)if(e.startsWith(i))return{base:i,relativeKey:e.slice(i.length),driver:t.mounts[i]};return{base:"",relativeKey:e,driver:t.mounts[""]}},r=(e,i)=>t.mountpoints.filter(t=>t.startsWith(e)||i&&e.startsWith(t)).map(i=>({relativeBase:e.length>i.length?e.slice(i.length):void 0,mountpoint:i,driver:t.mounts[i]})),n=(e,i)=>{if(t.watching)for(let r of(i=b(i),t.watchListeners))r(e,i)},a=async()=>{if(!t.watching)for(let e in t.watching=!0,t.mounts)t.unwatch[e]=await x(t.mounts[e],n,e)},o=async()=>{if(t.watching){for(let e in t.unwatch)await t.unwatch[e]();t.unwatch={},t.watching=!1}},s=(e,t,r)=>{let n=new Map,a=e=>{let t=n.get(e.base);return t||(t={driver:e.driver,base:e.base,items:[]},n.set(e.base,t)),t};for(let r of e){let e="string"==typeof r,n=b(e?r:r.key),o=e?void 0:r.value,s=e||!r.options?t:{...t,...r.options},c=i(n);a(c).items.push({key:n,value:o,relativeKey:c.relativeKey,options:s})}return Promise.all([...n.values()].map(e=>r(e))).then(e=>e.flat())},c={hasItem(e,t={}){let{relativeKey:r,driver:n}=i(e=b(e));return f(n.hasItem,r,t)},getItem(e,t={}){let{relativeKey:r,driver:n}=i(e=b(e));return f(n.getItem,r,t).then(e=>(0,h.Ay)(e))},getItems:(e,t)=>s(e,t,e=>e.driver.getItems?f(e.driver.getItems,e.items.map(e=>({key:e.relativeKey,options:e.options})),t).then(t=>t.map(t=>({key:function(...e){return b(e.join(":"))}(e.base,t.key),value:(0,h.Ay)(t.value)}))):Promise.all(e.items.map(t=>f(e.driver.getItem,t.relativeKey,t.options).then(e=>({key:t.key,value:(0,h.Ay)(e)}))))),getItemRaw(e,t={}){let{relativeKey:r,driver:n}=i(e=b(e));return n.getItemRaw?f(n.getItemRaw,r,t):f(n.getItem,r,t).then(e=>"string"==typeof e&&e.startsWith(m)?(w(),p.from(e.slice(m.length),"base64")):e)},async setItem(e,t,r={}){if(void 0===t)return c.removeItem(e);let{relativeKey:a,driver:o}=i(e=b(e));o.setItem&&(await f(o.setItem,a,g(t),r),o.watch||n("update",e))},async setItems(e,t){await s(e,t,async e=>{if(e.driver.setItems)return f(e.driver.setItems,e.items.map(e=>({key:e.relativeKey,value:g(e.value),options:e.options})),t);e.driver.setItem&&await Promise.all(e.items.map(t=>f(e.driver.setItem,t.relativeKey,g(t.value),t.options)))})},async setItemRaw(e,t,r={}){if(void 0===t)return c.removeItem(e,r);let{relativeKey:a,driver:o}=i(e=b(e));if(o.setItemRaw)await f(o.setItemRaw,a,t,r);else{if(!o.setItem)return;await f(o.setItem,a,"string"==typeof t?t:(w(),m+p.from(t).toString("base64")),r)}o.watch||n("update",e)},async removeItem(e,t={}){"boolean"==typeof t&&(t={removeMeta:t});let{relativeKey:r,driver:a}=i(e=b(e));a.removeItem&&(await f(a.removeItem,r,t),(t.removeMeta||t.removeMata)&&await f(a.removeItem,r+"$",t),a.watch||n("remove",e))},async getMeta(e,t={}){"boolean"==typeof t&&(t={nativeOnly:t});let{relativeKey:r,driver:n}=i(e=b(e)),a=Object.create(null);if(n.getMeta&&Object.assign(a,await f(n.getMeta,r,t)),!t.nativeOnly){let e=await f(n.getItem,r+"$",t).then(e=>(0,h.Ay)(e));e&&"object"==typeof e&&("string"==typeof e.atime&&(e.atime=new Date(e.atime)),"string"==typeof e.mtime&&(e.mtime=new Date(e.mtime)),Object.assign(a,e))}return a},setMeta(e,t,i={}){return this.setItem(e+"$",t,i)},removeMeta(e,t={}){return this.removeItem(e+"$",t)},async getKeys(e,t={}){let i=r(e=v(e),!0),n=[],a=[];for(let e of i){for(let i of(await f(e.driver.getKeys,e.relativeBase,t))){let t=e.mountpoint+b(i);n.some(e=>t.startsWith(e))||a.push(t)}n=[e.mountpoint,...n.filter(t=>!t.startsWith(e.mountpoint))]}return e?a.filter(t=>t.startsWith(e)&&"$"!==t[t.length-1]):a.filter(e=>"$"!==e[e.length-1])},async clear(e,t={}){e=v(e),await Promise.all(r(e,!1).map(async e=>e.driver.clear?f(e.driver.clear,e.relativeBase,t):e.driver.removeItem?Promise.all((await e.driver.getKeys(e.relativeBase||"",t)).map(i=>e.driver.removeItem(i,t))):void 0))},async dispose(){await Promise.all(Object.values(t.mounts).map(e=>C(e)))},watch:async e=>(await a(),t.watchListeners.push(e),async()=>{t.watchListeners=t.watchListeners.filter(t=>t!==e),0===t.watchListeners.length&&await o()}),async unwatch(){t.watchListeners=[],await o()},mount(e,i){if((e=v(e))&&t.mounts[e])throw Error(`already mounted at ${e}`);return e&&(t.mountpoints.push(e),t.mountpoints.sort((e,t)=>t.length-e.length)),t.mounts[e]=i,t.watching&&Promise.resolve(x(i,n,e)).then(i=>{t.unwatch[e]=i}).catch(console.error),c},async unmount(e,i=!0){(e=v(e))&&t.mounts[e]&&(t.watching&&e in t.unwatch&&(t.unwatch[e](),delete t.unwatch[e]),i&&await C(t.mounts[e]),t.mountpoints=t.mountpoints.filter(t=>t!==e),delete t.mounts[e])},getMount(e=""){let t=i(e=b(e)+":");return{driver:t.driver,base:t.base}},getMounts:(e="",t={})=>r(e=b(e),t.parents).map(e=>({driver:e.driver,base:e.mountpoint})),keys:(e,t={})=>c.getKeys(e,t),get:(e,t={})=>c.getItem(e,t),set:(e,t,i={})=>c.setItem(e,t,i),has:(e,t={})=>c.hasItem(e,t),del:(e,t={})=>c.removeItem(e,t),remove:(e,t={})=>c.removeItem(e,t)};return c}({driver:S({dbName:"WALLET_CONNECT_V2_INDEXED_DB",storeName:"keyvaluestorage"})})}async getKeys(){return this.indexedDb.getKeys()}async getEntries(){return(await this.indexedDb.getItems(await this.indexedDb.getKeys())).map(e=>[e.key,e.value])}async getItem(e){let t=await this.indexedDb.getItem(e);if(null!==t)return t}async setItem(e,t){await this.indexedDb.setItem(e,(0,I.h)(t))}async removeItem(e){await this.indexedDb.removeItem(e)}}var N="u">typeof globalThis?globalThis:"u">typeof window?window:"u">typeof i.g?i.g:"u">typeof self?self:{},P={exports:{}};function R(e){var t;return[e[0],(0,I.j)(null!=(t=e[1])?t:"")]}!function(){function e(){}e.prototype.getItem=function(e){return this.hasOwnProperty(e)?String(this[e]):null},e.prototype.setItem=function(e,t){this[e]=String(t)},e.prototype.removeItem=function(e){delete this[e]},e.prototype.clear=function(){let e=this;Object.keys(e).forEach(function(t){e[t]=void 0,delete e[t]})},e.prototype.key=function(e){return e=e||0,Object.keys(this)[e]},e.prototype.__defineGetter__("length",function(){return Object.keys(this).length}),"u">typeof N&&N.localStorage?P.exports=N.localStorage:"u">typeof window&&window.localStorage?P.exports=window.localStorage:P.exports=new e}();class O{constructor(){this.localStorage=P.exports}async getKeys(){return Object.keys(this.localStorage)}async getEntries(){return Object.entries(this.localStorage).map(R)}async getItem(e){let t=this.localStorage.getItem(e);if(null!==t)return(0,I.j)(t)}async setItem(e,t){this.localStorage.setItem(e,(0,I.h)(t))}async removeItem(e){this.localStorage.removeItem(e)}}let M=async(e,t,i)=>{let r="wc_storage_version",n=await t.getItem(r);if(n&&n>=1){i(t);return}let a=await e.getKeys();if(!a.length){i(t);return}let o=[];for(;a.length;){let i=a.shift();if(!i)continue;let r=i.toLowerCase();if(r.includes("wc@")||r.includes("walletconnect")||r.includes("wc_")||r.includes("wallet_connect")){let r=await e.getItem(i);await t.setItem(i,r),o.push(i)}}await t.setItem(r,1),i(t),D(e,o)},D=async(e,t)=>{t.length&&t.forEach(async t=>{await e.removeItem(t)})};class U{constructor(){this.initialized=!1,this.setInitialized=e=>{this.storage=e,this.initialized=!0};let e=new O;this.storage=e;try{let t=new T;M(e,t,this.setInitialized)}catch{this.initialized=!0}}async getKeys(){return await this.initialize(),this.storage.getKeys()}async getEntries(){return await this.initialize(),this.storage.getEntries()}async getItem(e){return await this.initialize(),this.storage.getItem(e)}async setItem(e,t){return await this.initialize(),this.storage.setItem(e,t)}async removeItem(e){return await this.initialize(),this.storage.removeItem(e)}async initialize(){this.initialized||await new Promise(e=>{let t=setInterval(()=>{this.initialized&&(clearInterval(t),e())},20)})}}var $=i(52027);class L extends s{constructor(e){super(),this.opts=e,this.protocol="wc",this.version=2}}class j extends s{constructor(e,t){super(),this.core=e,this.logger=t,this.records=new Map}}class B{constructor(e,t){this.logger=e,this.core=t}}class W extends s{constructor(e,t){super(),this.relayer=e,this.logger=t}}class q extends s{constructor(e){super()}}class H{constructor(e,t,i,r){this.core=e,this.logger=t,this.name=i}}class z extends s{constructor(e,t){super(),this.relayer=e,this.logger=t}}class F extends s{constructor(e,t){super(),this.core=e,this.logger=t}}class Z{constructor(e,t,i){this.core=e,this.logger=t,this.store=i}}class V{constructor(e,t){this.projectId=e,this.logger=t}}class K{constructor(e,t,i){this.core=e,this.logger=t,this.telemetryEnabled=i}}class G{constructor(e){this.opts=e,this.protocol="wc",this.version=2}}class J{constructor(e){this.client=e}}var Y=i(68678),Q=i(96374),X=i(63565);let ee="INTERNAL_ERROR",et="SERVER_ERROR",ei=[-32700,-32600,-32601,-32602,-32603],er={PARSE_ERROR:{code:-32700,message:"Parse error"},INVALID_REQUEST:{code:-32600,message:"Invalid Request"},METHOD_NOT_FOUND:{code:-32601,message:"Method not found"},INVALID_PARAMS:{code:-32602,message:"Invalid params"},[ee]:{code:-32603,message:"Internal error"},[et]:{code:-32e3,message:"Server error"}};function en(e){return Object.keys(er).includes(e)?er[e]:er[et]}function ea(e,t,i){return e.message.includes("getaddrinfo ENOTFOUND")||e.message.includes("connect ECONNREFUSED")?Error(`Unavailable ${i} RPC url at ${t}`):e}var eo=i(32105);function es(e=3){return Date.now()*Math.pow(10,e)+Math.floor(Math.random()*Math.pow(10,e))}function ec(e=6){return BigInt(es(e))}function el(e,t,i){return{id:i||es(),jsonrpc:"2.0",method:e,params:t}}function eu(e,t){return{id:e,jsonrpc:"2.0",result:t}}function ed(e,t,i){var r,n,a;return{id:e,jsonrpc:"2.0",error:void 0===(r=t)?en(ee):("string"==typeof r&&(r=Object.assign(Object.assign({},en(et)),{message:r})),void 0!==i&&(r.data=i),n=r.code,ei.includes(n)&&(a=r.code,r=Object.values(er).find(e=>e.code===a)||er[et]),r)}}class eh{}class ep extends eh{constructor(){super()}}class ef extends ep{constructor(e){super()}}function eg(e,t){let i=function(e){let t=e.match(RegExp(/^\w+:/,"gi"));if(t&&t.length)return t[0]}(e);return void 0!==i&&new RegExp(t).test(i)}function ew(e){return eg(e,"^https?:")}function em(e){return eg(e,"^wss?:")}function eb(e){return"object"==typeof e&&"id"in e&&"jsonrpc"in e&&"2.0"===e.jsonrpc}function ev(e){return eb(e)&&"method"in e}function ey(e){return eb(e)&&(ex(e)||eC(e))}function ex(e){return"result"in e}function eC(e){return"error"in e}class eA extends ef{constructor(e){super(e),this.events=new n.EventEmitter,this.hasRegisteredEventListeners=!1,this.connection=this.setConnection(e),this.connection.connected&&this.registerEventListeners()}async connect(e=this.connection){await this.open(e)}async disconnect(){await this.close()}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}off(e,t){this.events.off(e,t)}removeListener(e,t){this.events.removeListener(e,t)}async request(e,t){return this.requestStrict(el(e.method,e.params||[],e.id||ec().toString()),t)}async requestStrict(e,t){return new Promise(async(i,r)=>{if(!this.connection.connected)try{await this.open()}catch(e){r(e)}this.events.on(`${e.id}`,e=>{eC(e)?r(e.error):i(e.result)});try{await this.connection.send(e,t)}catch(e){r(e)}})}setConnection(e=this.connection){return e}onPayload(e){this.events.emit("payload",e),ey(e)?this.events.emit(`${e.id}`,e):this.events.emit("message",{type:e.method,data:e.params})}onClose(e){e&&3e3===e.code&&this.events.emit("error",Error(`WebSocket connection closed abnormally with code: ${e.code} ${e.reason?`(${e.reason})`:""}`)),this.events.emit("disconnect")}async open(e=this.connection){this.connection===e&&this.connection.connected||(this.connection.connected&&this.close(),"string"==typeof e&&(await this.connection.open(e),e=this.connection),this.connection=this.setConnection(e),await this.connection.open(),this.registerEventListeners(),this.events.emit("connect"))}async close(){await this.connection.close()}registerEventListeners(){this.hasRegisteredEventListeners||(this.connection.on("payload",e=>this.onPayload(e)),this.connection.on("close",e=>this.onClose(e)),this.connection.on("error",e=>this.events.emit("error",e)),this.connection.on("register_error",e=>this.onClose()),this.hasRegisteredEventListeners=!0)}}let eE=()=>"u">typeof WebSocket||"u">typeof i.g&&"u">typeof i.g.WebSocket||"u">typeof window&&"u">typeof window.WebSocket||"u">typeof self&&"u">typeof self.WebSocket,e_=e=>e.split("?")[0],ek="u">typeof WebSocket?WebSocket:"u">typeof i.g&&"u">typeof i.g.WebSocket?i.g.WebSocket:"u">typeof window&&"u">typeof window.WebSocket?window.WebSocket:"u">typeof self&&"u">typeof self.WebSocket?self.WebSocket:i(13361);class eI{constructor(e){if(this.url=e,this.events=new n.EventEmitter,this.registering=!1,!em(e))throw Error(`Provided URL is not compatible with WebSocket connection: ${e}`);this.url=e}get connected(){return"u">typeof this.socket}get connecting(){return this.registering}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}off(e,t){this.events.off(e,t)}removeListener(e,t){this.events.removeListener(e,t)}async open(e=this.url){await this.register(e)}async close(){return new Promise((e,t)=>{if(typeof this.socket>"u"){t(Error("Connection already closed"));return}this.socket.onclose=t=>{this.onClose(t),e()},this.socket.close()})}async send(e){typeof this.socket>"u"&&(this.socket=await this.register());try{this.socket.send((0,I.h)(e))}catch(t){this.onError(e.id,t)}}register(e=this.url){if(!em(e))throw Error(`Provided URL is not compatible with WebSocket connection: ${e}`);if(this.registering){let e=this.events.getMaxListeners();return(this.events.listenerCount("register_error")>=e||this.events.listenerCount("open")>=e)&&this.events.setMaxListeners(e+1),new Promise((e,t)=>{this.events.once("register_error",e=>{this.resetMaxListeners(),t(e)}),this.events.once("open",()=>{if(this.resetMaxListeners(),typeof this.socket>"u")return t(Error("WebSocket connection is missing or invalid"));e(this.socket)})})}return this.url=e,this.registering=!0,new Promise((t,i)=>{let r=new URLSearchParams(e).get("origin"),n=(0,eo.isReactNative)()?{headers:{origin:r}}:{rejectUnauthorized:!RegExp("wss?://localhost(:d{2,5})?").test(e)},a=new ek(e,[],n);eE()?a.onerror=e=>{i(this.emitError(e.error))}:a.on("error",e=>{i(this.emitError(e))}),a.onopen=()=>{this.onOpen(a),t(a)}})}onOpen(e){e.onmessage=e=>this.onPayload(e),e.onclose=e=>this.onClose(e),this.socket=e,this.registering=!1,this.events.emit("open")}onClose(e){this.socket=void 0,this.registering=!1,this.events.emit("close",e)}onPayload(e){if(typeof e.data>"u")return;let t="string"==typeof e.data?(0,I.j)(e.data):e.data;this.events.emit("payload",t)}onError(e,t){let i=this.parseError(t),r=ed(e,i.message||i.toString());this.events.emit("payload",r)}parseError(e,t=this.url){return ea(e,e_(t),"WS")}resetMaxListeners(){this.events.getMaxListeners()>10&&this.events.setMaxListeners(10)}emitError(e){let t=this.parseError(Error(e?.message||`WebSocket connection failed for host: ${e_(this.url)}`));return this.events.emit("register_error",t),t}}var eS=i(1606),eT=i.n(eS);let eN="core",eP=`wc@2:${eN}:`,eR={logger:"error"},eO={database:":memory:"},eM="client_ed25519_seed",eD=o.ONE_DAY,eU=o.SIX_HOURS,e$="wss://relay.walletconnect.org",eL={message:"relayer_message",message_ack:"relayer_message_ack",connect:"relayer_connect",disconnect:"relayer_disconnect",error:"relayer_error",connection_stalled:"relayer_connection_stalled",publish:"relayer_publish"},ej={payload:"payload",connect:"connect",disconnect:"disconnect",error:"error"},eB="2.17.0",eW={link_mode:"link_mode",relay:"relay"},eq="WALLETCONNECT_LINK_MODE_APPS",eH={created:"subscription_created",deleted:"subscription_deleted",sync:"subscription_sync",resubscribed:"subscription_resubscribed"},ez=1e3*o.FIVE_SECONDS,eF={wc_pairingDelete:{req:{ttl:o.ONE_DAY,prompt:!1,tag:1e3},res:{ttl:o.ONE_DAY,prompt:!1,tag:1001}},wc_pairingPing:{req:{ttl:o.THIRTY_SECONDS,prompt:!1,tag:1002},res:{ttl:o.THIRTY_SECONDS,prompt:!1,tag:1003}},unregistered_method:{req:{ttl:o.ONE_DAY,prompt:!1,tag:0},res:{ttl:o.ONE_DAY,prompt:!1,tag:0}}},eZ={create:"pairing_create",expire:"pairing_expire",delete:"pairing_delete",ping:"pairing_ping"},eV={created:"history_created",updated:"history_updated",deleted:"history_deleted",sync:"history_sync"},eK={created:"expirer_created",deleted:"expirer_deleted",expired:"expirer_expired",sync:"expirer_sync"},eG="https://verify.walletconnect.org",eJ=`${eG}/v3`,eY=["https://verify.walletconnect.com",eG],eQ={pairing_started:"pairing_started",pairing_uri_validation_success:"pairing_uri_validation_success",pairing_uri_not_expired:"pairing_uri_not_expired",store_new_pairing:"store_new_pairing",subscribing_pairing_topic:"subscribing_pairing_topic",subscribe_pairing_topic_success:"subscribe_pairing_topic_success",existing_pairing:"existing_pairing",pairing_not_expired:"pairing_not_expired",emit_inactive_pairing:"emit_inactive_pairing",emit_session_proposal:"emit_session_proposal"},eX={no_internet_connection:"no_internet_connection",malformed_pairing_uri:"malformed_pairing_uri",active_pairing_already_exists:"active_pairing_already_exists",subscribe_pairing_topic_failure:"subscribe_pairing_topic_failure",pairing_expired:"pairing_expired",proposal_listener_not_found:"proposal_listener_not_found"},e0={session_approve_started:"session_approve_started",session_namespaces_validation_success:"session_namespaces_validation_success",subscribing_session_topic:"subscribing_session_topic",subscribe_session_topic_success:"subscribe_session_topic_success",publishing_session_approve:"publishing_session_approve",session_approve_publish_success:"session_approve_publish_success",store_session:"store_session",publishing_session_settle:"publishing_session_settle",session_settle_publish_success:"session_settle_publish_success"},e1={no_internet_connection:"no_internet_connection",proposal_expired:"proposal_expired",subscribe_session_topic_failure:"subscribe_session_topic_failure",session_approve_publish_failure:"session_approve_publish_failure",session_settle_publish_failure:"session_settle_publish_failure",session_approve_namespace_validation_failure:"session_approve_namespace_validation_failure",proposal_not_found:"proposal_not_found"},e2={authenticated_session_approve_started:"authenticated_session_approve_started",create_authenticated_session_topic:"create_authenticated_session_topic",cacaos_verified:"cacaos_verified",store_authenticated_session:"store_authenticated_session",subscribing_authenticated_session_topic:"subscribing_authenticated_session_topic",subscribe_authenticated_session_topic_success:"subscribe_authenticated_session_topic_success",publishing_authenticated_session_approve:"publishing_authenticated_session_approve"},e3={no_internet_connection:"no_internet_connection",invalid_cacao:"invalid_cacao",subscribe_authenticated_session_topic_failure:"subscribe_authenticated_session_topic_failure",authenticated_session_approve_publish_failure:"authenticated_session_approve_publish_failure",authenticated_session_pending_request_not_found:"authenticated_session_pending_request_not_found"};var e5=function(e,t){if(e.length>=255)throw TypeError("Alphabet too long");for(var i=new Uint8Array(256),r=0;r>>0,o=new Uint8Array(a);e[t];){var u=i[e.charCodeAt(t)];if(255===u)return;for(var d=0,h=a-1;(0!==u||d>>0,o[h]=u%256>>>0,u=u/256>>>0;if(0!==u)throw Error("Non-zero carry");n=d,t++}if(" "!==e[t]){for(var p=a-n;p!==a&&0===o[p];)p++;for(var f=new Uint8Array(r+(a-p)),g=r;p!==a;)f[g++]=o[p++];return f}}}return{encode:function(t){if(t instanceof Uint8Array||(ArrayBuffer.isView(t)?t=new Uint8Array(t.buffer,t.byteOffset,t.byteLength):Array.isArray(t)&&(t=Uint8Array.from(t))),!(t instanceof Uint8Array))throw TypeError("Expected Uint8Array");if(0===t.length)return"";for(var i=0,r=0,n=0,a=t.length;n!==a&&0===t[n];)n++,i++;for(var o=(a-n)*u+1>>>0,l=new Uint8Array(o);n!==a;){for(var d=t[n],h=0,p=o-1;(0!==d||h>>0,l[p]=d%s>>>0,d=d/s>>>0;if(0!==d)throw Error("Non-zero carry");r=h,n++}for(var f=o-r;f!==o&&0===l[f];)f++;for(var g=c.repeat(i);f{if(e instanceof Uint8Array&&"Uint8Array"===e.constructor.name)return e;if(e instanceof ArrayBuffer)return new Uint8Array(e);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw Error("Unknown type, must be binary type")},e6=e=>new TextEncoder().encode(e),e8=e=>new TextDecoder().decode(e);class e9{constructor(e,t,i){this.name=e,this.prefix=t,this.baseEncode=i}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}}class e7{constructor(e,t,i){if(this.name=e,this.prefix=t,void 0===t.codePointAt(0))throw Error("Invalid prefix character");this.prefixCodePoint=t.codePointAt(0),this.baseDecode=i}decode(e){if("string"==typeof e){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}throw Error("Can only multibase decode strings")}or(e){return tt(this,e)}}class te{constructor(e){this.decoders=e}or(e){return tt(this,e)}decode(e){let t=e[0],i=this.decoders[t];if(i)return i.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}let tt=(e,t)=>new te({...e.decoders||{[e.prefix]:e},...t.decoders||{[t.prefix]:t}});class ti{constructor(e,t,i,r){this.name=e,this.prefix=t,this.baseEncode=i,this.baseDecode=r,this.encoder=new e9(e,t,i),this.decoder=new e7(e,t,r)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}let tr=({name:e,prefix:t,encode:i,decode:r})=>new ti(e,t,i,r),tn=({prefix:e,name:t,alphabet:i})=>{let{encode:r,decode:n}=e5(i,t);return tr({prefix:e,name:t,encode:r,decode:e=>e4(n(e))})},ta=(e,t,i,r)=>{let n={};for(let e=0;e=8&&(s-=8,o[l++]=255&c>>s)}if(s>=i||255&c<<8-s)throw SyntaxError("Unexpected end of data");return o},to=(e,t,i)=>{let r="="===t[t.length-1],n=(1<i;)o-=i,a+=t[n&s>>o];if(o&&(a+=t[n&s<tr({prefix:t,name:e,encode:e=>to(e,r,i),decode:t=>ta(t,r,i,e)});var tc=Object.freeze({__proto__:null,identity:tr({prefix:"\0",name:"identity",encode:e=>e8(e),decode:e=>e6(e)})}),tl=Object.freeze({__proto__:null,base2:ts({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1})}),tu=Object.freeze({__proto__:null,base8:ts({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3})}),td=Object.freeze({__proto__:null,base10:tn({prefix:"9",name:"base10",alphabet:"0123456789"})}),th=Object.freeze({__proto__:null,base16:ts({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),base16upper:ts({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4})});let tp=ts({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),tf=ts({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),tg=ts({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),tw=ts({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),tm=ts({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),tb=ts({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5});var tv=Object.freeze({__proto__:null,base32:tp,base32upper:tf,base32pad:tg,base32padupper:tw,base32hex:tm,base32hexupper:tb,base32hexpad:ts({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),base32hexpadupper:ts({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),base32z:ts({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5})}),ty=Object.freeze({__proto__:null,base36:tn({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),base36upper:tn({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"})}),tx=Object.freeze({__proto__:null,base58btc:tn({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),base58flickr:tn({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"})});let tC=ts({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6});var tA=Object.freeze({__proto__:null,base64:tC,base64pad:ts({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),base64url:ts({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),base64urlpad:ts({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6})});let tE=Array.from("\uD83D\uDE80\uD83E\uDE90☄\uD83D\uDEF0\uD83C\uDF0C\uD83C\uDF11\uD83C\uDF12\uD83C\uDF13\uD83C\uDF14\uD83C\uDF15\uD83C\uDF16\uD83C\uDF17\uD83C\uDF18\uD83C\uDF0D\uD83C\uDF0F\uD83C\uDF0E\uD83D\uDC09☀\uD83D\uDCBB\uD83D\uDDA5\uD83D\uDCBE\uD83D\uDCBF\uD83D\uDE02❤\uD83D\uDE0D\uD83E\uDD23\uD83D\uDE0A\uD83D\uDE4F\uD83D\uDC95\uD83D\uDE2D\uD83D\uDE18\uD83D\uDC4D\uD83D\uDE05\uD83D\uDC4F\uD83D\uDE01\uD83D\uDD25\uD83E\uDD70\uD83D\uDC94\uD83D\uDC96\uD83D\uDC99\uD83D\uDE22\uD83E\uDD14\uD83D\uDE06\uD83D\uDE44\uD83D\uDCAA\uD83D\uDE09☺\uD83D\uDC4C\uD83E\uDD17\uD83D\uDC9C\uD83D\uDE14\uD83D\uDE0E\uD83D\uDE07\uD83C\uDF39\uD83E\uDD26\uD83C\uDF89\uD83D\uDC9E✌✨\uD83E\uDD37\uD83D\uDE31\uD83D\uDE0C\uD83C\uDF38\uD83D\uDE4C\uD83D\uDE0B\uD83D\uDC97\uD83D\uDC9A\uD83D\uDE0F\uD83D\uDC9B\uD83D\uDE42\uD83D\uDC93\uD83E\uDD29\uD83D\uDE04\uD83D\uDE00\uD83D\uDDA4\uD83D\uDE03\uD83D\uDCAF\uD83D\uDE48\uD83D\uDC47\uD83C\uDFB6\uD83D\uDE12\uD83E\uDD2D❣\uD83D\uDE1C\uD83D\uDC8B\uD83D\uDC40\uD83D\uDE2A\uD83D\uDE11\uD83D\uDCA5\uD83D\uDE4B\uD83D\uDE1E\uD83D\uDE29\uD83D\uDE21\uD83E\uDD2A\uD83D\uDC4A\uD83E\uDD73\uD83D\uDE25\uD83E\uDD24\uD83D\uDC49\uD83D\uDC83\uD83D\uDE33✋\uD83D\uDE1A\uD83D\uDE1D\uD83D\uDE34\uD83C\uDF1F\uD83D\uDE2C\uD83D\uDE43\uD83C\uDF40\uD83C\uDF37\uD83D\uDE3B\uD83D\uDE13⭐✅\uD83E\uDD7A\uD83C\uDF08\uD83D\uDE08\uD83E\uDD18\uD83D\uDCA6✔\uD83D\uDE23\uD83C\uDFC3\uD83D\uDC90☹\uD83C\uDF8A\uD83D\uDC98\uD83D\uDE20☝\uD83D\uDE15\uD83C\uDF3A\uD83C\uDF82\uD83C\uDF3B\uD83D\uDE10\uD83D\uDD95\uD83D\uDC9D\uD83D\uDE4A\uD83D\uDE39\uD83D\uDDE3\uD83D\uDCAB\uD83D\uDC80\uD83D\uDC51\uD83C\uDFB5\uD83E\uDD1E\uD83D\uDE1B\uD83D\uDD34\uD83D\uDE24\uD83C\uDF3C\uD83D\uDE2B⚽\uD83E\uDD19☕\uD83C\uDFC6\uD83E\uDD2B\uD83D\uDC48\uD83D\uDE2E\uD83D\uDE46\uD83C\uDF7B\uD83C\uDF43\uD83D\uDC36\uD83D\uDC81\uD83D\uDE32\uD83C\uDF3F\uD83E\uDDE1\uD83C\uDF81⚡\uD83C\uDF1E\uD83C\uDF88❌✊\uD83D\uDC4B\uD83D\uDE30\uD83E\uDD28\uD83D\uDE36\uD83E\uDD1D\uD83D\uDEB6\uD83D\uDCB0\uD83C\uDF53\uD83D\uDCA2\uD83E\uDD1F\uD83D\uDE41\uD83D\uDEA8\uD83D\uDCA8\uD83E\uDD2C✈\uD83C\uDF80\uD83C\uDF7A\uD83E\uDD13\uD83D\uDE19\uD83D\uDC9F\uD83C\uDF31\uD83D\uDE16\uD83D\uDC76\uD83E\uDD74▶➡❓\uD83D\uDC8E\uD83D\uDCB8⬇\uD83D\uDE28\uD83C\uDF1A\uD83E\uDD8B\uD83D\uDE37\uD83D\uDD7A⚠\uD83D\uDE45\uD83D\uDE1F\uD83D\uDE35\uD83D\uDC4E\uD83E\uDD32\uD83E\uDD20\uD83E\uDD27\uD83D\uDCCC\uD83D\uDD35\uD83D\uDC85\uD83E\uDDD0\uD83D\uDC3E\uD83C\uDF52\uD83D\uDE17\uD83E\uDD11\uD83C\uDF0A\uD83E\uDD2F\uD83D\uDC37☎\uD83D\uDCA7\uD83D\uDE2F\uD83D\uDC86\uD83D\uDC46\uD83C\uDFA4\uD83D\uDE47\uD83C\uDF51❄\uD83C\uDF34\uD83D\uDCA3\uD83D\uDC38\uD83D\uDC8C\uD83D\uDCCD\uD83E\uDD40\uD83E\uDD22\uD83D\uDC45\uD83D\uDCA1\uD83D\uDCA9\uD83D\uDC50\uD83D\uDCF8\uD83D\uDC7B\uD83E\uDD10\uD83E\uDD2E\uD83C\uDFBC\uD83E\uDD75\uD83D\uDEA9\uD83C\uDF4E\uD83C\uDF4A\uD83D\uDC7C\uD83D\uDC8D\uD83D\uDCE3\uD83E\uDD42"),t_=tE.reduce((e,t,i)=>(e[i]=t,e),[]),tk=tE.reduce((e,t,i)=>(e[t.codePointAt(0)]=i,e),[]);var tI=Object.freeze({__proto__:null,base256emoji:tr({prefix:"\uD83D\uDE80",name:"base256emoji",encode:function(e){return e.reduce((e,t)=>e+=t_[t],"")},decode:function(e){let t=[];for(let i of e){let e=tk[i.codePointAt(0)];if(void 0===e)throw Error(`Non-base256emoji character: ${i}`);t.push(e)}return new Uint8Array(t)}})});function tS(e,t){var i,r=0,t=t||0,n=0,a=t,o=e.length;do{if(a>=o)throw tS.bytes=0,RangeError("Could not decode varint");i=e[a++],r+=n<28?(127&i)<=128);return tS.bytes=a-t,r}var tT={encode:function e(t,i,r){i=i||[],r=r||0;for(var n=r;t>=0x80000000;)i[r++]=255&t|128,t/=128;for(;-128&t;)i[r++]=255&t|128,t>>>=7;return i[r]=0|t,e.bytes=r-n+1,i},encodingLength:function(e){return e<128?1:e<16384?2:e<2097152?3:e<0x10000000?4:e<0x800000000?5:e<0x40000000000?6:e<0x2000000000000?7:e<0x100000000000000?8:e<0x8000000000000000?9:10}};let tN=(e,t,i=0)=>(tT.encode(e,t,i),t),tP=e=>tT.encodingLength(e),tR=(e,t)=>{let i=t.byteLength,r=tP(e),n=r+tP(i),a=new Uint8Array(n+i);return tN(e,a,0),tN(i,a,r),a.set(t,n),new tO(e,i,t,a)};class tO{constructor(e,t,i,r){this.code=e,this.size=t,this.digest=i,this.bytes=r}}let tM=({name:e,code:t,encode:i})=>new tD(e,t,i);class tD{constructor(e,t,i){this.name=e,this.code=t,this.encode=i}digest(e){if(e instanceof Uint8Array){let t=this.encode(e);return t instanceof Uint8Array?tR(this.code,t):t.then(e=>tR(this.code,e))}throw Error("Unknown type, must be binary type")}}let tU=e=>async t=>new Uint8Array(await crypto.subtle.digest(e,t));var t$=Object.freeze({__proto__:null,sha256:tM({name:"sha2-256",code:18,encode:tU("SHA-256")}),sha512:tM({name:"sha2-512",code:19,encode:tU("SHA-512")})}),tL=Object.freeze({__proto__:null,identity:{code:0,name:"identity",encode:e4,digest:e=>tR(0,e4(e))}});new TextEncoder,new TextDecoder;let tj={...tc,...tl,...tu,...td,...th,...tv,...ty,...tx,...tA,...tI};function tB(e,t,i,r){return{name:e,prefix:t,encoder:{name:e,prefix:t,encode:i},decoder:{decode:r}}}({...t$,...tL});let tW=tB("utf8","u",e=>"u"+new TextDecoder("utf8").decode(e),e=>new TextEncoder().encode(e.substring(1))),tq=tB("ascii","a",e=>{let t="a";for(let i=0;i{let t=function(e=0){return null!=globalThis.Buffer&&null!=globalThis.Buffer.allocUnsafe?globalThis.Buffer.allocUnsafe(e):new Uint8Array(e)}((e=e.substring(1)).length);for(let i=0;i{if(!this.initialized){let e=await this.getKeyChain();"u">typeof e&&(this.keychain=e),this.initialized=!0}},this.has=e=>(this.isInitialized(),this.keychain.has(e)),this.set=async(e,t)=>{this.isInitialized(),this.keychain.set(e,t),await this.persist()},this.get=e=>{this.isInitialized();let t=this.keychain.get(e);if(typeof t>"u"){let{message:t}=(0,Q.GuA)("NO_MATCHING_KEY",`${this.name}: ${e}`);throw Error(t)}return t},this.del=async e=>{this.isInitialized(),this.keychain.delete(e),await this.persist()},this.core=e,this.logger=(0,$.U5)(t,this.name)}get context(){return(0,$.oI)(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}async setKeyChain(e){await this.core.storage.setItem(this.storageKey,(0,Q.h0Y)(e))}async getKeyChain(){let e=await this.core.storage.getItem(this.storageKey);return"u">typeof e?(0,Q.PUk)(e):void 0}async persist(){await this.setKeyChain(this.keychain)}isInitialized(){if(!this.initialized){let{message:e}=(0,Q.GuA)("NOT_INITIALIZED",this.name);throw Error(e)}}}class tF{constructor(e,t,i){this.core=e,this.logger=t,this.name="crypto",this.randomSessionIdentifier=(0,Q.two)(),this.initialized=!1,this.init=async()=>{this.initialized||(await this.keychain.init(),this.initialized=!0)},this.hasKeys=e=>(this.isInitialized(),this.keychain.has(e)),this.getClientId=async()=>{this.isInitialized();let e=await this.getClientSeed(),t=Y.generateKeyPair(e);return Y.encodeIss(t.publicKey)},this.generateKeyPair=()=>{this.isInitialized();let e=(0,Q.TZl)();return this.setPrivateKey(e.publicKey,e.privateKey)},this.signJWT=async e=>{this.isInitialized();let t=await this.getClientSeed(),i=Y.generateKeyPair(t),r=this.randomSessionIdentifier;return await Y.signJWT(r,e,eD,i)},this.generateSharedKey=(e,t,i)=>{this.isInitialized();let r=this.getPrivateKey(e),n=(0,Q.ovp)(r,t);return this.setSymKey(n,i)},this.setSymKey=async(e,t)=>{this.isInitialized();let i=t||(0,Q.EN$)(e);return await this.keychain.set(i,e),i},this.deleteKeyPair=async e=>{this.isInitialized(),await this.keychain.del(e)},this.deleteSymKey=async e=>{this.isInitialized(),await this.keychain.del(e)},this.encode=async(e,t,i)=>{this.isInitialized();let r=(0,Q.AwN)(i),n=(0,I.h)(t);if((0,Q.ps1)(r))return(0,Q.Tw2)(n,i?.encoding);if((0,Q.V7m)(r)){let t=r.senderPublicKey,i=r.receiverPublicKey;e=await this.generateSharedKey(t,i)}let a=this.getSymKey(e),{type:o,senderPublicKey:s}=r;return(0,Q.wa2)({type:o,symKey:a,message:n,senderPublicKey:s,encoding:i?.encoding})},this.decode=async(e,t,i)=>{this.isInitialized();let r=(0,Q.C5G)(t,i);if((0,Q.ps1)(r)){let e=(0,Q.F$L)(t,i?.encoding);return(0,I.j)(e)}if((0,Q.V7m)(r)){let t=r.receiverPublicKey,i=r.senderPublicKey;e=await this.generateSharedKey(t,i)}try{let r=this.getSymKey(e),n=(0,Q.YcA)({symKey:r,encoded:t,encoding:i?.encoding});return(0,I.j)(n)}catch(t){this.logger.error(`Failed to decode message from topic: '${e}', clientId: '${await this.getClientId()}'`),this.logger.error(t)}},this.getPayloadType=(e,t=Q.EWt)=>{let i=(0,Q.iui)({encoded:e,encoding:t});return(0,Q.x0t)(i.type)},this.getPayloadSenderPublicKey=(e,t=Q.EWt)=>{let i=(0,Q.iui)({encoded:e,encoding:t});return i.senderPublicKey?(0,X.dI)(i.senderPublicKey,Q.bEt):void 0},this.core=e,this.logger=(0,$.U5)(t,this.name),this.keychain=i||new tz(this.core,this.logger)}get context(){return(0,$.oI)(this.logger)}async setPrivateKey(e,t){return await this.keychain.set(e,t),e}getPrivateKey(e){return this.keychain.get(e)}async getClientSeed(){let e="";try{e=this.keychain.get(eM)}catch{e=(0,Q.two)(),await this.keychain.set(eM,e)}return function(e,t="utf8"){let i=tH[t];if(!i)throw Error(`Unsupported encoding "${t}"`);return("utf8"===t||"utf-8"===t)&&null!=globalThis.Buffer&&null!=globalThis.Buffer.from?globalThis.Buffer.from(e,"utf8"):i.decoder.decode(`${i.prefix}${e}`)}(e,"base16")}getSymKey(e){return this.keychain.get(e)}isInitialized(){if(!this.initialized){let{message:e}=(0,Q.GuA)("NOT_INITIALIZED",this.name);throw Error(e)}}}class tZ extends B{constructor(e,t){super(e,t),this.logger=e,this.core=t,this.messages=new Map,this.name="messages",this.version="0.3",this.initialized=!1,this.storagePrefix=eP,this.init=async()=>{if(!this.initialized){this.logger.trace("Initialized");try{let e=await this.getRelayerMessages();"u">typeof e&&(this.messages=e),this.logger.debug(`Successfully Restored records for ${this.name}`),this.logger.trace({type:"method",method:"restore",size:this.messages.size})}catch(e){this.logger.debug(`Failed to Restore records for ${this.name}`),this.logger.error(e)}finally{this.initialized=!0}}},this.set=async(e,t)=>{this.isInitialized();let i=(0,Q.ALl)(t),r=this.messages.get(e);return typeof r>"u"&&(r={}),"u">typeof r[i]||(r[i]=t,this.messages.set(e,r),await this.persist()),i},this.get=e=>{this.isInitialized();let t=this.messages.get(e);return typeof t>"u"&&(t={}),t},this.has=(e,t)=>(this.isInitialized(),"u">typeof this.get(e)[(0,Q.ALl)(t)]),this.del=async e=>{this.isInitialized(),this.messages.delete(e),await this.persist()},this.logger=(0,$.U5)(e,this.name),this.core=t}get context(){return(0,$.oI)(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}async setRelayerMessages(e){await this.core.storage.setItem(this.storageKey,(0,Q.h0Y)(e))}async getRelayerMessages(){let e=await this.core.storage.getItem(this.storageKey);return"u">typeof e?(0,Q.PUk)(e):void 0}async persist(){await this.setRelayerMessages(this.messages)}isInitialized(){if(!this.initialized){let{message:e}=(0,Q.GuA)("NOT_INITIALIZED",this.name);throw Error(e)}}}class tV extends W{constructor(e,t){super(e,t),this.relayer=e,this.logger=t,this.events=new n.EventEmitter,this.name="publisher",this.queue=new Map,this.publishTimeout=(0,o.toMiliseconds)(o.ONE_MINUTE),this.failedPublishTimeout=(0,o.toMiliseconds)(o.ONE_SECOND),this.needsTransportRestart=!1,this.publish=async(e,t,i)=>{var r;this.logger.debug("Publishing Payload"),this.logger.trace({type:"method",method:"publish",params:{topic:e,message:t,opts:i}});let n=i?.ttl||eU,a=(0,Q.n6V)(i),o=i?.prompt||!1,s=i?.tag||0,c=i?.id||ec().toString(),l={topic:e,message:t,opts:{ttl:n,relay:a,prompt:o,tag:s,id:c,attestation:i?.attestation}},u=`Failed to publish payload, please try again. id:${c} tag:${s}`,d=Date.now(),h,p=1;try{for(;void 0===h;){if(Date.now()-d>this.publishTimeout)throw Error(u);this.logger.trace({id:c,attempts:p},`publisher.publish - attempt ${p}`),h=await await (0,Q.K3g)(this.rpcPublish(e,t,n,a,o,s,c,i?.attestation).catch(e=>this.logger.warn(e)),this.publishTimeout,u),p++,h||await new Promise(e=>setTimeout(e,this.failedPublishTimeout))}this.relayer.events.emit(eL.publish,l),this.logger.debug("Successfully Published Payload"),this.logger.trace({type:"method",method:"publish",params:{id:c,topic:e,message:t,opts:i}})}catch(e){if(this.logger.debug("Failed to Publish Payload"),this.logger.error(e),null!=(r=i?.internal)&&r.throwOnFailedPublish)throw e;this.queue.set(c,l)}},this.on=(e,t)=>{this.events.on(e,t)},this.once=(e,t)=>{this.events.once(e,t)},this.off=(e,t)=>{this.events.off(e,t)},this.removeListener=(e,t)=>{this.events.removeListener(e,t)},this.relayer=e,this.logger=(0,$.U5)(t,this.name),this.registerEventListeners()}get context(){return(0,$.oI)(this.logger)}rpcPublish(e,t,i,r,n,a,o,s){var c,l,u,d;let h={method:(0,Q.aa1)(r.protocol).publish,params:{topic:e,message:t,ttl:i,prompt:n,tag:a,attestation:s},id:o};return(0,Q.b07)(null==(c=h.params)?void 0:c.prompt)&&(null==(l=h.params)||delete l.prompt),(0,Q.b07)(null==(u=h.params)?void 0:u.tag)&&(null==(d=h.params)||delete d.tag),this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"message",direction:"outgoing",request:h}),this.relayer.request(h)}removeRequestFromQueue(e){this.queue.delete(e)}checkQueue(){this.queue.forEach(async e=>{let{topic:t,message:i,opts:r}=e;await this.publish(t,i,r)})}registerEventListeners(){this.relayer.core.heartbeat.on(u.pulse,()=>{if(this.needsTransportRestart){this.needsTransportRestart=!1,this.relayer.events.emit(eL.connection_stalled);return}this.checkQueue()}),this.relayer.on(eL.message_ack,e=>{this.removeRequestFromQueue(e.id.toString())})}}class tK{constructor(){this.map=new Map,this.set=(e,t)=>{let i=this.get(e);this.exists(e,t)||this.map.set(e,[...i,t])},this.get=e=>this.map.get(e)||[],this.exists=(e,t)=>this.get(e).includes(t),this.delete=(e,t)=>{if(typeof t>"u"){this.map.delete(e);return}if(!this.map.has(e))return;let i=this.get(e);if(!this.exists(e,t))return;let r=i.filter(e=>e!==t);if(!r.length){this.map.delete(e);return}this.map.set(e,r)},this.clear=()=>{this.map.clear()}}get topics(){return Array.from(this.map.keys())}}var tG=Object.defineProperty,tJ=Object.defineProperties,tY=Object.getOwnPropertyDescriptors,tQ=Object.getOwnPropertySymbols,tX=Object.prototype.hasOwnProperty,t0=Object.prototype.propertyIsEnumerable,t1=(e,t,i)=>t in e?tG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,t2=(e,t)=>{for(var i in t||(t={}))tX.call(t,i)&&t1(e,i,t[i]);if(tQ)for(var i of tQ(t))t0.call(t,i)&&t1(e,i,t[i]);return e},t3=(e,t)=>tJ(e,tY(t));class t5 extends z{constructor(e,t){super(e,t),this.relayer=e,this.logger=t,this.subscriptions=new Map,this.topicMap=new tK,this.events=new n.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=eP,this.subscribeTimeout=(0,o.toMiliseconds)(o.ONE_MINUTE),this.restartInProgress=!1,this.batchSubscribeTopicsLimit=500,this.pendingBatchMessages=[],this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),this.registerEventListeners(),this.clientId=await this.relayer.core.crypto.getClientId(),await this.restore()),this.initialized=!0},this.subscribe=async(e,t)=>{this.isInitialized(),this.logger.debug("Subscribing Topic"),this.logger.trace({type:"method",method:"subscribe",params:{topic:e,opts:t}});try{let i=(0,Q.n6V)(t),r={topic:e,relay:i,transportType:t?.transportType};this.pending.set(e,r);let n=await this.rpcSubscribe(e,i,t?.transportType);return"string"==typeof n&&(this.onSubscribe(n,r),this.logger.debug("Successfully Subscribed Topic"),this.logger.trace({type:"method",method:"subscribe",params:{topic:e,opts:t}})),n}catch(e){throw this.logger.debug("Failed to Subscribe Topic"),this.logger.error(e),e}},this.unsubscribe=async(e,t)=>{await this.restartToComplete(),this.isInitialized(),"u">typeof t?.id?await this.unsubscribeById(e,t.id,t):await this.unsubscribeByTopic(e,t)},this.isSubscribed=async e=>{if(this.topics.includes(e))return!0;let t=`${this.pendingSubscriptionWatchLabel}_${e}`;return await new Promise((i,r)=>{let n=new o.Watch;n.start(t);let a=setInterval(()=>{!this.pending.has(e)&&this.topics.includes(e)&&(clearInterval(a),n.stop(t),i(!0)),n.elapsed(t)>=ez&&(clearInterval(a),n.stop(t),r(Error("Subscription resolution timeout")))},this.pollingInterval)}).catch(()=>!1)},this.on=(e,t)=>{this.events.on(e,t)},this.once=(e,t)=>{this.events.once(e,t)},this.off=(e,t)=>{this.events.off(e,t)},this.removeListener=(e,t)=>{this.events.removeListener(e,t)},this.start=async()=>{await this.onConnect()},this.stop=async()=>{await this.onDisconnect()},this.restart=async()=>{this.restartInProgress=!0,await this.restore(),await this.reset(),this.restartInProgress=!1},this.relayer=e,this.logger=(0,$.U5)(t,this.name),this.clientId=""}get context(){return(0,$.oI)(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.relayer.core.customStoragePrefix+"//"+this.name}get length(){return this.subscriptions.size}get ids(){return Array.from(this.subscriptions.keys())}get values(){return Array.from(this.subscriptions.values())}get topics(){return this.topicMap.topics}hasSubscription(e,t){let i=!1;try{i=this.getSubscription(e).topic===t}catch{}return i}onEnable(){this.cached=[],this.initialized=!0}onDisable(){this.cached=this.values,this.subscriptions.clear(),this.topicMap.clear()}async unsubscribeByTopic(e,t){let i=this.topicMap.get(e);await Promise.all(i.map(async i=>await this.unsubscribeById(e,i,t)))}async unsubscribeById(e,t,i){this.logger.debug("Unsubscribing Topic"),this.logger.trace({type:"method",method:"unsubscribe",params:{topic:e,id:t,opts:i}});try{let r=(0,Q.n6V)(i);await this.rpcUnsubscribe(e,t,r);let n=(0,Q.Hjj)("USER_DISCONNECTED",`${this.name}, ${e}`);await this.onUnsubscribe(e,t,n),this.logger.debug("Successfully Unsubscribed Topic"),this.logger.trace({type:"method",method:"unsubscribe",params:{topic:e,id:t,opts:i}})}catch(e){throw this.logger.debug("Failed to Unsubscribe Topic"),this.logger.error(e),e}}async rpcSubscribe(e,t,i=eW.relay){i===eW.relay&&await this.restartToComplete();let r={method:(0,Q.aa1)(t.protocol).subscribe,params:{topic:e}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:r});try{let t=(0,Q.ALl)(e+this.clientId);return i===eW.link_mode?(setTimeout(()=>{(this.relayer.connected||this.relayer.connecting)&&this.relayer.request(r).catch(e=>this.logger.warn(e))},(0,o.toMiliseconds)(o.ONE_SECOND)),t):await await (0,Q.K3g)(this.relayer.request(r).catch(e=>this.logger.warn(e)),this.subscribeTimeout)?t:null}catch{this.logger.debug("Outgoing Relay Subscribe Payload stalled"),this.relayer.events.emit(eL.connection_stalled)}return null}async rpcBatchSubscribe(e){if(!e.length)return;let t=e[0].relay,i={method:(0,Q.aa1)(t.protocol).batchSubscribe,params:{topics:e.map(e=>e.topic)}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:i});try{return await await (0,Q.K3g)(this.relayer.request(i).catch(e=>this.logger.warn(e)),this.subscribeTimeout)}catch{this.relayer.events.emit(eL.connection_stalled)}}async rpcBatchFetchMessages(e){let t;if(!e.length)return;let i=e[0].relay,r={method:(0,Q.aa1)(i.protocol).batchFetchMessages,params:{topics:e.map(e=>e.topic)}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:r});try{t=await await (0,Q.K3g)(this.relayer.request(r).catch(e=>this.logger.warn(e)),this.subscribeTimeout)}catch{this.relayer.events.emit(eL.connection_stalled)}return t}rpcUnsubscribe(e,t,i){let r={method:(0,Q.aa1)(i.protocol).unsubscribe,params:{topic:e,id:t}};return this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:r}),this.relayer.request(r)}onSubscribe(e,t){this.setSubscription(e,t3(t2({},t),{id:e})),this.pending.delete(t.topic)}onBatchSubscribe(e){e.length&&e.forEach(e=>{this.setSubscription(e.id,t2({},e)),this.pending.delete(e.topic)})}async onUnsubscribe(e,t,i){this.events.removeAllListeners(t),this.hasSubscription(t,e)&&this.deleteSubscription(t,i),await this.relayer.messages.del(e)}async setRelayerSubscriptions(e){await this.relayer.core.storage.setItem(this.storageKey,e)}async getRelayerSubscriptions(){return await this.relayer.core.storage.getItem(this.storageKey)}setSubscription(e,t){this.logger.debug("Setting subscription"),this.logger.trace({type:"method",method:"setSubscription",id:e,subscription:t}),this.addSubscription(e,t)}addSubscription(e,t){this.subscriptions.set(e,t2({},t)),this.topicMap.set(t.topic,e),this.events.emit(eH.created,t)}getSubscription(e){this.logger.debug("Getting subscription"),this.logger.trace({type:"method",method:"getSubscription",id:e});let t=this.subscriptions.get(e);if(!t){let{message:t}=(0,Q.GuA)("NO_MATCHING_KEY",`${this.name}: ${e}`);throw Error(t)}return t}deleteSubscription(e,t){this.logger.debug("Deleting subscription"),this.logger.trace({type:"method",method:"deleteSubscription",id:e,reason:t});let i=this.getSubscription(e);this.subscriptions.delete(e),this.topicMap.delete(i.topic,e),this.events.emit(eH.deleted,t3(t2({},i),{reason:t}))}async persist(){await this.setRelayerSubscriptions(this.values),this.events.emit(eH.sync)}async reset(){if(this.cached.length){let e=Math.ceil(this.cached.length/this.batchSubscribeTopicsLimit);for(let t=0;t"u"||!e.length)return;if(this.subscriptions.size){let{message:e}=(0,Q.GuA)("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(e),this.logger.error(`${this.name}: ${JSON.stringify(this.values)}`),Error(e)}this.cached=e,this.logger.debug(`Successfully Restored subscriptions for ${this.name}`),this.logger.trace({type:"method",method:"restore",subscriptions:this.values})}catch(e){this.logger.debug(`Failed to Restore subscriptions for ${this.name}`),this.logger.error(e)}}async batchSubscribe(e){if(!e.length)return;let t=await this.rpcBatchSubscribe(e);(0,Q.OP1)(t)&&this.onBatchSubscribe(t.map((t,i)=>t3(t2({},e[i]),{id:t})))}async batchFetchMessages(e){if(!e.length)return;this.logger.trace(`Fetching batch messages for ${e.length} subscriptions`);let t=await this.rpcBatchFetchMessages(e);t&&t.messages&&(this.pendingBatchMessages=this.pendingBatchMessages.concat(t.messages))}async onConnect(){await this.restart(),this.onEnable()}onDisconnect(){this.onDisable()}async checkPending(){if(!this.initialized||!this.relayer.connected)return;let e=[];this.pending.forEach(t=>{e.push(t)}),await this.batchSubscribe(e),this.pendingBatchMessages.length&&(await this.relayer.handleBatchMessageEvents(this.pendingBatchMessages),this.pendingBatchMessages=[])}registerEventListeners(){this.relayer.core.heartbeat.on(u.pulse,async()=>{await this.checkPending()}),this.events.on(eH.created,async e=>{let t=eH.created;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,data:e}),await this.persist()}),this.events.on(eH.deleted,async e=>{let t=eH.deleted;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,data:e}),await this.persist()})}isInitialized(){if(!this.initialized){let{message:e}=(0,Q.GuA)("NOT_INITIALIZED",this.name);throw Error(e)}}async restartToComplete(){this.relayer.connected||this.relayer.connecting||await this.relayer.transportOpen(),this.restartInProgress&&await new Promise(e=>{let t=setInterval(()=>{this.restartInProgress||(clearInterval(t),e())},this.pollingInterval)})}}var t4=Object.defineProperty,t6=Object.getOwnPropertySymbols,t8=Object.prototype.hasOwnProperty,t9=Object.prototype.propertyIsEnumerable,t7=(e,t,i)=>t in e?t4(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,ie=(e,t)=>{for(var i in t||(t={}))t8.call(t,i)&&t7(e,i,t[i]);if(t6)for(var i of t6(t))t9.call(t,i)&&t7(e,i,t[i]);return e};class it extends q{constructor(e){super(e),this.protocol="wc",this.version=2,this.events=new n.EventEmitter,this.name="relayer",this.transportExplicitlyClosed=!1,this.initialized=!1,this.connectionAttemptInProgress=!1,this.connectionStatusPollingInterval=20,this.staleConnectionErrors=["socket hang up","stalled","interrupted"],this.hasExperiencedNetworkDisruption=!1,this.requestsInFlight=new Map,this.heartBeatTimeout=(0,o.toMiliseconds)(o.THIRTY_SECONDS+o.ONE_SECOND),this.request=async e=>{var t,i;this.logger.debug("Publishing Request Payload");let r=e.id||ec().toString();await this.toEstablishConnection();try{let n=this.provider.request(e);this.requestsInFlight.set(r,{promise:n,request:e}),this.logger.trace({id:r,method:e.method,topic:null==(t=e.params)?void 0:t.topic},"relayer.request - attempt to publish...");let a=await new Promise(async(e,t)=>{let i=()=>{t(Error(`relayer.request - publish interrupted, id: ${r}`))};this.provider.on(ej.disconnect,i);let a=await n;this.provider.off(ej.disconnect,i),e(a)});return this.logger.trace({id:r,method:e.method,topic:null==(i=e.params)?void 0:i.topic},"relayer.request - published"),a}catch(e){throw this.logger.debug(`Failed to Publish Request: ${r}`),e}finally{this.requestsInFlight.delete(r)}},this.resetPingTimeout=()=>{if((0,Q.Lln)())try{clearTimeout(this.pingTimeout),this.pingTimeout=setTimeout(()=>{var e,t,i;null==(i=null==(t=null==(e=this.provider)?void 0:e.connection)?void 0:t.socket)||i.terminate()},this.heartBeatTimeout)}catch(e){this.logger.warn(e)}},this.onPayloadHandler=e=>{this.onProviderPayload(e),this.resetPingTimeout()},this.onConnectHandler=()=>{this.logger.trace("relayer connected"),this.startPingTimeout(),this.events.emit(eL.connect)},this.onDisconnectHandler=()=>{this.logger.trace("relayer disconnected"),this.onProviderDisconnect()},this.onProviderErrorHandler=e=>{this.logger.error(e),this.events.emit(eL.error,e),this.logger.info("Fatal socket error received, closing transport"),this.transportClose()},this.registerProviderListeners=()=>{this.provider.on(ej.payload,this.onPayloadHandler),this.provider.on(ej.connect,this.onConnectHandler),this.provider.on(ej.disconnect,this.onDisconnectHandler),this.provider.on(ej.error,this.onProviderErrorHandler)},this.core=e.core,this.logger="u">typeof e.logger&&"string"!=typeof e.logger?(0,$.U5)(e.logger,this.name):(0,$.h6)((0,$.iP)({level:e.logger||"error"})),this.messages=new tZ(this.logger,e.core),this.subscriber=new t5(this,this.logger),this.publisher=new tV(this,this.logger),this.relayUrl=e?.relayUrl||e$,this.projectId=e.projectId,this.bundleId=(0,Q.w47)(),this.provider={}}async init(){if(this.logger.trace("Initialized"),this.registerEventListeners(),await Promise.all([this.messages.init(),this.subscriber.init()]),this.initialized=!0,this.subscriber.cached.length>0)try{await this.transportOpen()}catch(e){this.logger.warn(e)}}get context(){return(0,$.oI)(this.logger)}get connected(){var e,t,i;return(null==(i=null==(t=null==(e=this.provider)?void 0:e.connection)?void 0:t.socket)?void 0:i.readyState)===1}get connecting(){var e,t,i;return(null==(i=null==(t=null==(e=this.provider)?void 0:e.connection)?void 0:t.socket)?void 0:i.readyState)===0}async publish(e,t,i){this.isInitialized(),await this.publisher.publish(e,t,i),await this.recordMessageEvent({topic:e,message:t,publishedAt:Date.now(),transportType:eW.relay})}async subscribe(e,t){var i;this.isInitialized(),t?.transportType==="relay"&&await this.toEstablishConnection();let r=(null==(i=this.subscriber.topicMap.get(e))?void 0:i[0])||"",n,a=t=>{t.topic===e&&(this.subscriber.off(eH.created,a),n())};return await Promise.all([new Promise(e=>{n=e,this.subscriber.on(eH.created,a)}),new Promise(async i=>{r=await this.subscriber.subscribe(e,t)||r,i()})]),r}async unsubscribe(e,t){this.isInitialized(),await this.subscriber.unsubscribe(e,t)}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}off(e,t){this.events.off(e,t)}removeListener(e,t){this.events.removeListener(e,t)}async transportDisconnect(){if(!this.hasExperiencedNetworkDisruption&&this.connected&&this.requestsInFlight.size>0)try{await Promise.all(Array.from(this.requestsInFlight.values()).map(e=>e.promise))}catch(e){this.logger.warn(e)}this.hasExperiencedNetworkDisruption||this.connected?await (0,Q.K3g)(this.provider.disconnect(),2e3,"provider.disconnect()").catch(()=>this.onProviderDisconnect()):this.onProviderDisconnect()}async transportClose(){this.transportExplicitlyClosed=!0,await this.transportDisconnect()}async transportOpen(e){await this.confirmOnlineStateOrThrow(),e&&e!==this.relayUrl&&(this.relayUrl=e,await this.transportDisconnect()),await this.createProvider(),this.connectionAttemptInProgress=!0,this.transportExplicitlyClosed=!1;try{await new Promise(async(e,t)=>{let i=()=>{this.provider.off(ej.disconnect,i),t(Error("Connection interrupted while trying to subscribe"))};this.provider.on(ej.disconnect,i),await (0,Q.K3g)(this.provider.connect(),(0,o.toMiliseconds)(o.ONE_MINUTE),`Socket stalled when trying to connect to ${this.relayUrl}`).catch(e=>{t(e)}).finally(()=>{clearTimeout(this.reconnectTimeout),this.reconnectTimeout=void 0}),this.subscriber.start().catch(e=>{this.logger.error(e),this.onDisconnectHandler()}),this.hasExperiencedNetworkDisruption=!1,e()})}catch(e){if(this.logger.error(e),this.hasExperiencedNetworkDisruption=!0,!this.isConnectionStalled(e.message))throw e}finally{this.connectionAttemptInProgress=!1}}async restartTransport(e){this.connectionAttemptInProgress||(this.relayUrl=e||this.relayUrl,await this.confirmOnlineStateOrThrow(),await this.transportClose(),await this.transportOpen())}async confirmOnlineStateOrThrow(){if(!await (0,Q.sc7)())throw Error("No internet connection detected. Please restart your network and try again.")}async handleBatchMessageEvents(e){if(e?.length===0){this.logger.trace("Batch message events is empty. Ignoring...");return}let t=e.sort((e,t)=>e.publishedAt-t.publishedAt);for(let e of(this.logger.trace(`Batch of ${t.length} message events sorted`),t))try{await this.onMessageEvent(e)}catch(e){this.logger.warn(e)}this.logger.trace(`Batch of ${t.length} message events processed`)}async onLinkMessageEvent(e,t){let{topic:i}=e;if(!t.sessionExists){let e=(0,Q.Xw0)(o.FIVE_MINUTES);await this.core.pairing.pairings.set(i,{topic:i,expiry:e,relay:{protocol:"irn"},active:!1})}this.events.emit(eL.message,e),await this.recordMessageEvent(e)}startPingTimeout(){var e,t,i,r,n;if((0,Q.Lln)())try{null!=(t=null==(e=this.provider)?void 0:e.connection)&&t.socket&&(null==(n=null==(r=null==(i=this.provider)?void 0:i.connection)?void 0:r.socket)||n.once("ping",()=>{this.resetPingTimeout()})),this.resetPingTimeout()}catch(e){this.logger.warn(e)}}isConnectionStalled(e){return this.staleConnectionErrors.some(t=>e.includes(t))}async createProvider(){this.provider.connection&&this.unregisterProviderListeners();let e=await this.core.crypto.signJWT(this.relayUrl);this.provider=new eA(new eI((0,Q.jUZ)({sdkVersion:eB,protocol:this.protocol,version:this.version,relayUrl:this.relayUrl,projectId:this.projectId,auth:e,useOnCloseEvent:!0,bundleId:this.bundleId}))),this.registerProviderListeners()}async recordMessageEvent(e){let{topic:t,message:i}=e;await this.messages.set(t,i)}async shouldIgnoreMessageEvent(e){let{topic:t,message:i}=e;if(!i||0===i.length)return this.logger.debug(`Ignoring invalid/empty message: ${i}`),!0;if(!await this.subscriber.isSubscribed(t))return this.logger.debug(`Ignoring message for non-subscribed topic ${t}`),!0;let r=this.messages.has(t,i);return r&&this.logger.debug(`Ignoring duplicate message: ${i}`),r}async onProviderPayload(e){if(this.logger.debug("Incoming Relay Payload"),this.logger.trace({type:"payload",direction:"incoming",payload:e}),ev(e)){if(!e.method.endsWith("_subscription"))return;let t=e.params,{topic:i,message:r,publishedAt:n,attestation:a}=t.data,o={topic:i,message:r,publishedAt:n,transportType:eW.relay,attestation:a};this.logger.debug("Emitting Relayer Payload"),this.logger.trace(ie({type:"event",event:t.id},o)),this.events.emit(t.id,o),await this.acknowledgePayload(e),await this.onMessageEvent(o)}else ey(e)&&this.events.emit(eL.message_ack,e)}async onMessageEvent(e){await this.shouldIgnoreMessageEvent(e)||(this.events.emit(eL.message,e),await this.recordMessageEvent(e))}async acknowledgePayload(e){let t=eu(e.id,!0);await this.provider.connection.send(t)}unregisterProviderListeners(){this.provider.off(ej.payload,this.onPayloadHandler),this.provider.off(ej.connect,this.onConnectHandler),this.provider.off(ej.disconnect,this.onDisconnectHandler),this.provider.off(ej.error,this.onProviderErrorHandler),clearTimeout(this.pingTimeout)}async registerEventListeners(){let e=await (0,Q.sc7)();(0,Q.uym)(async t=>{e!==t&&(e=t,t?await this.restartTransport().catch(e=>this.logger.error(e)):(this.hasExperiencedNetworkDisruption=!0,await this.transportDisconnect(),this.transportExplicitlyClosed=!1))})}async onProviderDisconnect(){await this.subscriber.stop(),this.requestsInFlight.clear(),clearTimeout(this.pingTimeout),this.events.emit(eL.disconnect),this.connectionAttemptInProgress=!1,!this.transportExplicitlyClosed&&(this.reconnectTimeout||(this.reconnectTimeout=setTimeout(async()=>{await this.transportOpen().catch(e=>this.logger.error(e))},(0,o.toMiliseconds)(.1))))}isInitialized(){if(!this.initialized){let{message:e}=(0,Q.GuA)("NOT_INITIALIZED",this.name);throw Error(e)}}async toEstablishConnection(){await this.confirmOnlineStateOrThrow(),this.connected||(this.connectionAttemptInProgress&&await new Promise(e=>{let t=setInterval(()=>{this.connected&&(clearInterval(t),e())},this.connectionStatusPollingInterval)}),await this.transportOpen())}}var ii=Object.defineProperty,ir=Object.getOwnPropertySymbols,ia=Object.prototype.hasOwnProperty,io=Object.prototype.propertyIsEnumerable,is=(e,t,i)=>t in e?ii(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,ic=(e,t)=>{for(var i in t||(t={}))ia.call(t,i)&&is(e,i,t[i]);if(ir)for(var i of ir(t))io.call(t,i)&&is(e,i,t[i]);return e};class il extends H{constructor(e,t,i,r=eP,n){super(e,t,i,r),this.core=e,this.logger=t,this.name=i,this.map=new Map,this.version="0.3",this.cached=[],this.initialized=!1,this.storagePrefix=eP,this.recentlyDeleted=[],this.recentlyDeletedLimit=200,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(e=>{this.getKey&&null!==e&&!(0,Q.b07)(e)?this.map.set(this.getKey(e),e):(0,Q.CTo)(e)?this.map.set(e.id,e):(0,Q.mr0)(e)&&this.map.set(e.topic,e)}),this.cached=[],this.initialized=!0)},this.set=async(e,t)=>{this.isInitialized(),this.map.has(e)?await this.update(e,t):(this.logger.debug("Setting value"),this.logger.trace({type:"method",method:"set",key:e,value:t}),this.map.set(e,t),await this.persist())},this.get=e=>(this.isInitialized(),this.logger.debug("Getting value"),this.logger.trace({type:"method",method:"get",key:e}),this.getData(e)),this.getAll=e=>(this.isInitialized(),e?this.values.filter(t=>Object.keys(e).every(i=>eT()(t[i],e[i]))):this.values),this.update=async(e,t)=>{this.isInitialized(),this.logger.debug("Updating value"),this.logger.trace({type:"method",method:"update",key:e,update:t});let i=ic(ic({},this.getData(e)),t);this.map.set(e,i),await this.persist()},this.delete=async(e,t)=>{this.isInitialized(),this.map.has(e)&&(this.logger.debug("Deleting value"),this.logger.trace({type:"method",method:"delete",key:e,reason:t}),this.map.delete(e),this.addToRecentlyDeleted(e),await this.persist())},this.logger=(0,$.U5)(t,this.name),this.storagePrefix=r,this.getKey=n}get context(){return(0,$.oI)(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get length(){return this.map.size}get keys(){return Array.from(this.map.keys())}get values(){return Array.from(this.map.values())}addToRecentlyDeleted(e){this.recentlyDeleted.push(e),this.recentlyDeleted.length>=this.recentlyDeletedLimit&&this.recentlyDeleted.splice(0,this.recentlyDeletedLimit/2)}async setDataStore(e){await this.core.storage.setItem(this.storageKey,e)}async getDataStore(){return await this.core.storage.getItem(this.storageKey)}getData(e){let t=this.map.get(e);if(!t){if(this.recentlyDeleted.includes(e)){let{message:t}=(0,Q.GuA)("MISSING_OR_INVALID",`Record was recently deleted - ${this.name}: ${e}`);throw this.logger.error(t),Error(t)}let{message:t}=(0,Q.GuA)("NO_MATCHING_KEY",`${this.name}: ${e}`);throw this.logger.error(t),Error(t)}return t}async persist(){await this.setDataStore(this.values)}async restore(){try{let e=await this.getDataStore();if(typeof e>"u"||!e.length)return;if(this.map.size){let{message:e}=(0,Q.GuA)("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(e),Error(e)}this.cached=e,this.logger.debug(`Successfully Restored value for ${this.name}`),this.logger.trace({type:"method",method:"restore",value:this.values})}catch(e){this.logger.debug(`Failed to Restore value for ${this.name}`),this.logger.error(e)}}isInitialized(){if(!this.initialized){let{message:e}=(0,Q.GuA)("NOT_INITIALIZED",this.name);throw Error(e)}}}class iu{constructor(e,t){this.core=e,this.logger=t,this.name="pairing",this.version="0.3",this.events=new(a()),this.initialized=!1,this.storagePrefix=eP,this.ignoredPayloadTypes=[Q.Lp_],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:e})=>{this.isInitialized(),this.registeredMethods=[...new Set([...this.registeredMethods,...e])]},this.create=async e=>{this.isInitialized();let t=(0,Q.two)(),i=await this.core.crypto.setSymKey(t),r=(0,Q.Xw0)(o.FIVE_MINUTES),n={protocol:"irn"},a={topic:i,expiry:r,relay:n,active:!1,methods:e?.methods},s=(0,Q.QJh)({protocol:this.core.protocol,version:this.core.version,topic:i,symKey:t,relay:n,expiryTimestamp:r,methods:e?.methods});return this.events.emit(eZ.create,a),this.core.expirer.set(i,r),await this.pairings.set(i,a),await this.core.relayer.subscribe(i,{transportType:e?.transportType}),{topic:i,uri:s}},this.pair=async e=>{let t;this.isInitialized();let i=this.core.eventClient.createEvent({properties:{topic:e?.uri,trace:[eQ.pairing_started]}});this.isValidPair(e,i);let{topic:r,symKey:n,relay:a,expiryTimestamp:s,methods:c}=(0,Q.wYp)(e.uri);if(i.props.properties.topic=r,i.addTrace(eQ.pairing_uri_validation_success),i.addTrace(eQ.pairing_uri_not_expired),this.pairings.keys.includes(r)){if(t=this.pairings.get(r),i.addTrace(eQ.existing_pairing),t.active)throw i.setError(eX.active_pairing_already_exists),Error(`Pairing already exists: ${r}. Please try again with a new connection URI.`);i.addTrace(eQ.pairing_not_expired)}let l=s||(0,Q.Xw0)(o.FIVE_MINUTES),u={topic:r,relay:a,expiry:l,active:!1,methods:c};this.core.expirer.set(r,l),await this.pairings.set(r,u),i.addTrace(eQ.store_new_pairing),e.activatePairing&&await this.activate({topic:r}),this.events.emit(eZ.create,u),i.addTrace(eQ.emit_inactive_pairing),this.core.crypto.keychain.has(r)||await this.core.crypto.setSymKey(n,r),i.addTrace(eQ.subscribing_pairing_topic);try{await this.core.relayer.confirmOnlineStateOrThrow()}catch{i.setError(eX.no_internet_connection)}try{await this.core.relayer.subscribe(r,{relay:a})}catch(e){throw i.setError(eX.subscribe_pairing_topic_failure),e}return i.addTrace(eQ.subscribe_pairing_topic_success),u},this.activate=async({topic:e})=>{this.isInitialized();let t=(0,Q.Xw0)(o.THIRTY_DAYS);this.core.expirer.set(e,t),await this.pairings.update(e,{active:!0,expiry:t})},this.ping=async e=>{this.isInitialized(),await this.isValidPing(e);let{topic:t}=e;if(this.pairings.keys.includes(t)){let e=await this.sendRequest(t,"wc_pairingPing",{}),{done:i,resolve:r,reject:n}=(0,Q.Wx8)();this.events.once((0,Q.hEn)("pairing_ping",e),({error:e})=>{e?n(e):r()}),await i()}},this.updateExpiry=async({topic:e,expiry:t})=>{this.isInitialized(),await this.pairings.update(e,{expiry:t})},this.updateMetadata=async({topic:e,metadata:t})=>{this.isInitialized(),await this.pairings.update(e,{peerMetadata:t})},this.getPairings=()=>(this.isInitialized(),this.pairings.values),this.disconnect=async e=>{this.isInitialized(),await this.isValidDisconnect(e);let{topic:t}=e;this.pairings.keys.includes(t)&&(await this.sendRequest(t,"wc_pairingDelete",(0,Q.Hjj)("USER_DISCONNECTED")),await this.deletePairing(t))},this.formatUriFromPairing=e=>{this.isInitialized();let{topic:t,relay:i,expiry:r,methods:n}=e,a=this.core.crypto.keychain.get(t);return(0,Q.QJh)({protocol:this.core.protocol,version:this.core.version,topic:t,symKey:a,relay:i,expiryTimestamp:r,methods:n})},this.sendRequest=async(e,t,i)=>{let r=el(t,i),n=await this.core.crypto.encode(e,r),a=eF[t].req;return this.core.history.set(e,r),this.core.relayer.publish(e,n,a),r.id},this.sendResult=async(e,t,i)=>{let r=eu(e,i),n=await this.core.crypto.encode(t,r),a=eF[(await this.core.history.get(t,e)).request.method].res;await this.core.relayer.publish(t,n,a),await this.core.history.resolve(r)},this.sendError=async(e,t,i)=>{let r=ed(e,i),n=await this.core.crypto.encode(t,r),a=await this.core.history.get(t,e),o=eF[a.request.method]?eF[a.request.method].res:eF.unregistered_method.res;await this.core.relayer.publish(t,n,o),await this.core.history.resolve(r)},this.deletePairing=async(e,t)=>{await this.core.relayer.unsubscribe(e),await Promise.all([this.pairings.delete(e,(0,Q.Hjj)("USER_DISCONNECTED")),this.core.crypto.deleteSymKey(e),t?Promise.resolve():this.core.expirer.del(e)])},this.cleanup=async()=>{let e=this.pairings.getAll().filter(e=>(0,Q._dF)(e.expiry));await Promise.all(e.map(e=>this.deletePairing(e.topic)))},this.onRelayEventRequest=e=>{let{topic:t,payload:i}=e;switch(i.method){case"wc_pairingPing":return this.onPairingPingRequest(t,i);case"wc_pairingDelete":return this.onPairingDeleteRequest(t,i);default:return this.onUnknownRpcMethodRequest(t,i)}},this.onRelayEventResponse=async e=>{let{topic:t,payload:i}=e,r=(await this.core.history.get(t,i.id)).request.method;return"wc_pairingPing"===r?this.onPairingPingResponse(t,i):this.onUnknownRpcMethodResponse(r)},this.onPairingPingRequest=async(e,t)=>{let{id:i}=t;try{this.isValidPing({topic:e}),await this.sendResult(i,e,!0),this.events.emit(eZ.ping,{id:i,topic:e})}catch(t){await this.sendError(i,e,t),this.logger.error(t)}},this.onPairingPingResponse=(e,t)=>{let{id:i}=t;setTimeout(()=>{ex(t)?this.events.emit((0,Q.hEn)("pairing_ping",i),{}):eC(t)&&this.events.emit((0,Q.hEn)("pairing_ping",i),{error:t.error})},500)},this.onPairingDeleteRequest=async(e,t)=>{let{id:i}=t;try{this.isValidDisconnect({topic:e}),await this.deletePairing(e),this.events.emit(eZ.delete,{id:i,topic:e})}catch(t){await this.sendError(i,e,t),this.logger.error(t)}},this.onUnknownRpcMethodRequest=async(e,t)=>{let{id:i,method:r}=t;try{if(this.registeredMethods.includes(r))return;let t=(0,Q.Hjj)("WC_METHOD_UNSUPPORTED",r);await this.sendError(i,e,t),this.logger.error(t)}catch(t){await this.sendError(i,e,t),this.logger.error(t)}},this.onUnknownRpcMethodResponse=e=>{this.registeredMethods.includes(e)||this.logger.error((0,Q.Hjj)("WC_METHOD_UNSUPPORTED",e))},this.isValidPair=(e,t)=>{var i;if(!(0,Q.TeY)(e)){let{message:i}=(0,Q.GuA)("MISSING_OR_INVALID",`pair() params: ${e}`);throw t.setError(eX.malformed_pairing_uri),Error(i)}if(!(0,Q.AYU)(e.uri)){let{message:i}=(0,Q.GuA)("MISSING_OR_INVALID",`pair() uri: ${e.uri}`);throw t.setError(eX.malformed_pairing_uri),Error(i)}let r=(0,Q.wYp)(e?.uri);if(!(null!=(i=r?.relay)&&i.protocol)){let{message:e}=(0,Q.GuA)("MISSING_OR_INVALID","pair() uri#relay-protocol");throw t.setError(eX.malformed_pairing_uri),Error(e)}if(!(null!=r&&r.symKey)){let{message:e}=(0,Q.GuA)("MISSING_OR_INVALID","pair() uri#symKey");throw t.setError(eX.malformed_pairing_uri),Error(e)}if(null!=r&&r.expiryTimestamp&&(0,o.toMiliseconds)(r?.expiryTimestamp){if(!(0,Q.TeY)(e)){let{message:t}=(0,Q.GuA)("MISSING_OR_INVALID",`ping() params: ${e}`);throw Error(t)}let{topic:t}=e;await this.isValidPairingTopic(t)},this.isValidDisconnect=async e=>{if(!(0,Q.TeY)(e)){let{message:t}=(0,Q.GuA)("MISSING_OR_INVALID",`disconnect() params: ${e}`);throw Error(t)}let{topic:t}=e;await this.isValidPairingTopic(t)},this.isValidPairingTopic=async e=>{if(!(0,Q.Qhg)(e,!1)){let{message:t}=(0,Q.GuA)("MISSING_OR_INVALID",`pairing topic should be a string: ${e}`);throw Error(t)}if(!this.pairings.keys.includes(e)){let{message:t}=(0,Q.GuA)("NO_MATCHING_KEY",`pairing topic doesn't exist: ${e}`);throw Error(t)}if((0,Q._dF)(this.pairings.get(e).expiry)){await this.deletePairing(e);let{message:t}=(0,Q.GuA)("EXPIRED",`pairing topic: ${e}`);throw Error(t)}},this.core=e,this.logger=(0,$.U5)(t,this.name),this.pairings=new il(this.core,this.logger,this.name,this.storagePrefix)}get context(){return(0,$.oI)(this.logger)}isInitialized(){if(!this.initialized){let{message:e}=(0,Q.GuA)("NOT_INITIALIZED",this.name);throw Error(e)}}registerRelayerEvents(){this.core.relayer.on(eL.message,async e=>{let{topic:t,message:i,transportType:r}=e;if(!this.pairings.keys.includes(t)||r===eW.link_mode||this.ignoredPayloadTypes.includes(this.core.crypto.getPayloadType(i)))return;let n=await this.core.crypto.decode(t,i);try{ev(n)?(this.core.history.set(t,n),this.onRelayEventRequest({topic:t,payload:n})):ey(n)&&(await this.core.history.resolve(n),await this.onRelayEventResponse({topic:t,payload:n}),this.core.history.delete(t,n.id))}catch(e){this.logger.error(e)}})}registerExpirerEvents(){this.core.expirer.on(eK.expired,async e=>{let{topic:t}=(0,Q.c82)(e.target);t&&this.pairings.keys.includes(t)&&(await this.deletePairing(t,!0),this.events.emit(eZ.expire,{topic:t}))})}}class id extends j{constructor(e,t){super(e,t),this.core=e,this.logger=t,this.records=new Map,this.events=new n.EventEmitter,this.name="history",this.version="0.3",this.cached=[],this.initialized=!1,this.storagePrefix=eP,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(e=>this.records.set(e.id,e)),this.cached=[],this.registerEventListeners(),this.initialized=!0)},this.set=(e,t,i)=>{if(this.isInitialized(),this.logger.debug("Setting JSON-RPC request history record"),this.logger.trace({type:"method",method:"set",topic:e,request:t,chainId:i}),this.records.has(t.id))return;let r={id:t.id,topic:e,request:{method:t.method,params:t.params||null},chainId:i,expiry:(0,Q.Xw0)(o.THIRTY_DAYS)};this.records.set(r.id,r),this.persist(),this.events.emit(eV.created,r)},this.resolve=async e=>{if(this.isInitialized(),this.logger.debug("Updating JSON-RPC response history record"),this.logger.trace({type:"method",method:"update",response:e}),!this.records.has(e.id))return;let t=await this.getRecord(e.id);typeof t.response>"u"&&(t.response=eC(e)?{error:e.error}:{result:e.result},this.records.set(t.id,t),this.persist(),this.events.emit(eV.updated,t))},this.get=async(e,t)=>(this.isInitialized(),this.logger.debug("Getting record"),this.logger.trace({type:"method",method:"get",topic:e,id:t}),await this.getRecord(t)),this.delete=(e,t)=>{this.isInitialized(),this.logger.debug("Deleting record"),this.logger.trace({type:"method",method:"delete",id:t}),this.values.forEach(i=>{i.topic!==e||"u">typeof t&&i.id!==t||(this.records.delete(i.id),this.events.emit(eV.deleted,i))}),this.persist()},this.exists=async(e,t)=>(this.isInitialized(),!!this.records.has(t)&&(await this.getRecord(t)).topic===e),this.on=(e,t)=>{this.events.on(e,t)},this.once=(e,t)=>{this.events.once(e,t)},this.off=(e,t)=>{this.events.off(e,t)},this.removeListener=(e,t)=>{this.events.removeListener(e,t)},this.logger=(0,$.U5)(t,this.name)}get context(){return(0,$.oI)(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get size(){return this.records.size}get keys(){return Array.from(this.records.keys())}get values(){return Array.from(this.records.values())}get pending(){let e=[];return this.values.forEach(t=>{if("u">typeof t.response)return;let i={topic:t.topic,request:el(t.request.method,t.request.params,t.id),chainId:t.chainId};return e.push(i)}),e}async setJsonRpcRecords(e){await this.core.storage.setItem(this.storageKey,e)}async getJsonRpcRecords(){return await this.core.storage.getItem(this.storageKey)}getRecord(e){this.isInitialized();let t=this.records.get(e);if(!t){let{message:t}=(0,Q.GuA)("NO_MATCHING_KEY",`${this.name}: ${e}`);throw Error(t)}return t}async persist(){await this.setJsonRpcRecords(this.values),this.events.emit(eV.sync)}async restore(){try{let e=await this.getJsonRpcRecords();if(typeof e>"u"||!e.length)return;if(this.records.size){let{message:e}=(0,Q.GuA)("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(e),Error(e)}this.cached=e,this.logger.debug(`Successfully Restored records for ${this.name}`),this.logger.trace({type:"method",method:"restore",records:this.values})}catch(e){this.logger.debug(`Failed to Restore records for ${this.name}`),this.logger.error(e)}}registerEventListeners(){this.events.on(eV.created,e=>{let t=eV.created;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,record:e})}),this.events.on(eV.updated,e=>{let t=eV.updated;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,record:e})}),this.events.on(eV.deleted,e=>{let t=eV.deleted;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,record:e})}),this.core.heartbeat.on(u.pulse,()=>{this.cleanup()})}cleanup(){try{this.isInitialized();let e=!1;this.records.forEach(t=>{(0,o.toMiliseconds)(t.expiry||0)-Date.now()<=0&&(this.logger.info(`Deleting expired history log: ${t.id}`),this.records.delete(t.id),this.events.emit(eV.deleted,t,!1),e=!0)}),e&&this.persist()}catch(e){this.logger.warn(e)}}isInitialized(){if(!this.initialized){let{message:e}=(0,Q.GuA)("NOT_INITIALIZED",this.name);throw Error(e)}}}class ih extends F{constructor(e,t){super(e,t),this.core=e,this.logger=t,this.expirations=new Map,this.events=new n.EventEmitter,this.name="expirer",this.version="0.3",this.cached=[],this.initialized=!1,this.storagePrefix=eP,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(e=>this.expirations.set(e.target,e)),this.cached=[],this.registerEventListeners(),this.initialized=!0)},this.has=e=>{try{let t=this.formatTarget(e);return"u">typeof this.getExpiration(t)}catch{return!1}},this.set=(e,t)=>{this.isInitialized();let i=this.formatTarget(e),r={target:i,expiry:t};this.expirations.set(i,r),this.checkExpiry(i,r),this.events.emit(eK.created,{target:i,expiration:r})},this.get=e=>{this.isInitialized();let t=this.formatTarget(e);return this.getExpiration(t)},this.del=e=>{if(this.isInitialized(),this.has(e)){let t=this.formatTarget(e),i=this.getExpiration(t);this.expirations.delete(t),this.events.emit(eK.deleted,{target:t,expiration:i})}},this.on=(e,t)=>{this.events.on(e,t)},this.once=(e,t)=>{this.events.once(e,t)},this.off=(e,t)=>{this.events.off(e,t)},this.removeListener=(e,t)=>{this.events.removeListener(e,t)},this.logger=(0,$.U5)(t,this.name)}get context(){return(0,$.oI)(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get length(){return this.expirations.size}get keys(){return Array.from(this.expirations.keys())}get values(){return Array.from(this.expirations.values())}formatTarget(e){if("string"==typeof e)return(0,Q.ADD)(e);if("number"==typeof e)return(0,Q.gOF)(e);let{message:t}=(0,Q.GuA)("UNKNOWN_TYPE",`Target type: ${typeof e}`);throw Error(t)}async setExpirations(e){await this.core.storage.setItem(this.storageKey,e)}async getExpirations(){return await this.core.storage.getItem(this.storageKey)}async persist(){await this.setExpirations(this.values),this.events.emit(eK.sync)}async restore(){try{let e=await this.getExpirations();if(typeof e>"u"||!e.length)return;if(this.expirations.size){let{message:e}=(0,Q.GuA)("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(e),Error(e)}this.cached=e,this.logger.debug(`Successfully Restored expirations for ${this.name}`),this.logger.trace({type:"method",method:"restore",expirations:this.values})}catch(e){this.logger.debug(`Failed to Restore expirations for ${this.name}`),this.logger.error(e)}}getExpiration(e){let t=this.expirations.get(e);if(!t){let{message:t}=(0,Q.GuA)("NO_MATCHING_KEY",`${this.name}: ${e}`);throw this.logger.warn(t),Error(t)}return t}checkExpiry(e,t){let{expiry:i}=t;(0,o.toMiliseconds)(i)-Date.now()<=0&&this.expire(e,t)}expire(e,t){this.expirations.delete(e),this.events.emit(eK.expired,{target:e,expiration:t})}checkExpirations(){this.core.relayer.connected&&this.expirations.forEach((e,t)=>this.checkExpiry(t,e))}registerEventListeners(){this.core.heartbeat.on(u.pulse,()=>this.checkExpirations()),this.events.on(eK.created,e=>{let t=eK.created;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,data:e}),this.persist()}),this.events.on(eK.expired,e=>{let t=eK.expired;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,data:e}),this.persist()}),this.events.on(eK.deleted,e=>{let t=eK.deleted;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,data:e}),this.persist()})}isInitialized(){if(!this.initialized){let{message:e}=(0,Q.GuA)("NOT_INITIALIZED",this.name);throw Error(e)}}}var ip={};function ig(e){let t;return"u">typeof window&&"u">typeof window[e]&&(t=window[e]),t}function iw(e){let t=ig(e);if(!t)throw Error(`${e} is not defined in Window`);return t}Object.defineProperty(ip,"__esModule",{value:!0}),ip.getLocalStorage=ip.getLocalStorageOrThrow=ip.getCrypto=ip.getCryptoOrThrow=ip.getLocation=ip.getLocationOrThrow=ip.getNavigator=ip.getNavigatorOrThrow=im=ip.getDocument=ip.getDocumentOrThrow=ip.getFromWindowOrThrow=ip.getFromWindow=void 0,ip.getFromWindow=ig,ip.getFromWindowOrThrow=iw,ip.getDocumentOrThrow=function(){return iw("document")};var im=ip.getDocument=function(){return ig("document")};ip.getNavigatorOrThrow=function(){return iw("navigator")},ip.getNavigator=function(){return ig("navigator")},ip.getLocationOrThrow=function(){return iw("location")},ip.getLocation=function(){return ig("location")},ip.getCryptoOrThrow=function(){return iw("crypto")},ip.getCrypto=function(){return ig("crypto")},ip.getLocalStorageOrThrow=function(){return iw("localStorage")},ip.getLocalStorage=function(){return ig("localStorage")};class ib extends Z{constructor(e,t,i){super(e,t,i),this.core=e,this.logger=t,this.store=i,this.name="verify-api",this.verifyUrlV3=eJ,this.storagePrefix=eP,this.version=2,this.init=async()=>{var e;this.isDevEnv||(this.publicKey=await this.store.getItem(this.storeKey),this.publicKey&&(0,o.toMiliseconds)(null==(e=this.publicKey)?void 0:e.expiresAt){if(!(0,Q.BdH)()||this.isDevEnv)return;let t=window.location.origin,{id:i,decryptedId:r}=e,n=`${this.verifyUrlV3}/attestation?projectId=${this.core.projectId}&origin=${t}&id=${i}&decryptedId=${r}`;try{let e=im(),t=this.startAbortTimer(5*o.ONE_SECOND),r=await new Promise((r,a)=>{let o=()=>{window.removeEventListener("message",c),e.body.removeChild(s),a("attestation aborted")};this.abortController.signal.addEventListener("abort",o);let s=e.createElement("iframe");s.src=n,s.style.display="none",s.addEventListener("error",o,{signal:this.abortController.signal});let c=n=>{if(n.data&&"string"==typeof n.data)try{let a=JSON.parse(n.data);if("verify_attestation"===a.type){if((0,Y.decodeJWT)(a.attestation).payload.id!==i)return;clearInterval(t),e.body.removeChild(s),this.abortController.signal.removeEventListener("abort",o),window.removeEventListener("message",c),r(null===a.attestation?"":a.attestation)}}catch(e){this.logger.warn(e)}};e.body.appendChild(s),window.addEventListener("message",c,{signal:this.abortController.signal})});return this.logger.debug("jwt attestation",r),r}catch(e){this.logger.warn(e)}return""},this.resolve=async e=>{if(this.isDevEnv)return"";let{attestationId:t,hash:i,encryptedId:r}=e;if(""===t){this.logger.debug("resolve: attestationId is empty, skipping");return}if(t){if((0,Y.decodeJWT)(t).payload.id!==r)return;let e=await this.isValidJwtAttestation(t);if(e){if(!e.isVerified){this.logger.warn("resolve: jwt attestation: origin url not verified");return}return e}}if(!i)return;let n=this.getVerifyUrl(e?.verifyUrl);return this.fetchAttestation(i,n)},this.fetchAttestation=async(e,t)=>{this.logger.debug(`resolving attestation: ${e} from url: ${t}`);let i=this.startAbortTimer(5*o.ONE_SECOND),r=await fetch(`${t}/attestation/${e}?v2Supported=true`,{signal:this.abortController.signal});return clearTimeout(i),200===r.status?await r.json():void 0},this.getVerifyUrl=e=>{let t=e||eG;return eY.includes(t)||(this.logger.info(`verify url: ${t}, not included in trusted list, assigning default: ${eG}`),t=eG),t},this.fetchPublicKey=async()=>{try{this.logger.debug(`fetching public key from: ${this.verifyUrlV3}`);let e=this.startAbortTimer(o.FIVE_SECONDS),t=await fetch(`${this.verifyUrlV3}/public-key`,{signal:this.abortController.signal});return clearTimeout(e),await t.json()}catch(e){this.logger.warn(e)}},this.persistPublicKey=async e=>{this.logger.debug("persisting public key to local storage",e),await this.store.setItem(this.storeKey,e),this.publicKey=e},this.removePublicKey=async()=>{this.logger.debug("removing verify v2 public key from storage"),await this.store.removeItem(this.storeKey),this.publicKey=void 0},this.isValidJwtAttestation=async e=>{let t=await this.getPublicKey();try{if(t)return this.validateAttestation(e,t)}catch(e){this.logger.error(e),this.logger.warn("error validating attestation")}let i=await this.fetchAndPersistPublicKey();try{if(i)return this.validateAttestation(e,i)}catch(e){this.logger.error(e),this.logger.warn("error validating attestation")}},this.getPublicKey=async()=>this.publicKey?this.publicKey:await this.fetchAndPersistPublicKey(),this.fetchAndPersistPublicKey=async()=>{if(this.fetchPromise)return await this.fetchPromise,this.publicKey;this.fetchPromise=new Promise(async e=>{let t=await this.fetchPublicKey();t&&(await this.persistPublicKey(t),e(t))});let e=await this.fetchPromise;return this.fetchPromise=void 0,e},this.validateAttestation=(e,t)=>{let i=(0,Q.U0i)(e,t.publicKey),r={hasExpired:(0,o.toMiliseconds)(i.exp)this.abortController.abort(),(0,o.toMiliseconds)(e))}}class iv extends V{constructor(e,t){super(e,t),this.projectId=e,this.logger=t,this.context="echo",this.registerDeviceToken=async e=>{let{clientId:t,token:i,notificationType:r,enableEncrypted:n=!1}=e,a=`https://echo.walletconnect.com/${this.projectId}/clients`;await fetch(a,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({client_id:t,type:r,token:i,always_raw:n})})},this.logger=(0,$.U5)(t,this.context)}}var iy=Object.defineProperty,ix=Object.getOwnPropertySymbols,iC=Object.prototype.hasOwnProperty,iA=Object.prototype.propertyIsEnumerable,iE=(e,t,i)=>t in e?iy(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,i_=(e,t)=>{for(var i in t||(t={}))iC.call(t,i)&&iE(e,i,t[i]);if(ix)for(var i of ix(t))iA.call(t,i)&&iE(e,i,t[i]);return e};class ik extends K{constructor(e,t,i=!0){super(e,t,i),this.core=e,this.logger=t,this.context="event-client",this.storagePrefix=eP,this.storageVersion=.1,this.events=new Map,this.shouldPersist=!1,this.init=async()=>{if(!(0,Q.w8K)())try{let e={eventId:(0,Q.gZm)(),timestamp:Date.now(),domain:this.getAppDomain(),props:{event:"INIT",type:"",properties:{client_id:await this.core.crypto.getClientId(),user_agent:(0,Q.ojD)(this.core.relayer.protocol,this.core.relayer.version,eB)}}};await this.sendEvent([e])}catch(e){this.logger.warn(e)}},this.createEvent=e=>{let{event:t="ERROR",type:i="",properties:{topic:r,trace:n}}=e,a=(0,Q.gZm)(),o=this.core.projectId||"",s=i_({eventId:a,timestamp:Date.now(),props:{event:t,type:i,properties:{topic:r,trace:n}},bundleId:o,domain:this.getAppDomain()},this.setMethods(a));return this.telemetryEnabled&&(this.events.set(a,s),this.shouldPersist=!0),s},this.getEvent=e=>{let{eventId:t,topic:i}=e;if(t)return this.events.get(t);let r=Array.from(this.events.values()).find(e=>e.props.properties.topic===i);if(r)return i_(i_({},r),this.setMethods(r.eventId))},this.deleteEvent=e=>{let{eventId:t}=e;this.events.delete(t),this.shouldPersist=!0},this.setEventListeners=()=>{this.core.heartbeat.on(u.pulse,async()=>{this.shouldPersist&&await this.persist(),this.events.forEach(e=>{(0,o.fromMiliseconds)(Date.now())-(0,o.fromMiliseconds)(e.timestamp)>86400&&(this.events.delete(e.eventId),this.shouldPersist=!0)})})},this.setMethods=e=>({addTrace:t=>this.addTrace(e,t),setError:t=>this.setError(e,t)}),this.addTrace=(e,t)=>{let i=this.events.get(e);i&&(i.props.properties.trace.push(t),this.events.set(e,i),this.shouldPersist=!0)},this.setError=(e,t)=>{let i=this.events.get(e);i&&(i.props.type=t,i.timestamp=Date.now(),this.events.set(e,i),this.shouldPersist=!0)},this.persist=async()=>{await this.core.storage.setItem(this.storageKey,Array.from(this.events.values())),this.shouldPersist=!1},this.restore=async()=>{try{let e=await this.core.storage.getItem(this.storageKey)||[];if(!e.length)return;e.forEach(e=>{this.events.set(e.eventId,i_(i_({},e),this.setMethods(e.eventId)))})}catch(e){this.logger.warn(e)}},this.submit=async()=>{if(!this.telemetryEnabled||0===this.events.size)return;let e=[];for(let[t,i]of this.events)i.props.type&&e.push(i);if(0!==e.length)try{if((await this.sendEvent(e)).ok)for(let t of e)this.events.delete(t.eventId),this.shouldPersist=!0}catch(e){this.logger.warn(e)}},this.sendEvent=async e=>{let t=this.getAppDomain()?"":"&sp=desktop";return await fetch(`https://pulse.walletconnect.org/batch?projectId=${this.core.projectId}&st=events_sdk&sv=js-${eB}${t}`,{method:"POST",body:JSON.stringify(e)})},this.getAppDomain=()=>(0,Q.lFF)().url,this.logger=(0,$.U5)(t,this.context),this.telemetryEnabled=i,i?this.restore().then(async()=>{await this.submit(),this.setEventListeners()}):this.persist()}get storageKey(){return this.storagePrefix+this.storageVersion+this.core.customStoragePrefix+"//"+this.context}}var iI=Object.defineProperty,iS=Object.getOwnPropertySymbols,iT=Object.prototype.hasOwnProperty,iN=Object.prototype.propertyIsEnumerable,iP=(e,t,i)=>t in e?iI(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,iR=(e,t)=>{for(var i in t||(t={}))iT.call(t,i)&&iP(e,i,t[i]);if(iS)for(var i of iS(t))iN.call(t,i)&&iP(e,i,t[i]);return e};class iO extends L{constructor(e){var t;super(e),this.protocol="wc",this.version=2,this.name=eN,this.events=new n.EventEmitter,this.initialized=!1,this.on=(e,t)=>this.events.on(e,t),this.once=(e,t)=>this.events.once(e,t),this.off=(e,t)=>this.events.off(e,t),this.removeListener=(e,t)=>this.events.removeListener(e,t),this.dispatchEnvelope=({topic:e,message:t,sessionExists:i})=>{if(!e||!t)return;let r={topic:e,message:t,publishedAt:Date.now(),transportType:eW.link_mode};this.relayer.onLinkMessageEvent(r,{sessionExists:i})},this.projectId=e?.projectId,this.relayUrl=e?.relayUrl||e$,this.customStoragePrefix=null!=e&&e.customStoragePrefix?`:${e.customStoragePrefix}`:"";let i=(0,$.iP)({level:"string"==typeof e?.logger&&e.logger?e.logger:eR.logger}),{logger:r,chunkLoggerController:a}=(0,$.D5)({opts:i,maxSizeInBytes:e?.maxLogBlobSizeInBytes,loggerOverride:e?.logger});this.logChunkController=a,null!=(t=this.logChunkController)&&t.downloadLogsBlobInBrowser&&(window.downloadLogsBlobInBrowser=async()=>{var e,t;null!=(e=this.logChunkController)&&e.downloadLogsBlobInBrowser&&(null==(t=this.logChunkController)||t.downloadLogsBlobInBrowser({clientId:await this.crypto.getClientId()}))}),this.logger=(0,$.U5)(r,this.name),this.heartbeat=new d,this.crypto=new tF(this,this.logger,e?.keychain),this.history=new id(this,this.logger),this.expirer=new ih(this,this.logger),this.storage=null!=e&&e.storage?e.storage:new U(iR(iR({},eO),e?.storageOptions)),this.relayer=new it({core:this,logger:this.logger,relayUrl:this.relayUrl,projectId:this.projectId}),this.pairing=new iu(this,this.logger),this.verify=new ib(this,this.logger,this.storage),this.echoClient=new iv(this.projectId||"",this.logger),this.linkModeSupportedApps=[],this.eventClient=new ik(this,this.logger,e?.telemetryEnabled)}static async init(e){let t=new iO(e);await t.initialize();let i=await t.crypto.getClientId();return await t.storage.setItem("WALLETCONNECT_CLIENT_ID",i),t}get context(){return(0,$.oI)(this.logger)}async start(){this.initialized||await this.initialize()}async getLogsBlob(){var e;return null==(e=this.logChunkController)?void 0:e.logsToBlob({clientId:await this.crypto.getClientId()})}async addLinkModeSupportedApp(e){this.linkModeSupportedApps.includes(e)||(this.linkModeSupportedApps.push(e),await this.storage.setItem(eq,this.linkModeSupportedApps))}async initialize(){this.logger.trace("Initialized");try{await this.crypto.init(),await this.history.init(),await this.expirer.init(),await this.relayer.init(),await this.heartbeat.init(),await this.pairing.init(),this.eventClient.init(),this.linkModeSupportedApps=await this.storage.getItem(eq)||[],this.initialized=!0,this.logger.info("Core Initialization Success")}catch(e){throw this.logger.warn(`Core Initialization Failure at epoch ${Date.now()}`,e),this.logger.error(e.message),e}}}let iM="client",iD=`wc@2:${iM}:`,iU={name:iM,logger:"error"},i$="WALLETCONNECT_DEEPLINK_CHOICE",iL="Proposal expired",ij=o.SEVEN_DAYS,iB={wc_sessionPropose:{req:{ttl:o.FIVE_MINUTES,prompt:!0,tag:1100},res:{ttl:o.FIVE_MINUTES,prompt:!1,tag:1101},reject:{ttl:o.FIVE_MINUTES,prompt:!1,tag:1120},autoReject:{ttl:o.FIVE_MINUTES,prompt:!1,tag:1121}},wc_sessionSettle:{req:{ttl:o.FIVE_MINUTES,prompt:!1,tag:1102},res:{ttl:o.FIVE_MINUTES,prompt:!1,tag:1103}},wc_sessionUpdate:{req:{ttl:o.ONE_DAY,prompt:!1,tag:1104},res:{ttl:o.ONE_DAY,prompt:!1,tag:1105}},wc_sessionExtend:{req:{ttl:o.ONE_DAY,prompt:!1,tag:1106},res:{ttl:o.ONE_DAY,prompt:!1,tag:1107}},wc_sessionRequest:{req:{ttl:o.FIVE_MINUTES,prompt:!0,tag:1108},res:{ttl:o.FIVE_MINUTES,prompt:!1,tag:1109}},wc_sessionEvent:{req:{ttl:o.FIVE_MINUTES,prompt:!0,tag:1110},res:{ttl:o.FIVE_MINUTES,prompt:!1,tag:1111}},wc_sessionDelete:{req:{ttl:o.ONE_DAY,prompt:!1,tag:1112},res:{ttl:o.ONE_DAY,prompt:!1,tag:1113}},wc_sessionPing:{req:{ttl:o.ONE_DAY,prompt:!1,tag:1114},res:{ttl:o.ONE_DAY,prompt:!1,tag:1115}},wc_sessionAuthenticate:{req:{ttl:o.ONE_HOUR,prompt:!0,tag:1116},res:{ttl:o.ONE_HOUR,prompt:!1,tag:1117},reject:{ttl:o.FIVE_MINUTES,prompt:!1,tag:1118},autoReject:{ttl:o.FIVE_MINUTES,prompt:!1,tag:1119}}},iW={min:o.FIVE_MINUTES,max:o.SEVEN_DAYS},iq={idle:"IDLE",active:"ACTIVE"},iH=["wc_sessionPropose","wc_sessionRequest","wc_authRequest","wc_sessionAuthenticate"],iz="wc@1.5:auth:",iF=`${iz}:PUB_KEY`;var iZ=Object.defineProperty,iV=Object.defineProperties,iK=Object.getOwnPropertyDescriptors,iG=Object.getOwnPropertySymbols,iJ=Object.prototype.hasOwnProperty,iY=Object.prototype.propertyIsEnumerable,iQ=(e,t,i)=>t in e?iZ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,iX=(e,t)=>{for(var i in t||(t={}))iJ.call(t,i)&&iQ(e,i,t[i]);if(iG)for(var i of iG(t))iY.call(t,i)&&iQ(e,i,t[i]);return e},i0=(e,t)=>iV(e,iK(t));class i1 extends J{constructor(e){super(e),this.name="engine",this.events=new(a()),this.initialized=!1,this.requestQueue={state:iq.idle,queue:[]},this.sessionRequestQueue={state:iq.idle,queue:[]},this.requestQueueDelay=o.ONE_SECOND,this.expectedPairingMethodMap=new Map,this.recentlyDeletedMap=new Map,this.recentlyDeletedLimit=200,this.relayMessageCache=[],this.init=async()=>{this.initialized||(await this.cleanup(),this.registerRelayerEvents(),this.registerExpirerEvents(),this.registerPairingEvents(),await this.registerLinkModeListeners(),this.client.core.pairing.register({methods:Object.keys(iB)}),this.initialized=!0,setTimeout(()=>{this.sessionRequestQueue.queue=this.getPendingSessionRequests(),this.processSessionRequestQueue()},(0,o.toMiliseconds)(this.requestQueueDelay)))},this.connect=async e=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();let t=i0(iX({},e),{requiredNamespaces:e.requiredNamespaces||{},optionalNamespaces:e.optionalNamespaces||{}});await this.isValidConnect(t);let{pairingTopic:i,requiredNamespaces:r,optionalNamespaces:n,sessionProperties:a,relays:s}=t,c=i,l,u=!1;try{c&&(u=this.client.core.pairing.pairings.get(c).active)}catch(e){throw this.client.logger.error(`connect() -> pairing.get(${c}) failed`),e}if(!c||!u){let{topic:e,uri:t}=await this.client.core.pairing.create();c=e,l=t}if(!c){let{message:e}=(0,Q.GuA)("NO_MATCHING_KEY",`connect() pairing topic: ${c}`);throw Error(e)}let d=await this.client.core.crypto.generateKeyPair(),h=iB.wc_sessionPropose.req.ttl||o.FIVE_MINUTES,p=(0,Q.Xw0)(h),f=iX({requiredNamespaces:r,optionalNamespaces:n,relays:s??[{protocol:"irn"}],proposer:{publicKey:d,metadata:this.client.metadata},expiryTimestamp:p,pairingTopic:c},a&&{sessionProperties:a}),{reject:g,resolve:w,done:m}=(0,Q.Wx8)(h,iL);this.events.once((0,Q.hEn)("session_connect"),async({error:e,session:t})=>{if(e)g(e);else if(t){t.self.publicKey=d;let e=i0(iX({},t),{pairingTopic:f.pairingTopic,requiredNamespaces:f.requiredNamespaces,optionalNamespaces:f.optionalNamespaces,transportType:eW.relay});await this.client.session.set(t.topic,e),await this.setExpiry(t.topic,t.expiry),c&&await this.client.core.pairing.updateMetadata({topic:c,metadata:t.peer.metadata}),this.cleanupDuplicatePairings(e),w(e)}});let b=await this.sendRequest({topic:c,method:"wc_sessionPropose",params:f,throwOnFailedPublish:!0});return await this.setProposal(b,iX({id:b},f)),{uri:l,approval:m}},this.pair=async e=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{return await this.client.core.pairing.pair(e)}catch(e){throw this.client.logger.error("pair() failed"),e}},this.approve=async e=>{var t,i,r;let n=this.client.core.eventClient.createEvent({properties:{topic:null==(t=e?.id)?void 0:t.toString(),trace:[e0.session_approve_started]}});try{this.isInitialized(),await this.confirmOnlineStateOrThrow()}catch(e){throw n.setError(e1.no_internet_connection),e}try{await this.isValidProposalId(e?.id)}catch(t){throw this.client.logger.error(`approve() -> proposal.get(${e?.id}) failed`),n.setError(e1.proposal_not_found),t}try{await this.isValidApprove(e)}catch(e){throw this.client.logger.error("approve() -> isValidApprove() failed"),n.setError(e1.session_approve_namespace_validation_failure),e}let{id:a,relayProtocol:o,namespaces:s,sessionProperties:c,sessionConfig:l}=e,u=this.client.proposal.get(a);this.client.core.eventClient.deleteEvent({eventId:n.eventId});let{pairingTopic:d,proposer:h,requiredNamespaces:p,optionalNamespaces:f}=u,g=null==(i=this.client.core.eventClient)?void 0:i.getEvent({topic:d});g||(g=null==(r=this.client.core.eventClient)?void 0:r.createEvent({type:e0.session_approve_started,properties:{topic:d,trace:[e0.session_approve_started,e0.session_namespaces_validation_success]}}));let w=await this.client.core.crypto.generateKeyPair(),m=h.publicKey,b=await this.client.core.crypto.generateSharedKey(w,m),v=iX(iX({relay:{protocol:o??"irn"},namespaces:s,controller:{publicKey:w,metadata:this.client.metadata},expiry:(0,Q.Xw0)(ij)},c&&{sessionProperties:c}),l&&{sessionConfig:l}),y=eW.relay;g.addTrace(e0.subscribing_session_topic);try{await this.client.core.relayer.subscribe(b,{transportType:y})}catch(e){throw g.setError(e1.subscribe_session_topic_failure),e}g.addTrace(e0.subscribe_session_topic_success);let x=i0(iX({},v),{topic:b,requiredNamespaces:p,optionalNamespaces:f,pairingTopic:d,acknowledged:!1,self:v.controller,peer:{publicKey:h.publicKey,metadata:h.metadata},controller:w,transportType:eW.relay});await this.client.session.set(b,x),g.addTrace(e0.store_session);try{g.addTrace(e0.publishing_session_settle),await this.sendRequest({topic:b,method:"wc_sessionSettle",params:v,throwOnFailedPublish:!0}).catch(e=>{throw g?.setError(e1.session_settle_publish_failure),e}),g.addTrace(e0.session_settle_publish_success),g.addTrace(e0.publishing_session_approve),await this.sendResult({id:a,topic:d,result:{relay:{protocol:o??"irn"},responderPublicKey:w},throwOnFailedPublish:!0}).catch(e=>{throw g?.setError(e1.session_approve_publish_failure),e}),g.addTrace(e0.session_approve_publish_success)}catch(e){throw this.client.logger.error(e),this.client.session.delete(b,(0,Q.Hjj)("USER_DISCONNECTED")),await this.client.core.relayer.unsubscribe(b),e}return this.client.core.eventClient.deleteEvent({eventId:g.eventId}),await this.client.core.pairing.updateMetadata({topic:d,metadata:h.metadata}),await this.client.proposal.delete(a,(0,Q.Hjj)("USER_DISCONNECTED")),await this.client.core.pairing.activate({topic:d}),await this.setExpiry(b,(0,Q.Xw0)(ij)),{topic:b,acknowledged:()=>Promise.resolve(this.client.session.get(b))}},this.reject=async e=>{let t;this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidReject(e)}catch(e){throw this.client.logger.error("reject() -> isValidReject() failed"),e}let{id:i,reason:r}=e;try{t=this.client.proposal.get(i).pairingTopic}catch(e){throw this.client.logger.error(`reject() -> proposal.get(${i}) failed`),e}t&&(await this.sendError({id:i,topic:t,error:r,rpcOpts:iB.wc_sessionPropose.reject}),await this.client.proposal.delete(i,(0,Q.Hjj)("USER_DISCONNECTED")))},this.update=async e=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidUpdate(e)}catch(e){throw this.client.logger.error("update() -> isValidUpdate() failed"),e}let{topic:t,namespaces:i}=e,{done:r,resolve:n,reject:a}=(0,Q.Wx8)(),o=es(),s=ec().toString(),c=this.client.session.get(t).namespaces;return this.events.once((0,Q.hEn)("session_update",o),({error:e})=>{e?a(e):n()}),await this.client.session.update(t,{namespaces:i}),await this.sendRequest({topic:t,method:"wc_sessionUpdate",params:{namespaces:i},throwOnFailedPublish:!0,clientRpcId:o,relayRpcId:s}).catch(e=>{this.client.logger.error(e),this.client.session.update(t,{namespaces:c}),a(e)}),{acknowledged:r}},this.extend=async e=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidExtend(e)}catch(e){throw this.client.logger.error("extend() -> isValidExtend() failed"),e}let{topic:t}=e,i=es(),{done:r,resolve:n,reject:a}=(0,Q.Wx8)();return this.events.once((0,Q.hEn)("session_extend",i),({error:e})=>{e?a(e):n()}),await this.setExpiry(t,(0,Q.Xw0)(ij)),this.sendRequest({topic:t,method:"wc_sessionExtend",params:{},clientRpcId:i,throwOnFailedPublish:!0}).catch(e=>{a(e)}),{acknowledged:r}},this.request=async e=>{this.isInitialized();try{await this.isValidRequest(e)}catch(e){throw this.client.logger.error("request() -> isValidRequest() failed"),e}let{chainId:t,request:i,topic:r,expiry:n=iB.wc_sessionRequest.req.ttl}=e,a=this.client.session.get(r);a?.transportType===eW.relay&&await this.confirmOnlineStateOrThrow();let o=es(),s=ec().toString(),{done:c,resolve:l,reject:u}=(0,Q.Wx8)(n,"Request expired. Please try again.");this.events.once((0,Q.hEn)("session_request",o),({error:e,result:t})=>{e?u(e):l(t)});let d=this.getAppLinkIfEnabled(a.peer.metadata,a.transportType);return d?(await this.sendRequest({clientRpcId:o,relayRpcId:s,topic:r,method:"wc_sessionRequest",params:{request:i0(iX({},i),{expiryTimestamp:(0,Q.Xw0)(n)}),chainId:t},expiry:n,throwOnFailedPublish:!0,appLink:d}).catch(e=>u(e)),this.client.events.emit("session_request_sent",{topic:r,request:i,chainId:t,id:o}),await c()):await Promise.all([new Promise(async e=>{await this.sendRequest({clientRpcId:o,relayRpcId:s,topic:r,method:"wc_sessionRequest",params:{request:i0(iX({},i),{expiryTimestamp:(0,Q.Xw0)(n)}),chainId:t},expiry:n,throwOnFailedPublish:!0}).catch(e=>u(e)),this.client.events.emit("session_request_sent",{topic:r,request:i,chainId:t,id:o}),e()}),new Promise(async e=>{var t;if(!(null!=(t=a.sessionConfig)&&t.disableDeepLink)){let e=await (0,Q.jTh)(this.client.core.storage,i$);await (0,Q.n3s)({id:o,topic:r,wcDeepLink:e})}e()}),c()]).then(e=>e[2])},this.respond=async e=>{this.isInitialized(),await this.isValidRespond(e);let{topic:t,response:i}=e,{id:r}=i,n=this.client.session.get(t);n.transportType===eW.relay&&await this.confirmOnlineStateOrThrow();let a=this.getAppLinkIfEnabled(n.peer.metadata,n.transportType);ex(i)?await this.sendResult({id:r,topic:t,result:i.result,throwOnFailedPublish:!0,appLink:a}):eC(i)&&await this.sendError({id:r,topic:t,error:i.error,appLink:a}),this.cleanupAfterResponse(e)},this.ping=async e=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidPing(e)}catch(e){throw this.client.logger.error("ping() -> isValidPing() failed"),e}let{topic:t}=e;if(this.client.session.keys.includes(t)){let e=es(),i=ec().toString(),{done:r,resolve:n,reject:a}=(0,Q.Wx8)();this.events.once((0,Q.hEn)("session_ping",e),({error:e})=>{e?a(e):n()}),await Promise.all([this.sendRequest({topic:t,method:"wc_sessionPing",params:{},throwOnFailedPublish:!0,clientRpcId:e,relayRpcId:i}),r()])}else this.client.core.pairing.pairings.keys.includes(t)&&await this.client.core.pairing.ping({topic:t})},this.emit=async e=>{this.isInitialized(),await this.confirmOnlineStateOrThrow(),await this.isValidEmit(e);let{topic:t,event:i,chainId:r}=e,n=ec().toString();await this.sendRequest({topic:t,method:"wc_sessionEvent",params:{event:i,chainId:r},throwOnFailedPublish:!0,relayRpcId:n})},this.disconnect=async e=>{this.isInitialized(),await this.confirmOnlineStateOrThrow(),await this.isValidDisconnect(e);let{topic:t}=e;if(this.client.session.keys.includes(t))await this.sendRequest({topic:t,method:"wc_sessionDelete",params:(0,Q.Hjj)("USER_DISCONNECTED"),throwOnFailedPublish:!0}),await this.deleteSession({topic:t,emitEvent:!1});else if(this.client.core.pairing.pairings.keys.includes(t))await this.client.core.pairing.disconnect({topic:t});else{let{message:e}=(0,Q.GuA)("MISMATCHED_TOPIC",`Session or pairing topic not found: ${t}`);throw Error(e)}},this.find=e=>(this.isInitialized(),this.client.session.getAll().filter(t=>(0,Q.HNf)(t,e))),this.getPendingSessionRequests=()=>this.client.pendingRequest.getAll(),this.authenticate=async(e,t)=>{var i;let r;this.isInitialized(),this.isValidAuthenticate(e);let n=t&&this.client.core.linkModeSupportedApps.includes(t)&&(null==(i=this.client.metadata.redirect)?void 0:i.linkMode),a=n?eW.link_mode:eW.relay;a===eW.relay&&await this.confirmOnlineStateOrThrow();let{chains:o,statement:s="",uri:c,domain:l,nonce:u,type:d,exp:h,nbf:p,methods:f=[],expiry:g}=e,w=[...e.resources||[]],{topic:m,uri:b}=await this.client.core.pairing.create({methods:["wc_sessionAuthenticate"],transportType:a});this.client.logger.info({message:"Generated new pairing",pairing:{topic:m,uri:b}});let v=await this.client.core.crypto.generateKeyPair(),y=(0,Q.EN$)(v);if(await Promise.all([this.client.auth.authKeys.set(iF,{responseTopic:y,publicKey:v}),this.client.auth.pairingTopics.set(y,{topic:y,pairingTopic:m})]),await this.client.core.relayer.subscribe(y,{transportType:a}),this.client.logger.info(`sending request to new pairing topic: ${m}`),f.length>0){let{namespace:e}=(0,Q._Yb)(o[0]),t=(0,Q.e8_)(e,"request",f);(0,Q.VBM)(w)&&(t=(0,Q.hVC)(t,w.pop())),w.push(t)}let x=g&&g>iB.wc_sessionAuthenticate.req.ttl?g:iB.wc_sessionAuthenticate.req.ttl,C={authPayload:{type:d??"caip122",chains:o,statement:s,aud:c,domain:l,version:"1",nonce:u,iat:new Date().toISOString(),exp:h,nbf:p,resources:w},requester:{publicKey:v,metadata:this.client.metadata},expiryTimestamp:(0,Q.Xw0)(x)},A={requiredNamespaces:{},optionalNamespaces:{eip155:{chains:o,methods:[...new Set(["personal_sign",...f])],events:["chainChanged","accountsChanged"]}},relays:[{protocol:"irn"}],pairingTopic:m,proposer:{publicKey:v,metadata:this.client.metadata},expiryTimestamp:(0,Q.Xw0)(iB.wc_sessionPropose.req.ttl)},{done:E,resolve:_,reject:k}=(0,Q.Wx8)(x,"Request expired"),I=async({error:e,session:t})=>{if(this.events.off((0,Q.hEn)("session_request",T),S),e)k(e);else if(t){t.self.publicKey=v,await this.client.session.set(t.topic,t),await this.setExpiry(t.topic,t.expiry),m&&await this.client.core.pairing.updateMetadata({topic:m,metadata:t.peer.metadata});let e=this.client.session.get(t.topic);await this.deleteProposal(N),_({session:e})}},S=async e=>{var i,r,n;let o;if(await this.deletePendingAuthRequest(T,{message:"fulfilled",code:0}),e.error){let t=(0,Q.Hjj)("WC_METHOD_UNSUPPORTED","wc_sessionAuthenticate");return e.error.code===t.code?void 0:(this.events.off((0,Q.hEn)("session_connect"),I),k(e.error.message))}await this.deleteProposal(N),this.events.off((0,Q.hEn)("session_connect"),I);let{cacaos:s,responder:c}=e.result,l=[],u=[];for(let e of s){await (0,Q.IjX)({cacao:e,projectId:this.client.core.projectId})||(this.client.logger.error(e,"Signature verification failed"),k((0,Q.Hjj)("SESSION_SETTLEMENT_FAILED","Signature verification failed")));let{p:t}=e,i=(0,Q.VBM)(t.resources),r=[(0,Q.xkc)(t.iss)],n=(0,Q.q_h)(t.iss);if(i){let e=(0,Q.sc_)(i),t=(0,Q.WWN)(i);l.push(...e),r.push(...t)}for(let e of r)u.push(`${e}:${n}`)}let d=await this.client.core.crypto.generateSharedKey(v,c.publicKey);l.length>0&&(o={topic:d,acknowledged:!0,self:{publicKey:v,metadata:this.client.metadata},peer:c,controller:c.publicKey,expiry:(0,Q.Xw0)(ij),requiredNamespaces:{},optionalNamespaces:{},relay:{protocol:"irn"},pairingTopic:m,namespaces:(0,Q.Van)([...new Set(l)],[...new Set(u)]),transportType:a},await this.client.core.relayer.subscribe(d,{transportType:a}),await this.client.session.set(d,o),m&&await this.client.core.pairing.updateMetadata({topic:m,metadata:c.metadata}),o=this.client.session.get(d)),null!=(i=this.client.metadata.redirect)&&i.linkMode&&null!=(r=c.metadata.redirect)&&r.linkMode&&null!=(n=c.metadata.redirect)&&n.universal&&t&&(this.client.core.addLinkModeSupportedApp(c.metadata.redirect.universal),this.client.session.update(d,{transportType:eW.link_mode})),_({auths:s,session:o})},T=es(),N=es();this.events.once((0,Q.hEn)("session_connect"),I),this.events.once((0,Q.hEn)("session_request",T),S);try{if(n){let e=el("wc_sessionAuthenticate",C,T);this.client.core.history.set(m,e);let i=await this.client.core.crypto.encode("",e,{type:Q.EHS,encoding:Q.Pa8});r=(0,Q.$Bq)(t,m,i)}else await Promise.all([this.sendRequest({topic:m,method:"wc_sessionAuthenticate",params:C,expiry:e.expiry,throwOnFailedPublish:!0,clientRpcId:T}),this.sendRequest({topic:m,method:"wc_sessionPropose",params:A,expiry:iB.wc_sessionPropose.req.ttl,throwOnFailedPublish:!0,clientRpcId:N})])}catch(e){throw this.events.off((0,Q.hEn)("session_connect"),I),this.events.off((0,Q.hEn)("session_request",T),S),e}return await this.setProposal(N,iX({id:N},A)),await this.setAuthRequest(T,{request:i0(iX({},C),{verifyContext:{}}),pairingTopic:m,transportType:a}),{uri:r??b,response:E}},this.approveSessionAuthenticate=async e=>{let t;let{id:i,auths:r}=e,n=this.client.core.eventClient.createEvent({properties:{topic:i.toString(),trace:[e2.authenticated_session_approve_started]}});try{this.isInitialized()}catch(e){throw n.setError(e3.no_internet_connection),e}let a=this.getPendingAuthRequest(i);if(!a)throw n.setError(e3.authenticated_session_pending_request_not_found),Error(`Could not find pending auth request with id ${i}`);let o=a.transportType||eW.relay;o===eW.relay&&await this.confirmOnlineStateOrThrow();let s=a.requester.publicKey,c=await this.client.core.crypto.generateKeyPair(),l=(0,Q.EN$)(s),u={type:Q.Lp_,receiverPublicKey:s,senderPublicKey:c},d=[],h=[];for(let e of r){if(!await (0,Q.IjX)({cacao:e,projectId:this.client.core.projectId})){n.setError(e3.invalid_cacao);let e=(0,Q.Hjj)("SESSION_SETTLEMENT_FAILED","Signature verification failed");throw await this.sendError({id:i,topic:l,error:e,encodeOpts:u}),Error(e.message)}n.addTrace(e2.cacaos_verified);let{p:t}=e,r=(0,Q.VBM)(t.resources),a=[(0,Q.xkc)(t.iss)],o=(0,Q.q_h)(t.iss);if(r){let e=(0,Q.sc_)(r),t=(0,Q.WWN)(r);d.push(...e),a.push(...t)}for(let e of a)h.push(`${e}:${o}`)}let p=await this.client.core.crypto.generateSharedKey(c,s);if(n.addTrace(e2.create_authenticated_session_topic),d?.length>0){t={topic:p,acknowledged:!0,self:{publicKey:c,metadata:this.client.metadata},peer:{publicKey:s,metadata:a.requester.metadata},controller:s,expiry:(0,Q.Xw0)(ij),authentication:r,requiredNamespaces:{},optionalNamespaces:{},relay:{protocol:"irn"},pairingTopic:a.pairingTopic,namespaces:(0,Q.Van)([...new Set(d)],[...new Set(h)]),transportType:o},n.addTrace(e2.subscribing_authenticated_session_topic);try{await this.client.core.relayer.subscribe(p,{transportType:o})}catch(e){throw n.setError(e3.subscribe_authenticated_session_topic_failure),e}n.addTrace(e2.subscribe_authenticated_session_topic_success),await this.client.session.set(p,t),n.addTrace(e2.store_authenticated_session),await this.client.core.pairing.updateMetadata({topic:a.pairingTopic,metadata:a.requester.metadata})}n.addTrace(e2.publishing_authenticated_session_approve);try{await this.sendResult({topic:l,id:i,result:{cacaos:r,responder:{publicKey:c,metadata:this.client.metadata}},encodeOpts:u,throwOnFailedPublish:!0,appLink:this.getAppLinkIfEnabled(a.requester.metadata,o)})}catch(e){throw n.setError(e3.authenticated_session_approve_publish_failure),e}return await this.client.auth.requests.delete(i,{message:"fulfilled",code:0}),await this.client.core.pairing.activate({topic:a.pairingTopic}),this.client.core.eventClient.deleteEvent({eventId:n.eventId}),{session:t}},this.rejectSessionAuthenticate=async e=>{this.isInitialized();let{id:t,reason:i}=e,r=this.getPendingAuthRequest(t);if(!r)throw Error(`Could not find pending auth request with id ${t}`);r.transportType===eW.relay&&await this.confirmOnlineStateOrThrow();let n=r.requester.publicKey,a=await this.client.core.crypto.generateKeyPair(),o=(0,Q.EN$)(n),s={type:Q.Lp_,receiverPublicKey:n,senderPublicKey:a};await this.sendError({id:t,topic:o,error:i,encodeOpts:s,rpcOpts:iB.wc_sessionAuthenticate.reject,appLink:this.getAppLinkIfEnabled(r.requester.metadata,r.transportType)}),await this.client.auth.requests.delete(t,{message:"rejected",code:0}),await this.client.proposal.delete(t,(0,Q.Hjj)("USER_DISCONNECTED"))},this.formatAuthMessage=e=>{this.isInitialized();let{request:t,iss:i}=e;return(0,Q.hwK)(t,i)},this.processRelayMessageCache=()=>{setTimeout(async()=>{if(0!==this.relayMessageCache.length)for(;this.relayMessageCache.length>0;)try{let e=this.relayMessageCache.shift();e&&await this.onRelayMessage(e)}catch(e){this.client.logger.error(e)}},50)},this.cleanupDuplicatePairings=async e=>{if(e.pairingTopic)try{let t=this.client.core.pairing.pairings.get(e.pairingTopic),i=this.client.core.pairing.pairings.getAll().filter(i=>{var r,n;return(null==(r=i.peerMetadata)?void 0:r.url)&&(null==(n=i.peerMetadata)?void 0:n.url)===e.peer.metadata.url&&i.topic&&i.topic!==t.topic});if(0===i.length)return;this.client.logger.info(`Cleaning up ${i.length} duplicate pairing(s)`),await Promise.all(i.map(e=>this.client.core.pairing.disconnect({topic:e.topic}))),this.client.logger.info("Duplicate pairings clean up finished")}catch(e){this.client.logger.error(e)}},this.deleteSession=async e=>{var t;let{topic:i,expirerHasDeleted:r=!1,emitEvent:n=!0,id:a=0}=e,{self:o}=this.client.session.get(i);await this.client.core.relayer.unsubscribe(i),await this.client.session.delete(i,(0,Q.Hjj)("USER_DISCONNECTED")),this.addToRecentlyDeleted(i,"session"),this.client.core.crypto.keychain.has(o.publicKey)&&await this.client.core.crypto.deleteKeyPair(o.publicKey),this.client.core.crypto.keychain.has(i)&&await this.client.core.crypto.deleteSymKey(i),r||this.client.core.expirer.del(i),this.client.core.storage.removeItem(i$).catch(e=>this.client.logger.warn(e)),this.getPendingSessionRequests().forEach(e=>{e.topic===i&&this.deletePendingSessionRequest(e.id,(0,Q.Hjj)("USER_DISCONNECTED"))}),i===(null==(t=this.sessionRequestQueue.queue[0])?void 0:t.topic)&&(this.sessionRequestQueue.state=iq.idle),n&&this.client.events.emit("session_delete",{id:a,topic:i})},this.deleteProposal=async(e,t)=>{if(t)try{let t=this.client.proposal.get(e),i=this.client.core.eventClient.getEvent({topic:t.pairingTopic});i?.setError(e1.proposal_expired)}catch{}await Promise.all([this.client.proposal.delete(e,(0,Q.Hjj)("USER_DISCONNECTED")),t?Promise.resolve():this.client.core.expirer.del(e)]),this.addToRecentlyDeleted(e,"proposal")},this.deletePendingSessionRequest=async(e,t,i=!1)=>{await Promise.all([this.client.pendingRequest.delete(e,t),i?Promise.resolve():this.client.core.expirer.del(e)]),this.addToRecentlyDeleted(e,"request"),this.sessionRequestQueue.queue=this.sessionRequestQueue.queue.filter(t=>t.id!==e),i&&(this.sessionRequestQueue.state=iq.idle,this.client.events.emit("session_request_expire",{id:e}))},this.deletePendingAuthRequest=async(e,t,i=!1)=>{await Promise.all([this.client.auth.requests.delete(e,t),i?Promise.resolve():this.client.core.expirer.del(e)])},this.setExpiry=async(e,t)=>{this.client.session.keys.includes(e)&&(this.client.core.expirer.set(e,t),await this.client.session.update(e,{expiry:t}))},this.setProposal=async(e,t)=>{this.client.core.expirer.set(e,(0,Q.Xw0)(iB.wc_sessionPropose.req.ttl)),await this.client.proposal.set(e,t)},this.setAuthRequest=async(e,t)=>{let{request:i,pairingTopic:r,transportType:n=eW.relay}=t;this.client.core.expirer.set(e,i.expiryTimestamp),await this.client.auth.requests.set(e,{authPayload:i.authPayload,requester:i.requester,expiryTimestamp:i.expiryTimestamp,id:e,pairingTopic:r,verifyContext:i.verifyContext,transportType:n})},this.setPendingSessionRequest=async e=>{let{id:t,topic:i,params:r,verifyContext:n}=e,a=r.request.expiryTimestamp||(0,Q.Xw0)(iB.wc_sessionRequest.req.ttl);this.client.core.expirer.set(t,a),await this.client.pendingRequest.set(t,{id:t,topic:i,params:r,verifyContext:n})},this.sendRequest=async e=>{let t,r;let{topic:n,method:a,params:o,expiry:s,relayRpcId:c,clientRpcId:l,throwOnFailedPublish:u,appLink:d}=e,h=el(a,o,l),p=!!d;try{let e=p?Q.Pa8:Q.EWt;t=await this.client.core.crypto.encode(n,h,{encoding:e})}catch(e){throw await this.cleanup(),this.client.logger.error(`sendRequest() -> core.crypto.encode() for topic ${n} failed`),e}if(iH.includes(a)){let e=(0,Q.ALl)(JSON.stringify(h)),i=(0,Q.ALl)(t);r=await this.client.core.verify.register({id:i,decryptedId:e})}let f=iB[a].req;if(f.attestation=r,s&&(f.ttl=s),c&&(f.id=c),this.client.core.history.set(n,h),p){let e=(0,Q.$Bq)(d,n,t);await i.g.Linking.openURL(e,this.client.name)}else{let e=iB[a].req;s&&(e.ttl=s),c&&(e.id=c),u?(e.internal=i0(iX({},e.internal),{throwOnFailedPublish:!0}),await this.client.core.relayer.publish(n,t,e)):this.client.core.relayer.publish(n,t,e).catch(e=>this.client.logger.error(e))}return h.id},this.sendResult=async e=>{let t,r;let{id:n,topic:a,result:o,throwOnFailedPublish:s,encodeOpts:c,appLink:l}=e,u=eu(n,o),d=l&&"u">typeof(null==i.g?void 0:i.g.Linking);try{let e=d?Q.Pa8:Q.EWt;t=await this.client.core.crypto.encode(a,u,i0(iX({},c||{}),{encoding:e}))}catch(e){throw await this.cleanup(),this.client.logger.error(`sendResult() -> core.crypto.encode() for topic ${a} failed`),e}try{r=await this.client.core.history.get(a,n)}catch(e){throw this.client.logger.error(`sendResult() -> history.get(${a}, ${n}) failed`),e}if(d){let e=(0,Q.$Bq)(l,a,t);await i.g.Linking.openURL(e,this.client.name)}else{let e=iB[r.request.method].res;s?(e.internal=i0(iX({},e.internal),{throwOnFailedPublish:!0}),await this.client.core.relayer.publish(a,t,e)):this.client.core.relayer.publish(a,t,e).catch(e=>this.client.logger.error(e))}await this.client.core.history.resolve(u)},this.sendError=async e=>{let t,r;let{id:n,topic:a,error:o,encodeOpts:s,rpcOpts:c,appLink:l}=e,u=ed(n,o),d=l&&"u">typeof(null==i.g?void 0:i.g.Linking);try{let e=d?Q.Pa8:Q.EWt;t=await this.client.core.crypto.encode(a,u,i0(iX({},s||{}),{encoding:e}))}catch(e){throw await this.cleanup(),this.client.logger.error(`sendError() -> core.crypto.encode() for topic ${a} failed`),e}try{r=await this.client.core.history.get(a,n)}catch(e){throw this.client.logger.error(`sendError() -> history.get(${a}, ${n}) failed`),e}if(d){let e=(0,Q.$Bq)(l,a,t);await i.g.Linking.openURL(e,this.client.name)}else{let e=c||iB[r.request.method].res;this.client.core.relayer.publish(a,t,e)}await this.client.core.history.resolve(u)},this.cleanup=async()=>{let e=[],t=[];this.client.session.getAll().forEach(t=>{let i=!1;(0,Q._dF)(t.expiry)&&(i=!0),this.client.core.crypto.keychain.has(t.topic)||(i=!0),i&&e.push(t.topic)}),this.client.proposal.getAll().forEach(e=>{(0,Q._dF)(e.expiryTimestamp)&&t.push(e.id)}),await Promise.all([...e.map(e=>this.deleteSession({topic:e})),...t.map(e=>this.deleteProposal(e))])},this.onRelayEventRequest=async e=>{this.requestQueue.queue.push(e),await this.processRequestsQueue()},this.processRequestsQueue=async()=>{if(this.requestQueue.state===iq.active){this.client.logger.info("Request queue already active, skipping...");return}for(this.client.logger.info(`Request queue starting with ${this.requestQueue.queue.length} requests`);this.requestQueue.queue.length>0;){this.requestQueue.state=iq.active;let e=this.requestQueue.queue.shift();if(e)try{await this.processRequest(e)}catch(e){this.client.logger.warn(e)}}this.requestQueue.state=iq.idle},this.processRequest=async e=>{let{topic:t,payload:i,attestation:r,transportType:n,encryptedId:a}=e,o=i.method;if(!this.shouldIgnorePairingRequest({topic:t,requestMethod:o}))switch(o){case"wc_sessionPropose":return await this.onSessionProposeRequest({topic:t,payload:i,attestation:r,encryptedId:a});case"wc_sessionSettle":return await this.onSessionSettleRequest(t,i);case"wc_sessionUpdate":return await this.onSessionUpdateRequest(t,i);case"wc_sessionExtend":return await this.onSessionExtendRequest(t,i);case"wc_sessionPing":return await this.onSessionPingRequest(t,i);case"wc_sessionDelete":return await this.onSessionDeleteRequest(t,i);case"wc_sessionRequest":return await this.onSessionRequest({topic:t,payload:i,attestation:r,encryptedId:a,transportType:n});case"wc_sessionEvent":return await this.onSessionEventRequest(t,i);case"wc_sessionAuthenticate":return await this.onSessionAuthenticateRequest({topic:t,payload:i,attestation:r,encryptedId:a,transportType:n});default:return this.client.logger.info(`Unsupported request method ${o}`)}},this.onRelayEventResponse=async e=>{let{topic:t,payload:i,transportType:r}=e,n=(await this.client.core.history.get(t,i.id)).request.method;switch(n){case"wc_sessionPropose":return this.onSessionProposeResponse(t,i,r);case"wc_sessionSettle":return this.onSessionSettleResponse(t,i);case"wc_sessionUpdate":return this.onSessionUpdateResponse(t,i);case"wc_sessionExtend":return this.onSessionExtendResponse(t,i);case"wc_sessionPing":return this.onSessionPingResponse(t,i);case"wc_sessionRequest":return this.onSessionRequestResponse(t,i);case"wc_sessionAuthenticate":return this.onSessionAuthenticateResponse(t,i);default:return this.client.logger.info(`Unsupported response method ${n}`)}},this.onRelayEventUnknownPayload=e=>{let{topic:t}=e,{message:i}=(0,Q.GuA)("MISSING_OR_INVALID",`Decoded payload on topic ${t} is not identifiable as a JSON-RPC request or a response.`);throw Error(i)},this.shouldIgnorePairingRequest=e=>{let{topic:t,requestMethod:i}=e,r=this.expectedPairingMethodMap.get(t);return!(!r||r.includes(i))&&!!(r.includes("wc_sessionAuthenticate")&&this.client.events.listenerCount("session_authenticate")>0)},this.onSessionProposeRequest=async e=>{let{topic:t,payload:i,attestation:r,encryptedId:n}=e,{params:a,id:o}=i;try{let e=this.client.core.eventClient.getEvent({topic:t});this.isValidConnect(iX({},i.params));let s=a.expiryTimestamp||(0,Q.Xw0)(iB.wc_sessionPropose.req.ttl),c=iX({id:o,pairingTopic:t,expiryTimestamp:s},a);await this.setProposal(o,c);let l=await this.getVerifyContext({attestationId:r,hash:(0,Q.ALl)(JSON.stringify(i)),encryptedId:n,metadata:c.proposer.metadata});0===this.client.events.listenerCount("session_proposal")&&(console.warn("No listener for session_proposal event"),e?.setError(eX.proposal_listener_not_found)),e?.addTrace(eQ.emit_session_proposal),this.client.events.emit("session_proposal",{id:o,params:c,verifyContext:l})}catch(e){await this.sendError({id:o,topic:t,error:e,rpcOpts:iB.wc_sessionPropose.autoReject}),this.client.logger.error(e)}},this.onSessionProposeResponse=async(e,t,i)=>{let{id:r}=t;if(ex(t)){let{result:n}=t;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",result:n});let a=this.client.proposal.get(r);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",proposal:a});let o=a.proposer.publicKey;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",selfPublicKey:o});let s=n.responderPublicKey;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",peerPublicKey:s});let c=await this.client.core.crypto.generateSharedKey(o,s);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",sessionTopic:c});let l=await this.client.core.relayer.subscribe(c,{transportType:i});this.client.logger.trace({type:"method",method:"onSessionProposeResponse",subscriptionId:l}),await this.client.core.pairing.activate({topic:e})}else if(eC(t)){await this.client.proposal.delete(r,(0,Q.Hjj)("USER_DISCONNECTED"));let e=(0,Q.hEn)("session_connect");if(0===this.events.listenerCount(e))throw Error(`emitting ${e} without any listeners, 954`);this.events.emit((0,Q.hEn)("session_connect"),{error:t.error})}},this.onSessionSettleRequest=async(e,t)=>{let{id:i,params:r}=t;try{this.isValidSessionSettleRequest(r);let{relay:i,controller:n,expiry:a,namespaces:o,sessionProperties:s,sessionConfig:c}=t.params,l=i0(iX(iX({topic:e,relay:i,expiry:a,namespaces:o,acknowledged:!0,pairingTopic:"",requiredNamespaces:{},optionalNamespaces:{},controller:n.publicKey,self:{publicKey:"",metadata:this.client.metadata},peer:{publicKey:n.publicKey,metadata:n.metadata}},s&&{sessionProperties:s}),c&&{sessionConfig:c}),{transportType:eW.relay}),u=(0,Q.hEn)("session_connect");if(0===this.events.listenerCount(u))throw Error(`emitting ${u} without any listeners 997`);this.events.emit((0,Q.hEn)("session_connect"),{session:l}),await this.sendResult({id:t.id,topic:e,result:!0,throwOnFailedPublish:!0})}catch(t){await this.sendError({id:i,topic:e,error:t}),this.client.logger.error(t)}},this.onSessionSettleResponse=async(e,t)=>{let{id:i}=t;ex(t)?(await this.client.session.update(e,{acknowledged:!0}),this.events.emit((0,Q.hEn)("session_approve",i),{})):eC(t)&&(await this.client.session.delete(e,(0,Q.Hjj)("USER_DISCONNECTED")),this.events.emit((0,Q.hEn)("session_approve",i),{error:t.error}))},this.onSessionUpdateRequest=async(e,t)=>{let{params:i,id:r}=t;try{let t=`${e}_session_update`,n=Q.nyL.get(t);if(n&&this.isRequestOutOfSync(n,r)){this.client.logger.info(`Discarding out of sync request - ${r}`),this.sendError({id:r,topic:e,error:(0,Q.Hjj)("INVALID_UPDATE_REQUEST")});return}this.isValidUpdate(iX({topic:e},i));try{Q.nyL.set(t,r),await this.client.session.update(e,{namespaces:i.namespaces}),await this.sendResult({id:r,topic:e,result:!0,throwOnFailedPublish:!0})}catch(e){throw Q.nyL.delete(t),e}this.client.events.emit("session_update",{id:r,topic:e,params:i})}catch(t){await this.sendError({id:r,topic:e,error:t}),this.client.logger.error(t)}},this.isRequestOutOfSync=(e,t)=>parseInt(t.toString().slice(0,-3))<=parseInt(e.toString().slice(0,-3)),this.onSessionUpdateResponse=(e,t)=>{let{id:i}=t,r=(0,Q.hEn)("session_update",i);if(0===this.events.listenerCount(r))throw Error(`emitting ${r} without any listeners`);ex(t)?this.events.emit((0,Q.hEn)("session_update",i),{}):eC(t)&&this.events.emit((0,Q.hEn)("session_update",i),{error:t.error})},this.onSessionExtendRequest=async(e,t)=>{let{id:i}=t;try{this.isValidExtend({topic:e}),await this.setExpiry(e,(0,Q.Xw0)(ij)),await this.sendResult({id:i,topic:e,result:!0,throwOnFailedPublish:!0}),this.client.events.emit("session_extend",{id:i,topic:e})}catch(t){await this.sendError({id:i,topic:e,error:t}),this.client.logger.error(t)}},this.onSessionExtendResponse=(e,t)=>{let{id:i}=t,r=(0,Q.hEn)("session_extend",i);if(0===this.events.listenerCount(r))throw Error(`emitting ${r} without any listeners`);ex(t)?this.events.emit((0,Q.hEn)("session_extend",i),{}):eC(t)&&this.events.emit((0,Q.hEn)("session_extend",i),{error:t.error})},this.onSessionPingRequest=async(e,t)=>{let{id:i}=t;try{this.isValidPing({topic:e}),await this.sendResult({id:i,topic:e,result:!0,throwOnFailedPublish:!0}),this.client.events.emit("session_ping",{id:i,topic:e})}catch(t){await this.sendError({id:i,topic:e,error:t}),this.client.logger.error(t)}},this.onSessionPingResponse=(e,t)=>{let{id:i}=t,r=(0,Q.hEn)("session_ping",i);if(0===this.events.listenerCount(r))throw Error(`emitting ${r} without any listeners`);setTimeout(()=>{ex(t)?this.events.emit((0,Q.hEn)("session_ping",i),{}):eC(t)&&this.events.emit((0,Q.hEn)("session_ping",i),{error:t.error})},500)},this.onSessionDeleteRequest=async(e,t)=>{let{id:i}=t;try{this.isValidDisconnect({topic:e,reason:t.params}),Promise.all([new Promise(t=>{this.client.core.relayer.once(eL.publish,async()=>{t(await this.deleteSession({topic:e,id:i}))})}),this.sendResult({id:i,topic:e,result:!0,throwOnFailedPublish:!0}),this.cleanupPendingSentRequestsForTopic({topic:e,error:(0,Q.Hjj)("USER_DISCONNECTED")})]).catch(e=>this.client.logger.error(e))}catch(e){this.client.logger.error(e)}},this.onSessionRequest=async e=>{var t,i,r;let{topic:n,payload:a,attestation:o,encryptedId:s,transportType:c}=e,{id:l,params:u}=a;try{await this.isValidRequest(iX({topic:n},u));let e=this.client.session.get(n),a=await this.getVerifyContext({attestationId:o,hash:(0,Q.ALl)(JSON.stringify(el("wc_sessionRequest",u,l))),encryptedId:s,metadata:e.peer.metadata,transportType:c}),d={id:l,topic:n,params:u,verifyContext:a};await this.setPendingSessionRequest(d),c===eW.link_mode&&null!=(t=e.peer.metadata.redirect)&&t.universal&&this.client.core.addLinkModeSupportedApp(null==(i=e.peer.metadata.redirect)?void 0:i.universal),null!=(r=this.client.signConfig)&&r.disableRequestQueue?this.emitSessionRequest(d):(this.addSessionRequestToSessionRequestQueue(d),this.processSessionRequestQueue())}catch(e){await this.sendError({id:l,topic:n,error:e}),this.client.logger.error(e)}},this.onSessionRequestResponse=(e,t)=>{let{id:i}=t,r=(0,Q.hEn)("session_request",i);if(0===this.events.listenerCount(r))throw Error(`emitting ${r} without any listeners`);ex(t)?this.events.emit((0,Q.hEn)("session_request",i),{result:t.result}):eC(t)&&this.events.emit((0,Q.hEn)("session_request",i),{error:t.error})},this.onSessionEventRequest=async(e,t)=>{let{id:i,params:r}=t;try{let t=`${e}_session_event_${r.event.name}`,n=Q.nyL.get(t);if(n&&this.isRequestOutOfSync(n,i)){this.client.logger.info(`Discarding out of sync request - ${i}`);return}this.isValidEmit(iX({topic:e},r)),this.client.events.emit("session_event",{id:i,topic:e,params:r}),Q.nyL.set(t,i)}catch(t){await this.sendError({id:i,topic:e,error:t}),this.client.logger.error(t)}},this.onSessionAuthenticateResponse=(e,t)=>{let{id:i}=t;this.client.logger.trace({type:"method",method:"onSessionAuthenticateResponse",topic:e,payload:t}),ex(t)?this.events.emit((0,Q.hEn)("session_request",i),{result:t.result}):eC(t)&&this.events.emit((0,Q.hEn)("session_request",i),{error:t.error})},this.onSessionAuthenticateRequest=async e=>{var t;let{topic:i,payload:r,attestation:n,encryptedId:a,transportType:o}=e;try{let{requester:e,authPayload:s,expiryTimestamp:c}=r.params,l=await this.getVerifyContext({attestationId:n,hash:(0,Q.ALl)(JSON.stringify(r)),encryptedId:a,metadata:e.metadata,transportType:o}),u={requester:e,pairingTopic:i,id:r.id,authPayload:s,verifyContext:l,expiryTimestamp:c};await this.setAuthRequest(r.id,{request:u,pairingTopic:i,transportType:o}),o===eW.link_mode&&null!=(t=e.metadata.redirect)&&t.universal&&this.client.core.addLinkModeSupportedApp(e.metadata.redirect.universal),this.client.events.emit("session_authenticate",{topic:i,params:r.params,id:r.id,verifyContext:l})}catch(s){this.client.logger.error(s);let e=r.params.requester.publicKey,t=await this.client.core.crypto.generateKeyPair(),n=this.getAppLinkIfEnabled(r.params.requester.metadata,o),a={type:Q.Lp_,receiverPublicKey:e,senderPublicKey:t};await this.sendError({id:r.id,topic:i,error:s,encodeOpts:a,rpcOpts:iB.wc_sessionAuthenticate.autoReject,appLink:n})}},this.addSessionRequestToSessionRequestQueue=e=>{this.sessionRequestQueue.queue.push(e)},this.cleanupAfterResponse=e=>{this.deletePendingSessionRequest(e.response.id,{message:"fulfilled",code:0}),setTimeout(()=>{this.sessionRequestQueue.state=iq.idle,this.processSessionRequestQueue()},(0,o.toMiliseconds)(this.requestQueueDelay))},this.cleanupPendingSentRequestsForTopic=({topic:e,error:t})=>{let i=this.client.core.history.pending;i.length>0&&i.filter(t=>t.topic===e&&"wc_sessionRequest"===t.request.method).forEach(e=>{let i=e.request.id,r=(0,Q.hEn)("session_request",i);if(0===this.events.listenerCount(r))throw Error(`emitting ${r} without any listeners`);this.events.emit((0,Q.hEn)("session_request",e.request.id),{error:t})})},this.processSessionRequestQueue=()=>{if(this.sessionRequestQueue.state===iq.active){this.client.logger.info("session request queue is already active.");return}let e=this.sessionRequestQueue.queue[0];if(!e){this.client.logger.info("session request queue is empty.");return}try{this.sessionRequestQueue.state=iq.active,this.emitSessionRequest(e)}catch(e){this.client.logger.error(e)}},this.emitSessionRequest=e=>{this.client.events.emit("session_request",e)},this.onPairingCreated=e=>{if(e.methods&&this.expectedPairingMethodMap.set(e.topic,e.methods),e.active)return;let t=this.client.proposal.getAll().find(t=>t.pairingTopic===e.topic);t&&this.onSessionProposeRequest({topic:e.topic,payload:el("wc_sessionPropose",{requiredNamespaces:t.requiredNamespaces,optionalNamespaces:t.optionalNamespaces,relays:t.relays,proposer:t.proposer,sessionProperties:t.sessionProperties},t.id)})},this.isValidConnect=async e=>{if(!(0,Q.TeY)(e)){let{message:t}=(0,Q.GuA)("MISSING_OR_INVALID",`connect() params: ${JSON.stringify(e)}`);throw Error(t)}let{pairingTopic:t,requiredNamespaces:i,optionalNamespaces:r,sessionProperties:n,relays:a}=e;if((0,Q.b07)(t)||await this.isValidPairingTopic(t),!(0,Q.V9G)(a,!0)){let{message:e}=(0,Q.GuA)("MISSING_OR_INVALID",`connect() relays: ${a}`);throw Error(e)}(0,Q.b07)(i)||0===(0,Q.aF0)(i)||this.validateNamespaces(i,"requiredNamespaces"),(0,Q.b07)(r)||0===(0,Q.aF0)(r)||this.validateNamespaces(r,"optionalNamespaces"),(0,Q.b07)(n)||this.validateSessionProps(n,"sessionProperties")},this.validateNamespaces=(e,t)=>{let i=(0,Q.esh)(e,"connect()",t);if(i)throw Error(i.message)},this.isValidApprove=async e=>{if(!(0,Q.TeY)(e))throw Error((0,Q.GuA)("MISSING_OR_INVALID",`approve() params: ${e}`).message);let{id:t,namespaces:i,relayProtocol:r,sessionProperties:n}=e;this.checkRecentlyDeleted(t),await this.isValidProposalId(t);let a=this.client.proposal.get(t),o=(0,Q.FiO)(i,"approve()");if(o)throw Error(o.message);let s=(0,Q.XqR)(a.requiredNamespaces,i,"approve()");if(s)throw Error(s.message);if(!(0,Q.Qhg)(r,!0)){let{message:e}=(0,Q.GuA)("MISSING_OR_INVALID",`approve() relayProtocol: ${r}`);throw Error(e)}(0,Q.b07)(n)||this.validateSessionProps(n,"sessionProperties")},this.isValidReject=async e=>{if(!(0,Q.TeY)(e)){let{message:t}=(0,Q.GuA)("MISSING_OR_INVALID",`reject() params: ${e}`);throw Error(t)}let{id:t,reason:i}=e;if(this.checkRecentlyDeleted(t),await this.isValidProposalId(t),!(0,Q.X3c)(i)){let{message:e}=(0,Q.GuA)("MISSING_OR_INVALID",`reject() reason: ${JSON.stringify(i)}`);throw Error(e)}},this.isValidSessionSettleRequest=e=>{if(!(0,Q.TeY)(e)){let{message:t}=(0,Q.GuA)("MISSING_OR_INVALID",`onSessionSettleRequest() params: ${e}`);throw Error(t)}let{relay:t,controller:i,namespaces:r,expiry:n}=e;if(!(0,Q.kuU)(t)){let{message:e}=(0,Q.GuA)("MISSING_OR_INVALID","onSessionSettleRequest() relay protocol should be a string");throw Error(e)}let a=(0,Q.tk0)(i,"onSessionSettleRequest()");if(a)throw Error(a.message);let o=(0,Q.FiO)(r,"onSessionSettleRequest()");if(o)throw Error(o.message);if((0,Q._dF)(n)){let{message:e}=(0,Q.GuA)("EXPIRED","onSessionSettleRequest()");throw Error(e)}},this.isValidUpdate=async e=>{if(!(0,Q.TeY)(e)){let{message:t}=(0,Q.GuA)("MISSING_OR_INVALID",`update() params: ${e}`);throw Error(t)}let{topic:t,namespaces:i}=e;this.checkRecentlyDeleted(t),await this.isValidSessionTopic(t);let r=this.client.session.get(t),n=(0,Q.FiO)(i,"update()");if(n)throw Error(n.message);let a=(0,Q.XqR)(r.requiredNamespaces,i,"update()");if(a)throw Error(a.message)},this.isValidExtend=async e=>{if(!(0,Q.TeY)(e)){let{message:t}=(0,Q.GuA)("MISSING_OR_INVALID",`extend() params: ${e}`);throw Error(t)}let{topic:t}=e;this.checkRecentlyDeleted(t),await this.isValidSessionTopic(t)},this.isValidRequest=async e=>{if(!(0,Q.TeY)(e)){let{message:t}=(0,Q.GuA)("MISSING_OR_INVALID",`request() params: ${e}`);throw Error(t)}let{topic:t,request:i,chainId:r,expiry:n}=e;this.checkRecentlyDeleted(t),await this.isValidSessionTopic(t);let{namespaces:a}=this.client.session.get(t);if(!(0,Q.tLy)(a,r)){let{message:e}=(0,Q.GuA)("MISSING_OR_INVALID",`request() chainId: ${r}`);throw Error(e)}if(!(0,Q.iV1)(i)){let{message:e}=(0,Q.GuA)("MISSING_OR_INVALID",`request() ${JSON.stringify(i)}`);throw Error(e)}if(!(0,Q.oKp)(a,r,i.method)){let{message:e}=(0,Q.GuA)("MISSING_OR_INVALID",`request() method: ${i.method}`);throw Error(e)}if(n&&!(0,Q.Hbs)(n,iW)){let{message:e}=(0,Q.GuA)("MISSING_OR_INVALID",`request() expiry: ${n}. Expiry must be a number (in seconds) between ${iW.min} and ${iW.max}`);throw Error(e)}},this.isValidRespond=async e=>{var t;if(!(0,Q.TeY)(e)){let{message:t}=(0,Q.GuA)("MISSING_OR_INVALID",`respond() params: ${e}`);throw Error(t)}let{topic:i,response:r}=e;try{await this.isValidSessionTopic(i)}catch(i){throw null!=(t=e?.response)&&t.id&&this.cleanupAfterResponse(e),i}if(!(0,Q.M8n)(r)){let{message:e}=(0,Q.GuA)("MISSING_OR_INVALID",`respond() response: ${JSON.stringify(r)}`);throw Error(e)}},this.isValidPing=async e=>{if(!(0,Q.TeY)(e)){let{message:t}=(0,Q.GuA)("MISSING_OR_INVALID",`ping() params: ${e}`);throw Error(t)}let{topic:t}=e;await this.isValidSessionOrPairingTopic(t)},this.isValidEmit=async e=>{if(!(0,Q.TeY)(e)){let{message:t}=(0,Q.GuA)("MISSING_OR_INVALID",`emit() params: ${e}`);throw Error(t)}let{topic:t,event:i,chainId:r}=e;await this.isValidSessionTopic(t);let{namespaces:n}=this.client.session.get(t);if(!(0,Q.tLy)(n,r)){let{message:e}=(0,Q.GuA)("MISSING_OR_INVALID",`emit() chainId: ${r}`);throw Error(e)}if(!(0,Q.FR8)(i)||!(0,Q.z2N)(n,r,i.name)){let{message:e}=(0,Q.GuA)("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(i)}`);throw Error(e)}},this.isValidDisconnect=async e=>{if(!(0,Q.TeY)(e)){let{message:t}=(0,Q.GuA)("MISSING_OR_INVALID",`disconnect() params: ${e}`);throw Error(t)}let{topic:t}=e;await this.isValidSessionOrPairingTopic(t)},this.isValidAuthenticate=e=>{let{chains:t,uri:i,domain:r,nonce:n}=e;if(!Array.isArray(t)||0===t.length)throw Error("chains is required and must be a non-empty array");if(!(0,Q.Qhg)(i,!1))throw Error("uri is required parameter");if(!(0,Q.Qhg)(r,!1))throw Error("domain is required parameter");if(!(0,Q.Qhg)(n,!1))throw Error("nonce is required parameter");if([...new Set(t.map(e=>(0,Q._Yb)(e).namespace))].length>1)throw Error("Multi-namespace requests are not supported. Please request single namespace only.");let{namespace:a}=(0,Q._Yb)(t[0]);if("eip155"!==a)throw Error("Only eip155 namespace is supported for authenticated sessions. Please use .connect() for non-eip155 chains.")},this.getVerifyContext=async e=>{let{attestationId:t,hash:i,encryptedId:r,metadata:n,transportType:a}=e,o={verified:{verifyUrl:n.verifyUrl||eG,validation:"UNKNOWN",origin:n.url||""}};try{if(a===eW.link_mode){let e=this.getAppLinkIfEnabled(n,a);return o.verified.validation=e&&new URL(e).origin===new URL(n.url).origin?"VALID":"INVALID",o}let e=await this.client.core.verify.resolve({attestationId:t,hash:i,encryptedId:r,verifyUrl:n.verifyUrl});e&&(o.verified.origin=e.origin,o.verified.isScam=e.isScam,o.verified.validation=e.origin===new URL(n.url).origin?"VALID":"INVALID")}catch(e){this.client.logger.warn(e)}return this.client.logger.debug(`Verify context: ${JSON.stringify(o)}`),o},this.validateSessionProps=(e,t)=>{Object.values(e).forEach(e=>{if(!(0,Q.Qhg)(e,!1)){let{message:i}=(0,Q.GuA)("MISSING_OR_INVALID",`${t} must be in Record format. Received: ${JSON.stringify(e)}`);throw Error(i)}})},this.getPendingAuthRequest=e=>{let t=this.client.auth.requests.get(e);return"object"==typeof t?t:void 0},this.addToRecentlyDeleted=(e,t)=>{if(this.recentlyDeletedMap.set(e,t),this.recentlyDeletedMap.size>=this.recentlyDeletedLimit){let e=0,t=this.recentlyDeletedLimit/2;for(let i of this.recentlyDeletedMap.keys()){if(e++>=t)break;this.recentlyDeletedMap.delete(i)}}},this.checkRecentlyDeleted=e=>{let t=this.recentlyDeletedMap.get(e);if(t){let{message:i}=(0,Q.GuA)("MISSING_OR_INVALID",`Record was recently deleted - ${t}: ${e}`);throw Error(i)}},this.isLinkModeEnabled=(e,t)=>{var r,n,a,o,s,c,l,u,d;return!!e&&t===eW.link_mode&&(null==(n=null==(r=this.client.metadata)?void 0:r.redirect)?void 0:n.linkMode)===!0&&(null==(o=null==(a=this.client.metadata)?void 0:a.redirect)?void 0:o.universal)!==void 0&&(null==(c=null==(s=this.client.metadata)?void 0:s.redirect)?void 0:c.universal)!==""&&(null==(l=e?.redirect)?void 0:l.universal)!==void 0&&(null==(u=e?.redirect)?void 0:u.universal)!==""&&(null==(d=e?.redirect)?void 0:d.linkMode)===!0&&this.client.core.linkModeSupportedApps.includes(e.redirect.universal)&&"u">typeof(null==i.g?void 0:i.g.Linking)},this.getAppLinkIfEnabled=(e,t)=>{var i;return this.isLinkModeEnabled(e,t)?null==(i=e?.redirect)?void 0:i.universal:void 0},this.handleLinkModeMessage=({url:e})=>{if(!e||!e.includes("wc_ev")||!e.includes("topic"))return;let t=(0,Q.$hI)(e,"topic")||"",i=decodeURIComponent((0,Q.$hI)(e,"wc_ev")||""),r=this.client.session.keys.includes(t);r&&this.client.session.update(t,{transportType:eW.link_mode}),this.client.core.dispatchEnvelope({topic:t,message:i,sessionExists:r})},this.registerLinkModeListeners=async()=>{var e;if((0,Q.w8K)()||(0,Q.lVv)()&&null!=(e=this.client.metadata.redirect)&&e.linkMode){let e=null==i.g?void 0:i.g.Linking;if("u">typeof e){e.addEventListener("url",this.handleLinkModeMessage,this.client.name);let t=await e.getInitialURL();t&&setTimeout(()=>{this.handleLinkModeMessage({url:t})},50)}}}}isInitialized(){if(!this.initialized){let{message:e}=(0,Q.GuA)("NOT_INITIALIZED",this.name);throw Error(e)}}async confirmOnlineStateOrThrow(){await this.client.core.relayer.confirmOnlineStateOrThrow()}registerRelayerEvents(){this.client.core.relayer.on(eL.message,e=>{!this.initialized||this.relayMessageCache.length>0?this.relayMessageCache.push(e):this.onRelayMessage(e)})}async onRelayMessage(e){let{topic:t,message:i,attestation:r,transportType:n}=e,{publicKey:a}=this.client.auth.authKeys.keys.includes(iF)?this.client.auth.authKeys.get(iF):{responseTopic:void 0,publicKey:void 0},o=await this.client.core.crypto.decode(t,i,{receiverPublicKey:a,encoding:n===eW.link_mode?Q.Pa8:Q.EWt});try{ev(o)?(this.client.core.history.set(t,o),this.onRelayEventRequest({topic:t,payload:o,attestation:r,transportType:n,encryptedId:(0,Q.ALl)(i)})):ey(o)?(await this.client.core.history.resolve(o),await this.onRelayEventResponse({topic:t,payload:o,transportType:n}),this.client.core.history.delete(t,o.id)):this.onRelayEventUnknownPayload({topic:t,payload:o,transportType:n})}catch(e){this.client.logger.error(e)}}registerExpirerEvents(){this.client.core.expirer.on(eK.expired,async e=>{let{topic:t,id:i}=(0,Q.c82)(e.target);return i&&this.client.pendingRequest.keys.includes(i)?await this.deletePendingSessionRequest(i,(0,Q.GuA)("EXPIRED"),!0):i&&this.client.auth.requests.keys.includes(i)?await this.deletePendingAuthRequest(i,(0,Q.GuA)("EXPIRED"),!0):void(t?this.client.session.keys.includes(t)&&(await this.deleteSession({topic:t,expirerHasDeleted:!0}),this.client.events.emit("session_expire",{topic:t})):i&&(await this.deleteProposal(i,!0),this.client.events.emit("proposal_expire",{id:i})))})}registerPairingEvents(){this.client.core.pairing.events.on(eZ.create,e=>this.onPairingCreated(e)),this.client.core.pairing.events.on(eZ.delete,e=>{this.addToRecentlyDeleted(e.topic,"pairing")})}isValidPairingTopic(e){if(!(0,Q.Qhg)(e,!1)){let{message:t}=(0,Q.GuA)("MISSING_OR_INVALID",`pairing topic should be a string: ${e}`);throw Error(t)}if(!this.client.core.pairing.pairings.keys.includes(e)){let{message:t}=(0,Q.GuA)("NO_MATCHING_KEY",`pairing topic doesn't exist: ${e}`);throw Error(t)}if((0,Q._dF)(this.client.core.pairing.pairings.get(e).expiry)){let{message:t}=(0,Q.GuA)("EXPIRED",`pairing topic: ${e}`);throw Error(t)}}async isValidSessionTopic(e){if(!(0,Q.Qhg)(e,!1)){let{message:t}=(0,Q.GuA)("MISSING_OR_INVALID",`session topic should be a string: ${e}`);throw Error(t)}if(this.checkRecentlyDeleted(e),!this.client.session.keys.includes(e)){let{message:t}=(0,Q.GuA)("NO_MATCHING_KEY",`session topic doesn't exist: ${e}`);throw Error(t)}if((0,Q._dF)(this.client.session.get(e).expiry)){await this.deleteSession({topic:e});let{message:t}=(0,Q.GuA)("EXPIRED",`session topic: ${e}`);throw Error(t)}if(!this.client.core.crypto.keychain.has(e)){let{message:t}=(0,Q.GuA)("MISSING_OR_INVALID",`session topic does not exist in keychain: ${e}`);throw await this.deleteSession({topic:e}),Error(t)}}async isValidSessionOrPairingTopic(e){if(this.checkRecentlyDeleted(e),this.client.session.keys.includes(e))await this.isValidSessionTopic(e);else if(this.client.core.pairing.pairings.keys.includes(e))this.isValidPairingTopic(e);else if((0,Q.Qhg)(e,!1)){let{message:t}=(0,Q.GuA)("NO_MATCHING_KEY",`session or pairing topic doesn't exist: ${e}`);throw Error(t)}else{let{message:t}=(0,Q.GuA)("MISSING_OR_INVALID",`session or pairing topic should be a string: ${e}`);throw Error(t)}}async isValidProposalId(e){if(!(0,Q.Alu)(e)){let{message:t}=(0,Q.GuA)("MISSING_OR_INVALID",`proposal id should be a number: ${e}`);throw Error(t)}if(!this.client.proposal.keys.includes(e)){let{message:t}=(0,Q.GuA)("NO_MATCHING_KEY",`proposal id doesn't exist: ${e}`);throw Error(t)}if((0,Q._dF)(this.client.proposal.get(e).expiryTimestamp)){await this.deleteProposal(e);let{message:t}=(0,Q.GuA)("EXPIRED",`proposal id: ${e}`);throw Error(t)}}}class i2 extends il{constructor(e,t){super(e,t,"proposal",iD),this.core=e,this.logger=t}}class i3 extends il{constructor(e,t){super(e,t,"session",iD),this.core=e,this.logger=t}}class i5 extends il{constructor(e,t){super(e,t,"request",iD,e=>e.id),this.core=e,this.logger=t}}class i4 extends il{constructor(e,t){super(e,t,"authKeys",iz,()=>iF),this.core=e,this.logger=t}}class i6 extends il{constructor(e,t){super(e,t,"pairingTopics",iz),this.core=e,this.logger=t}}class i8 extends il{constructor(e,t){super(e,t,"requests",iz,e=>e.id),this.core=e,this.logger=t}}class i9{constructor(e,t){this.core=e,this.logger=t,this.authKeys=new i4(this.core,this.logger),this.pairingTopics=new i6(this.core,this.logger),this.requests=new i8(this.core,this.logger)}async init(){await this.authKeys.init(),await this.pairingTopics.init(),await this.requests.init()}}class i7 extends G{constructor(e){super(e),this.protocol="wc",this.version=2,this.name=iU.name,this.events=new n.EventEmitter,this.on=(e,t)=>this.events.on(e,t),this.once=(e,t)=>this.events.once(e,t),this.off=(e,t)=>this.events.off(e,t),this.removeListener=(e,t)=>this.events.removeListener(e,t),this.removeAllListeners=e=>this.events.removeAllListeners(e),this.connect=async e=>{try{return await this.engine.connect(e)}catch(e){throw this.logger.error(e.message),e}},this.pair=async e=>{try{return await this.engine.pair(e)}catch(e){throw this.logger.error(e.message),e}},this.approve=async e=>{try{return await this.engine.approve(e)}catch(e){throw this.logger.error(e.message),e}},this.reject=async e=>{try{return await this.engine.reject(e)}catch(e){throw this.logger.error(e.message),e}},this.update=async e=>{try{return await this.engine.update(e)}catch(e){throw this.logger.error(e.message),e}},this.extend=async e=>{try{return await this.engine.extend(e)}catch(e){throw this.logger.error(e.message),e}},this.request=async e=>{try{return await this.engine.request(e)}catch(e){throw this.logger.error(e.message),e}},this.respond=async e=>{try{return await this.engine.respond(e)}catch(e){throw this.logger.error(e.message),e}},this.ping=async e=>{try{return await this.engine.ping(e)}catch(e){throw this.logger.error(e.message),e}},this.emit=async e=>{try{return await this.engine.emit(e)}catch(e){throw this.logger.error(e.message),e}},this.disconnect=async e=>{try{return await this.engine.disconnect(e)}catch(e){throw this.logger.error(e.message),e}},this.find=e=>{try{return this.engine.find(e)}catch(e){throw this.logger.error(e.message),e}},this.getPendingSessionRequests=()=>{try{return this.engine.getPendingSessionRequests()}catch(e){throw this.logger.error(e.message),e}},this.authenticate=async(e,t)=>{try{return await this.engine.authenticate(e,t)}catch(e){throw this.logger.error(e.message),e}},this.formatAuthMessage=e=>{try{return this.engine.formatAuthMessage(e)}catch(e){throw this.logger.error(e.message),e}},this.approveSessionAuthenticate=async e=>{try{return await this.engine.approveSessionAuthenticate(e)}catch(e){throw this.logger.error(e.message),e}},this.rejectSessionAuthenticate=async e=>{try{return await this.engine.rejectSessionAuthenticate(e)}catch(e){throw this.logger.error(e.message),e}},this.name=e?.name||iU.name,this.metadata=e?.metadata||(0,Q.lFF)(),this.signConfig=e?.signConfig;let t="u">typeof e?.logger&&"string"!=typeof e?.logger?e.logger:(0,$.h6)((0,$.iP)({level:e?.logger||iU.logger}));this.core=e?.core||new iO(e),this.logger=(0,$.U5)(t,this.name),this.session=new i3(this.core,this.logger),this.proposal=new i2(this.core,this.logger),this.pendingRequest=new i5(this.core,this.logger),this.engine=new i1(this),this.auth=new i9(this.core,this.logger)}static async init(e){let t=new i7(e);return await t.initialize(),t}get context(){return(0,$.oI)(this.logger)}get pairing(){return this.core.pairing.pairings}async initialize(){this.logger.trace("Initialized");try{await this.core.start(),await this.session.init(),await this.proposal.init(),await this.pendingRequest.init(),await this.auth.init(),await this.engine.init(),this.logger.info("SignClient Initialization Success"),this.engine.processRelayMessageCache()}catch(e){throw this.logger.info("SignClient Initialization Failure"),this.logger.error(e.message),e}}}var re=i(77186),rt=i.n(re),ri=Object.defineProperty,rr=Object.defineProperties,rn=Object.getOwnPropertyDescriptors,ra=Object.getOwnPropertySymbols,ro=Object.prototype.hasOwnProperty,rs=Object.prototype.propertyIsEnumerable,rc=(e,t,i)=>t in e?ri(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,rl=(e,t)=>{for(var i in t||(t={}))ro.call(t,i)&&rc(e,i,t[i]);if(ra)for(var i of ra(t))rs.call(t,i)&&rc(e,i,t[i]);return e},ru=(e,t)=>rr(e,rn(t));let rd={headers:{Accept:"application/json","Content-Type":"application/json"},method:"POST"};class rh{constructor(e,t=!1){if(this.url=e,this.disableProviderPing=t,this.events=new n.EventEmitter,this.isAvailable=!1,this.registering=!1,!ew(e))throw Error(`Provided URL is not compatible with HTTP connection: ${e}`);this.url=e,this.disableProviderPing=t}get connected(){return this.isAvailable}get connecting(){return this.registering}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}off(e,t){this.events.off(e,t)}removeListener(e,t){this.events.removeListener(e,t)}async open(e=this.url){await this.register(e)}async close(){if(!this.isAvailable)throw Error("Connection already closed");this.onClose()}async send(e){this.isAvailable||await this.register();try{let t=(0,I.h)(e),i=await (await rt()(this.url,ru(rl({},rd),{body:t}))).json();this.onPayload({data:i})}catch(t){this.onError(e.id,t)}}async register(e=this.url){if(!ew(e))throw Error(`Provided URL is not compatible with HTTP connection: ${e}`);if(this.registering){let e=this.events.getMaxListeners();return(this.events.listenerCount("register_error")>=e||this.events.listenerCount("open")>=e)&&this.events.setMaxListeners(e+1),new Promise((e,t)=>{this.events.once("register_error",e=>{this.resetMaxListeners(),t(e)}),this.events.once("open",()=>{if(this.resetMaxListeners(),typeof this.isAvailable>"u")return t(Error("HTTP connection is missing or invalid"));e()})})}this.url=e,this.registering=!0;try{if(!this.disableProviderPing){let t=(0,I.h)({id:1,jsonrpc:"2.0",method:"test",params:[]});await rt()(e,ru(rl({},rd),{body:t}))}this.onOpen()}catch(t){let e=this.parseError(t);throw this.events.emit("register_error",e),this.onClose(),e}}onOpen(){this.isAvailable=!0,this.registering=!1,this.events.emit("open")}onClose(){this.isAvailable=!1,this.registering=!1,this.events.emit("close")}onPayload(e){if(typeof e.data>"u")return;let t="string"==typeof e.data?(0,I.j)(e.data):e.data;this.events.emit("payload",t)}onError(e,t){let i=this.parseError(t),r=ed(e,i.message||i.toString());this.events.emit("payload",r)}parseError(e,t=this.url){return ea(e,t,"HTTP")}resetMaxListeners(){this.events.getMaxListeners()>10&&this.events.setMaxListeners(10)}}let rp="error",rf="wc@2:universal_provider:",rg="https://rpc.walletconnect.org/v1/",rw="generic",rm=`${rg}bundler`,rb={DEFAULT_CHAIN_CHANGED:"default_chain_changed"};var rv="u">typeof globalThis?globalThis:"u">typeof window?window:"u">typeof i.g?i.g:"u">typeof self?self:{},ry={exports:{}};!function(e,t){(function(){var i,r="Expected a function",n="__lodash_hash_undefined__",a="__lodash_placeholder__",o=1/0,s=0/0,c=[["ary",128],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]],l="[object Arguments]",u="[object Array]",d="[object Boolean]",h="[object Date]",p="[object Error]",f="[object Function]",g="[object GeneratorFunction]",w="[object Map]",m="[object Number]",b="[object Object]",v="[object Promise]",y="[object RegExp]",x="[object Set]",C="[object String]",A="[object Symbol]",E="[object WeakMap]",_="[object ArrayBuffer]",k="[object DataView]",I="[object Float32Array]",S="[object Float64Array]",T="[object Int8Array]",N="[object Int16Array]",P="[object Int32Array]",R="[object Uint8Array]",O="[object Uint8ClampedArray]",M="[object Uint16Array]",D="[object Uint32Array]",U=/\b__p \+= '';/g,$=/\b(__p \+=) '' \+/g,L=/(__e\(.*?\)|\b__t\)) \+\n'';/g,j=/&(?:amp|lt|gt|quot|#39);/g,B=/[&<>"']/g,W=RegExp(j.source),q=RegExp(B.source),H=/<%-([\s\S]+?)%>/g,z=/<%([\s\S]+?)%>/g,F=/<%=([\s\S]+?)%>/g,Z=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,V=/^\w*$/,K=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,G=/[\\^$.*+?()[\]{}|]/g,J=RegExp(G.source),Y=/^\s+/,Q=/\s/,X=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,ee=/\{\n\/\* \[wrapped with (.+)\] \*/,et=/,? & /,ei=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,er=/[()=,{}\[\]\/\s]/,en=/\\(\\)?/g,ea=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,eo=/\w*$/,es=/^[-+]0x[0-9a-f]+$/i,ec=/^0b[01]+$/i,el=/^\[object .+?Constructor\]$/,eu=/^0o[0-7]+$/i,ed=/^(?:0|[1-9]\d*)$/,eh=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ep=/($^)/,ef=/['\n\r\u2028\u2029\\]/g,eg="\ud800-\udfff",ew="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",em="\\u2700-\\u27bf",eb="a-z\\xdf-\\xf6\\xf8-\\xff",ev="A-Z\\xc0-\\xd6\\xd8-\\xde",ey="\\ufe0e\\ufe0f",ex="\\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",eC="['’]",eA="["+ex+"]",eE="["+ew+"]",e_="["+eb+"]",ek="[^"+eg+ex+"\\d+"+em+eb+ev+"]",eI="\ud83c[\udffb-\udfff]",eS="[^"+eg+"]",eT="(?:\ud83c[\udde6-\uddff]){2}",eN="[\ud800-\udbff][\udc00-\udfff]",eP="["+ev+"]",eR="\\u200d",eO="(?:"+e_+"|"+ek+")",eM="(?:"+eP+"|"+ek+")",eD="(?:"+eC+"(?:d|ll|m|re|s|t|ve))?",eU="(?:"+eC+"(?:D|LL|M|RE|S|T|VE))?",e$="(?:"+eE+"|"+eI+")?",eL="["+ey+"]?",ej="(?:"+eR+"(?:"+[eS,eT,eN].join("|")+")"+eL+e$+")*",eB=eL+e$+ej,eW="(?:"+["["+em+"]",eT,eN].join("|")+")"+eB,eq="(?:"+[eS+eE+"?",eE,eT,eN,"["+eg+"]"].join("|")+")",eH=RegExp(eC,"g"),ez=RegExp(eE,"g"),eF=RegExp(eI+"(?="+eI+")|"+eq+eB,"g"),eZ=RegExp([eP+"?"+e_+"+"+eD+"(?="+[eA,eP,"$"].join("|")+")",eM+"+"+eU+"(?="+[eA,eP+eO,"$"].join("|")+")",eP+"?"+eO+"+"+eD,eP+"+"+eU,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])","\\d+",eW].join("|"),"g"),eV=RegExp("["+eR+eg+ew+ey+"]"),eK=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,eG=["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"],eJ=-1,eY={};eY[I]=eY[S]=eY[T]=eY[N]=eY[P]=eY[R]=eY[O]=eY[M]=eY[D]=!0,eY[l]=eY[u]=eY[_]=eY[d]=eY[k]=eY[h]=eY[p]=eY[f]=eY[w]=eY[m]=eY[b]=eY[y]=eY[x]=eY[C]=eY[E]=!1;var eQ={};eQ[l]=eQ[u]=eQ[_]=eQ[k]=eQ[d]=eQ[h]=eQ[I]=eQ[S]=eQ[T]=eQ[N]=eQ[P]=eQ[w]=eQ[m]=eQ[b]=eQ[y]=eQ[x]=eQ[C]=eQ[A]=eQ[R]=eQ[O]=eQ[M]=eQ[D]=!0,eQ[p]=eQ[f]=eQ[E]=!1;var eX={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},e0=parseFloat,e1=parseInt,e2="object"==typeof rv&&rv&&rv.Object===Object&&rv,e3="object"==typeof self&&self&&self.Object===Object&&self,e5=e2||e3||Function("return this")(),e4=t&&!t.nodeType&&t,e6=e4&&e&&!e.nodeType&&e,e8=e6&&e6.exports===e4,e9=e8&&e2.process,e7=function(){try{return e6&&e6.require&&e6.require("util").types||e9&&e9.binding&&e9.binding("util")}catch{}}(),te=e7&&e7.isArrayBuffer,tt=e7&&e7.isDate,ti=e7&&e7.isMap,tr=e7&&e7.isRegExp,tn=e7&&e7.isSet,ta=e7&&e7.isTypedArray;function to(e,t,i){switch(i.length){case 0:return e.call(t);case 1:return e.call(t,i[0]);case 2:return e.call(t,i[0],i[1]);case 3:return e.call(t,i[0],i[1],i[2])}return e.apply(t,i)}function ts(e,t,i,r){for(var n=-1,a=null==e?0:e.length;++n-1}function th(e,t,i){for(var r=-1,n=null==e?0:e.length;++r-1;);return i}function tD(e,t){for(var i=e.length;i--&&tx(t,e[i],0)>-1;);return i}var tU=tk({À:"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"}),t$=tk({"&":"&","<":"<",">":">",'"':""","'":"'"});function tL(e){return"\\"+eX[e]}function tj(e){return eV.test(e)}function tB(e){var t=-1,i=Array(e.size);return e.forEach(function(e,r){i[++t]=[r,e]}),i}function tW(e,t){return function(i){return e(t(i))}}function tq(e,t){for(var i=-1,r=e.length,n=0,o=[];++i",""":'"',"'":"'"}),tK=function e(t){var Q,eg,ew,em,eb=(t=null==t?e5:tK.defaults(e5.Object(),t,tK.pick(e5,eG))).Array,ev=t.Date,ey=t.Error,ex=t.Function,eC=t.Math,eA=t.Object,eE=t.RegExp,e_=t.String,ek=t.TypeError,eI=eb.prototype,eS=ex.prototype,eT=eA.prototype,eN=t["__core-js_shared__"],eP=eS.toString,eR=eT.hasOwnProperty,eO=0,eM=(Q=/[^.]+$/.exec(eN&&eN.keys&&eN.keys.IE_PROTO||""))?"Symbol(src)_1."+Q:"",eD=eT.toString,eU=eP.call(eA),e$=e5._,eL=eE("^"+eP.call(eR).replace(G,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ej=e8?t.Buffer:i,eB=t.Symbol,eW=t.Uint8Array,eq=ej?ej.allocUnsafe:i,eF=tW(eA.getPrototypeOf,eA),eV=eA.create,eX=eT.propertyIsEnumerable,e2=eI.splice,e3=eB?eB.isConcatSpreadable:i,e4=eB?eB.iterator:i,e6=eB?eB.toStringTag:i,e9=function(){try{var e=nf(eA,"defineProperty");return e({},"",{}),e}catch{}}(),e7=t.clearTimeout!==e5.clearTimeout&&t.clearTimeout,tb=ev&&ev.now!==e5.Date.now&&ev.now,tk=t.setTimeout!==e5.setTimeout&&t.setTimeout,tG=eC.ceil,tJ=eC.floor,tY=eA.getOwnPropertySymbols,tQ=ej?ej.isBuffer:i,tX=t.isFinite,t0=eI.join,t1=tW(eA.keys,eA),t2=eC.max,t3=eC.min,t5=ev.now,t4=t.parseInt,t6=eC.random,t8=eI.reverse,t9=nf(t,"DataView"),t7=nf(t,"Map"),ie=nf(t,"Promise"),it=nf(t,"Set"),ii=nf(t,"WeakMap"),ir=nf(eA,"create"),ia=ii&&new ii,io={},is=nj(t9),ic=nj(t7),il=nj(ie),iu=nj(it),id=nj(ii),ih=eB?eB.prototype:i,ip=ih?ih.valueOf:i,ig=ih?ih.toString:i;function iw(e){if(aZ(e)&&!aD(e)&&!(e instanceof iy)){if(e instanceof iv)return e;if(eR.call(e,"__wrapped__"))return nB(e)}return new iv(e)}var im=function(){function e(){}return function(t){if(!aF(t))return{};if(eV)return eV(t);e.prototype=t;var r=new e;return e.prototype=i,r}}();function ib(){}function iv(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=i}function iy(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=0xffffffff,this.__views__=[]}function ix(e){var t=-1,i=null==e?0:e.length;for(this.clear();++t=t?e:t)),e}function iU(e,t,r,n,a,o){var s,c=1&t,u=2&t,p=4&t;if(r&&(s=a?r(e,n,a,o):r(e)),s!==i)return s;if(!aF(e))return e;var v=aD(e);if(v){if(E=e.length,U=new e.constructor(E),E&&"string"==typeof e[0]&&eR.call(e,"index")&&(U.index=e.index,U.input=e.input),s=U,!c)return rq(e,s)}else{var E,U,$,L,j,B=nm(e),W=B==f||B==g;if(aj(e))return rU(e,c);if(B==b||B==l||W&&!a){if(s=u||W?{}:nv(e),!c)return u?($=(j=s)&&rH(e,op(e),j),rH(e,nw(e),$)):(L=iR(s,e),rH(e,ng(e),L))}else{if(!eQ[B])return a?e:{};s=function(e,t,i){var r,n,a=e.constructor;switch(t){case _:return r$(e);case d:case h:return new a(+e);case k:return r=i?r$(e.buffer):e.buffer,new e.constructor(r,e.byteOffset,e.byteLength);case I:case S:case T:case N:case P:case R:case O:case M:case D:return rL(e,i);case w:return new a;case m:case C:return new a(e);case y:return(n=new e.constructor(e.source,eo.exec(e))).lastIndex=e.lastIndex,n;case x:return new a;case A:return ip?eA(ip.call(e)):{}}}(e,B,c)}}o||(o=new i_);var q=o.get(e);if(q)return q;o.set(e,s),aY(e)?e.forEach(function(i){s.add(iU(i,t,r,i,e,o))}):aV(e)&&e.forEach(function(i,n){s.set(n,iU(i,t,r,n,e,o))});var H=p?u?ns:no:u?op:oh,z=v?i:H(e);return tc(z||e,function(i,n){z&&(i=e[n=i]),iT(s,n,iU(i,t,r,n,e,o))}),s}function i$(e,t,r){var n=r.length;if(null==e)return!n;for(e=eA(e);n--;){var a=r[n],o=t[a],s=e[a];if(s===i&&!(a in e)||!o(s))return!1}return!0}function iL(e,t,n){if("function"!=typeof e)throw new ek(r);return nR(function(){e.apply(i,n)},t)}function ij(e,t,i,r){var n=-1,a=td,o=!0,s=e.length,c=[],l=t.length;if(!s)return c;i&&(t=tp(t,tP(i))),r?(a=th,o=!1):t.length>=200&&(a=tO,o=!1,t=new iE(t));e:for(;++n-1},iC.prototype.set=function(e,t){var i=this.__data__,r=iN(i,e);return r<0?(++this.size,i.push([e,t])):i[r][1]=t,this},iA.prototype.clear=function(){this.size=0,this.__data__={hash:new ix,map:new(t7||iC),string:new ix}},iA.prototype.delete=function(e){var t=nh(this,e).delete(e);return this.size-=t?1:0,t},iA.prototype.get=function(e){return nh(this,e).get(e)},iA.prototype.has=function(e){return nh(this,e).has(e)},iA.prototype.set=function(e,t){var i=nh(this,e),r=i.size;return i.set(e,t),this.size+=i.size==r?0:1,this},iE.prototype.add=iE.prototype.push=function(e){return this.__data__.set(e,n),this},iE.prototype.has=function(e){return this.__data__.has(e)},i_.prototype.clear=function(){this.__data__=new iC,this.size=0},i_.prototype.delete=function(e){var t=this.__data__,i=t.delete(e);return this.size=t.size,i},i_.prototype.get=function(e){return this.__data__.get(e)},i_.prototype.has=function(e){return this.__data__.has(e)},i_.prototype.set=function(e,t){var i=this.__data__;if(i instanceof iC){var r=i.__data__;if(!t7||r.length<199)return r.push([e,t]),this.size=++i.size,this;i=this.__data__=new iA(r)}return i.set(e,t),this.size=i.size,this};var iB=rZ(iK),iW=rZ(iG,!0);function iq(e,t){var i=!0;return iB(e,function(e,r,n){return i=!!t(e,r,n)}),i}function iH(e,t,r){for(var n=-1,a=e.length;++n0&&i(s)?t>1?iF(s,t-1,i,r,n):tf(n,s):r||(n[n.length]=s)}return n}var iZ=rV(),iV=rV(!0);function iK(e,t){return e&&iZ(e,t,oh)}function iG(e,t){return e&&iV(e,t,oh)}function iJ(e,t){return tu(t,function(t){return aq(e[t])})}function iY(e,t){t=rO(t,e);for(var r=0,n=t.length;null!=e&&rt}function i1(e,t){return null!=e&&eR.call(e,t)}function i2(e,t){return null!=e&&t in eA(e)}function i3(e,t,r){for(var n=r?th:td,a=e[0].length,o=e.length,s=o,c=eb(o),l=1/0,u=[];s--;){var d=e[s];s&&t&&(d=tp(d,tP(t))),l=t3(d.length,l),c[s]=!r&&(t||a>=120&&d.length>=120)?new iE(s&&d):i}d=e[0];var h=-1,p=c[0];e:for(;++h=s)return c;return c*("desc"==i[r]?-1:1)}}return e.index-t.index}(e,t,i)})}function rc(e,t,i){for(var r=-1,n=t.length,a={};++r-1;)s!==e&&e2.call(s,c,1),e2.call(e,c,1);return e}function ru(e,t){for(var i=e?t.length:0,r=i-1;i--;){var n=t[i];if(i==r||n!==a){var a=n;nx(n)?e2.call(e,n,1):r_(e,n)}}return e}function rd(e,t){return e+tJ(t6()*(t-e+1))}function rh(e,t){var i="";if(!e||t<1||t>0x1fffffffffffff)return i;do t%2&&(i+=e),(t=tJ(t/2))&&(e+=e);while(t);return i}function rp(e,t){return nO(nS(e,t,oL),e+"")}function rf(e,t,r,n){if(!aF(e))return e;t=rO(t,e);for(var a=-1,o=t.length,s=o-1,c=e;null!=c&&++an?0:n+t),(i=i>n?n:i)<0&&(i+=n),n=t>i?0:i-t>>>0,t>>>=0;for(var a=eb(n);++r>>1,o=e[a];null!==o&&!aX(o)&&(i?o<=t:o=200){var l=t?null:r9(e);if(l)return tH(l);o=!1,n=tO,c=new iE}else c=t?[]:s;e:for(;++r=n?e:rm(e,t,r)}var rD=e7||function(e){return e5.clearTimeout(e)};function rU(e,t){if(t)return e.slice();var i=e.length,r=eq?eq(i):new e.constructor(i);return e.copy(r),r}function r$(e){var t=new e.constructor(e.byteLength);return new eW(t).set(new eW(e)),t}function rL(e,t){var i=t?r$(e.buffer):e.buffer;return new e.constructor(i,e.byteOffset,e.length)}function rj(e,t){if(e!==t){var r=e!==i,n=null===e,a=e==e,o=aX(e),s=t!==i,c=null===t,l=t==t,u=aX(t);if(!c&&!u&&!o&&e>t||o&&s&&l&&!c&&!u||n&&s&&l||!r&&l||!a)return 1;if(!n&&!o&&!u&&e1?r[a-1]:i,s=a>2?r[2]:i;for(o=e.length>3&&"function"==typeof o?(a--,o):i,s&&nC(r[0],r[1],s)&&(o=a<3?i:o,a=1),t=eA(t);++n-1?a[o?t[s]:s]:i}}function rQ(e){return na(function(t){var n=t.length,a=n,o=iv.prototype.thru;for(e&&t.reverse();a--;){var s=t[a];if("function"!=typeof s)throw new ek(r);if(o&&!c&&"wrapper"==nl(s))var c=new iv([],!0)}for(a=c?a:n;++a1&&v.reverse(),d&&lc))return!1;var u=o.get(e),d=o.get(t);if(u&&d)return u==t&&d==e;var h=-1,p=!0,f=2&r?new iE:i;for(o.set(e,t),o.set(t,e);++h-1&&e%1==0&&e1?"& ":"")+t[r],t=t.join(i>2?", ":" "),e.replace(X,`{ /* [wrapped with `+t+`] */ `)}(a,(r=(n=a.match(ee))?n[1].split(et):[],tc(c,function(e){var t="_."+e[0];i&e[1]&&!td(r,t)&&r.push(t)}),r.sort())))}function nD(e){var t=0,r=0;return function(){var n=t5(),a=16-(n-r);if(r=n,a>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(i,arguments)}}function nU(e,t){var r=-1,n=e.length,a=n-1;for(t=t===i?n:t;++r1?e[t-1]:i;return r="function"==typeof r?(e.pop(),r):i,n6(e,r)});function ar(e){var t=iw(e);return t.__chain__=!0,t}function an(e,t){return t(e)}var aa=na(function(e){var t=e.length,r=t?e[0]:0,n=this.__wrapped__,a=function(t){return iM(t,e)};return!(t>1)&&!this.__actions__.length&&n instanceof iy&&nx(r)?((n=n.slice(r,+r+(t?1:0))).__actions__.push({func:an,args:[a],thisArg:i}),new iv(n,this.__chain__).thru(function(e){return t&&!e.length&&e.push(i),e})):this.thru(a)}),ao=rz(function(e,t,i){eR.call(e,i)?++e[i]:iO(e,i,1)}),as=rY(nz),ac=rY(nF);function al(e,t){return(aD(e)?tc:iB)(e,nd(t,3))}function au(e,t){return(aD(e)?function(e,t){for(var i=null==e?0:e.length;i--&&!1!==t(e[i],i,e););return e}:iW)(e,nd(t,3))}var ad=rz(function(e,t,i){eR.call(e,i)?e[i].push(t):iO(e,i,[t])}),ah=rp(function(e,t,i){var r=-1,n="function"==typeof t,a=a$(e)?eb(e.length):[];return iB(e,function(e){a[++r]=n?to(t,e,i):i5(e,t,i)}),a}),ap=rz(function(e,t,i){iO(e,i,t)});function af(e,t){return(aD(e)?tp:ri)(e,nd(t,3))}var ag=rz(function(e,t,i){e[i?0:1].push(t)},function(){return[[],[]]}),aw=rp(function(e,t){if(null==e)return[];var i=t.length;return i>1&&nC(e,t[0],t[1])?t=[]:i>2&&nC(t[0],t[1],t[2])&&(t=[t[0]]),rs(e,iF(t,1),[])}),am=tb||function(){return e5.Date.now()};function ab(e,t,r){return t=r?i:t,t=e&&null==t?e.length:t,ne(e,128,i,i,i,i,t)}function av(e,t){var n;if("function"!=typeof t)throw new ek(r);return e=a4(e),function(){return--e>0&&(n=t.apply(this,arguments)),e<=1&&(t=i),n}}var ay=rp(function(e,t,i){var r=1;if(i.length){var n=tq(i,nu(ay));r|=32}return ne(e,r,t,i,n)}),ax=rp(function(e,t,i){var r=3;if(i.length){var n=tq(i,nu(ax));r|=32}return ne(t,r,e,i,n)});function aC(e,t,n){var a,o,s,c,l,u,d=0,h=!1,p=!1,f=!0;if("function"!=typeof e)throw new ek(r);function g(t){var r=a,n=o;return a=o=i,d=t,c=e.apply(n,r)}function w(e){var r=e-u,n=e-d;return u===i||r>=t||r<0||p&&n>=s}function m(){var e,i,r,n=am();if(w(n))return b(n);l=nR(m,(e=n-u,i=n-d,r=t-e,p?t3(r,s-i):r))}function b(e){return l=i,f&&a?g(e):(a=o=i,c)}function v(){var e,r=am(),n=w(r);if(a=arguments,o=this,u=r,n){if(l===i)return d=e=u,l=nR(m,t),h?g(e):c;if(p)return rD(l),l=nR(m,t),g(u)}return l===i&&(l=nR(m,t)),c}return t=a8(t)||0,aF(n)&&(h=!!n.leading,s=(p="maxWait"in n)?t2(a8(n.maxWait)||0,t):s,f="trailing"in n?!!n.trailing:f),v.cancel=function(){l!==i&&rD(l),d=0,a=u=o=l=i},v.flush=function(){return l===i?c:b(am())},v}var aA=rp(function(e,t){return iL(e,1,t)}),aE=rp(function(e,t,i){return iL(e,a8(t)||0,i)});function a_(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new ek(r);var i=function(){var r=arguments,n=t?t.apply(this,r):r[0],a=i.cache;if(a.has(n))return a.get(n);var o=e.apply(this,r);return i.cache=a.set(n,o)||a,o};return i.cache=new(a_.Cache||iA),i}function ak(e){if("function"!=typeof e)throw new ek(r);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}a_.Cache=iA;var aI=rp(function(e,t){var i=(t=1==t.length&&aD(t[0])?tp(t[0],tP(nd())):tp(iF(t,1),tP(nd()))).length;return rp(function(r){for(var n=-1,a=t3(r.length,i);++n=t}),aM=i4(function(){return arguments}())?i4:function(e){return aZ(e)&&eR.call(e,"callee")&&!eX.call(e,"callee")},aD=eb.isArray,aU=te?tP(te):function(e){return aZ(e)&&iX(e)==_};function a$(e){return null!=e&&az(e.length)&&!aq(e)}function aL(e){return aZ(e)&&a$(e)}var aj=tQ||oY,aB=tt?tP(tt):function(e){return aZ(e)&&iX(e)==h};function aW(e){if(!aZ(e))return!1;var t=iX(e);return t==p||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!aG(e)}function aq(e){if(!aF(e))return!1;var t=iX(e);return t==f||t==g||"[object AsyncFunction]"==t||"[object Proxy]"==t}function aH(e){return"number"==typeof e&&e==a4(e)}function az(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=0x1fffffffffffff}function aF(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function aZ(e){return null!=e&&"object"==typeof e}var aV=ti?tP(ti):function(e){return aZ(e)&&nm(e)==w};function aK(e){return"number"==typeof e||aZ(e)&&iX(e)==m}function aG(e){if(!aZ(e)||iX(e)!=b)return!1;var t=eF(e);if(null===t)return!0;var i=eR.call(t,"constructor")&&t.constructor;return"function"==typeof i&&i instanceof i&&eP.call(i)==eU}var aJ=tr?tP(tr):function(e){return aZ(e)&&iX(e)==y},aY=tn?tP(tn):function(e){return aZ(e)&&nm(e)==x};function aQ(e){return"string"==typeof e||!aD(e)&&aZ(e)&&iX(e)==C}function aX(e){return"symbol"==typeof e||aZ(e)&&iX(e)==A}var a0=ta?tP(ta):function(e){return aZ(e)&&az(e.length)&&!!eY[iX(e)]},a1=r4(rt),a2=r4(function(e,t){return e<=t});function a3(e){if(!e)return[];if(a$(e))return aQ(e)?tF(e):rq(e);if(e4&&e[e4])return function(e){for(var t,i=[];!(t=e.next()).done;)i.push(t.value);return i}(e[e4]());var t=nm(e);return(t==w?tB:t==x?tH:ox)(e)}function a5(e){return e?(e=a8(e))===o||e===-o?(e<0?-1:1)*17976931348623157e292:e==e?e:0:0===e?e:0}function a4(e){var t=a5(e),i=t%1;return t==t?i?t-i:t:0}function a6(e){return e?iD(a4(e),0,0xffffffff):0}function a8(e){if("number"==typeof e)return e;if(aX(e))return s;if(aF(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=aF(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=tN(e);var i=ec.test(e);return i||eu.test(e)?e1(e.slice(2),i?2:8):es.test(e)?s:+e}function a9(e){return rH(e,op(e))}function a7(e){return null==e?"":rA(e)}var oe=rF(function(e,t){if(nk(t)||a$(t)){rH(t,oh(t),e);return}for(var i in t)eR.call(t,i)&&iT(e,i,t[i])}),ot=rF(function(e,t){rH(t,op(t),e)}),oi=rF(function(e,t,i,r){rH(t,op(t),e,r)}),or=rF(function(e,t,i,r){rH(t,oh(t),e,r)}),on=na(iM),oa=rp(function(e,t){e=eA(e);var r=-1,n=t.length,a=n>2?t[2]:i;for(a&&nC(t[0],t[1],a)&&(n=1);++r1),t}),rH(e,ns(e),i),r&&(i=iU(i,7,nr));for(var n=t.length;n--;)r_(i,t[n]);return i}),om=na(function(e,t){return null==e?{}:rc(e,t,function(t,i){return oc(e,i)})});function ob(e,t){if(null==e)return{};var i=tp(ns(e),function(e){return[e]});return t=nd(t),rc(e,i,function(e,i){return t(e,i[0])})}var ov=r7(oh),oy=r7(op);function ox(e){return null==e?[]:tR(e,oh(e))}var oC=rG(function(e,t,i){return t=t.toLowerCase(),e+(i?oA(t):t)});function oA(e){return oP(a7(e).toLowerCase())}function oE(e){return(e=a7(e))&&e.replace(eh,tU).replace(ez,"")}var o_=rG(function(e,t,i){return e+(i?"-":"")+t.toLowerCase()}),ok=rG(function(e,t,i){return e+(i?" ":"")+t.toLowerCase()}),oI=rK("toLowerCase"),oS=rG(function(e,t,i){return e+(i?"_":"")+t.toLowerCase()}),oT=rG(function(e,t,i){return e+(i?" ":"")+oP(t)}),oN=rG(function(e,t,i){return e+(i?" ":"")+t.toUpperCase()}),oP=rK("toUpperCase");function oR(e,t,r){var n;return e=a7(e),(t=r?i:t)===i?(n=e,eK.test(n))?e.match(eZ)||[]:e.match(ei)||[]:e.match(t)||[]}var oO=rp(function(e,t){try{return to(e,i,t)}catch(e){return aW(e)?e:new ey(e)}}),oM=na(function(e,t){return tc(t,function(t){iO(e,t=nL(t),ay(e[t],e))}),e});function oD(e){return function(){return e}}var oU=rQ(),o$=rQ(!0);function oL(e){return e}function oj(e){return i7("function"==typeof e?e:iU(e,1))}var oB=rp(function(e,t){return function(i){return i5(i,e,t)}}),oW=rp(function(e,t){return function(i){return i5(e,i,t)}});function oq(e,t,i){var r=oh(t),n=iJ(t,r);null!=i||aF(t)&&(n.length||!r.length)||(i=t,t=e,e=this,n=iJ(t,oh(t)));var a=!(aF(i)&&"chain"in i)||!!i.chain,o=aq(e);return tc(n,function(i){var r=t[i];e[i]=r,o&&(e.prototype[i]=function(){var t=this.__chain__;if(a||t){var i=e(this.__wrapped__);return(i.__actions__=rq(this.__actions__)).push({func:r,args:arguments,thisArg:e}),i.__chain__=t,i}return r.apply(e,tf([this.value()],arguments))})}),e}function oH(){}var oz=r2(tp),oF=r2(tl),oZ=r2(tm);function oV(e){return nA(e)?t_(nL(e)):function(t){return iY(t,e)}}var oK=r5(),oG=r5(!0);function oJ(){return[]}function oY(){return!1}var oQ=r1(function(e,t){return e+t},0),oX=r8("ceil"),o0=r1(function(e,t){return e/t},1),o1=r8("floor"),o2=r1(function(e,t){return e*t},1),o3=r8("round"),o5=r1(function(e,t){return e-t},0);return iw.after=function(e,t){if("function"!=typeof t)throw new ek(r);return e=a4(e),function(){if(--e<1)return t.apply(this,arguments)}},iw.ary=ab,iw.assign=oe,iw.assignIn=ot,iw.assignInWith=oi,iw.assignWith=or,iw.at=on,iw.before=av,iw.bind=ay,iw.bindAll=oM,iw.bindKey=ax,iw.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return aD(e)?e:[e]},iw.chain=ar,iw.chunk=function(e,t,r){t=(r?nC(e,t,r):t===i)?1:t2(a4(t),0);var n=null==e?0:e.length;if(!n||t<1)return[];for(var a=0,o=0,s=eb(tG(n/t));aa?0:a+r),(n=n===i||n>a?a:a4(n))<0&&(n+=a),n=r>n?0:a6(n);r>>0)?(e=a7(e))&&("string"==typeof t||null!=t&&!aJ(t))&&!(t=rA(t))&&tj(e)?rM(tF(e),0,r):e.split(t,r):[]},iw.spread=function(e,t){if("function"!=typeof e)throw new ek(r);return t=null==t?0:t2(a4(t),0),rp(function(i){var r=i[t],n=rM(i,0,t);return r&&tf(n,r),to(e,this,n)})},iw.tail=function(e){var t=null==e?0:e.length;return t?rm(e,1,t):[]},iw.take=function(e,t,r){return e&&e.length?rm(e,0,(t=r||t===i?1:a4(t))<0?0:t):[]},iw.takeRight=function(e,t,r){var n=null==e?0:e.length;return n?rm(e,(t=n-(t=r||t===i?1:a4(t)))<0?0:t,n):[]},iw.takeRightWhile=function(e,t){return e&&e.length?rI(e,nd(t,3),!1,!0):[]},iw.takeWhile=function(e,t){return e&&e.length?rI(e,nd(t,3)):[]},iw.tap=function(e,t){return t(e),e},iw.throttle=function(e,t,i){var n=!0,a=!0;if("function"!=typeof e)throw new ek(r);return aF(i)&&(n="leading"in i?!!i.leading:n,a="trailing"in i?!!i.trailing:a),aC(e,t,{leading:n,maxWait:t,trailing:a})},iw.thru=an,iw.toArray=a3,iw.toPairs=ov,iw.toPairsIn=oy,iw.toPath=function(e){return aD(e)?tp(e,nL):aX(e)?[e]:rq(n$(a7(e)))},iw.toPlainObject=a9,iw.transform=function(e,t,i){var r=aD(e),n=r||aj(e)||a0(e);if(t=nd(t,4),null==i){var a=e&&e.constructor;i=n?r?new a:[]:aF(e)&&aq(a)?im(eF(e)):{}}return(n?tc:iK)(e,function(e,r,n){return t(i,e,r,n)}),i},iw.unary=function(e){return ab(e,1)},iw.union=n2,iw.unionBy=n3,iw.unionWith=n5,iw.uniq=function(e){return e&&e.length?rE(e):[]},iw.uniqBy=function(e,t){return e&&e.length?rE(e,nd(t,2)):[]},iw.uniqWith=function(e,t){return t="function"==typeof t?t:i,e&&e.length?rE(e,i,t):[]},iw.unset=function(e,t){return null==e||r_(e,t)},iw.unzip=n4,iw.unzipWith=n6,iw.update=function(e,t,i){return null==e?e:rk(e,t,rR(i))},iw.updateWith=function(e,t,r,n){return n="function"==typeof n?n:i,null==e?e:rk(e,t,rR(r),n)},iw.values=ox,iw.valuesIn=function(e){return null==e?[]:tR(e,op(e))},iw.without=n8,iw.words=oR,iw.wrap=function(e,t){return aS(rR(t),e)},iw.xor=n9,iw.xorBy=n7,iw.xorWith=ae,iw.zip=at,iw.zipObject=function(e,t){return rN(e||[],t||[],iT)},iw.zipObjectDeep=function(e,t){return rN(e||[],t||[],rf)},iw.zipWith=ai,iw.entries=ov,iw.entriesIn=oy,iw.extend=ot,iw.extendWith=oi,oq(iw,iw),iw.add=oQ,iw.attempt=oO,iw.camelCase=oC,iw.capitalize=oA,iw.ceil=oX,iw.clamp=function(e,t,r){return r===i&&(r=t,t=i),r!==i&&(r=(r=a8(r))==r?r:0),t!==i&&(t=(t=a8(t))==t?t:0),iD(a8(e),t,r)},iw.clone=function(e){return iU(e,4)},iw.cloneDeep=function(e){return iU(e,5)},iw.cloneDeepWith=function(e,t){return iU(e,5,t="function"==typeof t?t:i)},iw.cloneWith=function(e,t){return iU(e,4,t="function"==typeof t?t:i)},iw.conformsTo=function(e,t){return null==t||i$(e,t,oh(t))},iw.deburr=oE,iw.defaultTo=function(e,t){return null==e||e!=e?t:e},iw.divide=o0,iw.endsWith=function(e,t,r){e=a7(e),t=rA(t);var n=e.length,a=r=r===i?n:iD(a4(r),0,n);return(r-=t.length)>=0&&e.slice(r,a)==t},iw.eq=aP,iw.escape=function(e){return(e=a7(e))&&q.test(e)?e.replace(B,t$):e},iw.escapeRegExp=function(e){return(e=a7(e))&&J.test(e)?e.replace(G,"\\$&"):e},iw.every=function(e,t,r){var n=aD(e)?tl:iq;return r&&nC(e,t,r)&&(t=i),n(e,nd(t,3))},iw.find=as,iw.findIndex=nz,iw.findKey=function(e,t){return tv(e,nd(t,3),iK)},iw.findLast=ac,iw.findLastIndex=nF,iw.findLastKey=function(e,t){return tv(e,nd(t,3),iG)},iw.floor=o1,iw.forEach=al,iw.forEachRight=au,iw.forIn=function(e,t){return null==e?e:iZ(e,nd(t,3),op)},iw.forInRight=function(e,t){return null==e?e:iV(e,nd(t,3),op)},iw.forOwn=function(e,t){return e&&iK(e,nd(t,3))},iw.forOwnRight=function(e,t){return e&&iG(e,nd(t,3))},iw.get=os,iw.gt=aR,iw.gte=aO,iw.has=function(e,t){return null!=e&&nb(e,t,i1)},iw.hasIn=oc,iw.head=nV,iw.identity=oL,iw.includes=function(e,t,i,r){e=a$(e)?e:ox(e),i=i&&!r?a4(i):0;var n=e.length;return i<0&&(i=t2(n+i,0)),aQ(e)?i<=n&&e.indexOf(t,i)>-1:!!n&&tx(e,t,i)>-1},iw.indexOf=function(e,t,i){var r=null==e?0:e.length;if(!r)return -1;var n=null==i?0:a4(i);return n<0&&(n=t2(r+n,0)),tx(e,t,n)},iw.inRange=function(e,t,r){var n,a,o;return t=a5(t),r===i?(r=t,t=0):r=a5(r),(n=e=a8(e))>=t3(a=t,o=r)&&n=-0x1fffffffffffff&&e<=0x1fffffffffffff},iw.isSet=aY,iw.isString=aQ,iw.isSymbol=aX,iw.isTypedArray=a0,iw.isUndefined=function(e){return e===i},iw.isWeakMap=function(e){return aZ(e)&&nm(e)==E},iw.isWeakSet=function(e){return aZ(e)&&"[object WeakSet]"==iX(e)},iw.join=function(e,t){return null==e?"":t0.call(e,t)},iw.kebabCase=o_,iw.last=nY,iw.lastIndexOf=function(e,t,r){var n=null==e?0:e.length;if(!n)return -1;var a=n;return r!==i&&(a=(a=a4(r))<0?t2(n+a,0):t3(a,n-1)),t==t?function(e,t,i){for(var r=i+1;r--&&e[r]!==t;);return r}(e,t,a):ty(e,tA,a,!0)},iw.lowerCase=ok,iw.lowerFirst=oI,iw.lt=a1,iw.lte=a2,iw.max=function(e){return e&&e.length?iH(e,oL,i0):i},iw.maxBy=function(e,t){return e&&e.length?iH(e,nd(t,2),i0):i},iw.mean=function(e){return tE(e,oL)},iw.meanBy=function(e,t){return tE(e,nd(t,2))},iw.min=function(e){return e&&e.length?iH(e,oL,rt):i},iw.minBy=function(e,t){return e&&e.length?iH(e,nd(t,2),rt):i},iw.stubArray=oJ,iw.stubFalse=oY,iw.stubObject=function(){return{}},iw.stubString=function(){return""},iw.stubTrue=function(){return!0},iw.multiply=o2,iw.nth=function(e,t){return e&&e.length?ro(e,a4(t)):i},iw.noConflict=function(){return e5._===this&&(e5._=e$),this},iw.noop=oH,iw.now=am,iw.pad=function(e,t,i){e=a7(e);var r=(t=a4(t))?tz(e):0;if(!t||r>=t)return e;var n=(t-r)/2;return r3(tJ(n),i)+e+r3(tG(n),i)},iw.padEnd=function(e,t,i){e=a7(e);var r=(t=a4(t))?tz(e):0;return t&&rt){var n=e;e=t,t=n}if(r||e%1||t%1){var a=t6();return t3(e+a*(t-e+e0("1e-"+((a+"").length-1))),t)}return rd(e,t)},iw.reduce=function(e,t,i){var r=aD(e)?tg:tI,n=arguments.length<3;return r(e,nd(t,4),i,n,iB)},iw.reduceRight=function(e,t,i){var r=aD(e)?tw:tI,n=arguments.length<3;return r(e,nd(t,4),i,n,iW)},iw.repeat=function(e,t,r){return t=(r?nC(e,t,r):t===i)?1:a4(t),rh(a7(e),t)},iw.replace=function(){var e=arguments,t=a7(e[0]);return e.length<3?t:t.replace(e[1],e[2])},iw.result=function(e,t,r){t=rO(t,e);var n=-1,a=t.length;for(a||(a=1,e=i);++n0x1fffffffffffff)return[];var i=0xffffffff,r=t3(e,0xffffffff);t=nd(t),e-=0xffffffff;for(var n=tT(r,t);++i=o)return e;var c=r-tz(n);if(c<1)return n;var l=s?rM(s,0,c).join(""):e.slice(0,c);if(a===i)return l+n;if(s&&(c+=l.length-c),aJ(a)){if(e.slice(c).search(a)){var u,d=l;for(a.global||(a=eE(a.source,a7(eo.exec(a))+"g")),a.lastIndex=0;u=a.exec(d);)var h=u.index;l=l.slice(0,h===i?c:h)}}else if(e.indexOf(rA(a),c)!=c){var p=l.lastIndexOf(a);p>-1&&(l=l.slice(0,p))}return l+n},iw.unescape=function(e){return(e=a7(e))&&W.test(e)?e.replace(j,tV):e},iw.uniqueId=function(e){var t=++eO;return a7(e)+t},iw.upperCase=oN,iw.upperFirst=oP,iw.each=al,iw.eachRight=au,iw.first=nV,oq(iw,(em={},iK(iw,function(e,t){eR.call(iw.prototype,t)||(em[t]=e)}),em),{chain:!1}),iw.VERSION="4.17.21",tc(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){iw[e].placeholder=iw}),tc(["drop","take"],function(e,t){iy.prototype[e]=function(r){r=r===i?1:t2(a4(r),0);var n=this.__filtered__&&!t?new iy(this):this.clone();return n.__filtered__?n.__takeCount__=t3(r,n.__takeCount__):n.__views__.push({size:t3(r,0xffffffff),type:e+(n.__dir__<0?"Right":"")}),n},iy.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}}),tc(["filter","map","takeWhile"],function(e,t){var i=t+1,r=1==i||3==i;iy.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:nd(e,3),type:i}),t.__filtered__=t.__filtered__||r,t}}),tc(["head","last"],function(e,t){var i="take"+(t?"Right":"");iy.prototype[e]=function(){return this[i](1).value()[0]}}),tc(["initial","tail"],function(e,t){var i="drop"+(t?"":"Right");iy.prototype[e]=function(){return this.__filtered__?new iy(this):this[i](1)}}),iy.prototype.compact=function(){return this.filter(oL)},iy.prototype.find=function(e){return this.filter(e).head()},iy.prototype.findLast=function(e){return this.reverse().find(e)},iy.prototype.invokeMap=rp(function(e,t){return"function"==typeof e?new iy(this):this.map(function(i){return i5(i,e,t)})}),iy.prototype.reject=function(e){return this.filter(ak(nd(e)))},iy.prototype.slice=function(e,t){e=a4(e);var r=this;return r.__filtered__&&(e>0||t<0)?new iy(r):(e<0?r=r.takeRight(-e):e&&(r=r.drop(e)),t!==i&&(r=(t=a4(t))<0?r.dropRight(-t):r.take(t-e)),r)},iy.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},iy.prototype.toArray=function(){return this.take(0xffffffff)},iK(iy.prototype,function(e,t){var r=/^(?:filter|find|map|reject)|While$/.test(t),n=/^(?:head|last)$/.test(t),a=iw[n?"take"+("last"==t?"Right":""):t],o=n||/^find/.test(t);a&&(iw.prototype[t]=function(){var t=this.__wrapped__,s=n?[1]:arguments,c=t instanceof iy,l=s[0],u=c||aD(t),d=function(e){var t=a.apply(iw,tf([e],s));return n&&h?t[0]:t};u&&r&&"function"==typeof l&&1!=l.length&&(c=u=!1);var h=this.__chain__,p=!!this.__actions__.length,f=o&&!h,g=c&&!p;if(!o&&u){t=g?t:new iy(this);var w=e.apply(t,s);return w.__actions__.push({func:an,args:[d],thisArg:i}),new iv(w,h)}return f&&g?e.apply(this,s):(w=this.thru(d),f?n?w.value()[0]:w.value():w)})}),tc(["pop","push","shift","sort","splice","unshift"],function(e){var t=eI[e],i=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",r=/^(?:pop|shift)$/.test(e);iw.prototype[e]=function(){var e=arguments;if(r&&!this.__chain__){var n=this.value();return t.apply(aD(n)?n:[],e)}return this[i](function(i){return t.apply(aD(i)?i:[],e)})}}),iK(iy.prototype,function(e,t){var i=iw[t];if(i){var r=i.name+"";eR.call(io,r)||(io[r]=[]),io[r].push({name:t,func:i})}}),io[rX(i,2).name]=[{name:"wrapper",func:i}],iy.prototype.clone=function(){var e=new iy(this.__wrapped__);return e.__actions__=rq(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=rq(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=rq(this.__views__),e},iy.prototype.reverse=function(){if(this.__filtered__){var e=new iy(this);e.__dir__=-1,e.__filtered__=!0}else e=this.clone(),e.__dir__*=-1;return e},iy.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,i=aD(e),r=t<0,n=i?e.length:0,a=function(e,t,i){for(var r=-1,n=i.length;++r=this.__values__.length,t=e?i:this.__values__[this.__index__++];return{done:e,value:t}},iw.prototype.plant=function(e){for(var t,r=this;r instanceof ib;){var n=nB(r);n.__index__=0,n.__values__=i,t?a.__wrapped__=n:t=n;var a=n;r=r.__wrapped__}return a.__wrapped__=e,t},iw.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof iy){var t=e;return this.__actions__.length&&(t=new iy(this)),(t=t.reverse()).__actions__.push({func:an,args:[n1],thisArg:i}),new iv(t,this.__chain__)}return this.thru(n1)},iw.prototype.toJSON=iw.prototype.valueOf=iw.prototype.value=function(){return rS(this.__wrapped__,this.__actions__)},iw.prototype.first=iw.prototype.head,e4&&(iw.prototype[e4]=function(){return this}),iw}();e6?((e6.exports=tK)._=tK,e4._=tK):e5._=tK}).call(rv)}(ry,ry.exports);var rx=Object.defineProperty,rC=Object.defineProperties,rA=Object.getOwnPropertyDescriptors,rE=Object.getOwnPropertySymbols,r_=Object.prototype.hasOwnProperty,rk=Object.prototype.propertyIsEnumerable,rI=(e,t,i)=>t in e?rx(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,rS=(e,t)=>{for(var i in t||(t={}))r_.call(t,i)&&rI(e,i,t[i]);if(rE)for(var i of rE(t))rk.call(t,i)&&rI(e,i,t[i]);return e},rT=(e,t)=>rC(e,rA(t));function rN(e,t,i){var r;let n=(0,Q._Yb)(e);return(null==(r=t.rpcMap)?void 0:r[n.reference])||`${rg}?chainId=${n.namespace}:${n.reference}&projectId=${i}`}function rP(e){return e.includes(":")?e.split(":")[1]:e}function rR(e){return e.map(e=>`${e.split(":")[0]}:${e.split(":")[1]}`)}function rO(e={},t={}){let i=rM(e),r=rM(t);return ry.exports.merge(i,r)}function rM(e){var t,i,r,n;let a={};if(!(0,Q.aF0)(e))return a;for(let[o,s]of Object.entries(e)){let e=(0,Q.nWe)(o)?[o]:s.chains,c=s.methods||[],l=s.events||[],u=s.rpcMap||{},d=(0,Q.kob)(o);a[d]=rT(rS(rS({},a[d]),s),{chains:(0,Q.TRk)(e,null==(t=a[d])?void 0:t.chains),methods:(0,Q.TRk)(c,null==(i=a[d])?void 0:i.methods),events:(0,Q.TRk)(l,null==(r=a[d])?void 0:r.events),rpcMap:rS(rS({},u),null==(n=a[d])?void 0:n.rpcMap)})}return a}function rD(e){return e.includes(":")?e.split(":")[2]:e}function rU(e){let t={};for(let[i,r]of Object.entries(e)){let e=r.methods||[],n=r.events||[],a=r.accounts||[],o=(0,Q.nWe)(i)?[i]:r.chains?r.chains:rR(r.accounts);t[i]={chains:o,methods:e,events:n,accounts:a}}return t}function r$(e){return"number"==typeof e?e:e.includes("0x")?parseInt(e,16):isNaN(Number(e=e.includes(":")?e.split(":")[1]:e))?e:Number(e)}let rL={},rj=e=>rL[e],rB=(e,t)=>{rL[e]=t};class rW{constructor(e){this.name="polkadot",this.namespace=e.namespace,this.events=rj("events"),this.client=rj("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;let e=this.namespace.chains[0];if(!e)throw Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(rb.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getAccounts(){let e=this.namespace.accounts;return e&&e.filter(e=>e.split(":")[1]===this.chainId.toString()).map(e=>e.split(":")[2])||[]}createHttpProviders(){let e={};return this.namespace.chains.forEach(t=>{var i;let r=rP(t);e[r]=this.createHttpProvider(r,null==(i=this.namespace.rpcMap)?void 0:i[t])}),e}getHttpProvider(){let e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){let i=this.createHttpProvider(e,t);i&&(this.httpProviders[e]=i)}createHttpProvider(e,t){let i=t||rN(e,this.namespace,this.client.core.projectId);if(!i)throw Error(`No RPC url provided for chainId: ${e}`);return new eA(new rh(i,rj("disableProviderPing")))}}var rq=Object.defineProperty,rH=Object.defineProperties,rz=Object.getOwnPropertyDescriptors,rF=Object.getOwnPropertySymbols,rZ=Object.prototype.hasOwnProperty,rV=Object.prototype.propertyIsEnumerable,rK=(e,t,i)=>t in e?rq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,rG=(e,t)=>{for(var i in t||(t={}))rZ.call(t,i)&&rK(e,i,t[i]);if(rF)for(var i of rF(t))rV.call(t,i)&&rK(e,i,t[i]);return e},rJ=(e,t)=>rH(e,rz(t));class rY{constructor(e){this.name="eip155",this.namespace=e.namespace,this.events=rj("events"),this.client=rj("client"),this.httpProviders=this.createHttpProviders(),this.chainId=parseInt(this.getDefaultChain())}async request(e){switch(e.request.method){case"eth_requestAccounts":case"eth_accounts":return this.getAccounts();case"wallet_switchEthereumChain":return await this.handleSwitchChain(e);case"eth_chainId":return parseInt(this.getDefaultChain());case"wallet_getCapabilities":return await this.getCapabilities(e);case"wallet_getCallsStatus":return await this.getCallStatus(e)}return this.namespace.methods.includes(e.request.method)?await this.client.request(e):this.getHttpProvider().request(e.request)}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(parseInt(e),t),this.chainId=parseInt(e),this.events.emit(rb.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId.toString();if(this.namespace.defaultChain)return this.namespace.defaultChain;let e=this.namespace.chains[0];if(!e)throw Error("ChainId not found");return e.split(":")[1]}createHttpProvider(e,t){let i=t||rN(`${this.name}:${e}`,this.namespace,this.client.core.projectId);if(!i)throw Error(`No RPC url provided for chainId: ${e}`);return new eA(new rh(i,rj("disableProviderPing")))}setHttpProvider(e,t){let i=this.createHttpProvider(e,t);i&&(this.httpProviders[e]=i)}createHttpProviders(){let e={};return this.namespace.chains.forEach(t=>{var i;let r=parseInt(rP(t));e[r]=this.createHttpProvider(r,null==(i=this.namespace.rpcMap)?void 0:i[t])}),e}getAccounts(){let e=this.namespace.accounts;return e?[...new Set(e.filter(e=>e.split(":")[1]===this.chainId.toString()).map(e=>e.split(":")[2]))]:[]}getHttpProvider(){let e=this.chainId,t=this.httpProviders[e];if(typeof t>"u")throw Error(`JSON-RPC provider for ${e} not found`);return t}async handleSwitchChain(e){var t,i;let r=e.request.params?null==(t=e.request.params[0])?void 0:t.chainId:"0x0",n=parseInt(r=r.startsWith("0x")?r:`0x${r}`,16);if(this.isChainApproved(n))this.setDefaultChain(`${n}`);else if(this.namespace.methods.includes("wallet_switchEthereumChain"))await this.client.request({topic:e.topic,request:{method:e.request.method,params:[{chainId:r}]},chainId:null==(i=this.namespace.chains)?void 0:i[0]}),this.setDefaultChain(`${n}`);else throw Error(`Failed to switch to chain 'eip155:${n}'. The chain is not approved or the wallet does not support 'wallet_switchEthereumChain' method.`);return null}isChainApproved(e){return this.namespace.chains.includes(`${this.name}:${e}`)}async getCapabilities(e){var t,i,r;let n=null==(i=null==(t=e.request)?void 0:t.params)?void 0:i[0];if(!n)throw Error("Missing address parameter in `wallet_getCapabilities` request");let a=this.client.session.get(e.topic),o=(null==(r=a?.sessionProperties)?void 0:r.capabilities)||{};if(null!=o&&o[n])return o?.[n];let s=await this.client.request(e);try{await this.client.session.update(e.topic,{sessionProperties:rJ(rG({},a.sessionProperties||{}),{capabilities:rJ(rG({},o||{}),{[n]:s})})})}catch(e){console.warn("Failed to update session with capabilities",e)}return s}async getCallStatus(e){var t,i;let r=this.client.session.get(e.topic),n=null==(t=r.sessionProperties)?void 0:t.bundler_name;if(n){let t=this.getBundlerUrl(e.chainId,n);try{return await this.getUserOperationReceipt(t,e)}catch(e){console.warn("Failed to fetch call status from bundler",e,t)}}let a=null==(i=r.sessionProperties)?void 0:i.bundler_url;if(a)try{return await this.getUserOperationReceipt(a,e)}catch(e){console.warn("Failed to fetch call status from custom bundler",e,a)}if(this.namespace.methods.includes(e.request.method))return await this.client.request(e);throw Error("Fetching call status not approved by the wallet.")}async getUserOperationReceipt(e,t){var i;let r=new URL(e),n=await fetch(r,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(el("eth_getUserOperationReceipt",[null==(i=t.request.params)?void 0:i[0]]))});if(!n.ok)throw Error(`Failed to fetch user operation receipt - ${n.status}`);return await n.json()}getBundlerUrl(e,t){return`${rm}?projectId=${this.client.core.projectId}&chainId=${e}&bundler=${t}`}}class rQ{constructor(e){this.name="solana",this.namespace=e.namespace,this.events=rj("events"),this.client=rj("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(rb.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;let e=this.namespace.chains[0];if(!e)throw Error("ChainId not found");return e.split(":")[1]}getAccounts(){let e=this.namespace.accounts;return e?[...new Set(e.filter(e=>e.split(":")[1]===this.chainId.toString()).map(e=>e.split(":")[2]))]:[]}createHttpProviders(){let e={};return this.namespace.chains.forEach(t=>{var i;let r=rP(t);e[r]=this.createHttpProvider(r,null==(i=this.namespace.rpcMap)?void 0:i[t])}),e}getHttpProvider(){let e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){let i=this.createHttpProvider(e,t);i&&(this.httpProviders[e]=i)}createHttpProvider(e,t){let i=t||rN(e,this.namespace,this.client.core.projectId);if(!i)throw Error(`No RPC url provided for chainId: ${e}`);return new eA(new rh(i,rj("disableProviderPing")))}}class rX{constructor(e){this.name="cosmos",this.namespace=e.namespace,this.events=rj("events"),this.client=rj("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;let e=this.namespace.chains[0];if(!e)throw Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(rb.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){let e=this.namespace.accounts;return e?[...new Set(e.filter(e=>e.split(":")[1]===this.chainId.toString()).map(e=>e.split(":")[2]))]:[]}createHttpProviders(){let e={};return this.namespace.chains.forEach(t=>{var i;let r=rP(t);e[r]=this.createHttpProvider(r,null==(i=this.namespace.rpcMap)?void 0:i[t])}),e}getHttpProvider(){let e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){let i=this.createHttpProvider(e,t);i&&(this.httpProviders[e]=i)}createHttpProvider(e,t){let i=t||rN(e,this.namespace,this.client.core.projectId);if(!i)throw Error(`No RPC url provided for chainId: ${e}`);return new eA(new rh(i,rj("disableProviderPing")))}}class r0{constructor(e){this.name="algorand",this.namespace=e.namespace,this.events=rj("events"),this.client=rj("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){if(!this.httpProviders[e]){let i=t||rN(`${this.name}:${e}`,this.namespace,this.client.core.projectId);if(!i)throw Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,i)}this.chainId=e,this.events.emit(rb.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;let e=this.namespace.chains[0];if(!e)throw Error("ChainId not found");return e.split(":")[1]}getAccounts(){let e=this.namespace.accounts;return e?[...new Set(e.filter(e=>e.split(":")[1]===this.chainId.toString()).map(e=>e.split(":")[2]))]:[]}createHttpProviders(){let e={};return this.namespace.chains.forEach(t=>{var i;e[t]=this.createHttpProvider(t,null==(i=this.namespace.rpcMap)?void 0:i[t])}),e}getHttpProvider(){let e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){let i=this.createHttpProvider(e,t);i&&(this.httpProviders[e]=i)}createHttpProvider(e,t){let i=t||rN(e,this.namespace,this.client.core.projectId);return typeof i>"u"?void 0:new eA(new rh(i,rj("disableProviderPing")))}}class r1{constructor(e){this.name="cip34",this.namespace=e.namespace,this.events=rj("events"),this.client=rj("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;let e=this.namespace.chains[0];if(!e)throw Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(rb.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){let e=this.namespace.accounts;return e?[...new Set(e.filter(e=>e.split(":")[1]===this.chainId.toString()).map(e=>e.split(":")[2]))]:[]}createHttpProviders(){let e={};return this.namespace.chains.forEach(t=>{let i=this.getCardanoRPCUrl(t),r=rP(t);e[r]=this.createHttpProvider(r,i)}),e}getHttpProvider(){let e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw Error(`JSON-RPC provider for ${e} not found`);return t}getCardanoRPCUrl(e){let t=this.namespace.rpcMap;if(t)return t[e]}setHttpProvider(e,t){let i=this.createHttpProvider(e,t);i&&(this.httpProviders[e]=i)}createHttpProvider(e,t){let i=t||this.getCardanoRPCUrl(e);if(!i)throw Error(`No RPC url provided for chainId: ${e}`);return new eA(new rh(i,rj("disableProviderPing")))}}class r2{constructor(e){this.name="elrond",this.namespace=e.namespace,this.events=rj("events"),this.client=rj("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(rb.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;let e=this.namespace.chains[0];if(!e)throw Error("ChainId not found");return e.split(":")[1]}getAccounts(){let e=this.namespace.accounts;return e?[...new Set(e.filter(e=>e.split(":")[1]===this.chainId.toString()).map(e=>e.split(":")[2]))]:[]}createHttpProviders(){let e={};return this.namespace.chains.forEach(t=>{var i;let r=rP(t);e[r]=this.createHttpProvider(r,null==(i=this.namespace.rpcMap)?void 0:i[t])}),e}getHttpProvider(){let e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){let i=this.createHttpProvider(e,t);i&&(this.httpProviders[e]=i)}createHttpProvider(e,t){let i=t||rN(e,this.namespace,this.client.core.projectId);if(!i)throw Error(`No RPC url provided for chainId: ${e}`);return new eA(new rh(i,rj("disableProviderPing")))}}class r3{constructor(e){this.name="multiversx",this.namespace=e.namespace,this.events=rj("events"),this.client=rj("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(rb.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;let e=this.namespace.chains[0];if(!e)throw Error("ChainId not found");return e.split(":")[1]}getAccounts(){let e=this.namespace.accounts;return e?[...new Set(e.filter(e=>e.split(":")[1]===this.chainId.toString()).map(e=>e.split(":")[2]))]:[]}createHttpProviders(){let e={};return this.namespace.chains.forEach(t=>{var i;let r=rP(t);e[r]=this.createHttpProvider(r,null==(i=this.namespace.rpcMap)?void 0:i[t])}),e}getHttpProvider(){let e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){let i=this.createHttpProvider(e,t);i&&(this.httpProviders[e]=i)}createHttpProvider(e,t){let i=t||rN(e,this.namespace,this.client.core.projectId);if(!i)throw Error(`No RPC url provided for chainId: ${e}`);return new eA(new rh(i,rj("disableProviderPing")))}}class r5{constructor(e){this.name="near",this.namespace=e.namespace,this.events=rj("events"),this.client=rj("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;let e=this.namespace.chains[0];if(!e)throw Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){if(this.chainId=e,!this.httpProviders[e]){let i=t||rN(`${this.name}:${e}`,this.namespace);if(!i)throw Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,i)}this.events.emit(rb.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){let e=this.namespace.accounts;return e&&e.filter(e=>e.split(":")[1]===this.chainId.toString()).map(e=>e.split(":")[2])||[]}createHttpProviders(){let e={};return this.namespace.chains.forEach(t=>{var i;e[t]=this.createHttpProvider(t,null==(i=this.namespace.rpcMap)?void 0:i[t])}),e}getHttpProvider(){let e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){let i=this.createHttpProvider(e,t);i&&(this.httpProviders[e]=i)}createHttpProvider(e,t){let i=t||rN(e,this.namespace);return typeof i>"u"?void 0:new eA(new rh(i,rj("disableProviderPing")))}}class r4{constructor(e){this.name=rw,this.namespace=e.namespace,this.events=rj("events"),this.client=rj("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace.chains=[...new Set((this.namespace.chains||[]).concat(e.chains||[]))],this.namespace.accounts=[...new Set((this.namespace.accounts||[]).concat(e.accounts||[]))],this.namespace.methods=[...new Set((this.namespace.methods||[]).concat(e.methods||[]))],this.namespace.events=[...new Set((this.namespace.events||[]).concat(e.events||[]))],this.httpProviders=this.createHttpProviders()}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider(e.chainId).request(e.request)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(rb.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;let e=this.namespace.chains[0];if(!e)throw Error("ChainId not found");return e.split(":")[1]}getAccounts(){let e=this.namespace.accounts;return e?[...new Set(e.filter(e=>e.split(":")[1]===this.chainId.toString()).map(e=>e.split(":")[2]))]:[]}createHttpProviders(){var e,t;let i={};return null==(t=null==(e=this.namespace)?void 0:e.accounts)||t.forEach(e=>{let t=(0,Q._Yb)(e);i[`${t.namespace}:${t.reference}`]=this.createHttpProvider(e)}),i}getHttpProvider(e){let t=this.httpProviders[e];if(typeof t>"u")throw Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){let i=this.createHttpProvider(e,t);i&&(this.httpProviders[e]=i)}createHttpProvider(e,t){let i=t||rN(e,this.namespace,this.client.core.projectId);if(!i)throw Error(`No RPC url provided for chainId: ${e}`);return new eA(new rh(i,rj("disableProviderPing")))}}var r6=Object.defineProperty,r8=Object.defineProperties,r9=Object.getOwnPropertyDescriptors,r7=Object.getOwnPropertySymbols,ne=Object.prototype.hasOwnProperty,nt=Object.prototype.propertyIsEnumerable,ni=(e,t,i)=>t in e?r6(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,nr=(e,t)=>{for(var i in t||(t={}))ne.call(t,i)&&ni(e,i,t[i]);if(r7)for(var i of r7(t))nt.call(t,i)&&ni(e,i,t[i]);return e},nn=(e,t)=>r8(e,r9(t));class na{constructor(e){this.events=new(a()),this.rpcProviders={},this.shouldAbortPairingAttempt=!1,this.maxPairingAttempts=10,this.disableProviderPing=!1,this.providerOpts=e,this.logger="u">typeof e?.logger&&"string"!=typeof e?.logger?e.logger:(0,$.h6)((0,$.iP)({level:e?.logger||rp})),this.disableProviderPing=e?.disableProviderPing||!1}static async init(e){let t=new na(e);return await t.initialize(),t}async request(e,t,i){let[r,n]=this.validateChain(t);if(!this.session)throw Error("Please call connect() before request()");return await this.getProvider(r).request({request:nr({},e),chainId:`${r}:${n}`,topic:this.session.topic,expiry:i})}sendAsync(e,t,i,r){let n=new Date().getTime();this.request(e,i,r).then(e=>t(null,eu(n,e))).catch(e=>t(e,void 0))}async enable(){if(!this.client)throw 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 e;if(!this.session)throw Error("Please call connect() before enable()");await this.client.disconnect({topic:null==(e=this.session)?void 0:e.topic,reason:(0,Q.Hjj)("USER_DISCONNECTED")}),await this.cleanup()}async connect(e){if(!this.client)throw Error("Sign Client not initialized");if(this.setNamespaces(e),await this.cleanupPendingPairings(),!e.skipPairing)return await this.pair(e.pairingTopic)}async authenticate(e,t){if(!this.client)throw Error("Sign Client not initialized");this.setNamespaces(e),await this.cleanupPendingPairings();let{uri:i,response:r}=await this.client.authenticate(e,t);i&&(this.uri=i,this.events.emit("display_uri",i));let n=await r();if(this.session=n.session,this.session){let e=rU(this.session.namespaces);this.namespaces=rO(this.namespaces,e),this.persist("namespaces",this.namespaces),this.onConnect()}return n}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}removeListener(e,t){this.events.removeListener(e,t)}off(e,t){this.events.off(e,t)}get isWalletConnect(){return!0}async pair(e){this.shouldAbortPairingAttempt=!1;let t=0;do{if(this.shouldAbortPairingAttempt)throw Error("Pairing aborted");if(t>=this.maxPairingAttempts)throw Error("Max auto pairing attempts reached");let{uri:i,approval:r}=await this.client.connect({pairingTopic:e,requiredNamespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties});i&&(this.uri=i,this.events.emit("display_uri",i)),await r().then(e=>{this.session=e;let t=rU(e.namespaces);this.namespaces=rO(this.namespaces,t),this.persist("namespaces",this.namespaces)}).catch(e=>{if(e.message!==iL)throw e;t++})}while(!this.session);return this.onConnect(),this.session}setDefaultChain(e,t){try{if(!this.session)return;let[i,r]=this.validateChain(e),n=this.getProvider(i);n.name===rw?n.setDefaultChain(`${i}:${r}`,t):n.setDefaultChain(r,t)}catch(e){if(!/Please call connect/.test(e.message))throw e}}async cleanupPendingPairings(e={}){this.logger.info("Cleaning up inactive pairings...");let t=this.client.pairing.getAll();if((0,Q.OP1)(t)){for(let i of t)e.deletePairings?this.client.core.expirer.set(i.topic,0):await this.client.core.relayer.subscriber.unsubscribe(i.topic);this.logger.info(`Inactive pairings cleared: ${t.length}`)}}abortPairingAttempt(){this.shouldAbortPairingAttempt=!0}async checkStorage(){if(this.namespaces=await this.getFromStore("namespaces"),this.optionalNamespaces=await this.getFromStore("optionalNamespaces")||{},this.client.session.length){let e=this.client.session.keys.length-1;this.session=this.client.session.get(this.client.session.keys[e]),this.createProviders()}}async initialize(){this.logger.trace("Initialized"),await this.createClient(),await this.checkStorage(),this.registerEventListeners()}async createClient(){this.client=this.providerOpts.client||await i7.init({core:this.providerOpts.core,logger:this.providerOpts.logger||rp,relayUrl:this.providerOpts.relayUrl||"wss://relay.walletconnect.org",projectId:this.providerOpts.projectId,metadata:this.providerOpts.metadata,storageOptions:this.providerOpts.storageOptions,storage:this.providerOpts.storage,name:this.providerOpts.name,customStoragePrefix:this.providerOpts.customStoragePrefix,telemetryEnabled:this.providerOpts.telemetryEnabled}),this.logger.trace("SignClient Initialized")}createProviders(){if(!this.client)throw Error("Sign Client not initialized");if(!this.session)throw Error("Session not initialized. Please call connect() before enable()");let e=[...new Set(Object.keys(this.session.namespaces).map(e=>(0,Q.kob)(e)))];rB("client",this.client),rB("events",this.events),rB("disableProviderPing",this.disableProviderPing),e.forEach(e=>{if(!this.session)return;let t=function(e,t){let i=Object.keys(t.namespaces).filter(t=>t.includes(e));if(!i.length)return[];let r=[];return i.forEach(e=>{let i=t.namespaces[e].accounts;r.push(...i)}),r}(e,this.session),i=rR(t),r=nn(nr({},rO(this.namespaces,this.optionalNamespaces)[e]),{accounts:t,chains:i});switch(e){case"eip155":this.rpcProviders[e]=new rY({namespace:r});break;case"algorand":this.rpcProviders[e]=new r0({namespace:r});break;case"solana":this.rpcProviders[e]=new rQ({namespace:r});break;case"cosmos":this.rpcProviders[e]=new rX({namespace:r});break;case"polkadot":this.rpcProviders[e]=new rW({namespace:r});break;case"cip34":this.rpcProviders[e]=new r1({namespace:r});break;case"elrond":this.rpcProviders[e]=new r2({namespace:r});break;case"multiversx":this.rpcProviders[e]=new r3({namespace:r});break;case"near":this.rpcProviders[e]=new r5({namespace:r});break;default:this.rpcProviders[rw]?this.rpcProviders[rw].updateNamespace(r):this.rpcProviders[rw]=new r4({namespace:r})}})}registerEventListeners(){if(typeof this.client>"u")throw Error("Sign Client is not initialized");this.client.on("session_ping",e=>{this.events.emit("session_ping",e)}),this.client.on("session_event",e=>{let{params:t}=e,{event:i}=t;if("accountsChanged"===i.name){let e=i.data;e&&(0,Q.OP1)(e)&&this.events.emit("accountsChanged",e.map(rD))}else if("chainChanged"===i.name){let e=t.chainId,i=t.event.data,r=(0,Q.kob)(e),n=r$(e)!==r$(i)?`${r}:${r$(i)}`:e;this.onChainChanged(n)}else this.events.emit(i.name,i.data);this.events.emit("session_event",e)}),this.client.on("session_update",({topic:e,params:t})=>{var i;let{namespaces:r}=t,n=null==(i=this.client)?void 0:i.session.get(e);this.session=nn(nr({},n),{namespaces:r}),this.onSessionUpdate(),this.events.emit("session_update",{topic:e,params:t})}),this.client.on("session_delete",async e=>{await this.cleanup(),this.events.emit("session_delete",e),this.events.emit("disconnect",nn(nr({},(0,Q.Hjj)("USER_DISCONNECTED")),{data:e.topic}))}),this.on(rb.DEFAULT_CHAIN_CHANGED,e=>{this.onChainChanged(e,!0)})}getProvider(e){return this.rpcProviders[e]||this.rpcProviders[rw]}onSessionUpdate(){Object.keys(this.rpcProviders).forEach(e=>{var t;this.getProvider(e).updateNamespace(null==(t=this.session)?void 0:t.namespaces[e])})}setNamespaces(e){let{namespaces:t,optionalNamespaces:i,sessionProperties:r}=e;t&&Object.keys(t).length&&(this.namespaces=t),i&&Object.keys(i).length&&(this.optionalNamespaces=i),this.sessionProperties=r,this.persist("namespaces",t),this.persist("optionalNamespaces",i)}validateChain(e){let[t,i]=e?.split(":")||["",""];if(!this.namespaces||!Object.keys(this.namespaces).length)return[t,i];if(t&&!Object.keys(this.namespaces||{}).map(e=>(0,Q.kob)(e)).includes(t))throw Error(`Namespace '${t}' is not configured. Please call connect() first with namespace config.`);if(t&&i)return[t,i];let r=(0,Q.kob)(Object.keys(this.namespaces)[0]),n=this.rpcProviders[r].getDefaultChain();return[r,n]}async requestAccounts(){let[e]=this.validateChain();return await this.getProvider(e).requestAccounts()}onChainChanged(e,t=!1){if(!this.namespaces)return;let[i,r]=this.validateChain(e);r&&(t||this.getProvider(i).setDefaultChain(r),this.namespaces[i]?this.namespaces[i].defaultChain=r:this.namespaces[`${i}:${r}`]?this.namespaces[`${i}:${r}`].defaultChain=r:this.namespaces[`${i}:${r}`]={defaultChain:r},this.persist("namespaces",this.namespaces),this.events.emit("chainChanged",r))}onConnect(){this.createProviders(),this.events.emit("connect",{session:this.session})}async cleanup(){this.session=void 0,this.namespaces=void 0,this.optionalNamespaces=void 0,this.sessionProperties=void 0,this.persist("namespaces",void 0),this.persist("optionalNamespaces",void 0),this.persist("sessionProperties",void 0),await this.cleanupPendingPairings({deletePairings:!0})}persist(e,t){this.client.core.storage.setItem(`${rf}/${e}`,t)}async getFromStore(e){return await this.client.core.storage.getItem(`${rf}/${e}`)}}let no=na},16227:(e,t)=>{"use strict";function i(e){let t;return"undefined"!=typeof window&&void 0!==window[e]&&(t=window[e]),t}function r(e){let t=i(e);if(!t)throw Error(`${e} is not defined in Window`);return t}Object.defineProperty(t,"__esModule",{value:!0}),t.getLocalStorage=t.getLocalStorageOrThrow=t.getCrypto=t.getCryptoOrThrow=t.getLocation=t.getLocationOrThrow=t.getNavigator=t.getNavigatorOrThrow=t.getDocument=t.getDocumentOrThrow=t.getFromWindowOrThrow=t.getFromWindow=void 0,t.getFromWindow=i,t.getFromWindowOrThrow=r,t.getDocumentOrThrow=function(){return r("document")},t.getDocument=function(){return i("document")},t.getNavigatorOrThrow=function(){return r("navigator")},t.getNavigator=function(){return i("navigator")},t.getLocationOrThrow=function(){return r("location")},t.getLocation=function(){return i("location")},t.getCryptoOrThrow=function(){return r("crypto")},t.getCrypto=function(){return i("crypto")},t.getLocalStorageOrThrow=function(){return r("localStorage")},t.getLocalStorage=function(){return i("localStorage")}},70502:(e,t,i)=>{"use strict";t.g=void 0;let r=i(16227);t.g=function(){let e,t,i;try{e=r.getDocumentOrThrow(),t=r.getLocationOrThrow()}catch(e){return null}function n(...t){let i=e.getElementsByTagName("meta");for(let e=0;er.getAttribute(e)).filter(e=>!!e&&t.includes(e));if(n.length&&n){let e=r.getAttribute("content");if(e)return e}}return""}let a=((i=n("name","og:site_name","og:title","twitter:title"))||(i=e.title),i),o=n("description","og:description","twitter:description","keywords");return{description:o,url:t.origin,icons:function(){let i=e.getElementsByTagName("link"),r=[];for(let e=0;e-1){let e=n.getAttribute("href");if(e){if(-1===e.toLowerCase().indexOf("https:")&&-1===e.toLowerCase().indexOf("http:")&&0!==e.indexOf("//")){let i=t.protocol+"//"+t.host;if(0===e.indexOf("/"))i+=e;else{let r=t.pathname.split("/");r.pop(),i+=r.join("/")+"/"+e}r.push(i)}else if(0===e.indexOf("//")){let i=t.protocol+e;r.push(i)}else r.push(e)}}}return r}(),name:a}}},40707:function(e,t,i){!function(e,t){"use strict";function r(e,t){if(!e)throw Error(t||"Assertion failed")}function n(e,t){e.super_=t;var i=function(){};i.prototype=t.prototype,e.prototype=new i,e.prototype.constructor=e}function a(e,t,i){if(a.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&(("le"===t||"be"===t)&&(i=t,t=10),this._init(e||0,t||10,i||"be"))}"object"==typeof e?e.exports=a:t.BN=a,a.BN=a,a.wordSize=26;try{l="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:i(20399).Buffer}catch(e){}function o(e,t){var i=e.charCodeAt(t);return i>=65&&i<=70?i-55:i>=97&&i<=102?i-87:i-48&15}function s(e,t,i){var r=o(e,i);return i-1>=t&&(r|=o(e,i-1)<<4),r}function c(e,t,i,r){for(var n=0,a=Math.min(e.length,i),o=t;o=49?n+=s-49+10:s>=17?n+=s-17+10:n+=s}return n}a.isBN=function(e){return e instanceof a||null!==e&&"object"==typeof e&&e.constructor.wordSize===a.wordSize&&Array.isArray(e.words)},a.max=function(e,t){return e.cmp(t)>0?e:t},a.min=function(e,t){return 0>e.cmp(t)?e:t},a.prototype._init=function(e,t,i){if("number"==typeof e)return this._initNumber(e,t,i);if("object"==typeof e)return this._initArray(e,t,i);"hex"===t&&(t=16),r(t===(0|t)&&t>=2&&t<=36);var n=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(n++,this.negative=1),n=0;o-=3)a=e[o]|e[o-1]<<8|e[o-2]<<16,this.words[n]|=a<>>26-s&0x3ffffff,(s+=24)>=26&&(s-=26,n++);else if("le"===i)for(o=0,n=0;o>>26-s&0x3ffffff,(s+=24)>=26&&(s-=26,n++);return this.strip()},a.prototype._parseHex=function(e,t,i){this.length=Math.ceil((e.length-t)/6),this.words=Array(this.length);for(var r,n=0;n=t;n-=2)r=s(e,t,n)<=18?(a-=18,o+=1,this.words[o]|=r>>>26):a+=8;else for(n=(e.length-t)%2==0?t+1:t;n=18?(a-=18,o+=1,this.words[o]|=r>>>26):a+=8;this.strip()},a.prototype._parseBase=function(e,t,i){this.words=[0],this.length=1;for(var r=0,n=1;n<=0x3ffffff;n*=t)r++;r--,n=n/t|0;for(var a=e.length-i,o=a%r,s=Math.min(a,a-o)+i,l=0,u=i;u1&&0===this.words[this.length-1];)this.length--;return this._normSign()},a.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},a.prototype.inspect=function(){return(this.red?""};var l,u=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],d=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],h=[0,0,0x2000000,0x290d741,0x1000000,0x2e90edd,0x39aa400,0x267bf47,0x1000000,0x290d741,1e7,0x12959c3,0x222c000,0x3bd7765,7529536,0xadcea1,0x1000000,0x1704f61,0x206fc40,0x2cddcf9,64e6,4084101,5153632,6436343,7962624,9765625,0xb54ba0,0xdaf26b,0x1069c00,0x138f9ad,243e5,0x1b4d89f,0x2000000,0x25528a1,0x2b54a20,0x3216b93,0x39aa400];function p(e,t,i){i.negative=t.negative^e.negative;var r=e.length+t.length|0;i.length=r,r=r-1|0;var n=0|e.words[0],a=0|t.words[0],o=n*a,s=0x3ffffff&o,c=o/0x4000000|0;i.words[0]=s;for(var l=1;l>>26,d=0x3ffffff&c,h=Math.min(l,t.length-1),p=Math.max(0,l-e.length+1);p<=h;p++){var f=l-p|0;u+=(o=(n=0|e.words[f])*(a=0|t.words[p])+d)/0x4000000|0,d=0x3ffffff&o}i.words[l]=0|d,c=0|u}return 0!==c?i.words[l]=0|c:i.length--,i.strip()}a.prototype.toString=function(e,t){if(t=0|t||1,16===(e=e||10)||"hex"===e){i="";for(var i,n=0,a=0,o=0;o>>24-n&0xffffff,(n+=2)>=26&&(n-=26,o--),i=0!==a||o!==this.length-1?u[6-c.length]+c+i:c+i}for(0!==a&&(i=a.toString(16)+i);i.length%t!=0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}if(e===(0|e)&&e>=2&&e<=36){var l=d[e],p=h[e];i="";var f=this.clone();for(f.negative=0;!f.isZero();){var g=f.modn(p).toString(e);i=(f=f.idivn(p)).isZero()?g+i:u[l-g.length]+g+i}for(this.isZero()&&(i="0"+i);i.length%t!=0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}r(!1,"Base should be between 2 and 36")},a.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=0x4000000*this.words[1]:3===this.length&&1===this.words[2]?e+=0x10000000000000+0x4000000*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},a.prototype.toJSON=function(){return this.toString(16)},a.prototype.toBuffer=function(e,t){return r(void 0!==l),this.toArrayLike(l,e,t)},a.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},a.prototype.toArrayLike=function(e,t,i){var n,a,o=this.byteLength(),s=i||Math.max(1,o);r(o<=s,"byte array longer than desired length"),r(s>0,"Requested array length <= 0"),this.strip();var c=new e(s),l=this.clone();if("le"===t){for(a=0;!l.isZero();a++)n=l.andln(255),l.iushrn(8),c[a]=n;for(;a=4096&&(i+=13,t>>>=13),t>=64&&(i+=7,t>>>=7),t>=8&&(i+=4,t>>>=4),t>=2&&(i+=2,t>>>=2),i+t},a.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,i=0;return(8191&t)==0&&(i+=13,t>>>=13),(127&t)==0&&(i+=7,t>>>=7),(15&t)==0&&(i+=4,t>>>=4),(3&t)==0&&(i+=2,t>>>=2),(1&t)==0&&i++,i},a.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return(this.length-1)*26+t},a.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},a.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},a.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var i=0;ie.length?this.clone().iand(e):e.clone().iand(this)},a.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},a.prototype.iuxor=function(e){this.length>e.length?(t=this,i=e):(t=e,i=this);for(var t,i,r=0;re.length?this.clone().ixor(e):e.clone().ixor(this)},a.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},a.prototype.inotn=function(e){r("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),i=e%26;this._expand(t),i>0&&t--;for(var n=0;n0&&(this.words[n]=~this.words[n]&0x3ffffff>>26-i),this.strip()},a.prototype.notn=function(e){return this.clone().inotn(e)},a.prototype.setn=function(e,t){r("number"==typeof e&&e>=0);var i=e/26|0,n=e%26;return this._expand(i+1),t?this.words[i]=this.words[i]|1<e.length?(i=this,r=e):(i=e,r=this);for(var t,i,r,n=0,a=0;a>>26;for(;0!==n&&a>>26;if(this.length=i.length,0!==n)this.words[this.length]=n,this.length++;else if(i!==this)for(;ae.length?this.clone().iadd(e):e.clone().iadd(this)},a.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t,i,r=this.iadd(e);return e.negative=1,r._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var n=this.cmp(e);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(t=this,i=e):(t=e,i=this);for(var a=0,o=0;o>26,this.words[o]=0x3ffffff&r;for(;0!==a&&o>26,this.words[o]=0x3ffffff&r;if(0===a&&o>>13,p=0|o[1],f=8191&p,g=p>>>13,w=0|o[2],m=8191&w,b=w>>>13,v=0|o[3],y=8191&v,x=v>>>13,C=0|o[4],A=8191&C,E=C>>>13,_=0|o[5],k=8191&_,I=_>>>13,S=0|o[6],T=8191&S,N=S>>>13,P=0|o[7],R=8191&P,O=P>>>13,M=0|o[8],D=8191&M,U=M>>>13,$=0|o[9],L=8191&$,j=$>>>13,B=0|s[0],W=8191&B,q=B>>>13,H=0|s[1],z=8191&H,F=H>>>13,Z=0|s[2],V=8191&Z,K=Z>>>13,G=0|s[3],J=8191&G,Y=G>>>13,Q=0|s[4],X=8191&Q,ee=Q>>>13,et=0|s[5],ei=8191&et,er=et>>>13,en=0|s[6],ea=8191&en,eo=en>>>13,es=0|s[7],ec=8191&es,el=es>>>13,eu=0|s[8],ed=8191&eu,eh=eu>>>13,ep=0|s[9],ef=8191&ep,eg=ep>>>13;i.negative=e.negative^t.negative,i.length=19;var ew=(l+(r=Math.imul(d,W))|0)+((8191&(n=(n=Math.imul(d,q))+Math.imul(h,W)|0))<<13)|0;l=((a=Math.imul(h,q))+(n>>>13)|0)+(ew>>>26)|0,ew&=0x3ffffff,r=Math.imul(f,W),n=(n=Math.imul(f,q))+Math.imul(g,W)|0,a=Math.imul(g,q);var em=(l+(r=r+Math.imul(d,z)|0)|0)+((8191&(n=(n=n+Math.imul(d,F)|0)+Math.imul(h,z)|0))<<13)|0;l=((a=a+Math.imul(h,F)|0)+(n>>>13)|0)+(em>>>26)|0,em&=0x3ffffff,r=Math.imul(m,W),n=(n=Math.imul(m,q))+Math.imul(b,W)|0,a=Math.imul(b,q),r=r+Math.imul(f,z)|0,n=(n=n+Math.imul(f,F)|0)+Math.imul(g,z)|0,a=a+Math.imul(g,F)|0;var eb=(l+(r=r+Math.imul(d,V)|0)|0)+((8191&(n=(n=n+Math.imul(d,K)|0)+Math.imul(h,V)|0))<<13)|0;l=((a=a+Math.imul(h,K)|0)+(n>>>13)|0)+(eb>>>26)|0,eb&=0x3ffffff,r=Math.imul(y,W),n=(n=Math.imul(y,q))+Math.imul(x,W)|0,a=Math.imul(x,q),r=r+Math.imul(m,z)|0,n=(n=n+Math.imul(m,F)|0)+Math.imul(b,z)|0,a=a+Math.imul(b,F)|0,r=r+Math.imul(f,V)|0,n=(n=n+Math.imul(f,K)|0)+Math.imul(g,V)|0,a=a+Math.imul(g,K)|0;var ev=(l+(r=r+Math.imul(d,J)|0)|0)+((8191&(n=(n=n+Math.imul(d,Y)|0)+Math.imul(h,J)|0))<<13)|0;l=((a=a+Math.imul(h,Y)|0)+(n>>>13)|0)+(ev>>>26)|0,ev&=0x3ffffff,r=Math.imul(A,W),n=(n=Math.imul(A,q))+Math.imul(E,W)|0,a=Math.imul(E,q),r=r+Math.imul(y,z)|0,n=(n=n+Math.imul(y,F)|0)+Math.imul(x,z)|0,a=a+Math.imul(x,F)|0,r=r+Math.imul(m,V)|0,n=(n=n+Math.imul(m,K)|0)+Math.imul(b,V)|0,a=a+Math.imul(b,K)|0,r=r+Math.imul(f,J)|0,n=(n=n+Math.imul(f,Y)|0)+Math.imul(g,J)|0,a=a+Math.imul(g,Y)|0;var ey=(l+(r=r+Math.imul(d,X)|0)|0)+((8191&(n=(n=n+Math.imul(d,ee)|0)+Math.imul(h,X)|0))<<13)|0;l=((a=a+Math.imul(h,ee)|0)+(n>>>13)|0)+(ey>>>26)|0,ey&=0x3ffffff,r=Math.imul(k,W),n=(n=Math.imul(k,q))+Math.imul(I,W)|0,a=Math.imul(I,q),r=r+Math.imul(A,z)|0,n=(n=n+Math.imul(A,F)|0)+Math.imul(E,z)|0,a=a+Math.imul(E,F)|0,r=r+Math.imul(y,V)|0,n=(n=n+Math.imul(y,K)|0)+Math.imul(x,V)|0,a=a+Math.imul(x,K)|0,r=r+Math.imul(m,J)|0,n=(n=n+Math.imul(m,Y)|0)+Math.imul(b,J)|0,a=a+Math.imul(b,Y)|0,r=r+Math.imul(f,X)|0,n=(n=n+Math.imul(f,ee)|0)+Math.imul(g,X)|0,a=a+Math.imul(g,ee)|0;var ex=(l+(r=r+Math.imul(d,ei)|0)|0)+((8191&(n=(n=n+Math.imul(d,er)|0)+Math.imul(h,ei)|0))<<13)|0;l=((a=a+Math.imul(h,er)|0)+(n>>>13)|0)+(ex>>>26)|0,ex&=0x3ffffff,r=Math.imul(T,W),n=(n=Math.imul(T,q))+Math.imul(N,W)|0,a=Math.imul(N,q),r=r+Math.imul(k,z)|0,n=(n=n+Math.imul(k,F)|0)+Math.imul(I,z)|0,a=a+Math.imul(I,F)|0,r=r+Math.imul(A,V)|0,n=(n=n+Math.imul(A,K)|0)+Math.imul(E,V)|0,a=a+Math.imul(E,K)|0,r=r+Math.imul(y,J)|0,n=(n=n+Math.imul(y,Y)|0)+Math.imul(x,J)|0,a=a+Math.imul(x,Y)|0,r=r+Math.imul(m,X)|0,n=(n=n+Math.imul(m,ee)|0)+Math.imul(b,X)|0,a=a+Math.imul(b,ee)|0,r=r+Math.imul(f,ei)|0,n=(n=n+Math.imul(f,er)|0)+Math.imul(g,ei)|0,a=a+Math.imul(g,er)|0;var eC=(l+(r=r+Math.imul(d,ea)|0)|0)+((8191&(n=(n=n+Math.imul(d,eo)|0)+Math.imul(h,ea)|0))<<13)|0;l=((a=a+Math.imul(h,eo)|0)+(n>>>13)|0)+(eC>>>26)|0,eC&=0x3ffffff,r=Math.imul(R,W),n=(n=Math.imul(R,q))+Math.imul(O,W)|0,a=Math.imul(O,q),r=r+Math.imul(T,z)|0,n=(n=n+Math.imul(T,F)|0)+Math.imul(N,z)|0,a=a+Math.imul(N,F)|0,r=r+Math.imul(k,V)|0,n=(n=n+Math.imul(k,K)|0)+Math.imul(I,V)|0,a=a+Math.imul(I,K)|0,r=r+Math.imul(A,J)|0,n=(n=n+Math.imul(A,Y)|0)+Math.imul(E,J)|0,a=a+Math.imul(E,Y)|0,r=r+Math.imul(y,X)|0,n=(n=n+Math.imul(y,ee)|0)+Math.imul(x,X)|0,a=a+Math.imul(x,ee)|0,r=r+Math.imul(m,ei)|0,n=(n=n+Math.imul(m,er)|0)+Math.imul(b,ei)|0,a=a+Math.imul(b,er)|0,r=r+Math.imul(f,ea)|0,n=(n=n+Math.imul(f,eo)|0)+Math.imul(g,ea)|0,a=a+Math.imul(g,eo)|0;var eA=(l+(r=r+Math.imul(d,ec)|0)|0)+((8191&(n=(n=n+Math.imul(d,el)|0)+Math.imul(h,ec)|0))<<13)|0;l=((a=a+Math.imul(h,el)|0)+(n>>>13)|0)+(eA>>>26)|0,eA&=0x3ffffff,r=Math.imul(D,W),n=(n=Math.imul(D,q))+Math.imul(U,W)|0,a=Math.imul(U,q),r=r+Math.imul(R,z)|0,n=(n=n+Math.imul(R,F)|0)+Math.imul(O,z)|0,a=a+Math.imul(O,F)|0,r=r+Math.imul(T,V)|0,n=(n=n+Math.imul(T,K)|0)+Math.imul(N,V)|0,a=a+Math.imul(N,K)|0,r=r+Math.imul(k,J)|0,n=(n=n+Math.imul(k,Y)|0)+Math.imul(I,J)|0,a=a+Math.imul(I,Y)|0,r=r+Math.imul(A,X)|0,n=(n=n+Math.imul(A,ee)|0)+Math.imul(E,X)|0,a=a+Math.imul(E,ee)|0,r=r+Math.imul(y,ei)|0,n=(n=n+Math.imul(y,er)|0)+Math.imul(x,ei)|0,a=a+Math.imul(x,er)|0,r=r+Math.imul(m,ea)|0,n=(n=n+Math.imul(m,eo)|0)+Math.imul(b,ea)|0,a=a+Math.imul(b,eo)|0,r=r+Math.imul(f,ec)|0,n=(n=n+Math.imul(f,el)|0)+Math.imul(g,ec)|0,a=a+Math.imul(g,el)|0;var eE=(l+(r=r+Math.imul(d,ed)|0)|0)+((8191&(n=(n=n+Math.imul(d,eh)|0)+Math.imul(h,ed)|0))<<13)|0;l=((a=a+Math.imul(h,eh)|0)+(n>>>13)|0)+(eE>>>26)|0,eE&=0x3ffffff,r=Math.imul(L,W),n=(n=Math.imul(L,q))+Math.imul(j,W)|0,a=Math.imul(j,q),r=r+Math.imul(D,z)|0,n=(n=n+Math.imul(D,F)|0)+Math.imul(U,z)|0,a=a+Math.imul(U,F)|0,r=r+Math.imul(R,V)|0,n=(n=n+Math.imul(R,K)|0)+Math.imul(O,V)|0,a=a+Math.imul(O,K)|0,r=r+Math.imul(T,J)|0,n=(n=n+Math.imul(T,Y)|0)+Math.imul(N,J)|0,a=a+Math.imul(N,Y)|0,r=r+Math.imul(k,X)|0,n=(n=n+Math.imul(k,ee)|0)+Math.imul(I,X)|0,a=a+Math.imul(I,ee)|0,r=r+Math.imul(A,ei)|0,n=(n=n+Math.imul(A,er)|0)+Math.imul(E,ei)|0,a=a+Math.imul(E,er)|0,r=r+Math.imul(y,ea)|0,n=(n=n+Math.imul(y,eo)|0)+Math.imul(x,ea)|0,a=a+Math.imul(x,eo)|0,r=r+Math.imul(m,ec)|0,n=(n=n+Math.imul(m,el)|0)+Math.imul(b,ec)|0,a=a+Math.imul(b,el)|0,r=r+Math.imul(f,ed)|0,n=(n=n+Math.imul(f,eh)|0)+Math.imul(g,ed)|0,a=a+Math.imul(g,eh)|0;var e_=(l+(r=r+Math.imul(d,ef)|0)|0)+((8191&(n=(n=n+Math.imul(d,eg)|0)+Math.imul(h,ef)|0))<<13)|0;l=((a=a+Math.imul(h,eg)|0)+(n>>>13)|0)+(e_>>>26)|0,e_&=0x3ffffff,r=Math.imul(L,z),n=(n=Math.imul(L,F))+Math.imul(j,z)|0,a=Math.imul(j,F),r=r+Math.imul(D,V)|0,n=(n=n+Math.imul(D,K)|0)+Math.imul(U,V)|0,a=a+Math.imul(U,K)|0,r=r+Math.imul(R,J)|0,n=(n=n+Math.imul(R,Y)|0)+Math.imul(O,J)|0,a=a+Math.imul(O,Y)|0,r=r+Math.imul(T,X)|0,n=(n=n+Math.imul(T,ee)|0)+Math.imul(N,X)|0,a=a+Math.imul(N,ee)|0,r=r+Math.imul(k,ei)|0,n=(n=n+Math.imul(k,er)|0)+Math.imul(I,ei)|0,a=a+Math.imul(I,er)|0,r=r+Math.imul(A,ea)|0,n=(n=n+Math.imul(A,eo)|0)+Math.imul(E,ea)|0,a=a+Math.imul(E,eo)|0,r=r+Math.imul(y,ec)|0,n=(n=n+Math.imul(y,el)|0)+Math.imul(x,ec)|0,a=a+Math.imul(x,el)|0,r=r+Math.imul(m,ed)|0,n=(n=n+Math.imul(m,eh)|0)+Math.imul(b,ed)|0,a=a+Math.imul(b,eh)|0;var ek=(l+(r=r+Math.imul(f,ef)|0)|0)+((8191&(n=(n=n+Math.imul(f,eg)|0)+Math.imul(g,ef)|0))<<13)|0;l=((a=a+Math.imul(g,eg)|0)+(n>>>13)|0)+(ek>>>26)|0,ek&=0x3ffffff,r=Math.imul(L,V),n=(n=Math.imul(L,K))+Math.imul(j,V)|0,a=Math.imul(j,K),r=r+Math.imul(D,J)|0,n=(n=n+Math.imul(D,Y)|0)+Math.imul(U,J)|0,a=a+Math.imul(U,Y)|0,r=r+Math.imul(R,X)|0,n=(n=n+Math.imul(R,ee)|0)+Math.imul(O,X)|0,a=a+Math.imul(O,ee)|0,r=r+Math.imul(T,ei)|0,n=(n=n+Math.imul(T,er)|0)+Math.imul(N,ei)|0,a=a+Math.imul(N,er)|0,r=r+Math.imul(k,ea)|0,n=(n=n+Math.imul(k,eo)|0)+Math.imul(I,ea)|0,a=a+Math.imul(I,eo)|0,r=r+Math.imul(A,ec)|0,n=(n=n+Math.imul(A,el)|0)+Math.imul(E,ec)|0,a=a+Math.imul(E,el)|0,r=r+Math.imul(y,ed)|0,n=(n=n+Math.imul(y,eh)|0)+Math.imul(x,ed)|0,a=a+Math.imul(x,eh)|0;var eI=(l+(r=r+Math.imul(m,ef)|0)|0)+((8191&(n=(n=n+Math.imul(m,eg)|0)+Math.imul(b,ef)|0))<<13)|0;l=((a=a+Math.imul(b,eg)|0)+(n>>>13)|0)+(eI>>>26)|0,eI&=0x3ffffff,r=Math.imul(L,J),n=(n=Math.imul(L,Y))+Math.imul(j,J)|0,a=Math.imul(j,Y),r=r+Math.imul(D,X)|0,n=(n=n+Math.imul(D,ee)|0)+Math.imul(U,X)|0,a=a+Math.imul(U,ee)|0,r=r+Math.imul(R,ei)|0,n=(n=n+Math.imul(R,er)|0)+Math.imul(O,ei)|0,a=a+Math.imul(O,er)|0,r=r+Math.imul(T,ea)|0,n=(n=n+Math.imul(T,eo)|0)+Math.imul(N,ea)|0,a=a+Math.imul(N,eo)|0,r=r+Math.imul(k,ec)|0,n=(n=n+Math.imul(k,el)|0)+Math.imul(I,ec)|0,a=a+Math.imul(I,el)|0,r=r+Math.imul(A,ed)|0,n=(n=n+Math.imul(A,eh)|0)+Math.imul(E,ed)|0,a=a+Math.imul(E,eh)|0;var eS=(l+(r=r+Math.imul(y,ef)|0)|0)+((8191&(n=(n=n+Math.imul(y,eg)|0)+Math.imul(x,ef)|0))<<13)|0;l=((a=a+Math.imul(x,eg)|0)+(n>>>13)|0)+(eS>>>26)|0,eS&=0x3ffffff,r=Math.imul(L,X),n=(n=Math.imul(L,ee))+Math.imul(j,X)|0,a=Math.imul(j,ee),r=r+Math.imul(D,ei)|0,n=(n=n+Math.imul(D,er)|0)+Math.imul(U,ei)|0,a=a+Math.imul(U,er)|0,r=r+Math.imul(R,ea)|0,n=(n=n+Math.imul(R,eo)|0)+Math.imul(O,ea)|0,a=a+Math.imul(O,eo)|0,r=r+Math.imul(T,ec)|0,n=(n=n+Math.imul(T,el)|0)+Math.imul(N,ec)|0,a=a+Math.imul(N,el)|0,r=r+Math.imul(k,ed)|0,n=(n=n+Math.imul(k,eh)|0)+Math.imul(I,ed)|0,a=a+Math.imul(I,eh)|0;var eT=(l+(r=r+Math.imul(A,ef)|0)|0)+((8191&(n=(n=n+Math.imul(A,eg)|0)+Math.imul(E,ef)|0))<<13)|0;l=((a=a+Math.imul(E,eg)|0)+(n>>>13)|0)+(eT>>>26)|0,eT&=0x3ffffff,r=Math.imul(L,ei),n=(n=Math.imul(L,er))+Math.imul(j,ei)|0,a=Math.imul(j,er),r=r+Math.imul(D,ea)|0,n=(n=n+Math.imul(D,eo)|0)+Math.imul(U,ea)|0,a=a+Math.imul(U,eo)|0,r=r+Math.imul(R,ec)|0,n=(n=n+Math.imul(R,el)|0)+Math.imul(O,ec)|0,a=a+Math.imul(O,el)|0,r=r+Math.imul(T,ed)|0,n=(n=n+Math.imul(T,eh)|0)+Math.imul(N,ed)|0,a=a+Math.imul(N,eh)|0;var eN=(l+(r=r+Math.imul(k,ef)|0)|0)+((8191&(n=(n=n+Math.imul(k,eg)|0)+Math.imul(I,ef)|0))<<13)|0;l=((a=a+Math.imul(I,eg)|0)+(n>>>13)|0)+(eN>>>26)|0,eN&=0x3ffffff,r=Math.imul(L,ea),n=(n=Math.imul(L,eo))+Math.imul(j,ea)|0,a=Math.imul(j,eo),r=r+Math.imul(D,ec)|0,n=(n=n+Math.imul(D,el)|0)+Math.imul(U,ec)|0,a=a+Math.imul(U,el)|0,r=r+Math.imul(R,ed)|0,n=(n=n+Math.imul(R,eh)|0)+Math.imul(O,ed)|0,a=a+Math.imul(O,eh)|0;var eP=(l+(r=r+Math.imul(T,ef)|0)|0)+((8191&(n=(n=n+Math.imul(T,eg)|0)+Math.imul(N,ef)|0))<<13)|0;l=((a=a+Math.imul(N,eg)|0)+(n>>>13)|0)+(eP>>>26)|0,eP&=0x3ffffff,r=Math.imul(L,ec),n=(n=Math.imul(L,el))+Math.imul(j,ec)|0,a=Math.imul(j,el),r=r+Math.imul(D,ed)|0,n=(n=n+Math.imul(D,eh)|0)+Math.imul(U,ed)|0,a=a+Math.imul(U,eh)|0;var eR=(l+(r=r+Math.imul(R,ef)|0)|0)+((8191&(n=(n=n+Math.imul(R,eg)|0)+Math.imul(O,ef)|0))<<13)|0;l=((a=a+Math.imul(O,eg)|0)+(n>>>13)|0)+(eR>>>26)|0,eR&=0x3ffffff,r=Math.imul(L,ed),n=(n=Math.imul(L,eh))+Math.imul(j,ed)|0,a=Math.imul(j,eh);var eO=(l+(r=r+Math.imul(D,ef)|0)|0)+((8191&(n=(n=n+Math.imul(D,eg)|0)+Math.imul(U,ef)|0))<<13)|0;l=((a=a+Math.imul(U,eg)|0)+(n>>>13)|0)+(eO>>>26)|0,eO&=0x3ffffff;var eM=(l+(r=Math.imul(L,ef))|0)+((8191&(n=(n=Math.imul(L,eg))+Math.imul(j,ef)|0))<<13)|0;return l=((a=Math.imul(j,eg))+(n>>>13)|0)+(eM>>>26)|0,eM&=0x3ffffff,c[0]=ew,c[1]=em,c[2]=eb,c[3]=ev,c[4]=ey,c[5]=ex,c[6]=eC,c[7]=eA,c[8]=eE,c[9]=e_,c[10]=ek,c[11]=eI,c[12]=eS,c[13]=eT,c[14]=eN,c[15]=eP,c[16]=eR,c[17]=eO,c[18]=eM,0!==l&&(c[19]=l,i.length++),i};function g(e,t,i){return new w().mulp(e,t,i)}function w(e,t){this.x=e,this.y=t}Math.imul||(f=p),a.prototype.mulTo=function(e,t){var i=this.length+e.length;return 10===this.length&&10===e.length?f(this,e,t):i<63?p(this,e,t):i<1024?function(e,t,i){i.negative=t.negative^e.negative,i.length=e.length+t.length;for(var r=0,n=0,a=0;a>>26)|0)>>>26,o&=0x3ffffff}i.words[a]=s,r=o,o=n}return 0!==r?i.words[a]=r:i.length--,i.strip()}(this,e,t):g(this,e,t)},w.prototype.makeRBT=function(e){for(var t=Array(e),i=a.prototype._countBits(e)-1,r=0;r>=1;return r},w.prototype.permute=function(e,t,i,r,n,a){for(var o=0;o>>=1)n++;return 1<>>=13,i[2*o+1]=8191&a,a>>>=13;for(o=2*t;o>=26,t+=(n/0x4000000|0)+(a>>>26),this.words[i]=0x3ffffff&a}return 0!==t&&(this.words[i]=t,this.length++),this},a.prototype.muln=function(e){return this.clone().imuln(e)},a.prototype.sqr=function(){return this.mul(this)},a.prototype.isqr=function(){return this.imul(this.clone())},a.prototype.pow=function(e){var t=function(e){for(var t=Array(e.bitLength()),i=0;i>>n}return t}(e);if(0===t.length)return new a(1);for(var i=this,r=0;r=0);var t,i=e%26,n=(e-i)/26,a=0x3ffffff>>>26-i<<26-i;if(0!==i){var o=0;for(t=0;t>>26-i}o&&(this.words[t]=o,this.length++)}if(0!==n){for(t=this.length-1;t>=0;t--)this.words[t+n]=this.words[t];for(t=0;t=0),n=t?(t-t%26)/26:0;var n,a=e%26,o=Math.min((e-a)/26,this.length),s=0x3ffffff^0x3ffffff>>>a<o)for(this.length-=o,c=0;c=0&&(0!==l||c>=n);c--){var u=0|this.words[c];this.words[c]=l<<26-a|u>>>a,l=u&s}return i&&0!==l&&(i.words[i.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},a.prototype.ishrn=function(e,t,i){return r(0===this.negative),this.iushrn(e,t,i)},a.prototype.shln=function(e){return this.clone().ishln(e)},a.prototype.ushln=function(e){return this.clone().iushln(e)},a.prototype.shrn=function(e){return this.clone().ishrn(e)},a.prototype.ushrn=function(e){return this.clone().iushrn(e)},a.prototype.testn=function(e){r("number"==typeof e&&e>=0);var t=e%26,i=(e-t)/26;return!(this.length<=i)&&!!(this.words[i]&1<=0);var t=e%26,i=(e-t)/26;return(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=i)?this:(0!==t&&i++,this.length=Math.min(i,this.length),0!==t&&(this.words[this.length-1]&=0x3ffffff^0x3ffffff>>>t<=0x4000000;t++)this.words[t]-=0x4000000,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},a.prototype.isubn=function(e){if(r("number"==typeof e),r(e<0x4000000),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(c/0x4000000|0),this.words[n+i]=0x3ffffff&a}for(;n>26,this.words[n+i]=0x3ffffff&a;if(0===s)return this.strip();for(r(-1===s),s=0,n=0;n>26,this.words[n]=0x3ffffff&a;return this.negative=1,this.strip()},a.prototype._wordDiv=function(e,t){var i,r=this.length-e.length,n=this.clone(),o=e,s=0|o.words[o.length-1];0!=(r=26-this._countBits(s))&&(o=o.ushln(r),n.iushln(r),s=0|o.words[o.length-1]);var c=n.length-o.length;if("mod"!==t){(i=new a(null)).length=c+1,i.words=Array(i.length);for(var l=0;l=0;d--){var h=(0|n.words[o.length+d])*0x4000000+(0|n.words[o.length+d-1]);for(h=Math.min(h/s|0,0x3ffffff),n._ishlnsubmul(o,h,d);0!==n.negative;)h--,n.negative=0,n._ishlnsubmul(o,1,d),n.isZero()||(n.negative^=1);i&&(i.words[d]=h)}return i&&i.strip(),n.strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:i||null,mod:n}},a.prototype.divmod=function(e,t,i){var n,o,s;return(r(!e.isZero()),this.isZero())?{div:new a(0),mod:new a(0)}:0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(n=s.div.neg()),"div"!==t&&(o=s.mod.neg(),i&&0!==o.negative&&o.iadd(e)),{div:n,mod:o}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(n=s.div.neg()),{div:n,mod:s.mod}):(this.negative&e.negative)!=0?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(o=s.mod.neg(),i&&0!==o.negative&&o.isub(e)),{div:s.div,mod:o}):e.length>this.length||0>this.cmp(e)?{div:new a(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new a(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new a(this.modn(e.words[0]))}:this._wordDiv(e,t)},a.prototype.div=function(e){return this.divmod(e,"div",!1).div},a.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},a.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},a.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var i=0!==t.div.negative?t.mod.isub(e):t.mod,r=e.ushrn(1),n=e.andln(1),a=i.cmp(r);return a<0||1===n&&0===a?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},a.prototype.modn=function(e){r(e<=0x3ffffff);for(var t=0x4000000%e,i=0,n=this.length-1;n>=0;n--)i=(t*i+(0|this.words[n]))%e;return i},a.prototype.idivn=function(e){r(e<=0x3ffffff);for(var t=0,i=this.length-1;i>=0;i--){var n=(0|this.words[i])+0x4000000*t;this.words[i]=n/e|0,t=n%e}return this.strip()},a.prototype.divn=function(e){return this.clone().idivn(e)},a.prototype.egcd=function(e){r(0===e.negative),r(!e.isZero());var t=this,i=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var n=new a(1),o=new a(0),s=new a(0),c=new a(1),l=0;t.isEven()&&i.isEven();)t.iushrn(1),i.iushrn(1),++l;for(var u=i.clone(),d=t.clone();!t.isZero();){for(var h=0,p=1;(t.words[0]&p)==0&&h<26;++h,p<<=1);if(h>0)for(t.iushrn(h);h-- >0;)(n.isOdd()||o.isOdd())&&(n.iadd(u),o.isub(d)),n.iushrn(1),o.iushrn(1);for(var f=0,g=1;(i.words[0]&g)==0&&f<26;++f,g<<=1);if(f>0)for(i.iushrn(f);f-- >0;)(s.isOdd()||c.isOdd())&&(s.iadd(u),c.isub(d)),s.iushrn(1),c.iushrn(1);t.cmp(i)>=0?(t.isub(i),n.isub(s),o.isub(c)):(i.isub(t),s.isub(n),c.isub(o))}return{a:s,b:c,gcd:i.iushln(l)}},a.prototype._invmp=function(e){r(0===e.negative),r(!e.isZero());var t,i=this,n=e.clone();i=0!==i.negative?i.umod(e):i.clone();for(var o=new a(1),s=new a(0),c=n.clone();i.cmpn(1)>0&&n.cmpn(1)>0;){for(var l=0,u=1;(i.words[0]&u)==0&&l<26;++l,u<<=1);if(l>0)for(i.iushrn(l);l-- >0;)o.isOdd()&&o.iadd(c),o.iushrn(1);for(var d=0,h=1;(n.words[0]&h)==0&&d<26;++d,h<<=1);if(d>0)for(n.iushrn(d);d-- >0;)s.isOdd()&&s.iadd(c),s.iushrn(1);i.cmp(n)>=0?(i.isub(n),o.isub(s)):(n.isub(i),s.isub(o))}return 0>(t=0===i.cmpn(1)?o:s).cmpn(0)&&t.iadd(e),t},a.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),i=e.clone();t.negative=0,i.negative=0;for(var r=0;t.isEven()&&i.isEven();r++)t.iushrn(1),i.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;i.isEven();)i.iushrn(1);var n=t.cmp(i);if(n<0){var a=t;t=i,i=a}else if(0===n||0===i.cmpn(1))break;t.isub(i)}return i.iushln(r)},a.prototype.invm=function(e){return this.egcd(e).a.umod(e)},a.prototype.isEven=function(){return(1&this.words[0])==0},a.prototype.isOdd=function(){return(1&this.words[0])==1},a.prototype.andln=function(e){return this.words[0]&e},a.prototype.bincn=function(e){r("number"==typeof e);var t=e%26,i=(e-t)/26,n=1<>>26,s&=0x3ffffff,this.words[o]=s}return 0!==a&&(this.words[o]=a,this.length++),this},a.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},a.prototype.cmpn=function(e){var t,i=e<0;if(0!==this.negative&&!i)return -1;if(0===this.negative&&i)return 1;if(this.strip(),this.length>1)t=1;else{i&&(e=-e),r(e<=0x3ffffff,"Number is too big");var n=0|this.words[0];t=n===e?0:ne.length)return 1;if(this.length=0;i--){var r=0|this.words[i],n=0|e.words[i];if(r!==n){rn&&(t=1);break}}return t},a.prototype.gtn=function(e){return 1===this.cmpn(e)},a.prototype.gt=function(e){return 1===this.cmp(e)},a.prototype.gten=function(e){return this.cmpn(e)>=0},a.prototype.gte=function(e){return this.cmp(e)>=0},a.prototype.ltn=function(e){return -1===this.cmpn(e)},a.prototype.lt=function(e){return -1===this.cmp(e)},a.prototype.lten=function(e){return 0>=this.cmpn(e)},a.prototype.lte=function(e){return 0>=this.cmp(e)},a.prototype.eqn=function(e){return 0===this.cmpn(e)},a.prototype.eq=function(e){return 0===this.cmp(e)},a.red=function(e){return new A(e)},a.prototype.toRed=function(e){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},a.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},a.prototype._forceRed=function(e){return this.red=e,this},a.prototype.forceRed=function(e){return r(!this.red,"Already a number in reduction context"),this._forceRed(e)},a.prototype.redAdd=function(e){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},a.prototype.redIAdd=function(e){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},a.prototype.redSub=function(e){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},a.prototype.redISub=function(e){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},a.prototype.redShl=function(e){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},a.prototype.redMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},a.prototype.redIMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},a.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},a.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},a.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},a.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},a.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},a.prototype.redPow=function(e){return r(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var m={k256:null,p224:null,p192:null,p25519:null};function b(e,t){this.name=e,this.p=new a(t,16),this.n=this.p.bitLength(),this.k=new a(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function v(){b.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function y(){b.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function x(){b.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function C(){b.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function A(e){if("string"==typeof e){var t=a._prime(e);this.m=t.p,this.prime=t}else r(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function E(e){A.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new a(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}b.prototype._tmp=function(){var e=new a(null);return e.words=Array(Math.ceil(this.n/13)),e},b.prototype.ireduce=function(e){var t,i=e;do this.split(i,this.tmp),t=(i=(i=this.imulK(i)).iadd(this.tmp)).bitLength();while(t>this.n);var r=t0?i.isub(this.p):void 0!==i.strip?i.strip():i._strip(),i},b.prototype.split=function(e,t){e.iushrn(this.n,0,t)},b.prototype.imulK=function(e){return e.imul(this.k)},n(v,b),v.prototype.split=function(e,t){for(var i=Math.min(e.length,9),r=0;r>>22,n=a}n>>>=22,e.words[r-10]=n,0===n&&e.length>10?e.length-=10:e.length-=9},v.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,i=0;i>>=26,e.words[i]=n,t=r}return 0!==t&&(e.words[e.length++]=t),e},a._prime=function(e){var t;if(m[e])return m[e];if("k256"===e)t=new v;else if("p224"===e)t=new y;else if("p192"===e)t=new x;else if("p25519"===e)t=new C;else throw Error("Unknown prime "+e);return m[e]=t,t},A.prototype._verify1=function(e){r(0===e.negative,"red works only with positives"),r(e.red,"red works only with red numbers")},A.prototype._verify2=function(e,t){r((e.negative|t.negative)==0,"red works only with positives"),r(e.red&&e.red===t.red,"red works only with red numbers")},A.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},A.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},A.prototype.add=function(e,t){this._verify2(e,t);var i=e.add(t);return i.cmp(this.m)>=0&&i.isub(this.m),i._forceRed(this)},A.prototype.iadd=function(e,t){this._verify2(e,t);var i=e.iadd(t);return i.cmp(this.m)>=0&&i.isub(this.m),i},A.prototype.sub=function(e,t){this._verify2(e,t);var i=e.sub(t);return 0>i.cmpn(0)&&i.iadd(this.m),i._forceRed(this)},A.prototype.isub=function(e,t){this._verify2(e,t);var i=e.isub(t);return 0>i.cmpn(0)&&i.iadd(this.m),i},A.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},A.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},A.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},A.prototype.isqr=function(e){return this.imul(e,e.clone())},A.prototype.sqr=function(e){return this.mul(e,e)},A.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(r(t%2==1),3===t){var i=this.m.add(new a(1)).iushrn(2);return this.pow(e,i)}for(var n=this.m.subn(1),o=0;!n.isZero()&&0===n.andln(1);)o++,n.iushrn(1);r(!n.isZero());var s=new a(1).toRed(this),c=s.redNeg(),l=this.m.subn(1).iushrn(1),u=this.m.bitLength();for(u=new a(2*u*u).toRed(this);0!==this.pow(u,l).cmp(c);)u.redIAdd(c);for(var d=this.pow(u,n),h=this.pow(e,n.addn(1).iushrn(1)),p=this.pow(e,n),f=o;0!==p.cmp(s);){for(var g=p,w=0;0!==g.cmp(s);w++)g=g.redSqr();r(w=0;r--){for(var l=t.words[r],u=c-1;u>=0;u--){var d=l>>u&1;if(n!==i[0]&&(n=this.sqr(n)),0===d&&0===o){s=0;continue}o<<=1,o|=d,(4==++s||0===r&&0===u)&&(n=this.mul(n,i[o]),s=0,o=0)}c=26}return n},A.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},A.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},a.mont=function(e){return new E(e)},n(E,A),E.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},E.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},E.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var i=e.imul(t),r=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=i.isub(r).iushrn(this.shift),a=n;return n.cmp(this.m)>=0?a=n.isub(this.m):0>n.cmpn(0)&&(a=n.iadd(this.m)),a._forceRed(this)},E.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new a(0)._forceRed(this);var i=e.mul(t),r=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=i.isub(r).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):0>n.cmpn(0)&&(o=n.iadd(this.m)),o._forceRed(this)},E.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=i.nmd(e),this)},2009:(e,t,i)=>{var r;function n(e){this.rand=e}if(e.exports=function(e){return r||(r=new n(null)),r.generate(e)},e.exports.Rand=n,n.prototype.generate=function(e){return this._rand(e)},n.prototype._rand=function(e){if(this.rand.getBytes)return this.rand.getBytes(e);for(var t=new Uint8Array(e),i=0;i-1};function a(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(e))throw TypeError("Invalid character in header field name");return e.toLowerCase()}function o(e){return"string"!=typeof e&&(e=String(e)),e}function s(e){var i={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return t.iterable&&(i[Symbol.iterator]=function(){return i}),i}function c(e){this.map={},e instanceof c?e.forEach(function(e,t){this.append(t,e)},this):Array.isArray(e)?e.forEach(function(e){this.append(e[0],e[1])},this):e&&Object.getOwnPropertyNames(e).forEach(function(t){this.append(t,e[t])},this)}function l(e){if(e.bodyUsed)return Promise.reject(TypeError("Already read"));e.bodyUsed=!0}function u(e){return new Promise(function(t,i){e.onload=function(){t(e.result)},e.onerror=function(){i(e.error)}})}function d(e){var t=new FileReader,i=u(t);return t.readAsArrayBuffer(e),i}function h(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function p(){return this.bodyUsed=!1,this._initBody=function(e){if(this._bodyInit=e,e){if("string"==typeof e)this._bodyText=e;else if(t.blob&&Blob.prototype.isPrototypeOf(e))this._bodyBlob=e;else if(t.formData&&FormData.prototype.isPrototypeOf(e))this._bodyFormData=e;else if(t.searchParams&&URLSearchParams.prototype.isPrototypeOf(e))this._bodyText=e.toString();else{var i;t.arrayBuffer&&t.blob&&(i=e)&&DataView.prototype.isPrototypeOf(i)?(this._bodyArrayBuffer=h(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):t.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(e)||n(e))?this._bodyArrayBuffer=h(e):this._bodyText=e=Object.prototype.toString.call(e)}}else this._bodyText="";!this.headers.get("content-type")&&("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):t.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},t.blob&&(this.blob=function(){var e=l(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(!this._bodyFormData)return Promise.resolve(new Blob([this._bodyText]));throw Error("could not read FormData body as blob")},this.arrayBuffer=function(){return this._bodyArrayBuffer?l(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(d)}),this.text=function(){var e,t,i,r=l(this);if(r)return r;if(this._bodyBlob)return e=this._bodyBlob,i=u(t=new FileReader),t.readAsText(e),i;if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),i=Array(t.length),r=0;r-1?r:i),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&n)throw TypeError("Body not allowed for GET or HEAD requests");this._initBody(n)}function w(e){var t=new FormData;return e.trim().split("&").forEach(function(e){if(e){var i=e.split("="),r=i.shift().replace(/\+/g," "),n=i.join("=").replace(/\+/g," ");t.append(decodeURIComponent(r),decodeURIComponent(n))}}),t}function m(e,t){t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in t?t.statusText:"OK",this.headers=new c(t.headers),this.url=t.url||"",this._initBody(e)}g.prototype.clone=function(){return new g(this,{body:this._bodyInit})},p.call(g.prototype),p.call(m.prototype),m.prototype.clone=function(){return new m(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new c(this.headers),url:this.url})},m.error=function(){var e=new m(null,{status:0,statusText:""});return e.type="error",e};var b=[301,302,303,307,308];m.redirect=function(e,t){if(-1===b.indexOf(t))throw RangeError("Invalid status code");return new m(null,{status:t,headers:{location:e}})},e.DOMException=r.DOMException;try{new e.DOMException}catch(t){e.DOMException=function(e,t){this.message=e,this.name=t;var i=Error(e);this.stack=i.stack},e.DOMException.prototype=Object.create(Error.prototype),e.DOMException.prototype.constructor=e.DOMException}function v(i,r){return new Promise(function(n,a){var o=new g(i,r);if(o.signal&&o.signal.aborted)return a(new e.DOMException("Aborted","AbortError"));var s=new XMLHttpRequest;function l(){s.abort()}s.onload=function(){var e,t,i={status:s.status,statusText:s.statusText,headers:(e=s.getAllResponseHeaders()||"",t=new c,e.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach(function(e){var i=e.split(":"),r=i.shift().trim();if(r){var n=i.join(":").trim();t.append(r,n)}}),t)};i.url="responseURL"in s?s.responseURL:i.headers.get("X-Request-URL"),n(new m("response"in s?s.response:s.responseText,i))},s.onerror=function(){a(TypeError("Network request failed"))},s.ontimeout=function(){a(TypeError("Network request failed"))},s.onabort=function(){a(new e.DOMException("Aborted","AbortError"))},s.open(o.method,o.url,!0),"include"===o.credentials?s.withCredentials=!0:"omit"===o.credentials&&(s.withCredentials=!1),"responseType"in s&&t.blob&&(s.responseType="blob"),o.headers.forEach(function(e,t){s.setRequestHeader(t,e)}),o.signal&&(o.signal.addEventListener("abort",l),s.onreadystatechange=function(){4===s.readyState&&o.signal.removeEventListener("abort",l)}),s.send(void 0===o._bodyInit?null:o._bodyInit)})}v.polyfill=!0,r.fetch||(r.fetch=v,r.Headers=c,r.Request=g,r.Response=m),e.Headers=c,e.Request=g,e.Response=m,e.fetch=v,Object.defineProperty(e,"__esModule",{value:!0})})({}),r.fetch.ponyfill=!0,delete r.fetch.polyfill,(t=r.fetch).default=r.fetch,t.fetch=r.fetch,t.Headers=r.Headers,t.Request=r.Request,t.Response=r.Response,e.exports=t},21420:function(e){var t;t=function(){"use strict";var e="millisecond",t="second",i="minute",r="hour",n="week",a="month",o="quarter",s="year",c="date",l="Invalid Date",u=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,d=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,h=function(e,t,i){var r=String(e);return!r||r.length>=t?e:""+Array(t+1-r.length).join(i)+e},p="en",f={};f[p]={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(e){var t=["th","st","nd","rd"],i=e%100;return"["+e+(t[(i-20)%10]||t[i]||"th")+"]"}};var g="$isDayjsObject",w=function(e){return e instanceof y||!(!e||!e[g])},m=function e(t,i,r){var n;if(!t)return p;if("string"==typeof t){var a=t.toLowerCase();f[a]&&(n=a),i&&(f[a]=i,n=a);var o=t.split("-");if(!n&&o.length>1)return e(o[0])}else{var s=t.name;f[s]=t,n=s}return!r&&n&&(p=n),n||!r&&p},b=function(e,t){if(w(e))return e.clone();var i="object"==typeof t?t:{};return i.date=e,i.args=arguments,new y(i)},v={s:h,z:function(e){var t=-e.utcOffset(),i=Math.abs(t);return(t<=0?"+":"-")+h(Math.floor(i/60),2,"0")+":"+h(i%60,2,"0")},m:function e(t,i){if(t.date()0,w<=g.r||!g.r){w<=1&&f>0&&(g=h[f-1]);var m=d[g.l];s&&(w=s(""+w)),l="string"==typeof m?m.replace("%d",w):m(w,r,g.l,u);break}}if(r)return l;var b=u?d.future:d.past;return"function"==typeof b?b(l):b.replace("%s",l)},r.to=function(e,t){return a(e,t,this,!0)},r.from=function(e,t){return a(e,t,this)};var o=function(e){return e.$u?i.utc():i()};r.toNow=function(e){return this.to(o(this),e)},r.fromNow=function(e){return this.from(o(this),e)}}},e.exports=t()},14488:function(e){var t;t=function(){return function(e,t,i){i.updateLocale=function(e,t){var r=i.Ls[e];if(r)return(t?Object.keys(t):[]).forEach(function(e){r[e]=t[e]}),r}}},e.exports=t()},34961:e=>{"use strict";var t="%[a-f0-9]{2}",i=RegExp("("+t+")|([^%]+?)","gi"),r=RegExp("("+t+")+","gi");e.exports=function(e){if("string"!=typeof e)throw TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof e+"`");try{return e=e.replace(/\+/g," "),decodeURIComponent(e)}catch(t){return function(e){for(var t={"%FE%FF":"��","%FF%FE":"��"},n=r.exec(e);n;){try{t[n[0]]=decodeURIComponent(n[0])}catch(e){var a=function(e){try{return decodeURIComponent(e)}catch(n){for(var t=e.match(i)||[],r=1;r{"use strict";i.d(t,{o0:()=>p});var r=i(18596),n=function(e,t,i){if(i||2==arguments.length)for(var r,n=0,a=t.length;n{"use strict";var t={single_source_shortest_paths:function(e,i,r){var n,a,o,s,c,l,u,d={},h={};h[i]=0;var p=t.PriorityQueue.make();for(p.push(i,0);!p.empty();)for(o in a=(n=p.pop()).value,s=n.cost,c=e[a]||{})c.hasOwnProperty(o)&&(l=s+c[o],u=h[o],(void 0===h[o]||u>l)&&(h[o]=l,p.push(o,l),d[o]=a));if(void 0!==r&&void 0===h[r])throw Error(["Could not find a path from ",i," to ",r,"."].join(""));return d},extract_shortest_path_from_predecessor_list:function(e,t){for(var i=[],r=t;r;)i.push(r),e[r],r=e[r];return i.reverse(),i},find_path:function(e,i,r){var n=t.single_source_shortest_paths(e,i,r);return t.extract_shortest_path_from_predecessor_list(n,r)},PriorityQueue:{make:function(e){var i,r=t.PriorityQueue,n={};for(i in e=e||{},r)r.hasOwnProperty(i)&&(n[i]=r[i]);return n.queue=[],n.sorter=e.sorter||r.default_sorter,n},default_sorter:function(e,t){return e.cost-t.cost},push:function(e,t){this.queue.push({value:e,cost:t}),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return 0===this.queue.length}}};e.exports=t},81256:(e,t,i)=>{"use strict";t.version=i(64112).rE,t.utils=i(46514),t.rand=i(2009),t.curve=i(87919),t.curves=i(17513),t.ec=i(10510),t.eddsa=i(64843)},36204:(e,t,i)=>{"use strict";var r=i(40707),n=i(46514),a=n.getNAF,o=n.getJSF,s=n.assert;function c(e,t){this.type=e,this.p=new r(t.p,16),this.red=t.prime?r.red(t.prime):r.mont(this.p),this.zero=new r(0).toRed(this.red),this.one=new r(1).toRed(this.red),this.two=new r(2).toRed(this.red),this.n=t.n&&new r(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=[,,,,],this._wnafT2=[,,,,],this._wnafT3=[,,,,],this._wnafT4=[,,,,],this._bitLength=this.n?this.n.bitLength():0;var i=this.n&&this.p.div(this.n);!i||i.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function l(e,t){this.curve=e,this.type=t,this.precomputed=null}e.exports=c,c.prototype.point=function(){throw Error("Not implemented")},c.prototype.validate=function(){throw Error("Not implemented")},c.prototype._fixedNafMul=function(e,t){s(e.precomputed);var i,r,n=e._getDoubles(),o=a(t,1,this._bitLength),c=(1<=i;u--)r=(r<<1)+o[u];l.push(r)}for(var d=this.jpoint(null,null,null),h=this.jpoint(null,null,null),p=c;p>0;p--){for(i=0;i=0;l--){for(var u=0;l>=0&&0===o[l];l--)u++;if(l>=0&&u++,c=c.dblp(u),l<0)break;var d=o[l];s(0!==d),c="affine"===e.type?d>0?c.mixedAdd(n[d-1>>1]):c.mixedAdd(n[-d-1>>1].neg()):d>0?c.add(n[d-1>>1]):c.add(n[-d-1>>1].neg())}return"affine"===e.type?c.toP():c},c.prototype._wnafMulAdd=function(e,t,i,r,n){var s,c,l,u=this._wnafT1,d=this._wnafT2,h=this._wnafT3,p=0;for(s=0;s=1;s-=2){var g=s-1,w=s;if(1!==u[g]||1!==u[w]){h[g]=a(i[g],u[g],this._bitLength),h[w]=a(i[w],u[w],this._bitLength),p=Math.max(h[g].length,p),p=Math.max(h[w].length,p);continue}var m=[t[g],null,null,t[w]];0===t[g].y.cmp(t[w].y)?(m[1]=t[g].add(t[w]),m[2]=t[g].toJ().mixedAdd(t[w].neg())):0===t[g].y.cmp(t[w].y.redNeg())?(m[1]=t[g].toJ().mixedAdd(t[w]),m[2]=t[g].add(t[w].neg())):(m[1]=t[g].toJ().mixedAdd(t[w]),m[2]=t[g].toJ().mixedAdd(t[w].neg()));var b=[-3,-1,-5,-7,0,7,5,1,3],v=o(i[g],i[w]);for(c=0,p=Math.max(v[0].length,p),h[g]=Array(p),h[w]=Array(p);c=0;s--){for(var E=0;s>=0;){var _=!0;for(c=0;c=0&&E++,C=C.dblp(E),s<0)break;for(c=0;c0?l=d[c][k-1>>1]:k<0&&(l=d[c][-k-1>>1].neg()),C="affine"===l.type?C.mixedAdd(l):C.add(l))}}for(s=0;s=Math.ceil((e.bitLength()+1)/t.step)},l.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var i=[this],r=this,n=0;n{"use strict";var r=i(46514),n=i(40707),a=i(4242),o=i(36204),s=r.assert;function c(e){this.twisted=(0|e.a)!=1,this.mOneA=this.twisted&&(0|e.a)==-1,this.extended=this.mOneA,o.call(this,"edwards",e),this.a=new n(e.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new n(e.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new n(e.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),s(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=(0|e.c)==1}function l(e,t,i,r,a){o.BasePoint.call(this,e,"projective"),null===t&&null===i&&null===r?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new n(t,16),this.y=new n(i,16),this.z=r?new n(r,16):this.curve.one,this.t=a&&new n(a,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,!this.curve.extended||this.t||(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}a(c,o),e.exports=c,c.prototype._mulA=function(e){return this.mOneA?e.redNeg():this.a.redMul(e)},c.prototype._mulC=function(e){return this.oneC?e:this.c.redMul(e)},c.prototype.jpoint=function(e,t,i,r){return this.point(e,t,i,r)},c.prototype.pointFromX=function(e,t){(e=new n(e,16)).red||(e=e.toRed(this.red));var i=e.redSqr(),r=this.c2.redSub(this.a.redMul(i)),a=this.one.redSub(this.c2.redMul(this.d).redMul(i)),o=r.redMul(a.redInvm()),s=o.redSqrt();if(0!==s.redSqr().redSub(o).cmp(this.zero))throw Error("invalid point");var c=s.fromRed().isOdd();return(t&&!c||!t&&c)&&(s=s.redNeg()),this.point(e,s)},c.prototype.pointFromY=function(e,t){(e=new n(e,16)).red||(e=e.toRed(this.red));var i=e.redSqr(),r=i.redSub(this.c2),a=i.redMul(this.d).redMul(this.c2).redSub(this.a),o=r.redMul(a.redInvm());if(0===o.cmp(this.zero)){if(!t)return this.point(this.zero,e);throw Error("invalid point")}var s=o.redSqrt();if(0!==s.redSqr().redSub(o).cmp(this.zero))throw Error("invalid point");return s.fromRed().isOdd()!==t&&(s=s.redNeg()),this.point(s,e)},c.prototype.validate=function(e){if(e.isInfinity())return!0;e.normalize();var t=e.x.redSqr(),i=e.y.redSqr(),r=t.redMul(this.a).redAdd(i),n=this.c2.redMul(this.one.redAdd(this.d.redMul(t).redMul(i)));return 0===r.cmp(n)},a(l,o.BasePoint),c.prototype.pointFromJSON=function(e){return l.fromJSON(this,e)},c.prototype.point=function(e,t,i,r){return new l(this,e,t,i,r)},l.fromJSON=function(e,t){return new l(e,t[0],t[1],t[2])},l.prototype.inspect=function(){return this.isInfinity()?"":""},l.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},l.prototype._extDbl=function(){var e=this.x.redSqr(),t=this.y.redSqr(),i=this.z.redSqr();i=i.redIAdd(i);var r=this.curve._mulA(e),n=this.x.redAdd(this.y).redSqr().redISub(e).redISub(t),a=r.redAdd(t),o=a.redSub(i),s=r.redSub(t),c=n.redMul(o),l=a.redMul(s),u=n.redMul(s),d=o.redMul(a);return this.curve.point(c,l,d,u)},l.prototype._projDbl=function(){var e,t,i,r,n,a,o=this.x.redAdd(this.y).redSqr(),s=this.x.redSqr(),c=this.y.redSqr();if(this.curve.twisted){var l=(r=this.curve._mulA(s)).redAdd(c);this.zOne?(e=o.redSub(s).redSub(c).redMul(l.redSub(this.curve.two)),t=l.redMul(r.redSub(c)),i=l.redSqr().redSub(l).redSub(l)):(n=this.z.redSqr(),a=l.redSub(n).redISub(n),e=o.redSub(s).redISub(c).redMul(a),t=l.redMul(r.redSub(c)),i=l.redMul(a))}else r=s.redAdd(c),n=this.curve._mulC(this.z).redSqr(),a=r.redSub(n).redSub(n),e=this.curve._mulC(o.redISub(r)).redMul(a),t=this.curve._mulC(r).redMul(s.redISub(c)),i=r.redMul(a);return this.curve.point(e,t,i)},l.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},l.prototype._extAdd=function(e){var t=this.y.redSub(this.x).redMul(e.y.redSub(e.x)),i=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),r=this.t.redMul(this.curve.dd).redMul(e.t),n=this.z.redMul(e.z.redAdd(e.z)),a=i.redSub(t),o=n.redSub(r),s=n.redAdd(r),c=i.redAdd(t),l=a.redMul(o),u=s.redMul(c),d=a.redMul(c),h=o.redMul(s);return this.curve.point(l,u,h,d)},l.prototype._projAdd=function(e){var t,i,r=this.z.redMul(e.z),n=r.redSqr(),a=this.x.redMul(e.x),o=this.y.redMul(e.y),s=this.curve.d.redMul(a).redMul(o),c=n.redSub(s),l=n.redAdd(s),u=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(a).redISub(o),d=r.redMul(c).redMul(u);return this.curve.twisted?(t=r.redMul(l).redMul(o.redSub(this.curve._mulA(a))),i=c.redMul(l)):(t=r.redMul(l).redMul(o.redSub(a)),i=this.curve._mulC(c).redMul(l)),this.curve.point(d,t,i)},l.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},l.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},l.prototype.mulAdd=function(e,t,i){return this.curve._wnafMulAdd(1,[this,t],[e,i],2,!1)},l.prototype.jmulAdd=function(e,t,i){return this.curve._wnafMulAdd(1,[this,t],[e,i],2,!0)},l.prototype.normalize=function(){if(this.zOne)return this;var e=this.z.redInvm();return this.x=this.x.redMul(e),this.y=this.y.redMul(e),this.t&&(this.t=this.t.redMul(e)),this.z=this.curve.one,this.zOne=!0,this},l.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},l.prototype.getX=function(){return this.normalize(),this.x.fromRed()},l.prototype.getY=function(){return this.normalize(),this.y.fromRed()},l.prototype.eq=function(e){return this===e||0===this.getX().cmp(e.getX())&&0===this.getY().cmp(e.getY())},l.prototype.eqXToP=function(e){var t=e.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(t))return!0;for(var i=e.clone(),r=this.curve.redN.redMul(this.z);;){if(i.iadd(this.curve.n),i.cmp(this.curve.p)>=0)return!1;if(t.redIAdd(r),0===this.x.cmp(t))return!0}},l.prototype.toP=l.prototype.normalize,l.prototype.mixedAdd=l.prototype.add},87919:(e,t,i)=>{"use strict";t.base=i(36204),t.short=i(61453),t.mont=i(60147),t.edwards=i(5275)},60147:(e,t,i)=>{"use strict";var r=i(40707),n=i(4242),a=i(36204),o=i(46514);function s(e){a.call(this,"mont",e),this.a=new r(e.a,16).toRed(this.red),this.b=new r(e.b,16).toRed(this.red),this.i4=new r(4).toRed(this.red).redInvm(),this.two=new r(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function c(e,t,i){a.BasePoint.call(this,e,"projective"),null===t&&null===i?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new r(t,16),this.z=new r(i,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}n(s,a),e.exports=s,s.prototype.validate=function(e){var t=e.normalize().x,i=t.redSqr(),r=i.redMul(t).redAdd(i.redMul(this.a)).redAdd(t);return 0===r.redSqrt().redSqr().cmp(r)},n(c,a.BasePoint),s.prototype.decodePoint=function(e,t){return this.point(o.toArray(e,t),1)},s.prototype.point=function(e,t){return new c(this,e,t)},s.prototype.pointFromJSON=function(e){return c.fromJSON(this,e)},c.prototype.precompute=function(){},c.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},c.fromJSON=function(e,t){return new c(e,t[0],t[1]||e.one)},c.prototype.inspect=function(){return this.isInfinity()?"":""},c.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},c.prototype.dbl=function(){var e=this.x.redAdd(this.z).redSqr(),t=this.x.redSub(this.z).redSqr(),i=e.redSub(t),r=e.redMul(t),n=i.redMul(t.redAdd(this.curve.a24.redMul(i)));return this.curve.point(r,n)},c.prototype.add=function(){throw Error("Not supported on Montgomery curve")},c.prototype.diffAdd=function(e,t){var i=this.x.redAdd(this.z),r=this.x.redSub(this.z),n=e.x.redAdd(e.z),a=e.x.redSub(e.z).redMul(i),o=n.redMul(r),s=t.z.redMul(a.redAdd(o).redSqr()),c=t.x.redMul(a.redISub(o).redSqr());return this.curve.point(s,c)},c.prototype.mul=function(e){for(var t=e.clone(),i=this,r=this.curve.point(null,null),n=[];0!==t.cmpn(0);t.iushrn(1))n.push(t.andln(1));for(var a=n.length-1;a>=0;a--)0===n[a]?(i=i.diffAdd(r,this),r=r.dbl()):(r=i.diffAdd(r,this),i=i.dbl());return r},c.prototype.mulAdd=function(){throw Error("Not supported on Montgomery curve")},c.prototype.jumlAdd=function(){throw Error("Not supported on Montgomery curve")},c.prototype.eq=function(e){return 0===this.getX().cmp(e.getX())},c.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},c.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},61453:(e,t,i)=>{"use strict";var r=i(46514),n=i(40707),a=i(4242),o=i(36204),s=r.assert;function c(e){o.call(this,"short",e),this.a=new n(e.a,16).toRed(this.red),this.b=new n(e.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(e),this._endoWnafT1=[,,,,],this._endoWnafT2=[,,,,]}function l(e,t,i,r){o.BasePoint.call(this,e,"affine"),null===t&&null===i?(this.x=null,this.y=null,this.inf=!0):(this.x=new n(t,16),this.y=new n(i,16),r&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function u(e,t,i,r){o.BasePoint.call(this,e,"jacobian"),null===t&&null===i&&null===r?(this.x=this.curve.one,this.y=this.curve.one,this.z=new n(0)):(this.x=new n(t,16),this.y=new n(i,16),this.z=new n(r,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}a(c,o),e.exports=c,c.prototype._getEndomorphism=function(e){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){if(e.beta)t=new n(e.beta,16).toRed(this.red);else{var t,i,r,a=this._getEndoRoots(this.p);t=(t=0>a[0].cmp(a[1])?a[0]:a[1]).toRed(this.red)}if(e.lambda)i=new n(e.lambda,16);else{var o=this._getEndoRoots(this.n);0===this.g.mul(o[0]).x.cmp(this.g.x.redMul(t))?i=o[0]:(i=o[1],s(0===this.g.mul(i).x.cmp(this.g.x.redMul(t))))}return r=e.basis?e.basis.map(function(e){return{a:new n(e.a,16),b:new n(e.b,16)}}):this._getEndoBasis(i),{beta:t,lambda:i,basis:r}}},c.prototype._getEndoRoots=function(e){var t=e===this.p?this.red:n.mont(e),i=new n(2).toRed(t).redInvm(),r=i.redNeg(),a=new n(3).toRed(t).redNeg().redSqrt().redMul(i);return[r.redAdd(a).fromRed(),r.redSub(a).fromRed()]},c.prototype._getEndoBasis=function(e){for(var t,i,r,a,o,s,c,l,u,d=this.n.ushrn(Math.floor(this.n.bitLength()/2)),h=e,p=this.n.clone(),f=new n(1),g=new n(0),w=new n(0),m=new n(1),b=0;0!==h.cmpn(0);){var v=p.div(h);l=p.sub(v.mul(h)),u=w.sub(v.mul(f));var y=m.sub(v.mul(g));if(!r&&0>l.cmp(d))t=c.neg(),i=f,r=l.neg(),a=u;else if(r&&2==++b)break;c=l,p=h,h=l,w=f,f=u,m=g,g=y}o=l.neg(),s=u;var x=r.sqr().add(a.sqr());return o.sqr().add(s.sqr()).cmp(x)>=0&&(o=t,s=i),r.negative&&(r=r.neg(),a=a.neg()),o.negative&&(o=o.neg(),s=s.neg()),[{a:r,b:a},{a:o,b:s}]},c.prototype._endoSplit=function(e){var t=this.endo.basis,i=t[0],r=t[1],n=r.b.mul(e).divRound(this.n),a=i.b.neg().mul(e).divRound(this.n),o=n.mul(i.a),s=a.mul(r.a),c=n.mul(i.b),l=a.mul(r.b);return{k1:e.sub(o).sub(s),k2:c.add(l).neg()}},c.prototype.pointFromX=function(e,t){(e=new n(e,16)).red||(e=e.toRed(this.red));var i=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),r=i.redSqrt();if(0!==r.redSqr().redSub(i).cmp(this.zero))throw Error("invalid point");var a=r.fromRed().isOdd();return(t&&!a||!t&&a)&&(r=r.redNeg()),this.point(e,r)},c.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,i=e.y,r=this.a.redMul(t),n=t.redSqr().redMul(t).redIAdd(r).redIAdd(this.b);return 0===i.redSqr().redISub(n).cmpn(0)},c.prototype._endoWnafMulAdd=function(e,t,i){for(var r=this._endoWnafT1,n=this._endoWnafT2,a=0;a":""},l.prototype.isInfinity=function(){return this.inf},l.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e)||0===this.x.cmp(e.x))return this.curve.point(null,null);var t=this.y.redSub(e.y);0!==t.cmpn(0)&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var i=t.redSqr().redISub(this.x).redISub(e.x),r=t.redMul(this.x.redSub(i)).redISub(this.y);return this.curve.point(i,r)},l.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var t=this.curve.a,i=this.x.redSqr(),r=e.redInvm(),n=i.redAdd(i).redIAdd(i).redIAdd(t).redMul(r),a=n.redSqr().redISub(this.x.redAdd(this.x)),o=n.redMul(this.x.redSub(a)).redISub(this.y);return this.curve.point(a,o)},l.prototype.getX=function(){return this.x.fromRed()},l.prototype.getY=function(){return this.y.fromRed()},l.prototype.mul=function(e){return(e=new n(e,16),this.isInfinity())?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},l.prototype.mulAdd=function(e,t,i){var r=[this,t],n=[e,i];return this.curve.endo?this.curve._endoWnafMulAdd(r,n):this.curve._wnafMulAdd(1,r,n,2)},l.prototype.jmulAdd=function(e,t,i){var r=[this,t],n=[e,i];return this.curve.endo?this.curve._endoWnafMulAdd(r,n,!0):this.curve._wnafMulAdd(1,r,n,2,!0)},l.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||0===this.x.cmp(e.x)&&0===this.y.cmp(e.y))},l.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var i=this.precomputed,r=function(e){return e.neg()};t.precomputed={naf:i.naf&&{wnd:i.naf.wnd,points:i.naf.points.map(r)},doubles:i.doubles&&{step:i.doubles.step,points:i.doubles.points.map(r)}}}return t},l.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},a(u,o.BasePoint),c.prototype.jpoint=function(e,t,i){return new u(this,e,t,i)},u.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),i=this.x.redMul(t),r=this.y.redMul(t).redMul(e);return this.curve.point(i,r)},u.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},u.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),i=this.z.redSqr(),r=this.x.redMul(t),n=e.x.redMul(i),a=this.y.redMul(t.redMul(e.z)),o=e.y.redMul(i.redMul(this.z)),s=r.redSub(n),c=a.redSub(o);if(0===s.cmpn(0))return 0!==c.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var l=s.redSqr(),u=l.redMul(s),d=r.redMul(l),h=c.redSqr().redIAdd(u).redISub(d).redISub(d),p=c.redMul(d.redISub(h)).redISub(a.redMul(u)),f=this.z.redMul(e.z).redMul(s);return this.curve.jpoint(h,p,f)},u.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),i=this.x,r=e.x.redMul(t),n=this.y,a=e.y.redMul(t).redMul(this.z),o=i.redSub(r),s=n.redSub(a);if(0===o.cmpn(0))return 0!==s.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=o.redSqr(),l=c.redMul(o),u=i.redMul(c),d=s.redSqr().redIAdd(l).redISub(u).redISub(u),h=s.redMul(u.redISub(d)).redISub(n.redMul(l)),p=this.z.redMul(o);return this.curve.jpoint(d,h,p)},u.prototype.dblp=function(e){if(0===e||this.isInfinity())return this;if(!e)return this.dbl();if(this.curve.zeroA||this.curve.threeA){var t,i=this;for(t=0;t=0)return!1;if(i.redIAdd(n),0===this.x.cmp(i))return!0}},u.prototype.inspect=function(){return this.isInfinity()?"":""},u.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},17513:(e,t,i)=>{"use strict";var r,n=i(13108),a=i(87919),o=i(46514).assert;function s(e){"short"===e.type?this.curve=new a.short(e):"edwards"===e.type?this.curve=new a.edwards(e):this.curve=new a.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,o(this.g.validate(),"Invalid curve"),o(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function c(e,i){Object.defineProperty(t,e,{configurable:!0,enumerable:!0,get:function(){var r=new s(i);return Object.defineProperty(t,e,{configurable:!0,enumerable:!0,value:r}),r}})}t.PresetCurve=s,c("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:n.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),c("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:n.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),c("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:n.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),c("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:n.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),c("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:n.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),c("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:n.sha256,gRed:!1,g:["9"]}),c("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:n.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{r=i(89962)}catch(e){r=void 0}c("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:n.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",r]})},10510:(e,t,i)=>{"use strict";var r=i(40707),n=i(76304),a=i(46514),o=i(17513),s=i(2009),c=a.assert,l=i(74169),u=i(13160);function d(e){if(!(this instanceof d))return new d(e);"string"==typeof e&&(c(Object.prototype.hasOwnProperty.call(o,e),"Unknown curve "+e),e=o[e]),e instanceof o.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}e.exports=d,d.prototype.keyPair=function(e){return new l(this,e)},d.prototype.keyFromPrivate=function(e,t){return l.fromPrivate(this,e,t)},d.prototype.keyFromPublic=function(e,t){return l.fromPublic(this,e,t)},d.prototype.genKeyPair=function(e){e||(e={});for(var t=new n({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||s(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),i=this.n.byteLength(),a=this.n.sub(new r(2));;){var o=new r(t.generate(i));if(!(o.cmp(a)>0))return o.iaddn(1),this.keyFromPrivate(o)}},d.prototype._truncateToN=function(e,t,i){if(r.isBN(e)||"number"==typeof e)n=(e=new r(e,16)).byteLength();else if("object"==typeof e)n=e.length,e=new r(e,16);else{var n,a=e.toString();n=a.length+1>>>1,e=new r(a,16)}"number"!=typeof i&&(i=8*n);var o=i-this.n.bitLength();return(o>0&&(e=e.ushrn(o)),!t&&e.cmp(this.n)>=0)?e.sub(this.n):e},d.prototype.sign=function(e,t,i,a){if("object"==typeof i&&(a=i,i=null),a||(a={}),"string"!=typeof e&&"number"!=typeof e&&!r.isBN(e)){c("object"==typeof e&&e&&"number"==typeof e.length,"Expected message to be an array-like, a hex string, or a BN instance"),c(e.length>>>0===e.length);for(var o=0;o=(g=this._truncateToN(g,!0)).cmpn(1)||g.cmp(p)>=0)){var w=this.g.mul(g);if(!w.isInfinity()){var m=w.getX(),b=m.umod(this.n);if(0!==b.cmpn(0)){var v=g.invm(this.n).mul(b.mul(t.getPrivate()).iadd(e));if(0!==(v=v.umod(this.n)).cmpn(0)){var y=(w.getY().isOdd()?1:0)|(0!==m.cmp(b)?2:0);return a.canonical&&v.cmp(this.nh)>0&&(v=this.n.sub(v),y^=1),new u({r:b,s:v,recoveryParam:y})}}}}}},d.prototype.verify=function(e,t,i,r,n){n||(n={}),e=this._truncateToN(e,!1,n.msgBitLength),i=this.keyFromPublic(i,r);var a,o=(t=new u(t,"hex")).r,s=t.s;if(0>o.cmpn(1)||o.cmp(this.n)>=0||0>s.cmpn(1)||s.cmp(this.n)>=0)return!1;var c=s.invm(this.n),l=c.mul(e).umod(this.n),d=c.mul(o).umod(this.n);return this.curve._maxwellTrick?!(a=this.g.jmulAdd(l,i.getPublic(),d)).isInfinity()&&a.eqXToP(o):!(a=this.g.mulAdd(l,i.getPublic(),d)).isInfinity()&&0===a.getX().umod(this.n).cmp(o)},d.prototype.recoverPubKey=function(e,t,i,n){c((3&i)===i,"The recovery param is more than two bits"),t=new u(t,n);var a=this.n,o=new r(e),s=t.r,l=t.s,d=1&i,h=i>>1;if(s.cmp(this.curve.p.umod(this.curve.n))>=0&&h)throw Error("Unable to find sencond key candinate");s=h?this.curve.pointFromX(s.add(this.curve.n),d):this.curve.pointFromX(s,d);var p=t.r.invm(a),f=a.sub(o).mul(p).umod(a),g=l.mul(p).umod(a);return this.g.mulAdd(f,s,g)},d.prototype.getKeyRecoveryParam=function(e,t,i,r){if(null!==(t=new u(t,r)).recoveryParam)return t.recoveryParam;for(var n,a=0;a<4;a++){try{n=this.recoverPubKey(e,t,a)}catch(e){continue}if(n.eq(i))return a}throw Error("Unable to find valid recovery factor")}},74169:(e,t,i)=>{"use strict";var r=i(40707),n=i(46514).assert;function a(e,t){this.ec=e,this.priv=null,this.pub=null,t.priv&&this._importPrivate(t.priv,t.privEnc),t.pub&&this._importPublic(t.pub,t.pubEnc)}e.exports=a,a.fromPublic=function(e,t,i){return t instanceof a?t:new a(e,{pub:t,pubEnc:i})},a.fromPrivate=function(e,t,i){return t instanceof a?t:new a(e,{priv:t,privEnc:i})},a.prototype.validate=function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},a.prototype.getPublic=function(e,t){return("string"==typeof e&&(t=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),t)?this.pub.encode(t,e):this.pub},a.prototype.getPrivate=function(e){return"hex"===e?this.priv.toString(16,2):this.priv},a.prototype._importPrivate=function(e,t){this.priv=new r(e,t||16),this.priv=this.priv.umod(this.ec.curve.n)},a.prototype._importPublic=function(e,t){if(e.x||e.y){"mont"===this.ec.curve.type?n(e.x,"Need x coordinate"):("short"===this.ec.curve.type||"edwards"===this.ec.curve.type)&&n(e.x&&e.y,"Need both x and y coordinate"),this.pub=this.ec.curve.point(e.x,e.y);return}this.pub=this.ec.curve.decodePoint(e,t)},a.prototype.derive=function(e){return e.validate()||n(e.validate(),"public point not validated"),e.mul(this.priv).getX()},a.prototype.sign=function(e,t,i){return this.ec.sign(e,this,t,i)},a.prototype.verify=function(e,t,i){return this.ec.verify(e,t,this,void 0,i)},a.prototype.inspect=function(){return""}},13160:(e,t,i)=>{"use strict";var r=i(40707),n=i(46514),a=n.assert;function o(e,t){if(e instanceof o)return e;this._importDER(e,t)||(a(e.r&&e.s,"Signature without r or s"),this.r=new r(e.r,16),this.s=new r(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}function s(){this.place=0}function c(e,t){var i=e[t.place++];if(!(128&i))return i;var r=15&i;if(0===r||r>4||0===e[t.place])return!1;for(var n=0,a=0,o=t.place;a>>=0;return!(n<=127)&&(t.place=o,n)}function l(e){for(var t=0,i=e.length-1;!e[t]&&!(128&e[t+1])&&t>>3);for(e.push(128|i);--i;)e.push(t>>>(i<<3)&255);e.push(t)}e.exports=o,o.prototype._importDER=function(e,t){e=n.toArray(e,t);var i=new s;if(48!==e[i.place++])return!1;var a=c(e,i);if(!1===a||a+i.place!==e.length||2!==e[i.place++])return!1;var o=c(e,i);if(!1===o||(128&e[i.place])!=0)return!1;var l=e.slice(i.place,o+i.place);if(i.place+=o,2!==e[i.place++])return!1;var u=c(e,i);if(!1===u||e.length!==u+i.place||(128&e[i.place])!=0)return!1;var d=e.slice(i.place,u+i.place);if(0===l[0]){if(!(128&l[1]))return!1;l=l.slice(1)}if(0===d[0]){if(!(128&d[1]))return!1;d=d.slice(1)}return this.r=new r(l),this.s=new r(d),this.recoveryParam=null,!0},o.prototype.toDER=function(e){var t=this.r.toArray(),i=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&i[0]&&(i=[0].concat(i)),t=l(t),i=l(i);!i[0]&&!(128&i[1]);)i=i.slice(1);var r=[2];u(r,t.length),(r=r.concat(t)).push(2),u(r,i.length);var a=r.concat(i),o=[48];return u(o,a.length),o=o.concat(a),n.encode(o,e)}},64843:(e,t,i)=>{"use strict";var r=i(13108),n=i(17513),a=i(46514),o=a.assert,s=a.parseBytes,c=i(77220),l=i(94797);function u(e){if(o("ed25519"===e,"only tested with ed25519 so far"),!(this instanceof u))return new u(e);e=n[e].curve,this.curve=e,this.g=e.g,this.g.precompute(e.n.bitLength()+1),this.pointClass=e.point().constructor,this.encodingLength=Math.ceil(e.n.bitLength()/8),this.hash=r.sha512}e.exports=u,u.prototype.sign=function(e,t){e=s(e);var i=this.keyFromSecret(t),r=this.hashInt(i.messagePrefix(),e),n=this.g.mul(r),a=this.encodePoint(n),o=this.hashInt(a,i.pubBytes(),e).mul(i.priv()),c=r.add(o).umod(this.curve.n);return this.makeSignature({R:n,S:c,Rencoded:a})},u.prototype.verify=function(e,t,i){if(e=s(e),(t=this.makeSignature(t)).S().gte(t.eddsa.curve.n)||t.S().isNeg())return!1;var r=this.keyFromPublic(i),n=this.hashInt(t.Rencoded(),r.pubBytes(),e),a=this.g.mul(t.S());return t.R().add(r.pub().mul(n)).eq(a)},u.prototype.hashInt=function(){for(var e=this.hash(),t=0;t{"use strict";var r=i(46514),n=r.assert,a=r.parseBytes,o=r.cachedProperty;function s(e,t){this.eddsa=e,this._secret=a(t.secret),e.isPoint(t.pub)?this._pub=t.pub:this._pubBytes=a(t.pub)}s.fromPublic=function(e,t){return t instanceof s?t:new s(e,{pub:t})},s.fromSecret=function(e,t){return t instanceof s?t:new s(e,{secret:t})},s.prototype.secret=function(){return this._secret},o(s,"pubBytes",function(){return this.eddsa.encodePoint(this.pub())}),o(s,"pub",function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())}),o(s,"privBytes",function(){var e=this.eddsa,t=this.hash(),i=e.encodingLength-1,r=t.slice(0,e.encodingLength);return r[0]&=248,r[i]&=127,r[i]|=64,r}),o(s,"priv",function(){return this.eddsa.decodeInt(this.privBytes())}),o(s,"hash",function(){return this.eddsa.hash().update(this.secret()).digest()}),o(s,"messagePrefix",function(){return this.hash().slice(this.eddsa.encodingLength)}),s.prototype.sign=function(e){return n(this._secret,"KeyPair can only verify"),this.eddsa.sign(e,this)},s.prototype.verify=function(e,t){return this.eddsa.verify(e,t,this)},s.prototype.getSecret=function(e){return n(this._secret,"KeyPair is public only"),r.encode(this.secret(),e)},s.prototype.getPublic=function(e){return r.encode(this.pubBytes(),e)},e.exports=s},94797:(e,t,i)=>{"use strict";var r=i(40707),n=i(46514),a=n.assert,o=n.cachedProperty,s=n.parseBytes;function c(e,t){this.eddsa=e,"object"!=typeof t&&(t=s(t)),Array.isArray(t)&&(a(t.length===2*e.encodingLength,"Signature has invalid size"),t={R:t.slice(0,e.encodingLength),S:t.slice(e.encodingLength)}),a(t.R&&t.S,"Signature without R or S"),e.isPoint(t.R)&&(this._R=t.R),t.S instanceof r&&(this._S=t.S),this._Rencoded=Array.isArray(t.R)?t.R:t.Rencoded,this._Sencoded=Array.isArray(t.S)?t.S:t.Sencoded}o(c,"S",function(){return this.eddsa.decodeInt(this.Sencoded())}),o(c,"R",function(){return this.eddsa.decodePoint(this.Rencoded())}),o(c,"Rencoded",function(){return this.eddsa.encodePoint(this.R())}),o(c,"Sencoded",function(){return this.eddsa.encodeInt(this.S())}),c.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},c.prototype.toHex=function(){return n.encode(this.toBytes(),"hex").toUpperCase()},e.exports=c},89962:e=>{e.exports={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}}},46514:(e,t,i)=>{"use strict";var r=i(40707),n=i(28113),a=i(89150);t.assert=n,t.toArray=a.toArray,t.zero2=a.zero2,t.toHex=a.toHex,t.encode=a.encode,t.getNAF=function(e,t,i){var r=Array(Math.max(e.bitLength(),i)+1);for(o=0;o(n>>1)-1?(n>>1)-c:c,a.isubn(s)):s=0,r[o]=s,a.iushrn(1)}return r},t.getJSF=function(e,t){var i=[[],[]];e=e.clone(),t=t.clone();for(var r=0,n=0;e.cmpn(-r)>0||t.cmpn(-n)>0;){var a,o,s,c=e.andln(3)+r&3,l=t.andln(3)+n&3;3===c&&(c=-1),3===l&&(l=-1),o=(1&c)==0?0:(3==(a=e.andln(7)+r&7)||5===a)&&2===l?-c:c,i[0].push(o),s=(1&l)==0?0:(3==(a=t.andln(7)+n&7)||5===a)&&2===c?-l:l,i[1].push(s),2*r===o+1&&(r=1-r),2*n===s+1&&(n=1-n),e.iushrn(1),t.iushrn(1)}return i},t.cachedProperty=function(e,t,i){var r="_"+t;e.prototype[t]=function(){return void 0!==this[r]?this[r]:this[r]=i.call(this)}},t.parseBytes=function(e){return"string"==typeof e?t.toArray(e,"hex"):e},t.intFromLE=function(e){return new r(e,"hex","le")}},31159:e=>{"use strict";e.exports=function(e){for(var t=[],i=e.length,r=0;r=55296&&n<=56319&&i>r+1){var a=e.charCodeAt(r+1);a>=56320&&a<=57343&&(n=(n-55296)*1024+a-56320+65536,r+=1)}if(n<128){t.push(n);continue}if(n<2048){t.push(n>>6|192),t.push(63&n|128);continue}if(n<55296||n>=57344&&n<65536){t.push(n>>12|224),t.push(n>>6&63|128),t.push(63&n|128);continue}if(n>=65536&&n<=1114111){t.push(n>>18|240),t.push(n>>12&63|128),t.push(n>>6&63|128),t.push(63&n|128);continue}t.push(239,191,189)}return new Uint8Array(t).buffer}},30855:e=>{"use strict";var t=Object.prototype.hasOwnProperty,i="~";function r(){}function n(e,t,i){this.fn=e,this.context=t,this.once=i||!1}function a(e,t,r,a,o){if("function"!=typeof r)throw TypeError("The listener must be a function");var s=new n(r,a||e,o),c=i?i+t:t;return e._events[c]?e._events[c].fn?e._events[c]=[e._events[c],s]:e._events[c].push(s):(e._events[c]=s,e._eventsCount++),e}function o(e,t){0==--e._eventsCount?e._events=new r:delete e._events[t]}function s(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(i=!1)),s.prototype.eventNames=function(){var e,r,n=[];if(0===this._eventsCount)return n;for(r in e=this._events)t.call(e,r)&&n.push(i?r.slice(1):r);return Object.getOwnPropertySymbols?n.concat(Object.getOwnPropertySymbols(e)):n},s.prototype.listeners=function(e){var t=i?i+e:e,r=this._events[t];if(!r)return[];if(r.fn)return[r.fn];for(var n=0,a=r.length,o=Array(a);n{"use strict";e.exports=function(e,t){for(var i={},r=Object.keys(e),n=Array.isArray(t),a=0;a{t.utils=i(1982),t.common=i(35944),t.sha=i(44805),t.ripemd=i(42102),t.hmac=i(14094),t.sha1=t.sha.sha1,t.sha256=t.sha.sha256,t.sha224=t.sha.sha224,t.sha384=t.sha.sha384,t.sha512=t.sha.sha512,t.ripemd160=t.ripemd.ripemd160},35944:(e,t,i)=>{"use strict";var r=i(1982),n=i(28113);function a(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}t.BlockHash=a,a.prototype.update=function(e,t){if(e=r.toArray(e,t),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){var i=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-i,e.length),0===this.pending.length&&(this.pending=null),e=r.join32(e,0,e.length-i,this.endian);for(var n=0;n>>24&255,r[n++]=e>>>16&255,r[n++]=e>>>8&255,r[n++]=255&e}else for(a=8,r[n++]=255&e,r[n++]=e>>>8&255,r[n++]=e>>>16&255,r[n++]=e>>>24&255,r[n++]=0,r[n++]=0,r[n++]=0,r[n++]=0;a{"use strict";var r=i(1982),n=i(28113);function a(e,t,i){if(!(this instanceof a))return new a(e,t,i);this.Hash=e,this.blockSize=e.blockSize/8,this.outSize=e.outSize/8,this.inner=null,this.outer=null,this._init(r.toArray(t,i))}e.exports=a,a.prototype._init=function(e){e.length>this.blockSize&&(e=new this.Hash().update(e).digest()),n(e.length<=this.blockSize);for(var t=e.length;t{"use strict";var r=i(1982),n=i(35944),a=r.rotl32,o=r.sum32,s=r.sum32_3,c=r.sum32_4,l=n.BlockHash;function u(){if(!(this instanceof u))return new u;l.call(this),this.h=[0x67452301,0xefcdab89,0x98badcfe,0x10325476,0xc3d2e1f0],this.endian="little"}function d(e,t,i,r){return e<=15?t^i^r:e<=31?t&i|~t&r:e<=47?(t|~i)^r:e<=63?t&r|i&~r:t^(i|~r)}r.inherits(u,l),t.ripemd160=u,u.blockSize=512,u.outSize=160,u.hmacStrength=192,u.padLength=64,u.prototype._update=function(e,t){for(var i=this.h[0],r=this.h[1],n=this.h[2],l=this.h[3],u=this.h[4],w=i,m=r,b=n,v=l,y=u,x=0;x<80;x++){var C,A,E=o(a(c(i,d(x,r,n,l),e[h[x]+t],(C=x)<=15?0:C<=31?0x5a827999:C<=47?0x6ed9eba1:C<=63?0x8f1bbcdc:0xa953fd4e),f[x]),u);i=u,u=l,l=a(n,10),n=r,r=E,E=o(a(c(w,d(79-x,m,b,v),e[p[x]+t],(A=x)<=15?0x50a28be6:A<=31?0x5c4dd124:A<=47?0x6d703ef3:A<=63?0x7a6d76e9:0),g[x]),y),w=y,y=v,v=a(b,10),b=m,m=E}E=s(this.h[1],n,v),this.h[1]=s(this.h[2],l,y),this.h[2]=s(this.h[3],u,w),this.h[3]=s(this.h[4],i,m),this.h[4]=s(this.h[0],r,b),this.h[0]=E},u.prototype._digest=function(e){return"hex"===e?r.toHex32(this.h,"little"):r.split32(this.h,"little")};var h=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],p=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],f=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],g=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]},44805:(e,t,i)=>{"use strict";t.sha1=i(36641),t.sha224=i(29758),t.sha256=i(85031),t.sha384=i(48751),t.sha512=i(51150)},36641:(e,t,i)=>{"use strict";var r=i(1982),n=i(35944),a=i(51707),o=r.rotl32,s=r.sum32,c=r.sum32_5,l=a.ft_1,u=n.BlockHash,d=[0x5a827999,0x6ed9eba1,0x8f1bbcdc,0xca62c1d6];function h(){if(!(this instanceof h))return new h;u.call(this),this.h=[0x67452301,0xefcdab89,0x98badcfe,0x10325476,0xc3d2e1f0],this.W=Array(80)}r.inherits(h,u),e.exports=h,h.blockSize=512,h.outSize=160,h.hmacStrength=80,h.padLength=64,h.prototype._update=function(e,t){for(var i=this.W,r=0;r<16;r++)i[r]=e[t+r];for(;r{"use strict";var r=i(1982),n=i(85031);function a(){if(!(this instanceof a))return new a;n.call(this),this.h=[0xc1059ed8,0x367cd507,0x3070dd17,0xf70e5939,0xffc00b31,0x68581511,0x64f98fa7,0xbefa4fa4]}r.inherits(a,n),e.exports=a,a.blockSize=512,a.outSize=224,a.hmacStrength=192,a.padLength=64,a.prototype._digest=function(e){return"hex"===e?r.toHex32(this.h.slice(0,7),"big"):r.split32(this.h.slice(0,7),"big")}},85031:(e,t,i)=>{"use strict";var r=i(1982),n=i(35944),a=i(51707),o=i(28113),s=r.sum32,c=r.sum32_4,l=r.sum32_5,u=a.ch32,d=a.maj32,h=a.s0_256,p=a.s1_256,f=a.g0_256,g=a.g1_256,w=n.BlockHash,m=[0x428a2f98,0x71374491,0xb5c0fbcf,0xe9b5dba5,0x3956c25b,0x59f111f1,0x923f82a4,0xab1c5ed5,0xd807aa98,0x12835b01,0x243185be,0x550c7dc3,0x72be5d74,0x80deb1fe,0x9bdc06a7,0xc19bf174,0xe49b69c1,0xefbe4786,0xfc19dc6,0x240ca1cc,0x2de92c6f,0x4a7484aa,0x5cb0a9dc,0x76f988da,0x983e5152,0xa831c66d,0xb00327c8,0xbf597fc7,0xc6e00bf3,0xd5a79147,0x6ca6351,0x14292967,0x27b70a85,0x2e1b2138,0x4d2c6dfc,0x53380d13,0x650a7354,0x766a0abb,0x81c2c92e,0x92722c85,0xa2bfe8a1,0xa81a664b,0xc24b8b70,0xc76c51a3,0xd192e819,0xd6990624,0xf40e3585,0x106aa070,0x19a4c116,0x1e376c08,0x2748774c,0x34b0bcb5,0x391c0cb3,0x4ed8aa4a,0x5b9cca4f,0x682e6ff3,0x748f82ee,0x78a5636f,0x84c87814,0x8cc70208,0x90befffa,0xa4506ceb,0xbef9a3f7,0xc67178f2];function b(){if(!(this instanceof b))return new b;w.call(this),this.h=[0x6a09e667,0xbb67ae85,0x3c6ef372,0xa54ff53a,0x510e527f,0x9b05688c,0x1f83d9ab,0x5be0cd19],this.k=m,this.W=Array(64)}r.inherits(b,w),e.exports=b,b.blockSize=512,b.outSize=256,b.hmacStrength=192,b.padLength=64,b.prototype._update=function(e,t){for(var i=this.W,r=0;r<16;r++)i[r]=e[t+r];for(;r{"use strict";var r=i(1982),n=i(51150);function a(){if(!(this instanceof a))return new a;n.call(this),this.h=[0xcbbb9d5d,0xc1059ed8,0x629a292a,0x367cd507,0x9159015a,0x3070dd17,0x152fecd8,0xf70e5939,0x67332667,0xffc00b31,0x8eb44a87,0x68581511,0xdb0c2e0d,0x64f98fa7,0x47b5481d,0xbefa4fa4]}r.inherits(a,n),e.exports=a,a.blockSize=1024,a.outSize=384,a.hmacStrength=192,a.padLength=128,a.prototype._digest=function(e){return"hex"===e?r.toHex32(this.h.slice(0,12),"big"):r.split32(this.h.slice(0,12),"big")}},51150:(e,t,i)=>{"use strict";var r=i(1982),n=i(35944),a=i(28113),o=r.rotr64_hi,s=r.rotr64_lo,c=r.shr64_hi,l=r.shr64_lo,u=r.sum64,d=r.sum64_hi,h=r.sum64_lo,p=r.sum64_4_hi,f=r.sum64_4_lo,g=r.sum64_5_hi,w=r.sum64_5_lo,m=n.BlockHash,b=[0x428a2f98,0xd728ae22,0x71374491,0x23ef65cd,0xb5c0fbcf,0xec4d3b2f,0xe9b5dba5,0x8189dbbc,0x3956c25b,0xf348b538,0x59f111f1,0xb605d019,0x923f82a4,0xaf194f9b,0xab1c5ed5,0xda6d8118,0xd807aa98,0xa3030242,0x12835b01,0x45706fbe,0x243185be,0x4ee4b28c,0x550c7dc3,0xd5ffb4e2,0x72be5d74,0xf27b896f,0x80deb1fe,0x3b1696b1,0x9bdc06a7,0x25c71235,0xc19bf174,0xcf692694,0xe49b69c1,0x9ef14ad2,0xefbe4786,0x384f25e3,0xfc19dc6,0x8b8cd5b5,0x240ca1cc,0x77ac9c65,0x2de92c6f,0x592b0275,0x4a7484aa,0x6ea6e483,0x5cb0a9dc,0xbd41fbd4,0x76f988da,0x831153b5,0x983e5152,0xee66dfab,0xa831c66d,0x2db43210,0xb00327c8,0x98fb213f,0xbf597fc7,0xbeef0ee4,0xc6e00bf3,0x3da88fc2,0xd5a79147,0x930aa725,0x6ca6351,0xe003826f,0x14292967,0xa0e6e70,0x27b70a85,0x46d22ffc,0x2e1b2138,0x5c26c926,0x4d2c6dfc,0x5ac42aed,0x53380d13,0x9d95b3df,0x650a7354,0x8baf63de,0x766a0abb,0x3c77b2a8,0x81c2c92e,0x47edaee6,0x92722c85,0x1482353b,0xa2bfe8a1,0x4cf10364,0xa81a664b,0xbc423001,0xc24b8b70,0xd0f89791,0xc76c51a3,0x654be30,0xd192e819,0xd6ef5218,0xd6990624,0x5565a910,0xf40e3585,0x5771202a,0x106aa070,0x32bbd1b8,0x19a4c116,0xb8d2d0c8,0x1e376c08,0x5141ab53,0x2748774c,0xdf8eeb99,0x34b0bcb5,0xe19b48a8,0x391c0cb3,0xc5c95a63,0x4ed8aa4a,0xe3418acb,0x5b9cca4f,0x7763e373,0x682e6ff3,0xd6b2b8a3,0x748f82ee,0x5defb2fc,0x78a5636f,0x43172f60,0x84c87814,0xa1f0ab72,0x8cc70208,0x1a6439ec,0x90befffa,0x23631e28,0xa4506ceb,0xde82bde9,0xbef9a3f7,0xb2c67915,0xc67178f2,0xe372532b,0xca273ece,0xea26619c,0xd186b8c7,0x21c0c207,0xeada7dd6,0xcde0eb1e,0xf57d4f7f,0xee6ed178,0x6f067aa,0x72176fba,0xa637dc5,0xa2c898a6,0x113f9804,0xbef90dae,0x1b710b35,0x131c471b,0x28db77f5,0x23047d84,0x32caab7b,0x40c72493,0x3c9ebe0a,0x15c9bebc,0x431d67c4,0x9c100d4c,0x4cc5d4be,0xcb3e42b6,0x597f299c,0xfc657e2a,0x5fcb6fab,0x3ad6faec,0x6c44198c,0x4a475817];function v(){if(!(this instanceof v))return new v;m.call(this),this.h=[0x6a09e667,0xf3bcc908,0xbb67ae85,0x84caa73b,0x3c6ef372,0xfe94f82b,0xa54ff53a,0x5f1d36f1,0x510e527f,0xade682d1,0x9b05688c,0x2b3e6c1f,0x1f83d9ab,0xfb41bd6b,0x5be0cd19,0x137e2179],this.k=b,this.W=Array(160)}r.inherits(v,m),e.exports=v,v.blockSize=1024,v.outSize=512,v.hmacStrength=192,v.padLength=128,v.prototype._prepareBlock=function(e,t){for(var i=this.W,r=0;r<32;r++)i[r]=e[t+r];for(;r{"use strict";var r=i(1982).rotr32;function n(e,t,i){return e&t^e&i^t&i}t.ft_1=function(e,t,i,r){return 0===e?t&i^~t&r:1===e||3===e?t^i^r:2===e?n(t,i,r):void 0},t.ch32=function(e,t,i){return e&t^~e&i},t.maj32=n,t.p32=function(e,t,i){return e^t^i},t.s0_256=function(e){return r(e,2)^r(e,13)^r(e,22)},t.s1_256=function(e){return r(e,6)^r(e,11)^r(e,25)},t.g0_256=function(e){return r(e,7)^r(e,18)^e>>>3},t.g1_256=function(e){return r(e,17)^r(e,19)^e>>>10}},1982:(e,t,i)=>{"use strict";var r=i(28113),n=i(4242);function a(e){return(e>>>24|e>>>8&65280|e<<8&0xff0000|(255&e)<<24)>>>0}function o(e){return 1===e.length?"0"+e:e}function s(e){if(7===e.length)return"0"+e;if(6===e.length)return"00"+e;if(5===e.length)return"000"+e;if(4===e.length)return"0000"+e;if(3===e.length)return"00000"+e;if(2===e.length)return"000000"+e;if(1===e.length)return"0000000"+e;else return e}t.inherits=n,t.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var i=[];if("string"==typeof e){if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/ig,"")).length%2!=0&&(e="0"+e),n=0;n>6|192:((a=e,o=n,(64512&a.charCodeAt(o))!=55296||o<0||o+1>=a.length?1:(64512&a.charCodeAt(o+1))!=56320)?i[r++]=s>>12|224:(s=65536+((1023&s)<<10)+(1023&e.charCodeAt(++n)),i[r++]=s>>18|240,i[r++]=s>>12&63|128),i[r++]=s>>6&63|128),i[r++]=63&s|128)}}else for(n=0;n>>0;return s},t.split32=function(e,t){for(var i=Array(4*e.length),r=0,n=0;r>>24,i[n+1]=a>>>16&255,i[n+2]=a>>>8&255,i[n+3]=255&a):(i[n+3]=a>>>24,i[n+2]=a>>>16&255,i[n+1]=a>>>8&255,i[n]=255&a)}return i},t.rotr32=function(e,t){return e>>>t|e<<32-t},t.rotl32=function(e,t){return e<>>32-t},t.sum32=function(e,t){return e+t>>>0},t.sum32_3=function(e,t,i){return e+t+i>>>0},t.sum32_4=function(e,t,i,r){return e+t+i+r>>>0},t.sum32_5=function(e,t,i,r,n){return e+t+i+r+n>>>0},t.sum64=function(e,t,i,r){var n=e[t],a=r+e[t+1]>>>0;e[t]=(a>>0,e[t+1]=a},t.sum64_hi=function(e,t,i,r){return(t+r>>>0>>0},t.sum64_lo=function(e,t,i,r){return t+r>>>0},t.sum64_4_hi=function(e,t,i,r,n,a,o,s){var c,l=t;return e+i+n+o+(0+((l=l+r>>>0)>>0)>>0)>>0},t.sum64_4_lo=function(e,t,i,r,n,a,o,s){return t+r+a+s>>>0},t.sum64_5_hi=function(e,t,i,r,n,a,o,s,c,l){var u,d=t;return e+i+n+o+c+(0+((d=d+r>>>0)>>0)>>0)>>0)>>0},t.sum64_5_lo=function(e,t,i,r,n,a,o,s,c,l){return t+r+a+s+l>>>0},t.rotr64_hi=function(e,t,i){return(t<<32-i|e>>>i)>>>0},t.rotr64_lo=function(e,t,i){return(e<<32-i|t>>>i)>>>0},t.shr64_hi=function(e,t,i){return e>>>i},t.shr64_lo=function(e,t,i){return(e<<32-i|t>>>i)>>>0}},76304:(e,t,i)=>{"use strict";var r=i(13108),n=i(89150),a=i(28113);function o(e){if(!(this instanceof o))return new o(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=n.toArray(e.entropy,e.entropyEnc||"hex"),i=n.toArray(e.nonce,e.nonceEnc||"hex"),r=n.toArray(e.pers,e.persEnc||"hex");a(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,i,r)}e.exports=o,o.prototype._init=function(e,t,i){var r=e.concat(t).concat(i);this.K=Array(this.outLen/8),this.V=Array(this.outLen/8);for(var n=0;n=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(i||[])),this._reseed=1},o.prototype.generate=function(e,t,i,r){if(this._reseed>this.reseedInterval)throw Error("Reseed is required");"string"!=typeof t&&(r=i,i=t,t=null),i&&(i=n.toArray(i,r||"hex"),this._update(i));for(var a=[];a.length{e=i.nmd(e);var r,n,a="__lodash_hash_undefined__",o="[object Arguments]",s="[object Array]",c="[object Boolean]",l="[object Date]",u="[object Error]",d="[object Function]",h="[object Map]",p="[object Number]",f="[object Object]",g="[object Promise]",w="[object RegExp]",m="[object Set]",b="[object String]",v="[object WeakMap]",y="[object ArrayBuffer]",x="[object DataView]",C=/^\[object .+?Constructor\]$/,A=/^(?:0|[1-9]\d*)$/,E={};E["[object Float32Array]"]=E["[object Float64Array]"]=E["[object Int8Array]"]=E["[object Int16Array]"]=E["[object Int32Array]"]=E["[object Uint8Array]"]=E["[object Uint8ClampedArray]"]=E["[object Uint16Array]"]=E["[object Uint32Array]"]=!0,E[o]=E[s]=E[y]=E[c]=E[x]=E[l]=E[u]=E[d]=E[h]=E[p]=E[f]=E[w]=E[m]=E[b]=E[v]=!1;var _="object"==typeof i.g&&i.g&&i.g.Object===Object&&i.g,k="object"==typeof self&&self&&self.Object===Object&&self,I=_||k||Function("return this")(),S=t&&!t.nodeType&&t,T=S&&e&&!e.nodeType&&e,N=T&&T.exports===S,P=N&&_.process,R=function(){try{return P&&P.binding&&P.binding("util")}catch(e){}}(),O=R&&R.isTypedArray;function M(e){var t=-1,i=Array(e.size);return e.forEach(function(e,r){i[++t]=[r,e]}),i}function D(e){var t=-1,i=Array(e.size);return e.forEach(function(e){i[++t]=e}),i}var U=Array.prototype,$=Function.prototype,L=Object.prototype,j=I["__core-js_shared__"],B=$.toString,W=L.hasOwnProperty,q=function(){var e=/[^.]+$/.exec(j&&j.keys&&j.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),H=L.toString,z=RegExp("^"+B.call(W).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),F=N?I.Buffer:void 0,Z=I.Symbol,V=I.Uint8Array,K=L.propertyIsEnumerable,G=U.splice,J=Z?Z.toStringTag:void 0,Y=Object.getOwnPropertySymbols,Q=F?F.isBuffer:void 0,X=(r=Object.keys,n=Object,function(e){return r(n(e))}),ee=eE(I,"DataView"),et=eE(I,"Map"),ei=eE(I,"Promise"),er=eE(I,"Set"),en=eE(I,"WeakMap"),ea=eE(Object,"create"),eo=eI(ee),es=eI(et),ec=eI(ei),el=eI(er),eu=eI(en),ed=Z?Z.prototype:void 0,eh=ed?ed.valueOf:void 0;function ep(e){var t=-1,i=null==e?0:e.length;for(this.clear();++ts))return!1;var l=a.get(e);if(l&&a.get(t))return l==t;var u=-1,d=!0,h=2&i?new ew:void 0;for(a.set(e,t),a.set(t,e);++u-1&&u%1==0&&u-1},ef.prototype.set=function(e,t){var i=this.__data__,r=eb(i,e);return r<0?(++this.size,i.push([e,t])):i[r][1]=t,this},eg.prototype.clear=function(){this.size=0,this.__data__={hash:new ep,map:new(et||ef),string:new ep}},eg.prototype.delete=function(e){var t=eA(this,e).delete(e);return this.size-=t?1:0,t},eg.prototype.get=function(e){return eA(this,e).get(e)},eg.prototype.has=function(e){return eA(this,e).has(e)},eg.prototype.set=function(e,t){var i=eA(this,e),r=i.size;return i.set(e,t),this.size+=i.size==r?0:1,this},ew.prototype.add=ew.prototype.push=function(e){return this.__data__.set(e,a),this},ew.prototype.has=function(e){return this.__data__.has(e)},em.prototype.clear=function(){this.__data__=new ef,this.size=0},em.prototype.delete=function(e){var t=this.__data__,i=t.delete(e);return this.size=t.size,i},em.prototype.get=function(e){return this.__data__.get(e)},em.prototype.has=function(e){return this.__data__.has(e)},em.prototype.set=function(e,t){var i=this.__data__;if(i instanceof ef){var r=i.__data__;if(!et||r.length<199)return r.push([e,t]),this.size=++i.size,this;i=this.__data__=new eg(r)}return i.set(e,t),this.size=i.size,this};var e_=Y?function(e){return null==e?[]:function(e,t){for(var i=-1,r=null==e?0:e.length,n=0,a=[];++i-1&&e%1==0&&e<=0x1fffffffffffff}function eM(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function eD(e){return null!=e&&"object"==typeof e}var eU=O?function(e){return O(e)}:function(e){return eD(e)&&eO(e.length)&&!!E[ev(e)]};e.exports=function(e,t){return function e(t,i,r,n,a){return t===i||(null!=t&&null!=i&&(eD(t)||eD(i))?function(e,t,i,r,n,a){var d=eN(e),g=eN(t),v=d?s:ek(e),C=g?s:ek(t);v=v==o?f:v,C=C==o?f:C;var A=v==f,E=C==f,_=v==C;if(_&&eP(e)){if(!eP(t))return!1;d=!0,A=!1}if(_&&!A)return a||(a=new em),d||eU(e)?ex(e,t,i,r,n,a):function(e,t,i,r,n,a,o){switch(i){case x:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)break;e=e.buffer,t=t.buffer;case y:if(e.byteLength!=t.byteLength||!a(new V(e),new V(t)))break;return!0;case c:case l:case p:return eS(+e,+t);case u:return e.name==t.name&&e.message==t.message;case w:case b:return e==t+"";case h:var s=M;case m:var d=1&r;if(s||(s=D),e.size!=t.size&&!d)break;var f=o.get(e);if(f)return f==t;r|=2,o.set(e,t);var g=ex(s(e),s(t),r,n,a,o);return o.delete(e),g;case"[object Symbol]":if(eh)return eh.call(e)==eh.call(t)}return!1}(e,t,v,i,r,n,a);if(!(1&i)){var k=A&&W.call(e,"__wrapped__"),I=E&&W.call(t,"__wrapped__");if(k||I){var S=k?e.value():e,T=I?t.value():t;return a||(a=new em),n(S,T,i,r,a)}}return!!_&&(a||(a=new em),function(e,t,i,r,n,a){var o=1&i,s=eC(e),c=s.length;if(c!=eC(t).length&&!o)return!1;for(var l=c;l--;){var u=s[l];if(!(o?u in t:W.call(t,u)))return!1}var d=a.get(e);if(d&&a.get(t))return d==t;var h=!0;a.set(e,t),a.set(t,e);for(var p=o;++l{function t(e,t){if(!e)throw Error(t||"Assertion failed")}e.exports=t,t.equal=function(e,t,i){if(e!=t)throw Error(i||"Assertion failed: "+e+" != "+t)}},89150:(e,t)=>{"use strict";function i(e){return 1===e.length?"0"+e:e}function r(e){for(var t="",r=0;r>8,o=255&n;a?i.push(a,o):i.push(o)}return i},t.zero2=i,t.toHex=r,t.encode=function(e,t){return"hex"===t?r(e):e}},28480:(e,t,i)=>{let r=i(63426),n=i(87442),a=i(14283),o=i(57487);function s(e,t,i,a,o){let s=[].slice.call(arguments,1),c=s.length,l="function"==typeof s[c-1];if(!l&&!r())throw Error("Callback required as last argument");if(l){if(c<2)throw Error("Too few arguments provided");2===c?(o=i,i=t,t=a=void 0):3===c&&(t.getContext&&void 0===o?(o=a,a=void 0):(o=a,a=i,i=t,t=void 0))}else{if(c<1)throw Error("Too few arguments provided");return 1===c?(i=t,t=a=void 0):2!==c||t.getContext||(a=i,i=t,t=void 0),new Promise(function(r,o){try{let o=n.create(i,a);r(e(o,t,a))}catch(e){o(e)}})}try{let r=n.create(i,a);o(null,e(r,t,a))}catch(e){o(e)}}t.create=n.create,t.toCanvas=s.bind(null,a.render),t.toDataURL=s.bind(null,a.renderToDataURL),t.toString=s.bind(null,function(e,t,i){return o.render(e,i)})},63426:e=>{e.exports=function(){return"function"==typeof Promise&&Promise.prototype&&Promise.prototype.then}},17406:(e,t,i)=>{let r=i(61553).getSymbolSize;t.getRowColCoords=function(e){if(1===e)return[];let t=Math.floor(e/7)+2,i=r(e),n=145===i?26:2*Math.ceil((i-13)/(2*t-2)),a=[i-7];for(let e=1;e{let r=i(60999),n=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function a(e){this.mode=r.ALPHANUMERIC,this.data=e}a.getBitsLength=function(e){return 11*Math.floor(e/2)+e%2*6},a.prototype.getLength=function(){return this.data.length},a.prototype.getBitsLength=function(){return a.getBitsLength(this.data.length)},a.prototype.write=function(e){let t;for(t=0;t+2<=this.data.length;t+=2){let i=45*n.indexOf(this.data[t]);i+=n.indexOf(this.data[t+1]),e.put(i,11)}this.data.length%2&&e.put(n.indexOf(this.data[t]),6)},e.exports=a},93104:e=>{function t(){this.buffer=[],this.length=0}t.prototype={get:function(e){let t=Math.floor(e/8);return(this.buffer[t]>>>7-e%8&1)==1},put:function(e,t){for(let i=0;i>>t-i-1&1)==1)},getLengthInBits:function(){return this.length},putBit:function(e){let t=Math.floor(this.length/8);this.buffer.length<=t&&this.buffer.push(0),e&&(this.buffer[t]|=128>>>this.length%8),this.length++}},e.exports=t},50999:e=>{function t(e){if(!e||e<1)throw Error("BitMatrix size must be defined and greater than 0");this.size=e,this.data=new Uint8Array(e*e),this.reservedBit=new Uint8Array(e*e)}t.prototype.set=function(e,t,i,r){let n=e*this.size+t;this.data[n]=i,r&&(this.reservedBit[n]=!0)},t.prototype.get=function(e,t){return this.data[e*this.size+t]},t.prototype.xor=function(e,t,i){this.data[e*this.size+t]^=i},t.prototype.isReserved=function(e,t){return this.reservedBit[e*this.size+t]},e.exports=t},63577:(e,t,i)=>{let r=i(31159),n=i(60999);function a(e){this.mode=n.BYTE,"string"==typeof e&&(e=r(e)),this.data=new Uint8Array(e)}a.getBitsLength=function(e){return 8*e},a.prototype.getLength=function(){return this.data.length},a.prototype.getBitsLength=function(){return a.getBitsLength(this.data.length)},a.prototype.write=function(e){for(let t=0,i=this.data.length;t{let r=i(70938),n=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],a=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];t.getBlocksCount=function(e,t){switch(t){case r.L:return n[(e-1)*4+0];case r.M:return n[(e-1)*4+1];case r.Q:return n[(e-1)*4+2];case r.H:return n[(e-1)*4+3];default:return}},t.getTotalCodewordsCount=function(e,t){switch(t){case r.L:return a[(e-1)*4+0];case r.M:return a[(e-1)*4+1];case r.Q:return a[(e-1)*4+2];case r.H:return a[(e-1)*4+3];default:return}}},70938:(e,t)=>{t.L={bit:1},t.M={bit:0},t.Q={bit:3},t.H={bit:2},t.isValid=function(e){return e&&void 0!==e.bit&&e.bit>=0&&e.bit<4},t.from=function(e,i){if(t.isValid(e))return e;try{return function(e){if("string"!=typeof e)throw Error("Param is not a string");switch(e.toLowerCase()){case"l":case"low":return t.L;case"m":case"medium":return t.M;case"q":case"quartile":return t.Q;case"h":case"high":return t.H;default:throw Error("Unknown EC Level: "+e)}}(e)}catch(e){return i}}},24203:(e,t,i)=>{let r=i(61553).getSymbolSize;t.getPositions=function(e){let t=r(e);return[[0,0],[t-7,0],[0,t-7]]}},38962:(e,t,i)=>{let r=i(61553),n=r.getBCHDigit(1335);t.getEncodedBits=function(e,t){let i=e.bit<<3|t,a=i<<10;for(;r.getBCHDigit(a)-n>=0;)a^=1335<{let i=new Uint8Array(512),r=new Uint8Array(256);!function(){let e=1;for(let t=0;t<255;t++)i[t]=e,r[e]=t,256&(e<<=1)&&(e^=285);for(let e=255;e<512;e++)i[e]=i[e-255]}(),t.log=function(e){if(e<1)throw Error("log("+e+")");return r[e]},t.exp=function(e){return i[e]},t.mul=function(e,t){return 0===e||0===t?0:i[r[e]+r[t]]}},93090:(e,t,i)=>{let r=i(60999),n=i(61553);function a(e){this.mode=r.KANJI,this.data=e}a.getBitsLength=function(e){return 13*e},a.prototype.getLength=function(){return this.data.length},a.prototype.getBitsLength=function(){return a.getBitsLength(this.data.length)},a.prototype.write=function(e){let t;for(t=0;t=33088&&i<=40956)i-=33088;else if(i>=57408&&i<=60351)i-=49472;else throw Error("Invalid SJIS character: "+this.data[t]+"\nMake sure your charset is UTF-8");i=(i>>>8&255)*192+(255&i),e.put(i,13)}},e.exports=a},42695:(e,t)=>{t.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};let i={N1:3,N2:3,N3:40,N4:10};t.isValid=function(e){return null!=e&&""!==e&&!isNaN(e)&&e>=0&&e<=7},t.from=function(e){return t.isValid(e)?parseInt(e,10):void 0},t.getPenaltyN1=function(e){let t=e.size,r=0,n=0,a=0,o=null,s=null;for(let c=0;c=5&&(r+=i.N1+(n-5)),o=t,n=1),(t=e.get(l,c))===s?a++:(a>=5&&(r+=i.N1+(a-5)),s=t,a=1)}n>=5&&(r+=i.N1+(n-5)),a>=5&&(r+=i.N1+(a-5))}return r},t.getPenaltyN2=function(e){let t=e.size,r=0;for(let i=0;i=10&&(1488===n||93===n)&&r++,a=a<<1&2047|e.get(o,i),o>=10&&(1488===a||93===a)&&r++}return r*i.N3},t.getPenaltyN4=function(e){let t=0,r=e.data.length;for(let i=0;i{let r=i(14925),n=i(95347);t.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},t.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},t.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},t.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},t.MIXED={bit:-1},t.getCharCountIndicator=function(e,t){if(!e.ccBits)throw Error("Invalid mode: "+e);if(!r.isValid(t))throw Error("Invalid version: "+t);return t>=1&&t<10?e.ccBits[0]:t<27?e.ccBits[1]:e.ccBits[2]},t.getBestModeForData=function(e){return n.testNumeric(e)?t.NUMERIC:n.testAlphanumeric(e)?t.ALPHANUMERIC:n.testKanji(e)?t.KANJI:t.BYTE},t.toString=function(e){if(e&&e.id)return e.id;throw Error("Invalid mode")},t.isValid=function(e){return e&&e.bit&&e.ccBits},t.from=function(e,i){if(t.isValid(e))return e;try{return function(e){if("string"!=typeof e)throw Error("Param is not a string");switch(e.toLowerCase()){case"numeric":return t.NUMERIC;case"alphanumeric":return t.ALPHANUMERIC;case"kanji":return t.KANJI;case"byte":return t.BYTE;default:throw Error("Unknown mode: "+e)}}(e)}catch(e){return i}}},91234:(e,t,i)=>{let r=i(60999);function n(e){this.mode=r.NUMERIC,this.data=e.toString()}n.getBitsLength=function(e){return 10*Math.floor(e/3)+(e%3?e%3*3+1:0)},n.prototype.getLength=function(){return this.data.length},n.prototype.getBitsLength=function(){return n.getBitsLength(this.data.length)},n.prototype.write=function(e){let t,i;for(t=0;t+3<=this.data.length;t+=3)i=parseInt(this.data.substr(t,3),10),e.put(i,10);let r=this.data.length-t;r>0&&(i=parseInt(this.data.substr(t),10),e.put(i,3*r+1))},e.exports=n},23094:(e,t,i)=>{let r=i(15236);t.mul=function(e,t){let i=new Uint8Array(e.length+t.length-1);for(let n=0;n=0;){let e=i[0];for(let n=0;n{let r=i(61553),n=i(70938),a=i(93104),o=i(50999),s=i(17406),c=i(24203),l=i(42695),u=i(45313),d=i(15783),h=i(39012),p=i(38962),f=i(60999),g=i(46706);function w(e,t,i){let r,n;let a=e.size,o=p.getEncodedBits(t,i);for(r=0;r<15;r++)n=(o>>r&1)==1,r<6?e.set(r,8,n,!0):r<8?e.set(r+1,8,n,!0):e.set(a-15+r,8,n,!0),r<8?e.set(8,a-r-1,n,!0):r<9?e.set(8,15-r-1+1,n,!0):e.set(8,15-r-1,n,!0);e.set(a-8,8,1,!0)}t.create=function(e,t){let i,p;if(void 0===e||""===e)throw Error("No input text");let m=n.M;return void 0!==t&&(m=n.from(t.errorCorrectionLevel,n.M),i=h.from(t.version),p=l.from(t.maskPattern),t.toSJISFunc&&r.setToSJISFunction(t.toSJISFunc)),function(e,t,i,n){let p;if(Array.isArray(e))p=g.fromArray(e);else if("string"==typeof e){let r=t;if(!r){let t=g.rawSplit(e);r=h.getBestVersionForData(t,i)}p=g.fromString(e,r||40)}else throw Error("Invalid data");let m=h.getBestVersionForData(p,i);if(!m)throw Error("The amount of data is too big to be stored in a QR Code");if(t){if(t=0&&t<=6&&(0===r||6===r)||r>=0&&r<=6&&(0===t||6===t)||t>=2&&t<=4&&r>=2&&r<=4?e.set(n+t,a+r,!0,!0):e.set(n+t,a+r,!1,!0))}}(v,t),function(e){let t=e.size;for(let i=8;i=7&&function(e,t){let i,r,n;let a=e.size,o=h.getEncodedBits(t);for(let t=0;t<18;t++)i=Math.floor(t/3),r=t%3+a-8-3,n=(o>>t&1)==1,e.set(i,r,n,!0),e.set(r,i,n,!0)}(v,t),function(e,t){let i=e.size,r=-1,n=i-1,a=7,o=0;for(let s=i-1;s>0;s-=2)for(6===s&&s--;;){for(let i=0;i<2;i++)if(!e.isReserved(n,s-i)){let r=!1;o>>a&1)==1),e.set(n,s-i,r),-1==--a&&(o++,a=7)}if((n+=r)<0||i<=n){n-=r,r=-r;break}}}(v,b),isNaN(n)&&(n=l.getBestMask(v,w.bind(null,v,i))),l.applyMask(n,v),w(v,i,n),{modules:v,version:t,errorCorrectionLevel:i,maskPattern:n,segments:p}}(e,i,m,p)}},15783:(e,t,i)=>{let r=i(23094);function n(e){this.genPoly=void 0,this.degree=e,this.degree&&this.initialize(this.degree)}n.prototype.initialize=function(e){this.degree=e,this.genPoly=r.generateECPolynomial(this.degree)},n.prototype.encode=function(e){if(!this.genPoly)throw Error("Encoder not initialized");let t=new Uint8Array(e.length+this.degree);t.set(e);let i=r.mod(t,this.genPoly),n=this.degree-i.length;if(n>0){let e=new Uint8Array(this.degree);return e.set(i,n),e}return i},e.exports=n},95347:(e,t)=>{let i="[0-9]+",r="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+",n="(?:(?![A-Z0-9 $%*+\\-./:]|"+(r=r.replace(/u/g,"\\u"))+")(?:.|[\r\n]))+";t.KANJI=RegExp(r,"g"),t.BYTE_KANJI=RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),t.BYTE=RegExp(n,"g"),t.NUMERIC=RegExp(i,"g"),t.ALPHANUMERIC=RegExp("[A-Z $%*+\\-./:]+","g");let a=RegExp("^"+r+"$"),o=RegExp("^"+i+"$"),s=RegExp("^[A-Z0-9 $%*+\\-./:]+$");t.testKanji=function(e){return a.test(e)},t.testNumeric=function(e){return o.test(e)},t.testAlphanumeric=function(e){return s.test(e)}},46706:(e,t,i)=>{let r=i(60999),n=i(91234),a=i(96426),o=i(63577),s=i(93090),c=i(95347),l=i(61553),u=i(35363);function d(e){return unescape(encodeURIComponent(e)).length}function h(e,t,i){let r;let n=[];for(;null!==(r=e.exec(i));)n.push({data:r[0],index:r.index,mode:t,length:r[0].length});return n}function p(e){let t,i;let n=h(c.NUMERIC,r.NUMERIC,e),a=h(c.ALPHANUMERIC,r.ALPHANUMERIC,e);return l.isKanjiModeEnabled()?(t=h(c.BYTE,r.BYTE,e),i=h(c.KANJI,r.KANJI,e)):(t=h(c.BYTE_KANJI,r.BYTE,e),i=[]),n.concat(a,t,i).sort(function(e,t){return e.index-t.index}).map(function(e){return{data:e.data,mode:e.mode,length:e.length}})}function f(e,t){switch(t){case r.NUMERIC:return n.getBitsLength(e);case r.ALPHANUMERIC:return a.getBitsLength(e);case r.KANJI:return s.getBitsLength(e);case r.BYTE:return o.getBitsLength(e)}}function g(e,t){let i;let c=r.getBestModeForData(e);if((i=r.from(t,c))!==r.BYTE&&i.bit=0?e[e.length-1]:null;return i&&i.mode===t.mode?e[e.length-1].data+=t.data:e.push(t),e},[]))},t.rawSplit=function(e){return t.fromArray(p(e,l.isKanjiModeEnabled()))}},61553:(e,t)=>{let i;let r=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];t.getSymbolSize=function(e){if(!e)throw Error('"version" cannot be null or undefined');if(e<1||e>40)throw Error('"version" should be in range from 1 to 40');return 4*e+17},t.getSymbolTotalCodewords=function(e){return r[e]},t.getBCHDigit=function(e){let t=0;for(;0!==e;)t++,e>>>=1;return t},t.setToSJISFunction=function(e){if("function"!=typeof e)throw Error('"toSJISFunc" is not a valid function.');i=e},t.isKanjiModeEnabled=function(){return void 0!==i},t.toSJIS=function(e){return i(e)}},14925:(e,t)=>{t.isValid=function(e){return!isNaN(e)&&e>=1&&e<=40}},39012:(e,t,i)=>{let r=i(61553),n=i(45313),a=i(70938),o=i(60999),s=i(14925),c=r.getBCHDigit(7973);function l(e,t){return o.getCharCountIndicator(e,t)+4}t.from=function(e,t){return s.isValid(e)?parseInt(e,10):t},t.getCapacity=function(e,t,i){if(!s.isValid(e))throw Error("Invalid QR Code version");void 0===i&&(i=o.BYTE);let a=(r.getSymbolTotalCodewords(e)-n.getTotalCodewordsCount(e,t))*8;if(i===o.MIXED)return a;let c=a-l(i,e);switch(i){case o.NUMERIC:return Math.floor(c/10*3);case o.ALPHANUMERIC:return Math.floor(c/11*2);case o.KANJI:return Math.floor(c/13);case o.BYTE:default:return Math.floor(c/8)}},t.getBestVersionForData=function(e,i){let r;let n=a.from(i,a.M);if(Array.isArray(e)){if(e.length>1)return function(e,i){for(let r=1;r<=40;r++)if(function(e,t){let i=0;return e.forEach(function(e){let r=l(e.mode,t);i+=r+e.getBitsLength()}),i}(e,r)<=t.getCapacity(r,i,o.MIXED))return r}(e,n);if(0===e.length)return 1;r=e[0]}else r=e;return function(e,i,r){for(let n=1;n<=40;n++)if(i<=t.getCapacity(n,r,e))return n}(r.mode,r.getLength(),n)},t.getEncodedBits=function(e){if(!s.isValid(e)||e<7)throw Error("Invalid QR Code version");let t=e<<12;for(;r.getBCHDigit(t)-c>=0;)t^=7973<{let r=i(8901);t.render=function(e,t,i){var n;let a=i,o=t;void 0!==a||t&&t.getContext||(a=t,t=void 0),t||(o=function(){try{return document.createElement("canvas")}catch(e){throw Error("You need to specify a canvas element")}}()),a=r.getOptions(a);let s=r.getImageWidth(e.modules.size,a),c=o.getContext("2d"),l=c.createImageData(s,s);return r.qrToImageData(l.data,e,a),n=o,c.clearRect(0,0,n.width,n.height),n.style||(n.style={}),n.height=s,n.width=s,n.style.height=s+"px",n.style.width=s+"px",c.putImageData(l,0,0),o},t.renderToDataURL=function(e,i,r){let n=r;void 0!==n||i&&i.getContext||(n=i,i=void 0),n||(n={});let a=t.render(e,i,n),o=n.type||"image/png",s=n.rendererOpts||{};return a.toDataURL(o,s.quality)}},57487:(e,t,i)=>{let r=i(8901);function n(e,t){let i=e.a/255,r=t+'="'+e.hex+'"';return i<1?r+" "+t+'-opacity="'+i.toFixed(2).slice(1)+'"':r}function a(e,t,i){let r=e+t;return void 0!==i&&(r+=" "+i),r}t.render=function(e,t,i){let o=r.getOptions(t),s=e.modules.size,c=e.modules.data,l=s+2*o.margin,u=o.color.light.a?"':"",d="0&&l>0&&e[c-1]||(r+=o?a("M",l+i,.5+u+i):a("m",n,0),n=0,o=!1),l+1',h=''+u+d+"\n";return"function"==typeof i&&i(null,h),h}},8901:(e,t)=>{function i(e){if("number"==typeof e&&(e=e.toString()),"string"!=typeof e)throw Error("Color should be defined as hex string");let t=e.slice().replace("#","").split("");if(t.length<3||5===t.length||t.length>8)throw Error("Invalid hex color: "+e);(3===t.length||4===t.length)&&(t=Array.prototype.concat.apply([],t.map(function(e){return[e,e]}))),6===t.length&&t.push("F","F");let i=parseInt(t.join(""),16);return{r:i>>24&255,g:i>>16&255,b:i>>8&255,a:255&i,hex:"#"+t.slice(0,6).join("")}}t.getOptions=function(e){e||(e={}),e.color||(e.color={});let t=void 0===e.margin||null===e.margin||e.margin<0?4:e.margin,r=e.width&&e.width>=21?e.width:void 0,n=e.scale||4;return{width:r,scale:r?4:n,margin:t,color:{dark:i(e.color.dark||"#000000ff"),light:i(e.color.light||"#ffffffff")},type:e.type,rendererOpts:e.rendererOpts||{}}},t.getScale=function(e,t){return t.width&&t.width>=e+2*t.margin?t.width/(e+2*t.margin):t.scale},t.getImageWidth=function(e,i){let r=t.getScale(e,i);return Math.floor((e+2*i.margin)*r)},t.qrToImageData=function(e,i,r){let n=i.modules.size,a=i.modules.data,o=t.getScale(n,r),s=Math.floor((n+2*r.margin)*o),c=r.margin*o,l=[r.color.light,r.color.dark];for(let t=0;t=c&&i>=c&&t{"use strict";let r=i(87414),n=i(34961),a=i(10257),o=i(49509),s=e=>null==e,c=Symbol("encodeFragmentIdentifier");function l(e){if("string"!=typeof e||1!==e.length)throw TypeError("arrayFormatSeparator must be single character string")}function u(e,t){return t.encode?t.strict?r(e):encodeURIComponent(e):e}function d(e,t){return t.decode?n(e):e}function h(e){let t=e.indexOf("#");return -1!==t&&(e=e.slice(0,t)),e}function p(e){let t=(e=h(e)).indexOf("?");return -1===t?"":e.slice(t+1)}function f(e,t){return t.parseNumbers&&!Number.isNaN(Number(e))&&"string"==typeof e&&""!==e.trim()?e=Number(e):t.parseBooleans&&null!==e&&("true"===e.toLowerCase()||"false"===e.toLowerCase())&&(e="true"===e.toLowerCase()),e}function g(e,t){l((t=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},t)).arrayFormatSeparator);let i=function(e){let t;switch(e.arrayFormat){case"index":return(e,i,r)=>{if(t=/\[(\d*)\]$/.exec(e),e=e.replace(/\[\d*\]$/,""),!t){r[e]=i;return}void 0===r[e]&&(r[e]={}),r[e][t[1]]=i};case"bracket":return(e,i,r)=>{if(t=/(\[\])$/.exec(e),e=e.replace(/\[\]$/,""),!t){r[e]=i;return}if(void 0===r[e]){r[e]=[i];return}r[e]=[].concat(r[e],i)};case"colon-list-separator":return(e,i,r)=>{if(t=/(:list)$/.exec(e),e=e.replace(/:list$/,""),!t){r[e]=i;return}if(void 0===r[e]){r[e]=[i];return}r[e]=[].concat(r[e],i)};case"comma":case"separator":return(t,i,r)=>{let n="string"==typeof i&&i.includes(e.arrayFormatSeparator),a="string"==typeof i&&!n&&d(i,e).includes(e.arrayFormatSeparator);i=a?d(i,e):i;let o=n||a?i.split(e.arrayFormatSeparator).map(t=>d(t,e)):null===i?i:d(i,e);r[t]=o};case"bracket-separator":return(t,i,r)=>{let n=/(\[\])$/.test(t);if(t=t.replace(/\[\]$/,""),!n){r[t]=i?d(i,e):i;return}let a=null===i?[]:i.split(e.arrayFormatSeparator).map(t=>d(t,e));if(void 0===r[t]){r[t]=a;return}r[t]=[].concat(r[t],a)};default:return(e,t,i)=>{if(void 0===i[e]){i[e]=t;return}i[e]=[].concat(i[e],t)}}}(t),r=Object.create(null);if("string"!=typeof e||!(e=e.trim().replace(/^[?#&]/,"")))return r;for(let n of e.split("&")){if(""===n)continue;let[e,o]=a(t.decode?n.replace(/\+/g," "):n,"=");o=void 0===o?null:["comma","separator","bracket-separator"].includes(t.arrayFormat)?o:d(o,t),i(d(e,t),o,r)}for(let e of Object.keys(r)){let i=r[e];if("object"==typeof i&&null!==i)for(let e of Object.keys(i))i[e]=f(i[e],t);else r[e]=f(i,t)}return!1===t.sort?r:(!0===t.sort?Object.keys(r).sort():Object.keys(r).sort(t.sort)).reduce((e,t)=>{let i=r[t];return i&&"object"==typeof i&&!Array.isArray(i)?e[t]=function e(t){return Array.isArray(t)?t.sort():"object"==typeof t?e(Object.keys(t)).sort((e,t)=>Number(e)-Number(t)).map(e=>t[e]):t}(i):e[t]=i,e},Object.create(null))}t.extract=p,t.parse=g,t.stringify=(e,t)=>{if(!e)return"";l((t=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},t)).arrayFormatSeparator);let i=i=>t.skipNull&&s(e[i])||t.skipEmptyString&&""===e[i],r=function(e){switch(e.arrayFormat){case"index":return t=>(i,r)=>{let n=i.length;return void 0===r||e.skipNull&&null===r||e.skipEmptyString&&""===r?i:null===r?[...i,[u(t,e),"[",n,"]"].join("")]:[...i,[u(t,e),"[",u(n,e),"]=",u(r,e)].join("")]};case"bracket":return t=>(i,r)=>void 0===r||e.skipNull&&null===r||e.skipEmptyString&&""===r?i:null===r?[...i,[u(t,e),"[]"].join("")]:[...i,[u(t,e),"[]=",u(r,e)].join("")];case"colon-list-separator":return t=>(i,r)=>void 0===r||e.skipNull&&null===r||e.skipEmptyString&&""===r?i:null===r?[...i,[u(t,e),":list="].join("")]:[...i,[u(t,e),":list=",u(r,e)].join("")];case"comma":case"separator":case"bracket-separator":{let t="bracket-separator"===e.arrayFormat?"[]=":"=";return i=>(r,n)=>void 0===n||e.skipNull&&null===n||e.skipEmptyString&&""===n?r:(n=null===n?"":n,0===r.length)?[[u(i,e),t,u(n,e)].join("")]:[[r,u(n,e)].join(e.arrayFormatSeparator)]}default:return t=>(i,r)=>void 0===r||e.skipNull&&null===r||e.skipEmptyString&&""===r?i:null===r?[...i,u(t,e)]:[...i,[u(t,e),"=",u(r,e)].join("")]}}(t),n={};for(let t of Object.keys(e))i(t)||(n[t]=e[t]);let a=Object.keys(n);return!1!==t.sort&&a.sort(t.sort),a.map(i=>{let n=e[i];return void 0===n?"":null===n?u(i,t):Array.isArray(n)?0===n.length&&"bracket-separator"===t.arrayFormat?u(i,t)+"[]":n.reduce(r(i),[]).join("&"):u(i,t)+"="+u(n,t)}).filter(e=>e.length>0).join("&")},t.parseUrl=(e,t)=>{t=Object.assign({decode:!0},t);let[i,r]=a(e,"#");return Object.assign({url:i.split("?")[0]||"",query:g(p(e),t)},t&&t.parseFragmentIdentifier&&r?{fragmentIdentifier:d(r,t)}:{})},t.stringifyUrl=(e,i)=>{i=Object.assign({encode:!0,strict:!0,[c]:!0},i);let r=h(e.url).split("?")[0]||"",n=t.extract(e.url),a=Object.assign(t.parse(n,{sort:!1}),e.query),o=t.stringify(a,i);o&&(o=`?${o}`);let s=function(e){let t="",i=e.indexOf("#");return -1!==i&&(t=e.slice(i)),t}(e.url);return e.fragmentIdentifier&&(s=`#${i[c]?u(e.fragmentIdentifier,i):e.fragmentIdentifier}`),`${r}${o}${s}`},t.pick=(e,i,r)=>{r=Object.assign({parseFragmentIdentifier:!0,[c]:!1},r);let{url:n,query:a,fragmentIdentifier:s}=t.parseUrl(e,r);return t.stringifyUrl({url:n,query:o(a,i),fragmentIdentifier:s},r)},t.exclude=(e,i,r)=>{let n=Array.isArray(i)?e=>!i.includes(e):(e,t)=>!i(e,t);return t.pick(e,n,r)}},54213:e=>{"use strict";function t(e){try{return JSON.stringify(e)}catch(e){return'"[Circular]"'}}e.exports=function(e,i,r){var n=r&&r.stringify||t;if("object"==typeof e&&null!==e){var a=i.length+1;if(1===a)return e;var o=Array(a);o[0]=n(e);for(var s=1;s-1?d:0,e.charCodeAt(p+1)){case 100:case 102:if(u>=c||null==i[u])break;d=c||null==i[u])break;d=c||void 0===i[u])break;d",d=p+2,p++;break}l+=n(i[u]),d=p+2,p++;break;case 115:if(u>=c)break;d{"use strict";e.exports=(e,t)=>{if(!("string"==typeof e&&"string"==typeof t))throw TypeError("Expected the arguments to be of type `string`");if(""===t)return[e];let i=e.indexOf(t);return -1===i?[e]:[e.slice(0,i),e.slice(i+t.length)]}},87414:e=>{"use strict";e.exports=e=>encodeURIComponent(e).replace(/[!'()*]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`)},50752:(e,t,i)=>{"use strict";i.r(t),i.d(t,{__assign:()=>a,__asyncDelegator:()=>y,__asyncGenerator:()=>v,__asyncValues:()=>x,__await:()=>b,__awaiter:()=>u,__classPrivateFieldGet:()=>_,__classPrivateFieldSet:()=>k,__createBinding:()=>h,__decorate:()=>s,__exportStar:()=>p,__extends:()=>n,__generator:()=>d,__importDefault:()=>E,__importStar:()=>A,__makeTemplateObject:()=>C,__metadata:()=>l,__param:()=>c,__read:()=>g,__rest:()=>o,__spread:()=>w,__spreadArrays:()=>m,__values:()=>f});var r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(e,t)};function n(e,t){function i(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}var a=function(){return(a=Object.assign||function(e){for(var t,i=1,r=arguments.length;it.indexOf(r)&&(i[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var n=0,r=Object.getOwnPropertySymbols(e);nt.indexOf(r[n])&&Object.prototype.propertyIsEnumerable.call(e,r[n])&&(i[r[n]]=e[r[n]]);return i}function s(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o}function c(e,t){return function(i,r){t(i,r,e)}}function l(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function u(e,t,i,r){return new(i||(i=Promise))(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?n(e.value):((t=e.value)instanceof i?t:new i(function(e){e(t)})).then(o,s)}c((r=r.apply(e,t||[])).next())})}function d(e,t){var i,r,n,a,o={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(a){return function(s){return function(a){if(i)throw TypeError("Generator is already executing.");for(;o;)try{if(i=1,r&&(n=2&a[0]?r.return:a[0]?r.throw||((n=r.return)&&n.call(r),0):r.next)&&!(n=n.call(r,a[1])).done)return n;switch(r=0,n&&(a=[2&a[0],n.value]),a[0]){case 0:case 1:n=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,r=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!(n=(n=o.trys).length>0&&n[n.length-1])&&(6===a[0]||2===a[0])){o=0;continue}if(3===a[0]&&(!n||a[1]>n[0]&&a[1]=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function g(e,t){var i="function"==typeof Symbol&&e[Symbol.iterator];if(!i)return e;var r,n,a=i.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(e){n={error:e}}finally{try{r&&!r.done&&(i=a.return)&&i.call(a)}finally{if(n)throw n.error}}return o}function w(){for(var e=[],t=0;t1||s(e,t)})})}function s(e,t){try{var i;(i=n[e](t)).value instanceof b?Promise.resolve(i.value.v).then(c,l):u(a[0][2],i)}catch(e){u(a[0][3],e)}}function c(e){s("next",e)}function l(e){s("throw",e)}function u(e,t){e(t),a.shift(),a.length&&s(a[0][0],a[0][1])}}function y(e){var t,i;return t={},r("next"),r("throw",function(e){throw e}),r("return"),t[Symbol.iterator]=function(){return this},t;function r(r,n){t[r]=e[r]?function(t){return(i=!i)?{value:b(e[r](t)),done:"return"===r}:n?n(t):t}:n}}function x(e){if(!Symbol.asyncIterator)throw TypeError("Symbol.asyncIterator is not defined.");var t,i=e[Symbol.asyncIterator];return i?i.call(e):(e=f(e),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(i){t[i]=e[i]&&function(t){return new Promise(function(r,n){!function(e,t,i,r){Promise.resolve(r).then(function(t){e({value:t,done:i})},t)}(r,n,(t=e[i](t)).done,t.value)})}}}function C(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}function A(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)Object.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t.default=e,t}function E(e){return e&&e.__esModule?e:{default:e}}function _(e,t){if(!t.has(e))throw TypeError("attempted to get private field on non-instance");return t.get(e)}function k(e,t,i){if(!t.has(e))throw TypeError("attempted to set private field on non-instance");return t.set(e,i),i}},13361:e=>{"use strict";e.exports=function(){throw Error("ws does not work in the browser. Browser clients must use the native WebSocket object")}},87960:(e,t,i)=>{"use strict";let r=i(54213);e.exports=a;let n=function(){function e(e){return void 0!==e&&e}try{if("undefined"!=typeof globalThis)return globalThis;return Object.defineProperty(Object.prototype,"globalThis",{get:function(){return delete Object.prototype.globalThis,this.globalThis=this},configurable:!0}),globalThis}catch(t){return e(self)||e(window)||e(this)||{}}}().console||{};function a(e){var t,i;(e=e||{}).browser=e.browser||{};let r=e.browser.transmit;if(r&&"function"!=typeof r.send)throw Error("pino: transmit option must have a send function");let u=e.browser.write||n;e.browser.write&&(e.browser.asObject=!0);let d=e.serializers||{},g=Array.isArray(t=e.browser.serialize)?t.filter(function(e){return"!stdSerializers.err"!==e}):!0===t&&Object.keys(d),w=e.browser.serialize;Array.isArray(e.browser.serialize)&&e.browser.serialize.indexOf("!stdSerializers.err")>-1&&(w=!1),"function"==typeof u&&(u.error=u.fatal=u.warn=u.info=u.debug=u.trace=u),!1===e.enabled&&(e.level="silent");let m=e.level||"info",b=Object.create(u);b.log||(b.log=h),Object.defineProperty(b,"levelVal",{get:function(){return"silent"===this.level?1/0:this.levels.values[this.level]}}),Object.defineProperty(b,"level",{get:function(){return this._level},set:function(e){if("silent"!==e&&!this.levels.values[e])throw Error("unknown level "+e);this._level=e,o(v,b,"error","log"),o(v,b,"fatal","error"),o(v,b,"warn","error"),o(v,b,"info","log"),o(v,b,"debug","log"),o(v,b,"trace","log")}});let v={transmit:r,serialize:g,asObject:e.browser.asObject,levels:["error","fatal","warn","info","debug","trace"],timestamp:"function"==typeof(i=e).timestamp?i.timestamp:!1===i.timestamp?p:f};return b.levels=a.levels,b.level=m,b.setMaxListeners=b.getMaxListeners=b.emit=b.addListener=b.on=b.prependListener=b.once=b.prependOnceListener=b.removeListener=b.removeAllListeners=b.listeners=b.listenerCount=b.eventNames=b.write=b.flush=h,b.serializers=d,b._serialize=g,b._stdErrSerialize=w,b.child=function(t,i){if(!t)throw Error("missing bindings for child Pino");i=i||{},g&&t.serializers&&(i.serializers=t.serializers);let n=i.serializers;if(g&&n){var a=Object.assign({},d,n),o=!0===e.browser.serialize?Object.keys(a):g;delete t.serializers,s([t],o,a,this._stdErrSerialize)}function u(e){this._childLevel=(0|e._childLevel)+1,this.error=c(e,t,"error"),this.fatal=c(e,t,"fatal"),this.warn=c(e,t,"warn"),this.info=c(e,t,"info"),this.debug=c(e,t,"debug"),this.trace=c(e,t,"trace"),a&&(this.serializers=a,this._serialize=o),r&&(this._logEvent=l([].concat(e._logEvent.bindings,t)))}return u.prototype=this,new u(this)},r&&(b._logEvent=l()),b}function o(e,t,i,o){let c=Object.getPrototypeOf(t);t[i]=t.levelVal>t.levels.values[i]?h:c[i]?c[i]:n[i]||n[o]||h,function(e,t,i){if(e.transmit||t[i]!==h){var o;t[i]=(o=t[i],function(){let c=e.timestamp(),u=Array(arguments.length),d=Object.getPrototypeOf&&Object.getPrototypeOf(this)===n?n:this;for(var h=0;h-1&&r in i&&(e[n][r]=i[r](e[n][r]))}function c(e,t,i){return function(){let r=Array(1+arguments.length);r[0]=t;for(var n=1;n{"use strict";i.d(t,{M:()=>o});var r=i(21127);let n={attribute:!0,type:String,converter:r.W3,reflect:!1,hasChanged:r.Ec},a=(e=n,t,i)=>{let{kind:r,metadata:a}=i,o=globalThis.litPropertyMetadata.get(a);if(void 0===o&&globalThis.litPropertyMetadata.set(a,o=new Map),o.set(i.name,e),"accessor"===r){let{name:r}=i;return{set(i){let n=t.get.call(this);t.set.call(this,i),this.requestUpdate(r,n,e)},init(t){return void 0!==t&&this.C(r,void 0,e),t}}}if("setter"===r){let{name:r}=i;return function(i){let n=this[r];t.call(this,i),this.requestUpdate(r,n,e)}}throw Error("Unsupported decorator location: "+r)};function o(e){return(t,i)=>"object"==typeof i?a(e,t,i):((e,t,i)=>{let r=t.hasOwnProperty(i);return t.constructor.createProperty(i,r?{...e,wrapped:!0}:e),r?Object.getOwnPropertyDescriptor(t,i):void 0})(e,t,i)}},37857:(e,t,i)=>{"use strict";i.d(t,{w:()=>n});var r=i(1273);function n(e){return(0,r.M)({...e,state:!0,attribute:!1})}},21127:(e,t,i)=>{"use strict";i.d(t,{mN:()=>k,AH:()=>l,W3:()=>A,Ec:()=>E,iz:()=>c});let r=globalThis,n=r.ShadowRoot&&(void 0===r.ShadyCSS||r.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,a=Symbol(),o=new WeakMap;class s{constructor(e,t,i){if(this._$cssResult$=!0,i!==a)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o,t=this.t;if(n&&void 0===e){let i=void 0!==t&&1===t.length;i&&(e=o.get(t)),void 0===e&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),i&&o.set(t,e))}return e}toString(){return this.cssText}}let c=e=>new s("string"==typeof e?e:e+"",void 0,a),l=(e,...t)=>new s(1===e.length?e[0]:t.reduce((t,i,r)=>t+(e=>{if(!0===e._$cssResult$)return e.cssText;if("number"==typeof e)return e;throw Error("Value passed to 'css' function must be a 'css' function result: "+e+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+e[r+1],e[0]),e,a),u=(e,t)=>{if(n)e.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let i of t){let t=document.createElement("style"),n=r.litNonce;void 0!==n&&t.setAttribute("nonce",n),t.textContent=i.cssText,e.appendChild(t)}},d=n?e=>e:e=>e instanceof CSSStyleSheet?(e=>{let t="";for(let i of e.cssRules)t+=i.cssText;return c(t)})(e):e,{is:h,defineProperty:p,getOwnPropertyDescriptor:f,getOwnPropertyNames:g,getOwnPropertySymbols:w,getPrototypeOf:m}=Object,b=globalThis,v=b.trustedTypes,y=v?v.emptyScript:"",x=b.reactiveElementPolyfillSupport,C=(e,t)=>e,A={toAttribute(e,t){switch(t){case Boolean:e=e?y:null;break;case Object:case Array:e=null==e?e:JSON.stringify(e)}return e},fromAttribute(e,t){let i=e;switch(t){case Boolean:i=null!==e;break;case Number:i=null===e?null:Number(e);break;case Object:case Array:try{i=JSON.parse(e)}catch(e){i=null}}return i}},E=(e,t)=>!h(e,t),_={attribute:!0,type:String,converter:A,reflect:!1,hasChanged:E};Symbol.metadata??=Symbol("metadata"),b.litPropertyMetadata??=new WeakMap;class k extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=_){if(t.state&&(t.attribute=!1),this._$Ei(),this.elementProperties.set(e,t),!t.noAccessor){let i=Symbol(),r=this.getPropertyDescriptor(e,i,t);void 0!==r&&p(this.prototype,e,r)}}static getPropertyDescriptor(e,t,i){let{get:r,set:n}=f(this.prototype,e)??{get(){return this[t]},set(e){this[t]=e}};return{get(){return r?.call(this)},set(t){let a=r?.call(this);n.call(this,t),this.requestUpdate(e,a,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??_}static _$Ei(){if(this.hasOwnProperty(C("elementProperties")))return;let e=m(this);e.finalize(),void 0!==e.l&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(C("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(C("properties"))){let e=this.properties;for(let t of[...g(e),...w(e)])this.createProperty(t,e[t])}let e=this[Symbol.metadata];if(null!==e){let t=litPropertyMetadata.get(e);if(void 0!==t)for(let[e,i]of t)this.elementProperties.set(e,i)}for(let[e,t]of(this._$Eh=new Map,this.elementProperties)){let i=this._$Eu(e,t);void 0!==i&&this._$Eh.set(i,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){let t=[];if(Array.isArray(e))for(let i of new Set(e.flat(1/0).reverse()))t.unshift(d(i));else void 0!==e&&t.push(d(e));return t}static _$Eu(e,t){let i=t.attribute;return!1===i?void 0:"string"==typeof i?i:"string"==typeof e?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$Eg=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$ES(),this.requestUpdate(),this.constructor.l?.forEach(e=>e(this))}addController(e){(this._$E_??=new Set).add(e),void 0!==this.renderRoot&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$E_?.delete(e)}_$ES(){let e=new Map;for(let t of this.constructor.elementProperties.keys())this.hasOwnProperty(t)&&(e.set(t,this[t]),delete this[t]);e.size>0&&(this._$Ep=e)}createRenderRoot(){let e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return u(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$E_?.forEach(e=>e.hostConnected?.())}enableUpdating(e){}disconnectedCallback(){this._$E_?.forEach(e=>e.hostDisconnected?.())}attributeChangedCallback(e,t,i){this._$AK(e,i)}_$EO(e,t){let i=this.constructor.elementProperties.get(e),r=this.constructor._$Eu(e,i);if(void 0!==r&&!0===i.reflect){let n=(void 0!==i.converter?.toAttribute?i.converter:A).toAttribute(t,i.type);this._$Em=e,null==n?this.removeAttribute(r):this.setAttribute(r,n),this._$Em=null}}_$AK(e,t){let i=this.constructor,r=i._$Eh.get(e);if(void 0!==r&&this._$Em!==r){let e=i.getPropertyOptions(r),n="function"==typeof e.converter?{fromAttribute:e.converter}:void 0!==e.converter?.fromAttribute?e.converter:A;this._$Em=r,this[r]=n.fromAttribute(t,e.type),this._$Em=null}}requestUpdate(e,t,i,r=!1,n){if(void 0!==e){if(!((i??=this.constructor.getPropertyOptions(e)).hasChanged??E)(r?n:this[e],t))return;this.C(e,t,i)}!1===this.isUpdatePending&&(this._$Eg=this._$EP())}C(e,t,i){this._$AL.has(e)||this._$AL.set(e,t),!0===i.reflect&&this._$Em!==e&&(this._$Ej??=new Set).add(e)}async _$EP(){this.isUpdatePending=!0;try{await this._$Eg}catch(e){Promise.reject(e)}let e=this.scheduleUpdate();return null!=e&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[e,t]of this._$Ep)this[e]=t;this._$Ep=void 0}let e=this.constructor.elementProperties;if(e.size>0)for(let[t,i]of e)!0!==i.wrapped||this._$AL.has(t)||void 0===this[t]||this.C(t,this[t],i)}let e=!1,t=this._$AL;try{(e=this.shouldUpdate(t))?(this.willUpdate(t),this._$E_?.forEach(e=>e.hostUpdate?.()),this.update(t)):this._$ET()}catch(t){throw e=!1,this._$ET(),t}e&&this._$AE(t)}willUpdate(e){}_$AE(e){this._$E_?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$ET(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$Eg}shouldUpdate(e){return!0}update(e){this._$Ej&&=this._$Ej.forEach(e=>this._$EO(e,this[e])),this._$ET()}updated(e){}firstUpdated(e){}}k.elementStyles=[],k.shadowRootOptions={mode:"open"},k[C("elementProperties")]=new Map,k[C("finalized")]=new Map,x?.({ReactiveElement:k}),(b.reactiveElementVersions??=[]).push("2.0.2")},93709:(e,t,i)=>{"use strict";i.d(t,{DO:()=>s,Id:()=>x,My:()=>u,OG:()=>I,Ph:()=>w,Q5:()=>R,aK:()=>_,aT:()=>g,aY:()=>o,dJ:()=>k,e8:()=>c,ex:()=>C,fg:()=>N,lX:()=>m,lq:()=>b,qj:()=>y,r4:()=>E,x:()=>O,z:()=>v,zW:()=>d});let r=BigInt(0),n=BigInt(1),a=BigInt(2);function o(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&"Uint8Array"===e.constructor.name}function s(e){if(!o(e))throw Error("Uint8Array expected")}function c(e,t){if("boolean"!=typeof t)throw Error(e+" boolean expected, got "+t)}let l=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function u(e){s(e);let t="";for(let i=0;i=p._0&&e<=p._9?e-p._0:e>=p.A&&e<=p.F?e-(p.A-10):e>=p.a&&e<=p.f?e-(p.a-10):void 0}function g(e){if("string"!=typeof e)throw Error("hex string expected, got "+typeof e);let t=e.length,i=t/2;if(t%2)throw Error("hex string expected, got unpadded hex of length "+t);let r=new Uint8Array(i);for(let t=0,n=0;t"bigint"==typeof e&&r<=e;function E(e,t,i){return A(e)&&A(t)&&A(i)&&t<=e&&er;e>>=n,t+=1);return t}let I=e=>(a<new Uint8Array(e),T=e=>Uint8Array.from(e);function N(e,t,i){if("number"!=typeof e||e<2)throw Error("hashLen must be a number");if("number"!=typeof t||t<2)throw Error("qByteLen must be a number");if("function"!=typeof i)throw Error("hmacFn must be a function");let r=S(e),n=S(e),a=0,o=()=>{r.fill(1),n.fill(0),a=0},s=(...e)=>i(n,r,...e),c=(e=S())=>{n=s(T([0]),e),r=s(),0!==e.length&&(n=s(T([1]),e),r=s())},l=()=>{if(a++>=1e3)throw Error("drbg: tried 1000 values");let e=0,i=[];for(;e{let i;for(o(),c(e);!(i=t(l()));)c();return o(),i}}let P={bigint:e=>"bigint"==typeof e,function:e=>"function"==typeof e,boolean:e=>"boolean"==typeof e,string:e=>"string"==typeof e,stringOrUint8Array:e=>"string"==typeof e||o(e),isSafeInteger:e=>Number.isSafeInteger(e),array:e=>Array.isArray(e),field:(e,t)=>t.Fp.isValid(e),hash:e=>"function"==typeof e&&Number.isSafeInteger(e.outputLen)};function R(e,t,i={}){let r=(t,i,r)=>{let n=P[i];if("function"!=typeof n)throw Error("invalid validator function");let a=e[t];if((!r||void 0!==a)&&!n(a,e))throw Error("param "+String(t)+" is invalid. Expected "+i+", got "+a)};for(let[e,i]of Object.entries(t))r(e,i,!1);for(let[e,t]of Object.entries(i))r(e,t,!0);return e}function O(e){let t=new WeakMap;return(i,...r)=>{let n=t.get(i);if(void 0!==n)return n;let a=e(i,...r);return t.set(i,a),a}}},9631:(e,t,i)=>{"use strict";let r,n,a,o,s,c,l,u,d,h,p,f,g,w,m,b,v;i.d(t,{D:()=>ih}),i(15899);var y=i(21552),x=i(14191);let C=e=>(t,i,r)=>{let n=r.subscribe;return r.subscribe=(e,t,i)=>{let a=e;if(t){let n=(null==i?void 0:i.equalityFn)||Object.is,o=e(r.getState());a=i=>{let r=e(i);if(!n(o,r)){let e=o;t(o=r,e)}},(null==i?void 0:i.fireImmediately)&&t(o,o)}return n(a)},e(t,i,r)},A=e=>t=>{try{let i=e(t);if(i instanceof Promise)return i;return{then:e=>A(e)(i),catch(e){return this}}}catch(e){return{then(e){return this},catch:t=>A(t)(e)}}},E=(e,t)=>(i,r,n)=>{let a,o={storage:function(e,t){let i;try{i=e()}catch(e){return}return{getItem:e=>{var t;let r=e=>null===e?null:JSON.parse(e,void 0),n=null!=(t=i.getItem(e))?t:null;return n instanceof Promise?n.then(r):r(n)},setItem:(e,t)=>i.setItem(e,JSON.stringify(t,void 0)),removeItem:e=>i.removeItem(e)}}(()=>localStorage),partialize:e=>e,version:0,merge:(e,t)=>({...t,...e}),...t},s=!1,c=new Set,l=new Set,u=o.storage;if(!u)return e((...e)=>{console.warn(`[zustand persist middleware] Unable to update item '${o.name}', the given storage is currently unavailable.`),i(...e)},r,n);let d=()=>{let e=o.partialize({...r()});return u.setItem(o.name,{state:e,version:o.version})},h=n.setState;n.setState=(e,t)=>{h(e,t),d()};let p=e((...e)=>{i(...e),d()},r,n);n.getInitialState=()=>p;let f=()=>{var e,t;if(!u)return;s=!1,c.forEach(e=>{var t;return e(null!=(t=r())?t:p)});let n=(null==(t=o.onRehydrateStorage)?void 0:t.call(o,null!=(e=r())?e:p))||void 0;return A(u.getItem.bind(u))(o.name).then(e=>{if(e){if("number"!=typeof e.version||e.version===o.version)return[!1,e.state];if(o.migrate)return[!0,o.migrate(e.state,e.version)];console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}return[!1,void 0]}).then(e=>{var t;let[n,s]=e;if(i(a=o.merge(s,null!=(t=r())?t:p),!0),n)return d()}).then(()=>{null==n||n(a,void 0),a=r(),s=!0,l.forEach(e=>e(a))}).catch(e=>{null==n||n(void 0,e)})};return n.persist={setOptions:e=>{o={...o,...e},e.storage&&(u=e.storage)},clearStorage:()=>{null==u||u.removeItem(o.name)},getOptions:()=>o,rehydrate:()=>f(),hasHydrated:()=>s,onHydrate:e=>(c.add(e),()=>{c.delete(e)}),onFinishHydration:e=>(l.add(e),()=>{l.delete(e)})},o.skipHydration||f(),a||p},_=e=>{let t;let i=new Set,r=(e,r)=>{let n="function"==typeof e?e(t):e;if(!Object.is(n,t)){let e=t;t=(null!=r?r:"object"!=typeof n||null===n)?n:Object.assign({},t,n),i.forEach(i=>i(t,e))}},n=()=>t,a={setState:r,getState:n,getInitialState:()=>o,subscribe:e=>(i.add(e),()=>i.delete(e))},o=t=e(r,n,a);return a},k=e=>e?_(e):_;var I=i(72565),S=i(76170);class T{constructor(e){Object.defineProperty(this,"uid",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"_emitter",{enumerable:!0,configurable:!0,writable:!0,value:new S.b})}on(e,t){this._emitter.on(e,t)}once(e,t){this._emitter.once(e,t)}off(e,t){this._emitter.off(e,t)}emit(e,...t){let i=t[0];this._emitter.emit(e,{uid:this.uid,...i})}listenerCount(e){return this._emitter.listenerCount(e)}}var N=i(32130),P=i(61282);let R=256;var O=i(68748),M=i(12178),D=i(31336);let U=[];function $(e){let t=[...e.state.connections.values()];return"reconnecting"===e.state.status||(0,D.b)(U,t)?U:(U=t,t)}var L=i(16603),j=i(49647),B=i(40539),W=i(66604);async function q(e,t){let{account:i,chainId:r,...n}=t,a=i??(0,j.s)(e).address,o=e.getClient({chainId:r});return(0,W.T)(o,B.f,"prepareTransactionRequest")({...n,...a?{account:a}:{}})}var H=i(83295),z=i(36352);async function F(e,t){let i;let{account:r,chainId:n,connector:a,...o}=t;i="object"==typeof r&&r?.type==="local"?e.getClient({chainId:n}):await (0,z.r)(e,{account:r??void 0,chainId:n,connector:a});let s=(0,W.T)(i,H.v,"sendTransaction");return await s({...o,...r?{account:r}:{},chain:n?{id:n}:null,gas:o.gas??void 0})}var Z=i(67900),V=i(15176),K=i(14005),G=i(45735);let J=new Map,Y=new Map,Q=0;function X(e,t,i){let r=++Q,n=()=>J.get(e)||[],a=()=>{let t=n();J.set(e,t.filter(e=>e.id!==r))},o=()=>{let t=n();if(!t.some(e=>e.id===r))return;let i=Y.get(e);1===t.length&&i&&i(),a()},s=n();if(J.set(e,[...s,{id:r,fns:t}]),s&&s.length>0)return o;let c={};for(let e in t)c[e]=(...t)=>{let i=n();if(0!==i.length)for(let r of i)r.fns[e]?.(...t)};let l=i(c);return"function"==typeof l&&Y.set(e,l),o}var ee=i(54584),et=i(41525),ei=i(6044),er=i(27792),en=i(81867),ea=i(62443);async function eo(e,{blockHash:t,blockNumber:i,blockTag:r,hash:n,index:a}){let o=r||"latest",s=void 0!==i?(0,en.cK)(i):void 0,c=null;if(n?c=await e.request({method:"eth_getTransactionByHash",params:[n]},{dedupe:!0}):t?c=await e.request({method:"eth_getTransactionByBlockHashAndIndex",params:[t,(0,en.cK)(a)]},{dedupe:!0}):(s||o)&&(c=await e.request({method:"eth_getTransactionByBlockNumberAndIndex",params:[s||o,(0,en.cK)(a)]},{dedupe:!!s})),!c)throw new K.Kz({blockHash:t,blockNumber:i,blockTag:o,hash:n,index:a});return(e.chain?.formatters?.transaction?.format||ea.uP)(c)}let es={"0x0":"reverted","0x1":"success"};async function ec(e,{hash:t}){let i=await e.request({method:"eth_getTransactionReceipt",params:[t]},{dedupe:!0});if(!i)throw new K.Kc({hash:t});return(e.chain?.formatters?.transactionReceipt?.format||function(e){let t={...e,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,contractAddress:e.contractAddress?e.contractAddress:null,cumulativeGasUsed:e.cumulativeGasUsed?BigInt(e.cumulativeGasUsed):null,effectiveGasPrice:e.effectiveGasPrice?BigInt(e.effectiveGasPrice):null,gasUsed:e.gasUsed?BigInt(e.gasUsed):null,logs:e.logs?e.logs.map(e=>(function(e,{args:t,eventName:i}={}){return{...e,blockHash:e.blockHash?e.blockHash:null,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,logIndex:e.logIndex?Number(e.logIndex):null,transactionHash:e.transactionHash?e.transactionHash:null,transactionIndex:e.transactionIndex?Number(e.transactionIndex):null,...i?{args:t,eventName:i}:{}}})(e)):null,to:e.to?e.to:null,transactionIndex:e.transactionIndex?(0,Z.ME)(e.transactionIndex):null,status:e.status?es[e.status]:null,type:e.type?ea.b4[e.type]||e.type:null};return e.blobGasPrice&&(t.blobGasPrice=BigInt(e.blobGasPrice)),e.blobGasUsed&&(t.blobGasUsed=BigInt(e.blobGasUsed)),t})(i)}var el=i(38102);let eu=new Map,ed=new Map;async function eh(e,{cacheKey:t,cacheTime:i=Number.POSITIVE_INFINITY}){let r=function(e){let t=(e,t)=>({clear:()=>t.delete(e),get:()=>t.get(e),set:i=>t.set(e,i)}),i=t(e,eu),r=t(e,ed);return{clear:()=>{i.clear(),r.clear()},promise:i,response:r}}(t),n=r.response.get();if(n&&i>0&&new Date().getTime()-n.created.getTime()`blockNumber.${e}`;async function ef(e,{cacheTime:t=e.cacheTime}={}){return BigInt(await eh(()=>e.request({method:"eth_blockNumber"}),{cacheKey:ep(e.uid),cacheTime:t}))}function eg(e,{emitOnBegin:t=!1,emitMissed:i=!1,onBlockNumber:r,onError:n,poll:a,pollingInterval:o=e.pollingInterval}){let s;return(void 0!==a?a:"webSocket"!==e.transport.type&&("fallback"!==e.transport.type||"webSocket"!==e.transport.transports[0].config.type))?X((0,ei.A)(["watchBlockNumber",e.uid,t,i,o]),{onBlockNumber:r,onError:n},r=>(function(e,{emitOnBegin:t,initialWaitTime:i,interval:r}){let n=!0,a=()=>n=!1;return(async()=>{let o;t&&(o=await e({unpoll:a}));let s=await i?.(o)??r;await (0,el.u)(s);let c=async()=>{n&&(await e({unpoll:a}),await (0,el.u)(r),c())};c()})(),a})(async()=>{try{let t=await (0,G.T)(e,ef,"getBlockNumber")({cacheTime:0});if(s){if(t===s)return;if(t-s>1&&i)for(let e=s+1n;es)&&(r.onBlockNumber(t,s),s=t)}catch(e){r.onError?.(e)}},{emitOnBegin:t,interval:o})):X((0,ei.A)(["watchBlockNumber",e.uid,t,i]),{onBlockNumber:r,onError:n},t=>{let i=!0,r=()=>i=!1;return(async()=>{try{let n=(()=>{if("fallback"===e.transport.type){let t=e.transport.transports.find(e=>"webSocket"===e.config.type);return t?t.value:e.transport}return e.transport})(),{unsubscribe:a}=await n.subscribe({params:["newHeads"],onData(e){if(!i)return;let r=(0,Z.uU)(e.result?.number);t.onBlockNumber(r,s),s=r},onError(e){t.onError?.(e)}});r=a,i||r()}catch(e){n?.(e)}})(),()=>r()})}async function ew(e,{confirmations:t=1,hash:i,onReplaced:r,pollingInterval:n=e.pollingInterval,retryCount:a=6,retryDelay:o=({count:e})=>200*~~(1<g(new K.WA({hash:i})),s):void 0,m=X(d,{onReplaced:r,resolve:f,reject:g},r=>{let s=(0,G.T)(e,eg,"watchBlockNumber")({emitMissed:!0,emitOnBegin:!0,poll:!0,pollingInterval:n,async onBlockNumber(n){let d=e=>{clearTimeout(w),s(),e(),m()},p=n;if(!h)try{if(u){if(t>1&&(!u.blockNumber||p-u.blockNumber+1nr.resolve(u));return}if(c||(h=!0,await (0,et.b)(async()=>{(c=await (0,G.T)(e,eo,"getTransaction")({hash:i})).blockNumber&&(p=c.blockNumber)},{delay:o,retryCount:a}),h=!1),u=await (0,G.T)(e,ec,"getTransactionReceipt")({hash:i}),t>1&&(!u.blockNumber||p-u.blockNumber+1nr.resolve(u))}catch(i){if(i instanceof K.Kz||i instanceof K.Kc){if(!c){h=!1;return}try{l=c,h=!0;let i=await (0,et.b)(()=>(0,G.T)(e,er.g,"getBlock")({blockNumber:p,includeTransactions:!0}),{delay:o,retryCount:a,shouldRetry:({error:e})=>e instanceof V.l});h=!1;let n=i.transactions.find(({from:e,nonce:t})=>e===l.from&&t===l.nonce);if(!n||(u=await (0,G.T)(e,ec,"getTransactionReceipt")({hash:n.hash}),t>1&&(!u.blockNumber||p-u.blockNumber+1n{r.onReplaced?.({reason:s,replacedTransaction:l,transaction:n,transactionReceipt:u}),r.resolve(u)})}catch(e){d(()=>r.reject(e))}}else d(()=>r.reject(i))}}})});return p}var em=i(74736);async function eb(e,t){let{chainId:i,timeout:r=0,...n}=t,a=e.getClient({chainId:i}),o=(0,W.T)(a,ew,"waitForTransactionReceipt"),s=await o({...n,timeout:r});if("reverted"===s.status){let e=(0,W.T)(a,eo,"getTransaction"),t=await e({hash:s.transactionHash}),i=(0,W.T)(a,em.T,"call"),r=await i({...t,data:t.input,gasPrice:"eip1559"!==t.type?t.gasPrice:void 0,maxFeePerGas:"eip1559"===t.type?t.maxFeePerGas:void 0,maxPriorityFeePerGas:"eip1559"===t.type?t.maxPriorityFeePerGas:void 0});throw Error(r?.data?(0,Z.IQ)(`0x${r.data.substring(138)}`):"unknown reason")}return{...s,chainId:a.chain.id}}var ev=i(29378),ey=i(41136),ex=i(6319),eC=i(90154),eA=i(26418),eE=i(28464),e_=i(43782),ek=i(33671),eI=i(73186);function eS(e,t){if(!(e instanceof ek.C))return!1;let i=e.walk(e=>e instanceof eI.M);return i instanceof eI.M&&(!!(i.data?.errorName==="ResolverNotFound"||i.data?.errorName==="ResolverWildcardNotSupported"||i.data?.errorName==="ResolverNotContract"||i.data?.errorName==="ResolverError"||i.data?.errorName==="HttpError"||i.reason?.includes("Wildcard on non-extended resolvers is not supported"))||"reverse"===t&&i.reason===e_.fD[50])}var eT=i(65224),eN=i(24453),eP=i(99039),eR=i(14329);function eO(e){if(66!==e.length||0!==e.indexOf("[")||65!==e.indexOf("]"))return null;let t=`0x${e.slice(1,65)}`;return(0,eR.q)(t)?t:null}function eM(e){let t=new Uint8Array(32).fill(0);if(!e)return(0,en.My)(t);let i=e.split(".");for(let e=i.length-1;e>=0;e-=1){let r=eO(i[e]),n=r?(0,eN.ZJ)(r):(0,eP.S)((0,eN.Af)(i[e]),"bytes");t=(0,eP.S)((0,eT.xW)([t,n]),"bytes")}return(0,en.My)(t)}function eD(e){let t=e.replace(/^\.|\.$/gm,"");if(0===t.length)return new Uint8Array(1);let i=new Uint8Array((0,eN.Af)(t).byteLength+2),r=0,n=t.split(".");for(let e=0;e255){var a;t=(0,eN.Af)((a=function(e){let t=new Uint8Array(32).fill(0);return e?eO(e)||(0,eP.S)((0,eN.Af)(e)):(0,en.My)(t)}(n[e]),`[${a.slice(2)}]`))}i[r]=t.length,i.set(t,r+1),r+=t.length+1}return i.byteLength!==r+1?i.slice(0,r+1):i}var eU=i(97903);async function e$(e,{blockNumber:t,blockTag:i,coinType:r,name:n,gatewayUrls:a,strict:o,universalResolverAddress:s}){let c=s;if(!c){if(!e.chain)throw Error("client chain not configured. universalResolverAddress is required.");c=(0,eA.M)({blockNumber:t,chain:e.chain,contract:"ensUniversalResolver"})}try{let o=(0,eC.p)({abi:ey.Rm,functionName:"addr",...null!=r?{args:[eM(n),BigInt(r)]}:{args:[eM(n)]}}),s={address:c,abi:ey.Ag,functionName:"resolve",args:[(0,en.nj)(eD(n)),o],blockNumber:t,blockTag:i},l=(0,G.T)(e,eU.J,"readContract"),u=a?await l({...s,args:[...s.args,a]}):await l(s);if("0x"===u[0])return null;let d=(0,ex.e)({abi:ey.Rm,args:null!=r?[eM(n),BigInt(r)]:void 0,functionName:"addr",data:u[0]});if("0x"===d||"0x00"===(0,eE.B)(d))return null;return d}catch(e){if(o)throw e;if(eS(e,"resolve"))return null;throw e}}var eL=i(95036);async function ej(e,t){let i;let{chainId:r,connector:n,...a}=t;i=t.account?t.account:(await (0,z.r)(e,{account:t.account,chainId:r,connector:n})).account;let o=e.getClient({chainId:r});return(0,W.T)(o,eL.Q,"estimateGas")({...a,account:i})}var eB=i(73546),eW=i(54157),eq=i(13412);async function eH(e,{address:t,blockNumber:i,blockTag:r,gatewayUrls:n,strict:a,universalResolverAddress:o}){let s=o;if(!s){if(!e.chain)throw Error("client chain not configured. universalResolverAddress is required.");s=(0,eA.M)({blockNumber:i,chain:e.chain,contract:"ensUniversalResolver"})}let c=`${t.toLowerCase().substring(2)}.addr.reverse`;try{let a={address:s,abi:ey.oX,functionName:"reverse",args:[(0,en.nj)(eD(c))],blockNumber:i,blockTag:r},o=(0,G.T)(e,eU.J,"readContract"),[l,u]=n?await o({...a,args:[...a.args,n]}):await o(a);if(t.toLowerCase()!==u.toLowerCase())return null;return l}catch(e){if(a)throw e;if(eS(e,"reverse"))return null;throw e}}class ez extends ek.C{constructor({data:e}){super("Unable to extract image from metadata. The metadata may be malformed or invalid.",{metaMessages:["- Metadata must be a JSON object with at least an `image`, `image_url` or `image_data` property.","",`Provided data: ${JSON.stringify(e)}`],name:"EnsAvatarInvalidMetadataError"})}}class eF extends ek.C{constructor({reason:e}){super(`ENS NFT avatar URI is invalid. ${e}`,{name:"EnsAvatarInvalidNftUriError"})}}class eZ extends ek.C{constructor({uri:e}){super(`Unable to resolve ENS avatar URI "${e}". The URI may be malformed, invalid, or does not respond with a valid image.`,{name:"EnsAvatarUriResolutionError"})}}class eV extends ek.C{constructor({namespace:e}){super(`ENS NFT avatar namespace "${e}" is not supported. Must be "erc721" or "erc1155".`,{name:"EnsAvatarUnsupportedNamespaceError"})}}let eK=/(?https?:\/\/[^\/]*|ipfs:\/|ipns:\/|ar:\/)?(?\/)?(?ipfs\/|ipns\/)?(?[\w\-.]+)(?\/.*)?/,eG=/^(Qm[1-9A-HJ-NP-Za-km-z]{44,}|b[A-Za-z2-7]{58,}|B[A-Z2-7]{58,}|z[1-9A-HJ-NP-Za-km-z]{48,}|F[0-9A-F]{50,})(\/(?[\w\-.]+))?(?\/.*)?$/,eJ=/^data:([a-zA-Z\-/+]*);base64,([^"].*)/,eY=/^data:([a-zA-Z\-/+]*)?(;[a-zA-Z0-9].*?)?(,)/;async function eQ(e){try{let t=await fetch(e,{method:"HEAD"});if(200===t.status){let e=t.headers.get("content-type");return e?.startsWith("image/")}return!1}catch(t){if("object"==typeof t&&void 0!==t.response||!globalThis.hasOwnProperty("Image"))return!1;return new Promise(t=>{let i=new Image;i.onload=()=>{t(!0)},i.onerror=()=>{t(!1)},i.src=e})}}function eX(e,t){return e?e.endsWith("/")?e.slice(0,-1):e:t}function e0({uri:e,gatewayUrls:t}){let i=eJ.test(e);if(i)return{uri:e,isOnChain:!0,isEncoded:i};let r=eX(t?.ipfs,"https://ipfs.io"),n=eX(t?.arweave,"https://arweave.net"),a=e.match(eK),{protocol:o,subpath:s,target:c,subtarget:l=""}=a?.groups||{},u="ipns:/"===o||"ipns/"===s,d="ipfs:/"===o||"ipfs/"===s||eG.test(e);if(e.startsWith("http")&&!u&&!d){let i=e;return t?.arweave&&(i=e.replace(/https:\/\/arweave.net/g,t?.arweave)),{uri:i,isOnChain:!1,isEncoded:!1}}if((u||d)&&c)return{uri:`${r}/${u?"ipns":"ipfs"}/${c}${l}`,isOnChain:!1,isEncoded:!1};if("ar:/"===o&&c)return{uri:`${n}/${c}${l||""}`,isOnChain:!1,isEncoded:!1};let h=e.replace(eY,"");if(h.startsWith("e.json());return await e3({gatewayUrls:e,uri:e1(i)})}catch{throw new eZ({uri:t})}}async function e3({gatewayUrls:e,uri:t}){let{uri:i,isOnChain:r}=e0({uri:t,gatewayUrls:e});if(r||await eQ(i))return i;throw new eZ({uri:t})}async function e5(e,{nft:t}){if("erc721"===t.namespace)return(0,eU.J)(e,{address:t.contractAddress,abi:[{name:"tokenURI",type:"function",stateMutability:"view",inputs:[{name:"tokenId",type:"uint256"}],outputs:[{name:"",type:"string"}]}],functionName:"tokenURI",args:[BigInt(t.tokenID)]});if("erc1155"===t.namespace)return(0,eU.J)(e,{address:t.contractAddress,abi:[{name:"uri",type:"function",stateMutability:"view",inputs:[{name:"_id",type:"uint256"}],outputs:[{name:"",type:"string"}]}],functionName:"uri",args:[BigInt(t.tokenID)]});throw new eV({namespace:t.namespace})}async function e4(e,{gatewayUrls:t,record:i}){return/eip155:/i.test(i)?e6(e,{gatewayUrls:t,record:i}):e3({uri:i,gatewayUrls:t})}async function e6(e,{gatewayUrls:t,record:i}){let r=function(e){let t=e;t.startsWith("did:nft:")&&(t=t.replace("did:nft:","").replace(/_/g,"/"));let[i,r,n]=t.split("/"),[a,o]=i.split(":"),[s,c]=r.split(":");if(!a||"eip155"!==a.toLowerCase())throw new eF({reason:"Only EIP-155 supported"});if(!o)throw new eF({reason:"Chain ID not found"});if(!c)throw new eF({reason:"Contract address not found"});if(!n)throw new eF({reason:"Token ID not found"});if(!s)throw new eF({reason:"ERC namespace not found"});return{chainID:Number.parseInt(o),namespace:s.toLowerCase(),contractAddress:c,tokenID:n}}(i),{uri:n,isOnChain:a,isEncoded:o}=e0({uri:await e5(e,{nft:r}),gatewayUrls:t});if(a&&(n.includes("data:application/json;base64,")||n.startsWith("{")))return e3({uri:e1(JSON.parse(o?atob(n.replace("data:application/json;base64,","")):n)),gatewayUrls:t});let s=r.tokenID;return"erc1155"===r.namespace&&(s=s.replace("0x","").padStart(64,"0")),e2({gatewayUrls:t,uri:n.replace(/(?:0x)?{id}/,s)})}async function e8(e,{blockNumber:t,blockTag:i,name:r,key:n,gatewayUrls:a,strict:o,universalResolverAddress:s}){let c=s;if(!c){if(!e.chain)throw Error("client chain not configured. universalResolverAddress is required.");c=(0,eA.M)({blockNumber:t,chain:e.chain,contract:"ensUniversalResolver"})}try{let o={address:c,abi:ey.Ag,functionName:"resolve",args:[(0,en.nj)(eD(r)),(0,eC.p)({abi:ey.SJ,functionName:"text",args:[eM(r),n]})],blockNumber:t,blockTag:i},s=(0,G.T)(e,eU.J,"readContract"),l=a?await s({...o,args:[...o.args,a]}):await s(o);if("0x"===l[0])return null;let u=(0,ex.e)({abi:ey.SJ,functionName:"text",data:l[0]});return""===u?null:u}catch(e){if(o)throw e;if(eS(e,"resolve"))return null;throw e}}async function e9(e,{blockNumber:t,blockTag:i,assetGatewayUrls:r,name:n,gatewayUrls:a,strict:o,universalResolverAddress:s}){let c=await (0,G.T)(e,e8,"getEnsText")({blockNumber:t,blockTag:i,key:"avatar",name:n,universalResolverAddress:s,gatewayUrls:a,strict:o});if(!c)return null;try{return await e4(e,{record:c,gatewayUrls:r})}catch{return null}}async function e7(e,t={}){let i;if(t.connector)i=t.connector;else{let{connections:t,current:r}=e.state,n=t.get(r);i=n?.connector}let r=e.state.connections;i&&(await i.disconnect(),i.emitter.off("change",e._internal.events.change),i.emitter.off("disconnect",e._internal.events.disconnect),i.emitter.on("connect",e._internal.events.connect),r.delete(i.uid)),e.setState(e=>{if(0===r.size)return{...e,connections:new Map,current:null,status:"disconnected"};let t=r.values().next().value;return{...e,connections:new Map(r),current:t.connector.uid}});{let t=e.state.current;if(!t)return;let i=e.state.connections.get(t)?.connector;if(!i)return;await e.storage?.setItem("recentConnectorId",i.id)}}var te=i(64241),tt=i(50639),ti=i(83320);i(45011);var tr=i(61678),tn=i(7270),ta=i(60402),to=i(71139),ts=i(80196);i(81696),i(64810);var tc=i(58051),tl=i(84671);function tu(e,t,i){let r,n,a,o,s,c,l;let u=e.isNewChainsStale??!0;return(0,ti.U)(e=>({id:"walletConnect",name:"WalletConnect",type:tu.type,async setup(){let e=await this.getProvider().catch(()=>null);e&&(o||(o=this.onConnect.bind(this),e.on("connect",o)),c||(c=this.onSessionDelete.bind(this),e.on("session_delete",c)))},async connect({...e}={}){try{let t=await this.getProvider();if(!t)throw new tl.N;s||(s=this.onDisplayUri,t.on("display_uri",s));let r=await this.isChainsStale();if(t.session&&r&&await t.disconnect(),!t.session||r){let r=tc.k.createNamespaces(i);await t.connect({optionalNamespaces:r,..."pairingTopic"in e?{pairingTopic:e.pairingTopic}:{}}),this.setRequestedChainsIds(i.map(e=>Number(e.id)))}let u=(await t.enable()).map(e=>(0,tn.b)(e)),d=await this.getChainId();return s&&(t.removeListener("display_uri",s),s=void 0),o&&(t.removeListener("connect",o),o=void 0),n||(n=this.onAccountsChanged.bind(this),t.on("accountsChanged",n)),a||(a=this.onChainChanged.bind(this),t.on("chainChanged",a)),l||(l=this.onDisconnect.bind(this),t.on("disconnect",l)),c||(c=this.onSessionDelete.bind(this),t.on("session_delete",c)),{accounts:u,chainId:d}}catch(e){if(/(user rejected|connection request reset)/i.test(e?.message))throw new tr.vx(e);throw e}},async disconnect(){let e=await this.getProvider();try{await e?.disconnect()}catch(e){if(!/No matching key/i.test(e.message))throw e}finally{a&&(e?.removeListener("chainChanged",a),a=void 0),l&&(e?.removeListener("disconnect",l),l=void 0),o||(o=this.onConnect.bind(this),e?.on("connect",o)),n&&(e?.removeListener("accountsChanged",n),n=void 0),c&&(e?.removeListener("session_delete",c),c=void 0),this.setRequestedChainsIds([])}},async getAccounts(){let e=await this.getProvider();if(!e?.session?.namespaces)return[];let t=e?.session?.namespaces.eip155?.accounts;return t?.map(e=>e.split(":")[2])??[]},async getProvider({chainId:e}={}){r||(r=await t.getUniversalProvider(),r?.events.setMaxListeners(Number.POSITIVE_INFINITY));let i=t.getCaipNetwork()?.id;if(e&&i!==e){let e=ts.iT.getStoredActiveCaipNetwork();e&&e.chainNamespace===tt.oU.CHAIN.EVM&&await this.switchChain?.({chainId:Number(e.id)})}return r},async getChainId(){let e=t.getCaipNetwork()?.id;if(e)return e;let r=await this.getProvider(),n=r.session?.namespaces.eip155?.chains?.[0],a=i.find(e=>e.id===n);return a?.id},async isAuthorized(){try{let[e,t]=await Promise.all([this.getAccounts(),this.getProvider()]);if(!e.length)return!1;if(await this.isChainsStale()&&t.session)return await t.disconnect().catch(()=>{}),!1;return!0}catch{return!1}},async switchChain({addEthereumChainParameter:t,chainId:r}){let n=await this.getProvider();if(!n)throw new tl.N;let a=i.find(e=>e.id===r);if(!a)throw new tr.ch(new P.nk);try{await n.request({method:"wallet_switchEthereumChain",params:[{chainId:(0,en.cK)(r)}]}),a?.caipNetworkId&&n.setDefaultChain(a?.caipNetworkId),e.emitter.emit("change",{chainId:Number(r)});let t=await this.getRequestedChainsIds();return this.setRequestedChainsIds([...t,r]),{...a,id:a.id}}catch(e){if(/(?:user rejected)/iu.test(e.message))throw new tr.vx(e);try{let e={blockExplorerUrls:t?.blockExplorerUrls?t.blockExplorerUrls:a.blockExplorers?.default.url?[a.blockExplorers?.default.url]:[],chainId:(0,en.cK)(r),chainName:a.name,iconUrls:t?.iconUrls,nativeCurrency:a.nativeCurrency,rpcUrls:a.rpcUrls.default.http};await n.request({method:"wallet_addEthereumChain",params:[e]});let i=await this.getRequestedChainsIds();return this.setRequestedChainsIds([...i,r]),{...a,id:a.id}}catch(e){throw new tr.vx(e)}}},onAccountsChanged(t){0===t.length?this.onDisconnect():e.emitter.emit("change",{accounts:t.map(e=>(0,tn.b)(e))})},onChainChanged(t){let i=Number(t);e.emitter.emit("change",{chainId:i})},onConnect(e){this.setRequestedChainsIds(i.map(e=>Number(e.id)))},async onDisconnect(t){this.setRequestedChainsIds([]),e.emitter.emit("disconnect");let i=await this.getProvider();n&&(i.removeListener("accountsChanged",n),n=void 0),a&&(i.removeListener("chainChanged",a),a=void 0),l&&(i.removeListener("disconnect",l),l=void 0),c&&(i.removeListener("session_delete",c),c=void 0),o||(o=this.onConnect.bind(this),i.on("connect",o))},onDisplayUri(t){e.emitter.emit("message",{type:"display_uri",data:t})},onSessionDelete(){this.onDisconnect()},getNamespaceChainsIds(){if(!r?.session?.namespaces)return[];let e=r?.session?.namespaces.eip155?.accounts;return e?.map(e=>Number.parseInt(e.split(":")[1]??""))??[]},async getRequestedChainsIds(){return[...new Set(await e.storage?.getItem(this.requestedChainsStorageKey)??[])]},async isChainsStale(){if(!u)return!1;let t=e.chains.map(e=>e.id),i=this.getNamespaceChainsIds();if(i.length&&!i.some(e=>t.includes(e)))return!1;let r=await this.getRequestedChainsIds();return!t.every(e=>r.includes(Number(e)))},async setRequestedChainsIds(t){await e.storage?.setItem(this.requestedChainsStorageKey,t)},get requestedChainsStorageKey(){return`${this.id}.requestedChains`}}))}function td(e={}){let t,r,n,a,o,s,c,l,u;return"3"===e.version||e.headlessMode?(0,ti.U)(s=>({id:"coinbaseWalletSDK",name:"Coinbase Wallet",type:td.type,async connect({chainId:e}={}){try{let t=await this.getProvider(),i=(await t.request({method:"eth_requestAccounts"})).map(e=>(0,tn.b)(e));n||(n=this.onAccountsChanged.bind(this),t.on("accountsChanged",n)),a||(a=this.onChainChanged.bind(this),t.on("chainChanged",a)),o||(o=this.onDisconnect.bind(this),t.on("disconnect",o));let r=await this.getChainId();if(e&&r!==e){let t=await this.switchChain({chainId:e}).catch(e=>{if(e.code===tr.vx.code)throw e;return{id:r}});r=t?.id??r}return{accounts:i,chainId:r}}catch(e){if(/(user closed modal|accounts received is empty|user denied account)/i.test(e.message))throw new tr.vx(e);throw e}},async disconnect(){let e=await this.getProvider();n&&(e.removeListener("accountsChanged",n),n=void 0),a&&(e.removeListener("chainChanged",a),a=void 0),o&&(e.removeListener("disconnect",o),o=void 0),e.disconnect(),e.close()},async getAccounts(){let e=await this.getProvider();return(await e.request({method:"eth_accounts"})).map(e=>(0,tn.b)(e))},async getChainId(){let e=await this.getProvider();return Number(await e.request({method:"eth_chainId"}))},async getProvider(){if(!r){t=new(await (async()=>{let{default:e}=await Promise.all([i.e(3061),i.e(2493)]).then(i.t.bind(i,13061,19));return"function"!=typeof e&&"function"==typeof e.default?e.default:e})())({...e,reloadOnDisconnect:!1});let n=t.walletExtension?.getChainId(),a=s.chains.find(t=>e.chainId?t.id===e.chainId:t.id===n)||s.chains[0],o=e.chainId||a?.id,c=e.jsonRpcUrl||a?.rpcUrls.default.http[0];r=t.makeWeb3Provider(c,o)}return r},async isAuthorized(){try{return!!(await this.getAccounts()).length}catch{return!1}},async switchChain({addEthereumChainParameter:e,chainId:t}){let i=s.chains.find(e=>e.id===t);if(!i)throw new tr.ch(new P.nk);let r=await this.getProvider();try{return await r.request({method:"wallet_switchEthereumChain",params:[{chainId:(0,en.cK)(i.id)}]}),i}catch(n){if(4902===n.code)try{let n,a;n=e?.blockExplorerUrls?e.blockExplorerUrls:i.blockExplorers?.default.url?[i.blockExplorers?.default.url]:[],a=e?.rpcUrls?.length?e.rpcUrls:[i.rpcUrls.default?.http[0]??""];let o={blockExplorerUrls:n,chainId:(0,en.cK)(t),chainName:e?.chainName??i.name,iconUrls:e?.iconUrls,nativeCurrency:e?.nativeCurrency??i.nativeCurrency,rpcUrls:a};return await r.request({method:"wallet_addEthereumChain",params:[o]}),i}catch(e){throw new tr.vx(e)}throw new tr.ch(n)}},onAccountsChanged(e){0===e.length?this.onDisconnect():s.emitter.emit("change",{accounts:e.map(e=>(0,tn.b)(e))})},onChainChanged(e){let t=Number(e);s.emitter.emit("change",{chainId:t})},async onDisconnect(e){s.emitter.emit("disconnect");let t=await this.getProvider();n&&(t.removeListener("accountsChanged",n),n=void 0),a&&(t.removeListener("chainChanged",a),a=void 0),o&&(t.removeListener("disconnect",o),o=void 0)}})):(0,ti.U)(t=>({id:"coinbaseWalletSDK",name:"Coinbase Wallet",rdns:"com.coinbase.wallet",type:td.type,async connect({chainId:e}={}){try{let t=await this.getProvider(),i=(await t.request({method:"eth_requestAccounts"})).map(e=>(0,tn.b)(e));c||(c=this.onAccountsChanged.bind(this),t.on("accountsChanged",c)),l||(l=this.onChainChanged.bind(this),t.on("chainChanged",l)),u||(u=this.onDisconnect.bind(this),t.on("disconnect",u));let r=await this.getChainId();if(e&&r!==e){let t=await this.switchChain({chainId:e}).catch(e=>{if(e.code===tr.vx.code)throw e;return{id:r}});r=t?.id??r}return{accounts:i,chainId:r}}catch(e){if(/(user closed modal|accounts received is empty|user denied account|request rejected)/i.test(e.message))throw new tr.vx(e);throw e}},async disconnect(){let e=await this.getProvider();c&&(e.removeListener("accountsChanged",c),c=void 0),l&&(e.removeListener("chainChanged",l),l=void 0),u&&(e.removeListener("disconnect",u),u=void 0),e.disconnect(),e.close?.()},async getAccounts(){let e=await this.getProvider();return(await e.request({method:"eth_accounts"})).map(e=>(0,tn.b)(e))},async getChainId(){let e=await this.getProvider();return Number(await e.request({method:"eth_chainId"}))},async getProvider(){if(!s){let r="string"==typeof e.preference?{options:e.preference}:{...e.preference,options:e.preference?.options??"all"},{createCoinbaseWalletSDK:n}=await i.e(201).then(i.bind(i,90201));s=n({...e,appChainIds:t.chains.map(e=>e.id),preference:r}).getProvider()}return s},async isAuthorized(){try{return!!(await this.getAccounts()).length}catch{return!1}},async switchChain({addEthereumChainParameter:e,chainId:i}){let r=t.chains.find(e=>e.id===i);if(!r)throw new tr.ch(new P.nk);let n=await this.getProvider();try{return await n.request({method:"wallet_switchEthereumChain",params:[{chainId:(0,en.cK)(r.id)}]}),r}catch(t){if(4902===t.code)try{let t,a;t=e?.blockExplorerUrls?e.blockExplorerUrls:r.blockExplorers?.default.url?[r.blockExplorers?.default.url]:[],a=e?.rpcUrls?.length?e.rpcUrls:[r.rpcUrls.default?.http[0]??""];let o={blockExplorerUrls:t,chainId:(0,en.cK)(i),chainName:e?.chainName??r.name,iconUrls:e?.iconUrls,nativeCurrency:e?.nativeCurrency??r.nativeCurrency,rpcUrls:a};return await n.request({method:"wallet_addEthereumChain",params:[o]}),r}catch(e){throw new tr.vx(e)}throw new tr.ch(t)}},onAccountsChanged(e){0===e.length?this.onDisconnect():t.emitter.emit("change",{accounts:e.map(e=>(0,tn.b)(e))})},onChainChanged(e){let i=Number(e);t.emitter.emit("change",{chainId:i})},async onDisconnect(e){t.emitter.emit("disconnect");let i=await this.getProvider();c&&(i.removeListener("accountsChanged",c),c=void 0),l&&(i.removeListener("chainChanged",l),l=void 0),u&&(i.removeListener("disconnect",u),u=void 0)}}))}i(27258),tu.type="walletConnect",td.type="coinbaseWallet";var th=i(73963),tp=i(42328);let tf=new Map([[8217,"apostrophe"],[8260,"fraction slash"],[12539,"middle dot"]]);function tg(e){var t;let i;return t=function(e){let t=0;function i(){return e[t++]<<8|e[t++]}let r=i(),n=1,a=[0,1];for(let e=1;e>--c&1}let d=0x80000000-1,h=0;for(let e=0;e<31;e++)h=h<<1|u();let p=[],f=0,g=0x80000000;for(;;){let e=Math.floor(((h-f+1)*n-1)/g),t=0,i=r;for(;i-t>1;){let r=t+i>>>1;e>>1|u(),o=o<<1^0x40000000,s=(0x40000000^s)<<1|0x40000001;f=o,g=1+s-o}let w=r-4;return p.map(t=>{switch(t-w){case 3:return w+65792+(e[s++]<<16|e[s++]<<8|e[s++]);case 2:return w+256+(e[s++]<<8|e[s++]);case 1:return w+e[s++];default:return t-1}})}(function(e){let t=[];[..."ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"].forEach((e,i)=>t[e.charCodeAt(0)]=i);let i=e.length,r=new Uint8Array(6*i>>3);for(let n=0,a=0,o=0,s=0;n=8&&(r[a++]=s>>(o-=8));return r}(e)),i=0,()=>t[i++]}function tw(e,t=0){let i=[];for(;;){let r=e(),n=e();if(!n)break;t+=r;for(let e=0;e{let t=tw(e);if(t.length)return t})}function tb(e){let t=[];for(;;){let i=e();if(0==i)break;t.push(function(e,t){let i=1+t(),r=t(),n=tv(t);return ty(n.length,1+e,t).flatMap((e,t)=>{let[a,...o]=e;return Array(n[t]).fill().map((e,t)=>{let n=t*r;return[a+t*i,o.map(e=>e+n)]})})}(i,e))}for(;;){let i=e()-1;if(i<0)break;t.push(ty(1+e(),1+i,e).map(e=>[e[0],e.slice(1)]))}return t.flat()}function tv(e){let t=[];for(;;){let i=e(t.length);if(!i)break;t.push(i)}return t}function ty(e,t,i){let r=Array(e).fill().map(()=>[]);for(let n=0;n>1:r>>1}return i})(e,i).forEach((e,t)=>r[t].push(e));return r}function tx(e){return`{${e.toString(16).toUpperCase().padStart(2,"0")}}`}function tC(e){let t=e.length;if(t<4096)return String.fromCodePoint(...e);let i=[];for(let r=0;r>24&255}function t_(e){return 0xffffff&e}function tk(e){return e>=44032&&e<55204}function tI(e){n||function(){let e=tg("AEUDVgHLCGMATwDUADIAdAAhADQAFAAtABQAIQAPACcADQASAAoAGAAJABIACQARAAUACwAFAAwABQAQAAMABwAEAAoABQAJAAIACgABAAQAFAALAAIACwABAAIAAQAHAAMAAwAEAAsADAAMAAwACwANAA0AAwAKAAkABAAdAAYAZwDTAeYDMwCxCl8B8xhZAqfoC190UGcThgBurwf7PT09Pb09AjgJum8OjDllxHYUKXAPxzq6tABAxgK8ysUvWAgMPT09PT09PSs6LT2HcgWXWwFLoSMEEEl5RFVMKvO0XQ8ExDdJMnIgPi89uj00MsvBXxEPAGPCDwBnQKoEbwRwBHEEcgRzBHQEdQR2BHcEeAR6BHsEfAR+BIAEgfndBQoBYgULAWIFDAFiBNcE2ATZBRAFEQUvBdALFAsVDPcNBw13DYcOMA4xDjMB4BllHI0B2grbAMDpHLkQ7QHVAPRNQQFnGRUEg0yEB2uaJF8AJpIBpob5AERSMAKNoAXqaQLUBMCzEiC+AZ4EWRJJFbEu7QDQLARtEbgECxDwAb/RyAk1AV4nD2cEQQKTAzsAGpobWgAahAGPCrysdy0OAKwAfFIcBAQFUmoA/PtZADkBIadVj2UMUgx5Il4ANQC9vAITAdQZWxDzALN9AhsZVwIcGSkCBAgXOhG7AqMZ4M7+1M0UAPDNAWsC+mcJDe8AAQA99zkEXLICyQozAo6lAobcP5JvjQLFzwKD9gU/OD8FEQCtEQL6bW+nAKUEvzjDHsuRyUvOFHcacUz5AqIFRSE2kzsBEQCuaQL5DQTlcgO6twSpTiUgCwIFCAUXBHQEqQV6swAVxUlmTmsCwjqsP/wKJQmXb793UgZBEBsnpRD3DDMBtQE7De1L2ATxBjsEyR99GRkPzZWcCKUt3QztJuMuoYBaI/UqgwXtS/Q83QtNUWgPWQtlCeM6Y4FOAyEBDSKLCt0NOQhtEPMKyWsN5RFFBzkD1UmaAKUHAQsRHTUVtSYQYqwLCTl3Bvsa9guPJq8TKXr8BdMaIQZNASka/wDPLueFsFoxXBxPXwYDCyUjxxSoUCANJUC3eEgaGwcVJakCkUNwSodRNh6TIfY8PQ1mLhNRfAf1PAUZTwuBPJ5Gq0UOEdI+jT1IIklMLAQ1fywvJ4sJzw+FDLl8cgFZCSEJsQxxEzERFzfFCDkHGS2XJCcVCCFGlWCaBPefA/MT0QMLBT8JQQcTA7UcLRMuFSkFDYEk1wLzNtUuswKPVoABFwXLDyUf3xBQR+AO6QibAmUDgyXrAC0VIQAXIpsIQ2MAX4/YUwUuywjHamwjdANnFOdhEXMHkQ5XB6ccMxW/HOFwyF4Lhggoo68JWwF1CZkBXwTjCAk1W4ygIEFnU4tYGJsgYUE/XfwCMQxlFZ9EvYd4AosPaxIbATUBcwc5DQECdxHtEWsQlQjrhgQ1tTP4OiUETyGDIBEKJwNPbM4LJyb5DPhpAaMSYgMMND137merYLYkF/0HGTLFQWAh8QuST80MnBrBGEJULhnkB78D8xrzJ+pBVwX/A6MDEzpNM+4EvQtpCIsJPwBJDqMXB9cYagpxjNABMYsBt5kDV5GDAm+PBjcHCwBnC4cFeeUAHQKnCKMABQDPA1cAOQKtB50AGQCFQQE9AycvASHlAo8DkwgxywGVLwHzKQQbwwwVAPc3bkoCw7ECgGpmogXdWAKOAkk1AU0lBAVOR1EDr3HhANsASwYT30cBFatKyxrjQwHfbysAxwD7AAU1BwVBAc0B820AtwFfCzEJorO1AU3pKQCDABVrAdcCiQDdADUAf/EBUwBNBVn5BdMCT0kBETEYK1dhAbsDHwEzAQ0AeQbLjaXJBx8EbQfTAhAbFeEC7y4HtQEDIt8TzULFAr3eVaFgAmSBAmJCW02vWzcgAqH3AmiYAmYJAp+EOBsLAmY7AmYmBG4EfwN/EwN+kjkGOXcXOYI6IyMCbB0CMjY4CgJtxwJtru+KM2dFKwFnAN4A4QBKBQeYDI0A/gvCAA21AncvAnaiPwJ5S0MCeLodXNtFrkbXAnw/AnrIAn0JAnzwBVkFIEgASH1jJAKBbQKAAAKABQJ/rklYSlsVF0rMAtEBAtDMSycDiE8Dh+ZExZEyAvKhXQMDA65LzkwtJQPPTUxNrwKLPwKK2MEbBx1DZwW3Ao43Ao5cQJeBAo7ZAo5ceFG0UzUKUtRUhQKT+wKTDADpABxVHlWvVdAGLBsplYYy4XhmRTs5ApefAu+yWCGoAFklApaPApZ8nACpWaxaCYFNADsClrUClk5cRFzRApnLAplkXMpdBxkCnJs5wjqdApwWAp+bAp64igAdDzEqDwKd8QKekgC1PWE0Ye8CntMCoG4BqQKenx8Cnk6lY8hkJyUrAievAiZ+AqD7AqBMAqLdAqHEAqYvAqXOAqf/AH0Cp/JofGixAANJahxq0QKs4wKsrgKtZwKtAgJXHQJV3AKx4dcDH05slwKyvQ0CsugXbOBtY21IXwMlzQK2XDs/bpADKUUCuF4CuUcVArkqd3A2cOECvRkCu9pwlgMyEQK+iHICAzNxAr4acyJzTwLDywLDBHOCdEs1RXTgAzynAzyaAz2/AsV8AsZHAsYQiQLIaVECyEQCyU8CyS4CZJ0C3dJ4eWF4rnklS9ADGKNnAgJh9BnzlSR7C16SXrsRAs9rAs9sL0tT0vMTnwDGrQLPcwEp6gNOEn5LBQLcJwLbigLSTwNSXANTXwEBA1WMgIk/AMsW7WBFghyC04LOg40C2scC2d6EEIRJpzwDhqUALwNkDoZxWfkAVQLfZQLeuHN3AuIv7RQB8zAnAfSbAfLShwLr8wLpcHkC6vkC6uQA+UcBuQLuiQLrnJaqlwMC7j8DheCYeXDgcaEC8wMAaQOOFpmTAvcTA5FuA5KHAveYAvnZAvhmmhyaq7s3mx4DnYMC/voBGwA5nxyfswMFjQOmagOm2QDRxQMGaqGIogUJAwxJAtQAPwMA4UEXUwER8wNrB5dnBQCTLSu3r73bAYmZFH8RBDkB+ykFIQ6dCZ8Akv0TtRQrxQL3LScApQC3BbmOkRc/xqdtQS4UJo0uAUMBgPwBtSYAdQMOBG0ALAIWDKEAAAoCPQJqA90DfgSRASBFBSF8CgAFAEQAEwA2EgJ3AQAF1QNr7wrFAgD3Cp8nv7G35QGRIUFCAekUfxE0wIkABAAbAFoCRQKEiwAGOlM6lI1tALg6jzrQAI04wTrcAKUA6ADLATqBOjs5/Dn5O3aJOls7nok6bzkYAVYBMwFsBS81XTWeNa01ZjV1NbY1xTWCNZE10jXhNZ41rTXuNf01sjXBNgI2ETXGNdU2FjYnNd417TYuNj02LjUtITY6Nj02PDbJNwgEkDxXNjg23TcgNw82yiA3iTcwCgSwPGc2JDcZN2w6jTchQtRDB0LgQwscDw8JmyhtKFFVBgDpfwDpsAD+mxQ91wLpNSMArQC9BbeOkRdLxptzBL8MDAMMAQgDAAkKCwsLCQoGBAVVBI/DvwDz9b29kaUCb0QtsRTNLt4eGBcSHAMZFhYZEhYEARAEBUEcQRxBHEEcQRxBHEEaQRxBHEFCSTxBPElISUhBNkM2QTYbNklISVmBVIgELgEaJZkC7aMAoQCjBcGOmxdNxrsBvwGJAaQcEZ0ePCklMAAhMvAIMAL54gC7Bm8EescjzQMpARQpKgDUHqSvAj5Gqwr7YrMUACT9AN3rlr3JG9m8w9lIAXltp/v8kfWaIaaR9OwpAES/I3ZVamDXSgB/UsOgAG6D0tq+5CIqE15FiAhV3yA2VhCQ7tj+m6xXaF53FIfGi/IAZIskMGAi2MU7MDVJNCbMzERyHZi+osdPtnFVbvq653O8rwaCy4IAf9OOok65AqJUtUriUfYsGPPVbe6jm0s9lbKlPCUKjdkHsFsEhvX4kT39ZCtAAbwQdn/h4TpO5hTByWAmr5n+Wuwhdegv6bmvX4LyOes3z2+cuHv2JFYwVMNuq2gzn8YHTjlUQd39osyWei4NKl3LAdfxlO876hh5ENp/cOvpuI9bF55guEthLLPOXjD4dktTH04P5TvZrWTM0e4+BHJxj7MLApXIFOs0sWKhNkG8iwuM5wR83my6V3wW06abhDzTXYfOr/ZpFXgXzmv4d12FFyP00/dPGbIVGV5ao8UufGzUwp/IHx6v/wDWJr9iaoCulhWwlZ7A8q/NMoD12+mBdNRgJYnThRLtMx1Bgwttn8/4Qn2CDfOSup9GVXEvA21ILgp0owHYxNOkpwLWz0G7K+WREIDjIzUzSn8I99CuJSmSpPyH0Ke6/NERYiNx+3dncSebPnOUnnWD61AhJ1n/tSLZmU5wYO5GfgzyAYJm6VL91LxZ8hL1lfximQxIDMRhIecQZBmeE5R0XlrpvwplVrJwpa8BBCdp93GPP9lyBeZ2zkRr920CR3cYbKpKHfogvm0nV7XdDz6EbjzlxADCMjSLXuXpIpyuizy39yY+I+H9rmpoIF3YwEjlH9MgGgWcCNTjHEWMqAbprn2Ox7rOHupaVE3lNyg3nt5XaZID6Y+uml5Ja+aOPu+BI+DZbiJVfaspUadakWUX6TA4dETkIqdJJHYnU4Z4yKpt5y8rVIahoMUf8A8kWtAQNCTbjp71gx3/zVdqNz1Sutkw0gFIMVm2BF4Xdv/0olw+NaDIR9Bb3DPweZA2K/cw+/b+AwyWl9ZOP67A9nexmeTNjfdzPGf9J6E6BMPKa5lJh+qNsdUz3HBUevU71eQFCqOcxiIYhacAhh/8PX0J5DdSViZ6WazDDx7cukJNpMfEkYLJ5Ao4vLoVd3d25Pg4qaVa2p2D2L3WvYPJ5Yf/A/MSxptjlgXL/KJtP2U0cRv2I09ATAiWCJYuRwiapeKFsqmi18yMMulDp3HdcIldq+7jkwsJUOHLHCzzzBw5XFvL0CAmo1ub456z7zb7shk3KPGCLZzr47oT1k/j06XNnJvG3Udv6XrP+wsqTBlZ5MaNPt9FOs/4Bt/ja/vbVhTNpBFl9Gq7MqINvGlWKOAwQzwOZy+EzSdjAqKJVV2YcskTuM94aIK+kc/AZaXiZLPREUDpkXIV947IFfj+85TrqPqLfkGcxgboMQjosf+az+odLNXdyp1mDNGsqSdK/pJ2Ca04mt/4d6s1X+lncOEYaGBBeW4pApGcjf7/XJCFbj3N3mFb+BtlIcw8ZiDKoClFX9Rf0bxCqtLpicObKJzBVVHr/6u4siH2hK75RNv7w9GfTbhJOQBYiFUZAByY4rn37tZBHT//kqKsNi3ryL9AqXJRzqiMIJMhILjoi/i8LVEsbu+Ih9bsyW16sgQqjYLO0qda6KaCPKj3DQcu6CfV5lKtjS3ZCdqLAZkOey9MR+QutJBGiz/r15GVD6rCVwJR4UUKC4GNJkfDf00OMW8aQtLSAGLXV8MIi9mbbl/qQEpxCm2L5hutFX4ekeLH4QgBWUFKs/2VVMKy46WtFE6AbwgmYm/Z0yHk5veDIrcl2HpVqb/rSE0PC9EbDzJEWqeaPhh7vF369Umq2kSiB3s5rBI6c/7N9bkRu4h2n+/h5nSwy+7n+/I+6oXQVANo2Jb5zDwtiBPf1ySCzHdT6yJShMzqSRZfnykX49CaFaxhoVF4PBhEuECJ1PrFYSpmHuyYsl14DTAV9ZxRms1XiR/kBrjhZjidOt0UNe+GSml7XNgpVw8YsUTmZXLTK+6iYnyW/wYR1W4UXwOi14xpFROHb6HcZzksgF5DbL2AFXzKNwHU2adjdAY+KCyM/cwRTBkkq/a227NI0q6DR2MkMCRu620t79bGcYUmACtqN3mk/0uNwd3JSXHqE1kzf6Yyj0W2083JNDRnIXDlgBxJ6uf58NN1f6FQiRCWB4egF8QDx74AixV8oTyw7PluIjr3/rj/WzgwPSq4xPojaF7V0xqG2u5ti2L1h6yYHv73Isrukr0kURDIEjClBsBx7kdcXUxaYMS0syT3ymLzDzslNDWQOT1Tao1YNmJHARUenhCkmV9tqCPGI5GqZaRpkiPxyjoncWjyOHYGqvbvRX+Bn1pn7EhRNXa1lqJPmoeN5VqdqIDPhEVhFsyG0d4iQEIYX0wZUbY2XbZWYlpZ/l66IrDDY0q1C1YzBDpHC4h05YqHQLqS9anyl22JQ6lEvjvdBwMHfE7z0luCXD34/rFeDa2TmSeEAykSpYO5j1G/nsgpR3qn0qaQEmLjnnLfcz+veoYqPnRqmRGwCJ6FJ3Gm/Z1/aVX5PSb03MMnjAf41ww54sD5k8FrkfBP+K0b1MrYpapWjtpZfve2HVf4ickX3LKSOhu7qI1Vd4c1kNrn2ajy1t4y93JhV4fnWCKq7OmFpcr7FjdJCXPTql0Drr14Ho3Z87+GPQ4Z/DcTiGqtvZxlRYi8cNuhXABveZIwNl/BX1huhVLaFax5OqypUrQRyb9OE3SSkPlDdy5uo5XGg2EIGEjLY1MO5cr1ibfiFWV7zspcTgkBKkwo5jPyAin04LqizZXb2tDRgwKJjGx4cVk3ngAQixwcxjYAg2Q7vmUR/hpwInMdw7OhC2qyf41vTPkudQAORS0DdLtOGQxb4fH2VYGsvJCkeWPeUwtf1/tuIhzXEThoCZzzSJqqjUtbaPI3ntHm3T5uf849hGUA0zU8ni5W+EEn3/0Y6oUhQFw9z0aGjkljBbAlFXc0y82G2wkd7VdgWa5KTgJJNjNwZMfmdnUIUn1JU5LiWX5UZEZbVlKSN76mlmjUR2ku+fucTNlO4IAAahnLjBhlvQNR9pe9swGBgq0YR7P3VCyI/seYwQ4QBzy9X+HPePgoF8WfKaJ4MBOhLCGHae6Z8xkNXwni9QAKvTNtVA56x8YJflZ/VvONRSlsSLmiSyNMnTjTaE1ko81zkzGEnVwEhjCzlwIqpxmpDAqwsEmtpdr3xpc7i/ZX3f2TzT3M0FdxIEQvO1jgmmiN+D1YpMduAzEhBtj2OBkMN/rv6p7Th4pSH6f5aH3aTvwFTl7EOSgGASI7ttyMehzpm4AVyK+bFEaFg9gnZsSUPpsbAe/0RFhrH+EXZ12Z7thf4dzN1+Sn+G8QrDA1VKaN4IFxD1rQz9Xq9Coii9S9/hPbTGjyBwFH3H1UdQuz5KsgPDEHua4/kPg2Gp/IIItsaLWBqiT9XH45MiQxSosGJ56H/0F2cjcCFd72l1665RNHURdC3lspI77esfJsl+rXXabkAy7vxDXG/XGGcKpwiKDPFfvMEgjkAHil4Za1F36RnyxxvdIAzvgfH8knukYDck07tc++DP4TdWeI7HXuq5Yl6VVFrUQtf64/dkXewlKZSHQo6YvCSpREB0GDrz+Ys2GfO8nw2SwrYwaf88AifzlPvP17bf1mI3AuccJvAjZIpBmqvharKFAebEjVKfGAwpQjWoXlm9LROsq9bCk1UeQ3CJxJqprzssS/Q04JeS1ReCCubL3J7sx86spkP4eNpp95UF+8K748icIs8vdILFklk9skQqi1So6cx3X906pvy1vz+KipTJ8fiVJxsV5MmT0XwA");for(let[t,i]of(n=new Map(tm(e).flatMap((e,t)=>e.map(e=>[e,t+1<<24]))),a=new Set(tw(e)),o=new Map,s=new Map,tb(e))){if(!a.has(t)&&2==i.length){let[e,r]=i,n=s.get(e);n||(n=new Map,s.set(e,n)),n.set(r,t)}o.set(t,i.reverse())}}();let t=[],i=[],r=!1;function c(e){let i=n.get(e);i&&(r=!0,e|=i),t.push(e)}for(let r of e)for(;;){if(r<128)t.push(r);else if(tk(r)){let e=r-44032,t=e/588|0,i=e%588/28|0,n=e%28;c(4352+t),c(4449+i),n>0&&c(4519+n)}else{let e=o.get(r);e?i.push(...e):c(r)}if(!i.length)break;r=i.pop()}if(r&&t.length>1){let e=tE(t[0]);for(let i=1;i0&&n>=e)0==e?(t.push(r,...i),i.length=0,r=o):i.push(o),n=e;else{let a=function(e,t){if(e>=4352&&e<4371&&t>=4449&&t<4470)return 44032+(e-4352)*588+(t-4449)*28;if(tk(e)&&t>4519&&t<4547&&(e-44032)%28==0)return e+(t-4519);{let i=s.get(e);return i&&(i=i.get(t))?i:-1}}(r,o);a>=0?r=a:0==n&&0==e?(t.push(r),r=o):(i.push(o),n=e)}}return r>=0&&t.push(r,...i),t}(tI(e))}let tT=e=>Array.from(e);function tN(e,t){return e.P.has(t)||e.Q.has(t)}class tP extends Array{get is_emoji(){return!0}}function tR(){let e,t;if(c)return;let i=tg("AEkU4AngDVgB0QKRAQYBOwDqATEAnwDbAIUApABsAOAAbwCRAEYAiQBPAHYAPgA+ACsANwAlAGMAHwAvACsAJQAWAC8AGwAiACIALwAUACsAEQAiAAsAGwARABcAGAA6ACkALAAsADUAFgAsABEAHQAhAA8AGwAdABUAFgAZAA0ADQAXABAAGQAUABIEqgYJAR4UFjfDBdMAsQCuPwFnAKUBA10jAK5/Ly8vLwE/pwUJ6/0HPwbkMQVXBVgAPSs5APa2EQbIwQuUCkEDyJ4zAsUKLwKOoQKG2D+Ob4kCxcsCg/IBH98JAPKtAUECLY0KP48A4wDiChUAF9S5yAwLPZ0EG3cA/QI5GL0P6wkGKekFBIFnDRsHLQCrAGmR76WcfwBbBpMjBukAGwA7DJMAWxVbqfu75wzbIM8IuykDsRQ7APcta6MAoX0YABcEJdcWAR0AuRnNBPoJIEw3CZcJiB4bVllM44NCABMADAAVAA5rVAAhAA4AR+4V2D3zOVjKleYuChAdX01YPewAEwAMABUADmsgXECXAMPrABsAOQzFABsVW6n7Adq4HB0FWwXiAtCfAsSwCkwcpGUUcxptTPUAuw1nAuEACy00iRfJkQKBewETGwC9DWcC4QALLQFIUCWRTAoDLfsFMgnXaRetAddDAEkrEncCMRYhAusnuTdrADnhAfUlAMcOy7UBG2OBALEFAAUAitNJBRvDHwcXAKgn0QGhKy0DmwBnAQoZPu03dAQYFwCqAccCIQDTKxJzOvNQsAWQOncnNUgF+icFWQVYr7gFaTtdQhI6WEGXe5NmX6H4CxMDxQcl8XcjBKNLAlNTAnUbqycBj6OlNVsDRRcEg2EJANEGqz8vIwcpAjldAGsBYR9xAIMdGQCVAUm3ACdpFwGvxQM3LSFDUwFvWQZlAmUA8UkXAykBBQBJQQCrAF0AcwArtQYH8+8ZjX8ACSEAKQCzG0cB0QHbBwsxl3iB6AAKABEANAA9ADgzd3nTwBBfEFwBTQlMbDoVCwKsD6YL5REVDNEqy9PYADSpB+sDUwfrA1MDUwfrB+sDUwfrA1MDUwNTA1McCvAa08AQXw9IBG0FjgWLBNYIgyZJEYEHKAjSVA10HhxHA0UA/CMlSRw7kzMLJUJMDE0DB/w2QmynfTgDRzGrVPWQogPLMk85bAEecRKgACoPcxw1tU5+ekdxoApLT661f0liTmcCvjqoP/gKIQmTb7t3TgY9EBcnoRDzDC8BsQE3DelL1ATtBjcExR95GRUPyZWYCKEt2QzpJt8unYBWI/EqfwXpS/A82QtJUWQPVQthCd86X4FKAx0BCSKHCtkNNQhpEO8KxWcN4RFBBzUD0UmWAKEG/QsNHTEVsSYMYqgLBTlzBvca8guLJqsTJXr4Bc8aHQZJASUa+wDLLuOFrFotXBhPWwX/CyEjwxSkUBwNIUCzeEQaFwcRJaUCjUNsSoNRMh6PIfI8OQ1iLg9ReAfxPAEZSwt9PJpGp0UKEc4+iT1EIkVMKAQxeywrJ4cJyw+BDLV8bgFVCR0JrQxtEy0REzfBCDUHFSmXICcRCB1GkWCWBPObA+8TzQMHBTsJPQcPA7EcKRMqFSUFCYEg0wLvNtEurwKLVnwBEwXHDyEf2xBMR9wO5QiXAmEDfyXnACkVHQATIpcIP18AW4/UUwEuxwjDamgjcANjFONdEW8HjQ5TB6McLxW7HN1wxF4HhgQon6sJVwFxCZUBWwTfCAU1V4ycID1nT4tUGJcgXUE7XfgCLQxhFZtEuYd0AocPZxIXATEBbwc1DP0CcxHpEWcQkQjnhgA1sTP0OiEESyF/IA0KIwNLbMoLIyb1DPRlAZ8SXgMINDl36menYLIgF/kHFTLBQVwh7QuOT8kMmBq9GD5UKhngB7sD7xrvJ+ZBUwX7A58POkkz6gS5C2UIhwk7AEUOnxMH0xhmCm2MzAEthwGzlQNTjX8Ca4sGMwcHAGMHgwV14QAZAqMInwABAMsDUwA1AqkHmQAVAIE9ATkDIysBHeECiwOPCC3HAZErAe8lBBe/DBEA8zNuRgLDrQKAZmaeBdlUAooCRTEBSSEEAUpDTQOrbd0A1wBHBg/bQwERp0bHFt8/AdtrJwDDAPcAATEHAT0ByQHvaQCzAVsLLQmer7EBSeUlAH8AEWcB0wKFANkAMQB77QFPAEkFVfUFzwJLRQENLRQnU10BtwMbAS8BCQB1BseJocUDGwRpB88CEBcV3QLvKgexAyLbE8lCwQK92lEAMhIKNAq1CrQfX/NcLwItbj1MAAofpD7DP0oFTTtPO1Q7TztUO087VDtPO1Q7TztUA5O73rveCmhfQWHnDKIN0ETEOkUT12BNYC4TxC2zFL0VyiVSGTkauCcBJeBVBQ8ALc9mLAgoNHEXuAA7KWSDPWOCHiwKRxzjU41U9C0XAK1LnjOrDagbEUQ8BUN16WImFgoKHgJkfQJiPldJq1c3HAKh8wJolAJmBQKfgDgXBwJmNwJmIgRqBHsDfw8Dfo45AjlzEzl+Oh8fAmwZAjIyOAYCbcMCbarrhi9jQScBYwDaAN0ARgEHlAyJAPoHvgAJsQJ3KwJ2njsCeUc/Ani2GVjXRapG0wJ8OwJ6xAJ9BQJ87AVVBRxH/Eh5XyAAJxFJVEpXERNKyALQ/QLQyEsjA4hLA4fiRMGRLgLynVz/AwOqS8pMKSHLTUhNqwKLOwKK1L0XAxk/YwGzAo4zAo5YPJN9Ao7VAo5YdFGwUzEGUtBUgQKT9wKTCADlABhVGlWrVcwCLBcpkYIy3XhiRTc1ApebAu+uWB2kAFUhApaLApZ4mAClWahaBX1JADcClrEClkpcQFzNApnHAplgXMZdAxUCnJc5vjqZApwSAp+XAp60hgAZCy0mCwKd7QKejgCxOWEwYesCns8CoGoBpQKemxsCnkqhY8RkIyEnAierAiZ6AqD3AqBIAqLZAqHAAqYrAqXKAqf7AHkCp+5oeGit/0VqGGrNAqzfAqyqAq1jAqz+AlcZAlXYArHd0wMfSmyTArK5CQKy5BNs3G1fbURbAyXJArZYNztujAMpQQK4WgK5QxECuSZzcDJw3QK9FQK71nCSAzINAr6Ecf4DM20CvhZzHnNLAsPHAsMAc350RzFBdNwDPKMDPJYDPbsCxXgCxkMCxgyFAshlTQLIQALJSwLJKgJkmQLdznh1XXiqeSFLzAMYn2b+AmHwGe+VIHsHXo5etw0Cz2cCz2grR0/O7w+bAMKpAs9vASXmA04OfkcBAtwjAtuGAtJLA1JYA1NbAP0DVYiAhTvHEulcQYIYgs+CyoOJAtrDAtnahAyERac4A4ahACsDZAqGbVX1AFEC32EC3rRvcwLiK+0QAfMsIwH0lwHyzoMC6+8C6Wx1Aur1AurgAPVDAbUC7oUC65iWppb/Au47A4XcmHVw3HGdAvL/AGUDjhKZjwL3DwORagOSgwL3lAL51QL4YpoYmqe3M5saA51/Av72ARcANZ8Yn68DBYkDpmYDptUAzcEDBmahhKIBBQMMRQELARsHaQZdtWMBALcEZ7sNhx6vCQATcTUAHwMvEkkDhXsBXyMdAIzrAB0A5p8Dm40IswYbn8EApwURu+kdPT4WeAVoNz5AK0IhQrRfcRFfvACWxQUyAJBMGZu5OyZgMhG6zw4vGMYYicn2BVcFWAVXBVgFYwVYBVcFWAVXBVgFVwVYBVcFWEYVCNeFZwICAgpkXukrBMkDsQYvu7sAuwSnuwDnQCkWsgVGPmk+cEI/QrZfdTdf6ABYETOrAIz+zGvL/KbnRno9JiMEKxYnNjV+bd9qwfEZwixpAWvXbjAXBV8FasnBybgIz0lbAAAACnxefYu+ADM/gQADFtEG5a0jBQCMwwsDAQ0A5WUdPSQfSkKxQrxBOCNfJ2A2JzgjCcE9CkQ/Qz54PoE+cD5xAolCvElCO1/LTk9qTQosa1QvagtuH1/gMzobCWebCmIjKzwdJkKrQrwrzAHL/F/JDh8uCQgJIn6d32o6LUoXyavJrAllwcvMCmBBXw/lEKMRAJONHUVCJRupbTnOOAozP0M+cEI/HAcKHUxHbFssLVrhvBIKfe0dK0I/HF0ISgkOM1RDQjcEO0OcLAqBGy1CPxv1CFMiIxgwMQAFj2HwXgpxZMlgC2AtI25DYBk5AhseYLMGAmsQZU5gTREBZOdgFWCVYH1gs2BLYJFoFhcGtQ7cVam8WgtDFqsBuyvNwQIfFQAcAx4BeQJsLzCVUoABigq4RxoA5CN0jgrKDaZN6gGbAoecTwVAXwD39wkANBZXDAulDCQfuq9HAE8MNAAVE58rggh6AtILS2URGwDYTgZ1BAoeWgAxALa4AZonCxZvqyQ4nxkBWwGGCfwD2e0PBqoGSga5AB3LValaCbthE4kLLT8OuwG7ASICR1ooKCggHh8hLBImBiEMjQBUAm5XkEmVAW4fD3FHAdN1D85RIBmpsE3qBxEFTF8A9/cKAHoGJGwKKwulODAtx69WDQsAX7wLAGNAlQh6AOpN7yIbvwAxALa4AZonLTsOzgKQGHtQu1jIdHKO16WbDvWZFT0b7AEpEFwSBg8bAccJOhCTBRArDDYLABEAs84BAgCkAOEAmIIABWtXLwAUAFsbxi5sdioNwRACOyQz0+EcHgsbfQJ7Ls6hHATBCqrxbAA3OS0Opge7CQAQOi7OERkAfavaHA+7GkcczaF3HgE9Kl8cAuugCAHCAULz5B9lAb4Jtwz6CDwKPgAFwAs9AksNuwi8DTwKvC7OoSoJPA67BZgBG2sKD4sa4QHDARELuxY7AKALOxC7BBige9wAO2sMPAACpgm8BRvQ9QUBvgH6bsoGewAHuwG7D00RErwBAQDqAQAAdBVbBhbLFPxvF7sYOwAuuwLrDlaouwAeuwJVICp/AAG7AALjAAg7FTwVuwAbuwG9KOClWw6/xAD0AGj7L7ZtvgNIo7vIqDsDAbuVJ0sAAlsACrsEAOfdGbsIGnsIoQUK/3AA37unuxjbGruji3lyBvupm4MAErsGGwsBvAAAhgBtuwYAC7unOwEaO7oIoZzKAbsL7QfAqTsA4XsBvwAA5QAVuwAG+wAJuwBpiwAauwAOuwIYu45pFfsAAVsADmsALkseAAa7ABe7CCEADUoBwgC3ryYBwAAAtAAOmwG+J+QAsloAHBsBv/7hCqEABcYLFRXbAAebAEK7AQIAabsAC3sAHbsACLsJoQAFygBunxnVAJEIIQAFygABOwAH2wAdmwghAAaaAAl7ABsrAG0bAOa7gAAIWwAUuwkhAAbKAOOLAAk7C6EOxPtfAAc7AG6cQEgARwADOwAJrQM3AAcbABl7Abv/Aab7AAobAAo7AAn7p+sGuwAJGwADCwAQOwAAFDsAEWsAD4sADesADbsAGQsGFhsAFTsAbpsWswG7ALoAEzsDAGkrCgDhSwACOwAEUgAXewUbAAbQABi7AAv7AF+7AGv7AOSLAbsAF3YBvAABcguhAAVKHgF7KFIAOUUA/gcNDHIAKCpwAaQFCF4BvF4jDAkHb0tsXyqJHzwUYi02A6EKtAHYABYC0QNuAXZyR1IUIQNPAhU+ASwGA3NGvHtSekAAKQAxAfsAUwrbAHuQLAErAHblDREyRgFKAFcFAAFQAQeKzAB4OwQgpQBaANYVAJVoNx+LAM1rsQDP1BYIwnVzGxhWHQnRAYiQqyJTU01IEjzCifkAfxw3QCkr4BGXTwByASksMClCGQ8DMFUE98XuAEtl3ABqAnECPxF6Osd4LjXVBgUAEBsdCggMKgQfHSlOU04IuboAChLNACYAARoAhgCJAI41AO4AtADgAJ08ALsAqwCmAKEA8gCfANMAnADrAQwBBwDAAHkAWgDLAM0BBwDXAOsAiACiATUA4wDYANUDAQcqM9TU1NS2wNzN0M5DMhcBTQFXL0cBVQFkAWMBVgFHS0NFaA0BThUHCAMyNgwHACINJCYpLDg6Oj09PT4/DkAeUVFRUVNTUlMpVFVXVlYcXWFhYGJhI2ZocG9ycnJycnJ0dHR0dHR0dHR0dHZ2d3Z1WwBA7ABFAJYAdAAuAGLyAIoAUwBTADMCc+kAh//y8gBgAI/sAJsASwBeAGD5+aoAgQCBAGUAUgCtAB4AsgB/AjwCPwD4AOMA+gD6AOQA+wDlAOUA5ADiACkCdwFNATwBOgFQAToBOgE6ATUBNAE0ATQBGAFUDwArCAAATRcKFgMVFg4AigCSAKIASwBkGAItAHAAaQCRAxIDJCoDHkE+RykAiwJLAMMCUwKgALoCkgKSApICkgKSApIChwKSApICkgKSApICkgKRApEClAKcApMCkgKSApACkAKQApACjgKRAnEB0AKTApsCkgKSApEWeQsA+gUDpwJdAjYXAVAQNQLeEQorEwFKNxNNkQF3pDwBZVkA/wM9RwEAAJMpHhiPagApYABpAC4AiQOUzIvwroRaBborDsIRAZ3VdCoLBCMxbAEzWmwBsgDdfoB/foB+gYKCfoOGhH6FiIaAh4KIgol+in6LfoyKjX6Ofo+CkH6RfpJ+k36Ug5WIloKXftoC2WzhAtdsAIJsJGygAINsbARCBD8EQQREBEIESARFBEAERgRIBEcEQwRFBEgAlmZsAKMDh2wAtGYBBWwAyVFsbADPbAIMbAD2WmwA9gEZAPYA9AD0APUA9AN8XmzUhCNlvwD2APQA9AD1APQcbGwAiVpsAPYAiQEZAPYAiQLsAPYAiQN8XmzUhCNlvxxsAPdabAEZAPYA9gD0APQA9QD0APcA9AD0APUA9AN8XmzUhCNlvxxsbACJWmwBGQD2AIkA9gCJAuwA9gCJA3xebNSEI2W/HGwCQwE2bAJKATlsAkvBbGwCV2xsA54C7AOeA54DnwOfA58DnwN8XmzUhCNlvxxsbACJWmwBGQOeAIkDngCJAuwDngCJA3xebNSEI2W/HGwEN2wAiQQ4AIkGjTFtIC9s1m4DJmwA/QDGWgJsbABVWv4UMgJsbACJAmwAVAEAuV5sAmxebGwAiV5sAmxebD3YAEls1gJsbEZFNiJ9FGVAe8xvEZKvxVfKZszAVTBzYBH2d1iyUXEHH7twNw7eZF5JJRHI5EgaRr5D20/3dfONrFLSq5qSrrgd2CEUq722WBQ/LzpA+bx1oREI5xy4BDSZNun0ZWORUJqInZSyMaioyvfSI0l5uFDzbWaQ28/zdB0hwR4OQZ0/jn9ALSLNikjFYGfqR389qtFlhD3a6KdIh97rhZYpywuLc7o8ql5/X8KCbPU3L/QlmCowhRXhsGDvg6wUNprA9bM/49uxlAj7ZVy3ouEY/BgFXBNyK0TLrSjZWeJm/T4nz6QGLT3cJNtWRZVZTvIdtaxMMJRHgig9+S11LjBh7Inr06ykoch1U097Rw0hvgmOrydQyaWcEQDg0RavuMuT0zYabUZl1e33HNSK1oNUCS03eh+9C2EvF3fq9h+XBaAMFuoWeZf+mfZgL4HzyiKDIUtfNU4oFu0aE9qt3VA3U4D3fOSrAcYVnjG3cSkp1vhXZnp3JQm4JknKdBitO2NVnGCYQwU3YMWHWB87NEd+4AHuOKI8BSIH92reW0pfs+kWCTJxDCbRjFv8Cfc4/DSBYJScJYTeAEgg9wTEvcwd/QuHRHqGzAQ4fXf5FUI1lPrO+fvEcPl4JInM1z9AtBT2bL4QYEREe7KiSnnxTwtmAFjn8lqT3mND8qTktX2F16Ae9cakqJ6/pEQsHURqyqWlRMCzKXRKfCHT7sYHWx9/T/ugYTFY6iVN3Btm58ATJR5alYZybKMWojwOw3HbFn23NFyeLl7+Er82RchyYuBoGQ3j7SAWNxiYvp5U+Fq/DEzB9cG5DlJWsqkosRze92OVlCtQEYo1S1lF72Z8xWc4ld/+fFcfTEDTFb9d8tJGQ75dpJEvcWyGmGBiTbiWDdGOcw93Dmxq5ISUrmasygONfHLvhgo83HQZenbdBtSzBkvYrCEQ/xEDMhMZsN6gqplx5jGG9mSQLhM81UEdEeJ59sdNJDAFy/gPyJoKlwPZgB/MkC/kICLiCB8va+nCdO2ry4aDfkmPFpF/H/SGQ3LJ6aAv9dtJ8DniHtLOckZix0BVb0iR5V3LAp521LBSIi6AtV7r2ZB/hQEvAw54EFNOQcFnl1xGUIc67tqK1INNwD2n/RbwgzO9h45LM6VMuN8V1ZNIQ6t+Xy3lTqyVCD5kqLy/t3/b8MLbgDg8JIWDkSZ+LrGhhr+gYpH+pr1TnCUnZPjpUdw6bSL6MWVXoDDciQDWECwU2e6VEpfrcOBbrSOijqGkEIoJPbpmeJLkcwbvA0yWIixQVjo0HnYh7fji+Dfdq1mtV1lG2Zz9R7eFMHS+FK7nybutu2fwzDpFldO2pZBshsHJWaltn3PWOoGJpCT2jE8EHOuC6FkejNWcfsWCqNqMLP9xTwcWArj2EiiI7D+EaDi7/2cqHL1gPiF6C/J7aUo7RQqogPZ11WqbyP97nsoMxPOC78wZMF7B1Y0g7JNXJV/nN1m4xx8hbqWz07KSaqr5hE4icB326DMR/vUKX9LoNjle/ZWtbUhrTAcsdgrLlG5Ne8aiR0bS/2ZhpNOVVxavWIZsEM/rd68EB4vjbbD13NkMK1qvMk74vGbSkL7ULO0sZ9R6APSCo6KH+Xn98wEdw1bCPAnDTaBsD6sidAGN58uiH4a3ovG1KyZAu2XtyGgF/vgWKGxw9R1lfAVcfuYE71DHuxtTzfGZnHaDpDGWmfEq0N4GawE7yIkaoz8jcmVmzJe1ydM8q0p08YIxFcY1YcqQc1djWBEoNETDFcgk5waRftEJasPREkrV++N/TOKkERF1fCLrXS8DFGYGRBeECMQRNEs0ES3FzUtXCcNxpYEM3Uei6XodZruXUIRnn+UXf2b/r7n1vQutoi6WoIbW7svDNWBbUWcDUc7F9SJK3bvSy9KIqhgyJHoW2Kpvv0J4ob14HFXGWWVsYXJzjwxS+SADShTgCRjhoDgjAYRGxwJ1Vonw+cpnCKhz8NQPrb0SFxHIRbmG95Q2hlC4mDxvPBRbkFa60cvWakd7f0kVBxxktzZ9agPJEWyA63RSHYVqt8cPrs2uFJ3rS3k9ETGKn5+A6F9IOrdZHfT1biEyUJKEvwzuscwshGCBJvd16TrefW03xVnJf4xvs72PdxrMidjJO8EiWyN/VWyB3fv9kc34YIuZTFtXGo9DuG3H1Uka5FgBMwDPEvRcSabi3WakNQkXFecJlFk6buLVk5YHpuKWTw6oF632FPPSVIVl5hgUAeHhj0t/sw/PEEvThLQDDFE34eCg/rLOyXT3r+L98oRKrlTO0MdALYQ3rRQqC7d822dJPGxF1K4J2TtfPSMFaCAg0n0NGk9yiaKKOJD1v2aBX9HUOIawjjfvwCmjHZJTR62R9c9x33JnBjWrN4QYEOmehy0oZMP9XM9Zyi6TYoe07PaLceRXcCWZiY/imRUWW6+mci7+wMxSdwMdbXckXtvhJH8sc4iQcTwm7yp+3f7CaesTTQB2qkgeXh+wFiSMXfMlH7Yil0OoZ2QTtRLTip2O0cLZ4SstqWHZ6H+8A2kZXhpm0kPbL9dUanTOvziqIUh6Ambwa3WrCb2eWbuCN3L1hgWUmjRC3JoL3dBhR3imSQI8xuCMfsszlji7cSShNSYdqCXPxEVwbqO9i5B6hf93YI7aeyI8jxgcVXK0I/klbvhSXjkjOIwZgPdVwmsFW7HGPLUAvDRuKm+itybRg7c8+Yqqjg824Qf+/NxsBSUNAK9KCoJpauFqK0XQULrWYj4FnxeKDuvr54iokpi+D57e6Y1zxRJJdsHnDR3JyraCUufHBRTKODWBVzthjm4k3/Hv+Q990XDVR+KW+TcJX045LW86EKhz/97aqj89A8ZvTk1//tczosU90loIPVaHuWegJU3wP//7XHcO7c0yQM2jM/IhQKrf8hiObHWiWDZManF8Uf/HzbmDfC2wT//aiZ4hGTv/xzgKwdb1sD6cGEkceow0s3b89/zg+3plyRm0HlZi886j5wUwFhdHiDTaBidZRo5cx/tMeLyguOATbzq17ydhzbrpxunuHx6lbFGiO97gsd4dk//7iCIo+Ew+hG2so5kvv+ITG4c1fzHPtu1Xn5QfUnqY3/uByVmB7gmnE/E+5zdm+6nDmoews5fr+NzThdSHzK4bBQOL9c4O8OI0xLSqjJ4lbniLJg1aFpQRLwaSMZmpkC9e/j6FOVrTQ6a/a4alGgfrl2ZL1sbHUQ3DOI7ntq9diHFfm3t1mul3rdJEJCHnlW/hlQntipMrpeMs7fUr6wK370D7VbXH0DUHzdYfRg/6Z11Ult1sffJS+heHbco15Sxy3+rDnPesqH1lajk0yu02hPUvEUqvcUXWXL7Ad0wNGMx5gOle4XJxq/r/YY0xdco2wRSEGwcT7YADlBrHc9ZbvzOL0QwyWCWWChB9Obg800v7tyBWaNvdwz+fL7Ph9i2irEeJkRgOzeEDw+JiD/V93vH9FgMEoFIJMoIuogmicZohf94SBuPn6hXaV9jP4VVVA/bu+Wg8S88GLtmEPSNRLdtlXx2XL/nuM8nKkhnlnjaropiKKLIH94pLIASci0pDBfj9Hi5BfaTSXQg5+PMjQX91Ktk4MOqK1K99l4BRPv5+vNovGZ3IxQv8ICvjV4/diThpoaM8uvd3D9d/DE477w3yAbW3IDm2i73pZ9aEj38JqS6h/s8/xgmUIVcuq2JTgefAyuoafzQxAuRASeg3NtG3ach/JEkyuX+JDt2PnDZTShUhyHHG3ttBg/6lhAchGjLJBtopj4e01MlCp2yqQRTr4sBBXru+lKaoanwYX8y2aWCJiR3KnhCOkYVFSvsO0oDRujUFOEptiNDTYrJoUbvOyvl4AhC9h3wORiTXK1MrpMfnvdnndnR/HRVSusMBgIxwrLdn3vq1VcncPiD0SquTx/kNmxeFyCT4uXVUd9AL+rSGmuq7OOCzDKeVPjiNWVaoP5KOFqYq5Xcuf/xW9S+u9eIq9GAtZWtQlgkRecjRtvG1NR4WXXpn+pwsTBTIy079Ikg8rSef1aVapIFcXCd6C2wHVjLXR+N0tw4Taw6x6H90BFRgNrtlq2up6hHKuV3inM5RJaQWZHd84e6RsKkk9po3dk9by54tpPw7cBkFas/G+GbHwuG+AwP55BZyXILTHCIVrPpXHEaUPYfL6nphJP1Rc10xG4UaCeY4IHCwuur8xmSQDgY4aVwhzWhjbtSHG8JO6P2i2nC9/0Bfx0zk6dYQq3aw7k5vIObD7SEKrxhz0fQ0+YTOfHW23CBNeZci1qNsUDhoeqmfyP6PvjoEjHk8QbrFyQVZPHVWijnb8YCM65iYNoEbvnchStZ/9cKg5Vd45j8KnB6UjzXl/bkyZx7VoD47ocUUi117WwgySSb4rXgLJ52Mv5XJbp3I+uBP81BUvOjy4Cacgi+GWWlC/8dwgqwiojjUBDnEOxyRyowwLQfytFra1OZS4XvRYr4uoamAfG3I/p2bA7G90yqKThH8Ke00Tqd+3l3dmJpaCZelBMYjGqNLVa3SM4+LQeL56gY6Bymy2LQPVOxjWfj5tq4o74swcxhyGJPynkS5xAjOXZP1/FAYcBT3u6qLoIkEfErwo4gozmyI1YCvM0oyI3ghjGPQSsof2sKUhq91WsKy9cYWN+4A2v4pG/Mxpdc6w6kI/HX7Xb0TuihmsiOy2wQIsrZbUmr3OBSUo6oDJNgQp+YqYkgTgYcWZDgawJw3DFfdzT//PhVUidgB2qa8uw/j9ToHBAS33iT8YLhhAfyXG0bQUFp7QmH7oQ3i6Flf4OTZLvJdh8pfuflmWu2ohm5pTiSg1pl3vq9uluTJwqXfh1hqy8e2iHoD+Y35gCIViTo6VOtK5dD8HYClucJucXASzwe2kPj4S4eYQtmkYHagXhAzp/F541xE8YFYqSPszDuz3soWzHy0p3E2jwZNQaIcGU9FNQwQxeDw0ZlK9dxXrj9IUHGUPTOyib8CqXmbZ7Ex54bn1rLx3qqAavu/gh6XjV0GmN1p+yyMK9HN5uYEvxgbAk43tsheREhyI+Q5WLIneKTGPmYiM/lxOp8fvqHy8YgXK0TlMiX0tliLI2JtfmWZP8eVV732sdYm+pcWzDzEmKLJZyeelyaZKkjPnnUO9keDwtgiLnmd5+t+Sr5y8brRnlvxcWEWfCqIALQYHvaXx6jTg4dAlye469uGwwOZVZCILLfGjaMg4LUCNMTtMSp1aC2y/3wR2t1v3w/iNBRQ+bNbtDqL2NAr7K4rUcyqbSpNrXZgAWXvjxBBtfYLK1uRYt3q2pfXJOAL0HtWcEwJLddOSJKV1SwvcvEuzg/4MPnA8MIUJOLqm3qI6wFyN99Ck6zYaV/zGSAzF/PGsaNa4vPLe5QnyuqVUnVQ6xELA6gbe53aGgeke+R/ycb2LJVyc7BhuzI90zA+c6wUDTb7NH//gdDSl2u/aW7lRJm8m1fLtPxcNuEM5JbkOCZKPM88HUsLRoC1pmKKlvWyeAXuxILbu0snpSxf8N+RgtLUSe5n2gdjOjoSTaN7mMZ7bF+cWk/MS8mFD4pcyl5UN7CbpFZH2a+Pm1VAnUTVfbw8qrmz1G9m5aKmRzY1SMhhPrlCn2t4uNUXNA3IFe6NOjSC1DEaAFZAfDlEkQCsbNhsZPj6NQPDSB3tLiTo0ZYoEbIeEIaKtU3Wk60rEszawTFuyHVd365LA/c/uarABN5M5rGq/dqTG3Ilye/5EKiYisisuzqNaZjmWv0z9TORc0CKbaTea214oNM9u2sXUZub/eqM3Pi/PjRSyQiOSwPWif2asTgu6hS6fb5UGosCWxdedMqdViIUUSSdIJx+qQ4KShfTT39VAWZbi+mB+iKICNwpt6cflY57Rcbs6d1kA26Iru73cuxYVlSvuJdcR5VfDYZRk8X0AXePROyw3Le6LaUdmTLzYsoNhhgQpd67xVNiHgk3pakmndeIAtTC4DCXy9oS6eU4CWxDdVmY53pKNbdAKmQsP37lrJZC6iDXMELGKcHjNuuZgcDyY8W/yv6ha3DX7OWm/35fpvhw55oitf4V+GULlcPWYyGGuVBdro19c8u0RDddDun40W7G5cSIzHLh/qZxb59R+EPY+wZ2XerkUim92hhXpKyW6WtAh6zQS97DrPyjCvKi3pCw96LeKynOpyjtsMQc2RmI/20zFOZcSa2AK++PoRcT6zeJyxlBZ7kk5mhqXGkLlM2hFKc+/T544xXP0Ua38Q6xdPTLTeG1PHnLMaOvksUQMrEFTB/lizCirmFQL8zYVU+OTeYQEFaITsBSMMYexS9HkajO2gGIf2micvntCZJsZQEwIH3/4JGJQGflBuH5rNXmnRRYXDQs3ZoEQoMtYDr1kFKUS/siiQSUxcTH9XYeBZiKDDFQoExREO9dddKQLO3BwMHvymCSTFyY+vxn3D27NDx6OlU092D5EDUwilttqVHpjJQDUceJYCLsK2swfXeNUVrBJT/w/sk+7si8rPtiMFis+oxvGdGQxirMBID700T39mULuNHzOyN+xBfcFACZcyngF1aSpv0JPkNUrAZTqfplv509cGXFUiEEm5dZb+OsP/blizqdK45/dSsIrufYTrCPY2lgJD6k6QljTfXVlHfYKSq+MsagyUcaMintyr95bD8kdTAeYNLNsMmo/Wdd8a2nStBP49ARIjqqpUHWY4q4mvO5Cq/CgCP+4/B+5zutGwX5pssgVLr1+fIM7WWLfiUQDk4c6ZdHZOWv5hG3g2dgQ5NXnpIY+BWwJpaouf25bXnjDzbHnQNofH/c6m+dEAS9Gs2h7pFRPKOBDnqswZ8KZjhId1ytHUTs533KwBoSiImoxKQUgZ7z6pA9QB3sZ8Cq0vwutJTTkfbX8AzCpm2cFXx/P22niUMHauU8IGc+78R6TsutoonoqFuoNA3l80t387YHMoL5KGAT1JO4zmx+vJ0LbLHlicHraSVYvJjnO9p++qnWgKw9OwFVVUagvZuf9qfiuum+hIicxP1q4zDnzkHsCNriLxBpxY9N+UOmqzdY1MunLMDgkMyi3uvnN3UBXJeZ8YLs5xr8QrOhimYoKuGBebZHAiBIkViv3DG8k2oNpp5OIgX6ulqaRN8V62QUPjn5tl1kPXhT9bcd8qIm8gi4or/FGbvQ6pgGSHmnayrugmf5E0upGxPRf/3xOtitGMaHLKJVm5zhglmVfI91o0yxhJZVS/5wQ8zfxK8Ylw0WmHXoGfRkoBRx9Hsnl/6sgTjAVwpmNuSeZtBwlX4qB8Bh8lxjqBDIuFGJ4I1wxN0XRlAAslzqMKwQfyA7OkuivCXfv+i+3XmhcBFM2n4jdT+NyUmBnQJPV3F2sZfKvJhUlXzSosFR4VevVVcOkFnnjdiRWc0TeSYxj41sJGYMbZTeLI3GvyZ8/gAAudQ1+4oFX+enX5V49MczGCYVBuoC4kHjp7ZVxj+clBwPr9k+v05SsezQK3enxLs1Nt/N7c7AImVUysjGou4iOohHo83Zs9/MI/OWB+OyXzOBD93NbApGHXrv8CVRHp2bwH+xB55cfNrdqFD35HSMx4iVmtzYAmSCIV8kXsHoq3DIb93riTWbubnjxbBW5zConVtbxLRStXHkIyAByaozME952Gc9aAdAbBpZSVCH88Uwb/4bPTVOVl+WoMYD7JIvK8VcMrJ8zHV4bbG0Dg7Kx17A4ej/ZcZ2Z5pVuVLUH1E/AccUTKm81SE+LQ6STTUDscUk0x2OWIbEORhg69tdoTGNkA1RfkGIRZHr5mCXOpLC55WWzCZoGPFUVtZRHwh0nq039CDdjEPo+JyaxSQAvDgR6Iqvxy0frrtEG1A385N81l05SSzN+IDm9bypF9m92EUqblnauZ5sjc37wRykOdl7w4o8WMgQsjii3EE/aJYDfHs1cH6DNBEujjcCc8qAefYFyIAURDcDnzun5UmkbBQsU4eu/W8I9nBE0qJKTdg2hwjq0+XV7a3TJ7R+alvJZCRia9lJ+grNB9dbrOmWEvUotMjvDhq4wV/kq4fvIBkzUGpDeYH74rne8uU3dgoNZdR9pUL6q9YDNRfOiF6Dyk+SYXQIghTjm9qR4tBHh0gnmF/9q3Qv22EzaLhSvDlDOxMrrCNRmLCl1jApzLrBCPn2mjn5zqK7OYK7VxOfQ5GfBfoPdyQwqFEgCVHkJ9oTnagRM3R0+rsuN5jQv9icCav/p1WqiEXSzCdLd/WEA6z6dDP7tPqPbeDYKAkVcz1lLGbFOC9b7cBd3MV0Ve8dZ89oR7OnxGS7uVpSry8banVZwpJg+nkH1jRBYa2BvBMY2xITH9ERXCjHzdZxs+ipdXP2DY7X+eWiBhtT2L0RRGTLPeazn5tpl4tu8iE2rWig731iuJDRbCHHy+g/Mb9+miAyVqfIpXT/iZeOxOxODO0hEpLM78I1+G2Z45yi3lS1K3m4WMQ559Lp4UML5vZUjYGJuxl+OPpUH5klpyBujkjprhei0TmUik10gjvNUp8mDkWlNKikmYspaVTqewbnOzJrmz8FLIpsT67EJLHIIfeDcWEfiP+DJrZ1jfxpoAb2abeMqLx+9RuZGzQoYtYVGgAWwEM9Kek2vPIeBNAKD6ao7nw6sgvfeLZPoXkbYO/tStHJdKzk+WFSFEU2NcALJAEP6S8pcnqqBBt57dwTrzQNCIdk2SocK4dLRbD/pu/VryKnm65ZYXiJCfHJk3mx9MRSl+nSK6OqEBSoGjz0/LADddwF/HqcfK3K3O+6YUGQcmj8pZL4PhZ6KrGkb8B38FmDvvLd3XQXbvS/FQmrXFTvJNkaN/FGo83KuS43BK1UfVnIqigGkCoP5fBda2MwAGTGNKX9K9t4Bx83pMFc5KSORmWKv+8VoVggWxoaBz3/9IBh6RwLd1tebwy89xvE5z6EEpXpDfrXWfRsMs6+ekUHH6idVosno55+xQ8Zqzelh0bxtJTgCcH3Z3/Cxlx9eNIS4JIFKOAVrDqbrXRszmY55a5+niJGHtkO3b6mnIDxLa1WXc7BAe33mt2KyM4Fbc3R6/WVTQN8QhlqAtave2WsQTqzWeSlKuGUVIJRqtObpv294rS0kDN1RKzdstZTXJebR2HlzsQ4P3NbMHUqFZMZw+/IKXnh4t+lY8qocp/B1oMszR03EFs3bPeND8QkItMvllObeCz3SZAjqZrobmLcrpFyQV7mwBjg3C3C8/bc5goQhv8j/IXMLGnt4mF7tybRDG5G0polxoUScQkPvmnga2/K+aapKeqSL0BTmo1Cm5g+booNOtdyKva2KoefRURaBk7113QKo3y+WTuFKtgETIK8HRluYS9DvlcciCDvnG8UaJRfZE2siZsiTHvRmN80xkUIInHeRZl5Re/+ATL6VhKFi8CZ/n/jbFV6T5pZ+Uoppvsi3qjacVFOJgWWfdlwVHKPW/TJO3na9hRM9bS2yo2rEsC6IBzRReVO6IesJU7PItzOamr+ROFfwGZmZ7ue8HNxAgLJKb7P3p8dMqk6Be5PJaT/5Rdc1deYVihWH9cjVKc9uz5EnfHqxLUkOO8iJUENBNVf5LyNy8zjLu/78k5WNTywiPfYeX3CPk7yc6CI3lum/CEZwfUaNpcI3KsPqfn2lmz3kd/acQjKA1ebkJaiuLD+epQ/Fc1llHXXMzofWzz/Kd29SNmOhcjMWw1jq1g3YfrXZ9rzXDYW4ZttfgfMi6oCUtBs0PkMVuxmq5lxEoCaSXPSqCJJ7MlKdRDidVt0AFlxk5cTdX++sBF2+E35mjwfm8ERVxH0FvuAQtsfA4V2G0TKTUxeyRGVjd/u6F1SvuAiU2/WaQjcNCU4Ep7VunXCYSbZj3U3wzu/LWM5MPlYuyQ3FOOCD/zt7K295hY2JhwF+ODDIZ676vGQFKveEQYkWj7lkK7rVmD7MhU0Y/tF8EcTTpo4/yqOufbd/zWIpMajnbDuWK2vn6OPPtz2rc9MIBNlPd8tt+yf+7SC4wqEPbozKMCwY5Bygx4JmoIEDsixWRDcdHd6S3/dZMHXOJAAv7+NIstl00crgSqHZKAEe4g3G4dzIV51EeZB01r7p8GNlfUnG/GjZgNGsqXZdYMBVtAtFNv3hJWPve4GvqZ2XxuiNkHTz5kxWgr0PjQdJlVywJ9Zf2ZvqeeTbolKtvK54re2Lq5BoyzfsRtvDfyao3kmyFzDQ88nM+qx83w74RDlkngtYiArI05Epre3GgBeSlMig0pE6RGQaFznKkGeb0SozLCyiOtxh7hgwZlbKbClzUUfC8ntMiHUOZE375RhTy9c4DA+oMLkUDkztSybZbdmP1xpaIbjUpPAHBq3cIq+CBFzbMlMMCCkUQ6d9LGV6GYCsYiEWZIy3nBnuxOYXeU4YTGDSin9e4/pCjPtQSHlg5LMEvIlF0ElthqrF129iK2RPBEWd3XWOl3SWV5uz5VUyZYp5kEFmz7QfP/B1W1BBzQ2iTGbSVT79lUHzcGXz3PJceSgz4uknETUwo0xffpr2KUvZF0i/r2sL3IFIClYx8CbIZE6Qt7MDJbOPB3xMScwaOcWG66IJfCnDkb0D2Mb+PHzX+oiCbxeTIogtyN+s2NJirNACk/OACSOTtV6vscwbzW4M168xqaI+RzR47S1nlV/rOoZnid87n/Ima2XYa3un3BuGAisNjb8eLMT9OnMtazQROFCuO1HiZXaOc0oUDbNC4eKLToOx8DzVhMgGA8XIAQ2x3b6I0uEyLssQjJX3QphcUMx4KsMgJ+72km4N2aqkBF2coKmUEt1eqIMGn+5txMT4kYVGd3ALO+y9Z4PP3d3l48JQK8s9ZZ/Qx/+NBKgBEJFlQ32psoJiihGO7FSYM5L81q72kaAYcilEFMG+ZK1BcMqELkflyCV7v8JEXLO4Rf/oZYNZHZVjJhfL6fnpP9Tio3Euue5uS7FMkfGOeRCTrBZ06Caev7tgufeTrX34Ur/Vvc+b8ksiIShNJtuF9WmYxOZ4xg8y6zTdy3KAB2y5kYkcRnXsptWwAFyKZ2I/QGySNeoQLkINUMloC+5L3WuMMx297Q1xUYLKqZ9XHavaobo6QQv4auMm+i84IhxRpPt9nUmcav9NcjCcP+TcMmxsQZ/F3mgeoA0fQgwvTsyXuuTaM3Sqtv2jaaajmaFQpK9W6uIbeqwvSDo34ZrY6elDUHwSCjHRRmlwmyy+eOra64Ssq0XSXYljMHtKY+FShcMkHsEUY/4Bw63dJ6KpwDaxmthlDdbdE+TvYF3v33cGSKqO+1H1pKYhJMvZD5ckQcHyNF8zrtiR5b0ko6NPGoRexUZTYP6VbUdn3zzxGBOi8Z0OqHjGqYxRXwN3mYi0GYEEZYq+Q3QvdKcEHILLLj8S+VFepSfErtmfZCdvxbfIifFSpEzKi+7VJsLMT+zEFeyp1OdwRC1VZrfTLIyR7xTPUcZFYPD9qI7D70uTb4hdpqPXsJIRNYbZtNwch1OI3trh3u2ScoQyM9POnInsUa+OovcwkUP1UfIzPb95n4BaF2ev57NHAej0+BVMF9/Cj9663HN2/JN3SQgslL914bKfiTTDFAz9PlQEL/dSv1H8xl3mtWxh1McFO9EJXlRDaKQDsyKO4vOJW90NFE6yw2tjbc2GeF95sbs0I9enAa6QwQVf/kJQhAD2BzUDKggOyjy1TEhED6sfk+418lQy3c/uj8aw8UEzZ6hIMCd8RohAkumMtIj9m73l2yPWoGHVTPaywkC7Yj9tBM1NxMgcrDwRtk4RO2WHT7Ql5kQCKdJj6kNuOTeyEBYBjLMhGz+O5/YGa84HEiTYEpZ6fFzy26GG2hWtTyteuYrhSyG56BjsT/wQeLRytpTY3D7sIMqZnJ9z1FDrfyjFlGl2TNw9BQysbaxOuwYYZs/7I6BANgkqCknWZC7/BBXvaeKwAmC959I+G39BUE9bExkNlbRoFRyEtNzv+NJ91FuisG3JCS6uYBeRnfv8AkAfKTeg9EYamqnsGfAV7d0f9DghHEQ5IsPGDIUhgoSj7obM4Bu5uhQ3/CYEDTHc92AsFvDK4XGrwUeGBWBHPlS+f4x+CxmmHz2sAGmSFNt65kwZC64mnaoWlu2310laYn8r62AqsR5dfjyK18MEdurdagldzfJtjFXlZs7St4QhdPiye6TPh2/ZAQLU/Fip5s7TDEM16KtRWrK9hmxnQ7bmfa/+7pa10Z8WDPK3NuJ+NN/RAbQ5vHx2uX0Lm7/w7cAEH/hvZA+mt7J7zGw7YtQYwnNN6dpgwkGjjrS3yQoeoYt1EnczmtmJfQZWzUlP3Hlg9Wzlr9IH23q3thGth+QNEANFettxKfskkGOlLk8AqoKJwDqOxAa6UzAx07plSSyNBJSGco9zjnC5gGbDoKvsMDuBR6bGRlGzJ+hFsGa/Izt78aI+WZ6dJlZKp4pGISuv9rV0sAS0MWEwCmfauO7oQZMiakHU35LBxiyJoOMddhUWgcZuC8r4Ksvn75TTcQXLJ7kWtYhGuGqPd9dZuFjBWQHNwosXY5snbHFQq72CvHXhIg+shQxycuLOuWYErwCLZeF24b7F78pO7xw4X6lIAR02hUOf5087Rl0nOaeb6CK4i/KA/EZv76ftOWZtjwxslNr0E/u8rWUmnf3amfg6UZmBAluuoj3Dd7UV+9IAJ6iYcDfSJlgmIImohjfIUMJ27z+opj50Ak9af2LCNrWrBJvMovA1OeNO+MF/MwZvnaCxTgG7Cw4QfSPF6AYCGFt21M8PySZFeV3t2Rqqs5JMzMYzGRgq4o+UaKRgBf9GHi/9X9HXA3wxkCsd/UhnHSh2zUVDiraio/6nP4y3XJqs8ABfALAtCYU7DHPMPRjgcM6Ad/HiSXDAbOdSMkvGZPAkHs8wuQTy6X2Ov/JFvcPuKfV3/r9Q28"),r=()=>tw(i),n=()=>new Set(r()),a=(e,t)=>t.forEach(t=>e.add(t));c=new Map(tb(i)),l=n(),u=r(),d=new Set(r().map(e=>u[e])),u=new Set(u),h=n(),n();let o=tm(i),s=i(),p=()=>{let e=new Set;return r().forEach(t=>a(e,o[t])),a(e,r()),e};f=tv(e=>{let t=tv(i).map(e=>e+96);if(t.length){let r=e>=s;return t[0]-=32,t=tC(t),r&&(t=`Restricted[${t}]`),{N:t,P:p(),Q:p(),M:!i(),R:r}}}),g=n(),w=new Map;let y=r().concat(tT(g)).sort((e,t)=>e-t);for(let{V:e,M:t}of(y.forEach((e,t)=>{let r=i(),n=y[t]=r?y[t-r]:{V:[],M:new Map};n.V.push(e),g.has(e)||w.set(e,n)}),new Set(w.values()))){let i=[];for(let t of e){let e=f.filter(e=>tN(e,t)),r=i.find(({G:t})=>e.some(e=>t.has(e)));r||(r={G:new Set,V:[]},i.push(r)),r.V.push(t),a(r.G,e)}let r=i.flatMap(e=>tT(e.G));for(let{G:e,V:n}of i){let i=new Set(r.filter(t=>!e.has(t)));for(let e of n)t.set(e,i)}}m=new Set;let x=new Set,C=e=>m.has(e)?x.add(e):m.add(e);for(let e of f){for(let t of e.P)C(t);for(let t of e.Q)C(t)}for(let e of m)w.has(e)||x.has(e)||w.set(e,1);for(let r of(a(m,tI(m).map(t_)),b=(e=[],t=tw(i),function t({S:i,B:r},n,a){if(!(4&i)||a!==n[n.length-1])for(let o of(2&i&&(a=n[n.length-1]),1&i&&e.push(n),r))for(let e of o.Q)t(o,[...n,e],a)}(function e(r){return{S:i(),B:tv(()=>{let r=tw(i).map(e=>t[e]);if(r.length)return e(r)}),Q:r}}([]),[]),e).map(e=>tP.from(e)).sort(tA),v=new Map,b)){let e=[v];for(let t of r){let i=e.map(e=>{let i=e.get(t);return i||(i=new Map,e.set(t,i)),i});65039===t?e.push(...i):e=i}for(let t of e)t.V=r}}function tO(e){return(tU(e)?"":`${tM(tD([e]))} `)+tx(e)}function tM(e){return`"${e}"\u200E`}function tD(e,t=1/0,i=tx){var r;let n=[];r=e[0],tR(),u.has(r)&&n.push("◌"),e.length>t&&(t>>=1,e=[...e.slice(0,t),8230,...e.slice(-t)]);let a=0,o=e.length;for(let t=0;te.P.has(t));return r&&(i=`${r.N} ${i}`),Error(`illegal mixture: ${e.N} + ${i}`)}function tj(e){return Error(`illegal placement: ${e}`)}function tB(e){return e.filter(e=>65039!=e)}i(93709);class tW extends Error{constructor(e,t={}){let i=(()=>{if(t.cause instanceof tW){if(t.cause.details)return t.cause.details;if(t.cause.shortMessage)return t.cause.shortMessage}return t.cause?.message?t.cause.message:t.details})(),r=t.cause instanceof tW&&t.cause.docsPath||t.docsPath,n=`https://oxlib.sh${r??""}`;super([e||"An error occurred.",...t.metaMessages?["",...t.metaMessages]:[],...i||r?["",i?`Details: ${i}`:void 0,r?`See: ${n}`:void 0]:[]].filter(e=>"string"==typeof e).join("\n"),t.cause?{cause:t.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:"ox@0.1.1"}),this.cause=t.cause,this.details=i,this.docs=n,this.docsPath=r,this.shortMessage=e}walk(e){return function e(t,i){return i?.(t)?t:t&&"object"==typeof t&&"cause"in t&&t.cause?e(t.cause,i):i?null:t}(this,e)}}function tq(e,t,i){return JSON.stringify(e,(e,i)=>"function"==typeof t?t(e,i):"bigint"==typeof i?i.toString()+"#__bigint":i,i)}tq.parseError=e=>e;let tH={zero:48,nine:57,A:65,F:70,a:97,f:102};function tz(e){return e>=tH.zero&&e<=tH.nine?e-tH.zero:e>=tH.A&&e<=tH.F?e-(tH.A-10):e>=tH.a&&e<=tH.f?e-(tH.a-10):void 0}function tF(e,t){if(tJ(e)>t)throw new t0({givenSize:tJ(e),maxSize:t})}function tZ(e,t={}){let{dir:i,size:r=32}=t;if(0===r)return e;let n=e.replace("0x","");if(n.length>2*r)throw new t1({size:Math.ceil(n.length/2),targetSize:r,type:"Hex"});return`0x${n["right"===i?"padEnd":"padStart"](2*r,"0")}`}let tV=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function tK(e,t={}){let{strict:i=!1}=t;if(!e||"string"!=typeof e)throw new tY(e);if(i&&!/^0x[0-9a-fA-F]*$/.test(e)||!e.startsWith("0x"))throw new tQ(e)}tK.parseError=e=>e;function tG(e,t){return tZ(e,{dir:"right",size:t})}function tJ(e){return Math.ceil((e.length-2)/2)}e=>e,tG.parseError=e=>e;tJ.parseError=e=>e,e=>e;class tY extends tW{constructor(e){super(`Value \`${"object"==typeof e?tq(e):e}\` of type \`${typeof e}\` is an invalid hex type.`,{metaMessages:['Hex types must be represented as `"0x${string}"`.']}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.InvalidHexTypeError"})}}class tQ extends tW{constructor(e){super(`Value \`${e}\` is an invalid hex value.`,{metaMessages:['Hex values must start with `"0x"` and contain only hexadecimal characters (0-9, a-f, A-F).']}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.InvalidHexValueError"})}}class tX extends tW{constructor(e){super(`Hex value \`"${e}"\` is an odd length (${e.length-2} nibbles).`,{metaMessages:["It must be an even length."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.InvalidLengthError"})}}class t0 extends tW{constructor({givenSize:e,maxSize:t}){super(`Size cannot exceed \`${t}\` bytes. Given size: \`${e}\` bytes.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SizeOverflowError"})}}class t1 extends tW{constructor({size:e,targetSize:t,type:i}){super(`${i.charAt(0).toUpperCase()}${i.slice(1).toLowerCase()} size (\`${e}\`) exceeds padding size (\`${t}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SizeExceedsPaddingSizeError"})}}function t2(e){return e instanceof Uint8Array?e:new Uint8Array(e)}function t3(e,t={}){let{size:i}=t;if(e.length%2)throw new tX(e);let r=e;i&&(tF(e,i),r=tG(e,i));let n=r.slice(2),a=n.length/2,o=new Uint8Array(a);for(let e=0,t=0;ee,t3.parseError=e=>e;class t5 extends tW{constructor({size:e,targetSize:t,type:i}){super(`${i.charAt(0).toUpperCase()}${i.slice(1).toLowerCase()} size (\`${e}\`) exceeds padding size (\`${t}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.SizeExceedsPaddingSizeError"})}}var t4=i(44727),t6=i(94554);let t8=new Uint8Array([7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8]),t9=new Uint8Array(Array(16).fill(0).map((e,t)=>t)),t7=t9.map(e=>(9*e+5)%16),ie=[t9],it=[t7];for(let e=0;e<4;e++)for(let t of[ie,it])t.push(t[e].map(e=>t8[e]));let ii=[[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8],[12,13,11,15,6,9,9,7,12,15,11,13,7,8,7,7],[13,15,14,11,7,7,6,8,13,14,13,12,5,5,6,9],[14,11,12,14,8,6,5,5,15,12,15,14,9,9,8,6],[15,12,13,13,9,5,8,6,14,11,12,11,8,6,5,5]].map(e=>new Uint8Array(e)),ir=ie.map((e,t)=>e.map(e=>ii[t][e])),ia=it.map((e,t)=>e.map(e=>ii[t][e])),io=new Uint32Array([0,0x5a827999,0x6ed9eba1,0x8f1bbcdc,0xa953fd4e]),is=new Uint32Array([0x50a28be6,0x5c4dd124,0x6d703ef3,0x7a6d76e9,0]);function ic(e,t,i,r){return 0===e?t^i^r:1===e?t&i|~t&r:2===e?(t|~i)^r:3===e?t&r|i&~r:t^(i|~r)}let il=new Uint32Array(16);class iu extends t4.ol{constructor(){super(64,20,8,!0),this.h0=0x67452301,this.h1=-0x10325477,this.h2=-0x67452302,this.h3=0x10325476,this.h4=-0x3c2d1e10}get(){let{h0:e,h1:t,h2:i,h3:r,h4:n}=this;return[e,t,i,r,n]}set(e,t,i,r,n){this.h0=0|e,this.h1=0|t,this.h2=0|i,this.h3=0|r,this.h4=0|n}process(e,t){for(let i=0;i<16;i++,t+=4)il[i]=e.getUint32(t,!0);let i=0|this.h0,r=i,n=0|this.h1,a=n,o=0|this.h2,s=o,c=0|this.h3,l=c,u=0|this.h4,d=u;for(let e=0;e<5;e++){let t=4-e,h=io[e],p=is[e],f=ie[e],g=it[e],w=ir[e],m=ia[e];for(let t=0;t<16;t++){let r=(0,t6.aZ)(i+ic(e,n,o,c)+il[f[t]]+h,w[t])+u|0;i=u,u=c,c=0|(0,t6.aZ)(o,10),o=n,n=r}for(let e=0;e<16;e++){let i=(0,t6.aZ)(r+ic(t,a,s,l)+il[g[e]]+p,m[e])+d|0;r=d,d=l,l=0|(0,t6.aZ)(s,10),s=a,a=i}}this.set(this.h1+o+l|0,this.h2+c+d|0,this.h3+u+r|0,this.h4+i+a|0,this.h0+n+s|0)}roundClean(){il.fill(0)}destroy(){this.destroyed=!0,this.buffer.fill(0),this.set(0,0,0,0,0)}}function id(e){var t;return(t=function(e,t,i){if(!e)return[];tR();let r=0;return e.split(".").map(e=>{let n=function(e){let t=[];for(let i=0,r=e.length;i0;)if(95!==e[--t])throw Error("underscore allowed only at start")}(s),!(a.emoji=o>1||r[0].is_emoji)&&s.every(e=>e<128))!function(e){if(e.length>=4&&45==e[2]&&45==e[3])throw Error(`invalid label extension: "${tC(e.slice(0,4))}"`)}(s),e="ASCII";else{let t=r.flatMap(e=>e.is_emoji?[]:e);if(t.length){if(u.has(s[0]))throw tj("leading combining mark");for(let e=1;etN(e,i));if(!e.length){if(f.some(e=>tN(e,i)))throw tL(t[0],i);throw t$(i)}if(t=e,1==e.length)break}return t}(i);(function(e,t){for(let i of t)if(!tN(e,i))throw tL(e,i);if(e.M){let e=tI(t).map(t_);for(let t=1,i=e.length;t4)throw Error(`excessive non-spacing marks: ${tM(tD(e.slice(t-1,r)))} (${r-t}/4)`);t=r}}})(n,t),function(e,t){let i;let r=[];for(let e of t){let t=w.get(e);if(1===t)return;if(t){let r=t.M.get(e);if(!(i=i?i.filter(e=>r.has(e)):tT(r)).length)return}else r.push(e)}if(i){for(let t of i)if(r.every(e=>tN(t,e)))throw Error(`whole-script confusable: ${e.N}/${t.N}`)}}(n,i),e=n.N}else e="Emoji"}a.type=e}catch(e){a.error=e}return a})}(e,tS,tB)).map(({input:e,error:i,output:r})=>{if(i){let r=i.message;throw Error(1==t.length?r:`Invalid label ${tM(tD(e,63))}: ${r}`)}return tC(r)}).join(".")}i(6942),i(31890),id.parseError=e=>e;class ih extends y.X{constructor(e){super({projectId:e.projectId,networks:ta.R5.extendCaipNetworks(e.networks,{projectId:e.projectId,customNetworkImageUrls:{}})}),this.adapterType="wagmi",this.namespace=tt.oU.CHAIN.EVM,this.createConfig({...e,networks:ta.R5.extendCaipNetworks(e.networks,{projectId:e.projectId,customNetworkImageUrls:{}}),projectId:e.projectId}),this.setupWatchers()}createConfig(e){this.caipNetworks=ta.R5.extendCaipNetworks(e.networks,{projectId:e.projectId,customNetworkImageUrls:{}}),this.wagmiChains=this.caipNetworks.filter(e=>e.chainNamespace===tt.oU.CHAIN.EVM);let t=this.wagmiChains.map(e=>[e.id,ta.R5.getViemTransport(e)]);Object.entries(e.transports??{}).forEach(([e,i])=>{let r=t.findIndex(([t])=>t===Number(e));-1===r?t.push([Number(e),i]):t[r]=[Number(e),i]});let i=Object.fromEntries(t),n=[...e.connectors??[]];this.wagmiConfig=function(e){let t;let{multiInjectedProviderDiscovery:i=!0,storage:n=(0,N.w)({storage:"undefined"!=typeof window&&window.localStorage?window.localStorage:N.Q}),syncConnectedChain:a=!0,ssr:o=!1,...s}=e,c="undefined"!=typeof window&&i?function(){let e=new Set,t=[],i=()=>(function(e){if("undefined"==typeof window)return;let t=t=>e(t.detail);return window.addEventListener("eip6963:announceProvider",t),window.dispatchEvent(new CustomEvent("eip6963:requestProvider")),()=>window.removeEventListener("eip6963:announceProvider",t)})(i=>{t.some(({info:e})=>e.uuid===i.info.uuid)||(t=[...t,i],e.forEach(e=>e(t,{added:[i]})))}),r=i();return{_listeners:()=>e,clear(){e.forEach(e=>e([],{removed:[...t]})),t=[]},destroy(){this.clear(),e.clear(),r?.()},findProvider:({rdns:e})=>t.find(t=>t.info.rdns===e),getProviders:()=>t,reset(){this.clear(),r?.(),r=i()},subscribe:(i,{emitImmediately:r}={})=>(e.add(i),r&&i(t,{added:t}),()=>e.delete(i))}}():void 0,l=k(()=>s.chains),u=k(()=>{let e=[],t=new Set;for(let i of s.connectors??[]){let r=d(i);if(e.push(r),!o&&r.rdns)for(let e of"string"==typeof r.rdns?[r.rdns]:r.rdns)t.add(e)}if(!o&&c)for(let i of c.getProviders())t.has(i.info.rdns)||e.push(d(h(i)));return e});function d(e){let t=new T(function(e=11){if(!r||R+e>512){r="",R=0;for(let e=0;e<256;e++)r+=(256+256*Math.random()|0).toString(16).substring(1)}return r.substring(R,R+++e)}()),i={...e({emitter:t,chains:l.getState(),storage:n,transports:s.transports}),emitter:t,uid:t.uid};return t.on("connect",v),i.setup?.(),i}function h(e){let{info:t}=e,i=e.provider;return(0,I.b)({target:{...t,id:t.rdns,provider:i}})}let p=new Map;function f(){return{chainId:l.getState()[0].id,connections:new Map,current:null,status:"disconnected"}}let g="0.0.0-canary-";t=O.r.startsWith(g)?Number.parseInt(O.r.replace(g,"")):Number.parseInt(O.r.split(".")[0]??"0");let w=k(C(n?E(f,{migrate(e,i){if(i===t)return e;let r=f(),n=m(e,r.chainId);return{...r,chainId:n}},name:"store",partialize:e=>({connections:{__type:"Map",value:Array.from(e.connections.entries()).map(([e,t])=>{let{id:i,name:r,type:n,uid:a}=t.connector;return[e,{...t,connector:{id:i,name:r,type:n,uid:a}}]})},chainId:e.chainId,current:e.current}),merge(e,t){"object"==typeof e&&e&&"status"in e&&delete e.status;let i=m(e,t.chainId);return{...t,...e,chainId:i}},skipHydration:o,storage:n,version:t}):f));function m(e,t){return e&&"object"==typeof e&&"chainId"in e&&"number"==typeof e.chainId&&l.getState().some(t=>t.id===e.chainId)?e.chainId:t}function b(e){w.setState(t=>{let i=t.connections.get(e.uid);return i?{...t,connections:new Map(t.connections).set(e.uid,{accounts:e.accounts??i.accounts,chainId:e.chainId??i.chainId,connector:i.connector})}:t})}function v(e){"connecting"!==w.getState().status&&"reconnecting"!==w.getState().status&&w.setState(t=>{let i=u.getState().find(t=>t.uid===e.uid);return i?(i.emitter.listenerCount("connect")&&i.emitter.off("connect",b),i.emitter.listenerCount("change")||i.emitter.on("change",b),i.emitter.listenerCount("disconnect")||i.emitter.on("disconnect",y),{...t,connections:new Map(t.connections).set(e.uid,{accounts:e.accounts,chainId:e.chainId,connector:i}),current:e.uid,status:"connected"}):t})}function y(e){w.setState(t=>{let i=t.connections.get(e.uid);if(i){let e=i.connector;e.emitter.listenerCount("change")&&i.connector.emitter.off("change",b),e.emitter.listenerCount("disconnect")&&i.connector.emitter.off("disconnect",y),e.emitter.listenerCount("connect")||i.connector.emitter.on("connect",v)}if(t.connections.delete(e.uid),0===t.connections.size)return{...t,connections:new Map,current:null,status:"disconnected"};let r=t.connections.values().next().value;return{...t,connections:new Map(t.connections),current:r.connector.uid}})}return w.setState(f()),a&&w.subscribe(({connections:e,current:t})=>t?e.get(t)?.chainId:void 0,e=>{if(l.getState().some(t=>t.id===e))return w.setState(t=>({...t,chainId:e??t.chainId}))}),c?.subscribe(e=>{let t=new Set,i=new Set;for(let e of u.getState())if(t.add(e.id),e.rdns)for(let t of"string"==typeof e.rdns?[e.rdns]:e.rdns)i.add(t);let r=[];for(let n of e){if(i.has(n.info.rdns))continue;let e=d(h(n));t.has(e.id)||r.push(e)}(!n||w.persist.hasHydrated())&&u.setState(e=>[...e,...r],!0)}),{get chains(){return l.getState()},get connectors(){return u.getState()},storage:n,getClient:function(e={}){let t;let i=e.chainId??w.getState().chainId,r=l.getState().find(e=>e.id===i);if(e.chainId&&!r)throw new P.nk;{let e=p.get(w.getState().chainId);if(e&&!r)return e;if(!r)throw new P.nk}{let e=p.get(i);if(e)return e}if(s.client)t=s.client({chain:r});else{let e=r.id,i=l.getState().map(e=>e.id),n={};for(let[t,r]of Object.entries(s))if("chains"!==t&&"client"!==t&&"connectors"!==t&&"transports"!==t){if("object"==typeof r){if(e in r)n[t]=r[e];else{if(i.some(e=>e in r))continue;n[t]=r}}else n[t]=r}t=(0,x.U)({...n,chain:r,batch:n.batch??{multicall:!0},transport:t=>s.transports[e]({...t,connectors:u})})}return p.set(i,t),t},get state(){return w.getState()},setState(e){let t;t="function"==typeof e?e(w.getState()):e;let i=f();"object"!=typeof t&&(t=i),Object.keys(i).some(e=>!(e in t))&&(t=i),w.setState(t,!0)},subscribe:(e,t,i)=>w.subscribe(e,t,i?{...i,fireImmediately:i.emitImmediately}:void 0),_internal:{mipd:c,store:w,ssr:!!o,syncConnectedChain:a,transports:s.transports,chains:{setState(e){let t="function"==typeof e?e(l.getState()):e;if(0!==t.length)return l.setState(t,!0)},subscribe:e=>l.subscribe(e)},connectors:{providerDetailToConnector:h,setup:d,setState:e=>u.setState("function"==typeof e?e(u.getState()):e,!0),subscribe:e=>u.subscribe(e)},events:{change:b,connect:v,disconnect:y}}}}({...e,chains:this.wagmiChains,transports:i,connectors:n})}setupWatchers(){(0,M.F)(this.wagmiConfig,{onChange:e=>{e.address&&this.emit("accountChanged",{address:e.address,chainId:e.chainId}),e.chainId&&this.emit("switchNetwork",{address:e.address,chainId:e.chainId})}}),function(e,t){let{onChange:i}=t;e.subscribe(()=>$(e),i,{equalityFn:D.b})}(this.wagmiConfig,{onChange:e=>{0===e.length&&this.emit("disconnect")}})}addWagmiConnectors(e,t){let i=[];!1!==e.enableCoinbase&&i.push(td({version:"4",appName:e.metadata?.name??"Unknown",appLogoUrl:e.metadata?.icons[0]??"Unknown",preference:e.coinbasePreference??"all"})),!1!==e.enableWalletConnect&&i.push(tu(e,t,this.caipNetworks)),!1!==e.enableInjected&&i.push((0,I.b)({shimDisconnect:!0}));let r=e.features?.email===void 0?ts.oU.DEFAULT_FEATURES.email:e.features?.email,n=e.features?.socials?e.features?.socials?.length>0:ts.oU.DEFAULT_FEATURES.socials;(r||n)&&i.push(function(e){let t=[];function i(e){return tt.LX.parseEvmChainId(e)||1}return(0,ti.U)(r=>({id:ta.oU.AUTH_CONNECTOR_ID,name:"AppKit Auth",type:"ID_AUTH",chain:tt.oU.CHAIN.EVM,async connect(e={}){let r=await this.getProvider(),n=e.chainId;if(e.isReconnecting&&!(n=r.getLastUsedChainId()))throw Error("ChainId not found in provider");let{address:a,chainId:o,accounts:s}=await r.connect({chainId:n});t=s?.map(e=>e.address)||[a],await r.getSmartAccountEnabledNetworks();let c=i(o);return{accounts:t,account:a,chainId:c,chain:{id:c,unsuported:!1}}},async disconnect(){let e=await this.getProvider();await e.disconnect()},getAccounts:()=>t?.length?(r.emitter.emit("change",{accounts:t}),Promise.resolve(t)):Promise.resolve([]),async getProvider(){return this.provider||(this.provider=to.v.getInstance({projectId:e.options.projectId,onTimeout:()=>{ts.hG.open(ta.RQ.ALERT_ERRORS.SOCIALS_TIMEOUT,"error")}})),Promise.resolve(this.provider)},async getChainId(){let e=await this.getProvider(),{chainId:t}=await e.getChainId();return i(t)},async isAuthorized(){return Promise.resolve((await this.getProvider()).getLoginEmailUsed())},async switchChain({chainId:e}){try{let i=r.chains.find(t=>t.id===e);if(!i)throw new tr.ch(Error("chain not found on connector."));let n=await this.getProvider(),a=await n.connect({chainId:e});return t=a?.accounts?.map(e=>e.address)||[a.address],r.emitter.emit("change",{chainId:Number(e),accounts:t}),i}catch(e){if(e instanceof Error)throw new tr.ch(e);throw e}},onAccountsChanged(e){0===e.length?this.onDisconnect():r.emitter.emit("change",{accounts:e.map(tn.b)})},onChainChanged(e){let t=Number(e);r.emitter.emit("change",{chainId:t})},async onDisconnect(e){let t=await this.getProvider();await t.disconnect()}}))}({chains:this.wagmiChains,options:{projectId:e.projectId},provider:this.availableConnectors.find(e=>e.id===ta.oU.AUTH_CONNECTOR_ID)?.provider})),i.forEach(e=>{let t=this.wagmiConfig._internal.connectors.setup(e);this.wagmiConfig._internal.connectors.setState(e=>[...e,t])})}async signMessage(e){try{return{signature:await (0,L.l)(this.wagmiConfig,{message:e.message,account:e.address})}}catch(e){throw Error("WagmiAdapter:signMessage - Sign message failed")}}async sendTransaction(e){let{chainId:t}=(0,j.s)(this.wagmiConfig),i={account:e.address,to:e.to,value:e.value,gas:e.gas,gasPrice:e.gasPrice,data:e.data,chainId:t,type:"legacy"};await q(this.wagmiConfig,i);let r=await F(this.wagmiConfig,i);return await eb(this.wagmiConfig,{hash:r,timeout:25e3}),{hash:r}}async writeContract(e){let{caipNetwork:t,...i}=e,r=Number(tt.LX.caipNetworkIdToNumber(t.caipNetworkId));return{hash:await (0,ev.E)(this.wagmiConfig,{chain:this.wagmiChains?.[r],chainId:r,address:i.tokenAddress,account:i.fromAddress,abi:i.abi,functionName:i.method,args:[i.receiverAddress,i.tokenAmount]})}}async getEnsAddress(e){let{name:t,caipNetwork:i}=e;try{if(!this.wagmiConfig)throw Error("networkControllerClient:getApprovedCaipNetworksData - wagmiConfig is undefined");let e=!1,r=!1;return(0,tt.TY)(t)&&(r=await tc.k.resolveReownName(t)||!1),1===i.id&&(e=await function(e,t){let{chainId:i,...r}=t,n=e.getClient({chainId:i});return(0,W.T)(n,e$,"getEnsAddress")(r)}(this.wagmiConfig,{name:id(t),chainId:i.id})),{address:e||r||!1}}catch{return{address:!1}}}async estimateGas(e){try{return{gas:await ej(this.wagmiConfig,{account:e.address,to:e.to,data:e.data,type:"legacy"})}}catch(e){throw Error("WagmiAdapter:estimateGas - error estimating gas")}}parseUnits(e){return(0,th.X)(e.value,e.decimals)}formatUnits(e){return(0,tp.J)(e.value,e.decimals)}syncConnectors(e,t){this.addWagmiConnectors(e,t);let i=this.wagmiConfig.connectors.map(e=>({...e,chain:this.namespace})),r=new Set;i.filter(e=>{let t=r.has(e.id);return r.add(e.id),!t}).forEach(t=>{let i=ta.oU.AUTH_CONNECTOR_ID===t.id,r=t.id===ta.oU.INJECTED_CONNECTOR_ID;!i&&this.namespace&&this.addConnector({id:t.id,explorerId:ta.L_.ConnectorExplorerIds[t.id],imageUrl:e?.connectorImages?.[t.id]??t.icon,name:ta.L_.ConnectorNamesMap[t.id]??t.name,imageId:ta.L_.ConnectorImageIds[t.id],type:ta.L_.ConnectorTypesMap[t.type]??"EXTERNAL",info:r?void 0:{rdns:t.id},chain:this.namespace,chains:[]})})}async syncConnection(e){let{id:t}=e,i=$(this.wagmiConfig).find(e=>e.connector.id===t),r=this.wagmiConfig.connectors.find(e=>e.id===t),n=await r?.getProvider();return{chainId:Number(i?.chainId),address:i?.accounts[0],provider:n,type:i?.connector.type,id:i?.connector.id}}async connectWalletConnect(e,t){let i=this.wagmiConfig.connectors.find(e=>"walletConnect"===e.type),r=await i.getProvider();if(!this.caipNetworks||!r)throw Error("UniversalAdapter:connectWalletConnect - caipNetworks or provider is undefined");r.on("display_uri",t=>{e(t)}),await (0,eB.N)(this.wagmiConfig,{connector:i,chainId:t?Number(t):void 0})}async connect(e){let{id:t,provider:i,type:r,info:n,chainId:a}=e,o=this.wagmiConfig.connectors.find(e=>e.id===t);if(!o)throw Error("connectionControllerClient:connectExternal - connector is undefined");i&&n&&o.id===ta.oU.EIP6963_CONNECTOR_ID&&o.setEip6963Wallet?.({provider:i,info:n});let s=await (0,eB.N)(this.wagmiConfig,{connector:o,chainId:a?Number(a):void 0});return{address:s.accounts[0],chainId:s.chainId,provider:i,type:r,id:t}}async reconnect(e){let{id:t}=e,i=this.wagmiConfig.connectors.find(e=>e.id===t);if(!i)throw Error("connectionControllerClient:connectExternal - connector is undefined");await (0,eW.M)(this.wagmiConfig,{connectors:[i]})}async getBalance(e){let t=this.caipNetworks?.find(t=>t.id===e.chainId);if(t&&this.wagmiConfig){let i=Number(e.chainId),r=await (0,eq.r)(this.wagmiConfig,{address:e.address,chainId:i,token:e.tokens?.[t.caipNetworkId]?.address});return{balance:r.formatted,symbol:r.symbol}}return{balance:"",symbol:""}}async getProfile(e){let t=e.chainId,i=await function(e,t){let{chainId:i,...r}=t,n=e.getClient({chainId:i});return(0,W.T)(n,eH,"getEnsName")(r)}(this.wagmiConfig,{address:e.address,chainId:t});if(i){let e=await function(e,t){let{chainId:i,...r}=t,n=e.getClient({chainId:i});return(0,W.T)(n,e9,"getEnsAvatar")(r)}(this.wagmiConfig,{name:i,chainId:t});return{profileName:i,profileImage:e??void 0}}return{profileName:void 0,profileImage:void 0}}getWalletConnectProvider(){return this.wagmiConfig.connectors.find(e=>"walletConnect"===e.type)?.provider}async disconnect(){let e=$(this.wagmiConfig);await Promise.all(e.map(async e=>{let t=e?.connector;t&&await e7(this.wagmiConfig,{connector:t})}))}async switchNetwork(e){await (0,te.S)(this.wagmiConfig,{chainId:e.caipNetwork.id})}async getCapabilities(e){if(!this.wagmiConfig)throw Error("connectionControllerClient:getCapabilities - wagmiConfig is undefined");let t=$(this.wagmiConfig)[0];if(!t?.connector)throw Error("connectionControllerClient:getCapabilities - connector is undefined");let i=await t.connector.getProvider();if(!i)throw Error("connectionControllerClient:getCapabilities - provider is undefined");let r=i.session?.sessionProperties?.capabilities;if(r){let t=function(e){try{return JSON.parse(e)}catch(e){throw Error("Error parsing wallet capabilities")}}(r)[e];if(t)return t}return await i.request({method:"wallet_getCapabilities",params:[e]})}async grantPermissions(e){if(!this.wagmiConfig)throw Error("connectionControllerClient:grantPermissions - wagmiConfig is undefined");let t=$(this.wagmiConfig)[0];if(!t?.connector)throw Error("connectionControllerClient:grantPermissions - connector is undefined");let i=await t.connector.getProvider();if(!i)throw Error("connectionControllerClient:grantPermissions - provider is undefined");return i.request({method:"wallet_grantPermissions",params:e})}async revokePermissions(e){if(!this.wagmiConfig)throw Error("connectionControllerClient:revokePermissions - wagmiConfig is undefined");let t=$(this.wagmiConfig)[0];if(!t?.connector)throw Error("connectionControllerClient:revokePermissions - connector is undefined");let i=await t.connector.getProvider();if(!i)throw Error("connectionControllerClient:revokePermissions - provider is undefined");return i.request({method:"wallet_revokePermissions",params:e})}}},50639:(e,t,i)=>{"use strict";i.d(t,{oU:()=>g,vW:()=>w,rL:()=>c,t$:()=>h,TC:()=>m,LX:()=>l,Se:()=>d,Ud:()=>v,Ws:()=>b,o_:()=>x,TY:()=>C});var r=i(21420),n=i(37583),a=i(39346),o=i(14488);r.extend(a),r.extend(o);let s={...n,name:"en-web3-modal",relativeTime:{future:"in %s",past:"%s ago",s:"%d sec",m:"1 min",mm:"%d min",h:"1 hr",hh:"%d hrs",d:"1 d",dd:"%d d",M:"1 mo",MM:"%d mo",y:"1 yr",yy:"%d yr"}};r.locale("en-web3-modal",s);let c={getYear:(e=new Date().toISOString())=>r(e).year(),getRelativeDateFromNow:e=>r(e).locale("en-web3-modal").fromNow(!0),formatDate:(e,t="DD MMM")=>r(e).format(t)},l={caipNetworkIdToNumber:e=>e?Number(e.split(":")[1]):void 0,parseEvmChainId(e){return"string"==typeof e?this.caipNetworkIdToNumber(e):e}};var u=i(66499);let d={bigNumber:e=>new u.g(e),multiply(e,t){if(void 0===e||void 0===t)return u.g(0);let i=new u.g(e),r=new u.g(t);return i.multipliedBy(r)},formatNumberToLocalString:(e,t=2)=>void 0===e?"0.00":"number"==typeof e?e.toLocaleString("en-US",{maximumFractionDigits:t,minimumFractionDigits:t}):parseFloat(e).toLocaleString("en-US",{maximumFractionDigits:t,minimumFractionDigits:t})},h={numericInputKeyDown(e,t,i){let r=e.metaKey||e.ctrlKey,n=e.key,a=n.toLocaleLowerCase(),o=","===n,s="."===n,c=n>="0"&&n<="9";r||"a"!==a&&"c"!==a&&"v"!==a&&"x"!==a||e.preventDefault(),"0"!==t||o||s||"0"!==n||e.preventDefault(),"0"===t&&c&&(i(n),e.preventDefault()),(o||s)&&(t||(i("0."),e.preventDefault()),(t?.includes(".")||t?.includes(","))&&e.preventDefault()),c||["Backspace","Meta","Ctrl","a","A","c","C","x","X","v","V","ArrowLeft","ArrowRight","Tab"].includes(n)||s||o||e.preventDefault()}},p=[{type:"function",name:"transfer",stateMutability:"nonpayable",inputs:[{name:"_to",type:"address"},{name:"_value",type:"uint256"}],outputs:[{name:"",type:"bool"}]},{type:"function",name:"transferFrom",stateMutability:"nonpayable",inputs:[{name:"_from",type:"address"},{name:"_to",type:"address"},{name:"_value",type:"uint256"}],outputs:[{name:"",type:"bool"}]}],f=[{type:"function",name:"transfer",stateMutability:"nonpayable",inputs:[{name:"recipient",type:"address"},{name:"amount",type:"uint256"}],outputs:[]},{type:"function",name:"transferFrom",stateMutability:"nonpayable",inputs:[{name:"sender",type:"address"},{name:"recipient",type:"address"},{name:"amount",type:"uint256"}],outputs:[{name:"",type:"bool"}]}],g={WC_NAME_SUFFIX:".reown.id",WC_NAME_SUFFIX_LEGACY:".wcn.id",BLOCKCHAIN_API_RPC_URL:"https://rpc.walletconnect.org",PULSE_API_URL:"https://pulse.walletconnect.org",W3M_API_URL:"https://api.web3modal.org",CHAIN:{EVM:"eip155",SOLANA:"solana",POLKADOT:"polkadot"},CHAIN_NAME_MAP:{eip155:"Ethereum",solana:"Solana",polkadot:"Polkadot",bip122:"Bitcoin"},USDT_CONTRACT_ADDRESSES:["0xdac17f958d2ee523a2206206994597c13d831ec7","0xc2132d05d31c914a87c6611c10748aeb04b58e8f","0x9702230a8ea53601f5cd2dc00fdbc13d4df4a8c7","0x919C1c267BC06a7039e03fcc2eF738525769109c","0x48065fbBE25f71C9282ddf5e1cD6D6A887483D5e","0x55d398326f99059fF775485246999027B3197955","0xfd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb9"]},w={getERC20Abi:e=>g.USDT_CONTRACT_ADDRESSES.includes(e)?f:p},m={URLS:{FAQ:"https://walletconnect.com/faq"}},b={WALLET_ID:"@appkit/wallet_id",WALLET_NAME:"@appkit/wallet_name",SOLANA_WALLET:"@appkit/solana_wallet",SOLANA_CAIP_CHAIN:"@appkit/solana_caip_chain",ACTIVE_CAIP_NETWORK_ID:"@appkit/active_caip_network_id",CONNECTED_CONNECTOR:"@appkit/connected_connector",CONNECTED_SOCIAL:"@appkit/connected_social",CONNECTED_SOCIAL_USERNAME:"@appkit/connected_social_username",RECENT_WALLETS:"@appkit/recent_wallets",DEEPLINK_CHOICE:"WALLETCONNECT_DEEPLINK_CHOICE",CONNECTED_NAMESPACE:"@appkit/connected_namespace",CONNECTION_STATUS:"@appkit/connection_status"},v={setItem(e,t){y()&&localStorage.setItem(e,t)},getItem(e){if(y())return localStorage.getItem(e)||void 0},removeItem(e){y()&&localStorage.removeItem(e)},clear(){y()&&localStorage.clear()}};function y(){return"undefined"!=typeof window&&"undefined"!=typeof localStorage}function x(e,t){return"light"===t?{"--w3m-accent":e?.["--w3m-accent"]||"hsla(231, 100%, 70%, 1)","--w3m-background":"#fff"}:{"--w3m-accent":e?.["--w3m-accent"]||"hsla(230, 100%, 67%, 1)","--w3m-background":"#121313"}}function C(e){return e?.endsWith(g.WC_NAME_SUFFIX_LEGACY)||e?.endsWith(g.WC_NAME_SUFFIX)}},80196:(e,t,i)=>{"use strict";i.d(t,{Uj:()=>a.U,hG:()=>L,Np:()=>d.N,jQ:()=>x.j,$m:()=>B,TP:()=>u.T,WB:()=>o.W,x4:()=>b.x,aK:()=>v.a,oU:()=>l.oU,wE:()=>S.w,f:()=>U,En:()=>_.E,W3:()=>r.W,aG:()=>m,Hd:()=>A.H,z3:()=>E.z,IN:()=>n.I,UG:()=>q,Rv:()=>P,Pt:()=>y.P,iT:()=>W.i,GN:()=>I.GN,Wn:()=>C.W,Ib:()=>O,WC:()=>k.W});var r=i(29811),n=i(2850),a=i(73322),o=i(94984),s=i(5061),c=i(2614),l=i(36192),u=i(65411),d=i(57417),h=i(50639);let p={id:"2b92315d-eab7-5bef-84fa-089a131333f5",name:"USD Coin",symbol:"USDC",networks:[{name:"ethereum-mainnet",display_name:"Ethereum",chain_id:"1",contract_address:"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"},{name:"polygon-mainnet",display_name:"Polygon",chain_id:"137",contract_address:"0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174"}]},f={id:"USD",payment_method_limits:[{id:"card",min:"10.00",max:"7500.00"},{id:"ach_bank_account",min:"10.00",max:"25000.00"}]},g={providers:l.tM,selectedProvider:null,error:null,purchaseCurrency:p,paymentCurrency:f,purchaseCurrencies:[p],paymentCurrencies:[],quotesLoading:!1},w=(0,c.BX)(g),m={state:w,subscribe:e=>(0,c.B1)(w,()=>e(w)),subscribeKey:(e,t)=>(0,s.u$)(w,e,t),setSelectedProvider(e){if(e&&"meld"===e.name){let t=l.pv,i=o.W.state.activeChain===h.oU.CHAIN.SOLANA?"SOL":"USDC",r=a.U.state.address??"",n=new URL(e.url);n.searchParams.append("publicKey",t),n.searchParams.append("destinationCurrencyCode",i),n.searchParams.append("walletAddress",r),e.url=n.toString()}w.selectedProvider=e},setPurchaseCurrency(e){w.purchaseCurrency=e},setPaymentCurrency(e){w.paymentCurrency=e},setPurchaseAmount(e){this.state.purchaseAmount=e},setPaymentAmount(e){this.state.paymentAmount=e},async getAvailableCurrencies(){let e=await u.T.getOnrampOptions();w.purchaseCurrencies=e.purchaseCurrencies,w.paymentCurrencies=e.paymentCurrencies,w.paymentCurrency=e.paymentCurrencies[0]||f,w.purchaseCurrency=e.purchaseCurrencies[0]||p,await d.N.fetchCurrencyImages(e.paymentCurrencies.map(e=>e.id)),await d.N.fetchTokenImages(e.purchaseCurrencies.map(e=>e.symbol))},async getQuote(){w.quotesLoading=!0;try{let e=await u.T.getOnrampQuote({purchaseCurrency:w.purchaseCurrency,paymentCurrency:w.paymentCurrency,amount:w.paymentAmount?.toString()||"0",network:w.purchaseCurrency?.symbol});return w.quotesLoading=!1,w.purchaseAmount=Number(e.purchaseAmount.amount),e}catch(e){return w.error=e.message,w.quotesLoading=!1,null}finally{w.quotesLoading=!1}},resetState(){w.providers=l.tM,w.selectedProvider=null,w.error=null,w.purchaseCurrency=p,w.paymentCurrency=f,w.purchaseCurrencies=[p],w.paymentCurrencies=[],w.paymentAmount=void 0,w.purchaseAmount=void 0,w.quotesLoading=!1}};var b=i(35335),v=i(79950),y=i(55035),x=i(15741),C=i(51668),A=i(48131),E=i(36371),_=i(38946),k=i(76990),I=i(83637),S=i(12344),T=i(45011);let N=(0,c.BX)({loading:!1}),P={state:N,subscribe:e=>(0,c.B1)(N,()=>e(N)),subscribeKey:(e,t)=>(0,s.u$)(N,e,t),setToken(e){e&&(N.token=(0,c.KR)(e))},setTokenAmount(e){N.sendTokenAmount=e},setReceiverAddress(e){N.receiverAddress=e},setReceiverProfileImageUrl(e){N.receiverProfileImageUrl=e},setReceiverProfileName(e){N.receiverProfileName=e},setGasPrice(e){N.gasPrice=e},setGasPriceInUsd(e){N.gasPriceInUSD=e},setLoading(e){N.loading=e},sendToken(){switch(o.W.state.activeCaipNetwork?.chainNamespace){case"eip155":this.sendEvmToken();return;case"solana":this.sendSolanaToken();return;default:throw Error("Unsupported chain")}},sendEvmToken(){this.state.token?.address&&this.state.sendTokenAmount&&this.state.receiverAddress?(_.E.sendEvent({type:"track",event:"SEND_INITIATED",properties:{isSmartAccount:a.U.state.preferredAccountType===T.Vl.ACCOUNT_TYPES.SMART_ACCOUNT,token:this.state.token.address,amount:this.state.sendTokenAmount,network:o.W.state.activeCaipNetwork?.caipNetworkId||""}}),this.sendERC20Token({receiverAddress:this.state.receiverAddress,tokenAddress:this.state.token.address,sendTokenAmount:this.state.sendTokenAmount,decimals:this.state.token.quantity.decimals})):this.state.receiverAddress&&this.state.sendTokenAmount&&this.state.gasPrice&&this.state.token?.quantity.decimals&&(_.E.sendEvent({type:"track",event:"SEND_INITIATED",properties:{isSmartAccount:a.U.state.preferredAccountType===T.Vl.ACCOUNT_TYPES.SMART_ACCOUNT,token:this.state.token?.symbol,amount:this.state.sendTokenAmount,network:o.W.state.activeCaipNetwork?.caipNetworkId||""}}),this.sendNativeToken({receiverAddress:this.state.receiverAddress,sendTokenAmount:this.state.sendTokenAmount,gasPrice:this.state.gasPrice,decimals:this.state.token.quantity.decimals}))},async sendNativeToken(e){n.I.pushTransactionStack({view:"Account",goBack:!1});let t=e.receiverAddress,i=a.U.state.address,r=b.x.parseUnits(e.sendTokenAmount.toString(),Number(e.decimals));try{await b.x.sendTransaction({chainNamespace:"eip155",to:t,address:i,data:"0x",value:r??BigInt(0),gasPrice:e.gasPrice}),y.P.showSuccess("Transaction started"),_.E.sendEvent({type:"track",event:"SEND_SUCCESS",properties:{isSmartAccount:a.U.state.preferredAccountType===T.Vl.ACCOUNT_TYPES.SMART_ACCOUNT,token:this.state.token?.symbol||"",amount:e.sendTokenAmount,network:o.W.state.activeCaipNetwork?.caipNetworkId||""}}),this.resetSend()}catch(t){_.E.sendEvent({type:"track",event:"SEND_ERROR",properties:{isSmartAccount:a.U.state.preferredAccountType===T.Vl.ACCOUNT_TYPES.SMART_ACCOUNT,token:this.state.token?.symbol||"",amount:e.sendTokenAmount,network:o.W.state.activeCaipNetwork?.caipNetworkId||""}}),y.P.showError("Something went wrong")}},async sendERC20Token(e){n.I.pushTransactionStack({view:"Account",goBack:!1});let t=b.x.parseUnits(e.sendTokenAmount.toString(),Number(e.decimals));try{if(a.U.state.address&&e.sendTokenAmount&&e.receiverAddress&&e.tokenAddress){let i=S.w.getPlainAddress(e.tokenAddress);await b.x.writeContract({fromAddress:a.U.state.address,tokenAddress:i,receiverAddress:e.receiverAddress,tokenAmount:t??BigInt(0),method:"transfer",abi:h.vW.getERC20Abi(i)}),y.P.showSuccess("Transaction started"),this.resetSend()}}catch(e){y.P.showError("Something went wrong")}},sendSolanaToken(){if(!this.state.sendTokenAmount||!this.state.receiverAddress){y.P.showError("Please enter a valid amount and receiver address");return}n.I.pushTransactionStack({view:"Account",goBack:!1}),b.x.sendTransaction({chainNamespace:"solana",to:this.state.receiverAddress,value:this.state.sendTokenAmount}).then(()=>{this.resetSend(),a.U.fetchTokenBalance()}).catch(e=>{y.P.showError("Failed to send transaction. Please try again."),console.error("SendController:sendToken - failed to send solana transaction",e)})},resetSend(){N.token=void 0,N.sendTokenAmount=void 0,N.receiverAddress=void 0,N.receiverProfileImageUrl=void 0,N.receiverProfileName=void 0,N.loading=!1}},R=(0,c.BX)({message:"",open:!1,triggerRect:{width:0,height:0,top:0,left:0},variant:"shade"}),O={state:R,subscribe:e=>(0,c.B1)(R,()=>e(R)),subscribeKey:(e,t)=>(0,s.u$)(R,e,t),showTooltip({message:e,triggerRect:t,variant:i}){R.open=!0,R.message=e,R.triggerRect=t,R.variant=i},hide(){R.open=!1,R.message="",R.triggerRect={width:0,height:0,top:0,left:0}}},M={convertEVMChainIdToCoinType(e){if(e>=0x80000000)throw Error("Invalid chainId");return(0x80000000|e)>>>0}},D=(0,c.BX)({suggestions:[],loading:!1}),U={state:D,subscribe:e=>(0,c.B1)(D,()=>e(D)),subscribeKey:(e,t)=>(0,s.u$)(D,e,t),async resolveName(e){try{return await u.T.lookupEnsName(e)}catch(e){throw Error(e?.reasons?.[0]?.description||"Error resolving name")}},async isNameRegistered(e){try{return await u.T.lookupEnsName(e),!0}catch{return!1}},async getSuggestions(e){try{D.loading=!0,D.suggestions=[];let t=await u.T.getEnsNameSuggestions(e);return D.suggestions=t.suggestions.map(e=>({...e,name:e.name}))||[],D.suggestions}catch(e){throw Error(this.parseEnsApiError(e,"Error fetching name suggestions"))}finally{D.loading=!1}},async getNamesForAddress(e){try{if(!o.W.state.activeCaipNetwork)return[];return await u.T.reverseLookupEnsName({address:e})}catch(e){throw Error(this.parseEnsApiError(e,"Error fetching names for address"))}},async registerName(e){let t=o.W.state.activeCaipNetwork;if(!t)throw Error("Network not found");let i=a.U.state.address,r=v.a.getAuthConnector();if(!i||!r)throw Error("Address or auth connector not found");D.loading=!0;try{let r=JSON.stringify({name:e,attributes:{},timestamp:Math.floor(Date.now()/1e3)});n.I.pushTransactionStack({view:"RegisterAccountNameSuccess",goBack:!1,replace:!0,onCancel(){D.loading=!1}});let o=await b.x.signMessage(r),s=t.id;if(!s)throw Error("Network not found");let c=M.convertEVMChainIdToCoinType(Number(s));await u.T.registerEnsName({coinType:c,address:i,signature:o,message:r}),a.U.setProfileName(e,t.chainNamespace),n.I.replace("RegisterAccountNameSuccess")}catch(i){let t=this.parseEnsApiError(i,`Error registering name ${e}`);throw n.I.replace("RegisterAccountName"),Error(t)}finally{D.loading=!1}},validateName:e=>/^[a-zA-Z0-9-]{4,}$/u.test(e),parseEnsApiError:(e,t)=>e?.reasons?.[0]?.description||t},$=(0,c.BX)({message:"",variant:"info",open:!1}),L={state:$,subscribeKey:(e,t)=>(0,s.u$)($,e,t),open(e,t){let{debug:i}=A.H.state,{shortMessage:r,longMessage:n}=e;i&&($.message=r,$.variant=t,$.open=!0),n&&console.error("function"==typeof n?n():n)},close(){$.open=!1,$.message="",$.variant="info"}},j={eip155:"ba0ba0cd-17c6-4806-ad93-f9d174f17900",solana:"a1b58899-f671-4276-6a5e-56ca5bd59700",polkadot:"",bip122:""},B={async fetchWalletImage(e){if(e)return await d.N._fetchWalletImage(e),this.getWalletImageById(e)},getWalletImageById(e){if(e)return x.j.state.walletImages[e]},getWalletImage:e=>e?.image_url?e?.image_url:e?.image_id?x.j.state.walletImages[e.image_id]:void 0,getNetworkImage:e=>e?.assets?.imageUrl?e?.assets?.imageUrl:e?.assets?.imageId?x.j.state.networkImages[e.assets.imageId]:void 0,getNetworkImageById(e){if(e)return x.j.state.networkImages[e]},getConnectorImage:e=>e?.imageUrl?e.imageUrl:e?.imageId?x.j.state.connectorImages[e.imageId]:void 0,getChainImage:e=>x.j.state.networkImages[j[e]]};var W=i(75268);i(27258);let q={getSIWX:()=>A.H.state.siwx,async initializeIfEnabled(){let e=A.H.state.siwx,t=o.W.getActiveCaipAddress();if(!(e&&t))return;let[i,a,s]=t.split(":");if(o.W.checkIfSupportedNetwork(i))try{if((await e.getSessions(`${i}:${a}`,s)).length)return;await r.W.open({view:"SIWXSignMessage"})}catch(e){console.error("SIWXUtil:initializeIfEnabled",e),_.E.sendEvent({type:"track",event:"SIWX_AUTH_ERROR",properties:this.getSIWXEventProperties()}),await b.x._getClient()?.disconnect().catch(console.error),n.I.reset("Connect"),y.P.showError("A problem occurred while trying initialize authentication")}},async requestSignMessage(){let e=A.H.state.siwx,t=S.w.getPlainAddress(o.W.getActiveCaipAddress()),i=o.W.getActiveCaipNetwork(),a=b.x._getClient();if(!e)throw Error("SIWX is not enabled");if(!t)throw Error("No ActiveCaipAddress found");if(!i)throw Error("No ActiveCaipNetwork or client found");if(!a)throw Error("No ConnectionController client found");try{let o=await e.createMessage({chainId:i.caipNetworkId,accountAddress:t}),s=o.toString();"ID_AUTH"===W.i.getConnectedConnector()&&n.I.pushTransactionStack({view:null,goBack:!1,replace:!0});let c=await a.signMessage(s);await e.addSession({data:o,message:s,signature:c}),r.W.close(),_.E.sendEvent({type:"track",event:"SIWX_AUTH_SUCCESS",properties:this.getSIWXEventProperties()})}catch(t){let e=this.getSIWXEventProperties();r.W.state.open&&"ApproveTransaction"!==n.I.state.view||await r.W.open({view:"SIWXSignMessage"}),e.isSmartAccount?y.P.showError("This application might not support Smart Accounts"):y.P.showError("Signature declined"),_.E.sendEvent({type:"track",event:"SIWX_AUTH_ERROR",properties:e}),console.error("SWIXUtil:requestSignMessage",t)}},async cancelSignMessage(){try{await b.x.disconnect(),n.I.reset("Connect"),_.E.sendEvent({event:"CLICK_CANCEL_SIWX",type:"track",properties:this.getSIWXEventProperties()})}catch(e){console.error("SIWXUtil:cancelSignMessage",e)}},async getSessions(){let e=A.H.state.siwx,t=S.w.getPlainAddress(o.W.getActiveCaipAddress()),i=o.W.getActiveCaipNetwork();return e&&t&&i?e.getSessions(i.caipNetworkId,t):[]},async isSIWXCloseDisabled(){if(this.getSIWX()){let e="ApproveTransaction"===n.I.state.view,t="SIWXSignMessage"===n.I.state.view;if(e||t)return 0===(await this.getSessions()).length}return!1},async universalProviderAuthenticate({universalProvider:e,chains:t,methods:i}){let r=q.getSIWX(),n=new Set(t.map(e=>e.split(":")[0]));if(!r||1!==n.size)return!1;let a=await r.createMessage({chainId:o.W.getActiveCaipNetwork()?.caipNetworkId||"",accountAddress:""}),s=await e.authenticate({nonce:a.nonce,domain:a.domain,uri:a.uri,exp:a.expirationTime,iat:a.issuedAt,nbf:a.notBefore,requestId:a.requestId,version:a.version,resources:a.resources,statement:a.statement,chainId:a.chainId,methods:i,chains:t});if(s?.auths?.length){let t=s.auths.map(t=>{let i=e.client.formatAuthMessage({request:t.p,iss:t.p.iss});return{data:{...t.p,accountAddress:t.p.iss.split(":").slice(-1).join(""),chainId:t.p.iss.split(":").slice(2,4).join(":"),uri:t.p.aud,version:t.p.version||a.version,expirationTime:t.p.exp,issuedAt:t.p.iat,notBefore:t.p.nbf},message:i,signature:t.s.s,cacao:t}});try{await r.setSessions(t),_.E.sendEvent({type:"track",event:"SIWX_AUTH_SUCCESS",properties:q.getSIWXEventProperties()})}catch(t){throw console.error("SIWX:universalProviderAuth - failed to set sessions",t),_.E.sendEvent({type:"track",event:"SIWX_AUTH_ERROR",properties:q.getSIWXEventProperties()}),await e.disconnect().catch(console.error),t}}return!0},getSIWXEventProperties:()=>({network:o.W.state.activeCaipNetwork?.caipNetworkId||"",isSmartAccount:a.U.state.preferredAccountType===T.Vl.ACCOUNT_TYPES.SMART_ACCOUNT})}},73322:(e,t,i)=>{"use strict";i.d(t,{U:()=>h});var r=i(12344),n=i(65411),a=i(55035),o=i(83637),s=i(9592),c=i(94984),l=i(2614),u=i(36192);let d=(0,l.BX)({currentTab:0,tokenBalance:[],smartAccountDeployed:!1,addressLabels:new Map,allAccounts:[]}),h={state:d,replaceState(e){e&&Object.assign(d,(0,l.KR)(e))},subscribe:e=>c.W.subscribeChainProp("accountState",t=>{if(t)return e(t)}),subscribeKey(e,t,i){let r;return c.W.subscribeChainProp("accountState",i=>{if(i){let n=i[e];r!==n&&(r=n,t(n))}},i)},setStatus(e,t){c.W.setAccountProp("status",e,t)},getCaipAddress:e=>c.W.getAccountProp("caipAddress",e),setProvider(e,t){e&&c.W.setAccountProp("provider",e,t)},setCaipAddress(e,t){let i=e?r.w.getPlainAddress(e):void 0;t===c.W.state.activeChain&&(c.W.state.activeCaipAddress=e),c.W.setAccountProp("caipAddress",e,t),c.W.setAccountProp("address",i,t)},setBalance(e,t,i){c.W.setAccountProp("balance",e,i),c.W.setAccountProp("balanceSymbol",t,i)},setProfileName(e,t){c.W.setAccountProp("profileName",e,t)},setProfileImage(e,t){c.W.setAccountProp("profileImage",e,t)},setAddressExplorerUrl(e,t){c.W.setAccountProp("addressExplorerUrl",e,t)},setSmartAccountDeployed(e,t){c.W.setAccountProp("smartAccountDeployed",e,t)},setCurrentTab(e){c.W.setAccountProp("currentTab",e,c.W.state.activeChain)},setTokenBalance(e,t){e&&c.W.setAccountProp("tokenBalance",e,t)},setShouldUpdateToAddress(e,t){c.W.setAccountProp("shouldUpdateToAddress",e,t)},setAllAccounts(e,t){c.W.setAccountProp("allAccounts",e,t)},addAddressLabel(e,t,i){let r=c.W.getAccountProp("addressLabels",i)||new Map;r.set(e,t),c.W.setAccountProp("addressLabels",r,i)},removeAddressLabel(e,t){let i=c.W.getAccountProp("addressLabels",t)||new Map;i.delete(e),c.W.setAccountProp("addressLabels",i,t)},setConnectedWalletInfo(e,t){c.W.setAccountProp("connectedWalletInfo",e,t,!1)},setPreferredAccountType(e,t){c.W.setAccountProp("preferredAccountType",e,t)},setSocialProvider(e,t){e&&c.W.setAccountProp("socialProvider",e,t)},setSocialWindow(e,t){e&&c.W.setAccountProp("socialWindow",(0,l.KR)(e),t)},setFarcasterUrl(e,t){e&&c.W.setAccountProp("farcasterUrl",e,t)},async fetchTokenBalance(){let e=c.W.state.activeCaipNetwork?.caipNetworkId,t=c.W.state.activeCaipNetwork?.chainNamespace,i=c.W.state.activeCaipAddress,l=i?r.w.getPlainAddress(i):void 0;if(!d.lastRetry||r.w.isAllowedRetry(d.lastRetry,30*u.oU.ONE_SEC_MS))try{if(l&&e&&t){let i=await n.T.getBalance(l,e),r=i.balances.filter(e=>"0"!==e.quantity.decimals);this.setTokenBalance(r,t),o.GN.setBalances(s.s.mapBalancesToSwapTokens(i.balances)),d.lastRetry=void 0}}catch(e){d.lastRetry=Date.now(),a.P.showError("Token Balance Unavailable")}},resetAccount(e){c.W.resetAccount(e)}}},57417:(e,t,i)=>{"use strict";i.d(t,{N:()=>w});var r=i(5061),n=i(2614),a=i(12344),o=i(85493),s=i(75268),c=i(15741),l=i(79950),u=i(48131),d=i(94984),h=i(38946);let p=a.w.getApiUrl(),f=new o.Z({baseUrl:p,clientId:null}),g=(0,n.BX)({page:1,count:0,featured:[],recommended:[],wallets:[],search:[],isAnalyticsEnabled:!1,excludedRDNS:[]}),w={state:g,subscribeKey:(e,t)=>(0,r.u$)(g,e,t),_getSdkProperties(){let{projectId:e,sdkType:t,sdkVersion:i}=u.H.state;return{projectId:e,st:t||"appkit",sv:i||"html-wagmi-4.2.2"}},_filterOutExtensions:e=>u.H.state.isUniversalProvider?e.filter(e=>!!(e.mobile_link||e.desktop_link||e.webapp_link)):e,async _fetchWalletImage(e){let t=`${f.baseUrl}/getWalletImage/${e}`,i=await f.getBlob({path:t,params:w._getSdkProperties()});c.j.setWalletImage(e,URL.createObjectURL(i))},async _fetchNetworkImage(e){let t=`${f.baseUrl}/public/getAssetImage/${e}`,i=await f.getBlob({path:t,params:w._getSdkProperties()});c.j.setNetworkImage(e,URL.createObjectURL(i))},async _fetchConnectorImage(e){let t=`${f.baseUrl}/public/getAssetImage/${e}`,i=await f.getBlob({path:t,params:w._getSdkProperties()});c.j.setConnectorImage(e,URL.createObjectURL(i))},async _fetchCurrencyImage(e){let t=`${f.baseUrl}/public/getCurrencyImage/${e}`,i=await f.getBlob({path:t,params:w._getSdkProperties()});c.j.setCurrencyImage(e,URL.createObjectURL(i))},async _fetchTokenImage(e){let t=`${f.baseUrl}/public/getTokenImage/${e}`,i=await f.getBlob({path:t,params:w._getSdkProperties()});c.j.setTokenImage(e,URL.createObjectURL(i))},async fetchNetworkImages(){let e=d.W.getAllRequestedCaipNetworks(),t=e?.map(({assets:e})=>e?.imageId).filter(Boolean);t&&await Promise.allSettled(t.map(e=>w._fetchNetworkImage(e)))},async fetchConnectorImages(){let{connectors:e}=l.a.state,t=e.map(({imageId:e})=>e).filter(Boolean);await Promise.allSettled(t.map(e=>w._fetchConnectorImage(e)))},async fetchCurrencyImages(e=[]){await Promise.allSettled(e.map(e=>w._fetchCurrencyImage(e)))},async fetchTokenImages(e=[]){await Promise.allSettled(e.map(e=>w._fetchTokenImage(e)))},async fetchFeaturedWallets(){let{featuredWalletIds:e}=u.H.state;if(e?.length){let{data:t}=await f.get({path:"/getWallets",params:{...w._getSdkProperties(),page:"1",entries:e?.length?String(e.length):"4",include:e?.join(",")}});t.sort((t,i)=>e.indexOf(t.id)-e.indexOf(i.id));let i=t.map(e=>e.image_id).filter(Boolean);await Promise.allSettled(i.map(e=>w._fetchWalletImage(e))),g.featured=t}},async fetchRecommendedWallets(){try{let{includeWalletIds:e,excludeWalletIds:t,featuredWalletIds:i}=u.H.state,r=[...t??[],...i??[]].filter(Boolean),{data:n,count:a}=await f.get({path:"/getWallets",params:{...w._getSdkProperties(),page:"1",chains:d.W.state.activeCaipNetwork?.caipNetworkId,entries:"4",include:e?.join(","),exclude:r?.join(",")}}),o=s.i.getRecentWallets(),c=n.map(e=>e.image_id).filter(Boolean),l=o.map(e=>e.image_id).filter(Boolean);await Promise.allSettled([...c,...l].map(e=>w._fetchWalletImage(e))),g.recommended=n,g.count=a??0}catch{}},async fetchWallets({page:e}){let{includeWalletIds:t,excludeWalletIds:i,featuredWalletIds:r}=u.H.state,n=[...g.recommended.map(({id:e})=>e),...i??[],...r??[]].filter(Boolean),{data:o,count:s}=await f.get({path:"/getWallets",params:{...w._getSdkProperties(),page:String(e),entries:"40",chains:d.W.state.activeCaipNetwork?.caipNetworkId,include:t?.join(","),exclude:n.join(",")}}),c=o.slice(0,20).map(e=>e.image_id).filter(Boolean);await Promise.allSettled(c.map(e=>w._fetchWalletImage(e))),g.wallets=a.w.uniqueBy([...g.wallets,...w._filterOutExtensions(o)],"id"),g.count=s>g.count?s:g.count,g.page=e},async searchWalletByIds({ids:e}){let{data:t}=await f.get({path:"/getWallets",params:{...w._getSdkProperties(),page:"1",entries:String(e.length),chains:d.W.state.activeCaipNetwork?.caipNetworkId,include:e?.join(",")}});t&&t.forEach(e=>{e?.rdns&&g.excludedRDNS.push(e.rdns)})},async searchWallet({search:e,badge:t}){let{includeWalletIds:i,excludeWalletIds:r}=u.H.state;g.search=[];let{data:n}=await f.get({path:"/getWallets",params:{...w._getSdkProperties(),page:"1",entries:"100",search:e?.trim(),badge_type:t,chains:d.W.state.activeCaipNetwork?.caipNetworkId,include:i?.join(","),exclude:r?.join(",")}});h.E.sendEvent({type:"track",event:"SEARCH_WALLET",properties:{badge:t??"",search:e??""}});let o=n.map(e=>e.image_id).filter(Boolean);await Promise.allSettled([...o.map(e=>w._fetchWalletImage(e)),a.w.wait(300)]),g.search=w._filterOutExtensions(n)},async reFetchWallets(){g.page=1,g.wallets=[],await w.fetchFeaturedWallets(),await w.fetchRecommendedWallets()},prefetch(){let e=[w.fetchFeaturedWallets(),w.fetchRecommendedWallets(),w.fetchNetworkImages(),w.fetchConnectorImages()];u.H.state.features?.analytics&&e.push(w.fetchAnalyticsConfig()),g.prefetchPromise=Promise.race([Promise.allSettled(e)])},async fetchAnalyticsConfig(){let{isAnalyticsEnabled:e}=await f.get({path:"/getAnalyticsConfig",params:w._getSdkProperties()});u.H.setFeatures({analytics:e})}}},15741:(e,t,i)=>{"use strict";i.d(t,{j:()=>o});var r=i(5061),n=i(2614);let a=(0,n.BX)({walletImages:{},networkImages:{},chainImages:{},connectorImages:{},tokenImages:{},currencyImages:{}}),o={state:a,subscribeNetworkImages:e=>(0,n.B1)(a.networkImages,()=>e(a.networkImages)),subscribeKey:(e,t)=>(0,r.u$)(a,e,t),subscribe:e=>(0,n.B1)(a,()=>e(a)),setWalletImage(e,t){a.walletImages[e]=t},setNetworkImage(e,t){a.networkImages[e]=t},setChainImage(e,t){a.chainImages[e]=t},setConnectorImage(e,t){a.connectorImages[e]=t},setTokenImage(e,t){a.tokenImages[e]=t},setCurrencyImage(e,t){a.currencyImages[e]=t}}},65411:(e,t,i)=>{"use strict";i.d(t,{T:()=>p});var r=i(36192),n=i(12344),a=i(85493),o=i(48131),s=i(2614),c=i(73322),l=i(94984);let u={purchaseCurrencies:[{id:"2b92315d-eab7-5bef-84fa-089a131333f5",name:"USD Coin",symbol:"USDC",networks:[{name:"ethereum-mainnet",display_name:"Ethereum",chain_id:"1",contract_address:"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"},{name:"polygon-mainnet",display_name:"Polygon",chain_id:"137",contract_address:"0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174"}]},{id:"2b92315d-eab7-5bef-84fa-089a131333f5",name:"Ether",symbol:"ETH",networks:[{name:"ethereum-mainnet",display_name:"Ethereum",chain_id:"1",contract_address:"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"},{name:"polygon-mainnet",display_name:"Polygon",chain_id:"137",contract_address:"0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174"}]}],paymentCurrencies:[{id:"USD",payment_method_limits:[{id:"card",min:"10.00",max:"7500.00"},{id:"ach_bank_account",min:"10.00",max:"25000.00"}]},{id:"EUR",payment_method_limits:[{id:"card",min:"10.00",max:"7500.00"},{id:"ach_bank_account",min:"10.00",max:"25000.00"}]}]},d=n.w.getBlockchainApiUrl(),h=(0,s.BX)({clientId:null,api:new a.Z({baseUrl:d,clientId:null})}),p={state:h,fetchIdentity:({address:e})=>h.api.get({path:`/v1/identity/${e}`,params:{projectId:o.H.state.projectId,sender:l.W.state.activeCaipAddress?n.w.getPlainAddress(l.W.state.activeCaipAddress):void 0}}),fetchTransactions:({account:e,projectId:t,cursor:i,onramp:r,signal:n,cache:a,chainId:o})=>h.api.get({path:`/v1/account/${e}/history`,params:{projectId:t,cursor:i,onramp:r,chainId:o},signal:n,cache:a}),fetchSwapQuote:({projectId:e,amount:t,userAddress:i,from:r,to:n,gasPrice:a})=>h.api.get({path:"/v1/convert/quotes",headers:{"Content-Type":"application/json"},params:{projectId:e,amount:t,userAddress:i,from:r,to:n,gasPrice:a}}),fetchSwapTokens:({projectId:e,chainId:t})=>h.api.get({path:"/v1/convert/tokens",params:{projectId:e,chainId:t}}),fetchTokenPrice:({projectId:e,addresses:t})=>h.api.post({path:"/v1/fungible/price",body:{projectId:e,currency:"usd",addresses:t},headers:{"Content-Type":"application/json"}}),fetchSwapAllowance({projectId:e,tokenAddress:t,userAddress:i}){let{sdkType:r,sdkVersion:n}=o.H.state;return h.api.get({path:"/v1/convert/allowance",params:{projectId:e,tokenAddress:t,userAddress:i},headers:{"Content-Type":"application/json","x-sdk-type":r,"x-sdk-version":n||"html-wagmi-4.2.2"}})},fetchGasPrice({projectId:e,chainId:t}){let{sdkType:i,sdkVersion:r}=o.H.state;return h.api.get({path:"/v1/convert/gas-price",headers:{"Content-Type":"application/json","x-sdk-type":i,"x-sdk-version":r||"html-wagmi-4.2.2"},params:{projectId:e,chainId:t}})},generateSwapCalldata:({amount:e,from:t,projectId:i,to:n,userAddress:a})=>h.api.post({path:"/v1/convert/build-transaction",headers:{"Content-Type":"application/json"},body:{amount:e,eip155:{slippage:r.oU.CONVERT_SLIPPAGE_TOLERANCE},from:t,projectId:i,to:n,userAddress:a}}),generateApproveCalldata({from:e,projectId:t,to:i,userAddress:r}){let{sdkType:n,sdkVersion:a}=o.H.state;return h.api.get({path:"/v1/convert/build-approve",headers:{"Content-Type":"application/json","x-sdk-type":n,"x-sdk-version":a||"html-wagmi-4.2.2"},params:{projectId:t,userAddress:r,from:e,to:i}})},async getBalance(e,t,i){let{sdkType:r,sdkVersion:n}=o.H.state;return h.api.get({path:`/v1/account/${e}/balance`,headers:{"x-sdk-type":r,"x-sdk-version":n||"html-wagmi-4.2.2"},params:{currency:"usd",projectId:o.H.state.projectId,chainId:t,forceUpdate:i}})},lookupEnsName:async e=>h.api.get({path:`/v1/profile/account/${e}`,params:{projectId:o.H.state.projectId,apiVersion:"2"}}),reverseLookupEnsName:async({address:e})=>h.api.get({path:`/v1/profile/reverse/${e}`,params:{sender:c.U.state.address,projectId:o.H.state.projectId,apiVersion:"2"}}),getEnsNameSuggestions:async e=>h.api.get({path:`/v1/profile/suggestions/${e}`,params:{projectId:o.H.state.projectId,zone:"reown.id"}}),registerEnsName:async({coinType:e,address:t,message:i,signature:r})=>h.api.post({path:"/v1/profile/account",body:{coin_type:e,address:t,message:i,signature:r},headers:{"Content-Type":"application/json"}}),generateOnRampURL:async({destinationWallets:e,partnerUserId:t,defaultNetwork:i,purchaseAmount:r,paymentAmount:n})=>(await h.api.post({path:"/v1/generators/onrampurl",params:{projectId:o.H.state.projectId},body:{destinationWallets:e,defaultNetwork:i,partnerUserId:t,defaultExperience:"buy",presetCryptoAmount:r,presetFiatAmount:n}})).url,async getOnrampOptions(){try{return await h.api.get({path:"/v1/onramp/options",params:{projectId:o.H.state.projectId}})}catch(e){return u}},async getOnrampQuote({purchaseCurrency:e,paymentCurrency:t,amount:i,network:r}){try{return await h.api.post({path:"/v1/onramp/quote",params:{projectId:o.H.state.projectId},body:{purchaseCurrency:e,paymentCurrency:t,amount:i,network:r}})}catch(e){return{coinbaseFee:{amount:i,currency:t.id},networkFee:{amount:i,currency:t.id},paymentSubtotal:{amount:i,currency:t.id},paymentTotal:{amount:i,currency:t.id},purchaseAmount:{amount:i,currency:t.id},quoteId:"mocked-quote-id"}}},getSmartSessions:e=>h.api.get({path:`/v1/sessions/${e}`,params:{projectId:o.H.state.projectId}}),revokeSmartSession:(e,t,i)=>h.api.post({path:`/v1/sessions/${e}/revoke`,params:{projectId:o.H.state.projectId},body:{pci:t,signature:i}}),setClientId(e){h.clientId=e,h.api=new a.Z({baseUrl:d,clientId:e})}}},94984:(e,t,i)=>{"use strict";i.d(t,{W:()=>w});var r=i(5061),n=i(2614),a=i(73322),o=i(36371),s=i(50639),c=i(12344),l=i(36192),u=i(29811),d=i(38946),h=i(2850);let p={currentTab:0,tokenBalance:[],smartAccountDeployed:!1,addressLabels:new Map,allAccounts:[]},f={supportsAllNetworks:!0,smartAccountEnabledNetworks:[]},g=(0,n.BX)({chains:(0,r.zC)(),activeCaipAddress:void 0,activeChain:void 0,activeCaipNetwork:void 0,noAdapters:!1,universalAdapter:{networkControllerClient:void 0,connectionControllerClient:void 0}}),w={state:g,subscribe:e=>(0,n.B1)(g,()=>{e(g)}),subscribeKey:(e,t)=>(0,r.u$)(g,e,t),subscribeChainProp(e,t,i){let r;return(0,n.B1)(g.chains,()=>{let n=i||g.activeChain;if(n){let i=g.chains.get(n)?.[e];r!==i&&(r=i,t(i))}})},initialize(e){let t=e?.[0];e?.length!==0&&t||(g.noAdapters=!0),g.noAdapters||(g.activeChain=t?.namespace,o.z.set({activeChain:t?.namespace}),e.forEach(e=>{g.chains.set(e.namespace,{namespace:e.namespace,connectionControllerClient:e.connectionControllerClient,networkControllerClient:e.networkControllerClient,adapterType:e.adapterType,accountState:p,networkState:f,caipNetworks:e.caipNetworks})}))},setAdapterNetworkState(e,t){let i=g.chains.get(e);i&&(i.networkState=(0,n.KR)({...i.networkState,...t}),g.chains.set(e,(0,n.KR)(i)))},setChainAccountData(e,t,i=!0){if(!e)throw Error("Chain is required to update chain account data");let r=g.chains.get(e);r&&(r.accountState=(0,n.KR)({...r.accountState,...t}),g.chains.set(e,r),(1===g.chains.size||g.activeChain===e)&&(t.caipAddress&&(g.activeCaipAddress=t.caipAddress),a.U.replaceState(r.accountState)))},setAccountProp(e,t,i,r=!0){this.setChainAccountData(i,{[e]:t},r)},setActiveNamespace(e){g.activeChain=e;let t=e?g.chains.get(e):void 0,i=t?.networkState?.caipNetwork;i?.id&&(g.activeCaipAddress=t?.accountState?.caipAddress,g.activeCaipNetwork=i,s.Ud.setItem(s.Ws.ACTIVE_CAIP_NETWORK_ID,i?.caipNetworkId),o.z.set({activeChain:e,selectedNetworkId:i?.caipNetworkId}))},setActiveCaipNetwork(e){if(!e)return;let t=g.chains.get(e.chainNamespace);g.activeChain=e.chainNamespace,g.activeCaipNetwork=e,t?.accountState?.address?g.activeCaipAddress=`${e.chainNamespace}:${e.id}:${t?.accountState?.address}`:g.activeCaipAddress=void 0,t&&a.U.replaceState(t.accountState),o.z.set({activeChain:g.activeChain,selectedNetworkId:g.activeCaipNetwork?.caipNetworkId}),s.Ud.setItem(s.Ws.ACTIVE_CAIP_NETWORK_ID,e.caipNetworkId),this.checkIfSupportedNetwork(e.chainNamespace)||this.showUnsupportedChainUI()},addCaipNetwork(e){if(!e)return;let t=g.chains.get(e.chainNamespace);t&&t?.caipNetworks?.push(e)},async switchActiveNetwork(e){let t=w.state.chains.get(w.state.activeChain),i=!t?.caipNetworks?.some(e=>e.id===g.activeCaipNetwork?.id),r=this.getNetworkControllerClient(e.chainNamespace);r&&await r.switchCaipNetwork(e),i&&h.I.goBack(),this.setActiveCaipNetwork(e),e&&d.E.sendEvent({type:"track",event:"SWITCH_NETWORK",properties:{network:e.caipNetworkId}})},setActiveConnector(e){e&&(g.activeConnector=(0,n.KR)(e))},getNetworkControllerClient(e){let t=e||g.activeChain,i=g.chains.get(t);if(!i)throw Error("Chain adapter not found");if(!i.networkControllerClient)throw Error("NetworkController client not set");return i.networkControllerClient},getConnectionControllerClient(e){let t=e||g.activeChain;if(!t)throw Error("Chain is required to get connection controller client");let i=g.chains.get(t);if(!i?.connectionControllerClient)throw Error("ConnectionController client not set");return i.connectionControllerClient},getAccountProp(e,t){let i=g.activeChain;if(t&&(i=t),!i)return;let r=g.chains.get(i)?.accountState;if(r)return r[e]},getNetworkProp(e,t){let i=g.chains.get(t)?.networkState;if(i)return i[e]},getRequestedCaipNetworks(e){let t=g.chains.get(e),{approvedCaipNetworkIds:i=[],requestedCaipNetworks:r=[]}=t?.networkState||{};return c.w.sortRequestedNetworks(i,r)},getAllRequestedCaipNetworks(){let e=[];return g.chains.forEach(t=>{let i=this.getRequestedCaipNetworks(t.namespace);e.push(...i)}),e},setRequestedCaipNetworks(e,t){this.setAdapterNetworkState(t,{requestedCaipNetworks:e})},getAllApprovedCaipNetworkIds(){let e=[];return g.chains.forEach(t=>{let i=this.getApprovedCaipNetworkIds(t.namespace);e.push(...i)}),e},getActiveCaipNetwork:()=>g.activeCaipNetwork,getActiveCaipAddress:()=>g.activeCaipAddress,getApprovedCaipNetworkIds(e){let t=g.chains.get(e);return t?.networkState?.approvedCaipNetworkIds||[]},async setApprovedCaipNetworksData(e){let t=this.getNetworkControllerClient(),i=await t?.getApprovedCaipNetworksData();this.setAdapterNetworkState(e,{approvedCaipNetworkIds:i?.approvedCaipNetworkIds,supportsAllNetworks:i?.supportsAllNetworks})},checkIfSupportedNetwork(e){let t=this.state.activeCaipNetwork,i=this.getRequestedCaipNetworks(e);return!i.length||i?.some(e=>e.id===t?.id)},checkIfSupportedChainId(e){if(!this.state.activeChain)return!0;let t=this.getRequestedCaipNetworks(this.state.activeChain);return t?.some(t=>t.id===e)},setSmartAccountEnabledNetworks(e,t){this.setAdapterNetworkState(t,{smartAccountEnabledNetworks:e})},checkIfSmartAccountEnabled(){let e=s.LX.caipNetworkIdToNumber(g.activeCaipNetwork?.caipNetworkId),t=this.state.activeChain;if(!t||!e)return!1;let i=this.getNetworkProp("smartAccountEnabledNetworks",t);return!!i?.includes(Number(e))},getActiveNetworkTokenAddress(){let e=this.state.activeCaipNetwork?.chainNamespace||"eip155",t=this.state.activeCaipNetwork?.id||1,i=l.oU.NATIVE_TOKEN_ADDRESS[e];return`${e}:${t}:${i}`},showUnsupportedChainUI(){setTimeout(()=>{u.W.open({view:"UnsupportedChain"})},300)},checkIfNamesSupported(){let e=g.activeCaipNetwork;return!!(e?.chainNamespace&&l.oU.NAMES_SUPPORTED_CHAIN_NAMESPACES.includes(e.chainNamespace))},resetNetwork(e){this.setAdapterNetworkState(e,{approvedCaipNetworkIds:void 0,supportsAllNetworks:!0,smartAccountEnabledNetworks:[]})},resetAccount(e){if(!e)throw Error("Chain is required to set account prop");this.state.activeCaipAddress=void 0,this.setChainAccountData(e,(0,n.KR)({smartAccountDeployed:!1,currentTab:0,caipAddress:void 0,address:void 0,balance:void 0,balanceSymbol:void 0,profileName:void 0,profileImage:void 0,addressExplorerUrl:void 0,tokenBalance:[],connectedWalletInfo:void 0,preferredAccountType:void 0,socialProvider:void 0,socialWindow:void 0,farcasterUrl:void 0,provider:void 0}))}}},35335:(e,t,i)=>{"use strict";let r;i.d(t,{x:()=>g});var n=i(5061),a=i(2614),o=i(12344),s=i(75268),c=i(76990),l=i(94984);i(45011);var u=i(29811),d=i(79950),h=i(38946),p=i(48131);let f=(0,a.BX)({wcError:!1,buffering:!1,status:"disconnected"}),g={state:f,subscribeKey:(e,t)=>(0,n.u$)(f,e,t),_getClient:()=>f._client,setClient(e){f._client=(0,a.KR)(e)},async connectWalletConnect(){if(s.i.setConnectedConnector("WALLET_CONNECT"),o.w.isTelegram()){if(r){try{await r}catch(e){}r=void 0;return}if(!o.w.isPairingExpired(f?.wcPairingExpiry)){let e=f.wcUri;f.wcUri=e;return}r=new Promise(async(e,t)=>{await this._getClient()?.connectWalletConnect?.(e=>{f.wcUri=e,f.wcPairingExpiry=o.w.getPairingExpiry()}).catch(t),e()}),this.state.status="connecting",await r,r=void 0,f.wcPairingExpiry=void 0,this.state.status="connected"}else await this._getClient()?.connectWalletConnect?.(e=>{f.wcUri=e,f.wcPairingExpiry=o.w.getPairingExpiry()})},async connectExternal(e,t,i=!0){await this._getClient()?.connectExternal?.(e),i&&l.W.setActiveNamespace(t)},async reconnectExternal(e){await this._getClient()?.reconnectExternal?.(e),s.i.setConnectedConnector("AUTH"===e.type?"ID_AUTH":e.type)},async setPreferredAccountType(e){u.W.setLoading(!0);let t=d.a.getAuthConnector();t&&(await t?.provider.setPreferredAccount(e),await this.reconnectExternal(t),u.W.setLoading(!1),h.E.sendEvent({type:"track",event:"SET_PREFERRED_ACCOUNT_TYPE",properties:{accountType:e,network:l.W.state.activeCaipNetwork?.caipNetworkId||""}}))},async signMessage(e){return this._getClient()?.signMessage(e)},parseUnits(e,t){return this._getClient()?.parseUnits(e,t)},formatUnits(e,t){return this._getClient()?.formatUnits(e,t)},async sendTransaction(e){return this._getClient()?.sendTransaction(e)},async getCapabilities(e){return this._getClient()?.getCapabilities(e)},async grantPermissions(e){return this._getClient()?.grantPermissions(e)},async estimateGas(e){return this._getClient()?.estimateGas(e)},async writeContract(e){return this._getClient()?.writeContract(e)},async getEnsAddress(e){return this._getClient()?.getEnsAddress(e)},async getEnsAvatar(e){return this._getClient()?.getEnsAvatar(e)},checkInstalled(e){return this._getClient()?.checkInstalled?.(e)||!1},resetWcConnection(){f.wcUri=void 0,f.wcPairingExpiry=void 0,f.wcLinking=void 0,f.recentWallet=void 0,f.status="disconnected",c.W.resetTransactions(),s.i.deleteWalletConnectDeepLink()},setWcLinking(e){f.wcLinking=e},setWcError(e){f.wcError=e,f.buffering=!1},setRecentWallet(e){f.recentWallet=e},setBuffering(e){f.buffering=e},setStatus(e){f.status=e},async disconnect(){try{let e=this._getClient(),t=p.H.state.siwx;if(t){let e=l.W.getActiveCaipNetwork(),i=o.w.getPlainAddress(l.W.getActiveCaipAddress());e&&i&&await t.revokeSession(e.caipNetworkId,i)}await e?.disconnect(),this.resetWcConnection()}catch(e){throw Error("Failed to disconnect")}}}},79950:(e,t,i)=>{"use strict";i.d(t,{a:()=>u});var r=i(5061),n=i(2614),a=i(50639),o=i(48131),s=i(51668),c=i(94984);let l=(0,n.BX)({allConnectors:[],connectors:[]}),u={state:l,subscribeKey:(e,t)=>(0,r.u$)(l,e,t),setConnectors(e){e.filter(e=>!l.allConnectors.some(t=>t.id===e.id&&this.getConnectorName(t.name)===this.getConnectorName(e.name)&&t.chain===e.chain)).forEach(e=>{l.allConnectors.push((0,n.KR)(e))}),l.connectors=this.mergeMultiChainConnectors(l.allConnectors)},mergeMultiChainConnectors(e){let t=this.generateConnectorMapByName(e),i=[];return t.forEach(e=>{let t=e[0],r=t?.id==="ID_AUTH";e.length>1?i.push({name:t?.name,imageUrl:t?.imageUrl,imageId:t?.imageId,connectors:[...e],type:r?"AUTH":"MULTI_CHAIN",chain:"eip155",id:t?.id||""}):t&&i.push(t)}),i},generateConnectorMapByName(e){let t=new Map;return e.forEach(e=>{let{name:i}=e,r=this.getConnectorName(i);if(!r)return;let n=t.get(r)||[];n.find(t=>t.chain===e.chain)||n.push(e),t.set(r,n)}),t},getConnectorName:e=>e&&({"Trust Wallet":"Trust"})[e]||e,getUniqueConnectorsByName(e){let t=[];return e.forEach(e=>{t.find(t=>t.chain===e.chain)||t.push(e)}),t},addConnector(e){if("ID_AUTH"===e.id){let t=(0,n.P9)(o.H.state),i=s.W.getSnapshot().themeMode,r=s.W.getSnapshot().themeVariables;e?.provider?.syncDappData?.({metadata:t.metadata,sdkVersion:t.sdkVersion,projectId:t.projectId,sdkType:t.sdkType}),e.provider.syncTheme({themeMode:i,themeVariables:r,w3mThemeVariables:(0,a.o_)(r,i)}),this.setConnectors([e])}else this.setConnectors([e])},getAuthConnector(){let e=c.W.state.activeChain,t=l.connectors.find(e=>"ID_AUTH"===e.id);return t?t?.connectors?.length?t.connectors.find(t=>t.chain===e):t:void 0},getAnnouncedConnectorRdns:()=>l.connectors.filter(e=>"ANNOUNCED"===e.type).map(e=>e.info?.rdns),getConnectors:()=>l.connectors,getConnector:(e,t)=>l.connectors.find(i=>i.explorerId===e||i.info?.rdns===t),syncIfAuthConnector(e){if("ID_AUTH"!==e.id)return;let t=(0,n.P9)(o.H.state),i=s.W.getSnapshot().themeMode,r=s.W.getSnapshot().themeVariables;e?.provider?.syncDappData?.({metadata:t.metadata,sdkVersion:t.sdkVersion,sdkType:t.sdkType,projectId:t.projectId}),e.provider.syncTheme({themeMode:i,themeVariables:r,w3mThemeVariables:(0,a.o_)(r,i)})}}},38946:(e,t,i)=>{"use strict";i.d(t,{E:()=>d});var r=i(2614),n=i(12344),a=i(85493),o=i(48131);let s=n.w.getAnalyticsUrl(),c=new a.Z({baseUrl:s,clientId:null}),l=["MODAL_CREATED"],u=(0,r.BX)({timestamp:Date.now(),data:{type:"track",event:"MODAL_CREATED"}}),d={state:u,subscribe:e=>(0,r.B1)(u,()=>e(u)),_getApiHeaders(){let{projectId:e,sdkType:t,sdkVersion:i}=o.H.state;return{"x-project-id":e,"x-sdk-type":t,"x-sdk-version":i||"html-wagmi-4.2.2"}},async _sendAnalyticsEvent(e){try{if(l.includes(e.data.event)||"undefined"==typeof window)return;await c.post({path:"/e",headers:d._getApiHeaders(),body:{eventId:n.w.getUUID(),url:window.location.href,domain:window.location.hostname,timestamp:e.timestamp,props:e.data}})}catch{}},sendEvent(e){u.timestamp=Date.now(),u.data=e,o.H.state.features?.analytics&&d._sendAnalyticsEvent(u)}}},29811:(e,t,i)=>{"use strict";i.d(t,{W:()=>h});var r=i(5061),n=i(2614),a=i(57417),o=i(38946),s=i(36371),c=i(2850),l=i(94984),u=i(12344);let d=(0,n.BX)({loading:!1,open:!1,shake:!1}),h={state:d,subscribe:e=>(0,n.B1)(d,()=>e(d)),subscribeKey:(e,t)=>(0,r.u$)(d,e,t),async open(e){await a.N.state.prefetchPromise;let t=l.W.state.activeCaipAddress,i=l.W.state.noAdapters;e?.view?c.I.reset(e.view):t?c.I.reset("Account"):i&&!u.w.isMobile()?c.I.reset("ConnectingWalletConnect"):c.I.reset("Connect"),d.open=!0,s.z.set({open:!0}),o.E.sendEvent({type:"track",event:"MODAL_OPEN",properties:{connected:!!t}})},close(){let e=!!l.W.state.activeCaipAddress;d.open=!1,s.z.set({open:!1}),o.E.sendEvent({type:"track",event:"MODAL_CLOSE",properties:{connected:e}})},setLoading(e){d.loading=e,s.z.set({loading:e})},shake(){d.shake||(d.shake=!0,setTimeout(()=>{d.shake=!1},500))}}},48131:(e,t,i)=>{"use strict";i.d(t,{H:()=>s});var r=i(5061),n=i(2614),a=i(36192);let o=(0,n.BX)({features:a.oU.DEFAULT_FEATURES,projectId:"",sdkType:"appkit",sdkVersion:"html-wagmi-undefined"}),s={state:o,subscribeKey:(e,t)=>(0,r.u$)(o,e,t),setOptions(e){Object.assign(o,e)},setFeatures(e){e&&Object.entries(e).forEach(([e,t])=>{o.features||(o.features=a.oU.DEFAULT_FEATURES),e in o.features&&(o.features[e]=t)})},setProjectId(e){o.projectId=e},setAllWallets(e){o.allWallets=e},setIncludeWalletIds(e){o.includeWalletIds=e},setExcludeWalletIds(e){o.excludeWalletIds=e},setFeaturedWalletIds(e){o.featuredWalletIds=e},setTokens(e){o.tokens=e},setTermsConditionsUrl(e){o.termsConditionsUrl=e},setPrivacyPolicyUrl(e){o.privacyPolicyUrl=e},setCustomWallets(e){o.customWallets=e},setIsSiweEnabled(e){o.isSiweEnabled=e},setIsUniversalProvider(e){o.isUniversalProvider=e},setSdkVersion(e){o.sdkVersion=e},setMetadata(e){o.metadata=e},setDisableAppend(e){o.disableAppend=e},setEIP6963Enabled(e){o.enableEIP6963=e},setDebug(e){o.debug=e},setEnableWalletConnect(e){o.enableWalletConnect=e},setEnableWallets(e){o.enableWallets=e},setHasMultipleAddresses(e){o.hasMultipleAddresses=e},setSIWX(e){o.siwx=e}}},36371:(e,t,i)=>{"use strict";i.d(t,{z:()=>a});var r=i(2614);let n=(0,r.BX)({loading:!1,open:!1,selectedNetworkId:void 0,activeChain:void 0}),a={state:n,subscribe:e=>(0,r.B1)(n,()=>e(n)),set(e){Object.assign(n,{...n,...e})}}},2850:(e,t,i)=>{"use strict";i.d(t,{I:()=>s});var r=i(5061),n=i(2614),a=i(29811);let o=(0,n.BX)({view:"Connect",history:["Connect"],transactionStack:[]}),s={state:o,subscribeKey:(e,t)=>(0,r.u$)(o,e,t),pushTransactionStack(e){o.transactionStack.push(e)},popTransactionStack(e){let t=o.transactionStack.pop();if(t){if(e)this.goBack(),t?.onCancel?.();else{if(t.goBack)this.goBack();else if(t.replace){let e=o.history.indexOf("ConnectingSiwe");e>0?this.goBackToIndex(e-1):(a.W.close(),o.history=[])}else t.view&&this.reset(t.view);t?.onSuccess?.()}}},push(e,t){e!==o.view&&(o.view=e,o.history.push(e),o.data=t)},reset(e){o.view=e,o.history=[e]},replace(e,t){o.history.at(-1)!==e&&(o.view=e,o.history[o.history.length-1]=e,o.data=t)},goBack(){if(o.history.length>1&&!o.history.includes("UnsupportedChain")){o.history.pop();let[e]=o.history.slice(-1);e&&(o.view=e)}else a.W.close()},goBackToIndex(e){if(o.history.length>1){o.history=o.history.slice(0,e+1);let[t]=o.history.slice(-1);t&&(o.view=t)}}}},55035:(e,t,i)=>{"use strict";i.d(t,{P:()=>s});var r=i(5061),n=i(2614),a=i(12344);let o=(0,n.BX)({message:"",variant:"success",svg:void 0,open:!1}),s={state:o,subscribeKey:(e,t)=>(0,r.u$)(o,e,t),showLoading(e){this._showMessage({message:e,variant:"loading"})},showSuccess(e){this._showMessage({message:e,variant:"success"})},showSvg(e,t){this._showMessage({message:e,svg:t})},showError(e){let t=a.w.parseError(e);this._showMessage({message:t,variant:"error"})},hide(){o.open=!1},_showMessage({message:e,svg:t,variant:i="success"}){o.open?(o.open=!1,setTimeout(()=>{o.message=e,o.variant=i,o.svg=t,o.open=!0},150)):(o.message=e,o.variant=i,o.svg=t,o.open=!0)}}},83637:(e,t,i)=>{"use strict";i.d(t,{GN:()=>C});var r=i(5061),n=i(2614),a=i(73322),o=i(36192),s=i(35335),c=i(9592),l=i(55035),u=i(2850),d=i(50639),h=i(12344),p=i(65411),f=i(48131);let g={getGasPriceInEther:(e,t)=>Number(t*e)/1e18,getGasPriceInUSD(e,t,i){let r=g.getGasPriceInEther(t,i);return d.Se.bigNumber(e).multipliedBy(r).toNumber()},getPriceImpact({sourceTokenAmount:e,sourceTokenPriceInUSD:t,toTokenPriceInUSD:i,toTokenAmount:r}){let n=d.Se.bigNumber(e).multipliedBy(t),a=d.Se.bigNumber(r).multipliedBy(i);return n.minus(a).dividedBy(n).multipliedBy(100).toNumber()},getMaxSlippage(e,t){let i=d.Se.bigNumber(e).dividedBy(100);return d.Se.multiply(t,i).toNumber()},getProviderFee:(e,t=.0085)=>d.Se.bigNumber(e).multipliedBy(t).toString(),isInsufficientNetworkTokenForGas:(e,t)=>!!d.Se.bigNumber(e).isZero()||d.Se.bigNumber(d.Se.bigNumber(t||"0")).isGreaterThan(e),isInsufficientSourceTokenForSwap(e,t,i){let r=i?.find(e=>e.address===t)?.quantity?.numeric;return d.Se.bigNumber(r||"0").isLessThan(e)},getToTokenAmount({sourceToken:e,toToken:t,sourceTokenPrice:i,toTokenPrice:r,sourceTokenAmount:n}){if("0"===n||!e||!t)return"0";let a=e.decimals,o=t.decimals;if(r<=0)return"0";let s=d.Se.bigNumber(n).multipliedBy(.0085),c=d.Se.bigNumber(n).minus(s).multipliedBy(d.Se.bigNumber(10).pow(a)),l=d.Se.bigNumber(i).dividedBy(r),u=a-o;return c.multipliedBy(l).dividedBy(d.Se.bigNumber(10).pow(u)).dividedBy(d.Se.bigNumber(10).pow(o)).toFixed(o).toString()}};var w=i(38946),m=i(45011),b=i(75268),v=i(94984);let y={initializing:!1,initialized:!1,loadingPrices:!1,loadingQuote:!1,loadingApprovalTransaction:!1,loadingBuildTransaction:!1,loadingTransaction:!1,fetchError:!1,approvalTransaction:void 0,swapTransaction:void 0,transactionError:void 0,sourceToken:void 0,sourceTokenAmount:"",sourceTokenPriceInUSD:0,toToken:void 0,toTokenAmount:"",toTokenPriceInUSD:0,networkPrice:"0",networkBalanceInUSD:"0",networkTokenSymbol:"",inputError:void 0,slippage:o.oU.CONVERT_SLIPPAGE_TOLERANCE,tokens:void 0,popularTokens:void 0,suggestedTokens:void 0,foundTokens:void 0,myTokensWithBalance:void 0,tokensPriceMap:{},gasFee:"0",gasPriceInUSD:0,priceImpact:void 0,maxSlippage:void 0,providerFee:void 0},x=(0,n.BX)(y),C={state:x,subscribe:e=>(0,n.B1)(x,()=>e(x)),subscribeKey:(e,t)=>(0,r.u$)(x,e,t),getParams(){let e=v.W.state.activeCaipAddress,t=h.w.getPlainAddress(e),i=v.W.getActiveNetworkTokenAddress(),r=b.i.getConnectedConnector();if(!t)throw Error("No address found to swap the tokens from.");let n=!x.toToken?.address||!x.toToken?.decimals,a=!x.sourceToken?.address||!x.sourceToken?.decimals||!d.Se.bigNumber(x.sourceTokenAmount).isGreaterThan(0),o=!x.sourceTokenAmount;return{networkAddress:i,fromAddress:t,fromCaipAddress:e,sourceTokenAddress:x.sourceToken?.address,toTokenAddress:x.toToken?.address,toTokenAmount:x.toTokenAmount,toTokenDecimals:x.toToken?.decimals,sourceTokenAmount:x.sourceTokenAmount,sourceTokenDecimals:x.sourceToken?.decimals,invalidToToken:n,invalidSourceToken:a,invalidSourceTokenAmount:o,availableToSwap:e&&!n&&!a&&!o,isAuthConnector:"ID_AUTH"===r}},setSourceToken(e){if(!e){x.sourceToken=e,x.sourceTokenAmount="",x.sourceTokenPriceInUSD=0;return}x.sourceToken=e,this.setTokenPrice(e.address,"sourceToken")},setSourceTokenAmount(e){x.sourceTokenAmount=e},setToToken(e){if(!e){x.toToken=e,x.toTokenAmount="",x.toTokenPriceInUSD=0;return}x.toToken=e,this.setTokenPrice(e.address,"toToken")},setToTokenAmount(e){x.toTokenAmount=e?d.Se.formatNumberToLocalString(e,6):""},async setTokenPrice(e,t){let{availableToSwap:i}=this.getParams(),r=x.tokensPriceMap[e]||0;r||(x.loadingPrices=!0,r=await this.getAddressPrice(e)),"sourceToken"===t?x.sourceTokenPriceInUSD=r:"toToken"===t&&(x.toTokenPriceInUSD=r),x.loadingPrices&&(x.loadingPrices=!1,i&&this.swapTokens())},switchTokens(){if(x.initializing||!x.initialized)return;let e=x.toToken?{...x.toToken}:void 0,t=x.sourceToken?{...x.sourceToken}:void 0,i=e&&""===x.toTokenAmount?"1":x.toTokenAmount;this.setSourceToken(e),this.setToToken(t),this.setSourceTokenAmount(i),this.setToTokenAmount(""),this.swapTokens()},resetState(){x.myTokensWithBalance=y.myTokensWithBalance,x.tokensPriceMap=y.tokensPriceMap,x.initialized=y.initialized,x.sourceToken=y.sourceToken,x.sourceTokenAmount=y.sourceTokenAmount,x.sourceTokenPriceInUSD=y.sourceTokenPriceInUSD,x.toToken=y.toToken,x.toTokenAmount=y.toTokenAmount,x.toTokenPriceInUSD=y.toTokenPriceInUSD,x.networkPrice=y.networkPrice,x.networkTokenSymbol=y.networkTokenSymbol,x.networkBalanceInUSD=y.networkBalanceInUSD,x.inputError=y.inputError},resetValues(){let{networkAddress:e}=this.getParams(),t=x.tokens?.find(t=>t.address===e);this.setSourceToken(t),this.setToToken(void 0)},getApprovalLoadingState:()=>x.loadingApprovalTransaction,clearError(){x.transactionError=void 0},async initializeState(){if(!x.initializing){if(x.initializing=!0,!x.initialized)try{await this.fetchTokens(),x.initialized=!0}catch(e){x.initialized=!1,l.P.showError("Failed to initialize swap"),u.I.goBack()}x.initializing=!1}},async fetchTokens(){let{networkAddress:e}=this.getParams();await this.getTokenList(),await this.getNetworkTokenPrice(),await this.getMyTokensWithBalance();let t=x.tokens?.find(t=>t.address===e);t&&(x.networkTokenSymbol=t.symbol,this.setSourceToken(t),this.setSourceTokenAmount("1"))},async getTokenList(){let e=await c.s.getTokenList();x.tokens=e,x.popularTokens=e.sort((e,t)=>e.symbolt.symbol?1:0),x.suggestedTokens=e.filter(e=>!!o.oU.SWAP_SUGGESTED_TOKENS.includes(e.symbol),{})},async getAddressPrice(e){let t=x.tokensPriceMap[e];if(t)return t;let i=(await p.T.fetchTokenPrice({projectId:f.H.state.projectId,addresses:[e]})).fungibles||[],r=[...x.tokens||[],...x.myTokensWithBalance||[]],n=r?.find(t=>t.address===e)?.symbol,a=parseFloat((i.find(e=>e.symbol.toLowerCase()===n?.toLowerCase())?.price||0).toString());return x.tokensPriceMap[e]=a,a},async getNetworkTokenPrice(){let{networkAddress:e}=this.getParams(),t=await p.T.fetchTokenPrice({projectId:f.H.state.projectId,addresses:[e]}).catch(()=>(l.P.showError("Failed to fetch network token price"),{fungibles:[]})),i=t.fungibles?.[0],r=i?.price.toString()||"0";x.tokensPriceMap[e]=parseFloat(r),x.networkTokenSymbol=i?.symbol||"",x.networkPrice=r},async getMyTokensWithBalance(e){let t=await c.s.getMyTokensWithBalance(e);t&&(await this.getInitialGasPrice(),this.setBalances(t))},setBalances(e){let{networkAddress:t}=this.getParams(),i=v.W.state.activeCaipNetwork;if(!i)return;let r=e.find(e=>e.address===t);e.forEach(e=>{x.tokensPriceMap[e.address]=e.price||0}),x.myTokensWithBalance=e.filter(e=>e.address.startsWith(i.caipNetworkId)),x.networkBalanceInUSD=r?d.Se.multiply(r.quantity.numeric,r.price).toString():"0"},async getInitialGasPrice(){let e=await c.s.fetchGasPrice();if(!e)return{gasPrice:null,gasPriceInUSD:null};if(v.W.state?.activeCaipNetwork?.chainNamespace==="solana")return x.gasFee=e.standard??"0",x.gasPriceInUSD=d.Se.multiply(e.standard,x.networkPrice).dividedBy(1e9).toNumber(),{gasPrice:BigInt(x.gasFee),gasPriceInUSD:Number(x.gasPriceInUSD)};{let t=e.standard??"0",i=BigInt(t),r=BigInt(15e4),n=g.getGasPriceInUSD(x.networkPrice,r,i);return x.gasFee=t,x.gasPriceInUSD=n,{gasPrice:i,gasPriceInUSD:n}}},async swapTokens(){let e=a.U.state.address,t=x.sourceToken,i=x.toToken,r=d.Se.bigNumber(x.sourceTokenAmount).isGreaterThan(0);if(!i||!t||x.loadingPrices||!r)return;x.loadingQuote=!0;let n=d.Se.bigNumber(x.sourceTokenAmount).multipliedBy(10**t.decimals).integerValue(),o=await p.T.fetchSwapQuote({userAddress:e,projectId:f.H.state.projectId,from:t.address,to:i.address,gasPrice:x.gasFee,amount:n.toString()});x.loadingQuote=!1;let s=o?.quotes?.[0]?.toAmount;if(!s)return;let c=d.Se.bigNumber(s).dividedBy(10**i.decimals).toString();this.setToTokenAmount(c),this.hasInsufficientToken(x.sourceTokenAmount,t.address)?x.inputError="Insufficient balance":(x.inputError=void 0,this.setTransactionDetails())},async getTransaction(){let{fromCaipAddress:e,availableToSwap:t}=this.getParams(),i=x.sourceToken,r=x.toToken;if(e&&t&&i&&r&&!x.loadingQuote)try{let t;return x.loadingBuildTransaction=!0,t=await c.s.fetchSwapAllowance({userAddress:e,tokenAddress:i.address,sourceTokenAmount:x.sourceTokenAmount,sourceTokenDecimals:i.decimals})?await this.createSwapTransaction():await this.createAllowanceTransaction(),x.loadingBuildTransaction=!1,x.fetchError=!1,t}catch(e){u.I.goBack(),l.P.showError("Failed to check allowance"),x.loadingBuildTransaction=!1,x.approvalTransaction=void 0,x.swapTransaction=void 0,x.fetchError=!0;return}},async createAllowanceTransaction(){let{fromCaipAddress:e,fromAddress:t,sourceTokenAddress:i,toTokenAddress:r}=this.getParams();if(e&&r){if(!i)throw Error("createAllowanceTransaction - No source token address found.");try{let n=await p.T.generateApproveCalldata({projectId:f.H.state.projectId,from:i,to:r,userAddress:e}),a=await s.x.estimateGas({address:t,to:h.w.getPlainAddress(n.tx.to),data:n.tx.data}),o={data:n.tx.data,to:h.w.getPlainAddress(n.tx.from),gas:a,gasPrice:BigInt(n.tx.eip155.gasPrice),value:BigInt(n.tx.value),toAmount:x.toTokenAmount};return x.swapTransaction=void 0,x.approvalTransaction={data:o.data,to:o.to,gas:o.gas??BigInt(0),gasPrice:o.gasPrice,value:o.value,toAmount:o.toAmount},{data:o.data,to:o.to,gas:o.gas??BigInt(0),gasPrice:o.gasPrice,value:o.value,toAmount:o.toAmount}}catch(e){u.I.goBack(),l.P.showError("Failed to create approval transaction"),x.approvalTransaction=void 0,x.swapTransaction=void 0,x.fetchError=!0;return}}},async createSwapTransaction(){let{networkAddress:e,fromCaipAddress:t,sourceTokenAmount:i}=this.getParams(),r=x.sourceToken,n=x.toToken;if(!t||!i||!r||!n)return;let a=s.x.parseUnits(i,r.decimals)?.toString();try{let i=await p.T.generateSwapCalldata({projectId:f.H.state.projectId,userAddress:t,from:r.address,to:n.address,amount:a}),o=r.address===e,s=BigInt(i.tx.eip155.gas),c=BigInt(i.tx.eip155.gasPrice),l={data:i.tx.data,to:h.w.getPlainAddress(i.tx.to),gas:s,gasPrice:c,value:o?BigInt(a??"0"):BigInt("0"),toAmount:x.toTokenAmount};return x.gasPriceInUSD=g.getGasPriceInUSD(x.networkPrice,s,c),x.approvalTransaction=void 0,x.swapTransaction=l,l}catch(e){u.I.goBack(),l.P.showError("Failed to create transaction"),x.approvalTransaction=void 0,x.swapTransaction=void 0,x.fetchError=!0;return}},async sendTransactionForApproval(e){let{fromAddress:t,isAuthConnector:i}=this.getParams();x.loadingApprovalTransaction=!0;let r="Approve limit increase in your wallet";i?u.I.pushTransactionStack({view:null,goBack:!0,onSuccess(){l.P.showLoading(r)}}):l.P.showLoading(r);try{await s.x.sendTransaction({address:t,to:e.to,data:e.data,value:BigInt(e.value),gasPrice:BigInt(e.gasPrice),chainNamespace:"eip155"}),await this.swapTokens(),await this.getTransaction(),x.approvalTransaction=void 0,x.loadingApprovalTransaction=!1}catch(e){x.transactionError=e?.shortMessage,x.loadingApprovalTransaction=!1,l.P.showError(e?.shortMessage||"Transaction error")}},async sendTransactionForSwap(e){if(!e)return;let{fromAddress:t,toTokenAmount:i,isAuthConnector:r}=this.getParams();x.loadingTransaction=!0;let n=`Swapping ${x.sourceToken?.symbol} to ${d.Se.formatNumberToLocalString(i,3)} ${x.toToken?.symbol}`,o=`Swapped ${x.sourceToken?.symbol} to ${d.Se.formatNumberToLocalString(i,3)} ${x.toToken?.symbol}`;r?u.I.pushTransactionStack({view:"Account",goBack:!1,onSuccess(){l.P.showLoading(n),C.resetState()}}):l.P.showLoading("Confirm transaction in your wallet");try{let i=[x.sourceToken?.address,x.toToken?.address].join(","),n=await s.x.sendTransaction({address:t,to:e.to,data:e.data,gas:e.gas,gasPrice:BigInt(e.gasPrice),value:e.value,chainNamespace:"eip155"});return x.loadingTransaction=!1,l.P.showSuccess(o),w.E.sendEvent({type:"track",event:"SWAP_SUCCESS",properties:{network:v.W.state.activeCaipNetwork?.caipNetworkId||"",swapFromToken:this.state.sourceToken?.symbol||"",swapToToken:this.state.toToken?.symbol||"",swapFromAmount:this.state.sourceTokenAmount||"",swapToAmount:this.state.toTokenAmount||"",isSmartAccount:a.U.state.preferredAccountType===m.Vl.ACCOUNT_TYPES.SMART_ACCOUNT}}),C.resetState(),r||u.I.replace("Account"),C.getMyTokensWithBalance(i),n}catch(e){x.transactionError=e?.shortMessage,x.loadingTransaction=!1,l.P.showError(e?.shortMessage||"Transaction error"),w.E.sendEvent({type:"track",event:"SWAP_ERROR",properties:{message:e?.shortMessage||e?.message||"Unknown",network:v.W.state.activeCaipNetwork?.caipNetworkId||"",swapFromToken:this.state.sourceToken?.symbol||"",swapToToken:this.state.toToken?.symbol||"",swapFromAmount:this.state.sourceTokenAmount||"",swapToAmount:this.state.toTokenAmount||"",isSmartAccount:a.U.state.preferredAccountType===m.Vl.ACCOUNT_TYPES.SMART_ACCOUNT}});return}},hasInsufficientToken(e,t){let i=g.isInsufficientSourceTokenForSwap(e,t,x.myTokensWithBalance);return a.U.state.preferredAccountType!==m.Vl.ACCOUNT_TYPES.SMART_ACCOUNT&&g.isInsufficientNetworkTokenForGas(x.networkBalanceInUSD,x.gasPriceInUSD)||i},setTransactionDetails(){let{toTokenAddress:e,toTokenDecimals:t}=this.getParams();e&&t&&(x.gasPriceInUSD=g.getGasPriceInUSD(x.networkPrice,BigInt(x.gasFee),BigInt(15e4)),x.priceImpact=g.getPriceImpact({sourceTokenAmount:x.sourceTokenAmount,sourceTokenPriceInUSD:x.sourceTokenPriceInUSD,toTokenPriceInUSD:x.toTokenPriceInUSD,toTokenAmount:x.toTokenAmount}),x.maxSlippage=g.getMaxSlippage(x.slippage,x.toTokenAmount),x.providerFee=g.getProviderFee(x.sourceTokenAmount))}}},51668:(e,t,i)=>{"use strict";i.d(t,{W:()=>s});var r=i(2614),n=i(79950),a=i(50639);let o=(0,r.BX)({themeMode:"dark",themeVariables:{},w3mThemeVariables:void 0}),s={state:o,subscribe:e=>(0,r.B1)(o,()=>e(o)),setThemeMode(e){o.themeMode=e;try{let t=n.a.getAuthConnector();if(t){let i=s.getSnapshot().themeVariables;t.provider.syncTheme({themeMode:e,themeVariables:i,w3mThemeVariables:(0,a.o_)(i,e)})}}catch{console.info("Unable to sync theme to auth connector")}},setThemeVariables(e){o.themeVariables={...o.themeVariables,...e};try{let e=n.a.getAuthConnector();if(e){let t=s.getSnapshot().themeVariables;e.provider.syncTheme({themeVariables:t,w3mThemeVariables:(0,a.o_)(o.themeVariables,o.themeMode)})}}catch{console.info("Unable to sync theme to auth connector")}},getSnapshot:()=>(0,r.P9)(o)}},76990:(e,t,i)=>{"use strict";i.d(t,{W:()=>h});var r=i(2614),n=i(48131),a=i(38946),o=i(55035),s=i(65411),c=i(73322),l=i(45011),u=i(94984);let d=(0,r.BX)({transactions:[],coinbaseTransactions:{},transactionsByYear:{},lastNetworkInView:void 0,loading:!1,empty:!1,next:void 0}),h={state:d,subscribe:e=>(0,r.B1)(d,()=>e(d)),setLastNetworkInView(e){d.lastNetworkInView=e},async fetchTransactions(e,t){let{projectId:i}=n.H.state;if(!i||!e)throw Error("Transactions can't be fetched without a projectId and an accountAddress");d.loading=!0;try{let r=await s.T.fetchTransactions({account:e,projectId:i,cursor:d.next,onramp:t,cache:"coinbase"===t?"no-cache":void 0,chainId:u.W.state.activeCaipNetwork?.caipNetworkId}),n=this.filterSpamTransactions(r.data),a=this.filterByConnectedChain(n),o=[...d.transactions,...a];d.loading=!1,"coinbase"===t?d.coinbaseTransactions=this.groupTransactionsByYearAndMonth(d.coinbaseTransactions,r.data):(d.transactions=o,d.transactionsByYear=this.groupTransactionsByYearAndMonth(d.transactionsByYear,a)),d.empty=0===o.length,d.next=r.next?r.next:void 0}catch(t){a.E.sendEvent({type:"track",event:"ERROR_FETCH_TRANSACTIONS",properties:{address:e,projectId:i,cursor:d.next,isSmartAccount:c.U.state.preferredAccountType===l.Vl.ACCOUNT_TYPES.SMART_ACCOUNT}}),o.P.showError("Failed to fetch transactions"),d.loading=!1,d.empty=!0,d.next=void 0}},groupTransactionsByYearAndMonth:(e={},t=[])=>(t.forEach(t=>{let i=new Date(t.metadata.minedAt).getFullYear(),r=new Date(t.metadata.minedAt).getMonth(),n=e[i]??{},a=(n[r]??[]).filter(e=>e.id!==t.id);e[i]={...n,[r]:[...a,t].sort((e,t)=>new Date(t.metadata.minedAt).getTime()-new Date(e.metadata.minedAt).getTime())}}),e),filterSpamTransactions:e=>e.filter(e=>!e.transfers.every(e=>e.nft_info?.flags.is_spam===!0)),filterByConnectedChain(e){let t=u.W.state.activeCaipNetwork?.caipNetworkId;return e.filter(e=>e.metadata.chain===t)},clearCursor(){d.next=void 0},resetTransactions(){d.transactions=[],d.transactionsByYear={},d.lastNetworkInView=void 0,d.loading=!1,d.empty=!1,d.next=void 0}}},36192:(e,t,i)=>{"use strict";i.d(t,{oU:()=>o,pv:()=>a,tM:()=>n});let r="https://secure.walletconnect.org",n=[{label:"Coinbase",name:"coinbase",feeRange:"1-2%",url:"",supportedChains:["eip155"]},{label:"Meld.io",name:"meld",feeRange:"1-2%",url:"https://meldcrypto.com",supportedChains:["eip155","solana"]}],a="WXETMuFUQmqqybHuRkSgxv:25B8LJHSfpG6LVjR2ytU5Cwh7Z4Sch2ocoU",o={FOUR_MINUTES_MS:24e4,TEN_SEC_MS:1e4,FIVE_SEC_MS:5e3,THREE_SEC_MS:3e3,ONE_SEC_MS:1e3,SECURE_SITE:r,SECURE_SITE_DASHBOARD:`${r}/dashboard`,SECURE_SITE_FAVICON:`${r}/images/favicon.png`,RESTRICTED_TIMEZONES:["ASIA/SHANGHAI","ASIA/URUMQI","ASIA/CHONGQING","ASIA/HARBIN","ASIA/KASHGAR","ASIA/MACAU","ASIA/HONG_KONG","ASIA/MACAO","ASIA/BEIJING","ASIA/HARBIN"],WC_COINBASE_PAY_SDK_CHAINS:["ethereum","arbitrum","polygon","avalanche-c-chain","optimism","celo","base"],WC_COINBASE_PAY_SDK_FALLBACK_CHAIN:"ethereum",WC_COINBASE_PAY_SDK_CHAIN_NAME_MAP:{Ethereum:"ethereum","Arbitrum One":"arbitrum",Polygon:"polygon",Avalanche:"avalanche-c-chain","OP Mainnet":"optimism",Celo:"celo",Base:"base"},WC_COINBASE_ONRAMP_APP_ID:"bf18c88d-495a-463b-b249-0b9d3656cf5e",SWAP_SUGGESTED_TOKENS:["ETH","UNI","1INCH","AAVE","SOL","ADA","AVAX","DOT","LINK","NITRO","GAIA","MILK","TRX","NEAR","GNO","WBTC","DAI","WETH","USDC","USDT","ARB","BAL","BICO","CRV","ENS","MATIC","OP"],SWAP_POPULAR_TOKENS:["ETH","UNI","1INCH","AAVE","SOL","ADA","AVAX","DOT","LINK","NITRO","GAIA","MILK","TRX","NEAR","GNO","WBTC","DAI","WETH","USDC","USDT","ARB","BAL","BICO","CRV","ENS","MATIC","OP","METAL","DAI","CHAMP","WOLF","SALE","BAL","BUSD","MUST","BTCpx","ROUTE","HEX","WELT","amDAI","VSQ","VISION","AURUM","pSP","SNX","VC","LINK","CHP","amUSDT","SPHERE","FOX","GIDDY","GFC","OMEN","OX_OLD","DE","WNT"],SWAP_SUPPORTED_NETWORKS:["eip155:1","eip155:42161","eip155:10","eip155:324","eip155:8453","eip155:56","eip155:137","eip155:100","eip155:43114","eip155:250","eip155:8217","eip155:1313161554"],NAMES_SUPPORTED_CHAIN_NAMESPACES:["eip155"],NATIVE_TOKEN_ADDRESS:{eip155:"0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",solana:"So11111111111111111111111111111111111111111",polkadot:"0x",bip122:"0x"},CONVERT_SLIPPAGE_TOLERANCE:1,CONNECT_LABELS:{MOBILE:"Open and continue in a new browser tab"},DEFAULT_FEATURES:{swaps:!0,onramp:!0,email:!0,emailShowWallets:!0,socials:["google","x","discord","farcaster","github","apple","facebook"],history:!0,analytics:!0,allWallets:!0,legalCheckbox:!1,smartSessions:!1}}},12344:(e,t,i)=>{"use strict";i.d(t,{w:()=>a});var r=i(50639),n=i(36192);let a={isMobile:()=>"undefined"!=typeof window&&!!(window.matchMedia("(pointer:coarse)").matches||/Android|webOS|iPhone|iPad|iPod|BlackBerry|Opera Mini/u.test(navigator.userAgent)),checkCaipNetwork:(e,t="")=>e?.caipNetworkId.toLocaleLowerCase().includes(t.toLowerCase()),isAndroid(){let e=window.navigator.userAgent.toLowerCase();return a.isMobile()&&e.includes("android")},isIos(){let e=window.navigator.userAgent.toLowerCase();return a.isMobile()&&(e.includes("iphone")||e.includes("ipad"))},isClient:()=>"undefined"!=typeof window,isPairingExpired:e=>!e||e-Date.now()<=n.oU.TEN_SEC_MS,isAllowedRetry:(e,t=n.oU.ONE_SEC_MS)=>Date.now()-e>=t,copyToClopboard(e){navigator.clipboard.writeText(e)},getPairingExpiry:()=>Date.now()+n.oU.FOUR_MINUTES_MS,getNetworkId:e=>e?.split(":")[1],getPlainAddress:e=>e?.split(":")[2],wait:async e=>new Promise(t=>{setTimeout(t,e)}),debounce(e,t=500){let i;return(...r)=>{i&&clearTimeout(i),i=setTimeout(function(){e(...r)},t)}},isHttpUrl:e=>e.startsWith("http://")||e.startsWith("https://"),formatNativeUrl(e,t){if(a.isHttpUrl(e))return this.formatUniversalUrl(e,t);let i=e;i.includes("://")||(i=e.replaceAll("/","").replaceAll(":",""),i=`${i}://`),i.endsWith("/")||(i=`${i}/`),this.isTelegram()&&this.isAndroid()&&(t=encodeURIComponent(t));let r=encodeURIComponent(t);return{redirect:`${i}wc?uri=${r}`,href:i}},formatUniversalUrl(e,t){if(!a.isHttpUrl(e))return this.formatNativeUrl(e,t);let i=e;i.endsWith("/")||(i=`${i}/`);let r=encodeURIComponent(t);return{redirect:`${i}wc?uri=${r}`,href:i}},getOpenTargetForPlatform(e){return this.isTelegram()?"_blank":e},openHref(e,t,i){window.open(e,this.getOpenTargetForPlatform(t),i||"noreferrer noopener")},returnOpenHref(e,t,i){return window.open(e,this.getOpenTargetForPlatform(t),i||"noreferrer noopener")},isTelegram:()=>"undefined"!=typeof window&&(!!window.TelegramWebviewProxy||!!window.Telegram||!!window.TelegramWebviewProxyProto),preloadImage:async e=>Promise.race([new Promise((t,i)=>{let r=new Image;r.onload=t,r.onerror=i,r.crossOrigin="anonymous",r.src=e}),a.wait(2e3)]),formatBalance(e,t){let i="0.000";if("string"==typeof e){let t=Number(e);if(t){let e=Math.floor(1e3*t)/1e3;e&&(i=e.toString())}}return`${i}${t?` ${t}`:""}`},formatBalance2(e,t){let i;if("0"===e)i="0";else if("string"==typeof e){let t=Number(e);t&&(i=t.toString().match(/^-?\d+(?:\.\d{0,3})?/u)?.[0])}return{value:i??"0",rest:"0"===i?"000":"",symbol:t}},getApiUrl:()=>r.oU.W3M_API_URL,getBlockchainApiUrl:()=>r.oU.BLOCKCHAIN_API_RPC_URL,getAnalyticsUrl:()=>r.oU.PULSE_API_URL,getUUID:()=>crypto?.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/gu,e=>{let t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}),parseError:e=>"string"==typeof e?e:"string"==typeof e?.issues?.[0]?.message?e.issues[0].message:e instanceof Error?e.message:"Unknown error",sortRequestedNetworks(e,t=[]){let i={};return t&&e&&(e.forEach((e,t)=>{i[e]=t}),t.sort((e,t)=>{let r=i[e.id],n=i[t.id];return void 0!==r&&void 0!==n?r-n:void 0!==r?-1:void 0!==n?1:0})),t},calculateBalance(e){let t=0;for(let i of e)t+=i.value??0;return t},formatTokenBalance(e){let[t,i]=e.toFixed(2).split(".");return{dollars:t,pennies:i}},isAddress(e,t="eip155"){switch(t){case"eip155":if(/^(?:0x)?[0-9a-f]{40}$/iu.test(e)&&(/^(?:0x)?[0-9a-f]{40}$/iu.test(e)||/^(?:0x)?[0-9A-F]{40}$/iu.test(e)))return!0;return!1;case"solana":return/[1-9A-HJ-NP-Za-km-z]{32,44}$/iu.test(e);default:return!1}},uniqueBy(e,t){let i=new Set;return e.filter(e=>{let r=e[t];return!i.has(r)&&(i.add(r),!0)})},generateSdkVersion(e,t,i){let r=0===e.length?"universal":e.map(e=>e.adapterType).join(",");return`${t}-${r}-${i}`}}},85493:(e,t,i)=>{"use strict";async function r(...e){let t=await fetch(...e);if(!t.ok)throw Error(`HTTP status code: ${t.status}`,{cause:t});return t}i.d(t,{Z:()=>n});class n{constructor({baseUrl:e,clientId:t}){this.baseUrl=e,this.clientId=t}async get({headers:e,signal:t,cache:i,...n}){let a=this.createUrl(n);return(await r(a,{method:"GET",headers:e,signal:t,cache:i})).json()}async getBlob({headers:e,signal:t,...i}){let n=this.createUrl(i);return(await r(n,{method:"GET",headers:e,signal:t})).blob()}async post({body:e,headers:t,signal:i,...n}){let a=this.createUrl(n);return(await r(a,{method:"POST",headers:t,body:e?JSON.stringify(e):void 0,signal:i})).json()}async put({body:e,headers:t,signal:i,...n}){let a=this.createUrl(n);return(await r(a,{method:"PUT",headers:t,body:e?JSON.stringify(e):void 0,signal:i})).json()}async delete({body:e,headers:t,signal:i,...n}){let a=this.createUrl(n);return(await r(a,{method:"DELETE",headers:t,body:e?JSON.stringify(e):void 0,signal:i})).json()}createUrl({path:e,params:t}){let i=new URL(e,this.baseUrl);return t&&Object.entries(t).forEach(([e,t])=>{t&&i.searchParams.append(e,t)}),this.clientId&&i.searchParams.append("clientId",this.clientId),i}}},75268:(e,t,i)=>{"use strict";i.d(t,{i:()=>a});var r=i(50639),n=i(94984);let a={setWalletConnectDeepLink({name:e,href:t}){try{r.Ud.setItem(r.Ws.DEEPLINK_CHOICE,JSON.stringify({href:t,name:e}))}catch{console.info("Unable to set WalletConnect deep link")}},getWalletConnectDeepLink(){try{let e=r.Ud.getItem(r.Ws.DEEPLINK_CHOICE);if(e)return JSON.parse(e)}catch{console.info("Unable to get WalletConnect deep link")}},deleteWalletConnectDeepLink(){try{r.Ud.removeItem(r.Ws.DEEPLINK_CHOICE)}catch{console.info("Unable to delete WalletConnect deep link")}},setAppKitRecent(e){try{let t=a.getRecentWallets();t.find(t=>t.id===e.id)||(t.unshift(e),t.length>2&&t.pop(),r.Ud.setItem(r.Ws.RECENT_WALLETS,JSON.stringify(t)))}catch{console.info("Unable to set AppKit recent")}},getRecentWallets(){try{let e=r.Ud.getItem(r.Ws.RECENT_WALLETS);return e?JSON.parse(e):[]}catch{console.info("Unable to get AppKit recent")}return[]},setConnectedConnector(e){try{r.Ud.setItem(r.Ws.CONNECTED_CONNECTOR,e)}catch{console.info("Unable to set Connected Connector")}},setConnectedNamespace(e){try{r.Ud.setItem(r.Ws.CONNECTED_NAMESPACE,e)}catch{console.info("Unable to set Connected Namespace")}},getConnectedConnector(){try{return r.Ud.getItem(r.Ws.CONNECTED_CONNECTOR)}catch{console.info("Unable to get Connected Connector")}},setConnectedSocialProvider(e){try{r.Ud.setItem(r.Ws.CONNECTED_SOCIAL,e)}catch{console.info("Unable to set Connected Social Provider")}},getConnectedSocialProvider(){try{return r.Ud.getItem(r.Ws.CONNECTED_SOCIAL)}catch{console.info("Unable to get Connected Social Provider")}},getConnectedSocialUsername(){try{return r.Ud.getItem(r.Ws.CONNECTED_SOCIAL_USERNAME)}catch{console.info("Unable to get Connected Social Username")}},getStoredActiveCaipNetwork(){let e=r.Ud.getItem(r.Ws.ACTIVE_CAIP_NETWORK_ID),t=n.W.getAllRequestedCaipNetworks();return t?.find(t=>t.caipNetworkId===e)},setConnectionStatus(e){try{r.Ud.setItem(r.Ws.CONNECTION_STATUS,e)}catch{console.info("Unable to set Connection Status")}},getConnectionStatus(){try{return r.Ud.getItem(r.Ws.CONNECTION_STATUS)}catch{return}}}},9592:(e,t,i)=>{"use strict";i.d(t,{s:()=>c});var r=i(35335),n=i(65411),a=i(48131),o=i(73322),s=i(94984);let c={async getTokenList(){let e=s.W.state.activeCaipNetwork,t=await n.T.fetchSwapTokens({chainId:e?.caipNetworkId,projectId:a.H.state.projectId});return t?.tokens?.map(e=>({...e,eip2612:!1,quantity:{decimals:"0",numeric:"0"},price:0,value:0}))||[]},async fetchGasPrice(){let e=a.H.state.projectId,t=s.W.state.activeCaipNetwork;if(!t)return null;try{if("solana"===t.chainNamespace){let e=(await r.x?.estimateGas({chainNamespace:"solana"}))?.toString();return{standard:e,fast:e,instant:e}}return await n.T.fetchGasPrice({projectId:e,chainId:t.caipNetworkId})}catch{return null}},async fetchSwapAllowance({tokenAddress:e,userAddress:t,sourceTokenAmount:i,sourceTokenDecimals:o}){let s=a.H.state.projectId,c=await n.T.fetchSwapAllowance({projectId:s,tokenAddress:e,userAddress:t});if(c?.allowance&&i&&o){let e=r.x.parseUnits(i,o)||0;return BigInt(c.allowance)>=e}return!1},async getMyTokensWithBalance(e){let t=o.U.state.address,i=s.W.state.activeCaipNetwork;if(!t||!i)return[];let r=(await n.T.getBalance(t,i.caipNetworkId,e)).balances.filter(e=>"0"!==e.quantity.decimals);return o.U.setTokenBalance(r,s.W.state.activeChain),this.mapBalancesToSwapTokens(r)},mapBalancesToSwapTokens:e=>e?.map(e=>({...e,address:e?.address?e.address:s.W.getActiveNetworkTokenAddress(),decimals:parseInt(e.quantity.decimals,10),logoUri:e.iconUrl,eip2612:!1}))||[]}},15899:(e,t,i)=>{"use strict";var r=i(41562);"undefined"==typeof window||(window.Buffer||(window.Buffer=r.Buffer),window.global||(window.global=window),window.process||(window.process={}),window.process?.env||(window.process={env:{}}))},64810:(e,t,i)=>{"use strict";var r=i(57068),n=i(80196),a=i(16896),o=i(5419),s=i(92821),c=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o};class l extends a.WF{constructor(){super(),this.unsubscribe=[],this.disabled=!1,this.balance="show",this.charsStart=4,this.charsEnd=6,this.caipAddress=n.WB.state.activeCaipAddress,this.balanceVal=n.Uj.state.balance,this.balanceSymbol=n.Uj.state.balanceSymbol,this.profileName=n.Uj.state.profileName,this.profileImage=n.Uj.state.profileImage,this.network=n.WB.state.activeCaipNetwork,this.networkImage=n.$m.getNetworkImage(this.network),this.isSupported=!0,this.unsubscribe.push(n.jQ.subscribeNetworkImages(()=>{this.networkImage=n.$m.getNetworkImage(this.network)}),n.WB.subscribeKey("activeCaipAddress",e=>{this.caipAddress=e}),n.Uj.subscribeKey("balance",e=>this.balanceVal=e),n.Uj.subscribeKey("balanceSymbol",e=>this.balanceSymbol=e),n.Uj.subscribeKey("profileName",e=>this.profileName=e),n.Uj.subscribeKey("profileImage",e=>this.profileImage=e),n.WB.subscribeKey("activeCaipNetwork",e=>{this.network=e,this.networkImage=n.$m.getNetworkImage(e),this.isSupported=!e?.chainNamespace||n.WB.checkIfSupportedNetwork(e?.chainNamespace)}))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){if(!n.WB.state.activeChain)return null;let e="show"===this.balance;return(0,a.qy)` `}onClick(){this.isSupported?n.W3.open():n.W3.open({view:"UnsupportedChain"})}}c([(0,o.MZ)({type:Boolean})],l.prototype,"disabled",void 0),c([(0,o.MZ)()],l.prototype,"balance",void 0),c([(0,o.MZ)()],l.prototype,"charsStart",void 0),c([(0,o.MZ)()],l.prototype,"charsEnd",void 0),c([(0,o.wk)()],l.prototype,"caipAddress",void 0),c([(0,o.wk)()],l.prototype,"balanceVal",void 0),c([(0,o.wk)()],l.prototype,"balanceSymbol",void 0),c([(0,o.wk)()],l.prototype,"profileName",void 0),c([(0,o.wk)()],l.prototype,"profileImage",void 0),c([(0,o.wk)()],l.prototype,"network",void 0),c([(0,o.wk)()],l.prototype,"networkImage",void 0),c([(0,o.wk)()],l.prototype,"isSupported",void 0);let u=class extends l{};u=c([(0,r.customElement)("w3m-account-button")],u);let d=class extends l{};d=c([(0,r.customElement)("appkit-account-button")],d);let h=(0,a.AH)` :host { display: block; width: max-content; } `;var p=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o};class f extends a.WF{constructor(){super(...arguments),this.unsubscribe=[],this.disabled=!1,this.balance=void 0,this.size=void 0,this.label=void 0,this.loadingLabel=void 0,this.charsStart=4,this.charsEnd=6,this.caipAddress=n.WB.state.activeCaipAddress,this.isLoading=n.W3.state.loading}firstUpdated(){this.unsubscribe.push(n.WB.subscribeKey("activeCaipAddress",e=>this.caipAddress=e),n.W3.subscribeKey("loading",e=>this.isLoading=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return this.caipAddress&&!this.isLoading?(0,a.qy)` `:(0,a.qy)` `}}f.styles=h,p([(0,o.MZ)({type:Boolean})],f.prototype,"disabled",void 0),p([(0,o.MZ)()],f.prototype,"balance",void 0),p([(0,o.MZ)()],f.prototype,"size",void 0),p([(0,o.MZ)()],f.prototype,"label",void 0),p([(0,o.MZ)()],f.prototype,"loadingLabel",void 0),p([(0,o.MZ)()],f.prototype,"charsStart",void 0),p([(0,o.MZ)()],f.prototype,"charsEnd",void 0),p([(0,o.wk)()],f.prototype,"caipAddress",void 0),p([(0,o.wk)()],f.prototype,"isLoading",void 0);let g=class extends f{};g=p([(0,r.customElement)("w3m-button")],g);let w=class extends f{};w=p([(0,r.customElement)("appkit-button")],w);var m=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o};class b extends a.WF{constructor(){super(),this.unsubscribe=[],this.size="md",this.label="Connect Wallet",this.loadingLabel="Connecting...",this.open=n.W3.state.open,this.loading=n.W3.state.loading,this.unsubscribe.push(n.W3.subscribe(e=>{this.open=e.open,this.loading=e.loading}))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){let e=this.loading||this.open;return(0,a.qy)` ${e?this.loadingLabel:this.label} `}onClick(){this.open?n.W3.close():this.loading||n.W3.open()}}m([(0,o.MZ)()],b.prototype,"size",void 0),m([(0,o.MZ)()],b.prototype,"label",void 0),m([(0,o.MZ)()],b.prototype,"loadingLabel",void 0),m([(0,o.wk)()],b.prototype,"open",void 0),m([(0,o.wk)()],b.prototype,"loading",void 0);let v=class extends b{};v=m([(0,r.customElement)("w3m-connect-button")],v);let y=class extends b{};y=m([(0,r.customElement)("appkit-connect-button")],y);let x=(0,a.AH)` :host { display: block; width: max-content; } `;var C=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o};class A extends a.WF{constructor(){super(),this.unsubscribe=[],this.disabled=!1,this.network=n.WB.state.activeCaipNetwork,this.networkImage=n.$m.getNetworkImage(this.network),this.caipAddress=n.WB.state.activeCaipAddress,this.loading=n.W3.state.loading,this.isSupported=!0,this.unsubscribe.push(n.jQ.subscribeNetworkImages(()=>{this.networkImage=n.$m.getNetworkImage(this.network)}),n.WB.subscribeKey("activeCaipAddress",e=>{this.caipAddress=e}),n.WB.subscribeKey("activeCaipNetwork",e=>{this.network=e,this.networkImage=n.$m.getNetworkImage(e),this.isSupported=!e?.chainNamespace||n.WB.checkIfSupportedNetwork(e.chainNamespace)}),n.W3.subscribeKey("loading",e=>this.loading=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){let e=!this.network||n.WB.checkIfSupportedNetwork(this.network.chainNamespace);return(0,a.qy)` ${this.getLabel()} `}getLabel(){return this.network?this.isSupported?this.network.name:"Switch Network":this.label?this.label:this.caipAddress?"Unknown Network":"Select Network"}onClick(){this.loading||(n.En.sendEvent({type:"track",event:"CLICK_NETWORKS"}),n.W3.open({view:"Networks"}))}}A.styles=x,C([(0,o.MZ)({type:Boolean})],A.prototype,"disabled",void 0),C([(0,o.MZ)({type:String})],A.prototype,"label",void 0),C([(0,o.wk)()],A.prototype,"network",void 0),C([(0,o.wk)()],A.prototype,"networkImage",void 0),C([(0,o.wk)()],A.prototype,"caipAddress",void 0),C([(0,o.wk)()],A.prototype,"loading",void 0),C([(0,o.wk)()],A.prototype,"isSupported",void 0);let E=class extends A{};E=C([(0,r.customElement)("w3m-network-button")],E);let _=class extends A{};_=C([(0,r.customElement)("appkit-network-button")],_);let k=(0,a.AH)` :host { --prev-height: 0px; --new-height: 0px; display: block; } div.w3m-router-container { transform: translateY(0); opacity: 1; } div.w3m-router-container[view-direction='prev'] { animation: slide-left-out 150ms forwards ease, slide-left-in 150ms forwards ease; animation-delay: 0ms, 200ms; } div.w3m-router-container[view-direction='next'] { animation: slide-right-out 150ms forwards ease, slide-right-in 150ms forwards ease; animation-delay: 0ms, 200ms; } @keyframes slide-left-out { from { transform: translateX(0px); opacity: 1; } to { transform: translateX(10px); opacity: 0; } } @keyframes slide-left-in { from { transform: translateX(-10px); opacity: 0; } to { transform: translateX(0); opacity: 1; } } @keyframes slide-right-out { from { transform: translateX(0px); opacity: 1; } to { transform: translateX(-10px); opacity: 0; } } @keyframes slide-right-in { from { transform: translateX(10px); opacity: 0; } to { transform: translateX(0); opacity: 1; } } `,I={ACCOUNT_TABS:[{label:"Tokens"},{label:"NFTs"},{label:"Activity"}],SECURE_SITE_ORIGIN:i(18596).env.NEXT_PUBLIC_SECURE_SITE_ORIGIN||"https://secure.walletconnect.org",VIEW_DIRECTION:{Next:"next",Prev:"prev"},ANIMATION_DURATIONS:{HeaderText:120,ModalHeight:150,ViewTransition:150}};var S=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o};let T=class extends a.WF{constructor(){super(),this.resizeObserver=void 0,this.prevHeight="0px",this.prevHistoryLength=1,this.unsubscribe=[],this.view=n.IN.state.view,this.viewDirection="",this.unsubscribe.push(n.IN.subscribeKey("view",e=>this.onViewChange(e)))}firstUpdated(){this.resizeObserver=new ResizeObserver(([e])=>{let t=`${e?.contentRect.height}px`;"0px"!==this.prevHeight&&(this.style.setProperty("--prev-height",this.prevHeight),this.style.setProperty("--new-height",t),this.style.animation="w3m-view-height 150ms forwards ease",this.style.height="auto"),setTimeout(()=>{this.prevHeight=t,this.style.animation="unset"},I.ANIMATION_DURATIONS.ModalHeight)}),this.resizeObserver.observe(this.getWrapper())}disconnectedCallback(){this.resizeObserver?.unobserve(this.getWrapper()),this.unsubscribe.forEach(e=>e())}render(){return(0,a.qy)`
${this.viewTemplate()}
`}viewTemplate(){switch(this.view){case"AccountSettings":return(0,a.qy)``;case"Account":return(0,a.qy)``;case"AllWallets":return(0,a.qy)``;case"ApproveTransaction":return(0,a.qy)``;case"BuyInProgress":return(0,a.qy)``;case"ChooseAccountName":return(0,a.qy)``;case"Connect":default:return(0,a.qy)``;case"Create":return(0,a.qy)``;case"ConnectingWalletConnect":return(0,a.qy)``;case"ConnectingExternal":return(0,a.qy)``;case"ConnectingSiwe":return(0,a.qy)``;case"ConnectWallets":return(0,a.qy)``;case"ConnectSocials":return(0,a.qy)``;case"ConnectingSocial":return(0,a.qy)``;case"Downloads":return(0,a.qy)``;case"EmailVerifyOtp":return(0,a.qy)``;case"EmailVerifyDevice":return(0,a.qy)``;case"GetWallet":return(0,a.qy)``;case"Networks":return(0,a.qy)``;case"SwitchNetwork":return(0,a.qy)``;case"Profile":return(0,a.qy)``;case"SwitchAddress":return(0,a.qy)``;case"Transactions":return(0,a.qy)``;case"OnRampProviders":return(0,a.qy)``;case"OnRampActivity":return(0,a.qy)``;case"OnRampTokenSelect":return(0,a.qy)``;case"OnRampFiatSelect":return(0,a.qy)``;case"UpgradeEmailWallet":return(0,a.qy)``;case"UpgradeToSmartAccount":return(0,a.qy)``;case"UpdateEmailWallet":return(0,a.qy)``;case"UpdateEmailPrimaryOtp":return(0,a.qy)``;case"UpdateEmailSecondaryOtp":return(0,a.qy)``;case"UnsupportedChain":return(0,a.qy)``;case"Swap":return(0,a.qy)``;case"SwapSelectToken":return(0,a.qy)``;case"SwapPreview":return(0,a.qy)``;case"WalletSend":return(0,a.qy)``;case"WalletSendSelectToken":return(0,a.qy)``;case"WalletSendPreview":return(0,a.qy)``;case"WhatIsABuy":return(0,a.qy)``;case"WalletReceive":return(0,a.qy)``;case"WalletCompatibleNetworks":return(0,a.qy)``;case"WhatIsAWallet":return(0,a.qy)``;case"ConnectingMultiChain":return(0,a.qy)``;case"WhatIsANetwork":return(0,a.qy)``;case"ConnectingFarcaster":return(0,a.qy)``;case"SwitchActiveChain":return(0,a.qy)``;case"RegisterAccountName":return(0,a.qy)``;case"RegisterAccountNameSuccess":return(0,a.qy)``;case"SmartSessionCreated":return(0,a.qy)``;case"SmartSessionList":return(0,a.qy)``;case"SIWXSignMessage":return(0,a.qy)``}}onViewChange(e){n.Ib.hide();let t=I.VIEW_DIRECTION.Next,{history:i}=n.IN.state;i.length{this.view=e},I.ANIMATION_DURATIONS.ViewTransition)}getWrapper(){return this.shadowRoot?.querySelector("div")}};T.styles=k,S([(0,o.wk)()],T.prototype,"view",void 0),S([(0,o.wk)()],T.prototype,"viewDirection",void 0),T=S([(0,r.customElement)("w3m-router")],T);let N=(0,a.AH)` :host > wui-flex { width: 100%; max-width: 360px; } :host > wui-flex > wui-flex { border-radius: var(--wui-border-radius-l); width: 100%; } .amounts-container { width: 100%; } `;var P=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o};let R={USD:"$",EUR:"€",GBP:"\xa3"},O=[100,250,500,1e3],M=class extends a.WF{constructor(){super(),this.unsubscribe=[],this.disabled=!1,this.caipAddress=n.WB.state.activeCaipAddress,this.loading=n.W3.state.loading,this.paymentCurrency=n.aG.state.paymentCurrency,this.paymentAmount=n.aG.state.paymentAmount,this.purchaseAmount=n.aG.state.purchaseAmount,this.quoteLoading=n.aG.state.quotesLoading,this.unsubscribe.push(n.WB.subscribeKey("activeCaipAddress",e=>this.caipAddress=e),n.W3.subscribeKey("loading",e=>{this.loading=e}),n.aG.subscribe(e=>{this.paymentCurrency=e.paymentCurrency,this.paymentAmount=e.paymentAmount,this.purchaseAmount=e.purchaseAmount,this.quoteLoading=e.quotesLoading}))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return(0,a.qy)` ${O.map(e=>(0,a.qy)`this.selectPresetAmount(e)} >${`${R[this.paymentCurrency?.id||"USD"]} ${e}`}`)} ${this.templateButton()} `}templateButton(){return this.caipAddress?(0,a.qy)` Get quotes `:(0,a.qy)` Connect wallet `}getQuotes(){this.loading||n.W3.open({view:"OnRampProviders"})}openModal(){n.W3.open({view:"Connect"})}async onPaymentAmountChange(e){n.aG.setPaymentAmount(Number(e.detail)),await n.aG.getQuote()}async selectPresetAmount(e){n.aG.setPaymentAmount(e),await n.aG.getQuote()}};M.styles=N,P([(0,o.MZ)({type:Boolean})],M.prototype,"disabled",void 0),P([(0,o.wk)()],M.prototype,"caipAddress",void 0),P([(0,o.wk)()],M.prototype,"loading",void 0),P([(0,o.wk)()],M.prototype,"paymentCurrency",void 0),P([(0,o.wk)()],M.prototype,"paymentAmount",void 0),P([(0,o.wk)()],M.prototype,"purchaseAmount",void 0),P([(0,o.wk)()],M.prototype,"quoteLoading",void 0),M=P([(0,r.customElement)("w3m-onramp-widget")],M);var D=i(45011),U=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o};let $=class extends a.WF{constructor(){super(),this.usubscribe=[],this.networkImages=n.jQ.state.networkImages,this.address=n.Uj.state.address,this.profileImage=n.Uj.state.profileImage,this.profileName=n.Uj.state.profileName,this.network=n.WB.state.activeCaipNetwork,this.preferredAccountType=n.Uj.state.preferredAccountType,this.disconnecting=!1,this.loading=!1,this.switched=!1,this.text="",this.usubscribe.push(n.Uj.subscribe(e=>{e.address?(this.address=e.address,this.profileImage=e.profileImage,this.profileName=e.profileName,this.preferredAccountType=e.preferredAccountType):n.W3.close()}),n.Uj.subscribeKey("preferredAccountType",e=>this.preferredAccountType=e),n.WB.subscribeKey("activeCaipNetwork",e=>{e?.id&&(this.network=e)}))}disconnectedCallback(){this.usubscribe.forEach(e=>e())}render(){if(!this.address)throw Error("w3m-account-settings-view: No account provided");let e=this.networkImages[this.network?.assets?.imageId??""];return(0,a.qy)` ${r.UiHelperUtil.getTruncateString({string:this.address,charsStart:4,charsEnd:6,truncate:"middle"})} ${this.authCardTemplate()} ${this.network?.name??"Unknown"} ${this.togglePreferredAccountBtnTemplate()} ${this.chooseNameButtonTemplate()} Disconnect `}chooseNameButtonTemplate(){let e=n.iT.getConnectedConnector(),t=n.aK.getAuthConnector();return n.WB.checkIfNamesSupported()&&t&&"ID_AUTH"===e&&!this.profileName?(0,a.qy)` Choose account name `:null}authCardTemplate(){let e=n.iT.getConnectedConnector(),t=n.aK.getAuthConnector(),{origin:i}=location;return!t||"ID_AUTH"!==e||i.includes(n.oU.SECURE_SITE)?null:(0,a.qy)` `}isAllowedNetworkSwitch(){let e=n.WB.getAllRequestedCaipNetworks(),t=!!e&&e.length>1,i=e?.find(({id:e})=>e===this.network?.id);return t||!i}onCopyAddress(){try{this.address&&(n.wE.copyToClopboard(this.address),n.Pt.showSuccess("Address copied"))}catch{n.Pt.showError("Failed to copy")}}togglePreferredAccountBtnTemplate(){let e=n.WB.checkIfSmartAccountEnabled(),t=n.iT.getConnectedConnector();return n.aK.getAuthConnector()&&"ID_AUTH"===t&&e?(this.switched||(this.text=this.preferredAccountType===D.Vl.ACCOUNT_TYPES.SMART_ACCOUNT?"Switch to your EOA":"Switch to your smart account"),(0,a.qy)` ${this.text} `):null}onChooseName(){n.IN.push("ChooseAccountName")}async changePreferredAccountType(){let e=n.WB.checkIfSmartAccountEnabled(),t=this.preferredAccountType!==D.Vl.ACCOUNT_TYPES.SMART_ACCOUNT&&e?D.Vl.ACCOUNT_TYPES.SMART_ACCOUNT:D.Vl.ACCOUNT_TYPES.EOA;n.aK.getAuthConnector()&&(this.loading=!0,await n.x4.setPreferredAccountType(t),this.text=t===D.Vl.ACCOUNT_TYPES.SMART_ACCOUNT?"Switch to your EOA":"Switch to your smart account",this.switched=!0,n.Rv.resetSend(),this.loading=!1,this.requestUpdate())}onNetworks(){this.isAllowedNetworkSwitch()&&n.IN.push("Networks")}async onDisconnect(){try{this.disconnecting=!0,await n.x4.disconnect(),n.En.sendEvent({type:"track",event:"DISCONNECT_SUCCESS"}),n.W3.close()}catch{n.En.sendEvent({type:"track",event:"DISCONNECT_ERROR"}),n.Pt.showError("Failed to disconnect")}finally{this.disconnecting=!1}}onGoToUpgradeView(){n.En.sendEvent({type:"track",event:"EMAIL_UPGRADE_FROM_MODAL"}),n.IN.push("UpgradeEmailWallet")}};U([(0,o.wk)()],$.prototype,"address",void 0),U([(0,o.wk)()],$.prototype,"profileImage",void 0),U([(0,o.wk)()],$.prototype,"profileName",void 0),U([(0,o.wk)()],$.prototype,"network",void 0),U([(0,o.wk)()],$.prototype,"preferredAccountType",void 0),U([(0,o.wk)()],$.prototype,"disconnecting",void 0),U([(0,o.wk)()],$.prototype,"loading",void 0),U([(0,o.wk)()],$.prototype,"switched",void 0),U([(0,o.wk)()],$.prototype,"text",void 0),$=U([(0,r.customElement)("w3m-account-settings-view")],$);let L=class extends a.WF{render(){let e=n.iT.getConnectedConnector(),t=n.aK.getAuthConnector();return(0,a.qy)` ${t&&"ID_AUTH"===e?this.walletFeaturesTemplate():this.defaultTemplate()} `}walletFeaturesTemplate(){return(0,a.qy)``}defaultTemplate(){return(0,a.qy)``}};L=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o}([(0,r.customElement)("w3m-account-view")],L);var j=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o};let B=class extends a.WF{constructor(){super(...arguments),this.search="",this.onDebouncedSearch=n.wE.debounce(e=>{this.search=e})}render(){let e=this.search.length>=2;return(0,a.qy)` ${this.qrButtonTemplate()} ${e||this.badge?(0,a.qy)``:(0,a.qy)``} `}onInputChange(e){this.onDebouncedSearch(e.detail)}onClick(){if("certified"===this.badge){this.badge=void 0;return}this.badge="certified",n.Pt.showSvg("Only WalletConnect certified",{icon:"walletConnectBrown",iconColor:"accent-100"})}qrButtonTemplate(){return n.wE.isMobile()?(0,a.qy)` `:null}onWalletConnectQr(){n.IN.push("ConnectingWalletConnect")}};j([(0,o.wk)()],B.prototype,"search",void 0),j([(0,o.wk)()],B.prototype,"badge",void 0),B=j([(0,r.customElement)("w3m-all-wallets-view")],B);let W=(0,a.AH)` @keyframes shake { 0% { transform: translateX(0); } 25% { transform: translateX(3px); } 50% { transform: translateX(-3px); } 75% { transform: translateX(3px); } 100% { transform: translateX(0); } } wui-flex:first-child:not(:only-child) { position: relative; } wui-loading-thumbnail { position: absolute; } wui-visual { width: var(--wui-wallet-image-size-lg); height: var(--wui-wallet-image-size-lg); border-radius: calc(var(--wui-border-radius-5xs) * 9 - var(--wui-border-radius-xxs)); position: relative; overflow: hidden; } wui-visual::after { content: ''; display: block; width: 100%; height: 100%; position: absolute; inset: 0; border-radius: calc(var(--wui-border-radius-5xs) * 9 - var(--wui-border-radius-xxs)); box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-005); } wui-icon-box { position: absolute; right: calc(var(--wui-spacing-3xs) * -1); bottom: calc(var(--wui-spacing-3xs) * -1); opacity: 0; transform: scale(0.5); transition: opacity var(--wui-ease-out-power-2) var(--wui-duration-lg), transform var(--wui-ease-out-power-2) var(--wui-duration-lg); will-change: opacity, transform; } wui-text[align='center'] { width: 100%; padding: 0px var(--wui-spacing-l); } [data-error='true'] wui-icon-box { opacity: 1; transform: scale(1); } [data-error='true'] > wui-flex:first-child { animation: shake 250ms cubic-bezier(0.36, 0.07, 0.19, 0.97) both; } [data-retry='false'] wui-link { display: none; } [data-retry='true'] wui-link { display: block; opacity: 1; } wui-link { padding: var(--wui-spacing-4xs) var(--wui-spacing-xxs); } `;var q=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o};let H=class extends a.WF{constructor(){super(),this.unsubscribe=[],this.selectedOnRampProvider=n.aG.state.selectedProvider,this.uri=n.x4.state.wcUri,this.ready=!1,this.showRetry=!1,this.buffering=!1,this.error=!1,this.startTime=null,this.isMobile=!1,this.onRetry=void 0,this.unsubscribe.push(n.aG.subscribeKey("selectedProvider",e=>{this.selectedOnRampProvider=e})),this.watchTransactions()}disconnectedCallback(){this.intervalId&&clearInterval(this.intervalId)}render(){let e="Continue in external window";this.error?e="Buy failed":this.selectedOnRampProvider&&(e=`Buy in ${this.selectedOnRampProvider?.label}`);let t=this.error?"Buy can be declined from your side or due to and error on the provider app":`We’ll notify you once your Buy is processed`;return(0,a.qy)` ${this.error?null:this.loaderTemplate()} ${e} ${t} ${this.error?this.tryAgainTemplate():null} Copy link `}watchTransactions(){this.selectedOnRampProvider&&"coinbase"===this.selectedOnRampProvider.name&&(this.startTime=Date.now(),this.initializeCoinbaseTransactions())}async initializeCoinbaseTransactions(){await this.watchCoinbaseTransactions(),this.intervalId=setInterval(()=>this.watchCoinbaseTransactions(),4e3)}async watchCoinbaseTransactions(){try{let e=n.Uj.state.address,t=n.Hd.state.projectId;if(!e)throw Error("No address found");(await n.TP.fetchTransactions({account:e,onramp:"coinbase",projectId:t})).data.filter(e=>new Date(e.metadata.minedAt)>new Date(this.startTime)||"ONRAMP_TRANSACTION_STATUS_IN_PROGRESS"===e.metadata.status).length?(clearInterval(this.intervalId),n.IN.replace("OnRampActivity")):this.startTime&&Date.now()-this.startTime>=18e4&&(clearInterval(this.intervalId),this.error=!0)}catch(e){n.Pt.showError(e)}}onTryAgain(){this.selectedOnRampProvider&&(this.error=!1,n.wE.openHref(this.selectedOnRampProvider.url,"popupWindow","width=600,height=800,scrollbars=yes"))}tryAgainTemplate(){return this.selectedOnRampProvider?.url?(0,a.qy)` Try again `:null}loaderTemplate(){let e=n.Wn.state.themeVariables["--w3m-border-radius-master"],t=e?parseInt(e.replace("px",""),10):4;return(0,a.qy)``}onCopyUri(){if(!this.selectedOnRampProvider?.url){n.Pt.showError("No link found"),n.IN.goBack();return}try{n.wE.copyToClopboard(this.selectedOnRampProvider.url),n.Pt.showSuccess("Link copied")}catch{n.Pt.showError("Failed to copy")}}};H.styles=W,q([(0,o.wk)()],H.prototype,"intervalId",void 0),q([(0,o.wk)()],H.prototype,"selectedOnRampProvider",void 0),q([(0,o.wk)()],H.prototype,"uri",void 0),q([(0,o.wk)()],H.prototype,"ready",void 0),q([(0,o.wk)()],H.prototype,"showRetry",void 0),q([(0,o.wk)()],H.prototype,"buffering",void 0),q([(0,o.wk)()],H.prototype,"error",void 0),q([(0,o.wk)()],H.prototype,"startTime",void 0),q([(0,o.MZ)({type:Boolean})],H.prototype,"isMobile",void 0),q([(0,o.MZ)()],H.prototype,"onRetry",void 0),H=q([(0,r.customElement)("w3m-buy-in-progress-view")],H);let z=(0,a.AH)` :host { --connect-scroll--top-opacity: 0; --connect-scroll--bottom-opacity: 0; } .connect { max-height: clamp(360px, 470px, 80vh); scrollbar-width: none; overflow-y: scroll; overflow-x: hidden; transition: opacity var(--wui-ease-out-power-1) var(--wui-duration-md); will-change: opacity; mask-image: linear-gradient( to bottom, rgba(0, 0, 0, calc(1 - var(--connect-scroll--top-opacity))) 0px, rgba(200, 200, 200, calc(1 - var(--connect-scroll--top-opacity))) 1px, black 40px, black calc(100% - 40px), rgba(155, 155, 155, calc(1 - var(--connect-scroll--bottom-opacity))) calc(100% - 1px), rgba(0, 0, 0, calc(1 - var(--connect-scroll--bottom-opacity))) 100% ); } .guide { transition: opacity var(--wui-ease-out-power-1) var(--wui-duration-md); will-change: opacity; } .connect::-webkit-scrollbar { display: none; } .all-wallets { flex-flow: column; } .connect.disabled, .guide.disabled { opacity: 0.3; pointer-events: none; user-select: none; } `;var F=i(37857),Z=i(60037),V=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o};let K=class extends a.WF{constructor(){super(),this.unsubscribe=[],this.connectors=n.aK.state.connectors,this.authConnector=this.connectors.find(e=>"AUTH"===e.type),this.features=n.Hd.state.features,this.walletGuide="get-started",this.checked=!1,this.unsubscribe.push(n.aK.subscribeKey("connectors",e=>{this.connectors=e,this.authConnector=this.connectors.find(e=>"AUTH"===e.type)}),n.Hd.subscribeKey("features",e=>this.features=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e());let e=this.shadowRoot?.querySelector(".connect");e?.removeEventListener("scroll",this.handleConnectListScroll.bind(this))}firstUpdated(){let e=this.shadowRoot?.querySelector(".connect");requestAnimationFrame(this.handleConnectListScroll.bind(this)),e?.addEventListener("scroll",this.handleConnectListScroll.bind(this))}render(){let{termsConditionsUrl:e,privacyPolicyUrl:t}=n.Hd.state,i=n.Hd.state.features?.legalCheckbox,r=!!(e||t)&&!!i&&"get-started"===this.walletGuide&&!this.checked,o=this.features?.socials,c=n.Hd.state.enableWallets,l=o&&o.length||this.authConnector,u=r?-1:void 0;return(0,a.qy)` ${this.legalCheckboxTemplate()} ${this.walletListTemplate(u)} ${this.guideTemplate(r)} `}walletListTemplate(e){let t=this.features?.socials,i=this.features?.emailShowWallets;return n.Hd.state.enableWallets&&(n.wE.isTelegram()&&n.wE.isIos()&&n.x4.connectWalletConnect().catch(e=>({})),"explore"!==this.walletGuide)?this.authConnector&&t?this.authConnector&&i?(0,a.qy)` `:(0,a.qy)``:(0,a.qy)``:null}guideTemplate(e=!1){let t=this.features?.socials,i=n.Hd.state.enableWallets,r=t&&t.length,o={guide:!0,disabled:e};return(this.authConnector||r)&&i?"explore"===this.walletGuide?(0,a.qy)` `:(0,a.qy)` `:null}legalCheckboxTemplate(){return"explore"===this.walletGuide?null:(0,a.qy)``}handleConnectListScroll(){let e=this.shadowRoot?.querySelector(".connect");e&&!(e.scrollHeight<=470)&&(e.style.setProperty("--connect-scroll--top-opacity",r.MathUtil.interpolate([0,50],[0,1],e.scrollTop).toString()),e.style.setProperty("--connect-scroll--bottom-opacity",r.MathUtil.interpolate([0,50],[0,1],e.scrollHeight-e.scrollTop-e.offsetHeight).toString()))}onContinueWalletClick(){n.IN.push("ConnectWallets")}onCheckboxChange(e){this.checked=!!e.detail}};K.styles=z,V([(0,F.w)()],K.prototype,"connectors",void 0),V([(0,F.w)()],K.prototype,"authConnector",void 0),V([(0,F.w)()],K.prototype,"features",void 0),V([(0,o.MZ)()],K.prototype,"walletGuide",void 0),V([(0,F.w)()],K.prototype,"checked",void 0),K=V([(0,r.customElement)("w3m-connect-view")],K);var G=i(60402);let J=(0,a.AH)` @keyframes shake { 0% { transform: translateX(0); } 25% { transform: translateX(3px); } 50% { transform: translateX(-3px); } 75% { transform: translateX(3px); } 100% { transform: translateX(0); } } wui-flex:first-child:not(:only-child) { position: relative; } wui-loading-thumbnail { position: absolute; } wui-icon-box { position: absolute; right: calc(var(--wui-spacing-3xs) * -1); bottom: calc(var(--wui-spacing-3xs) * -1); opacity: 0; transform: scale(0.5); transition-property: opacity, transform; transition-duration: var(--wui-duration-lg); transition-timing-function: var(--wui-ease-out-power-2); will-change: opacity, transform; } wui-text[align='center'] { width: 100%; padding: 0px var(--wui-spacing-l); } [data-error='true'] wui-icon-box { opacity: 1; transform: scale(1); } [data-error='true'] > wui-flex:first-child { animation: shake 250ms cubic-bezier(0.36, 0.07, 0.19, 0.97) both; } [data-retry='false'] wui-link { display: none; } [data-retry='true'] wui-link { display: block; opacity: 1; } `;var Y=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o};class Q extends a.WF{constructor(){super(),this.wallet=n.IN.state.data?.wallet,this.connector=n.IN.state.data?.connector,this.timeout=void 0,this.secondaryBtnIcon="refresh",this.onConnect=void 0,this.onRender=void 0,this.onAutoConnect=void 0,this.isWalletConnect=!0,this.unsubscribe=[],this.imageSrc=n.$m.getWalletImage(this.wallet)??n.$m.getConnectorImage(this.connector),this.name=this.wallet?.name??this.connector?.name??"Wallet",this.isRetrying=!1,this.uri=n.x4.state.wcUri,this.error=n.x4.state.wcError,this.ready=!1,this.showRetry=!1,this.secondaryBtnLabel="Try again",this.secondaryLabel="Accept connection request in the wallet",this.buffering=!1,this.isMobile=!1,this.onRetry=void 0,this.unsubscribe.push(n.x4.subscribeKey("wcUri",e=>{this.uri=e,this.isRetrying&&this.onRetry&&(this.isRetrying=!1,this.onConnect?.())}),n.x4.subscribeKey("wcError",e=>this.error=e),n.x4.subscribeKey("buffering",e=>this.buffering=e)),n.wE.isTelegram()&&n.wE.isIos()&&n.x4.state.wcUri&&this.onConnect?.()}firstUpdated(){this.onAutoConnect?.(),this.showRetry=!this.onAutoConnect}disconnectedCallback(){this.unsubscribe.forEach(e=>e()),clearTimeout(this.timeout)}render(){this.onRender?.(),this.onShowRetry();let e=this.error?"Connection can be declined if a previous request is still active":this.secondaryLabel,t=`Continue in ${this.name}`;return this.buffering&&(t="Connecting..."),this.error&&(t="Connection declined"),(0,a.qy)` ${this.error?null:this.loaderTemplate()} ${t} ${e} ${this.secondaryBtnLabel?(0,a.qy)` ${this.secondaryBtnLabel} `:null} ${this.isWalletConnect?(0,a.qy)` Copy link `:null} `}onShowRetry(){if(this.error&&!this.showRetry){this.showRetry=!0;let e=this.shadowRoot?.querySelector("wui-button");e?.animate([{opacity:0},{opacity:1}],{fill:"forwards",easing:"ease"})}}onTryAgain(){this.buffering||(n.x4.setWcError(!1),this.onRetry?(this.isRetrying=!0,this.onRetry?.()):this.onConnect?.())}loaderTemplate(){let e=n.Wn.state.themeVariables["--w3m-border-radius-master"],t=e?parseInt(e.replace("px",""),10):4;return(0,a.qy)``}onCopyUri(){try{this.uri&&(n.wE.copyToClopboard(this.uri),n.Pt.showSuccess("Link copied"))}catch{n.Pt.showError("Failed to copy")}}}Q.styles=J,Y([(0,o.wk)()],Q.prototype,"isRetrying",void 0),Y([(0,o.wk)()],Q.prototype,"uri",void 0),Y([(0,o.wk)()],Q.prototype,"error",void 0),Y([(0,o.wk)()],Q.prototype,"ready",void 0),Y([(0,o.wk)()],Q.prototype,"showRetry",void 0),Y([(0,o.wk)()],Q.prototype,"secondaryBtnLabel",void 0),Y([(0,o.wk)()],Q.prototype,"secondaryLabel",void 0),Y([(0,o.wk)()],Q.prototype,"buffering",void 0),Y([(0,o.MZ)({type:Boolean})],Q.prototype,"isMobile",void 0),Y([(0,o.MZ)()],Q.prototype,"onRetry",void 0);let X=class extends Q{constructor(){if(super(),this.externalViewUnsubscribe=[],!this.connector)throw Error("w3m-connecting-view: No connector provided");n.En.sendEvent({type:"track",event:"SELECT_WALLET",properties:{name:this.connector.name??"Unknown",platform:"browser"}}),this.onConnect=this.onConnectProxy.bind(this),this.onAutoConnect=this.onConnectProxy.bind(this),this.isWalletConnect=!1,this.externalViewUnsubscribe.push(n.WB.subscribeKey("activeCaipAddress",e=>{e&&n.W3.close()}))}disconnectedCallback(){this.externalViewUnsubscribe.forEach(e=>e())}async onConnectProxy(){try{this.error=!1,this.connector&&(this.connector.id!==G.oU.COINBASE_SDK_CONNECTOR_ID||!this.error)&&(await n.x4.connectExternal(this.connector,this.connector.chain),n.En.sendEvent({type:"track",event:"CONNECT_SUCCESS",properties:{method:"browser",name:this.connector.name||"Unknown"}}))}catch(e){n.En.sendEvent({type:"track",event:"CONNECT_ERROR",properties:{message:e?.message??"Unknown"}}),this.error=!0}}};X=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o}([(0,r.customElement)("w3m-connecting-external-view")],X);let ee=(0,a.AH)` wui-flex, wui-list-wallet { width: 100%; } `;var et=i(50639),ei=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o};let er=class extends a.WF{constructor(){super(),this.unsubscribe=[],this.activeConnector=n.WB.state.activeConnector,this.unsubscribe.push(n.WB.subscribeKey("activeConnector",e=>this.activeConnector=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return(0,a.qy)` Select Chain for ${this.activeConnector?.name} Select which chain to connect to your multi chain wallet ${this.networksTemplate()} `}networksTemplate(){return this.activeConnector?.connectors?.map(e=>e.name?a.qy` this.onConnector(e)} > `:null)}onConnector(e){let t=this.activeConnector?.connectors?.find(t=>t.chain===e.chain);if(!t){n.Pt.showError("Failed to find connector");return}"walletConnect"===t.id?n.wE.isMobile()?n.IN.push("AllWallets"):n.IN.push("ConnectingWalletConnect"):n.IN.push("ConnectingExternal",{connector:t})}};er.styles=ee,ei([(0,o.wk)()],er.prototype,"activeConnector",void 0),er=ei([(0,r.customElement)("w3m-connecting-multi-chain-view")],er);var en=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o};let ea=class extends a.WF{constructor(){super(),this.interval=void 0,this.lastRetry=Date.now(),this.wallet=n.IN.state.data?.wallet,this.platform=void 0,this.platforms=[],this.isSiwxEnabled=!!n.Hd.state.siwx,this.determinePlatforms(),this.initializeConnection(),this.interval=setInterval(this.initializeConnection.bind(this),n.oU.TEN_SEC_MS)}disconnectedCallback(){clearTimeout(this.interval)}render(){return this.wallet?(0,a.qy)` ${this.headerTemplate()}
${this.platformTemplate()}
`:(0,a.qy)``}async initializeConnection(e=!1){if("browser"!==this.platform)try{let{wcPairingExpiry:t,status:i}=n.x4.state;(e||n.wE.isPairingExpired(t)||"connecting"===i)&&(await n.x4.connectWalletConnect(),this.finalizeConnection(),this.isSiwxEnabled||n.W3.close())}catch(e){n.En.sendEvent({type:"track",event:"CONNECT_ERROR",properties:{message:e?.message??"Unknown"}}),n.x4.setWcError(!0),n.wE.isAllowedRetry(this.lastRetry)?(n.Pt.showError(e.message??"Declined"),this.lastRetry=Date.now(),this.initializeConnection(!0)):n.Pt.showError(e.message??"Connection error")}}finalizeConnection(){let{wcLinking:e,recentWallet:t}=n.x4.state;e&&n.iT.setWalletConnectDeepLink(e),t&&n.iT.setAppKitRecent(t),n.En.sendEvent({type:"track",event:"CONNECT_SUCCESS",properties:{method:e?"mobile":"qrcode",name:this.wallet?.name||"Unknown"}})}determinePlatforms(){if(!this.wallet){this.platforms.push("qrcode"),this.platform="qrcode";return}if(this.platform)return;let{mobile_link:e,desktop_link:t,webapp_link:i,injected:r,rdns:a,name:o}=this.wallet,s=r?.map(({injected_id:e})=>e).filter(Boolean),c=[...a?[a]:s??[],o],l=!n.Hd.state.isUniversalProvider&&c.length,u=n.x4.checkInstalled(c),d=l&&u,h=t&&!n.wE.isMobile();d&&this.platforms.push("browser"),e&&this.platforms.push(n.wE.isMobile()?"mobile":"qrcode"),i&&this.platforms.push("web"),h&&this.platforms.push("desktop"),!d&&l&&this.platforms.push("unsupported"),this.platform=this.platforms[0]}platformTemplate(){switch(this.platform){case"browser":return(0,a.qy)``;case"web":return(0,a.qy)``;case"desktop":return(0,a.qy)` this.initializeConnection(!0)}> `;case"mobile":return(0,a.qy)` this.initializeConnection(!0)}> `;case"qrcode":return(0,a.qy)``;default:return(0,a.qy)``}}headerTemplate(){return this.platforms.length>1?(0,a.qy)` `:null}async onSelectPlatform(e){let t=this.shadowRoot?.querySelector("div");t&&(await t.animate([{opacity:1},{opacity:0}],{duration:200,fill:"forwards",easing:"ease"}).finished,this.platform=e,t.animate([{opacity:0},{opacity:1}],{duration:200,fill:"forwards",easing:"ease"}))}};en([(0,o.wk)()],ea.prototype,"platform",void 0),en([(0,o.wk)()],ea.prototype,"platforms",void 0),en([(0,o.wk)()],ea.prototype,"isSiwxEnabled",void 0),ea=en([(0,r.customElement)("w3m-connecting-wc-view")],ea);let eo=(0,a.AH)` .continue-button-container { width: 100%; } `;var es=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o};let ec=class extends a.WF{constructor(){super(...arguments),this.loading=!1}render(){return(0,a.qy)` ${this.onboardingTemplate()} ${this.buttonsTemplate()} {n.wE.openHref(et.TC.URLS.FAQ,"_blank")}} > Learn more about names `}onboardingTemplate(){return(0,a.qy)` Choose your account name Finally say goodbye to 0x addresses, name your account to make it easier to exchange assets `}buttonsTemplate(){return(0,a.qy)` Choose name `}handleContinue(){n.IN.push("RegisterAccountName"),n.En.sendEvent({type:"track",event:"OPEN_ENS_FLOW",properties:{isSmartAccount:n.Uj.state.preferredAccountType===D.Vl.ACCOUNT_TYPES.SMART_ACCOUNT}})}};ec.styles=eo,es([(0,o.wk)()],ec.prototype,"loading",void 0),ec=es([(0,r.customElement)("w3m-choose-account-name-view")],ec);let el=class extends a.WF{constructor(){super(...arguments),this.wallet=n.IN.state.data?.wallet}render(){if(!this.wallet)throw Error("w3m-downloads-view");return(0,a.qy)` ${this.chromeTemplate()} ${this.iosTemplate()} ${this.androidTemplate()} ${this.homepageTemplate()} `}chromeTemplate(){return this.wallet?.chrome_store?(0,a.qy)` Chrome Extension `:null}iosTemplate(){return this.wallet?.app_store?(0,a.qy)` iOS App `:null}androidTemplate(){return this.wallet?.play_store?(0,a.qy)` Android App `:null}homepageTemplate(){return this.wallet?.homepage?(0,a.qy)` Website `:null}onChromeStore(){this.wallet?.chrome_store&&n.wE.openHref(this.wallet.chrome_store,"_blank")}onAppStore(){this.wallet?.app_store&&n.wE.openHref(this.wallet.app_store,"_blank")}onPlayStore(){this.wallet?.play_store&&n.wE.openHref(this.wallet.play_store,"_blank")}onHomePage(){this.wallet?.homepage&&n.wE.openHref(this.wallet.homepage,"_blank")}};el=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o}([(0,r.customElement)("w3m-downloads-view")],el);let eu=class extends a.WF{render(){return(0,a.qy)` ${this.recommendedWalletsTemplate()} {n.wE.openHref("https://walletconnect.com/explorer?type=wallet","_blank")}} > `}recommendedWalletsTemplate(){let{recommended:e,featured:t}=n.Np.state,{customWallets:i}=n.Hd.state;return[...t,...i??[],...e].slice(0,4).map(e=>(0,a.qy)` {n.wE.openHref(e.homepage??"https://walletconnect.com/explorer","_blank")}} > `)}};eu=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o}([(0,r.customElement)("w3m-get-wallet-view")],eu);let ed=(0,a.AH)` wui-flex { width: 100%; } .suggestion { background: var(--wui-color-gray-glass-002); border-radius: var(--wui-border-radius-xs); } .suggestion:hover { background-color: var(--wui-color-gray-glass-005); cursor: pointer; } .suggested-name { max-width: 75%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } form { width: 100%; } wui-icon-link { position: absolute; right: 20px; transform: translateY(11px); } `;var eh=i(87580),ep=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o};let ef=class extends a.WF{constructor(){super(),this.formRef=(0,eh._)(),this.usubscribe=[],this.name="",this.error="",this.loading=n.f.state.loading,this.suggestions=n.f.state.suggestions,this.registered=!1,this.profileName=n.Uj.state.profileName,this.onDebouncedNameInputChange=n.wE.debounce(e=>{n.f.validateName(e)?(this.error="",this.name=e,n.f.getSuggestions(e),n.f.isNameRegistered(e).then(e=>{this.registered=e})):e.length<4?this.error="Name must be at least 4 characters long":this.error="Can only contain letters, numbers and - characters"}),this.usubscribe.push(n.f.subscribe(e=>{this.suggestions=e.suggestions,this.loading=e.loading}),n.Uj.subscribeKey("profileName",e=>{this.profileName=e,e&&(this.error="You already own a name")}))}firstUpdated(){this.formRef.value?.addEventListener("keydown",this.onEnterKey.bind(this))}disconnectedCallback(){super.disconnectedCallback(),this.usubscribe.forEach(e=>e()),this.formRef.value?.removeEventListener("keydown",this.onEnterKey.bind(this))}render(){return(0,a.qy)`
${this.submitButtonTemplate()}
${this.templateSuggestions()}
`}submitButtonTemplate(){return this.isAllowedToSubmit()?(0,a.qy)` `:null}onSelectSuggestion(e){return()=>{this.name=e,this.registered=!1,this.requestUpdate()}}onNameInputChange(e){this.onDebouncedNameInputChange(e.detail)}nameSuggestionTagTemplate(){return this.loading?(0,a.qy)``:this.registered?(0,a.qy)`Registered`:(0,a.qy)`Available`}templateSuggestions(){if(!this.name||this.name.length<4||this.error)return null;let e=this.registered?this.suggestions.filter(e=>e.name!==this.name):[];return(0,a.qy)` ${this.name}${this.nameSuggestionTagTemplate()} ${e.map(e=>this.availableNameTemplate(e.name))} `}availableNameTemplate(e){return(0,a.qy)` ${e} Available `}isAllowedToSubmit(){return!this.loading&&!this.registered&&!this.error&&!this.profileName&&n.f.validateName(this.name)}async onSubmitName(){try{if(!this.isAllowedToSubmit())return;let e=`${this.name}${et.oU.WC_NAME_SUFFIX}`;n.En.sendEvent({type:"track",event:"REGISTER_NAME_INITIATED",properties:{isSmartAccount:n.Uj.state.preferredAccountType===D.Vl.ACCOUNT_TYPES.SMART_ACCOUNT,ensName:e}}),await n.f.registerName(e),n.En.sendEvent({type:"track",event:"REGISTER_NAME_SUCCESS",properties:{isSmartAccount:n.Uj.state.preferredAccountType===D.Vl.ACCOUNT_TYPES.SMART_ACCOUNT,ensName:e}})}catch(e){n.Pt.showError(e.message),n.En.sendEvent({type:"track",event:"REGISTER_NAME_ERROR",properties:{isSmartAccount:n.Uj.state.preferredAccountType===D.Vl.ACCOUNT_TYPES.SMART_ACCOUNT,ensName:`${this.name}${et.oU.WC_NAME_SUFFIX}`,error:e?.message||"Unknown error"}})}}onEnterKey(e){"Enter"===e.key&&this.isAllowedToSubmit()&&this.onSubmitName()}};ef.styles=ed,ep([(0,o.MZ)()],ef.prototype,"errorMessage",void 0),ep([(0,o.wk)()],ef.prototype,"name",void 0),ep([(0,o.wk)()],ef.prototype,"error",void 0),ep([(0,o.wk)()],ef.prototype,"loading",void 0),ep([(0,o.wk)()],ef.prototype,"suggestions",void 0),ep([(0,o.wk)()],ef.prototype,"registered",void 0),ep([(0,o.wk)()],ef.prototype,"profileName",void 0),ef=ep([(0,r.customElement)("w3m-register-account-name-view")],ef);let eg=(0,a.AH)` .continue-button-container { width: 100%; } `,ew=class extends a.WF{render(){return(0,a.qy)` ${this.onboardingTemplate()} ${this.buttonsTemplate()} {n.wE.openHref(et.TC.URLS.FAQ,"_blank")}} > Learn more `}onboardingTemplate(){return(0,a.qy)` Account name chosen successfully You can now fund your account and trade crypto `}buttonsTemplate(){return(0,a.qy)` Let's Go! `}redirectToAccount(){n.IN.replace("Account")}};ew.styles=eg,ew=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o}([(0,r.customElement)("w3m-register-account-name-success-view")],ew);let em=(0,a.AH)` @keyframes shake { 0% { transform: translateX(0); } 25% { transform: translateX(3px); } 50% { transform: translateX(-3px); } 75% { transform: translateX(3px); } 100% { transform: translateX(0); } } wui-flex:first-child:not(:only-child) { position: relative; } wui-loading-hexagon { position: absolute; } wui-icon-box { position: absolute; right: 4px; bottom: 0; opacity: 0; transform: scale(0.5); z-index: 1; } wui-button { display: none; } [data-error='true'] wui-icon-box { opacity: 1; transform: scale(1); } [data-error='true'] > wui-flex:first-child { animation: shake 250ms cubic-bezier(0.36, 0.07, 0.19, 0.97) both; } wui-button[data-retry='true'] { display: block; opacity: 1; } `;var eb=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o};let ev=class extends a.WF{constructor(){super(),this.network=n.IN.state.data?.network,this.unsubscribe=[],this.showRetry=!1,this.error=!1}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}firstUpdated(){this.onSwitchNetwork()}render(){if(!this.network)throw Error("w3m-network-switch-view: No network provided");this.onShowRetry();let e=this.getLabel(),t=this.getSubLabel();return(0,a.qy)` ${this.error?null:(0,a.qy)``} ${e} ${t} Try again `}getSubLabel(){let e=n.iT.getConnectedConnector();return n.aK.getAuthConnector()&&"AUTH"===e?"":this.error?"Switch can be declined if chain is not supported by a wallet or previous request is still active":"Accept connection request in your wallet"}getLabel(){let e=n.iT.getConnectedConnector();return n.aK.getAuthConnector()&&"AUTH"===e?`Switching to ${this.network?.name??"Unknown"} network...`:this.error?"Switch declined":"Approve in wallet"}onShowRetry(){if(this.error&&!this.showRetry){this.showRetry=!0;let e=this.shadowRoot?.querySelector("wui-button");e?.animate([{opacity:0},{opacity:1}],{fill:"forwards",easing:"ease"})}}async onSwitchNetwork(){try{this.error=!1,this.network&&await n.WB.switchActiveNetwork(this.network)}catch(e){this.error=!0}}};ev.styles=em,eb([(0,o.wk)()],ev.prototype,"showRetry",void 0),eb([(0,o.wk)()],ev.prototype,"error",void 0),ev=eb([(0,r.customElement)("w3m-network-switch-view")],ev);let ey=(0,a.AH)` .container { max-height: 360px; overflow: auto; } .container::-webkit-scrollbar { display: none; } `;var ex=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o};let eC=class extends a.WF{constructor(){super(),this.unsubscribe=[],this.network=n.WB.state.activeCaipNetwork,this.requestedCaipNetworks=n.WB.getAllRequestedCaipNetworks(),this.search="",this.onDebouncedSearch=n.wE.debounce(e=>{this.search=e},100),this.unsubscribe.push(n.WB.subscribeKey("activeCaipNetwork",e=>this.network=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return(0,a.qy)` ${this.templateSearchInput()} ${this.networksTemplate()} Your connected wallet may not support some of the networks available for this dApp What is a network `}templateSearchInput(){return(0,a.qy)` `}onInputChange(e){this.onDebouncedSearch(e.detail)}onNetworkHelp(){n.En.sendEvent({type:"track",event:"CLICK_NETWORK_HELP"}),n.IN.push("WhatIsANetwork")}networksTemplate(){let e=n.WB.getAllRequestedCaipNetworks(),t=n.WB.getAllApprovedCaipNetworkIds(),i=n.wE.sortRequestedNetworks(t,e);return this.search?this.filteredNetworks=i?.filter(e=>e?.name?.toLowerCase().includes(this.search.toLowerCase())):this.filteredNetworks=i,this.filteredNetworks?.map(e=>a.qy` this.onSwitchNetwork(e)} .disabled=${this.getNetworkDisabled(e)} data-testid=${`w3m-network-switch-${e.name??e.id}`} > `)}getNetworkDisabled(e){let t=e.chainNamespace,i=n.Uj.getCaipAddress(t),r=n.WB.getAllApprovedCaipNetworkIds(),a=!1!==n.WB.getNetworkProp("supportsAllNetworks",t),o=n.iT.getConnectedConnector(),s=n.aK.getAuthConnector();return!!i&&!a&&("ID_AUTH"!==o||!s)&&!r?.includes(e.caipNetworkId)}onSwitchNetwork(e){let t=n.IN.state.data;if(e.id===this.network?.id)return;let i=e.chainNamespace!==n.WB.state.activeChain,r=n.WB.getAccountProp("caipAddress",e.chainNamespace),a=n.Uj.state.caipAddress,o="ID_AUTH"===n.iT.getConnectedConnector();i&&a&&!r&&!o?n.IN.push("SwitchActiveChain",{switchToChain:e.chainNamespace,navigateTo:"Connect",navigateWithReplace:!0,network:e}):n.IN.push("SwitchNetwork",{...t,network:e})}};eC.styles=ey,ex([(0,o.wk)()],eC.prototype,"network",void 0),ex([(0,o.wk)()],eC.prototype,"requestedCaipNetworks",void 0),ex([(0,o.wk)()],eC.prototype,"filteredNetworks",void 0),ex([(0,o.wk)()],eC.prototype,"search",void 0),eC=ex([(0,r.customElement)("w3m-networks-view")],eC);let eA=(0,a.AH)` :host > wui-flex { height: 500px; overflow-y: auto; overflow-x: hidden; scrollbar-width: none; padding: var(--wui-spacing-m); box-sizing: border-box; display: flex; align-items: center; justify-content: flex-start; } :host > wui-flex::-webkit-scrollbar { display: none; } :host > wui-flex > wui-flex { width: 100%; } wui-transaction-list-item-loader { width: 100%; } `;var eE=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o};let e_=class extends a.WF{constructor(){super(),this.unsubscribe=[],this.selectedOnRampProvider=n.aG.state.selectedProvider,this.loading=!1,this.coinbaseTransactions=n.WC.state.coinbaseTransactions,this.tokenImages=n.jQ.state.tokenImages,this.unsubscribe.push(n.aG.subscribeKey("selectedProvider",e=>{this.selectedOnRampProvider=e}),n.jQ.subscribeKey("tokenImages",e=>this.tokenImages=e),()=>{clearTimeout(this.refetchTimeout)},n.WC.subscribe(e=>{this.coinbaseTransactions={...e.coinbaseTransactions}})),n.WC.clearCursor(),this.fetchTransactions()}render(){return(0,a.qy)` ${this.loading?this.templateLoading():this.templateTransactionsByYear()} `}templateTransactions(e){return e?.map(e=>{let t=et.rL.formatDate(e?.metadata?.minedAt),i=e.transfers[0],r=i?.fungible_info;if(!r)return null;let n=r?.icon?.url||this.tokenImages?.[r.symbol||""];return a.qy` `})}templateTransactionsByYear(){return Object.keys(this.coinbaseTransactions).sort().reverse().map(e=>{let t=parseInt(e,10);return Array(12).fill(null).map((e,t)=>t).reverse().map(e=>{let i=r.TransactionUtil.getTransactionGroupTitle(t,e),n=this.coinbaseTransactions[t]?.[e];return n?(0,a.qy)` ${i} ${this.templateTransactions(n)} `:null})})}async fetchTransactions(){await this.fetchCoinbaseTransactions()}async fetchCoinbaseTransactions(){let e=n.Uj.state.address,t=n.Hd.state.projectId;if(!e)throw Error("No address found");if(!t)throw Error("No projectId found");this.loading=!0,await n.WC.fetchTransactions(e,"coinbase"),this.loading=!1,this.refetchLoadingTransactions()}refetchLoadingTransactions(){let e=new Date;if(0===(this.coinbaseTransactions[e.getFullYear()]?.[e.getMonth()]||[]).filter(e=>"ONRAMP_TRANSACTION_STATUS_IN_PROGRESS"===e.metadata.status).length){clearTimeout(this.refetchTimeout);return}this.refetchTimeout=setTimeout(async()=>{let e=n.Uj.state.address;await n.WC.fetchTransactions(e,"coinbase"),this.refetchLoadingTransactions()},3e3)}templateLoading(){return Array(7).fill((0,a.qy)` `).map(e=>e)}};e_.styles=eA,eE([(0,o.wk)()],e_.prototype,"selectedOnRampProvider",void 0),eE([(0,o.wk)()],e_.prototype,"loading",void 0),eE([(0,o.wk)()],e_.prototype,"coinbaseTransactions",void 0),eE([(0,o.wk)()],e_.prototype,"tokenImages",void 0),e_=eE([(0,r.customElement)("w3m-onramp-activity-view")],e_);let ek=(0,a.AH)` :host > wui-grid { max-height: 360px; overflow: auto; } wui-flex { transition: opacity var(--wui-ease-out-power-1) var(--wui-duration-md); will-change: opacity; } wui-grid::-webkit-scrollbar { display: none; } wui-flex.disabled { opacity: 0.3; pointer-events: none; user-select: none; } `;var eI=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o};let eS=class extends a.WF{constructor(){super(),this.unsubscribe=[],this.selectedCurrency=n.aG.state.paymentCurrency,this.currencies=n.aG.state.paymentCurrencies,this.currencyImages=n.jQ.state.currencyImages,this.checked=!1,this.unsubscribe.push(n.aG.subscribe(e=>{this.selectedCurrency=e.paymentCurrency,this.currencies=e.paymentCurrencies}),n.jQ.subscribeKey("currencyImages",e=>this.currencyImages=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){let{termsConditionsUrl:e,privacyPolicyUrl:t}=n.Hd.state,i=n.Hd.state.features?.legalCheckbox,r=!!(e||t)&&!!i&&!this.checked;return(0,a.qy)` ${this.currenciesTemplate(r)} `}currenciesTemplate(e=!1){return this.currencies.map(t=>(0,a.qy)` this.selectCurrency(t)} variant="image" tabIdx=${(0,s.J)(e?-1:void 0)} > ${t.id} `)}selectCurrency(e){e&&(n.aG.setPaymentCurrency(e),n.W3.close())}onCheckboxChange(e){this.checked=!!e.detail}};eS.styles=ek,eI([(0,o.wk)()],eS.prototype,"selectedCurrency",void 0),eI([(0,o.wk)()],eS.prototype,"currencies",void 0),eI([(0,o.wk)()],eS.prototype,"currencyImages",void 0),eI([(0,o.wk)()],eS.prototype,"checked",void 0),eS=eI([(0,r.customElement)("w3m-onramp-fiat-select-view")],eS);var eT=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o};let eN=class extends a.WF{constructor(){super(),this.unsubscribe=[],this.providers=n.aG.state.providers,this.unsubscribe.push(n.aG.subscribeKey("providers",e=>{this.providers=e}))}firstUpdated(){Promise.all(this.providers.map(async e=>"coinbase"===e.name?await this.getCoinbaseOnRampURL():Promise.resolve(e?.url))).then(e=>{this.providers=this.providers.map((t,i)=>({...t,url:e[i]||""}))})}render(){return(0,a.qy)` ${this.onRampProvidersTemplate()} `}onRampProvidersTemplate(){return this.providers.filter(e=>e.supportedChains.includes(n.WB.state.activeChain??"eip155")).map(e=>(0,a.qy)` {this.onClickProvider(e)}} ?disabled=${!e.url} > `)}onClickProvider(e){n.aG.setSelectedProvider(e),n.IN.push("BuyInProgress"),n.wE.openHref(e.url,"popupWindow","width=600,height=800,scrollbars=yes"),n.En.sendEvent({type:"track",event:"SELECT_BUY_PROVIDER",properties:{provider:e.name,isSmartAccount:n.Uj.state.preferredAccountType===D.Vl.ACCOUNT_TYPES.SMART_ACCOUNT}})}async getCoinbaseOnRampURL(){let e=n.Uj.state.address,t=n.WB.state.activeCaipNetwork;if(!e)throw Error("No address found");if(!t?.name)throw Error("No network found");let i=n.oU.WC_COINBASE_PAY_SDK_CHAIN_NAME_MAP[t.name]??n.oU.WC_COINBASE_PAY_SDK_FALLBACK_CHAIN,r=n.aG.state.purchaseCurrency,a=r?[r.symbol]:n.aG.state.purchaseCurrencies.map(e=>e.symbol);return await n.TP.generateOnRampURL({defaultNetwork:i,destinationWallets:[{address:e,blockchains:n.oU.WC_COINBASE_PAY_SDK_CHAINS,assets:a}],partnerUserId:e,purchaseAmount:n.aG.state.purchaseAmount})}};eT([(0,o.wk)()],eN.prototype,"providers",void 0),eN=eT([(0,r.customElement)("w3m-onramp-providers-view")],eN);let eP=(0,a.AH)` :host > wui-grid { max-height: 360px; overflow: auto; } wui-flex { transition: opacity var(--wui-ease-out-power-1) var(--wui-duration-md); will-change: opacity; } wui-grid::-webkit-scrollbar { display: none; } wui-flex.disabled { opacity: 0.3; pointer-events: none; user-select: none; } `;var eR=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o};let eO=class extends a.WF{constructor(){super(),this.unsubscribe=[],this.selectedCurrency=n.aG.state.purchaseCurrencies,this.tokens=n.aG.state.purchaseCurrencies,this.tokenImages=n.jQ.state.tokenImages,this.checked=!1,this.unsubscribe.push(n.aG.subscribe(e=>{this.selectedCurrency=e.purchaseCurrencies,this.tokens=e.purchaseCurrencies}),n.jQ.subscribeKey("tokenImages",e=>this.tokenImages=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){let{termsConditionsUrl:e,privacyPolicyUrl:t}=n.Hd.state,i=n.Hd.state.features?.legalCheckbox,r=!!(e||t)&&!!i&&!this.checked;return(0,a.qy)` ${this.currenciesTemplate(r)} `}currenciesTemplate(e=!1){return this.tokens.map(t=>(0,a.qy)` this.selectToken(t)} variant="image" tabIdx=${(0,s.J)(e?-1:void 0)} > ${t.name} ${t.symbol} `)}selectToken(e){e&&(n.aG.setPurchaseCurrency(e),n.W3.close())}onCheckboxChange(e){this.checked=!!e.detail}};eO.styles=eP,eR([(0,o.wk)()],eO.prototype,"selectedCurrency",void 0),eR([(0,o.wk)()],eO.prototype,"tokens",void 0),eR([(0,o.wk)()],eO.prototype,"tokenImages",void 0),eR([(0,o.wk)()],eO.prototype,"checked",void 0),eO=eR([(0,r.customElement)("w3m-onramp-token-select-view")],eO);let eM=(0,a.AH)` :host > wui-flex:first-child { overflow-y: auto; overflow-x: hidden; scrollbar-width: none; } :host > wui-flex:first-child::-webkit-scrollbar { display: none; } wui-loading-hexagon { position: absolute; } .action-button { width: 100%; border-radius: var(--wui-border-radius-xs); } .action-button:disabled { border-color: 1px solid var(--wui-color-gray-glass-005); } .swap-inputs-container { position: relative; } .replace-tokens-button-container { display: flex; justify-content: center; align-items: center; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); gap: var(--wui-spacing-1xs); border-radius: var(--wui-border-radius-xs); background-color: var(--wui-color-modal-bg-base); padding: var(--wui-spacing-xxs); } .replace-tokens-button-container > button { display: flex; justify-content: center; align-items: center; height: 40px; width: 40px; padding: var(--wui-spacing-xs); border: none; border-radius: var(--wui-border-radius-xxs); background: var(--wui-color-gray-glass-002); transition: background-color var(--wui-duration-md) var(--wui-ease-out-power-1); will-change: background-color; z-index: 20; } .replace-tokens-button-container > button:hover { background: var(--wui-color-gray-glass-005); } .details-container > wui-flex { background: var(--wui-color-gray-glass-002); border-radius: var(--wui-border-radius-xxs); width: 100%; } .details-container > wui-flex > button { border: none; background: none; padding: var(--wui-spacing-s); border-radius: var(--wui-border-radius-xxs); transition: background 0.2s linear; } .details-container > wui-flex > button:hover { background: var(--wui-color-gray-glass-002); } .details-content-container { padding: var(--wui-spacing-1xs); display: flex; align-items: center; justify-content: center; } .details-content-container > wui-flex { width: 100%; } .details-row { width: 100%; padding: var(--wui-spacing-s) var(--wui-spacing-xl); border-radius: var(--wui-border-radius-xxs); background: var(--wui-color-gray-glass-002); } `;var eD=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o};let eU=class extends a.WF{constructor(){super(),this.unsubscribe=[],this.detailsOpen=!1,this.caipNetworkId=n.WB.state.activeCaipNetwork?.caipNetworkId,this.initialized=n.GN.state.initialized,this.loadingQuote=n.GN.state.loadingQuote,this.loadingPrices=n.GN.state.loadingPrices,this.loadingTransaction=n.GN.state.loadingTransaction,this.sourceToken=n.GN.state.sourceToken,this.sourceTokenAmount=n.GN.state.sourceTokenAmount,this.sourceTokenPriceInUSD=n.GN.state.sourceTokenPriceInUSD,this.toToken=n.GN.state.toToken,this.toTokenAmount=n.GN.state.toTokenAmount,this.toTokenPriceInUSD=n.GN.state.toTokenPriceInUSD,this.inputError=n.GN.state.inputError,this.gasPriceInUSD=n.GN.state.gasPriceInUSD,this.fetchError=n.GN.state.fetchError,this.onDebouncedGetSwapCalldata=n.wE.debounce(async()=>{await n.GN.swapTokens()},200),n.WB.subscribeKey("activeCaipNetwork",e=>{this.caipNetworkId!==e?.caipNetworkId&&(this.caipNetworkId=e?.caipNetworkId,n.GN.resetState(),n.GN.initializeState())}),this.unsubscribe.push(n.W3.subscribeKey("open",e=>{e||n.GN.resetState()}),n.IN.subscribeKey("view",e=>{e.includes("Swap")||n.GN.resetValues()}),n.GN.subscribe(e=>{this.initialized=e.initialized,this.loadingQuote=e.loadingQuote,this.loadingPrices=e.loadingPrices,this.loadingTransaction=e.loadingTransaction,this.sourceToken=e.sourceToken,this.sourceTokenAmount=e.sourceTokenAmount,this.sourceTokenPriceInUSD=e.sourceTokenPriceInUSD,this.toToken=e.toToken,this.toTokenAmount=e.toTokenAmount,this.toTokenPriceInUSD=e.toTokenPriceInUSD,this.inputError=e.inputError,this.gasPriceInUSD=e.gasPriceInUSD,this.fetchError=e.fetchError}))}firstUpdated(){n.GN.initializeState(),this.watchTokensAndValues()}disconnectedCallback(){this.unsubscribe.forEach(e=>e?.()),clearInterval(this.interval)}render(){return(0,a.qy)` ${this.initialized?this.templateSwap():this.templateLoading()} `}watchTokensAndValues(){this.interval=setInterval(()=>{n.GN.getNetworkTokenPrice(),n.GN.getMyTokensWithBalance(),n.GN.swapTokens()},1e4)}templateSwap(){return(0,a.qy)` ${this.templateTokenInput("sourceToken",this.sourceToken)} ${this.templateTokenInput("toToken",this.toToken)} ${this.templateReplaceTokensButton()} ${this.templateDetails()} ${this.templateActionButton()} `}actionButtonLabel(){return this.fetchError?"Swap":this.sourceToken&&this.toToken?this.sourceTokenAmount?this.inputError?this.inputError:"Review swap":"Enter amount":"Select token"}templateReplaceTokensButton(){return(0,a.qy)` `}templateLoading(){return(0,a.qy)` ${this.templateReplaceTokensButton()} ${this.templateActionButton()} `}templateTokenInput(e,t){let i=n.GN.state.myTokensWithBalance?.find(e=>e?.address===t?.address),r="toToken"===e?this.toTokenAmount:this.sourceTokenAmount,o="toToken"===e?this.toTokenPriceInUSD:this.sourceTokenPriceInUSD,s=parseFloat(r)*o;return"toToken"===e&&(s-=this.gasPriceInUSD||0),(0,a.qy)``}onSetMaxValue(e,t){let i="sourceToken"===e?this.sourceToken:this.toToken,r=i?.address===n.WB.getActiveNetworkTokenAddress(),a="0";if(!t){a="0",this.handleChangeAmount(e,a);return}if(!this.gasPriceInUSD){a=t,this.handleChangeAmount(e,a);return}let o=et.Se.bigNumber(this.gasPriceInUSD.toFixed(5)).dividedBy(this.sourceTokenPriceInUSD),s=r?et.Se.bigNumber(t).minus(o):et.Se.bigNumber(t);this.handleChangeAmount(e,s.isGreaterThan(0)?s.toFixed(20):"0")}templateDetails(){return this.sourceToken&&this.toToken&&!this.inputError?(0,a.qy)``:null}handleChangeAmount(e,t){n.GN.clearError(),"sourceToken"===e?n.GN.setSourceTokenAmount(t):n.GN.setToTokenAmount(t),this.onDebouncedGetSwapCalldata()}templateActionButton(){let e=!this.toToken||!this.sourceToken,t=!this.sourceTokenAmount,i=this.loadingQuote||this.loadingPrices||this.loadingTransaction,r=i||e||t||this.inputError;return(0,a.qy)` ${this.actionButtonLabel()} `}onSwitchTokens(){n.GN.switchTokens()}onSwapPreview(){if(this.fetchError){n.GN.swapTokens();return}n.En.sendEvent({type:"track",event:"INITIATE_SWAP",properties:{network:this.caipNetworkId||"",swapFromToken:this.sourceToken?.symbol||"",swapToToken:this.toToken?.symbol||"",swapFromAmount:this.sourceTokenAmount||"",swapToAmount:this.toTokenAmount||"",isSmartAccount:n.Uj.state.preferredAccountType===D.Vl.ACCOUNT_TYPES.SMART_ACCOUNT}}),n.IN.push("SwapPreview")}};eU.styles=eM,eD([(0,o.wk)()],eU.prototype,"interval",void 0),eD([(0,o.wk)()],eU.prototype,"detailsOpen",void 0),eD([(0,o.wk)()],eU.prototype,"caipNetworkId",void 0),eD([(0,o.wk)()],eU.prototype,"initialized",void 0),eD([(0,o.wk)()],eU.prototype,"loadingQuote",void 0),eD([(0,o.wk)()],eU.prototype,"loadingPrices",void 0),eD([(0,o.wk)()],eU.prototype,"loadingTransaction",void 0),eD([(0,o.wk)()],eU.prototype,"sourceToken",void 0),eD([(0,o.wk)()],eU.prototype,"sourceTokenAmount",void 0),eD([(0,o.wk)()],eU.prototype,"sourceTokenPriceInUSD",void 0),eD([(0,o.wk)()],eU.prototype,"toToken",void 0),eD([(0,o.wk)()],eU.prototype,"toTokenAmount",void 0),eD([(0,o.wk)()],eU.prototype,"toTokenPriceInUSD",void 0),eD([(0,o.wk)()],eU.prototype,"inputError",void 0),eD([(0,o.wk)()],eU.prototype,"gasPriceInUSD",void 0),eD([(0,o.wk)()],eU.prototype,"fetchError",void 0),eU=eD([(0,r.customElement)("w3m-swap-view")],eU);let e$=(0,a.AH)` @keyframes shake { 0% { transform: translateX(0); } 25% { transform: translateX(3px); } 50% { transform: translateX(-3px); } 75% { transform: translateX(3px); } 100% { transform: translateX(0); } } wui-flex:first-child:not(:only-child) { position: relative; } wui-loading-thumbnail { position: absolute; } wui-visual { width: var(--wui-wallet-image-size-lg); height: var(--wui-wallet-image-size-lg); border-radius: calc(var(--wui-border-radius-5xs) * 9 - var(--wui-border-radius-xxs)); position: relative; overflow: hidden; } wui-visual::after { content: ''; display: block; width: 100%; height: 100%; position: absolute; inset: 0; border-radius: calc(var(--wui-border-radius-5xs) * 9 - var(--wui-border-radius-xxs)); box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-005); } wui-icon-box { position: absolute; right: calc(var(--wui-spacing-3xs) * -1); bottom: calc(var(--wui-spacing-3xs) * -1); opacity: 0; transform: scale(0.5); transition: opacity var(--wui-ease-out-power-2) var(--wui-duration-lg), transform var(--wui-ease-out-power-2) var(--wui-duration-lg); will-change: opacity, transform; } wui-text[align='center'] { width: 100%; padding: 0px var(--wui-spacing-l); } [data-error='true'] wui-icon-box { opacity: 1; transform: scale(1); } [data-error='true'] > wui-flex:first-child { animation: shake 250ms cubic-bezier(0.36, 0.07, 0.19, 0.97) both; } [data-retry='false'] wui-link { display: none; } [data-retry='true'] wui-link { display: block; opacity: 1; } wui-link { padding: var(--wui-spacing-4xs) var(--wui-spacing-xxs); } .capitalize { text-transform: capitalize; } `;var eL=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o};let ej=class extends a.WF{constructor(){super(...arguments),this.unsubscribe=[],this.switchToChain=n.IN.state.data?.switchToChain,this.navigateTo=n.IN.state.data?.navigateTo,this.navigateWithReplace=n.IN.state.data?.navigateWithReplace,this.caipNetwork=n.IN.state.data?.network,this.activeChain=n.WB.state.activeChain}firstUpdated(){this.unsubscribe.push(n.WB.subscribeKey("activeChain",e=>this.activeChain=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){let e=this.switchToChain?et.oU.CHAIN_NAME_MAP[this.switchToChain]:"supported";if(!this.switchToChain)return null;let t="eip155"===this.switchToChain?"Ethereum":this.switchToChain;return(0,a.qy)` Switch to ${t} Connected wallet doesn't support connecting to ${e} chain. You need to connect with a different wallet. Switch `}async switchActiveChain(){this.switchToChain&&(this.caipNetwork?await n.WB.switchActiveNetwork(this.caipNetwork):n.WB.setActiveNamespace(this.switchToChain),n.W3.close(),n.W3.open({view:"Connect"}))}};ej.styles=e$,eL([(0,o.MZ)()],ej.prototype,"activeChain",void 0),ej=eL([(0,r.customElement)("w3m-switch-active-chain-view")],ej);let eB=(0,a.AH)` :host > wui-flex:first-child { overflow-y: auto; overflow-x: hidden; scrollbar-width: none; } :host > wui-flex:first-child::-webkit-scrollbar { display: none; } .preview-container, .details-container { width: 100%; } .token-image { width: 24px; height: 24px; box-shadow: 0 0 0 2px var(--wui-color-gray-glass-005); border-radius: 12px; } wui-loading-hexagon { position: absolute; } .token-item { display: flex; align-items: center; justify-content: center; gap: var(--wui-spacing-xxs); padding: var(--wui-spacing-xs); height: 40px; border: none; border-radius: 80px; background: var(--wui-color-gray-glass-002); box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-002); cursor: pointer; transition: background 0.2s linear; } .token-item:hover { background: var(--wui-color-gray-glass-005); } .preview-token-details-container { width: 100%; } .details-row { width: 100%; padding: var(--wui-spacing-s) var(--wui-spacing-xl); border-radius: var(--wui-border-radius-xxs); background: var(--wui-color-gray-glass-002); } .action-buttons-container { width: 100%; gap: var(--wui-spacing-xs); } .action-buttons-container > button { display: flex; align-items: center; justify-content: center; background: transparent; height: 48px; border-radius: var(--wui-border-radius-xs); border: none; box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-010); } .action-buttons-container > button:disabled { opacity: 0.8; cursor: not-allowed; } .action-button > wui-loading-spinner { display: inline-block; } .cancel-button:hover, .action-button:hover { cursor: pointer; } .action-buttons-container > wui-button.cancel-button { flex: 2; } .action-buttons-container > wui-button.action-button { flex: 4; } .action-buttons-container > button.action-button > wui-text { color: white; } .details-container > wui-flex { background: var(--wui-color-gray-glass-002); border-radius: var(--wui-border-radius-xxs); width: 100%; } .details-container > wui-flex > button { border: none; background: none; padding: var(--wui-spacing-s); border-radius: var(--wui-border-radius-xxs); transition: background 0.2s linear; } .details-container > wui-flex > button:hover { background: var(--wui-color-gray-glass-002); } .details-content-container { padding: var(--wui-spacing-1xs); display: flex; align-items: center; justify-content: center; } .details-content-container > wui-flex { width: 100%; } .details-row { width: 100%; padding: var(--wui-spacing-s) var(--wui-spacing-xl); border-radius: var(--wui-border-radius-xxs); background: var(--wui-color-gray-glass-002); } `;var eW=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o};let eq=class extends a.WF{constructor(){super(),this.unsubscribe=[],this.detailsOpen=!0,this.approvalTransaction=n.GN.state.approvalTransaction,this.swapTransaction=n.GN.state.swapTransaction,this.sourceToken=n.GN.state.sourceToken,this.sourceTokenAmount=n.GN.state.sourceTokenAmount??"",this.sourceTokenPriceInUSD=n.GN.state.sourceTokenPriceInUSD,this.toToken=n.GN.state.toToken,this.toTokenAmount=n.GN.state.toTokenAmount??"",this.toTokenPriceInUSD=n.GN.state.toTokenPriceInUSD,this.caipNetwork=n.WB.state.activeCaipNetwork,this.balanceSymbol=n.Uj.state.balanceSymbol,this.gasPriceInUSD=n.GN.state.gasPriceInUSD,this.inputError=n.GN.state.inputError,this.loadingQuote=n.GN.state.loadingQuote,this.loadingApprovalTransaction=n.GN.state.loadingApprovalTransaction,this.loadingBuildTransaction=n.GN.state.loadingBuildTransaction,this.loadingTransaction=n.GN.state.loadingTransaction,this.unsubscribe.push(n.Uj.subscribeKey("balanceSymbol",e=>{this.balanceSymbol!==e&&n.IN.goBack()}),n.WB.subscribeKey("activeCaipNetwork",e=>{this.caipNetwork!==e&&(this.caipNetwork=e)}),n.GN.subscribe(e=>{this.approvalTransaction=e.approvalTransaction,this.swapTransaction=e.swapTransaction,this.sourceToken=e.sourceToken,this.gasPriceInUSD=e.gasPriceInUSD,this.toToken=e.toToken,this.gasPriceInUSD=e.gasPriceInUSD,this.toTokenPriceInUSD=e.toTokenPriceInUSD,this.sourceTokenAmount=e.sourceTokenAmount??"",this.toTokenAmount=e.toTokenAmount??"",this.inputError=e.inputError,e.inputError&&n.IN.goBack(),this.loadingQuote=e.loadingQuote,this.loadingApprovalTransaction=e.loadingApprovalTransaction,this.loadingBuildTransaction=e.loadingBuildTransaction,this.loadingTransaction=e.loadingTransaction}))}firstUpdated(){n.GN.getTransaction(),this.refreshTransaction()}disconnectedCallback(){this.unsubscribe.forEach(e=>e?.()),clearInterval(this.interval)}render(){return(0,a.qy)` ${this.templateSwap()} `}refreshTransaction(){this.interval=setInterval(()=>{n.GN.getApprovalLoadingState()||n.GN.getTransaction()},1e4)}templateSwap(){let e=`${r.UiHelperUtil.formatNumberToLocalString(parseFloat(this.sourceTokenAmount))} ${this.sourceToken?.symbol}`,t=`${r.UiHelperUtil.formatNumberToLocalString(parseFloat(this.toTokenAmount))} ${this.toToken?.symbol}`,i=parseFloat(this.sourceTokenAmount)*this.sourceTokenPriceInUSD,n=parseFloat(this.toTokenAmount)*this.toTokenPriceInUSD-(this.gasPriceInUSD||0),o=r.UiHelperUtil.formatNumberToLocalString(i),s=r.UiHelperUtil.formatNumberToLocalString(n),c=this.loadingQuote||this.loadingBuildTransaction||this.loadingTransaction||this.loadingApprovalTransaction;return(0,a.qy)` Send $${o} Receive $${s} ${this.templateDetails()} Review transaction carefully Cancel ${this.actionButtonLabel()} `}templateDetails(){return this.sourceToken&&this.toToken&&!this.inputError?(0,a.qy)``:null}actionButtonLabel(){return this.loadingApprovalTransaction?"Approving...":this.approvalTransaction?"Approve":"Swap"}onCancelTransaction(){n.IN.goBack()}onSendTransaction(){this.approvalTransaction?n.GN.sendTransactionForApproval(this.approvalTransaction):n.GN.sendTransactionForSwap(this.swapTransaction)}};eq.styles=eB,eW([(0,o.wk)()],eq.prototype,"interval",void 0),eW([(0,o.wk)()],eq.prototype,"detailsOpen",void 0),eW([(0,o.wk)()],eq.prototype,"approvalTransaction",void 0),eW([(0,o.wk)()],eq.prototype,"swapTransaction",void 0),eW([(0,o.wk)()],eq.prototype,"sourceToken",void 0),eW([(0,o.wk)()],eq.prototype,"sourceTokenAmount",void 0),eW([(0,o.wk)()],eq.prototype,"sourceTokenPriceInUSD",void 0),eW([(0,o.wk)()],eq.prototype,"toToken",void 0),eW([(0,o.wk)()],eq.prototype,"toTokenAmount",void 0),eW([(0,o.wk)()],eq.prototype,"toTokenPriceInUSD",void 0),eW([(0,o.wk)()],eq.prototype,"caipNetwork",void 0),eW([(0,o.wk)()],eq.prototype,"balanceSymbol",void 0),eW([(0,o.wk)()],eq.prototype,"gasPriceInUSD",void 0),eW([(0,o.wk)()],eq.prototype,"inputError",void 0),eW([(0,o.wk)()],eq.prototype,"loadingQuote",void 0),eW([(0,o.wk)()],eq.prototype,"loadingApprovalTransaction",void 0),eW([(0,o.wk)()],eq.prototype,"loadingBuildTransaction",void 0),eW([(0,o.wk)()],eq.prototype,"loadingTransaction",void 0),eq=eW([(0,r.customElement)("w3m-swap-preview-view")],eq);let eH=(0,a.AH)` :host { --tokens-scroll--top-opacity: 0; --tokens-scroll--bottom-opacity: 1; --suggested-tokens-scroll--left-opacity: 0; --suggested-tokens-scroll--right-opacity: 1; } :host > wui-flex:first-child { overflow-y: hidden; overflow-x: hidden; scrollbar-width: none; scrollbar-height: none; } :host > wui-flex:first-child::-webkit-scrollbar { display: none; } wui-loading-hexagon { position: absolute; } .suggested-tokens-container { overflow-x: auto; mask-image: linear-gradient( to right, rgba(0, 0, 0, calc(1 - var(--suggested-tokens-scroll--left-opacity))) 0px, rgba(200, 200, 200, calc(1 - var(--suggested-tokens-scroll--left-opacity))) 1px, black 50px, black 90px, black calc(100% - 90px), black calc(100% - 50px), rgba(155, 155, 155, calc(1 - var(--suggested-tokens-scroll--right-opacity))) calc(100% - 1px), rgba(0, 0, 0, calc(1 - var(--suggested-tokens-scroll--right-opacity))) 100% ); } .suggested-tokens-container::-webkit-scrollbar { display: none; } .tokens-container { border-top: 1px solid var(--wui-color-gray-glass-005); height: 100%; max-height: 390px; } .tokens { width: 100%; overflow-y: auto; mask-image: linear-gradient( to bottom, rgba(0, 0, 0, calc(1 - var(--tokens-scroll--top-opacity))) 0px, rgba(200, 200, 200, calc(1 - var(--tokens-scroll--top-opacity))) 1px, black 50px, black 90px, black calc(100% - 90px), black calc(100% - 50px), rgba(155, 155, 155, calc(1 - var(--tokens-scroll--bottom-opacity))) calc(100% - 1px), rgba(0, 0, 0, calc(1 - var(--tokens-scroll--bottom-opacity))) 100% ); } .network-search-input, .select-network-button { height: 40px; } .select-network-button { border: none; display: flex; flex-direction: row; align-items: center; justify-content: center; gap: var(--wui-spacing-xs); box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-005); background-color: transparent; border-radius: var(--wui-border-radius-xxs); padding: var(--wui-spacing-xs); align-items: center; transition: background-color 0.2s linear; } .select-network-button:hover { background-color: var(--wui-color-gray-glass-002); } .select-network-button > wui-image { width: 26px; height: 26px; border-radius: var(--wui-border-radius-xs); box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-010); } `;var ez=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o};let eF=class extends a.WF{constructor(){super(),this.unsubscribe=[],this.targetToken=n.IN.state.data?.target,this.sourceToken=n.GN.state.sourceToken,this.sourceTokenAmount=n.GN.state.sourceTokenAmount,this.toToken=n.GN.state.toToken,this.myTokensWithBalance=n.GN.state.myTokensWithBalance,this.popularTokens=n.GN.state.popularTokens,this.searchValue="",this.unsubscribe.push(n.GN.subscribe(e=>{this.sourceToken=e.sourceToken,this.toToken=e.toToken,this.myTokensWithBalance=e.myTokensWithBalance}))}updated(){let e=this.renderRoot?.querySelector(".suggested-tokens-container");e?.addEventListener("scroll",this.handleSuggestedTokensScroll.bind(this));let t=this.renderRoot?.querySelector(".tokens");t?.addEventListener("scroll",this.handleTokenListScroll.bind(this))}disconnectedCallback(){super.disconnectedCallback();let e=this.renderRoot?.querySelector(".suggested-tokens-container"),t=this.renderRoot?.querySelector(".tokens");e?.removeEventListener("scroll",this.handleSuggestedTokensScroll.bind(this)),t?.removeEventListener("scroll",this.handleTokenListScroll.bind(this)),clearInterval(this.interval)}render(){return(0,a.qy)` ${this.templateSearchInput()} ${this.templateSuggestedTokens()} ${this.templateTokens()} `}onSelectToken(e){"sourceToken"===this.targetToken?n.GN.setSourceToken(e):(n.GN.setToToken(e),this.sourceToken&&this.sourceTokenAmount&&n.GN.swapTokens()),n.IN.goBack()}templateSearchInput(){return(0,a.qy)` `}templateTokens(){let e=this.myTokensWithBalance?Object.values(this.myTokensWithBalance):[],t=this.popularTokens?this.popularTokens:[],i=this.filterTokensWithText(e,this.searchValue),r=this.filterTokensWithText(t,this.searchValue);return(0,a.qy)` ${i?.length>0?(0,a.qy)` Your tokens ${i.map(e=>{let t=e.symbol===this.sourceToken?.symbol||e.symbol===this.toToken?.symbol;return(0,a.qy)` {t||this.onSelectToken(e)}} > `})} `:null} Tokens ${r?.length>0?r.map(e=>(0,a.qy)` this.onSelectToken(e)} > `):null} `}templateSuggestedTokens(){let e=n.GN.state.suggestedTokens?n.GN.state.suggestedTokens.slice(0,8):null;return e?(0,a.qy)` ${e.map(e=>(0,a.qy)` this.onSelectToken(e)} > `)} `:null}onSearchInputChange(e){this.searchValue=e.detail}handleSuggestedTokensScroll(){let e=this.renderRoot?.querySelector(".suggested-tokens-container");e&&(e.style.setProperty("--suggested-tokens-scroll--left-opacity",r.MathUtil.interpolate([0,100],[0,1],e.scrollLeft).toString()),e.style.setProperty("--suggested-tokens-scroll--right-opacity",r.MathUtil.interpolate([0,100],[0,1],e.scrollWidth-e.scrollLeft-e.offsetWidth).toString()))}handleTokenListScroll(){let e=this.renderRoot?.querySelector(".tokens");e&&(e.style.setProperty("--tokens-scroll--top-opacity",r.MathUtil.interpolate([0,100],[0,1],e.scrollTop).toString()),e.style.setProperty("--tokens-scroll--bottom-opacity",r.MathUtil.interpolate([0,100],[0,1],e.scrollHeight-e.scrollTop-e.offsetHeight).toString()))}filterTokensWithText(e,t){return e.filter(e=>`${e.symbol} ${e.name} ${e.address}`.toLowerCase().includes(t.toLowerCase()))}};eF.styles=eH,ez([(0,o.wk)()],eF.prototype,"interval",void 0),ez([(0,o.wk)()],eF.prototype,"targetToken",void 0),ez([(0,o.wk)()],eF.prototype,"sourceToken",void 0),ez([(0,o.wk)()],eF.prototype,"sourceTokenAmount",void 0),ez([(0,o.wk)()],eF.prototype,"toToken",void 0),ez([(0,o.wk)()],eF.prototype,"myTokensWithBalance",void 0),ez([(0,o.wk)()],eF.prototype,"popularTokens",void 0),ez([(0,o.wk)()],eF.prototype,"searchValue",void 0),eF=ez([(0,r.customElement)("w3m-swap-select-token-view")],eF);let eZ=(0,a.AH)` :host > wui-flex:first-child { height: 500px; overflow-y: auto; overflow-x: hidden; scrollbar-width: none; } :host > wui-flex:first-child::-webkit-scrollbar { display: none; } `,eV=class extends a.WF{render(){return(0,a.qy)` `}};eV.styles=eZ,eV=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o}([(0,r.customElement)("w3m-transactions-view")],eV);let eK=[{images:["network","layers","system"],title:"The system’s nuts and bolts",text:"A network is what brings the blockchain to life, as this technical infrastructure allows apps to access the ledger and smart contract services."},{images:["noun","defiAlt","dao"],title:"Designed for different uses",text:"Each network is designed differently, and may therefore suit certain apps and experiences."}],eG=class extends a.WF{render(){return(0,a.qy)` {n.wE.openHref("https://ethereum.org/en/developers/docs/networks/","_blank")}} > Learn more `}};eG=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o}([(0,r.customElement)("w3m-what-is-a-network-view")],eG);let eJ=[{images:["login","profile","lock"],title:"One login for all of web3",text:"Log in to any app by connecting your wallet. Say goodbye to countless passwords!"},{images:["defi","nft","eth"],title:"A home for your digital assets",text:"A wallet lets you store, send and receive digital assets like cryptocurrencies and NFTs."},{images:["browser","noun","dao"],title:"Your gateway to a new web",text:"With your wallet, you can explore and interact with DeFi, NFTs, DAOs, and much more."}],eY=class extends a.WF{render(){return(0,a.qy)` Get a wallet `}onGetWallet(){n.En.sendEvent({type:"track",event:"CLICK_GET_WALLET"}),n.IN.push("GetWallet")}};eY=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o}([(0,r.customElement)("w3m-what-is-a-wallet-view")],eY);let eQ=class extends a.WF{render(){return(0,a.qy)` Quickly and easily buy digital assets! Simply select your preferred onramp provider and add digital assets to your account using your credit card or bank transfer Buy `}};eQ=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o}([(0,r.customElement)("w3m-what-is-a-buy-view")],eQ);let eX=(0,a.AH)` wui-loading-spinner { margin: 9px auto; } .email-display, .email-display wui-text { max-width: 100%; } `;var e0=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o};let e1=class extends a.WF{firstUpdated(){this.startOTPTimeout()}disconnectedCallback(){clearTimeout(this.OTPTimeout)}constructor(){super(),this.loading=!1,this.timeoutTimeLeft=D.QH.getTimeToNextEmailLogin(),this.error="",this.otp="",this.email=n.IN.state.data?.email,this.authConnector=n.aK.getAuthConnector()}render(){if(!this.email)throw Error("w3m-email-otp-widget: No email provided");let e=!!this.timeoutTimeLeft,t=this.getFooterLabels(e);return(0,a.qy)` The code expires in 20 minutes ${this.loading?(0,a.qy)``:(0,a.qy)` ${this.error?(0,a.qy)` ${this.error}. Try Again `:null} `} ${t.title} ${t.action} `}startOTPTimeout(){this.timeoutTimeLeft=D.QH.getTimeToNextEmailLogin(),this.OTPTimeout=setInterval(()=>{this.timeoutTimeLeft>0?this.timeoutTimeLeft=D.QH.getTimeToNextEmailLogin():clearInterval(this.OTPTimeout)},1e3)}async onOtpInputChange(e){try{!this.loading&&(this.otp=e.detail,this.authConnector&&6===this.otp.length&&(this.loading=!0,await this.onOtpSubmit?.(this.otp)))}catch(e){this.error=n.wE.parseError(e),this.loading=!1}}async onResendCode(){try{if(this.onOtpResend){if(!this.loading&&!this.timeoutTimeLeft){if(this.error="",this.otp="",!n.aK.getAuthConnector()||!this.email)throw Error("w3m-email-otp-widget: Unable to resend email");this.loading=!0,await this.onOtpResend(this.email),this.startOTPTimeout(),n.Pt.showSuccess("Code email resent")}}else this.onStartOver&&this.onStartOver()}catch(e){n.Pt.showError(e)}finally{this.loading=!1}}getFooterLabels(e){return this.onStartOver?{title:"Something wrong?",action:`Try again ${e?`in ${this.timeoutTimeLeft}s`:""}`}:{title:"Didn't receive it?",action:`Resend ${e?`in ${this.timeoutTimeLeft}s`:"Code"}`}}};e1.styles=eX,e0([(0,o.wk)()],e1.prototype,"loading",void 0),e0([(0,o.wk)()],e1.prototype,"timeoutTimeLeft",void 0),e0([(0,o.wk)()],e1.prototype,"error",void 0),e1=e0([(0,r.customElement)("w3m-email-otp-widget")],e1);let e2=class extends e1{constructor(){super(...arguments),this.onOtpSubmit=async e=>{try{if(this.authConnector){if(await this.authConnector.provider.connectOtp({otp:e}),n.En.sendEvent({type:"track",event:"EMAIL_VERIFICATION_CODE_PASS"}),n.WB.state.activeChain)await n.x4.connectExternal(this.authConnector,n.WB.state.activeChain);else throw Error("Active chain is not set on ChainControll");n.En.sendEvent({type:"track",event:"CONNECT_SUCCESS",properties:{method:"email",name:this.authConnector.name||"Unknown"}}),n.Hd.state.siwx||n.W3.close()}}catch(e){throw n.En.sendEvent({type:"track",event:"EMAIL_VERIFICATION_CODE_FAIL"}),e}},this.onOtpResend=async e=>{this.authConnector&&(await this.authConnector.provider.connectEmail({email:e}),n.En.sendEvent({type:"track",event:"EMAIL_VERIFICATION_CODE_SENT"}))}}};e2=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o}([(0,r.customElement)("w3m-email-verify-otp-view")],e2);let e3=(0,a.AH)` wui-icon-box { height: var(--wui-icon-box-size-xl); width: var(--wui-icon-box-size-xl); } `;var e5=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o};let e4=class extends a.WF{constructor(){super(),this.email=n.IN.state.data?.email,this.authConnector=n.aK.getAuthConnector(),this.loading=!1,this.listenForDeviceApproval()}render(){if(!this.email)throw Error("w3m-email-verify-device-view: No email provided");if(!this.authConnector)throw Error("w3m-email-verify-device-view: No auth connector provided");return(0,a.qy)` Approve the login link we sent to ${this.email} The code expires in 20 minutes Didn't receive it? Resend email `}async listenForDeviceApproval(){if(this.authConnector)try{await this.authConnector.provider.connectDevice(),n.En.sendEvent({type:"track",event:"DEVICE_REGISTERED_FOR_EMAIL"}),n.En.sendEvent({type:"track",event:"EMAIL_VERIFICATION_CODE_SENT"}),n.IN.replace("EmailVerifyOtp",{email:this.email})}catch(e){n.IN.goBack()}}async onResendCode(){try{if(!this.loading){if(!this.authConnector||!this.email)throw Error("w3m-email-login-widget: Unable to resend email");this.loading=!0,await this.authConnector.provider.connectEmail({email:this.email}),this.listenForDeviceApproval(),n.Pt.showSuccess("Code email resent")}}catch(e){n.Pt.showError(e)}finally{this.loading=!1}}};e4.styles=e3,e5([(0,o.wk)()],e4.prototype,"loading",void 0),e4=e5([(0,r.customElement)("w3m-email-verify-device-view")],e4);let e6=(0,a.AH)` div { width: 100%; } [data-ready='false'] { transform: scale(1.05); } @media (max-width: 430px) { [data-ready='false'] { transform: translateY(-50px); } } `;var e8=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o};let e9=class extends a.WF{constructor(){super(),this.bodyObserver=void 0,this.unsubscribe=[],this.iframe=document.getElementById("w3m-iframe"),this.ready=!1,this.unsubscribe.push(n.W3.subscribeKey("open",e=>{e||(this.onHideIframe(),n.IN.popTransactionStack())}),n.W3.subscribeKey("shake",e=>{e?this.iframe.style.animation="w3m-shake 500ms var(--wui-ease-out-power-2)":this.iframe.style.animation="none"}))}disconnectedCallback(){this.onHideIframe(),this.unsubscribe.forEach(e=>e()),this.bodyObserver?.unobserve(window.document.body)}async firstUpdated(){await this.syncTheme(),this.iframe.style.display="block";let e=this?.renderRoot?.querySelector("div");this.bodyObserver=new ResizeObserver(t=>{let i=t?.[0]?.contentBoxSize,r=i?.[0]?.inlineSize;this.iframe.style.height="600px",e.style.height="600px",r&&r<=430?(this.iframe.style.width="100%",this.iframe.style.left="0px",this.iframe.style.bottom="0px",this.iframe.style.top="unset"):(this.iframe.style.width="360px",this.iframe.style.left="calc(50% - 180px)",this.iframe.style.top="calc(50% - 300px + 32px)",this.iframe.style.bottom="unset"),this.ready=!0,this.onShowIframe()}),this.bodyObserver.observe(window.document.body)}render(){return(0,a.qy)`
`}onShowIframe(){let e=window.innerWidth<=430;this.iframe.style.animation=e?"w3m-iframe-zoom-in-mobile 200ms var(--wui-ease-out-power-2)":"w3m-iframe-zoom-in 200ms var(--wui-ease-out-power-2)"}onHideIframe(){this.iframe.style.display="none",this.iframe.style.animation="w3m-iframe-fade-out 200ms var(--wui-ease-out-power-2)"}async syncTheme(){let e=n.aK.getAuthConnector();if(e){let t=n.Wn.getSnapshot().themeMode,i=n.Wn.getSnapshot().themeVariables;await e.provider.syncTheme({themeVariables:i,w3mThemeVariables:(0,et.o_)(i,t)})}}};e9.styles=e6,e8([(0,o.wk)()],e9.prototype,"ready",void 0),e9=e8([(0,r.customElement)("w3m-approve-transaction-view")],e9);let e7=class extends a.WF{render(){return(0,a.qy)` Follow the instructions on You will have to reconnect for security reasons `}};e7=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o}([(0,r.customElement)("w3m-upgrade-wallet-view")],e7);var te=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o};let tt=class extends a.WF{constructor(){super(...arguments),this.authConnector=n.aK.getAuthConnector(),this.loading=!1,this.setPreferSmartAccount=async()=>{if(this.authConnector)try{this.loading=!0,await n.x4.setPreferredAccountType(D.Vl.ACCOUNT_TYPES.SMART_ACCOUNT),this.loading=!1,n.IN.push("Account")}catch(e){n.Pt.showError("Error upgrading to smart account")}}}render(){return(0,a.qy)` ${this.onboardingTemplate()} ${this.buttonsTemplate()} {n.wE.openHref(et.TC.URLS.FAQ,"_blank")}} > Learn more `}onboardingTemplate(){return(0,a.qy)` Discover Smart Accounts Access advanced features such as username, social login, improved security and a smoother user experience! `}buttonsTemplate(){return(0,a.qy)` Do it later Continue `}redirectToAccount(){n.IN.push("Account")}};te([(0,o.wk)()],tt.prototype,"authConnector",void 0),te([(0,o.wk)()],tt.prototype,"loading",void 0),tt=te([(0,r.customElement)("w3m-upgrade-to-smart-account-view")],tt);let ti=(0,a.AH)` wui-email-input { width: 100%; } form { width: 100%; display: block; position: relative; } `;var tr=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o};let tn=class extends a.WF{constructor(){super(...arguments),this.formRef=(0,eh._)(),this.initialEmail=n.IN.state.data?.email??"",this.email="",this.loading=!1}firstUpdated(){this.formRef.value?.addEventListener("keydown",e=>{"Enter"===e.key&&this.onSubmitEmail(e)})}render(){let e=!this.loading&&this.email.length>3&&this.email!==this.initialEmail;return(0,a.qy)`
Cancel Save
`}onEmailInputChange(e){this.email=e.detail}async onSubmitEmail(e){try{if(this.loading)return;this.loading=!0,e.preventDefault();let t=n.aK.getAuthConnector();if(!t)throw Error("w3m-update-email-wallet: Auth connector not found");let i=await t.provider.updateEmail({email:this.email});n.En.sendEvent({type:"track",event:"EMAIL_EDIT"}),"VERIFY_SECONDARY_OTP"===i.action?n.IN.push("UpdateEmailSecondaryOtp",{email:this.initialEmail,newEmail:this.email}):n.IN.push("UpdateEmailPrimaryOtp",{email:this.initialEmail,newEmail:this.email})}catch(e){n.Pt.showError(e),this.loading=!1}}};tn.styles=ti,tr([(0,o.wk)()],tn.prototype,"email",void 0),tr([(0,o.wk)()],tn.prototype,"loading",void 0),tn=tr([(0,r.customElement)("w3m-update-email-wallet-view")],tn);let ta=class extends e1{constructor(){super(),this.email=n.IN.state.data?.email,this.onOtpSubmit=async e=>{try{this.authConnector&&(await this.authConnector.provider.updateEmailPrimaryOtp({otp:e}),n.En.sendEvent({type:"track",event:"EMAIL_VERIFICATION_CODE_PASS"}),n.IN.replace("UpdateEmailSecondaryOtp",n.IN.state.data))}catch(e){throw n.En.sendEvent({type:"track",event:"EMAIL_VERIFICATION_CODE_FAIL"}),e}},this.onStartOver=()=>{n.IN.replace("UpdateEmailWallet",n.IN.state.data)}}};ta=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o}([(0,r.customElement)("w3m-update-email-primary-otp-view")],ta);let to=class extends e1{constructor(){super(),this.email=n.IN.state.data?.newEmail,this.onOtpSubmit=async e=>{try{this.authConnector&&(await this.authConnector.provider.updateEmailSecondaryOtp({otp:e}),n.En.sendEvent({type:"track",event:"EMAIL_VERIFICATION_CODE_PASS"}),n.IN.reset("Account"))}catch(e){throw n.En.sendEvent({type:"track",event:"EMAIL_VERIFICATION_CODE_FAIL"}),e}},this.onStartOver=()=>{n.IN.replace("UpdateEmailWallet",n.IN.state.data)}}};to=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o}([(0,r.customElement)("w3m-update-email-secondary-otp-view")],to);let ts=(0,a.AH)` :host > wui-flex { max-height: clamp(360px, 540px, 80vh); overflow: scroll; scrollbar-width: none; } :host > wui-flex::-webkit-scrollbar { display: none; } `;var tc=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o};let tl=class extends a.WF{constructor(){super(...arguments),this.swapUnsupportedChain=n.IN.state.data?.swapUnsupportedChain,this.disconecting=!1}render(){return(0,a.qy)` ${this.descriptionTemplate()} ${this.networksTemplate()} Disconnect `}descriptionTemplate(){return this.swapUnsupportedChain?(0,a.qy)` The swap feature doesn’t support your current network. Switch to an available option to continue. `:(0,a.qy)` This app doesn’t support your current network. Switch to an available option to continue. `}networksTemplate(){let e=n.WB.getAllRequestedCaipNetworks(),t=n.WB.getAllApprovedCaipNetworkIds(),i=n.wE.sortRequestedNetworks(t,e);return(this.swapUnsupportedChain?i.filter(e=>n.oU.SWAP_SUPPORTED_NETWORKS.includes(e.caipNetworkId)):i).map(e=>(0,a.qy)` this.onSwitchNetwork(e)} > `)}async onDisconnect(){try{this.disconecting=!0,await n.x4.disconnect(),n.En.sendEvent({type:"track",event:"DISCONNECT_SUCCESS"}),n.W3.close()}catch{n.En.sendEvent({type:"track",event:"DISCONNECT_ERROR"}),n.Pt.showError("Failed to disconnect")}finally{this.disconecting=!1}}async onSwitchNetwork(e){let t=n.Uj.state.caipAddress,i=n.WB.getAllApprovedCaipNetworkIds(),r=(n.WB.getNetworkProp("supportsAllNetworks",e.chainNamespace),n.IN.state.data);t?i?.includes(e.caipNetworkId)?await n.WB.switchActiveNetwork(e):n.IN.push("SwitchNetwork",{...r,network:e}):t||(n.WB.setActiveCaipNetwork(e),n.IN.push("Connect"))}};tl.styles=ts,tc([(0,o.wk)()],tl.prototype,"disconecting",void 0),tl=tc([(0,r.customElement)("w3m-unsupported-chain-view")],tl);let tu=(0,a.AH)` wui-compatible-network { margin-top: var(--wui-spacing-l); } `;var td=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o};let th=class extends a.WF{constructor(){super(),this.unsubscribe=[],this.address=n.Uj.state.address,this.profileName=n.Uj.state.profileName,this.network=n.WB.state.activeCaipNetwork,this.preferredAccountType=n.Uj.state.preferredAccountType,this.unsubscribe.push(n.Uj.subscribe(e=>{e.address?(this.address=e.address,this.profileName=e.profileName,this.preferredAccountType=e.preferredAccountType):n.Pt.showError("Account not found")}),n.WB.subscribeKey("activeCaipNetwork",e=>{e?.id&&(this.network=e)}))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){if(!this.address)throw Error("w3m-wallet-receive-view: No account provided");let e=n.$m.getNetworkImage(this.network);return(0,a.qy)` Copy your address or scan this QR code ${this.networkTemplate()} `}networkTemplate(){let e=n.WB.getAllRequestedCaipNetworks(),t=n.WB.checkIfSmartAccountEnabled(),i=n.WB.state.activeCaipNetwork;if(this.preferredAccountType===D.Vl.ACCOUNT_TYPES.SMART_ACCOUNT&&t)return i?(0,a.qy)``:null;let r=(e?.filter(e=>e?.assets?.imageId)?.slice(0,5)).map(n.$m.getNetworkImage).filter(Boolean);return(0,a.qy)``}onReceiveClick(){n.IN.push("WalletCompatibleNetworks")}onCopyClick(){try{this.address&&(n.wE.copyToClopboard(this.address),n.Pt.showSuccess("Address copied"))}catch{n.Pt.showError("Failed to copy")}}};th.styles=tu,td([(0,o.wk)()],th.prototype,"address",void 0),td([(0,o.wk)()],th.prototype,"profileName",void 0),td([(0,o.wk)()],th.prototype,"network",void 0),td([(0,o.wk)()],th.prototype,"preferredAccountType",void 0),th=td([(0,r.customElement)("w3m-wallet-receive-view")],th);let tp=(0,a.AH)` :host > wui-flex { max-height: clamp(360px, 540px, 80vh); overflow: scroll; scrollbar-width: none; } :host > wui-flex::-webkit-scrollbar { display: none; } `;var tf=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o};let tg=class extends a.WF{constructor(){super(),this.unsubscribe=[],this.preferredAccountType=n.Uj.state.preferredAccountType,this.unsubscribe.push(n.Uj.subscribeKey("preferredAccountType",e=>{this.preferredAccountType=e}))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return(0,a.qy)` ${this.networkTemplate()} `}networkTemplate(){let e=n.WB.getAllRequestedCaipNetworks(),t=n.WB.getAllApprovedCaipNetworkIds(),i=n.WB.state.activeCaipNetwork,r=n.WB.checkIfSmartAccountEnabled(),o=n.wE.sortRequestedNetworks(t,e);if(r&&this.preferredAccountType===D.Vl.ACCOUNT_TYPES.SMART_ACCOUNT){if(!i)return null;o=[i]}return o.map(e=>(0,a.qy)` `)}};tg.styles=tp,tf([(0,o.wk)()],tg.prototype,"preferredAccountType",void 0),tg=tf([(0,r.customElement)("w3m-wallet-compatible-networks-view")],tg);let tw=(0,a.AH)` :host { display: block; } wui-flex { position: relative; } wui-icon-box { width: 40px; height: 40px; border-radius: var(--wui-border-radius-xs) !important; border: 5px solid var(--wui-color-bg-125); background: var(--wui-color-bg-175); position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 3; } wui-button { --local-border-radius: var(--wui-border-radius-xs) !important; } .inputContainer { height: fit-content; } `;var tm=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o};let tb=class extends a.WF{constructor(){super(),this.unsubscribe=[],this.token=n.Rv.state.token,this.sendTokenAmount=n.Rv.state.sendTokenAmount,this.receiverAddress=n.Rv.state.receiverAddress,this.receiverProfileName=n.Rv.state.receiverProfileName,this.loading=n.Rv.state.loading,this.gasPriceInUSD=n.Rv.state.gasPriceInUSD,this.gasPrice=n.Rv.state.gasPrice,this.message="Preview Send",this.fetchNetworkPrice(),this.unsubscribe.push(n.Rv.subscribe(e=>{this.token=e.token,this.sendTokenAmount=e.sendTokenAmount,this.receiverAddress=e.receiverAddress,this.gasPriceInUSD=e.gasPriceInUSD,this.receiverProfileName=e.receiverProfileName,this.loading=e.loading}))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return this.getMessage(),(0,a.qy)` ${this.message} `}async fetchNetworkPrice(){await n.GN.getNetworkTokenPrice();let e=await n.GN.getInitialGasPrice();e?.gasPrice&&e?.gasPriceInUSD&&(n.Rv.setGasPrice(e.gasPrice),n.Rv.setGasPriceInUsd(e.gasPriceInUSD))}onButtonClick(){n.IN.push("WalletSendPreview")}getMessage(){this.message="Preview Send",this.receiverAddress&&!n.wE.isAddress(this.receiverAddress,n.WB.state.activeChain)&&(this.message="Invalid Address"),this.receiverAddress||(this.message="Add Address"),this.sendTokenAmount&&this.token&&this.sendTokenAmount>Number(this.token.quantity.numeric)&&(this.message="Insufficient Funds"),this.sendTokenAmount||(this.message="Add Amount"),this.sendTokenAmount&&this.token?.price&&!(this.sendTokenAmount*this.token.price)&&(this.message="Incorrect Value"),this.token||(this.message="Select Token")}};tb.styles=tw,tm([(0,o.wk)()],tb.prototype,"token",void 0),tm([(0,o.wk)()],tb.prototype,"sendTokenAmount",void 0),tm([(0,o.wk)()],tb.prototype,"receiverAddress",void 0),tm([(0,o.wk)()],tb.prototype,"receiverProfileName",void 0),tm([(0,o.wk)()],tb.prototype,"loading",void 0),tm([(0,o.wk)()],tb.prototype,"gasPriceInUSD",void 0),tm([(0,o.wk)()],tb.prototype,"gasPrice",void 0),tm([(0,o.wk)()],tb.prototype,"message",void 0),tb=tm([(0,r.customElement)("w3m-wallet-send-view")],tb);let tv=(0,a.AH)` .contentContainer { height: 440px; overflow: scroll; scrollbar-width: none; } .contentContainer::-webkit-scrollbar { display: none; } wui-icon-box { width: 40px; height: 40px; border-radius: var(--wui-border-radius-xxs); } `;var ty=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o};let tx=class extends a.WF{constructor(){super(),this.unsubscribe=[],this.tokenBalance=n.Uj.state.tokenBalance,this.search="",this.onDebouncedSearch=n.wE.debounce(e=>{this.search=e}),this.unsubscribe.push(n.Uj.subscribe(e=>{this.tokenBalance=e.tokenBalance}))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return(0,a.qy)` ${this.templateSearchInput()} ${this.templateTokens()} `}templateSearchInput(){return(0,a.qy)` `}templateTokens(){return this.tokens=this.tokenBalance?.filter(e=>e.chainId===n.WB.state.activeCaipNetwork?.caipNetworkId),this.search?this.filteredTokens=this.tokenBalance?.filter(e=>e.name.toLowerCase().includes(this.search.toLowerCase())):this.filteredTokens=this.tokens,(0,a.qy)` Your tokens ${this.filteredTokens&&this.filteredTokens.length>0?this.filteredTokens.map(e=>(0,a.qy)``):(0,a.qy)` No tokens found Your tokens will appear here Buy `} `}onBuyClick(){n.IN.push("OnRampProviders")}onInputChange(e){this.onDebouncedSearch(e.detail)}handleTokenClick(e){n.Rv.setToken(e),n.Rv.setTokenAmount(void 0),n.IN.goBack()}};tx.styles=tv,ty([(0,o.wk)()],tx.prototype,"tokenBalance",void 0),ty([(0,o.wk)()],tx.prototype,"tokens",void 0),ty([(0,o.wk)()],tx.prototype,"filteredTokens",void 0),ty([(0,o.wk)()],tx.prototype,"search",void 0),tx=ty([(0,r.customElement)("w3m-wallet-send-select-token-view")],tx);let tC=(0,a.AH)` wui-avatar, wui-image { display: ruby; width: 32px; height: 32px; border-radius: var(--wui-border-radius-3xl); } .sendButton { width: 70%; --local-width: 100% !important; --local-border-radius: var(--wui-border-radius-xs) !important; } .cancelButton { width: 30%; --local-width: 100% !important; --local-border-radius: var(--wui-border-radius-xs) !important; } `;var tA=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o};let tE=class extends a.WF{constructor(){super(),this.unsubscribe=[],this.token=n.Rv.state.token,this.sendTokenAmount=n.Rv.state.sendTokenAmount,this.receiverAddress=n.Rv.state.receiverAddress,this.receiverProfileName=n.Rv.state.receiverProfileName,this.receiverProfileImageUrl=n.Rv.state.receiverProfileImageUrl,this.gasPriceInUSD=n.Rv.state.gasPriceInUSD,this.caipNetwork=n.WB.state.activeCaipNetwork,this.unsubscribe.push(n.Rv.subscribe(e=>{this.token=e.token,this.sendTokenAmount=e.sendTokenAmount,this.receiverAddress=e.receiverAddress,this.gasPriceInUSD=e.gasPriceInUSD,this.receiverProfileName=e.receiverProfileName,this.receiverProfileImageUrl=e.receiverProfileImageUrl}),n.WB.subscribeKey("activeCaipNetwork",e=>this.caipNetwork=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return(0,a.qy)` Send ${this.sendValueTemplate()} To Review transaction carefully Cancel Send `}sendValueTemplate(){if(this.token&&this.sendTokenAmount){let e=this.token.price*this.sendTokenAmount;return(0,a.qy)`$${e.toFixed(2)}`}return null}onSendClick(){n.Rv.sendToken()}onCancelClick(){n.IN.goBack()}};tE.styles=tC,tA([(0,o.wk)()],tE.prototype,"token",void 0),tA([(0,o.wk)()],tE.prototype,"sendTokenAmount",void 0),tA([(0,o.wk)()],tE.prototype,"receiverAddress",void 0),tA([(0,o.wk)()],tE.prototype,"receiverProfileName",void 0),tA([(0,o.wk)()],tE.prototype,"receiverProfileImageUrl",void 0),tA([(0,o.wk)()],tE.prototype,"gasPriceInUSD",void 0),tA([(0,o.wk)()],tE.prototype,"caipNetwork",void 0),tE=tA([(0,r.customElement)("w3m-wallet-send-preview-view")],tE);let t_=(0,a.AH)` wui-flex { max-height: clamp(360px, 540px, 80vh); overflow: scroll; scrollbar-width: none; transition: opacity var(--wui-ease-out-power-1) var(--wui-duration-md); will-change: opacity; } wui-flex::-webkit-scrollbar { display: none; } wui-flex.disabled { opacity: 0.3; pointer-events: none; user-select: none; } `;var tk=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o};let tI=class extends a.WF{constructor(){super(...arguments),this.checked=!1}render(){let{termsConditionsUrl:e,privacyPolicyUrl:t}=n.Hd.state,i=n.Hd.state.features?.legalCheckbox,r=!!(e||t)&&!!i,o=r&&!this.checked;return(0,a.qy)` `}onCheckboxChange(e){this.checked=!!e.detail}};tI.styles=t_,tk([(0,o.wk)()],tI.prototype,"checked",void 0),tI=tk([(0,r.customElement)("w3m-connect-wallets-view")],tI);let tS=(0,a.AH)` wui-flex { max-height: clamp(360px, 540px, 80vh); overflow: scroll; scrollbar-width: none; transition: opacity var(--wui-ease-out-power-1) var(--wui-duration-md); will-change: opacity; } wui-flex::-webkit-scrollbar { display: none; } wui-flex.disabled { opacity: 0.3; pointer-events: none; user-select: none; } `;var tT=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o};let tN=class extends a.WF{constructor(){super(...arguments),this.checked=!1}render(){let{termsConditionsUrl:e,privacyPolicyUrl:t}=n.Hd.state,i=n.Hd.state.features?.legalCheckbox,r=!!(e||t)&&!!i,o=r&&!this.checked;return(0,a.qy)` `}onCheckboxChange(e){this.checked=!!e.detail}};tN.styles=tS,tT([(0,o.wk)()],tN.prototype,"checked",void 0),tN=tT([(0,r.customElement)("w3m-connect-socials-view")],tN);let tP=(0,a.AH)` wui-logo { width: 80px; height: 80px; border-radius: var(--wui-border-radius-m); } @keyframes shake { 0% { transform: translateX(0); } 25% { transform: translateX(3px); } 50% { transform: translateX(-3px); } 75% { transform: translateX(3px); } 100% { transform: translateX(0); } } wui-flex:first-child:not(:only-child) { position: relative; } wui-loading-thumbnail { position: absolute; } wui-icon-box { position: absolute; right: calc(var(--wui-spacing-3xs) * -1); bottom: calc(var(--wui-spacing-3xs) * -1); opacity: 0; transform: scale(0.5); transition: all var(--wui-ease-out-power-2) var(--wui-duration-lg); } wui-text[align='center'] { width: 100%; padding: 0px var(--wui-spacing-l); } [data-error='true'] wui-icon-box { opacity: 1; transform: scale(1); } [data-error='true'] > wui-flex:first-child { animation: shake 250ms cubic-bezier(0.36, 0.07, 0.19, 0.97) both; } .capitalize { text-transform: capitalize; } `;var tR=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o};let tO=class extends a.WF{constructor(){super(),this.unsubscribe=[],this.socialProvider=n.Uj.state.socialProvider,this.socialWindow=n.Uj.state.socialWindow,this.error=!1,this.connecting=!1,this.message="Connect in the provider window",this.authConnector=n.aK.getAuthConnector(),this.handleSocialConnection=async e=>{if(e.data?.resultUri){if(e.origin===I.SECURE_SITE_ORIGIN){window.removeEventListener("message",this.handleSocialConnection,!1);try{if(this.authConnector&&!this.connecting){this.socialWindow&&(this.socialWindow.close(),n.Uj.setSocialWindow(void 0,n.WB.state.activeChain)),this.connecting=!0,this.updateMessage();let t=e.data.resultUri;this.socialProvider&&n.En.sendEvent({type:"track",event:"SOCIAL_LOGIN_REQUEST_USER_DATA",properties:{provider:this.socialProvider}}),await this.authConnector.provider.connectSocial(t),this.socialProvider&&(n.iT.setConnectedSocialProvider(this.socialProvider),await n.x4.connectExternal(this.authConnector,this.authConnector.chain),n.En.sendEvent({type:"track",event:"SOCIAL_LOGIN_SUCCESS",properties:{provider:this.socialProvider}}))}}catch(e){this.error=!0,this.updateMessage(),this.socialProvider&&n.En.sendEvent({type:"track",event:"SOCIAL_LOGIN_ERROR",properties:{provider:this.socialProvider}})}}else n.IN.goBack(),n.Pt.showError("Untrusted Origin"),this.socialProvider&&n.En.sendEvent({type:"track",event:"SOCIAL_LOGIN_ERROR",properties:{provider:this.socialProvider}})}},this.unsubscribe.push(n.Uj.subscribe(e=>{e.socialProvider&&(this.socialProvider=e.socialProvider),e.socialWindow&&(this.socialWindow=e.socialWindow),e.address&&n.W3.state.open&&n.W3.close()})),this.authConnector&&this.connectSocial()}disconnectedCallback(){this.unsubscribe.forEach(e=>e()),window.removeEventListener("message",this.handleSocialConnection,!1)}render(){return(0,a.qy)` ${this.error?null:this.loaderTemplate()} Log in with ${this.socialProvider??"Social"} ${this.message} `}loaderTemplate(){let e=n.Wn.state.themeVariables["--w3m-border-radius-master"],t=e?parseInt(e.replace("px",""),10):4;return(0,a.qy)``}connectSocial(){let e=setInterval(()=>{this.socialWindow?.closed&&(this.connecting||"ConnectingSocial"!==n.IN.state.view||(this.socialProvider&&n.En.sendEvent({type:"track",event:"SOCIAL_LOGIN_CANCELED",properties:{provider:this.socialProvider}}),n.IN.goBack()),clearInterval(e))},1e3);window.addEventListener("message",this.handleSocialConnection,!1)}updateMessage(){this.error?this.message="Something went wrong":this.connecting?this.message="Retrieving user data":this.message="Connect in the provider window"}};tO.styles=tP,tR([(0,o.wk)()],tO.prototype,"socialProvider",void 0),tR([(0,o.wk)()],tO.prototype,"socialWindow",void 0),tR([(0,o.wk)()],tO.prototype,"error",void 0),tR([(0,o.wk)()],tO.prototype,"connecting",void 0),tR([(0,o.wk)()],tO.prototype,"message",void 0),tO=tR([(0,r.customElement)("w3m-connecting-social-view")],tO);let tM=(0,a.AH)` wui-flex { width: 100%; } wui-icon-link { margin-right: calc(var(--wui-icon-box-size-md) * -1); } .account-links { display: flex; justify-content: space-between; align-items: center; } .account-links wui-flex { cursor: pointer; display: flex; align-items: center; justify-content: center; flex: 1; background: red; align-items: center; justify-content: center; height: 48px; padding: 10px; flex: 1 0 0; border-radius: var(--XS, 16px); border: 1px solid var(--dark-accent-glass-010, rgba(71, 161, 255, 0.1)); background: var(--dark-accent-glass-010, rgba(71, 161, 255, 0.1)); transition: background-color var(--wui-ease-out-power-1) var(--wui-duration-md); will-change: background-color; } .account-links wui-flex:hover { background: var(--dark-accent-glass-015, rgba(71, 161, 255, 0.15)); } .account-links wui-flex wui-icon { width: var(--S, 20px); height: var(--S, 20px); } .account-links wui-flex wui-icon svg path { stroke: #47a1ff; } .account-settings-button { padding: calc(var(--wui-spacing-m) - 1px) var(--wui-spacing-2l); height: 40px; border-radius: var(--wui-border-radius-xxs); border: 1px solid var(--wui-color-gray-glass-002); background: var(--wui-color-gray-glass-002); cursor: pointer; } .account-settings-button:hover { background: var(--wui-color-gray-glass-005); } `;var tD=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o};let tU=class extends a.WF{constructor(){super(),this.usubscribe=[],this.address=n.Uj.state.address,this.profileImage=n.Uj.state.profileImage,this.profileName=n.Uj.state.profileName,this.accounts=n.Uj.state.allAccounts,this.loading=!1,this.usubscribe.push(n.Uj.subscribeKey("address",e=>{e?this.address=e:n.W3.close()})),this.usubscribe.push(n.Uj.subscribeKey("profileImage",e=>{this.profileImage=e})),this.usubscribe.push(n.Uj.subscribeKey("profileName",e=>{this.profileName=e}))}disconnectedCallback(){this.usubscribe.forEach(e=>e())}render(){if(!this.address)throw Error("w3m-profile-view: No account provided");return(0,a.qy)` ${this.profileName?r.UiHelperUtil.getTruncateString({string:this.profileName,charsStart:20,charsEnd:0,truncate:"end"}):r.UiHelperUtil.getTruncateString({string:this.address,charsStart:4,charsEnd:6,truncate:"middle"})} ${this.accountsTemplate()} `}accountsTemplate(){return(0,a.qy)` Your accounts ${this.accounts.map(e=>this.accountTemplate(e))} `}async onSwitchAccount(e){this.loading=!0,n.aK.getAuthConnector()&&await n.x4.setPreferredAccountType(e.type),n.Uj.setShouldUpdateToAddress(e.address,n.WB.state.activeChain),this.loading=!1}accountTemplate(e){return(0,a.qy)` ${e.address===this.address?"":(0,a.qy)`this.onSwitchAccount(e)} .loading=${this.loading} >Switch`} `}onCopyAddress(){try{this.profileName?(n.wE.copyToClopboard(this.profileName),n.Pt.showSuccess("Name copied")):this.address&&(n.wE.copyToClopboard(this.address),n.Pt.showSuccess("Address copied"))}catch{n.Pt.showError("Failed to copy")}}};tU.styles=tM,tD([(0,o.wk)()],tU.prototype,"address",void 0),tD([(0,o.wk)()],tU.prototype,"profileImage",void 0),tD([(0,o.wk)()],tU.prototype,"profileName",void 0),tD([(0,o.wk)()],tU.prototype,"accounts",void 0),tD([(0,o.wk)()],tU.prototype,"loading",void 0),tU=tD([(0,r.customElement)("w3m-profile-view")],tU);let t$=(0,a.AH)` wui-avatar { width: var(--wui-spacing-3xl); height: var(--wui-spacing-3xl); box-shadow: 0 0 0 0; } wui-icon-box { position: relative; right: 15px; top: 15px; border: 2px solid var(--wui-color-bg-150); background-color: var(--wui-color-bg-125); } `;var tL=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o};let tj=class extends a.WF{constructor(){super(),this.metadata=n.Hd.state.metadata,this.allAccounts=n.Uj.state.allAccounts||[],this.balances={},this.labels=n.Uj.state.addressLabels,this.currentAddress=n.Uj.state.address||"",this.connectedConnector=n.iT.getConnectedConnector(),this.shouldShowIcon="AUTH"===this.connectedConnector,this.caipNetwork=n.WB.state.activeCaipNetwork,n.Uj.subscribeKey("allAccounts",e=>{this.allAccounts=e})}connectedCallback(){super.connectedCallback(),this.allAccounts.forEach(e=>{n.TP.getBalance(e.address,this.caipNetwork?.caipNetworkId).then(t=>{let i=this.balances[e.address]||0;t.balances.length>0&&(i=t.balances.reduce((e,t)=>e+(t?.value||0),0)),this.balances[e.address]=i,this.requestUpdate()})})}getAddressIcon(e){return"smartAccount"===e?"lightbulb":"mail"}render(){return(0,a.qy)` ${this.allAccounts.map((e,t)=>this.getAddressTemplate(e,t))} `}getAddressTemplate(e,t){let i=this.labels?.get(e.address);return(0,a.qy)` ${this.shouldShowIcon?(0,a.qy)``:(0,a.qy)``} ${i||r.UiHelperUtil.getTruncateString({string:e.address,charsStart:4,charsEnd:6,truncate:"middle"})} ${"number"==typeof this.balances[e.address]?`$${this.balances[e.address]?.toFixed(2)}`:(0,a.qy)``} ${e.address?.toLowerCase()===this.currentAddress?.toLowerCase()?"":(0,a.qy)` this.onSwitchAddress(e.address)} >Switch to `} `}onSwitchAddress(e){let t=n.WB.state.activeCaipNetwork,i=t?.chainNamespace,r=`${i}:${t?.id}:${e}`;n.Uj.setCaipAddress(r,i),n.W3.close()}};tj.styles=t$,tL([(0,o.wk)()],tj.prototype,"allAccounts",void 0),tL([(0,o.wk)()],tj.prototype,"balances",void 0),tj=tL([(0,r.customElement)("w3m-switch-address-view")],tj);let tB=(0,a.AH)` @keyframes fadein { from { opacity: 0; } to { opacity: 1; } } wui-shimmer { width: 100%; aspect-ratio: 1 / 1; border-radius: clamp(0px, var(--wui-border-radius-l), 40px) !important; } wui-qr-code { opacity: 0; animation-duration: 200ms; animation-timing-function: ease; animation-name: fadein; animation-fill-mode: forwards; } wui-logo { width: 80px; height: 80px; border-radius: var(--wui-border-radius-m); } wui-flex:first-child:not(:only-child) { position: relative; } wui-loading-thumbnail { position: absolute; } wui-icon-box { position: absolute; right: calc(var(--wui-spacing-3xs) * -1); bottom: calc(var(--wui-spacing-3xs) * -1); opacity: 0; transform: scale(0.5); transition: all var(--wui-ease-out-power-2) var(--wui-duration-lg); } `;var tW=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o};let tq=class extends a.WF{constructor(){super(),this.unsubscribe=[],this.timeout=void 0,this.socialProvider=n.Uj.state.socialProvider,this.uri=n.Uj.state.farcasterUrl,this.ready=!1,this.loading=!1,this.authConnector=n.aK.getAuthConnector(),this.forceUpdate=()=>{this.requestUpdate()},this.unsubscribe.push(n.Uj.subscribeKey("farcasterUrl",e=>{e&&(this.uri=e,this.connectFarcaster())}),n.Uj.subscribeKey("socialProvider",e=>{e&&(this.socialProvider=e)})),window.addEventListener("resize",this.forceUpdate)}disconnectedCallback(){super.disconnectedCallback(),clearTimeout(this.timeout),window.removeEventListener("resize",this.forceUpdate)}render(){return this.onRenderProxy(),(0,a.qy)`${this.platformTemplate()}`}platformTemplate(){return n.wE.isMobile()?(0,a.qy)`${this.mobileTemplate()}`:(0,a.qy)`${this.desktopTemplate()}`}desktopTemplate(){return this.loading?(0,a.qy)`${this.loadingTemplate()}`:(0,a.qy)`${this.qrTemplate()}`}qrTemplate(){return(0,a.qy)` ${this.qrCodeTemplate()} Scan this QR Code with your phone ${this.copyTemplate()} `}loadingTemplate(){return(0,a.qy)` ${this.loaderTemplate()} Loading user data Please wait a moment while we load your data. `}mobileTemplate(){return(0,a.qy)` ${this.loaderTemplate()} Continue in Farcaster Accept connection request in the app ${this.mobileLinkTemplate()} `}loaderTemplate(){let e=n.Wn.state.themeVariables["--w3m-border-radius-master"],t=e?parseInt(e.replace("px",""),10):4;return(0,a.qy)``}async connectFarcaster(){if(this.authConnector)try{await this.authConnector?.provider.connectFarcaster(),this.socialProvider&&n.iT.setConnectedSocialProvider(this.socialProvider),this.loading=!0,await n.x4.connectExternal(this.authConnector,this.authConnector.chain),this.loading=!1,n.W3.close()}catch(e){n.IN.goBack(),n.Pt.showError(e)}}mobileLinkTemplate(){return(0,a.qy)`{this.uri&&n.wE.openHref(this.uri,"_blank")}} > Open farcaster`}onRenderProxy(){!this.ready&&this.uri&&(this.timeout=setTimeout(()=>{this.ready=!0},0))}qrCodeTemplate(){if(!this.uri||!this.ready)return null;let e=this.getBoundingClientRect().width-40;return(0,a.qy)` `}copyTemplate(){let e=!this.uri||!this.ready;return(0,a.qy)` Copy link `}onCopyUri(){try{this.uri&&(n.wE.copyToClopboard(this.uri),n.Pt.showSuccess("Link copied"))}catch{n.Pt.showError("Failed to copy")}}};tq.styles=tB,tW([(0,o.wk)()],tq.prototype,"socialProvider",void 0),tW([(0,o.wk)()],tq.prototype,"uri",void 0),tW([(0,o.wk)()],tq.prototype,"ready",void 0),tW([(0,o.wk)()],tq.prototype,"loading",void 0),tq=tW([(0,r.customElement)("w3m-connecting-farcaster-view")],tq);var tH=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o};let tz=class extends a.WF{constructor(){super(...arguments),this.dappName=n.Hd.state.metadata?.name,this.isCancelling=!1,this.isSigning=!1}render(){return(0,a.qy)` ${this.dappName??"Dapp"} needs to connect to your wallet Sign this message to prove you own this wallet and proceed. Canceling will disconnect you. ${this.isCancelling?"Cancelling...":"Cancel"} ${this.isSigning?"Signing...":"Sign"} `}async onSign(){this.isSigning=!0,await n.UG.requestSignMessage().finally(()=>this.isSigning=!1)}async onCancel(){this.isCancelling=!0,await n.UG.cancelSignMessage().finally(()=>this.isCancelling=!1)}};tH([(0,o.wk)()],tz.prototype,"isCancelling",void 0),tH([(0,o.wk)()],tz.prototype,"isSigning",void 0),tz=tH([(0,r.customElement)("w3m-siwx-sign-message-view")],tz);let tF=(0,a.AH)` wui-grid { max-height: clamp(360px, 400px, 80vh); overflow: scroll; scrollbar-width: none; grid-auto-rows: min-content; grid-template-columns: repeat(auto-fill, 104px); } @media (max-width: 350px) { wui-grid { grid-template-columns: repeat(2, 1fr); } } wui-grid[data-scroll='false'] { overflow: hidden; } wui-grid::-webkit-scrollbar { display: none; } wui-loading-spinner { padding-top: var(--wui-spacing-l); padding-bottom: var(--wui-spacing-l); justify-content: center; grid-column: 1 / span 4; } `,tZ={filterOutDuplicatesByRDNS(e){let t=n.Hd.state.enableEIP6963?n.aK.state.connectors:[],i=n.iT.getRecentWallets(),r=t.map(e=>e.info?.rdns).filter(Boolean),a=i.map(e=>e.rdns).filter(Boolean),o=r.concat(a);if(o.includes("io.metamask.mobile")&&n.wE.isMobile()){let e=o.indexOf("io.metamask.mobile");o[e]="io.metamask"}return e.filter(e=>!o.includes(String(e?.rdns)))},filterOutDuplicatesByIds(e){let t=n.aK.state.connectors.filter(e=>"ANNOUNCED"===e.type||"INJECTED"===e.type),i=n.iT.getRecentWallets(),r=t.map(e=>e.explorerId),a=i.map(e=>e.id),o=r.concat(a);return e.filter(e=>!o.includes(e?.id))},filterOutDuplicateWallets(e){let t=this.filterOutDuplicatesByRDNS(e);return this.filterOutDuplicatesByIds(t)},markWalletsAsInstalled(e){let{connectors:t}=n.aK.state,i=t.filter(e=>"ANNOUNCED"===e.type).reduce((e,t)=>(t.info?.rdns&&(e[t.info.rdns]=!0),e),{});return e.map(e=>({...e,installed:!!e.rdns&&!!i[e.rdns??""]})).sort((e,t)=>Number(t.installed)-Number(e.installed))}};var tV=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o};let tK="local-paginator",tG=class extends a.WF{constructor(){super(),this.unsubscribe=[],this.paginationObserver=void 0,this.initial=!n.Np.state.wallets.length,this.wallets=n.Np.state.wallets,this.recommended=n.Np.state.recommended,this.featured=n.Np.state.featured,this.unsubscribe.push(n.Np.subscribeKey("wallets",e=>this.wallets=e),n.Np.subscribeKey("recommended",e=>this.recommended=e),n.Np.subscribeKey("featured",e=>this.featured=e))}firstUpdated(){this.initialFetch(),this.createPaginationObserver()}disconnectedCallback(){this.unsubscribe.forEach(e=>e()),this.paginationObserver?.disconnect()}render(){return(0,a.qy)` ${this.initial?this.shimmerTemplate(16):this.walletsTemplate()} ${this.paginationLoaderTemplate()} `}async initialFetch(){let e=this.shadowRoot?.querySelector("wui-grid");this.initial&&e&&(await n.Np.fetchWallets({page:1}),await e.animate([{opacity:1},{opacity:0}],{duration:200,fill:"forwards",easing:"ease"}).finished,this.initial=!1,e.animate([{opacity:0},{opacity:1}],{duration:200,fill:"forwards",easing:"ease"}))}shimmerTemplate(e,t){return[...Array(e)].map(()=>(0,a.qy)` `)}walletsTemplate(){let e=[...this.featured,...this.recommended,...this.wallets];return tZ.markWalletsAsInstalled(e).map(e=>(0,a.qy)` this.onConnectWallet(e)} .wallet=${e} > `)}paginationLoaderTemplate(){let{wallets:e,recommended:t,featured:i,count:r}=n.Np.state,a=window.innerWidth<352?3:4,o=e.length+t.length,s=Math.ceil(o/a)*a-o+a;return(s-=e.length?i.length%a:0,0===r&&i.length>0)?null:0===r||[...i,...e,...t].length{if(e?.isIntersecting&&!this.initial){let{page:e,count:t,wallets:i}=n.Np.state;i.length wui-flex > wui-text { color: var(--wui-color-fg-100); max-width: 86px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; justify-content: center; } button > wui-flex > wui-text.certified { max-width: 66px; } button:hover:enabled { background-color: var(--wui-color-gray-glass-005); } button:disabled > wui-flex > wui-text { color: var(--wui-color-gray-glass-015); } [data-selected='true'] { background-color: var(--wui-color-accent-glass-020); } @media (hover: hover) and (pointer: fine) { [data-selected='true']:hover:enabled { background-color: var(--wui-color-accent-glass-015); } } [data-selected='true']:active:enabled { background-color: var(--wui-color-accent-glass-010); } @media (max-width: 350px) { button { width: 100%; } } `;var tY=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o};let tQ=class extends a.WF{constructor(){super(),this.observer=new IntersectionObserver(()=>void 0),this.visible=!1,this.imageSrc=void 0,this.imageLoading=!1,this.wallet=void 0,this.observer=new IntersectionObserver(e=>{e.forEach(e=>{e.isIntersecting?(this.visible=!0,this.fetchImageSrc()):this.visible=!1})},{threshold:.01})}firstUpdated(){this.observer.observe(this)}disconnectedCallback(){this.observer.disconnect()}render(){let e=this.wallet?.badge_type==="certified";return(0,a.qy)` `}imageTemplate(){return(this.visible||this.imageSrc)&&!this.imageLoading?(0,a.qy)` `:this.shimmerTemplate()}shimmerTemplate(){return(0,a.qy)``}async fetchImageSrc(){this.wallet&&(this.imageSrc=n.$m.getWalletImage(this.wallet),this.imageSrc||(this.imageLoading=!0,this.imageSrc=await n.$m.fetchWalletImage(this.wallet.image_id),this.imageLoading=!1))}};tQ.styles=tJ,tY([(0,o.wk)()],tQ.prototype,"visible",void 0),tY([(0,o.wk)()],tQ.prototype,"imageSrc",void 0),tY([(0,o.wk)()],tQ.prototype,"imageLoading",void 0),tY([(0,o.MZ)()],tQ.prototype,"wallet",void 0),tQ=tY([(0,r.customElement)("w3m-all-wallets-list-item")],tQ);let tX=(0,a.AH)` wui-grid, wui-loading-spinner, wui-flex { height: 360px; } wui-grid { overflow: scroll; scrollbar-width: none; grid-auto-rows: min-content; grid-template-columns: repeat(auto-fill, 104px); } wui-grid[data-scroll='false'] { overflow: hidden; } wui-grid::-webkit-scrollbar { display: none; } wui-loading-spinner { justify-content: center; align-items: center; } @media (max-width: 350px) { wui-grid { grid-template-columns: repeat(2, 1fr); } } `;var t0=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o};let t1=class extends a.WF{constructor(){super(...arguments),this.prevQuery="",this.prevBadge=void 0,this.loading=!0,this.query=""}render(){return this.onSearch(),this.loading?(0,a.qy)``:this.walletsTemplate()}async onSearch(){(this.query.trim()!==this.prevQuery.trim()||this.badge!==this.prevBadge)&&(this.prevQuery=this.query,this.prevBadge=this.badge,this.loading=!0,await n.Np.searchWallet({search:this.query,badge:this.badge}),this.loading=!1)}walletsTemplate(){let{search:e}=n.Np.state,t=tZ.markWalletsAsInstalled(e);return e.length?(0,a.qy)` ${t.map(e=>(0,a.qy)` this.onConnectWallet(e)} .wallet=${e} data-testid="wallet-search-item-${e.id}" > `)} `:(0,a.qy)` No Wallet found `}onConnectWallet(e){let t=n.aK.getConnector(e.id,e.rdns);t?n.IN.push("ConnectingExternal",{connector:t}):n.IN.push("ConnectingWalletConnect",{wallet:e})}};t1.styles=tX,t0([(0,o.wk)()],t1.prototype,"loading",void 0),t0([(0,o.MZ)()],t1.prototype,"query",void 0),t0([(0,o.MZ)()],t1.prototype,"badge",void 0),t1=t0([(0,r.customElement)("w3m-all-wallets-search")],t1);var t2=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o};let t3=class extends a.WF{constructor(){super(),this.platformTabs=[],this.unsubscribe=[],this.platforms=[],this.onSelectPlatfrom=void 0,this.buffering=!1,this.unsubscribe.push(n.x4.subscribeKey("buffering",e=>this.buffering=e))}disconnectCallback(){this.unsubscribe.forEach(e=>e())}render(){let e=this.generateTabs();return(0,a.qy)` `}generateTabs(){let e=this.platforms.map(e=>"browser"===e?{label:"Browser",icon:"extension",platform:"browser"}:"mobile"===e?{label:"Mobile",icon:"mobile",platform:"mobile"}:"qrcode"===e?{label:"Mobile",icon:"mobile",platform:"qrcode"}:"web"===e?{label:"Webapp",icon:"browser",platform:"web"}:"desktop"===e?{label:"Desktop",icon:"desktop",platform:"desktop"}:{label:"Browser",icon:"extension",platform:"unsupported"});return this.platformTabs=e.map(({platform:e})=>e),e}onTabChange(e){let t=this.platformTabs[e];t&&this.onSelectPlatfrom?.(t)}};t2([(0,o.MZ)({type:Array})],t3.prototype,"platforms",void 0),t2([(0,o.MZ)()],t3.prototype,"onSelectPlatfrom",void 0),t2([(0,o.wk)()],t3.prototype,"buffering",void 0),t3=t2([(0,r.customElement)("w3m-connecting-header")],t3);let t5=class extends Q{constructor(){if(super(),!this.wallet)throw Error("w3m-connecting-wc-browser: No wallet provided");this.onConnect=this.onConnectProxy.bind(this),this.onAutoConnect=this.onConnectProxy.bind(this),n.En.sendEvent({type:"track",event:"SELECT_WALLET",properties:{name:this.wallet.name,platform:"browser"}})}async onConnectProxy(){try{this.error=!1;let{connectors:e}=n.aK.state,t=e.find(e=>"ANNOUNCED"===e.type&&e.info?.rdns===this.wallet?.rdns||"INJECTED"===e.type||e.name===this.wallet?.name);if(t)await n.x4.connectExternal(t,t.chain);else throw Error("w3m-connecting-wc-browser: No connector found");n.W3.close(),n.En.sendEvent({type:"track",event:"CONNECT_SUCCESS",properties:{method:"browser",name:this.wallet?.name||"Unknown"}})}catch(e){n.En.sendEvent({type:"track",event:"CONNECT_ERROR",properties:{message:e?.message??"Unknown"}}),this.error=!0}}};t5=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o}([(0,r.customElement)("w3m-connecting-wc-browser")],t5);let t4=class extends Q{constructor(){if(super(),!this.wallet)throw Error("w3m-connecting-wc-desktop: No wallet provided");this.onConnect=this.onConnectProxy.bind(this),this.onRender=this.onRenderProxy.bind(this),n.En.sendEvent({type:"track",event:"SELECT_WALLET",properties:{name:this.wallet.name,platform:"desktop"}})}onRenderProxy(){!this.ready&&this.uri&&(this.ready=!0,this.onConnect?.())}onConnectProxy(){if(this.wallet?.desktop_link&&this.uri)try{this.error=!1;let{desktop_link:e,name:t}=this.wallet,{redirect:i,href:r}=n.wE.formatNativeUrl(e,this.uri);n.x4.setWcLinking({name:t,href:r}),n.x4.setRecentWallet(this.wallet),n.wE.openHref(i,"_blank")}catch{this.error=!0}}};t4=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o}([(0,r.customElement)("w3m-connecting-wc-desktop")],t4);let t6=class extends Q{constructor(){if(super(),this.btnLabelTimeout=void 0,this.labelTimeout=void 0,!this.wallet)throw Error("w3m-connecting-wc-mobile: No wallet provided");this.secondaryBtnLabel=void 0,this.secondaryLabel=n.oU.CONNECT_LABELS.MOBILE,this.onConnect=this.onConnectProxy.bind(this),this.onRender=this.onRenderProxy.bind(this),document.addEventListener("visibilitychange",this.onBuffering.bind(this)),n.En.sendEvent({type:"track",event:"SELECT_WALLET",properties:{name:this.wallet.name,platform:"mobile"}}),this.btnLabelTimeout=setTimeout(()=>{this.secondaryBtnLabel="Try again",this.secondaryLabel=n.oU.CONNECT_LABELS.MOBILE},n.oU.FIVE_SEC_MS),this.labelTimeout=setTimeout(()=>{this.secondaryLabel="Hold tight... it's taking longer than expected"},n.oU.THREE_SEC_MS)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("visibilitychange",this.onBuffering.bind(this)),clearTimeout(this.btnLabelTimeout),clearTimeout(this.labelTimeout)}onRenderProxy(){!this.ready&&this.uri&&(this.ready=!0,this.onConnect?.())}onConnectProxy(){if(this.wallet?.mobile_link&&this.uri)try{this.error=!1;let{mobile_link:e,name:t}=this.wallet,{redirect:i,href:r}=n.wE.formatNativeUrl(e,this.uri);n.x4.setWcLinking({name:t,href:r}),n.x4.setRecentWallet(this.wallet),n.wE.openHref(i,"_self"),clearTimeout(this.labelTimeout),this.secondaryLabel=n.oU.CONNECT_LABELS.MOBILE}catch(e){n.En.sendEvent({type:"track",event:"CONNECT_PROXY_ERROR",properties:{message:e instanceof Error?e.message:"Error parsing the deeplink",uri:this.uri,mobile_link:this.wallet.mobile_link,name:this.wallet.name}}),this.error=!0}}onBuffering(){let e=n.wE.isIos();document?.visibilityState==="visible"&&!this.error&&e&&(n.x4.setBuffering(!0),setTimeout(()=>{n.x4.setBuffering(!1)},5e3))}};t6=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o}([(0,r.customElement)("w3m-connecting-wc-mobile")],t6);let t8=(0,a.AH)` @keyframes fadein { from { opacity: 0; } to { opacity: 1; } } wui-shimmer { width: 100%; aspect-ratio: 1 / 1; border-radius: clamp(0px, var(--wui-border-radius-l), 40px) !important; } wui-qr-code { opacity: 0; animation-duration: 200ms; animation-timing-function: ease; animation-name: fadein; animation-fill-mode: forwards; } `,t9=class extends Q{constructor(){super(),this.forceUpdate=()=>{this.requestUpdate()},window.addEventListener("resize",this.forceUpdate),n.En.sendEvent({type:"track",event:"SELECT_WALLET",properties:{name:this.wallet?.name??"WalletConnect",platform:"qrcode"}})}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener("resize",this.forceUpdate)}render(){return this.onRenderProxy(),(0,a.qy)` ${this.qrCodeTemplate()} Scan this QR Code with your phone ${this.copyTemplate()} `}onRenderProxy(){!this.ready&&this.uri&&(this.timeout=setTimeout(()=>{this.ready=!0},200))}qrCodeTemplate(){if(!this.uri||!this.ready)return null;let e=this.getBoundingClientRect().width-40,t=this.wallet?this.wallet.name:void 0;return n.x4.setWcLinking(void 0),n.x4.setRecentWallet(this.wallet),(0,a.qy)` `}copyTemplate(){let e=!this.uri||!this.ready;return(0,a.qy)` Copy link `}};t9.styles=t8,t9=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o}([(0,r.customElement)("w3m-connecting-wc-qrcode")],t9);let t7=class extends a.WF{constructor(){if(super(),this.wallet=n.IN.state.data?.wallet,!this.wallet)throw Error("w3m-connecting-wc-unsupported: No wallet provided");n.En.sendEvent({type:"track",event:"SELECT_WALLET",properties:{name:this.wallet.name,platform:"browser"}})}render(){return(0,a.qy)` Not Detected `}};t7=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o}([(0,r.customElement)("w3m-connecting-wc-unsupported")],t7);let ie=class extends Q{constructor(){if(super(),!this.wallet)throw Error("w3m-connecting-wc-web: No wallet provided");this.onConnect=this.onConnectProxy.bind(this),this.secondaryBtnLabel="Open",this.secondaryLabel="Open and continue in a new browser tab",this.secondaryBtnIcon="externalLink",n.En.sendEvent({type:"track",event:"SELECT_WALLET",properties:{name:this.wallet.name,platform:"web"}})}onConnectProxy(){if(this.wallet?.webapp_link&&this.uri)try{this.error=!1;let{webapp_link:e,name:t}=this.wallet,{redirect:i,href:r}=n.wE.formatUniversalUrl(e,this.uri);n.x4.setWcLinking({name:t,href:r}),n.x4.setRecentWallet(this.wallet),n.wE.openHref(i,"_blank")}catch{this.error=!0}}};ie=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o}([(0,r.customElement)("w3m-connecting-wc-web")],ie);let it=(0,a.AH)` :host { width: 100%; } .details-container > wui-flex { background: var(--wui-color-gray-glass-002); border-radius: var(--wui-border-radius-xxs); width: 100%; } .details-container > wui-flex > button { border: none; background: none; padding: var(--wui-spacing-s); border-radius: var(--wui-border-radius-xxs); cursor: pointer; } .details-content-container { padding: var(--wui-spacing-1xs); padding-top: 0px; display: flex; align-items: center; justify-content: center; } .details-content-container > wui-flex { width: 100%; } .details-row { width: 100%; padding: var(--wui-spacing-s); padding-left: var(--wui-spacing-s); padding-right: var(--wui-spacing-1xs); border-radius: calc(var(--wui-border-radius-5xs) + var(--wui-border-radius-4xs)); background: var(--wui-color-gray-glass-002); } .details-row-title { white-space: nowrap; } .details-row.provider-free-row { padding-right: var(--wui-spacing-xs); } `;var ii=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o};let ir=n.oU.CONVERT_SLIPPAGE_TOLERANCE,ia=class extends a.WF{constructor(){super(),this.unsubscribe=[],this.networkName=n.WB.state.activeCaipNetwork?.name,this.detailsOpen=!1,this.sourceToken=n.GN.state.sourceToken,this.toToken=n.GN.state.toToken,this.toTokenAmount=n.GN.state.toTokenAmount,this.sourceTokenPriceInUSD=n.GN.state.sourceTokenPriceInUSD,this.toTokenPriceInUSD=n.GN.state.toTokenPriceInUSD,this.gasPriceInUSD=n.GN.state.gasPriceInUSD,this.priceImpact=n.GN.state.priceImpact,this.maxSlippage=n.GN.state.maxSlippage,this.networkTokenSymbol=n.GN.state.networkTokenSymbol,this.inputError=n.GN.state.inputError,this.unsubscribe.push(n.GN.subscribe(e=>{this.sourceToken=e.sourceToken,this.toToken=e.toToken,this.toTokenAmount=e.toTokenAmount,this.gasPriceInUSD=e.gasPriceInUSD,this.priceImpact=e.priceImpact,this.maxSlippage=e.maxSlippage,this.sourceTokenPriceInUSD=e.sourceTokenPriceInUSD,this.toTokenPriceInUSD=e.toTokenPriceInUSD,this.inputError=e.inputError}))}render(){let e=this.toTokenAmount&&this.maxSlippage?et.Se.bigNumber(this.toTokenAmount).minus(this.maxSlippage).toString():null;if(!this.sourceToken||!this.toToken||this.inputError)return null;let t=this.sourceTokenPriceInUSD&&this.toTokenPriceInUSD?1/this.toTokenPriceInUSD*this.sourceTokenPriceInUSD:0;return(0,a.qy)` ${this.detailsOpen?(0,a.qy)` Network cost $${r.UiHelperUtil.formatNumberToLocalString(this.gasPriceInUSD,3)} ${this.priceImpact?(0,a.qy)` Price impact ${r.UiHelperUtil.formatNumberToLocalString(this.priceImpact,3)}% `:null} ${this.maxSlippage&&this.sourceToken.symbol?(0,a.qy)` Max. slippage ${r.UiHelperUtil.formatNumberToLocalString(this.maxSlippage,6)} ${this.toToken.symbol} ${ir}% `:null} Provider fee 0.85% `:null} `}toggleDetails(){this.detailsOpen=!this.detailsOpen}};ia.styles=[it],ii([(0,o.wk)()],ia.prototype,"networkName",void 0),ii([(0,o.MZ)()],ia.prototype,"detailsOpen",void 0),ii([(0,o.wk)()],ia.prototype,"sourceToken",void 0),ii([(0,o.wk)()],ia.prototype,"toToken",void 0),ii([(0,o.wk)()],ia.prototype,"toTokenAmount",void 0),ii([(0,o.wk)()],ia.prototype,"sourceTokenPriceInUSD",void 0),ii([(0,o.wk)()],ia.prototype,"toTokenPriceInUSD",void 0),ii([(0,o.wk)()],ia.prototype,"gasPriceInUSD",void 0),ii([(0,o.wk)()],ia.prototype,"priceImpact",void 0),ii([(0,o.wk)()],ia.prototype,"maxSlippage",void 0),ii([(0,o.wk)()],ia.prototype,"networkTokenSymbol",void 0),ii([(0,o.wk)()],ia.prototype,"inputError",void 0),ia=ii([(0,r.customElement)("w3m-swap-details")],ia);let io=(0,a.AH)` :host > wui-flex { display: flex; flex-direction: row; justify-content: space-between; align-items: center; border-radius: var(--wui-border-radius-s); background-color: var(--wui-color-gray-glass-002); padding: var(--wui-spacing-xl); padding-right: var(--wui-spacing-s); width: 100%; height: 100px; box-sizing: border-box; box-shadow: inset 0px 0px 0px 1px var(--wui-color-gray-glass-002); position: relative; transition: box-shadow var(--wui-ease-out-power-1) var(--wui-duration-lg); will-change: background-color; } :host wui-flex.focus { box-shadow: inset 0px 0px 0px 1px var(--wui-color-gray-glass-005); } :host > wui-flex .swap-input, :host > wui-flex .swap-token-button { z-index: 10; } :host > wui-flex .swap-input { -webkit-mask-image: linear-gradient( 270deg, transparent 0px, transparent 8px, black 24px, black 25px, black 32px, black 100% ); mask-image: linear-gradient( 270deg, transparent 0px, transparent 8px, black 24px, black 25px, black 32px, black 100% ); } :host > wui-flex .swap-input input { background: none; border: none; height: 42px; width: 100%; font-size: 32px; font-style: normal; font-weight: 400; line-height: 130%; letter-spacing: -1.28px; outline: none; caret-color: var(--wui-color-accent-100); color: var(--wui-color-fg-100); padding: 0px; } :host > wui-flex .swap-input input:focus-visible { outline: none; } :host > wui-flex .swap-input input::-webkit-outer-spin-button, :host > wui-flex .swap-input input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; } .max-value-button { background-color: transparent; border: none; cursor: pointer; color: var(--wui-color-gray-glass-020); padding-left: 0px; } .market-value { min-height: 18px; } `;var is=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o};let ic=class extends a.WF{constructor(){super(...arguments),this.focused=!1,this.price=0,this.target="sourceToken",this.onSetAmount=null,this.onSetMaxValue=null}render(){let e=this.marketValue||"0",t=et.Se.bigNumber(e).isGreaterThan("0");return(0,a.qy)` this.onFocusChange(!0)} @focusout=${()=>this.onFocusChange(!1)} ?disabled=${this.disabled} .value=${this.value} @input=${this.dispatchInputChangeEvent} @keydown=${this.handleKeydown} placeholder="0" type="text" inputmode="decimal" /> ${t?`$${r.UiHelperUtil.formatNumberToLocalString(this.marketValue,3)}`:null} ${this.templateTokenSelectButton()} `}handleKeydown(e){return et.t$.numericInputKeyDown(e,this.value,e=>this.onSetAmount?.(this.target,e))}dispatchInputChangeEvent(e){if(!this.onSetAmount)return;let t=e.target.value.replace(/[^0-9.]/gu,"");","===t||"."===t?this.onSetAmount(this.target,"0."):t.endsWith(",")?this.onSetAmount(this.target,t.replace(",",".")):this.onSetAmount(this.target,t)}setMaxValueToInput(){this.onSetMaxValue?.(this.target,this.balance)}templateTokenSelectButton(){return this.token?(0,a.qy)` ${this.tokenBalanceTemplate()} `:(0,a.qy)` Select token `}tokenBalanceTemplate(){let e=et.Se.multiply(this.balance,this.price),t=!!e&&e?.isGreaterThan(5e-5);return(0,a.qy)` ${t?(0,a.qy)` ${r.UiHelperUtil.formatNumberToLocalString(this.balance,3)} `:null} ${"sourceToken"===this.target?this.tokenActionButtonTemplate(t):null} `}tokenActionButtonTemplate(e){return e?(0,a.qy)` `:(0,a.qy)` `}onFocusChange(e){this.focused=e}onSelectToken(){n.En.sendEvent({type:"track",event:"CLICK_SELECT_TOKEN_TO_SWAP"}),n.IN.push("SwapSelectToken",{target:this.target})}onBuyToken(){n.IN.push("OnRampProviders")}};ic.styles=[io],is([(0,o.MZ)()],ic.prototype,"focused",void 0),is([(0,o.MZ)()],ic.prototype,"balance",void 0),is([(0,o.MZ)()],ic.prototype,"value",void 0),is([(0,o.MZ)()],ic.prototype,"price",void 0),is([(0,o.MZ)()],ic.prototype,"marketValue",void 0),is([(0,o.MZ)()],ic.prototype,"disabled",void 0),is([(0,o.MZ)()],ic.prototype,"target",void 0),is([(0,o.MZ)()],ic.prototype,"token",void 0),is([(0,o.MZ)()],ic.prototype,"onSetAmount",void 0),is([(0,o.MZ)()],ic.prototype,"onSetMaxValue",void 0),ic=is([(0,r.customElement)("w3m-swap-input")],ic);let il=(0,a.AH)` :host { width: 100%; } :host > wui-flex { display: flex; flex-direction: row; justify-content: space-between; align-items: center; border-radius: var(--wui-border-radius-s); padding: var(--wui-spacing-xl); padding-right: var(--wui-spacing-s); background-color: var(--wui-color-gray-glass-002); box-shadow: inset 0px 0px 0px 1px var(--wui-color-gray-glass-002); width: 100%; height: 100px; box-sizing: border-box; position: relative; } wui-shimmer.market-value { opacity: 0; } :host > wui-flex > svg.input_mask { position: absolute; inset: 0; z-index: 5; } :host wui-flex .input_mask__border, :host wui-flex .input_mask__background { transition: fill var(--wui-duration-md) var(--wui-ease-out-power-1); will-change: fill; } :host wui-flex .input_mask__border { fill: var(--wui-color-gray-glass-020); } :host wui-flex .input_mask__background { fill: var(--wui-color-gray-glass-002); } `;var iu=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o};let id=class extends a.WF{constructor(){super(...arguments),this.target="sourceToken"}render(){return(0,a.qy)` ${this.templateTokenSelectButton()} `}templateTokenSelectButton(){return(0,a.qy)` `}};id.styles=[il],iu([(0,o.MZ)()],id.prototype,"target",void 0),id=iu([(0,r.customElement)("w3m-swap-input-skeleton")],id);let ih=(0,a.AH)` :host { height: 64px; } wui-text { text-transform: capitalize; } wui-flex.w3m-header-title { transform: translateY(0); opacity: 1; } wui-flex.w3m-header-title[view-direction='prev'] { animation: slide-down-out 120ms forwards var(--wui-ease-out-power-2), slide-down-in 120ms forwards var(--wui-ease-out-power-2); animation-delay: 0ms, 200ms; } wui-flex.w3m-header-title[view-direction='next'] { animation: slide-up-out 120ms forwards var(--wui-ease-out-power-2), slide-up-in 120ms forwards var(--wui-ease-out-power-2); animation-delay: 0ms, 200ms; } wui-icon-link[data-hidden='true'] { opacity: 0 !important; pointer-events: none; } @keyframes slide-up-out { from { transform: translateY(0px); opacity: 1; } to { transform: translateY(3px); opacity: 0; } } @keyframes slide-up-in { from { transform: translateY(-3px); opacity: 0; } to { transform: translateY(0); opacity: 1; } } @keyframes slide-down-out { from { transform: translateY(0px); opacity: 1; } to { transform: translateY(-3px); opacity: 0; } } @keyframes slide-down-in { from { transform: translateY(3px); opacity: 0; } to { transform: translateY(0); opacity: 1; } } `;var ip=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o};let ig=["SmartSessionList"];function iw(){let e=n.IN.state.data?.connector?.name,t=n.IN.state.data?.wallet?.name,i=n.IN.state.data?.network?.name,r=t??e,a=n.aK.getConnectors(),o=1===a.length&&a[0]?.id==="w3m-email";return{Connect:`Connect ${o?"Email":""} Wallet`,Create:"Create Wallet",ChooseAccountName:void 0,Account:void 0,AccountSettings:void 0,AllWallets:"All Wallets",ApproveTransaction:"Approve Transaction",BuyInProgress:"Buy",ConnectingExternal:r??"Connect Wallet",ConnectingWalletConnect:r??"WalletConnect",ConnectingSiwe:"Sign In",Convert:"Convert",ConvertSelectToken:"Select token",ConvertPreview:"Preview convert",Downloads:r?`Get ${r}`:"Downloads",EmailVerifyOtp:"Confirm Email",EmailVerifyDevice:"Register Device",GetWallet:"Get a wallet",Networks:"Choose Network",OnRampProviders:"Choose Provider",OnRampActivity:"Activity",OnRampTokenSelect:"Select Token",OnRampFiatSelect:"Select Currency",Profile:void 0,SwitchNetwork:i??"Switch Network",SwitchAddress:"Switch Address",Transactions:"Activity",UnsupportedChain:"Switch Network",UpgradeEmailWallet:"Upgrade your Wallet",UpgradeToSmartAccount:void 0,UpdateEmailWallet:"Edit Email",UpdateEmailPrimaryOtp:"Confirm Current Email",UpdateEmailSecondaryOtp:"Confirm New Email",WhatIsABuy:"What is Buy?",RegisterAccountName:"Choose name",RegisterAccountNameSuccess:"",WalletReceive:"Receive",WalletCompatibleNetworks:"Compatible Networks",Swap:"Swap",SwapSelectToken:"Select token",SwapPreview:"Preview swap",WalletSend:"Send",WalletSendPreview:"Review send",WalletSendSelectToken:"Select Token",WhatIsANetwork:"What is a network?",WhatIsAWallet:"What is a wallet?",ConnectWallets:"Connect wallet",ConnectSocials:"All socials",ConnectingSocial:n.Uj.state.socialProvider?n.Uj.state.socialProvider:"Connect Social",ConnectingMultiChain:"Select chain",ConnectingFarcaster:"Farcaster",SwitchActiveChain:"Switch chain",SmartSessionCreated:void 0,SmartSessionList:"Smart Sessions",SIWXSignMessage:"Sign In"}}let im=class extends a.WF{constructor(){super(),this.unsubscribe=[],this.heading=iw()[n.IN.state.view],this.network=n.WB.state.activeCaipNetwork,this.buffering=!1,this.showBack=!1,this.prevHistoryLength=1,this.view=n.IN.state.view,this.viewDirection="",this.headerText=iw()[n.IN.state.view],this.unsubscribe.push(n.IN.subscribeKey("view",e=>{setTimeout(()=>{this.view=e,this.headerText=iw()[e]},I.ANIMATION_DURATIONS.HeaderText),this.onViewChange(),this.onHistoryChange()}),n.x4.subscribeKey("buffering",e=>this.buffering=e),n.WB.subscribeKey("activeCaipNetwork",e=>this.network=e))}disconnectCallback(){this.unsubscribe.forEach(e=>e())}render(){return(0,a.qy)` ${this.leftHeaderTemplate()} ${this.titleTemplate()} ${this.rightHeaderTemplate()} `}onWalletHelp(){n.En.sendEvent({type:"track",event:"CLICK_WALLET_HELP"}),n.IN.push("WhatIsAWallet")}async onClose(){"UnsupportedChain"===n.IN.state.view||await n.UG.isSIWXCloseDisabled()?n.W3.shake():n.W3.close()}rightHeaderTemplate(){let e=n.Hd?.state?.features?.smartSessions;return"Account"===n.IN.state.view&&e?(0,a.qy)` n.IN.push("SmartSessionList")} data-testid="w3m-header-smart-sessions" > ${this.closeButtonTemplate()} `:this.closeButtonTemplate()}closeButtonTemplate(){return(0,a.qy)` `}titleTemplate(){let e=ig.includes(this.view);return(0,a.qy)` ${this.headerText} ${e?(0,a.qy)`Beta`:null} `}leftHeaderTemplate(){let{view:e}=n.IN.state;return"Account"===e?(0,a.qy)``:this.showBack&&!("ApproveTransaction"===e||"UpgradeToSmartAccount"===e||"ConnectingSiwe"===e)?(0,a.qy)``:(0,a.qy)``}onNetworks(){this.isAllowedNetworkSwitch()&&(n.En.sendEvent({type:"track",event:"CLICK_NETWORKS"}),n.IN.push("Networks"))}isAllowedNetworkSwitch(){let e=n.WB.getAllRequestedCaipNetworks(),t=!!e&&e.length>1,i=e?.find(({id:e})=>e===this.network?.id);return t||!i}getPadding(){return this.heading?["l","2l","l","2l"]:["0","2l","0","2l"]}onViewChange(){let{history:e}=n.IN.state,t=I.VIEW_DIRECTION.Next;e.length1&&!this.showBack&&t?(await t.animate([{opacity:1},{opacity:0}],{duration:200,fill:"forwards",easing:"ease"}).finished,this.showBack=!0,t.animate([{opacity:0},{opacity:1}],{duration:200,fill:"forwards",easing:"ease"})):e.length<=1&&this.showBack&&t&&(await t.animate([{opacity:1},{opacity:0}],{duration:200,fill:"forwards",easing:"ease"}).finished,this.showBack=!1,t.animate([{opacity:0},{opacity:1}],{duration:200,fill:"forwards",easing:"ease"}))}onGoBack(){n.IN.goBack()}};im.styles=ih,ip([(0,o.wk)()],im.prototype,"heading",void 0),ip([(0,o.wk)()],im.prototype,"network",void 0),ip([(0,o.wk)()],im.prototype,"buffering",void 0),ip([(0,o.wk)()],im.prototype,"showBack",void 0),ip([(0,o.wk)()],im.prototype,"prevHistoryLength",void 0),ip([(0,o.wk)()],im.prototype,"view",void 0),ip([(0,o.wk)()],im.prototype,"viewDirection",void 0),ip([(0,o.wk)()],im.prototype,"headerText",void 0),im=ip([(0,r.customElement)("w3m-header")],im);var ib=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o};let iv=class extends a.WF{constructor(){super(...arguments),this.data=[]}render(){return(0,a.qy)` ${this.data.map(e=>(0,a.qy)` ${e.images.map(e=>(0,a.qy)``)} ${e.title} ${e.text} `)} `}};ib([(0,o.MZ)({type:Array})],iv.prototype,"data",void 0),iv=ib([(0,r.customElement)("w3m-help-widget")],iv);let iy=(0,a.AH)` :host { width: 100%; } :host > wui-flex { width: 100%; padding: var(--wui-spacing-s); border-radius: var(--wui-border-radius-xs); width: 100%; display: flex; align-items: center; justify-content: flex-start; gap: var(--wui-spacing-s); } :host > wui-flex:hover { background-color: var(--wui-color-gray-glass-002); } .purchase-image-container { display: flex; justify-content: center; align-items: center; position: relative; width: var(--wui-icon-box-size-lg); height: var(--wui-icon-box-size-lg); } .purchase-image-container wui-image { width: 100%; height: 100%; position: relative; border-radius: calc(var(--wui-icon-box-size-lg) / 2); } .purchase-image-container wui-image::after { content: ''; display: block; width: 100%; height: 100%; position: absolute; inset: 0; border-radius: calc(var(--wui-icon-box-size-lg) / 2); box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-005); } .purchase-image-container wui-icon-box { position: absolute; right: 0; bottom: 0; transform: translate(20%, 20%); } `;var ix=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o};let iC=class extends a.WF{constructor(){super(...arguments),this.disabled=!1,this.color="inherit",this.label="Bought",this.purchaseValue="",this.purchaseCurrency="",this.date="",this.completed=!1,this.inProgress=!1,this.failed=!1,this.onClick=null,this.symbol=""}firstUpdated(){this.icon||this.fetchTokenImage()}render(){return(0,a.qy)` ${this.imageTemplate()} ${this.statusIconTemplate()} ${this.label} + ${this.purchaseValue} ${this.purchaseCurrency} ${this.inProgress?(0,a.qy)``:(0,a.qy)`${this.date}`} `}async fetchTokenImage(){await n.Np._fetchTokenImage(this.purchaseCurrency)}statusIconTemplate(){return this.inProgress?null:this.completed?this.boughtIconTemplate():this.errorIconTemplate()}errorIconTemplate(){return(0,a.qy)``}imageTemplate(){let e=this.icon||`https://avatar.vercel.sh/andrew.svg?size=50&text=${this.symbol}`;return(0,a.qy)` `}boughtIconTemplate(){return(0,a.qy)``}};iC.styles=[iy],ix([(0,o.MZ)({type:Boolean})],iC.prototype,"disabled",void 0),ix([(0,o.MZ)()],iC.prototype,"color",void 0),ix([(0,o.MZ)()],iC.prototype,"label",void 0),ix([(0,o.MZ)()],iC.prototype,"purchaseValue",void 0),ix([(0,o.MZ)()],iC.prototype,"purchaseCurrency",void 0),ix([(0,o.MZ)()],iC.prototype,"date",void 0),ix([(0,o.MZ)({type:Boolean})],iC.prototype,"completed",void 0),ix([(0,o.MZ)({type:Boolean})],iC.prototype,"inProgress",void 0),ix([(0,o.MZ)({type:Boolean})],iC.prototype,"failed",void 0),ix([(0,o.MZ)()],iC.prototype,"onClick",void 0),ix([(0,o.MZ)()],iC.prototype,"symbol",void 0),ix([(0,o.MZ)()],iC.prototype,"icon",void 0),iC=ix([(0,r.customElement)("w3m-onramp-activity-item")],iC);let iA=(0,a.AH)` :host { width: 100%; } wui-loading-spinner { position: absolute; top: 50%; right: 20px; transform: translateY(-50%); } .currency-container { position: absolute; top: 50%; transform: translateY(-50%); right: var(--wui-spacing-1xs); height: 40px; padding: var(--wui-spacing-xs) var(--wui-spacing-1xs) var(--wui-spacing-xs) var(--wui-spacing-xs); min-width: 95px; border-radius: var(--FULL, 1000px); border: 1px solid var(--wui-color-gray-glass-002); background: var(--wui-color-gray-glass-002); cursor: pointer; } .currency-container > wui-image { height: 24px; width: 24px; border-radius: 50%; } `;var iE=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o};let i_=class extends a.WF{constructor(){super(),this.unsubscribe=[],this.type="Token",this.value=0,this.currencies=[],this.selectedCurrency=this.currencies?.[0],this.currencyImages=n.jQ.state.currencyImages,this.tokenImages=n.jQ.state.tokenImages,this.unsubscribe.push(n.aG.subscribeKey("purchaseCurrency",e=>{e&&"Fiat"!==this.type&&(this.selectedCurrency=this.formatPurchaseCurrency(e))}),n.aG.subscribeKey("paymentCurrency",e=>{e&&"Token"!==this.type&&(this.selectedCurrency=this.formatPaymentCurrency(e))}),n.aG.subscribe(e=>{"Fiat"===this.type?this.currencies=e.purchaseCurrencies.map(this.formatPurchaseCurrency):this.currencies=e.paymentCurrencies.map(this.formatPaymentCurrency)}),n.jQ.subscribe(e=>{this.currencyImages={...e.currencyImages},this.tokenImages={...e.tokenImages}}))}firstUpdated(){n.aG.getAvailableCurrencies()}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){let e=this.selectedCurrency?.symbol||"",t=this.currencyImages[e]||this.tokenImages[e];return(0,a.qy)` ${this.selectedCurrency?(0,a.qy)` n.W3.open({view:`OnRamp${this.type}Select`})} > ${this.selectedCurrency.symbol} `:(0,a.qy)``} `}formatPaymentCurrency(e){return{name:e.id,symbol:e.id}}formatPurchaseCurrency(e){return{name:e.name,symbol:e.symbol}}};i_.styles=iA,iE([(0,o.MZ)({type:String})],i_.prototype,"type",void 0),iE([(0,o.MZ)({type:Number})],i_.prototype,"value",void 0),iE([(0,o.wk)()],i_.prototype,"currencies",void 0),iE([(0,o.wk)()],i_.prototype,"selectedCurrency",void 0),iE([(0,o.wk)()],i_.prototype,"currencyImages",void 0),iE([(0,o.wk)()],i_.prototype,"tokenImages",void 0),i_=iE([(0,r.customElement)("w3m-onramp-input")],i_);let ik=(0,a.AH)` button { padding: var(--wui-spacing-s); border-radius: var(--wui-border-radius-xs); border: none; outline: none; background-color: var(--wui-color-gray-glass-002); width: 100%; display: flex; align-items: center; justify-content: flex-start; gap: var(--wui-spacing-s); transition: background-color var(--wui-ease-out-power-1) var(--wui-duration-md); will-change: background-color; } button:hover { background-color: var(--wui-color-gray-glass-005); } .provider-image { width: var(--wui-spacing-3xl); min-width: var(--wui-spacing-3xl); height: var(--wui-spacing-3xl); border-radius: calc(var(--wui-border-radius-xs) - calc(var(--wui-spacing-s) / 2)); position: relative; overflow: hidden; } .provider-image::after { content: ''; display: block; width: 100%; height: 100%; position: absolute; inset: 0; border-radius: calc(var(--wui-border-radius-xs) - calc(var(--wui-spacing-s) / 2)); box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-005); } .network-icon { width: var(--wui-spacing-m); height: var(--wui-spacing-m); border-radius: calc(var(--wui-spacing-m) / 2); overflow: hidden; box-shadow: 0 0 0 3px var(--wui-color-gray-glass-002), 0 0 0 3px var(--wui-color-modal-bg); transition: box-shadow var(--wui-ease-out-power-1) var(--wui-duration-md); will-change: box-shadow; } button:hover .network-icon { box-shadow: 0 0 0 3px var(--wui-color-gray-glass-005), 0 0 0 3px var(--wui-color-modal-bg); } `;var iI=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o};let iS=class extends a.WF{constructor(){super(...arguments),this.disabled=!1,this.color="inherit",this.label="",this.feeRange="",this.loading=!1,this.onClick=null}render(){return(0,a.qy)` `}networksTemplate(){let e=n.WB.getAllRequestedCaipNetworks(),t=e?.filter(e=>e?.assets?.imageId)?.slice(0,5);return(0,a.qy)` ${t?.map(e=>a.qy` `)} `}};iS.styles=[ik],iI([(0,o.MZ)({type:Boolean})],iS.prototype,"disabled",void 0),iI([(0,o.MZ)()],iS.prototype,"color",void 0),iI([(0,o.MZ)()],iS.prototype,"name",void 0),iI([(0,o.MZ)()],iS.prototype,"label",void 0),iI([(0,o.MZ)()],iS.prototype,"feeRange",void 0),iI([(0,o.MZ)({type:Boolean})],iS.prototype,"loading",void 0),iI([(0,o.MZ)()],iS.prototype,"onClick",void 0),iS=iI([(0,r.customElement)("w3m-onramp-provider-item")],iS);let iT=(0,a.AH)` wui-flex { background-color: var(--wui-color-gray-glass-005); } a { text-decoration: none; color: var(--wui-color-fg-175); font-weight: 500; } `,iN=class extends a.WF{render(){let{termsConditionsUrl:e,privacyPolicyUrl:t}=n.Hd.state,i=n.Hd.state.features?.legalCheckbox;return(e||t)&&!i?(0,a.qy)` By connecting your wallet, you agree to our
${this.termsTemplate()} ${this.andTemplate()} ${this.privacyTemplate()}
`:null}andTemplate(){let{termsConditionsUrl:e,privacyPolicyUrl:t}=n.Hd.state;return e&&t?"and":""}termsTemplate(){let{termsConditionsUrl:e}=n.Hd.state;return e?(0,a.qy)`Terms of Service`:null}privacyTemplate(){let{privacyPolicyUrl:e}=n.Hd.state;return e?(0,a.qy)`Privacy Policy`:null}};iN.styles=[iT],iN=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o}([(0,r.customElement)("w3m-legal-footer")],iN);let iP=(0,a.AH)` :host { display: flex; align-items: center; justify-content: center; } wui-checkbox { padding: var(--wui-spacing-s); } a { text-decoration: none; color: var(--wui-color-fg-150); font-weight: 500; } `,iR=class extends a.WF{render(){let{termsConditionsUrl:e,privacyPolicyUrl:t}=n.Hd.state,i=n.Hd.state.features?.legalCheckbox;return(e||t)&&i?(0,a.qy)` I agree to our ${this.termsTemplate()} ${this.andTemplate()} ${this.privacyTemplate()} `:null}andTemplate(){let{termsConditionsUrl:e,privacyPolicyUrl:t}=n.Hd.state;return e&&t?"and":""}termsTemplate(){let{termsConditionsUrl:e}=n.Hd.state;return e?(0,a.qy)`terms of service`:null}privacyTemplate(){let{privacyPolicyUrl:e}=n.Hd.state;return e?(0,a.qy)`privacy policy`:null}};iR.styles=[iP],iR=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o}([(0,r.customElement)("w3m-legal-checkbox")],iR);let iO=(0,a.AH)` :host { display: block; padding: 0 var(--wui-spacing-xl) var(--wui-spacing-xl); } `;var iM=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o};let iD=class extends a.WF{constructor(){super(...arguments),this.wallet=void 0}render(){if(!this.wallet)return this.style.display="none",null;let{name:e,app_store:t,play_store:i,chrome_store:o,homepage:s}=this.wallet,c=n.wE.isMobile(),l=n.wE.isIos(),u=n.wE.isAndroid(),d=[t,i,s,o].filter(Boolean).length>1,h=r.UiHelperUtil.getTruncateString({string:e,charsStart:12,charsEnd:0,truncate:"end"});return d&&!c?(0,a.qy)` n.IN.push("Downloads",{wallet:this.wallet})} > `:!d&&s?(0,a.qy)` `:t&&l?(0,a.qy)` `:i&&u?(0,a.qy)` `:(this.style.display="none",null)}onAppStore(){this.wallet?.app_store&&n.wE.openHref(this.wallet.app_store,"_blank")}onPlayStore(){this.wallet?.play_store&&n.wE.openHref(this.wallet.play_store,"_blank")}onHomePage(){this.wallet?.homepage&&n.wE.openHref(this.wallet.homepage,"_blank")}};iD.styles=[iO],iM([(0,o.MZ)({type:Object})],iD.prototype,"wallet",void 0),iD=iM([(0,r.customElement)("w3m-mobile-download-links")],iD);let iU=(0,a.AH)` wui-flex { border-top: 1px solid var(--wui-color-gray-glass-005); } a { text-decoration: none; color: var(--wui-color-fg-175); font-weight: 500; display: flex; align-items: center; justify-content: center; gap: var(--wui-spacing-3xs); } `,i$=class extends a.WF{render(){let{termsConditionsUrl:e,privacyPolicyUrl:t}=n.Hd.state;return e||t?(0,a.qy)` We work with the best providers to give you the lowest fees and best support. More options coming soon! ${this.howDoesItWorkTemplate()} `:null}howDoesItWorkTemplate(){return(0,a.qy)` How does it work? `}onWhatIsBuy(){n.En.sendEvent({type:"track",event:"SELECT_WHAT_IS_A_BUY",properties:{isSmartAccount:n.Uj.state.preferredAccountType===D.Vl.ACCOUNT_TYPES.SMART_ACCOUNT}}),n.IN.push("WhatIsABuy")}};i$.styles=[iU],i$=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o}([(0,r.customElement)("w3m-onramp-providers-footer")],i$);let iL=(0,a.AH)` :host { display: block; position: absolute; opacity: 0; pointer-events: none; top: 11px; left: 50%; width: max-content; } `;var ij=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o};let iB={loading:void 0,success:{backgroundColor:"success-100",iconColor:"success-100",icon:"checkmark"},error:{backgroundColor:"error-100",iconColor:"error-100",icon:"close"}},iW=class extends a.WF{constructor(){super(),this.unsubscribe=[],this.timeout=void 0,this.open=n.Pt.state.open,this.unsubscribe.push(n.Pt.subscribeKey("open",e=>{this.open=e,this.onOpen()}))}disconnectedCallback(){clearTimeout(this.timeout),this.unsubscribe.forEach(e=>e())}render(){let{message:e,variant:t,svg:i}=n.Pt.state,r=iB[t],{icon:o,iconColor:s}=i??r??{};return(0,a.qy)` `}onOpen(){clearTimeout(this.timeout),this.open?(this.animate([{opacity:0,transform:"translateX(-50%) scale(0.85)"},{opacity:1,transform:"translateX(-50%) scale(1)"}],{duration:150,fill:"forwards",easing:"ease"}),this.timeout&&clearTimeout(this.timeout),this.timeout=setTimeout(()=>n.Pt.hide(),2500)):this.animate([{opacity:1,transform:"translateX(-50%) scale(1)"},{opacity:0,transform:"translateX(-50%) scale(0.85)"}],{duration:150,fill:"forwards",easing:"ease"})}};iW.styles=iL,ij([(0,o.wk)()],iW.prototype,"open",void 0),iW=ij([(0,r.customElement)("w3m-snackbar")],iW);let iq=(0,a.AH)` :host { display: block; position: absolute; top: var(--wui-spacing-s); left: var(--wui-spacing-l); right: var(--wui-spacing-l); opacity: 0; pointer-events: none; } `;var iH=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o};let iz={info:{backgroundColor:"fg-350",iconColor:"fg-325",icon:"info"},success:{backgroundColor:"success-glass-reown-020",iconColor:"success-125",icon:"checkmark"},warning:{backgroundColor:"warning-glass-reown-020",iconColor:"warning-100",icon:"warningCircle"},error:{backgroundColor:"error-glass-reown-020",iconColor:"error-125",icon:"exclamationTriangle"}},iF=class extends a.WF{constructor(){super(),this.unsubscribe=[],this.open=n.hG.state.open,this.onOpen(!0),this.unsubscribe.push(n.hG.subscribeKey("open",e=>{this.open=e,this.onOpen(!1)}))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){let{message:e,variant:t}=n.hG.state,i=iz[t];return(0,a.qy)` `}onOpen(e){this.open?(this.animate([{opacity:0,transform:"scale(0.85)"},{opacity:1,transform:"scale(1)"}],{duration:150,fill:"forwards",easing:"ease"}),this.style.cssText="pointer-events: auto"):e||(this.animate([{opacity:1,transform:"scale(1)"},{opacity:0,transform:"scale(0.85)"}],{duration:150,fill:"forwards",easing:"ease"}),this.style.cssText="pointer-events: none")}};iF.styles=iq,iH([(0,o.wk)()],iF.prototype,"open",void 0),iF=iH([(0,r.customElement)("w3m-alertbar")],iF);let iZ=(0,a.AH)` wui-separator { margin: var(--wui-spacing-s) calc(var(--wui-spacing-s) * -1); width: calc(100% + var(--wui-spacing-s) * 2); } wui-email-input { width: 100%; } form { width: 100%; display: block; position: relative; } wui-icon-link, wui-loading-spinner { position: absolute; top: 50%; transform: translateY(-50%); } wui-icon-link { right: var(--wui-spacing-xs); } wui-loading-spinner { right: var(--wui-spacing-m); } wui-text { margin: var(--wui-spacing-xxs) var(--wui-spacing-m) var(--wui-spacing-0) var(--wui-spacing-m); } `;var iV=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o};let iK=class extends a.WF{constructor(){super(),this.unsubscribe=[],this.formRef=(0,eh._)(),this.connectors=n.aK.state.connectors,this.authConnector=this.connectors.find(e=>"AUTH"===e.type),this.email="",this.loading=!1,this.error="",this.walletGuide="get-started",this.unsubscribe.push(n.aK.subscribeKey("connectors",e=>{this.connectors=e,this.authConnector=e.find(e=>"AUTH"===e.type)}))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}firstUpdated(){this.formRef.value?.addEventListener("keydown",e=>{"Enter"===e.key&&this.onSubmitEmail(e)})}render(){let e=n.Hd.state.features?.email;return this.authConnector&&e?(0,a.qy)`
${this.submitButtonTemplate()}${this.loadingTemplate()}
${this.templateError()} ${this.separatorTemplate()} `:null}submitButtonTemplate(){return!this.loading&&this.email.length>3?(0,a.qy)` `:null}separatorTemplate(){let e=n.Hd.state.features?.socials,t=this.connectors.length>1,i=n.Hd.state.enableWallets,r=n.Hd.state.features?.emailShowWallets;return(e&&e.length||r||!t||!i)&&"get-started"===this.walletGuide||e&&e.length>0?null:(0,a.qy)` `}loadingTemplate(){return this.loading?(0,a.qy)``:null}templateError(){return this.error?(0,a.qy)`${this.error}`:null}onEmailInputChange(e){this.email=e.detail.trim(),this.error=""}async onSubmitEmail(e){if(![et.oU.CHAIN.EVM,et.oU.CHAIN.SOLANA].find(e=>e===n.WB.state.activeChain)){n.IN.push("SwitchActiveChain",{switchToChain:et.oU.CHAIN.EVM});return}try{if(this.loading)return;this.loading=!0,e.preventDefault();let t=n.aK.getAuthConnector();if(!t)throw Error("w3m-email-login-widget: Auth connector not found");let{action:i}=await t.provider.connectEmail({email:this.email});n.En.sendEvent({type:"track",event:"EMAIL_SUBMITTED"}),"VERIFY_OTP"===i?(n.En.sendEvent({type:"track",event:"EMAIL_VERIFICATION_CODE_SENT"}),n.IN.push("EmailVerifyOtp",{email:this.email})):"VERIFY_DEVICE"===i&&n.IN.push("EmailVerifyDevice",{email:this.email})}catch(t){let e=n.wE.parseError(t);e?.includes("Invalid email")?this.error="Invalid email. Try again.":n.Pt.showError(t)}finally{this.loading=!1}}onFocusEvent(){n.En.sendEvent({type:"track",event:"EMAIL_LOGIN_SELECTED"})}};iK.styles=iZ,iV([(0,o.MZ)()],iK.prototype,"tabIdx",void 0),iV([(0,o.wk)()],iK.prototype,"connectors",void 0),iV([(0,o.wk)()],iK.prototype,"authConnector",void 0),iV([(0,o.wk)()],iK.prototype,"email",void 0),iV([(0,o.wk)()],iK.prototype,"loading",void 0),iV([(0,o.wk)()],iK.prototype,"error",void 0),iV([(0,o.MZ)()],iK.prototype,"walletGuide",void 0),iK=iV([(0,r.customElement)("w3m-email-login-widget")],iK);let iG=(0,a.AH)` wui-flex { width: 100%; } :host > wui-flex:first-child { transform: translateY(calc(var(--wui-spacing-xxs) * -1)); } wui-icon-link { margin-right: calc(var(--wui-icon-box-size-md) * -1); } wui-notice-card { margin-bottom: var(--wui-spacing-3xs); } wui-list-item > wui-text { flex: 1; } w3m-transactions-view { max-height: 200px; } .tab-content-container { height: 300px; overflow-y: auto; overflow-x: hidden; scrollbar-width: none; } .tab-content-container::-webkit-scrollbar { display: none; } .account-button { width: auto; border: none; display: flex; align-items: center; justify-content: center; gap: var(--wui-spacing-s); height: 48px; padding: var(--wui-spacing-xs); padding-right: var(--wui-spacing-s); box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-002); background-color: var(--wui-color-gray-glass-002); border-radius: 24px; transition: background-color 0.2s linear; } .account-button:hover { background-color: var(--wui-color-gray-glass-005); } .avatar-container { position: relative; } wui-avatar.avatar { width: 32px; height: 32px; box-shadow: 0 0 0 2px var(--wui-color-gray-glass-005); } wui-avatar.network-avatar { width: 16px; height: 16px; position: absolute; left: 100%; top: 100%; transform: translate(-75%, -75%); box-shadow: 0 0 0 2px var(--wui-color-gray-glass-005); } .account-links { display: flex; justify-content: space-between; align-items: center; } .account-links wui-flex { cursor: pointer; display: flex; align-items: center; justify-content: center; flex: 1; background: red; align-items: center; justify-content: center; height: 48px; padding: 10px; flex: 1 0 0; border-radius: var(--XS, 16px); border: 1px solid var(--dark-accent-glass-010, rgba(71, 161, 255, 0.1)); background: var(--dark-accent-glass-010, rgba(71, 161, 255, 0.1)); transition: background-color var(--wui-ease-out-power-1) var(--wui-duration-md), opacity var(--wui-ease-out-power-1) var(--wui-duration-md); will-change: background-color, opacity; } .account-links wui-flex:hover { background: var(--dark-accent-glass-015, rgba(71, 161, 255, 0.15)); } .account-links wui-flex wui-icon { width: var(--S, 20px); height: var(--S, 20px); } .account-links wui-flex wui-icon svg path { stroke: #667dff; } `;var iJ=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o};let iY=class extends a.WF{constructor(){super(),this.unsubscribe=[],this.caipAddress=n.Uj.state.caipAddress,this.address=n.wE.getPlainAddress(n.Uj.state.caipAddress),this.allAccounts=n.Uj.state.allAccounts,this.profileImage=n.Uj.state.profileImage,this.profileName=n.Uj.state.profileName,this.disconnecting=!1,this.balance=n.Uj.state.balance,this.balanceSymbol=n.Uj.state.balanceSymbol,this.features=n.Hd.state.features,this.unsubscribe.push(n.Uj.subscribeKey("caipAddress",e=>{this.address=n.wE.getPlainAddress(e),this.caipAddress=e}),n.Uj.subscribeKey("balance",e=>this.balance=e),n.Uj.subscribeKey("balanceSymbol",e=>this.balanceSymbol=e),n.Uj.subscribeKey("profileName",e=>this.profileName=e),n.Uj.subscribeKey("profileImage",e=>this.profileImage=e),n.Hd.subscribeKey("features",e=>this.features=e),n.Uj.subscribeKey("allAccounts",e=>{this.allAccounts=e}))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){if(!this.caipAddress)return null;let e=n.WB.state.activeChain===et.oU.CHAIN.EVM&&this.allAccounts.length>1;return(0,a.qy)` ${e?this.multiAccountTemplate():this.singleAccountTemplate()} ${n.wE.formatBalance(this.balance,this.balanceSymbol)} ${this.explorerBtnTemplate()} ${this.authCardTemplate()} ${this.onrampTemplate()} ${this.swapsTemplate()} ${this.activityTemplate()} Disconnect `}onrampTemplate(){return this.features?.onramp?(0,a.qy)` Buy crypto `:null}activityTemplate(){let e=n.WB.state.activeChain===et.oU.CHAIN.SOLANA;return(0,a.qy)` Activity ${e?(0,a.qy)`Coming soon`:""} `}swapsTemplate(){let e=this.features?.swaps,t=n.WB.state.activeChain===et.oU.CHAIN.SOLANA;return!e||t?null:(0,a.qy)` Swap `}authCardTemplate(){let e=n.iT.getConnectedConnector(),t=n.aK.getAuthConnector(),{origin:i}=location;return!t||"ID_AUTH"!==e||i.includes(n.oU.SECURE_SITE)?null:(0,a.qy)` `}handleSwitchAccountsView(){n.IN.push("SwitchAddress")}handleClickPay(){n.IN.push("OnRampProviders")}handleClickSwap(){n.IN.push("Swap")}explorerBtnTemplate(){return n.Uj.state.addressExplorerUrl?(0,a.qy)` Block Explorer `:null}singleAccountTemplate(){return(0,a.qy)` ${this.profileName?r.UiHelperUtil.getTruncateString({string:this.profileName,charsStart:20,charsEnd:0,truncate:"end"}):r.UiHelperUtil.getTruncateString({string:this.address||"",charsStart:4,charsEnd:4,truncate:"middle"})} `}multiAccountTemplate(){if(!this.address)throw Error("w3m-account-view: No account provided");let e=this.allAccounts.find(e=>e.address===this.address),t=n.Uj.state.addressLabels.get(this.address);return(0,a.qy)` `}onCopyAddress(){try{this.address&&(n.wE.copyToClopboard(this.address),n.Pt.showSuccess("Address copied"))}catch{n.Pt.showError("Failed to copy")}}onTransactions(){n.En.sendEvent({type:"track",event:"CLICK_TRANSACTIONS",properties:{isSmartAccount:n.Uj.state.preferredAccountType===D.Vl.ACCOUNT_TYPES.SMART_ACCOUNT}}),n.IN.push("Transactions")}async onDisconnect(){try{this.disconnecting=!0,await n.x4.disconnect(),n.En.sendEvent({type:"track",event:"DISCONNECT_SUCCESS"}),n.W3.close()}catch{n.En.sendEvent({type:"track",event:"DISCONNECT_ERROR"}),n.Pt.showError("Failed to disconnect")}finally{this.disconnecting=!1}}onExplorer(){let e=n.Uj.state.addressExplorerUrl;e&&n.wE.openHref(e,"_blank")}onGoToUpgradeView(){n.En.sendEvent({type:"track",event:"EMAIL_UPGRADE_FROM_MODAL"}),n.IN.push("UpgradeEmailWallet")}};iY.styles=iG,iJ([(0,o.wk)()],iY.prototype,"caipAddress",void 0),iJ([(0,o.wk)()],iY.prototype,"address",void 0),iJ([(0,o.wk)()],iY.prototype,"allAccounts",void 0),iJ([(0,o.wk)()],iY.prototype,"profileImage",void 0),iJ([(0,o.wk)()],iY.prototype,"profileName",void 0),iJ([(0,o.wk)()],iY.prototype,"disconnecting",void 0),iJ([(0,o.wk)()],iY.prototype,"balance",void 0),iJ([(0,o.wk)()],iY.prototype,"balanceSymbol",void 0),iJ([(0,o.wk)()],iY.prototype,"features",void 0),iY=iJ([(0,r.customElement)("w3m-account-default-widget")],iY);let iQ=(0,a.AH)` wui-flex { width: 100%; } wui-promo { position: absolute; top: -32px; } wui-profile-button { margin-top: calc(-1 * var(--wui-spacing-2l)); } wui-promo + wui-profile-button { margin-top: var(--wui-spacing-2l); } wui-tabs { width: 100%; } .contentContainer { height: 280px; } .contentContainer > wui-icon-box { width: 40px; height: 40px; border-radius: var(--wui-border-radius-xxs); } .contentContainer > .textContent { width: 65%; } `;var iX=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o};let i0=class extends a.WF{constructor(){super(),this.unsubscribe=[],this.address=n.Uj.state.address,this.profileImage=n.Uj.state.profileImage,this.profileName=n.Uj.state.profileName,this.smartAccountDeployed=n.Uj.state.smartAccountDeployed,this.network=n.WB.state.activeCaipNetwork,this.currentTab=n.Uj.state.currentTab,this.tokenBalance=n.Uj.state.tokenBalance,this.preferredAccountType=n.Uj.state.preferredAccountType,this.features=n.Hd.state.features,this.unsubscribe.push(n.Uj.subscribe(e=>{e.address?(this.address=e.address,this.profileImage=e.profileImage,this.profileName=e.profileName,this.currentTab=e.currentTab,this.tokenBalance=e.tokenBalance,this.smartAccountDeployed=e.smartAccountDeployed,this.preferredAccountType=e.preferredAccountType):n.W3.close()}),n.WB.subscribeKey("activeCaipNetwork",e=>this.network=e),n.Hd.subscribeKey("features",e=>this.features=e)),this.watchSwapValues()}disconnectedCallback(){this.unsubscribe.forEach(e=>e()),clearInterval(this.watchTokenBalance)}firstUpdated(){n.Uj.fetchTokenBalance()}render(){if(!this.address)throw Error("w3m-account-view: No account provided");let e=n.$m.getNetworkImage(this.network);return(0,a.qy)` ${this.network&&(0,a.qy)``} ${this.activateAccountTemplate()} ${this.tokenBalanceTemplate()} ${this.swapsTemplate()} ${this.listContentTemplate()} `}swapsTemplate(){return this.features?.swaps?(0,a.qy)` `:null}watchSwapValues(){this.watchTokenBalance=setInterval(()=>n.Uj.fetchTokenBalance(),1e4)}listContentTemplate(){return 0===this.currentTab?(0,a.qy)``:1===this.currentTab?(0,a.qy)``:2===this.currentTab?(0,a.qy)``:(0,a.qy)``}tokenBalanceTemplate(){if(this.tokenBalance&&this.tokenBalance?.length>=0){let e=n.wE.calculateBalance(this.tokenBalance),{dollars:t="0",pennies:i="00"}=n.wE.formatTokenBalance(e);return(0,a.qy)``}return(0,a.qy)``}activateAccountTemplate(){return!n.WB.checkIfSmartAccountEnabled()||this.preferredAccountType!==D.Vl.ACCOUNT_TYPES.EOA||this.smartAccountDeployed?null:(0,a.qy)` `}onTabChange(e){n.Uj.setCurrentTab(e)}onProfileButtonClick(){n.IN.push("Profile")}onBuyClick(){n.IN.push("OnRampProviders")}onSwapClick(){this.network?.caipNetworkId&&!n.oU.SWAP_SUPPORTED_NETWORKS.includes(this.network?.caipNetworkId)?n.IN.push("UnsupportedChain",{swapUnsupportedChain:!0}):(n.En.sendEvent({type:"track",event:"OPEN_SWAP",properties:{network:this.network?.caipNetworkId||"",isSmartAccount:n.Uj.state.preferredAccountType===D.Vl.ACCOUNT_TYPES.SMART_ACCOUNT}}),n.IN.push("Swap"))}onReceiveClick(){n.IN.push("WalletReceive")}onSendClick(){n.En.sendEvent({type:"track",event:"OPEN_SEND",properties:{network:this.network?.caipNetworkId||"",isSmartAccount:n.Uj.state.preferredAccountType===D.Vl.ACCOUNT_TYPES.SMART_ACCOUNT}}),n.IN.push("WalletSend")}onUpdateToSmartAccount(){n.IN.push("UpgradeToSmartAccount")}};i0.styles=iQ,iX([(0,o.wk)()],i0.prototype,"watchTokenBalance",void 0),iX([(0,o.wk)()],i0.prototype,"address",void 0),iX([(0,o.wk)()],i0.prototype,"profileImage",void 0),iX([(0,o.wk)()],i0.prototype,"profileName",void 0),iX([(0,o.wk)()],i0.prototype,"smartAccountDeployed",void 0),iX([(0,o.wk)()],i0.prototype,"network",void 0),iX([(0,o.wk)()],i0.prototype,"currentTab",void 0),iX([(0,o.wk)()],i0.prototype,"tokenBalance",void 0),iX([(0,o.wk)()],i0.prototype,"preferredAccountType",void 0),iX([(0,o.wk)()],i0.prototype,"features",void 0),i0=iX([(0,r.customElement)("w3m-account-wallet-features-widget")],i0);let i1=(0,a.AH)` :host { width: 100%; max-height: 280px; overflow: scroll; scrollbar-width: none; } :host::-webkit-scrollbar { display: none; } `,i2=class extends a.WF{render(){return(0,a.qy)``}};i2.styles=i1,i2=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o}([(0,r.customElement)("w3m-account-activity-widget")],i2);let i3=(0,a.AH)` .contentContainer { height: 280px; } .contentContainer > wui-icon-box { width: 40px; height: 40px; border-radius: var(--wui-border-radius-xxs); } .contentContainer > .textContent { width: 65%; } `,i5=class extends a.WF{render(){return(0,a.qy)`${this.nftTemplate()}`}nftTemplate(){return(0,a.qy)` Coming soon Stay tuned for our upcoming NFT feature Receive funds `}onReceiveClick(){n.IN.push("WalletReceive")}};i5.styles=i3,i5=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o}([(0,r.customElement)("w3m-account-nfts-widget")],i5);let i4=(0,a.AH)` :host { width: 100%; } wui-flex { width: 100%; } .contentContainer { max-height: 280px; overflow: scroll; scrollbar-width: none; } .contentContainer::-webkit-scrollbar { display: none; } `;var i6=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o};let i8=class extends a.WF{constructor(){super(),this.unsubscribe=[],this.tokenBalance=n.Uj.state.tokenBalance,this.unsubscribe.push(n.Uj.subscribe(e=>{this.tokenBalance=e.tokenBalance}))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return(0,a.qy)`${this.tokenTemplate()}`}tokenTemplate(){return this.tokenBalance&&this.tokenBalance?.length>0?(0,a.qy)` ${this.tokenItemTemplate()} `:(0,a.qy)` `}tokenItemTemplate(){return this.tokenBalance?.map(e=>a.qy``)}onReceiveClick(){n.IN.push("WalletReceive")}onBuyClick(){n.En.sendEvent({type:"track",event:"SELECT_BUY_CRYPTO",properties:{isSmartAccount:n.Uj.state.preferredAccountType===D.Vl.ACCOUNT_TYPES.SMART_ACCOUNT}}),n.IN.push("OnRampProviders")}};i8.styles=i4,i6([(0,o.wk)()],i8.prototype,"tokenBalance",void 0),i8=i6([(0,r.customElement)("w3m-account-tokens-widget")],i8);let i9=(0,a.AH)` :host { min-height: 100%; } .group-container[last-group='true'] { padding-bottom: var(--wui-spacing-m); } .contentContainer { height: 280px; } .contentContainer > wui-icon-box { width: 40px; height: 40px; border-radius: var(--wui-border-radius-xxs); } .contentContainer > .textContent { width: 65%; } .emptyContainer { height: 100%; } `;var i7=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o};let re="last-transaction",rt=class extends a.WF{constructor(){super(),this.unsubscribe=[],this.paginationObserver=void 0,this.page="activity",this.caipAddress=n.WB.state.activeCaipAddress,this.transactionsByYear=n.WC.state.transactionsByYear,this.loading=n.WC.state.loading,this.empty=n.WC.state.empty,this.next=n.WC.state.next,n.WC.clearCursor(),this.unsubscribe.push(n.WB.subscribeKey("activeCaipAddress",e=>{e&&this.caipAddress!==e&&(n.WC.resetTransactions(),n.WC.fetchTransactions(e)),this.caipAddress=e}),n.WB.subscribeKey("activeCaipNetwork",()=>{this.updateTransactionView()}),n.WC.subscribe(e=>{this.transactionsByYear=e.transactionsByYear,this.loading=e.loading,this.empty=e.empty,this.next=e.next}))}firstUpdated(){this.updateTransactionView(),this.createPaginationObserver()}updated(){this.setPaginationObserver()}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return(0,a.qy)` ${this.empty?null:this.templateTransactionsByYear()} ${this.loading?this.templateLoading():null} ${!this.loading&&this.empty?this.templateEmpty():null}`}updateTransactionView(){let e=n.WB.state.activeCaipNetwork?.caipNetworkId;n.WC.state.lastNetworkInView!==e&&(n.WC.resetTransactions(),this.caipAddress&&n.WC.fetchTransactions(n.wE.getPlainAddress(this.caipAddress))),n.WC.setLastNetworkInView(e)}templateTransactionsByYear(){return Object.keys(this.transactionsByYear).sort().reverse().map(e=>{let t=parseInt(e,10),i=Array(12).fill(null).map((e,i)=>({groupTitle:r.TransactionUtil.getTransactionGroupTitle(t,i),transactions:this.transactionsByYear[t]?.[i]})).filter(({transactions:e})=>e).reverse();return i.map(({groupTitle:e,transactions:t},r)=>{let n=r===i.length-1;return t?(0,a.qy)` ${e} ${this.templateTransactions(t,n)} `:null})})}templateRenderTransaction(e,t){let{date:i,descriptions:n,direction:o,isAllNFT:s,images:c,status:l,transfers:u,type:d}=this.getTransactionListItemProps(e),h=u?.length>1;return u?.length!==2||s?h?u.map((e,n)=>{let o=r.TransactionUtil.getTransferDescription(e),s=t&&n===u.length-1;return(0,a.qy)` `}):(0,a.qy)` `:(0,a.qy)` `}templateTransactions(e,t){return e.map((i,r)=>{let n=t&&r===e.length-1;return(0,a.qy)`${this.templateRenderTransaction(i,n)}`})}emptyStateActivity(){return(0,a.qy)` No Transactions yet Start trading on dApps
to grow your wallet!
`}emptyStateAccount(){return(0,a.qy)` No activity yet Your next transactions will appear here Trade `}templateEmpty(){return"account"===this.page?(0,a.qy)`${this.emptyStateAccount()}`:(0,a.qy)`${this.emptyStateActivity()}`}templateLoading(){return"activity"===this.page?Array(7).fill((0,a.qy)` `).map(e=>e):null}onReceiveClick(){n.IN.push("WalletReceive")}createPaginationObserver(){let{projectId:e}=n.Hd.state;this.paginationObserver=new IntersectionObserver(([t])=>{t?.isIntersecting&&!this.loading&&(n.WC.fetchTransactions(n.wE.getPlainAddress(this.caipAddress)),n.En.sendEvent({type:"track",event:"LOAD_MORE_TRANSACTIONS",properties:{address:n.wE.getPlainAddress(this.caipAddress),projectId:e,cursor:this.next,isSmartAccount:n.Uj.state.preferredAccountType===D.Vl.ACCOUNT_TYPES.SMART_ACCOUNT}}))},{}),this.setPaginationObserver()}setPaginationObserver(){this.paginationObserver?.disconnect();let e=this.shadowRoot?.querySelector(`#${re}`);e&&this.paginationObserver?.observe(e)}getTransactionListItemProps(e){let t=et.rL.formatDate(e?.metadata?.minedAt),i=r.TransactionUtil.getTransactionDescriptions(e),n=e?.transfers,a=e?.transfers?.[0],o=!!a&&e?.transfers?.every(e=>!!e.nft_info),s=r.TransactionUtil.getTransactionImages(n);return{date:t,direction:a?.direction,descriptions:i,isAllNFT:o,images:s,status:e.metadata?.status,transfers:n,type:e.metadata?.operationType}}};rt.styles=i9,i7([(0,o.MZ)()],rt.prototype,"page",void 0),i7([(0,o.wk)()],rt.prototype,"caipAddress",void 0),i7([(0,o.wk)()],rt.prototype,"transactionsByYear",void 0),i7([(0,o.wk)()],rt.prototype,"loading",void 0),i7([(0,o.wk)()],rt.prototype,"empty",void 0),i7([(0,o.wk)()],rt.prototype,"next",void 0),rt=i7([(0,r.customElement)("w3m-activity-list")],rt);let ri=(0,a.AH)` :host { width: 100%; height: 100px; border-radius: var(--wui-border-radius-s); border: 1px solid var(--wui-color-gray-glass-002); background-color: var(--wui-color-gray-glass-002); transition: background-color var(--wui-ease-out-power-1) var(--wui-duration-lg); will-change: background-color; } :host(:hover) { background-color: var(--wui-color-gray-glass-005); } wui-flex { width: 100%; height: fit-content; } wui-button { width: 100%; display: flex; justify-content: flex-end; } wui-input-amount { mask-image: linear-gradient( 270deg, transparent 0px, transparent 8px, black 24px, black 25px, black 32px, black 100% ); } .totalValue { width: 100%; } `;var rr=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o};let rn=class extends a.WF{render(){return(0,a.qy)` ${this.buttonTemplate()} ${this.sendValueTemplate()} ${this.maxAmountTemplate()} ${this.actionTemplate()} `}buttonTemplate(){return this.token?(0,a.qy)` `:(0,a.qy)`Select token`}handleSelectButtonClick(){n.IN.push("WalletSendSelectToken")}sendValueTemplate(){if(this.token&&this.sendTokenAmount){let e=this.token.price*this.sendTokenAmount;return(0,a.qy)`${e?`$${r.UiHelperUtil.formatNumberToLocalString(e,2)}`:"Incorrect value"}`}return null}maxAmountTemplate(){return this.token?this.sendTokenAmount&&this.sendTokenAmount>Number(this.token.quantity.numeric)?(0,a.qy)` ${r.UiHelperUtil.roundNumber(Number(this.token.quantity.numeric),6,5)} `:(0,a.qy)` ${r.UiHelperUtil.roundNumber(Number(this.token.quantity.numeric),6,5)} `:null}actionTemplate(){return this.token?this.sendTokenAmount&&this.sendTokenAmount>Number(this.token.quantity.numeric)?(0,a.qy)`Buy`:(0,a.qy)`Max`:null}onInputChange(e){n.Rv.setTokenAmount(e.detail)}onMaxClick(){if(this.token&&void 0!==this.gasPrice){let e=void 0===this.token.address||Object.values(n.oU.NATIVE_TOKEN_ADDRESS).some(e=>this.token?.address===e),t=et.Se.bigNumber(this.gasPrice).shiftedBy(-this.token.quantity.decimals),i=e?et.Se.bigNumber(this.token.quantity.numeric).minus(t):et.Se.bigNumber(this.token.quantity.numeric);n.Rv.setTokenAmount(Number(i.toFixed(20)))}}onBuyClick(){n.IN.push("OnRampProviders")}};rn.styles=ri,rr([(0,o.MZ)({type:Object})],rn.prototype,"token",void 0),rr([(0,o.MZ)({type:Number})],rn.prototype,"sendTokenAmount",void 0),rr([(0,o.MZ)({type:Number})],rn.prototype,"gasPriceInUSD",void 0),rr([(0,o.MZ)({type:Number})],rn.prototype,"gasPrice",void 0),rn=rr([(0,r.customElement)("w3m-input-token")],rn);let ra=(0,a.AH)` :host { width: 100%; height: 100px; border-radius: var(--wui-border-radius-s); border: 1px solid var(--wui-color-gray-glass-002); background-color: var(--wui-color-gray-glass-002); transition: background-color var(--wui-ease-out-power-1) var(--wui-duration-lg); will-change: background-color; position: relative; } :host(:hover) { background-color: var(--wui-color-gray-glass-005); } wui-flex { width: 100%; height: fit-content; } wui-button { display: ruby; color: var(--wui-color-fg-100); margin: 0 var(--wui-spacing-xs); } .instruction { position: absolute; top: 50%; transform: translateY(-50%); z-index: 2; } .paste { display: inline-flex; } textarea { background: transparent; width: 100%; font-family: var(--w3m-font-family); font-size: var(--wui-font-size-medium); font-style: normal; font-weight: var(--wui-font-weight-light); line-height: 130%; letter-spacing: var(--wui-letter-spacing-medium); color: var(--wui-color-fg-100); caret-color: var(--wui-color-accent-100); box-sizing: border-box; -webkit-appearance: none; -moz-appearance: textfield; padding: 0px; border: none; outline: none; appearance: none; resize: none; overflow: hidden; } `;var ro=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o};let rs=class extends a.WF{constructor(){super(...arguments),this.inputElementRef=(0,eh._)(),this.instructionElementRef=(0,eh._)(),this.instructionHidden=!!this.value,this.pasting=!1,this.onDebouncedSearch=n.wE.debounce(async e=>{let t=await n.x4.getEnsAddress(e);if(n.Rv.setLoading(!1),t){n.Rv.setReceiverProfileName(e),n.Rv.setReceiverAddress(t);let i=await n.x4.getEnsAvatar(e);n.Rv.setReceiverProfileImageUrl(i||void 0)}else n.Rv.setReceiverAddress(e),n.Rv.setReceiverProfileName(void 0),n.Rv.setReceiverProfileImageUrl(void 0)})}firstUpdated(){this.value&&(this.instructionHidden=!0),this.checkHidden()}render(){return(0,a.qy)` Type or Paste address `}async focusInput(){this.instructionElementRef.value&&(this.instructionHidden=!0,await this.toggleInstructionFocus(!1),this.instructionElementRef.value.style.pointerEvents="none",this.inputElementRef.value?.focus(),this.inputElementRef.value&&(this.inputElementRef.value.selectionStart=this.inputElementRef.value.selectionEnd=this.inputElementRef.value.value.length))}async focusInstruction(){this.instructionElementRef.value&&(this.instructionHidden=!1,await this.toggleInstructionFocus(!0),this.instructionElementRef.value.style.pointerEvents="auto",this.inputElementRef.value?.blur())}async toggleInstructionFocus(e){this.instructionElementRef.value&&await this.instructionElementRef.value.animate([{opacity:e?0:1},{opacity:e?1:0}],{duration:100,easing:"ease",fill:"forwards"}).finished}onBoxClick(){this.value||this.instructionHidden||this.focusInput()}onBlur(){this.value||!this.instructionHidden||this.pasting||this.focusInstruction()}checkHidden(){this.instructionHidden&&this.focusInput()}async onPasteClick(){this.pasting=!0;let e=await navigator.clipboard.readText();n.Rv.setReceiverAddress(e),this.focusInput()}onInputChange(e){this.pasting=!1;let t=e.target;t.value&&!this.instructionHidden&&this.focusInput(),n.Rv.setLoading(!0),this.onDebouncedSearch(t.value)}};rs.styles=ra,ro([(0,o.MZ)()],rs.prototype,"value",void 0),ro([(0,o.wk)()],rs.prototype,"instructionHidden",void 0),ro([(0,o.wk)()],rs.prototype,"pasting",void 0),rs=ro([(0,r.customElement)("w3m-input-address")],rs);let rc=(0,a.AH)` :host { display: flex; width: auto; flex-direction: column; gap: var(--wui-border-radius-1xs); border-radius: var(--wui-border-radius-s); background: var(--wui-color-gray-glass-002); padding: var(--wui-spacing-s) var(--wui-spacing-1xs) var(--wui-spacing-1xs) var(--wui-spacing-1xs); } wui-text { padding: 0 var(--wui-spacing-1xs); } wui-flex { margin-top: var(--wui-spacing-1xs); } .network { cursor: pointer; transition: background-color var(--wui-ease-out-power-1) var(--wui-duration-lg); will-change: background-color; } .network:focus-visible { border: 1px solid var(--wui-color-accent-100); background-color: var(--wui-color-gray-glass-005); -webkit-box-shadow: 0px 0px 0px 4px var(--wui-box-shadow-blue); -moz-box-shadow: 0px 0px 0px 4px var(--wui-box-shadow-blue); box-shadow: 0px 0px 0px 4px var(--wui-box-shadow-blue); } .network:hover { background-color: var(--wui-color-gray-glass-005); } .network:active { background-color: var(--wui-color-gray-glass-010); } `;var rl=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o};let ru=class extends a.WF{render(){return(0,a.qy)` Details ${this.networkTemplate()} `}networkTemplate(){return this.caipNetwork?.name?(0,a.qy)` this.onNetworkClick(this.caipNetwork)} class="network" textTitle="Network" imageSrc=${(0,s.J)(n.$m.getNetworkImage(this.caipNetwork))} >`:null}onNetworkClick(e){e&&n.IN.push("Networks",{network:e})}};ru.styles=rc,rl([(0,o.MZ)()],ru.prototype,"receiverAddress",void 0),rl([(0,o.MZ)({type:Object})],ru.prototype,"caipNetwork",void 0),rl([(0,o.MZ)({type:Number})],ru.prototype,"networkFee",void 0),ru=rl([(0,r.customElement)("w3m-wallet-send-details")],ru);let rd=(0,a.AH)` :host { pointer-events: none; } :host > wui-flex { display: var(--w3m-tooltip-display); opacity: var(--w3m-tooltip-opacity); padding: 9px var(--wui-spacing-s) 10px var(--wui-spacing-s); border-radius: var(--wui-border-radius-xxs); color: var(--wui-color-bg-100); position: fixed; top: var(--w3m-tooltip-top); left: var(--w3m-tooltip-left); transform: translate(calc(-50% + var(--w3m-tooltip-parent-width)), calc(-100% - 8px)); max-width: calc(var(--w3m-modal-width) - var(--wui-spacing-xl)); transition: opacity 0.2s var(--wui-ease-out-power-2); will-change: opacity; } :host([data-variant='shade']) > wui-flex { background-color: var(--wui-color-bg-150); border: 1px solid var(--wui-color-gray-glass-005); } :host([data-variant='shade']) > wui-flex > wui-text { color: var(--wui-color-fg-150); } :host([data-variant='fill']) > wui-flex { background-color: var(--wui-color-fg-100); border: none; } wui-icon { position: absolute; width: 12px !important; height: 4px !important; color: var(--wui-color-bg-150); } wui-icon[data-placement='top'] { bottom: 0px; left: 50%; transform: translate(-50%, 95%); } wui-icon[data-placement='bottom'] { top: 0; left: 50%; transform: translate(-50%, -95%) rotate(180deg); } wui-icon[data-placement='right'] { top: 50%; left: 0; transform: translate(-65%, -50%) rotate(90deg); } wui-icon[data-placement='left'] { top: 50%; right: 0%; transform: translate(65%, -50%) rotate(270deg); } `;var rh=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o};let rp=class extends a.WF{constructor(){super(),this.unsubscribe=[],this.open=n.Ib.state.open,this.message=n.Ib.state.message,this.triggerRect=n.Ib.state.triggerRect,this.variant=n.Ib.state.variant,this.unsubscribe.push(n.Ib.subscribe(e=>{this.open=e.open,this.message=e.message,this.triggerRect=e.triggerRect,this.variant=e.variant}))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){this.dataset.variant=this.variant;let e=this.triggerRect.top,t=this.triggerRect.left;return this.style.cssText=` --w3m-tooltip-top: ${e}px; --w3m-tooltip-left: ${t}px; --w3m-tooltip-parent-width: ${this.triggerRect.width/2}px; --w3m-tooltip-display: ${this.open?"flex":"none"}; --w3m-tooltip-opacity: ${this.open?1:0}; `,(0,a.qy)` ${this.message} `}};rp.styles=[rd],rh([(0,o.wk)()],rp.prototype,"open",void 0),rh([(0,o.wk)()],rp.prototype,"message",void 0),rh([(0,o.wk)()],rp.prototype,"triggerRect",void 0),rh([(0,o.wk)()],rp.prototype,"variant",void 0),rp=rh([(0,r.customElement)("w3m-tooltip")],rp);let rf=(0,a.AH)` :host { width: 100%; display: block; } `;var rg=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o};let rw=class extends a.WF{constructor(){super(),this.unsubscribe=[],this.text="",this.open=n.Ib.state.open,this.unsubscribe.push(n.IN.subscribeKey("view",()=>{n.Ib.hide()}),n.W3.subscribeKey("open",e=>{e||n.Ib.hide()}),n.Ib.subscribeKey("open",e=>{this.open=e}))}disconnectedCallback(){this.unsubscribe.forEach(e=>e()),n.Ib.hide()}render(){return(0,a.qy)`
${this.renderChildren()}
`}renderChildren(){return(0,a.qy)` `}onMouseEnter(){let e=this.getBoundingClientRect();this.open||n.Ib.showTooltip({message:this.text,triggerRect:{width:e.width,height:e.height,left:e.left,top:e.top},variant:"shade"})}onMouseLeave(e){this.contains(e.relatedTarget)||n.Ib.hide()}};rw.styles=[rf],rg([(0,o.MZ)()],rw.prototype,"text",void 0),rg([(0,o.wk)()],rw.prototype,"open",void 0),rw=rg([(0,r.customElement)("w3m-tooltip-trigger")],rw);let rm=(0,a.AH)` :host > wui-flex:first-child { margin-top: var(--wui-spacing-s); } wui-separator { margin: var(--wui-spacing-m) calc(var(--wui-spacing-m) * -1) var(--wui-spacing-m) calc(var(--wui-spacing-m) * -1); width: calc(100% + var(--wui-spacing-s) * 2); } `;var rb=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o};let rv=class extends a.WF{constructor(){super(),this.unsubscribe=[],this.walletGuide="get-started",this.tabIdx=void 0,this.connectors=n.aK.state.connectors,this.features=n.Hd.state.features,this.authConnector=this.connectors.find(e=>"AUTH"===e.type),this.unsubscribe.push(n.aK.subscribeKey("connectors",e=>{this.connectors=e,this.authConnector=this.connectors.find(e=>"AUTH"===e.type)}),n.Hd.subscribeKey("features",e=>this.features=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){let e=this.features?.socials;return this.authConnector&&e&&e?.length?(0,a.qy)` ${this.topViewTemplate()}${this.bottomViewTemplate()} ${this.separatorTemplate()} `:null}topViewTemplate(){let e=this.features?.socials;return this.authConnector&&e&&e?.length?2===e.length?(0,a.qy)` ${e.slice(0,2).map(e=>(0,a.qy)`{this.onSocialClick(e)}} logo=${e} tabIdx=${(0,s.J)(this.tabIdx)} >`)} `:(0,a.qy)` {this.onSocialClick(e?.[0])}} logo=${(0,s.J)(e[0])} align="center" name=${`Continue with ${e[0]}`} tabIdx=${(0,s.J)(this.tabIdx)} >`:null}bottomViewTemplate(){let e=this.features?.socials;return this.authConnector&&e&&e?.length&&!(e.length<=2)?e.length>6?(0,a.qy)` ${e.slice(1,5).map(e=>(0,a.qy)`{this.onSocialClick(e)}} logo=${e} tabIdx=${(0,s.J)(this.tabIdx)} >`)} `:(0,a.qy)` ${e.slice(1,e.length).map(e=>(0,a.qy)`{this.onSocialClick(e)}} logo=${e} tabIdx=${(0,s.J)(this.tabIdx)} >`)} `:null}separatorTemplate(){let e=this.connectors.find(e=>"walletConnect"===e.id),t=n.Hd.state.enableWallets;return e&&t||"explore"===this.walletGuide?(0,a.qy)``:null}onMoreSocialsClick(){n.IN.push("ConnectSocials")}async onSocialClick(e){if(e&&(n.Uj.setSocialProvider(e,n.WB.state.activeChain),n.En.sendEvent({type:"track",event:"SOCIAL_LOGIN_STARTED",properties:{provider:e}})),e===G.iV.Farcaster){n.IN.push("ConnectingFarcaster");let e=n.aK.getAuthConnector();if(e&&!n.Uj.state.farcasterUrl)try{let{url:t}=await e.provider.getFarcasterUri();n.Uj.setFarcasterUrl(t,n.WB.state.activeChain)}catch(e){n.IN.goBack(),n.Pt.showError(e)}}else{n.IN.push("ConnectingSocial");let t=n.aK.getAuthConnector();this.popupWindow=n.wE.returnOpenHref("","popupWindow","width=600,height=800,scrollbars=yes");try{if(t&&e){let{uri:i}=await t.provider.getSocialRedirectUri({provider:e});if(this.popupWindow&&i)n.Uj.setSocialWindow(this.popupWindow,n.WB.state.activeChain),this.popupWindow.location.href=i;else throw this.popupWindow?.close(),Error("Something went wrong")}}catch(e){this.popupWindow?.close(),n.Pt.showError("Something went wrong")}}}};rv.styles=rm,rb([(0,o.MZ)()],rv.prototype,"walletGuide",void 0),rb([(0,o.MZ)()],rv.prototype,"tabIdx",void 0),rb([(0,o.wk)()],rv.prototype,"connectors",void 0),rb([(0,o.wk)()],rv.prototype,"features",void 0),rb([(0,o.wk)()],rv.prototype,"authConnector",void 0),rv=rb([(0,r.customElement)("w3m-social-login-widget")],rv);var ry=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o};let rx=class extends a.WF{constructor(){super(...arguments),this.tabIdx=void 0}render(){return(0,a.qy)` `}};ry([(0,o.MZ)()],rx.prototype,"tabIdx",void 0),rx=ry([(0,r.customElement)("w3m-wallet-login-list")],rx);let rC=(0,a.AH)` :host { margin-top: var(--wui-spacing-3xs); } wui-separator { margin: var(--wui-spacing-m) calc(var(--wui-spacing-m) * -1) var(--wui-spacing-xs) calc(var(--wui-spacing-m) * -1); width: calc(100% + var(--wui-spacing-s) * 2); } `;var rA=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o};let rE=class extends a.WF{constructor(){super(),this.unsubscribe=[],this.tabIdx=void 0,this.connectors=n.aK.state.connectors,this.authConnector=this.connectors.find(e=>"AUTH"===e.type),this.features=n.Hd.state.features,this.unsubscribe.push(n.aK.subscribeKey("connectors",e=>{this.connectors=e,this.authConnector=this.connectors.find(e=>"AUTH"===e.type)}),n.Hd.subscribeKey("features",e=>this.features=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){let e=this.features?.socials;return this.authConnector&&e&&e?.length?(0,a.qy)` ${e.map(e=>(0,a.qy)`{this.onSocialClick(e)}} name=${e} logo=${e} tabIdx=${(0,s.J)(this.tabIdx)} >`)} `:null}async onSocialClick(e){if(e&&(n.Uj.setSocialProvider(e,n.WB.state.activeChain),n.En.sendEvent({type:"track",event:"SOCIAL_LOGIN_STARTED",properties:{provider:e}})),e===G.iV.Farcaster){n.IN.push("ConnectingFarcaster");let e=n.aK.getAuthConnector();if(e&&!n.Uj.state.farcasterUrl)try{let{url:t}=await e.provider.getFarcasterUri();n.Uj.setFarcasterUrl(t,n.WB.state.activeChain)}catch(e){n.IN.goBack(),n.Pt.showError(e)}}else{n.IN.push("ConnectingSocial");let t=n.aK.getAuthConnector();this.popupWindow=n.wE.returnOpenHref("","popupWindow","width=600,height=800,scrollbars=yes");try{if(t&&e){let{uri:i}=await t.provider.getSocialRedirectUri({provider:e});if(this.popupWindow&&i)n.Uj.setSocialWindow(this.popupWindow,n.WB.state.activeChain),this.popupWindow.location.href=i;else throw this.popupWindow?.close(),Error("Something went wrong")}}catch(e){this.popupWindow?.close(),n.Pt.showError("Something went wrong")}}}};rE.styles=rC,rA([(0,o.MZ)()],rE.prototype,"tabIdx",void 0),rA([(0,o.wk)()],rE.prototype,"connectors",void 0),rA([(0,o.wk)()],rE.prototype,"authConnector",void 0),rA([(0,o.wk)()],rE.prototype,"features",void 0),rE=rA([(0,r.customElement)("w3m-social-login-list")],rE);var r_=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o};let rk=class extends a.WF{constructor(){super(),this.unsubscribe=[],this.tabIdx=void 0,this.connectors=n.aK.state.connectors,this.unsubscribe.push(n.aK.subscribeKey("connectors",e=>this.connectors=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){let e=this.connectors.filter(e=>"ANNOUNCED"===e.type);return e?.length?(0,a.qy)` ${e.map(e=>e.info?.rdns&&n.Np.state.excludedRDNS&&n.Np.state.excludedRDNS.includes(e?.info?.rdns)?null:(0,a.qy)` this.onConnector(e)} tagVariant="success" tagLabel="installed" data-testid=${`wallet-selector-${e.id}`} .installed=${!0} tabIdx=${(0,s.J)(this.tabIdx)} > `)} `:(this.style.cssText="display: none",null)}onConnector(e){"walletConnect"===e.id?n.wE.isMobile()?n.IN.push("AllWallets"):n.IN.push("ConnectingWalletConnect"):n.IN.push("ConnectingExternal",{connector:e})}};r_([(0,o.MZ)()],rk.prototype,"tabIdx",void 0),r_([(0,o.wk)()],rk.prototype,"connectors",void 0),rk=r_([(0,r.customElement)("w3m-connect-announced-widget")],rk);var rI=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o};let rS=class extends a.WF{constructor(){super(),this.unsubscribe=[],this.tabIdx=void 0,this.connectors=n.aK.state.connectors,this.unsubscribe.push(n.aK.subscribeKey("connectors",e=>this.connectors=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){let{customWallets:e}=n.Hd.state;if(!e?.length)return this.style.cssText="display: none",null;let t=this.filterOutDuplicateWallets(e);return(0,a.qy)` ${t.map(e=>(0,a.qy)` this.onConnectWallet(e)} data-testid=${`wallet-selector-${e.id}`} tabIdx=${(0,s.J)(this.tabIdx)} > `)} `}filterOutDuplicateWallets(e){let t=n.iT.getRecentWallets(),i=this.connectors.map(e=>e.info?.rdns).filter(Boolean),r=t.map(e=>e.rdns).filter(Boolean),a=i.concat(r);if(a.includes("io.metamask.mobile")&&n.wE.isMobile()){let e=a.indexOf("io.metamask.mobile");a[e]="io.metamask"}return e.filter(e=>!a.includes(String(e?.rdns)))}onConnectWallet(e){n.IN.push("ConnectingWalletConnect",{wallet:e})}};rI([(0,o.MZ)()],rS.prototype,"tabIdx",void 0),rI([(0,o.wk)()],rS.prototype,"connectors",void 0),rS=rI([(0,r.customElement)("w3m-connect-custom-widget")],rS);var rT=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o};let rN=class extends a.WF{constructor(){super(...arguments),this.unsubscribe=[],this.tabIdx=void 0}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){let{featured:e}=n.Np.state;if(!e.length)return this.style.cssText="display: none",null;let t=tZ.filterOutDuplicateWallets(e);return(0,a.qy)` ${t.map(e=>(0,a.qy)` this.onConnectWallet(e)} tabIdx=${(0,s.J)(this.tabIdx)} > `)} `}onConnectWallet(e){let t=n.aK.getConnector(e.id,e.rdns);t?n.IN.push("ConnectingExternal",{connector:t}):n.IN.push("ConnectingWalletConnect",{wallet:e})}};rT([(0,o.MZ)()],rN.prototype,"tabIdx",void 0),rN=rT([(0,r.customElement)("w3m-connect-featured-widget")],rN);var rP=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o};let rR=class extends a.WF{constructor(){super(),this.unsubscribe=[],this.tabIdx=void 0,this.connectors=n.aK.state.connectors,this.unsubscribe.push(n.aK.subscribeKey("connectors",e=>this.connectors=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){let e=this.connectors.filter(e=>"INJECTED"===e.type);return e?.length&&(1!==e.length||e[0]?.name!=="Browser Wallet"||n.wE.isMobile())?(0,a.qy)` ${e.map(e=>{if(!n.wE.isMobile()&&"Browser Wallet"===e.name)return null;let t=e.info?.rdns;return t||n.x4.checkInstalled(void 0)?t&&n.Np.state.excludedRDNS&&n.Np.state.excludedRDNS.includes(t)?null:(0,a.qy)` this.onConnector(e)} tabIdx=${(0,s.J)(this.tabIdx)} > `:(this.style.cssText="display: none",null)})} `:(this.style.cssText="display: none",null)}onConnector(e){n.WB.setActiveConnector(e),n.IN.push("ConnectingExternal",{connector:e})}};rP([(0,o.MZ)()],rR.prototype,"tabIdx",void 0),rP([(0,o.wk)()],rR.prototype,"connectors",void 0),rR=rP([(0,r.customElement)("w3m-connect-injected-widget")],rR);var rO=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o};let rM=class extends a.WF{constructor(){super(),this.unsubscribe=[],this.tabIdx=void 0,this.connectors=n.aK.state.connectors,this.unsubscribe.push(n.aK.subscribeKey("connectors",e=>this.connectors=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){let e=this.connectors.filter(e=>"MULTI_CHAIN"===e.type&&"WalletConnect"!==e.name);return e?.length?(0,a.qy)` ${e.map(e=>(0,a.qy)` this.onConnector(e)} tabIdx=${(0,s.J)(this.tabIdx)} > `)} `:(this.style.cssText="display: none",null)}onConnector(e){n.WB.setActiveConnector(e),n.IN.push("ConnectingMultiChain")}};rO([(0,o.MZ)()],rM.prototype,"tabIdx",void 0),rO([(0,o.wk)()],rM.prototype,"connectors",void 0),rM=rO([(0,r.customElement)("w3m-connect-multi-chain-widget")],rM);var rD=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o};let rU=class extends a.WF{constructor(){super(),this.unsubscribe=[],this.tabIdx=void 0,this.connectors=n.aK.state.connectors,this.unsubscribe.push(n.aK.subscribeKey("connectors",e=>this.connectors=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){let e=this.connectors.filter(e=>"EXTERNAL"===e.type).filter(e=>"coinbaseWalletSDK"!==e.id);return e?.length?(0,a.qy)` ${e.map(e=>(0,a.qy)` this.onConnector(e)} tabIdx=${(0,s.J)(this.tabIdx)} > `)} `:(this.style.cssText="display: none",null)}onConnector(e){n.IN.push("ConnectingExternal",{connector:e})}};rD([(0,o.MZ)()],rU.prototype,"tabIdx",void 0),rD([(0,o.wk)()],rU.prototype,"connectors",void 0),rU=rD([(0,r.customElement)("w3m-connect-external-widget")],rU);var r$=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o};let rL=class extends a.WF{constructor(){super(...arguments),this.tabIdx=void 0}render(){let e=n.iT.getRecentWallets();return e?.length?(0,a.qy)` ${e.map(e=>(0,a.qy)` this.onConnectWallet(e)} tagLabel="recent" tagVariant="shade" tabIdx=${(0,s.J)(this.tabIdx)} > `)} `:(this.style.cssText="display: none",null)}onConnectWallet(e){n.IN.push("ConnectingWalletConnect",{wallet:e})}};r$([(0,o.MZ)()],rL.prototype,"tabIdx",void 0),rL=r$([(0,r.customElement)("w3m-connect-recent-widget")],rL);var rj=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o};let rB=class extends a.WF{constructor(){super(),this.unsubscribe=[],this.tabIdx=void 0,this.connectors=n.aK.state.connectors,this.unsubscribe.push(n.aK.subscribeKey("connectors",e=>this.connectors=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){if(!this.connectors.find(e=>"walletConnect"===e.id))return null;let{recommended:e}=n.Np.state,{customWallets:t,featuredWalletIds:i}=n.Hd.state,{connectors:r}=n.aK.state,o=n.iT.getRecentWallets(),c=r.filter(e=>"INJECTED"===e.type||"ANNOUNCED"===e.type||"MULTI_CHAIN"===e.type).filter(e=>"Browser Wallet"!==e.name);if(i||t||!e.length)return this.style.cssText="display: none",null;let l=Math.max(0,2-(c.length+o.length)),u=tZ.filterOutDuplicateWallets(e).slice(0,l);return u.length?(0,a.qy)` ${u.map(e=>(0,a.qy)` this.onConnectWallet(e)} tabIdx=${(0,s.J)(this.tabIdx)} > `)} `:(this.style.cssText="display: none",null)}onConnectWallet(e){let t=n.aK.getConnector(e.id,e.rdns);t?n.IN.push("ConnectingExternal",{connector:t}):n.IN.push("ConnectingWalletConnect",{wallet:e})}};rj([(0,o.MZ)()],rB.prototype,"tabIdx",void 0),rj([(0,o.wk)()],rB.prototype,"connectors",void 0),rB=rj([(0,r.customElement)("w3m-connect-recommended-widget")],rB);var rW=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o};let rq=class extends a.WF{constructor(){super(),this.unsubscribe=[],this.tabIdx=void 0,this.connectors=n.aK.state.connectors,this.unsubscribe.push(n.aK.subscribeKey("connectors",e=>this.connectors=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){if(n.wE.isMobile())return this.style.cssText="display: none",null;let e=this.connectors.find(e=>"walletConnect"===e.id);return e?(0,a.qy)` this.onConnector(e)} tagLabel="qr code" tagVariant="main" tabIdx=${(0,s.J)(this.tabIdx)} data-testid="wallet-selector-walletconnect" > `:(this.style.cssText="display: none",null)}onConnector(e){n.WB.setActiveConnector(e),n.IN.push("ConnectingWalletConnect")}};rW([(0,o.MZ)()],rq.prototype,"tabIdx",void 0),rW([(0,o.wk)()],rq.prototype,"connectors",void 0),rq=rW([(0,r.customElement)("w3m-connect-walletconnect-widget")],rq);let rH=(0,a.AH)` :host { margin-top: var(--wui-spacing-3xs); } wui-separator { margin: var(--wui-spacing-m) calc(var(--wui-spacing-m) * -1) var(--wui-spacing-xs) calc(var(--wui-spacing-m) * -1); width: calc(100% + var(--wui-spacing-s) * 2); } `;var rz=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o};let rF=class extends a.WF{constructor(){super(),this.unsubscribe=[],this.tabIdx=void 0,this.connectors=n.aK.state.connectors,this.unsubscribe.push(n.aK.subscribeKey("connectors",e=>this.connectors=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){let{custom:e,recent:t,announced:i,injected:r,multiChain:o,recommended:c,featured:l,external:u}=this.getConnectorsByType(),d=n.Hd.state.enableWalletConnect;return(0,a.qy)` ${d?(0,a.qy)``:null} ${t.length?(0,a.qy)``:null} ${o.length?(0,a.qy)``:null} ${i.length?(0,a.qy)``:null} ${r.length?(0,a.qy)``:null} ${l.length?(0,a.qy)``:null} ${e?.length?(0,a.qy)``:null} ${u.length?(0,a.qy)``:null} ${c.length?(0,a.qy)``:null} `}getConnectorsByType(){let{featured:e,recommended:t}=n.Np.state,{customWallets:i}=n.Hd.state,r=n.iT.getRecentWallets(),a=tZ.filterOutDuplicateWallets(t),o=tZ.filterOutDuplicateWallets(e),s=this.connectors.filter(e=>"MULTI_CHAIN"===e.type),c=this.connectors.filter(e=>"ANNOUNCED"===e.type),l=this.connectors.filter(e=>"INJECTED"===e.type);return{custom:i,recent:r,external:this.connectors.filter(e=>"EXTERNAL"===e.type),multiChain:s,announced:c,injected:l,recommended:a,featured:o}}};rF.styles=rH,rz([(0,o.MZ)()],rF.prototype,"tabIdx",void 0),rz([(0,o.wk)()],rF.prototype,"connectors",void 0),rF=rz([(0,r.customElement)("w3m-connector-list")],rF);var rZ=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o};let rV=class extends a.WF{constructor(){super(),this.unsubscribe=[],this.tabIdx=void 0,this.connectors=n.aK.state.connectors,this.count=n.Np.state.count,this.unsubscribe.push(n.aK.subscribeKey("connectors",e=>this.connectors=e),n.Np.subscribeKey("count",e=>this.count=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){let e=this.connectors.find(e=>"walletConnect"===e.id),{allWallets:t}=n.Hd.state;if(!e||"HIDE"===t||"ONLY_MOBILE"===t&&!n.wE.isMobile())return null;let i=n.Np.state.featured.length,r=this.count+i,o=r<10?r:10*Math.floor(r/10),c=o `}onAllWallets(){n.En.sendEvent({type:"track",event:"CLICK_ALL_WALLETS"}),n.IN.push("AllWallets")}};rZ([(0,o.MZ)()],rV.prototype,"tabIdx",void 0),rZ([(0,o.wk)()],rV.prototype,"connectors",void 0),rZ([(0,o.wk)()],rV.prototype,"count",void 0),rV=rZ([(0,r.customElement)("w3m-all-wallets-widget")],rV);let rK=class extends a.WF{constructor(){super(...arguments),this.socialProvider=n.iT.getConnectedSocialProvider(),this.socialUsername=n.iT.getConnectedSocialUsername()}render(){let e=n.iT.getConnectedConnector(),t=n.aK.getAuthConnector();if(!t||"ID_AUTH"!==e)return this.style.cssText="display: none",null;let i=t.provider.getEmail()??"";return(0,a.qy)` {this.onGoToUpdateEmail(i,this.socialProvider)}} > ${this.getAuthName(i)} `}onGoToUpdateEmail(e,t){t||n.IN.push("UpdateEmailWallet",{email:e})}getAuthName(e){return this.socialUsername?"discord"===this.socialProvider&&this.socialUsername.endsWith("0")?this.socialUsername.slice(0,-1):this.socialUsername:e.length>30?`${e.slice(0,-3)}...`:e}};rK=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o}([(0,r.customElement)("w3m-account-auth-button")],rK);let rG=(0,a.AH)` wui-flex { width: 100%; } .wallet-guide { width: 100%; } .chip-box { width: fit-content; background-color: var(--wui-color-gray-glass-005); border-radius: var(--wui-border-radius-3xl); } `;var rJ=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o};let rY=class extends a.WF{constructor(){super(...arguments),this.walletGuide="get-started"}render(){return"explore"===this.walletGuide?(0,a.qy)` Looking for a self-custody wallet? `:(0,a.qy)` Haven't got a wallet? Get started `}onGetStarted(){n.IN.push("Create")}};rY.styles=rG,rJ([(0,o.MZ)()],rY.prototype,"tabIdx",void 0),rJ([(0,o.MZ)()],rY.prototype,"walletGuide",void 0),rY=rJ([(0,r.customElement)("w3m-wallet-guide")],rY);let rQ=(0,a.AH)` :host { display: flex; justify-content: center; gap: var(--wui-spacing-2xl); } wui-visual-thumbnail:nth-child(1) { z-index: 1; } `,rX=class extends a.WF{constructor(){super(...arguments),this.dappImageUrl=n.Hd.state.metadata?.icons,this.walletImageUrl=n.Uj.state.connectedWalletInfo?.icon}firstUpdated(){let e=this.shadowRoot?.querySelectorAll("wui-visual-thumbnail");e?.[0]&&this.createAnimation(e[0],"translate(18px)"),e?.[1]&&this.createAnimation(e[1],"translate(-18px)")}render(){return(0,a.qy)` `}createAnimation(e,t){e.animate([{transform:"translateX(0px)"},{transform:t}],{duration:1600,easing:"cubic-bezier(0.56, 0, 0.48, 1)",direction:"alternate",iterations:1/0})}};rX.styles=rQ,rX=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o}([(0,r.customElement)("w3m-siwx-sign-message-thumbnails")],rX)},57068:(e,t,i)=>{"use strict";let r,n,a;i.r(t),i.d(t,{MathUtil:()=>n5,TransactionUtil:()=>n8,UiHelperUtil:()=>tT,WuiAccountButton:()=>tW,WuiAlertBar:()=>rC,WuiAllWalletsImage:()=>tV,WuiAvatar:()=>tD,WuiBalance:()=>r5,WuiBanner:()=>nl,WuiBannerImg:()=>nh,WuiButton:()=>tX,WuiCard:()=>y,WuiCardSelect:()=>it,WuiCardSelectLoader:()=>t3,WuiCertifiedSwitch:()=>nY,WuiCheckBox:()=>nF,WuiChip:()=>ia,WuiChipButton:()=>nr,WuiCompatibleNetwork:()=>no,WuiConnectButton:()=>ic,WuiCtaButton:()=>id,WuiDetailsGroup:()=>ip,WuiDetailsGroupItem:()=>im,WuiDropdownMenu:()=>iy,WuiEmailInput:()=>iI,WuiEnsInput:()=>iN,WuiFlex:()=>tR,WuiGrid:()=>n0,WuiIcon:()=>eZ,WuiIconBox:()=>tL,WuiIconButton:()=>nO,WuiIconLink:()=>iO,WuiImage:()=>eG,WuiInputAmount:()=>nA,WuiInputElement:()=>iU,WuiInputNumeric:()=>ij,WuiInputText:()=>iE,WuiLink:()=>iq,WuiListAccordion:()=>rH,WuiListAccount:()=>nN,WuiListButton:()=>nU,WuiListContent:()=>rZ,WuiListDescription:()=>nb,WuiListItem:()=>iF,WuiListNetwork:()=>rG,WuiListSocial:()=>nj,WuiListToken:()=>ng,WuiListWallet:()=>i4,WuiListWalletTransaction:()=>rQ,WuiLoadingHexagon:()=>eY,WuiLoadingSpinner:()=>e0,WuiLoadingThumbnail:()=>e3,WuiLogo:()=>i9,WuiLogoSelect:()=>rt,WuiNetworkButton:()=>rn,WuiNetworkImage:()=>t9,WuiNoticeCard:()=>rB,WuiOtp:()=>rs,WuiPreviewItem:()=>nk,WuiProfileButton:()=>r8,WuiProfileButtonV2:()=>ne,WuiPromo:()=>r1,WuiQrCode:()=>rp,WuiSearchBar:()=>rg,WuiSelect:()=>nq,WuiSeparator:()=>n3,WuiShimmer:()=>e6,WuiSnackbar:()=>rb,WuiSwitch:()=>nK,WuiTabs:()=>r_,WuiTag:()=>i2,WuiText:()=>te,WuiTokenButton:()=>rS,WuiTokenListItem:()=>rM,WuiTooltip:()=>rP,WuiTransactionListItem:()=>iY,WuiTransactionListItemLoader:()=>iX,WuiTransactionVisual:()=>iK,WuiVisual:()=>tI,WuiVisualThumbnail:()=>r$,WuiWalletImage:()=>tz,customElement:()=>b,initializeTheming:()=>d,setColorTheme:()=>h,setThemeVariables:()=>p,swapInputMaskBottomSvg:()=>c,swapInputMaskTopSvg:()=>l});var o,s=i(16896);let c=(0,s.JW)` `,l=(0,s.JW)` `;var u=i(50639);function d(e,t){r=document.createElement("style"),n=document.createElement("style"),a=document.createElement("style"),r.textContent=f(e).core.cssText,n.textContent=f(e).dark.cssText,a.textContent=f(e).light.cssText,document.head.appendChild(r),document.head.appendChild(n),document.head.appendChild(a),h(t)}function h(e){n&&a&&("light"===e?(n.removeAttribute("media"),a.media="enabled"):(a.removeAttribute("media"),n.media="enabled"))}function p(e){r&&n&&a&&(r.textContent=f(e).core.cssText,n.textContent=f(e).dark.cssText,a.textContent=f(e).light.cssText)}function f(e){return{core:(0,s.AH)` @import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap'); @keyframes w3m-shake { 0% { transform: scale(1) rotate(0deg); } 20% { transform: scale(1) rotate(-1deg); } 40% { transform: scale(1) rotate(1.5deg); } 60% { transform: scale(1) rotate(-1.5deg); } 80% { transform: scale(1) rotate(1deg); } 100% { transform: scale(1) rotate(0deg); } } @keyframes w3m-iframe-fade-out { 0% { opacity: 1; } 100% { opacity: 0; } } @keyframes w3m-iframe-zoom-in { 0% { transform: translateY(50px); opacity: 0; } 100% { transform: translateY(0px); opacity: 1; } } @keyframes w3m-iframe-zoom-in-mobile { 0% { transform: scale(0.95); opacity: 0; } 100% { transform: scale(1); opacity: 1; } } :root { --w3m-modal-width: 360px; --w3m-color-mix-strength: ${(0,s.iz)(e?.["--w3m-color-mix-strength"]?`${e["--w3m-color-mix-strength"]}%`:"0%")}; --w3m-font-family: ${(0,s.iz)(e?.["--w3m-font-family"]||"Inter, Segoe UI, Roboto, Oxygen, Ubuntu, Cantarell, Fira Sans, Droid Sans, Helvetica Neue, sans-serif;")}; --w3m-font-size-master: ${(0,s.iz)(e?.["--w3m-font-size-master"]||"10px")}; --w3m-border-radius-master: ${(0,s.iz)(e?.["--w3m-border-radius-master"]||"4px")}; --w3m-z-index: ${(0,s.iz)(e?.["--w3m-z-index"]||999)}; --wui-font-family: var(--w3m-font-family); --wui-font-size-mini: calc(var(--w3m-font-size-master) * 0.8); --wui-font-size-micro: var(--w3m-font-size-master); --wui-font-size-tiny: calc(var(--w3m-font-size-master) * 1.2); --wui-font-size-small: calc(var(--w3m-font-size-master) * 1.4); --wui-font-size-paragraph: calc(var(--w3m-font-size-master) * 1.6); --wui-font-size-medium: calc(var(--w3m-font-size-master) * 1.8); --wui-font-size-large: calc(var(--w3m-font-size-master) * 2); --wui-font-size-title-6: calc(var(--w3m-font-size-master) * 2.2); --wui-font-size-medium-title: calc(var(--w3m-font-size-master) * 2.4); --wui-font-size-2xl: calc(var(--w3m-font-size-master) * 4); --wui-border-radius-5xs: var(--w3m-border-radius-master); --wui-border-radius-4xs: calc(var(--w3m-border-radius-master) * 1.5); --wui-border-radius-3xs: calc(var(--w3m-border-radius-master) * 2); --wui-border-radius-xxs: calc(var(--w3m-border-radius-master) * 3); --wui-border-radius-xs: calc(var(--w3m-border-radius-master) * 4); --wui-border-radius-s: calc(var(--w3m-border-radius-master) * 5); --wui-border-radius-m: calc(var(--w3m-border-radius-master) * 7); --wui-border-radius-l: calc(var(--w3m-border-radius-master) * 9); --wui-border-radius-3xl: calc(var(--w3m-border-radius-master) * 20); --wui-font-weight-light: 400; --wui-font-weight-regular: 500; --wui-font-weight-medium: 600; --wui-font-weight-bold: 700; --wui-letter-spacing-2xl: -1.6px; --wui-letter-spacing-medium-title: -0.96px; --wui-letter-spacing-title-6: -0.88px; --wui-letter-spacing-large: -0.8px; --wui-letter-spacing-medium: -0.72px; --wui-letter-spacing-paragraph: -0.64px; --wui-letter-spacing-small: -0.56px; --wui-letter-spacing-tiny: -0.48px; --wui-letter-spacing-micro: -0.2px; --wui-letter-spacing-mini: -0.16px; --wui-spacing-0: 0px; --wui-spacing-4xs: 2px; --wui-spacing-3xs: 4px; --wui-spacing-xxs: 6px; --wui-spacing-2xs: 7px; --wui-spacing-xs: 8px; --wui-spacing-1xs: 10px; --wui-spacing-s: 12px; --wui-spacing-m: 14px; --wui-spacing-l: 16px; --wui-spacing-2l: 18px; --wui-spacing-xl: 20px; --wui-spacing-xxl: 24px; --wui-spacing-2xl: 32px; --wui-spacing-3xl: 40px; --wui-spacing-4xl: 90px; --wui-spacing-5xl: 95px; --wui-icon-box-size-xxs: 14px; --wui-icon-box-size-xs: 20px; --wui-icon-box-size-sm: 24px; --wui-icon-box-size-md: 32px; --wui-icon-box-size-lg: 40px; --wui-icon-box-size-2lg: 48px; --wui-icon-box-size-xl: 64px; --wui-icon-size-inherit: inherit; --wui-icon-size-xxs: 10px; --wui-icon-size-xs: 12px; --wui-icon-size-sm: 14px; --wui-icon-size-md: 16px; --wui-icon-size-mdl: 18px; --wui-icon-size-lg: 20px; --wui-icon-size-xl: 24px; --wui-icon-size-xxl: 28px; --wui-wallet-image-size-inherit: inherit; --wui-wallet-image-size-sm: 40px; --wui-wallet-image-size-md: 56px; --wui-wallet-image-size-lg: 80px; --wui-visual-size-size-inherit: inherit; --wui-visual-size-sm: 40px; --wui-visual-size-md: 55px; --wui-visual-size-lg: 80px; --wui-box-size-md: 100px; --wui-box-size-lg: 120px; --wui-ease-out-power-2: cubic-bezier(0, 0, 0.22, 1); --wui-ease-out-power-1: cubic-bezier(0, 0, 0.55, 1); --wui-ease-in-power-3: cubic-bezier(0.66, 0, 1, 1); --wui-ease-in-power-2: cubic-bezier(0.45, 0, 1, 1); --wui-ease-in-power-1: cubic-bezier(0.3, 0, 1, 1); --wui-ease-inout-power-1: cubic-bezier(0.45, 0, 0.55, 1); --wui-duration-lg: 200ms; --wui-duration-md: 125ms; --wui-duration-sm: 75ms; --wui-path-network-sm: path( 'M15.4 2.1a5.21 5.21 0 0 1 5.2 0l11.61 6.7a5.21 5.21 0 0 1 2.61 4.52v13.4c0 1.87-1 3.59-2.6 4.52l-11.61 6.7c-1.62.93-3.6.93-5.22 0l-11.6-6.7a5.21 5.21 0 0 1-2.61-4.51v-13.4c0-1.87 1-3.6 2.6-4.52L15.4 2.1Z' ); --wui-path-network-md: path( 'M43.4605 10.7248L28.0485 1.61089C25.5438 0.129705 22.4562 0.129705 19.9515 1.61088L4.53951 10.7248C2.03626 12.2051 0.5 14.9365 0.5 17.886V36.1139C0.5 39.0635 2.03626 41.7949 4.53951 43.2752L19.9515 52.3891C22.4562 53.8703 25.5438 53.8703 28.0485 52.3891L43.4605 43.2752C45.9637 41.7949 47.5 39.0635 47.5 36.114V17.8861C47.5 14.9365 45.9637 12.2051 43.4605 10.7248Z' ); --wui-path-network-lg: path( 'M78.3244 18.926L50.1808 2.45078C45.7376 -0.150261 40.2624 -0.150262 35.8192 2.45078L7.6756 18.926C3.23322 21.5266 0.5 26.3301 0.5 31.5248V64.4752C0.5 69.6699 3.23322 74.4734 7.6756 77.074L35.8192 93.5492C40.2624 96.1503 45.7376 96.1503 50.1808 93.5492L78.3244 77.074C82.7668 74.4734 85.5 69.6699 85.5 64.4752V31.5248C85.5 26.3301 82.7668 21.5266 78.3244 18.926Z' ); --wui-width-network-sm: 36px; --wui-width-network-md: 48px; --wui-width-network-lg: 86px; --wui-height-network-sm: 40px; --wui-height-network-md: 54px; --wui-height-network-lg: 96px; --wui-icon-size-network-xs: 12px; --wui-icon-size-network-sm: 16px; --wui-icon-size-network-md: 24px; --wui-icon-size-network-lg: 42px; --wui-color-inherit: inherit; --wui-color-inverse-100: #fff; --wui-color-inverse-000: #000; --wui-cover: rgba(20, 20, 20, 0.8); --wui-color-modal-bg: var(--wui-color-modal-bg-base); --wui-color-accent-100: var(--wui-color-accent-base-100); --wui-color-accent-090: var(--wui-color-accent-base-090); --wui-color-accent-080: var(--wui-color-accent-base-080); --wui-color-success-100: var(--wui-color-success-base-100); --wui-color-success-125: var(--wui-color-success-base-125); --wui-color-warning-100: var(--wui-color-warning-base-100); --wui-color-error-100: var(--wui-color-error-base-100); --wui-color-error-125: var(--wui-color-error-base-125); --wui-color-blue-100: var(--wui-color-blue-base-100); --wui-color-blue-90: var(--wui-color-blue-base-90); --wui-icon-box-bg-error-100: var(--wui-icon-box-bg-error-base-100); --wui-icon-box-bg-blue-100: var(--wui-icon-box-bg-blue-base-100); --wui-icon-box-bg-success-100: var(--wui-icon-box-bg-success-base-100); --wui-icon-box-bg-inverse-100: var(--wui-icon-box-bg-inverse-base-100); --wui-all-wallets-bg-100: var(--wui-all-wallets-bg-100); --wui-avatar-border: var(--wui-avatar-border-base); --wui-thumbnail-border: var(--wui-thumbnail-border-base); --wui-box-shadow-blue: var(--wui-color-accent-glass-020); } @supports (background: color-mix(in srgb, white 50%, black)) { :root { --wui-color-modal-bg: color-mix( in srgb, var(--w3m-color-mix) var(--w3m-color-mix-strength), var(--wui-color-modal-bg-base) ); --wui-box-shadow-blue: color-mix(in srgb, var(--wui-color-accent-100) 20%, transparent); --wui-color-accent-100: color-mix( in srgb, var(--wui-color-accent-base-100) 100%, transparent ); --wui-color-accent-090: color-mix( in srgb, var(--wui-color-accent-base-100) 90%, transparent ); --wui-color-accent-080: color-mix( in srgb, var(--wui-color-accent-base-100) 80%, transparent ); --wui-color-accent-glass-090: color-mix( in srgb, var(--wui-color-accent-base-100) 90%, transparent ); --wui-color-accent-glass-080: color-mix( in srgb, var(--wui-color-accent-base-100) 80%, transparent ); --wui-color-accent-glass-020: color-mix( in srgb, var(--wui-color-accent-base-100) 20%, transparent ); --wui-color-accent-glass-015: color-mix( in srgb, var(--wui-color-accent-base-100) 15%, transparent ); --wui-color-accent-glass-010: color-mix( in srgb, var(--wui-color-accent-base-100) 10%, transparent ); --wui-color-accent-glass-005: color-mix( in srgb, var(--wui-color-accent-base-100) 5%, transparent ); --wui-color-accent-002: color-mix( in srgb, var(--wui-color-accent-base-100) 2%, transparent ); --wui-color-fg-100: color-mix( in srgb, var(--w3m-color-mix) var(--w3m-color-mix-strength), var(--wui-color-fg-100) ); --wui-color-fg-125: color-mix( in srgb, var(--w3m-color-mix) var(--w3m-color-mix-strength), var(--wui-color-fg-125) ); --wui-color-fg-150: color-mix( in srgb, var(--w3m-color-mix) var(--w3m-color-mix-strength), var(--wui-color-fg-150) ); --wui-color-fg-175: color-mix( in srgb, var(--w3m-color-mix) var(--w3m-color-mix-strength), var(--wui-color-fg-175) ); --wui-color-fg-200: color-mix( in srgb, var(--w3m-color-mix) var(--w3m-color-mix-strength), var(--wui-color-fg-200) ); --wui-color-fg-225: color-mix( in srgb, var(--w3m-color-mix) var(--w3m-color-mix-strength), var(--wui-color-fg-225) ); --wui-color-fg-250: color-mix( in srgb, var(--w3m-color-mix) var(--w3m-color-mix-strength), var(--wui-color-fg-250) ); --wui-color-fg-275: color-mix( in srgb, var(--w3m-color-mix) var(--w3m-color-mix-strength), var(--wui-color-fg-275) ); --wui-color-fg-300: color-mix( in srgb, var(--w3m-color-mix) var(--w3m-color-mix-strength), var(--wui-color-fg-300) ); --wui-color-fg-325: color-mix( in srgb, var(--w3m-color-mix) var(--w3m-color-mix-strength), var(--wui-color-fg-325) ); --wui-color-fg-350: color-mix( in srgb, var(--w3m-color-mix) var(--w3m-color-mix-strength), var(--wui-color-fg-350) ); --wui-color-bg-100: color-mix( in srgb, var(--w3m-color-mix) var(--w3m-color-mix-strength), var(--wui-color-bg-100) ); --wui-color-bg-125: color-mix( in srgb, var(--w3m-color-mix) var(--w3m-color-mix-strength), var(--wui-color-bg-125) ); --wui-color-bg-150: color-mix( in srgb, var(--w3m-color-mix) var(--w3m-color-mix-strength), var(--wui-color-bg-150) ); --wui-color-bg-175: color-mix( in srgb, var(--w3m-color-mix) var(--w3m-color-mix-strength), var(--wui-color-bg-175) ); --wui-color-bg-200: color-mix( in srgb, var(--w3m-color-mix) var(--w3m-color-mix-strength), var(--wui-color-bg-200) ); --wui-color-bg-225: color-mix( in srgb, var(--w3m-color-mix) var(--w3m-color-mix-strength), var(--wui-color-bg-225) ); --wui-color-bg-250: color-mix( in srgb, var(--w3m-color-mix) var(--w3m-color-mix-strength), var(--wui-color-bg-250) ); --wui-color-bg-275: color-mix( in srgb, var(--w3m-color-mix) var(--w3m-color-mix-strength), var(--wui-color-bg-275) ); --wui-color-bg-300: color-mix( in srgb, var(--w3m-color-mix) var(--w3m-color-mix-strength), var(--wui-color-bg-300) ); --wui-color-bg-325: color-mix( in srgb, var(--w3m-color-mix) var(--w3m-color-mix-strength), var(--wui-color-bg-325) ); --wui-color-bg-350: color-mix( in srgb, var(--w3m-color-mix) var(--w3m-color-mix-strength), var(--wui-color-bg-350) ); --wui-color-success-100: color-mix( in srgb, var(--w3m-color-mix) var(--w3m-color-mix-strength), var(--wui-color-success-base-100) ); --wui-color-success-125: color-mix( in srgb, var(--w3m-color-mix) var(--w3m-color-mix-strength), var(--wui-color-success-base-125) ); --wui-color-warning-100: color-mix( in srgb, var(--w3m-color-mix) var(--w3m-color-mix-strength), var(--wui-color-warning-base-100) ); --wui-color-error-100: color-mix( in srgb, var(--w3m-color-mix) var(--w3m-color-mix-strength), var(--wui-color-error-base-100) ); --wui-color-blue-100: color-mix( in srgb, var(--w3m-color-mix) var(--w3m-color-mix-strength), var(--wui-color-blue-base-100) ); --wui-color-blue-90: color-mix( in srgb, var(--w3m-color-mix) var(--w3m-color-mix-strength), var(--wui-color-blue-base-90) ); --wui-color-error-125: color-mix( in srgb, var(--w3m-color-mix) var(--w3m-color-mix-strength), var(--wui-color-error-base-125) ); --wui-icon-box-bg-error-100: color-mix( in srgb, var(--w3m-color-mix) var(--w3m-color-mix-strength), var(--wui-icon-box-bg-error-base-100) ); --wui-icon-box-bg-accent-100: color-mix( in srgb, var(--w3m-color-mix) var(--w3m-color-mix-strength), var(--wui-icon-box-bg-blue-base-100) ); --wui-icon-box-bg-success-100: color-mix( in srgb, var(--w3m-color-mix) var(--w3m-color-mix-strength), var(--wui-icon-box-bg-success-base-100) ); --wui-icon-box-bg-inverse-100: color-mix( in srgb, var(--w3m-color-mix) var(--w3m-color-mix-strength), var(--wui-icon-box-bg-inverse-base-100) ); --wui-all-wallets-bg-100: color-mix( in srgb, var(--w3m-color-mix) var(--w3m-color-mix-strength), var(--wui-all-wallets-bg-100) ); --wui-avatar-border: color-mix( in srgb, var(--w3m-color-mix) var(--w3m-color-mix-strength), var(--wui-avatar-border-base) ); --wui-thumbnail-border: color-mix( in srgb, var(--w3m-color-mix) var(--w3m-color-mix-strength), var(--wui-thumbnail-border-base) ); } } `,light:(0,s.AH)` :root { --w3m-color-mix: ${(0,s.iz)(e?.["--w3m-color-mix"]||"#fff")}; --w3m-accent: ${(0,s.iz)((0,u.o_)(e,"dark")["--w3m-accent"])}; --w3m-default: #fff; --wui-color-modal-bg-base: ${(0,s.iz)((0,u.o_)(e,"dark")["--w3m-background"])}; --wui-color-accent-base-100: var(--w3m-accent); --wui-color-blueberry-100: hsla(230, 100%, 67%, 1); --wui-color-blueberry-090: hsla(231, 76%, 61%, 1); --wui-color-blueberry-080: hsla(230, 59%, 55%, 1); --wui-color-blueberry-050: hsla(231, 100%, 70%, 0.1); --wui-color-fg-100: #e4e7e7; --wui-color-fg-125: #d0d5d5; --wui-color-fg-150: #a8b1b1; --wui-color-fg-175: #a8b0b0; --wui-color-fg-200: #949e9e; --wui-color-fg-225: #868f8f; --wui-color-fg-250: #788080; --wui-color-fg-275: #788181; --wui-color-fg-300: #6e7777; --wui-color-fg-325: #9a9a9a; --wui-color-fg-350: #363636; --wui-color-bg-100: #141414; --wui-color-bg-125: #191a1a; --wui-color-bg-150: #1e1f1f; --wui-color-bg-175: #222525; --wui-color-bg-200: #272a2a; --wui-color-bg-225: #2c3030; --wui-color-bg-250: #313535; --wui-color-bg-275: #363b3b; --wui-color-bg-300: #3b4040; --wui-color-bg-325: #252525; --wui-color-bg-350: #ffffff; --wui-color-success-base-100: #26d962; --wui-color-success-base-125: #30a46b; --wui-color-warning-base-100: #f3a13f; --wui-color-error-base-100: #f25a67; --wui-color-error-base-125: #df4a34; --wui-color-blue-base-100: rgba(102, 125, 255, 1); --wui-color-blue-base-90: rgba(102, 125, 255, 0.9); --wui-color-success-glass-001: rgba(38, 217, 98, 0.01); --wui-color-success-glass-002: rgba(38, 217, 98, 0.02); --wui-color-success-glass-005: rgba(38, 217, 98, 0.05); --wui-color-success-glass-010: rgba(38, 217, 98, 0.1); --wui-color-success-glass-015: rgba(38, 217, 98, 0.15); --wui-color-success-glass-020: rgba(38, 217, 98, 0.2); --wui-color-success-glass-025: rgba(38, 217, 98, 0.25); --wui-color-success-glass-030: rgba(38, 217, 98, 0.3); --wui-color-success-glass-060: rgba(38, 217, 98, 0.6); --wui-color-success-glass-080: rgba(38, 217, 98, 0.8); --wui-color-success-glass-reown-020: rgba(48, 164, 107, 0.2); --wui-color-warning-glass-reown-020: rgba(243, 161, 63, 0.2); --wui-color-error-glass-001: rgba(242, 90, 103, 0.01); --wui-color-error-glass-002: rgba(242, 90, 103, 0.02); --wui-color-error-glass-005: rgba(242, 90, 103, 0.05); --wui-color-error-glass-010: rgba(242, 90, 103, 0.1); --wui-color-error-glass-015: rgba(242, 90, 103, 0.15); --wui-color-error-glass-020: rgba(242, 90, 103, 0.2); --wui-color-error-glass-025: rgba(242, 90, 103, 0.25); --wui-color-error-glass-030: rgba(242, 90, 103, 0.3); --wui-color-error-glass-060: rgba(242, 90, 103, 0.6); --wui-color-error-glass-080: rgba(242, 90, 103, 0.8); --wui-color-error-glass-reown-020: rgba(223, 74, 52, 0.2); --wui-color-gray-glass-001: rgba(255, 255, 255, 0.01); --wui-color-gray-glass-002: rgba(255, 255, 255, 0.02); --wui-color-gray-glass-005: rgba(255, 255, 255, 0.05); --wui-color-gray-glass-010: rgba(255, 255, 255, 0.1); --wui-color-gray-glass-015: rgba(255, 255, 255, 0.15); --wui-color-gray-glass-020: rgba(255, 255, 255, 0.2); --wui-color-gray-glass-025: rgba(255, 255, 255, 0.25); --wui-color-gray-glass-030: rgba(255, 255, 255, 0.3); --wui-color-gray-glass-060: rgba(255, 255, 255, 0.6); --wui-color-gray-glass-080: rgba(255, 255, 255, 0.8); --wui-color-gray-glass-090: rgba(255, 255, 255, 0.9); --wui-color-dark-glass-100: rgba(42, 42, 42, 1); --wui-icon-box-bg-error-base-100: #3c2426; --wui-icon-box-bg-blue-base-100: #20303f; --wui-icon-box-bg-success-base-100: #1f3a28; --wui-icon-box-bg-inverse-base-100: #243240; --wui-all-wallets-bg-100: #222b35; --wui-avatar-border-base: #252525; --wui-thumbnail-border-base: #252525; } `,dark:(0,s.AH)` :root { --w3m-color-mix: ${(0,s.iz)(e?.["--w3m-color-mix"]||"#000")}; --w3m-accent: ${(0,s.iz)((0,u.o_)(e,"light")["--w3m-accent"])}; --w3m-default: #000; --wui-color-modal-bg-base: ${(0,s.iz)((0,u.o_)(e,"light")["--w3m-background"])}; --wui-color-accent-base-100: var(--w3m-accent); --wui-color-blueberry-100: hsla(231, 100%, 70%, 1); --wui-color-blueberry-090: hsla(231, 97%, 72%, 1); --wui-color-blueberry-080: hsla(231, 92%, 74%, 1); --wui-color-fg-100: #141414; --wui-color-fg-125: #2d3131; --wui-color-fg-150: #474d4d; --wui-color-fg-175: #636d6d; --wui-color-fg-200: #798686; --wui-color-fg-225: #828f8f; --wui-color-fg-250: #8b9797; --wui-color-fg-275: #95a0a0; --wui-color-fg-300: #9ea9a9; --wui-color-fg-325: #9a9a9a; --wui-color-fg-350: #d0d0d0; --wui-color-bg-100: #ffffff; --wui-color-bg-125: #f5fafa; --wui-color-bg-150: #f3f8f8; --wui-color-bg-175: #eef4f4; --wui-color-bg-200: #eaf1f1; --wui-color-bg-225: #e5eded; --wui-color-bg-250: #e1e9e9; --wui-color-bg-275: #dce7e7; --wui-color-bg-300: #d8e3e3; --wui-color-bg-325: #f3f3f3; --wui-color-bg-350: #202020; --wui-color-success-base-100: #26b562; --wui-color-success-base-125: #30a46b; --wui-color-warning-base-100: #f3a13f; --wui-color-error-base-100: #f05142; --wui-color-error-base-125: #df4a34; --wui-color-blue-base-100: rgba(102, 125, 255, 1); --wui-color-blue-base-90: rgba(102, 125, 255, 0.9); --wui-color-success-glass-001: rgba(38, 181, 98, 0.01); --wui-color-success-glass-002: rgba(38, 181, 98, 0.02); --wui-color-success-glass-005: rgba(38, 181, 98, 0.05); --wui-color-success-glass-010: rgba(38, 181, 98, 0.1); --wui-color-success-glass-015: rgba(38, 181, 98, 0.15); --wui-color-success-glass-020: rgba(38, 181, 98, 0.2); --wui-color-success-glass-025: rgba(38, 181, 98, 0.25); --wui-color-success-glass-030: rgba(38, 181, 98, 0.3); --wui-color-success-glass-060: rgba(38, 181, 98, 0.6); --wui-color-success-glass-080: rgba(38, 181, 98, 0.8); --wui-color-success-glass-reown-020: rgba(48, 164, 107, 0.2); --wui-color-warning-glass-reown-020: rgba(243, 161, 63, 0.2); --wui-color-error-glass-001: rgba(240, 81, 66, 0.01); --wui-color-error-glass-002: rgba(240, 81, 66, 0.02); --wui-color-error-glass-005: rgba(240, 81, 66, 0.05); --wui-color-error-glass-010: rgba(240, 81, 66, 0.1); --wui-color-error-glass-015: rgba(240, 81, 66, 0.15); --wui-color-error-glass-020: rgba(240, 81, 66, 0.2); --wui-color-error-glass-025: rgba(240, 81, 66, 0.25); --wui-color-error-glass-030: rgba(240, 81, 66, 0.3); --wui-color-error-glass-060: rgba(240, 81, 66, 0.6); --wui-color-error-glass-080: rgba(240, 81, 66, 0.8); --wui-color-error-glass-reown-020: rgba(223, 74, 52, 0.2); --wui-icon-box-bg-error-base-100: #f4dfdd; --wui-icon-box-bg-blue-base-100: #d9ecfb; --wui-icon-box-bg-success-base-100: #daf0e4; --wui-icon-box-bg-inverse-base-100: #dcecfc; --wui-all-wallets-bg-100: #e8f1fa; --wui-avatar-border-base: #f3f4f4; --wui-thumbnail-border-base: #eaefef; --wui-color-gray-glass-001: rgba(0, 0, 0, 0.01); --wui-color-gray-glass-002: rgba(0, 0, 0, 0.02); --wui-color-gray-glass-005: rgba(0, 0, 0, 0.05); --wui-color-gray-glass-010: rgba(0, 0, 0, 0.1); --wui-color-gray-glass-015: rgba(0, 0, 0, 0.15); --wui-color-gray-glass-020: rgba(0, 0, 0, 0.2); --wui-color-gray-glass-025: rgba(0, 0, 0, 0.25); --wui-color-gray-glass-030: rgba(0, 0, 0, 0.3); --wui-color-gray-glass-060: rgba(0, 0, 0, 0.6); --wui-color-gray-glass-080: rgba(0, 0, 0, 0.8); --wui-color-gray-glass-090: rgba(0, 0, 0, 0.9); --wui-color-dark-glass-100: rgba(233, 233, 233, 1); } `}}let g=(0,s.AH)` *, *::after, *::before, :host { margin: 0; padding: 0; box-sizing: border-box; font-style: normal; text-rendering: optimizeSpeed; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; -webkit-tap-highlight-color: transparent; font-family: var(--wui-font-family); backface-visibility: hidden; } `,w=(0,s.AH)` button, a { cursor: pointer; display: flex; justify-content: center; align-items: center; position: relative; transition: color var(--wui-duration-lg) var(--wui-ease-out-power-1), background-color var(--wui-duration-lg) var(--wui-ease-out-power-1), border var(--wui-duration-lg) var(--wui-ease-out-power-1), box-shadow var(--wui-duration-lg) var(--wui-ease-out-power-1); will-change: background-color, color, border, box-shadow; outline: none; border: none; column-gap: var(--wui-spacing-3xs); background-color: transparent; text-decoration: none; } button:disabled > wui-wallet-image, button:disabled > wui-all-wallets-image, button:disabled > wui-network-image, button:disabled > wui-image, button:disabled > wui-transaction-visual, button:disabled > wui-logo { filter: grayscale(1); } @media (hover: hover) and (pointer: fine) { button:hover:enabled { background-color: var(--wui-color-gray-glass-005); } button:active:enabled { background-color: var(--wui-color-gray-glass-010); } } button:disabled > wui-icon-box { opacity: 0.5; } input { border: none; outline: none; appearance: none; } `,m=(0,s.AH)` .wui-color-inherit { color: var(--wui-color-inherit); } .wui-color-accent-100 { color: var(--wui-color-accent-100); } .wui-color-error-100 { color: var(--wui-color-error-100); } .wui-color-blue-100 { color: var(--wui-color-blue-100); } .wui-color-blue-90 { color: var(--wui-color-blue-90); } .wui-color-error-125 { color: var(--wui-color-error-125); } .wui-color-success-100 { color: var(--wui-color-success-100); } .wui-color-success-125 { color: var(--wui-color-success-125); } .wui-color-inverse-100 { color: var(--wui-color-inverse-100); } .wui-color-inverse-000 { color: var(--wui-color-inverse-000); } .wui-color-fg-100 { color: var(--wui-color-fg-100); } .wui-color-fg-200 { color: var(--wui-color-fg-200); } .wui-color-fg-300 { color: var(--wui-color-fg-300); } .wui-color-fg-325 { color: var(--wui-color-fg-325); } .wui-color-fg-350 { color: var(--wui-color-fg-350); } .wui-bg-color-inherit { background-color: var(--wui-color-inherit); } .wui-bg-color-blue-100 { background-color: var(--wui-color-accent-100); } .wui-bg-color-error-100 { background-color: var(--wui-color-error-100); } .wui-bg-color-error-125 { background-color: var(--wui-color-error-125); } .wui-bg-color-success-100 { background-color: var(--wui-color-success-100); } .wui-bg-color-success-125 { background-color: var(--wui-color-success-100); } .wui-bg-color-inverse-100 { background-color: var(--wui-color-inverse-100); } .wui-bg-color-inverse-000 { background-color: var(--wui-color-inverse-000); } .wui-bg-color-fg-100 { background-color: var(--wui-color-fg-100); } .wui-bg-color-fg-200 { background-color: var(--wui-color-fg-200); } .wui-bg-color-fg-300 { background-color: var(--wui-color-fg-300); } .wui-color-fg-325 { background-color: var(--wui-color-fg-325); } .wui-color-fg-350 { background-color: var(--wui-color-fg-350); } `;function b(e){return function(t){return"function"==typeof t?(customElements.get(e)||customElements.define(e,t),t):function(e,t){let{kind:i,elements:r}=t;return{kind:i,elements:r,finisher(t){customElements.get(e)||customElements.define(e,t)}}}(e,t)}}let v=(0,s.AH)` :host { display: block; border-radius: clamp(0px, var(--wui-border-radius-l), 44px); box-shadow: 0 0 0 1px var(--wui-color-gray-glass-005); background-color: var(--wui-color-modal-bg); overflow: hidden; } `,y=class extends s.WF{render(){return(0,s.qy)``}};y.styles=[g,v],y=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o}([b("wui-card")],y);var x=i(5419);let C=(0,s.AH)` :host { display: flex; aspect-ratio: 1 / 1; color: var(--local-color); width: var(--local-width); } svg { width: inherit; height: inherit; object-fit: contain; object-position: center; } `,A=(0,s.JW)` `,E=(0,s.JW)` `,_=(0,s.JW)` `,k=(0,s.JW)` `,I=(0,s.JW)` `,S=(0,s.JW)` `,T=(0,s.JW)` `,N=(0,s.JW)` `,P=(0,s.JW)` `,R=(0,s.JW)` `,O=(0,s.JW)` `,M=(0,s.JW)` `,D=(0,s.JW)` `,U=(0,s.JW)` `,$=(0,s.JW)` `,L=(0,s.JW)` `,j=(0,s.JW)` `,B=(0,s.JW)` `,W=(0,s.JW)` `,q=(0,s.JW)` `,H=(0,s.JW)` `,z=(0,s.JW)` `,F=(0,s.JW)` `,Z=(0,s.JW)` `,V=(0,s.JW)` `,K=(0,s.JW)` `,G=(0,s.JW)` `,J=(0,s.JW)` `,Y=(0,s.JW)` `,Q=(0,s.JW)` `,X=(0,s.JW)` `,ee=(0,s.JW)` `,et=(0,s.JW)` `,ei=(0,s.JW)` `,er=(0,s.JW)` `,en=(0,s.JW)` `,ea=(0,s.JW)` `,eo=(0,s.JW)` `,es=(0,s.JW)` `,ec=(0,s.JW)` `,el=(0,s.JW)` `,eu=(0,s.JW)` `,ed=(0,s.JW)` `,eh=(0,s.JW)` `,ep=(0,s.JW)` `,ef=(0,s.JW)` `,eg=(0,s.JW)` `,ew=(0,s.JW)` `,em=(0,s.JW)` `,eb=(0,s.JW)` `,ev=(0,s.JW)` `,ey=(0,s.JW)` `,ex=(0,s.JW)` `,eC=(0,s.JW)` `,eA=(0,s.JW)` `,eE=(0,s.JW)` `,e_=(0,s.JW)` `,ek=(0,s.JW)` `,eI=(0,s.JW)` `,eS=(0,s.JW)` `,eT=(0,s.JW)` `,eN=(0,s.JW)` `,eP=(0,s.JW)` `,eR=(0,s.JW)` `,eO=(0,s.JW)` `,eM=(0,s.JW)` `,eD=(0,s.JW)` `,eU=(0,s.JW)` `,e$=(0,s.JW)` `,eL=(0,s.JW)` `,ej=(0,s.JW)` `,eB=(0,s.JW)` `,eW=(0,s.JW)` `,eq=(0,s.JW)` `,eH=(0,s.JW)` `;var ez=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o};let eF={add:A,allWallets:E,arrowBottomCircle:_,appStore:k,apple:I,arrowBottom:S,arrowLeft:T,arrowRight:N,arrowTop:P,bank:R,browser:O,card:M,checkmark:U,checkmarkBold:D,chevronBottom:$,chevronLeft:L,chevronRight:j,chevronTop:B,chromeStore:W,clock:q,close:H,compass:F,coinPlaceholder:z,copy:Z,cursor:V,cursorTransparent:K,desktop:G,disconnect:J,discord:Y,etherscan:Q,extension:X,externalLink:ee,facebook:et,farcaster:ei,filters:er,github:en,google:ea,helpCircle:eo,image:es,id:eB,infoCircle:ec,lightbulb:ej,mail:el,mobile:eu,more:ed,networkPlaceholder:eh,nftPlaceholder:ep,off:ef,playStore:eg,plus:ew,qrCode:em,recycleHorizontal:eb,refresh:ev,search:ey,send:ex,swapHorizontal:eC,swapHorizontalMedium:eE,swapHorizontalBold:eA,swapHorizontalRoundedBold:e_,swapVertical:ek,telegram:eI,threeDots:eS,twitch:eT,twitter:eW,twitterIcon:eN,verify:eP,verifyFilled:eR,wallet:eM,walletConnect:eD,walletConnectLightBrown:eU,walletConnectBrown:e$,walletPlaceholder:eO,warningCircle:eL,x:eW,info:eq,exclamationTriangle:eH},eZ=class extends s.WF{constructor(){super(...arguments),this.size="md",this.name="copy",this.color="fg-300"}render(){return this.style.cssText=` --local-color: var(--wui-color-${this.color}); --local-width: var(--wui-icon-size-${this.size}); `,(0,s.qy)`${eF[this.name]}`}};eZ.styles=[g,m,C],ez([(0,x.MZ)()],eZ.prototype,"size",void 0),ez([(0,x.MZ)()],eZ.prototype,"name",void 0),ez([(0,x.MZ)()],eZ.prototype,"color",void 0),eZ=ez([b("wui-icon")],eZ);let eV=(0,s.AH)` :host { display: block; width: var(--local-width); height: var(--local-height); } img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center center; border-radius: inherit; } `;var eK=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o};let eG=class extends s.WF{constructor(){super(...arguments),this.src="./path/to/image.jpg",this.alt="Image",this.size=void 0}render(){return this.style.cssText=` --local-width: ${this.size?`var(--wui-icon-size-${this.size});`:"100%"}; --local-height: ${this.size?`var(--wui-icon-size-${this.size});`:"100%"}; `,(0,s.qy)`${this.alt}`}handleImageError(){this.dispatchEvent(new CustomEvent("onLoadError",{bubbles:!0,composed:!0}))}};eG.styles=[g,m,eV],eK([(0,x.MZ)()],eG.prototype,"src",void 0),eK([(0,x.MZ)()],eG.prototype,"alt",void 0),eK([(0,x.MZ)()],eG.prototype,"size",void 0),eG=eK([b("wui-image")],eG);let eJ=(0,s.AH)` :host { display: block; width: var(--wui-box-size-lg); height: var(--wui-box-size-lg); } svg { width: var(--wui-box-size-lg); height: var(--wui-box-size-lg); fill: none; stroke: transparent; stroke-linecap: round; } use { stroke: var(--wui-color-accent-100); stroke-width: 2px; stroke-dasharray: 54, 118; stroke-dashoffset: 172; animation: dash 1s linear infinite; } @keyframes dash { to { stroke-dashoffset: 0px; } } `,eY=class extends s.WF{render(){return(0,s.qy)` `}};eY.styles=[g,eJ],eY=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o}([b("wui-loading-hexagon")],eY);let eQ=(0,s.AH)` :host { display: flex; } :host([data-size='sm']) > svg { width: 12px; height: 12px; } :host([data-size='md']) > svg { width: 16px; height: 16px; } :host([data-size='lg']) > svg { width: 24px; height: 24px; } :host([data-size='xl']) > svg { width: 32px; height: 32px; } svg { animation: rotate 2s linear infinite; } circle { fill: none; stroke: var(--local-color); stroke-width: 4px; stroke-dasharray: 1, 124; stroke-dashoffset: 0; stroke-linecap: round; animation: dash 1.5s ease-in-out infinite; } :host([data-size='md']) > svg > circle { stroke-width: 6px; } :host([data-size='sm']) > svg > circle { stroke-width: 8px; } @keyframes rotate { 100% { transform: rotate(360deg); } } @keyframes dash { 0% { stroke-dasharray: 1, 124; stroke-dashoffset: 0; } 50% { stroke-dasharray: 90, 124; stroke-dashoffset: -35; } 100% { stroke-dashoffset: -125; } } `;var eX=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o};let e0=class extends s.WF{constructor(){super(...arguments),this.color="accent-100",this.size="lg"}render(){return this.style.cssText=`--local-color: ${"inherit"===this.color?"inherit":`var(--wui-color-${this.color})`}`,this.dataset.size=this.size,(0,s.qy)` `}};e0.styles=[g,eQ],eX([(0,x.MZ)()],e0.prototype,"color",void 0),eX([(0,x.MZ)()],e0.prototype,"size",void 0),e0=eX([b("wui-loading-spinner")],e0);let e1=(0,s.AH)` :host { display: block; width: var(--wui-box-size-md); height: var(--wui-box-size-md); } svg { width: var(--wui-box-size-md); height: var(--wui-box-size-md); } rect { fill: none; stroke: var(--wui-color-accent-100); stroke-width: 4px; stroke-linecap: round; animation: dash 1s linear infinite; } @keyframes dash { to { stroke-dashoffset: 0px; } } `;var e2=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o};let e3=class extends s.WF{constructor(){super(...arguments),this.radius=36}render(){return this.svgLoaderTemplate()}svgLoaderTemplate(){let e=this.radius>50?50:this.radius,t=36-e;return(0,s.qy)` `}};e3.styles=[g,e1],e2([(0,x.MZ)({type:Number})],e3.prototype,"radius",void 0),e3=e2([b("wui-loading-thumbnail")],e3);let e5=(0,s.AH)` :host { display: block; box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-005); background: linear-gradient( 120deg, var(--wui-color-bg-200) 5%, var(--wui-color-bg-200) 48%, var(--wui-color-bg-300) 55%, var(--wui-color-bg-300) 60%, var(--wui-color-bg-300) calc(60% + 10px), var(--wui-color-bg-200) calc(60% + 12px), var(--wui-color-bg-200) 100% ); background-size: 250%; animation: shimmer 3s linear infinite reverse; } :host([variant='light']) { background: linear-gradient( 120deg, var(--wui-color-bg-150) 5%, var(--wui-color-bg-150) 48%, var(--wui-color-bg-200) 55%, var(--wui-color-bg-200) 60%, var(--wui-color-bg-200) calc(60% + 10px), var(--wui-color-bg-150) calc(60% + 12px), var(--wui-color-bg-150) 100% ); background-size: 250%; } @keyframes shimmer { from { background-position: -250% 0; } to { background-position: 250% 0; } } `;var e4=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o};let e6=class extends s.WF{constructor(){super(...arguments),this.width="",this.height="",this.borderRadius="m",this.variant="default"}render(){return this.style.cssText=` width: ${this.width}; height: ${this.height}; border-radius: clamp(0px,var(--wui-border-radius-${this.borderRadius}), 40px); `,(0,s.qy)``}};e6.styles=[e5],e4([(0,x.MZ)()],e6.prototype,"width",void 0),e4([(0,x.MZ)()],e6.prototype,"height",void 0),e4([(0,x.MZ)()],e6.prototype,"borderRadius",void 0),e4([(0,x.MZ)()],e6.prototype,"variant",void 0),e6=e4([b("wui-shimmer")],e6);var e8=i(60037);let e9=(0,s.AH)` :host { display: inline-flex !important; } slot { width: 100%; display: inline-block; font-style: normal; font-family: var(--wui-font-family); font-feature-settings: 'tnum' on, 'lnum' on, 'case' on; line-height: 130%; font-weight: var(--wui-font-weight-regular); overflow: inherit; text-overflow: inherit; text-align: var(--local-align); color: var(--local-color); } .wui-line-clamp-1 { overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 1; } .wui-line-clamp-2 { overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; } .wui-font-medium-400 { font-size: var(--wui-font-size-medium); font-weight: var(--wui-font-weight-light); letter-spacing: var(--wui-letter-spacing-medium); } .wui-font-medium-600 { font-size: var(--wui-font-size-medium); letter-spacing: var(--wui-letter-spacing-medium); } .wui-font-title-600 { font-size: var(--wui-font-size-title); letter-spacing: var(--wui-letter-spacing-title); } .wui-font-title-6-600 { font-size: var(--wui-font-size-title-6); letter-spacing: var(--wui-letter-spacing-title-6); } .wui-font-mini-700 { font-size: var(--wui-font-size-mini); letter-spacing: var(--wui-letter-spacing-mini); text-transform: uppercase; } .wui-font-large-500, .wui-font-large-600, .wui-font-large-700 { font-size: var(--wui-font-size-large); letter-spacing: var(--wui-letter-spacing-large); } .wui-font-2xl-500, .wui-font-2xl-600, .wui-font-2xl-700 { font-size: var(--wui-font-size-2xl); letter-spacing: var(--wui-letter-spacing-2xl); } .wui-font-paragraph-400, .wui-font-paragraph-500, .wui-font-paragraph-600, .wui-font-paragraph-700 { font-size: var(--wui-font-size-paragraph); letter-spacing: var(--wui-letter-spacing-paragraph); } .wui-font-small-400, .wui-font-small-500, .wui-font-small-600 { font-size: var(--wui-font-size-small); letter-spacing: var(--wui-letter-spacing-small); } .wui-font-tiny-400, .wui-font-tiny-500, .wui-font-tiny-600 { font-size: var(--wui-font-size-tiny); letter-spacing: var(--wui-letter-spacing-tiny); } .wui-font-micro-700, .wui-font-micro-600 { font-size: var(--wui-font-size-micro); letter-spacing: var(--wui-letter-spacing-micro); text-transform: uppercase; } .wui-font-tiny-400, .wui-font-small-400, .wui-font-medium-400, .wui-font-paragraph-400 { font-weight: var(--wui-font-weight-light); } .wui-font-large-700, .wui-font-paragraph-700, .wui-font-micro-700, .wui-font-mini-700 { font-weight: var(--wui-font-weight-bold); } .wui-font-medium-600, .wui-font-medium-title-600, .wui-font-title-6-600, .wui-font-large-600, .wui-font-paragraph-600, .wui-font-small-600, .wui-font-tiny-600, .wui-font-micro-600 { font-weight: var(--wui-font-weight-medium); } :host([disabled]) { opacity: 0.4; } `;var e7=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o};let te=class extends s.WF{constructor(){super(...arguments),this.variant="paragraph-500",this.color="fg-300",this.align="left",this.lineClamp=void 0}render(){let e={[`wui-font-${this.variant}`]:!0,[`wui-color-${this.color}`]:!0,[`wui-line-clamp-${this.lineClamp}`]:!!this.lineClamp};return this.style.cssText=` --local-align: ${this.align}; --local-color: var(--wui-color-${this.color}); `,(0,s.qy)``}};te.styles=[g,e9],e7([(0,x.MZ)()],te.prototype,"variant",void 0),e7([(0,x.MZ)()],te.prototype,"color",void 0),e7([(0,x.MZ)()],te.prototype,"align",void 0),e7([(0,x.MZ)()],te.prototype,"lineClamp",void 0),te=e7([b("wui-text")],te);let tt=(0,s.JW)` `,ti=(0,s.JW)` `,tr=(0,s.JW)` `,tn=(0,s.JW)` `,ta=(0,s.JW)` `,to=(0,s.JW)` `,ts=(0,s.JW)` `,tc=(0,s.JW)` `,tl=(0,s.JW)` `,tu=(0,s.JW)` `,td=(0,s.JW)` `,th=(0,s.JW)` `,tp=(0,s.JW)` `,tf=(0,s.JW)` `,tg=(0,s.JW)` `,tw=(0,s.JW)` `,tm=(0,s.JW)` `,tb=(0,s.JW)` `,tv=(0,s.JW)` `,ty=(0,s.JW)` `,tx=(0,s.JW)` `,tC=(0,s.JW)` `,tA=(0,s.AH)` :host { display: block; width: var(--local-size); height: var(--local-size); } :host svg { width: 100%; height: 100%; } `,tE=(0,s.JW)` `;var t_=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o};let tk={browser:tt,dao:ti,defi:tr,defiAlt:tn,eth:ta,layers:to,lock:ts,login:tc,network:tl,nft:tu,noun:td,profile:th,system:tp,coinbase:tf,meld:tC,onrampCard:tb,moonpay:tg,stripe:tw,paypal:tm,google:tv,pencil:ty,lightbulb:tx,solana:tE},tI=class extends s.WF{constructor(){super(...arguments),this.name="browser",this.size="md"}render(){return this.style.cssText=` --local-size: var(--wui-visual-size-${this.size}); `,(0,s.qy)`${tk[this.name]}`}};tI.styles=[g,tA],t_([(0,x.MZ)()],tI.prototype,"name",void 0),t_([(0,x.MZ)()],tI.prototype,"size",void 0),tI=t_([b("wui-visual")],tI);var tS=i(92821);let tT={getSpacingStyles:(e,t)=>Array.isArray(e)?e[t]?`var(--wui-spacing-${e[t]})`:void 0:"string"==typeof e?`var(--wui-spacing-${e})`:void 0,getFormattedDate:e=>new Intl.DateTimeFormat("en-US",{month:"short",day:"numeric"}).format(e),getHostName(e){try{return new URL(e).hostname}catch(e){return""}},getTruncateString:({string:e,charsStart:t,charsEnd:i,truncate:r})=>e.length<=t+i?e:"end"===r?`${e.substring(0,t)}...`:"start"===r?`...${e.substring(e.length-i)}`:`${e.substring(0,Math.floor(t))}...${e.substring(e.length-Math.floor(i))}`,generateAvatarColors(e){let t=e.toLowerCase().replace(/^0x/iu,"").replace(/[^a-f0-9]/gu,"").substring(0,6).padEnd(6,"0"),i=this.hexToRgb(t),r=getComputedStyle(document.documentElement).getPropertyValue("--w3m-border-radius-master"),n=100-3*Number(r?.replace("px","")),a=`${n}% ${n}% at 65% 40%`,o=[];for(let e=0;e<5;e+=1){let t=this.tintColor(i,.15*e);o.push(`rgb(${t[0]}, ${t[1]}, ${t[2]})`)}return` --local-color-1: ${o[0]}; --local-color-2: ${o[1]}; --local-color-3: ${o[2]}; --local-color-4: ${o[3]}; --local-color-5: ${o[4]}; --local-radial-circle: ${a} `},hexToRgb(e){let t=parseInt(e,16);return[t>>16&255,t>>8&255,255&t]},tintColor(e,t){let[i,r,n]=e;return[Math.round(i+(255-i)*t),Math.round(r+(255-r)*t),Math.round(n+(255-n)*t)]},isNumber:e=>/^[0-9]+$/u.test(e),getColorTheme:e=>e||("undefined"!=typeof window&&window.matchMedia?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":"dark"),splitBalance(e){let t=e.split(".");return 2===t.length?[t[0],t[1]]:["0","00"]},roundNumber:(e,t,i)=>e.toString().length>=t?Number(e).toFixed(i):e,formatNumberToLocalString:(e,t=2)=>void 0===e?"0.00":"number"==typeof e?e.toLocaleString("en-US",{maximumFractionDigits:t,minimumFractionDigits:t}):parseFloat(e).toLocaleString("en-US",{maximumFractionDigits:t,minimumFractionDigits:t})},tN=(0,s.AH)` :host { display: flex; width: inherit; height: inherit; } `;var tP=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o};let tR=class extends s.WF{render(){return this.style.cssText=` flex-direction: ${this.flexDirection}; flex-wrap: ${this.flexWrap}; flex-basis: ${this.flexBasis}; flex-grow: ${this.flexGrow}; flex-shrink: ${this.flexShrink}; align-items: ${this.alignItems}; justify-content: ${this.justifyContent}; column-gap: ${this.columnGap&&`var(--wui-spacing-${this.columnGap})`}; row-gap: ${this.rowGap&&`var(--wui-spacing-${this.rowGap})`}; gap: ${this.gap&&`var(--wui-spacing-${this.gap})`}; padding-top: ${this.padding&&tT.getSpacingStyles(this.padding,0)}; padding-right: ${this.padding&&tT.getSpacingStyles(this.padding,1)}; padding-bottom: ${this.padding&&tT.getSpacingStyles(this.padding,2)}; padding-left: ${this.padding&&tT.getSpacingStyles(this.padding,3)}; margin-top: ${this.margin&&tT.getSpacingStyles(this.margin,0)}; margin-right: ${this.margin&&tT.getSpacingStyles(this.margin,1)}; margin-bottom: ${this.margin&&tT.getSpacingStyles(this.margin,2)}; margin-left: ${this.margin&&tT.getSpacingStyles(this.margin,3)}; `,(0,s.qy)``}};tR.styles=[g,tN],tP([(0,x.MZ)()],tR.prototype,"flexDirection",void 0),tP([(0,x.MZ)()],tR.prototype,"flexWrap",void 0),tP([(0,x.MZ)()],tR.prototype,"flexBasis",void 0),tP([(0,x.MZ)()],tR.prototype,"flexGrow",void 0),tP([(0,x.MZ)()],tR.prototype,"flexShrink",void 0),tP([(0,x.MZ)()],tR.prototype,"alignItems",void 0),tP([(0,x.MZ)()],tR.prototype,"justifyContent",void 0),tP([(0,x.MZ)()],tR.prototype,"columnGap",void 0),tP([(0,x.MZ)()],tR.prototype,"rowGap",void 0),tP([(0,x.MZ)()],tR.prototype,"gap",void 0),tP([(0,x.MZ)()],tR.prototype,"padding",void 0),tP([(0,x.MZ)()],tR.prototype,"margin",void 0),tR=tP([b("wui-flex")],tR);let tO=(0,s.AH)` :host { display: block; width: var(--local-width); height: var(--local-height); border-radius: var(--wui-border-radius-3xl); box-shadow: 0 0 0 8px var(--wui-color-gray-glass-005); overflow: hidden; position: relative; } :host([data-variant='generated']) { --mixed-local-color-1: var(--local-color-1); --mixed-local-color-2: var(--local-color-2); --mixed-local-color-3: var(--local-color-3); --mixed-local-color-4: var(--local-color-4); --mixed-local-color-5: var(--local-color-5); } @supports (background: color-mix(in srgb, white 50%, black)) { :host([data-variant='generated']) { --mixed-local-color-1: color-mix( in srgb, var(--w3m-color-mix) var(--w3m-color-mix-strength), var(--local-color-1) ); --mixed-local-color-2: color-mix( in srgb, var(--w3m-color-mix) var(--w3m-color-mix-strength), var(--local-color-2) ); --mixed-local-color-3: color-mix( in srgb, var(--w3m-color-mix) var(--w3m-color-mix-strength), var(--local-color-3) ); --mixed-local-color-4: color-mix( in srgb, var(--w3m-color-mix) var(--w3m-color-mix-strength), var(--local-color-4) ); --mixed-local-color-5: color-mix( in srgb, var(--w3m-color-mix) var(--w3m-color-mix-strength), var(--local-color-5) ); } } :host([data-variant='generated']) { box-shadow: 0 0 0 8px var(--wui-color-gray-glass-005); background: radial-gradient( var(--local-radial-circle), #fff 0.52%, var(--mixed-local-color-5) 31.25%, var(--mixed-local-color-3) 51.56%, var(--mixed-local-color-2) 65.63%, var(--mixed-local-color-1) 82.29%, var(--mixed-local-color-4) 100% ); } :host([data-variant='default']) { box-shadow: 0 0 0 8px var(--wui-color-gray-glass-005); background: radial-gradient( 75.29% 75.29% at 64.96% 24.36%, #fff 0.52%, #f5ccfc 31.25%, #dba4f5 51.56%, #9a8ee8 65.63%, #6493da 82.29%, #6ebdea 100% ); } `;var tM=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o};let tD=class extends s.WF{constructor(){super(...arguments),this.imageSrc=void 0,this.alt=void 0,this.address=void 0,this.size="xl"}render(){return this.style.cssText=` --local-width: var(--wui-icon-box-size-${this.size}); --local-height: var(--wui-icon-box-size-${this.size}); `,(0,s.qy)`${this.visualTemplate()}`}visualTemplate(){if(this.imageSrc)return this.dataset.variant="image",(0,s.qy)``;if(this.address){this.dataset.variant="generated";let e=tT.generateAvatarColors(this.address);return this.style.cssText+=` ${e}`,null}return this.dataset.variant="default",null}};tD.styles=[g,tO],tM([(0,x.MZ)()],tD.prototype,"imageSrc",void 0),tM([(0,x.MZ)()],tD.prototype,"alt",void 0),tM([(0,x.MZ)()],tD.prototype,"address",void 0),tM([(0,x.MZ)()],tD.prototype,"size",void 0),tD=tM([b("wui-avatar")],tD);let tU=(0,s.AH)` :host { display: inline-flex; justify-content: center; align-items: center; position: relative; overflow: hidden; background-color: var(--wui-color-gray-glass-020); border-radius: var(--local-border-radius); border: var(--local-border); box-sizing: content-box; width: var(--local-size); height: var(--local-size); min-height: var(--local-size); min-width: var(--local-size); } @supports (background: color-mix(in srgb, white 50%, black)) { :host { background-color: color-mix(in srgb, var(--local-bg-value) var(--local-bg-mix), transparent); } } `;var t$=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o};let tL=class extends s.WF{constructor(){super(...arguments),this.size="md",this.backgroundColor="accent-100",this.iconColor="accent-100",this.background="transparent",this.border=!1,this.borderColor="wui-color-bg-125",this.icon="copy"}render(){let e=this.iconSize||this.size,t="lg"===this.size,i="xl"===this.size,r="gray"===this.background,n="opaque"===this.background,a="accent-100"===this.backgroundColor&&n||"success-100"===this.backgroundColor&&n||"error-100"===this.backgroundColor&&n||"inverse-100"===this.backgroundColor&&n,o=`var(--wui-color-${this.backgroundColor})`;return a?o=`var(--wui-icon-box-bg-${this.backgroundColor})`:r&&(o=`var(--wui-color-gray-${this.backgroundColor})`),this.style.cssText=` --local-bg-value: ${o}; --local-bg-mix: ${a||r?"100%":t?"12%":"16%"}; --local-border-radius: var(--wui-border-radius-${t?"xxs":i?"s":"3xl"}); --local-size: var(--wui-icon-box-size-${this.size}); --local-border: ${"wui-color-bg-125"===this.borderColor?"2px":"1px"} solid ${this.border?`var(--${this.borderColor})`:"transparent"} `,(0,s.qy)` `}};tL.styles=[g,w,tU],t$([(0,x.MZ)()],tL.prototype,"size",void 0),t$([(0,x.MZ)()],tL.prototype,"backgroundColor",void 0),t$([(0,x.MZ)()],tL.prototype,"iconColor",void 0),t$([(0,x.MZ)()],tL.prototype,"iconSize",void 0),t$([(0,x.MZ)()],tL.prototype,"background",void 0),t$([(0,x.MZ)({type:Boolean})],tL.prototype,"border",void 0),t$([(0,x.MZ)()],tL.prototype,"borderColor",void 0),t$([(0,x.MZ)()],tL.prototype,"icon",void 0),tL=t$([b("wui-icon-box")],tL);let tj=(0,s.AH)` :host { display: block; } button { border-radius: var(--wui-border-radius-3xl); background: var(--wui-color-gray-glass-002); display: flex; gap: var(--wui-spacing-xs); padding: var(--wui-spacing-3xs) var(--wui-spacing-xs) var(--wui-spacing-3xs) var(--wui-spacing-xs); border: 1px solid var(--wui-color-gray-glass-005); } button:disabled { background: var(--wui-color-gray-glass-015); } button:disabled > wui-text { color: var(--wui-color-gray-glass-015); } button:disabled > wui-flex > wui-text { color: var(--wui-color-gray-glass-015); } button:disabled > wui-image, button:disabled > wui-flex > wui-avatar { filter: grayscale(1); } button:has(wui-image) { padding: var(--wui-spacing-3xs) var(--wui-spacing-3xs) var(--wui-spacing-3xs) var(--wui-spacing-xs); } wui-text { color: var(--wui-color-fg-100); } wui-flex > wui-text { color: var(--wui-color-fg-200); } wui-image, wui-icon-box { border-radius: var(--wui-border-radius-3xl); width: 24px; height: 24px; box-shadow: 0 0 0 2px var(--wui-color-gray-glass-005); } wui-flex { border-radius: var(--wui-border-radius-3xl); border: 1px solid var(--wui-color-gray-glass-005); background: var(--wui-color-gray-glass-005); padding: 4px var(--wui-spacing-m) 4px var(--wui-spacing-xxs); } button.local-no-balance { border-radius: 0px; border: none; background: transparent; } wui-avatar { width: 20px; height: 20px; box-shadow: 0 0 0 2px var(--wui-color-accent-glass-010); } @media (max-width: 500px) { button { gap: 0px; padding: var(--wui-spacing-3xs) var(--wui-spacing-xs) !important; height: 32px; } wui-image, wui-icon-box, button > wui-text { visibility: hidden; width: 0px; height: 0px; } button { border-radius: 0px; border: none; background: transparent; padding: 0px; } } @media (hover: hover) and (pointer: fine) { button:hover:enabled > wui-flex > wui-text { color: var(--wui-color-fg-175); } button:active:enabled > wui-flex > wui-text { color: var(--wui-color-fg-175); } } `;var tB=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o};let tW=class extends s.WF{constructor(){super(...arguments),this.networkSrc=void 0,this.avatarSrc=void 0,this.balance=void 0,this.isUnsupportedChain=void 0,this.disabled=!1,this.address="",this.profileName="",this.charsStart=4,this.charsEnd=6}render(){return(0,s.qy)` `}balanceTemplate(){if(this.isUnsupportedChain)return(0,s.qy)` Switch Network`;if(this.balance){let e=this.networkSrc?(0,s.qy)``:(0,s.qy)` `;return(0,s.qy)` ${e} ${this.balance} `}return null}};tW.styles=[g,w,tj],tB([(0,x.MZ)()],tW.prototype,"networkSrc",void 0),tB([(0,x.MZ)()],tW.prototype,"avatarSrc",void 0),tB([(0,x.MZ)()],tW.prototype,"balance",void 0),tB([(0,x.MZ)({type:Boolean})],tW.prototype,"isUnsupportedChain",void 0),tB([(0,x.MZ)({type:Boolean})],tW.prototype,"disabled",void 0),tB([(0,x.MZ)()],tW.prototype,"address",void 0),tB([(0,x.MZ)()],tW.prototype,"profileName",void 0),tB([(0,x.MZ)()],tW.prototype,"charsStart",void 0),tB([(0,x.MZ)()],tW.prototype,"charsEnd",void 0),tW=tB([b("wui-account-button")],tW);let tq=(0,s.AH)` :host { position: relative; background-color: var(--wui-color-gray-glass-002); display: flex; justify-content: center; align-items: center; width: var(--local-size); height: var(--local-size); border-radius: inherit; border-radius: var(--local-border-radius); } :host > wui-flex { overflow: hidden; border-radius: inherit; border-radius: var(--local-border-radius); } :host::after { content: ''; position: absolute; top: 0; bottom: 0; left: 0; right: 0; border-radius: inherit; border: 1px solid var(--wui-color-gray-glass-010); pointer-events: none; } :host([name='Extension'])::after { border: 1px solid var(--wui-color-accent-glass-010); } :host([data-wallet-icon='allWallets']) { background-color: var(--wui-all-wallets-bg-100); } :host([data-wallet-icon='allWallets'])::after { border: 1px solid var(--wui-color-accent-glass-010); } wui-icon[data-parent-size='inherit'] { width: 75%; height: 75%; align-items: center; } wui-icon[data-parent-size='sm'] { width: 18px; height: 18px; } wui-icon[data-parent-size='md'] { width: 24px; height: 24px; } wui-icon[data-parent-size='lg'] { width: 42px; height: 42px; } wui-icon[data-parent-size='full'] { width: 100%; height: 100%; } :host > wui-icon-box { position: absolute; overflow: hidden; right: -1px; bottom: -2px; z-index: 1; border: 2px solid var(--wui-color-bg-150, #1e1f1f); padding: 1px; } `;var tH=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o};let tz=class extends s.WF{constructor(){super(...arguments),this.size="md",this.name="",this.installed=!1,this.badgeSize="xs"}render(){let e="xxs";return e="lg"===this.size?"m":"md"===this.size?"xs":"xxs",this.style.cssText=` --local-border-radius: var(--wui-border-radius-${e}); --local-size: var(--wui-wallet-image-size-${this.size}); `,this.walletIcon&&(this.dataset.walletIcon=this.walletIcon),(0,s.qy)` ${this.templateVisual()} `}templateVisual(){return this.imageSrc?(0,s.qy)``:this.walletIcon?(0,s.qy)``:(0,s.qy)``}};tz.styles=[g,tq],tH([(0,x.MZ)()],tz.prototype,"size",void 0),tH([(0,x.MZ)()],tz.prototype,"name",void 0),tH([(0,x.MZ)()],tz.prototype,"imageSrc",void 0),tH([(0,x.MZ)()],tz.prototype,"walletIcon",void 0),tH([(0,x.MZ)({type:Boolean})],tz.prototype,"installed",void 0),tH([(0,x.MZ)()],tz.prototype,"badgeSize",void 0),tz=tH([b("wui-wallet-image")],tz);let tF=(0,s.AH)` :host { position: relative; border-radius: var(--wui-border-radius-xxs); width: 40px; height: 40px; overflow: hidden; background: var(--wui-color-gray-glass-002); display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: var(--wui-spacing-4xs); padding: 3.75px !important; } :host::after { content: ''; position: absolute; top: 0; bottom: 0; left: 0; right: 0; border-radius: inherit; border: 1px solid var(--wui-color-gray-glass-010); pointer-events: none; } :host > wui-wallet-image { width: 14px; height: 14px; border-radius: var(--wui-border-radius-5xs); } :host > wui-flex { padding: 2px; position: fixed; overflow: hidden; left: 34px; bottom: 8px; background: var(--dark-background-150, #1e1f1f); border-radius: 50%; z-index: 2; display: flex; } `;var tZ=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o};let tV=class extends s.WF{constructor(){super(...arguments),this.walletImages=[]}render(){let e=this.walletImages.length<4;return(0,s.qy)`${this.walletImages.slice(0,4).map(({src:e,walletName:t})=>(0,s.qy)` `)} ${e?[...Array(4-this.walletImages.length)].map(()=>(0,s.qy)` `):null} `}};tV.styles=[g,tF],tZ([(0,x.MZ)({type:Array})],tV.prototype,"walletImages",void 0),tV=tZ([b("wui-all-wallets-image")],tV);let tK=(0,s.AH)` :host { width: var(--local-width); position: relative; } button { border: none; border-radius: var(--local-border-radius); width: var(--local-width); white-space: nowrap; } /* -- Sizes --------------------------------------------------- */ button[data-size='md'] { padding: 8.2px var(--wui-spacing-l) 9px var(--wui-spacing-l); height: 36px; } button[data-size='md'][data-icon-left='true'][data-icon-right='false'] { padding: 8.2px var(--wui-spacing-l) 9px var(--wui-spacing-s); } button[data-size='md'][data-icon-right='true'][data-icon-left='false'] { padding: 8.2px var(--wui-spacing-s) 9px var(--wui-spacing-l); } button[data-size='lg'] { padding: var(--wui-spacing-m) var(--wui-spacing-2l); height: 48px; } /* -- Variants --------------------------------------------------------- */ button[data-variant='main'] { background-color: var(--wui-color-accent-100); color: var(--wui-color-inverse-100); border: none; box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-010); } button[data-variant='inverse'] { background-color: var(--wui-color-inverse-100); color: var(--wui-color-inverse-000); border: none; box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-010); } button[data-variant='accent'] { background-color: var(--wui-color-accent-glass-010); color: var(--wui-color-accent-100); border: none; box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-005); } button[data-variant='accent-error'] { background: var(--wui-color-error-glass-015); color: var(--wui-color-error-100); border: none; box-shadow: inset 0 0 0 1px var(--wui-color-error-glass-010); } button[data-variant='accent-success'] { background: var(--wui-color-success-glass-015); color: var(--wui-color-success-100); border: none; box-shadow: inset 0 0 0 1px var(--wui-color-success-glass-010); } button[data-variant='neutral'] { background: transparent; color: var(--wui-color-fg-100); border: none; box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-005); } /* -- Focus states --------------------------------------------------- */ button[data-variant='main']:focus-visible:enabled { background-color: var(--wui-color-accent-090); box-shadow: inset 0 0 0 1px var(--wui-color-accent-100), 0 0 0 4px var(--wui-color-accent-glass-020); } button[data-variant='inverse']:focus-visible:enabled { background-color: var(--wui-color-inverse-100); box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-010), 0 0 0 4px var(--wui-color-accent-glass-020); } button[data-variant='accent']:focus-visible:enabled { background-color: var(--wui-color-accent-glass-010); box-shadow: inset 0 0 0 1px var(--wui-color-accent-100), 0 0 0 4px var(--wui-color-accent-glass-020); } button[data-variant='accent-error']:focus-visible:enabled { background: var(--wui-color-error-glass-015); box-shadow: inset 0 0 0 1px var(--wui-color-error-100), 0 0 0 4px var(--wui-color-error-glass-020); } button[data-variant='accent-success']:focus-visible:enabled { background: var(--wui-color-success-glass-015); box-shadow: inset 0 0 0 1px var(--wui-color-success-100), 0 0 0 4px var(--wui-color-success-glass-020); } button[data-variant='neutral']:focus-visible:enabled { background: var(--wui-color-gray-glass-005); box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-010), 0 0 0 4px var(--wui-color-gray-glass-002); } /* -- Hover & Active states ----------------------------------------------------------- */ @media (hover: hover) and (pointer: fine) { button[data-variant='main']:hover:enabled { background-color: var(--wui-color-accent-090); } button[data-variant='main']:active:enabled { background-color: var(--wui-color-accent-080); } button[data-variant='accent']:hover:enabled { background-color: var(--wui-color-accent-glass-015); } button[data-variant='accent']:active:enabled { background-color: var(--wui-color-accent-glass-020); } button[data-variant='accent-error']:hover:enabled { background: var(--wui-color-error-glass-020); color: var(--wui-color-error-100); } button[data-variant='accent-error']:active:enabled { background: var(--wui-color-error-glass-030); color: var(--wui-color-error-100); } button[data-variant='accent-success']:hover:enabled { background: var(--wui-color-success-glass-020); color: var(--wui-color-success-100); } button[data-variant='accent-success']:active:enabled { background: var(--wui-color-success-glass-030); color: var(--wui-color-success-100); } button[data-variant='neutral']:hover:enabled { background: var(--wui-color-gray-glass-002); } button[data-variant='neutral']:active:enabled { background: var(--wui-color-gray-glass-005); } button[data-size='lg'][data-icon-left='true'][data-icon-right='false'] { padding-left: var(--wui-spacing-m); } button[data-size='lg'][data-icon-right='true'][data-icon-left='false'] { padding-right: var(--wui-spacing-m); } } /* -- Disabled state --------------------------------------------------- */ button:disabled { background-color: var(--wui-color-gray-glass-002); box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-002); color: var(--wui-color-gray-glass-020); cursor: not-allowed; } button > wui-text { transition: opacity var(--wui-ease-out-power-1) var(--wui-duration-md); will-change: opacity; opacity: var(--local-opacity-100); } ::slotted(*) { transition: opacity var(--wui-ease-out-power-1) var(--wui-duration-md); will-change: opacity; opacity: var(--local-opacity-100); } wui-loading-spinner { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); opacity: var(--local-opacity-000); } `;var tG=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o};let tJ={main:"inverse-100",inverse:"inverse-000",accent:"accent-100","accent-error":"error-100","accent-success":"success-100",neutral:"fg-100",disabled:"gray-glass-020"},tY={lg:"paragraph-600",md:"small-600"},tQ={lg:"md",md:"md"},tX=class extends s.WF{constructor(){super(...arguments),this.size="lg",this.disabled=!1,this.fullWidth=!1,this.loading=!1,this.variant="main",this.hasIconLeft=!1,this.hasIconRight=!1,this.borderRadius="m"}render(){this.style.cssText=` --local-width: ${this.fullWidth?"100%":"auto"}; --local-opacity-100: ${this.loading?0:1}; --local-opacity-000: ${this.loading?1:0}; --local-border-radius: var(--wui-border-radius-${this.borderRadius}); `;let e=this.textVariant??tY[this.size];return(0,s.qy)` `}handleSlotLeftChange(){this.hasIconLeft=!0}handleSlotRightChange(){this.hasIconRight=!0}loadingTemplate(){if(this.loading){let e=tQ[this.size],t=this.disabled?tJ.disabled:tJ[this.variant];return(0,s.qy)``}return(0,s.qy)``}};tX.styles=[g,w,tK],tG([(0,x.MZ)()],tX.prototype,"size",void 0),tG([(0,x.MZ)({type:Boolean})],tX.prototype,"disabled",void 0),tG([(0,x.MZ)({type:Boolean})],tX.prototype,"fullWidth",void 0),tG([(0,x.MZ)({type:Boolean})],tX.prototype,"loading",void 0),tG([(0,x.MZ)()],tX.prototype,"variant",void 0),tG([(0,x.MZ)({type:Boolean})],tX.prototype,"hasIconLeft",void 0),tG([(0,x.MZ)({type:Boolean})],tX.prototype,"hasIconRight",void 0),tG([(0,x.MZ)()],tX.prototype,"borderRadius",void 0),tG([(0,x.MZ)()],tX.prototype,"textVariant",void 0),tX=tG([b("wui-button")],tX);let t0=(0,s.JW)` `,t1=(0,s.AH)` :host { display: flex; flex-direction: column; align-items: center; width: 104px; row-gap: var(--wui-spacing-xs); padding: var(--wui-spacing-xs) 10px; background-color: var(--wui-color-gray-glass-002); border-radius: clamp(0px, var(--wui-border-radius-xs), 20px); position: relative; } wui-shimmer[data-type='network'] { border: none; -webkit-clip-path: var(--wui-path-network); clip-path: var(--wui-path-network); } svg { position: absolute; width: 48px; height: 54px; z-index: 1; } svg > path { stroke: var(--wui-color-gray-glass-010); stroke-width: 1px; } @media (max-width: 350px) { :host { width: 100%; } } `;var t2=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o};let t3=class extends s.WF{constructor(){super(...arguments),this.type="wallet"}render(){return(0,s.qy)` ${this.shimmerTemplate()} `}shimmerTemplate(){return"network"===this.type?(0,s.qy)` ${t0}`:(0,s.qy)``}};t3.styles=[g,w,t1],t2([(0,x.MZ)()],t3.prototype,"type",void 0),t3=t2([b("wui-card-select-loader")],t3);let t5=(0,s.JW)` `,t4=(0,s.JW)` `,t6=(0,s.AH)` :host { position: relative; border-radius: inherit; display: flex; justify-content: center; align-items: center; width: var(--local-width); height: var(--local-height); } :host([data-round='true']) { background: var(--wui-color-gray-glass-002); border-radius: 100%; outline: 1px solid var(--wui-color-gray-glass-005); } svg { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 1; fill: var(--wui-color-gray-glass-002); } svg > path { stroke: var(--local-stroke); } wui-image { width: 100%; height: 100%; -webkit-clip-path: var(--local-path); clip-path: var(--local-path); background: var(--wui-color-gray-glass-002); } wui-icon { transform: translateY(-5%); width: var(--local-icon-size); height: var(--local-icon-size); } `;var t8=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o};let t9=class extends s.WF{constructor(){super(...arguments),this.size="md",this.name="uknown",this.networkImagesBySize={sm:t5,md:t0,lg:t4},this.selected=!1,this.round=!1}render(){return this.round?(this.dataset.round="true",this.style.cssText=` --local-width: var(--wui-spacing-3xl); --local-height: var(--wui-spacing-3xl); --local-icon-size: var(--wui-spacing-l); `):this.style.cssText=` --local-path: var(--wui-path-network-${this.size}); --local-width: var(--wui-width-network-${this.size}); --local-height: var(--wui-height-network-${this.size}); --local-icon-size: var(--wui-icon-size-network-${this.size}); `,(0,s.qy)`${this.templateVisual()} ${this.svgTemplate()} `}svgTemplate(){return this.round?null:this.networkImagesBySize[this.size]}templateVisual(){return this.imageSrc?(0,s.qy)``:(0,s.qy)``}};t9.styles=[g,t6],t8([(0,x.MZ)()],t9.prototype,"size",void 0),t8([(0,x.MZ)()],t9.prototype,"name",void 0),t8([(0,x.MZ)({type:Object})],t9.prototype,"networkImagesBySize",void 0),t8([(0,x.MZ)()],t9.prototype,"imageSrc",void 0),t8([(0,x.MZ)({type:Boolean})],t9.prototype,"selected",void 0),t8([(0,x.MZ)({type:Boolean})],t9.prototype,"round",void 0),t9=t8([b("wui-network-image")],t9);let t7=(0,s.AH)` button { flex-direction: column; width: 76px; row-gap: var(--wui-spacing-xs); padding: var(--wui-spacing-xs) var(--wui-spacing-0); background-color: var(--wui-color-gray-glass-002); border-radius: clamp(0px, var(--wui-border-radius-xs), 20px); } button > wui-text { color: var(--wui-color-fg-100); max-width: var(--wui-icon-box-size-xl); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; justify-content: center; } button:disabled > wui-text { color: var(--wui-color-gray-glass-015); } [data-selected='true'] { background-color: var(--wui-color-accent-glass-020); } @media (hover: hover) and (pointer: fine) { [data-selected='true']:hover:enabled { background-color: var(--wui-color-accent-glass-015); } } [data-selected='true']:active:enabled { background-color: var(--wui-color-accent-glass-010); } `;var ie=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o};let it=class extends s.WF{constructor(){super(...arguments),this.name="Unknown",this.type="wallet",this.imageSrc=void 0,this.disabled=!1,this.selected=!1,this.installed=!1}render(){return(0,s.qy)` `}imageTemplate(){return"network"===this.type?(0,s.qy)` `:(0,s.qy)` `}};it.styles=[g,w,t7],ie([(0,x.MZ)()],it.prototype,"name",void 0),ie([(0,x.MZ)()],it.prototype,"type",void 0),ie([(0,x.MZ)()],it.prototype,"imageSrc",void 0),ie([(0,x.MZ)({type:Boolean})],it.prototype,"disabled",void 0),ie([(0,x.MZ)({type:Boolean})],it.prototype,"selected",void 0),ie([(0,x.MZ)({type:Boolean})],it.prototype,"installed",void 0),it=ie([b("wui-card-select")],it);let ii=(0,s.AH)` a { border: 1px solid var(--wui-color-gray-glass-010); border-radius: var(--wui-border-radius-3xl); } wui-image { border-radius: var(--wui-border-radius-3xl); overflow: hidden; } a.disabled > wui-icon:not(.image-icon), a.disabled > wui-image { filter: grayscale(1); } a[data-variant='fill'] { color: var(--wui-color-inverse-100); background-color: var(--wui-color-accent-100); } a[data-variant='shade'], a[data-variant='shadeSmall'] { background-color: transparent; background-color: var(--wui-color-gray-glass-010); color: var(--wui-color-fg-200); } a[data-variant='success'] { column-gap: var(--wui-spacing-xxs); border: 1px solid var(--wui-color-success-glass-010); background-color: var(--wui-color-success-glass-010); color: var(--wui-color-success-100); } a[data-variant='error'] { column-gap: var(--wui-spacing-xxs); border: 1px solid var(--wui-color-error-glass-010); background-color: var(--wui-color-error-glass-010); color: var(--wui-color-error-100); } a[data-variant='transparent'] { column-gap: var(--wui-spacing-xxs); background-color: transparent; color: var(--wui-color-fg-150); } a[data-variant='transparent'], a[data-variant='success'], a[data-variant='shadeSmall'], a[data-variant='error'] { padding: 7px var(--wui-spacing-s) 7px 10px; } a[data-variant='transparent']:has(wui-text:first-child), a[data-variant='success']:has(wui-text:first-child), a[data-variant='shadeSmall']:has(wui-text:first-child), a[data-variant='error']:has(wui-text:first-child) { padding: 7px var(--wui-spacing-s); } a[data-variant='fill'], a[data-variant='shade'] { column-gap: var(--wui-spacing-xs); padding: var(--wui-spacing-xxs) var(--wui-spacing-m) var(--wui-spacing-xxs) var(--wui-spacing-xs); } a[data-variant='fill']:has(wui-text:first-child), a[data-variant='shade']:has(wui-text:first-child) { padding: 9px var(--wui-spacing-m) 9px var(--wui-spacing-m); } a[data-variant='fill'] > wui-image, a[data-variant='shade'] > wui-image { width: 24px; height: 24px; } a[data-variant='fill'] > wui-image { box-shadow: inset 0 0 0 1px var(--wui-color-accent-090); } a[data-variant='shade'] > wui-image, a[data-variant='shadeSmall'] > wui-image { box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-010); } a[data-variant='fill'] > wui-icon:not(.image-icon), a[data-variant='shade'] > wui-icon:not(.image-icon) { width: 14px; height: 14px; } a[data-variant='transparent'] > wui-image, a[data-variant='success'] > wui-image, a[data-variant='shadeSmall'] > wui-image, a[data-variant='error'] > wui-image { width: 14px; height: 14px; } a[data-variant='transparent'] > wui-icon:not(.image-icon), a[data-variant='success'] > wui-icon:not(.image-icon), a[data-variant='shadeSmall'] > wui-icon:not(.image-icon), a[data-variant='error'] > wui-icon:not(.image-icon) { width: 12px; height: 12px; } a[data-variant='fill']:focus-visible { background-color: var(--wui-color-accent-090); } a[data-variant='shade']:focus-visible, a[data-variant='shadeSmall']:focus-visible { background-color: var(--wui-color-gray-glass-015); } a[data-variant='transparent']:focus-visible { background-color: var(--wui-color-gray-glass-005); } a[data-variant='success']:focus-visible { background-color: var(--wui-color-success-glass-015); } a[data-variant='error']:focus-visible { background-color: var(--wui-color-error-glass-015); } a.disabled { color: var(--wui-color-gray-glass-015); background-color: var(--wui-color-gray-glass-015); pointer-events: none; } @media (hover: hover) and (pointer: fine) { a[data-variant='fill']:hover { background-color: var(--wui-color-accent-090); } a[data-variant='shade']:hover, a[data-variant='shadeSmall']:hover { background-color: var(--wui-color-gray-glass-015); } a[data-variant='transparent']:hover { background-color: var(--wui-color-gray-glass-005); } a[data-variant='success']:hover { background-color: var(--wui-color-success-glass-015); } a[data-variant='error']:hover { background-color: var(--wui-color-error-glass-015); } } a[data-variant='fill']:active { background-color: var(--wui-color-accent-080); } a[data-variant='shade']:active, a[data-variant='shadeSmall']:active { background-color: var(--wui-color-gray-glass-020); } a[data-variant='transparent']:active { background-color: var(--wui-color-gray-glass-010); } a[data-variant='success']:active { background-color: var(--wui-color-success-glass-020); } a[data-variant='error']:active { background-color: var(--wui-color-error-glass-020); } `;var ir=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o};let ia=class extends s.WF{constructor(){super(...arguments),this.variant="fill",this.imageSrc=void 0,this.imageIcon=void 0,this.imageIconSize="md",this.disabled=!1,this.icon="externalLink",this.href="",this.text=void 0}render(){let e="success"===this.variant||"transparent"===this.variant||"shadeSmall"===this.variant;return(0,s.qy)` ${this.imageTemplate()} ${this.title?this.title:tT.getHostName(this.href)} `}imageTemplate(){return this.imageSrc?(0,s.qy)``:this.imageIcon?(0,s.qy)``:null}};ia.styles=[g,w,ii],ir([(0,x.MZ)()],ia.prototype,"variant",void 0),ir([(0,x.MZ)()],ia.prototype,"imageSrc",void 0),ir([(0,x.MZ)()],ia.prototype,"imageIcon",void 0),ir([(0,x.MZ)()],ia.prototype,"imageIconSize",void 0),ir([(0,x.MZ)({type:Boolean})],ia.prototype,"disabled",void 0),ir([(0,x.MZ)()],ia.prototype,"icon",void 0),ir([(0,x.MZ)()],ia.prototype,"href",void 0),ir([(0,x.MZ)()],ia.prototype,"text",void 0),ia=ir([b("wui-chip")],ia);let io=(0,s.AH)` :host { position: relative; display: block; } button { background: var(--wui-color-accent-100); border: 1px solid var(--wui-color-gray-glass-010); border-radius: var(--wui-border-radius-m); gap: var(--wui-spacing-xs); } button.loading { background: var(--wui-color-gray-glass-010); border: 1px solid var(--wui-color-gray-glass-010); pointer-events: none; } button:disabled { background-color: var(--wui-color-gray-glass-015); border: 1px solid var(--wui-color-gray-glass-010); } button:disabled > wui-text { color: var(--wui-color-gray-glass-015); } @media (hover: hover) and (pointer: fine) { button:hover:enabled { background-color: var(--wui-color-accent-090); } button:active:enabled { background-color: var(--wui-color-accent-080); } } button:focus-visible { border: 1px solid var(--wui-color-gray-glass-010); background-color: var(--wui-color-accent-090); -webkit-box-shadow: 0px 0px 0px 4px var(--wui-box-shadow-blue); -moz-box-shadow: 0px 0px 0px 4px var(--wui-box-shadow-blue); box-shadow: 0px 0px 0px 4px var(--wui-box-shadow-blue); } button[data-size='sm'] { padding: 6.75px 10px 7.25px; } ::slotted(*) { transition: opacity var(--wui-ease-out-power-1) var(--wui-duration-md); will-change: opacity; opacity: var(--local-opacity-100); } button > wui-text { transition: opacity var(--wui-ease-out-power-1) var(--wui-duration-md); will-change: opacity; opacity: var(--local-opacity-100); color: var(--wui-color-inverse-100); } button[data-size='md'] { padding: 9px var(--wui-spacing-l) 9px var(--wui-spacing-l); } button[data-size='md'] + wui-text { padding-left: var(--wui-spacing-3xs); } @media (max-width: 500px) { button[data-size='md'] { height: 32px; padding: 5px 12px; } button[data-size='md'] > wui-text > slot { font-size: 14px !important; } } wui-loading-spinner { width: 14px; height: 14px; } wui-loading-spinner::slotted(svg) { width: 10px !important; height: 10px !important; } button[data-size='sm'] > wui-loading-spinner { width: 12px; height: 12px; } `;var is=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o};let ic=class extends s.WF{constructor(){super(...arguments),this.size="md",this.loading=!1}render(){let e="md"===this.size?"paragraph-600":"small-600";return(0,s.qy)` `}loadingTemplate(){return this.loading?(0,s.qy)``:null}};ic.styles=[g,w,io],is([(0,x.MZ)()],ic.prototype,"size",void 0),is([(0,x.MZ)({type:Boolean})],ic.prototype,"loading",void 0),ic=is([b("wui-connect-button")],ic);let il=(0,s.AH)` wui-flex { width: 100%; background-color: var(--wui-color-gray-glass-002); border-radius: var(--wui-border-radius-xs); } `;var iu=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o};let id=class extends s.WF{constructor(){super(...arguments),this.disabled=!1,this.label="",this.buttonLabel=""}render(){return(0,s.qy)` ${this.label} `}};id.styles=[g,w,il],iu([(0,x.MZ)({type:Boolean})],id.prototype,"disabled",void 0),iu([(0,x.MZ)()],id.prototype,"label",void 0),iu([(0,x.MZ)()],id.prototype,"buttonLabel",void 0),id=iu([b("wui-cta-button")],id);let ih=(0,s.AH)` :host { display: block; padding: var(--wui-spacing-l) var(--wui-spacing-m); background-color: var(--wui-color-gray-glass-002); border-radius: var(--wui-border-radius-xs); width: 100%; } `,ip=class extends s.WF{render(){return(0,s.qy)` `}};ip.styles=[g,w,ih],ip=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o}([b("wui-details-group")],ip);let ig=(0,s.AH)` :host { display: flex; flex-direction: row; gap: var(--wui-spacing-l); width: 100%; border-radius: var(--wui-border-radius-xs); } `;var iw=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o};let im=class extends s.WF{constructor(){super(...arguments),this.name=""}render(){return(0,s.qy)` ${this.name} `}};im.styles=[g,w,ig],iw([(0,x.MZ)()],im.prototype,"name",void 0),im=iw([b("wui-details-group-item")],im);let ib=(0,s.AH)` :host { z-index: calc(var(--w3m-z-index) + 1); width: 200px; padding: var(--wui-spacing-3xs); align-items: center; display: inherit; border-radius: var(--wui-border-radius-xs); border: 1px solid var(--wui-color-gray-glass-002); background: var(--wui-color-fg-base-125); /* Dark/Elevation/L */ box-shadow: 0px 8px 22px -6px rgba(0, 0, 0, 0.12), 0px 14px 64px -4px rgba(0, 0, 0, 0.12); } `;var iv=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o};let iy=class extends s.WF{constructor(){super(...arguments),this.actions=[],this.isOpen=!1}render(){return this.isOpen?(0,s.qy)` ${this.actions.map(e=>(0,s.qy)` ${e.label} `)} `:null}};iy.styles=[g,w,ib],iv([(0,x.MZ)({type:Array})],iy.prototype,"actions",void 0),iv([(0,x.MZ)({type:Boolean})],iy.prototype,"isOpen",void 0),iy=iv([b("wui-dropdown-menu")],iy);var ix=i(87580);let iC=(0,s.AH)` :host { position: relative; width: 100%; display: inline-block; color: var(--wui-color-fg-275); } input { width: 100%; border-radius: var(--wui-border-radius-xs); box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-002); background: var(--wui-color-gray-glass-002); font-size: var(--wui-font-size-paragraph); letter-spacing: var(--wui-letter-spacing-paragraph); color: var(--wui-color-fg-100); transition: background-color var(--wui-ease-inout-power-1) var(--wui-duration-md), border-color var(--wui-ease-inout-power-1) var(--wui-duration-md), box-shadow var(--wui-ease-inout-power-1) var(--wui-duration-md); will-change: background-color, border-color, box-shadow; caret-color: var(--wui-color-accent-100); } input:disabled { cursor: not-allowed; border: 1px solid var(--wui-color-gray-glass-010); } input:disabled::placeholder, input:disabled + wui-icon { color: var(--wui-color-fg-300); } input::placeholder { color: var(--wui-color-fg-275); } input:focus:enabled { background-color: var(--wui-color-gray-glass-005); -webkit-box-shadow: inset 0 0 0 1px var(--wui-color-accent-100), 0px 0px 0px 4px var(--wui-box-shadow-blue); -moz-box-shadow: inset 0 0 0 1px var(--wui-color-accent-100), 0px 0px 0px 4px var(--wui-box-shadow-blue); box-shadow: inset 0 0 0 1px var(--wui-color-accent-100), 0px 0px 0px 4px var(--wui-box-shadow-blue); } input:hover:enabled { background-color: var(--wui-color-gray-glass-005); } wui-icon { position: absolute; top: 50%; transform: translateY(-50%); pointer-events: none; } .wui-size-sm { padding: 9px var(--wui-spacing-m) 10px var(--wui-spacing-s); } wui-icon + .wui-size-sm { padding: 9px var(--wui-spacing-m) 10px 36px; } wui-icon[data-input='sm'] { left: var(--wui-spacing-s); } .wui-size-md { padding: 15px var(--wui-spacing-m) var(--wui-spacing-l) var(--wui-spacing-m); } wui-icon + .wui-size-md, wui-loading-spinner + .wui-size-md { padding: 10.5px var(--wui-spacing-3xl) 10.5px var(--wui-spacing-3xl); } wui-icon[data-input='md'] { left: var(--wui-spacing-l); } .wui-size-lg { padding: var(--wui-spacing-s) var(--wui-spacing-s) var(--wui-spacing-s) var(--wui-spacing-l); letter-spacing: var(--wui-letter-spacing-medium-title); font-size: var(--wui-font-size-medium-title); font-weight: var(--wui-font-weight-light); line-height: 130%; color: var(--wui-color-fg-100); height: 64px; } .wui-padding-right-xs { padding-right: var(--wui-spacing-xs); } .wui-padding-right-s { padding-right: var(--wui-spacing-s); } .wui-padding-right-m { padding-right: var(--wui-spacing-m); } .wui-padding-right-l { padding-right: var(--wui-spacing-l); } .wui-padding-right-xl { padding-right: var(--wui-spacing-xl); } .wui-padding-right-2xl { padding-right: var(--wui-spacing-2xl); } .wui-padding-right-3xl { padding-right: var(--wui-spacing-3xl); } .wui-padding-right-4xl { padding-right: var(--wui-spacing-4xl); } .wui-padding-right-5xl { padding-right: var(--wui-spacing-5xl); } wui-icon + .wui-size-lg, wui-loading-spinner + .wui-size-lg { padding-left: 50px; } wui-icon[data-input='lg'] { left: var(--wui-spacing-l); } .wui-size-mdl { padding: 17.25px var(--wui-spacing-m) 17.25px var(--wui-spacing-m); } wui-icon + .wui-size-mdl, wui-loading-spinner + .wui-size-mdl { padding: 17.25px var(--wui-spacing-3xl) 17.25px 40px; } wui-icon[data-input='mdl'] { left: var(--wui-spacing-m); } input:placeholder-shown ~ ::slotted(wui-input-element), input:placeholder-shown ~ ::slotted(wui-icon) { opacity: 0; pointer-events: none; } input::-webkit-outer-spin-button, input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; } input[type='number'] { -moz-appearance: textfield; } ::slotted(wui-input-element), ::slotted(wui-icon) { position: absolute; top: 50%; transform: translateY(-50%); } ::slotted(wui-input-element) { right: var(--wui-spacing-m); } ::slotted(wui-icon) { right: 0px; } `;var iA=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o};let iE=class extends s.WF{constructor(){super(...arguments),this.inputElementRef=(0,ix._)(),this.size="md",this.disabled=!1,this.placeholder="",this.type="text",this.value=""}render(){let e=`wui-padding-right-${this.inputRightPadding}`,t={[`wui-size-${this.size}`]:!0,[e]:!!this.inputRightPadding};return(0,s.qy)`${this.templateIcon()} `}templateIcon(){return this.icon?(0,s.qy)``:null}dispatchInputChangeEvent(){this.dispatchEvent(new CustomEvent("inputChange",{detail:this.inputElementRef.value?.value,bubbles:!0,composed:!0}))}};iE.styles=[g,w,iC],iA([(0,x.MZ)()],iE.prototype,"size",void 0),iA([(0,x.MZ)()],iE.prototype,"icon",void 0),iA([(0,x.MZ)({type:Boolean})],iE.prototype,"disabled",void 0),iA([(0,x.MZ)()],iE.prototype,"placeholder",void 0),iA([(0,x.MZ)()],iE.prototype,"type",void 0),iA([(0,x.MZ)()],iE.prototype,"keyHint",void 0),iA([(0,x.MZ)()],iE.prototype,"value",void 0),iA([(0,x.MZ)()],iE.prototype,"inputRightPadding",void 0),iA([(0,x.MZ)()],iE.prototype,"tabIdx",void 0),iE=iA([b("wui-input-text")],iE);let i_=(0,s.AH)` :host { position: relative; display: inline-block; } wui-text { margin: var(--wui-spacing-xxs) var(--wui-spacing-m) var(--wui-spacing-0) var(--wui-spacing-m); } `;var ik=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o};let iI=class extends s.WF{constructor(){super(...arguments),this.disabled=!1}render(){return(0,s.qy)` ${this.templateError()} `}templateError(){return this.errorMessage?(0,s.qy)`${this.errorMessage}`:null}};iI.styles=[g,i_],ik([(0,x.MZ)()],iI.prototype,"errorMessage",void 0),ik([(0,x.MZ)({type:Boolean})],iI.prototype,"disabled",void 0),ik([(0,x.MZ)()],iI.prototype,"value",void 0),ik([(0,x.MZ)()],iI.prototype,"tabIdx",void 0),iI=ik([b("wui-email-input")],iI);let iS=(0,s.AH)` :host { position: relative; width: 100%; display: inline-block; color: var(--wui-color-fg-275); } .error { margin: var(--wui-spacing-xxs) var(--wui-spacing-m) var(--wui-spacing-0) var(--wui-spacing-m); } .base-name { position: absolute; right: 45px; top: 15px; text-align: right; } `;var iT=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o};let iN=class extends s.WF{constructor(){super(...arguments),this.disabled=!1,this.loading=!1}render(){return(0,s.qy)` ${this.baseNameTemplate()} ${this.errorTemplate()}${this.loadingTemplate()} `}baseNameTemplate(){return(0,s.qy)` ${u.oU.WC_NAME_SUFFIX} `}loadingTemplate(){return this.loading?(0,s.qy)``:null}errorTemplate(){return this.errorMessage?(0,s.qy)`${this.errorMessage}`:null}};iN.styles=[g,iS],iT([(0,x.MZ)()],iN.prototype,"errorMessage",void 0),iT([(0,x.MZ)({type:Boolean})],iN.prototype,"disabled",void 0),iT([(0,x.MZ)()],iN.prototype,"value",void 0),iT([(0,x.MZ)({type:Boolean})],iN.prototype,"loading",void 0),iN=iT([b("wui-ens-input")],iN);let iP=(0,s.AH)` button { border-radius: var(--local-border-radius); color: var(--wui-color-fg-100); padding: var(--local-padding); } @media (max-width: 700px) { button { padding: var(--wui-spacing-s); } } button > wui-icon { pointer-events: none; } button:disabled > wui-icon { color: var(--wui-color-bg-300) !important; } button:disabled { background-color: transparent; } `;var iR=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o};let iO=class extends s.WF{constructor(){super(...arguments),this.size="md",this.disabled=!1,this.icon="copy",this.iconColor="inherit"}render(){let e="lg"===this.size?"--wui-border-radius-xs":"--wui-border-radius-xxs",t="lg"===this.size?"--wui-spacing-1xs":"--wui-spacing-2xs";return this.style.cssText=` --local-border-radius: var(${e}); --local-padding: var(${t}); `,(0,s.qy)` `}};iO.styles=[g,w,m,iP],iR([(0,x.MZ)()],iO.prototype,"size",void 0),iR([(0,x.MZ)({type:Boolean})],iO.prototype,"disabled",void 0),iR([(0,x.MZ)()],iO.prototype,"icon",void 0),iR([(0,x.MZ)()],iO.prototype,"iconColor",void 0),iO=iR([b("wui-icon-link")],iO);let iM=(0,s.AH)` button { background-color: var(--wui-color-fg-300); border-radius: var(--wui-border-radius-4xs); width: 16px; height: 16px; } button:disabled { background-color: var(--wui-color-bg-300); } wui-icon { color: var(--wui-color-bg-200) !important; } button:focus-visible { background-color: var(--wui-color-fg-250); border: 1px solid var(--wui-color-accent-100); } @media (hover: hover) and (pointer: fine) { button:hover:enabled { background-color: var(--wui-color-fg-250); } button:active:enabled { background-color: var(--wui-color-fg-225); } } `;var iD=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o};let iU=class extends s.WF{constructor(){super(...arguments),this.icon="copy"}render(){return(0,s.qy)` `}};iU.styles=[g,w,iM],iD([(0,x.MZ)()],iU.prototype,"icon",void 0),iU=iD([b("wui-input-element")],iU);let i$=(0,s.AH)` :host { position: relative; display: inline-block; } input { width: 50px; height: 50px; background: var(--wui-color-gray-glass-010); border-radius: var(--wui-border-radius-xs); border: 1px solid var(--wui-color-gray-glass-005); font-family: var(--wui-font-family); font-size: var(--wui-font-size-large); font-weight: var(--wui-font-weight-regular); letter-spacing: var(--wui-letter-spacing-large); text-align: center; color: var(--wui-color-fg-100); caret-color: var(--wui-color-accent-100); transition: background-color var(--wui-ease-inout-power-1) var(--wui-duration-md), border-color var(--wui-ease-inout-power-1) var(--wui-duration-md), box-shadow var(--wui-ease-inout-power-1) var(--wui-duration-md); will-change: background-color, border-color, box-shadow; box-sizing: border-box; -webkit-appearance: none; -moz-appearance: textfield; padding: 0px; } input::-webkit-outer-spin-button, input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; } input[type='number'] { -moz-appearance: textfield; } input:disabled { cursor: not-allowed; border: 1px solid var(--wui-color-gray-glass-010); background: var(--wui-color-gray-glass-005); } input:focus:enabled { background-color: var(--wui-color-gray-glass-015); border: 1px solid var(--wui-color-accent-100); -webkit-box-shadow: 0px 0px 0px 4px var(--wui-box-shadow-blue); -moz-box-shadow: 0px 0px 0px 4px var(--wui-box-shadow-blue); box-shadow: 0px 0px 0px 4px var(--wui-box-shadow-blue); } @media (hover: hover) and (pointer: fine) { input:hover:enabled { background-color: var(--wui-color-gray-glass-015); } } `;var iL=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o};let ij=class extends s.WF{constructor(){super(...arguments),this.disabled=!1,this.value=""}render(){return(0,s.qy)` `}};ij.styles=[g,w,i$],iL([(0,x.MZ)({type:Boolean})],ij.prototype,"disabled",void 0),iL([(0,x.MZ)({type:String})],ij.prototype,"value",void 0),ij=iL([b("wui-input-numeric")],ij);let iB=(0,s.AH)` button { padding: var(--wui-spacing-4xs) var(--wui-spacing-xxs); border-radius: var(--wui-border-radius-3xs); background-color: transparent; color: var(--wui-color-accent-100); } button:disabled { background-color: transparent; color: var(--wui-color-gray-glass-015); } button:hover { background-color: var(--wui-color-gray-glass-005); } `;var iW=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o};let iq=class extends s.WF{constructor(){super(...arguments),this.tabIdx=void 0,this.disabled=!1,this.color="inherit"}render(){return(0,s.qy)` `}};iq.styles=[g,w,iB],iW([(0,x.MZ)()],iq.prototype,"tabIdx",void 0),iW([(0,x.MZ)({type:Boolean})],iq.prototype,"disabled",void 0),iW([(0,x.MZ)()],iq.prototype,"color",void 0),iq=iW([b("wui-link")],iq);let iH=(0,s.AH)` button { column-gap: var(--wui-spacing-s); padding: 11px 18px 11px var(--wui-spacing-s); width: 100%; background-color: var(--wui-color-gray-glass-002); border-radius: var(--wui-border-radius-xs); color: var(--wui-color-fg-250); transition: color var(--wui-ease-out-power-1) var(--wui-duration-md), background-color var(--wui-ease-out-power-1) var(--wui-duration-md); will-change: color, background-color; } button[data-iconvariant='square'], button[data-iconvariant='square-blue'] { padding: 6px 18px 6px 9px; } button > wui-flex { flex: 1; } button > wui-image { width: 32px; height: 32px; box-shadow: 0 0 0 2px var(--wui-color-gray-glass-005); border-radius: var(--wui-border-radius-3xl); } button > wui-icon { width: 36px; height: 36px; transition: opacity var(--wui-ease-out-power-1) var(--wui-duration-md); will-change: opacity; } button > wui-icon-box[data-variant='blue'] { box-shadow: 0 0 0 2px var(--wui-color-accent-glass-005); } button > wui-icon-box[data-variant='overlay'] { box-shadow: 0 0 0 2px var(--wui-color-gray-glass-005); } button > wui-icon-box[data-variant='square-blue'] { border-radius: var(--wui-border-radius-3xs); position: relative; border: none; width: 36px; height: 36px; } button > wui-icon-box[data-variant='square-blue']::after { content: ''; position: absolute; top: 0; bottom: 0; left: 0; right: 0; border-radius: inherit; border: 1px solid var(--wui-color-accent-glass-010); pointer-events: none; } button > wui-icon:last-child { width: 14px; height: 14px; } button:disabled { color: var(--wui-color-gray-glass-020); } button[data-loading='true'] > wui-icon { opacity: 0; } wui-loading-spinner { position: absolute; right: 18px; top: 50%; transform: translateY(-50%); } `;var iz=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o};let iF=class extends s.WF{constructor(){super(...arguments),this.tabIdx=void 0,this.variant="icon",this.disabled=!1,this.imageSrc=void 0,this.alt=void 0,this.chevron=!1,this.loading=!1}render(){return(0,s.qy)` `}visualTemplate(){if("image"===this.variant&&this.imageSrc)return(0,s.qy)``;if("square"===this.iconVariant&&this.icon&&"icon"===this.variant)return(0,s.qy)``;if("icon"===this.variant&&this.icon&&this.iconVariant){let e=["blue","square-blue"].includes(this.iconVariant)?"accent-100":"fg-200",t="square-blue"===this.iconVariant?"mdl":"md",i=this.iconSize?this.iconSize:t;return(0,s.qy)` `}return null}loadingTemplate(){return this.loading?(0,s.qy)``:(0,s.qy)``}chevronTemplate(){return this.chevron?(0,s.qy)``:null}};iF.styles=[g,w,iH],iz([(0,x.MZ)()],iF.prototype,"icon",void 0),iz([(0,x.MZ)()],iF.prototype,"iconSize",void 0),iz([(0,x.MZ)()],iF.prototype,"tabIdx",void 0),iz([(0,x.MZ)()],iF.prototype,"variant",void 0),iz([(0,x.MZ)()],iF.prototype,"iconVariant",void 0),iz([(0,x.MZ)({type:Boolean})],iF.prototype,"disabled",void 0),iz([(0,x.MZ)()],iF.prototype,"imageSrc",void 0),iz([(0,x.MZ)()],iF.prototype,"alt",void 0),iz([(0,x.MZ)({type:Boolean})],iF.prototype,"chevron",void 0),iz([(0,x.MZ)({type:Boolean})],iF.prototype,"loading",void 0),iF=iz([b("wui-list-item")],iF),function(e){e.approve="approved",e.bought="bought",e.borrow="borrowed",e.burn="burnt",e.cancel="canceled",e.claim="claimed",e.deploy="deployed",e.deposit="deposited",e.execute="executed",e.mint="minted",e.receive="received",e.repay="repaid",e.send="sent",e.sell="sold",e.stake="staked",e.trade="swapped",e.unstake="unstaked",e.withdraw="withdrawn"}(o||(o={}));let iZ=(0,s.AH)` :host > wui-flex { display: flex; justify-content: center; align-items: center; position: relative; width: 40px; height: 40px; box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-005); background-color: var(--wui-color-gray-glass-005); } :host > wui-flex wui-image { display: block; } :host > wui-flex, :host > wui-flex wui-image, .swap-images-container, .swap-images-container.nft, wui-image.nft { border-top-left-radius: var(--local-left-border-radius); border-top-right-radius: var(--local-right-border-radius); border-bottom-left-radius: var(--local-left-border-radius); border-bottom-right-radius: var(--local-right-border-radius); } wui-icon { width: 20px; height: 20px; } wui-icon-box { position: absolute; right: 0; bottom: 0; transform: translate(20%, 20%); } .swap-images-container { position: relative; width: 40px; height: 40px; overflow: hidden; } .swap-images-container wui-image:first-child { position: absolute; width: 40px; height: 40px; top: 0; left: 0%; clip-path: inset(0px calc(50% + 2px) 0px 0%); } .swap-images-container wui-image:last-child { clip-path: inset(0px 0px 0px calc(50% + 2px)); } `;var iV=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o};let iK=class extends s.WF{constructor(){super(...arguments),this.images=[],this.secondImage={type:void 0,url:""}}render(){let[e,t]=this.images,i=e?.type==="NFT",r=t?.url?"NFT"===t.type:i;return this.style.cssText=` --local-left-border-radius: ${i?"var(--wui-border-radius-xxs)":"var(--wui-border-radius-s)"}; --local-right-border-radius: ${r?"var(--wui-border-radius-xxs)":"var(--wui-border-radius-s)"}; `,(0,s.qy)` ${this.templateVisual()} ${this.templateIcon()} `}templateVisual(){let[e,t]=this.images,i=e?.type;return 2===this.images.length&&(e?.url||t?.url)?(0,s.qy)`
${e?.url?(0,s.qy)``:null} ${t?.url?(0,s.qy)``:null}
`:e?.url?(0,s.qy)``:"NFT"===i?(0,s.qy)``:(0,s.qy)``}templateIcon(){let e,t="accent-100";return(e=this.getIcon(),this.status&&(t=this.getStatusColor()),e)?(0,s.qy)` `:null}getDirectionIcon(){switch(this.direction){case"in":return"arrowBottom";case"out":return"arrowTop";default:return}}getIcon(){return this.onlyDirectionIcon?this.getDirectionIcon():"trade"===this.type?"swapHorizontalBold":"approve"===this.type?"checkmark":"cancel"===this.type?"close":this.getDirectionIcon()}getStatusColor(){switch(this.status){case"confirmed":return"success-100";case"failed":return"error-100";case"pending":return"inverse-100";default:return"accent-100"}}};iK.styles=[iZ],iV([(0,x.MZ)()],iK.prototype,"type",void 0),iV([(0,x.MZ)()],iK.prototype,"status",void 0),iV([(0,x.MZ)()],iK.prototype,"direction",void 0),iV([(0,x.MZ)({type:Boolean})],iK.prototype,"onlyDirectionIcon",void 0),iV([(0,x.MZ)({type:Array})],iK.prototype,"images",void 0),iV([(0,x.MZ)({type:Object})],iK.prototype,"secondImage",void 0),iK=iV([b("wui-transaction-visual")],iK);let iG=(0,s.AH)` :host > wui-flex:first-child { align-items: center; column-gap: var(--wui-spacing-s); padding: 6.5px var(--wui-spacing-xs) 6.5px var(--wui-spacing-xs); width: 100%; } :host > wui-flex:first-child wui-text:nth-child(1) { text-transform: capitalize; } wui-transaction-visual { width: 40px; height: 40px; } wui-flex { flex: 1; } :host wui-flex wui-flex { overflow: hidden; } :host .description-container wui-text span { word-break: break-all; } :host .description-container wui-text { overflow: hidden; } :host .description-separator-icon { margin: 0px 6px; } :host wui-text > span { overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 1; } `;var iJ=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o};let iY=class extends s.WF{constructor(){super(...arguments),this.type="approve",this.onlyDirectionIcon=!1,this.images=[],this.price=[],this.amount=[],this.symbol=[]}render(){return(0,s.qy)` ${o[this.type]||this.type} ${this.templateDescription()} ${this.templateSecondDescription()} ${this.date} `}templateDescription(){let e=this.descriptions?.[0];return e?(0,s.qy)` ${e} `:null}templateSecondDescription(){let e=this.descriptions?.[1];return e?(0,s.qy)` ${e} `:null}};iY.styles=[g,iG],iJ([(0,x.MZ)()],iY.prototype,"type",void 0),iJ([(0,x.MZ)({type:Array})],iY.prototype,"descriptions",void 0),iJ([(0,x.MZ)()],iY.prototype,"date",void 0),iJ([(0,x.MZ)({type:Boolean})],iY.prototype,"onlyDirectionIcon",void 0),iJ([(0,x.MZ)()],iY.prototype,"status",void 0),iJ([(0,x.MZ)()],iY.prototype,"direction",void 0),iJ([(0,x.MZ)({type:Array})],iY.prototype,"images",void 0),iJ([(0,x.MZ)({type:Array})],iY.prototype,"price",void 0),iJ([(0,x.MZ)({type:Array})],iY.prototype,"amount",void 0),iJ([(0,x.MZ)({type:Array})],iY.prototype,"symbol",void 0),iY=iJ([b("wui-transaction-list-item")],iY);let iQ=(0,s.AH)` :host > wui-flex:first-child { column-gap: var(--wui-spacing-s); padding: 7px var(--wui-spacing-l) 7px var(--wui-spacing-xs); width: 100%; } wui-flex { display: flex; flex: 1; } `,iX=class extends s.WF{render(){return(0,s.qy)` `}};iX.styles=[g,iQ],iX=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o}([b("wui-transaction-list-item-loader")],iX);let i0=(0,s.AH)` :host { display: flex; justify-content: center; align-items: center; height: var(--wui-spacing-m); padding: 0 var(--wui-spacing-3xs) !important; border-radius: var(--wui-border-radius-5xs); } :host > wui-text { transform: translateY(5%); } :host([data-variant='main']) { background-color: var(--wui-color-accent-glass-015); color: var(--wui-color-accent-100); } :host([data-variant='shade']) { background-color: var(--wui-color-gray-glass-010); color: var(--wui-color-fg-200); } :host([data-variant='success']) { background-color: var(--wui-icon-box-bg-success-100); color: var(--wui-color-success-100); } :host([data-variant='error']) { background-color: var(--wui-icon-box-bg-error-100); color: var(--wui-color-error-100); } :host([data-size='lg']) { padding: 11px 5px !important; } :host([data-size='lg']) > wui-text { transform: translateY(2%); } `;var i1=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o};let i2=class extends s.WF{constructor(){super(...arguments),this.variant="main",this.size="lg"}render(){this.dataset.variant=this.variant,this.dataset.size=this.size;let e="md"===this.size?"mini-700":"micro-700";return(0,s.qy)` `}};i2.styles=[g,i0],i1([(0,x.MZ)()],i2.prototype,"variant",void 0),i1([(0,x.MZ)()],i2.prototype,"size",void 0),i2=i1([b("wui-tag")],i2);let i3=(0,s.AH)` button { column-gap: var(--wui-spacing-s); padding: 7px var(--wui-spacing-l) 7px var(--wui-spacing-xs); width: 100%; background-color: var(--wui-color-gray-glass-002); border-radius: var(--wui-border-radius-xs); color: var(--wui-color-fg-100); } button > wui-text:nth-child(2) { display: flex; flex: 1; } button:disabled { background-color: var(--wui-color-gray-glass-015); color: var(--wui-color-gray-glass-015); } button:disabled > wui-tag { background-color: var(--wui-color-gray-glass-010); color: var(--wui-color-fg-300); } wui-icon { color: var(--wui-color-fg-200) !important; } `;var i5=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o};let i4=class extends s.WF{constructor(){super(...arguments),this.walletImages=[],this.imageSrc="",this.name="",this.tabIdx=void 0,this.installed=!1,this.disabled=!1,this.showAllWallets=!1}render(){return(0,s.qy)` `}templateAllWallets(){return this.showAllWallets&&this.imageSrc?(0,s.qy)` `:this.showAllWallets&&this.walletIcon?(0,s.qy)` `:null}templateWalletImage(){return!this.showAllWallets&&this.imageSrc?(0,s.qy)``:this.showAllWallets||this.imageSrc?null:(0,s.qy)``}templateStatus(){return this.tagLabel&&this.tagVariant?(0,s.qy)`${this.tagLabel}`:this.icon?(0,s.qy)``:null}};i4.styles=[g,w,i3],i5([(0,x.MZ)({type:Array})],i4.prototype,"walletImages",void 0),i5([(0,x.MZ)()],i4.prototype,"imageSrc",void 0),i5([(0,x.MZ)()],i4.prototype,"name",void 0),i5([(0,x.MZ)()],i4.prototype,"tagLabel",void 0),i5([(0,x.MZ)()],i4.prototype,"tagVariant",void 0),i5([(0,x.MZ)()],i4.prototype,"icon",void 0),i5([(0,x.MZ)()],i4.prototype,"walletIcon",void 0),i5([(0,x.MZ)()],i4.prototype,"tabIdx",void 0),i5([(0,x.MZ)({type:Boolean})],i4.prototype,"installed",void 0),i5([(0,x.MZ)({type:Boolean})],i4.prototype,"disabled",void 0),i5([(0,x.MZ)({type:Boolean})],i4.prototype,"showAllWallets",void 0),i4=i5([b("wui-list-wallet")],i4);let i6=(0,s.AH)` :host { display: flex; justify-content: center; align-items: center; width: 40px; height: 40px; border-radius: var(--wui-border-radius-3xl); border: 1px solid var(--wui-color-gray-glass-005); overflow: hidden; } wui-icon { width: 100%; height: 100%; } `;var i8=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o};let i9=class extends s.WF{constructor(){super(...arguments),this.logo="google"}render(){return(0,s.qy)` `}};i9.styles=[g,i6],i8([(0,x.MZ)()],i9.prototype,"logo",void 0),i9=i8([b("wui-logo")],i9);let i7=(0,s.AH)` :host { display: block; width: 100%; } button { width: 100%; height: 56px; background: var(--wui-color-gray-glass-002); border-radius: var(--wui-border-radius-xs); } `;var re=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o};let rt=class extends s.WF{constructor(){super(...arguments),this.logo="google",this.disabled=!1,this.tabIdx=void 0}render(){return(0,s.qy)` `}};rt.styles=[g,w,i7],re([(0,x.MZ)()],rt.prototype,"logo",void 0),re([(0,x.MZ)({type:Boolean})],rt.prototype,"disabled",void 0),re([(0,x.MZ)()],rt.prototype,"tabIdx",void 0),rt=re([b("wui-logo-select")],rt);let ri=(0,s.AH)` :host { display: block; } button { border-radius: var(--wui-border-radius-3xl); display: flex; gap: var(--wui-spacing-xs); padding: var(--wui-spacing-2xs) var(--wui-spacing-s) var(--wui-spacing-2xs) var(--wui-spacing-xs); border: 1px solid var(--wui-color-gray-glass-010); background-color: var(--wui-color-gray-glass-005); color: var(--wui-color-fg-100); } button:disabled { border: 1px solid var(--wui-color-gray-glass-005); background-color: var(--wui-color-gray-glass-015); color: var(--wui-color-gray-glass-015); } @media (hover: hover) and (pointer: fine) { button:hover:enabled { background-color: var(--wui-color-gray-glass-010); } button:active:enabled { background-color: var(--wui-color-gray-glass-015); } } wui-image, wui-icon-box { border-radius: var(--wui-border-radius-3xl); width: 24px; height: 24px; box-shadow: 0 0 0 2px var(--wui-color-gray-glass-005); } `;var rr=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o};let rn=class extends s.WF{constructor(){super(...arguments),this.imageSrc=void 0,this.isUnsupportedChain=void 0,this.disabled=!1}render(){return(0,s.qy)` `}visualTemplate(){return this.isUnsupportedChain?(0,s.qy)` `:this.imageSrc?(0,s.qy)``:(0,s.qy)` `}};rn.styles=[g,w,ri],rr([(0,x.MZ)()],rn.prototype,"imageSrc",void 0),rr([(0,x.MZ)({type:Boolean})],rn.prototype,"isUnsupportedChain",void 0),rr([(0,x.MZ)({type:Boolean})],rn.prototype,"disabled",void 0),rn=rr([b("wui-network-button")],rn);let ra=(0,s.AH)` :host { position: relative; display: block; } `;var ro=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o};let rs=class extends s.WF{constructor(){super(...arguments),this.length=6,this.otp="",this.values=Array.from({length:this.length}).map(()=>""),this.numerics=[],this.shouldInputBeEnabled=e=>this.values.slice(0,e).every(e=>""!==e),this.handleKeyDown=(e,t)=>{let i=e.target,r=this.getInputElement(i);if(!r)return;["ArrowLeft","ArrowRight","Shift","Delete"].includes(e.key)&&e.preventDefault();let n=r.selectionStart;switch(e.key){case"ArrowLeft":n&&r.setSelectionRange(n+1,n+1),this.focusInputField("prev",t);break;case"ArrowRight":case"Shift":this.focusInputField("next",t);break;case"Delete":case"Backspace":""===r.value?this.focusInputField("prev",t):this.updateInput(r,t,"")}},this.focusInputField=(e,t)=>{if("next"===e){let e=t+1;if(!this.shouldInputBeEnabled(e))return;let i=this.numerics[e-1?e:t],r=i?this.getInputElement(i):void 0;r&&r.focus()}}}firstUpdated(){this.otp&&(this.values=this.otp.split(""));let e=this.shadowRoot?.querySelectorAll("wui-input-numeric");e&&(this.numerics=Array.from(e)),this.numerics[0]?.focus()}render(){return(0,s.qy)` ${Array.from({length:this.length}).map((e,t)=>(0,s.qy)` this.handleInput(e,t)} @click=${e=>this.selectInput(e)} @keydown=${e=>this.handleKeyDown(e,t)} .disabled=${!this.shouldInputBeEnabled(t)} .value=${this.values[t]||""} > `)} `}updateInput(e,t,i){let r=this.numerics[t],n=e||(r?this.getInputElement(r):void 0);n&&(n.value=i,this.values=this.values.map((e,r)=>r===t?i:e))}selectInput(e){let t=e.target;if(t){let e=this.getInputElement(t);e?.select()}}handleInput(e,t){let i=e.target,r=this.getInputElement(i);if(r){let i=r.value;"insertFromPaste"===e.inputType?this.handlePaste(r,i,t):tT.isNumber(i)&&e.data?(this.updateInput(r,t,e.data),this.focusInputField("next",t)):this.updateInput(r,t,"")}this.dispatchInputChangeEvent()}handlePaste(e,t,i){let r=t[0];if(r&&tT.isNumber(r)){this.updateInput(e,i,r);let n=t.substring(1);if(i+1(i%r==0?e.push([t]):e[e.length-1].push(t))&&e,[])}(e,0),o=t/a.length,c=[{x:0,y:0},{x:1,y:0},{x:0,y:1}];c.forEach(({x:e,y:t})=>{let i=(a.length-7)*o*e,l=(a.length-7)*o*t;for(let e=0;e `)}});let l=Math.floor((i+25)/o),u=a.length/2-l/2,d=a.length/2+l/2-1,h=[];a.forEach((e,t)=>{e.forEach((e,i)=>{!a[t][i]||t<7&&i<7||t>a.length-8&&i<7||t<7&&i>a.length-8||t>u&&tu&&i{p[e]?p[e]?.push(t):p[e]=[t]}),Object.entries(p).map(([e,t])=>{let i=t.filter(e=>t.every(t=>!rl(e,t,o)));return[Number(e),i]}).forEach(([e,t])=>{t.forEach(t=>{n.push((0,s.JW)``)})}),Object.entries(p).filter(([e,t])=>t.length>1).map(([e,t])=>{let i=t.filter(e=>t.some(t=>rl(e,t,o)));return[Number(e),i]}).map(([e,t])=>{t.sort((e,t)=>et.some(t=>rl(e,t,o)));t?t.push(e):i.push([e])}return[e,i.map(e=>[e[0],e[e.length-1]])]}).forEach(([e,t])=>{t.forEach(([t,i])=>{n.push((0,s.JW)` `)})}),n}},rd=(0,s.AH)` :host { position: relative; user-select: none; display: block; overflow: hidden; aspect-ratio: 1 / 1; width: var(--local-size); } :host([data-theme='dark']) { border-radius: clamp(0px, var(--wui-border-radius-l), 40px); background-color: var(--wui-color-inverse-100); padding: var(--wui-spacing-l); } :host([data-theme='light']) { box-shadow: 0 0 0 1px var(--wui-color-bg-125); background-color: var(--wui-color-bg-125); } :host([data-clear='true']) > wui-icon { display: none; } svg:first-child, wui-image, wui-icon { position: absolute; top: 50%; left: 50%; transform: translateY(-50%) translateX(-50%); } wui-image { width: 25%; height: 25%; border-radius: var(--wui-border-radius-xs); } wui-icon { width: 100%; height: 100%; color: #3396ff !important; transform: translateY(-50%) translateX(-50%) scale(0.25); } `;var rh=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o};let rp=class extends s.WF{constructor(){super(...arguments),this.uri="",this.size=0,this.theme="dark",this.imageSrc=void 0,this.alt=void 0,this.arenaClear=void 0,this.farcaster=void 0}render(){return this.dataset.theme=this.theme,this.dataset.clear=String(this.arenaClear),this.style.cssText=`--local-size: ${this.size}px`,(0,s.qy)`${this.templateVisual()} ${this.templateSvg()}`}templateSvg(){let e="light"===this.theme?this.size:this.size-32;return(0,s.JW)` ${ru.generate(this.uri,e,this.arenaClear?0:e/4)} `}templateVisual(){return this.imageSrc?(0,s.qy)``:this.farcaster?(0,s.qy)``:(0,s.qy)``}};rp.styles=[g,rd],rh([(0,x.MZ)()],rp.prototype,"uri",void 0),rh([(0,x.MZ)({type:Number})],rp.prototype,"size",void 0),rh([(0,x.MZ)()],rp.prototype,"theme",void 0),rh([(0,x.MZ)()],rp.prototype,"imageSrc",void 0),rh([(0,x.MZ)()],rp.prototype,"alt",void 0),rh([(0,x.MZ)({type:Boolean})],rp.prototype,"arenaClear",void 0),rh([(0,x.MZ)({type:Boolean})],rp.prototype,"farcaster",void 0),rp=rh([b("wui-qr-code")],rp);let rf=(0,s.AH)` :host { position: relative; display: inline-block; width: 100%; } `,rg=class extends s.WF{constructor(){super(...arguments),this.inputComponentRef=(0,ix._)()}render(){return(0,s.qy)` `}clearValue(){let e=this.inputComponentRef.value,t=e?.inputElementRef.value;t&&(t.value="",t.focus(),t.dispatchEvent(new Event("input")))}};rg.styles=[g,rf],rg=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o}([b("wui-search-bar")],rg);let rw=(0,s.AH)` :host { display: flex; column-gap: var(--wui-spacing-s); align-items: center; padding: var(--wui-spacing-xs) var(--wui-spacing-m) var(--wui-spacing-xs) var(--wui-spacing-xs); border-radius: var(--wui-border-radius-s); border: 1px solid var(--wui-color-gray-glass-005); box-sizing: border-box; background-color: var(--wui-color-bg-175); box-shadow: 0px 14px 64px -4px rgba(0, 0, 0, 0.15), 0px 8px 22px -6px rgba(0, 0, 0, 0.15); max-width: 300px; } :host wui-loading-spinner { margin-left: var(--wui-spacing-3xs); } `;var rm=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o};let rb=class extends s.WF{constructor(){super(...arguments),this.backgroundColor="accent-100",this.iconColor="accent-100",this.icon="checkmark",this.message="",this.loading=!1,this.iconType="default"}render(){return(0,s.qy)` ${this.templateIcon()} ${this.message} `}templateIcon(){return this.loading?(0,s.qy)``:"default"===this.iconType?(0,s.qy)``:(0,s.qy)``}};rb.styles=[g,rw],rm([(0,x.MZ)()],rb.prototype,"backgroundColor",void 0),rm([(0,x.MZ)()],rb.prototype,"iconColor",void 0),rm([(0,x.MZ)()],rb.prototype,"icon",void 0),rm([(0,x.MZ)()],rb.prototype,"message",void 0),rm([(0,x.MZ)()],rb.prototype,"loading",void 0),rm([(0,x.MZ)()],rb.prototype,"iconType",void 0),rb=rm([b("wui-snackbar")],rb);var rv=i(80196);let ry=(0,s.AH)` :host { display: flex; align-items: center; justify-content: center; padding: var(--wui-spacing-s); border-radius: var(--wui-border-radius-s); border: 1px solid var(--wui-color-dark-glass-100); box-sizing: border-box; background-color: var(--wui-color-bg-325); box-shadow: 0px 0px 16px 0px rgba(0, 0, 0, 0.25); } wui-flex { width: 100%; } wui-text { word-break: break-word; flex: 1; } .close { cursor: pointer; } .icon-box { height: 40px; width: 40px; border-radius: var(--wui-border-radius-3xs); background-color: var(--local-icon-bg-value); } `;var rx=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o};let rC=class extends s.WF{constructor(){super(...arguments),this.message="",this.backgroundColor="accent-100",this.iconColor="accent-100",this.icon="info"}render(){return this.style.cssText=` --local-icon-bg-value: var(--wui-color-${this.backgroundColor}); `,(0,s.qy)` ${this.message} `}onClose(){rv.hG.close()}};rC.styles=[g,ry],rx([(0,x.MZ)()],rC.prototype,"message",void 0),rx([(0,x.MZ)()],rC.prototype,"backgroundColor",void 0),rx([(0,x.MZ)()],rC.prototype,"iconColor",void 0),rx([(0,x.MZ)()],rC.prototype,"icon",void 0),rC=rx([b("wui-alertbar")],rC);let rA=(0,s.AH)` :host { display: inline-flex; background-color: var(--wui-color-gray-glass-002); border-radius: var(--wui-border-radius-3xl); padding: var(--wui-spacing-3xs); position: relative; height: 36px; min-height: 36px; overflow: hidden; } :host::before { content: ''; position: absolute; pointer-events: none; top: 4px; left: 4px; display: block; width: var(--local-tab-width); height: 28px; border-radius: var(--wui-border-radius-3xl); background-color: var(--wui-color-gray-glass-002); box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-002); transform: translateX(calc(var(--local-tab) * var(--local-tab-width))); transition: transform var(--wui-ease-out-power-1) var(--wui-duration-md); will-change: background-color, opacity; } :host([data-type='flex'])::before { left: 3px; transform: translateX(calc((var(--local-tab) * 34px) + (var(--local-tab) * 4px))); } :host([data-type='flex']) { display: flex; padding: 0px 0px 0px 12px; gap: 4px; } :host([data-type='flex']) > button > wui-text { position: absolute; left: 18px; opacity: 0; } button[data-active='true'] > wui-icon, button[data-active='true'] > wui-text { color: var(--wui-color-fg-100); } button[data-active='false'] > wui-icon, button[data-active='false'] > wui-text { color: var(--wui-color-fg-200); } button[data-active='true']:disabled, button[data-active='false']:disabled { background-color: transparent; opacity: 0.5; cursor: not-allowed; } button[data-active='true']:disabled > wui-text { color: var(--wui-color-fg-200); } button[data-active='false']:disabled > wui-text { color: var(--wui-color-fg-300); } button > wui-icon, button > wui-text { pointer-events: none; transition: color var(--wui-e ase-out-power-1) var(--wui-duration-md); will-change: color; } button { width: var(--local-tab-width); transition: background-color var(--wui-ease-out-power-1) var(--wui-duration-md); will-change: background-color; } :host([data-type='flex']) > button { width: 34px; position: relative; display: flex; justify-content: flex-start; } button:hover:enabled, button:active:enabled { background-color: transparent !important; } button:hover:enabled > wui-icon, button:active:enabled > wui-icon { transition: all var(--wui-ease-out-power-1) var(--wui-duration-lg); color: var(--wui-color-fg-125); } button:hover:enabled > wui-text, button:active:enabled > wui-text { transition: all var(--wui-ease-out-power-1) var(--wui-duration-lg); color: var(--wui-color-fg-125); } button { border-radius: var(--wui-border-radius-3xl); } `;var rE=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o};let r_=class extends s.WF{constructor(){super(...arguments),this.tabs=[],this.onTabChange=()=>null,this.buttons=[],this.disabled=!1,this.localTabWidth="100px",this.activeTab=0,this.isDense=!1}render(){return this.isDense=this.tabs.length>3,this.style.cssText=` --local-tab: ${this.activeTab}; --local-tab-width: ${this.localTabWidth}; `,this.dataset.type=this.isDense?"flex":"block",this.tabs.map((e,t)=>{let i=t===this.activeTab;return(0,s.qy)` `})}firstUpdated(){this.shadowRoot&&this.isDense&&(this.buttons=[...this.shadowRoot.querySelectorAll("button")],setTimeout(()=>{this.animateTabs(0,!0)},0))}iconTemplate(e){return e.icon?(0,s.qy)``:null}onTabClick(e){this.buttons&&this.animateTabs(e,!1),this.activeTab=e,this.onTabChange(e)}animateTabs(e,t){let i=this.buttons[this.activeTab],r=this.buttons[e],n=i?.querySelector("wui-text"),a=r?.querySelector("wui-text"),o=r?.getBoundingClientRect(),s=a?.getBoundingClientRect();i&&n&&!t&&e!==this.activeTab&&(n.animate([{opacity:0}],{duration:50,easing:"ease",fill:"forwards"}),i.animate([{width:"34px"}],{duration:500,easing:"ease",fill:"forwards"})),r&&o&&s&&a&&(e!==this.activeTab||t)&&(this.localTabWidth=`${Math.round(o.width+s.width)+6}px`,r.animate([{width:`${o.width+s.width}px`}],{duration:t?0:500,fill:"forwards",easing:"ease"}),a.animate([{opacity:1}],{duration:t?0:125,delay:t?0:200,fill:"forwards",easing:"ease"}))}};r_.styles=[g,w,rA],rE([(0,x.MZ)({type:Array})],r_.prototype,"tabs",void 0),rE([(0,x.MZ)()],r_.prototype,"onTabChange",void 0),rE([(0,x.MZ)({type:Array})],r_.prototype,"buttons",void 0),rE([(0,x.MZ)({type:Boolean})],r_.prototype,"disabled",void 0),rE([(0,x.MZ)()],r_.prototype,"localTabWidth",void 0),rE([(0,x.wk)()],r_.prototype,"activeTab",void 0),rE([(0,x.wk)()],r_.prototype,"isDense",void 0),r_=rE([b("wui-tabs")],r_);let rk=(0,s.AH)` :host { display: block; } :host > button { gap: var(--wui-spacing-xxs); padding: var(--wui-spacing-xs); padding-right: var(--wui-spacing-1xs); height: 40px; border-radius: var(--wui-border-radius-l); background: var(--wui-color-gray-glass-002); border-width: 0px; box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-002); } :host > button wui-image { width: 24px; height: 24px; border-radius: var(--wui-border-radius-s); box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-010); } `;var rI=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o};let rS=class extends s.WF{constructor(){super(...arguments),this.text=""}render(){return(0,s.qy)` `}tokenTemplate(){return this.imageSrc?(0,s.qy)``:(0,s.qy)` `}};rS.styles=[g,w,rk],rI([(0,x.MZ)()],rS.prototype,"imageSrc",void 0),rI([(0,x.MZ)()],rS.prototype,"text",void 0),rS=rI([b("wui-token-button")],rS);let rT=(0,s.AH)` :host { display: block; padding: 9px var(--wui-spacing-s) 10px var(--wui-spacing-s); border-radius: var(--wui-border-radius-xxs); color: var(--wui-color-bg-100); position: relative; } :host([data-variant='shade']) { background-color: var(--wui-color-bg-150); border: 1px solid var(--wui-color-gray-glass-005); } :host([data-variant='shade']) > wui-text { color: var(--wui-color-fg-150); } :host([data-variant='fill']) { background-color: var(--wui-color-fg-100); border: none; } wui-icon { position: absolute; width: 12px !important; height: 4px !important; } wui-icon[data-placement='top'] { bottom: 0px; left: 50%; transform: translate(-50%, 95%); } wui-icon[data-placement='bottom'] { top: 0; left: 50%; transform: translate(-50%, -95%) rotate(180deg); } wui-icon[data-placement='right'] { top: 50%; left: 0; transform: translate(-65%, -50%) rotate(90deg); } wui-icon[data-placement='left'] { top: 50%; right: 0%; transform: translate(65%, -50%) rotate(270deg); } `;var rN=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o};let rP=class extends s.WF{constructor(){super(...arguments),this.placement="top",this.variant="fill",this.message=""}render(){return this.dataset.variant=this.variant,(0,s.qy)` ${this.message}`}};rP.styles=[g,w,rT],rN([(0,x.MZ)()],rP.prototype,"placement",void 0),rN([(0,x.MZ)()],rP.prototype,"variant",void 0),rN([(0,x.MZ)()],rP.prototype,"message",void 0),rP=rN([b("wui-tooltip")],rP);let rR=(0,s.AH)` :host { height: 60px; min-height: 60px; } :host > wui-flex { cursor: pointer; height: 100%; display: flex; column-gap: var(--wui-spacing-s); padding: var(--wui-spacing-xs); padding-right: var(--wui-spacing-l); width: 100%; background-color: transparent; border-radius: var(--wui-border-radius-xs); color: var(--wui-color-fg-250); transition: background-color var(--wui-ease-out-power-1) var(--wui-duration-lg), opacity var(--wui-ease-out-power-1) var(--wui-duration-lg); will-change: background-color, opacity; } @media (hover: hover) and (pointer: fine) { :host > wui-flex:hover { background-color: var(--wui-color-gray-glass-002); } :host > wui-flex:active { background-color: var(--wui-color-gray-glass-005); } } :host([disabled]) > wui-flex { opacity: 0.6; } :host([disabled]) > wui-flex:hover { background-color: transparent; } :host > wui-flex > wui-flex { flex: 1; } :host > wui-flex > wui-image, :host > wui-flex > .token-item-image-placeholder { width: 40px; max-width: 40px; height: 40px; border-radius: var(--wui-border-radius-3xl); position: relative; } :host > wui-flex > .token-item-image-placeholder { display: flex; align-items: center; justify-content: center; } :host > wui-flex > wui-image::after, :host > wui-flex > .token-item-image-placeholder::after { position: absolute; content: ''; inset: 0; box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-010); border-radius: var(--wui-border-radius-l); } button > wui-icon-box[data-variant='square-blue'] { border-radius: var(--wui-border-radius-3xs); position: relative; border: none; width: 36px; height: 36px; } `;var rO=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o};let rM=class extends s.WF{constructor(){super(),this.observer=new IntersectionObserver(()=>void 0),this.imageSrc=void 0,this.name=void 0,this.symbol=void 0,this.price=void 0,this.amount=void 0,this.visible=!1,this.imageError=!1,this.observer=new IntersectionObserver(e=>{e.forEach(e=>{e.isIntersecting?this.visible=!0:this.visible=!1})},{threshold:.1})}firstUpdated(){this.observer.observe(this)}disconnectedCallback(){this.observer.disconnect()}render(){if(!this.visible)return null;let e=this.amount&&this.price?u.Se.multiply(this.price,this.amount)?.toFixed(3):null;return(0,s.qy)` ${this.visualTemplate()} ${this.name} ${e?(0,s.qy)` $${tT.formatNumberToLocalString(e,3)} `:null} ${this.symbol} ${this.amount?(0,s.qy)` ${tT.formatNumberToLocalString(this.amount,4)} `:null} `}visualTemplate(){return this.imageError?(0,s.qy)` `:this.imageSrc?(0,s.qy)``:null}imageLoadError(){this.imageError=!0}};rM.styles=[g,w,rR],rO([(0,x.MZ)()],rM.prototype,"imageSrc",void 0),rO([(0,x.MZ)()],rM.prototype,"name",void 0),rO([(0,x.MZ)()],rM.prototype,"symbol",void 0),rO([(0,x.MZ)()],rM.prototype,"price",void 0),rO([(0,x.MZ)()],rM.prototype,"amount",void 0),rO([(0,x.wk)()],rM.prototype,"visible",void 0),rO([(0,x.wk)()],rM.prototype,"imageError",void 0),rM=rO([b("wui-token-list-item")],rM);let rD=(0,s.AH)` :host { display: flex; justify-content: center; align-items: center; width: var(--wui-icon-box-size-xl); height: var(--wui-icon-box-size-xl); box-shadow: 0 0 0 8px var(--wui-thumbnail-border); border-radius: var(--local-border-radius); overflow: hidden; } wui-icon { width: 32px; height: 32px; } `;var rU=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o};let r$=class extends s.WF{render(){return this.style.cssText=`--local-border-radius: ${this.borderRadiusFull?"1000px":"20px"}; background-color: var(--wui-color-modal-bg);`,(0,s.qy)`${this.templateVisual()}`}templateVisual(){return this.imageSrc?(0,s.qy)``:(0,s.qy)``}};r$.styles=[g,rD],rU([(0,x.MZ)()],r$.prototype,"imageSrc",void 0),rU([(0,x.MZ)()],r$.prototype,"alt",void 0),rU([(0,x.MZ)({type:Boolean})],r$.prototype,"borderRadiusFull",void 0),r$=rU([b("wui-visual-thumbnail")],r$);let rL=(0,s.AH)` :host { display: block; } button { width: 100%; display: block; padding-top: var(--wui-spacing-l); padding-bottom: var(--wui-spacing-l); padding-left: var(--wui-spacing-s); padding-right: var(--wui-spacing-2l); border-radius: var(--wui-border-radius-s); background-color: var(--wui-color-accent-glass-010); } button:hover { background-color: var(--wui-color-accent-glass-015) !important; } button:active { background-color: var(--wui-color-accent-glass-020) !important; } `;var rj=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o};let rB=class extends s.WF{constructor(){super(...arguments),this.label="",this.description="",this.icon="wallet"}render(){return(0,s.qy)` `}};rB.styles=[g,w,rL],rj([(0,x.MZ)()],rB.prototype,"label",void 0),rj([(0,x.MZ)()],rB.prototype,"description",void 0),rj([(0,x.MZ)()],rB.prototype,"icon",void 0),rB=rj([b("wui-notice-card")],rB);let rW=(0,s.AH)` button { height: auto; position: relative; flex-direction: column; gap: var(--wui-spacing-s); padding: 17px 18px 17px var(--wui-spacing-m); width: 100%; background-color: var(--wui-color-gray-glass-002); border-radius: var(--wui-border-radius-xs); color: var(--wui-color-fg-250); } .overflowedContent { width: 100%; overflow: hidden; } .overflowedContent[data-active='false']:after { content: ''; position: absolute; top: 50%; left: 0; right: 0; bottom: 0; background: linear-gradient(to top, var(--wui-color-bg-150), transparent); border-bottom-left-radius: var(--wui-border-radius-xs); border-bottom-right-radius: var(--wui-border-radius-xs); } .heightContent { max-height: 100px; } pre { text-align: left; white-space: pre-wrap; height: auto; overflow-x: auto; overflow-wrap: anywhere; } `;var rq=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o};let rH=class extends s.WF{constructor(){super(...arguments),this.textTitle="",this.overflowedContent="",this.toggled=!1,this.enableAccordion=!1,this.scrollElement=void 0,this.scrollHeightElement=0}updated(e){super.updated(e),(e.has("textTitle")||e.has("overflowedContent"))&&setTimeout(()=>{this.checkHeight()},1)}checkHeight(){this.updateComplete.then(()=>{let e=this.shadowRoot?.querySelector(".heightContent"),t=this.shadowRoot?.querySelector(".textContent");if(e&&t){this.scrollElement=e;let i=t?.scrollHeight;i&&i>100&&(this.enableAccordion=!0,this.scrollHeightElement=i,this.requestUpdate())}})}render(){return(0,s.qy)` `}onClick(){let e=this.shadowRoot?.querySelector("wui-icon");this.enableAccordion&&(this.toggled=!this.toggled,this.requestUpdate(),this.scrollElement&&this.scrollElement.animate([{maxHeight:this.toggled?"100px":`${this.scrollHeightElement}px`},{maxHeight:this.toggled?`${this.scrollHeightElement}px`:"100px"}],{duration:300,fill:"forwards",easing:"ease"}),e&&e.animate([{transform:this.toggled?"rotate(0deg)":"rotate(180deg)"},{transform:this.toggled?"rotate(180deg)":"rotate(0deg)"}],{duration:300,fill:"forwards",easing:"ease"}))}chevronTemplate(){return this.enableAccordion?(0,s.qy)` `:null}};rH.styles=[g,w,rW],rq([(0,x.MZ)()],rH.prototype,"textTitle",void 0),rq([(0,x.MZ)()],rH.prototype,"overflowedContent",void 0),rH=rq([b("wui-list-accordion")],rH);let rz=(0,s.AH)` :host { display: flex; column-gap: var(--wui-spacing-s); padding: 17px 18px 17px var(--wui-spacing-m); width: 100%; background-color: var(--wui-color-gray-glass-002); border-radius: var(--wui-border-radius-xs); color: var(--wui-color-fg-250); } wui-image { width: var(--wui-icon-size-lg); height: var(--wui-icon-size-lg); border-radius: var(--wui-border-radius-3xl); } wui-icon { width: var(--wui-icon-size-lg); height: var(--wui-icon-size-lg); } `;var rF=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o};let rZ=class extends s.WF{constructor(){super(...arguments),this.imageSrc=void 0,this.textTitle="",this.textValue=void 0}render(){return(0,s.qy)` ${this.textTitle} ${this.templateContent()} `}templateContent(){return this.imageSrc?(0,s.qy)``:this.textValue?(0,s.qy)` ${this.textValue} `:(0,s.qy)``}};rZ.styles=[g,w,rz],rF([(0,x.MZ)()],rZ.prototype,"imageSrc",void 0),rF([(0,x.MZ)()],rZ.prototype,"textTitle",void 0),rF([(0,x.MZ)()],rZ.prototype,"textValue",void 0),rZ=rF([b("wui-list-content")],rZ);let rV=(0,s.AH)` button { column-gap: var(--wui-spacing-s); padding: 7px var(--wui-spacing-l) 7px var(--wui-spacing-xs); width: 100%; transition: all var(--wui-ease-out-power-1) var(--wui-duration-md); border-radius: var(--wui-border-radius-xs); color: var(--wui-color-fg-100); } button > wui-text:nth-child(2) { display: flex; flex: 1; } button[data-transparent='true'] { pointer-events: none; background-color: transparent; } button:hover { background-color: var(--wui-color-gray-glass-002); } button:active { background-color: var(--wui-color-gray-glass-005); } wui-image { width: var(--wui-spacing-3xl); height: var(--wui-spacing-3xl); border-radius: 100%; } button:disabled { background-color: var(--wui-color-gray-glass-002); opacity: 0.5; cursor: not-allowed; } button:disabled > wui-tag { background-color: var(--wui-color-gray-glass-010); color: var(--wui-color-fg-300); } `;var rK=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o};let rG=class extends s.WF{constructor(){super(...arguments),this.imageSrc="",this.name="",this.disabled=!1,this.selected=!1,this.transparent=!1}render(){return(0,s.qy)` `}checkmarkTemplate(){return this.selected?(0,s.qy)``:null}templateNetworkImage(){return this.imageSrc?(0,s.qy)``:this.imageSrc?null:(0,s.qy)``}};rG.styles=[g,w,rV],rK([(0,x.MZ)()],rG.prototype,"imageSrc",void 0),rK([(0,x.MZ)()],rG.prototype,"name",void 0),rK([(0,x.MZ)({type:Boolean})],rG.prototype,"disabled",void 0),rK([(0,x.MZ)({type:Boolean})],rG.prototype,"selected",void 0),rK([(0,x.MZ)({type:Boolean})],rG.prototype,"transparent",void 0),rG=rK([b("wui-list-network")],rG);let rJ=(0,s.AH)` :host { display: flex; flex-direction: column; gap: var(--wui-spacing-l); padding: 17px 18px 17px var(--wui-spacing-m); width: 100%; background-color: var(--wui-color-gray-glass-002); border-radius: var(--wui-border-radius-xs); color: var(--wui-color-fg-250); } wui-image { width: var(--wui-icon-size-lg); height: var(--wui-icon-size-lg); border-radius: var(--wui-border-radius-3xl); } wui-icon { width: var(--wui-icon-size-lg); height: var(--wui-icon-size-lg); } `;var rY=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o};let rQ=class extends s.WF{constructor(){super(...arguments),this.amount="",this.networkCurreny="",this.networkImageUrl="",this.receiverAddress="",this.addressExplorerUrl=""}render(){return(0,s.qy)` Sending ${this.amount} ${this.networkCurreny} ${this.templateNetworkVisual()} To `}templateNetworkVisual(){return this.networkImageUrl?(0,s.qy)``:(0,s.qy)``}};rQ.styles=[g,w,rJ],rY([(0,x.MZ)()],rQ.prototype,"amount",void 0),rY([(0,x.MZ)()],rQ.prototype,"networkCurreny",void 0),rY([(0,x.MZ)()],rQ.prototype,"networkImageUrl",void 0),rY([(0,x.MZ)()],rQ.prototype,"receiverAddress",void 0),rY([(0,x.MZ)()],rQ.prototype,"addressExplorerUrl",void 0),rQ=rY([b("wui-list-wallet-transaction")],rQ);let rX=(0,s.AH)` button { display: flex; gap: var(--wui-spacing-3xs); align-items: center; padding: 6.25px var(--wui-spacing-xs) 7.25px var(--wui-spacing-s); background-color: var(--wui-color-gray-glass-090); border-radius: var(--wui-border-radius-3xl); border: 1px solid var(--wui-color-gray-glass-060); transition: background-color var(--wui-duration-md) var(--wui-ease-inout-power-1); will-change: background-color; } @media (hover: hover) and (pointer: fine) { button:hover:enabled { background-color: var(--wui-color-gray-glass-080); } button:active:enabled { background-color: var(--wui-color-gray-glass-060); } } `;var r0=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o};let r1=class extends s.WF{constructor(){super(...arguments),this.text=""}render(){return(0,s.qy)``}};r1.styles=[g,w,rX],r0([(0,x.MZ)()],r1.prototype,"text",void 0),r1=r0([b("wui-promo")],r1);let r2=(0,s.AH)` span { font-weight: 500; font-size: 40px; color: var(--wui-color-fg-100); line-height: 130%; /* 52px */ letter-spacing: -1.6px; text-align: center; } .pennies { color: var(--wui-color-fg-200); } `;var r3=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o};let r5=class extends s.WF{constructor(){super(...arguments),this.dollars="0",this.pennies="00"}render(){return(0,s.qy)`$${this.dollars}.${this.pennies}`}};r5.styles=[g,r2],r3([(0,x.MZ)()],r5.prototype,"dollars",void 0),r3([(0,x.MZ)()],r5.prototype,"pennies",void 0),r5=r3([b("wui-balance")],r5);let r4=(0,s.AH)` button { background-color: var(--wui-color-gray-glass-002); border-radius: var(--wui-border-radius-3xl); border: 1px solid var(--wui-color-gray-glass-002); padding: var(--wui-spacing-xs) var(--wui-spacing-s) var(--wui-spacing-xs) var(--wui-spacing-xs); position: relative; } wui-avatar { width: 32px; height: 32px; box-shadow: 0 0 0 0; outline: 3px solid var(--wui-color-gray-glass-005); } wui-icon-box, wui-image { width: 16px; height: 16px; border-radius: var(--wui-border-radius-3xl); position: absolute; left: 26px; top: 24px; } wui-image { outline: 2px solid var(--wui-color-bg-125); } wui-icon-box { outline: 2px solid var(--wui-color-bg-200); background-color: var(--wui-color-bg-250); } `;var r6=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o};let r8=class extends s.WF{constructor(){super(...arguments),this.networkSrc=void 0,this.avatarSrc=void 0,this.profileName="",this.address="",this.icon="chevronBottom"}render(){return(0,s.qy)``}networkImageTemplate(){return this.networkSrc?(0,s.qy)``:(0,s.qy)` `}};r8.styles=[g,w,r4],r6([(0,x.MZ)()],r8.prototype,"networkSrc",void 0),r6([(0,x.MZ)()],r8.prototype,"avatarSrc",void 0),r6([(0,x.MZ)()],r8.prototype,"profileName",void 0),r6([(0,x.MZ)()],r8.prototype,"address",void 0),r6([(0,x.MZ)()],r8.prototype,"icon",void 0),r8=r6([b("wui-profile-button")],r8);let r9=(0,s.AH)` button { background-color: var(--wui-color-gray-glass-002); border-radius: var(--wui-border-radius-3xl); border: 1px solid var(--wui-color-gray-glass-002); padding: var(--wui-spacing-xs) var(--wui-spacing-s) var(--wui-spacing-xs) var(--wui-spacing-xs); position: relative; } wui-avatar { width: 32px; height: 32px; box-shadow: 0 0 0 0; outline: 3px solid var(--wui-color-gray-glass-005); } wui-icon-box, wui-image { width: 16px; height: 16px; border-radius: var(--wui-border-radius-3xl); position: absolute; left: 26px; top: 24px; } wui-image { outline: 2px solid var(--wui-color-bg-125); } wui-icon-box { outline: 2px solid var(--wui-color-bg-200); background-color: var(--wui-color-bg-250); } `;var r7=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o};let ne=class extends s.WF{constructor(){super(...arguments),this.avatarSrc=void 0,this.profileName="",this.address="",this.icon="mail",this.connectedConnector=rv.iT.getConnectedConnector(),this.shouldShowIcon="AUTH"===this.connectedConnector}render(){return(0,s.qy)``}handleClick(e){if(e.target instanceof HTMLElement&&"copy-address"===e.target.id){this.onCopyClick?.(e);return}this.onProfileClick?.(e)}getIconTemplate(e){return(0,s.qy)` `}};ne.styles=[g,w,r9],r7([(0,x.MZ)()],ne.prototype,"avatarSrc",void 0),r7([(0,x.MZ)()],ne.prototype,"profileName",void 0),r7([(0,x.MZ)()],ne.prototype,"address",void 0),r7([(0,x.MZ)()],ne.prototype,"icon",void 0),r7([(0,x.MZ)()],ne.prototype,"onProfileClick",void 0),r7([(0,x.MZ)()],ne.prototype,"onCopyClick",void 0),ne=r7([b("wui-profile-button-v2")],ne);let nt=(0,s.AH)` button { border: none; border-radius: var(--wui-border-radius-3xl); } button[data-variant='main'] { background-color: var(--wui-color-accent-100); color: var(--wui-color-inverse-100); box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-010); } button[data-variant='accent'] { background-color: var(--wui-color-accent-glass-010); color: var(--wui-color-accent-100); box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-005); } button[data-variant='gray'] { background-color: transparent; color: var(--wui-color-fg-200); box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-010); } button[data-variant='shade'] { background-color: transparent; color: var(--wui-color-accent-100); box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-010); } button[data-size='sm'] { height: 32px; padding: 0 var(--wui-spacing-s); } button[data-size='md'] { height: 40px; padding: 0 var(--wui-spacing-l); } button[data-size='sm'] > wui-image { width: 16px; height: 16px; } button[data-size='md'] > wui-image { width: 24px; height: 24px; } button[data-size='sm'] > wui-icon { width: 12px; height: 12px; } button[data-size='md'] > wui-icon { width: 14px; height: 14px; } wui-image { border-radius: var(--wui-border-radius-3xl); overflow: hidden; } button.disabled > wui-icon, button.disabled > wui-image { filter: grayscale(1); } button[data-variant='main'] > wui-image { box-shadow: inset 0 0 0 1px var(--wui-color-accent-090); } button[data-variant='shade'] > wui-image, button[data-variant='gray'] > wui-image { box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-010); } @media (hover: hover) and (pointer: fine) { button[data-variant='main']:focus-visible { background-color: var(--wui-color-accent-090); } button[data-variant='main']:hover:enabled { background-color: var(--wui-color-accent-090); } button[data-variant='main']:active:enabled { background-color: var(--wui-color-accent-080); } button[data-variant='accent']:hover:enabled { background-color: var(--wui-color-accent-glass-015); } button[data-variant='accent']:active:enabled { background-color: var(--wui-color-accent-glass-020); } button[data-variant='shade']:focus-visible, button[data-variant='gray']:focus-visible, button[data-variant='shade']:hover, button[data-variant='gray']:hover { background-color: var(--wui-color-gray-glass-002); } button[data-variant='gray']:active, button[data-variant='shade']:active { background-color: var(--wui-color-gray-glass-005); } } button.disabled { color: var(--wui-color-gray-glass-020); background-color: var(--wui-color-gray-glass-002); box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-002); pointer-events: none; } `;var ni=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o};let nr=class extends s.WF{constructor(){super(...arguments),this.variant="accent",this.imageSrc="",this.disabled=!1,this.icon="externalLink",this.size="md",this.text=""}render(){let e="sm"===this.size?"small-600":"paragraph-600";return(0,s.qy)` `}};nr.styles=[g,w,nt],ni([(0,x.MZ)()],nr.prototype,"variant",void 0),ni([(0,x.MZ)()],nr.prototype,"imageSrc",void 0),ni([(0,x.MZ)({type:Boolean})],nr.prototype,"disabled",void 0),ni([(0,x.MZ)()],nr.prototype,"icon",void 0),ni([(0,x.MZ)()],nr.prototype,"size",void 0),ni([(0,x.MZ)()],nr.prototype,"text",void 0),nr=ni([b("wui-chip-button")],nr);let nn=(0,s.AH)` button { display: flex; gap: var(--wui-spacing-xl); width: 100%; background-color: var(--wui-color-gray-glass-002); border-radius: var(--wui-border-radius-xxs); padding: var(--wui-spacing-m) var(--wui-spacing-s); } wui-text { width: 100%; } wui-flex { width: auto; } .network-icon { width: var(--wui-spacing-2l); height: var(--wui-spacing-2l); border-radius: calc(var(--wui-spacing-2l) / 2); overflow: hidden; box-shadow: 0 0 0 3px var(--wui-color-gray-glass-002), 0 0 0 3px var(--wui-color-modal-bg); } `;var na=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o};let no=class extends s.WF{constructor(){super(...arguments),this.networkImages=[""],this.text=""}render(){return(0,s.qy)` `}networksTemplate(){let e=this.networkImages.slice(0,5);return(0,s.qy)` ${e?.map(e=>s.qy` `)} `}};no.styles=[g,w,nn],na([(0,x.MZ)({type:Array})],no.prototype,"networkImages",void 0),na([(0,x.MZ)()],no.prototype,"text",void 0),no=na([b("wui-compatible-network")],no);let ns=(0,s.AH)` wui-flex { width: 100%; background-color: var(--wui-color-gray-glass-005); border-radius: var(--wui-border-radius-s); padding: var(--wui-spacing-1xs) var(--wui-spacing-s) var(--wui-spacing-1xs) var(--wui-spacing-1xs); } `;var nc=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o};let nl=class extends s.WF{constructor(){super(...arguments),this.icon="externalLink",this.text=""}render(){return(0,s.qy)` ${this.text} `}};nl.styles=[g,w,ns],nc([(0,x.MZ)()],nl.prototype,"icon",void 0),nc([(0,x.MZ)()],nl.prototype,"text",void 0),nl=nc([b("wui-banner")],nl);let nu=(0,s.AH)` wui-flex { width: 100%; background-color: var(--wui-color-gray-glass-005); border-radius: var(--wui-border-radius-m); padding: var(--wui-spacing-1xs) var(--wui-spacing-s) var(--wui-spacing-1xs) var(--wui-spacing-1xs); } `;var nd=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o};let nh=class extends s.WF{constructor(){super(...arguments),this.imageSrc="",this.text="",this.size=""}render(){return(0,s.qy)` ${this.text} `}};nh.styles=[g,w,nu],nd([(0,x.MZ)()],nh.prototype,"imageSrc",void 0),nd([(0,x.MZ)()],nh.prototype,"text",void 0),nd([(0,x.MZ)()],nh.prototype,"size",void 0),nh=nd([b("wui-banner-img")],nh);let np=(0,s.AH)` button { padding: 6.5px var(--wui-spacing-l) 6.5px var(--wui-spacing-xs); display: flex; justify-content: space-between; width: 100%; border-radius: var(--wui-border-radius-xs); background-color: var(--wui-color-gray-glass-002); } button[data-clickable='false'] { pointer-events: none; background-color: transparent; } wui-image, wui-icon { width: var(--wui-spacing-3xl); height: var(--wui-spacing-3xl); } wui-image { border-radius: var(--wui-border-radius-3xl); } `;var nf=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o};let ng=class extends s.WF{constructor(){super(...arguments),this.tokenName="",this.tokenImageUrl="",this.tokenValue=0,this.tokenAmount="0.0",this.tokenCurrency="",this.clickable=!1}render(){return(0,s.qy)` `}visualTemplate(){return this.tokenName&&this.tokenImageUrl?(0,s.qy)``:(0,s.qy)``}};ng.styles=[g,w,np],nf([(0,x.MZ)()],ng.prototype,"tokenName",void 0),nf([(0,x.MZ)()],ng.prototype,"tokenImageUrl",void 0),nf([(0,x.MZ)({type:Number})],ng.prototype,"tokenValue",void 0),nf([(0,x.MZ)()],ng.prototype,"tokenAmount",void 0),nf([(0,x.MZ)()],ng.prototype,"tokenCurrency",void 0),nf([(0,x.MZ)({type:Boolean})],ng.prototype,"clickable",void 0),ng=nf([b("wui-list-token")],ng);let nw=(0,s.AH)` button { width: 100%; display: flex; gap: var(--wui-spacing-s); align-items: center; justify-content: flex-start; padding: var(--wui-spacing-s) var(--wui-spacing-m) var(--wui-spacing-s) var(--wui-spacing-s); background-color: var(--wui-color-gray-glass-002); border-radius: var(--wui-border-radius-xs); } wui-icon-box { width: var(--wui-spacing-2xl); height: var(--wui-spacing-2xl); } wui-flex { width: auto; } `;var nm=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o};let nb=class extends s.WF{constructor(){super(...arguments),this.icon="card",this.text="",this.description="",this.tag=void 0,this.iconBackgroundColor="accent-100",this.iconColor="accent-100",this.disabled=!1}render(){return(0,s.qy)` `}titleTemplate(){return this.tag?(0,s.qy)` ${this.text}${this.tag} `:(0,s.qy)`${this.text}`}};nb.styles=[g,w,nw],nm([(0,x.MZ)()],nb.prototype,"icon",void 0),nm([(0,x.MZ)()],nb.prototype,"text",void 0),nm([(0,x.MZ)()],nb.prototype,"description",void 0),nm([(0,x.MZ)()],nb.prototype,"tag",void 0),nm([(0,x.MZ)()],nb.prototype,"iconBackgroundColor",void 0),nm([(0,x.MZ)()],nb.prototype,"iconColor",void 0),nm([(0,x.MZ)({type:Boolean})],nb.prototype,"disabled",void 0),nb=nm([b("wui-list-description")],nb);let nv=(0,s.AH)` :host { position: relative; display: inline-block; } input { background: transparent; width: 100%; height: auto; font-family: var(--wui-font-family); color: var(--wui-color-fg-100); font-feature-settings: 'case' on; font-size: 32px; font-weight: var(--wui-font-weight-light); caret-color: var(--wui-color-accent-100); line-height: 130%; letter-spacing: -1.28px; box-sizing: border-box; -webkit-appearance: none; -moz-appearance: textfield; padding: 0px; } input::-webkit-outer-spin-button, input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; } input::placeholder { color: var(--wui-color-fg-275); } `,ny=/[.*+?^${}()|[\]\\]/gu,nx=/[0-9,.]/u;var nC=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o};let nA=class extends s.WF{constructor(){super(...arguments),this.inputElementRef=(0,ix._)(),this.disabled=!1,this.value="",this.placeholder="0"}render(){return this.inputElementRef?.value&&this.value&&(this.inputElementRef.value.value=this.value),(0,s.qy)` `}dispatchInputChangeEvent(e){let t=e.data;if(t&&this.inputElementRef?.value){if(","===t){let e=this.inputElementRef.value.value.replace(",",".");this.inputElementRef.value.value=e,this.value=`${this.value}${e}`}else nx.test(t)||(this.inputElementRef.value.value=this.value.replace(RegExp(t.replace(ny,"\\$&"),"gu"),""))}this.dispatchEvent(new CustomEvent("inputChange",{detail:this.inputElementRef.value?.value,bubbles:!0,composed:!0}))}};nA.styles=[g,w,nv],nC([(0,x.MZ)({type:Boolean})],nA.prototype,"disabled",void 0),nC([(0,x.MZ)({type:String})],nA.prototype,"value",void 0),nC([(0,x.MZ)({type:String})],nA.prototype,"placeholder",void 0),nA=nC([b("wui-input-amount")],nA);let nE=(0,s.AH)` :host { display: flex; gap: var(--wui-spacing-xs); border-radius: var(--wui-border-radius-3xl); border: 1px solid var(--wui-color-gray-glass-002); background: var(--wui-color-gray-glass-002); padding: var(--wui-spacing-2xs) var(--wui-spacing-xs) var(--wui-spacing-2xs) var(--wui-spacing-s); align-items: center; } wui-avatar, wui-icon, wui-image { width: 32px; height: 32px; border: 1px solid var(--wui-color-gray-glass-002); border-radius: var(--wui-border-radius-3xl); box-shadow: 0 0 0 2px var(--wui-color-gray-glass-002); } `;var n_=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o};let nk=class extends s.WF{constructor(){super(...arguments),this.text="",this.address="",this.isAddress=!1}render(){return(0,s.qy)`${this.text} ${this.imageTemplate()}`}imageTemplate(){return this.isAddress?(0,s.qy)``:this.imageSrc?(0,s.qy)``:(0,s.qy)``}};nk.styles=[g,w,nE],n_([(0,x.MZ)()],nk.prototype,"text",void 0),n_([(0,x.MZ)()],nk.prototype,"address",void 0),n_([(0,x.MZ)()],nk.prototype,"imageSrc",void 0),n_([(0,x.MZ)({type:Boolean})],nk.prototype,"isAddress",void 0),nk=n_([b("wui-preview-item")],nk);let nI=(0,s.AH)` button { padding: 6.5px var(--wui-spacing-l) 6.5px var(--wui-spacing-xs); display: flex; justify-content: space-between; width: 100%; border-radius: var(--wui-border-radius-xs); background-color: var(--wui-color-gray-glass-002); } button[data-clickable='false'] { pointer-events: none; background-color: transparent; } wui-image { width: var(--wui-spacing-3xl); height: var(--wui-spacing-3xl); border-radius: var(--wui-border-radius-3xl); } wui-avatar { width: var(--wui-spacing-3xl); height: var(--wui-spacing-3xl); box-shadow: 0 0 0 0; } .address { color: var(--wui-color-fg-base-100); } .address-description { text-transform: capitalize; color: var(--wui-color-fg-base-200); } wui-icon-box { position: relative; right: 15px; top: 15px; border: 2px solid var(--wui-color-bg-150); background-color: var(--wui-color-bg-125); } `;var nS=i(45011),nT=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o};let nN=class extends s.WF{constructor(){super(...arguments),this.accountAddress="",this.accountType="",this.connectedConnector=rv.iT.getConnectedConnector(),this.labels=rv.Uj.state.addressLabels,this.caipNetwork=rv.WB.state.activeCaipNetwork,this.socialProvider=rv.iT.getConnectedSocialProvider(),this.balance=0,this.fetchingBalance=!0,this.shouldShowIcon=!1,this.selected=!1}connectedCallback(){super.connectedCallback(),rv.TP.getBalance(this.accountAddress,this.caipNetwork?.caipNetworkId).then(e=>{let t=this.balance;e.balances.length>0&&(t=e.balances.reduce((e,t)=>e+(t?.value||0),0)),this.balance=t,this.fetchingBalance=!1,this.requestUpdate()}).catch(()=>{this.fetchingBalance=!1,this.requestUpdate()})}render(){let e=this.getLabel();return this.shouldShowIcon="ID_AUTH"===this.connectedConnector,(0,s.qy)` ${this.shouldShowIcon?(0,s.qy)``:(0,s.qy)``} ${tT.getTruncateString({string:this.accountAddress,charsStart:4,charsEnd:6,truncate:"middle"})} ${e} ${this.fetchingBalance?(0,s.qy)``:(0,s.qy)` $${this.balance.toFixed(2)}`} `}getLabel(){let e=this.labels?.get(this.accountAddress);return e||"ID_AUTH"!==this.connectedConnector?(e||"INJECTED"!==this.connectedConnector)&&"ANNOUNCED"!==this.connectedConnector?e||(e="EOA"):e="Injected Account":e=`${"eoa"===this.accountType?this.socialProvider??"Email":"Smart"} Account`,e}};nN.styles=[g,w,nI],nT([(0,x.MZ)()],nN.prototype,"accountAddress",void 0),nT([(0,x.MZ)()],nN.prototype,"accountType",void 0),nT([(0,x.MZ)({type:Boolean})],nN.prototype,"selected",void 0),nT([(0,x.MZ)({type:Function})],nN.prototype,"onSelect",void 0),nN=nT([b("wui-list-account")],nN);let nP=(0,s.AH)` :host { position: relative; } button { display: flex; justify-content: center; align-items: center; height: 48px; width: 100%; background-color: var(--wui-color-accent-glass-010); border-radius: var(--wui-border-radius-xs); border: 1px solid var(--wui-color-accent-glass-010); transition: background-color var(--wui-ease-out-power-1) var(--wui-duration-md); will-change: background-color; } wui-tooltip { padding: 7px var(--wui-spacing-s) 8px var(--wui-spacing-s); position: absolute; top: -8px; left: 50%; transform: translate(-50%, -100%); opacity: 0; display: none; } @media (hover: hover) and (pointer: fine) { button:hover:enabled { background-color: var(--wui-color-accent-glass-015); } button:active:enabled { background-color: var(--wui-color-accent-glass-020); } } `;var nR=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o};let nO=class extends s.WF{constructor(){super(...arguments),this.text="",this.icon="card"}render(){return(0,s.qy)``}};nO.styles=[g,w,nP],nR([(0,x.MZ)()],nO.prototype,"text",void 0),nR([(0,x.MZ)()],nO.prototype,"icon",void 0),nO=nR([b("wui-icon-button")],nO);let nM=(0,s.AH)` button { column-gap: var(--wui-spacing-s); padding: 16.5px var(--wui-spacing-l) 16.5px var(--wui-spacing-xs); width: 100%; background-color: var(--wui-color-gray-glass-002); border-radius: var(--wui-border-radius-xs); color: var(--wui-color-fg-100); justify-content: center; align-items: center; } button:disabled { background-color: var(--wui-color-gray-glass-015); color: var(--wui-color-gray-glass-015); } `;var nD=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o};let nU=class extends s.WF{constructor(){super(...arguments),this.text="",this.disabled=!1,this.tabIdx=void 0}render(){return(0,s.qy)` `}};nU.styles=[g,w,nM],nD([(0,x.MZ)()],nU.prototype,"text",void 0),nD([(0,x.MZ)({type:Boolean})],nU.prototype,"disabled",void 0),nD([(0,x.MZ)()],nU.prototype,"tabIdx",void 0),nU=nD([b("wui-list-button")],nU);let n$=(0,s.AH)` button { column-gap: var(--wui-spacing-s); padding: 7px var(--wui-spacing-l) 7px var(--wui-spacing-xs); width: 100%; justify-content: flex-start; background-color: var(--wui-color-gray-glass-002); border-radius: var(--wui-border-radius-xs); color: var(--wui-color-fg-100); } wui-text { text-transform: capitalize; } wui-text[data-align='left'] { display: flex; flex: 1; } wui-text[data-align='center'] { display: flex; flex: 1; justify-content: center; } .invisible { opacity: 0; pointer-events: none; } button:disabled { background-color: var(--wui-color-gray-glass-015); color: var(--wui-color-gray-glass-015); } `;var nL=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o};let nj=class extends s.WF{constructor(){super(...arguments),this.logo="google",this.name="Continue with google",this.align="left",this.disabled=!1}render(){return(0,s.qy)` `}templatePlacement(){return"center"===this.align?(0,s.qy)` `:null}};nj.styles=[g,w,n$],nL([(0,x.MZ)()],nj.prototype,"logo",void 0),nL([(0,x.MZ)()],nj.prototype,"name",void 0),nL([(0,x.MZ)()],nj.prototype,"align",void 0),nL([(0,x.MZ)()],nj.prototype,"tabIdx",void 0),nL([(0,x.MZ)({type:Boolean})],nj.prototype,"disabled",void 0),nj=nL([b("wui-list-social")],nj);let nB=(0,s.AH)` button { display: block; display: flex; align-items: center; padding: var(--wui-spacing-xxs); gap: var(--wui-spacing-xxs); transition: all var(--wui-ease-out-power-1) var(--wui-duration-md); border-radius: var(--wui-border-radius-xxs); } wui-image { border-radius: 100%; width: var(--wui-spacing-xl); height: var(--wui-spacing-xl); } wui-icon-box { width: var(--wui-spacing-xl); height: var(--wui-spacing-xl); } button:hover { background-color: var(--wui-color-gray-glass-002); } button:active { background-color: var(--wui-color-gray-glass-005); } `;var nW=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o};let nq=class extends s.WF{constructor(){super(...arguments),this.imageSrc=""}render(){return(0,s.qy)``}imageTemplate(){return this.imageSrc?(0,s.qy)``:(0,s.qy)``}};nq.styles=[g,w,m,nB],nW([(0,x.MZ)()],nq.prototype,"imageSrc",void 0),nq=nW([b("wui-select")],nq);let nH=(0,s.AH)` label { display: flex; align-items: center; cursor: pointer; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; column-gap: var(--wui-spacing-1xs); } label > input[type='checkbox'] { height: 0; width: 0; opacity: 0; pointer-events: none; position: absolute; } label > span { width: var(--wui-spacing-xl); height: var(--wui-spacing-xl); min-width: var(--wui-spacing-xl); min-height: var(--wui-spacing-xl); border-radius: var(--wui-border-radius-3xs); border-width: 1px; border-style: solid; border-color: var(--wui-color-gray-glass-010); display: flex; align-items: center; justify-content: center; transition: background-color var(--wui-ease-out-power-1) var(--wui-duration-lg); will-change: background-color; } label > span:hover, label > input[type='checkbox']:focus-visible + span { background-color: var(--wui-color-gray-glass-010); } label input[type='checkbox']:checked + span { background-color: var(--wui-color-blue-base-90); } label > span > wui-icon { opacity: 0; transition: opacity var(--wui-ease-out-power-1) var(--wui-duration-lg); will-change: opacity; } label > input[type='checkbox']:checked + span wui-icon { opacity: 1; } `;var nz=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o};let nF=class extends s.WF{constructor(){super(...arguments),this.inputElementRef=(0,ix._)(),this.checked=void 0}render(){return(0,s.qy)` `}dispatchChangeEvent(){this.dispatchEvent(new CustomEvent("checkboxChange",{detail:this.inputElementRef.value?.checked,bubbles:!0,composed:!0}))}};nF.styles=[g,nH],nz([(0,x.MZ)({type:Boolean})],nF.prototype,"checked",void 0),nF=nz([b("wui-checkbox")],nF);let nZ=(0,s.AH)` :host { display: flex; align-items: center; justify-content: center; } label { position: relative; display: inline-block; width: 32px; height: 22px; } input { width: 0; height: 0; opacity: 0; } span { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: var(--wui-color-blue-100); border-width: 1px; border-style: solid; border-color: var(--wui-color-gray-glass-002); border-radius: 999px; transition: background-color var(--wui-ease-inout-power-1) var(--wui-duration-md), border-color var(--wui-ease-inout-power-1) var(--wui-duration-md); will-change: background-color, border-color; } span:before { position: absolute; content: ''; height: 16px; width: 16px; left: 3px; top: 2px; background-color: var(--wui-color-inverse-100); transition: transform var(--wui-ease-inout-power-1) var(--wui-duration-lg); will-change: transform; border-radius: 50%; } input:checked + span { border-color: var(--wui-color-gray-glass-005); background-color: var(--wui-color-blue-100); } input:not(:checked) + span { background-color: var(--wui-color-gray-glass-010); } input:checked + span:before { transform: translateX(calc(100% - 7px)); } `;var nV=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o};let nK=class extends s.WF{constructor(){super(...arguments),this.inputElementRef=(0,ix._)(),this.checked=void 0}render(){return(0,s.qy)` `}dispatchChangeEvent(){this.dispatchEvent(new CustomEvent("switchChange",{detail:this.inputElementRef.value?.checked,bubbles:!0,composed:!0}))}};nK.styles=[g,w,m,nZ],nV([(0,x.MZ)({type:Boolean})],nK.prototype,"checked",void 0),nK=nV([b("wui-switch")],nK);let nG=(0,s.AH)` :host { height: 100%; } button { display: flex; align-items: center; justify-content: center; column-gap: var(--wui-spacing-1xs); padding: var(--wui-spacing-xs) var(--wui-spacing-s); background-color: var(--wui-color-gray-glass-002); border-radius: var(--wui-border-radius-xs); box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-002); transition: background-color var(--wui-ease-out-power-1) var(--wui-duration-md); will-change: background-color; cursor: pointer; } wui-switch { pointer-events: none; } `;var nJ=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o};let nY=class extends s.WF{constructor(){super(...arguments),this.checked=void 0}render(){return(0,s.qy)` `}};nY.styles=[g,w,nG],nJ([(0,x.MZ)({type:Boolean})],nY.prototype,"checked",void 0),nY=nJ([b("wui-certified-switch")],nY);let nQ=(0,s.AH)` :host { display: grid; width: inherit; height: inherit; } `;var nX=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o};let n0=class extends s.WF{render(){return this.style.cssText=` grid-template-rows: ${this.gridTemplateRows}; grid-template-columns: ${this.gridTemplateColumns}; justify-items: ${this.justifyItems}; align-items: ${this.alignItems}; justify-content: ${this.justifyContent}; align-content: ${this.alignContent}; column-gap: ${this.columnGap&&`var(--wui-spacing-${this.columnGap})`}; row-gap: ${this.rowGap&&`var(--wui-spacing-${this.rowGap})`}; gap: ${this.gap&&`var(--wui-spacing-${this.gap})`}; padding-top: ${this.padding&&tT.getSpacingStyles(this.padding,0)}; padding-right: ${this.padding&&tT.getSpacingStyles(this.padding,1)}; padding-bottom: ${this.padding&&tT.getSpacingStyles(this.padding,2)}; padding-left: ${this.padding&&tT.getSpacingStyles(this.padding,3)}; margin-top: ${this.margin&&tT.getSpacingStyles(this.margin,0)}; margin-right: ${this.margin&&tT.getSpacingStyles(this.margin,1)}; margin-bottom: ${this.margin&&tT.getSpacingStyles(this.margin,2)}; margin-left: ${this.margin&&tT.getSpacingStyles(this.margin,3)}; `,(0,s.qy)``}};n0.styles=[g,nQ],nX([(0,x.MZ)()],n0.prototype,"gridTemplateRows",void 0),nX([(0,x.MZ)()],n0.prototype,"gridTemplateColumns",void 0),nX([(0,x.MZ)()],n0.prototype,"justifyItems",void 0),nX([(0,x.MZ)()],n0.prototype,"alignItems",void 0),nX([(0,x.MZ)()],n0.prototype,"justifyContent",void 0),nX([(0,x.MZ)()],n0.prototype,"alignContent",void 0),nX([(0,x.MZ)()],n0.prototype,"columnGap",void 0),nX([(0,x.MZ)()],n0.prototype,"rowGap",void 0),nX([(0,x.MZ)()],n0.prototype,"gap",void 0),nX([(0,x.MZ)()],n0.prototype,"padding",void 0),nX([(0,x.MZ)()],n0.prototype,"margin",void 0),n0=nX([b("wui-grid")],n0);let n1=(0,s.AH)` :host { position: relative; display: flex; width: 100%; height: 1px; background-color: var(--wui-color-gray-glass-005); justify-content: center; align-items: center; } :host > wui-text { position: absolute; padding: 0px 10px; background-color: var(--wui-color-modal-bg); } `;var n2=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o};let n3=class extends s.WF{constructor(){super(...arguments),this.text=""}render(){return(0,s.qy)`${this.template()}`}template(){return this.text?(0,s.qy)`${this.text}`:null}};n3.styles=[g,n1],n2([(0,x.MZ)()],n3.prototype,"text",void 0),n3=n2([b("wui-separator")],n3);let n5={interpolate(e,t,i){if(2!==e.length||2!==t.length)throw Error("inputRange and outputRange must be an array of length 2");let r=e[0]||0,n=e[1]||0,a=t[0]||0,o=t[1]||0;return in?o:(o-a)/(n-r)*(i-r)+a}},n4=["receive","deposit","borrow","claim"],n6=["withdraw","repay","burn"],n8={getMonthName(e){let t=new Date;return t.setMonth(e),t.toLocaleString("en-US",{month:"long"})},getTransactionGroupTitle(e,t){let i=u.rL.getYear(),r=this.getMonthName(t);return e===i?r:`${r} ${e}`},getTransactionImages(e){let[t,i]=e,r=!!t&&e?.every(e=>!!e.nft_info),n=e?.length>1;return e?.length!==2||r?n?e.map(e=>this.getTransactionImage(e)):[this.getTransactionImage(t)]:[this.getTransactionImage(t),this.getTransactionImage(i)]},getTransactionImage:e=>({type:n8.getTransactionTransferTokenType(e),url:n8.getTransactionImageURL(e)}),getTransactionImageURL(e){let t;let i=!!e?.nft_info,r=!!e?.fungible_info;return e&&i?t=e?.nft_info?.content?.preview?.url:e&&r&&(t=e?.fungible_info?.icon?.url),t},getTransactionTransferTokenType:e=>e?.fungible_info?"FUNGIBLE":e?.nft_info?"NFT":void 0,getTransactionDescriptions(e){let t=e?.metadata?.operationType,i=e?.transfers,r=e?.transfers?.length>0,n=e?.transfers?.length>1,a=r&&i?.every(e=>!!e?.fungible_info),[o,s]=i,c=this.getTransferDescription(o);if(this.getTransferDescription(s),!r)return("send"===t||"receive"===t)&&a?[c=tT.getTruncateString({string:e?.metadata.sentFrom,charsStart:4,charsEnd:6,truncate:"middle"}),tT.getTruncateString({string:e?.metadata.sentTo,charsStart:4,charsEnd:6,truncate:"middle"})]:[e.metadata.status];if(n)return i.map(e=>this.getTransferDescription(e));let l="";return n4.includes(t)?l="+":n6.includes(t)&&(l="-"),[c=l.concat(c)]},getTransferDescription(e){let t="";return e&&(e?.nft_info?t=e?.nft_info?.name||"-":e?.fungible_info&&(t=this.getFungibleTransferDescription(e)||"-")),t},getFungibleTransferDescription(e){return e?[this.getQuantityFixedValue(e?.quantity.numeric),e?.fungible_info?.symbol].join(" ").trim():null},getQuantityFixedValue:e=>e?parseFloat(e).toFixed(3):null}},60402:(e,t,i)=>{"use strict";i.d(t,{R5:()=>y,oU:()=>r,RQ:()=>a,L_:()=>n,iV:()=>o});let r={WALLET_CONNECT_CONNECTOR_ID:"walletConnect",INJECTED_CONNECTOR_ID:"injected",WALLET_STANDARD_CONNECTOR_ID:"announced",COINBASE_CONNECTOR_ID:"coinbaseWallet",COINBASE_SDK_CONNECTOR_ID:"coinbaseWalletSDK",SAFE_CONNECTOR_ID:"safe",LEDGER_CONNECTOR_ID:"ledger",EIP6963_CONNECTOR_ID:"eip6963",AUTH_CONNECTOR_ID:"ID_AUTH",EIP155:"eip155",ADD_CHAIN_METHOD:"wallet_addEthereumChain",EIP6963_ANNOUNCE_EVENT:"eip6963:announceProvider",EIP6963_REQUEST_EVENT:"eip6963:requestProvider",CONNECTOR_RDNS_MAP:{coinbaseWallet:"com.coinbase.wallet",coinbaseWalletSDK:"com.coinbase.wallet"},CONNECTOR_TYPE_EXTERNAL:"EXTERNAL",CONNECTOR_TYPE_WALLET_CONNECT:"WALLET_CONNECT",CONNECTOR_TYPE_INJECTED:"INJECTED",CONNECTOR_TYPE_ANNOUNCED:"ANNOUNCED",CONNECTOR_TYPE_AUTH:"AUTH",CONNECTOR_TYPE_MULTI_CHAIN:"MULTI_CHAIN",CONNECTOR_TYPE_W3M_AUTH:"ID_AUTH"},n={ConnectorExplorerIds:{[r.COINBASE_CONNECTOR_ID]:"fd20dc426fb37566d803205b19bbc1d4096b248ac04548e3cfb6b3a38bd033aa",[r.COINBASE_SDK_CONNECTOR_ID]:"fd20dc426fb37566d803205b19bbc1d4096b248ac04548e3cfb6b3a38bd033aa",[r.SAFE_CONNECTOR_ID]:"225affb176778569276e484e1b92637ad061b01e13a048b35a9d280c3b58970f",[r.LEDGER_CONNECTOR_ID]:"19177a98252e07ddfc9af2083ba8e07ef627cb6103467ffebb3f8f4205fd7927"},NetworkImageIds:{1:"ba0ba0cd-17c6-4806-ad93-f9d174f17900",42161:"3bff954d-5cb0-47a0-9a23-d20192e74600",43114:"30c46e53-e989-45fb-4549-be3bd4eb3b00",56:"93564157-2e8e-4ce7-81df-b264dbee9b00",250:"06b26297-fe0c-4733-5d6b-ffa5498aac00",10:"ab9c186a-c52f-464b-2906-ca59d760a400",137:"41d04d42-da3b-4453-8506-668cc0727900",100:"02b53f6a-e3d4-479e-1cb4-21178987d100",9001:"f926ff41-260d-4028-635e-91913fc28e00",324:"b310f07f-4ef7-49f3-7073-2a0a39685800",314:"5a73b3dd-af74-424e-cae0-0de859ee9400",4689:"34e68754-e536-40da-c153-6ef2e7188a00",1088:"3897a66d-40b9-4833-162f-a2c90531c900",1284:"161038da-44ae-4ec7-1208-0ea569454b00",1285:"f1d73bb6-5450-4e18-38f7-fb6484264a00",7777777:"845c60df-d429-4991-e687-91ae45791600",42220:"ab781bbc-ccc6-418d-d32d-789b15da1f00",8453:"7289c336-3981-4081-c5f4-efc26ac64a00",0x4e454152:"3ff73439-a619-4894-9262-4470c773a100",2020:"b8101fc0-9c19-4b6f-ec65-f6dfff106e00",2021:"b8101fc0-9c19-4b6f-ec65-f6dfff106e00","5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp":"a1b58899-f671-4276-6a5e-56ca5bd59700","4uhcVJyU9pJkvQyS88uRDiswHXSCkY3z":"a1b58899-f671-4276-6a5e-56ca5bd59700",EtWTRABZaYq6iMfeYKouRu166VU2xqa1:"a1b58899-f671-4276-6a5e-56ca5bd59700"},ConnectorImageIds:{[r.COINBASE_CONNECTOR_ID]:"0c2840c3-5b04-4c44-9661-fbd4b49e1800",[r.COINBASE_SDK_CONNECTOR_ID]:"0c2840c3-5b04-4c44-9661-fbd4b49e1800",[r.SAFE_CONNECTOR_ID]:"461db637-8616-43ce-035a-d89b8a1d5800",[r.LEDGER_CONNECTOR_ID]:"54a1aa77-d202-4f8d-0fb2-5d2bb6db0300",[r.WALLET_CONNECT_CONNECTOR_ID]:"ef1a1fcf-7fe8-4d69-bd6d-fda1345b4400",[r.INJECTED_CONNECTOR_ID]:"07ba87ed-43aa-4adf-4540-9e6a2b9cae00"},ConnectorNamesMap:{[r.INJECTED_CONNECTOR_ID]:"Browser Wallet",[r.WALLET_CONNECT_CONNECTOR_ID]:"WalletConnect",[r.COINBASE_CONNECTOR_ID]:"Coinbase",[r.COINBASE_SDK_CONNECTOR_ID]:"Coinbase",[r.LEDGER_CONNECTOR_ID]:"Ledger",[r.SAFE_CONNECTOR_ID]:"Safe"},ConnectorTypesMap:{[r.INJECTED_CONNECTOR_ID]:"INJECTED",[r.WALLET_CONNECT_CONNECTOR_ID]:"WALLET_CONNECT",[r.EIP6963_CONNECTOR_ID]:"ANNOUNCED",[r.AUTH_CONNECTOR_ID]:"AUTH"},WalletConnectRpcChainIds:[1,5,0xaa36a7,10,420,42161,421613,137,80001,42220,0x4e454152,0x4e454153,56,97,43114,43113,100,8453,84531,7777777,999,324,280]},a={UniversalProviderErrors:{UNAUTHORIZED_DOMAIN_NOT_ALLOWED:{message:"Unauthorized: origin not allowed",alertErrorKey:"INVALID_APP_CONFIGURATION"},JWT_VALIDATION_ERROR:{message:"JWT validation error: JWT Token is not yet valid",alertErrorKey:"JWT_TOKEN_NOT_VALID"}},ALERT_ERRORS:{SWITCH_NETWORK_NOT_FOUND:{shortMessage:"Network Not Found",longMessage:"Network not found - please make sure it is included in 'networks' array in createAppKit function"},INVALID_APP_CONFIGURATION:{shortMessage:"Invalid App Configuration",longMessage:()=>`Origin ${"undefined"!=typeof window?window.origin:"unknown"} not found on Allowlist - update configuration on cloud.reown.com`},SOCIALS_TIMEOUT:{shortMessage:"Invalid App Configuration",longMessage:()=>"There was an issue loading the embedded wallet. Please verify that your domain is allowed at cloud.reown.com"},JWT_TOKEN_NOT_VALID:{shortMessage:"Session Expired",longMessage:"Invalid session found on UniversalProvider - please check your time settings and connect again"},PROJECT_ID_NOT_CONFIGURED:{shortMessage:"Project ID Not Configured",longMessage:"Project ID Not Configured - update configuration on cloud.reown.com"}}};i(52027);var o,s=i(50639),c=i(36280),l=i(33671);class u extends l.C{constructor(){super("No URL was provided to the Transport. Please provide a valid RPC URL to the Transport.",{docsPath:"/docs/clients/intro",name:"UrlRequiredError"})}}var d=i(9704),h=i(42220),p=i(6044);let f={current:0,take(){return this.current++},reset(){this.current=0}};var g=i(5512);function w(e,t={}){let{batch:i,fetchOptions:r,key:n="http",name:a="HTTP JSON-RPC",onFetchRequest:o,onFetchResponse:s,retryDelay:l}=t;return({chain:w,retryCount:m,timeout:b})=>{let{batchSize:v=1e3,wait:y=0}="object"==typeof i?i:{},x=t.retryCount??m,C=b??t.timeout??1e4,A=e||w?.rpcUrls.default.http[0];if(!A)throw new u;let E=function(e,t={}){return{async request(i){let{body:r,onRequest:n=t.onRequest,onResponse:a=t.onResponse,timeout:o=t.timeout??1e4}=i,s={...t.fetchOptions??{},...i.fetchOptions??{}},{headers:l,method:u,signal:d}=s;try{let t;let i=await (0,h.w)(async({signal:t})=>{let i={...s,body:Array.isArray(r)?(0,p.A)(r.map(e=>({jsonrpc:"2.0",id:e.id??f.take(),...e}))):(0,p.A)({jsonrpc:"2.0",id:r.id??f.take(),...r}),headers:{"Content-Type":"application/json",...l},method:u||"POST",signal:d||(o>0?t:null)},a=new Request(e,i),c=await n?.(a,i)??{...i,url:e};return await fetch(c.url??e,c)},{errorInstance:new c.MU({body:r,url:e}),timeout:o,signal:!0});if(a&&await a(i),i.headers.get("Content-Type")?.startsWith("application/json"))t=await i.json();else{t=await i.text();try{t=JSON.parse(t||"{}")}catch(e){if(i.ok)throw e;t={error:t}}}if(!i.ok)throw new c.Ci({body:r,details:(0,p.A)(t.error)||i.statusText,headers:i.headers,status:i.status,url:e});return t}catch(t){if(t instanceof c.Ci||t instanceof c.MU)throw t;throw new c.Ci({body:r,cause:t,url:e})}}}}(A,{fetchOptions:r,onRequest:o,onResponse:s,timeout:C});return(0,g.o)({key:n,name:a,async request({method:e,params:t}){let r={method:e,params:t},{schedule:n}=(0,d.u)({id:A,wait:y,shouldSplitBatch:e=>e.length>v,fn:e=>E.request({body:e}),sort:(e,t)=>e.id-t.id}),a=async e=>i?n(e):[await E.request({body:e})],[{error:o,result:s}]=await a(r);if(o)throw new c.J8({body:r,error:o,url:A});return s},retryCount:x,retryDelay:l,timeout:C,type:"http"},{fetchOptions:r,url:A})}}var m=i(61678),b=i(38102);let v=["near:mainnet","solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp","eip155:1101","eip155:56","eip155:42161","eip155:7777777","eip155:59144","eip155:324","solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1","eip155:5000","solana:4sgjmw1sunhzsxgspuhpqldx6wiyjntz","eip155:80084","eip155:5003","eip155:100","eip155:8453","eip155:42220","eip155:1313161555","eip155:17000","eip155:1","eip155:300","eip155:1313161554","eip155:1329","eip155:84532","eip155:421614","eip155:11155111","eip155:8217","eip155:43114","solana:4uhcVJyU9pJkvQyS88uRDiswHXSCkY3z","eip155:999999999","eip155:11155420","eip155:80002","eip155:97","eip155:43113","eip155:137","eip155:10","eip155:1301"],y={extendRpcUrlWithProjectId(e,t){let i=!1;try{i="rpc.walletconnect.org"===new URL(e).host}catch(e){i=!1}if(i){let i=new URL(e);return i.searchParams.has("projectId")||i.searchParams.set("projectId",t),i.toString()}return e},isCaipNetwork:e=>"chainNamespace"in e&&"caipNetworkId"in e,getChainNamespace(e){return this.isCaipNetwork(e)?e.chainNamespace:s.oU.CHAIN.EVM},getCaipNetworkId(e){return this.isCaipNetwork(e)?e.caipNetworkId:`${s.oU.CHAIN.EVM}:${e.id}`},getRpcUrl(e,t,i){let r=e.rpcUrls?.default?.http?.[0];return v.includes(t)?function(e,t){let i=new URL("https://rpc.walletconnect.org/v1/");return i.searchParams.set("chainId",e),i.searchParams.set("projectId",t),i.toString()}(t,i):r||""},extendCaipNetwork(e,{customNetworkImageUrls:t,projectId:i}){let r=this.getCaipNetworkId(e),a=this.getChainNamespace(e),o=this.getRpcUrl(e,r,i);return{...e,chainNamespace:a,caipNetworkId:r,assets:{imageId:n.NetworkImageIds[e.id],imageUrl:t?.[e.id]},rpcUrls:{...e.rpcUrls,default:{http:[o]}}}},extendCaipNetworks:(e,{customNetworkImageUrls:t,projectId:i})=>e.map(e=>y.extendCaipNetwork(e,{customNetworkImageUrls:t,projectId:i})),getViemTransport(e){let t=e.rpcUrls.default.http?.[0];return v.includes(e.caipNetworkId)?function(e,t={}){let{key:i="fallback",name:r="Fallback",rank:n=!1,retryCount:a,retryDelay:o}=t;return({chain:t,pollingInterval:s=4e3,timeout:c,...l})=>{let u=e,d=()=>{},h=(0,g.o)({key:i,name:r,async request({method:e,params:i}){let r=async(n=0)=>{let a=u[n]({...l,chain:t,retryCount:0,timeout:c});try{let t=await a.request({method:e,params:i});return d({method:e,params:i,response:t,transport:a,status:"success"}),t}catch(t){if(d({error:t,method:e,params:i,transport:a,status:"error"}),"code"in t&&"number"==typeof t.code&&(t.code===m.YW.code||t.code===m.vx.code||5e3===t.code)||n===u.length-1)throw t;return r(n+1)}};return r()},retryCount:a,retryDelay:o,type:"fallback"},{onResponse:e=>d=e,transports:u.map(e=>e({chain:t,retryCount:0}))});if(n){let e="object"==typeof n?n:{};!function({chain:e,interval:t=4e3,onTransports:i,ping:r,sampleCount:n=10,timeout:a=1e3,transports:o,weights:s={}}){let{stability:c=.7,latency:l=.3}=s,u=[],d=async()=>{let s=await Promise.all(o.map(async t=>{let i,n;let o=t({chain:e,retryCount:0,timeout:a}),s=Date.now();try{await (r?r({transport:o}):o.request({method:"net_listening"})),n=1}catch{n=0}finally{i=Date.now()}return{latency:i-s,success:n}}));u.push(s),u.length>n&&u.shift();let h=Math.max(...u.map(e=>Math.max(...e.map(({latency:e})=>e))));i(o.map((e,t)=>{let i=u.map(e=>e[t].latency),r=i.reduce((e,t)=>e+t,0)/i.length,n=u.map(e=>e[t].success),a=n.reduce((e,t)=>e+t,0)/n.length;return 0===a?[0,t]:[l*(1-r/h)+c*a,t]}).sort((e,t)=>t[0]-e[0]).map(([,e])=>o[e])),await (0,b.u)(t),d()};d()}({chain:t,interval:e.interval??s,onTransports:e=>u=e,ping:e.ping,sampleCount:e.sampleCount,timeout:e.timeout,transports:u,weights:e.weights})}return h}}([w(t,{fetchOptions:{headers:{"Content-Type":"text/plain"}}}),w(t)]):w(t)}};!function(e){e.Google="google",e.Github="github",e.Apple="apple",e.Facebook="facebook",e.X="x",e.Discord="discord",e.Farcaster="farcaster"}(o||(o={}))},45011:(e,t,i)=>{"use strict";let r;i.d(t,{QH:()=>iv,YW:()=>iT,Vl:()=>p}),i(15899);var n,a,o,s,c=i(18596);let l=c.env.NEXT_PUBLIC_SECURE_SITE_SDK_URL||"https://secure.walletconnect.org/sdk",u=c.env.NEXT_PUBLIC_DEFAULT_LOG_LEVEL||"error",d=c.env.NEXT_PUBLIC_SECURE_SITE_SDK_VERSION||2,h={APP_EVENT_KEY:"@w3m-app/",FRAME_EVENT_KEY:"@w3m-frame/",RPC_METHOD_KEY:"RPC_",STORAGE_KEY:"@appkit-wallet/",SESSION_TOKEN_KEY:"SESSION_TOKEN_KEY",EMAIL_LOGIN_USED_KEY:"EMAIL_LOGIN_USED_KEY",LAST_USED_CHAIN_KEY:"LAST_USED_CHAIN_KEY",LAST_EMAIL_LOGIN_TIME:"LAST_EMAIL_LOGIN_TIME",EMAIL:"EMAIL",PREFERRED_ACCOUNT_TYPE:"PREFERRED_ACCOUNT_TYPE",SMART_ACCOUNT_ENABLED:"SMART_ACCOUNT_ENABLED",SMART_ACCOUNT_ENABLED_NETWORKS:"SMART_ACCOUNT_ENABLED_NETWORKS",SOCIAL_USERNAME:"SOCIAL_USERNAME",APP_SWITCH_NETWORK:"@w3m-app/SWITCH_NETWORK",APP_CONNECT_EMAIL:"@w3m-app/CONNECT_EMAIL",APP_CONNECT_DEVICE:"@w3m-app/CONNECT_DEVICE",APP_CONNECT_OTP:"@w3m-app/CONNECT_OTP",APP_CONNECT_SOCIAL:"@w3m-app/CONNECT_SOCIAL",APP_GET_SOCIAL_REDIRECT_URI:"@w3m-app/GET_SOCIAL_REDIRECT_URI",APP_GET_USER:"@w3m-app/GET_USER",APP_SIGN_OUT:"@w3m-app/SIGN_OUT",APP_IS_CONNECTED:"@w3m-app/IS_CONNECTED",APP_GET_CHAIN_ID:"@w3m-app/GET_CHAIN_ID",APP_RPC_REQUEST:"@w3m-app/RPC_REQUEST",APP_UPDATE_EMAIL:"@w3m-app/UPDATE_EMAIL",APP_UPDATE_EMAIL_PRIMARY_OTP:"@w3m-app/UPDATE_EMAIL_PRIMARY_OTP",APP_UPDATE_EMAIL_SECONDARY_OTP:"@w3m-app/UPDATE_EMAIL_SECONDARY_OTP",APP_AWAIT_UPDATE_EMAIL:"@w3m-app/AWAIT_UPDATE_EMAIL",APP_SYNC_THEME:"@w3m-app/SYNC_THEME",APP_SYNC_DAPP_DATA:"@w3m-app/SYNC_DAPP_DATA",APP_GET_SMART_ACCOUNT_ENABLED_NETWORKS:"@w3m-app/GET_SMART_ACCOUNT_ENABLED_NETWORKS",APP_INIT_SMART_ACCOUNT:"@w3m-app/INIT_SMART_ACCOUNT",APP_SET_PREFERRED_ACCOUNT:"@w3m-app/SET_PREFERRED_ACCOUNT",APP_CONNECT_FARCASTER:"@w3m-app/CONNECT_FARCASTER",APP_GET_FARCASTER_URI:"@w3m-app/GET_FARCASTER_URI",FRAME_SWITCH_NETWORK_ERROR:"@w3m-frame/SWITCH_NETWORK_ERROR",FRAME_SWITCH_NETWORK_SUCCESS:"@w3m-frame/SWITCH_NETWORK_SUCCESS",FRAME_CONNECT_EMAIL_ERROR:"@w3m-frame/CONNECT_EMAIL_ERROR",FRAME_CONNECT_EMAIL_SUCCESS:"@w3m-frame/CONNECT_EMAIL_SUCCESS",FRAME_CONNECT_DEVICE_ERROR:"@w3m-frame/CONNECT_DEVICE_ERROR",FRAME_CONNECT_DEVICE_SUCCESS:"@w3m-frame/CONNECT_DEVICE_SUCCESS",FRAME_CONNECT_OTP_SUCCESS:"@w3m-frame/CONNECT_OTP_SUCCESS",FRAME_CONNECT_OTP_ERROR:"@w3m-frame/CONNECT_OTP_ERROR",FRAME_CONNECT_SOCIAL_SUCCESS:"@w3m-frame/CONNECT_SOCIAL_SUCCESS",FRAME_CONNECT_SOCIAL_ERROR:"@w3m-frame/CONNECT_SOCIAL_ERROR",FRAME_CONNECT_FARCASTER_SUCCESS:"@w3m-frame/CONNECT_FARCASTER_SUCCESS",FRAME_CONNECT_FARCASTER_ERROR:"@w3m-frame/CONNECT_FARCASTER_ERROR",FRAME_GET_FARCASTER_URI_SUCCESS:"@w3m-frame/GET_FARCASTER_URI_SUCCESS",FRAME_GET_FARCASTER_URI_ERROR:"@w3m-frame/GET_FARCASTER_URI_ERROR",FRAME_GET_SOCIAL_REDIRECT_URI_SUCCESS:"@w3m-frame/GET_SOCIAL_REDIRECT_URI_SUCCESS",FRAME_GET_SOCIAL_REDIRECT_URI_ERROR:"@w3m-frame/GET_SOCIAL_REDIRECT_URI_ERROR",FRAME_GET_USER_SUCCESS:"@w3m-frame/GET_USER_SUCCESS",FRAME_GET_USER_ERROR:"@w3m-frame/GET_USER_ERROR",FRAME_SIGN_OUT_SUCCESS:"@w3m-frame/SIGN_OUT_SUCCESS",FRAME_SIGN_OUT_ERROR:"@w3m-frame/SIGN_OUT_ERROR",FRAME_IS_CONNECTED_SUCCESS:"@w3m-frame/IS_CONNECTED_SUCCESS",FRAME_IS_CONNECTED_ERROR:"@w3m-frame/IS_CONNECTED_ERROR",FRAME_GET_CHAIN_ID_SUCCESS:"@w3m-frame/GET_CHAIN_ID_SUCCESS",FRAME_GET_CHAIN_ID_ERROR:"@w3m-frame/GET_CHAIN_ID_ERROR",FRAME_RPC_REQUEST_SUCCESS:"@w3m-frame/RPC_REQUEST_SUCCESS",FRAME_RPC_REQUEST_ERROR:"@w3m-frame/RPC_REQUEST_ERROR",FRAME_SESSION_UPDATE:"@w3m-frame/SESSION_UPDATE",FRAME_UPDATE_EMAIL_SUCCESS:"@w3m-frame/UPDATE_EMAIL_SUCCESS",FRAME_UPDATE_EMAIL_ERROR:"@w3m-frame/UPDATE_EMAIL_ERROR",FRAME_UPDATE_EMAIL_PRIMARY_OTP_SUCCESS:"@w3m-frame/UPDATE_EMAIL_PRIMARY_OTP_SUCCESS",FRAME_UPDATE_EMAIL_PRIMARY_OTP_ERROR:"@w3m-frame/UPDATE_EMAIL_PRIMARY_OTP_ERROR",FRAME_UPDATE_EMAIL_SECONDARY_OTP_SUCCESS:"@w3m-frame/UPDATE_EMAIL_SECONDARY_OTP_SUCCESS",FRAME_UPDATE_EMAIL_SECONDARY_OTP_ERROR:"@w3m-frame/UPDATE_EMAIL_SECONDARY_OTP_ERROR",FRAME_SYNC_THEME_SUCCESS:"@w3m-frame/SYNC_THEME_SUCCESS",FRAME_SYNC_THEME_ERROR:"@w3m-frame/SYNC_THEME_ERROR",FRAME_SYNC_DAPP_DATA_SUCCESS:"@w3m-frame/SYNC_DAPP_DATA_SUCCESS",FRAME_SYNC_DAPP_DATA_ERROR:"@w3m-frame/SYNC_DAPP_DATA_ERROR",FRAME_GET_SMART_ACCOUNT_ENABLED_NETWORKS_SUCCESS:"@w3m-frame/GET_SMART_ACCOUNT_ENABLED_NETWORKS_SUCCESS",FRAME_GET_SMART_ACCOUNT_ENABLED_NETWORKS_ERROR:"@w3m-frame/GET_SMART_ACCOUNT_ENABLED_NETWORKS_ERROR",FRAME_INIT_SMART_ACCOUNT_SUCCESS:"@w3m-frame/INIT_SMART_ACCOUNT_SUCCESS",FRAME_INIT_SMART_ACCOUNT_ERROR:"@w3m-frame/INIT_SMART_ACCOUNT_ERROR",FRAME_SET_PREFERRED_ACCOUNT_SUCCESS:"@w3m-frame/SET_PREFERRED_ACCOUNT_SUCCESS",FRAME_SET_PREFERRED_ACCOUNT_ERROR:"@w3m-frame/SET_PREFERRED_ACCOUNT_ERROR",FRAME_READY:"@w3m-frame/READY",RPC_RESPONSE_TYPE_ERROR:"RPC_RESPONSE_ERROR",RPC_RESPONSE_TYPE_TX:"RPC_RESPONSE_TRANSACTION_HASH",RPC_RESPONSE_TYPE_OBJECT:"RPC_RESPONSE_OBJECT"},p={SAFE_RPC_METHODS:["eth_accounts","eth_blockNumber","eth_call","eth_chainId","eth_estimateGas","eth_feeHistory","eth_gasPrice","eth_getAccount","eth_getBalance","eth_getBlockByHash","eth_getBlockByNumber","eth_getBlockReceipts","eth_getBlockTransactionCountByHash","eth_getBlockTransactionCountByNumber","eth_getCode","eth_getFilterChanges","eth_getFilterLogs","eth_getLogs","eth_getProof","eth_getStorageAt","eth_getTransactionByBlockHashAndIndex","eth_getTransactionByBlockNumberAndIndex","eth_getTransactionByHash","eth_getTransactionCount","eth_getTransactionReceipt","eth_getUncleCountByBlockHash","eth_getUncleCountByBlockNumber","eth_maxPriorityFeePerGas","eth_newBlockFilter","eth_newFilter","eth_newPendingTransactionFilter","eth_sendRawTransaction","eth_syncing","eth_uninstallFilter","wallet_getCapabilities","wallet_getCallsStatus","eth_getUserOperationReceipt","eth_estimateUserOperationGas","eth_getUserOperationByHash","eth_supportedEntryPoints"],NOT_SAFE_RPC_METHODS:["personal_sign","eth_signTypedData_v4","eth_sendTransaction","solana_signMessage","solana_signTransaction","solana_signAllTransactions","solana_signAndSendTransaction","wallet_sendCalls","wallet_grantPermissions","wallet_revokePermissions","eth_sendUserOperation"],GET_CHAIN_ID:"eth_chainId",RPC_METHOD_NOT_ALLOWED_MESSAGE:"Requested RPC call is not allowed",RPC_METHOD_NOT_ALLOWED_UI_MESSAGE:"Action not allowed",ACCOUNT_TYPES:{EOA:"eoa",SMART_ACCOUNT:"smartAccount"}};!function(e){e.assertEqual=e=>e,e.assertIs=function(e){},e.assertNever=function(e){throw Error()},e.arrayToEnum=e=>{let t={};for(let i of e)t[i]=i;return t},e.getValidEnumValues=t=>{let i=e.objectKeys(t).filter(e=>"number"!=typeof t[t[e]]),r={};for(let e of i)r[e]=t[e];return e.objectValues(r)},e.objectValues=t=>e.objectKeys(t).map(function(e){return t[e]}),e.objectKeys="function"==typeof Object.keys?e=>Object.keys(e):e=>{let t=[];for(let i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.push(i);return t},e.find=(e,t)=>{for(let i of e)if(t(i))return i},e.isInteger="function"==typeof Number.isInteger?e=>Number.isInteger(e):e=>"number"==typeof e&&isFinite(e)&&Math.floor(e)===e,e.joinValues=function(e,t=" | "){return e.map(e=>"string"==typeof e?`'${e}'`:e).join(t)},e.jsonStringifyReplacer=(e,t)=>"bigint"==typeof t?t.toString():t}(n||(n={})),(a||(a={})).mergeShapes=(e,t)=>({...e,...t});let f=n.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),g=e=>{switch(typeof e){case"undefined":return f.undefined;case"string":return f.string;case"number":return isNaN(e)?f.nan:f.number;case"boolean":return f.boolean;case"function":return f.function;case"bigint":return f.bigint;case"symbol":return f.symbol;case"object":if(Array.isArray(e))return f.array;if(null===e)return f.null;if(e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch)return f.promise;if("undefined"!=typeof Map&&e instanceof Map)return f.map;if("undefined"!=typeof Set&&e instanceof Set)return f.set;if("undefined"!=typeof Date&&e instanceof Date)return f.date;return f.object;default:return f.unknown}},w=n.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class m extends Error{constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};let t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){let t=e||function(e){return e.message},i={_errors:[]},r=e=>{for(let n of e.issues)if("invalid_union"===n.code)n.unionErrors.map(r);else if("invalid_return_type"===n.code)r(n.returnTypeError);else if("invalid_arguments"===n.code)r(n.argumentsError);else if(0===n.path.length)i._errors.push(t(n));else{let e=i,r=0;for(;re.message){let t={},i=[];for(let r of this.issues)r.path.length>0?(t[r.path[0]]=t[r.path[0]]||[],t[r.path[0]].push(e(r))):i.push(e(r));return{formErrors:i,fieldErrors:t}}get formErrors(){return this.flatten()}}m.create=e=>new m(e);let b=(e,t)=>{let i;switch(e.code){case w.invalid_type:i=e.received===f.undefined?"Required":`Expected ${e.expected}, received ${e.received}`;break;case w.invalid_literal:i=`Invalid literal value, expected ${JSON.stringify(e.expected,n.jsonStringifyReplacer)}`;break;case w.unrecognized_keys:i=`Unrecognized key(s) in object: ${n.joinValues(e.keys,", ")}`;break;case w.invalid_union:i="Invalid input";break;case w.invalid_union_discriminator:i=`Invalid discriminator value. Expected ${n.joinValues(e.options)}`;break;case w.invalid_enum_value:i=`Invalid enum value. Expected ${n.joinValues(e.options)}, received '${e.received}'`;break;case w.invalid_arguments:i="Invalid function arguments";break;case w.invalid_return_type:i="Invalid function return type";break;case w.invalid_date:i="Invalid date";break;case w.invalid_string:"object"==typeof e.validation?"includes"in e.validation?(i=`Invalid input: must include "${e.validation.includes}"`,"number"==typeof e.validation.position&&(i=`${i} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?i=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?i=`Invalid input: must end with "${e.validation.endsWith}"`:n.assertNever(e.validation):i="regex"!==e.validation?`Invalid ${e.validation}`:"Invalid";break;case w.too_small:i="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:"date"===e.type?`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:"Invalid input";break;case w.too_big:i="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"bigint"===e.type?`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"date"===e.type?`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:"Invalid input";break;case w.custom:i="Invalid input";break;case w.invalid_intersection_types:i="Intersection results could not be merged";break;case w.not_multiple_of:i=`Number must be a multiple of ${e.multipleOf}`;break;case w.not_finite:i="Number must be finite";break;default:i=t.defaultError,n.assertNever(e)}return{message:i}},v=b;function y(){return v}let x=e=>{let{data:t,path:i,errorMaps:r,issueData:n}=e,a=[...i,...n.path||[]],o={...n,path:a},s="";for(let e of r.filter(e=>!!e).slice().reverse())s=e(o,{data:t,defaultError:s}).message;return{...n,path:a,message:n.message||s}};function C(e,t){let i=x({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,y(),b].filter(e=>!!e)});e.common.issues.push(i)}class A{constructor(){this.value="valid"}dirty(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static mergeArray(e,t){let i=[];for(let r of t){if("aborted"===r.status)return E;"dirty"===r.status&&e.dirty(),i.push(r.value)}return{status:e.value,value:i}}static async mergeObjectAsync(e,t){let i=[];for(let e of t)i.push({key:await e.key,value:await e.value});return A.mergeObjectSync(e,i)}static mergeObjectSync(e,t){let i={};for(let r of t){let{key:t,value:n}=r;if("aborted"===t.status||"aborted"===n.status)return E;"dirty"===t.status&&e.dirty(),"dirty"===n.status&&e.dirty(),"__proto__"!==t.value&&(void 0!==n.value||r.alwaysSet)&&(i[t.value]=n.value)}return{status:e.value,value:i}}}let E=Object.freeze({status:"aborted"}),_=e=>({status:"dirty",value:e}),k=e=>({status:"valid",value:e}),I=e=>"aborted"===e.status,S=e=>"dirty"===e.status,T=e=>"valid"===e.status,N=e=>"undefined"!=typeof Promise&&e instanceof Promise;!function(e){e.errToObj=e=>"string"==typeof e?{message:e}:e||{},e.toString=e=>"string"==typeof e?e:null==e?void 0:e.message}(o||(o={}));class P{constructor(e,t,i,r){this._cachedPath=[],this.parent=e,this.data=t,this._path=i,this._key=r}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}let R=(e,t)=>{if(T(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let t=new m(e.common.issues);return this._error=t,this._error}}};function O(e){if(!e)return{};let{errorMap:t,invalid_type_error:i,required_error:r,description:n}=e;if(t&&(i||r))throw Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');return t?{errorMap:t,description:n}:{errorMap:(e,t)=>"invalid_type"!==e.code?{message:t.defaultError}:void 0===t.data?{message:null!=r?r:t.defaultError}:{message:null!=i?i:t.defaultError},description:n}}class M{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return g(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:g(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new A,ctx:{common:e.parent.common,data:e.data,parsedType:g(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(N(t))throw Error("Synchronous parse encountered promise.");return t}_parseAsync(e){return Promise.resolve(this._parse(e))}parse(e,t){let i=this.safeParse(e,t);if(i.success)return i.data;throw i.error}safeParse(e,t){var i;let r={common:{issues:[],async:null!==(i=null==t?void 0:t.async)&&void 0!==i&&i,contextualErrorMap:null==t?void 0:t.errorMap},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:g(e)},n=this._parseSync({data:e,path:r.path,parent:r});return R(r,n)}async parseAsync(e,t){let i=await this.safeParseAsync(e,t);if(i.success)return i.data;throw i.error}async safeParseAsync(e,t){let i={common:{issues:[],contextualErrorMap:null==t?void 0:t.errorMap,async:!0},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:g(e)},r=this._parse({data:e,path:i.path,parent:i});return R(i,await (N(r)?r:Promise.resolve(r)))}refine(e,t){let i=e=>"string"==typeof t||void 0===t?{message:t}:"function"==typeof t?t(e):t;return this._refinement((t,r)=>{let n=e(t),a=()=>r.addIssue({code:w.custom,...i(t)});return"undefined"!=typeof Promise&&n instanceof Promise?n.then(e=>!!e||(a(),!1)):!!n||(a(),!1)})}refinement(e,t){return this._refinement((i,r)=>!!e(i)||(r.addIssue("function"==typeof t?t(i,r):t),!1))}_refinement(e){return new eb({schema:this,typeName:s.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return ev.create(this,this._def)}nullable(){return ey.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return et.create(this,this._def)}promise(){return em.create(this,this._def)}or(e){return er.create([this,e],this._def)}and(e){return eo.create(this,e,this._def)}transform(e){return new eb({...O(this._def),schema:this,typeName:s.ZodEffects,effect:{type:"transform",transform:e}})}default(e){return new ex({...O(this._def),innerType:this,defaultValue:"function"==typeof e?e:()=>e,typeName:s.ZodDefault})}brand(){return new e_({typeName:s.ZodBranded,type:this,...O(this._def)})}catch(e){return new eC({...O(this._def),innerType:this,catchValue:"function"==typeof e?e:()=>e,typeName:s.ZodCatch})}describe(e){return new this.constructor({...this._def,description:e})}pipe(e){return ek.create(this,e)}readonly(){return eI.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}let D=/^c[^\s-]{8,}$/i,U=/^[a-z][a-z0-9]*$/,$=/^[0-9A-HJKMNP-TV-Z]{26}$/,L=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,j=/^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,B=/^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$/,W=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,q=e=>e.precision?e.offset?RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${e.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`):RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${e.precision}}Z$`):0===e.precision?e.offset?RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$"):RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"):e.offset?RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"):RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$");class H extends M{_parse(e){let t;if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==f.string){let t=this._getOrReturnCtx(e);return C(t,{code:w.invalid_type,expected:f.string,received:t.parsedType}),E}let i=new A;for(let s of this._def.checks)if("min"===s.kind)e.data.lengths.value&&(C(t=this._getOrReturnCtx(e,t),{code:w.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),i.dirty());else if("length"===s.kind){let r=e.data.length>s.value,n=e.data.lengthe.test(t),{validation:t,code:w.invalid_string,...o.errToObj(i)})}_addCheck(e){return new H({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...o.errToObj(e)})}url(e){return this._addCheck({kind:"url",...o.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...o.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...o.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...o.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...o.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...o.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...o.errToObj(e)})}datetime(e){var t;return"string"==typeof e?this._addCheck({kind:"datetime",precision:null,offset:!1,message:e}):this._addCheck({kind:"datetime",precision:void 0===(null==e?void 0:e.precision)?null:null==e?void 0:e.precision,offset:null!==(t=null==e?void 0:e.offset)&&void 0!==t&&t,...o.errToObj(null==e?void 0:e.message)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...o.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:null==t?void 0:t.position,...o.errToObj(null==t?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...o.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...o.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...o.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...o.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...o.errToObj(t)})}nonempty(e){return this.min(1,o.errToObj(e))}trim(){return new H({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new H({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new H({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>"datetime"===e.kind)}get isEmail(){return!!this._def.checks.find(e=>"email"===e.kind)}get isURL(){return!!this._def.checks.find(e=>"url"===e.kind)}get isEmoji(){return!!this._def.checks.find(e=>"emoji"===e.kind)}get isUUID(){return!!this._def.checks.find(e=>"uuid"===e.kind)}get isCUID(){return!!this._def.checks.find(e=>"cuid"===e.kind)}get isCUID2(){return!!this._def.checks.find(e=>"cuid2"===e.kind)}get isULID(){return!!this._def.checks.find(e=>"ulid"===e.kind)}get isIP(){return!!this._def.checks.find(e=>"ip"===e.kind)}get minLength(){let e=null;for(let t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(let t of this._def.checks)"max"===t.kind&&(null===e||t.value{var t;return new H({checks:[],typeName:s.ZodString,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...O(e)})};class z extends M{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){let t;if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==f.number){let t=this._getOrReturnCtx(e);return C(t,{code:w.invalid_type,expected:f.number,received:t.parsedType}),E}let i=new A;for(let r of this._def.checks)"int"===r.kind?n.isInteger(e.data)||(C(t=this._getOrReturnCtx(e,t),{code:w.invalid_type,expected:"integer",received:"float",message:r.message}),i.dirty()):"min"===r.kind?(r.inclusive?e.datar.value:e.data>=r.value)&&(C(t=this._getOrReturnCtx(e,t),{code:w.too_big,maximum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),i.dirty()):"multipleOf"===r.kind?0!==function(e,t){let i=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,n=i>r?i:r;return parseInt(e.toFixed(n).replace(".",""))%parseInt(t.toFixed(n).replace(".",""))/Math.pow(10,n)}(e.data,r.value)&&(C(t=this._getOrReturnCtx(e,t),{code:w.not_multiple_of,multipleOf:r.value,message:r.message}),i.dirty()):"finite"===r.kind?Number.isFinite(e.data)||(C(t=this._getOrReturnCtx(e,t),{code:w.not_finite,message:r.message}),i.dirty()):n.assertNever(r);return{status:i.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,o.toString(t))}gt(e,t){return this.setLimit("min",e,!1,o.toString(t))}lte(e,t){return this.setLimit("max",e,!0,o.toString(t))}lt(e,t){return this.setLimit("max",e,!1,o.toString(t))}setLimit(e,t,i,r){return new z({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:i,message:o.toString(r)}]})}_addCheck(e){return new z({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:o.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:o.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:o.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:o.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:o.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:o.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:o.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:o.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:o.toString(e)})}get minValue(){let e=null;for(let t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)"max"===t.kind&&(null===e||t.value"int"===e.kind||"multipleOf"===e.kind&&n.isInteger(e.value))}get isFinite(){let e=null,t=null;for(let i of this._def.checks){if("finite"===i.kind||"int"===i.kind||"multipleOf"===i.kind)return!0;"min"===i.kind?(null===t||i.value>t)&&(t=i.value):"max"===i.kind&&(null===e||i.valuenew z({checks:[],typeName:s.ZodNumber,coerce:(null==e?void 0:e.coerce)||!1,...O(e)});class F extends M{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){let t;if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==f.bigint){let t=this._getOrReturnCtx(e);return C(t,{code:w.invalid_type,expected:f.bigint,received:t.parsedType}),E}let i=new A;for(let r of this._def.checks)"min"===r.kind?(r.inclusive?e.datar.value:e.data>=r.value)&&(C(t=this._getOrReturnCtx(e,t),{code:w.too_big,type:"bigint",maximum:r.value,inclusive:r.inclusive,message:r.message}),i.dirty()):"multipleOf"===r.kind?e.data%r.value!==BigInt(0)&&(C(t=this._getOrReturnCtx(e,t),{code:w.not_multiple_of,multipleOf:r.value,message:r.message}),i.dirty()):n.assertNever(r);return{status:i.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,o.toString(t))}gt(e,t){return this.setLimit("min",e,!1,o.toString(t))}lte(e,t){return this.setLimit("max",e,!0,o.toString(t))}lt(e,t){return this.setLimit("max",e,!1,o.toString(t))}setLimit(e,t,i,r){return new F({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:i,message:o.toString(r)}]})}_addCheck(e){return new F({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:o.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:o.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:o.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:o.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:o.toString(t)})}get minValue(){let e=null;for(let t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)"max"===t.kind&&(null===e||t.value{var t;return new F({checks:[],typeName:s.ZodBigInt,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...O(e)})};class Z extends M{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==f.boolean){let t=this._getOrReturnCtx(e);return C(t,{code:w.invalid_type,expected:f.boolean,received:t.parsedType}),E}return k(e.data)}}Z.create=e=>new Z({typeName:s.ZodBoolean,coerce:(null==e?void 0:e.coerce)||!1,...O(e)});class V extends M{_parse(e){let t;if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==f.date){let t=this._getOrReturnCtx(e);return C(t,{code:w.invalid_type,expected:f.date,received:t.parsedType}),E}if(isNaN(e.data.getTime()))return C(this._getOrReturnCtx(e),{code:w.invalid_date}),E;let i=new A;for(let r of this._def.checks)"min"===r.kind?e.data.getTime()r.value&&(C(t=this._getOrReturnCtx(e,t),{code:w.too_big,message:r.message,inclusive:!0,exact:!1,maximum:r.value,type:"date"}),i.dirty()):n.assertNever(r);return{status:i.value,value:new Date(e.data.getTime())}}_addCheck(e){return new V({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:o.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:o.toString(t)})}get minDate(){let e=null;for(let t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return null!=e?new Date(e):null}get maxDate(){let e=null;for(let t of this._def.checks)"max"===t.kind&&(null===e||t.valuenew V({checks:[],coerce:(null==e?void 0:e.coerce)||!1,typeName:s.ZodDate,...O(e)});class K extends M{_parse(e){if(this._getType(e)!==f.symbol){let t=this._getOrReturnCtx(e);return C(t,{code:w.invalid_type,expected:f.symbol,received:t.parsedType}),E}return k(e.data)}}K.create=e=>new K({typeName:s.ZodSymbol,...O(e)});class G extends M{_parse(e){if(this._getType(e)!==f.undefined){let t=this._getOrReturnCtx(e);return C(t,{code:w.invalid_type,expected:f.undefined,received:t.parsedType}),E}return k(e.data)}}G.create=e=>new G({typeName:s.ZodUndefined,...O(e)});class J extends M{_parse(e){if(this._getType(e)!==f.null){let t=this._getOrReturnCtx(e);return C(t,{code:w.invalid_type,expected:f.null,received:t.parsedType}),E}return k(e.data)}}J.create=e=>new J({typeName:s.ZodNull,...O(e)});class Y extends M{constructor(){super(...arguments),this._any=!0}_parse(e){return k(e.data)}}Y.create=e=>new Y({typeName:s.ZodAny,...O(e)});class Q extends M{constructor(){super(...arguments),this._unknown=!0}_parse(e){return k(e.data)}}Q.create=e=>new Q({typeName:s.ZodUnknown,...O(e)});class X extends M{_parse(e){let t=this._getOrReturnCtx(e);return C(t,{code:w.invalid_type,expected:f.never,received:t.parsedType}),E}}X.create=e=>new X({typeName:s.ZodNever,...O(e)});class ee extends M{_parse(e){if(this._getType(e)!==f.undefined){let t=this._getOrReturnCtx(e);return C(t,{code:w.invalid_type,expected:f.void,received:t.parsedType}),E}return k(e.data)}}ee.create=e=>new ee({typeName:s.ZodVoid,...O(e)});class et extends M{_parse(e){let{ctx:t,status:i}=this._processInputParams(e),r=this._def;if(t.parsedType!==f.array)return C(t,{code:w.invalid_type,expected:f.array,received:t.parsedType}),E;if(null!==r.exactLength){let e=t.data.length>r.exactLength.value,n=t.data.lengthr.maxLength.value&&(C(t,{code:w.too_big,maximum:r.maxLength.value,type:"array",inclusive:!0,exact:!1,message:r.maxLength.message}),i.dirty()),t.common.async)return Promise.all([...t.data].map((e,i)=>r.type._parseAsync(new P(t,e,t.path,i)))).then(e=>A.mergeArray(i,e));let n=[...t.data].map((e,i)=>r.type._parseSync(new P(t,e,t.path,i)));return A.mergeArray(i,n)}get element(){return this._def.type}min(e,t){return new et({...this._def,minLength:{value:e,message:o.toString(t)}})}max(e,t){return new et({...this._def,maxLength:{value:e,message:o.toString(t)}})}length(e,t){return new et({...this._def,exactLength:{value:e,message:o.toString(t)}})}nonempty(e){return this.min(1,e)}}et.create=(e,t)=>new et({type:e,minLength:null,maxLength:null,exactLength:null,typeName:s.ZodArray,...O(t)});class ei extends M{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(null!==this._cached)return this._cached;let e=this._def.shape(),t=n.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==f.object){let t=this._getOrReturnCtx(e);return C(t,{code:w.invalid_type,expected:f.object,received:t.parsedType}),E}let{status:t,ctx:i}=this._processInputParams(e),{shape:r,keys:n}=this._getCached(),a=[];if(!(this._def.catchall instanceof X&&"strip"===this._def.unknownKeys))for(let e in i.data)n.includes(e)||a.push(e);let o=[];for(let e of n){let t=r[e],n=i.data[e];o.push({key:{status:"valid",value:e},value:t._parse(new P(i,n,i.path,e)),alwaysSet:e in i.data})}if(this._def.catchall instanceof X){let e=this._def.unknownKeys;if("passthrough"===e)for(let e of a)o.push({key:{status:"valid",value:e},value:{status:"valid",value:i.data[e]}});else if("strict"===e)a.length>0&&(C(i,{code:w.unrecognized_keys,keys:a}),t.dirty());else if("strip"===e);else throw Error("Internal ZodObject error: invalid unknownKeys value.")}else{let e=this._def.catchall;for(let t of a){let r=i.data[t];o.push({key:{status:"valid",value:t},value:e._parse(new P(i,r,i.path,t)),alwaysSet:t in i.data})}}return i.common.async?Promise.resolve().then(async()=>{let e=[];for(let t of o){let i=await t.key;e.push({key:i,value:await t.value,alwaysSet:t.alwaysSet})}return e}).then(e=>A.mergeObjectSync(t,e)):A.mergeObjectSync(t,o)}get shape(){return this._def.shape()}strict(e){return o.errToObj,new ei({...this._def,unknownKeys:"strict",...void 0!==e?{errorMap:(t,i)=>{var r,n,a,s;let c=null!==(a=null===(n=(r=this._def).errorMap)||void 0===n?void 0:n.call(r,t,i).message)&&void 0!==a?a:i.defaultError;return"unrecognized_keys"===t.code?{message:null!==(s=o.errToObj(e).message)&&void 0!==s?s:c}:{message:c}}}:{}})}strip(){return new ei({...this._def,unknownKeys:"strip"})}passthrough(){return new ei({...this._def,unknownKeys:"passthrough"})}extend(e){return new ei({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new ei({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:s.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new ei({...this._def,catchall:e})}pick(e){let t={};return n.objectKeys(e).forEach(i=>{e[i]&&this.shape[i]&&(t[i]=this.shape[i])}),new ei({...this._def,shape:()=>t})}omit(e){let t={};return n.objectKeys(this.shape).forEach(i=>{e[i]||(t[i]=this.shape[i])}),new ei({...this._def,shape:()=>t})}deepPartial(){return function e(t){if(t instanceof ei){let i={};for(let r in t.shape){let n=t.shape[r];i[r]=ev.create(e(n))}return new ei({...t._def,shape:()=>i})}return t instanceof et?new et({...t._def,type:e(t.element)}):t instanceof ev?ev.create(e(t.unwrap())):t instanceof ey?ey.create(e(t.unwrap())):t instanceof es?es.create(t.items.map(t=>e(t))):t}(this)}partial(e){let t={};return n.objectKeys(this.shape).forEach(i=>{let r=this.shape[i];e&&!e[i]?t[i]=r:t[i]=r.optional()}),new ei({...this._def,shape:()=>t})}required(e){let t={};return n.objectKeys(this.shape).forEach(i=>{if(e&&!e[i])t[i]=this.shape[i];else{let e=this.shape[i];for(;e instanceof ev;)e=e._def.innerType;t[i]=e}}),new ei({...this._def,shape:()=>t})}keyof(){return ef(n.objectKeys(this.shape))}}ei.create=(e,t)=>new ei({shape:()=>e,unknownKeys:"strip",catchall:X.create(),typeName:s.ZodObject,...O(t)}),ei.strictCreate=(e,t)=>new ei({shape:()=>e,unknownKeys:"strict",catchall:X.create(),typeName:s.ZodObject,...O(t)}),ei.lazycreate=(e,t)=>new ei({shape:e,unknownKeys:"strip",catchall:X.create(),typeName:s.ZodObject,...O(t)});class er extends M{_parse(e){let{ctx:t}=this._processInputParams(e),i=this._def.options;if(t.common.async)return Promise.all(i.map(async e=>{let i={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:i}),ctx:i}})).then(function(e){for(let t of e)if("valid"===t.result.status)return t.result;for(let i of e)if("dirty"===i.result.status)return t.common.issues.push(...i.ctx.common.issues),i.result;let i=e.map(e=>new m(e.ctx.common.issues));return C(t,{code:w.invalid_union,unionErrors:i}),E});{let e;let r=[];for(let n of i){let i={...t,common:{...t.common,issues:[]},parent:null},a=n._parseSync({data:t.data,path:t.path,parent:i});if("valid"===a.status)return a;"dirty"!==a.status||e||(e={result:a,ctx:i}),i.common.issues.length&&r.push(i.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;let n=r.map(e=>new m(e));return C(t,{code:w.invalid_union,unionErrors:n}),E}}get options(){return this._def.options}}er.create=(e,t)=>new er({options:e,typeName:s.ZodUnion,...O(t)});let en=e=>{if(e instanceof eh)return en(e.schema);if(e instanceof eb)return en(e.innerType());if(e instanceof ep)return[e.value];if(e instanceof eg)return e.options;if(e instanceof ew)return Object.keys(e.enum);if(e instanceof ex)return en(e._def.innerType);if(e instanceof G)return[void 0];else if(e instanceof J)return[null];else return null};class ea extends M{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==f.object)return C(t,{code:w.invalid_type,expected:f.object,received:t.parsedType}),E;let i=this.discriminator,r=t.data[i],n=this.optionsMap.get(r);return n?t.common.async?n._parseAsync({data:t.data,path:t.path,parent:t}):n._parseSync({data:t.data,path:t.path,parent:t}):(C(t,{code:w.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[i]}),E)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,i){let r=new Map;for(let i of t){let t=en(i.shape[e]);if(!t)throw Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let n of t){if(r.has(n))throw Error(`Discriminator property ${String(e)} has duplicate value ${String(n)}`);r.set(n,i)}}return new ea({typeName:s.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:r,...O(i)})}}class eo extends M{_parse(e){let{status:t,ctx:i}=this._processInputParams(e),r=(e,r)=>{if(I(e)||I(r))return E;let a=function e(t,i){let r=g(t),a=g(i);if(t===i)return{valid:!0,data:t};if(r===f.object&&a===f.object){let r=n.objectKeys(i),a=n.objectKeys(t).filter(e=>-1!==r.indexOf(e)),o={...t,...i};for(let r of a){let n=e(t[r],i[r]);if(!n.valid)return{valid:!1};o[r]=n.data}return{valid:!0,data:o}}if(r===f.array&&a===f.array){if(t.length!==i.length)return{valid:!1};let r=[];for(let n=0;nr(e,t)):r(this._def.left._parseSync({data:i.data,path:i.path,parent:i}),this._def.right._parseSync({data:i.data,path:i.path,parent:i}))}}eo.create=(e,t,i)=>new eo({left:e,right:t,typeName:s.ZodIntersection,...O(i)});class es extends M{_parse(e){let{status:t,ctx:i}=this._processInputParams(e);if(i.parsedType!==f.array)return C(i,{code:w.invalid_type,expected:f.array,received:i.parsedType}),E;if(i.data.lengththis._def.items.length&&(C(i,{code:w.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());let r=[...i.data].map((e,t)=>{let r=this._def.items[t]||this._def.rest;return r?r._parse(new P(i,e,i.path,t)):null}).filter(e=>!!e);return i.common.async?Promise.all(r).then(e=>A.mergeArray(t,e)):A.mergeArray(t,r)}get items(){return this._def.items}rest(e){return new es({...this._def,rest:e})}}es.create=(e,t)=>{if(!Array.isArray(e))throw Error("You must pass an array of schemas to z.tuple([ ... ])");return new es({items:e,typeName:s.ZodTuple,rest:null,...O(t)})};class ec extends M{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:i}=this._processInputParams(e);if(i.parsedType!==f.object)return C(i,{code:w.invalid_type,expected:f.object,received:i.parsedType}),E;let r=[],n=this._def.keyType,a=this._def.valueType;for(let e in i.data)r.push({key:n._parse(new P(i,e,i.path,e)),value:a._parse(new P(i,i.data[e],i.path,e))});return i.common.async?A.mergeObjectAsync(t,r):A.mergeObjectSync(t,r)}get element(){return this._def.valueType}static create(e,t,i){return new ec(t instanceof M?{keyType:e,valueType:t,typeName:s.ZodRecord,...O(i)}:{keyType:H.create(),valueType:e,typeName:s.ZodRecord,...O(t)})}}class el extends M{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:i}=this._processInputParams(e);if(i.parsedType!==f.map)return C(i,{code:w.invalid_type,expected:f.map,received:i.parsedType}),E;let r=this._def.keyType,n=this._def.valueType,a=[...i.data.entries()].map(([e,t],a)=>({key:r._parse(new P(i,e,i.path,[a,"key"])),value:n._parse(new P(i,t,i.path,[a,"value"]))}));if(i.common.async){let e=new Map;return Promise.resolve().then(async()=>{for(let i of a){let r=await i.key,n=await i.value;if("aborted"===r.status||"aborted"===n.status)return E;("dirty"===r.status||"dirty"===n.status)&&t.dirty(),e.set(r.value,n.value)}return{status:t.value,value:e}})}{let e=new Map;for(let i of a){let r=i.key,n=i.value;if("aborted"===r.status||"aborted"===n.status)return E;("dirty"===r.status||"dirty"===n.status)&&t.dirty(),e.set(r.value,n.value)}return{status:t.value,value:e}}}}el.create=(e,t,i)=>new el({valueType:t,keyType:e,typeName:s.ZodMap,...O(i)});class eu extends M{_parse(e){let{status:t,ctx:i}=this._processInputParams(e);if(i.parsedType!==f.set)return C(i,{code:w.invalid_type,expected:f.set,received:i.parsedType}),E;let r=this._def;null!==r.minSize&&i.data.sizer.maxSize.value&&(C(i,{code:w.too_big,maximum:r.maxSize.value,type:"set",inclusive:!0,exact:!1,message:r.maxSize.message}),t.dirty());let n=this._def.valueType;function a(e){let i=new Set;for(let r of e){if("aborted"===r.status)return E;"dirty"===r.status&&t.dirty(),i.add(r.value)}return{status:t.value,value:i}}let o=[...i.data.values()].map((e,t)=>n._parse(new P(i,e,i.path,t)));return i.common.async?Promise.all(o).then(e=>a(e)):a(o)}min(e,t){return new eu({...this._def,minSize:{value:e,message:o.toString(t)}})}max(e,t){return new eu({...this._def,maxSize:{value:e,message:o.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}eu.create=(e,t)=>new eu({valueType:e,minSize:null,maxSize:null,typeName:s.ZodSet,...O(t)});class ed extends M{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==f.function)return C(t,{code:w.invalid_type,expected:f.function,received:t.parsedType}),E;function i(e,i){return x({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,y(),b].filter(e=>!!e),issueData:{code:w.invalid_arguments,argumentsError:i}})}function r(e,i){return x({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,y(),b].filter(e=>!!e),issueData:{code:w.invalid_return_type,returnTypeError:i}})}let n={errorMap:t.common.contextualErrorMap},a=t.data;if(this._def.returns instanceof em){let e=this;return k(async function(...t){let o=new m([]),s=await e._def.args.parseAsync(t,n).catch(e=>{throw o.addIssue(i(t,e)),o}),c=await Reflect.apply(a,this,s);return await e._def.returns._def.type.parseAsync(c,n).catch(e=>{throw o.addIssue(r(c,e)),o})})}{let e=this;return k(function(...t){let o=e._def.args.safeParse(t,n);if(!o.success)throw new m([i(t,o.error)]);let s=Reflect.apply(a,this,o.data),c=e._def.returns.safeParse(s,n);if(!c.success)throw new m([r(s,c.error)]);return c.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new ed({...this._def,args:es.create(e).rest(Q.create())})}returns(e){return new ed({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,i){return new ed({args:e||es.create([]).rest(Q.create()),returns:t||Q.create(),typeName:s.ZodFunction,...O(i)})}}class eh extends M{get schema(){return this._def.getter()}_parse(e){let{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}eh.create=(e,t)=>new eh({getter:e,typeName:s.ZodLazy,...O(t)});class ep extends M{_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return C(t,{received:t.data,code:w.invalid_literal,expected:this._def.value}),E}return{status:"valid",value:e.data}}get value(){return this._def.value}}function ef(e,t){return new eg({values:e,typeName:s.ZodEnum,...O(t)})}ep.create=(e,t)=>new ep({value:e,typeName:s.ZodLiteral,...O(t)});class eg extends M{_parse(e){if("string"!=typeof e.data){let t=this._getOrReturnCtx(e),i=this._def.values;return C(t,{expected:n.joinValues(i),received:t.parsedType,code:w.invalid_type}),E}if(-1===this._def.values.indexOf(e.data)){let t=this._getOrReturnCtx(e),i=this._def.values;return C(t,{received:t.data,code:w.invalid_enum_value,options:i}),E}return k(e.data)}get options(){return this._def.values}get enum(){let e={};for(let t of this._def.values)e[t]=t;return e}get Values(){let e={};for(let t of this._def.values)e[t]=t;return e}get Enum(){let e={};for(let t of this._def.values)e[t]=t;return e}extract(e){return eg.create(e)}exclude(e){return eg.create(this.options.filter(t=>!e.includes(t)))}}eg.create=ef;class ew extends M{_parse(e){let t=n.getValidEnumValues(this._def.values),i=this._getOrReturnCtx(e);if(i.parsedType!==f.string&&i.parsedType!==f.number){let e=n.objectValues(t);return C(i,{expected:n.joinValues(e),received:i.parsedType,code:w.invalid_type}),E}if(-1===t.indexOf(e.data)){let e=n.objectValues(t);return C(i,{received:i.data,code:w.invalid_enum_value,options:e}),E}return k(e.data)}get enum(){return this._def.values}}ew.create=(e,t)=>new ew({values:e,typeName:s.ZodNativeEnum,...O(t)});class em extends M{unwrap(){return this._def.type}_parse(e){let{ctx:t}=this._processInputParams(e);return t.parsedType!==f.promise&&!1===t.common.async?(C(t,{code:w.invalid_type,expected:f.promise,received:t.parsedType}),E):k((t.parsedType===f.promise?t.data:Promise.resolve(t.data)).then(e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap})))}}em.create=(e,t)=>new em({type:e,typeName:s.ZodPromise,...O(t)});class eb extends M{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===s.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:t,ctx:i}=this._processInputParams(e),r=this._def.effect||null,a={addIssue:e=>{C(i,e),e.fatal?t.abort():t.dirty()},get path(){return i.path}};if(a.addIssue=a.addIssue.bind(a),"preprocess"===r.type){let e=r.transform(i.data,a);return i.common.issues.length?{status:"dirty",value:i.data}:i.common.async?Promise.resolve(e).then(e=>this._def.schema._parseAsync({data:e,path:i.path,parent:i})):this._def.schema._parseSync({data:e,path:i.path,parent:i})}if("refinement"===r.type){let e=e=>{let t=r.refinement(e,a);if(i.common.async)return Promise.resolve(t);if(t instanceof Promise)throw Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return e};if(!1!==i.common.async)return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(i=>"aborted"===i.status?E:("dirty"===i.status&&t.dirty(),e(i.value).then(()=>({status:t.value,value:i.value}))));{let r=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});return"aborted"===r.status?E:("dirty"===r.status&&t.dirty(),e(r.value),{status:t.value,value:r.value})}}if("transform"===r.type){if(!1!==i.common.async)return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(e=>T(e)?Promise.resolve(r.transform(e.value,a)).then(e=>({status:t.value,value:e})):e);{let e=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});if(!T(e))return e;let n=r.transform(e.value,a);if(n instanceof Promise)throw Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:n}}}n.assertNever(r)}}eb.create=(e,t,i)=>new eb({schema:e,typeName:s.ZodEffects,effect:t,...O(i)}),eb.createWithPreprocess=(e,t,i)=>new eb({schema:t,effect:{type:"preprocess",transform:e},typeName:s.ZodEffects,...O(i)});class ev extends M{_parse(e){return this._getType(e)===f.undefined?k(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}ev.create=(e,t)=>new ev({innerType:e,typeName:s.ZodOptional,...O(t)});class ey extends M{_parse(e){return this._getType(e)===f.null?k(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}ey.create=(e,t)=>new ey({innerType:e,typeName:s.ZodNullable,...O(t)});class ex extends M{_parse(e){let{ctx:t}=this._processInputParams(e),i=t.data;return t.parsedType===f.undefined&&(i=this._def.defaultValue()),this._def.innerType._parse({data:i,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}ex.create=(e,t)=>new ex({innerType:e,typeName:s.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...O(t)});class eC extends M{_parse(e){let{ctx:t}=this._processInputParams(e),i={...t,common:{...t.common,issues:[]}},r=this._def.innerType._parse({data:i.data,path:i.path,parent:{...i}});return N(r)?r.then(e=>({status:"valid",value:"valid"===e.status?e.value:this._def.catchValue({get error(){return new m(i.common.issues)},input:i.data})})):{status:"valid",value:"valid"===r.status?r.value:this._def.catchValue({get error(){return new m(i.common.issues)},input:i.data})}}removeCatch(){return this._def.innerType}}eC.create=(e,t)=>new eC({innerType:e,typeName:s.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:()=>t.catch,...O(t)});class eA extends M{_parse(e){if(this._getType(e)!==f.nan){let t=this._getOrReturnCtx(e);return C(t,{code:w.invalid_type,expected:f.nan,received:t.parsedType}),E}return{status:"valid",value:e.data}}}eA.create=e=>new eA({typeName:s.ZodNaN,...O(e)});let eE=Symbol("zod_brand");class e_ extends M{_parse(e){let{ctx:t}=this._processInputParams(e),i=t.data;return this._def.type._parse({data:i,path:t.path,parent:t})}unwrap(){return this._def.type}}class ek extends M{_parse(e){let{status:t,ctx:i}=this._processInputParams(e);if(i.common.async)return(async()=>{let e=await this._def.in._parseAsync({data:i.data,path:i.path,parent:i});return"aborted"===e.status?E:"dirty"===e.status?(t.dirty(),_(e.value)):this._def.out._parseAsync({data:e.value,path:i.path,parent:i})})();{let e=this._def.in._parseSync({data:i.data,path:i.path,parent:i});return"aborted"===e.status?E:"dirty"===e.status?(t.dirty(),{status:"dirty",value:e.value}):this._def.out._parseSync({data:e.value,path:i.path,parent:i})}}static create(e,t){return new ek({in:e,out:t,typeName:s.ZodPipeline})}}class eI extends M{_parse(e){let t=this._def.innerType._parse(e);return T(t)&&(t.value=Object.freeze(t.value)),t}}eI.create=(e,t)=>new eI({innerType:e,typeName:s.ZodReadonly,...O(t)});let eS=(e,t={},i)=>e?Y.create().superRefine((r,n)=>{var a,o;if(!e(r)){let e="function"==typeof t?t(r):"string"==typeof t?{message:t}:t,s=null===(o=null!==(a=e.fatal)&&void 0!==a?a:i)||void 0===o||o,c="string"==typeof e?{message:e}:e;n.addIssue({code:"custom",...c,fatal:s})}}):Y.create(),eT={object:ei.lazycreate};!function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"}(s||(s={}));let eN=H.create,eP=z.create,eR=eA.create,eO=F.create,eM=Z.create,eD=V.create,eU=K.create,e$=G.create,eL=J.create,ej=Y.create,eB=Q.create,eW=X.create,eq=ee.create,eH=et.create,ez=ei.create,eF=ei.strictCreate,eZ=er.create,eV=ea.create,eK=eo.create,eG=es.create,eJ=ec.create,eY=el.create,eQ=eu.create,eX=ed.create,e0=eh.create,e1=ep.create,e2=eg.create,e3=ew.create,e5=em.create,e4=eb.create,e6=ev.create,e8=ey.create,e9=eb.createWithPreprocess,e7=ek.create;var te=Object.freeze({__proto__:null,defaultErrorMap:b,setErrorMap:function(e){v=e},getErrorMap:y,makeIssue:x,EMPTY_PATH:[],addIssueToContext:C,ParseStatus:A,INVALID:E,DIRTY:_,OK:k,isAborted:I,isDirty:S,isValid:T,isAsync:N,get util(){return n},get objectUtil(){return a},ZodParsedType:f,getParsedType:g,ZodType:M,ZodString:H,ZodNumber:z,ZodBigInt:F,ZodBoolean:Z,ZodDate:V,ZodSymbol:K,ZodUndefined:G,ZodNull:J,ZodAny:Y,ZodUnknown:Q,ZodNever:X,ZodVoid:ee,ZodArray:et,ZodObject:ei,ZodUnion:er,ZodDiscriminatedUnion:ea,ZodIntersection:eo,ZodTuple:es,ZodRecord:ec,ZodMap:el,ZodSet:eu,ZodFunction:ed,ZodLazy:eh,ZodLiteral:ep,ZodEnum:eg,ZodNativeEnum:ew,ZodPromise:em,ZodEffects:eb,ZodTransformer:eb,ZodOptional:ev,ZodNullable:ey,ZodDefault:ex,ZodCatch:eC,ZodNaN:eA,BRAND:eE,ZodBranded:e_,ZodPipeline:ek,ZodReadonly:eI,custom:eS,Schema:M,ZodSchema:M,late:eT,get ZodFirstPartyTypeKind(){return s},coerce:{string:e=>H.create({...e,coerce:!0}),number:e=>z.create({...e,coerce:!0}),boolean:e=>Z.create({...e,coerce:!0}),bigint:e=>F.create({...e,coerce:!0}),date:e=>V.create({...e,coerce:!0})},any:ej,array:eH,bigint:eO,boolean:eM,date:eD,discriminatedUnion:eV,effect:e4,enum:e2,function:eX,instanceof:(e,t={message:`Input not instance of ${e.name}`})=>eS(t=>t instanceof e,t),intersection:eK,lazy:e0,literal:e1,map:eY,nan:eR,nativeEnum:e3,never:eW,null:eL,nullable:e8,number:eP,object:ez,oboolean:()=>eM().optional(),onumber:()=>eP().optional(),optional:e6,ostring:()=>eN().optional(),pipeline:e7,preprocess:e9,promise:e5,record:eJ,set:eQ,strictObject:eF,string:eN,symbol:eU,transformer:e4,tuple:eG,undefined:e$,union:eZ,unknown:eB,void:eq,NEVER:E,ZodIssueCode:w,quotelessJson:e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),ZodError:m});let tt=te.object({message:te.string()});function ti(e){return te.literal(h[e])}te.object({accessList:te.array(te.string()),blockHash:te.string().nullable(),blockNumber:te.string().nullable(),chainId:te.string().or(te.number()),from:te.string(),gas:te.string(),hash:te.string(),input:te.string().nullable(),maxFeePerGas:te.string(),maxPriorityFeePerGas:te.string(),nonce:te.string(),r:te.string(),s:te.string(),to:te.string(),transactionIndex:te.string().nullable(),type:te.string(),v:te.string(),value:te.string()});let tr=te.object({chainId:te.string().or(te.number())}),tn=te.object({email:te.string().email()}),ta=te.object({otp:te.string()}),to=te.object({uri:te.string()}),ts=te.object({chainId:te.optional(te.string().or(te.number())),preferredAccountType:te.optional(te.string())}),tc=te.object({provider:te.enum(["google","github","apple","facebook","x","discord"])}),tl=te.object({email:te.string().email()}),tu=te.object({otp:te.string()}),td=te.object({otp:te.string()}),th=te.object({themeMode:te.optional(te.enum(["light","dark"])),themeVariables:te.optional(te.record(te.string(),te.string().or(te.number()))),w3mThemeVariables:te.optional(te.record(te.string(),te.string()))}),tp=te.object({metadata:te.object({name:te.string(),description:te.string(),url:te.string(),icons:te.array(te.string())}).optional(),sdkVersion:te.string().optional(),sdkType:te.string().optional(),projectId:te.string()}),tf=te.object({type:te.string()}),tg=te.object({action:te.enum(["VERIFY_DEVICE","VERIFY_OTP"])}),tw=te.object({url:te.string()}),tm=te.object({userName:te.string()}),tb=te.object({email:te.string(),address:te.string(),chainId:te.string().or(te.number()),accounts:te.array(te.object({address:te.string(),type:te.enum([p.ACCOUNT_TYPES.EOA,p.ACCOUNT_TYPES.SMART_ACCOUNT])})).optional(),userName:te.string().optional()}),tv=te.object({action:te.enum(["VERIFY_PRIMARY_OTP","VERIFY_SECONDARY_OTP"])}),ty=te.object({email:te.string().email().optional().nullable(),address:te.string(),chainId:te.string().or(te.number()),smartAccountDeployed:te.optional(te.boolean()),accounts:te.array(te.object({address:te.string(),type:te.enum([p.ACCOUNT_TYPES.EOA,p.ACCOUNT_TYPES.SMART_ACCOUNT])})).optional(),preferredAccountType:te.optional(te.string())}),tx=te.object({uri:te.string()}),tC=te.object({isConnected:te.boolean()}),tA=te.object({chainId:te.string().or(te.number())}),tE=te.object({chainId:te.string().or(te.number())}),t_=te.object({newEmail:te.string().email()}),tk=te.object({smartAccountEnabledNetworks:te.array(te.number())});te.object({address:te.string(),isDeployed:te.boolean()});let tI=te.object({version:te.string().optional()}),tS=te.object({type:te.string(),address:te.string()}),tT=te.any(),tN=te.object({method:te.literal("eth_accounts")}),tP=te.object({method:te.literal("eth_blockNumber")}),tR=te.object({method:te.literal("eth_call"),params:te.array(te.any())}),tO=te.object({method:te.literal("eth_chainId")}),tM=te.object({method:te.literal("eth_estimateGas"),params:te.array(te.any())}),tD=te.object({method:te.literal("eth_feeHistory"),params:te.array(te.any())}),tU=te.object({method:te.literal("eth_gasPrice")}),t$=te.object({method:te.literal("eth_getAccount"),params:te.array(te.any())}),tL=te.object({method:te.literal("eth_getBalance"),params:te.array(te.any())}),tj=te.object({method:te.literal("eth_getBlockByHash"),params:te.array(te.any())}),tB=te.object({method:te.literal("eth_getBlockByNumber"),params:te.array(te.any())}),tW=te.object({method:te.literal("eth_getBlockReceipts"),params:te.array(te.any())}),tq=te.object({method:te.literal("eth_getBlockTransactionCountByHash"),params:te.array(te.any())}),tH=te.object({method:te.literal("eth_getBlockTransactionCountByNumber"),params:te.array(te.any())}),tz=te.object({method:te.literal("eth_getCode"),params:te.array(te.any())}),tF=te.object({method:te.literal("eth_getFilterChanges"),params:te.array(te.any())}),tZ=te.object({method:te.literal("eth_getFilterLogs"),params:te.array(te.any())}),tV=te.object({method:te.literal("eth_getLogs"),params:te.array(te.any())}),tK=te.object({method:te.literal("eth_getProof"),params:te.array(te.any())}),tG=te.object({method:te.literal("eth_getStorageAt"),params:te.array(te.any())}),tJ=te.object({method:te.literal("eth_getTransactionByBlockHashAndIndex"),params:te.array(te.any())}),tY=te.object({method:te.literal("eth_getTransactionByBlockNumberAndIndex"),params:te.array(te.any())}),tQ=te.object({method:te.literal("eth_getTransactionByHash"),params:te.array(te.any())}),tX=te.object({method:te.literal("eth_getTransactionCount"),params:te.array(te.any())}),t0=te.object({method:te.literal("eth_getTransactionReceipt"),params:te.array(te.any())}),t1=te.object({method:te.literal("eth_getUncleCountByBlockHash"),params:te.array(te.any())}),t2=te.object({method:te.literal("eth_getUncleCountByBlockNumber"),params:te.array(te.any())}),t3=te.object({method:te.literal("eth_maxPriorityFeePerGas")}),t5=te.object({method:te.literal("eth_newBlockFilter")}),t4=te.object({method:te.literal("eth_newFilter"),params:te.array(te.any())}),t6=te.object({method:te.literal("eth_newPendingTransactionFilter")}),t8=te.object({method:te.literal("eth_sendRawTransaction"),params:te.array(te.any())}),t9=te.object({method:te.literal("eth_syncing"),params:te.array(te.any())}),t7=te.object({method:te.literal("eth_uninstallFilter"),params:te.array(te.any())}),ie=te.object({method:te.literal("personal_sign"),params:te.array(te.any())}),it=te.object({method:te.literal("eth_signTypedData_v4"),params:te.array(te.any())}),ii=te.object({method:te.literal("eth_sendTransaction"),params:te.array(te.any())}),ir=te.object({method:te.literal("solana_signMessage"),params:te.object({message:te.string(),pubkey:te.string()})}),ia=te.object({method:te.literal("solana_signTransaction"),params:te.object({transaction:te.string()})}),io=te.object({method:te.literal("solana_signAllTransactions"),params:te.object({transactions:te.array(te.string())})}),is=te.object({method:te.literal("solana_signAndSendTransaction"),params:te.object({transaction:te.string(),options:te.object({skipPreflight:te.boolean().optional(),preflightCommitment:te.enum(["processed","confirmed","finalized","recent","single","singleGossip","root","max"]).optional(),maxRetries:te.number().optional(),minContextSlot:te.number().optional()}).optional()})}),ic=te.object({method:te.literal("wallet_sendCalls"),params:te.array(te.object({chainId:te.string().or(te.number()).optional(),from:te.string().optional(),version:te.string().optional(),capabilities:te.any().optional(),calls:te.array(te.object({to:te.string().startsWith("0x"),data:te.string().startsWith("0x").optional(),value:te.string().optional()}))}))}),il=te.object({method:te.literal("wallet_getCallsStatus"),params:te.array(te.string())}),iu=te.object({method:te.literal("wallet_getCapabilities")}),id=te.object({method:te.literal("wallet_grantPermissions"),params:te.array(te.any())}),ih=te.object({method:te.literal("wallet_revokePermissions"),params:te.any()}),ip=te.object({token:te.string()}),ig=te.object({id:te.string().optional()}),iw={appEvent:ig.extend({type:ti("APP_SWITCH_NETWORK"),payload:tr}).or(ig.extend({type:ti("APP_CONNECT_EMAIL"),payload:tn})).or(ig.extend({type:ti("APP_CONNECT_DEVICE")})).or(ig.extend({type:ti("APP_CONNECT_OTP"),payload:ta})).or(ig.extend({type:ti("APP_CONNECT_SOCIAL"),payload:to})).or(ig.extend({type:ti("APP_GET_FARCASTER_URI")})).or(ig.extend({type:ti("APP_CONNECT_FARCASTER")})).or(ig.extend({type:ti("APP_GET_USER"),payload:te.optional(ts)})).or(ig.extend({type:ti("APP_GET_SOCIAL_REDIRECT_URI"),payload:tc})).or(ig.extend({type:ti("APP_SIGN_OUT")})).or(ig.extend({type:ti("APP_IS_CONNECTED"),payload:te.optional(ip)})).or(ig.extend({type:ti("APP_GET_CHAIN_ID")})).or(ig.extend({type:ti("APP_GET_SMART_ACCOUNT_ENABLED_NETWORKS")})).or(ig.extend({type:ti("APP_INIT_SMART_ACCOUNT")})).or(ig.extend({type:ti("APP_SET_PREFERRED_ACCOUNT"),payload:tf})).or(ig.extend({type:ti("APP_RPC_REQUEST"),payload:ie.or(ii).or(tN).or(tP).or(tR).or(tO).or(tM).or(tD).or(tU).or(t$).or(tL).or(tj).or(tB).or(tW).or(tq).or(tH).or(tz).or(tF).or(tZ).or(tV).or(tK).or(tG).or(tJ).or(tY).or(tQ).or(tX).or(t0).or(t1).or(t2).or(t3).or(t5).or(t4).or(t6).or(t8).or(t9).or(t7).or(ie).or(it).or(ii).or(ir).or(ia).or(io).or(is).or(il).or(ic).or(iu).or(id).or(ih)})).or(ig.extend({type:ti("APP_UPDATE_EMAIL"),payload:tl})).or(ig.extend({type:ti("APP_UPDATE_EMAIL_PRIMARY_OTP"),payload:tu})).or(ig.extend({type:ti("APP_UPDATE_EMAIL_SECONDARY_OTP"),payload:td})).or(ig.extend({type:ti("APP_SYNC_THEME"),payload:th})).or(ig.extend({type:ti("APP_SYNC_DAPP_DATA"),payload:tp})),frameEvent:ig.extend({type:ti("FRAME_SWITCH_NETWORK_ERROR"),payload:tt}).or(ig.extend({type:ti("FRAME_SWITCH_NETWORK_SUCCESS"),payload:tE})).or(ig.extend({type:ti("FRAME_CONNECT_EMAIL_SUCCESS"),payload:tg})).or(ig.extend({type:ti("FRAME_CONNECT_EMAIL_ERROR"),payload:tt})).or(ig.extend({type:ti("FRAME_GET_FARCASTER_URI_SUCCESS"),payload:tw})).or(ig.extend({type:ti("FRAME_GET_FARCASTER_URI_ERROR"),payload:tt})).or(ig.extend({type:ti("FRAME_CONNECT_FARCASTER_SUCCESS"),payload:tm})).or(ig.extend({type:ti("FRAME_CONNECT_FARCASTER_ERROR"),payload:tt})).or(ig.extend({type:ti("FRAME_CONNECT_OTP_ERROR"),payload:tt})).or(ig.extend({type:ti("FRAME_CONNECT_OTP_SUCCESS")})).or(ig.extend({type:ti("FRAME_CONNECT_DEVICE_ERROR"),payload:tt})).or(ig.extend({type:ti("FRAME_CONNECT_DEVICE_SUCCESS")})).or(ig.extend({type:ti("FRAME_CONNECT_SOCIAL_SUCCESS"),payload:tb})).or(ig.extend({type:ti("FRAME_CONNECT_SOCIAL_ERROR"),payload:tt})).or(ig.extend({type:ti("FRAME_GET_USER_ERROR"),payload:tt})).or(ig.extend({type:ti("FRAME_GET_USER_SUCCESS"),payload:ty})).or(ig.extend({type:ti("FRAME_GET_SOCIAL_REDIRECT_URI_ERROR"),payload:tt})).or(ig.extend({type:ti("FRAME_GET_SOCIAL_REDIRECT_URI_SUCCESS"),payload:tx})).or(ig.extend({type:ti("FRAME_SIGN_OUT_ERROR"),payload:tt})).or(ig.extend({type:ti("FRAME_SIGN_OUT_SUCCESS")})).or(ig.extend({type:ti("FRAME_IS_CONNECTED_ERROR"),payload:tt})).or(ig.extend({type:ti("FRAME_IS_CONNECTED_SUCCESS"),payload:tC})).or(ig.extend({type:ti("FRAME_GET_CHAIN_ID_ERROR"),payload:tt})).or(ig.extend({type:ti("FRAME_GET_CHAIN_ID_SUCCESS"),payload:tA})).or(ig.extend({type:ti("FRAME_RPC_REQUEST_ERROR"),payload:tt})).or(ig.extend({type:ti("FRAME_RPC_REQUEST_SUCCESS"),payload:tT})).or(ig.extend({type:ti("FRAME_SESSION_UPDATE"),payload:ip})).or(ig.extend({type:ti("FRAME_UPDATE_EMAIL_ERROR"),payload:tt})).or(ig.extend({type:ti("FRAME_UPDATE_EMAIL_SUCCESS"),payload:tv})).or(ig.extend({type:ti("FRAME_UPDATE_EMAIL_PRIMARY_OTP_ERROR"),payload:tt})).or(ig.extend({type:ti("FRAME_UPDATE_EMAIL_PRIMARY_OTP_SUCCESS")})).or(ig.extend({type:ti("FRAME_UPDATE_EMAIL_SECONDARY_OTP_ERROR"),payload:tt})).or(ig.extend({type:ti("FRAME_UPDATE_EMAIL_SECONDARY_OTP_SUCCESS"),payload:t_})).or(ig.extend({type:ti("FRAME_SYNC_THEME_ERROR"),payload:tt})).or(ig.extend({type:ti("FRAME_SYNC_THEME_SUCCESS")})).or(ig.extend({type:ti("FRAME_SYNC_DAPP_DATA_ERROR"),payload:tt})).or(ig.extend({type:ti("FRAME_SYNC_DAPP_DATA_SUCCESS")})).or(ig.extend({type:ti("FRAME_GET_SMART_ACCOUNT_ENABLED_NETWORKS_SUCCESS"),payload:tk})).or(ig.extend({type:ti("FRAME_GET_SMART_ACCOUNT_ENABLED_NETWORKS_ERROR"),payload:tt})).or(ig.extend({type:ti("FRAME_INIT_SMART_ACCOUNT_ERROR"),payload:tt})).or(ig.extend({type:ti("FRAME_SET_PREFERRED_ACCOUNT_SUCCESS"),payload:tS})).or(ig.extend({type:ti("FRAME_SET_PREFERRED_ACCOUNT_ERROR"),payload:tt})).or(ig.extend({type:ti("FRAME_READY"),payload:tI}))},im={set(e,t){iv.isClient&&localStorage.setItem(`${h.STORAGE_KEY}${e}`,t)},get:e=>iv.isClient?localStorage.getItem(`${h.STORAGE_KEY}${e}`):null,delete(e,t){iv.isClient&&(t?localStorage.removeItem(e):localStorage.removeItem(`${h.STORAGE_KEY}${e}`))}},ib={transactionHash:/^0x(?:[A-Fa-f0-9]{64})$/u,signedMessage:/^0x(?:[a-fA-F0-9]{62,})$/u},iv={checkIfAllowedToTriggerEmail(){let e=im.get(h.LAST_EMAIL_LOGIN_TIME);if(e){let t=Date.now()-Number(e);if(t<3e4){let e=Math.ceil((3e4-t)/1e3);throw Error(`Please try again after ${e} seconds`)}}},getTimeToNextEmailLogin(){let e=im.get(h.LAST_EMAIL_LOGIN_TIME);if(e){let t=Date.now()-Number(e);if(t<3e4)return Math.ceil((3e4-t)/1e3)}return 0},checkIfRequestExists:e=>p.NOT_SAFE_RPC_METHODS.includes(e.method)||p.SAFE_RPC_METHODS.includes(e.method),getResponseType:e=>"string"==typeof e&&(e?.match(ib.transactionHash)||e?.match(ib.signedMessage))?h.RPC_RESPONSE_TYPE_TX:h.RPC_RESPONSE_TYPE_OBJECT,checkIfRequestIsSafe:e=>p.SAFE_RPC_METHODS.includes(e.method),isClient:"undefined"!=typeof window};var iy=i(21420),ix=i(37583),iC=i(39346),iA=i(14488);iy.extend(iC),iy.extend(iA);let iE={...ix,name:"en-web3-modal",relativeTime:{future:"in %s",past:"%s ago",s:"%d sec",m:"1 min",mm:"%d min",h:"1 hr",hh:"%d hrs",d:"1 d",dd:"%d d",M:"1 mo",MM:"%d mo",y:"1 yr",yy:"%d yr"}};iy.locale("en-web3-modal",iE),i(66499);let i_={BLOCKCHAIN_API_RPC_URL:"https://rpc.walletconnect.org"};class ik{constructor(e,t=!1,i="eip155:1"){if(this.iframe=null,this.rpcUrl=i_.BLOCKCHAIN_API_RPC_URL,this.initFrame=()=>{let e=document.getElementById("w3m-iframe");this.iframe&&!e&&document.body.appendChild(this.iframe)},this.events={registerFrameEventHandler:(e,t,i)=>{function r({data:i}){if("string"!=typeof i.type||!i.type.includes(h.FRAME_EVENT_KEY))return;let n=iw.frameEvent.parse(i);n.id===e&&(t(n),window.removeEventListener("message",r))}iv.isClient&&(window.addEventListener("message",r),i.addEventListener("abort",()=>{window.removeEventListener("message",r)}))},onFrameEvent:e=>{iv.isClient&&window.addEventListener("message",({data:t})=>{"string"==typeof t.type&&t.type.includes(h.FRAME_EVENT_KEY)&&e(iw.frameEvent.parse(t))})},onAppEvent:e=>{iv.isClient&&window.addEventListener("message",({data:t})=>{"string"==typeof t.type&&t.type.includes(h.APP_EVENT_KEY)&&e(iw.appEvent.parse(t))})},postAppEvent:e=>{if(iv.isClient){if(!this.iframe?.contentWindow)throw Error("W3mFrame: iframe is not set");iw.appEvent.parse(e),this.iframe.contentWindow.postMessage(e,"*")}},postFrameEvent:e=>{if(iv.isClient){if(!parent)throw Error("W3mFrame: parent is not set");iw.frameEvent.parse(e),parent.postMessage(e,"*")}}},this.projectId=e,this.frameLoadPromise=new Promise((e,t)=>{this.frameLoadPromiseResolver={resolve:e,reject:t}}),t&&(this.frameLoadPromise=new Promise((e,t)=>{this.frameLoadPromiseResolver={resolve:e,reject:t}}),iv.isClient)){let t=document.createElement("iframe");t.id="w3m-iframe",t.src=`${l}?projectId=${e}&chainId=${i}&version=${d}`,t.name="w3m-secure-iframe",t.style.position="fixed",t.style.zIndex="999999",t.style.display="none",t.style.animationDelay="0s, 50ms",t.style.borderBottomLeftRadius="clamp(0px, var(--wui-border-radius-l), 44px)",t.style.borderBottomRightRadius="clamp(0px, var(--wui-border-radius-l), 44px)",this.iframe=t,this.iframe.onerror=()=>{this.frameLoadPromiseResolver?.reject("Unable to load email login dependency")},this.events.onFrameEvent(e=>{"@w3m-frame/READY"===e.type&&this.frameLoadPromiseResolver?.resolve(void 0)})}}get networks(){return Object.assign({},...["eip155:1","eip155:5","eip155:11155111","eip155:10","eip155:420","eip155:42161","eip155:421613","eip155:137","eip155:80001","eip155:42220","eip155:1313161554","eip155:1313161555","eip155:56","eip155:97","eip155:43114","eip155:43113","eip155:324","eip155:280","eip155:100","eip155:8453","eip155:84531","eip155:84532","eip155:7777777","eip155:999","solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp","solana:4uhcVJyU9pJkvQyS88uRDiswHXSCkY3z","solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1"].map(e=>({[e]:{rpcUrl:`${this.rpcUrl}/v1/?chainId=${e}&projectId=${this.projectId}`,chainId:e}})))}}var iI=i(52027);class iS{constructor(e){let t=(0,iI.iP)({level:u}),{logger:i,chunkLoggerController:r}=(0,iI.D5)({opts:t});this.logger=(0,iI.U5)(i,this.constructor.name),this.chunkLoggerController=r,"undefined"!=typeof window&&this.chunkLoggerController?.downloadLogsBlobInBrowser&&(window.downloadAppKitLogsBlob||(window.downloadAppKitLogsBlob={}),window.downloadAppKitLogsBlob.sdk=()=>{this.chunkLoggerController?.downloadLogsBlobInBrowser&&this.chunkLoggerController.downloadLogsBlobInBrowser({projectId:e})})}}class iT{constructor({projectId:e,chainId:t,onTimeout:i}){this.openRpcRequests=[],this.w3mLogger=new iS(e),this.w3mFrame=new ik(e,!0,t),this.onTimeout=i,this.getLoginEmailUsed()&&this.w3mFrame.initFrame()}getLoginEmailUsed(){return!!im.get(h.EMAIL_LOGIN_USED_KEY)}getEmail(){return im.get(h.EMAIL)}async connectEmail(e){try{iv.checkIfAllowedToTriggerEmail(),this.w3mFrame.initFrame();let t=await this.appEvent({type:h.APP_CONNECT_EMAIL,payload:e});return this.setNewLastEmailLoginTime(),t}catch(e){throw this.w3mLogger.logger.error({error:e},"Error connecting email"),e}}async connectDevice(){try{return this.appEvent({type:h.APP_CONNECT_DEVICE})}catch(e){throw this.w3mLogger.logger.error({error:e},"Error connecting device"),e}}async connectOtp(e){try{return this.appEvent({type:h.APP_CONNECT_OTP,payload:e})}catch(e){throw this.w3mLogger.logger.error({error:e},"Error connecting otp"),e}}async isConnected(){try{let e=await this.appEvent({type:h.APP_IS_CONNECTED});return e.isConnected||this.deleteAuthLoginCache(),e}catch(e){throw this.deleteAuthLoginCache(),this.w3mLogger.logger.error({error:e},"Error checking connection"),e}}async getChainId(){try{let e=await this.appEvent({type:h.APP_GET_CHAIN_ID});return this.setLastUsedChainId(e.chainId),e}catch(e){throw this.w3mLogger.logger.error({error:e},"Error getting chain id"),e}}async getSocialRedirectUri(e){try{return this.w3mFrame.initFrame(),this.appEvent({type:h.APP_GET_SOCIAL_REDIRECT_URI,payload:e})}catch(e){throw this.w3mLogger.logger.error({error:e},"Error getting social redirect uri"),e}}async updateEmail(e){try{let t=await this.appEvent({type:h.APP_UPDATE_EMAIL,payload:e});return this.setNewLastEmailLoginTime(),t}catch(e){throw this.w3mLogger.logger.error({error:e},"Error updating email"),e}}async updateEmailPrimaryOtp(e){try{return this.appEvent({type:h.APP_UPDATE_EMAIL_PRIMARY_OTP,payload:e})}catch(e){throw this.w3mLogger.logger.error({error:e},"Error updating email primary otp"),e}}async updateEmailSecondaryOtp(e){try{let t=await this.appEvent({type:h.APP_UPDATE_EMAIL_SECONDARY_OTP,payload:e});return this.setLoginSuccess(t.newEmail),t}catch(e){throw this.w3mLogger.logger.error({error:e},"Error updating email secondary otp"),e}}async syncTheme(e){try{return this.appEvent({type:h.APP_SYNC_THEME,payload:e})}catch(e){throw this.w3mLogger.logger.error({error:e},"Error syncing theme"),e}}async syncDappData(e){try{return this.appEvent({type:h.APP_SYNC_DAPP_DATA,payload:e})}catch(e){throw this.w3mLogger.logger.error({error:e},"Error syncing dapp data"),e}}async getSmartAccountEnabledNetworks(){try{let e=await this.appEvent({type:h.APP_GET_SMART_ACCOUNT_ENABLED_NETWORKS});return this.persistSmartAccountEnabledNetworks(e.smartAccountEnabledNetworks),e}catch(e){throw this.persistSmartAccountEnabledNetworks([]),this.w3mLogger.logger.error({error:e},"Error getting smart account enabled networks"),e}}async setPreferredAccount(e){try{return this.appEvent({type:h.APP_SET_PREFERRED_ACCOUNT,payload:{type:e}})}catch(e){throw this.w3mLogger.logger.error({error:e},"Error setting preferred account"),e}}async connect(e){try{let t=e?.chainId||this.getLastUsedChainId()||1,i=await this.appEvent({type:h.APP_GET_USER,payload:{...e,chainId:t}});return this.setLoginSuccess(i.email),this.setLastUsedChainId(i.chainId),i}catch(e){throw this.w3mLogger.logger.error({error:e},"Error connecting"),e}}async getUser(e){try{let t=e?.chainId||this.getLastUsedChainId()||1;return await this.appEvent({type:h.APP_GET_USER,payload:{...e,chainId:t}})}catch(e){throw this.w3mLogger.logger.error({error:e},"Error connecting"),e}}async connectSocial(e){try{let t=await this.appEvent({type:h.APP_CONNECT_SOCIAL,payload:{uri:e}});return t.userName&&this.setSocialLoginSuccess(t.userName),t}catch(e){throw this.w3mLogger.logger.error({error:e},"Error connecting social"),e}}async getFarcasterUri(){try{return this.w3mFrame.initFrame(),await this.appEvent({type:h.APP_GET_FARCASTER_URI})}catch(e){throw this.w3mLogger.logger.error({error:e},"Error getting farcaster uri"),e}}async connectFarcaster(){try{let e=await this.appEvent({type:h.APP_CONNECT_FARCASTER});return e.userName&&this.setSocialLoginSuccess(e.userName),e}catch(e){throw this.w3mLogger.logger.error({error:e},"Error connecting farcaster"),e}}async switchNetwork(e){try{let t=await this.appEvent({type:h.APP_SWITCH_NETWORK,payload:{chainId:e}});return this.setLastUsedChainId(t.chainId),t}catch(e){throw this.w3mLogger.logger.error({error:e},"Error switching network"),e}}async disconnect(){try{let e=await this.appEvent({type:h.APP_SIGN_OUT});return this.deleteAuthLoginCache(),e}catch(e){throw this.w3mLogger.logger.error({error:e},"Error disconnecting"),e}}async request(e){try{if(p.GET_CHAIN_ID===e.method)return this.getLastUsedChainId();this.rpcRequestHandler?.(e);let t=await this.appEvent({type:h.APP_RPC_REQUEST,payload:e});return this.rpcSuccessHandler?.(t,e),t}catch(t){throw this.rpcErrorHandler?.(t,e),this.w3mLogger.logger.error({error:t},"Error requesting"),t}}onRpcRequest(e){this.rpcRequestHandler=e}onRpcSuccess(e){this.rpcSuccessHandler=e}onRpcError(e){this.rpcErrorHandler=e}onIsConnected(e){this.w3mFrame.events.onFrameEvent(t=>{t.type===h.FRAME_IS_CONNECTED_SUCCESS&&t.payload.isConnected&&e()})}onNotConnected(e){this.w3mFrame.events.onFrameEvent(t=>{t.type===h.FRAME_IS_CONNECTED_ERROR&&e(),t.type!==h.FRAME_IS_CONNECTED_SUCCESS||t.payload.isConnected||e()})}onConnect(e){this.w3mFrame.events.onFrameEvent(t=>{t.type===h.FRAME_GET_USER_SUCCESS&&e(t.payload)})}async getCapabilities(){try{return await this.request({method:"wallet_getCapabilities"})||{}}catch{return{}}}onSetPreferredAccount(e){this.w3mFrame.events.onFrameEvent(t=>{t.type===h.FRAME_SET_PREFERRED_ACCOUNT_SUCCESS?e(t.payload):t.type===h.FRAME_SET_PREFERRED_ACCOUNT_ERROR&&e({type:p.ACCOUNT_TYPES.EOA})})}onGetSmartAccountEnabledNetworks(e){this.w3mFrame.events.onFrameEvent(t=>{t.type===h.FRAME_GET_SMART_ACCOUNT_ENABLED_NETWORKS_SUCCESS?e(t.payload.smartAccountEnabledNetworks):t.type===h.FRAME_GET_SMART_ACCOUNT_ENABLED_NETWORKS_ERROR&&e([])})}getAvailableChainIds(){return Object.keys(this.w3mFrame.networks)}rejectRpcRequests(){try{this.openRpcRequests.forEach(({abortController:e,method:t})=>{p.SAFE_RPC_METHODS.includes(t)||e.abort()}),this.openRpcRequests=[]}catch(e){this.w3mLogger.logger.error({error:e},"Error aborting RPC request")}}async appEvent(e){let t;function i(e){return e.replace("@w3m-app/","")}await this.w3mFrame.frameLoadPromise;let r=new AbortController,n=i(e.type);return[h.APP_CONNECT_EMAIL,h.APP_CONNECT_DEVICE,h.APP_CONNECT_OTP,h.APP_CONNECT_SOCIAL,h.APP_GET_SOCIAL_REDIRECT_URI,h.APP_GET_FARCASTER_URI].map(i).includes(n)&&(t=setTimeout(()=>{this.onTimeout?.(),r.abort()},3e4)),new Promise((i,a)=>{let o=Math.random().toString(36).substring(7);this.w3mLogger.logger.info?.({event:e,id:o},"Sending app event"),this.w3mFrame.events.postAppEvent({...e,id:o}),"RPC_REQUEST"===n&&(this.openRpcRequests=[...this.openRpcRequests,{...e.payload,abortController:r}]),r.signal.addEventListener("abort",()=>{"RPC_REQUEST"===n?a(Error("Request was aborted")):a(Error("Something went wrong"))}),this.w3mFrame.events.registerFrameEventHandler(o,e=>{var r;return r=this.w3mLogger,void(e.id===o&&(r.logger.info?.({framEvent:e,id:o},"Received frame response"),e.type===`@w3m-frame/${n}_SUCCESS`?(t&&clearTimeout(t),"payload"in e&&i(e.payload),i(void 0)):e.type===`@w3m-frame/${n}_ERROR`&&(t&&clearTimeout(t),"payload"in e&&a(Error(e.payload?.message||"An error occurred")),a(Error("An error occurred")))))},r.signal)})}setNewLastEmailLoginTime(){im.set(h.LAST_EMAIL_LOGIN_TIME,Date.now().toString())}setSocialLoginSuccess(e){im.set(h.SOCIAL_USERNAME,e)}setLoginSuccess(e){e&&im.set(h.EMAIL,e),im.set(h.EMAIL_LOGIN_USED_KEY,"true"),im.delete(h.LAST_EMAIL_LOGIN_TIME)}deleteAuthLoginCache(){im.delete(h.EMAIL_LOGIN_USED_KEY),im.delete(h.EMAIL),im.delete(h.LAST_USED_CHAIN_KEY),im.delete(h.SOCIAL_USERNAME)}setLastUsedChainId(e){e&&im.set(h.LAST_USED_CHAIN_KEY,String(e))}getLastUsedChainId(){return Number(im.get(h.LAST_USED_CHAIN_KEY))}persistSmartAccountEnabledNetworks(e){im.set(h.SMART_ACCOUNT_ENABLED_NETWORKS,e.join(","))}}},49440:(e,t,i)=>{"use strict";i.d(t,{D8t:()=>r.D8t,Gby:()=>r.Gby,rCZ:()=>r.rCZ});var r=i(93113)},24598:(e,t,i)=>{"use strict";let r,n;i.d(t,{sX:()=>c,JS:()=>o});var a=i(81696);function o(){if(!r)throw Error('Please call "createAppKit" before using "useAppKit" hook');return{open:async function(e){await r?.open(e)},close:async function(){await r?.close()}}}i(57749),i(10491),i(73322),i(12344),i(94984),i(35335);var s=i(80196);function c(e){return!n&&(r=n=new a._({...e,sdkVersion:s.wE.generateSdkVersion(e.adapters??[],"react","1.5.3")})),n}i(64810),i(58051)},21552:(e,t,i)=>{"use strict";i.d(t,{X:()=>s});var r=i(50639),n=i(80196),a=i(60402),o=i(2614);class s{constructor(e){this.availableConnectors=[],this.eventListeners=new Map,e&&this.construct(e)}construct(e){this.caipNetworks=e.networks,this.projectId=e.projectId,this.namespace=e.namespace}get connectors(){return this.availableConnectors}get networks(){return this.caipNetworks||[]}setUniversalProvider(e){this.addConnector({id:a.oU.WALLET_CONNECT_CONNECTOR_ID,type:"WALLET_CONNECT",name:a.L_.ConnectorNamesMap[a.oU.WALLET_CONNECT_CONNECTOR_ID],provider:e,imageId:a.L_.ConnectorImageIds[a.oU.WALLET_CONNECT_CONNECTOR_ID],chain:this.namespace,chains:[]})}setAuthProvider(e){this.addConnector({id:a.oU.AUTH_CONNECTOR_ID,type:"AUTH",name:"Auth",provider:e,imageId:a.L_.ConnectorImageIds[a.oU.AUTH_CONNECTOR_ID],chain:this.namespace,chains:[]})}addConnector(...e){if(e.some(e=>"ID_AUTH"===e.id)){let t=e.find(e=>"ID_AUTH"===e.id),i=(0,o.P9)(n.Hd.state),a=n.Wn.getSnapshot().themeMode,s=n.Wn.getSnapshot().themeVariables;t?.provider?.syncDappData?.({metadata:i.metadata,sdkVersion:i.sdkVersion,projectId:i.projectId,sdkType:i.sdkType}),t.provider.syncTheme({themeMode:a,themeVariables:s,w3mThemeVariables:(0,r.o_)(s,a)})}let t=new Set;this.availableConnectors=[...e,...this.availableConnectors].filter(e=>!t.has(e.id)&&(t.add(e.id),!0))}setStatus(e,t){n.Uj.setStatus(e,t)}on(e,t){this.eventListeners.has(e)||this.eventListeners.set(e,new Set),this.eventListeners.get(e)?.add(t)}off(e,t){let i=this.eventListeners.get(e);i&&i.delete(t)}emit(e,t){let i=this.eventListeners.get(e);i&&i.forEach(e=>e(t))}}},71139:(e,t,i)=>{"use strict";i.d(t,{v:()=>n});var r=i(45011);class n{constructor(){}static getInstance({projectId:e,chainId:t,onTimeout:i}){return n.instance||(n.instance=new r.YW({projectId:e,chainId:t,onTimeout:i})),n.instance}}},81696:(e,t,i)=>{"use strict";i.d(t,{_:()=>v});var r=i(80196),n=i(57068),a=i(50639),o=i(21552),s=i(58051);let c=function(e){if(e.length>=255)throw TypeError("Alphabet too long");let t=new Uint8Array(256);for(let e=0;e>>0,l=new Uint8Array(c);for(;e[a];){let r=t[e.charCodeAt(a)];if(255===r)return;let n=0;for(let e=c-1;(0!==r||n>>0,l[e]=r%256>>>0,r=r/256>>>0;if(0!==r)throw Error("Non-zero carry");s=n,a++}let u=c-s;for(;u!==c&&0===l[u];)u++;let d=new Uint8Array(o+(c-u)),h=o;for(;u!==c;)d[h++]=l[u++];return d}return{encode:function(t){if(t instanceof Uint8Array||(ArrayBuffer.isView(t)?t=new Uint8Array(t.buffer,t.byteOffset,t.byteLength):Array.isArray(t)&&(t=Uint8Array.from(t))),!(t instanceof Uint8Array))throw TypeError("Expected Uint8Array");if(0===t.length)return"";let n=0,o=0,s=0,c=t.length;for(;s!==c&&0===t[s];)s++,n++;let l=(c-s)*a+1>>>0,u=new Uint8Array(l);for(;s!==c;){let e=t[s],r=0;for(let t=l-1;(0!==e||r>>0,u[t]=e%i>>>0,e=e/i>>>0;if(0!==e)throw Error("Non-zero carry");o=r,s++}let d=l-o;for(;d!==l&&0===u[d];)d++;let h=r.repeat(n);for(;d"WALLET_CONNECT"===e.type),i=t?.provider;if(!this.caipNetworks||!i)throw Error("UniversalAdapter:connectWalletConnect - caipNetworks or provider is undefined");i.on("display_uri",t=>{e(t)});let r=s.k.createNamespaces(this.caipNetworks);await i.connect({optionalNamespaces:r})}async connect(e){return Promise.resolve({id:"WALLET_CONNECT",type:"WALLET_CONNECT",chainId:Number(e.chainId),provider:this.provider,address:""})}async disconnect(){let e=this.connectors.find(e=>"WALLET_CONNECT"===e.id),t=e?.provider;await t?.disconnect()}async syncConnectors(){return Promise.resolve()}async getBalance(){return Promise.resolve({balance:"0",decimals:0,symbol:""})}async signMessage(e){let{provider:t,message:i,address:n}=e;if(!t)throw Error("UniversalAdapter:signMessage - provider is undefined");return{signature:r.WB.state.activeCaipNetwork?.chainNamespace===a.oU.CHAIN.SOLANA?(await t.request({method:"solana_signMessage",params:{message:c.encode(new TextEncoder().encode(i)),pubkey:n}},r.WB.state.activeCaipNetwork?.caipNetworkId)).signature:await t.request({method:"personal_sign",params:[i,n]},r.WB.state.activeCaipNetwork?.caipNetworkId)}}async estimateGas(){return Promise.resolve({gas:BigInt(0)})}async getProfile(){return Promise.resolve({profileImage:"",profileName:""})}async sendTransaction(){return Promise.resolve({hash:""})}async writeContract(){return Promise.resolve({hash:""})}async getEnsAddress(){return Promise.resolve({address:!1})}parseUnits(){return 0n}formatUnits(){return"0"}async getCapabilities(){return Promise.resolve({})}async grantPermissions(){return Promise.resolve({})}async revokePermissions(){return Promise.resolve("0x")}async syncConnection(){return Promise.resolve({id:"WALLET_CONNECT",type:"WALLET_CONNECT",chainId:1,provider:this.provider,address:""})}async switchNetwork(e){let{caipNetwork:t}=e,i=this.connectors.find(e=>"WALLET_CONNECT"===e.type),r=i?.provider;if(!r)throw Error("UniversalAdapter:switchNetwork - provider is undefined");r.setDefaultChain(`${t.chainNamespace}:${String(t.id)}`)}getWalletConnectProvider(){let e=this.connectors.find(e=>"WALLET_CONNECT"===e.type);return e?.provider}}var u=i(60402),d=i(45011),h=i(10491),p=i(27258),f=i(71139);let g={currentTab:0,tokenBalance:[],smartAccountDeployed:!1,addressLabels:new Map,allAccounts:[]},w={supportsAllNetworks:!0,smartAccountEnabledNetworks:[]},m=["eth_accounts","eth_requestAccounts","eth_sendRawTransaction","eth_sign","eth_signTransaction","eth_signTypedData","eth_signTypedData_v3","eth_signTypedData_v4","eth_sendTransaction","personal_sign","wallet_switchEthereumChain","wallet_addEthereumChain","wallet_getPermissions","wallet_requestPermissions","wallet_registerOnboarding","wallet_watchAsset","wallet_scanQRCode","wallet_getCallsStatus","wallet_sendCalls","wallet_getCapabilities","wallet_grantPermissions","wallet_revokePermissions"],b=!1;class v{constructor(e){this.chainNamespaces=[],this.initPromise=void 0,this.setStatus=(e,t)=>{r.iT.setConnectionStatus(e),r.Uj.setStatus(e,t)},this.getIsConnectedState=()=>!!r.WB.state.activeCaipAddress,this.setAllAccounts=(e,t)=>{r.Uj.setAllAccounts(e,t),r.Hd.setHasMultipleAddresses(e?.length>1)},this.addAddressLabel=(e,t,i)=>{r.Uj.addAddressLabel(e,t,i)},this.removeAddressLabel=(e,t)=>{r.Uj.removeAddressLabel(e,t)},this.getCaipAddress=e=>r.WB.state.activeChain!==e&&e?r.WB.getAccountProp("caipAddress",e):r.WB.state.activeCaipAddress,this.getAddressByChainNamespace=e=>r.WB.getAccountProp("address",e),this.getAddress=e=>r.WB.state.activeChain!==e&&e?r.WB.getAccountProp("address",e):r.Uj.state.address,this.getProvider=()=>r.Uj.state.provider,this.getPreferredAccountType=()=>r.Uj.state.preferredAccountType,this.setCaipAddress=(e,t)=>{r.Uj.setCaipAddress(e,t)},this.setProvider=(e,t)=>{r.Uj.setProvider(e,t)},this.setBalance=(e,t,i)=>{r.Uj.setBalance(e,t,i)},this.setProfileName=(e,t)=>{r.Uj.setProfileName(e,t)},this.setProfileImage=(e,t)=>{r.Uj.setProfileImage(e,t)},this.resetAccount=e=>{r.Uj.resetAccount(e)},this.setCaipNetwork=e=>{r.WB.setActiveCaipNetwork(e)},this.getCaipNetwork=e=>e?r.WB.getRequestedCaipNetworks(e).filter(t=>t.chainNamespace===e)?.[0]:r.WB.state.activeCaipNetwork,this.getCaipNetworkId=()=>{let e=this.getCaipNetwork();if(e)return e.id},this.getCaipNetworks=e=>r.WB.getRequestedCaipNetworks(e),this.getActiveChainNamespace=()=>r.WB.state.activeChain,this.setRequestedCaipNetworks=(e,t)=>{r.WB.setRequestedCaipNetworks(e,t)},this.getApprovedCaipNetworkIds=()=>r.WB.getAllApprovedCaipNetworkIds(),this.setApprovedCaipNetworksData=e=>r.WB.setApprovedCaipNetworksData(e),this.resetNetwork=e=>{r.WB.resetNetwork(e)},this.setConnectors=e=>{let t=[...r.aK.getConnectors(),...e];r.aK.setConnectors(t)},this.addConnector=e=>{r.aK.addConnector(e)},this.getConnectors=()=>r.aK.getConnectors(),this.resetWcConnection=()=>{r.x4.resetWcConnection()},this.fetchIdentity=e=>r.TP.fetchIdentity(e),this.setAddressExplorerUrl=(e,t)=>{r.Uj.setAddressExplorerUrl(e,t)},this.setSmartAccountDeployed=(e,t)=>{r.Uj.setSmartAccountDeployed(e,t)},this.setConnectedWalletInfo=(e,t)=>{r.Uj.setConnectedWalletInfo(e,t)},this.setSmartAccountEnabledNetworks=(e,t)=>{r.WB.setSmartAccountEnabledNetworks(e,t)},this.setPreferredAccountType=(e,t)=>{r.Uj.setPreferredAccountType(e,t)},this.getReownName=e=>r.f.getNamesForAddress(e),this.setEIP6963Enabled=e=>{r.Hd.setEIP6963Enabled(e)},this.setClientId=e=>{r.TP.setClientId(e)},this.getConnectorImage=e=>r.$m.getConnectorImage(e),this.handleUnsafeRPCRequest=()=>{this.isOpen()?this.isTransactionStackEmpty()||this.redirect("ApproveTransaction"):this.open({view:"ApproveTransaction"})},this.options=e,this.initialize(e)}static getInstance(){return this.instance}async initialize(e){this.caipNetworks=this.extendCaipNetworks(e),this.defaultCaipNetwork=this.extendDefaultCaipNetwork(e),await this.initControllers(e),this.createAuthProvider(),await this.createUniversalProvider(),this.createClients(),r.WB.initialize(e.adapters??[]),this.chainAdapters=await this.createAdapters(e.adapters),await this.initChainAdapters(),this.syncRequestedNetworks(),await this.initOrContinue(),await this.syncExistingConnection(),this.version=e.sdkVersion}async open(e){await this.initOrContinue(),r.W3.open(e)}async close(){await this.initOrContinue(),r.W3.close()}setLoading(e){r.W3.setLoading(e)}getError(){return""}getChainId(){return r.WB.state.activeCaipNetwork?.id}switchNetwork(e){let t=this.caipNetworks?.find(t=>t.id===e.id);if(!t){r.hG.open(u.RQ.ALERT_ERRORS.SWITCH_NETWORK_NOT_FOUND,"error");return}r.WB.switchActiveNetwork(t)}getWalletProvider(){return r.WB.state.activeChain?h.A.state.providers[r.WB.state.activeChain]:null}getWalletProviderType(){return r.WB.state.activeChain?h.A.state.providerIds[r.WB.state.activeChain]:null}subscribeProvider(){return null}getThemeMode(){return r.Wn.state.themeMode}getThemeVariables(){return r.Wn.state.themeVariables}setThemeMode(e){r.Wn.setThemeMode(e),(0,n.setColorTheme)(r.Wn.state.themeMode)}setThemeVariables(e){r.Wn.setThemeVariables(e),(0,n.setThemeVariables)(r.Wn.state.themeVariables)}subscribeTheme(e){return r.Wn.subscribe(e)}getWalletInfo(){return r.Uj.state.connectedWalletInfo}subscribeAccount(e){function t(){e({caipAddress:r.WB.state.activeCaipAddress,address:r.wE.getPlainAddress(r.WB.state.activeCaipAddress),isConnected:!!r.WB.state.activeCaipAddress,status:r.Uj.state.status})}r.WB.subscribe(t),r.Uj.subscribe(t)}subscribeNetwork(e){return r.WB.subscribe(({activeCaipNetwork:t})=>{e({caipNetwork:t,chainId:t?.id,caipNetworkId:t?.caipNetworkId})})}subscribeWalletInfo(e){return r.Uj.subscribeKey("connectedWalletInfo",e)}subscribeShouldUpdateToAddress(e){r.Uj.subscribeKey("shouldUpdateToAddress",e)}subscribeCaipNetworkChange(e){r.WB.subscribeKey("activeCaipNetwork",e)}getState(){return r.z3.state}subscribeState(e){return r.z3.subscribe(e)}showErrorMessage(e){r.Pt.showError(e)}showSuccessMessage(e){r.Pt.showSuccess(e)}getEvent(){return{...r.En.state}}subscribeEvents(e){return r.En.subscribe(e)}replace(e){r.IN.replace(e)}redirect(e){r.IN.push(e)}popTransactionStack(e){r.IN.popTransactionStack(e)}isOpen(){return r.W3.state.open}isTransactionStackEmpty(){return 0===r.IN.state.transactionStack.length}isTransactionShouldReplaceView(){return r.IN.state.transactionStack[r.IN.state.transactionStack.length-1]?.replace}async disconnect(){await this.connectionControllerClient?.disconnect()}async initControllers(e){if(r.Hd.setDebug(e.debug),r.Hd.setProjectId(e.projectId),r.Hd.setSdkVersion(e.sdkVersion),!e.projectId){r.hG.open(u.RQ.ALERT_ERRORS.PROJECT_ID_NOT_CONFIGURED,"error");return}this.adapters=e.adapters;let t=this.getDefaultMetaData();if(!e.metadata&&t&&(e.metadata=t),this.setDefaultNetwork(),r.Hd.setAllWallets(e.allWallets),r.Hd.setIncludeWalletIds(e.includeWalletIds),r.Hd.setExcludeWalletIds(e.excludeWalletIds),e.excludeWalletIds&&r.Np.searchWalletByIds({ids:e.excludeWalletIds}),r.Hd.setFeaturedWalletIds(e.featuredWalletIds),r.Hd.setTokens(e.tokens),r.Hd.setTermsConditionsUrl(e.termsConditionsUrl),r.Hd.setPrivacyPolicyUrl(e.privacyPolicyUrl),r.Hd.setCustomWallets(e.customWallets),r.Hd.setFeatures(e.features),r.Hd.setEnableWalletConnect(!1!==e.enableWalletConnect),r.Hd.setEnableWallets(!1!==e.enableWallets),e.metadata&&r.Hd.setMetadata(e.metadata),e.themeMode&&r.Wn.setThemeMode(e.themeMode),e.themeVariables&&r.Wn.setThemeVariables(e.themeVariables),e.disableAppend&&r.Hd.setDisableAppend(!!e.disableAppend),e.siwx&&r.Hd.setSIWX(e.siwx),e.adapters?.find(e=>e.namespace===a.oU.CHAIN.EVM)&&e.siweConfig){if(e.siwx)throw Error("Cannot set both `siweConfig` and `siwx` options");let t=await i.e(86).then(i.bind(i,90086));if("function"!=typeof t.mapToSIWX)throw Error("Please update the `@reown/appkit-siwe` package to the latest version");r.Hd.setSIWX(t.mapToSIWX(e.siweConfig))}}getDefaultMetaData(){return"undefined"!=typeof window&&"undefined"!=typeof document?{name:document.getElementsByTagName("title")[0]?.textContent||"",description:document.querySelector('meta[property="og:description"]')?.content||"",url:window.location.origin,icons:[document.querySelector('link[rel~="icon"]')?.href||""]}:null}setUnsupportedNetwork(e){let t=this.getActiveChainNamespace();t&&r.WB.setActiveCaipNetwork({id:e,caipNetworkId:`${t}:${e}`,name:"Unknown Network",chainNamespace:t,nativeCurrency:{name:"",decimals:0,symbol:""},rpcUrls:{default:{http:[]}}})}extendCaipNetworks(e){return u.R5.extendCaipNetworks(e.networks,{customNetworkImageUrls:e.chainImages,projectId:e.projectId})}extendDefaultCaipNetwork(e){let t=e.networks.find(t=>t.id===e.defaultNetwork?.id);return t?u.R5.extendCaipNetwork(t,{customNetworkImageUrls:e.chainImages,projectId:e.projectId}):void 0}createClients(){this.connectionControllerClient={connectWalletConnect:async e=>{let t=this.getAdapter(r.WB.state.activeChain);this.universalProvider?.on("display_uri",t=>{e(t)}),this.setClientId(await this.universalProvider?.client?.core?.crypto?.getClientId()||null);let i=!1;if(this.universalProvider){let e=this.caipNetworks?.map(e=>e.caipNetworkId)||[];i=await r.UG.universalProviderAuthenticate({universalProvider:this.universalProvider,chains:e,methods:m})}i?this.close():await t?.connectWalletConnect(e,this.getCaipNetwork()?.id),await this.syncWalletConnectAccount()},connectExternal:async({id:e,info:t,type:i,provider:n,chain:a,caipNetwork:o})=>{if(a&&a!==r.WB.state.activeChain&&!o){let e=this.caipNetworks?.find(e=>e.chainNamespace===a);e&&this.setCaipNetwork(e)}let s=a?this.getAdapter(a):this.getAdapter(r.WB.state.activeChain),c=await s?.connect({id:e,info:t,type:i,provider:n,chainId:o?.id||this.getCaipNetwork()?.id,rpcUrl:o?.rpcUrls?.default?.http?.[0]||this.getCaipNetwork()?.rpcUrls?.default?.http?.[0]});c&&(this.syncProvider({...c,chainNamespace:a||r.WB.state.activeChain}),await this.syncAccount({...c,chainNamespace:a||r.WB.state.activeChain})),!this.caipNetworks?.some(e=>e.id===c?.chainId)&&c?.chainId&&this.setUnsupportedNetwork(c.chainId)},reconnectExternal:async({id:e,info:t,type:i,provider:n})=>{let a=this.getAdapter(r.WB.state.activeChain);a?.reconnect&&await a?.reconnect({id:e,info:t,type:i,provider:n,chainId:this.getCaipNetwork()?.id})},disconnect:async()=>{let e=this.getAdapter(r.WB.state.activeChain),t=h.A.getProvider(r.WB.state.activeChain),i=h.A.state.providerIds[r.WB.state.activeChain];await e?.disconnect({provider:t,providerType:i}),this.setStatus("disconnected",r.WB.state.activeChain),a.Ud.removeItem(a.Ws.CONNECTED_CONNECTOR),a.Ud.removeItem(a.Ws.ACTIVE_CAIP_NETWORK_ID),r.WB.state.chains.forEach(e=>{this.resetAccount(e.namespace)})},checkInstalled:e=>e?e.some(e=>!!window.ethereum?.[String(e)]):!!window.ethereum,signMessage:async e=>{let t=this.getAdapter(r.WB.state.activeChain),i=await t?.signMessage({message:e,address:r.Uj.state.address,provider:h.A.getProvider(r.WB.state.activeChain)});return i?.signature||""},sendTransaction:async e=>{if("eip155"===e.chainNamespace){let t=this.getAdapter(r.WB.state.activeChain),i=await t?.sendTransaction(e);return i?.hash||""}return""},estimateGas:async e=>{if("eip155"===e.chainNamespace){let t=this.getAdapter(r.WB.state.activeChain),i=h.A.getProvider(r.WB.state.activeChain),n=this.getCaipNetwork();if(!n)throw Error("CaipNetwork is undefined");let a=await t?.estimateGas({...e,provider:i,caipNetwork:n});return a?.gas||0n}return 0n},getEnsAvatar:async()=>{let e=this.getAdapter(r.WB.state.activeChain),t=await e?.getProfile({address:r.Uj.state.address,chainId:Number(this.getCaipNetwork()?.id)});return t?.profileImage||!1},getEnsAddress:async e=>{let t=this.getAdapter(r.WB.state.activeChain),i=this.getCaipNetwork();if(!i)return!1;let n=await t?.getEnsAddress({name:e,caipNetwork:i});return n?.address||!1},writeContract:async e=>{let t=this.getAdapter(r.WB.state.activeChain),i=this.getCaipNetwork(),n=this.getCaipAddress(),a=h.A.getProvider(r.WB.state.activeChain);if(!i||!n)throw Error("CaipNetwork or CaipAddress is undefined");let o=await t?.writeContract({...e,caipNetwork:i,provider:a,caipAddress:n});return o?.hash},parseUnits:(e,t)=>{let i=this.getAdapter(r.WB.state.activeChain);return i?.parseUnits({value:e,decimals:t})??0n},formatUnits:(e,t)=>{let i=this.getAdapter(r.WB.state.activeChain);return i?.formatUnits({value:e,decimals:t})??"0"},getCapabilities:async e=>{let t=this.getAdapter(r.WB.state.activeChain);await t?.getCapabilities(e)},grantPermissions:async e=>{let t=this.getAdapter(r.WB.state.activeChain);return await t?.grantPermissions(e)},revokePermissions:async e=>{let t=this.getAdapter(r.WB.state.activeChain);return t?.revokePermissions?await t.revokePermissions(e):"0x"}},this.networkControllerClient={switchCaipNetwork:async e=>{if(e){if(r.Uj.state.address&&e.chainNamespace===r.WB.state.activeChain){let t=this.getAdapter(r.WB.state.activeChain),i=h.A.getProvider(r.WB.state.activeChain),n=h.A.state.providerIds[r.WB.state.activeChain];await t?.switchNetwork({caipNetwork:e,provider:i,providerType:n}),this.setCaipNetwork(e),await this.syncAccount({address:r.Uj.state.address,chainId:r.WB.state.activeCaipNetwork?.id,chainNamespace:e.chainNamespace})}else if(r.Uj.state.address){let t=h.A.state.providerIds[r.WB.state.activeChain];if(t===u.oU.CONNECTOR_TYPE_AUTH)try{r.WB.state.activeChain=e.chainNamespace,await this.connectionControllerClient?.connectExternal?.({id:u.oU.AUTH_CONNECTOR_ID,provider:this.authProvider,chain:e.chainNamespace,chainId:e.id,type:u.oU.CONNECTOR_TYPE_AUTH,caipNetwork:e})}catch(r){let i=this.getAdapter(e.chainNamespace);await i?.switchNetwork({caipNetwork:e,provider:this.authProvider,providerType:t})}else if("WALLET_CONNECT"===t)this.setCaipNetwork(e),this.syncWalletConnectAccount();else{this.setCaipNetwork(e);let t=this.getAddressByChainNamespace(e.chainNamespace);t&&this.syncAccount({address:t,chainId:e.id,chainNamespace:e.chainNamespace})}}else this.setCaipNetwork(e)}},getApprovedCaipNetworksData:async()=>{if(h.A.state.providerIds[r.WB.state.activeChain]===u.oU.CONNECTOR_TYPE_WALLET_CONNECT){let e=this.universalProvider?.session?.namespaces;return{supportsAllNetworks:this.universalProvider?.session?.peer?.metadata.name==="MetaMask Wallet",approvedCaipNetworkIds:this.getChainsFromNamespaces(e)}}return{supportsAllNetworks:!0,approvedCaipNetworkIds:[]}}},this.networkControllerClient&&this.connectionControllerClient&&r.x4.setClient(this.connectionControllerClient)}async handleDisconnect(){await this.connectionControllerClient?.disconnect()}async listenAuthConnector(e){this.setLoading(!0);let t=e.getLoginEmailUsed();this.setLoading(t),t&&this.setStatus("connecting",r.WB.state.activeChain);let{isConnected:i}=await e.isConnected();e.onRpcRequest(t=>{d.QH.checkIfRequestExists(t)?d.QH.checkIfRequestIsSafe(t)||this.handleUnsafeRPCRequest():(this.open(),console.error(d.Vl.RPC_METHOD_NOT_ALLOWED_MESSAGE,{method:t.method}),setTimeout(()=>{this.showErrorMessage(d.Vl.RPC_METHOD_NOT_ALLOWED_UI_MESSAGE)},300),e.rejectRpcRequests())}),e.onRpcError(()=>{this.isOpen()&&(this.isTransactionStackEmpty()?this.close():this.popTransactionStack(!0))}),e.onRpcSuccess((e,t)=>{d.QH.checkIfRequestIsSafe(t)||(this.isTransactionStackEmpty()?this.close():this.popTransactionStack())}),e.onNotConnected(()=>{let e=a.Ud.getItem(a.Ws.CONNECTED_CONNECTOR)===u.oU.AUTH_CONNECTOR_ID;!i&&e&&(this.setCaipAddress(void 0,r.WB.state.activeChain),this.setLoading(!1))}),e.onIsConnected(()=>{e.connect()}),e.onConnect(async t=>{this.syncProvider({type:u.oU.CONNECTOR_TYPE_AUTH,provider:e,id:u.oU.AUTH_CONNECTOR_ID,chainNamespace:r.WB.state.activeChain});let i="eip155"===r.WB.state.activeChain?`eip155:${t.chainId}:${t.address}`:`${t.chainId}:${t.address}`;this.setCaipAddress(i,r.WB.state.activeChain),this.setSmartAccountDeployed(!!t.smartAccountDeployed,r.WB.state.activeChain),this.setPreferredAccountType(t.preferredAccountType,r.WB.state.activeChain),this.setAllAccounts(t.accounts||[{address:t.address,type:t.preferredAccountType||"eoa"}],r.WB.state.activeChain),await e.getSmartAccountEnabledNetworks(),this.setLoading(!1)}),e.onGetSmartAccountEnabledNetworks(e=>{this.setSmartAccountEnabledNetworks(e,r.WB.state.activeChain)}),e.onSetPreferredAccount(({address:e,type:t})=>{e&&this.setPreferredAccountType(t,r.WB.state.activeChain)}),i&&this.connectionControllerClient?.connectExternal?(await this.connectionControllerClient?.connectExternal({id:u.oU.AUTH_CONNECTOR_ID,info:{name:u.oU.AUTH_CONNECTOR_ID},type:u.oU.CONNECTOR_TYPE_AUTH,provider:e,chainId:r.WB.state.activeCaipNetwork?.id}),this.setLoading(!1),this.setStatus("connected",r.WB.state.activeChain)):(this.setLoading(!1),this.setStatus("disconnected",r.WB.state.activeChain))}listenWalletConnect(){this.universalProvider&&(this.universalProvider.on("disconnect",()=>{this.chainNamespaces.forEach(e=>{this.resetAccount(e)}),r.x4.resetWcConnection()}),this.universalProvider.on("chainChanged",e=>{let t=this.caipNetworks?.find(t=>t.chainNamespace===r.WB.state.activeChain&&t.id==e),i=this.getCaipNetwork();if(!t){this.setUnsupportedNetwork(e);return}i&&i?.id===t?.id||this.setCaipNetwork(t)}))}listenAdapter(e){let t=this.getAdapter(e),i=r.iT.getConnectionStatus();"connected"===i?this.setStatus("connecting",e):this.setStatus(i,e),t?.on("switchNetwork",({address:t,chainId:i})=>{i&&this.caipNetworks?.find(e=>e.id===i)?r.WB.state.activeChain===e&&t?this.syncAccount({address:t,chainId:i,chainNamespace:e}):r.WB.state.activeChain===e&&r.Uj.state.address&&this.syncAccount({address:r.Uj.state.address,chainId:i,chainNamespace:e}):this.setUnsupportedNetwork(i)}),t?.on("disconnect",()=>{r.WB.state.activeChain===e&&this.handleDisconnect()}),t?.on("accountChanged",({address:t,chainId:i})=>{r.WB.state.activeChain===e&&i?this.syncAccount({address:t,chainId:i,chainNamespace:e}):r.WB.state.activeChain===e&&r.WB.state.activeCaipNetwork?.id&&this.syncAccount({address:t,chainId:r.WB.state.activeCaipNetwork?.id,chainNamespace:e})})}getChainsFromNamespaces(e={}){return Object.values(e).flatMap(e=>Array.from(new Set([...e.chains||[],...e.accounts.map(e=>{let[t,i]=e.split(":");return`${t}:${i}`})])))}async syncWalletConnectAccount(){let e=this.getAdapter(r.WB.state.activeChain);r.iT.setConnectedNamespace(r.WB.state.activeChain),this.chainNamespaces.forEach(async t=>{let i=this.universalProvider?.session?.namespaces?.[t]?.accounts[0];if(i){if(h.A.setProviderId(t,u.oU.CONNECTOR_TYPE_WALLET_CONNECT),this.caipNetworks&&r.WB.state.activeCaipNetwork&&e?.namespace!=="eip155"){let i=e?.getWalletConnectProvider({caipNetworks:this.caipNetworks,provider:this.universalProvider,activeCaipNetwork:r.WB.state.activeCaipNetwork});h.A.setProvider(t,i)}else h.A.setProvider(t,this.universalProvider);r.iT.setConnectedConnector(u.oU.CONNECTOR_TYPE_WALLET_CONNECT);let n="";if(n=3===i.split(":").length?i.split(":")[2]:r.Uj.state.address,e?.adapterType==="wagmi")try{await e?.connect({id:"walletConnect",type:"WALLET_CONNECT",chainId:r.WB.state.activeCaipNetwork?.id})}catch(t){e?.reconnect&&e?.reconnect({id:"walletConnect",type:"WALLET_CONNECT"})}this.syncWalletConnectAccounts(t),await this.syncAccount({address:n,chainId:r.WB.state.activeChain===t?r.WB.state.activeCaipNetwork?.id:this.caipNetworks?.find(e=>e.chainNamespace===t)?.id,chainNamespace:t})}}),await r.WB.setApprovedCaipNetworksData(r.WB.state.activeChain)}syncWalletConnectAccounts(e){let t=this.universalProvider?.session?.namespaces?.[e]?.accounts?.map(e=>{let[,,t]=e.split(":");return t}).filter((e,t,i)=>i.indexOf(e)===t);t&&this.setAllAccounts(t.map(e=>({address:e,type:"eoa"})),e)}syncProvider({type:e,provider:t,id:i,chainNamespace:n}){h.A.setProviderId(n,e),h.A.setProvider(n,t),r.iT.setConnectedConnector(i),r.iT.setConnectedNamespace(r.WB.state.activeChain)}async syncAccount({address:e,chainId:t,chainNamespace:i}){if(this.setPreferredAccountType(r.Uj.state.preferredAccountType?r.Uj.state.preferredAccountType:"eoa",r.WB.state.activeChain),this.setCaipAddress(`${i}:${t}:${e}`,i),this.setStatus("connected",i),i===r.WB.state.activeChain){let r=this.caipNetworks?.find(e=>e.id===t&&e.chainNamespace===i);r?this.setCaipNetwork(r):this.setCaipNetwork(this.caipNetworks?.find(e=>e.chainNamespace===i)),this.syncConnectedWalletInfo(i);let n=this.getAdapter(i),a=await n?.getBalance({address:e,chainId:t,caipNetwork:r||this.getCaipNetwork(),tokens:this.options.tokens});a&&this.setBalance(a.balance,a.symbol,i),await this.syncIdentity({address:e,chainId:Number(t),chainNamespace:i})}}syncConnectedWalletInfo(e){let t=a.Ud.getItem(a.Ws.CONNECTED_CONNECTOR),i=h.A.state.providerIds[e];if(i===u.oU.CONNECTOR_TYPE_ANNOUNCED||i===u.oU.CONNECTOR_TYPE_INJECTED){if(t){let i=this.getConnectors().find(e=>e.id===t);i?.info&&this.setConnectedWalletInfo({...i.info},e)}}else if(i===u.oU.CONNECTOR_TYPE_WALLET_CONNECT){let t=h.A.getProvider(e);t?.session&&this.setConnectedWalletInfo({...t.session.peer.metadata,name:t.session.peer.metadata.name,icon:t.session.peer.metadata.icons?.[0]},e)}else if(i===u.oU.COINBASE_CONNECTOR_ID){let t=this.getConnectors().find(e=>e.id===u.oU.COINBASE_CONNECTOR_ID);this.setConnectedWalletInfo({name:"Coinbase Wallet",icon:this.getConnectorImage(t)},e)}else t&&this.setConnectedWalletInfo({name:t},e)}async syncIdentity({address:e,chainId:t,chainNamespace:i}){try{let{name:r,avatar:n}=await this.fetchIdentity({address:e});if(this.setProfileName(r,i),this.setProfileImage(n,i),!r){await this.syncReownName(e,i);let r=this.getAdapter(i),n=await r?.getProfile({address:e,chainId:Number(t)});n?.profileName?(this.setProfileName(n.profileName,i),n.profileImage&&this.setProfileImage(n.profileImage,i)):(await this.syncReownName(e,i),this.setProfileImage(null,i))}}catch{1===t?await this.syncReownName(e,i):(await this.syncReownName(e,i),this.setProfileImage(null,i))}}async syncReownName(e,t){try{let i=await this.getReownName(e);if(i[0]){let e=i[0];this.setProfileName(e.name,t)}else this.setProfileName(null,t)}catch{this.setProfileName(null,t)}}syncRequestedNetworks(){let e=[...new Set(this.caipNetworks?.map(e=>e.chainNamespace))];this.chainNamespaces=e,e.forEach(e=>this.setRequestedCaipNetworks(this.caipNetworks?.filter(t=>t.chainNamespace===e)??[],e))}async syncExistingConnection(){let e=a.Ud.getItem(a.Ws.CONNECTED_CONNECTOR),t=a.Ud.getItem(a.Ws.CONNECTED_NAMESPACE);if(e===u.oU.CONNECTOR_TYPE_WALLET_CONNECT&&t)this.syncWalletConnectAccount();else if(e&&e!==u.oU.CONNECTOR_TYPE_W3M_AUTH&&t){this.setStatus("connecting",t);let i=this.getAdapter(t),r=await i?.syncConnection({id:e,chainId:this.getCaipNetwork()?.id,namespace:t,rpcUrl:this.getCaipNetwork()?.rpcUrls?.default?.http?.[0]});r?(this.syncProvider({...r,chainNamespace:t}),await this.syncAccount({...r,chainNamespace:t}),this.setStatus("connected",t)):this.setStatus("disconnected",t),!this.caipNetworks?.some(e=>e.id===r?.chainId)&&r?.chainId&&this.setUnsupportedNetwork(r.chainId)}else e!==u.oU.CONNECTOR_TYPE_W3M_AUTH&&this.setStatus("disconnected",r.WB.state.activeChain)}getAdapter(e){return this.chainAdapters?.[e]}createUniversalProvider(){return!this.universalProviderInitPromise&&"undefined"!=typeof window&&this.options?.projectId&&(this.universalProviderInitPromise=this.initializeUniversalAdapter()),this.universalProviderInitPromise}async initializeUniversalAdapter(){let e={projectId:this.options?.projectId,metadata:{name:this.options?.metadata?this.options?.metadata.name:"",description:this.options?.metadata?this.options?.metadata.description:"",url:this.options?.metadata?this.options?.metadata.url:"",icons:this.options?.metadata?this.options?.metadata.icons:[""]}};this.universalProvider=await p.A.init(e)}async getUniversalProvider(){if(!this.universalProvider)try{await this.createUniversalProvider()}catch(e){throw Error("AppKit:getUniversalProvider - Cannot create provider")}return this.universalProvider}createAuthProvider(){let e=this.options?.features?.email===void 0?r.oU.DEFAULT_FEATURES.email:this.options?.features?.email,t=this.options?.features?.socials?this.options?.features?.socials?.length>0:r.oU.DEFAULT_FEATURES.socials;this.options?.projectId&&(e||t)&&(this.authProvider=f.v.getInstance({projectId:this.options.projectId}),this.listenAuthConnector(this.authProvider))}async createAdapters(e){return this.universalProvider||(this.universalProvider=await this.getUniversalProvider()),this.syncRequestedNetworks(),this.chainNamespaces.reduce((t,i)=>{let n=e?.find(e=>e.namespace===i);return n?(t[i]=n,t[i].namespace=i,t[i].construct({namespace:i,projectId:this.options?.projectId,networks:this.caipNetworks}),this.universalProvider&&t[i].setUniversalProvider(this.universalProvider),this.authProvider&&t[i].setAuthProvider(this.authProvider),t[i].syncConnectors(this.options,this)):(t[i]=new l({namespace:i,networks:this.caipNetworks}),this.universalProvider&&t[i].setUniversalProvider(this.universalProvider),this.authProvider&&t[i].setAuthProvider(this.authProvider)),r.WB.state.chains.set(i,{namespace:i,connectionControllerClient:this.connectionControllerClient,networkControllerClient:this.networkControllerClient,networkState:w,accountState:g,caipNetworks:this.caipNetworks??[]}),t},{})}async initChainAdapters(){await Promise.all(this.chainNamespaces.map(async e=>{this.options&&(this.listenAdapter(e),this.setConnectors(this.chainAdapters?.[e]?.connectors||[]))})),this.listenWalletConnect()}setDefaultNetwork(){let e=a.Ud.getItem(a.Ws.ACTIVE_CAIP_NETWORK_ID),t=(e&&this.caipNetworks?.length?this.caipNetworks.find(t=>t.caipNetworkId===e):void 0)||this.defaultCaipNetwork||this.caipNetworks?.[0];t&&r.WB.setActiveCaipNetwork(t)}async initOrContinue(){return!this.initPromise&&!b&&r.wE.isClient()&&(b=!0,this.initPromise=new Promise(async e=>{await Promise.all([Promise.resolve().then(i.bind(i,57068)),i.e(5453).then(i.bind(i,15453))]);let t=document.createElement("w3m-modal");r.Hd.state.disableAppend||document.body.insertAdjacentElement("beforeend",t),e()})),this.initPromise}}},93113:(e,t,i)=>{"use strict";i.d(t,{D8t:()=>r.D,rCZ:()=>n.r,Gby:()=>a.G,tWt:()=>s,Rn0:()=>c});var r=i(46753),n=i(63645),a=i(50952);function o(e){return{formatters:void 0,fees:void 0,serializers:void 0,...e}}let s=o({id:"5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp",name:"Solana",network:"solana-mainnet",nativeCurrency:{name:"Solana",symbol:"SOL",decimals:9},rpcUrls:{default:{http:["https://rpc.walletconnect.org/v1"]}},blockExplorers:{default:{name:"Solscan",url:"https://solscan.io"}},testnet:!1,chainNamespace:"solana",caipNetworkId:"solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp",deprecatedCaipNetworkId:"solana:4sGjMW1sUnHzSxGspuhpqLDx6wiyjNtZ"}),c=o({id:"EtWTRABZaYq6iMfeYKouRu166VU2xqa1",name:"Solana Devnet",network:"solana-devnet",nativeCurrency:{name:"Solana",symbol:"SOL",decimals:9},rpcUrls:{default:{http:["https://rpc.walletconnect.org/v1"]}},blockExplorers:{default:{name:"Solscan",url:"https://solscan.io"}},testnet:!0,chainNamespace:"solana",caipNetworkId:"solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1",deprecatedCaipNetworkId:"solana:8E9rvCKLFQia2Y35HXjjpWzj8weVo44K"});o({id:"4uhcVJyU9pJkvQyS88uRDiswHXSCkY3z",name:"Solana Testnet",network:"solana-testnet",nativeCurrency:{name:"Solana",symbol:"SOL",decimals:9},rpcUrls:{default:{http:["https://rpc.walletconnect.org/v1"]}},blockExplorers:{default:{name:"Solscan",url:"https://solscan.io"}},testnet:!0,chainNamespace:"solana",caipNetworkId:"solana:4uhcVJyU9pJkvQyS88uRDiswHXSCkY3z"}),o({id:"000000000019d6689c085ae165831e93",caipNetworkId:"bip122:000000000019d6689c085ae165831e93",chainNamespace:"bip122",name:"Bitcoin",nativeCurrency:{name:"Bitcoin",symbol:"BTC",decimals:8},rpcUrls:{default:{http:["https://rpc.walletconnect.org/v1"]}}}),o({id:"000000000933ea01ad0ee984209779ba",caipNetworkId:"bip122:000000000933ea01ad0ee984209779ba",chainNamespace:"bip122",name:"Bitcoin Testnet",nativeCurrency:{name:"Bitcoin",symbol:"BTC",decimals:8},rpcUrls:{default:{http:["https://rpc.walletconnect.org/v1"]}}})},10491:(e,t,i)=>{"use strict";i.d(t,{A:()=>s});var r=i(2614),n=i(5061);let a={eip155:void 0,solana:void 0,polkadot:void 0,bip122:void 0},o=(0,r.BX)({providers:{...a},providerIds:{...a}}),s={state:o,subscribeKey:(e,t)=>(0,n.u$)(o,e,t),subscribeProviders:e=>(0,r.B1)(o.providers,()=>e(o.providers)),setProvider(e,t){t&&(o.providers[e]=(0,r.KR)(t))},getProvider:e=>o.providers[e],setProviderId(e,t){t&&(o.providerIds[e]=t)},getProviderId:e=>o.providerIds[e],reset(){o.providers={...a},o.providerIds={...a}},resetChain(e){o.providers[e]=void 0,o.providerIds[e]=void 0}}},58051:(e,t,i)=>{"use strict";i.d(t,{k:()=>a});var r=i(80196),n=i(93113);let a={getMethodsByChainNamespace(e){switch(e){case"solana":return["solana_signMessage","solana_signTransaction","solana_requestAccounts","solana_getAccounts","solana_signAllTransactions","solana_signAndSendTransaction"];case"eip155":return["personal_sign","eth_sign","eth_signTransaction","eth_signTypedData","eth_signTypedData_v3","eth_signTypedData_v4","eth_sendRawTransaction","eth_sendTransaction","wallet_getCapabilities","wallet_sendCalls","wallet_showCallsStatus","wallet_getCallsStatus","wallet_grantPermissions","wallet_revokePermissions","wallet_switchEthereumChain"];case"bip122":return["sendTransfer","signMessage","signPsbt","getAccountAddresses"];default:return[]}},createNamespaces(e){return e.reduce((e,t)=>{let{id:i,chainNamespace:r,rpcUrls:a}=t,o=a.default.http[0],s=this.getMethodsByChainNamespace(r);e[r]||(e[r]={methods:s,events:["accountsChanged","chainChanged"],chains:[],rpcMap:{}});let c=`${r}:${i}`,l=e[r];switch(l.chains.push(c),c){case n.tWt.caipNetworkId:l.chains.push(n.tWt.deprecatedCaipNetworkId);break;case n.Rn0.caipNetworkId:l.chains.push(n.Rn0.deprecatedCaipNetworkId)}return l?.rpcMap&&o&&(l.rpcMap[i]=o),e},{})},resolveReownName:async e=>{let t=await r.f.resolveName(e),i=Object.values(t?.addresses)||[];return i[0]?.address||!1},getChainsFromNamespaces:(e={})=>Object.values(e).flatMap(e=>Array.from(new Set([...e.chains||[],...e.accounts.map(e=>{let[t,i]=e.split(":");return`${t}:${i}`})])))}},42856:(e,t,i)=>{"use strict";i.d(t,{u:()=>l});var r=i(83320),n=i(84671),a=i(61282),o=i(7270),s=i(61678),c=i(81867);function l(e){let t,u,d,h,p,f,g,w;let m=e.isNewChainsStale??!0;return(0,r.U)(r=>({id:"walletConnect",name:"WalletConnect",type:l.type,async setup(){let e=await this.getProvider().catch(()=>null);e&&(p||(p=this.onConnect.bind(this),e.on("connect",p)),g||(g=this.onSessionDelete.bind(this),e.on("session_delete",g)))},async connect({chainId:e,...t}={}){try{let i=await this.getProvider();if(!i)throw new n.N;f||(f=this.onDisplayUri,i.on("display_uri",f));let a=e;if(!a){let e=await r.storage?.getItem("state")??{};a=r.chains.some(t=>t.id===e.chainId)?e.chainId:r.chains[0]?.id}if(!a)throw Error("No chains found on connector.");let s=await this.isChainsStale();if(i.session&&s&&await i.disconnect(),!i.session||s){let e=r.chains.filter(e=>e.id!==a).map(e=>e.id);await i.connect({optionalChains:[a,...e],..."pairingTopic"in t?{pairingTopic:t.pairingTopic}:{}}),this.setRequestedChainsIds(r.chains.map(e=>e.id))}let c=(await i.enable()).map(e=>(0,o.b)(e)),l=await this.getChainId();return f&&(i.removeListener("display_uri",f),f=void 0),p&&(i.removeListener("connect",p),p=void 0),d||(d=this.onAccountsChanged.bind(this),i.on("accountsChanged",d)),h||(h=this.onChainChanged.bind(this),i.on("chainChanged",h)),w||(w=this.onDisconnect.bind(this),i.on("disconnect",w)),g||(g=this.onSessionDelete.bind(this),i.on("session_delete",g)),{accounts:c,chainId:l}}catch(e){if(/(user rejected|connection request reset)/i.test(e?.message))throw new s.vx(e);throw e}},async disconnect(){let e=await this.getProvider();try{await e?.disconnect()}catch(e){if(!/No matching key/i.test(e.message))throw e}finally{h&&(e?.removeListener("chainChanged",h),h=void 0),w&&(e?.removeListener("disconnect",w),w=void 0),p||(p=this.onConnect.bind(this),e?.on("connect",p)),d&&(e?.removeListener("accountsChanged",d),d=void 0),g&&(e?.removeListener("session_delete",g),g=void 0),this.setRequestedChainsIds([])}},async getAccounts(){return(await this.getProvider()).accounts.map(e=>(0,o.b)(e))},async getProvider({chainId:n}={}){async function a(){let t=r.chains.map(e=>e.id);if(!t.length)return;let{EthereumProvider:n}=await i.e(2084).then(i.bind(i,62084));return await n.init({...e,disableProviderPing:!0,optionalChains:t,projectId:e.projectId,rpcMap:Object.fromEntries(r.chains.map(e=>{let[t]=function(e){let{chain:t}=e,i=t.rpcUrls.default.http[0];if(!e.transports)return[i];let r=e.transports?.[t.id]?.({chain:t});return(r?.value?.transports||[r]).map(({value:e})=>e?.url||i)}({chain:e,transports:r.transports});return[e.id,t]})),showQrModal:e.showQrModal??!0})}return t||(u||(u=a()),t=await u,t?.events.setMaxListeners(Number.POSITIVE_INFINITY)),n&&await this.switchChain?.({chainId:n}),t},async getChainId(){return(await this.getProvider()).chainId},async isAuthorized(){try{let[e,t]=await Promise.all([this.getAccounts(),this.getProvider()]);if(!e.length)return!1;if(await this.isChainsStale()&&t.session)return await t.disconnect().catch(()=>{}),!1;return!0}catch{return!1}},async switchChain({addEthereumChainParameter:e,chainId:t}){let i=await this.getProvider();if(!i)throw new n.N;let o=r.chains.find(e=>e.id===t);if(!o)throw new s.ch(new a.nk);try{await Promise.all([new Promise(e=>{let i=({chainId:n})=>{n===t&&(r.emitter.off("change",i),e())};r.emitter.on("change",i)}),i.request({method:"wallet_switchEthereumChain",params:[{chainId:(0,c.cK)(t)}]})]);let e=await this.getRequestedChainsIds();return this.setRequestedChainsIds([...e,t]),o}catch(r){if(/(user rejected)/i.test(r.message))throw new s.vx(r);try{let r,n;r=e?.blockExplorerUrls?e.blockExplorerUrls:o.blockExplorers?.default.url?[o.blockExplorers?.default.url]:[],n=e?.rpcUrls?.length?e.rpcUrls:[...o.rpcUrls.default.http];let a={blockExplorerUrls:r,chainId:(0,c.cK)(t),chainName:e?.chainName??o.name,iconUrls:e?.iconUrls,nativeCurrency:e?.nativeCurrency??o.nativeCurrency,rpcUrls:n};await i.request({method:"wallet_addEthereumChain",params:[a]});let s=await this.getRequestedChainsIds();return this.setRequestedChainsIds([...s,t]),o}catch(e){throw new s.vx(e)}}},onAccountsChanged(e){0===e.length?this.onDisconnect():r.emitter.emit("change",{accounts:e.map(e=>(0,o.b)(e))})},onChainChanged(e){let t=Number(e);r.emitter.emit("change",{chainId:t})},async onConnect(e){let t=Number(e.chainId),i=await this.getAccounts();r.emitter.emit("connect",{accounts:i,chainId:t})},async onDisconnect(e){this.setRequestedChainsIds([]),r.emitter.emit("disconnect");let t=await this.getProvider();d&&(t.removeListener("accountsChanged",d),d=void 0),h&&(t.removeListener("chainChanged",h),h=void 0),w&&(t.removeListener("disconnect",w),w=void 0),g&&(t.removeListener("session_delete",g),g=void 0),p||(p=this.onConnect.bind(this),t.on("connect",p))},onDisplayUri(e){r.emitter.emit("message",{type:"display_uri",data:e})},onSessionDelete(){this.onDisconnect()},getNamespaceChainsIds:()=>t?t.session?.namespaces.eip155?.accounts?.map(e=>Number.parseInt(e.split(":")[1]||""))??[]:[],async getRequestedChainsIds(){return await r.storage?.getItem(this.requestedChainsStorageKey)??[]},async isChainsStale(){if(!m)return!1;let e=r.chains.map(e=>e.id),t=this.getNamespaceChainsIds();if(t.length&&!t.some(t=>e.includes(t)))return!1;let i=await this.getRequestedChainsIds();return!e.every(e=>i.includes(e))},async setRequestedChainsIds(e){await r.storage?.setItem(this.requestedChainsStorageKey,e)},get requestedChainsStorageKey(){return`${this.id}.requestedChains`}}))}l.type="walletConnect"},73546:(e,t,i)=>{"use strict";i.d(t,{N:()=>n});var r=i(61282);async function n(e,t){let i;if((i="function"==typeof t.connector?e._internal.connectors.setup(t.connector):t.connector).uid===e.state.current)throw new r.nM;try{e.setState(e=>({...e,status:"connecting"})),i.emitter.emit("message",{type:"connecting"});let r=await i.connect({chainId:t.chainId}),n=r.accounts;return i.emitter.off("connect",e._internal.events.connect),i.emitter.on("change",e._internal.events.change),i.emitter.on("disconnect",e._internal.events.disconnect),await e.storage?.setItem("recentConnectorId",i.id),e.setState(e=>({...e,connections:new Map(e.connections).set(i.uid,{accounts:n,chainId:r.chainId,connector:i}),current:i.uid,status:"connected"})),{accounts:n,chainId:r.chainId}}catch(t){throw e.setState(e=>({...e,status:e.current?"connected":"disconnected"})),t}}},16603:(e,t,i)=>{"use strict";i.d(t,{l:()=>l});var r=i(17162),n=i(74950),a=i(81867);async function o(e,{account:t=e.account,message:i}){if(!t)throw new n.T({docsPath:"/docs/actions/wallet/signMessage"});let o=(0,r.J)(t);if(o.signMessage)return o.signMessage({message:i});let s="string"==typeof i?(0,a.i3)(i):i.raw instanceof Uint8Array?(0,a.nj)(i.raw):i.raw;return e.request({method:"personal_sign",params:[s,o.address]},{retryCount:0})}var s=i(66604),c=i(36352);async function l(e,t){let i;let{account:r,connector:n,...a}=t;return i="object"==typeof r&&"local"===r.type?e.getClient():await (0,c.r)(e,{account:r,connector:n}),(0,s.T)(i,o,"signMessage")({...a,...r?{account:r}:{}})}},64241:(e,t,i)=>{"use strict";i.d(t,{S:()=>a});var r=i(61282),n=i(84671);async function a(e,t){let{addEthereumChainParameter:i,chainId:a}=t,o=e.state.connections.get(t.connector?.uid??e.state.current);if(o){let e=o.connector;if(!e.switchChain)throw new n.V({connector:e});return await e.switchChain({addEthereumChainParameter:i,chainId:a})}let s=e.chains.find(e=>e.id===a);if(!s)throw new r.nk;return e.setState(e=>({...e,chainId:a})),s}},83320:(e,t,i)=>{"use strict";function r(e){return e}i.d(t,{U:()=>r})},72565:(e,t,i)=>{"use strict";i.d(t,{b:()=>d});var r=i(7270),n=i(61678),a=i(42220),o=i(41525),s=i(81867),c=i(61282),l=i(84671),u=i(83320);function d(e={}){let t,i,f,g;let{shimDisconnect:w=!0,unstable_shimAsyncInject:m}=e;function b(){let t=e.target;if("function"==typeof t){let e=t();if(e)return e}return"object"==typeof t?t:"string"==typeof t?{...h[t]??{id:t,name:`${t[0].toUpperCase()}${t.slice(1)}`,provider:`is${t[0].toUpperCase()}${t.slice(1)}`}}:{id:"injected",name:"Injected",provider:e=>e?.ethereum}}return(0,u.U)(u=>({get icon(){return b().icon},get id(){return b().id},get name(){return b().name},get supportsSimulation(){return!0},type:d.type,async setup(){let i=await this.getProvider();i?.on&&e.target&&(f||(f=this.onConnect.bind(this),i.on("connect",f)),t||(t=this.onAccountsChanged.bind(this),i.on("accountsChanged",t)))},async connect({chainId:a,isReconnecting:o}={}){let s=await this.getProvider();if(!s)throw new l.N;let c=[];if(o)c=await this.getAccounts().catch(()=>[]);else if(w)try{let e=await s.request({method:"wallet_requestPermissions",params:[{eth_accounts:{}}]});(c=e[0]?.caveats?.[0]?.value?.map(e=>r.b(e))).length>0&&(c=await this.getAccounts())}catch(e){if(e.code===n.vx.code)throw new n.vx(e);if(e.code===n.qZ.code)throw e}try{c?.length||o||(c=(await s.request({method:"eth_requestAccounts"})).map(e=>(0,r.b)(e))),f&&(s.removeListener("connect",f),f=void 0),t||(t=this.onAccountsChanged.bind(this),s.on("accountsChanged",t)),i||(i=this.onChainChanged.bind(this),s.on("chainChanged",i)),g||(g=this.onDisconnect.bind(this),s.on("disconnect",g));let l=await this.getChainId();if(a&&l!==a){let e=await this.switchChain({chainId:a}).catch(e=>{if(e.code===n.vx.code)throw e;return{id:l}});l=e?.id??l}return w&&await u.storage?.removeItem(`${this.id}.disconnected`),e.target||await u.storage?.setItem("injected.connected",!0),{accounts:c,chainId:l}}catch(e){if(e.code===n.vx.code)throw new n.vx(e);if(e.code===n.qZ.code)throw new n.qZ(e);throw e}},async disconnect(){let t=await this.getProvider();if(!t)throw new l.N;i&&(t.removeListener("chainChanged",i),i=void 0),g&&(t.removeListener("disconnect",g),g=void 0),f||(f=this.onConnect.bind(this),t.on("connect",f));try{await (0,a.w)(()=>t.request({method:"wallet_revokePermissions",params:[{eth_accounts:{}}]}),{timeout:100})}catch{}w&&await u.storage?.setItem(`${this.id}.disconnected`,!0),e.target||await u.storage?.removeItem("injected.connected")},async getAccounts(){let e=await this.getProvider();if(!e)throw new l.N;return(await e.request({method:"eth_accounts"})).map(e=>(0,r.b)(e))},async getChainId(){let e=await this.getProvider();if(!e)throw new l.N;return Number(await e.request({method:"eth_chainId"}))},async getProvider(){let e;if("undefined"==typeof window)return;let t=b();return(e="function"==typeof t.provider?t.provider(window):"string"==typeof t.provider?p(window,t.provider):t.provider)&&!e.removeListener&&("off"in e&&"function"==typeof e.off?e.removeListener=e.off:e.removeListener=()=>{}),e},async isAuthorized(){try{if(w&&await u.storage?.getItem(`${this.id}.disconnected`)||!e.target&&!await u.storage?.getItem("injected.connected"))return!1;if(!await this.getProvider()){if(void 0!==m&&!1!==m){let e=async()=>("undefined"!=typeof window&&window.removeEventListener("ethereum#initialized",e),!!await this.getProvider()),t="number"==typeof m?m:1e3;if(await Promise.race([..."undefined"!=typeof window?[new Promise(t=>window.addEventListener("ethereum#initialized",()=>t(e()),{once:!0}))]:[],new Promise(i=>setTimeout(()=>i(e()),t))]))return!0}throw new l.N}return!!(await (0,o.b)(()=>this.getAccounts())).length}catch{return!1}},async switchChain({addEthereumChainParameter:e,chainId:t}){let i=await this.getProvider();if(!i)throw new l.N;let r=u.chains.find(e=>e.id===t);if(!r)throw new n.ch(new c.nk);let a=new Promise(e=>{let i=r=>{"chainId"in r&&r.chainId===t&&(u.emitter.off("change",i),e())};u.emitter.on("change",i)});try{return await Promise.all([i.request({method:"wallet_switchEthereumChain",params:[{chainId:(0,s.cK)(t)}]}).then(async()=>{await this.getChainId()===t&&u.emitter.emit("change",{chainId:t})}),a]),r}catch(o){if(4902===o.code||o?.data?.originalError?.code===4902)try{let o,c;let{default:l,...d}=r.blockExplorers??{};e?.blockExplorerUrls?o=e.blockExplorerUrls:l&&(o=[l.url,...Object.values(d).map(e=>e.url)]),c=e?.rpcUrls?.length?e.rpcUrls:[r.rpcUrls.default?.http[0]??""];let h={blockExplorerUrls:o,chainId:(0,s.cK)(t),chainName:e?.chainName??r.name,iconUrls:e?.iconUrls,nativeCurrency:e?.nativeCurrency??r.nativeCurrency,rpcUrls:c};return await Promise.all([i.request({method:"wallet_addEthereumChain",params:[h]}).then(async()=>{if(await this.getChainId()===t)u.emitter.emit("change",{chainId:t});else throw new n.vx(Error("User rejected switch after adding network."))}),a]),r}catch(e){throw new n.vx(e)}if(o.code===n.vx.code)throw new n.vx(o);throw new n.ch(o)}},async onAccountsChanged(e){if(0===e.length)this.onDisconnect();else if(u.emitter.listenerCount("connect")){let e=(await this.getChainId()).toString();this.onConnect({chainId:e}),w&&await u.storage?.removeItem(`${this.id}.disconnected`)}else u.emitter.emit("change",{accounts:e.map(e=>(0,r.b)(e))})},onChainChanged(e){let t=Number(e);u.emitter.emit("change",{chainId:t})},async onConnect(e){let r=await this.getAccounts();if(0===r.length)return;let n=Number(e.chainId);u.emitter.emit("connect",{accounts:r,chainId:n});let a=await this.getProvider();a&&(f&&(a.removeListener("connect",f),f=void 0),t||(t=this.onAccountsChanged.bind(this),a.on("accountsChanged",t)),i||(i=this.onChainChanged.bind(this),a.on("chainChanged",i)),g||(g=this.onDisconnect.bind(this),a.on("disconnect",g)))},async onDisconnect(e){let t=await this.getProvider();e&&1013===e.code&&t&&(await this.getAccounts()).length||(u.emitter.emit("disconnect"),t&&(i&&(t.removeListener("chainChanged",i),i=void 0),g&&(t.removeListener("disconnect",g),g=void 0),f||(f=this.onConnect.bind(this),t.on("connect",f))))}}))}d.type="injected";let h={coinbaseWallet:{id:"coinbaseWallet",name:"Coinbase Wallet",provider:e=>e?.coinbaseWalletExtension?e.coinbaseWalletExtension:p(e,"isCoinbaseWallet")},metaMask:{id:"metaMask",name:"MetaMask",provider:e=>p(e,e=>{if(!e.isMetaMask||e.isBraveWallet&&!e._events&&!e._state)return!1;for(let t of["isApexWallet","isAvalanche","isBitKeep","isBlockWallet","isKuCoinWallet","isMathWallet","isOkxWallet","isOKExWallet","isOneInchIOSWallet","isOneInchAndroidWallet","isOpera","isPortal","isRabby","isTokenPocket","isTokenary","isUniswapWallet","isZerion"])if(e[t])return!1;return!0})},phantom:{id:"phantom",name:"Phantom",provider:e=>e?.phantom?.ethereum?e.phantom?.ethereum:p(e,"isPhantom")}};function p(e,t){function i(e){return"function"==typeof t?t(e):"string"!=typeof t||e[t]}let r=e.ethereum;return r?.providers?r.providers.find(e=>i(e)):r&&i(r)?r:void 0}},32130:(e,t,i)=>{"use strict";i.d(t,{w:()=>s,Q:()=>c});var r=i(48145);function n(e,t){return e.slice(0,t).join(".")||"."}function a(e,t){let{length:i}=e;for(let r=0;r{let r=i;return"bigint"==typeof r&&(r={__type:"bigint",value:i.toString()}),r instanceof Map&&(r={__type:"Map",value:Array.from(i.entries())}),t?.(e,r)??r},r),i??void 0)}function s(e){let{deserialize:t=r.i,key:i="wagmi",serialize:n=o,storage:a=c}=e;function s(e){return e instanceof Promise?e.then(e=>e).catch(()=>null):e}return{...a,key:i,async getItem(e,r){let n=a.getItem(`${i}.${e}`),o=await s(n);return o?t(o)??null:r??null},async setItem(e,t){let r=`${i}.${e}`;null===t?await s(a.removeItem(r)):await s(a.setItem(r,n(t)))},async removeItem(e){await s(a.removeItem(`${i}.${e}`))}}}let c={getItem:()=>null,setItem:()=>{},removeItem:()=>{}}},84671:(e,t,i)=>{"use strict";i.d(t,{N:()=>n,V:()=>a});var r=i(11612);class n extends r.C{constructor(){super("Provider not found."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ProviderNotFoundError"})}}class a extends r.C{constructor({connector:e}){super(`"${e.name}" does not support programmatic chain switching.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SwitchChainNotSupportedError"})}}},46564:(e,t,i)=>{"use strict";i.d(t,{T2:()=>a,iM:()=>n});var r=i(48145);let n={getItem:e=>"undefined"==typeof window?null:o(document.cookie,e)??null,setItem(e,t){"undefined"!=typeof window&&(document.cookie=`${e}=${t};path=/;samesite=Lax`)},removeItem(e){"undefined"!=typeof window&&(document.cookie=`${e}=;max-age=-1;path=/`)}};function a(e,t){if(!t)return;let i=o(t,`${e.storage?.key}.store`);if(i)return(0,r.i)(i).state}function o(e,t){let i=e.split("; ").find(e=>e.startsWith(`${t}=`));if(i)return i.substring(t.length+1)}},48145:(e,t,i)=>{"use strict";function r(e,t){return JSON.parse(e,(e,i)=>{let r=i;return r?.__type==="bigint"&&(r=BigInt(r.value)),r?.__type==="Map"&&(r=new Map(r.value)),t?.(e,r)??r})}i.d(t,{i:()=>r})},66499:(e,t,i)=>{"use strict";i.d(t,{g:()=>w});var r=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,n=Math.ceil,a=Math.floor,o="[BigNumber Error] ",s=o+"Number primitive has more than 15 significant digits: ",c=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13];function l(e){var t=0|e;return e>0||e===t?t:t-1}function u(e){for(var t,i,r=1,n=e.length,a=e[0]+"";rl^i?1:-1;for(o=0,s=(c=n.length)<(l=a.length)?c:l;oa[o]^i?1:-1;return c==l?0:c>l^i?1:-1}function h(e,t,i,r){if(ei||e!==a(e))throw Error(o+(r||"Argument")+("number"==typeof e?ei?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function p(e){var t=e.c.length-1;return l(e.e/14)==t&&e.c[t]%2!=0}function f(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function g(e,t,i){var r,n;if(t<0){for(n=i+".";++t;n+=i);e=n+e}else if(r=e.length,++t>r){for(n=i,t-=r;--t;n+=i);e+=n}else tP?f.c=f.e=null:e.e=10;l/=10,c++);c>P?f.c=f.e=null:(f.e=c,f.c=[e]);return}p=String(e)}else{if(!r.test(p=String(e)))return A(f,p,u);f.s=45==p.charCodeAt(0)?(p=p.slice(1),-1):1}(c=p.indexOf("."))>-1&&(p=p.replace(".","")),(l=p.search(/e/i))>0?(c<0&&(c=l),c+=+p.slice(l+1),p=p.substring(0,l)):c<0&&(c=p.length)}else{if(h(t,2,U.length,"Base"),10==t&&$)return q(f=new L(e),k+f.e+1,I);if(p=String(e),u="number"==typeof e){if(0*e!=0)return A(f,p,u,t);if(f.s=1/e<0?(p=p.slice(1),-1):1,L.DEBUG&&p.replace(/^0\.0*|\./,"").length>15)throw Error(s+e)}else f.s=45===p.charCodeAt(0)?(p=p.slice(1),-1):1;for(i=U.slice(0,t),c=l=0,d=p.length;li.indexOf(n=p.charAt(l))){if("."==n){if(l>c){c=d;continue}}else if(!o&&(p==p.toUpperCase()&&(p=p.toLowerCase())||p==p.toLowerCase()&&(p=p.toUpperCase()))){o=!0,l=-1,c=0;continue}return A(f,String(e),u,t)}u=!1,(c=(p=C(p,t,10,f.s)).indexOf("."))>-1?p=p.replace(".",""):c=p.length}for(l=0;48===p.charCodeAt(l);l++);for(d=p.length;48===p.charCodeAt(--d););if(p=p.slice(l,++d)){if(d-=l,u&&L.DEBUG&&d>15&&(e>0x1fffffffffffff||e!==a(e)))throw Error(s+f.s*e);if((c=c-l-1)>P)f.c=f.e=null;else if(c=T)?f(c,o):g(c,o,"0");else if(a=(e=q(new L(e),t,i)).e,s=(c=u(e.c)).length,1==r||2==r&&(t<=a||a<=S)){for(;ss){if(--t>0)for(c+=".";t--;c+="0");}else if((t+=a-s)>0)for(a+1==s&&(c+=".");t--;c+="0");return e.s<0&&n?"-"+c:c}function B(e,t){for(var i,r,n=1,a=new L(e[0]);n=10;n/=10,r++);return(i=r+14*i-1)>P?e.c=e.e=null:i=10;u/=10,o++);if((s=t-o)<0)s+=14,l=t,p=a((d=f[h=0])/c[o-l-1]%10);else if((h=n((s+1)/14))>=f.length){if(r){for(;f.length<=h;f.push(0));d=p=0,o=1,s%=14,l=s-14+1}else break t}else{for(o=1,d=u=f[h];u>=10;u/=10,o++);s%=14,p=(l=s-14+o)<0?0:a(d/c[o-l-1]%10)}if(r=r||t<0||null!=f[h+1]||(l<0?d:d%c[o-l-1]),r=i<4?(p||r)&&(0==i||i==(e.s<0?3:2)):p>5||5==p&&(4==i||r||6==i&&(s>0?l>0?d/c[o-l]:0:f[h-1])%10&1||i==(e.s<0?8:7)),t<1||!f[0])return f.length=0,r?(t-=e.e+1,f[0]=c[(14-t%14)%14],e.e=-t||0):f[0]=e.e=0,e;if(0==s?(f.length=h,u=1,h--):(f.length=h+1,u=c[14-s],f[h]=l>0?a(d/c[o-l]%c[l])*u:0),r)for(;;){if(0==h){for(s=1,l=f[0];l>=10;l/=10,s++);for(l=f[0]+=u,u=1;l>=10;l/=10,u++);s!=u&&(e.e++,1e14==f[0]&&(f[0]=1));break}if(f[h]+=u,1e14!=f[h])break;f[h--]=0,u=1}for(s=f.length;0===f[--s];f.pop());}e.e>P?e.c=e.e=null:e.e=T?f(t,i):g(t,i,"0"),e.s<0?"-"+t:t)}return L.clone=e,L.ROUND_UP=0,L.ROUND_DOWN=1,L.ROUND_CEIL=2,L.ROUND_FLOOR=3,L.ROUND_HALF_UP=4,L.ROUND_HALF_DOWN=5,L.ROUND_HALF_EVEN=6,L.ROUND_HALF_CEIL=7,L.ROUND_HALF_FLOOR=8,L.EUCLID=9,L.config=L.set=function(e){var t,i;if(null!=e){if("object"==typeof e){if(e.hasOwnProperty(t="DECIMAL_PLACES")&&(h(i=e[t],0,1e9,t),k=i),e.hasOwnProperty(t="ROUNDING_MODE")&&(h(i=e[t],0,8,t),I=i),e.hasOwnProperty(t="EXPONENTIAL_AT")&&((i=e[t])&&i.pop?(h(i[0],-1e9,0,t),h(i[1],0,1e9,t),S=i[0],T=i[1]):(h(i,-1e9,1e9,t),S=-(T=i<0?-i:i))),e.hasOwnProperty(t="RANGE")){if((i=e[t])&&i.pop)h(i[0],-1e9,-1,t),h(i[1],1,1e9,t),N=i[0],P=i[1];else if(h(i,-1e9,1e9,t),i)N=-(P=i<0?-i:i);else throw Error(o+t+" cannot be zero: "+i)}if(e.hasOwnProperty(t="CRYPTO")){if(!!(i=e[t])===i){if(i){if("undefined"!=typeof crypto&&crypto&&(crypto.getRandomValues||crypto.randomBytes))R=i;else throw R=!i,Error(o+"crypto unavailable")}else R=i}else throw Error(o+t+" not true or false: "+i)}if(e.hasOwnProperty(t="MODULO_MODE")&&(h(i=e[t],0,9,t),O=i),e.hasOwnProperty(t="POW_PRECISION")&&(h(i=e[t],0,1e9,t),M=i),e.hasOwnProperty(t="FORMAT")){if("object"==typeof(i=e[t]))D=i;else throw Error(o+t+" not an object: "+i)}if(e.hasOwnProperty(t="ALPHABET")){if("string"!=typeof(i=e[t])||/^.?$|[+\-.\s]|(.).*\1/.test(i))throw Error(o+t+" invalid: "+i);$="0123456789"==i.slice(0,10),U=i}}else throw Error(o+"Object expected: "+e)}return{DECIMAL_PLACES:k,ROUNDING_MODE:I,EXPONENTIAL_AT:[S,T],RANGE:[N,P],CRYPTO:R,MODULO_MODE:O,POW_PRECISION:M,FORMAT:D,ALPHABET:U}},L.isBigNumber=function(e){if(!e||!0!==e._isBigNumber)return!1;if(!L.DEBUG)return!0;var t,i,r=e.c,n=e.e,s=e.s;t:if("[object Array]"==({}).toString.call(r)){if((1===s||-1===s)&&n>=-1e9&&n<=1e9&&n===a(n)){if(0===r[0]){if(0===n&&1===r.length)return!0;break t}if((t=(n+1)%14)<1&&(t+=14),String(r[0]).length==t){for(t=0;t=1e14||i!==a(i))break t;if(0!==i)return!0}}}else if(null===r&&null===n&&(null===s||1===s||-1===s))return!0;throw Error(o+"Invalid BigNumber: "+e)},L.maximum=L.max=function(){return B(arguments,-1)},L.minimum=L.min=function(){return B(arguments,1)},L.random=(i=0x20000000000000*Math.random()&2097151?function(){return a(0x20000000000000*Math.random())}:function(){return(0x40000000*Math.random()|0)*8388608+(8388608*Math.random()|0)},function(e){var t,r,s,l,u,d=0,p=[],f=new L(_);if(null==e?e=k:h(e,0,1e9),l=n(e/14),R){if(crypto.getRandomValues){for(t=crypto.getRandomValues(new Uint32Array(l*=2));d>>11))>=9e15?(r=crypto.getRandomValues(new Uint32Array(2)),t[d]=r[0],t[d+1]=r[1]):(p.push(u%1e14),d+=2);d=l/2}else if(crypto.randomBytes){for(t=crypto.randomBytes(l*=7);d=9e15?crypto.randomBytes(7).copy(t,d):(p.push(u%1e14),d+=7);d=l/7}else throw R=!1,Error(o+"crypto unavailable")}if(!R)for(;d=10;u/=10,d++);d<14&&(s-=14-d)}return f.e=s,f.c=p,f}),L.sum=function(){for(var e=1,t=arguments,i=new L(t[0]);ei-1&&(null==o[n+1]&&(o[n+1]=0),o[n+1]+=o[n]/i|0,o[n]%=i)}return o.reverse()}return function(i,r,n,a,o){var s,c,l,d,h,p,f,w,m=i.indexOf("."),b=k,v=I;for(m>=0&&(d=M,M=0,i=i.replace(".",""),p=(w=new L(r)).pow(i.length-m),M=d,w.c=t(g(u(p.c),p.e,"0"),10,n,e),w.e=w.c.length),l=d=(f=t(i,r,n,o?(s=U,e):(s=e,U))).length;0==f[--d];f.pop());if(!f[0])return s.charAt(0);if(m<0?--l:(p.c=f,p.e=l,p.s=a,f=(p=x(p,w,b,v,n)).c,h=p.r,l=p.e),m=f[c=l+b+1],d=n/2,h=h||c<0||null!=f[c+1],h=v<4?(null!=m||h)&&(0==v||v==(p.s<0?3:2)):m>d||m==d&&(4==v||h||6==v&&1&f[c-1]||v==(p.s<0?8:7)),c<1||!f[0])i=h?g(s.charAt(1),-b,s.charAt(0)):s.charAt(0);else{if(f.length=c,h)for(--n;++f[--c]>n;)f[c]=0,c||(++l,f=[1].concat(f));for(d=f.length;!f[--d];);for(m=0,i="";m<=d;i+=s.charAt(f[m++]));i=g(i,l,s.charAt(0))}return i}}(),x=function(){function e(e,t,i){var r,n,a,o,s=0,c=e.length,l=t%1e7,u=t/1e7|0;for(e=e.slice();c--;)r=u*(a=e[c]%1e7)+(o=e[c]/1e7|0)*l,s=((n=l*a+r%1e7*1e7+s)/i|0)+(r/1e7|0)+u*o,e[c]=n%i;return s&&(e=[s].concat(e)),e}function t(e,t,i,r){var n,a;if(i!=r)a=i>r?1:-1;else for(n=a=0;nt[n]?1:-1;break}return a}function i(e,t,i,r){for(var n=0;i--;)e[i]-=n,n=e[i]1;e.splice(0,1));}return function(r,n,o,s,c){var u,d,h,p,f,g,w,m,b,v,y,x,C,A,E,_,k,I=r.s==n.s?1:-1,S=r.c,T=n.c;if(!S||!S[0]||!T||!T[0])return new L(r.s&&n.s&&(S?!T||S[0]!=T[0]:T)?S&&0==S[0]||!T?0*I:I/0:NaN);for(b=(m=new L(I)).c=[],I=o+(d=r.e-n.e)+1,c||(c=1e14,d=l(r.e/14)-l(n.e/14),I=I/14|0),h=0;T[h]==(S[h]||0);h++);if(T[h]>(S[h]||0)&&d--,I<0)b.push(1),p=!0;else{for(A=S.length,_=T.length,h=0,I+=2,(f=a(c/(T[0]+1)))>1&&(T=e(T,f,c),S=e(S,f,c),_=T.length,A=S.length),C=_,y=(v=S.slice(0,_)).length;y<_;v[y++]=0);k=[0].concat(k=T.slice()),E=T[0],T[1]>=c/2&&E++;do{if(f=0,(u=t(T,v,_,y))<0){if(x=v[0],_!=y&&(x=x*c+(v[1]||0)),(f=a(x/E))>1)for(f>=c&&(f=c-1),w=(g=e(T,f,c)).length,y=v.length;1==t(g,v,w,y);)f--,i(g,_t(T,v,_,y);)f++,i(v,_=10;I/=10,h++);q(m,o+(m.e=h+14*d-1)+1,s,p)}else m.e=d,m.r=+p;return m}}(),w=/^(-?)0([xbo])(?=\w[\w.]*$)/i,m=/^([^.]+)\.$/,b=/^\.([^.]+)$/,v=/^-?(Infinity|NaN)$/,y=/^\s*\+(?=[\w.])|^\s+|\s+$/g,A=function(e,t,i,r){var n,a=i?t:t.replace(y,"");if(v.test(a))e.s=isNaN(a)?null:a<0?-1:1;else{if(!i&&(a=a.replace(w,function(e,t,i){return n="x"==(i=i.toLowerCase())?16:"b"==i?2:8,r&&r!=n?e:t}),r&&(n=r,a=a.replace(m,"$1").replace(b,"0.$1")),t!=a))return new L(a,n);if(L.DEBUG)throw Error(o+"Not a"+(r?" base "+r:"")+" number: "+t);e.s=null}e.c=e.e=null},E.absoluteValue=E.abs=function(){var e=new L(this);return e.s<0&&(e.s=1),e},E.comparedTo=function(e,t){return d(this,new L(e,t))},E.decimalPlaces=E.dp=function(e,t){var i,r,n;if(null!=e)return h(e,0,1e9),null==t?t=I:h(t,0,8),q(new L(this),e+this.e+1,t);if(!(i=this.c))return null;if(r=((n=i.length-1)-l(this.e/14))*14,n=i[n])for(;n%10==0;n/=10,r--);return r<0&&(r=0),r},E.dividedBy=E.div=function(e,t){return x(this,new L(e,t),k,I)},E.dividedToIntegerBy=E.idiv=function(e,t){return x(this,new L(e,t),0,1)},E.exponentiatedBy=E.pow=function(e,t){var i,r,s,c,l,u,d,h,f,g=this;if((e=new L(e)).c&&!e.isInteger())throw Error(o+"Exponent not an integer: "+H(e));if(null!=t&&(t=new L(t)),u=e.e>14,!g.c||!g.c[0]||1==g.c[0]&&!g.e&&1==g.c.length||!e.c||!e.c[0])return f=new L(Math.pow(+H(g),u?e.s*(2-p(e)):+H(e))),t?f.mod(t):f;if(d=e.s<0,t){if(t.c?!t.c[0]:!t.s)return new L(NaN);(r=!d&&g.isInteger()&&t.isInteger())&&(g=g.mod(t))}else{if(e.e>9&&(g.e>0||g.e<-1||(0==g.e?g.c[0]>1||u&&g.c[1]>=24e7:g.c[0]<8e13||u&&g.c[0]<=9999975e7)))return c=g.s<0&&p(e)?-0:0,g.e>-1&&(c=1/c),new L(d?1/c:c);M&&(c=n(M/14+2))}for(u?(i=new L(.5),d&&(e.s=1),h=p(e)):h=(s=Math.abs(+H(e)))%2,f=new L(_);;){if(h){if(!(f=f.times(g)).c)break;c?f.c.length>c&&(f.c.length=c):r&&(f=f.mod(t))}if(s){if(0===(s=a(s/2)))break;h=s%2}else if(q(e=e.times(i),e.e+1,1),e.e>14)h=p(e);else{if(0==(s=+H(e)))break;h=s%2}g=g.times(g),c?g.c&&g.c.length>c&&(g.c.length=c):r&&(g=g.mod(t))}return r?f:(d&&(f=_.div(f)),t?f.mod(t):c?q(f,M,I,l):f)},E.integerValue=function(e){var t=new L(this);return null==e?e=I:h(e,0,8),q(t,t.e+1,e)},E.isEqualTo=E.eq=function(e,t){return 0===d(this,new L(e,t))},E.isFinite=function(){return!!this.c},E.isGreaterThan=E.gt=function(e,t){return d(this,new L(e,t))>0},E.isGreaterThanOrEqualTo=E.gte=function(e,t){return 1===(t=d(this,new L(e,t)))||0===t},E.isInteger=function(){return!!this.c&&l(this.e/14)>this.c.length-2},E.isLessThan=E.lt=function(e,t){return 0>d(this,new L(e,t))},E.isLessThanOrEqualTo=E.lte=function(e,t){return -1===(t=d(this,new L(e,t)))||0===t},E.isNaN=function(){return!this.s},E.isNegative=function(){return this.s<0},E.isPositive=function(){return this.s>0},E.isZero=function(){return!!this.c&&0==this.c[0]},E.minus=function(e,t){var i,r,n,a,o=this.s;if(t=(e=new L(e,t)).s,!o||!t)return new L(NaN);if(o!=t)return e.s=-t,this.plus(e);var s=this.e/14,c=e.e/14,u=this.c,d=e.c;if(!s||!c){if(!u||!d)return u?(e.s=-t,e):new L(d?this:NaN);if(!u[0]||!d[0])return d[0]?(e.s=-t,e):new L(u[0]?this:3==I?-0:0)}if(s=l(s),c=l(c),u=u.slice(),o=s-c){for((a=o<0)?(o=-o,n=u):(c=s,n=d),n.reverse(),t=o;t--;n.push(0));n.reverse()}else for(r=(a=(o=u.length)<(t=d.length))?o:t,o=t=0;t0)for(;t--;u[i++]=0);for(t=1e14-1;r>o;){if(u[--r]=0;){for(i=0,p=m[n]%1e7,f=m[n]/1e7|0,a=n+(o=c);a>n;)s=f*(u=w[--o]%1e7)+(d=w[o]/1e7|0)*p,i=((u=p*u+s%1e7*1e7+g[a]+i)/1e14|0)+(s/1e7|0)+f*d,g[a--]=u%1e14;g[a]=i}return i?++r:g.splice(0,1),W(e,g,r)},E.negated=function(){var e=new L(this);return e.s=-e.s||null,e},E.plus=function(e,t){var i,r=this.s;if(t=(e=new L(e,t)).s,!r||!t)return new L(NaN);if(r!=t)return e.s=-t,this.minus(e);var n=this.e/14,a=e.e/14,o=this.c,s=e.c;if(!n||!a){if(!o||!s)return new L(r/0);if(!o[0]||!s[0])return s[0]?e:new L(o[0]?this:0*r)}if(n=l(n),a=l(a),o=o.slice(),r=n-a){for(r>0?(a=n,i=s):(r=-r,i=o),i.reverse();r--;i.push(0));i.reverse()}for((r=o.length)-(t=s.length)<0&&(i=s,s=o,o=i,t=r),r=0;t;)r=(o[--t]=o[t]+s[t]+r)/1e14|0,o[t]=1e14===o[t]?0:o[t]%1e14;return r&&(o=[r].concat(o),++a),W(e,o,a)},E.precision=E.sd=function(e,t){var i,r,n;if(null!=e&&!!e!==e)return h(e,1,1e9),null==t?t=I:h(t,0,8),q(new L(this),e,t);if(!(i=this.c))return null;if(r=14*(n=i.length-1)+1,n=i[n]){for(;n%10==0;n/=10,r--);for(n=i[0];n>=10;n/=10,r++);}return e&&this.e+1>r&&(r=this.e+1),r},E.shiftedBy=function(e){return h(e,-0x1fffffffffffff,0x1fffffffffffff),this.times("1e"+e)},E.squareRoot=E.sqrt=function(){var e,t,i,r,n,a=this.c,o=this.s,s=this.e,c=k+4,d=new L("0.5");if(1!==o||!a||!a[0])return new L(!o||o<0&&(!a||a[0])?NaN:a?this:1/0);if(0==(o=Math.sqrt(+H(this)))||o==1/0?(((t=u(a)).length+s)%2==0&&(t+="0"),o=Math.sqrt(+t),s=l((s+1)/2)-(s<0||s%2),i=new L(t=o==1/0?"5e"+s:(t=o.toExponential()).slice(0,t.indexOf("e")+1)+s)):i=new L(o+""),i.c[0]){for((o=(s=i.e)+c)<3&&(o=0);;)if(n=i,i=d.times(n.plus(x(this,n,c,1))),u(n.c).slice(0,o)===(t=u(i.c)).slice(0,o)){if(i.e0&&f>0){for(n=f%s||s,u=p.substr(0,n);n0&&(u+=l+p.slice(n)),h&&(u="-"+u)}r=d?u+(i.decimalSeparator||"")+((c=+i.fractionGroupSize)?d.replace(RegExp("\\d{"+c+"}\\B","g"),"$&"+(i.fractionGroupSeparator||"")):d):u}return(i.prefix||"")+r+(i.suffix||"")},E.toFraction=function(e){var t,i,r,n,a,s,l,d,h,p,f,g,w=this.c;if(null!=e&&(!(l=new L(e)).isInteger()&&(l.c||1!==l.s)||l.lt(_)))throw Error(o+"Argument "+(l.isInteger()?"out of range: ":"not an integer: ")+H(l));if(!w)return new L(this);for(t=new L(_),h=i=new L(_),r=d=new L(_),g=u(w),a=t.e=g.length-this.e-1,t.c[0]=c[(s=a%14)<0?14+s:s],e=!e||l.comparedTo(t)>0?a>0?t:h:l,s=P,P=1/0,l=new L(g),d.c[0]=0;p=x(l,t,0,1),1!=(n=i.plus(p.times(r))).comparedTo(e);)i=r,r=n,h=d.plus(p.times(n=h)),d=n,t=l.minus(p.times(n=t)),l=n;return n=x(e.minus(i),r,0,1),d=d.plus(n.times(h)),i=i.plus(n.times(r)),d.s=h.s=this.s,a*=2,f=1>x(h,r,a,I).minus(this).abs().comparedTo(x(d,i,a,I).minus(this).abs())?[h,r]:[d,i],P=s,f},E.toNumber=function(){return+H(this)},E.toPrecision=function(e,t){return null!=e&&h(e,1,1e9),j(this,e,t,2)},E.toString=function(e){var t,i=this,r=i.s,n=i.e;return null===n?r?(t="Infinity",r<0&&(t="-"+t)):t="NaN":(null==e?t=n<=S||n>=T?f(u(i.c),n):g(u(i.c),n,"0"):10===e&&$?t=g(u((i=q(new L(i),k+n+1,I)).c),i.e,"0"):(h(e,2,U.length,"Base"),t=C(g(u(i.c),n,"0"),10,e,r,!0)),r<0&&i.c[0]&&(t="-"+t)),t},E.valueOf=E.toJSON=function(){return H(this)},E._isBigNumber=!0,E[Symbol.toStringTag]="BigNumber",E[Symbol.for("nodejs.util.inspect.custom")]=E.valueOf,null!=t&&L.set(t),L}()},76170:(e,t,i)=>{"use strict";i.d(t,{b:()=>r});var r=i(30855)},89864:(e,t,i)=>{"use strict";i.d(t,{OA:()=>r,WL:()=>a,u$:()=>n});let r={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},n=e=>(...t)=>({_$litDirective$:e,values:t});class a{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,t,i){this._$Ct=e,this._$AM=t,this._$Ci=i}_$AS(e,t){return this.update(e,t)}update(e,t){return this.render(...t)}}},64982:(e,t,i)=>{"use strict";i.d(t,{JW:()=>_,XX:()=>H,c0:()=>k,ge:()=>W,qy:()=>E,s6:()=>I});let r=globalThis,n=r.trustedTypes,a=n?n.createPolicy("lit-html",{createHTML:e=>e}):void 0,o="$lit$",s=`lit$${(Math.random()+"").slice(9)}$`,c="?"+s,l=`<${c}>`,u=document,d=()=>u.createComment(""),h=e=>null===e||"object"!=typeof e&&"function"!=typeof e,p=Array.isArray,f=e=>p(e)||"function"==typeof e?.[Symbol.iterator],g="[ \n\f\r]",w=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,m=/-->/g,b=/>/g,v=RegExp(`>|${g}(?:([^\\s"'>=/]+)(${g}*=${g}*(?:[^ \f\r"'\`<>=]|("|')|))|$)`,"g"),y=/'/g,x=/"/g,C=/^(?:script|style|textarea|title)$/i,A=e=>(t,...i)=>({_$litType$:e,strings:t,values:i}),E=A(1),_=A(2),k=Symbol.for("lit-noChange"),I=Symbol.for("lit-nothing"),S=new WeakMap,T=u.createTreeWalker(u,129);function N(e,t){if(!Array.isArray(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==a?a.createHTML(t):t}let P=(e,t)=>{let i=e.length-1,r=[],n,a=2===t?"":"",c=w;for(let t=0;t"===d[0]?(c=n??w,h=-1):void 0===d[1]?h=-2:(h=c.lastIndex-d[2].length,u=d[1],c=void 0===d[3]?v:'"'===d[3]?x:y):c===x||c===y?c=v:c===m||c===b?c=w:(c=v,n=void 0);let f=c===v&&e[t+1].startsWith("/>")?" ":"";a+=c===w?i+l:h>=0?(r.push(u),i.slice(0,h)+o+i.slice(h)+s+f):i+s+(-2===h?t:f)}return[N(e,a+(e[i]||"")+(2===t?"":"")),r]};class R{constructor({strings:e,_$litType$:t},i){let r;this.parts=[];let a=0,l=0,u=e.length-1,h=this.parts,[p,f]=P(e,t);if(this.el=R.createElement(p,i),T.currentNode=this.el.content,2===t){let e=this.el.content.firstChild;e.replaceWith(...e.childNodes)}for(;null!==(r=T.nextNode())&&h.length0){r.textContent=n?n.emptyScript:"";for(let i=0;i2||""!==i[0]||""!==i[1]?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=I}_$AI(e,t=this,i,r){let n=this.strings,a=!1;if(void 0===n)(a=!h(e=O(this,e,t,0))||e!==this._$AH&&e!==k)&&(this._$AH=e);else{let r,o;let s=e;for(e=n[0],r=0;r{let r=i?.renderBefore??t,n=r._$litPart$;if(void 0===n){let e=i?.renderBefore??null;r._$litPart$=n=new D(t.insertBefore(d(),e),e,void 0,i??{})}return n._$AI(e),n}},5419:(e,t,i)=>{"use strict";i.d(t,{MZ:()=>r.M,wk:()=>n.w});var r=i(1273),n=i(37857)},60037:(e,t,i)=>{"use strict";i.d(t,{H:()=>a});var r=i(64982),n=i(89864);let a=(0,n.u$)(class extends n.WL{constructor(e){if(super(e),e.type!==n.OA.ATTRIBUTE||"class"!==e.name||e.strings?.length>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(e){return" "+Object.keys(e).filter(t=>e[t]).join(" ")+" "}update(e,[t]){if(void 0===this.it){for(let i in this.it=new Set,void 0!==e.strings&&(this.st=new Set(e.strings.join(" ").split(/\s/).filter(e=>""!==e))),t)t[i]&&!this.st?.has(i)&&this.it.add(i);return this.render(t)}let i=e.element.classList;for(let e of this.it)e in t||(i.remove(e),this.it.delete(e));for(let e in t){let r=!!t[e];r===this.it.has(e)||this.st?.has(e)||(r?(i.add(e),this.it.add(e)):(i.remove(e),this.it.delete(e)))}return r.c0}})},92821:(e,t,i)=>{"use strict";i.d(t,{J:()=>n});var r=i(64982);let n=e=>e??r.s6},87580:(e,t,i)=>{"use strict";i.d(t,{_:()=>f,K:()=>m});var r=i(64982);let{D:n}=r.ge,a=e=>void 0===e.strings;var o=i(89864);let s=(e,t)=>{let i=e._$AN;if(void 0===i)return!1;for(let e of i)e._$AO?.(t,!1),s(e,t);return!0},c=e=>{let t,i;do{if(void 0===(t=e._$AM))break;(i=t._$AN).delete(e),e=t}while(0===i?.size)},l=e=>{for(let t;t=e._$AM;e=t){let i=t._$AN;if(void 0===i)t._$AN=i=new Set;else if(i.has(e))break;i.add(e),h(t)}};function u(e){void 0!==this._$AN?(c(this),this._$AM=e,l(this)):this._$AM=e}function d(e,t=!1,i=0){let r=this._$AH,n=this._$AN;if(void 0!==n&&0!==n.size){if(t){if(Array.isArray(r))for(let e=i;e{e.type==o.OA.CHILD&&(e._$AP??=d,e._$AQ??=u)};class p extends o.WL{constructor(){super(...arguments),this._$AN=void 0}_$AT(e,t,i){super._$AT(e,t,i),l(this),this.isConnected=e._$AU}_$AO(e,t=!0){e!==this.isConnected&&(this.isConnected=e,e?this.reconnected?.():this.disconnected?.()),t&&(s(this,e),c(this))}setValue(e){if(a(this._$Ct))this._$Ct._$AI(e,this);else{let t=[...this._$Ct._$AH];t[this._$Ci]=e,this._$Ct._$AI(t,this,0)}}disconnected(){}reconnected(){}}let f=()=>new g;class g{}let w=new WeakMap,m=(0,o.u$)(class extends p{render(e){return r.s6}update(e,[t]){let i=t!==this.G;return i&&void 0!==this.G&&this.ot(void 0),(i||this.rt!==this.lt)&&(this.G=t,this.ct=e.options?.host,this.ot(this.lt=e.element)),r.s6}ot(e){if("function"==typeof this.G){let t=this.ct??globalThis,i=w.get(t);void 0===i&&(i=new WeakMap,w.set(t,i)),void 0!==i.get(this.G)&&this.G.call(this.ct,void 0),i.set(this.G,e),void 0!==e&&this.G.call(this.ct,e)}else this.G.value=e}get rt(){return"function"==typeof this.G?w.get(this.ct??globalThis)?.get(this.G):this.G?.value}disconnected(){this.rt===this.lt&&this.ot(void 0)}reconnected(){this.ot(this.lt)}})},16896:(e,t,i)=>{"use strict";i.d(t,{WF:()=>a,AH:()=>r.AH,qy:()=>n.qy,JW:()=>n.JW,iz:()=>r.iz});var r=i(21127),n=i(64982);class a extends r.mN{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){let e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){let t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=(0,n.XX)(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return n.c0}}a._$litElement$=!0,a.finalized=!0,globalThis.litElementHydrateSupport?.({LitElement:a});let o=globalThis.litElementPolyfillSupport;o?.({LitElement:a}),(globalThis.litElementVersions??=[]).push("4.0.2")},27095:(e,t,i)=>{"use strict";i.d(t,{Fo:()=>eW});var r={};i.r(r),i.d(r,{identity:()=>R});var n={};i.r(n),i.d(n,{base2:()=>O});var a={};i.r(a),i.d(a,{base8:()=>M});var o={};i.r(o),i.d(o,{base10:()=>D});var s={};i.r(s),i.d(s,{base16:()=>U,base16upper:()=>$});var c={};i.r(c),i.d(c,{base32:()=>L,base32hex:()=>q,base32hexpad:()=>z,base32hexpadupper:()=>F,base32hexupper:()=>H,base32pad:()=>B,base32padupper:()=>W,base32upper:()=>j,base32z:()=>Z});var l={};i.r(l),i.d(l,{base36:()=>V,base36upper:()=>K});var u={};i.r(u),i.d(u,{base58btc:()=>G,base58flickr:()=>J});var d={};i.r(d),i.d(d,{base64:()=>Y,base64pad:()=>Q,base64url:()=>X,base64urlpad:()=>ee});var h={};i.r(h),i.d(h,{base256emoji:()=>en});var p={};i.r(p),i.d(p,{sha256:()=>ew,sha512:()=>em});var f={};i.r(f),i.d(f,{identity:()=>eb});var g={};i.r(g),i.d(g,{code:()=>ey,decode:()=>eC,encode:()=>ex,name:()=>ev});var w={};i.r(w),i.d(w,{code:()=>ek,decode:()=>eS,encode:()=>eI,name:()=>e_});let m=function(e,t){if(e.length>=255)throw TypeError("Alphabet too long");for(var i=new Uint8Array(256),r=0;r>>0,o=new Uint8Array(a);e[t];){var u=i[e.charCodeAt(t)];if(255===u)return;for(var d=0,h=a-1;(0!==u||d>>0,o[h]=u%256>>>0,u=u/256>>>0;if(0!==u)throw Error("Non-zero carry");n=d,t++}if(" "!==e[t]){for(var p=a-n;p!==a&&0===o[p];)p++;for(var f=new Uint8Array(r+(a-p)),g=r;p!==a;)f[g++]=o[p++];return f}}}return{encode:function(t){if(t instanceof Uint8Array||(ArrayBuffer.isView(t)?t=new Uint8Array(t.buffer,t.byteOffset,t.byteLength):Array.isArray(t)&&(t=Uint8Array.from(t))),!(t instanceof Uint8Array))throw TypeError("Expected Uint8Array");if(0===t.length)return"";for(var i=0,r=0,n=0,a=t.length;n!==a&&0===t[n];)n++,i++;for(var o=(a-n)*u+1>>>0,l=new Uint8Array(o);n!==a;){for(var d=t[n],h=0,p=o-1;(0!==d||h>>0,l[p]=d%s>>>0,d=d/s>>>0;if(0!==d)throw Error("Non-zero carry");r=h,n++}for(var f=o-r;f!==o&&0===l[f];)f++;for(var g=c.repeat(i);f{if(e===t)return!0;if(e.byteLength!==t.byteLength)return!1;for(let i=0;i{if(e instanceof Uint8Array&&"Uint8Array"===e.constructor.name)return e;if(e instanceof ArrayBuffer)return new Uint8Array(e);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw Error("Unknown type, must be binary type")},y=e=>new TextEncoder().encode(e),x=e=>new TextDecoder().decode(e);class C{constructor(e,t,i){this.name=e,this.prefix=t,this.baseEncode=i}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}}class A{constructor(e,t,i){if(this.name=e,this.prefix=t,void 0===t.codePointAt(0))throw Error("Invalid prefix character");this.prefixCodePoint=t.codePointAt(0),this.baseDecode=i}decode(e){if("string"==typeof e){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}throw Error("Can only multibase decode strings")}or(e){return _(this,e)}}class E{constructor(e){this.decoders=e}or(e){return _(this,e)}decode(e){let t=e[0],i=this.decoders[t];if(i)return i.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}let _=(e,t)=>new E({...e.decoders||{[e.prefix]:e},...t.decoders||{[t.prefix]:t}});class k{constructor(e,t,i,r){this.name=e,this.prefix=t,this.baseEncode=i,this.baseDecode=r,this.encoder=new C(e,t,i),this.decoder=new A(e,t,r)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}let I=({name:e,prefix:t,encode:i,decode:r})=>new k(e,t,i,r),S=({prefix:e,name:t,alphabet:i})=>{let{encode:r,decode:n}=m(i,t);return I({prefix:e,name:t,encode:r,decode:e=>v(n(e))})},T=(e,t,i,r)=>{let n={};for(let e=0;e=8&&(s-=8,o[l++]=255&c>>s)}if(s>=i||255&c<<8-s)throw SyntaxError("Unexpected end of data");return o},N=(e,t,i)=>{let r="="===t[t.length-1],n=(1<i;)o-=i,a+=t[n&s>>o];if(o&&(a+=t[n&s<I({prefix:t,name:e,encode:e=>N(e,r,i),decode:t=>T(t,r,i,e)}),R=I({prefix:"\0",name:"identity",encode:e=>x(e),decode:e=>y(e)}),O=P({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1}),M=P({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3}),D=S({prefix:"9",name:"base10",alphabet:"0123456789"}),U=P({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),$=P({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4}),L=P({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),j=P({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),B=P({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),W=P({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),q=P({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),H=P({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),z=P({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),F=P({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),Z=P({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),V=S({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),K=S({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"}),G=S({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),J=S({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"}),Y=P({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),Q=P({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),X=P({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),ee=P({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6}),et=Array.from("\uD83D\uDE80\uD83E\uDE90☄\uD83D\uDEF0\uD83C\uDF0C\uD83C\uDF11\uD83C\uDF12\uD83C\uDF13\uD83C\uDF14\uD83C\uDF15\uD83C\uDF16\uD83C\uDF17\uD83C\uDF18\uD83C\uDF0D\uD83C\uDF0F\uD83C\uDF0E\uD83D\uDC09☀\uD83D\uDCBB\uD83D\uDDA5\uD83D\uDCBE\uD83D\uDCBF\uD83D\uDE02❤\uD83D\uDE0D\uD83E\uDD23\uD83D\uDE0A\uD83D\uDE4F\uD83D\uDC95\uD83D\uDE2D\uD83D\uDE18\uD83D\uDC4D\uD83D\uDE05\uD83D\uDC4F\uD83D\uDE01\uD83D\uDD25\uD83E\uDD70\uD83D\uDC94\uD83D\uDC96\uD83D\uDC99\uD83D\uDE22\uD83E\uDD14\uD83D\uDE06\uD83D\uDE44\uD83D\uDCAA\uD83D\uDE09☺\uD83D\uDC4C\uD83E\uDD17\uD83D\uDC9C\uD83D\uDE14\uD83D\uDE0E\uD83D\uDE07\uD83C\uDF39\uD83E\uDD26\uD83C\uDF89\uD83D\uDC9E✌✨\uD83E\uDD37\uD83D\uDE31\uD83D\uDE0C\uD83C\uDF38\uD83D\uDE4C\uD83D\uDE0B\uD83D\uDC97\uD83D\uDC9A\uD83D\uDE0F\uD83D\uDC9B\uD83D\uDE42\uD83D\uDC93\uD83E\uDD29\uD83D\uDE04\uD83D\uDE00\uD83D\uDDA4\uD83D\uDE03\uD83D\uDCAF\uD83D\uDE48\uD83D\uDC47\uD83C\uDFB6\uD83D\uDE12\uD83E\uDD2D❣\uD83D\uDE1C\uD83D\uDC8B\uD83D\uDC40\uD83D\uDE2A\uD83D\uDE11\uD83D\uDCA5\uD83D\uDE4B\uD83D\uDE1E\uD83D\uDE29\uD83D\uDE21\uD83E\uDD2A\uD83D\uDC4A\uD83E\uDD73\uD83D\uDE25\uD83E\uDD24\uD83D\uDC49\uD83D\uDC83\uD83D\uDE33✋\uD83D\uDE1A\uD83D\uDE1D\uD83D\uDE34\uD83C\uDF1F\uD83D\uDE2C\uD83D\uDE43\uD83C\uDF40\uD83C\uDF37\uD83D\uDE3B\uD83D\uDE13⭐✅\uD83E\uDD7A\uD83C\uDF08\uD83D\uDE08\uD83E\uDD18\uD83D\uDCA6✔\uD83D\uDE23\uD83C\uDFC3\uD83D\uDC90☹\uD83C\uDF8A\uD83D\uDC98\uD83D\uDE20☝\uD83D\uDE15\uD83C\uDF3A\uD83C\uDF82\uD83C\uDF3B\uD83D\uDE10\uD83D\uDD95\uD83D\uDC9D\uD83D\uDE4A\uD83D\uDE39\uD83D\uDDE3\uD83D\uDCAB\uD83D\uDC80\uD83D\uDC51\uD83C\uDFB5\uD83E\uDD1E\uD83D\uDE1B\uD83D\uDD34\uD83D\uDE24\uD83C\uDF3C\uD83D\uDE2B⚽\uD83E\uDD19☕\uD83C\uDFC6\uD83E\uDD2B\uD83D\uDC48\uD83D\uDE2E\uD83D\uDE46\uD83C\uDF7B\uD83C\uDF43\uD83D\uDC36\uD83D\uDC81\uD83D\uDE32\uD83C\uDF3F\uD83E\uDDE1\uD83C\uDF81⚡\uD83C\uDF1E\uD83C\uDF88❌✊\uD83D\uDC4B\uD83D\uDE30\uD83E\uDD28\uD83D\uDE36\uD83E\uDD1D\uD83D\uDEB6\uD83D\uDCB0\uD83C\uDF53\uD83D\uDCA2\uD83E\uDD1F\uD83D\uDE41\uD83D\uDEA8\uD83D\uDCA8\uD83E\uDD2C✈\uD83C\uDF80\uD83C\uDF7A\uD83E\uDD13\uD83D\uDE19\uD83D\uDC9F\uD83C\uDF31\uD83D\uDE16\uD83D\uDC76\uD83E\uDD74▶➡❓\uD83D\uDC8E\uD83D\uDCB8⬇\uD83D\uDE28\uD83C\uDF1A\uD83E\uDD8B\uD83D\uDE37\uD83D\uDD7A⚠\uD83D\uDE45\uD83D\uDE1F\uD83D\uDE35\uD83D\uDC4E\uD83E\uDD32\uD83E\uDD20\uD83E\uDD27\uD83D\uDCCC\uD83D\uDD35\uD83D\uDC85\uD83E\uDDD0\uD83D\uDC3E\uD83C\uDF52\uD83D\uDE17\uD83E\uDD11\uD83C\uDF0A\uD83E\uDD2F\uD83D\uDC37☎\uD83D\uDCA7\uD83D\uDE2F\uD83D\uDC86\uD83D\uDC46\uD83C\uDFA4\uD83D\uDE47\uD83C\uDF51❄\uD83C\uDF34\uD83D\uDCA3\uD83D\uDC38\uD83D\uDC8C\uD83D\uDCCD\uD83E\uDD40\uD83E\uDD22\uD83D\uDC45\uD83D\uDCA1\uD83D\uDCA9\uD83D\uDC50\uD83D\uDCF8\uD83D\uDC7B\uD83E\uDD10\uD83E\uDD2E\uD83C\uDFBC\uD83E\uDD75\uD83D\uDEA9\uD83C\uDF4E\uD83C\uDF4A\uD83D\uDC7C\uD83D\uDC8D\uD83D\uDCE3\uD83E\uDD42"),ei=et.reduce((e,t,i)=>(e[i]=t,e),[]),er=et.reduce((e,t,i)=>(e[t.codePointAt(0)]=i,e),[]),en=I({prefix:"\uD83D\uDE80",name:"base256emoji",encode:function(e){return e.reduce((e,t)=>e+=ei[t],"")},decode:function(e){let t=[];for(let i of e){let e=er[i.codePointAt(0)];if(void 0===e)throw Error(`Non-base256emoji character: ${i}`);t.push(e)}return new Uint8Array(t)}}),ea={encode:function e(t,i,r){i=i||[];for(var n=r=r||0;t>=0x80000000;)i[r++]=255&t|128,t/=128;for(;-128&t;)i[r++]=255&t|128,t>>>=7;return i[r]=0|t,e.bytes=r-n+1,i},decode:function e(t,i){var r,n=0,i=i||0,a=0,o=i,s=t.length;do{if(o>=s)throw e.bytes=0,RangeError("Could not decode varint");r=t[o++],n+=a<28?(127&r)<=128);return e.bytes=o-i,n},encodingLength:function(e){return e<128?1:e<16384?2:e<2097152?3:e<0x10000000?4:e<0x800000000?5:e<0x40000000000?6:e<0x2000000000000?7:e<0x100000000000000?8:e<0x8000000000000000?9:10}},eo=(e,t=0)=>[ea.decode(e,t),ea.decode.bytes],es=(e,t,i=0)=>(ea.encode(e,t,i),t),ec=e=>ea.encodingLength(e),el=(e,t)=>{let i=t.byteLength,r=ec(e),n=r+ec(i),a=new Uint8Array(n+i);return es(e,a,0),es(i,a,r),a.set(t,n),new eh(e,i,t,a)},eu=e=>{let t=v(e),[i,r]=eo(t),[n,a]=eo(t.subarray(r)),o=t.subarray(r+a);if(o.byteLength!==n)throw Error("Incorrect length");return new eh(i,n,o,t)},ed=(e,t)=>e===t||e.code===t.code&&e.size===t.size&&b(e.bytes,t.bytes);class eh{constructor(e,t,i,r){this.code=e,this.size=t,this.digest=i,this.bytes=r}}let ep=({name:e,code:t,encode:i})=>new ef(e,t,i);class ef{constructor(e,t,i){this.name=e,this.code=t,this.encode=i}digest(e){if(e instanceof Uint8Array){let t=this.encode(e);return t instanceof Uint8Array?el(this.code,t):t.then(e=>el(this.code,e))}throw Error("Unknown type, must be binary type")}}let eg=e=>async t=>new Uint8Array(await crypto.subtle.digest(e,t)),ew=ep({name:"sha2-256",code:18,encode:eg("SHA-256")}),em=ep({name:"sha2-512",code:19,encode:eg("SHA-512")}),eb={code:0,name:"identity",encode:v,digest:e=>el(0,v(e))},ev="raw",ey=85,ex=e=>v(e),eC=e=>v(e),eA=new TextEncoder,eE=new TextDecoder,e_="json",ek=512,eI=e=>eA.encode(JSON.stringify(e)),eS=e=>JSON.parse(eE.decode(e));class eT{constructor(e,t,i,r){this.code=t,this.version=e,this.multihash=i,this.bytes=r,this.byteOffset=r.byteOffset,this.byteLength=r.byteLength,this.asCID=this,this._baseCache=new Map,Object.defineProperties(this,{byteOffset:eL,byteLength:eL,code:e$,version:e$,multihash:e$,bytes:e$,_baseCache:eL,asCID:eL})}toV0(){if(0===this.version)return this;{let{code:e,multihash:t}=this;if(e!==eO)throw Error("Cannot convert a non dag-pb CID to CIDv0");if(t.code!==eM)throw Error("Cannot convert non sha2-256 multihash CID to CIDv0");return eT.createV0(t)}}toV1(){switch(this.version){case 0:{let{code:e,digest:t}=this.multihash,i=el(e,t);return eT.createV1(this.code,i)}case 1:return this;default:throw Error(`Can not convert CID version ${this.version} to version 0. This is a bug please report`)}}equals(e){return e&&this.code===e.code&&this.version===e.version&&ed(this.multihash,e.multihash)}toString(e){let{bytes:t,version:i,_baseCache:r}=this;return 0===i?eP(t,r,e||G.encoder):eR(t,r,e||L.encoder)}toJSON(){return{code:this.code,version:this.version,hash:this.multihash.bytes}}get[Symbol.toStringTag](){return"CID"}[Symbol.for("nodejs.util.inspect.custom")](){return"CID("+this.toString()+")"}static isCID(e){return ej(/^0\.0/,eB),!!(e&&(e[eU]||e.asCID===e))}get toBaseEncodedString(){throw Error("Deprecated, use .toString()")}get codec(){throw Error('"codec" property is deprecated, use integer "code" property instead')}get buffer(){throw Error("Deprecated .buffer property, use .bytes to get Uint8Array instead")}get multibaseName(){throw Error('"multibaseName" property is deprecated')}get prefix(){throw Error('"prefix" property is deprecated')}static asCID(e){if(e instanceof eT)return e;if(null!=e&&e.asCID===e){let{version:t,code:i,multihash:r,bytes:n}=e;return new eT(t,i,r,n||eD(t,i,r.bytes))}if(null==e||!0!==e[eU])return null;{let{version:t,multihash:i,code:r}=e,n=eu(i);return eT.create(t,r,n)}}static create(e,t,i){if("number"!=typeof t)throw Error("String codecs are no longer supported");switch(e){case 0:if(t===eO)return new eT(e,t,i,i.bytes);throw Error(`Version 0 CID must use dag-pb (code: ${eO}) block encoding`);case 1:{let r=eD(e,t,i.bytes);return new eT(e,t,i,r)}default:throw Error("Invalid version")}}static createV0(e){return eT.create(0,eO,e)}static createV1(e,t){return eT.create(1,e,t)}static decode(e){let[t,i]=eT.decodeFirst(e);if(i.length)throw Error("Incorrect length");return t}static decodeFirst(e){let t=eT.inspectBytes(e),i=t.size-t.multihashSize,r=v(e.subarray(i,i+t.multihashSize));if(r.byteLength!==t.multihashSize)throw Error("Incorrect length");let n=r.subarray(t.multihashSize-t.digestSize),a=new eh(t.multihashCode,t.digestSize,n,r);return[0===t.version?eT.createV0(a):eT.createV1(t.codec,a),e.subarray(t.size)]}static inspectBytes(e){let t=0,i=()=>{let[i,r]=eo(e.subarray(t));return t+=r,i},r=i(),n=eO;if(18===r?(r=0,t=0):1===r&&(n=i()),0!==r&&1!==r)throw RangeError(`Invalid CID version ${r}`);let a=t,o=i(),s=i(),c=t+s;return{version:r,codec:n,multihashCode:o,digestSize:s,multihashSize:c-a,size:c}}static parse(e,t){let[i,r]=eN(e,t),n=eT.decode(r);return n._baseCache.set(i,e),n}}let eN=(e,t)=>{switch(e[0]){case"Q":{let i=t||G;return[G.prefix,i.decode(`${G.prefix}${e}`)]}case G.prefix:{let i=t||G;return[G.prefix,i.decode(e)]}case L.prefix:{let i=t||L;return[L.prefix,i.decode(e)]}default:if(null==t)throw Error("To parse non base32 or base58btc encoded CID multibase decoder must be provided");return[e[0],t.decode(e)]}},eP=(e,t,i)=>{let{prefix:r}=i;if(r!==G.prefix)throw Error(`Cannot string encode V0 in ${i.name} encoding`);let n=t.get(r);if(null!=n)return n;{let n=i.encode(e).slice(1);return t.set(r,n),n}},eR=(e,t,i)=>{let{prefix:r}=i,n=t.get(r);if(null!=n)return n;{let n=i.encode(e);return t.set(r,n),n}},eO=112,eM=18,eD=(e,t,i)=>{let r=ec(e),n=r+ec(t),a=new Uint8Array(n+i.byteLength);return es(e,a,0),es(t,a,r),a.set(i,n),a},eU=Symbol.for("@ipld/js-cid/CID"),e$={writable:!1,configurable:!1,enumerable:!0},eL={writable:!1,enumerable:!1,configurable:!1},ej=(e,t)=>{if(e.test("0.0.0-dev"))console.warn(t);else throw Error(t)},eB=`CID.isCID(v) is deprecated and will be removed in the next major release. Following code pattern: if (CID.isCID(value)) { doSomethingWithCID(value) } Is replaced with: const cid = CID.asCID(value) if (cid) { // Make sure to use cid instead of value doSomethingWithCID(cid) } `,eW={...r,...n,...a,...o,...s,...c,...l,...u,...d,...h};({...p,...f})},63565:(e,t,i)=>{"use strict";function r(e=0){return null!=globalThis.Buffer&&null!=globalThis.Buffer.allocUnsafe?globalThis.Buffer.allocUnsafe(e):new Uint8Array(e)}function n(e,t){t||(t=e.reduce((e,t)=>e+t.length,0));let i=r(t),n=0;for(let t of e)i.set(t,n),n+=t.length;return i}i.d(t,{xW:()=>n,sH:()=>u,dI:()=>d});var a=i(27095);function o(e,t,i,r){return{name:e,prefix:t,encoder:{name:e,prefix:t,encode:i},decoder:{decode:r}}}let s=o("utf8","u",e=>"u"+new TextDecoder("utf8").decode(e),e=>new TextEncoder().encode(e.substring(1))),c=o("ascii","a",e=>{let t="a";for(let i=0;i{let t=r((e=e.substring(1)).length);for(let i=0;i{"use strict";i.d(t,{BX:()=>p,KR:()=>w,P9:()=>g,B1:()=>f}),Symbol();let r=Symbol(),n=Object.getPrototypeOf,a=new WeakMap,o=e=>e&&(a.has(e)?a.get(e):n(e)===Object.prototype||n(e)===Array.prototype),s=e=>o(e)&&e[r]||null,c=(e,t=!0)=>{a.set(e,t)},l=e=>"object"==typeof e&&null!==e,u=new WeakMap,d=new WeakSet,[h]=((e=Object.is,t=(e,t)=>new Proxy(e,t),i=e=>l(e)&&!d.has(e)&&(Array.isArray(e)||!(Symbol.iterator in e))&&!(e instanceof WeakMap)&&!(e instanceof WeakSet)&&!(e instanceof Error)&&!(e instanceof Number)&&!(e instanceof Date)&&!(e instanceof String)&&!(e instanceof RegExp)&&!(e instanceof ArrayBuffer),r=e=>{switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:throw e}},n=new WeakMap,a=(e,t,i=r)=>{let o=n.get(e);if((null==o?void 0:o[0])===t)return o[1];let s=Array.isArray(e)?[]:Object.create(Object.getPrototypeOf(e));return c(s,!0),n.set(e,[t,s]),Reflect.ownKeys(e).forEach(t=>{if(Object.getOwnPropertyDescriptor(s,t))return;let r=Reflect.get(e,t),n={value:r,enumerable:!0,configurable:!0};if(d.has(r))c(r,!1);else if(r instanceof Promise)delete n.value,n.get=()=>i(r);else if(u.has(r)){let[e,t]=u.get(r);n.value=a(e,t(),i)}Object.defineProperty(s,t,n)}),Object.preventExtensions(s)},o=new WeakMap,h=[1,1],p=r=>{if(!l(r))throw Error("object required");let n=o.get(r);if(n)return n;let c=h[0],f=new Set,g=(e,t=++h[0])=>{c!==t&&(c=t,f.forEach(i=>i(e,t)))},w=h[1],m=(e=++h[1])=>(w===e||f.size||(w=e,v.forEach(([t])=>{let i=t[1](e);i>c&&(c=i)})),c),b=e=>(t,i)=>{let r=[...t];r[1]=[e,...r[1]],g(r,i)},v=new Map,y=(e,t)=>{if(v.has(e))throw Error("prop listener already exists");if(f.size){let i=t[3](b(e));v.set(e,[t,i])}else v.set(e,[t])},x=e=>{var t;let i=v.get(e);i&&(v.delete(e),null==(t=i[1])||t.call(i))},C=e=>{f.add(e),1===f.size&&v.forEach(([e,t],i)=>{if(t)throw Error("remove already exists");let r=e[3](b(i));v.set(i,[e,r])});let t=()=>{f.delete(e),0===f.size&&v.forEach(([e,t],i)=>{t&&(t(),v.set(i,[e]))})};return t},A=Array.isArray(r)?[]:Object.create(Object.getPrototypeOf(r)),E={deleteProperty(e,t){let i=Reflect.get(e,t);x(t);let r=Reflect.deleteProperty(e,t);return r&&g(["delete",[t],i]),r},set(t,r,n,a){let c=Reflect.has(t,r),h=Reflect.get(t,r,a);if(c&&(e(h,n)||o.has(n)&&e(h,o.get(n))))return!0;x(r),l(n)&&(n=s(n)||n);let f=n;if(n instanceof Promise)n.then(e=>{n.status="fulfilled",n.value=e,g(["resolve",[r],e])}).catch(e=>{n.status="rejected",n.reason=e,g(["reject",[r],e])});else{!u.has(n)&&i(n)&&(f=p(n));let e=!d.has(f)&&u.get(f);e&&y(r,e)}return Reflect.set(t,r,f,a),g(["set",[r],n,h]),!0}},_=t(A,E);o.set(r,_);let k=[A,m,a,C];return u.set(_,k),Reflect.ownKeys(r).forEach(e=>{let t=Object.getOwnPropertyDescriptor(r,e);"value"in t&&(_[e]=r[e],delete t.value,delete t.writable),Object.defineProperty(A,e,t)}),_})=>[p,u,d,e,t,i,r,n,a,o,h])();function p(e={}){return h(e)}function f(e,t,i){let r;let n=u.get(e);n||console.warn("Please use proxy object");let a=[],o=n[3],s=!1,c=o(e=>{if(a.push(e),i){t(a.splice(0));return}r||(r=Promise.resolve().then(()=>{r=void 0,s&&t(a.splice(0))}))});return s=!0,()=>{s=!1,c()}}function g(e,t){let i=u.get(e);i||console.warn("Please use proxy object");let[r,n,a]=i;return a(r,n(),t)}function w(e){return d.add(e),e}},5061:(e,t,i)=>{"use strict";i.d(t,{u$:()=>n,zC:()=>o});var r=i(2614);function n(e,t,i,n){let a=e[t];return(0,r.B1)(e,()=>{let r=e[t];Object.is(a,r)||i(a=r)},n)}Symbol();let a=new WeakMap;function o(e){let t=(0,r.BX)({data:Array.from(e||[]),has(e){return this.data.some(t=>t[0]===e)},set(e,t){let i=this.data.find(t=>t[0]===e);return i?i[1]=t:this.data.push([e,t]),this},get(e){var t;return null==(t=this.data.find(t=>t[0]===e))?void 0:t[1]},delete(e){let t=this.data.findIndex(t=>t[0]===e);return -1!==t&&(this.data.splice(t,1),!0)},clear(){this.data.splice(0)},get size(){return this.data.length},toJSON(){return new Map(this.data)},forEach(e){this.data.forEach(t=>{e(t[1],t[0],this)})},keys(){return this.data.map(e=>e[0]).values()},values(){return this.data.map(e=>e[1]).values()},entries(){return new Map(this.data).entries()},get[Symbol.toStringTag](){return"Map"},[Symbol.iterator](){return this.entries()}});return Object.defineProperties(t,{data:{enumerable:!1},size:{enumerable:!1},toJSON:{enumerable:!1}}),Object.seal(t),t}},63645:(e,t,i)=>{"use strict";i.d(t,{r:()=>r});let r=(0,i(51835).x)({id:1,name:"Ethereum",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://cloudflare-eth.com"]}},blockExplorers:{default:{name:"Etherscan",url:"https://etherscan.io",apiUrl:"https://api.etherscan.io/api"}},contracts:{ensRegistry:{address:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},ensUniversalResolver:{address:"0xce01f8eee7E479C928F8919abD53E553a36CeF67",blockCreated:0x125db65},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:0xdb04c1}}})},50952:(e,t,i)=>{"use strict";i.d(t,{G:()=>r});let r=(0,i(51835).x)({id:0xaa36a7,name:"Sepolia",nativeCurrency:{name:"Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://sepolia.drpc.org"]}},blockExplorers:{default:{name:"Etherscan",url:"https://sepolia.etherscan.io",apiUrl:"https://api-sepolia.etherscan.io/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:751532},ensRegistry:{address:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},ensUniversalResolver:{address:"0xc8Af999e38273D658BE1b921b88A9Ddf005769cC",blockCreated:5317080}},testnet:!0})},42220:(e,t,i)=>{"use strict";function r(e,{errorInstance:t=Error("timed out"),timeout:i,signal:r}){return new Promise((n,a)=>{(async()=>{let o;try{let s=new AbortController;i>0&&(o=setTimeout(()=>{r?s.abort():a(t)},i)),n(await e({signal:s?.signal||null}))}catch(e){e?.name==="AbortError"&&a(t),a(e)}finally{clearTimeout(o)}})()})}i.d(t,{w:()=>r})},64112:e=>{"use strict";e.exports={rE:"6.6.1"}}}]);