@walletconnect/ethereum-provider 2.4.0 → 2.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.umd.js CHANGED
@@ -1,4 +1,4 @@
1
- (function(Gr,Ot){typeof exports=="object"&&typeof module<"u"?Ot(exports):typeof define=="function"&&define.amd?define(["exports"],Ot):(Gr=typeof globalThis<"u"?globalThis:Gr||self,Ot(Gr["@walletconnect/ethereum-provider"]={}))})(this,function(Gr){"use strict";var Ot=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Bp(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function Yr(t){var e=t.default;if(typeof e=="function"){var r=function(){return e.apply(this,arguments)};r.prototype=e.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(t).forEach(function(n){var i=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(r,n,i.get?i:{enumerable:!0,get:function(){return t[n]}})}),r}var Dt={exports:{}},An=typeof Reflect=="object"?Reflect:null,Du=An&&typeof An.apply=="function"?An.apply:function(e,r,n){return Function.prototype.apply.call(e,r,n)},Po;An&&typeof An.ownKeys=="function"?Po=An.ownKeys:Object.getOwnPropertySymbols?Po=function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Po=function(e){return Object.getOwnPropertyNames(e)};function jp(t){console&&console.warn&&console.warn(t)}var $u=Number.isNaN||function(e){return e!==e};function dt(){dt.init.call(this)}Dt.exports=dt,Dt.exports.once=Wp,dt.EventEmitter=dt,dt.prototype._events=void 0,dt.prototype._eventsCount=0,dt.prototype._maxListeners=void 0;var Fu=10;function To(t){if(typeof t!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}Object.defineProperty(dt,"defaultMaxListeners",{enumerable:!0,get:function(){return Fu},set:function(t){if(typeof t!="number"||t<0||$u(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");Fu=t}}),dt.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},dt.prototype.setMaxListeners=function(e){if(typeof e!="number"||e<0||$u(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this};function Pu(t){return t._maxListeners===void 0?dt.defaultMaxListeners:t._maxListeners}dt.prototype.getMaxListeners=function(){return Pu(this)},dt.prototype.emit=function(e){for(var r=[],n=1;n<arguments.length;n++)r.push(arguments[n]);var i=e==="error",o=this._events;if(o!==void 0)i=i&&o.error===void 0;else if(!i)return!1;if(i){var s;if(r.length>0&&(s=r[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var l=o[e];if(l===void 0)return!1;if(typeof l=="function")Du(l,this,r);else for(var u=l.length,d=Mu(l,u),n=0;n<u;++n)Du(d[n],this,r);return!0};function Tu(t,e,r,n){var i,o,s;if(To(r),o=t._events,o===void 0?(o=t._events=Object.create(null),t._eventsCount=0):(o.newListener!==void 0&&(t.emit("newListener",e,r.listener?r.listener:r),o=t._events),s=o[e]),s===void 0)s=o[e]=r,++t._eventsCount;else if(typeof s=="function"?s=o[e]=n?[r,s]:[s,r]:n?s.unshift(r):s.push(r),i=Pu(t),i>0&&s.length>i&&!s.warned){s.warned=!0;var a=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");a.name="MaxListenersExceededWarning",a.emitter=t,a.type=e,a.count=s.length,jp(a)}return t}dt.prototype.addListener=function(e,r){return Tu(this,e,r,!1)},dt.prototype.on=dt.prototype.addListener,dt.prototype.prependListener=function(e,r){return Tu(this,e,r,!0)};function kp(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function Nu(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},i=kp.bind(n);return i.listener=r,n.wrapFn=i,i}dt.prototype.once=function(e,r){return To(r),this.on(e,Nu(this,e,r)),this},dt.prototype.prependOnceListener=function(e,r){return To(r),this.prependListener(e,Nu(this,e,r)),this},dt.prototype.removeListener=function(e,r){var n,i,o,s,a;if(To(r),i=this._events,i===void 0)return this;if(n=i[e],n===void 0)return this;if(n===r||n.listener===r)--this._eventsCount===0?this._events=Object.create(null):(delete i[e],i.removeListener&&this.emit("removeListener",e,n.listener||r));else if(typeof n!="function"){for(o=-1,s=n.length-1;s>=0;s--)if(n[s]===r||n[s].listener===r){a=n[s].listener,o=s;break}if(o<0)return this;o===0?n.shift():Hp(n,o),n.length===1&&(i[e]=n[0]),i.removeListener!==void 0&&this.emit("removeListener",e,a||r)}return this},dt.prototype.off=dt.prototype.removeListener,dt.prototype.removeAllListeners=function(e){var r,n,i;if(n=this._events,n===void 0)return this;if(n.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):n[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete n[e]),this;if(arguments.length===0){var o=Object.keys(n),s;for(i=0;i<o.length;++i)s=o[i],s!=="removeListener"&&this.removeAllListeners(s);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(r=n[e],typeof r=="function")this.removeListener(e,r);else if(r!==void 0)for(i=r.length-1;i>=0;i--)this.removeListener(e,r[i]);return this};function Ru(t,e,r){var n=t._events;if(n===void 0)return[];var i=n[e];return i===void 0?[]:typeof i=="function"?r?[i.listener||i]:[i]:r?zp(i):Mu(i,i.length)}dt.prototype.listeners=function(e){return Ru(this,e,!0)},dt.prototype.rawListeners=function(e){return Ru(this,e,!1)},dt.listenerCount=function(t,e){return typeof t.listenerCount=="function"?t.listenerCount(e):Lu.call(t,e)},dt.prototype.listenerCount=Lu;function Lu(t){var e=this._events;if(e!==void 0){var r=e[t];if(typeof r=="function")return 1;if(r!==void 0)return r.length}return 0}dt.prototype.eventNames=function(){return this._eventsCount>0?Po(this._events):[]};function Mu(t,e){for(var r=new Array(e),n=0;n<e;++n)r[n]=t[n];return r}function Hp(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}function zp(t){for(var e=new Array(t.length),r=0;r<e.length;++r)e[r]=t[r].listener||t[r];return e}function Wp(t,e){return new Promise(function(r,n){function i(s){t.removeListener(e,o),n(s)}function o(){typeof t.removeListener=="function"&&t.removeListener("error",i),r([].slice.call(arguments))}Uu(t,e,o,{once:!0}),e!=="error"&&Vp(t,i,{once:!0})})}function Vp(t,e,r){typeof t.on=="function"&&Uu(t,"error",e,r)}function Uu(t,e,r,n){if(typeof t.on=="function")n.once?t.once(e,r):t.on(e,r);else if(typeof t.addEventListener=="function")t.addEventListener(e,function i(o){n.once&&t.removeEventListener(e,i),r(o)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof t)}var Js={},No={},ke={},Bu={};(function(t){Object.defineProperty(t,"__esModule",{value:!0});function e(a,l){var u=a>>>16&65535,d=a&65535,y=l>>>16&65535,m=l&65535;return d*m+(u*m+d*y<<16>>>0)|0}t.mul=Math.imul||e;function r(a,l){return a+l|0}t.add=r;function n(a,l){return a-l|0}t.sub=n;function i(a,l){return a<<l|a>>>32-l}t.rotl=i;function o(a,l){return a<<32-l|a>>>l}t.rotr=o;function s(a){return typeof a=="number"&&isFinite(a)&&Math.floor(a)===a}t.isInteger=Number.isInteger||s,t.MAX_SAFE_INTEGER=9007199254740991,t.isSafeInteger=function(a){return t.isInteger(a)&&a>=-t.MAX_SAFE_INTEGER&&a<=t.MAX_SAFE_INTEGER}})(Bu),Object.defineProperty(ke,"__esModule",{value:!0});var ju=Bu;function qp(t,e){return e===void 0&&(e=0),(t[e+0]<<8|t[e+1])<<16>>16}ke.readInt16BE=qp;function Kp(t,e){return e===void 0&&(e=0),(t[e+0]<<8|t[e+1])>>>0}ke.readUint16BE=Kp;function Gp(t,e){return e===void 0&&(e=0),(t[e+1]<<8|t[e])<<16>>16}ke.readInt16LE=Gp;function Yp(t,e){return e===void 0&&(e=0),(t[e+1]<<8|t[e])>>>0}ke.readUint16LE=Yp;function ku(t,e,r){return e===void 0&&(e=new Uint8Array(2)),r===void 0&&(r=0),e[r+0]=t>>>8,e[r+1]=t>>>0,e}ke.writeUint16BE=ku,ke.writeInt16BE=ku;function Hu(t,e,r){return e===void 0&&(e=new Uint8Array(2)),r===void 0&&(r=0),e[r+0]=t>>>0,e[r+1]=t>>>8,e}ke.writeUint16LE=Hu,ke.writeInt16LE=Hu;function Xs(t,e){return e===void 0&&(e=0),t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3]}ke.readInt32BE=Xs;function Qs(t,e){return e===void 0&&(e=0),(t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3])>>>0}ke.readUint32BE=Qs;function ea(t,e){return e===void 0&&(e=0),t[e+3]<<24|t[e+2]<<16|t[e+1]<<8|t[e]}ke.readInt32LE=ea;function ta(t,e){return e===void 0&&(e=0),(t[e+3]<<24|t[e+2]<<16|t[e+1]<<8|t[e])>>>0}ke.readUint32LE=ta;function Ro(t,e,r){return e===void 0&&(e=new Uint8Array(4)),r===void 0&&(r=0),e[r+0]=t>>>24,e[r+1]=t>>>16,e[r+2]=t>>>8,e[r+3]=t>>>0,e}ke.writeUint32BE=Ro,ke.writeInt32BE=Ro;function Lo(t,e,r){return e===void 0&&(e=new Uint8Array(4)),r===void 0&&(r=0),e[r+0]=t>>>0,e[r+1]=t>>>8,e[r+2]=t>>>16,e[r+3]=t>>>24,e}ke.writeUint32LE=Lo,ke.writeInt32LE=Lo;function Zp(t,e){e===void 0&&(e=0);var r=Xs(t,e),n=Xs(t,e+4);return r*4294967296+n-(n>>31)*4294967296}ke.readInt64BE=Zp;function Jp(t,e){e===void 0&&(e=0);var r=Qs(t,e),n=Qs(t,e+4);return r*4294967296+n}ke.readUint64BE=Jp;function Xp(t,e){e===void 0&&(e=0);var r=ea(t,e),n=ea(t,e+4);return n*4294967296+r-(r>>31)*4294967296}ke.readInt64LE=Xp;function Qp(t,e){e===void 0&&(e=0);var r=ta(t,e),n=ta(t,e+4);return n*4294967296+r}ke.readUint64LE=Qp;function zu(t,e,r){return e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0),Ro(t/4294967296>>>0,e,r),Ro(t>>>0,e,r+4),e}ke.writeUint64BE=zu,ke.writeInt64BE=zu;function Wu(t,e,r){return e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0),Lo(t>>>0,e,r),Lo(t/4294967296>>>0,e,r+4),e}ke.writeUint64LE=Wu,ke.writeInt64LE=Wu;function e3(t,e,r){if(r===void 0&&(r=0),t%8!==0)throw new Error("readUintBE supports only bitLengths divisible by 8");if(t/8>e.length-r)throw new Error("readUintBE: array is too short for the given bitLength");for(var n=0,i=1,o=t/8+r-1;o>=r;o--)n+=e[o]*i,i*=256;return n}ke.readUintBE=e3;function t3(t,e,r){if(r===void 0&&(r=0),t%8!==0)throw new Error("readUintLE supports only bitLengths divisible by 8");if(t/8>e.length-r)throw new Error("readUintLE: array is too short for the given bitLength");for(var n=0,i=1,o=r;o<r+t/8;o++)n+=e[o]*i,i*=256;return n}ke.readUintLE=t3;function r3(t,e,r,n){if(r===void 0&&(r=new Uint8Array(t/8)),n===void 0&&(n=0),t%8!==0)throw new Error("writeUintBE supports only bitLengths divisible by 8");if(!ju.isSafeInteger(e))throw new Error("writeUintBE value must be an integer");for(var i=1,o=t/8+n-1;o>=n;o--)r[o]=e/i&255,i*=256;return r}ke.writeUintBE=r3;function n3(t,e,r,n){if(r===void 0&&(r=new Uint8Array(t/8)),n===void 0&&(n=0),t%8!==0)throw new Error("writeUintLE supports only bitLengths divisible by 8");if(!ju.isSafeInteger(e))throw new Error("writeUintLE value must be an integer");for(var i=1,o=n;o<n+t/8;o++)r[o]=e/i&255,i*=256;return r}ke.writeUintLE=n3;function i3(t,e){e===void 0&&(e=0);var r=new DataView(t.buffer,t.byteOffset,t.byteLength);return r.getFloat32(e)}ke.readFloat32BE=i3;function o3(t,e){e===void 0&&(e=0);var r=new DataView(t.buffer,t.byteOffset,t.byteLength);return r.getFloat32(e,!0)}ke.readFloat32LE=o3;function s3(t,e){e===void 0&&(e=0);var r=new DataView(t.buffer,t.byteOffset,t.byteLength);return r.getFloat64(e)}ke.readFloat64BE=s3;function a3(t,e){e===void 0&&(e=0);var r=new DataView(t.buffer,t.byteOffset,t.byteLength);return r.getFloat64(e,!0)}ke.readFloat64LE=a3;function c3(t,e,r){e===void 0&&(e=new Uint8Array(4)),r===void 0&&(r=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.setFloat32(r,t),e}ke.writeFloat32BE=c3;function l3(t,e,r){e===void 0&&(e=new Uint8Array(4)),r===void 0&&(r=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.setFloat32(r,t,!0),e}ke.writeFloat32LE=l3;function u3(t,e,r){e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.setFloat64(r,t),e}ke.writeFloat64BE=u3;function h3(t,e,r){e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.setFloat64(r,t,!0),e}ke.writeFloat64LE=h3;var rr={};Object.defineProperty(rr,"__esModule",{value:!0});function f3(t){for(var e=0;e<t.length;e++)t[e]=0;return t}rr.wipe=f3,Object.defineProperty(No,"__esModule",{value:!0});var Bt=ke,ra=rr,d3=20;function p3(t,e,r){for(var n=1634760805,i=857760878,o=2036477234,s=1797285236,a=r[3]<<24|r[2]<<16|r[1]<<8|r[0],l=r[7]<<24|r[6]<<16|r[5]<<8|r[4],u=r[11]<<24|r[10]<<16|r[9]<<8|r[8],d=r[15]<<24|r[14]<<16|r[13]<<8|r[12],y=r[19]<<24|r[18]<<16|r[17]<<8|r[16],m=r[23]<<24|r[22]<<16|r[21]<<8|r[20],v=r[27]<<24|r[26]<<16|r[25]<<8|r[24],_=r[31]<<24|r[30]<<16|r[29]<<8|r[28],R=e[3]<<24|e[2]<<16|e[1]<<8|e[0],M=e[7]<<24|e[6]<<16|e[5]<<8|e[4],B=e[11]<<24|e[10]<<16|e[9]<<8|e[8],D=e[15]<<24|e[14]<<16|e[13]<<8|e[12],N=n,C=i,$=o,P=s,h=a,S=l,q=u,z=d,Y=y,re=m,ie=v,E=_,O=R,Z=M,J=B,H=D,j=0;j<d3;j+=2)N=N+h|0,O^=N,O=O>>>32-16|O<<16,Y=Y+O|0,h^=Y,h=h>>>32-12|h<<12,C=C+S|0,Z^=C,Z=Z>>>32-16|Z<<16,re=re+Z|0,S^=re,S=S>>>32-12|S<<12,$=$+q|0,J^=$,J=J>>>32-16|J<<16,ie=ie+J|0,q^=ie,q=q>>>32-12|q<<12,P=P+z|0,H^=P,H=H>>>32-16|H<<16,E=E+H|0,z^=E,z=z>>>32-12|z<<12,$=$+q|0,J^=$,J=J>>>32-8|J<<8,ie=ie+J|0,q^=ie,q=q>>>32-7|q<<7,P=P+z|0,H^=P,H=H>>>32-8|H<<8,E=E+H|0,z^=E,z=z>>>32-7|z<<7,C=C+S|0,Z^=C,Z=Z>>>32-8|Z<<8,re=re+Z|0,S^=re,S=S>>>32-7|S<<7,N=N+h|0,O^=N,O=O>>>32-8|O<<8,Y=Y+O|0,h^=Y,h=h>>>32-7|h<<7,N=N+S|0,H^=N,H=H>>>32-16|H<<16,ie=ie+H|0,S^=ie,S=S>>>32-12|S<<12,C=C+q|0,O^=C,O=O>>>32-16|O<<16,E=E+O|0,q^=E,q=q>>>32-12|q<<12,$=$+z|0,Z^=$,Z=Z>>>32-16|Z<<16,Y=Y+Z|0,z^=Y,z=z>>>32-12|z<<12,P=P+h|0,J^=P,J=J>>>32-16|J<<16,re=re+J|0,h^=re,h=h>>>32-12|h<<12,$=$+z|0,Z^=$,Z=Z>>>32-8|Z<<8,Y=Y+Z|0,z^=Y,z=z>>>32-7|z<<7,P=P+h|0,J^=P,J=J>>>32-8|J<<8,re=re+J|0,h^=re,h=h>>>32-7|h<<7,C=C+q|0,O^=C,O=O>>>32-8|O<<8,E=E+O|0,q^=E,q=q>>>32-7|q<<7,N=N+S|0,H^=N,H=H>>>32-8|H<<8,ie=ie+H|0,S^=ie,S=S>>>32-7|S<<7;Bt.writeUint32LE(N+n|0,t,0),Bt.writeUint32LE(C+i|0,t,4),Bt.writeUint32LE($+o|0,t,8),Bt.writeUint32LE(P+s|0,t,12),Bt.writeUint32LE(h+a|0,t,16),Bt.writeUint32LE(S+l|0,t,20),Bt.writeUint32LE(q+u|0,t,24),Bt.writeUint32LE(z+d|0,t,28),Bt.writeUint32LE(Y+y|0,t,32),Bt.writeUint32LE(re+m|0,t,36),Bt.writeUint32LE(ie+v|0,t,40),Bt.writeUint32LE(E+_|0,t,44),Bt.writeUint32LE(O+R|0,t,48),Bt.writeUint32LE(Z+M|0,t,52),Bt.writeUint32LE(J+B|0,t,56),Bt.writeUint32LE(H+D|0,t,60)}function Vu(t,e,r,n,i){if(i===void 0&&(i=0),t.length!==32)throw new Error("ChaCha: key size must be 32 bytes");if(n.length<r.length)throw new Error("ChaCha: destination is shorter than source");var o,s;if(i===0){if(e.length!==8&&e.length!==12)throw new Error("ChaCha nonce must be 8 or 12 bytes");o=new Uint8Array(16),s=o.length-e.length,o.set(e,s)}else{if(e.length!==16)throw new Error("ChaCha nonce with counter must be 16 bytes");o=e,s=i}for(var a=new Uint8Array(64),l=0;l<r.length;l+=64){p3(a,o,t);for(var u=l;u<l+64&&u<r.length;u++)n[u]=r[u]^a[u-l];m3(o,0,s)}return ra.wipe(a),i===0&&ra.wipe(o),n}No.streamXOR=Vu;function g3(t,e,r,n){return n===void 0&&(n=0),ra.wipe(r),Vu(t,e,r,r,n)}No.stream=g3;function m3(t,e,r){for(var n=1;r--;)n=n+(t[e]&255)|0,t[e]=n&255,n>>>=8,e++;if(n>0)throw new Error("ChaCha: counter overflow")}var qu={},Mr={};Object.defineProperty(Mr,"__esModule",{value:!0});function b3(t,e,r){return~(t-1)&e|t-1&r}Mr.select=b3;function y3(t,e){return(t|0)-(e|0)-1>>>31&1}Mr.lessOrEqual=y3;function Ku(t,e){if(t.length!==e.length)return 0;for(var r=0,n=0;n<t.length;n++)r|=t[n]^e[n];return 1&r-1>>>8}Mr.compare=Ku;function w3(t,e){return t.length===0||e.length===0?!1:Ku(t,e)!==0}Mr.equal=w3,function(t){Object.defineProperty(t,"__esModule",{value:!0});var e=Mr,r=rr;t.DIGEST_LENGTH=16;var n=function(){function s(a){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 l=a[0]|a[1]<<8;this._r[0]=l&8191;var u=a[2]|a[3]<<8;this._r[1]=(l>>>13|u<<3)&8191;var d=a[4]|a[5]<<8;this._r[2]=(u>>>10|d<<6)&7939;var y=a[6]|a[7]<<8;this._r[3]=(d>>>7|y<<9)&8191;var m=a[8]|a[9]<<8;this._r[4]=(y>>>4|m<<12)&255,this._r[5]=m>>>1&8190;var v=a[10]|a[11]<<8;this._r[6]=(m>>>14|v<<2)&8191;var _=a[12]|a[13]<<8;this._r[7]=(v>>>11|_<<5)&8065;var R=a[14]|a[15]<<8;this._r[8]=(_>>>8|R<<8)&8191,this._r[9]=R>>>5&127,this._pad[0]=a[16]|a[17]<<8,this._pad[1]=a[18]|a[19]<<8,this._pad[2]=a[20]|a[21]<<8,this._pad[3]=a[22]|a[23]<<8,this._pad[4]=a[24]|a[25]<<8,this._pad[5]=a[26]|a[27]<<8,this._pad[6]=a[28]|a[29]<<8,this._pad[7]=a[30]|a[31]<<8}return s.prototype._blocks=function(a,l,u){for(var d=this._fin?0:2048,y=this._h[0],m=this._h[1],v=this._h[2],_=this._h[3],R=this._h[4],M=this._h[5],B=this._h[6],D=this._h[7],N=this._h[8],C=this._h[9],$=this._r[0],P=this._r[1],h=this._r[2],S=this._r[3],q=this._r[4],z=this._r[5],Y=this._r[6],re=this._r[7],ie=this._r[8],E=this._r[9];u>=16;){var O=a[l+0]|a[l+1]<<8;y+=O&8191;var Z=a[l+2]|a[l+3]<<8;m+=(O>>>13|Z<<3)&8191;var J=a[l+4]|a[l+5]<<8;v+=(Z>>>10|J<<6)&8191;var H=a[l+6]|a[l+7]<<8;_+=(J>>>7|H<<9)&8191;var j=a[l+8]|a[l+9]<<8;R+=(H>>>4|j<<12)&8191,M+=j>>>1&8191;var W=a[l+10]|a[l+11]<<8;B+=(j>>>14|W<<2)&8191;var V=a[l+12]|a[l+13]<<8;D+=(W>>>11|V<<5)&8191;var ce=a[l+14]|a[l+15]<<8;N+=(V>>>8|ce<<8)&8191,C+=ce>>>5|d;var te=0,Ce=te;Ce+=y*$,Ce+=m*(5*E),Ce+=v*(5*ie),Ce+=_*(5*re),Ce+=R*(5*Y),te=Ce>>>13,Ce&=8191,Ce+=M*(5*z),Ce+=B*(5*q),Ce+=D*(5*S),Ce+=N*(5*h),Ce+=C*(5*P),te+=Ce>>>13,Ce&=8191;var ne=te;ne+=y*P,ne+=m*$,ne+=v*(5*E),ne+=_*(5*ie),ne+=R*(5*re),te=ne>>>13,ne&=8191,ne+=M*(5*Y),ne+=B*(5*z),ne+=D*(5*q),ne+=N*(5*S),ne+=C*(5*h),te+=ne>>>13,ne&=8191;var Oe=te;Oe+=y*h,Oe+=m*P,Oe+=v*$,Oe+=_*(5*E),Oe+=R*(5*ie),te=Oe>>>13,Oe&=8191,Oe+=M*(5*re),Oe+=B*(5*Y),Oe+=D*(5*z),Oe+=N*(5*q),Oe+=C*(5*S),te+=Oe>>>13,Oe&=8191;var T=te;T+=y*S,T+=m*h,T+=v*P,T+=_*$,T+=R*(5*E),te=T>>>13,T&=8191,T+=M*(5*ie),T+=B*(5*re),T+=D*(5*Y),T+=N*(5*z),T+=C*(5*q),te+=T>>>13,T&=8191;var F=te;F+=y*q,F+=m*S,F+=v*h,F+=_*P,F+=R*$,te=F>>>13,F&=8191,F+=M*(5*E),F+=B*(5*ie),F+=D*(5*re),F+=N*(5*Y),F+=C*(5*z),te+=F>>>13,F&=8191;var I=te;I+=y*z,I+=m*q,I+=v*S,I+=_*h,I+=R*P,te=I>>>13,I&=8191,I+=M*$,I+=B*(5*E),I+=D*(5*ie),I+=N*(5*re),I+=C*(5*Y),te+=I>>>13,I&=8191;var c=te;c+=y*Y,c+=m*z,c+=v*q,c+=_*S,c+=R*h,te=c>>>13,c&=8191,c+=M*P,c+=B*$,c+=D*(5*E),c+=N*(5*ie),c+=C*(5*re),te+=c>>>13,c&=8191;var w=te;w+=y*re,w+=m*Y,w+=v*z,w+=_*q,w+=R*S,te=w>>>13,w&=8191,w+=M*h,w+=B*P,w+=D*$,w+=N*(5*E),w+=C*(5*ie),te+=w>>>13,w&=8191;var G=te;G+=y*ie,G+=m*re,G+=v*Y,G+=_*z,G+=R*q,te=G>>>13,G&=8191,G+=M*S,G+=B*h,G+=D*P,G+=N*$,G+=C*(5*E),te+=G>>>13,G&=8191;var Q=te;Q+=y*E,Q+=m*ie,Q+=v*re,Q+=_*Y,Q+=R*z,te=Q>>>13,Q&=8191,Q+=M*q,Q+=B*S,Q+=D*h,Q+=N*P,Q+=C*$,te+=Q>>>13,Q&=8191,te=(te<<2)+te|0,te=te+Ce|0,Ce=te&8191,te=te>>>13,ne+=te,y=Ce,m=ne,v=Oe,_=T,R=F,M=I,B=c,D=w,N=G,C=Q,l+=16,u-=16}this._h[0]=y,this._h[1]=m,this._h[2]=v,this._h[3]=_,this._h[4]=R,this._h[5]=M,this._h[6]=B,this._h[7]=D,this._h[8]=N,this._h[9]=C},s.prototype.finish=function(a,l){l===void 0&&(l=0);var u=new Uint16Array(10),d,y,m,v;if(this._leftover){for(v=this._leftover,this._buffer[v++]=1;v<16;v++)this._buffer[v]=0;this._fin=1,this._blocks(this._buffer,0,16)}for(d=this._h[1]>>>13,this._h[1]&=8191,v=2;v<10;v++)this._h[v]+=d,d=this._h[v]>>>13,this._h[v]&=8191;for(this._h[0]+=d*5,d=this._h[0]>>>13,this._h[0]&=8191,this._h[1]+=d,d=this._h[1]>>>13,this._h[1]&=8191,this._h[2]+=d,u[0]=this._h[0]+5,d=u[0]>>>13,u[0]&=8191,v=1;v<10;v++)u[v]=this._h[v]+d,d=u[v]>>>13,u[v]&=8191;for(u[9]-=1<<13,y=(d^1)-1,v=0;v<10;v++)u[v]&=y;for(y=~y,v=0;v<10;v++)this._h[v]=this._h[v]&y|u[v];for(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,m=this._h[0]+this._pad[0],this._h[0]=m&65535,v=1;v<8;v++)m=(this._h[v]+this._pad[v]|0)+(m>>>16)|0,this._h[v]=m&65535;return a[l+0]=this._h[0]>>>0,a[l+1]=this._h[0]>>>8,a[l+2]=this._h[1]>>>0,a[l+3]=this._h[1]>>>8,a[l+4]=this._h[2]>>>0,a[l+5]=this._h[2]>>>8,a[l+6]=this._h[3]>>>0,a[l+7]=this._h[3]>>>8,a[l+8]=this._h[4]>>>0,a[l+9]=this._h[4]>>>8,a[l+10]=this._h[5]>>>0,a[l+11]=this._h[5]>>>8,a[l+12]=this._h[6]>>>0,a[l+13]=this._h[6]>>>8,a[l+14]=this._h[7]>>>0,a[l+15]=this._h[7]>>>8,this._finished=!0,this},s.prototype.update=function(a){var l=0,u=a.length,d;if(this._leftover){d=16-this._leftover,d>u&&(d=u);for(var y=0;y<d;y++)this._buffer[this._leftover+y]=a[l+y];if(u-=d,l+=d,this._leftover+=d,this._leftover<16)return this;this._blocks(this._buffer,0,16),this._leftover=0}if(u>=16&&(d=u-u%16,this._blocks(a,l,d),l+=d,u-=d),u){for(var y=0;y<u;y++)this._buffer[this._leftover+y]=a[l+y];this._leftover+=u}return this},s.prototype.digest=function(){if(this._finished)throw new Error("Poly1305 was finished");var a=new Uint8Array(16);return this.finish(a),a},s.prototype.clean=function(){return r.wipe(this._buffer),r.wipe(this._r),r.wipe(this._h),r.wipe(this._pad),this._leftover=0,this._fin=0,this._finished=!0,this},s}();t.Poly1305=n;function i(s,a){var l=new n(s);l.update(a);var u=l.digest();return l.clean(),u}t.oneTimeAuth=i;function o(s,a){return s.length!==t.DIGEST_LENGTH||a.length!==t.DIGEST_LENGTH?!1:e.equal(s,a)}t.equal=o}(qu),function(t){Object.defineProperty(t,"__esModule",{value:!0});var e=No,r=qu,n=rr,i=ke,o=Mr;t.KEY_LENGTH=32,t.NONCE_LENGTH=12,t.TAG_LENGTH=16;var s=new Uint8Array(16),a=function(){function l(u){if(this.nonceLength=t.NONCE_LENGTH,this.tagLength=t.TAG_LENGTH,u.length!==t.KEY_LENGTH)throw new Error("ChaCha20Poly1305 needs 32-byte key");this._key=new Uint8Array(u)}return l.prototype.seal=function(u,d,y,m){if(u.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");var v=new Uint8Array(16);v.set(u,v.length-u.length);var _=new Uint8Array(32);e.stream(this._key,v,_,4);var R=d.length+this.tagLength,M;if(m){if(m.length!==R)throw new Error("ChaCha20Poly1305: incorrect destination length");M=m}else M=new Uint8Array(R);return e.streamXOR(this._key,v,d,M,4),this._authenticate(M.subarray(M.length-this.tagLength,M.length),_,M.subarray(0,M.length-this.tagLength),y),n.wipe(v),M},l.prototype.open=function(u,d,y,m){if(u.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");if(d.length<this.tagLength)return null;var v=new Uint8Array(16);v.set(u,v.length-u.length);var _=new Uint8Array(32);e.stream(this._key,v,_,4);var R=new Uint8Array(this.tagLength);if(this._authenticate(R,_,d.subarray(0,d.length-this.tagLength),y),!o.equal(R,d.subarray(d.length-this.tagLength,d.length)))return null;var M=d.length-this.tagLength,B;if(m){if(m.length!==M)throw new Error("ChaCha20Poly1305: incorrect destination length");B=m}else B=new Uint8Array(M);return e.streamXOR(this._key,v,d.subarray(0,d.length-this.tagLength),B,4),n.wipe(v),B},l.prototype.clean=function(){return n.wipe(this._key),this},l.prototype._authenticate=function(u,d,y,m){var v=new r.Poly1305(d);m&&(v.update(m),m.length%16>0&&v.update(s.subarray(m.length%16))),v.update(y),y.length%16>0&&v.update(s.subarray(y.length%16));var _=new Uint8Array(8);m&&i.writeUint64LE(m.length,_),v.update(_),i.writeUint64LE(y.length,_),v.update(_);for(var R=v.digest(),M=0;M<R.length;M++)u[M]=R[M];v.clean(),n.wipe(R),n.wipe(_)},l}();t.ChaCha20Poly1305=a}(Js);var Gu={},ri={},na={};Object.defineProperty(na,"__esModule",{value:!0});function v3(t){return typeof t.saveState<"u"&&typeof t.restoreState<"u"&&typeof t.cleanSavedState<"u"}na.isSerializableHash=v3,Object.defineProperty(ri,"__esModule",{value:!0});var mr=na,_3=Mr,E3=rr,Yu=function(){function t(e,r){this._finished=!1,this._inner=new e,this._outer=new e,this.blockSize=this._outer.blockSize,this.digestLength=this._outer.digestLength;var n=new Uint8Array(this.blockSize);r.length>this.blockSize?this._inner.update(r).finish(n).clean():n.set(r);for(var i=0;i<n.length;i++)n[i]^=54;this._inner.update(n);for(var i=0;i<n.length;i++)n[i]^=106;this._outer.update(n),mr.isSerializableHash(this._inner)&&mr.isSerializableHash(this._outer)&&(this._innerKeyedState=this._inner.saveState(),this._outerKeyedState=this._outer.saveState()),E3.wipe(n)}return t.prototype.reset=function(){if(!mr.isSerializableHash(this._inner)||!mr.isSerializableHash(this._outer))throw new Error("hmac: can't reset() because hash doesn't implement restoreState()");return this._inner.restoreState(this._innerKeyedState),this._outer.restoreState(this._outerKeyedState),this._finished=!1,this},t.prototype.clean=function(){mr.isSerializableHash(this._inner)&&this._inner.cleanSavedState(this._innerKeyedState),mr.isSerializableHash(this._outer)&&this._outer.cleanSavedState(this._outerKeyedState),this._inner.clean(),this._outer.clean()},t.prototype.update=function(e){return this._inner.update(e),this},t.prototype.finish=function(e){return this._finished?(this._outer.finish(e),this):(this._inner.finish(e),this._outer.update(e.subarray(0,this.digestLength)).finish(e),this._finished=!0,this)},t.prototype.digest=function(){var e=new Uint8Array(this.digestLength);return this.finish(e),e},t.prototype.saveState=function(){if(!mr.isSerializableHash(this._inner))throw new Error("hmac: can't saveState() because hash doesn't implement it");return this._inner.saveState()},t.prototype.restoreState=function(e){if(!mr.isSerializableHash(this._inner)||!mr.isSerializableHash(this._outer))throw new Error("hmac: can't restoreState() because hash doesn't implement it");return this._inner.restoreState(e),this._outer.restoreState(this._outerKeyedState),this._finished=!1,this},t.prototype.cleanSavedState=function(e){if(!mr.isSerializableHash(this._inner))throw new Error("hmac: can't cleanSavedState() because hash doesn't implement it");this._inner.cleanSavedState(e)},t}();ri.HMAC=Yu;function x3(t,e,r){var n=new Yu(t,e);n.update(r);var i=n.digest();return n.clean(),i}ri.hmac=x3,ri.equal=_3.equal,Object.defineProperty(Gu,"__esModule",{value:!0});var Zu=ri,Ju=rr,C3=function(){function t(e,r,n,i){n===void 0&&(n=new Uint8Array(0)),this._counter=new Uint8Array(1),this._hash=e,this._info=i;var o=Zu.hmac(this._hash,n,r);this._hmac=new Zu.HMAC(e,o),this._buffer=new Uint8Array(this._hmac.digestLength),this._bufpos=this._buffer.length}return t.prototype._fillBuffer=function(){this._counter[0]++;var e=this._counter[0];if(e===0)throw new 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},t.prototype.expand=function(e){for(var r=new Uint8Array(e),n=0;n<r.length;n++)this._bufpos===this._buffer.length&&this._fillBuffer(),r[n]=this._buffer[this._bufpos++];return r},t.prototype.clean=function(){this._hmac.clean(),Ju.wipe(this._buffer),Ju.wipe(this._counter),this._bufpos=0},t}(),S3=Gu.HKDF=C3,In={},Mo={},Uo={};Object.defineProperty(Uo,"__esModule",{value:!0}),Uo.BrowserRandomSource=void 0;const Xu=65536;class A3{constructor(){this.isAvailable=!1,this.isInstantiated=!1;const e=typeof self<"u"?self.crypto||self.msCrypto:null;e&&e.getRandomValues!==void 0&&(this._crypto=e,this.isAvailable=!0,this.isInstantiated=!0)}randomBytes(e){if(!this.isAvailable||!this._crypto)throw new Error("Browser random byte generator is not available.");const r=new Uint8Array(e);for(let n=0;n<r.length;n+=Xu)this._crypto.getRandomValues(r.subarray(n,n+Math.min(r.length-n,Xu)));return r}}Uo.BrowserRandomSource=A3;function I3(t){throw new Error('Could not dynamically require "'+t+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Bo={},O3={},D3=Object.freeze({__proto__:null,default:O3}),$3=Yr(D3);Object.defineProperty(Bo,"__esModule",{value:!0}),Bo.NodeRandomSource=void 0;const F3=rr;class P3{constructor(){if(this.isAvailable=!1,this.isInstantiated=!1,typeof I3<"u"){const e=$3;e&&e.randomBytes&&(this._crypto=e,this.isAvailable=!0,this.isInstantiated=!0)}}randomBytes(e){if(!this.isAvailable||!this._crypto)throw new Error("Node.js random byte generator is not available.");let r=this._crypto.randomBytes(e);if(r.length!==e)throw new Error("NodeRandomSource: got fewer bytes than requested");const n=new Uint8Array(e);for(let i=0;i<n.length;i++)n[i]=r[i];return(0,F3.wipe)(r),n}}Bo.NodeRandomSource=P3,Object.defineProperty(Mo,"__esModule",{value:!0}),Mo.SystemRandomSource=void 0;const T3=Uo,N3=Bo;class R3{constructor(){if(this.isAvailable=!1,this.name="",this._source=new T3.BrowserRandomSource,this._source.isAvailable){this.isAvailable=!0,this.name="Browser";return}if(this._source=new N3.NodeRandomSource,this._source.isAvailable){this.isAvailable=!0,this.name="Node";return}}randomBytes(e){if(!this.isAvailable)throw new Error("System random byte generator is not available.");return this._source.randomBytes(e)}}Mo.SystemRandomSource=R3,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.randomStringForEntropy=t.randomString=t.randomUint32=t.randomBytes=t.defaultRandomSource=void 0;const e=Mo,r=ke,n=rr;t.defaultRandomSource=new e.SystemRandomSource;function i(u,d=t.defaultRandomSource){return d.randomBytes(u)}t.randomBytes=i;function o(u=t.defaultRandomSource){const d=i(4,u),y=(0,r.readUint32LE)(d);return(0,n.wipe)(d),y}t.randomUint32=o;const s="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";function a(u,d=s,y=t.defaultRandomSource){if(d.length<2)throw new Error("randomString charset is too short");if(d.length>256)throw new Error("randomString charset is too long");let m="";const v=d.length,_=256-256%v;for(;u>0;){const R=i(Math.ceil(u*256/_),y);for(let M=0;M<R.length&&u>0;M++){const B=R[M];B<_&&(m+=d.charAt(B%v),u--)}(0,n.wipe)(R)}return m}t.randomString=a;function l(u,d=s,y=t.defaultRandomSource){const m=Math.ceil(u/(Math.log(d.length)/Math.LN2));return a(m,d,y)}t.randomStringForEntropy=l}(In);var jo={};(function(t){Object.defineProperty(t,"__esModule",{value:!0});var e=ke,r=rr;t.DIGEST_LENGTH=32,t.BLOCK_SIZE=64;var n=function(){function a(){this.digestLength=t.DIGEST_LENGTH,this.blockSize=t.BLOCK_SIZE,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 a.prototype._initState=function(){this._state[0]=1779033703,this._state[1]=3144134277,this._state[2]=1013904242,this._state[3]=2773480762,this._state[4]=1359893119,this._state[5]=2600822924,this._state[6]=528734635,this._state[7]=1541459225},a.prototype.reset=function(){return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this},a.prototype.clean=function(){r.wipe(this._buffer),r.wipe(this._temp),this.reset()},a.prototype.update=function(l,u){if(u===void 0&&(u=l.length),this._finished)throw new Error("SHA256: can't update because hash was finished.");var d=0;if(this._bytesHashed+=u,this._bufferLength>0){for(;this._bufferLength<this.blockSize&&u>0;)this._buffer[this._bufferLength++]=l[d++],u--;this._bufferLength===this.blockSize&&(o(this._temp,this._state,this._buffer,0,this.blockSize),this._bufferLength=0)}for(u>=this.blockSize&&(d=o(this._temp,this._state,l,d,u),u%=this.blockSize);u>0;)this._buffer[this._bufferLength++]=l[d++],u--;return this},a.prototype.finish=function(l){if(!this._finished){var u=this._bytesHashed,d=this._bufferLength,y=u/536870912|0,m=u<<3,v=u%64<56?64:128;this._buffer[d]=128;for(var _=d+1;_<v-8;_++)this._buffer[_]=0;e.writeUint32BE(y,this._buffer,v-8),e.writeUint32BE(m,this._buffer,v-4),o(this._temp,this._state,this._buffer,0,v),this._finished=!0}for(var _=0;_<this.digestLength/4;_++)e.writeUint32BE(this._state[_],l,_*4);return this},a.prototype.digest=function(){var l=new Uint8Array(this.digestLength);return this.finish(l),l},a.prototype.saveState=function(){if(this._finished)throw new Error("SHA256: cannot save finished state");return{state:new Int32Array(this._state),buffer:this._bufferLength>0?new Uint8Array(this._buffer):void 0,bufferLength:this._bufferLength,bytesHashed:this._bytesHashed}},a.prototype.restoreState=function(l){return this._state.set(l.state),this._bufferLength=l.bufferLength,l.buffer&&this._buffer.set(l.buffer),this._bytesHashed=l.bytesHashed,this._finished=!1,this},a.prototype.cleanSavedState=function(l){r.wipe(l.state),l.buffer&&r.wipe(l.buffer),l.bufferLength=0,l.bytesHashed=0},a}();t.SHA256=n;var i=new Int32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]);function o(a,l,u,d,y){for(;y>=64;){for(var m=l[0],v=l[1],_=l[2],R=l[3],M=l[4],B=l[5],D=l[6],N=l[7],C=0;C<16;C++){var $=d+C*4;a[C]=e.readUint32BE(u,$)}for(var C=16;C<64;C++){var P=a[C-2],h=(P>>>17|P<<32-17)^(P>>>19|P<<32-19)^P>>>10;P=a[C-15];var S=(P>>>7|P<<32-7)^(P>>>18|P<<32-18)^P>>>3;a[C]=(h+a[C-7]|0)+(S+a[C-16]|0)}for(var C=0;C<64;C++){var h=(((M>>>6|M<<26)^(M>>>11|M<<21)^(M>>>25|M<<7))+(M&B^~M&D)|0)+(N+(i[C]+a[C]|0)|0)|0,S=((m>>>2|m<<32-2)^(m>>>13|m<<32-13)^(m>>>22|m<<32-22))+(m&v^m&_^v&_)|0;N=D,D=B,B=M,M=R+h|0,R=_,_=v,v=m,m=h+S|0}l[0]+=m,l[1]+=v,l[2]+=_,l[3]+=R,l[4]+=M,l[5]+=B,l[6]+=D,l[7]+=N,d+=64,y-=64}return d}function s(a){var l=new n;l.update(a);var u=l.digest();return l.clean(),u}t.hash=s})(jo);var ia={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.sharedKey=t.generateKeyPair=t.generateKeyPairFromSeed=t.scalarMultBase=t.scalarMult=t.SHARED_KEY_LENGTH=t.SECRET_KEY_LENGTH=t.PUBLIC_KEY_LENGTH=void 0;const e=In,r=rr;t.PUBLIC_KEY_LENGTH=32,t.SECRET_KEY_LENGTH=32,t.SHARED_KEY_LENGTH=32;function n(C){const $=new Float64Array(16);if(C)for(let P=0;P<C.length;P++)$[P]=C[P];return $}const i=new Uint8Array(32);i[0]=9;const o=n([56129,1]);function s(C){let $=1;for(let P=0;P<16;P++){let h=C[P]+$+65535;$=Math.floor(h/65536),C[P]=h-$*65536}C[0]+=$-1+37*($-1)}function a(C,$,P){const h=~(P-1);for(let S=0;S<16;S++){const q=h&(C[S]^$[S]);C[S]^=q,$[S]^=q}}function l(C,$){const P=n(),h=n();for(let S=0;S<16;S++)h[S]=$[S];s(h),s(h),s(h);for(let S=0;S<2;S++){P[0]=h[0]-65517;for(let z=1;z<15;z++)P[z]=h[z]-65535-(P[z-1]>>16&1),P[z-1]&=65535;P[15]=h[15]-32767-(P[14]>>16&1);const q=P[15]>>16&1;P[14]&=65535,a(h,P,1-q)}for(let S=0;S<16;S++)C[2*S]=h[S]&255,C[2*S+1]=h[S]>>8}function u(C,$){for(let P=0;P<16;P++)C[P]=$[2*P]+($[2*P+1]<<8);C[15]&=32767}function d(C,$,P){for(let h=0;h<16;h++)C[h]=$[h]+P[h]}function y(C,$,P){for(let h=0;h<16;h++)C[h]=$[h]-P[h]}function m(C,$,P){let h,S,q=0,z=0,Y=0,re=0,ie=0,E=0,O=0,Z=0,J=0,H=0,j=0,W=0,V=0,ce=0,te=0,Ce=0,ne=0,Oe=0,T=0,F=0,I=0,c=0,w=0,G=0,Q=0,he=0,be=0,pe=0,ye=0,ze=0,Ue=0,xe=P[0],Ee=P[1],ge=P[2],we=P[3],ve=P[4],fe=P[5],me=P[6],b=P[7],f=P[8],p=P[9],A=P[10],L=P[11],k=P[12],K=P[13],se=P[14],de=P[15];h=$[0],q+=h*xe,z+=h*Ee,Y+=h*ge,re+=h*we,ie+=h*ve,E+=h*fe,O+=h*me,Z+=h*b,J+=h*f,H+=h*p,j+=h*A,W+=h*L,V+=h*k,ce+=h*K,te+=h*se,Ce+=h*de,h=$[1],z+=h*xe,Y+=h*Ee,re+=h*ge,ie+=h*we,E+=h*ve,O+=h*fe,Z+=h*me,J+=h*b,H+=h*f,j+=h*p,W+=h*A,V+=h*L,ce+=h*k,te+=h*K,Ce+=h*se,ne+=h*de,h=$[2],Y+=h*xe,re+=h*Ee,ie+=h*ge,E+=h*we,O+=h*ve,Z+=h*fe,J+=h*me,H+=h*b,j+=h*f,W+=h*p,V+=h*A,ce+=h*L,te+=h*k,Ce+=h*K,ne+=h*se,Oe+=h*de,h=$[3],re+=h*xe,ie+=h*Ee,E+=h*ge,O+=h*we,Z+=h*ve,J+=h*fe,H+=h*me,j+=h*b,W+=h*f,V+=h*p,ce+=h*A,te+=h*L,Ce+=h*k,ne+=h*K,Oe+=h*se,T+=h*de,h=$[4],ie+=h*xe,E+=h*Ee,O+=h*ge,Z+=h*we,J+=h*ve,H+=h*fe,j+=h*me,W+=h*b,V+=h*f,ce+=h*p,te+=h*A,Ce+=h*L,ne+=h*k,Oe+=h*K,T+=h*se,F+=h*de,h=$[5],E+=h*xe,O+=h*Ee,Z+=h*ge,J+=h*we,H+=h*ve,j+=h*fe,W+=h*me,V+=h*b,ce+=h*f,te+=h*p,Ce+=h*A,ne+=h*L,Oe+=h*k,T+=h*K,F+=h*se,I+=h*de,h=$[6],O+=h*xe,Z+=h*Ee,J+=h*ge,H+=h*we,j+=h*ve,W+=h*fe,V+=h*me,ce+=h*b,te+=h*f,Ce+=h*p,ne+=h*A,Oe+=h*L,T+=h*k,F+=h*K,I+=h*se,c+=h*de,h=$[7],Z+=h*xe,J+=h*Ee,H+=h*ge,j+=h*we,W+=h*ve,V+=h*fe,ce+=h*me,te+=h*b,Ce+=h*f,ne+=h*p,Oe+=h*A,T+=h*L,F+=h*k,I+=h*K,c+=h*se,w+=h*de,h=$[8],J+=h*xe,H+=h*Ee,j+=h*ge,W+=h*we,V+=h*ve,ce+=h*fe,te+=h*me,Ce+=h*b,ne+=h*f,Oe+=h*p,T+=h*A,F+=h*L,I+=h*k,c+=h*K,w+=h*se,G+=h*de,h=$[9],H+=h*xe,j+=h*Ee,W+=h*ge,V+=h*we,ce+=h*ve,te+=h*fe,Ce+=h*me,ne+=h*b,Oe+=h*f,T+=h*p,F+=h*A,I+=h*L,c+=h*k,w+=h*K,G+=h*se,Q+=h*de,h=$[10],j+=h*xe,W+=h*Ee,V+=h*ge,ce+=h*we,te+=h*ve,Ce+=h*fe,ne+=h*me,Oe+=h*b,T+=h*f,F+=h*p,I+=h*A,c+=h*L,w+=h*k,G+=h*K,Q+=h*se,he+=h*de,h=$[11],W+=h*xe,V+=h*Ee,ce+=h*ge,te+=h*we,Ce+=h*ve,ne+=h*fe,Oe+=h*me,T+=h*b,F+=h*f,I+=h*p,c+=h*A,w+=h*L,G+=h*k,Q+=h*K,he+=h*se,be+=h*de,h=$[12],V+=h*xe,ce+=h*Ee,te+=h*ge,Ce+=h*we,ne+=h*ve,Oe+=h*fe,T+=h*me,F+=h*b,I+=h*f,c+=h*p,w+=h*A,G+=h*L,Q+=h*k,he+=h*K,be+=h*se,pe+=h*de,h=$[13],ce+=h*xe,te+=h*Ee,Ce+=h*ge,ne+=h*we,Oe+=h*ve,T+=h*fe,F+=h*me,I+=h*b,c+=h*f,w+=h*p,G+=h*A,Q+=h*L,he+=h*k,be+=h*K,pe+=h*se,ye+=h*de,h=$[14],te+=h*xe,Ce+=h*Ee,ne+=h*ge,Oe+=h*we,T+=h*ve,F+=h*fe,I+=h*me,c+=h*b,w+=h*f,G+=h*p,Q+=h*A,he+=h*L,be+=h*k,pe+=h*K,ye+=h*se,ze+=h*de,h=$[15],Ce+=h*xe,ne+=h*Ee,Oe+=h*ge,T+=h*we,F+=h*ve,I+=h*fe,c+=h*me,w+=h*b,G+=h*f,Q+=h*p,he+=h*A,be+=h*L,pe+=h*k,ye+=h*K,ze+=h*se,Ue+=h*de,q+=38*ne,z+=38*Oe,Y+=38*T,re+=38*F,ie+=38*I,E+=38*c,O+=38*w,Z+=38*G,J+=38*Q,H+=38*he,j+=38*be,W+=38*pe,V+=38*ye,ce+=38*ze,te+=38*Ue,S=1,h=q+S+65535,S=Math.floor(h/65536),q=h-S*65536,h=z+S+65535,S=Math.floor(h/65536),z=h-S*65536,h=Y+S+65535,S=Math.floor(h/65536),Y=h-S*65536,h=re+S+65535,S=Math.floor(h/65536),re=h-S*65536,h=ie+S+65535,S=Math.floor(h/65536),ie=h-S*65536,h=E+S+65535,S=Math.floor(h/65536),E=h-S*65536,h=O+S+65535,S=Math.floor(h/65536),O=h-S*65536,h=Z+S+65535,S=Math.floor(h/65536),Z=h-S*65536,h=J+S+65535,S=Math.floor(h/65536),J=h-S*65536,h=H+S+65535,S=Math.floor(h/65536),H=h-S*65536,h=j+S+65535,S=Math.floor(h/65536),j=h-S*65536,h=W+S+65535,S=Math.floor(h/65536),W=h-S*65536,h=V+S+65535,S=Math.floor(h/65536),V=h-S*65536,h=ce+S+65535,S=Math.floor(h/65536),ce=h-S*65536,h=te+S+65535,S=Math.floor(h/65536),te=h-S*65536,h=Ce+S+65535,S=Math.floor(h/65536),Ce=h-S*65536,q+=S-1+37*(S-1),S=1,h=q+S+65535,S=Math.floor(h/65536),q=h-S*65536,h=z+S+65535,S=Math.floor(h/65536),z=h-S*65536,h=Y+S+65535,S=Math.floor(h/65536),Y=h-S*65536,h=re+S+65535,S=Math.floor(h/65536),re=h-S*65536,h=ie+S+65535,S=Math.floor(h/65536),ie=h-S*65536,h=E+S+65535,S=Math.floor(h/65536),E=h-S*65536,h=O+S+65535,S=Math.floor(h/65536),O=h-S*65536,h=Z+S+65535,S=Math.floor(h/65536),Z=h-S*65536,h=J+S+65535,S=Math.floor(h/65536),J=h-S*65536,h=H+S+65535,S=Math.floor(h/65536),H=h-S*65536,h=j+S+65535,S=Math.floor(h/65536),j=h-S*65536,h=W+S+65535,S=Math.floor(h/65536),W=h-S*65536,h=V+S+65535,S=Math.floor(h/65536),V=h-S*65536,h=ce+S+65535,S=Math.floor(h/65536),ce=h-S*65536,h=te+S+65535,S=Math.floor(h/65536),te=h-S*65536,h=Ce+S+65535,S=Math.floor(h/65536),Ce=h-S*65536,q+=S-1+37*(S-1),C[0]=q,C[1]=z,C[2]=Y,C[3]=re,C[4]=ie,C[5]=E,C[6]=O,C[7]=Z,C[8]=J,C[9]=H,C[10]=j,C[11]=W,C[12]=V,C[13]=ce,C[14]=te,C[15]=Ce}function v(C,$){m(C,$,$)}function _(C,$){const P=n();for(let h=0;h<16;h++)P[h]=$[h];for(let h=253;h>=0;h--)v(P,P),h!==2&&h!==4&&m(P,P,$);for(let h=0;h<16;h++)C[h]=P[h]}function R(C,$){const P=new Uint8Array(32),h=new Float64Array(80),S=n(),q=n(),z=n(),Y=n(),re=n(),ie=n();for(let J=0;J<31;J++)P[J]=C[J];P[31]=C[31]&127|64,P[0]&=248,u(h,$);for(let J=0;J<16;J++)q[J]=h[J];S[0]=Y[0]=1;for(let J=254;J>=0;--J){const H=P[J>>>3]>>>(J&7)&1;a(S,q,H),a(z,Y,H),d(re,S,z),y(S,S,z),d(z,q,Y),y(q,q,Y),v(Y,re),v(ie,S),m(S,z,S),m(z,q,re),d(re,S,z),y(S,S,z),v(q,S),y(z,Y,ie),m(S,z,o),d(S,S,Y),m(z,z,S),m(S,Y,ie),m(Y,q,h),v(q,re),a(S,q,H),a(z,Y,H)}for(let J=0;J<16;J++)h[J+16]=S[J],h[J+32]=z[J],h[J+48]=q[J],h[J+64]=Y[J];const E=h.subarray(32),O=h.subarray(16);_(E,E),m(O,O,E);const Z=new Uint8Array(32);return l(Z,O),Z}t.scalarMult=R;function M(C){return R(C,i)}t.scalarMultBase=M;function B(C){if(C.length!==t.SECRET_KEY_LENGTH)throw new Error(`x25519: seed must be ${t.SECRET_KEY_LENGTH} bytes`);const $=new Uint8Array(C);return{publicKey:M($),secretKey:$}}t.generateKeyPairFromSeed=B;function D(C){const $=(0,e.randomBytes)(32,C),P=B($);return(0,r.wipe)($),P}t.generateKeyPair=D;function N(C,$,P=!1){if(C.length!==t.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect secret key length");if($.length!==t.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect public key length");const h=R(C,$);if(P){let S=0;for(let q=0;q<h.length;q++)S|=h[q];if(S===0)throw new Error("X25519: invalid shared key")}return h}t.sharedKey=N})(ia);function Qu(t=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?globalThis.Buffer.allocUnsafe(t):new Uint8Array(t)}function oa(t,e){e||(e=t.reduce((i,o)=>i+o.length,0));const r=Qu(e);let n=0;for(const i of t)r.set(i,n),n+=i.length;return r}function L3(t,e){if(t.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),n=0;n<r.length;n++)r[n]=255;for(var i=0;i<t.length;i++){var o=t.charAt(i),s=o.charCodeAt(0);if(r[s]!==255)throw new TypeError(o+" is ambiguous");r[s]=i}var a=t.length,l=t.charAt(0),u=Math.log(a)/Math.log(256),d=Math.log(256)/Math.log(a);function y(_){if(_ instanceof Uint8Array||(ArrayBuffer.isView(_)?_=new Uint8Array(_.buffer,_.byteOffset,_.byteLength):Array.isArray(_)&&(_=Uint8Array.from(_))),!(_ instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(_.length===0)return"";for(var R=0,M=0,B=0,D=_.length;B!==D&&_[B]===0;)B++,R++;for(var N=(D-B)*d+1>>>0,C=new Uint8Array(N);B!==D;){for(var $=_[B],P=0,h=N-1;($!==0||P<M)&&h!==-1;h--,P++)$+=256*C[h]>>>0,C[h]=$%a>>>0,$=$/a>>>0;if($!==0)throw new Error("Non-zero carry");M=P,B++}for(var S=N-M;S!==N&&C[S]===0;)S++;for(var q=l.repeat(R);S<N;++S)q+=t.charAt(C[S]);return q}function m(_){if(typeof _!="string")throw new TypeError("Expected String");if(_.length===0)return new Uint8Array;var R=0;if(_[R]!==" "){for(var M=0,B=0;_[R]===l;)M++,R++;for(var D=(_.length-R)*u+1>>>0,N=new Uint8Array(D);_[R];){var C=r[_.charCodeAt(R)];if(C===255)return;for(var $=0,P=D-1;(C!==0||$<B)&&P!==-1;P--,$++)C+=a*N[P]>>>0,N[P]=C%256>>>0,C=C/256>>>0;if(C!==0)throw new Error("Non-zero carry");B=$,R++}if(_[R]!==" "){for(var h=D-B;h!==D&&N[h]===0;)h++;for(var S=new Uint8Array(M+(D-h)),q=M;h!==D;)S[q++]=N[h++];return S}}}function v(_){var R=m(_);if(R)return R;throw new Error(`Non-${e} character`)}return{encode:y,decodeUnsafe:m,decode:v}}var M3=L3,U3=M3;const eh=t=>{if(t instanceof Uint8Array&&t.constructor.name==="Uint8Array")return t;if(t instanceof ArrayBuffer)return new Uint8Array(t);if(ArrayBuffer.isView(t))return new Uint8Array(t.buffer,t.byteOffset,t.byteLength);throw new Error("Unknown type, must be binary type")},B3=t=>new TextEncoder().encode(t),j3=t=>new TextDecoder().decode(t);class k3{constructor(e,r,n){this.name=e,this.prefix=r,this.baseEncode=n}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}}class H3{constructor(e,r,n){if(this.name=e,this.prefix=r,r.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=r.codePointAt(0),this.baseDecode=n}decode(e){if(typeof e=="string"){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))}else throw Error("Can only multibase decode strings")}or(e){return th(this,e)}}class z3{constructor(e){this.decoders=e}or(e){return th(this,e)}decode(e){const r=e[0],n=this.decoders[r];if(n)return n.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const th=(t,e)=>new z3({...t.decoders||{[t.prefix]:t},...e.decoders||{[e.prefix]:e}});class W3{constructor(e,r,n,i){this.name=e,this.prefix=r,this.baseEncode=n,this.baseDecode=i,this.encoder=new k3(e,r,n),this.decoder=new H3(e,r,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}const ko=({name:t,prefix:e,encode:r,decode:n})=>new W3(t,e,r,n),ni=({prefix:t,name:e,alphabet:r})=>{const{encode:n,decode:i}=U3(r,e);return ko({prefix:t,name:e,encode:n,decode:o=>eh(i(o))})},V3=(t,e,r,n)=>{const i={};for(let d=0;d<e.length;++d)i[e[d]]=d;let o=t.length;for(;t[o-1]==="=";)--o;const s=new Uint8Array(o*r/8|0);let a=0,l=0,u=0;for(let d=0;d<o;++d){const y=i[t[d]];if(y===void 0)throw new SyntaxError(`Non-${n} character`);l=l<<r|y,a+=r,a>=8&&(a-=8,s[u++]=255&l>>a)}if(a>=r||255&l<<8-a)throw new SyntaxError("Unexpected end of data");return s},q3=(t,e,r)=>{const n=e[e.length-1]==="=",i=(1<<r)-1;let o="",s=0,a=0;for(let l=0;l<t.length;++l)for(a=a<<8|t[l],s+=8;s>r;)s-=r,o+=e[i&a>>s];if(s&&(o+=e[i&a<<r-s]),n)for(;o.length*r&7;)o+="=";return o},Pt=({name:t,prefix:e,bitsPerChar:r,alphabet:n})=>ko({prefix:e,name:t,encode(i){return q3(i,n,r)},decode(i){return V3(i,n,r,t)}}),K3=ko({prefix:"\0",name:"identity",encode:t=>j3(t),decode:t=>B3(t)});var G3=Object.freeze({__proto__:null,identity:K3});const Y3=Pt({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var Z3=Object.freeze({__proto__:null,base2:Y3});const J3=Pt({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var X3=Object.freeze({__proto__:null,base8:J3});const Q3=ni({prefix:"9",name:"base10",alphabet:"0123456789"});var e2=Object.freeze({__proto__:null,base10:Q3});const t2=Pt({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),r2=Pt({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var n2=Object.freeze({__proto__:null,base16:t2,base16upper:r2});const i2=Pt({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),o2=Pt({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),s2=Pt({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),a2=Pt({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),c2=Pt({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),l2=Pt({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),u2=Pt({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),h2=Pt({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),f2=Pt({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var d2=Object.freeze({__proto__:null,base32:i2,base32upper:o2,base32pad:s2,base32padupper:a2,base32hex:c2,base32hexupper:l2,base32hexpad:u2,base32hexpadupper:h2,base32z:f2});const p2=ni({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),g2=ni({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var m2=Object.freeze({__proto__:null,base36:p2,base36upper:g2});const b2=ni({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),y2=ni({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var w2=Object.freeze({__proto__:null,base58btc:b2,base58flickr:y2});const v2=Pt({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),_2=Pt({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),E2=Pt({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),x2=Pt({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var C2=Object.freeze({__proto__:null,base64:v2,base64pad:_2,base64url:E2,base64urlpad:x2});const rh=Array.from("\u{1F680}\u{1FA90}\u2604\u{1F6F0}\u{1F30C}\u{1F311}\u{1F312}\u{1F313}\u{1F314}\u{1F315}\u{1F316}\u{1F317}\u{1F318}\u{1F30D}\u{1F30F}\u{1F30E}\u{1F409}\u2600\u{1F4BB}\u{1F5A5}\u{1F4BE}\u{1F4BF}\u{1F602}\u2764\u{1F60D}\u{1F923}\u{1F60A}\u{1F64F}\u{1F495}\u{1F62D}\u{1F618}\u{1F44D}\u{1F605}\u{1F44F}\u{1F601}\u{1F525}\u{1F970}\u{1F494}\u{1F496}\u{1F499}\u{1F622}\u{1F914}\u{1F606}\u{1F644}\u{1F4AA}\u{1F609}\u263A\u{1F44C}\u{1F917}\u{1F49C}\u{1F614}\u{1F60E}\u{1F607}\u{1F339}\u{1F926}\u{1F389}\u{1F49E}\u270C\u2728\u{1F937}\u{1F631}\u{1F60C}\u{1F338}\u{1F64C}\u{1F60B}\u{1F497}\u{1F49A}\u{1F60F}\u{1F49B}\u{1F642}\u{1F493}\u{1F929}\u{1F604}\u{1F600}\u{1F5A4}\u{1F603}\u{1F4AF}\u{1F648}\u{1F447}\u{1F3B6}\u{1F612}\u{1F92D}\u2763\u{1F61C}\u{1F48B}\u{1F440}\u{1F62A}\u{1F611}\u{1F4A5}\u{1F64B}\u{1F61E}\u{1F629}\u{1F621}\u{1F92A}\u{1F44A}\u{1F973}\u{1F625}\u{1F924}\u{1F449}\u{1F483}\u{1F633}\u270B\u{1F61A}\u{1F61D}\u{1F634}\u{1F31F}\u{1F62C}\u{1F643}\u{1F340}\u{1F337}\u{1F63B}\u{1F613}\u2B50\u2705\u{1F97A}\u{1F308}\u{1F608}\u{1F918}\u{1F4A6}\u2714\u{1F623}\u{1F3C3}\u{1F490}\u2639\u{1F38A}\u{1F498}\u{1F620}\u261D\u{1F615}\u{1F33A}\u{1F382}\u{1F33B}\u{1F610}\u{1F595}\u{1F49D}\u{1F64A}\u{1F639}\u{1F5E3}\u{1F4AB}\u{1F480}\u{1F451}\u{1F3B5}\u{1F91E}\u{1F61B}\u{1F534}\u{1F624}\u{1F33C}\u{1F62B}\u26BD\u{1F919}\u2615\u{1F3C6}\u{1F92B}\u{1F448}\u{1F62E}\u{1F646}\u{1F37B}\u{1F343}\u{1F436}\u{1F481}\u{1F632}\u{1F33F}\u{1F9E1}\u{1F381}\u26A1\u{1F31E}\u{1F388}\u274C\u270A\u{1F44B}\u{1F630}\u{1F928}\u{1F636}\u{1F91D}\u{1F6B6}\u{1F4B0}\u{1F353}\u{1F4A2}\u{1F91F}\u{1F641}\u{1F6A8}\u{1F4A8}\u{1F92C}\u2708\u{1F380}\u{1F37A}\u{1F913}\u{1F619}\u{1F49F}\u{1F331}\u{1F616}\u{1F476}\u{1F974}\u25B6\u27A1\u2753\u{1F48E}\u{1F4B8}\u2B07\u{1F628}\u{1F31A}\u{1F98B}\u{1F637}\u{1F57A}\u26A0\u{1F645}\u{1F61F}\u{1F635}\u{1F44E}\u{1F932}\u{1F920}\u{1F927}\u{1F4CC}\u{1F535}\u{1F485}\u{1F9D0}\u{1F43E}\u{1F352}\u{1F617}\u{1F911}\u{1F30A}\u{1F92F}\u{1F437}\u260E\u{1F4A7}\u{1F62F}\u{1F486}\u{1F446}\u{1F3A4}\u{1F647}\u{1F351}\u2744\u{1F334}\u{1F4A3}\u{1F438}\u{1F48C}\u{1F4CD}\u{1F940}\u{1F922}\u{1F445}\u{1F4A1}\u{1F4A9}\u{1F450}\u{1F4F8}\u{1F47B}\u{1F910}\u{1F92E}\u{1F3BC}\u{1F975}\u{1F6A9}\u{1F34E}\u{1F34A}\u{1F47C}\u{1F48D}\u{1F4E3}\u{1F942}"),S2=rh.reduce((t,e,r)=>(t[r]=e,t),[]),A2=rh.reduce((t,e,r)=>(t[e.codePointAt(0)]=r,t),[]);function I2(t){return t.reduce((e,r)=>(e+=S2[r],e),"")}function O2(t){const e=[];for(const r of t){const n=A2[r.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${r}`);e.push(n)}return new Uint8Array(e)}const D2=ko({prefix:"\u{1F680}",name:"base256emoji",encode:I2,decode:O2});var $2=Object.freeze({__proto__:null,base256emoji:D2}),F2=ih,nh=128,P2=127,T2=~P2,N2=Math.pow(2,31);function ih(t,e,r){e=e||[],r=r||0;for(var n=r;t>=N2;)e[r++]=t&255|nh,t/=128;for(;t&T2;)e[r++]=t&255|nh,t>>>=7;return e[r]=t|0,ih.bytes=r-n+1,e}var R2=sa,L2=128,oh=127;function sa(t,n){var r=0,n=n||0,i=0,o=n,s,a=t.length;do{if(o>=a)throw sa.bytes=0,new RangeError("Could not decode varint");s=t[o++],r+=i<28?(s&oh)<<i:(s&oh)*Math.pow(2,i),i+=7}while(s>=L2);return sa.bytes=o-n,r}var M2=Math.pow(2,7),U2=Math.pow(2,14),B2=Math.pow(2,21),j2=Math.pow(2,28),k2=Math.pow(2,35),H2=Math.pow(2,42),z2=Math.pow(2,49),W2=Math.pow(2,56),V2=Math.pow(2,63),q2=function(t){return t<M2?1:t<U2?2:t<B2?3:t<j2?4:t<k2?5:t<H2?6:t<z2?7:t<W2?8:t<V2?9:10},K2={encode:F2,decode:R2,encodingLength:q2},sh=K2;const ah=(t,e,r=0)=>(sh.encode(t,e,r),e),ch=t=>sh.encodingLength(t),aa=(t,e)=>{const r=e.byteLength,n=ch(t),i=n+ch(r),o=new Uint8Array(i+r);return ah(t,o,0),ah(r,o,n),o.set(e,i),new G2(t,r,e,o)};class G2{constructor(e,r,n,i){this.code=e,this.size=r,this.digest=n,this.bytes=i}}const lh=({name:t,code:e,encode:r})=>new Y2(t,e,r);class Y2{constructor(e,r,n){this.name=e,this.code=r,this.encode=n}digest(e){if(e instanceof Uint8Array){const r=this.encode(e);return r instanceof Uint8Array?aa(this.code,r):r.then(n=>aa(this.code,n))}else throw Error("Unknown type, must be binary type")}}const uh=t=>async e=>new Uint8Array(await crypto.subtle.digest(t,e)),Z2=lh({name:"sha2-256",code:18,encode:uh("SHA-256")}),J2=lh({name:"sha2-512",code:19,encode:uh("SHA-512")});var X2=Object.freeze({__proto__:null,sha256:Z2,sha512:J2});const hh=0,Q2="identity",fh=eh;var eg=Object.freeze({__proto__:null,identity:{code:hh,name:Q2,encode:fh,digest:t=>aa(hh,fh(t))}});new TextEncoder,new TextDecoder;const dh={...G3,...Z3,...X3,...e2,...n2,...d2,...m2,...w2,...C2,...$2};({...X2,...eg});function ph(t,e,r,n){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:r},decoder:{decode:n}}}const gh=ph("utf8","u",t=>"u"+new TextDecoder("utf8").decode(t),t=>new TextEncoder().encode(t.substring(1))),ca=ph("ascii","a",t=>{let e="a";for(let r=0;r<t.length;r++)e+=String.fromCharCode(t[r]);return e},t=>{t=t.substring(1);const e=Qu(t.length);for(let r=0;r<t.length;r++)e[r]=t.charCodeAt(r);return e}),mh={utf8:gh,"utf-8":gh,hex:dh.base16,latin1:ca,ascii:ca,binary:ca,...dh};function Yt(t,e="utf8"){const r=mh[e];if(!r)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(t,"utf8"):r.decoder.decode(`${r.prefix}${t}`)}function Zt(t,e="utf8"){const r=mh[e];if(!r)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(t.buffer,t.byteOffset,t.byteLength).toString("utf8"):r.encoder.encode(t).substring(1)}var bh=function(t,e,r){if(r||arguments.length===2)for(var n=0,i=e.length,o;n<i;n++)(o||!(n in e))&&(o||(o=Array.prototype.slice.call(e,0,n)),o[n]=e[n]);return t.concat(o||Array.prototype.slice.call(e))},tg=function(){function t(e,r,n){this.name=e,this.version=r,this.os=n,this.type="browser"}return t}(),rg=function(){function t(e){this.version=e,this.type="node",this.name="node",this.os=process.platform}return t}(),ng=function(){function t(e,r,n,i){this.name=e,this.version=r,this.os=n,this.bot=i,this.type="bot-device"}return t}(),ig=function(){function t(){this.type="bot",this.bot=!0,this.name="bot",this.version=null,this.os=null}return t}(),og=function(){function t(){this.type="react-native",this.name="react-native",this.version=null,this.os=null}return t}(),sg=/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/,ag=/(nuhk|curl|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/,yh=3,cg=[["aol",/AOLShield\/([0-9\._]+)/],["edge",/Edge\/([0-9\._]+)/],["edge-ios",/EdgiOS\/([0-9\._]+)/],["yandexbrowser",/YaBrowser\/([0-9\._]+)/],["kakaotalk",/KAKAOTALK\s([0-9\.]+)/],["samsung",/SamsungBrowser\/([0-9\.]+)/],["silk",/\bSilk\/([0-9._-]+)\b/],["miui",/MiuiBrowser\/([0-9\.]+)$/],["beaker",/BeakerBrowser\/([0-9\.]+)/],["edge-chromium",/EdgA?\/([0-9\.]+)/],["chromium-webview",/(?!Chrom.*OPR)wv\).*Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["chrome",/(?!Chrom.*OPR)Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["phantomjs",/PhantomJS\/([0-9\.]+)(:?\s|$)/],["crios",/CriOS\/([0-9\.]+)(:?\s|$)/],["firefox",/Firefox\/([0-9\.]+)(?:\s|$)/],["fxios",/FxiOS\/([0-9\.]+)/],["opera-mini",/Opera Mini.*Version\/([0-9\.]+)/],["opera",/Opera\/([0-9\.]+)(?:\s|$)/],["opera",/OPR\/([0-9\.]+)(:?\s|$)/],["pie",/^Microsoft Pocket Internet Explorer\/(\d+\.\d+)$/],["pie",/^Mozilla\/\d\.\d+\s\(compatible;\s(?:MSP?IE|MSInternet Explorer) (\d+\.\d+);.*Windows CE.*\)$/],["netfront",/^Mozilla\/\d\.\d+.*NetFront\/(\d.\d)/],["ie",/Trident\/7\.0.*rv\:([0-9\.]+).*\).*Gecko$/],["ie",/MSIE\s([0-9\.]+);.*Trident\/[4-7].0/],["ie",/MSIE\s(7\.0)/],["bb10",/BB10;\sTouch.*Version\/([0-9\.]+)/],["android",/Android\s([0-9\.]+)/],["ios",/Version\/([0-9\._]+).*Mobile.*Safari.*/],["safari",/Version\/([0-9\._]+).*Safari/],["facebook",/FB[AS]V\/([0-9\.]+)/],["instagram",/Instagram\s([0-9\.]+)/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Mobile/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Gecko\)$/],["curl",/^curl\/([0-9\.]+)$/],["searchbot",sg]],wh=[["iOS",/iP(hone|od|ad)/],["Android OS",/Android/],["BlackBerry OS",/BlackBerry|BB10/],["Windows Mobile",/IEMobile/],["Amazon OS",/Kindle/],["Windows 3.11",/Win16/],["Windows 95",/(Windows 95)|(Win95)|(Windows_95)/],["Windows 98",/(Windows 98)|(Win98)/],["Windows 2000",/(Windows NT 5.0)|(Windows 2000)/],["Windows XP",/(Windows NT 5.1)|(Windows XP)/],["Windows Server 2003",/(Windows NT 5.2)/],["Windows Vista",/(Windows NT 6.0)/],["Windows 7",/(Windows NT 6.1)/],["Windows 8",/(Windows NT 6.2)/],["Windows 8.1",/(Windows NT 6.3)/],["Windows 10",/(Windows NT 10.0)/],["Windows ME",/Windows ME/],["Windows CE",/Windows CE|WinCE|Microsoft Pocket Internet Explorer/],["Open BSD",/OpenBSD/],["Sun OS",/SunOS/],["Chrome OS",/CrOS/],["Linux",/(Linux)|(X11)/],["Mac OS",/(Mac_PowerPC)|(Macintosh)/],["QNX",/QNX/],["BeOS",/BeOS/],["OS/2",/OS\/2/]];function lg(t){return t?vh(t):typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"?new og:typeof navigator<"u"?vh(navigator.userAgent):fg()}function ug(t){return t!==""&&cg.reduce(function(e,r){var n=r[0],i=r[1];if(e)return e;var o=i.exec(t);return!!o&&[n,o]},!1)}function vh(t){var e=ug(t);if(!e)return null;var r=e[0],n=e[1];if(r==="searchbot")return new ig;var i=n[1]&&n[1].split(".").join("_").split("_").slice(0,3);i?i.length<yh&&(i=bh(bh([],i,!0),dg(yh-i.length),!0)):i=[];var o=i.join("."),s=hg(t),a=ag.exec(t);return a&&a[1]?new ng(r,o,s,a[1]):new tg(r,o,s)}function hg(t){for(var e=0,r=wh.length;e<r;e++){var n=wh[e],i=n[0],o=n[1],s=o.exec(t);if(s)return i}return null}function fg(){var t=typeof process<"u"&&process.version;return t?new rg(process.version.slice(1)):null}function dg(t){for(var e=[],r=0;r<t;r++)e.push("0");return e}var Fe={};/*! *****************************************************************************
1
+ (function(Ar,ut){typeof exports=="object"&&typeof module<"u"?ut(exports):typeof define=="function"&&define.amd?define(["exports"],ut):(Ar=typeof globalThis<"u"?globalThis:Ar||self,ut(Ar["@walletconnect/ethereum-provider"]={}))})(this,function(Ar){"use strict";var ut=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Td(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function $r(t){var e=t.default;if(typeof e=="function"){var r=function(){return e.apply(this,arguments)};r.prototype=e.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(t).forEach(function(n){var i=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(r,n,i.get?i:{enumerable:!0,get:function(){return t[n]}})}),r}var _t={exports:{}},an=typeof Reflect=="object"?Reflect:null,Nc=an&&typeof an.apply=="function"?an.apply:function(e,r,n){return Function.prototype.apply.call(e,r,n)},Hi;an&&typeof an.ownKeys=="function"?Hi=an.ownKeys:Object.getOwnPropertySymbols?Hi=function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Hi=function(e){return Object.getOwnPropertyNames(e)};function Nd(t){console&&console.warn&&console.warn(t)}var Rc=Number.isNaN||function(e){return e!==e};function He(){He.init.call(this)}_t.exports=He,_t.exports.once=Ud,He.EventEmitter=He,He.prototype._events=void 0,He.prototype._eventsCount=0,He.prototype._maxListeners=void 0;var Lc=10;function zi(t){if(typeof t!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}Object.defineProperty(He,"defaultMaxListeners",{enumerable:!0,get:function(){return Lc},set:function(t){if(typeof t!="number"||t<0||Rc(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");Lc=t}}),He.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},He.prototype.setMaxListeners=function(e){if(typeof e!="number"||e<0||Rc(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this};function Mc(t){return t._maxListeners===void 0?He.defaultMaxListeners:t._maxListeners}He.prototype.getMaxListeners=function(){return Mc(this)},He.prototype.emit=function(e){for(var r=[],n=1;n<arguments.length;n++)r.push(arguments[n]);var i=e==="error",s=this._events;if(s!==void 0)i=i&&s.error===void 0;else if(!i)return!1;if(i){var o;if(r.length>0&&(o=r[0]),o instanceof Error)throw o;var a=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw a.context=o,a}var c=s[e];if(c===void 0)return!1;if(typeof c=="function")Nc(c,this,r);else for(var l=c.length,p=kc(c,l),n=0;n<l;++n)Nc(p[n],this,r);return!0};function Uc(t,e,r,n){var i,s,o;if(zi(r),s=t._events,s===void 0?(s=t._events=Object.create(null),t._eventsCount=0):(s.newListener!==void 0&&(t.emit("newListener",e,r.listener?r.listener:r),s=t._events),o=s[e]),o===void 0)o=s[e]=r,++t._eventsCount;else if(typeof o=="function"?o=s[e]=n?[r,o]:[o,r]:n?o.unshift(r):o.push(r),i=Mc(t),i>0&&o.length>i&&!o.warned){o.warned=!0;var a=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");a.name="MaxListenersExceededWarning",a.emitter=t,a.type=e,a.count=o.length,Nd(a)}return t}He.prototype.addListener=function(e,r){return Uc(this,e,r,!1)},He.prototype.on=He.prototype.addListener,He.prototype.prependListener=function(e,r){return Uc(this,e,r,!0)};function Rd(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function Fc(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},i=Rd.bind(n);return i.listener=r,n.wrapFn=i,i}He.prototype.once=function(e,r){return zi(r),this.on(e,Fc(this,e,r)),this},He.prototype.prependOnceListener=function(e,r){return zi(r),this.prependListener(e,Fc(this,e,r)),this},He.prototype.removeListener=function(e,r){var n,i,s,o,a;if(zi(r),i=this._events,i===void 0)return this;if(n=i[e],n===void 0)return this;if(n===r||n.listener===r)--this._eventsCount===0?this._events=Object.create(null):(delete i[e],i.removeListener&&this.emit("removeListener",e,n.listener||r));else if(typeof n!="function"){for(s=-1,o=n.length-1;o>=0;o--)if(n[o]===r||n[o].listener===r){a=n[o].listener,s=o;break}if(s<0)return this;s===0?n.shift():Ld(n,s),n.length===1&&(i[e]=n[0]),i.removeListener!==void 0&&this.emit("removeListener",e,a||r)}return this},He.prototype.off=He.prototype.removeListener,He.prototype.removeAllListeners=function(e){var r,n,i;if(n=this._events,n===void 0)return this;if(n.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):n[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete n[e]),this;if(arguments.length===0){var s=Object.keys(n),o;for(i=0;i<s.length;++i)o=s[i],o!=="removeListener"&&this.removeAllListeners(o);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(r=n[e],typeof r=="function")this.removeListener(e,r);else if(r!==void 0)for(i=r.length-1;i>=0;i--)this.removeListener(e,r[i]);return this};function Bc(t,e,r){var n=t._events;if(n===void 0)return[];var i=n[e];return i===void 0?[]:typeof i=="function"?r?[i.listener||i]:[i]:r?Md(i):kc(i,i.length)}He.prototype.listeners=function(e){return Bc(this,e,!0)},He.prototype.rawListeners=function(e){return Bc(this,e,!1)},He.listenerCount=function(t,e){return typeof t.listenerCount=="function"?t.listenerCount(e):jc.call(t,e)},He.prototype.listenerCount=jc;function jc(t){var e=this._events;if(e!==void 0){var r=e[t];if(typeof r=="function")return 1;if(r!==void 0)return r.length}return 0}He.prototype.eventNames=function(){return this._eventsCount>0?Hi(this._events):[]};function kc(t,e){for(var r=new Array(e),n=0;n<e;++n)r[n]=t[n];return r}function Ld(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}function Md(t){for(var e=new Array(t.length),r=0;r<e.length;++r)e[r]=t[r].listener||t[r];return e}function Ud(t,e){return new Promise(function(r,n){function i(o){t.removeListener(e,s),n(o)}function s(){typeof t.removeListener=="function"&&t.removeListener("error",i),r([].slice.call(arguments))}Hc(t,e,s,{once:!0}),e!=="error"&&Fd(t,i,{once:!0})})}function Fd(t,e,r){typeof t.on=="function"&&Hc(t,"error",e,r)}function Hc(t,e,r,n){if(typeof t.on=="function")n.once?t.once(e,r):t.on(e,r);else if(typeof t.addEventListener=="function")t.addEventListener(e,function i(s){n.once&&t.removeEventListener(e,i),r(s)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof t)}var ro={},Wi={},ve={},zc={};(function(t){Object.defineProperty(t,"__esModule",{value:!0});function e(a,c){var l=a>>>16&65535,p=a&65535,w=c>>>16&65535,y=c&65535;return p*y+(l*y+p*w<<16>>>0)|0}t.mul=Math.imul||e;function r(a,c){return a+c|0}t.add=r;function n(a,c){return a-c|0}t.sub=n;function i(a,c){return a<<c|a>>>32-c}t.rotl=i;function s(a,c){return a<<32-c|a>>>c}t.rotr=s;function o(a){return typeof a=="number"&&isFinite(a)&&Math.floor(a)===a}t.isInteger=Number.isInteger||o,t.MAX_SAFE_INTEGER=9007199254740991,t.isSafeInteger=function(a){return t.isInteger(a)&&a>=-t.MAX_SAFE_INTEGER&&a<=t.MAX_SAFE_INTEGER}})(zc),Object.defineProperty(ve,"__esModule",{value:!0});var Wc=zc;function Bd(t,e){return e===void 0&&(e=0),(t[e+0]<<8|t[e+1])<<16>>16}ve.readInt16BE=Bd;function jd(t,e){return e===void 0&&(e=0),(t[e+0]<<8|t[e+1])>>>0}ve.readUint16BE=jd;function kd(t,e){return e===void 0&&(e=0),(t[e+1]<<8|t[e])<<16>>16}ve.readInt16LE=kd;function Hd(t,e){return e===void 0&&(e=0),(t[e+1]<<8|t[e])>>>0}ve.readUint16LE=Hd;function qc(t,e,r){return e===void 0&&(e=new Uint8Array(2)),r===void 0&&(r=0),e[r+0]=t>>>8,e[r+1]=t>>>0,e}ve.writeUint16BE=qc,ve.writeInt16BE=qc;function Vc(t,e,r){return e===void 0&&(e=new Uint8Array(2)),r===void 0&&(r=0),e[r+0]=t>>>0,e[r+1]=t>>>8,e}ve.writeUint16LE=Vc,ve.writeInt16LE=Vc;function no(t,e){return e===void 0&&(e=0),t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3]}ve.readInt32BE=no;function io(t,e){return e===void 0&&(e=0),(t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3])>>>0}ve.readUint32BE=io;function so(t,e){return e===void 0&&(e=0),t[e+3]<<24|t[e+2]<<16|t[e+1]<<8|t[e]}ve.readInt32LE=so;function oo(t,e){return e===void 0&&(e=0),(t[e+3]<<24|t[e+2]<<16|t[e+1]<<8|t[e])>>>0}ve.readUint32LE=oo;function qi(t,e,r){return e===void 0&&(e=new Uint8Array(4)),r===void 0&&(r=0),e[r+0]=t>>>24,e[r+1]=t>>>16,e[r+2]=t>>>8,e[r+3]=t>>>0,e}ve.writeUint32BE=qi,ve.writeInt32BE=qi;function Vi(t,e,r){return e===void 0&&(e=new Uint8Array(4)),r===void 0&&(r=0),e[r+0]=t>>>0,e[r+1]=t>>>8,e[r+2]=t>>>16,e[r+3]=t>>>24,e}ve.writeUint32LE=Vi,ve.writeInt32LE=Vi;function zd(t,e){e===void 0&&(e=0);var r=no(t,e),n=no(t,e+4);return r*4294967296+n-(n>>31)*4294967296}ve.readInt64BE=zd;function Wd(t,e){e===void 0&&(e=0);var r=io(t,e),n=io(t,e+4);return r*4294967296+n}ve.readUint64BE=Wd;function qd(t,e){e===void 0&&(e=0);var r=so(t,e),n=so(t,e+4);return n*4294967296+r-(r>>31)*4294967296}ve.readInt64LE=qd;function Vd(t,e){e===void 0&&(e=0);var r=oo(t,e),n=oo(t,e+4);return n*4294967296+r}ve.readUint64LE=Vd;function Kc(t,e,r){return e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0),qi(t/4294967296>>>0,e,r),qi(t>>>0,e,r+4),e}ve.writeUint64BE=Kc,ve.writeInt64BE=Kc;function Gc(t,e,r){return e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0),Vi(t>>>0,e,r),Vi(t/4294967296>>>0,e,r+4),e}ve.writeUint64LE=Gc,ve.writeInt64LE=Gc;function Kd(t,e,r){if(r===void 0&&(r=0),t%8!==0)throw new Error("readUintBE supports only bitLengths divisible by 8");if(t/8>e.length-r)throw new Error("readUintBE: array is too short for the given bitLength");for(var n=0,i=1,s=t/8+r-1;s>=r;s--)n+=e[s]*i,i*=256;return n}ve.readUintBE=Kd;function Gd(t,e,r){if(r===void 0&&(r=0),t%8!==0)throw new Error("readUintLE supports only bitLengths divisible by 8");if(t/8>e.length-r)throw new Error("readUintLE: array is too short for the given bitLength");for(var n=0,i=1,s=r;s<r+t/8;s++)n+=e[s]*i,i*=256;return n}ve.readUintLE=Gd;function Yd(t,e,r,n){if(r===void 0&&(r=new Uint8Array(t/8)),n===void 0&&(n=0),t%8!==0)throw new Error("writeUintBE supports only bitLengths divisible by 8");if(!Wc.isSafeInteger(e))throw new Error("writeUintBE value must be an integer");for(var i=1,s=t/8+n-1;s>=n;s--)r[s]=e/i&255,i*=256;return r}ve.writeUintBE=Yd;function Zd(t,e,r,n){if(r===void 0&&(r=new Uint8Array(t/8)),n===void 0&&(n=0),t%8!==0)throw new Error("writeUintLE supports only bitLengths divisible by 8");if(!Wc.isSafeInteger(e))throw new Error("writeUintLE value must be an integer");for(var i=1,s=n;s<n+t/8;s++)r[s]=e/i&255,i*=256;return r}ve.writeUintLE=Zd;function Jd(t,e){e===void 0&&(e=0);var r=new DataView(t.buffer,t.byteOffset,t.byteLength);return r.getFloat32(e)}ve.readFloat32BE=Jd;function Xd(t,e){e===void 0&&(e=0);var r=new DataView(t.buffer,t.byteOffset,t.byteLength);return r.getFloat32(e,!0)}ve.readFloat32LE=Xd;function Qd(t,e){e===void 0&&(e=0);var r=new DataView(t.buffer,t.byteOffset,t.byteLength);return r.getFloat64(e)}ve.readFloat64BE=Qd;function ef(t,e){e===void 0&&(e=0);var r=new DataView(t.buffer,t.byteOffset,t.byteLength);return r.getFloat64(e,!0)}ve.readFloat64LE=ef;function tf(t,e,r){e===void 0&&(e=new Uint8Array(4)),r===void 0&&(r=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.setFloat32(r,t),e}ve.writeFloat32BE=tf;function rf(t,e,r){e===void 0&&(e=new Uint8Array(4)),r===void 0&&(r=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.setFloat32(r,t,!0),e}ve.writeFloat32LE=rf;function nf(t,e,r){e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.setFloat64(r,t),e}ve.writeFloat64BE=nf;function sf(t,e,r){e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.setFloat64(r,t,!0),e}ve.writeFloat64LE=sf;var Ut={};Object.defineProperty(Ut,"__esModule",{value:!0});function of(t){for(var e=0;e<t.length;e++)t[e]=0;return t}Ut.wipe=of,Object.defineProperty(Wi,"__esModule",{value:!0});var St=ve,ao=Ut,af=20;function cf(t,e,r){for(var n=1634760805,i=857760878,s=2036477234,o=1797285236,a=r[3]<<24|r[2]<<16|r[1]<<8|r[0],c=r[7]<<24|r[6]<<16|r[5]<<8|r[4],l=r[11]<<24|r[10]<<16|r[9]<<8|r[8],p=r[15]<<24|r[14]<<16|r[13]<<8|r[12],w=r[19]<<24|r[18]<<16|r[17]<<8|r[16],y=r[23]<<24|r[22]<<16|r[21]<<8|r[20],m=r[27]<<24|r[26]<<16|r[25]<<8|r[24],E=r[31]<<24|r[30]<<16|r[29]<<8|r[28],A=e[3]<<24|e[2]<<16|e[1]<<8|e[0],N=e[7]<<24|e[6]<<16|e[5]<<8|e[4],M=e[11]<<24|e[10]<<16|e[9]<<8|e[8],x=e[15]<<24|e[14]<<16|e[13]<<8|e[12],D=n,b=i,I=s,O=o,h=a,_=c,H=l,j=p,q=w,X=y,re=m,C=E,$=A,G=N,K=M,W=x,z=0;z<af;z+=2)D=D+h|0,$^=D,$=$>>>32-16|$<<16,q=q+$|0,h^=q,h=h>>>32-12|h<<12,b=b+_|0,G^=b,G=G>>>32-16|G<<16,X=X+G|0,_^=X,_=_>>>32-12|_<<12,I=I+H|0,K^=I,K=K>>>32-16|K<<16,re=re+K|0,H^=re,H=H>>>32-12|H<<12,O=O+j|0,W^=O,W=W>>>32-16|W<<16,C=C+W|0,j^=C,j=j>>>32-12|j<<12,I=I+H|0,K^=I,K=K>>>32-8|K<<8,re=re+K|0,H^=re,H=H>>>32-7|H<<7,O=O+j|0,W^=O,W=W>>>32-8|W<<8,C=C+W|0,j^=C,j=j>>>32-7|j<<7,b=b+_|0,G^=b,G=G>>>32-8|G<<8,X=X+G|0,_^=X,_=_>>>32-7|_<<7,D=D+h|0,$^=D,$=$>>>32-8|$<<8,q=q+$|0,h^=q,h=h>>>32-7|h<<7,D=D+_|0,W^=D,W=W>>>32-16|W<<16,re=re+W|0,_^=re,_=_>>>32-12|_<<12,b=b+H|0,$^=b,$=$>>>32-16|$<<16,C=C+$|0,H^=C,H=H>>>32-12|H<<12,I=I+j|0,G^=I,G=G>>>32-16|G<<16,q=q+G|0,j^=q,j=j>>>32-12|j<<12,O=O+h|0,K^=O,K=K>>>32-16|K<<16,X=X+K|0,h^=X,h=h>>>32-12|h<<12,I=I+j|0,G^=I,G=G>>>32-8|G<<8,q=q+G|0,j^=q,j=j>>>32-7|j<<7,O=O+h|0,K^=O,K=K>>>32-8|K<<8,X=X+K|0,h^=X,h=h>>>32-7|h<<7,b=b+H|0,$^=b,$=$>>>32-8|$<<8,C=C+$|0,H^=C,H=H>>>32-7|H<<7,D=D+_|0,W^=D,W=W>>>32-8|W<<8,re=re+W|0,_^=re,_=_>>>32-7|_<<7;St.writeUint32LE(D+n|0,t,0),St.writeUint32LE(b+i|0,t,4),St.writeUint32LE(I+s|0,t,8),St.writeUint32LE(O+o|0,t,12),St.writeUint32LE(h+a|0,t,16),St.writeUint32LE(_+c|0,t,20),St.writeUint32LE(H+l|0,t,24),St.writeUint32LE(j+p|0,t,28),St.writeUint32LE(q+w|0,t,32),St.writeUint32LE(X+y|0,t,36),St.writeUint32LE(re+m|0,t,40),St.writeUint32LE(C+E|0,t,44),St.writeUint32LE($+A|0,t,48),St.writeUint32LE(G+N|0,t,52),St.writeUint32LE(K+M|0,t,56),St.writeUint32LE(W+x|0,t,60)}function Yc(t,e,r,n,i){if(i===void 0&&(i=0),t.length!==32)throw new Error("ChaCha: key size must be 32 bytes");if(n.length<r.length)throw new Error("ChaCha: destination is shorter than source");var s,o;if(i===0){if(e.length!==8&&e.length!==12)throw new Error("ChaCha nonce must be 8 or 12 bytes");s=new Uint8Array(16),o=s.length-e.length,s.set(e,o)}else{if(e.length!==16)throw new Error("ChaCha nonce with counter must be 16 bytes");s=e,o=i}for(var a=new Uint8Array(64),c=0;c<r.length;c+=64){cf(a,s,t);for(var l=c;l<c+64&&l<r.length;l++)n[l]=r[l]^a[l-c];uf(s,0,o)}return ao.wipe(a),i===0&&ao.wipe(s),n}Wi.streamXOR=Yc;function lf(t,e,r,n){return n===void 0&&(n=0),ao.wipe(r),Yc(t,e,r,r,n)}Wi.stream=lf;function uf(t,e,r){for(var n=1;r--;)n=n+(t[e]&255)|0,t[e]=n&255,n>>>=8,e++;if(n>0)throw new Error("ChaCha: counter overflow")}var Zc={},pr={};Object.defineProperty(pr,"__esModule",{value:!0});function hf(t,e,r){return~(t-1)&e|t-1&r}pr.select=hf;function df(t,e){return(t|0)-(e|0)-1>>>31&1}pr.lessOrEqual=df;function Jc(t,e){if(t.length!==e.length)return 0;for(var r=0,n=0;n<t.length;n++)r|=t[n]^e[n];return 1&r-1>>>8}pr.compare=Jc;function ff(t,e){return t.length===0||e.length===0?!1:Jc(t,e)!==0}pr.equal=ff,function(t){Object.defineProperty(t,"__esModule",{value:!0});var e=pr,r=Ut;t.DIGEST_LENGTH=16;var n=function(){function o(a){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 c=a[0]|a[1]<<8;this._r[0]=c&8191;var l=a[2]|a[3]<<8;this._r[1]=(c>>>13|l<<3)&8191;var p=a[4]|a[5]<<8;this._r[2]=(l>>>10|p<<6)&7939;var w=a[6]|a[7]<<8;this._r[3]=(p>>>7|w<<9)&8191;var y=a[8]|a[9]<<8;this._r[4]=(w>>>4|y<<12)&255,this._r[5]=y>>>1&8190;var m=a[10]|a[11]<<8;this._r[6]=(y>>>14|m<<2)&8191;var E=a[12]|a[13]<<8;this._r[7]=(m>>>11|E<<5)&8065;var A=a[14]|a[15]<<8;this._r[8]=(E>>>8|A<<8)&8191,this._r[9]=A>>>5&127,this._pad[0]=a[16]|a[17]<<8,this._pad[1]=a[18]|a[19]<<8,this._pad[2]=a[20]|a[21]<<8,this._pad[3]=a[22]|a[23]<<8,this._pad[4]=a[24]|a[25]<<8,this._pad[5]=a[26]|a[27]<<8,this._pad[6]=a[28]|a[29]<<8,this._pad[7]=a[30]|a[31]<<8}return o.prototype._blocks=function(a,c,l){for(var p=this._fin?0:2048,w=this._h[0],y=this._h[1],m=this._h[2],E=this._h[3],A=this._h[4],N=this._h[5],M=this._h[6],x=this._h[7],D=this._h[8],b=this._h[9],I=this._r[0],O=this._r[1],h=this._r[2],_=this._r[3],H=this._r[4],j=this._r[5],q=this._r[6],X=this._r[7],re=this._r[8],C=this._r[9];l>=16;){var $=a[c+0]|a[c+1]<<8;w+=$&8191;var G=a[c+2]|a[c+3]<<8;y+=($>>>13|G<<3)&8191;var K=a[c+4]|a[c+5]<<8;m+=(G>>>10|K<<6)&8191;var W=a[c+6]|a[c+7]<<8;E+=(K>>>7|W<<9)&8191;var z=a[c+8]|a[c+9]<<8;A+=(W>>>4|z<<12)&8191,N+=z>>>1&8191;var J=a[c+10]|a[c+11]<<8;M+=(z>>>14|J<<2)&8191;var Y=a[c+12]|a[c+13]<<8;x+=(J>>>11|Y<<5)&8191;var le=a[c+14]|a[c+15]<<8;D+=(Y>>>8|le<<8)&8191,b+=le>>>5|p;var ee=0,fe=ee;fe+=w*I,fe+=y*(5*C),fe+=m*(5*re),fe+=E*(5*X),fe+=A*(5*q),ee=fe>>>13,fe&=8191,fe+=N*(5*j),fe+=M*(5*H),fe+=x*(5*_),fe+=D*(5*h),fe+=b*(5*O),ee+=fe>>>13,fe&=8191;var ae=ee;ae+=w*O,ae+=y*I,ae+=m*(5*C),ae+=E*(5*re),ae+=A*(5*X),ee=ae>>>13,ae&=8191,ae+=N*(5*q),ae+=M*(5*j),ae+=x*(5*H),ae+=D*(5*_),ae+=b*(5*h),ee+=ae>>>13,ae&=8191;var Ce=ee;Ce+=w*h,Ce+=y*O,Ce+=m*I,Ce+=E*(5*C),Ce+=A*(5*re),ee=Ce>>>13,Ce&=8191,Ce+=N*(5*X),Ce+=M*(5*q),Ce+=x*(5*j),Ce+=D*(5*H),Ce+=b*(5*_),ee+=Ce>>>13,Ce&=8191;var B=ee;B+=w*_,B+=y*h,B+=m*O,B+=E*I,B+=A*(5*C),ee=B>>>13,B&=8191,B+=N*(5*re),B+=M*(5*X),B+=x*(5*q),B+=D*(5*j),B+=b*(5*H),ee+=B>>>13,B&=8191;var F=ee;F+=w*H,F+=y*_,F+=m*h,F+=E*O,F+=A*I,ee=F>>>13,F&=8191,F+=N*(5*C),F+=M*(5*re),F+=x*(5*X),F+=D*(5*q),F+=b*(5*j),ee+=F>>>13,F&=8191;var R=ee;R+=w*j,R+=y*H,R+=m*_,R+=E*h,R+=A*O,ee=R>>>13,R&=8191,R+=N*I,R+=M*(5*C),R+=x*(5*re),R+=D*(5*X),R+=b*(5*q),ee+=R>>>13,R&=8191;var f=ee;f+=w*q,f+=y*j,f+=m*H,f+=E*_,f+=A*h,ee=f>>>13,f&=8191,f+=N*O,f+=M*I,f+=x*(5*C),f+=D*(5*re),f+=b*(5*X),ee+=f>>>13,f&=8191;var P=ee;P+=w*X,P+=y*q,P+=m*j,P+=E*H,P+=A*_,ee=P>>>13,P&=8191,P+=N*h,P+=M*O,P+=x*I,P+=D*(5*C),P+=b*(5*re),ee+=P>>>13,P&=8191;var te=ee;te+=w*re,te+=y*X,te+=m*q,te+=E*j,te+=A*H,ee=te>>>13,te&=8191,te+=N*_,te+=M*h,te+=x*O,te+=D*I,te+=b*(5*C),ee+=te>>>13,te&=8191;var ie=ee;ie+=w*C,ie+=y*re,ie+=m*X,ie+=E*q,ie+=A*j,ee=ie>>>13,ie&=8191,ie+=N*H,ie+=M*_,ie+=x*h,ie+=D*O,ie+=b*I,ee+=ie>>>13,ie&=8191,ee=(ee<<2)+ee|0,ee=ee+fe|0,fe=ee&8191,ee=ee>>>13,ae+=ee,w=fe,y=ae,m=Ce,E=B,A=F,N=R,M=f,x=P,D=te,b=ie,c+=16,l-=16}this._h[0]=w,this._h[1]=y,this._h[2]=m,this._h[3]=E,this._h[4]=A,this._h[5]=N,this._h[6]=M,this._h[7]=x,this._h[8]=D,this._h[9]=b},o.prototype.finish=function(a,c){c===void 0&&(c=0);var l=new Uint16Array(10),p,w,y,m;if(this._leftover){for(m=this._leftover,this._buffer[m++]=1;m<16;m++)this._buffer[m]=0;this._fin=1,this._blocks(this._buffer,0,16)}for(p=this._h[1]>>>13,this._h[1]&=8191,m=2;m<10;m++)this._h[m]+=p,p=this._h[m]>>>13,this._h[m]&=8191;for(this._h[0]+=p*5,p=this._h[0]>>>13,this._h[0]&=8191,this._h[1]+=p,p=this._h[1]>>>13,this._h[1]&=8191,this._h[2]+=p,l[0]=this._h[0]+5,p=l[0]>>>13,l[0]&=8191,m=1;m<10;m++)l[m]=this._h[m]+p,p=l[m]>>>13,l[m]&=8191;for(l[9]-=1<<13,w=(p^1)-1,m=0;m<10;m++)l[m]&=w;for(w=~w,m=0;m<10;m++)this._h[m]=this._h[m]&w|l[m];for(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,y=this._h[0]+this._pad[0],this._h[0]=y&65535,m=1;m<8;m++)y=(this._h[m]+this._pad[m]|0)+(y>>>16)|0,this._h[m]=y&65535;return a[c+0]=this._h[0]>>>0,a[c+1]=this._h[0]>>>8,a[c+2]=this._h[1]>>>0,a[c+3]=this._h[1]>>>8,a[c+4]=this._h[2]>>>0,a[c+5]=this._h[2]>>>8,a[c+6]=this._h[3]>>>0,a[c+7]=this._h[3]>>>8,a[c+8]=this._h[4]>>>0,a[c+9]=this._h[4]>>>8,a[c+10]=this._h[5]>>>0,a[c+11]=this._h[5]>>>8,a[c+12]=this._h[6]>>>0,a[c+13]=this._h[6]>>>8,a[c+14]=this._h[7]>>>0,a[c+15]=this._h[7]>>>8,this._finished=!0,this},o.prototype.update=function(a){var c=0,l=a.length,p;if(this._leftover){p=16-this._leftover,p>l&&(p=l);for(var w=0;w<p;w++)this._buffer[this._leftover+w]=a[c+w];if(l-=p,c+=p,this._leftover+=p,this._leftover<16)return this;this._blocks(this._buffer,0,16),this._leftover=0}if(l>=16&&(p=l-l%16,this._blocks(a,c,p),c+=p,l-=p),l){for(var w=0;w<l;w++)this._buffer[this._leftover+w]=a[c+w];this._leftover+=l}return this},o.prototype.digest=function(){if(this._finished)throw new Error("Poly1305 was finished");var a=new Uint8Array(16);return this.finish(a),a},o.prototype.clean=function(){return r.wipe(this._buffer),r.wipe(this._r),r.wipe(this._h),r.wipe(this._pad),this._leftover=0,this._fin=0,this._finished=!0,this},o}();t.Poly1305=n;function i(o,a){var c=new n(o);c.update(a);var l=c.digest();return c.clean(),l}t.oneTimeAuth=i;function s(o,a){return o.length!==t.DIGEST_LENGTH||a.length!==t.DIGEST_LENGTH?!1:e.equal(o,a)}t.equal=s}(Zc),function(t){Object.defineProperty(t,"__esModule",{value:!0});var e=Wi,r=Zc,n=Ut,i=ve,s=pr;t.KEY_LENGTH=32,t.NONCE_LENGTH=12,t.TAG_LENGTH=16;var o=new Uint8Array(16),a=function(){function c(l){if(this.nonceLength=t.NONCE_LENGTH,this.tagLength=t.TAG_LENGTH,l.length!==t.KEY_LENGTH)throw new Error("ChaCha20Poly1305 needs 32-byte key");this._key=new Uint8Array(l)}return c.prototype.seal=function(l,p,w,y){if(l.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");var m=new Uint8Array(16);m.set(l,m.length-l.length);var E=new Uint8Array(32);e.stream(this._key,m,E,4);var A=p.length+this.tagLength,N;if(y){if(y.length!==A)throw new Error("ChaCha20Poly1305: incorrect destination length");N=y}else N=new Uint8Array(A);return e.streamXOR(this._key,m,p,N,4),this._authenticate(N.subarray(N.length-this.tagLength,N.length),E,N.subarray(0,N.length-this.tagLength),w),n.wipe(m),N},c.prototype.open=function(l,p,w,y){if(l.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");if(p.length<this.tagLength)return null;var m=new Uint8Array(16);m.set(l,m.length-l.length);var E=new Uint8Array(32);e.stream(this._key,m,E,4);var A=new Uint8Array(this.tagLength);if(this._authenticate(A,E,p.subarray(0,p.length-this.tagLength),w),!s.equal(A,p.subarray(p.length-this.tagLength,p.length)))return null;var N=p.length-this.tagLength,M;if(y){if(y.length!==N)throw new Error("ChaCha20Poly1305: incorrect destination length");M=y}else M=new Uint8Array(N);return e.streamXOR(this._key,m,p.subarray(0,p.length-this.tagLength),M,4),n.wipe(m),M},c.prototype.clean=function(){return n.wipe(this._key),this},c.prototype._authenticate=function(l,p,w,y){var m=new r.Poly1305(p);y&&(m.update(y),y.length%16>0&&m.update(o.subarray(y.length%16))),m.update(w),w.length%16>0&&m.update(o.subarray(w.length%16));var E=new Uint8Array(8);y&&i.writeUint64LE(y.length,E),m.update(E),i.writeUint64LE(w.length,E),m.update(E);for(var A=m.digest(),N=0;N<A.length;N++)l[N]=A[N];m.clean(),n.wipe(A),n.wipe(E)},c}();t.ChaCha20Poly1305=a}(ro);var Xc={},Nn={},co={};Object.defineProperty(co,"__esModule",{value:!0});function pf(t){return typeof t.saveState<"u"&&typeof t.restoreState<"u"&&typeof t.cleanSavedState<"u"}co.isSerializableHash=pf,Object.defineProperty(Nn,"__esModule",{value:!0});var Xt=co,gf=pr,mf=Ut,Qc=function(){function t(e,r){this._finished=!1,this._inner=new e,this._outer=new e,this.blockSize=this._outer.blockSize,this.digestLength=this._outer.digestLength;var n=new Uint8Array(this.blockSize);r.length>this.blockSize?this._inner.update(r).finish(n).clean():n.set(r);for(var i=0;i<n.length;i++)n[i]^=54;this._inner.update(n);for(var i=0;i<n.length;i++)n[i]^=106;this._outer.update(n),Xt.isSerializableHash(this._inner)&&Xt.isSerializableHash(this._outer)&&(this._innerKeyedState=this._inner.saveState(),this._outerKeyedState=this._outer.saveState()),mf.wipe(n)}return t.prototype.reset=function(){if(!Xt.isSerializableHash(this._inner)||!Xt.isSerializableHash(this._outer))throw new Error("hmac: can't reset() because hash doesn't implement restoreState()");return this._inner.restoreState(this._innerKeyedState),this._outer.restoreState(this._outerKeyedState),this._finished=!1,this},t.prototype.clean=function(){Xt.isSerializableHash(this._inner)&&this._inner.cleanSavedState(this._innerKeyedState),Xt.isSerializableHash(this._outer)&&this._outer.cleanSavedState(this._outerKeyedState),this._inner.clean(),this._outer.clean()},t.prototype.update=function(e){return this._inner.update(e),this},t.prototype.finish=function(e){return this._finished?(this._outer.finish(e),this):(this._inner.finish(e),this._outer.update(e.subarray(0,this.digestLength)).finish(e),this._finished=!0,this)},t.prototype.digest=function(){var e=new Uint8Array(this.digestLength);return this.finish(e),e},t.prototype.saveState=function(){if(!Xt.isSerializableHash(this._inner))throw new Error("hmac: can't saveState() because hash doesn't implement it");return this._inner.saveState()},t.prototype.restoreState=function(e){if(!Xt.isSerializableHash(this._inner)||!Xt.isSerializableHash(this._outer))throw new Error("hmac: can't restoreState() because hash doesn't implement it");return this._inner.restoreState(e),this._outer.restoreState(this._outerKeyedState),this._finished=!1,this},t.prototype.cleanSavedState=function(e){if(!Xt.isSerializableHash(this._inner))throw new Error("hmac: can't cleanSavedState() because hash doesn't implement it");this._inner.cleanSavedState(e)},t}();Nn.HMAC=Qc;function wf(t,e,r){var n=new Qc(t,e);n.update(r);var i=n.digest();return n.clean(),i}Nn.hmac=wf,Nn.equal=gf.equal,Object.defineProperty(Xc,"__esModule",{value:!0});var el=Nn,tl=Ut,yf=function(){function t(e,r,n,i){n===void 0&&(n=new Uint8Array(0)),this._counter=new Uint8Array(1),this._hash=e,this._info=i;var s=el.hmac(this._hash,n,r);this._hmac=new el.HMAC(e,s),this._buffer=new Uint8Array(this._hmac.digestLength),this._bufpos=this._buffer.length}return t.prototype._fillBuffer=function(){this._counter[0]++;var e=this._counter[0];if(e===0)throw new 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},t.prototype.expand=function(e){for(var r=new Uint8Array(e),n=0;n<r.length;n++)this._bufpos===this._buffer.length&&this._fillBuffer(),r[n]=this._buffer[this._bufpos++];return r},t.prototype.clean=function(){this._hmac.clean(),tl.wipe(this._buffer),tl.wipe(this._counter),this._bufpos=0},t}(),bf=Xc.HKDF=yf,cn={},Ki={},Gi={};Object.defineProperty(Gi,"__esModule",{value:!0}),Gi.BrowserRandomSource=void 0;const rl=65536;class vf{constructor(){this.isAvailable=!1,this.isInstantiated=!1;const e=typeof self<"u"?self.crypto||self.msCrypto:null;e&&e.getRandomValues!==void 0&&(this._crypto=e,this.isAvailable=!0,this.isInstantiated=!0)}randomBytes(e){if(!this.isAvailable||!this._crypto)throw new Error("Browser random byte generator is not available.");const r=new Uint8Array(e);for(let n=0;n<r.length;n+=rl)this._crypto.getRandomValues(r.subarray(n,n+Math.min(r.length-n,rl)));return r}}Gi.BrowserRandomSource=vf;function _f(t){throw new Error('Could not dynamically require "'+t+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Yi={},Ef={},xf=Object.freeze({__proto__:null,default:Ef}),Cf=$r(xf);Object.defineProperty(Yi,"__esModule",{value:!0}),Yi.NodeRandomSource=void 0;const Sf=Ut;class If{constructor(){if(this.isAvailable=!1,this.isInstantiated=!1,typeof _f<"u"){const e=Cf;e&&e.randomBytes&&(this._crypto=e,this.isAvailable=!0,this.isInstantiated=!0)}}randomBytes(e){if(!this.isAvailable||!this._crypto)throw new Error("Node.js random byte generator is not available.");let r=this._crypto.randomBytes(e);if(r.length!==e)throw new Error("NodeRandomSource: got fewer bytes than requested");const n=new Uint8Array(e);for(let i=0;i<n.length;i++)n[i]=r[i];return(0,Sf.wipe)(r),n}}Yi.NodeRandomSource=If,Object.defineProperty(Ki,"__esModule",{value:!0}),Ki.SystemRandomSource=void 0;const Df=Gi,Of=Yi;class Af{constructor(){if(this.isAvailable=!1,this.name="",this._source=new Df.BrowserRandomSource,this._source.isAvailable){this.isAvailable=!0,this.name="Browser";return}if(this._source=new Of.NodeRandomSource,this._source.isAvailable){this.isAvailable=!0,this.name="Node";return}}randomBytes(e){if(!this.isAvailable)throw new Error("System random byte generator is not available.");return this._source.randomBytes(e)}}Ki.SystemRandomSource=Af,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.randomStringForEntropy=t.randomString=t.randomUint32=t.randomBytes=t.defaultRandomSource=void 0;const e=Ki,r=ve,n=Ut;t.defaultRandomSource=new e.SystemRandomSource;function i(l,p=t.defaultRandomSource){return p.randomBytes(l)}t.randomBytes=i;function s(l=t.defaultRandomSource){const p=i(4,l),w=(0,r.readUint32LE)(p);return(0,n.wipe)(p),w}t.randomUint32=s;const o="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";function a(l,p=o,w=t.defaultRandomSource){if(p.length<2)throw new Error("randomString charset is too short");if(p.length>256)throw new Error("randomString charset is too long");let y="";const m=p.length,E=256-256%m;for(;l>0;){const A=i(Math.ceil(l*256/E),w);for(let N=0;N<A.length&&l>0;N++){const M=A[N];M<E&&(y+=p.charAt(M%m),l--)}(0,n.wipe)(A)}return y}t.randomString=a;function c(l,p=o,w=t.defaultRandomSource){const y=Math.ceil(l/(Math.log(p.length)/Math.LN2));return a(y,p,w)}t.randomStringForEntropy=c}(cn);var Zi={};(function(t){Object.defineProperty(t,"__esModule",{value:!0});var e=ve,r=Ut;t.DIGEST_LENGTH=32,t.BLOCK_SIZE=64;var n=function(){function a(){this.digestLength=t.DIGEST_LENGTH,this.blockSize=t.BLOCK_SIZE,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 a.prototype._initState=function(){this._state[0]=1779033703,this._state[1]=3144134277,this._state[2]=1013904242,this._state[3]=2773480762,this._state[4]=1359893119,this._state[5]=2600822924,this._state[6]=528734635,this._state[7]=1541459225},a.prototype.reset=function(){return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this},a.prototype.clean=function(){r.wipe(this._buffer),r.wipe(this._temp),this.reset()},a.prototype.update=function(c,l){if(l===void 0&&(l=c.length),this._finished)throw new Error("SHA256: can't update because hash was finished.");var p=0;if(this._bytesHashed+=l,this._bufferLength>0){for(;this._bufferLength<this.blockSize&&l>0;)this._buffer[this._bufferLength++]=c[p++],l--;this._bufferLength===this.blockSize&&(s(this._temp,this._state,this._buffer,0,this.blockSize),this._bufferLength=0)}for(l>=this.blockSize&&(p=s(this._temp,this._state,c,p,l),l%=this.blockSize);l>0;)this._buffer[this._bufferLength++]=c[p++],l--;return this},a.prototype.finish=function(c){if(!this._finished){var l=this._bytesHashed,p=this._bufferLength,w=l/536870912|0,y=l<<3,m=l%64<56?64:128;this._buffer[p]=128;for(var E=p+1;E<m-8;E++)this._buffer[E]=0;e.writeUint32BE(w,this._buffer,m-8),e.writeUint32BE(y,this._buffer,m-4),s(this._temp,this._state,this._buffer,0,m),this._finished=!0}for(var E=0;E<this.digestLength/4;E++)e.writeUint32BE(this._state[E],c,E*4);return this},a.prototype.digest=function(){var c=new Uint8Array(this.digestLength);return this.finish(c),c},a.prototype.saveState=function(){if(this._finished)throw new Error("SHA256: cannot save finished state");return{state:new Int32Array(this._state),buffer:this._bufferLength>0?new Uint8Array(this._buffer):void 0,bufferLength:this._bufferLength,bytesHashed:this._bytesHashed}},a.prototype.restoreState=function(c){return this._state.set(c.state),this._bufferLength=c.bufferLength,c.buffer&&this._buffer.set(c.buffer),this._bytesHashed=c.bytesHashed,this._finished=!1,this},a.prototype.cleanSavedState=function(c){r.wipe(c.state),c.buffer&&r.wipe(c.buffer),c.bufferLength=0,c.bytesHashed=0},a}();t.SHA256=n;var i=new Int32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]);function s(a,c,l,p,w){for(;w>=64;){for(var y=c[0],m=c[1],E=c[2],A=c[3],N=c[4],M=c[5],x=c[6],D=c[7],b=0;b<16;b++){var I=p+b*4;a[b]=e.readUint32BE(l,I)}for(var b=16;b<64;b++){var O=a[b-2],h=(O>>>17|O<<32-17)^(O>>>19|O<<32-19)^O>>>10;O=a[b-15];var _=(O>>>7|O<<32-7)^(O>>>18|O<<32-18)^O>>>3;a[b]=(h+a[b-7]|0)+(_+a[b-16]|0)}for(var b=0;b<64;b++){var h=(((N>>>6|N<<26)^(N>>>11|N<<21)^(N>>>25|N<<7))+(N&M^~N&x)|0)+(D+(i[b]+a[b]|0)|0)|0,_=((y>>>2|y<<32-2)^(y>>>13|y<<32-13)^(y>>>22|y<<32-22))+(y&m^y&E^m&E)|0;D=x,x=M,M=N,N=A+h|0,A=E,E=m,m=y,y=h+_|0}c[0]+=y,c[1]+=m,c[2]+=E,c[3]+=A,c[4]+=N,c[5]+=M,c[6]+=x,c[7]+=D,p+=64,w-=64}return p}function o(a){var c=new n;c.update(a);var l=c.digest();return c.clean(),l}t.hash=o})(Zi);var lo={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.sharedKey=t.generateKeyPair=t.generateKeyPairFromSeed=t.scalarMultBase=t.scalarMult=t.SHARED_KEY_LENGTH=t.SECRET_KEY_LENGTH=t.PUBLIC_KEY_LENGTH=void 0;const e=cn,r=Ut;t.PUBLIC_KEY_LENGTH=32,t.SECRET_KEY_LENGTH=32,t.SHARED_KEY_LENGTH=32;function n(b){const I=new Float64Array(16);if(b)for(let O=0;O<b.length;O++)I[O]=b[O];return I}const i=new Uint8Array(32);i[0]=9;const s=n([56129,1]);function o(b){let I=1;for(let O=0;O<16;O++){let h=b[O]+I+65535;I=Math.floor(h/65536),b[O]=h-I*65536}b[0]+=I-1+37*(I-1)}function a(b,I,O){const h=~(O-1);for(let _=0;_<16;_++){const H=h&(b[_]^I[_]);b[_]^=H,I[_]^=H}}function c(b,I){const O=n(),h=n();for(let _=0;_<16;_++)h[_]=I[_];o(h),o(h),o(h);for(let _=0;_<2;_++){O[0]=h[0]-65517;for(let j=1;j<15;j++)O[j]=h[j]-65535-(O[j-1]>>16&1),O[j-1]&=65535;O[15]=h[15]-32767-(O[14]>>16&1);const H=O[15]>>16&1;O[14]&=65535,a(h,O,1-H)}for(let _=0;_<16;_++)b[2*_]=h[_]&255,b[2*_+1]=h[_]>>8}function l(b,I){for(let O=0;O<16;O++)b[O]=I[2*O]+(I[2*O+1]<<8);b[15]&=32767}function p(b,I,O){for(let h=0;h<16;h++)b[h]=I[h]+O[h]}function w(b,I,O){for(let h=0;h<16;h++)b[h]=I[h]-O[h]}function y(b,I,O){let h,_,H=0,j=0,q=0,X=0,re=0,C=0,$=0,G=0,K=0,W=0,z=0,J=0,Y=0,le=0,ee=0,fe=0,ae=0,Ce=0,B=0,F=0,R=0,f=0,P=0,te=0,ie=0,Ee=0,Le=0,$e=0,Me=0,Ye=0,Ke=0,Pe=O[0],De=O[1],ge=O[2],Se=O[3],Oe=O[4],pe=O[5],xe=O[6],g=O[7],u=O[8],d=O[9],v=O[10],T=O[11],U=O[12],k=O[13],oe=O[14],he=O[15];h=I[0],H+=h*Pe,j+=h*De,q+=h*ge,X+=h*Se,re+=h*Oe,C+=h*pe,$+=h*xe,G+=h*g,K+=h*u,W+=h*d,z+=h*v,J+=h*T,Y+=h*U,le+=h*k,ee+=h*oe,fe+=h*he,h=I[1],j+=h*Pe,q+=h*De,X+=h*ge,re+=h*Se,C+=h*Oe,$+=h*pe,G+=h*xe,K+=h*g,W+=h*u,z+=h*d,J+=h*v,Y+=h*T,le+=h*U,ee+=h*k,fe+=h*oe,ae+=h*he,h=I[2],q+=h*Pe,X+=h*De,re+=h*ge,C+=h*Se,$+=h*Oe,G+=h*pe,K+=h*xe,W+=h*g,z+=h*u,J+=h*d,Y+=h*v,le+=h*T,ee+=h*U,fe+=h*k,ae+=h*oe,Ce+=h*he,h=I[3],X+=h*Pe,re+=h*De,C+=h*ge,$+=h*Se,G+=h*Oe,K+=h*pe,W+=h*xe,z+=h*g,J+=h*u,Y+=h*d,le+=h*v,ee+=h*T,fe+=h*U,ae+=h*k,Ce+=h*oe,B+=h*he,h=I[4],re+=h*Pe,C+=h*De,$+=h*ge,G+=h*Se,K+=h*Oe,W+=h*pe,z+=h*xe,J+=h*g,Y+=h*u,le+=h*d,ee+=h*v,fe+=h*T,ae+=h*U,Ce+=h*k,B+=h*oe,F+=h*he,h=I[5],C+=h*Pe,$+=h*De,G+=h*ge,K+=h*Se,W+=h*Oe,z+=h*pe,J+=h*xe,Y+=h*g,le+=h*u,ee+=h*d,fe+=h*v,ae+=h*T,Ce+=h*U,B+=h*k,F+=h*oe,R+=h*he,h=I[6],$+=h*Pe,G+=h*De,K+=h*ge,W+=h*Se,z+=h*Oe,J+=h*pe,Y+=h*xe,le+=h*g,ee+=h*u,fe+=h*d,ae+=h*v,Ce+=h*T,B+=h*U,F+=h*k,R+=h*oe,f+=h*he,h=I[7],G+=h*Pe,K+=h*De,W+=h*ge,z+=h*Se,J+=h*Oe,Y+=h*pe,le+=h*xe,ee+=h*g,fe+=h*u,ae+=h*d,Ce+=h*v,B+=h*T,F+=h*U,R+=h*k,f+=h*oe,P+=h*he,h=I[8],K+=h*Pe,W+=h*De,z+=h*ge,J+=h*Se,Y+=h*Oe,le+=h*pe,ee+=h*xe,fe+=h*g,ae+=h*u,Ce+=h*d,B+=h*v,F+=h*T,R+=h*U,f+=h*k,P+=h*oe,te+=h*he,h=I[9],W+=h*Pe,z+=h*De,J+=h*ge,Y+=h*Se,le+=h*Oe,ee+=h*pe,fe+=h*xe,ae+=h*g,Ce+=h*u,B+=h*d,F+=h*v,R+=h*T,f+=h*U,P+=h*k,te+=h*oe,ie+=h*he,h=I[10],z+=h*Pe,J+=h*De,Y+=h*ge,le+=h*Se,ee+=h*Oe,fe+=h*pe,ae+=h*xe,Ce+=h*g,B+=h*u,F+=h*d,R+=h*v,f+=h*T,P+=h*U,te+=h*k,ie+=h*oe,Ee+=h*he,h=I[11],J+=h*Pe,Y+=h*De,le+=h*ge,ee+=h*Se,fe+=h*Oe,ae+=h*pe,Ce+=h*xe,B+=h*g,F+=h*u,R+=h*d,f+=h*v,P+=h*T,te+=h*U,ie+=h*k,Ee+=h*oe,Le+=h*he,h=I[12],Y+=h*Pe,le+=h*De,ee+=h*ge,fe+=h*Se,ae+=h*Oe,Ce+=h*pe,B+=h*xe,F+=h*g,R+=h*u,f+=h*d,P+=h*v,te+=h*T,ie+=h*U,Ee+=h*k,Le+=h*oe,$e+=h*he,h=I[13],le+=h*Pe,ee+=h*De,fe+=h*ge,ae+=h*Se,Ce+=h*Oe,B+=h*pe,F+=h*xe,R+=h*g,f+=h*u,P+=h*d,te+=h*v,ie+=h*T,Ee+=h*U,Le+=h*k,$e+=h*oe,Me+=h*he,h=I[14],ee+=h*Pe,fe+=h*De,ae+=h*ge,Ce+=h*Se,B+=h*Oe,F+=h*pe,R+=h*xe,f+=h*g,P+=h*u,te+=h*d,ie+=h*v,Ee+=h*T,Le+=h*U,$e+=h*k,Me+=h*oe,Ye+=h*he,h=I[15],fe+=h*Pe,ae+=h*De,Ce+=h*ge,B+=h*Se,F+=h*Oe,R+=h*pe,f+=h*xe,P+=h*g,te+=h*u,ie+=h*d,Ee+=h*v,Le+=h*T,$e+=h*U,Me+=h*k,Ye+=h*oe,Ke+=h*he,H+=38*ae,j+=38*Ce,q+=38*B,X+=38*F,re+=38*R,C+=38*f,$+=38*P,G+=38*te,K+=38*ie,W+=38*Ee,z+=38*Le,J+=38*$e,Y+=38*Me,le+=38*Ye,ee+=38*Ke,_=1,h=H+_+65535,_=Math.floor(h/65536),H=h-_*65536,h=j+_+65535,_=Math.floor(h/65536),j=h-_*65536,h=q+_+65535,_=Math.floor(h/65536),q=h-_*65536,h=X+_+65535,_=Math.floor(h/65536),X=h-_*65536,h=re+_+65535,_=Math.floor(h/65536),re=h-_*65536,h=C+_+65535,_=Math.floor(h/65536),C=h-_*65536,h=$+_+65535,_=Math.floor(h/65536),$=h-_*65536,h=G+_+65535,_=Math.floor(h/65536),G=h-_*65536,h=K+_+65535,_=Math.floor(h/65536),K=h-_*65536,h=W+_+65535,_=Math.floor(h/65536),W=h-_*65536,h=z+_+65535,_=Math.floor(h/65536),z=h-_*65536,h=J+_+65535,_=Math.floor(h/65536),J=h-_*65536,h=Y+_+65535,_=Math.floor(h/65536),Y=h-_*65536,h=le+_+65535,_=Math.floor(h/65536),le=h-_*65536,h=ee+_+65535,_=Math.floor(h/65536),ee=h-_*65536,h=fe+_+65535,_=Math.floor(h/65536),fe=h-_*65536,H+=_-1+37*(_-1),_=1,h=H+_+65535,_=Math.floor(h/65536),H=h-_*65536,h=j+_+65535,_=Math.floor(h/65536),j=h-_*65536,h=q+_+65535,_=Math.floor(h/65536),q=h-_*65536,h=X+_+65535,_=Math.floor(h/65536),X=h-_*65536,h=re+_+65535,_=Math.floor(h/65536),re=h-_*65536,h=C+_+65535,_=Math.floor(h/65536),C=h-_*65536,h=$+_+65535,_=Math.floor(h/65536),$=h-_*65536,h=G+_+65535,_=Math.floor(h/65536),G=h-_*65536,h=K+_+65535,_=Math.floor(h/65536),K=h-_*65536,h=W+_+65535,_=Math.floor(h/65536),W=h-_*65536,h=z+_+65535,_=Math.floor(h/65536),z=h-_*65536,h=J+_+65535,_=Math.floor(h/65536),J=h-_*65536,h=Y+_+65535,_=Math.floor(h/65536),Y=h-_*65536,h=le+_+65535,_=Math.floor(h/65536),le=h-_*65536,h=ee+_+65535,_=Math.floor(h/65536),ee=h-_*65536,h=fe+_+65535,_=Math.floor(h/65536),fe=h-_*65536,H+=_-1+37*(_-1),b[0]=H,b[1]=j,b[2]=q,b[3]=X,b[4]=re,b[5]=C,b[6]=$,b[7]=G,b[8]=K,b[9]=W,b[10]=z,b[11]=J,b[12]=Y,b[13]=le,b[14]=ee,b[15]=fe}function m(b,I){y(b,I,I)}function E(b,I){const O=n();for(let h=0;h<16;h++)O[h]=I[h];for(let h=253;h>=0;h--)m(O,O),h!==2&&h!==4&&y(O,O,I);for(let h=0;h<16;h++)b[h]=O[h]}function A(b,I){const O=new Uint8Array(32),h=new Float64Array(80),_=n(),H=n(),j=n(),q=n(),X=n(),re=n();for(let K=0;K<31;K++)O[K]=b[K];O[31]=b[31]&127|64,O[0]&=248,l(h,I);for(let K=0;K<16;K++)H[K]=h[K];_[0]=q[0]=1;for(let K=254;K>=0;--K){const W=O[K>>>3]>>>(K&7)&1;a(_,H,W),a(j,q,W),p(X,_,j),w(_,_,j),p(j,H,q),w(H,H,q),m(q,X),m(re,_),y(_,j,_),y(j,H,X),p(X,_,j),w(_,_,j),m(H,_),w(j,q,re),y(_,j,s),p(_,_,q),y(j,j,_),y(_,q,re),y(q,H,h),m(H,X),a(_,H,W),a(j,q,W)}for(let K=0;K<16;K++)h[K+16]=_[K],h[K+32]=j[K],h[K+48]=H[K],h[K+64]=q[K];const C=h.subarray(32),$=h.subarray(16);E(C,C),y($,$,C);const G=new Uint8Array(32);return c(G,$),G}t.scalarMult=A;function N(b){return A(b,i)}t.scalarMultBase=N;function M(b){if(b.length!==t.SECRET_KEY_LENGTH)throw new Error(`x25519: seed must be ${t.SECRET_KEY_LENGTH} bytes`);const I=new Uint8Array(b);return{publicKey:N(I),secretKey:I}}t.generateKeyPairFromSeed=M;function x(b){const I=(0,e.randomBytes)(32,b),O=M(I);return(0,r.wipe)(I),O}t.generateKeyPair=x;function D(b,I,O=!1){if(b.length!==t.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect secret key length");if(I.length!==t.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect public key length");const h=A(b,I);if(O){let _=0;for(let H=0;H<h.length;H++)_|=h[H];if(_===0)throw new Error("X25519: invalid shared key")}return h}t.sharedKey=D})(lo);function nl(t=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?globalThis.Buffer.allocUnsafe(t):new Uint8Array(t)}function uo(t,e){e||(e=t.reduce((i,s)=>i+s.length,0));const r=nl(e);let n=0;for(const i of t)r.set(i,n),n+=i.length;return r}function $f(t,e){if(t.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),n=0;n<r.length;n++)r[n]=255;for(var i=0;i<t.length;i++){var s=t.charAt(i),o=s.charCodeAt(0);if(r[o]!==255)throw new TypeError(s+" is ambiguous");r[o]=i}var a=t.length,c=t.charAt(0),l=Math.log(a)/Math.log(256),p=Math.log(256)/Math.log(a);function w(E){if(E instanceof Uint8Array||(ArrayBuffer.isView(E)?E=new Uint8Array(E.buffer,E.byteOffset,E.byteLength):Array.isArray(E)&&(E=Uint8Array.from(E))),!(E instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(E.length===0)return"";for(var A=0,N=0,M=0,x=E.length;M!==x&&E[M]===0;)M++,A++;for(var D=(x-M)*p+1>>>0,b=new Uint8Array(D);M!==x;){for(var I=E[M],O=0,h=D-1;(I!==0||O<N)&&h!==-1;h--,O++)I+=256*b[h]>>>0,b[h]=I%a>>>0,I=I/a>>>0;if(I!==0)throw new Error("Non-zero carry");N=O,M++}for(var _=D-N;_!==D&&b[_]===0;)_++;for(var H=c.repeat(A);_<D;++_)H+=t.charAt(b[_]);return H}function y(E){if(typeof E!="string")throw new TypeError("Expected String");if(E.length===0)return new Uint8Array;var A=0;if(E[A]!==" "){for(var N=0,M=0;E[A]===c;)N++,A++;for(var x=(E.length-A)*l+1>>>0,D=new Uint8Array(x);E[A];){var b=r[E.charCodeAt(A)];if(b===255)return;for(var I=0,O=x-1;(b!==0||I<M)&&O!==-1;O--,I++)b+=a*D[O]>>>0,D[O]=b%256>>>0,b=b/256>>>0;if(b!==0)throw new Error("Non-zero carry");M=I,A++}if(E[A]!==" "){for(var h=x-M;h!==x&&D[h]===0;)h++;for(var _=new Uint8Array(N+(x-h)),H=N;h!==x;)_[H++]=D[h++];return _}}}function m(E){var A=y(E);if(A)return A;throw new Error(`Non-${e} character`)}return{encode:w,decodeUnsafe:y,decode:m}}var Pf=$f,Tf=Pf;const il=t=>{if(t instanceof Uint8Array&&t.constructor.name==="Uint8Array")return t;if(t instanceof ArrayBuffer)return new Uint8Array(t);if(ArrayBuffer.isView(t))return new Uint8Array(t.buffer,t.byteOffset,t.byteLength);throw new Error("Unknown type, must be binary type")},Nf=t=>new TextEncoder().encode(t),Rf=t=>new TextDecoder().decode(t);class Lf{constructor(e,r,n){this.name=e,this.prefix=r,this.baseEncode=n}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}}class Mf{constructor(e,r,n){if(this.name=e,this.prefix=r,r.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=r.codePointAt(0),this.baseDecode=n}decode(e){if(typeof e=="string"){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))}else throw Error("Can only multibase decode strings")}or(e){return sl(this,e)}}class Uf{constructor(e){this.decoders=e}or(e){return sl(this,e)}decode(e){const r=e[0],n=this.decoders[r];if(n)return n.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const sl=(t,e)=>new Uf({...t.decoders||{[t.prefix]:t},...e.decoders||{[e.prefix]:e}});class Ff{constructor(e,r,n,i){this.name=e,this.prefix=r,this.baseEncode=n,this.baseDecode=i,this.encoder=new Lf(e,r,n),this.decoder=new Mf(e,r,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}const Ji=({name:t,prefix:e,encode:r,decode:n})=>new Ff(t,e,r,n),Rn=({prefix:t,name:e,alphabet:r})=>{const{encode:n,decode:i}=Tf(r,e);return Ji({prefix:t,name:e,encode:n,decode:s=>il(i(s))})},Bf=(t,e,r,n)=>{const i={};for(let p=0;p<e.length;++p)i[e[p]]=p;let s=t.length;for(;t[s-1]==="=";)--s;const o=new Uint8Array(s*r/8|0);let a=0,c=0,l=0;for(let p=0;p<s;++p){const w=i[t[p]];if(w===void 0)throw new SyntaxError(`Non-${n} character`);c=c<<r|w,a+=r,a>=8&&(a-=8,o[l++]=255&c>>a)}if(a>=r||255&c<<8-a)throw new SyntaxError("Unexpected end of data");return o},jf=(t,e,r)=>{const n=e[e.length-1]==="=",i=(1<<r)-1;let s="",o=0,a=0;for(let c=0;c<t.length;++c)for(a=a<<8|t[c],o+=8;o>r;)o-=r,s+=e[i&a>>o];if(o&&(s+=e[i&a<<r-o]),n)for(;s.length*r&7;)s+="=";return s},Et=({name:t,prefix:e,bitsPerChar:r,alphabet:n})=>Ji({prefix:e,name:t,encode(i){return jf(i,n,r)},decode(i){return Bf(i,n,r,t)}}),kf=Ji({prefix:"\0",name:"identity",encode:t=>Rf(t),decode:t=>Nf(t)});var Hf=Object.freeze({__proto__:null,identity:kf});const zf=Et({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var Wf=Object.freeze({__proto__:null,base2:zf});const qf=Et({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var Vf=Object.freeze({__proto__:null,base8:qf});const Kf=Rn({prefix:"9",name:"base10",alphabet:"0123456789"});var Gf=Object.freeze({__proto__:null,base10:Kf});const Yf=Et({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),Zf=Et({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var Jf=Object.freeze({__proto__:null,base16:Yf,base16upper:Zf});const Xf=Et({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),Qf=Et({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),e1=Et({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),t1=Et({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),r1=Et({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),n1=Et({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),i1=Et({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),s1=Et({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),o1=Et({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var a1=Object.freeze({__proto__:null,base32:Xf,base32upper:Qf,base32pad:e1,base32padupper:t1,base32hex:r1,base32hexupper:n1,base32hexpad:i1,base32hexpadupper:s1,base32z:o1});const c1=Rn({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),l1=Rn({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var u1=Object.freeze({__proto__:null,base36:c1,base36upper:l1});const h1=Rn({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),d1=Rn({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var f1=Object.freeze({__proto__:null,base58btc:h1,base58flickr:d1});const p1=Et({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),g1=Et({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),m1=Et({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),w1=Et({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var y1=Object.freeze({__proto__:null,base64:p1,base64pad:g1,base64url:m1,base64urlpad:w1});const ol=Array.from("\u{1F680}\u{1FA90}\u2604\u{1F6F0}\u{1F30C}\u{1F311}\u{1F312}\u{1F313}\u{1F314}\u{1F315}\u{1F316}\u{1F317}\u{1F318}\u{1F30D}\u{1F30F}\u{1F30E}\u{1F409}\u2600\u{1F4BB}\u{1F5A5}\u{1F4BE}\u{1F4BF}\u{1F602}\u2764\u{1F60D}\u{1F923}\u{1F60A}\u{1F64F}\u{1F495}\u{1F62D}\u{1F618}\u{1F44D}\u{1F605}\u{1F44F}\u{1F601}\u{1F525}\u{1F970}\u{1F494}\u{1F496}\u{1F499}\u{1F622}\u{1F914}\u{1F606}\u{1F644}\u{1F4AA}\u{1F609}\u263A\u{1F44C}\u{1F917}\u{1F49C}\u{1F614}\u{1F60E}\u{1F607}\u{1F339}\u{1F926}\u{1F389}\u{1F49E}\u270C\u2728\u{1F937}\u{1F631}\u{1F60C}\u{1F338}\u{1F64C}\u{1F60B}\u{1F497}\u{1F49A}\u{1F60F}\u{1F49B}\u{1F642}\u{1F493}\u{1F929}\u{1F604}\u{1F600}\u{1F5A4}\u{1F603}\u{1F4AF}\u{1F648}\u{1F447}\u{1F3B6}\u{1F612}\u{1F92D}\u2763\u{1F61C}\u{1F48B}\u{1F440}\u{1F62A}\u{1F611}\u{1F4A5}\u{1F64B}\u{1F61E}\u{1F629}\u{1F621}\u{1F92A}\u{1F44A}\u{1F973}\u{1F625}\u{1F924}\u{1F449}\u{1F483}\u{1F633}\u270B\u{1F61A}\u{1F61D}\u{1F634}\u{1F31F}\u{1F62C}\u{1F643}\u{1F340}\u{1F337}\u{1F63B}\u{1F613}\u2B50\u2705\u{1F97A}\u{1F308}\u{1F608}\u{1F918}\u{1F4A6}\u2714\u{1F623}\u{1F3C3}\u{1F490}\u2639\u{1F38A}\u{1F498}\u{1F620}\u261D\u{1F615}\u{1F33A}\u{1F382}\u{1F33B}\u{1F610}\u{1F595}\u{1F49D}\u{1F64A}\u{1F639}\u{1F5E3}\u{1F4AB}\u{1F480}\u{1F451}\u{1F3B5}\u{1F91E}\u{1F61B}\u{1F534}\u{1F624}\u{1F33C}\u{1F62B}\u26BD\u{1F919}\u2615\u{1F3C6}\u{1F92B}\u{1F448}\u{1F62E}\u{1F646}\u{1F37B}\u{1F343}\u{1F436}\u{1F481}\u{1F632}\u{1F33F}\u{1F9E1}\u{1F381}\u26A1\u{1F31E}\u{1F388}\u274C\u270A\u{1F44B}\u{1F630}\u{1F928}\u{1F636}\u{1F91D}\u{1F6B6}\u{1F4B0}\u{1F353}\u{1F4A2}\u{1F91F}\u{1F641}\u{1F6A8}\u{1F4A8}\u{1F92C}\u2708\u{1F380}\u{1F37A}\u{1F913}\u{1F619}\u{1F49F}\u{1F331}\u{1F616}\u{1F476}\u{1F974}\u25B6\u27A1\u2753\u{1F48E}\u{1F4B8}\u2B07\u{1F628}\u{1F31A}\u{1F98B}\u{1F637}\u{1F57A}\u26A0\u{1F645}\u{1F61F}\u{1F635}\u{1F44E}\u{1F932}\u{1F920}\u{1F927}\u{1F4CC}\u{1F535}\u{1F485}\u{1F9D0}\u{1F43E}\u{1F352}\u{1F617}\u{1F911}\u{1F30A}\u{1F92F}\u{1F437}\u260E\u{1F4A7}\u{1F62F}\u{1F486}\u{1F446}\u{1F3A4}\u{1F647}\u{1F351}\u2744\u{1F334}\u{1F4A3}\u{1F438}\u{1F48C}\u{1F4CD}\u{1F940}\u{1F922}\u{1F445}\u{1F4A1}\u{1F4A9}\u{1F450}\u{1F4F8}\u{1F47B}\u{1F910}\u{1F92E}\u{1F3BC}\u{1F975}\u{1F6A9}\u{1F34E}\u{1F34A}\u{1F47C}\u{1F48D}\u{1F4E3}\u{1F942}"),b1=ol.reduce((t,e,r)=>(t[r]=e,t),[]),v1=ol.reduce((t,e,r)=>(t[e.codePointAt(0)]=r,t),[]);function _1(t){return t.reduce((e,r)=>(e+=b1[r],e),"")}function E1(t){const e=[];for(const r of t){const n=v1[r.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${r}`);e.push(n)}return new Uint8Array(e)}const x1=Ji({prefix:"\u{1F680}",name:"base256emoji",encode:_1,decode:E1});var C1=Object.freeze({__proto__:null,base256emoji:x1}),S1=cl,al=128,I1=127,D1=~I1,O1=Math.pow(2,31);function cl(t,e,r){e=e||[],r=r||0;for(var n=r;t>=O1;)e[r++]=t&255|al,t/=128;for(;t&D1;)e[r++]=t&255|al,t>>>=7;return e[r]=t|0,cl.bytes=r-n+1,e}var A1=ho,$1=128,ll=127;function ho(t,n){var r=0,n=n||0,i=0,s=n,o,a=t.length;do{if(s>=a)throw ho.bytes=0,new RangeError("Could not decode varint");o=t[s++],r+=i<28?(o&ll)<<i:(o&ll)*Math.pow(2,i),i+=7}while(o>=$1);return ho.bytes=s-n,r}var P1=Math.pow(2,7),T1=Math.pow(2,14),N1=Math.pow(2,21),R1=Math.pow(2,28),L1=Math.pow(2,35),M1=Math.pow(2,42),U1=Math.pow(2,49),F1=Math.pow(2,56),B1=Math.pow(2,63),j1=function(t){return t<P1?1:t<T1?2:t<N1?3:t<R1?4:t<L1?5:t<M1?6:t<U1?7:t<F1?8:t<B1?9:10},k1={encode:S1,decode:A1,encodingLength:j1},ul=k1;const hl=(t,e,r=0)=>(ul.encode(t,e,r),e),dl=t=>ul.encodingLength(t),fo=(t,e)=>{const r=e.byteLength,n=dl(t),i=n+dl(r),s=new Uint8Array(i+r);return hl(t,s,0),hl(r,s,n),s.set(e,i),new H1(t,r,e,s)};class H1{constructor(e,r,n,i){this.code=e,this.size=r,this.digest=n,this.bytes=i}}const fl=({name:t,code:e,encode:r})=>new z1(t,e,r);class z1{constructor(e,r,n){this.name=e,this.code=r,this.encode=n}digest(e){if(e instanceof Uint8Array){const r=this.encode(e);return r instanceof Uint8Array?fo(this.code,r):r.then(n=>fo(this.code,n))}else throw Error("Unknown type, must be binary type")}}const pl=t=>async e=>new Uint8Array(await crypto.subtle.digest(t,e)),W1=fl({name:"sha2-256",code:18,encode:pl("SHA-256")}),q1=fl({name:"sha2-512",code:19,encode:pl("SHA-512")});var V1=Object.freeze({__proto__:null,sha256:W1,sha512:q1});const gl=0,K1="identity",ml=il;var G1=Object.freeze({__proto__:null,identity:{code:gl,name:K1,encode:ml,digest:t=>fo(gl,ml(t))}});new TextEncoder,new TextDecoder;const wl={...Hf,...Wf,...Vf,...Gf,...Jf,...a1,...u1,...f1,...y1,...C1};({...V1,...G1});function yl(t,e,r,n){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:r},decoder:{decode:n}}}const bl=yl("utf8","u",t=>"u"+new TextDecoder("utf8").decode(t),t=>new TextEncoder().encode(t.substring(1))),po=yl("ascii","a",t=>{let e="a";for(let r=0;r<t.length;r++)e+=String.fromCharCode(t[r]);return e},t=>{t=t.substring(1);const e=nl(t.length);for(let r=0;r<t.length;r++)e[r]=t.charCodeAt(r);return e}),vl={utf8:bl,"utf-8":bl,hex:wl.base16,latin1:po,ascii:po,binary:po,...wl};function Pt(t,e="utf8"){const r=vl[e];if(!r)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(t,"utf8"):r.decoder.decode(`${r.prefix}${t}`)}function Tt(t,e="utf8"){const r=vl[e];if(!r)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(t.buffer,t.byteOffset,t.byteLength).toString("utf8"):r.encoder.encode(t).substring(1)}var _l=function(t,e,r){if(r||arguments.length===2)for(var n=0,i=e.length,s;n<i;n++)(s||!(n in e))&&(s||(s=Array.prototype.slice.call(e,0,n)),s[n]=e[n]);return t.concat(s||Array.prototype.slice.call(e))},Y1=function(){function t(e,r,n){this.name=e,this.version=r,this.os=n,this.type="browser"}return t}(),Z1=function(){function t(e){this.version=e,this.type="node",this.name="node",this.os=process.platform}return t}(),J1=function(){function t(e,r,n,i){this.name=e,this.version=r,this.os=n,this.bot=i,this.type="bot-device"}return t}(),X1=function(){function t(){this.type="bot",this.bot=!0,this.name="bot",this.version=null,this.os=null}return t}(),Q1=function(){function t(){this.type="react-native",this.name="react-native",this.version=null,this.os=null}return t}(),ep=/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/,tp=/(nuhk|curl|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/,El=3,rp=[["aol",/AOLShield\/([0-9\._]+)/],["edge",/Edge\/([0-9\._]+)/],["edge-ios",/EdgiOS\/([0-9\._]+)/],["yandexbrowser",/YaBrowser\/([0-9\._]+)/],["kakaotalk",/KAKAOTALK\s([0-9\.]+)/],["samsung",/SamsungBrowser\/([0-9\.]+)/],["silk",/\bSilk\/([0-9._-]+)\b/],["miui",/MiuiBrowser\/([0-9\.]+)$/],["beaker",/BeakerBrowser\/([0-9\.]+)/],["edge-chromium",/EdgA?\/([0-9\.]+)/],["chromium-webview",/(?!Chrom.*OPR)wv\).*Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["chrome",/(?!Chrom.*OPR)Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["phantomjs",/PhantomJS\/([0-9\.]+)(:?\s|$)/],["crios",/CriOS\/([0-9\.]+)(:?\s|$)/],["firefox",/Firefox\/([0-9\.]+)(?:\s|$)/],["fxios",/FxiOS\/([0-9\.]+)/],["opera-mini",/Opera Mini.*Version\/([0-9\.]+)/],["opera",/Opera\/([0-9\.]+)(?:\s|$)/],["opera",/OPR\/([0-9\.]+)(:?\s|$)/],["pie",/^Microsoft Pocket Internet Explorer\/(\d+\.\d+)$/],["pie",/^Mozilla\/\d\.\d+\s\(compatible;\s(?:MSP?IE|MSInternet Explorer) (\d+\.\d+);.*Windows CE.*\)$/],["netfront",/^Mozilla\/\d\.\d+.*NetFront\/(\d.\d)/],["ie",/Trident\/7\.0.*rv\:([0-9\.]+).*\).*Gecko$/],["ie",/MSIE\s([0-9\.]+);.*Trident\/[4-7].0/],["ie",/MSIE\s(7\.0)/],["bb10",/BB10;\sTouch.*Version\/([0-9\.]+)/],["android",/Android\s([0-9\.]+)/],["ios",/Version\/([0-9\._]+).*Mobile.*Safari.*/],["safari",/Version\/([0-9\._]+).*Safari/],["facebook",/FB[AS]V\/([0-9\.]+)/],["instagram",/Instagram\s([0-9\.]+)/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Mobile/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Gecko\)$/],["curl",/^curl\/([0-9\.]+)$/],["searchbot",ep]],xl=[["iOS",/iP(hone|od|ad)/],["Android OS",/Android/],["BlackBerry OS",/BlackBerry|BB10/],["Windows Mobile",/IEMobile/],["Amazon OS",/Kindle/],["Windows 3.11",/Win16/],["Windows 95",/(Windows 95)|(Win95)|(Windows_95)/],["Windows 98",/(Windows 98)|(Win98)/],["Windows 2000",/(Windows NT 5.0)|(Windows 2000)/],["Windows XP",/(Windows NT 5.1)|(Windows XP)/],["Windows Server 2003",/(Windows NT 5.2)/],["Windows Vista",/(Windows NT 6.0)/],["Windows 7",/(Windows NT 6.1)/],["Windows 8",/(Windows NT 6.2)/],["Windows 8.1",/(Windows NT 6.3)/],["Windows 10",/(Windows NT 10.0)/],["Windows ME",/Windows ME/],["Windows CE",/Windows CE|WinCE|Microsoft Pocket Internet Explorer/],["Open BSD",/OpenBSD/],["Sun OS",/SunOS/],["Chrome OS",/CrOS/],["Linux",/(Linux)|(X11)/],["Mac OS",/(Mac_PowerPC)|(Macintosh)/],["QNX",/QNX/],["BeOS",/BeOS/],["OS/2",/OS\/2/]];function np(t){return t?Cl(t):typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"?new Q1:typeof navigator<"u"?Cl(navigator.userAgent):op()}function ip(t){return t!==""&&rp.reduce(function(e,r){var n=r[0],i=r[1];if(e)return e;var s=i.exec(t);return!!s&&[n,s]},!1)}function Cl(t){var e=ip(t);if(!e)return null;var r=e[0],n=e[1];if(r==="searchbot")return new X1;var i=n[1]&&n[1].split(".").join("_").split("_").slice(0,3);i?i.length<El&&(i=_l(_l([],i,!0),ap(El-i.length),!0)):i=[];var s=i.join("."),o=sp(t),a=tp.exec(t);return a&&a[1]?new J1(r,s,o,a[1]):new Y1(r,s,o)}function sp(t){for(var e=0,r=xl.length;e<r;e++){var n=xl[e],i=n[0],s=n[1],o=s.exec(t);if(o)return i}return null}function op(){var t=typeof process<"u"&&process.version;return t?new Z1(process.version.slice(1)):null}function ap(t){for(var e=[],r=0;r<t;r++)e.push("0");return e}var me={};/*! *****************************************************************************
2
2
  Copyright (c) Microsoft Corporation.
3
3
 
4
4
  Permission to use, copy, modify, and/or distribute this software for any
@@ -11,7 +11,7 @@
11
11
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
12
12
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
13
13
  PERFORMANCE OF THIS SOFTWARE.
14
- ***************************************************************************** */var la=function(t,e){return la=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)n.hasOwnProperty(i)&&(r[i]=n[i])},la(t,e)};function pg(t,e){la(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var ua=function(){return ua=Object.assign||function(e){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e},ua.apply(this,arguments)};function gg(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r}function mg(t,e,r,n){var i=arguments.length,o=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,r,o):s(e,r))||o);return i>3&&o&&Object.defineProperty(e,r,o),o}function bg(t,e){return function(r,n){e(r,n,t)}}function yg(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function wg(t,e,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(d){try{u(n.next(d))}catch(y){s(y)}}function l(d){try{u(n.throw(d))}catch(y){s(y)}}function u(d){d.done?o(d.value):i(d.value).then(a,l)}u((n=n.apply(t,e||[])).next())})}function vg(t,e){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,s;return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(u){return function(d){return l([u,d])}}function l(u){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(o=u[0]&2?i.return:u[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,u[1])).done)return o;switch(i=0,o&&(u=[u[0]&2,o.value]),u[0]){case 0:case 1:o=u;break;case 4:return r.label++,{value:u[1],done:!1};case 5:r.label++,i=u[1],u=[0];continue;case 7:u=r.ops.pop(),r.trys.pop();continue;default:if(o=r.trys,!(o=o.length>0&&o[o.length-1])&&(u[0]===6||u[0]===2)){r=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[1]<o[3])){r.label=u[1];break}if(u[0]===6&&r.label<o[1]){r.label=o[1],o=u;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(u);break}o[2]&&r.ops.pop(),r.trys.pop();continue}u=e.call(t,r)}catch(d){u=[6,d],i=0}finally{n=o=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}function _g(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}function Eg(t,e){for(var r in t)r!=="default"&&!e.hasOwnProperty(r)&&(e[r]=t[r])}function ha(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function _h(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,o=[],s;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(a){s={error:a}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(s)throw s.error}}return o}function xg(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(_h(arguments[e]));return t}function Cg(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;for(var n=Array(t),i=0,e=0;e<r;e++)for(var o=arguments[e],s=0,a=o.length;s<a;s++,i++)n[i]=o[s];return n}function ii(t){return this instanceof ii?(this.v=t,this):new ii(t)}function Sg(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(t,e||[]),i,o=[];return i={},s("next"),s("throw"),s("return"),i[Symbol.asyncIterator]=function(){return this},i;function s(m){n[m]&&(i[m]=function(v){return new Promise(function(_,R){o.push([m,v,_,R])>1||a(m,v)})})}function a(m,v){try{l(n[m](v))}catch(_){y(o[0][3],_)}}function l(m){m.value instanceof ii?Promise.resolve(m.value.v).then(u,d):y(o[0][2],m)}function u(m){a("next",m)}function d(m){a("throw",m)}function y(m,v){m(v),o.shift(),o.length&&a(o[0][0],o[0][1])}}function Ag(t){var e,r;return e={},n("next"),n("throw",function(i){throw i}),n("return"),e[Symbol.iterator]=function(){return this},e;function n(i,o){e[i]=t[i]?function(s){return(r=!r)?{value:ii(t[i](s)),done:i==="return"}:o?o(s):s}:o}}function Ig(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof ha=="function"?ha(t):t[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(o){r[o]=t[o]&&function(s){return new Promise(function(a,l){s=t[o](s),i(a,l,s.done,s.value)})}}function i(o,s,a,l){Promise.resolve(l).then(function(u){o({value:u,done:a})},s)}}function Og(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function Dg(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}function $g(t){return t&&t.__esModule?t:{default:t}}function Fg(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}function Pg(t,e,r){if(!e.has(t))throw new TypeError("attempted to set private field on non-instance");return e.set(t,r),r}var Tg=Object.freeze({__proto__:null,__extends:pg,get __assign(){return ua},__rest:gg,__decorate:mg,__param:bg,__metadata:yg,__awaiter:wg,__generator:vg,__createBinding:_g,__exportStar:Eg,__values:ha,__read:_h,__spread:xg,__spreadArrays:Cg,__await:ii,__asyncGenerator:Sg,__asyncDelegator:Ag,__asyncValues:Ig,__makeTemplateObject:Og,__importStar:Dg,__importDefault:$g,__classPrivateFieldGet:Fg,__classPrivateFieldSet:Pg}),Ho=Yr(Tg),fa={},oi={},Eh;function Ng(){if(Eh)return oi;Eh=1,Object.defineProperty(oi,"__esModule",{value:!0}),oi.delay=void 0;function t(e){return new Promise(r=>{setTimeout(()=>{r(!0)},e)})}return oi.delay=t,oi}var Zr={},da={},Jr={},xh;function Rg(){return xh||(xh=1,Object.defineProperty(Jr,"__esModule",{value:!0}),Jr.ONE_THOUSAND=Jr.ONE_HUNDRED=void 0,Jr.ONE_HUNDRED=100,Jr.ONE_THOUSAND=1e3),Jr}var pa={},Ch;function Lg(){return Ch||(Ch=1,function(t){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=t.ONE_MINUTE*5,t.TEN_MINUTES=t.ONE_MINUTE*10,t.THIRTY_MINUTES=t.ONE_MINUTE*30,t.SIXTY_MINUTES=t.ONE_MINUTE*60,t.ONE_HOUR=t.SIXTY_MINUTES,t.THREE_HOURS=t.ONE_HOUR*3,t.SIX_HOURS=t.ONE_HOUR*6,t.TWELVE_HOURS=t.ONE_HOUR*12,t.TWENTY_FOUR_HOURS=t.ONE_HOUR*24,t.ONE_DAY=t.TWENTY_FOUR_HOURS,t.THREE_DAYS=t.ONE_DAY*3,t.FIVE_DAYS=t.ONE_DAY*5,t.SEVEN_DAYS=t.ONE_DAY*7,t.THIRTY_DAYS=t.ONE_DAY*30,t.ONE_WEEK=t.SEVEN_DAYS,t.TWO_WEEKS=t.ONE_WEEK*2,t.THREE_WEEKS=t.ONE_WEEK*3,t.FOUR_WEEKS=t.ONE_WEEK*4,t.ONE_YEAR=t.ONE_DAY*365}(pa)),pa}var Sh;function Ah(){return Sh||(Sh=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=Ho;e.__exportStar(Rg(),t),e.__exportStar(Lg(),t)}(da)),da}var Ih;function Mg(){if(Ih)return Zr;Ih=1,Object.defineProperty(Zr,"__esModule",{value:!0}),Zr.fromMiliseconds=Zr.toMiliseconds=void 0;const t=Ah();function e(n){return n*t.ONE_THOUSAND}Zr.toMiliseconds=e;function r(n){return Math.floor(n/t.ONE_THOUSAND)}return Zr.fromMiliseconds=r,Zr}var Oh;function Ug(){return Oh||(Oh=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=Ho;e.__exportStar(Ng(),t),e.__exportStar(Mg(),t)}(fa)),fa}var On={},Dh;function Bg(){if(Dh)return On;Dh=1,Object.defineProperty(On,"__esModule",{value:!0}),On.Watch=void 0;class t{constructor(){this.timestamps=new Map}start(r){if(this.timestamps.has(r))throw new Error(`Watch already started for label: ${r}`);this.timestamps.set(r,{started:Date.now()})}stop(r){const n=this.get(r);if(typeof n.elapsed<"u")throw new Error(`Watch already stopped for label: ${r}`);const i=Date.now()-n.started;this.timestamps.set(r,{started:n.started,elapsed:i})}get(r){const n=this.timestamps.get(r);if(typeof n>"u")throw new Error(`No timestamp found for label: ${r}`);return n}elapsed(r){const n=this.get(r);return n.elapsed||Date.now()-n.started}}return On.Watch=t,On.default=t,On}var ga={},si={},$h;function jg(){if($h)return si;$h=1,Object.defineProperty(si,"__esModule",{value:!0}),si.IWatch=void 0;class t{}return si.IWatch=t,si}var Fh;function kg(){return Fh||(Fh=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),Ho.__exportStar(jg(),t)}(ga)),ga}(function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=Ho;e.__exportStar(Ug(),t),e.__exportStar(Bg(),t),e.__exportStar(kg(),t),e.__exportStar(Ah(),t)})(Fe);var mt={};Object.defineProperty(mt,"__esModule",{value:!0}),mt.getLocalStorage=mt.getLocalStorageOrThrow=mt.getCrypto=mt.getCryptoOrThrow=Th=mt.getLocation=mt.getLocationOrThrow=ma=mt.getNavigator=mt.getNavigatorOrThrow=Ph=mt.getDocument=mt.getDocumentOrThrow=mt.getFromWindowOrThrow=mt.getFromWindow=void 0;function Xr(t){let e;return typeof window<"u"&&typeof window[t]<"u"&&(e=window[t]),e}mt.getFromWindow=Xr;function Dn(t){const e=Xr(t);if(!e)throw new Error(`${t} is not defined in Window`);return e}mt.getFromWindowOrThrow=Dn;function Hg(){return Dn("document")}mt.getDocumentOrThrow=Hg;function zg(){return Xr("document")}var Ph=mt.getDocument=zg;function Wg(){return Dn("navigator")}mt.getNavigatorOrThrow=Wg;function Vg(){return Xr("navigator")}var ma=mt.getNavigator=Vg;function qg(){return Dn("location")}mt.getLocationOrThrow=qg;function Kg(){return Xr("location")}var Th=mt.getLocation=Kg;function Gg(){return Dn("crypto")}mt.getCryptoOrThrow=Gg;function Yg(){return Xr("crypto")}mt.getCrypto=Yg;function Zg(){return Dn("localStorage")}mt.getLocalStorageOrThrow=Zg;function Jg(){return Xr("localStorage")}mt.getLocalStorage=Jg;var ba={};Object.defineProperty(ba,"__esModule",{value:!0});var Nh=ba.getWindowMetadata=void 0;const Rh=mt;function Xg(){let t,e;try{t=Rh.getDocumentOrThrow(),e=Rh.getLocationOrThrow()}catch{return null}function r(){const y=t.getElementsByTagName("link"),m=[];for(let v=0;v<y.length;v++){const _=y[v],R=_.getAttribute("rel");if(R&&R.toLowerCase().indexOf("icon")>-1){const M=_.getAttribute("href");if(M)if(M.toLowerCase().indexOf("https:")===-1&&M.toLowerCase().indexOf("http:")===-1&&M.indexOf("//")!==0){let B=e.protocol+"//"+e.host;if(M.indexOf("/")===0)B+=M;else{const D=e.pathname.split("/");D.pop();const N=D.join("/");B+=N+"/"+M}m.push(B)}else if(M.indexOf("//")===0){const B=e.protocol+M;m.push(B)}else m.push(M)}}return m}function n(...y){const m=t.getElementsByTagName("meta");for(let v=0;v<m.length;v++){const _=m[v],R=["itemprop","property","name"].map(M=>_.getAttribute(M)).filter(M=>M?y.includes(M):!1);if(R.length&&R){const M=_.getAttribute("content");if(M)return M}}return""}function i(){let y=n("name","og:site_name","og:title","twitter:title");return y||(y=t.title),y}function o(){return n("description","og:description","twitter:description","keywords")}const s=i(),a=o(),l=e.origin,u=r();return{description:a,url:l,icons:u,name:s}}Nh=ba.getWindowMetadata=Xg;var ai={},Qg=t=>encodeURIComponent(t).replace(/[!'()*]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`),Lh="%[a-f0-9]{2}",Mh=new RegExp("("+Lh+")|([^%]+?)","gi"),Uh=new RegExp("("+Lh+")+","gi");function ya(t,e){try{return[decodeURIComponent(t.join(""))]}catch{}if(t.length===1)return t;e=e||1;var r=t.slice(0,e),n=t.slice(e);return Array.prototype.concat.call([],ya(r),ya(n))}function e5(t){try{return decodeURIComponent(t)}catch{for(var e=t.match(Mh)||[],r=1;r<e.length;r++)t=ya(e,r).join(""),e=t.match(Mh)||[];return t}}function t5(t){for(var e={"%FE%FF":"\uFFFD\uFFFD","%FF%FE":"\uFFFD\uFFFD"},r=Uh.exec(t);r;){try{e[r[0]]=decodeURIComponent(r[0])}catch{var n=e5(r[0]);n!==r[0]&&(e[r[0]]=n)}r=Uh.exec(t)}e["%C2"]="\uFFFD";for(var i=Object.keys(e),o=0;o<i.length;o++){var s=i[o];t=t.replace(new RegExp(s,"g"),e[s])}return t}var r5=function(t){if(typeof t!="string")throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof t+"`");try{return t=t.replace(/\+/g," "),decodeURIComponent(t)}catch{return t5(t)}},n5=(t,e)=>{if(!(typeof t=="string"&&typeof e=="string"))throw new TypeError("Expected the arguments to be of type `string`");if(e==="")return[t];const r=t.indexOf(e);return r===-1?[t]:[t.slice(0,r),t.slice(r+e.length)]},i5=function(t,e){for(var r={},n=Object.keys(t),i=Array.isArray(e),o=0;o<n.length;o++){var s=n[o],a=t[s];(i?e.indexOf(s)!==-1:e(s,a,t))&&(r[s]=a)}return r};(function(t){const e=Qg,r=r5,n=n5,i=i5,o=D=>D==null,s=Symbol("encodeFragmentIdentifier");function a(D){switch(D.arrayFormat){case"index":return N=>(C,$)=>{const P=C.length;return $===void 0||D.skipNull&&$===null||D.skipEmptyString&&$===""?C:$===null?[...C,[d(N,D),"[",P,"]"].join("")]:[...C,[d(N,D),"[",d(P,D),"]=",d($,D)].join("")]};case"bracket":return N=>(C,$)=>$===void 0||D.skipNull&&$===null||D.skipEmptyString&&$===""?C:$===null?[...C,[d(N,D),"[]"].join("")]:[...C,[d(N,D),"[]=",d($,D)].join("")];case"colon-list-separator":return N=>(C,$)=>$===void 0||D.skipNull&&$===null||D.skipEmptyString&&$===""?C:$===null?[...C,[d(N,D),":list="].join("")]:[...C,[d(N,D),":list=",d($,D)].join("")];case"comma":case"separator":case"bracket-separator":{const N=D.arrayFormat==="bracket-separator"?"[]=":"=";return C=>($,P)=>P===void 0||D.skipNull&&P===null||D.skipEmptyString&&P===""?$:(P=P===null?"":P,$.length===0?[[d(C,D),N,d(P,D)].join("")]:[[$,d(P,D)].join(D.arrayFormatSeparator)])}default:return N=>(C,$)=>$===void 0||D.skipNull&&$===null||D.skipEmptyString&&$===""?C:$===null?[...C,d(N,D)]:[...C,[d(N,D),"=",d($,D)].join("")]}}function l(D){let N;switch(D.arrayFormat){case"index":return(C,$,P)=>{if(N=/\[(\d*)\]$/.exec(C),C=C.replace(/\[\d*\]$/,""),!N){P[C]=$;return}P[C]===void 0&&(P[C]={}),P[C][N[1]]=$};case"bracket":return(C,$,P)=>{if(N=/(\[\])$/.exec(C),C=C.replace(/\[\]$/,""),!N){P[C]=$;return}if(P[C]===void 0){P[C]=[$];return}P[C]=[].concat(P[C],$)};case"colon-list-separator":return(C,$,P)=>{if(N=/(:list)$/.exec(C),C=C.replace(/:list$/,""),!N){P[C]=$;return}if(P[C]===void 0){P[C]=[$];return}P[C]=[].concat(P[C],$)};case"comma":case"separator":return(C,$,P)=>{const h=typeof $=="string"&&$.includes(D.arrayFormatSeparator),S=typeof $=="string"&&!h&&y($,D).includes(D.arrayFormatSeparator);$=S?y($,D):$;const q=h||S?$.split(D.arrayFormatSeparator).map(z=>y(z,D)):$===null?$:y($,D);P[C]=q};case"bracket-separator":return(C,$,P)=>{const h=/(\[\])$/.test(C);if(C=C.replace(/\[\]$/,""),!h){P[C]=$&&y($,D);return}const S=$===null?[]:$.split(D.arrayFormatSeparator).map(q=>y(q,D));if(P[C]===void 0){P[C]=S;return}P[C]=[].concat(P[C],S)};default:return(C,$,P)=>{if(P[C]===void 0){P[C]=$;return}P[C]=[].concat(P[C],$)}}}function u(D){if(typeof D!="string"||D.length!==1)throw new TypeError("arrayFormatSeparator must be single character string")}function d(D,N){return N.encode?N.strict?e(D):encodeURIComponent(D):D}function y(D,N){return N.decode?r(D):D}function m(D){return Array.isArray(D)?D.sort():typeof D=="object"?m(Object.keys(D)).sort((N,C)=>Number(N)-Number(C)).map(N=>D[N]):D}function v(D){const N=D.indexOf("#");return N!==-1&&(D=D.slice(0,N)),D}function _(D){let N="";const C=D.indexOf("#");return C!==-1&&(N=D.slice(C)),N}function R(D){D=v(D);const N=D.indexOf("?");return N===-1?"":D.slice(N+1)}function M(D,N){return N.parseNumbers&&!Number.isNaN(Number(D))&&typeof D=="string"&&D.trim()!==""?D=Number(D):N.parseBooleans&&D!==null&&(D.toLowerCase()==="true"||D.toLowerCase()==="false")&&(D=D.toLowerCase()==="true"),D}function B(D,N){N=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},N),u(N.arrayFormatSeparator);const C=l(N),$=Object.create(null);if(typeof D!="string"||(D=D.trim().replace(/^[?#&]/,""),!D))return $;for(const P of D.split("&")){if(P==="")continue;let[h,S]=n(N.decode?P.replace(/\+/g," "):P,"=");S=S===void 0?null:["comma","separator","bracket-separator"].includes(N.arrayFormat)?S:y(S,N),C(y(h,N),S,$)}for(const P of Object.keys($)){const h=$[P];if(typeof h=="object"&&h!==null)for(const S of Object.keys(h))h[S]=M(h[S],N);else $[P]=M(h,N)}return N.sort===!1?$:(N.sort===!0?Object.keys($).sort():Object.keys($).sort(N.sort)).reduce((P,h)=>{const S=$[h];return Boolean(S)&&typeof S=="object"&&!Array.isArray(S)?P[h]=m(S):P[h]=S,P},Object.create(null))}t.extract=R,t.parse=B,t.stringify=(D,N)=>{if(!D)return"";N=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},N),u(N.arrayFormatSeparator);const C=S=>N.skipNull&&o(D[S])||N.skipEmptyString&&D[S]==="",$=a(N),P={};for(const S of Object.keys(D))C(S)||(P[S]=D[S]);const h=Object.keys(P);return N.sort!==!1&&h.sort(N.sort),h.map(S=>{const q=D[S];return q===void 0?"":q===null?d(S,N):Array.isArray(q)?q.length===0&&N.arrayFormat==="bracket-separator"?d(S,N)+"[]":q.reduce($(S),[]).join("&"):d(S,N)+"="+d(q,N)}).filter(S=>S.length>0).join("&")},t.parseUrl=(D,N)=>{N=Object.assign({decode:!0},N);const[C,$]=n(D,"#");return Object.assign({url:C.split("?")[0]||"",query:B(R(D),N)},N&&N.parseFragmentIdentifier&&$?{fragmentIdentifier:y($,N)}:{})},t.stringifyUrl=(D,N)=>{N=Object.assign({encode:!0,strict:!0,[s]:!0},N);const C=v(D.url).split("?")[0]||"",$=t.extract(D.url),P=t.parse($,{sort:!1}),h=Object.assign(P,D.query);let S=t.stringify(h,N);S&&(S=`?${S}`);let q=_(D.url);return D.fragmentIdentifier&&(q=`#${N[s]?d(D.fragmentIdentifier,N):D.fragmentIdentifier}`),`${C}${S}${q}`},t.pick=(D,N,C)=>{C=Object.assign({parseFragmentIdentifier:!0,[s]:!1},C);const{url:$,query:P,fragmentIdentifier:h}=t.parseUrl(D,C);return t.stringifyUrl({url:$,query:i(P,N),fragmentIdentifier:h},C)},t.exclude=(D,N,C)=>{const $=Array.isArray(N)?P=>!N.includes(P):(P,h)=>!N(P,h);return t.pick(D,$,C)}})(ai);const o5={waku:{publish:"waku_publish",subscribe:"waku_subscribe",subscription:"waku_subscription",unsubscribe:"waku_unsubscribe"},irn:{publish:"irn_publish",subscribe:"irn_subscribe",subscription:"irn_subscription",unsubscribe:"irn_unsubscribe"},iridium:{publish:"iridium_publish",subscribe:"iridium_subscribe",subscription:"iridium_subscription",unsubscribe:"iridium_unsubscribe"}};function s5(t,e=[]){const r=[];return Object.keys(t).forEach(n=>{if(e.length&&!e.includes(n))return;const i=t[n];r.push(...i.accounts)}),r}function wa(t,e){return t.includes(":")?[t]:e.chains||[]}const Bh="base10",Jt="base16",va="base64pad",_a="utf8",jh=0,Qr=1,a5=0,kh=1,Ea=12,xa=32;function c5(){const t=ia.generateKeyPair();return{privateKey:Zt(t.secretKey,Jt),publicKey:Zt(t.publicKey,Jt)}}function Ca(){const t=In.randomBytes(xa);return Zt(t,Jt)}function l5(t,e){const r=ia.sharedKey(Yt(t,Jt),Yt(e,Jt)),n=new S3(jo.SHA256,r).expand(xa);return Zt(n,Jt)}function u5(t){const e=jo.hash(Yt(t,Jt));return Zt(e,Jt)}function zo(t){const e=jo.hash(Yt(t,_a));return Zt(e,Jt)}function h5(t){return Yt(`${t}`,Bh)}function ci(t){return Number(Zt(t,Bh))}function f5(t){const e=h5(typeof t.type<"u"?t.type:jh);if(ci(e)===Qr&&typeof t.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");const r=typeof t.senderPublicKey<"u"?Yt(t.senderPublicKey,Jt):void 0,n=typeof t.iv<"u"?Yt(t.iv,Jt):In.randomBytes(Ea),i=new Js.ChaCha20Poly1305(Yt(t.symKey,Jt)).seal(n,Yt(t.message,_a));return p5({type:e,sealed:i,iv:n,senderPublicKey:r})}function d5(t){const e=new Js.ChaCha20Poly1305(Yt(t.symKey,Jt)),{sealed:r,iv:n}=Sa(t.encoded),i=e.open(n,r);if(i===null)throw new Error("Failed to decrypt");return Zt(i,_a)}function p5(t){if(ci(t.type)===Qr){if(typeof t.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");return Zt(oa([t.type,t.senderPublicKey,t.iv,t.sealed]),va)}return Zt(oa([t.type,t.iv,t.sealed]),va)}function Sa(t){const e=Yt(t,va),r=e.slice(a5,kh),n=kh;if(ci(r)===Qr){const a=n+xa,l=a+Ea,u=e.slice(n,a),d=e.slice(a,l),y=e.slice(l);return{type:r,sealed:y,iv:d,senderPublicKey:u}}const i=n+Ea,o=e.slice(n,i),s=e.slice(i);return{type:r,sealed:s,iv:o}}function g5(t,e){const r=Sa(t);return Hh({type:ci(r.type),senderPublicKey:typeof r.senderPublicKey<"u"?Zt(r.senderPublicKey,Jt):void 0,receiverPublicKey:e?.receiverPublicKey})}function Hh(t){const e=t?.type||jh;if(e===Qr){if(typeof t?.senderPublicKey>"u")throw new Error("missing sender public key");if(typeof t?.receiverPublicKey>"u")throw new Error("missing receiver public key")}return{type:e,senderPublicKey:t?.senderPublicKey,receiverPublicKey:t?.receiverPublicKey}}function zh(t){return t.type===Qr&&typeof t.senderPublicKey=="string"&&typeof t.receiverPublicKey=="string"}var m5=Object.defineProperty,Wh=Object.getOwnPropertySymbols,b5=Object.prototype.hasOwnProperty,y5=Object.prototype.propertyIsEnumerable,Vh=(t,e,r)=>e in t?m5(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,qh=(t,e)=>{for(var r in e||(e={}))b5.call(e,r)&&Vh(t,r,e[r]);if(Wh)for(var r of Wh(e))y5.call(e,r)&&Vh(t,r,e[r]);return t};const w5="ReactNative",li={reactNative:"react-native",node:"node",browser:"browser",unknown:"unknown"},v5="js";function Kh(){return typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.node<"u"}function _5(){return!Ph()&&!!ma()&&navigator.product===w5}function E5(){return!Kh()&&!!ma()}function x5(){return _5()?li.reactNative:Kh()?li.node:E5()?li.browser:li.unknown}function C5(t,e){let r=ai.parse(t);return r=qh(qh({},r),e),t=ai.stringify(r),t}function S5(){return Nh()||{name:"",description:"",url:"",icons:[""]}}function A5(){const t=lg();if(t===null)return"unknown";const e=t.os?t.os.replace(" ","").toLowerCase():"unknown";return t.type==="browser"?[e,t.name,t.version].join("-"):[e,t.version].join("-")}function I5(){var t;const e=x5();return e===li.browser?[e,((t=Th())==null?void 0:t.host)||"unknown"].join(":"):e}function O5(t,e,r){const n=A5(),i=I5();return[[t,e].join("-"),[v5,r].join("-"),n,i].join("/")}function D5({protocol:t,version:e,relayUrl:r,sdkVersion:n,auth:i,projectId:o}){const s=r.split("?"),a=O5(t,e,n),l={auth:i,ua:a,projectId:o},u=C5(s[1]||"",l);return s[0]+"?"+u}function Ur(t,e){return t.filter(r=>e.includes(r)).length===t.length}function Gh(t){return Object.fromEntries(t.entries())}function Yh(t){return new Map(Object.entries(t))}function en(t){const e=Fe.toMiliseconds(t||Fe.FIVE_MINUTES);let r,n,i;return{resolve:o=>{i&&r&&(clearTimeout(i),r(o))},reject:o=>{i&&n&&(clearTimeout(i),n(o))},done:()=>new Promise((o,s)=>{i=setTimeout(s,e),r=o,n=s})}}function Zh(t,e){return new Promise(async(r,n)=>{const i=setTimeout(()=>n(),e),o=await t;clearTimeout(i),r(o)})}function Jh(t,e){if(typeof e=="string"&&e.startsWith(`${t}:`))return e;if(t.toLowerCase()==="topic"){if(typeof e!="string")throw new Error('Value must be "string" for expirer target type: topic');return`topic:${e}`}else if(t.toLowerCase()==="id"){if(typeof e!="number")throw new Error('Value must be "number" for expirer target type: id');return`id:${e}`}throw new Error(`Unknown expirer target type: ${t}`)}function $5(t){return Jh("topic",t)}function F5(t){return Jh("id",t)}function Xh(t){const[e,r]=t.split(":"),n={id:void 0,topic:void 0};if(e==="topic"&&typeof r=="string")n.topic=r;else if(e==="id"&&Number.isInteger(Number(r)))n.id=Number(r);else throw new Error(`Invalid target, expected id:number or topic:string, got ${e}:${r}`);return n}function br(t,e){return Fe.fromMiliseconds((e||Date.now())+Fe.toMiliseconds(t))}function Br(t){return Date.now()>=Fe.toMiliseconds(t)}function Et(t,e){return`${t}${e?`:${e}`:""}`}const P5="irn";function Aa(t){return t?.relay||{protocol:P5}}function Ia(t){const e=o5[t];if(typeof e>"u")throw new Error(`Relay Protocol not supported: ${t}`);return e}var T5=Object.defineProperty,Qh=Object.getOwnPropertySymbols,N5=Object.prototype.hasOwnProperty,R5=Object.prototype.propertyIsEnumerable,e0=(t,e,r)=>e in t?T5(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,L5=(t,e)=>{for(var r in e||(e={}))N5.call(e,r)&&e0(t,r,e[r]);if(Qh)for(var r of Qh(e))R5.call(e,r)&&e0(t,r,e[r]);return t};function M5(t,e="-"){const r={},n="relay"+e;return Object.keys(t).forEach(i=>{if(i.startsWith(n)){const o=i.replace(n,""),s=t[i];r[o]=s}}),r}function U5(t){const e=t.indexOf(":"),r=t.indexOf("?")!==-1?t.indexOf("?"):void 0,n=t.substring(0,e),i=t.substring(e+1,r).split("@"),o=typeof r<"u"?t.substring(r):"",s=ai.parse(o);return{protocol:n,topic:i[0],version:parseInt(i[1],10),symKey:s.symKey,relay:M5(s)}}function B5(t,e="-"){const r="relay",n={};return Object.keys(t).forEach(i=>{const o=r+e+i;t[i]&&(n[o]=t[i])}),n}function j5(t){return`${t.protocol}:${t.topic}@${t.version}?`+ai.stringify(L5({symKey:t.symKey},B5(t.relay)))}function ui(t){const e=[];return t.forEach(r=>{const[n,i]=r.split(":");e.push(`${n}:${i}`)}),e}function k5(t){const e=[];return Object.values(t).forEach(r=>{e.push(...ui(r.accounts))}),e}function H5(t,e){const r=[];return Object.values(t).forEach(n=>{ui(n.accounts).includes(e)&&r.push(...n.methods)}),r}function z5(t,e){const r=[];return Object.values(t).forEach(n=>{ui(n.accounts).includes(e)&&r.push(...n.events)}),r}function W5(t,e){const r=Wo(t,e);if(r)throw new Error(r.message);const n={};for(const[i,o]of Object.entries(t))n[i]={methods:o.methods,events:o.events,chains:o.accounts.map(s=>`${s.split(":")[0]}:${s.split(":")[1]}`)};return n}const V5={INVALID_METHOD:{message:"Invalid method.",code:1001},INVALID_EVENT:{message:"Invalid event.",code:1002},INVALID_UPDATE_REQUEST:{message:"Invalid update request.",code:1003},INVALID_EXTEND_REQUEST:{message:"Invalid extend request.",code:1004},INVALID_SESSION_SETTLE_REQUEST:{message:"Invalid session settle request.",code:1005},UNAUTHORIZED_METHOD:{message:"Unauthorized method.",code:3001},UNAUTHORIZED_EVENT:{message:"Unauthorized event.",code:3002},UNAUTHORIZED_UPDATE_REQUEST:{message:"Unauthorized update request.",code:3003},UNAUTHORIZED_EXTEND_REQUEST:{message:"Unauthorized extend request.",code:3004},USER_REJECTED:{message:"User rejected.",code:5e3},USER_REJECTED_CHAINS:{message:"User rejected chains.",code:5001},USER_REJECTED_METHODS:{message:"User rejected methods.",code:5002},USER_REJECTED_EVENTS:{message:"User rejected events.",code:5003},UNSUPPORTED_CHAINS:{message:"Unsupported chains.",code:5100},UNSUPPORTED_METHODS:{message:"Unsupported methods.",code:5101},UNSUPPORTED_EVENTS:{message:"Unsupported events.",code:5102},UNSUPPORTED_ACCOUNTS:{message:"Unsupported accounts.",code:5103},UNSUPPORTED_NAMESPACE_KEY:{message:"Unsupported namespace key.",code:5104},USER_DISCONNECTED:{message:"User disconnected.",code:6e3},SESSION_SETTLEMENT_FAILED:{message:"Session settlement failed.",code:7e3},WC_METHOD_UNSUPPORTED:{message:"Unsupported wc_ method.",code:10001}},q5={NOT_INITIALIZED:{message:"Not initialized.",code:1},NO_MATCHING_KEY:{message:"No matching key.",code:2},RESTORE_WILL_OVERRIDE:{message:"Restore will override.",code:3},RESUBSCRIBED:{message:"Resubscribed.",code:4},MISSING_OR_INVALID:{message:"Missing or invalid.",code:5},EXPIRED:{message:"Expired.",code:6},UNKNOWN_TYPE:{message:"Unknown type.",code:7},MISMATCHED_TOPIC:{message:"Mismatched topic.",code:8},NON_CONFORMING_NAMESPACES:{message:"Non conforming namespaces.",code:9}};function ue(t,e){const{message:r,code:n}=q5[t];return{message:e?`${r} ${e}`:r,code:n}}function xt(t,e){const{message:r,code:n}=V5[t];return{message:e?`${r} ${e}`:r,code:n}}function $n(t,e){return Array.isArray(t)?typeof e<"u"&&t.length?t.every(e):!0:!1}function hi(t){return Object.getPrototypeOf(t)===Object.prototype&&Object.keys(t).length}function kt(t){return typeof t>"u"}function $t(t,e){return e&&kt(t)?!0:typeof t=="string"&&Boolean(t.trim().length)}function Oa(t,e){return e&&kt(t)?!0:typeof t=="number"&&!isNaN(t)}function K5(t,e){const{requiredNamespaces:r}=e,n=Object.keys(t.namespaces),i=Object.keys(r);let o=!0;return Ur(i,n)?(n.forEach(s=>{const{accounts:a,methods:l,events:u}=t.namespaces[s],d=ui(a),y=r[s];(!Ur(wa(s,y),d)||!Ur(y.methods,l)||!Ur(y.events,u))&&(o=!1)}),o):!1}function Da(t){return $t(t,!1)&&t.includes(":")?t.split(":").length===2:!1}function G5(t){if($t(t,!1)&&t.includes(":")){const e=t.split(":");if(e.length===3){const r=e[0]+":"+e[1];return!!e[2]&&Da(r)}}return!1}function Y5(t){if($t(t,!1))try{return typeof new URL(t)<"u"}catch{return!1}return!1}function Z5(t){var e;return(e=t?.proposer)==null?void 0:e.publicKey}function J5(t){return t?.topic}function X5(t,e){let r=null;return $t(t?.publicKey,!1)||(r=ue("MISSING_OR_INVALID",`${e} controller public key should be a string`)),r}function t0(t){let e=!0;return $n(t)?t.length&&(e=t.every(r=>$t(r,!1))):e=!1,e}function Q5(t,e,r){let n=null;return $n(e)?e.forEach(i=>{n||(!Da(i)||!i.includes(t))&&(n=xt("UNSUPPORTED_CHAINS",`${r}, chain ${i} should be a string and conform to "namespace:chainId" format`))}):n=xt("UNSUPPORTED_CHAINS",`${r}, chains ${e} should be an array of strings conforming to "namespace:chainId" format`),n}function em(t,e){let r=null;return Object.entries(t).forEach(([n,i])=>{if(r)return;const o=Q5(n,wa(n,i),`${e} requiredNamespace`);o&&(r=o)}),r}function tm(t,e){let r=null;return $n(t)?t.forEach(n=>{r||G5(n)||(r=xt("UNSUPPORTED_ACCOUNTS",`${e}, account ${n} should be a string and conform to "namespace:chainId:address" format`))}):r=xt("UNSUPPORTED_ACCOUNTS",`${e}, accounts should be an array of strings conforming to "namespace:chainId:address" format`),r}function rm(t,e){let r=null;return Object.values(t).forEach(n=>{if(r)return;const i=tm(n?.accounts,`${e} namespace`);i&&(r=i)}),r}function nm(t,e){let r=null;return t0(t?.methods)?t0(t?.events)||(r=xt("UNSUPPORTED_EVENTS",`${e}, events should be an array of strings or empty array for no events`)):r=xt("UNSUPPORTED_METHODS",`${e}, methods should be an array of strings or empty array for no methods`),r}function r0(t,e){let r=null;return Object.values(t).forEach(n=>{if(r)return;const i=nm(n,`${e}, namespace`);i&&(r=i)}),r}function im(t,e,r){let n=null;if(t&&hi(t)){const i=r0(t,e);i&&(n=i);const o=em(t,e);o&&(n=o)}else n=ue("MISSING_OR_INVALID",`${e}, ${r} should be an object with data`);return n}function Wo(t,e){let r=null;if(t&&hi(t)){const n=r0(t,e);n&&(r=n);const i=rm(t,e);i&&(r=i)}else r=ue("MISSING_OR_INVALID",`${e}, namespaces should be an object with data`);return r}function n0(t){return $t(t.protocol,!0)}function om(t,e){let r=!1;return e&&!t?r=!0:t&&$n(t)&&t.length&&t.forEach(n=>{r=n0(n)}),r}function sm(t){return typeof t=="number"}function Xt(t){return typeof t<"u"&&typeof t!==null}function am(t){return!(!t||typeof t!="object"||!t.code||!Oa(t.code,!1)||!t.message||!$t(t.message,!1))}function cm(t){return!(kt(t)||!$t(t.method,!1))}function lm(t){return!(kt(t)||kt(t.result)&&kt(t.error)||!Oa(t.id,!1)||!$t(t.jsonrpc,!1))}function um(t){return!(kt(t)||!$t(t.name,!1))}function i0(t,e){return!(!Da(e)||!k5(t).includes(e))}function hm(t,e,r){return $t(r,!1)?H5(t,e).includes(r):!1}function fm(t,e,r){return $t(r,!1)?z5(t,e).includes(r):!1}function $a(t,e,r,n){let i=null;const o=Object.keys(t),s=Object.keys(e);return Ur(o,s)?o.forEach(a=>{if(i)return;const l=ui(e[a].accounts);Ur(wa(a,t[a]),l)?Ur(t[a].methods,e[a].methods)?Ur(t[a].events,e[a].events)||(i=ue("NON_CONFORMING_NAMESPACES",`${r} namespaces events don't satisfy namespace events for ${a}`)):i=ue("NON_CONFORMING_NAMESPACES",`${r} namespaces methods don't satisfy namespace methods for ${a}`):i=ue("NON_CONFORMING_NAMESPACES",`${r} namespaces accounts don't satisfy namespace chains for ${a}`)}):i=ue("NON_CONFORMING_NAMESPACES",`${r} namespaces keys don't satisfy ${n}`),i}function dm(t,e){return Oa(t,!1)&&t<=e.max&&t>=e.min}function pm(t){try{return JSON.stringify(t)}catch{return'"[Circular]"'}}var gm=mm;function mm(t,e,r){var n=r&&r.stringify||pm,i=1;if(typeof t=="object"&&t!==null){var o=e.length+i;if(o===1)return t;var s=new Array(o);s[0]=n(t);for(var a=1;a<o;a++)s[a]=n(e[a]);return s.join(" ")}if(typeof t!="string")return t;var l=e.length;if(l===0)return t;for(var u="",d=1-i,y=-1,m=t&&t.length||0,v=0;v<m;){if(t.charCodeAt(v)===37&&v+1<m){switch(y=y>-1?y:0,t.charCodeAt(v+1)){case 100:case 102:if(d>=l||e[d]==null)break;y<v&&(u+=t.slice(y,v)),u+=Number(e[d]),y=v+2,v++;break;case 105:if(d>=l||e[d]==null)break;y<v&&(u+=t.slice(y,v)),u+=Math.floor(Number(e[d])),y=v+2,v++;break;case 79:case 111:case 106:if(d>=l||e[d]===void 0)break;y<v&&(u+=t.slice(y,v));var _=typeof e[d];if(_==="string"){u+="'"+e[d]+"'",y=v+2,v++;break}if(_==="function"){u+=e[d].name||"<anonymous>",y=v+2,v++;break}u+=n(e[d]),y=v+2,v++;break;case 115:if(d>=l)break;y<v&&(u+=t.slice(y,v)),u+=String(e[d]),y=v+2,v++;break;case 37:y<v&&(u+=t.slice(y,v)),u+="%",y=v+2,v++,d--;break}++d}++v}return y===-1?t:(y<m&&(u+=t.slice(y)),u)}const o0=gm;var fi=yr;const di=Am().console||{},bm={mapHttpRequest:qo,mapHttpResponse:qo,wrapRequestSerializer:Pa,wrapResponseSerializer:Pa,wrapErrorSerializer:Pa,req:qo,res:qo,err:Em};function ym(t,e){return Array.isArray(t)?t.filter(function(n){return n!=="!stdSerializers.err"}):t===!0?Object.keys(e):!1}function yr(t){t=t||{},t.browser=t.browser||{};const e=t.browser.transmit;if(e&&typeof e.send!="function")throw Error("pino: transmit option must have a send function");const r=t.browser.write||di;t.browser.write&&(t.browser.asObject=!0);const n=t.serializers||{},i=ym(t.browser.serialize,n);let o=t.browser.serialize;Array.isArray(t.browser.serialize)&&t.browser.serialize.indexOf("!stdSerializers.err")>-1&&(o=!1);const s=["error","fatal","warn","info","debug","trace"];typeof r=="function"&&(r.error=r.fatal=r.warn=r.info=r.debug=r.trace=r),t.enabled===!1&&(t.level="silent");const a=t.level||"info",l=Object.create(r);l.log||(l.log=pi),Object.defineProperty(l,"levelVal",{get:d}),Object.defineProperty(l,"level",{get:y,set:m});const u={transmit:e,serialize:i,asObject:t.browser.asObject,levels:s,timestamp:xm(t)};l.levels=yr.levels,l.level=a,l.setMaxListeners=l.getMaxListeners=l.emit=l.addListener=l.on=l.prependListener=l.once=l.prependOnceListener=l.removeListener=l.removeAllListeners=l.listeners=l.listenerCount=l.eventNames=l.write=l.flush=pi,l.serializers=n,l._serialize=i,l._stdErrSerialize=o,l.child=v,e&&(l._logEvent=Fa());function d(){return this.level==="silent"?1/0:this.levels.values[this.level]}function y(){return this._level}function m(_){if(_!=="silent"&&!this.levels.values[_])throw Error("unknown level "+_);this._level=_,Fn(u,l,"error","log"),Fn(u,l,"fatal","error"),Fn(u,l,"warn","error"),Fn(u,l,"info","log"),Fn(u,l,"debug","log"),Fn(u,l,"trace","log")}function v(_,R){if(!_)throw new Error("missing bindings for child Pino");R=R||{},i&&_.serializers&&(R.serializers=_.serializers);const M=R.serializers;if(i&&M){var B=Object.assign({},n,M),D=t.browser.serialize===!0?Object.keys(B):i;delete _.serializers,Vo([_],D,B,this._stdErrSerialize)}function N(C){this._childLevel=(C._childLevel|0)+1,this.error=Pn(C,_,"error"),this.fatal=Pn(C,_,"fatal"),this.warn=Pn(C,_,"warn"),this.info=Pn(C,_,"info"),this.debug=Pn(C,_,"debug"),this.trace=Pn(C,_,"trace"),B&&(this.serializers=B,this._serialize=D),e&&(this._logEvent=Fa([].concat(C._logEvent.bindings,_)))}return N.prototype=this,new N(this)}return l}yr.levels={values:{fatal:60,error:50,warn:40,info:30,debug:20,trace:10},labels:{10:"trace",20:"debug",30:"info",40:"warn",50:"error",60:"fatal"}},yr.stdSerializers=bm,yr.stdTimeFunctions=Object.assign({},{nullTime:s0,epochTime:a0,unixTime:Cm,isoTime:Sm});function Fn(t,e,r,n){const i=Object.getPrototypeOf(e);e[r]=e.levelVal>e.levels.values[r]?pi:i[r]?i[r]:di[r]||di[n]||pi,wm(t,e,r)}function wm(t,e,r){!t.transmit&&e[r]===pi||(e[r]=function(n){return function(){const o=t.timestamp(),s=new Array(arguments.length),a=Object.getPrototypeOf&&Object.getPrototypeOf(this)===di?di:this;for(var l=0;l<s.length;l++)s[l]=arguments[l];if(t.serialize&&!t.asObject&&Vo(s,this._serialize,this.serializers,this._stdErrSerialize),t.asObject?n.call(a,vm(this,r,s,o)):n.apply(a,s),t.transmit){const u=t.transmit.level||e.level,d=yr.levels.values[u],y=yr.levels.values[r];if(y<d)return;_m(this,{ts:o,methodLevel:r,methodValue:y,transmitLevel:u,transmitValue:yr.levels.values[t.transmit.level||e.level],send:t.transmit.send,val:e.levelVal},s)}}}(e[r]))}function vm(t,e,r,n){t._serialize&&Vo(r,t._serialize,t.serializers,t._stdErrSerialize);const i=r.slice();let o=i[0];const s={};n&&(s.time=n),s.level=yr.levels.values[e];let a=(t._childLevel|0)+1;if(a<1&&(a=1),o!==null&&typeof o=="object"){for(;a--&&typeof i[0]=="object";)Object.assign(s,i.shift());o=i.length?o0(i.shift(),i):void 0}else typeof o=="string"&&(o=o0(i.shift(),i));return o!==void 0&&(s.msg=o),s}function Vo(t,e,r,n){for(const i in t)if(n&&t[i]instanceof Error)t[i]=yr.stdSerializers.err(t[i]);else if(typeof t[i]=="object"&&!Array.isArray(t[i]))for(const o in t[i])e&&e.indexOf(o)>-1&&o in r&&(t[i][o]=r[o](t[i][o]))}function Pn(t,e,r){return function(){const n=new Array(1+arguments.length);n[0]=e;for(var i=1;i<n.length;i++)n[i]=arguments[i-1];return t[r].apply(this,n)}}function _m(t,e,r){const n=e.send,i=e.ts,o=e.methodLevel,s=e.methodValue,a=e.val,l=t._logEvent.bindings;Vo(r,t._serialize||Object.keys(t.serializers),t.serializers,t._stdErrSerialize===void 0?!0:t._stdErrSerialize),t._logEvent.ts=i,t._logEvent.messages=r.filter(function(u){return l.indexOf(u)===-1}),t._logEvent.level.label=o,t._logEvent.level.value=s,n(o,t._logEvent,a),t._logEvent=Fa(l)}function Fa(t){return{ts:0,messages:[],bindings:t||[],level:{label:"",value:0}}}function Em(t){const e={type:t.constructor.name,msg:t.message,stack:t.stack};for(const r in t)e[r]===void 0&&(e[r]=t[r]);return e}function xm(t){return typeof t.timestamp=="function"?t.timestamp:t.timestamp===!1?s0:a0}function qo(){return{}}function Pa(t){return t}function pi(){}function s0(){return!1}function a0(){return Date.now()}function Cm(){return Math.round(Date.now()/1e3)}function Sm(){return new Date(Date.now()).toISOString()}function Am(){function t(e){return typeof e<"u"&&e}try{return typeof globalThis<"u"||Object.defineProperty(Object.prototype,"globalThis",{get:function(){return delete Object.prototype.globalThis,this.globalThis=this},configurable:!0}),globalThis}catch{return t(self)||t(window)||t(this)||{}}}var Ko={};/*! *****************************************************************************
14
+ ***************************************************************************** */var go=function(t,e){return go=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)n.hasOwnProperty(i)&&(r[i]=n[i])},go(t,e)};function cp(t,e){go(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var mo=function(){return mo=Object.assign||function(e){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(e[s]=r[s])}return e},mo.apply(this,arguments)};function lp(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r}function up(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s}function hp(t,e){return function(r,n){e(r,n,t)}}function dp(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function fp(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(p){try{l(n.next(p))}catch(w){o(w)}}function c(p){try{l(n.throw(p))}catch(w){o(w)}}function l(p){p.done?s(p.value):i(p.value).then(a,c)}l((n=n.apply(t,e||[])).next())})}function pp(t,e){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,i,s,o;return o={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(l){return function(p){return c([l,p])}}function c(l){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(s=l[0]&2?i.return:l[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,l[1])).done)return s;switch(i=0,s&&(l=[l[0]&2,s.value]),l[0]){case 0:case 1:s=l;break;case 4:return r.label++,{value:l[1],done:!1};case 5:r.label++,i=l[1],l=[0];continue;case 7:l=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(l[0]===6||l[0]===2)){r=0;continue}if(l[0]===3&&(!s||l[1]>s[0]&&l[1]<s[3])){r.label=l[1];break}if(l[0]===6&&r.label<s[1]){r.label=s[1],s=l;break}if(s&&r.label<s[2]){r.label=s[2],r.ops.push(l);break}s[2]&&r.ops.pop(),r.trys.pop();continue}l=e.call(t,r)}catch(p){l=[6,p],i=0}finally{n=s=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}function gp(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}function mp(t,e){for(var r in t)r!=="default"&&!e.hasOwnProperty(r)&&(e[r]=t[r])}function wo(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function Sl(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,s=[],o;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(a){o={error:a}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}return s}function wp(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(Sl(arguments[e]));return t}function yp(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;for(var n=Array(t),i=0,e=0;e<r;e++)for(var s=arguments[e],o=0,a=s.length;o<a;o++,i++)n[i]=s[o];return n}function Ln(t){return this instanceof Ln?(this.v=t,this):new Ln(t)}function bp(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(t,e||[]),i,s=[];return i={},o("next"),o("throw"),o("return"),i[Symbol.asyncIterator]=function(){return this},i;function o(y){n[y]&&(i[y]=function(m){return new Promise(function(E,A){s.push([y,m,E,A])>1||a(y,m)})})}function a(y,m){try{c(n[y](m))}catch(E){w(s[0][3],E)}}function c(y){y.value instanceof Ln?Promise.resolve(y.value.v).then(l,p):w(s[0][2],y)}function l(y){a("next",y)}function p(y){a("throw",y)}function w(y,m){y(m),s.shift(),s.length&&a(s[0][0],s[0][1])}}function vp(t){var e,r;return e={},n("next"),n("throw",function(i){throw i}),n("return"),e[Symbol.iterator]=function(){return this},e;function n(i,s){e[i]=t[i]?function(o){return(r=!r)?{value:Ln(t[i](o)),done:i==="return"}:s?s(o):o}:s}}function _p(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof wo=="function"?wo(t):t[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(s){r[s]=t[s]&&function(o){return new Promise(function(a,c){o=t[s](o),i(a,c,o.done,o.value)})}}function i(s,o,a,c){Promise.resolve(c).then(function(l){s({value:l,done:a})},o)}}function Ep(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function xp(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}function Cp(t){return t&&t.__esModule?t:{default:t}}function Sp(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}function Ip(t,e,r){if(!e.has(t))throw new TypeError("attempted to set private field on non-instance");return e.set(t,r),r}var Dp=Object.freeze({__proto__:null,__extends:cp,get __assign(){return mo},__rest:lp,__decorate:up,__param:hp,__metadata:dp,__awaiter:fp,__generator:pp,__createBinding:gp,__exportStar:mp,__values:wo,__read:Sl,__spread:wp,__spreadArrays:yp,__await:Ln,__asyncGenerator:bp,__asyncDelegator:vp,__asyncValues:_p,__makeTemplateObject:Ep,__importStar:xp,__importDefault:Cp,__classPrivateFieldGet:Sp,__classPrivateFieldSet:Ip}),Xi=$r(Dp),yo={},Mn={},Il;function Op(){if(Il)return Mn;Il=1,Object.defineProperty(Mn,"__esModule",{value:!0}),Mn.delay=void 0;function t(e){return new Promise(r=>{setTimeout(()=>{r(!0)},e)})}return Mn.delay=t,Mn}var Pr={},bo={},Tr={},Dl;function Ap(){return Dl||(Dl=1,Object.defineProperty(Tr,"__esModule",{value:!0}),Tr.ONE_THOUSAND=Tr.ONE_HUNDRED=void 0,Tr.ONE_HUNDRED=100,Tr.ONE_THOUSAND=1e3),Tr}var vo={},Ol;function $p(){return Ol||(Ol=1,function(t){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=t.ONE_MINUTE*5,t.TEN_MINUTES=t.ONE_MINUTE*10,t.THIRTY_MINUTES=t.ONE_MINUTE*30,t.SIXTY_MINUTES=t.ONE_MINUTE*60,t.ONE_HOUR=t.SIXTY_MINUTES,t.THREE_HOURS=t.ONE_HOUR*3,t.SIX_HOURS=t.ONE_HOUR*6,t.TWELVE_HOURS=t.ONE_HOUR*12,t.TWENTY_FOUR_HOURS=t.ONE_HOUR*24,t.ONE_DAY=t.TWENTY_FOUR_HOURS,t.THREE_DAYS=t.ONE_DAY*3,t.FIVE_DAYS=t.ONE_DAY*5,t.SEVEN_DAYS=t.ONE_DAY*7,t.THIRTY_DAYS=t.ONE_DAY*30,t.ONE_WEEK=t.SEVEN_DAYS,t.TWO_WEEKS=t.ONE_WEEK*2,t.THREE_WEEKS=t.ONE_WEEK*3,t.FOUR_WEEKS=t.ONE_WEEK*4,t.ONE_YEAR=t.ONE_DAY*365}(vo)),vo}var Al;function $l(){return Al||(Al=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=Xi;e.__exportStar(Ap(),t),e.__exportStar($p(),t)}(bo)),bo}var Pl;function Pp(){if(Pl)return Pr;Pl=1,Object.defineProperty(Pr,"__esModule",{value:!0}),Pr.fromMiliseconds=Pr.toMiliseconds=void 0;const t=$l();function e(n){return n*t.ONE_THOUSAND}Pr.toMiliseconds=e;function r(n){return Math.floor(n/t.ONE_THOUSAND)}return Pr.fromMiliseconds=r,Pr}var Tl;function Tp(){return Tl||(Tl=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=Xi;e.__exportStar(Op(),t),e.__exportStar(Pp(),t)}(yo)),yo}var ln={},Nl;function Np(){if(Nl)return ln;Nl=1,Object.defineProperty(ln,"__esModule",{value:!0}),ln.Watch=void 0;class t{constructor(){this.timestamps=new Map}start(r){if(this.timestamps.has(r))throw new Error(`Watch already started for label: ${r}`);this.timestamps.set(r,{started:Date.now()})}stop(r){const n=this.get(r);if(typeof n.elapsed<"u")throw new Error(`Watch already stopped for label: ${r}`);const i=Date.now()-n.started;this.timestamps.set(r,{started:n.started,elapsed:i})}get(r){const n=this.timestamps.get(r);if(typeof n>"u")throw new Error(`No timestamp found for label: ${r}`);return n}elapsed(r){const n=this.get(r);return n.elapsed||Date.now()-n.started}}return ln.Watch=t,ln.default=t,ln}var _o={},Un={},Rl;function Rp(){if(Rl)return Un;Rl=1,Object.defineProperty(Un,"__esModule",{value:!0}),Un.IWatch=void 0;class t{}return Un.IWatch=t,Un}var Ll;function Lp(){return Ll||(Ll=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),Xi.__exportStar(Rp(),t)}(_o)),_o}(function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=Xi;e.__exportStar(Tp(),t),e.__exportStar(Np(),t),e.__exportStar(Lp(),t),e.__exportStar($l(),t)})(me);var ze={};Object.defineProperty(ze,"__esModule",{value:!0}),ze.getLocalStorage=ze.getLocalStorageOrThrow=ze.getCrypto=ze.getCryptoOrThrow=Ul=ze.getLocation=ze.getLocationOrThrow=Eo=ze.getNavigator=ze.getNavigatorOrThrow=Ml=ze.getDocument=ze.getDocumentOrThrow=ze.getFromWindowOrThrow=ze.getFromWindow=void 0;function Nr(t){let e;return typeof window<"u"&&typeof window[t]<"u"&&(e=window[t]),e}ze.getFromWindow=Nr;function un(t){const e=Nr(t);if(!e)throw new Error(`${t} is not defined in Window`);return e}ze.getFromWindowOrThrow=un;function Mp(){return un("document")}ze.getDocumentOrThrow=Mp;function Up(){return Nr("document")}var Ml=ze.getDocument=Up;function Fp(){return un("navigator")}ze.getNavigatorOrThrow=Fp;function Bp(){return Nr("navigator")}var Eo=ze.getNavigator=Bp;function jp(){return un("location")}ze.getLocationOrThrow=jp;function kp(){return Nr("location")}var Ul=ze.getLocation=kp;function Hp(){return un("crypto")}ze.getCryptoOrThrow=Hp;function zp(){return Nr("crypto")}ze.getCrypto=zp;function Wp(){return un("localStorage")}ze.getLocalStorageOrThrow=Wp;function qp(){return Nr("localStorage")}ze.getLocalStorage=qp;var xo={};Object.defineProperty(xo,"__esModule",{value:!0});var Fl=xo.getWindowMetadata=void 0;const Bl=ze;function Vp(){let t,e;try{t=Bl.getDocumentOrThrow(),e=Bl.getLocationOrThrow()}catch{return null}function r(){const w=t.getElementsByTagName("link"),y=[];for(let m=0;m<w.length;m++){const E=w[m],A=E.getAttribute("rel");if(A&&A.toLowerCase().indexOf("icon")>-1){const N=E.getAttribute("href");if(N)if(N.toLowerCase().indexOf("https:")===-1&&N.toLowerCase().indexOf("http:")===-1&&N.indexOf("//")!==0){let M=e.protocol+"//"+e.host;if(N.indexOf("/")===0)M+=N;else{const x=e.pathname.split("/");x.pop();const D=x.join("/");M+=D+"/"+N}y.push(M)}else if(N.indexOf("//")===0){const M=e.protocol+N;y.push(M)}else y.push(N)}}return y}function n(...w){const y=t.getElementsByTagName("meta");for(let m=0;m<y.length;m++){const E=y[m],A=["itemprop","property","name"].map(N=>E.getAttribute(N)).filter(N=>N?w.includes(N):!1);if(A.length&&A){const N=E.getAttribute("content");if(N)return N}}return""}function i(){let w=n("name","og:site_name","og:title","twitter:title");return w||(w=t.title),w}function s(){return n("description","og:description","twitter:description","keywords")}const o=i(),a=s(),c=e.origin,l=r();return{description:a,url:c,icons:l,name:o}}Fl=xo.getWindowMetadata=Vp;var Fn={},Kp=t=>encodeURIComponent(t).replace(/[!'()*]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`),jl="%[a-f0-9]{2}",kl=new RegExp("("+jl+")|([^%]+?)","gi"),Hl=new RegExp("("+jl+")+","gi");function Co(t,e){try{return[decodeURIComponent(t.join(""))]}catch{}if(t.length===1)return t;e=e||1;var r=t.slice(0,e),n=t.slice(e);return Array.prototype.concat.call([],Co(r),Co(n))}function Gp(t){try{return decodeURIComponent(t)}catch{for(var e=t.match(kl)||[],r=1;r<e.length;r++)t=Co(e,r).join(""),e=t.match(kl)||[];return t}}function Yp(t){for(var e={"%FE%FF":"\uFFFD\uFFFD","%FF%FE":"\uFFFD\uFFFD"},r=Hl.exec(t);r;){try{e[r[0]]=decodeURIComponent(r[0])}catch{var n=Gp(r[0]);n!==r[0]&&(e[r[0]]=n)}r=Hl.exec(t)}e["%C2"]="\uFFFD";for(var i=Object.keys(e),s=0;s<i.length;s++){var o=i[s];t=t.replace(new RegExp(o,"g"),e[o])}return t}var Zp=function(t){if(typeof t!="string")throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof t+"`");try{return t=t.replace(/\+/g," "),decodeURIComponent(t)}catch{return Yp(t)}},Jp=(t,e)=>{if(!(typeof t=="string"&&typeof e=="string"))throw new TypeError("Expected the arguments to be of type `string`");if(e==="")return[t];const r=t.indexOf(e);return r===-1?[t]:[t.slice(0,r),t.slice(r+e.length)]},Xp=function(t,e){for(var r={},n=Object.keys(t),i=Array.isArray(e),s=0;s<n.length;s++){var o=n[s],a=t[o];(i?e.indexOf(o)!==-1:e(o,a,t))&&(r[o]=a)}return r};(function(t){const e=Kp,r=Zp,n=Jp,i=Xp,s=x=>x==null,o=Symbol("encodeFragmentIdentifier");function a(x){switch(x.arrayFormat){case"index":return D=>(b,I)=>{const O=b.length;return I===void 0||x.skipNull&&I===null||x.skipEmptyString&&I===""?b:I===null?[...b,[p(D,x),"[",O,"]"].join("")]:[...b,[p(D,x),"[",p(O,x),"]=",p(I,x)].join("")]};case"bracket":return D=>(b,I)=>I===void 0||x.skipNull&&I===null||x.skipEmptyString&&I===""?b:I===null?[...b,[p(D,x),"[]"].join("")]:[...b,[p(D,x),"[]=",p(I,x)].join("")];case"colon-list-separator":return D=>(b,I)=>I===void 0||x.skipNull&&I===null||x.skipEmptyString&&I===""?b:I===null?[...b,[p(D,x),":list="].join("")]:[...b,[p(D,x),":list=",p(I,x)].join("")];case"comma":case"separator":case"bracket-separator":{const D=x.arrayFormat==="bracket-separator"?"[]=":"=";return b=>(I,O)=>O===void 0||x.skipNull&&O===null||x.skipEmptyString&&O===""?I:(O=O===null?"":O,I.length===0?[[p(b,x),D,p(O,x)].join("")]:[[I,p(O,x)].join(x.arrayFormatSeparator)])}default:return D=>(b,I)=>I===void 0||x.skipNull&&I===null||x.skipEmptyString&&I===""?b:I===null?[...b,p(D,x)]:[...b,[p(D,x),"=",p(I,x)].join("")]}}function c(x){let D;switch(x.arrayFormat){case"index":return(b,I,O)=>{if(D=/\[(\d*)\]$/.exec(b),b=b.replace(/\[\d*\]$/,""),!D){O[b]=I;return}O[b]===void 0&&(O[b]={}),O[b][D[1]]=I};case"bracket":return(b,I,O)=>{if(D=/(\[\])$/.exec(b),b=b.replace(/\[\]$/,""),!D){O[b]=I;return}if(O[b]===void 0){O[b]=[I];return}O[b]=[].concat(O[b],I)};case"colon-list-separator":return(b,I,O)=>{if(D=/(:list)$/.exec(b),b=b.replace(/:list$/,""),!D){O[b]=I;return}if(O[b]===void 0){O[b]=[I];return}O[b]=[].concat(O[b],I)};case"comma":case"separator":return(b,I,O)=>{const h=typeof I=="string"&&I.includes(x.arrayFormatSeparator),_=typeof I=="string"&&!h&&w(I,x).includes(x.arrayFormatSeparator);I=_?w(I,x):I;const H=h||_?I.split(x.arrayFormatSeparator).map(j=>w(j,x)):I===null?I:w(I,x);O[b]=H};case"bracket-separator":return(b,I,O)=>{const h=/(\[\])$/.test(b);if(b=b.replace(/\[\]$/,""),!h){O[b]=I&&w(I,x);return}const _=I===null?[]:I.split(x.arrayFormatSeparator).map(H=>w(H,x));if(O[b]===void 0){O[b]=_;return}O[b]=[].concat(O[b],_)};default:return(b,I,O)=>{if(O[b]===void 0){O[b]=I;return}O[b]=[].concat(O[b],I)}}}function l(x){if(typeof x!="string"||x.length!==1)throw new TypeError("arrayFormatSeparator must be single character string")}function p(x,D){return D.encode?D.strict?e(x):encodeURIComponent(x):x}function w(x,D){return D.decode?r(x):x}function y(x){return Array.isArray(x)?x.sort():typeof x=="object"?y(Object.keys(x)).sort((D,b)=>Number(D)-Number(b)).map(D=>x[D]):x}function m(x){const D=x.indexOf("#");return D!==-1&&(x=x.slice(0,D)),x}function E(x){let D="";const b=x.indexOf("#");return b!==-1&&(D=x.slice(b)),D}function A(x){x=m(x);const D=x.indexOf("?");return D===-1?"":x.slice(D+1)}function N(x,D){return D.parseNumbers&&!Number.isNaN(Number(x))&&typeof x=="string"&&x.trim()!==""?x=Number(x):D.parseBooleans&&x!==null&&(x.toLowerCase()==="true"||x.toLowerCase()==="false")&&(x=x.toLowerCase()==="true"),x}function M(x,D){D=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},D),l(D.arrayFormatSeparator);const b=c(D),I=Object.create(null);if(typeof x!="string"||(x=x.trim().replace(/^[?#&]/,""),!x))return I;for(const O of x.split("&")){if(O==="")continue;let[h,_]=n(D.decode?O.replace(/\+/g," "):O,"=");_=_===void 0?null:["comma","separator","bracket-separator"].includes(D.arrayFormat)?_:w(_,D),b(w(h,D),_,I)}for(const O of Object.keys(I)){const h=I[O];if(typeof h=="object"&&h!==null)for(const _ of Object.keys(h))h[_]=N(h[_],D);else I[O]=N(h,D)}return D.sort===!1?I:(D.sort===!0?Object.keys(I).sort():Object.keys(I).sort(D.sort)).reduce((O,h)=>{const _=I[h];return Boolean(_)&&typeof _=="object"&&!Array.isArray(_)?O[h]=y(_):O[h]=_,O},Object.create(null))}t.extract=A,t.parse=M,t.stringify=(x,D)=>{if(!x)return"";D=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},D),l(D.arrayFormatSeparator);const b=_=>D.skipNull&&s(x[_])||D.skipEmptyString&&x[_]==="",I=a(D),O={};for(const _ of Object.keys(x))b(_)||(O[_]=x[_]);const h=Object.keys(O);return D.sort!==!1&&h.sort(D.sort),h.map(_=>{const H=x[_];return H===void 0?"":H===null?p(_,D):Array.isArray(H)?H.length===0&&D.arrayFormat==="bracket-separator"?p(_,D)+"[]":H.reduce(I(_),[]).join("&"):p(_,D)+"="+p(H,D)}).filter(_=>_.length>0).join("&")},t.parseUrl=(x,D)=>{D=Object.assign({decode:!0},D);const[b,I]=n(x,"#");return Object.assign({url:b.split("?")[0]||"",query:M(A(x),D)},D&&D.parseFragmentIdentifier&&I?{fragmentIdentifier:w(I,D)}:{})},t.stringifyUrl=(x,D)=>{D=Object.assign({encode:!0,strict:!0,[o]:!0},D);const b=m(x.url).split("?")[0]||"",I=t.extract(x.url),O=t.parse(I,{sort:!1}),h=Object.assign(O,x.query);let _=t.stringify(h,D);_&&(_=`?${_}`);let H=E(x.url);return x.fragmentIdentifier&&(H=`#${D[o]?p(x.fragmentIdentifier,D):x.fragmentIdentifier}`),`${b}${_}${H}`},t.pick=(x,D,b)=>{b=Object.assign({parseFragmentIdentifier:!0,[o]:!1},b);const{url:I,query:O,fragmentIdentifier:h}=t.parseUrl(x,b);return t.stringifyUrl({url:I,query:i(O,D),fragmentIdentifier:h},b)},t.exclude=(x,D,b)=>{const I=Array.isArray(D)?O=>!D.includes(O):(O,h)=>!D(O,h);return t.pick(x,I,b)}})(Fn);const Qp={waku:{publish:"waku_publish",subscribe:"waku_subscribe",subscription:"waku_subscription",unsubscribe:"waku_unsubscribe"},irn:{publish:"irn_publish",subscribe:"irn_subscribe",subscription:"irn_subscription",unsubscribe:"irn_unsubscribe"},iridium:{publish:"iridium_publish",subscribe:"iridium_subscribe",subscription:"iridium_subscription",unsubscribe:"iridium_unsubscribe"}};function eg(t,e=[]){const r=[];return Object.keys(t).forEach(n=>{if(e.length&&!e.includes(n))return;const i=t[n];r.push(...i.accounts)}),r}function So(t,e){return t.includes(":")?[t]:e.chains||[]}const zl="base10",Nt="base16",Io="base64pad",Do="utf8",Wl=0,Rr=1,tg=0,ql=1,Oo=12,Ao=32;function rg(){const t=lo.generateKeyPair();return{privateKey:Tt(t.secretKey,Nt),publicKey:Tt(t.publicKey,Nt)}}function $o(){const t=cn.randomBytes(Ao);return Tt(t,Nt)}function ng(t,e){const r=lo.sharedKey(Pt(t,Nt),Pt(e,Nt)),n=new bf(Zi.SHA256,r).expand(Ao);return Tt(n,Nt)}function ig(t){const e=Zi.hash(Pt(t,Nt));return Tt(e,Nt)}function Qi(t){const e=Zi.hash(Pt(t,Do));return Tt(e,Nt)}function sg(t){return Pt(`${t}`,zl)}function Bn(t){return Number(Tt(t,zl))}function og(t){const e=sg(typeof t.type<"u"?t.type:Wl);if(Bn(e)===Rr&&typeof t.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");const r=typeof t.senderPublicKey<"u"?Pt(t.senderPublicKey,Nt):void 0,n=typeof t.iv<"u"?Pt(t.iv,Nt):cn.randomBytes(Oo),i=new ro.ChaCha20Poly1305(Pt(t.symKey,Nt)).seal(n,Pt(t.message,Do));return cg({type:e,sealed:i,iv:n,senderPublicKey:r})}function ag(t){const e=new ro.ChaCha20Poly1305(Pt(t.symKey,Nt)),{sealed:r,iv:n}=Po(t.encoded),i=e.open(n,r);if(i===null)throw new Error("Failed to decrypt");return Tt(i,Do)}function cg(t){if(Bn(t.type)===Rr){if(typeof t.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");return Tt(uo([t.type,t.senderPublicKey,t.iv,t.sealed]),Io)}return Tt(uo([t.type,t.iv,t.sealed]),Io)}function Po(t){const e=Pt(t,Io),r=e.slice(tg,ql),n=ql;if(Bn(r)===Rr){const a=n+Ao,c=a+Oo,l=e.slice(n,a),p=e.slice(a,c),w=e.slice(c);return{type:r,sealed:w,iv:p,senderPublicKey:l}}const i=n+Oo,s=e.slice(n,i),o=e.slice(i);return{type:r,sealed:o,iv:s}}function lg(t,e){const r=Po(t);return Vl({type:Bn(r.type),senderPublicKey:typeof r.senderPublicKey<"u"?Tt(r.senderPublicKey,Nt):void 0,receiverPublicKey:e?.receiverPublicKey})}function Vl(t){const e=t?.type||Wl;if(e===Rr){if(typeof t?.senderPublicKey>"u")throw new Error("missing sender public key");if(typeof t?.receiverPublicKey>"u")throw new Error("missing receiver public key")}return{type:e,senderPublicKey:t?.senderPublicKey,receiverPublicKey:t?.receiverPublicKey}}function Kl(t){return t.type===Rr&&typeof t.senderPublicKey=="string"&&typeof t.receiverPublicKey=="string"}var ug=Object.defineProperty,Gl=Object.getOwnPropertySymbols,hg=Object.prototype.hasOwnProperty,dg=Object.prototype.propertyIsEnumerable,Yl=(t,e,r)=>e in t?ug(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Zl=(t,e)=>{for(var r in e||(e={}))hg.call(e,r)&&Yl(t,r,e[r]);if(Gl)for(var r of Gl(e))dg.call(e,r)&&Yl(t,r,e[r]);return t};const fg="ReactNative",jn={reactNative:"react-native",node:"node",browser:"browser",unknown:"unknown"},pg="js";function Jl(){return typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.node<"u"}function gg(){return!Ml()&&!!Eo()&&navigator.product===fg}function mg(){return!Jl()&&!!Eo()}function wg(){return gg()?jn.reactNative:Jl()?jn.node:mg()?jn.browser:jn.unknown}function yg(t,e){let r=Fn.parse(t);return r=Zl(Zl({},r),e),t=Fn.stringify(r),t}function bg(){return Fl()||{name:"",description:"",url:"",icons:[""]}}function vg(){const t=np();if(t===null)return"unknown";const e=t.os?t.os.replace(" ","").toLowerCase():"unknown";return t.type==="browser"?[e,t.name,t.version].join("-"):[e,t.version].join("-")}function _g(){var t;const e=wg();return e===jn.browser?[e,((t=Ul())==null?void 0:t.host)||"unknown"].join(":"):e}function Eg(t,e,r){const n=vg(),i=_g();return[[t,e].join("-"),[pg,r].join("-"),n,i].join("/")}function xg({protocol:t,version:e,relayUrl:r,sdkVersion:n,auth:i,projectId:s}){const o=r.split("?"),a=Eg(t,e,n),c={auth:i,ua:a,projectId:s},l=yg(o[1]||"",c);return o[0]+"?"+l}function gr(t,e){return t.filter(r=>e.includes(r)).length===t.length}function Xl(t){return Object.fromEntries(t.entries())}function Ql(t){return new Map(Object.entries(t))}function Lr(t){const e=me.toMiliseconds(t||me.FIVE_MINUTES);let r,n,i;return{resolve:s=>{i&&r&&(clearTimeout(i),r(s))},reject:s=>{i&&n&&(clearTimeout(i),n(s))},done:()=>new Promise((s,o)=>{i=setTimeout(o,e),r=s,n=o})}}function eu(t,e){return new Promise(async(r,n)=>{const i=setTimeout(()=>n(),e),s=await t;clearTimeout(i),r(s)})}function tu(t,e){if(typeof e=="string"&&e.startsWith(`${t}:`))return e;if(t.toLowerCase()==="topic"){if(typeof e!="string")throw new Error('Value must be "string" for expirer target type: topic');return`topic:${e}`}else if(t.toLowerCase()==="id"){if(typeof e!="number")throw new Error('Value must be "number" for expirer target type: id');return`id:${e}`}throw new Error(`Unknown expirer target type: ${t}`)}function Cg(t){return tu("topic",t)}function Sg(t){return tu("id",t)}function ru(t){const[e,r]=t.split(":"),n={id:void 0,topic:void 0};if(e==="topic"&&typeof r=="string")n.topic=r;else if(e==="id"&&Number.isInteger(Number(r)))n.id=Number(r);else throw new Error(`Invalid target, expected id:number or topic:string, got ${e}:${r}`);return n}function Qt(t,e){return me.fromMiliseconds((e||Date.now())+me.toMiliseconds(t))}function mr(t){return Date.now()>=me.toMiliseconds(t)}function et(t,e){return`${t}${e?`:${e}`:""}`}const Ig="irn";function To(t){return t?.relay||{protocol:Ig}}function No(t){const e=Qp[t];if(typeof e>"u")throw new Error(`Relay Protocol not supported: ${t}`);return e}var Dg=Object.defineProperty,nu=Object.getOwnPropertySymbols,Og=Object.prototype.hasOwnProperty,Ag=Object.prototype.propertyIsEnumerable,iu=(t,e,r)=>e in t?Dg(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,$g=(t,e)=>{for(var r in e||(e={}))Og.call(e,r)&&iu(t,r,e[r]);if(nu)for(var r of nu(e))Ag.call(e,r)&&iu(t,r,e[r]);return t};function Pg(t,e="-"){const r={},n="relay"+e;return Object.keys(t).forEach(i=>{if(i.startsWith(n)){const s=i.replace(n,""),o=t[i];r[s]=o}}),r}function Tg(t){const e=t.indexOf(":"),r=t.indexOf("?")!==-1?t.indexOf("?"):void 0,n=t.substring(0,e),i=t.substring(e+1,r).split("@"),s=typeof r<"u"?t.substring(r):"",o=Fn.parse(s);return{protocol:n,topic:i[0],version:parseInt(i[1],10),symKey:o.symKey,relay:Pg(o)}}function Ng(t,e="-"){const r="relay",n={};return Object.keys(t).forEach(i=>{const s=r+e+i;t[i]&&(n[s]=t[i])}),n}function Rg(t){return`${t.protocol}:${t.topic}@${t.version}?`+Fn.stringify($g({symKey:t.symKey},Ng(t.relay)))}function kn(t){const e=[];return t.forEach(r=>{const[n,i]=r.split(":");e.push(`${n}:${i}`)}),e}function Lg(t){const e=[];return Object.values(t).forEach(r=>{e.push(...kn(r.accounts))}),e}function Mg(t,e){const r=[];return Object.values(t).forEach(n=>{kn(n.accounts).includes(e)&&r.push(...n.methods)}),r}function Ug(t,e){const r=[];return Object.values(t).forEach(n=>{kn(n.accounts).includes(e)&&r.push(...n.events)}),r}function Fg(t,e){const r=es(t,e);if(r)throw new Error(r.message);const n={};for(const[i,s]of Object.entries(t))n[i]={methods:s.methods,events:s.events,chains:s.accounts.map(o=>`${o.split(":")[0]}:${o.split(":")[1]}`)};return n}const Bg={INVALID_METHOD:{message:"Invalid method.",code:1001},INVALID_EVENT:{message:"Invalid event.",code:1002},INVALID_UPDATE_REQUEST:{message:"Invalid update request.",code:1003},INVALID_EXTEND_REQUEST:{message:"Invalid extend request.",code:1004},INVALID_SESSION_SETTLE_REQUEST:{message:"Invalid session settle request.",code:1005},UNAUTHORIZED_METHOD:{message:"Unauthorized method.",code:3001},UNAUTHORIZED_EVENT:{message:"Unauthorized event.",code:3002},UNAUTHORIZED_UPDATE_REQUEST:{message:"Unauthorized update request.",code:3003},UNAUTHORIZED_EXTEND_REQUEST:{message:"Unauthorized extend request.",code:3004},USER_REJECTED:{message:"User rejected.",code:5e3},USER_REJECTED_CHAINS:{message:"User rejected chains.",code:5001},USER_REJECTED_METHODS:{message:"User rejected methods.",code:5002},USER_REJECTED_EVENTS:{message:"User rejected events.",code:5003},UNSUPPORTED_CHAINS:{message:"Unsupported chains.",code:5100},UNSUPPORTED_METHODS:{message:"Unsupported methods.",code:5101},UNSUPPORTED_EVENTS:{message:"Unsupported events.",code:5102},UNSUPPORTED_ACCOUNTS:{message:"Unsupported accounts.",code:5103},UNSUPPORTED_NAMESPACE_KEY:{message:"Unsupported namespace key.",code:5104},USER_DISCONNECTED:{message:"User disconnected.",code:6e3},SESSION_SETTLEMENT_FAILED:{message:"Session settlement failed.",code:7e3},WC_METHOD_UNSUPPORTED:{message:"Unsupported wc_ method.",code:10001}},jg={NOT_INITIALIZED:{message:"Not initialized.",code:1},NO_MATCHING_KEY:{message:"No matching key.",code:2},RESTORE_WILL_OVERRIDE:{message:"Restore will override.",code:3},RESUBSCRIBED:{message:"Resubscribed.",code:4},MISSING_OR_INVALID:{message:"Missing or invalid.",code:5},EXPIRED:{message:"Expired.",code:6},UNKNOWN_TYPE:{message:"Unknown type.",code:7},MISMATCHED_TOPIC:{message:"Mismatched topic.",code:8},NON_CONFORMING_NAMESPACES:{message:"Non conforming namespaces.",code:9}};function se(t,e){const{message:r,code:n}=jg[t];return{message:e?`${r} ${e}`:r,code:n}}function ot(t,e){const{message:r,code:n}=Bg[t];return{message:e?`${r} ${e}`:r,code:n}}function wr(t,e){return Array.isArray(t)?typeof e<"u"&&t.length?t.every(e):!0:!1}function Hn(t){return Object.getPrototypeOf(t)===Object.prototype&&Object.keys(t).length}function Ot(t){return typeof t>"u"}function ht(t,e){return e&&Ot(t)?!0:typeof t=="string"&&Boolean(t.trim().length)}function Ro(t,e){return e&&Ot(t)?!0:typeof t=="number"&&!isNaN(t)}function kg(t,e){const{requiredNamespaces:r}=e,n=Object.keys(t.namespaces),i=Object.keys(r);let s=!0;return gr(i,n)?(n.forEach(o=>{const{accounts:a,methods:c,events:l}=t.namespaces[o],p=kn(a),w=r[o];(!gr(So(o,w),p)||!gr(w.methods,c)||!gr(w.events,l))&&(s=!1)}),s):!1}function Lo(t){return ht(t,!1)&&t.includes(":")?t.split(":").length===2:!1}function Hg(t){if(ht(t,!1)&&t.includes(":")){const e=t.split(":");if(e.length===3){const r=e[0]+":"+e[1];return!!e[2]&&Lo(r)}}return!1}function zg(t){if(ht(t,!1))try{return typeof new URL(t)<"u"}catch{return!1}return!1}function Wg(t){var e;return(e=t?.proposer)==null?void 0:e.publicKey}function qg(t){return t?.topic}function Vg(t,e){let r=null;return ht(t?.publicKey,!1)||(r=se("MISSING_OR_INVALID",`${e} controller public key should be a string`)),r}function su(t){let e=!0;return wr(t)?t.length&&(e=t.every(r=>ht(r,!1))):e=!1,e}function Kg(t,e,r){let n=null;return wr(e)?e.forEach(i=>{n||(!Lo(i)||!i.includes(t))&&(n=ot("UNSUPPORTED_CHAINS",`${r}, chain ${i} should be a string and conform to "namespace:chainId" format`))}):n=ot("UNSUPPORTED_CHAINS",`${r}, chains ${e} should be an array of strings conforming to "namespace:chainId" format`),n}function Gg(t,e){let r=null;return Object.entries(t).forEach(([n,i])=>{if(r)return;const s=Kg(n,So(n,i),`${e} requiredNamespace`);s&&(r=s)}),r}function Yg(t,e){let r=null;return wr(t)?t.forEach(n=>{r||Hg(n)||(r=ot("UNSUPPORTED_ACCOUNTS",`${e}, account ${n} should be a string and conform to "namespace:chainId:address" format`))}):r=ot("UNSUPPORTED_ACCOUNTS",`${e}, accounts should be an array of strings conforming to "namespace:chainId:address" format`),r}function Zg(t,e){let r=null;return Object.values(t).forEach(n=>{if(r)return;const i=Yg(n?.accounts,`${e} namespace`);i&&(r=i)}),r}function Jg(t,e){let r=null;return su(t?.methods)?su(t?.events)||(r=ot("UNSUPPORTED_EVENTS",`${e}, events should be an array of strings or empty array for no events`)):r=ot("UNSUPPORTED_METHODS",`${e}, methods should be an array of strings or empty array for no methods`),r}function ou(t,e){let r=null;return Object.values(t).forEach(n=>{if(r)return;const i=Jg(n,`${e}, namespace`);i&&(r=i)}),r}function Xg(t,e,r){let n=null;if(t&&Hn(t)){const i=ou(t,e);i&&(n=i);const s=Gg(t,e);s&&(n=s)}else n=se("MISSING_OR_INVALID",`${e}, ${r} should be an object with data`);return n}function es(t,e){let r=null;if(t&&Hn(t)){const n=ou(t,e);n&&(r=n);const i=Zg(t,e);i&&(r=i)}else r=se("MISSING_OR_INVALID",`${e}, namespaces should be an object with data`);return r}function au(t){return ht(t.protocol,!0)}function Qg(t,e){let r=!1;return e&&!t?r=!0:t&&wr(t)&&t.length&&t.forEach(n=>{r=au(n)}),r}function e2(t){return typeof t=="number"}function Rt(t){return typeof t<"u"&&typeof t!==null}function t2(t){return!(!t||typeof t!="object"||!t.code||!Ro(t.code,!1)||!t.message||!ht(t.message,!1))}function r2(t){return!(Ot(t)||!ht(t.method,!1))}function n2(t){return!(Ot(t)||Ot(t.result)&&Ot(t.error)||!Ro(t.id,!1)||!ht(t.jsonrpc,!1))}function i2(t){return!(Ot(t)||!ht(t.name,!1))}function cu(t,e){return!(!Lo(e)||!Lg(t).includes(e))}function s2(t,e,r){return ht(r,!1)?Mg(t,e).includes(r):!1}function o2(t,e,r){return ht(r,!1)?Ug(t,e).includes(r):!1}function Mo(t,e,r,n){let i=null;const s=Object.keys(t),o=Object.keys(e);return gr(s,o)?s.forEach(a=>{if(i)return;const c=kn(e[a].accounts);gr(So(a,t[a]),c)?gr(t[a].methods,e[a].methods)?gr(t[a].events,e[a].events)||(i=se("NON_CONFORMING_NAMESPACES",`${r} namespaces events don't satisfy namespace events for ${a}`)):i=se("NON_CONFORMING_NAMESPACES",`${r} namespaces methods don't satisfy namespace methods for ${a}`):i=se("NON_CONFORMING_NAMESPACES",`${r} namespaces accounts don't satisfy namespace chains for ${a}`)}):i=se("NON_CONFORMING_NAMESPACES",`${r} namespaces keys don't satisfy ${n}`),i}function a2(t,e){return Ro(t,!1)&&t<=e.max&&t>=e.min}function c2(t){try{return JSON.stringify(t)}catch{return'"[Circular]"'}}var l2=u2;function u2(t,e,r){var n=r&&r.stringify||c2,i=1;if(typeof t=="object"&&t!==null){var s=e.length+i;if(s===1)return t;var o=new Array(s);o[0]=n(t);for(var a=1;a<s;a++)o[a]=n(e[a]);return o.join(" ")}if(typeof t!="string")return t;var c=e.length;if(c===0)return t;for(var l="",p=1-i,w=-1,y=t&&t.length||0,m=0;m<y;){if(t.charCodeAt(m)===37&&m+1<y){switch(w=w>-1?w:0,t.charCodeAt(m+1)){case 100:case 102:if(p>=c||e[p]==null)break;w<m&&(l+=t.slice(w,m)),l+=Number(e[p]),w=m+2,m++;break;case 105:if(p>=c||e[p]==null)break;w<m&&(l+=t.slice(w,m)),l+=Math.floor(Number(e[p])),w=m+2,m++;break;case 79:case 111:case 106:if(p>=c||e[p]===void 0)break;w<m&&(l+=t.slice(w,m));var E=typeof e[p];if(E==="string"){l+="'"+e[p]+"'",w=m+2,m++;break}if(E==="function"){l+=e[p].name||"<anonymous>",w=m+2,m++;break}l+=n(e[p]),w=m+2,m++;break;case 115:if(p>=c)break;w<m&&(l+=t.slice(w,m)),l+=String(e[p]),w=m+2,m++;break;case 37:w<m&&(l+=t.slice(w,m)),l+="%",w=m+2,m++,p--;break}++p}++m}return w===-1?t:(w<y&&(l+=t.slice(w)),l)}const lu=l2;var zn=er;const Wn=v2().console||{},h2={mapHttpRequest:rs,mapHttpResponse:rs,wrapRequestSerializer:Fo,wrapResponseSerializer:Fo,wrapErrorSerializer:Fo,req:rs,res:rs,err:m2};function d2(t,e){return Array.isArray(t)?t.filter(function(n){return n!=="!stdSerializers.err"}):t===!0?Object.keys(e):!1}function er(t){t=t||{},t.browser=t.browser||{};const e=t.browser.transmit;if(e&&typeof e.send!="function")throw Error("pino: transmit option must have a send function");const r=t.browser.write||Wn;t.browser.write&&(t.browser.asObject=!0);const n=t.serializers||{},i=d2(t.browser.serialize,n);let s=t.browser.serialize;Array.isArray(t.browser.serialize)&&t.browser.serialize.indexOf("!stdSerializers.err")>-1&&(s=!1);const o=["error","fatal","warn","info","debug","trace"];typeof r=="function"&&(r.error=r.fatal=r.warn=r.info=r.debug=r.trace=r),t.enabled===!1&&(t.level="silent");const a=t.level||"info",c=Object.create(r);c.log||(c.log=qn),Object.defineProperty(c,"levelVal",{get:p}),Object.defineProperty(c,"level",{get:w,set:y});const l={transmit:e,serialize:i,asObject:t.browser.asObject,levels:o,timestamp:w2(t)};c.levels=er.levels,c.level=a,c.setMaxListeners=c.getMaxListeners=c.emit=c.addListener=c.on=c.prependListener=c.once=c.prependOnceListener=c.removeListener=c.removeAllListeners=c.listeners=c.listenerCount=c.eventNames=c.write=c.flush=qn,c.serializers=n,c._serialize=i,c._stdErrSerialize=s,c.child=m,e&&(c._logEvent=Uo());function p(){return this.level==="silent"?1/0:this.levels.values[this.level]}function w(){return this._level}function y(E){if(E!=="silent"&&!this.levels.values[E])throw Error("unknown level "+E);this._level=E,hn(l,c,"error","log"),hn(l,c,"fatal","error"),hn(l,c,"warn","error"),hn(l,c,"info","log"),hn(l,c,"debug","log"),hn(l,c,"trace","log")}function m(E,A){if(!E)throw new Error("missing bindings for child Pino");A=A||{},i&&E.serializers&&(A.serializers=E.serializers);const N=A.serializers;if(i&&N){var M=Object.assign({},n,N),x=t.browser.serialize===!0?Object.keys(M):i;delete E.serializers,ts([E],x,M,this._stdErrSerialize)}function D(b){this._childLevel=(b._childLevel|0)+1,this.error=dn(b,E,"error"),this.fatal=dn(b,E,"fatal"),this.warn=dn(b,E,"warn"),this.info=dn(b,E,"info"),this.debug=dn(b,E,"debug"),this.trace=dn(b,E,"trace"),M&&(this.serializers=M,this._serialize=x),e&&(this._logEvent=Uo([].concat(b._logEvent.bindings,E)))}return D.prototype=this,new D(this)}return c}er.levels={values:{fatal:60,error:50,warn:40,info:30,debug:20,trace:10},labels:{10:"trace",20:"debug",30:"info",40:"warn",50:"error",60:"fatal"}},er.stdSerializers=h2,er.stdTimeFunctions=Object.assign({},{nullTime:uu,epochTime:hu,unixTime:y2,isoTime:b2});function hn(t,e,r,n){const i=Object.getPrototypeOf(e);e[r]=e.levelVal>e.levels.values[r]?qn:i[r]?i[r]:Wn[r]||Wn[n]||qn,f2(t,e,r)}function f2(t,e,r){!t.transmit&&e[r]===qn||(e[r]=function(n){return function(){const s=t.timestamp(),o=new Array(arguments.length),a=Object.getPrototypeOf&&Object.getPrototypeOf(this)===Wn?Wn:this;for(var c=0;c<o.length;c++)o[c]=arguments[c];if(t.serialize&&!t.asObject&&ts(o,this._serialize,this.serializers,this._stdErrSerialize),t.asObject?n.call(a,p2(this,r,o,s)):n.apply(a,o),t.transmit){const l=t.transmit.level||e.level,p=er.levels.values[l],w=er.levels.values[r];if(w<p)return;g2(this,{ts:s,methodLevel:r,methodValue:w,transmitLevel:l,transmitValue:er.levels.values[t.transmit.level||e.level],send:t.transmit.send,val:e.levelVal},o)}}}(e[r]))}function p2(t,e,r,n){t._serialize&&ts(r,t._serialize,t.serializers,t._stdErrSerialize);const i=r.slice();let s=i[0];const o={};n&&(o.time=n),o.level=er.levels.values[e];let a=(t._childLevel|0)+1;if(a<1&&(a=1),s!==null&&typeof s=="object"){for(;a--&&typeof i[0]=="object";)Object.assign(o,i.shift());s=i.length?lu(i.shift(),i):void 0}else typeof s=="string"&&(s=lu(i.shift(),i));return s!==void 0&&(o.msg=s),o}function ts(t,e,r,n){for(const i in t)if(n&&t[i]instanceof Error)t[i]=er.stdSerializers.err(t[i]);else if(typeof t[i]=="object"&&!Array.isArray(t[i]))for(const s in t[i])e&&e.indexOf(s)>-1&&s in r&&(t[i][s]=r[s](t[i][s]))}function dn(t,e,r){return function(){const n=new Array(1+arguments.length);n[0]=e;for(var i=1;i<n.length;i++)n[i]=arguments[i-1];return t[r].apply(this,n)}}function g2(t,e,r){const n=e.send,i=e.ts,s=e.methodLevel,o=e.methodValue,a=e.val,c=t._logEvent.bindings;ts(r,t._serialize||Object.keys(t.serializers),t.serializers,t._stdErrSerialize===void 0?!0:t._stdErrSerialize),t._logEvent.ts=i,t._logEvent.messages=r.filter(function(l){return c.indexOf(l)===-1}),t._logEvent.level.label=s,t._logEvent.level.value=o,n(s,t._logEvent,a),t._logEvent=Uo(c)}function Uo(t){return{ts:0,messages:[],bindings:t||[],level:{label:"",value:0}}}function m2(t){const e={type:t.constructor.name,msg:t.message,stack:t.stack};for(const r in t)e[r]===void 0&&(e[r]=t[r]);return e}function w2(t){return typeof t.timestamp=="function"?t.timestamp:t.timestamp===!1?uu:hu}function rs(){return{}}function Fo(t){return t}function qn(){}function uu(){return!1}function hu(){return Date.now()}function y2(){return Math.round(Date.now()/1e3)}function b2(){return new Date(Date.now()).toISOString()}function v2(){function t(e){return typeof e<"u"&&e}try{return typeof globalThis<"u"||Object.defineProperty(Object.prototype,"globalThis",{get:function(){return delete Object.prototype.globalThis,this.globalThis=this},configurable:!0}),globalThis}catch{return t(self)||t(window)||t(this)||{}}}var ns={};/*! *****************************************************************************
15
15
  Copyright (c) Microsoft Corporation.
16
16
 
17
17
  Permission to use, copy, modify, and/or distribute this software for any
@@ -24,7 +24,7 @@
24
24
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
25
25
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
26
26
  PERFORMANCE OF THIS SOFTWARE.
27
- ***************************************************************************** */var Ta=function(t,e){return Ta=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)n.hasOwnProperty(i)&&(r[i]=n[i])},Ta(t,e)};function Im(t,e){Ta(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var Na=function(){return Na=Object.assign||function(e){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e},Na.apply(this,arguments)};function Om(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r}function Dm(t,e,r,n){var i=arguments.length,o=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,r,o):s(e,r))||o);return i>3&&o&&Object.defineProperty(e,r,o),o}function $m(t,e){return function(r,n){e(r,n,t)}}function Fm(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function Pm(t,e,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(d){try{u(n.next(d))}catch(y){s(y)}}function l(d){try{u(n.throw(d))}catch(y){s(y)}}function u(d){d.done?o(d.value):i(d.value).then(a,l)}u((n=n.apply(t,e||[])).next())})}function Tm(t,e){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,s;return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(u){return function(d){return l([u,d])}}function l(u){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(o=u[0]&2?i.return:u[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,u[1])).done)return o;switch(i=0,o&&(u=[u[0]&2,o.value]),u[0]){case 0:case 1:o=u;break;case 4:return r.label++,{value:u[1],done:!1};case 5:r.label++,i=u[1],u=[0];continue;case 7:u=r.ops.pop(),r.trys.pop();continue;default:if(o=r.trys,!(o=o.length>0&&o[o.length-1])&&(u[0]===6||u[0]===2)){r=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[1]<o[3])){r.label=u[1];break}if(u[0]===6&&r.label<o[1]){r.label=o[1],o=u;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(u);break}o[2]&&r.ops.pop(),r.trys.pop();continue}u=e.call(t,r)}catch(d){u=[6,d],i=0}finally{n=o=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}function Nm(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}function Rm(t,e){for(var r in t)r!=="default"&&!e.hasOwnProperty(r)&&(e[r]=t[r])}function Ra(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function c0(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,o=[],s;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(a){s={error:a}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(s)throw s.error}}return o}function Lm(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(c0(arguments[e]));return t}function Mm(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;for(var n=Array(t),i=0,e=0;e<r;e++)for(var o=arguments[e],s=0,a=o.length;s<a;s++,i++)n[i]=o[s];return n}function gi(t){return this instanceof gi?(this.v=t,this):new gi(t)}function Um(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(t,e||[]),i,o=[];return i={},s("next"),s("throw"),s("return"),i[Symbol.asyncIterator]=function(){return this},i;function s(m){n[m]&&(i[m]=function(v){return new Promise(function(_,R){o.push([m,v,_,R])>1||a(m,v)})})}function a(m,v){try{l(n[m](v))}catch(_){y(o[0][3],_)}}function l(m){m.value instanceof gi?Promise.resolve(m.value.v).then(u,d):y(o[0][2],m)}function u(m){a("next",m)}function d(m){a("throw",m)}function y(m,v){m(v),o.shift(),o.length&&a(o[0][0],o[0][1])}}function Bm(t){var e,r;return e={},n("next"),n("throw",function(i){throw i}),n("return"),e[Symbol.iterator]=function(){return this},e;function n(i,o){e[i]=t[i]?function(s){return(r=!r)?{value:gi(t[i](s)),done:i==="return"}:o?o(s):s}:o}}function jm(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof Ra=="function"?Ra(t):t[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(o){r[o]=t[o]&&function(s){return new Promise(function(a,l){s=t[o](s),i(a,l,s.done,s.value)})}}function i(o,s,a,l){Promise.resolve(l).then(function(u){o({value:u,done:a})},s)}}function km(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function Hm(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}function zm(t){return t&&t.__esModule?t:{default:t}}function Wm(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}function Vm(t,e,r){if(!e.has(t))throw new TypeError("attempted to set private field on non-instance");return e.set(t,r),r}var qm=Object.freeze({__proto__:null,__extends:Im,get __assign(){return Na},__rest:Om,__decorate:Dm,__param:$m,__metadata:Fm,__awaiter:Pm,__generator:Tm,__createBinding:Nm,__exportStar:Rm,__values:Ra,__read:c0,__spread:Lm,__spreadArrays:Mm,__await:gi,__asyncGenerator:Um,__asyncDelegator:Bm,__asyncValues:jm,__makeTemplateObject:km,__importStar:Hm,__importDefault:zm,__classPrivateFieldGet:Wm,__classPrivateFieldSet:Vm}),l0=Yr(qm),mi={};Object.defineProperty(mi,"__esModule",{value:!0});function Km(t){if(typeof t!="string")throw new Error(`Cannot safe json parse value of type ${typeof t}`);try{return JSON.parse(t)}catch{return t}}mi.safeJsonParse=Km;function Gm(t){return typeof t=="string"?t:JSON.stringify(t,(e,r)=>typeof r>"u"?null:r)}mi.safeJsonStringify=Gm;var bi={exports:{}},u0;function Ym(){return u0||(u0=1,function(){let t;function e(){}t=e,t.prototype.getItem=function(r){return this.hasOwnProperty(r)?String(this[r]):null},t.prototype.setItem=function(r,n){this[r]=String(n)},t.prototype.removeItem=function(r){delete this[r]},t.prototype.clear=function(){const r=this;Object.keys(r).forEach(function(n){r[n]=void 0,delete r[n]})},t.prototype.key=function(r){return r=r||0,Object.keys(this)[r]},t.prototype.__defineGetter__("length",function(){return Object.keys(this).length}),typeof Ot<"u"&&Ot.localStorage?bi.exports=Ot.localStorage:typeof window<"u"&&window.localStorage?bi.exports=window.localStorage:bi.exports=new e}()),bi.exports}var La={},yi={},h0;function Zm(){if(h0)return yi;h0=1,Object.defineProperty(yi,"__esModule",{value:!0}),yi.IKeyValueStorage=void 0;class t{}return yi.IKeyValueStorage=t,yi}var wi={},f0;function Jm(){if(f0)return wi;f0=1,Object.defineProperty(wi,"__esModule",{value:!0}),wi.parseEntry=void 0;const t=mi;function e(r){var n;return[r[0],t.safeJsonParse((n=r[1])!==null&&n!==void 0?n:"")]}return wi.parseEntry=e,wi}var d0;function Xm(){return d0||(d0=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=l0;e.__exportStar(Zm(),t),e.__exportStar(Jm(),t)}(La)),La}Object.defineProperty(Ko,"__esModule",{value:!0}),Ko.KeyValueStorage=void 0;const Tn=l0,p0=mi,Qm=Tn.__importDefault(Ym()),eb=Xm();class g0{constructor(){this.localStorage=Qm.default}getKeys(){return Tn.__awaiter(this,void 0,void 0,function*(){return Object.keys(this.localStorage)})}getEntries(){return Tn.__awaiter(this,void 0,void 0,function*(){return Object.entries(this.localStorage).map(eb.parseEntry)})}getItem(e){return Tn.__awaiter(this,void 0,void 0,function*(){const r=this.localStorage.getItem(e);if(r!==null)return p0.safeJsonParse(r)})}setItem(e,r){return Tn.__awaiter(this,void 0,void 0,function*(){this.localStorage.setItem(e,p0.safeJsonStringify(r))})}removeItem(e){return Tn.__awaiter(this,void 0,void 0,function*(){this.localStorage.removeItem(e)})}}Ko.KeyValueStorage=g0;var tb=Ko.default=g0,vi={};/*! *****************************************************************************
27
+ ***************************************************************************** */var Bo=function(t,e){return Bo=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)n.hasOwnProperty(i)&&(r[i]=n[i])},Bo(t,e)};function _2(t,e){Bo(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var jo=function(){return jo=Object.assign||function(e){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(e[s]=r[s])}return e},jo.apply(this,arguments)};function E2(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r}function x2(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s}function C2(t,e){return function(r,n){e(r,n,t)}}function S2(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function I2(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(p){try{l(n.next(p))}catch(w){o(w)}}function c(p){try{l(n.throw(p))}catch(w){o(w)}}function l(p){p.done?s(p.value):i(p.value).then(a,c)}l((n=n.apply(t,e||[])).next())})}function D2(t,e){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,i,s,o;return o={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(l){return function(p){return c([l,p])}}function c(l){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(s=l[0]&2?i.return:l[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,l[1])).done)return s;switch(i=0,s&&(l=[l[0]&2,s.value]),l[0]){case 0:case 1:s=l;break;case 4:return r.label++,{value:l[1],done:!1};case 5:r.label++,i=l[1],l=[0];continue;case 7:l=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(l[0]===6||l[0]===2)){r=0;continue}if(l[0]===3&&(!s||l[1]>s[0]&&l[1]<s[3])){r.label=l[1];break}if(l[0]===6&&r.label<s[1]){r.label=s[1],s=l;break}if(s&&r.label<s[2]){r.label=s[2],r.ops.push(l);break}s[2]&&r.ops.pop(),r.trys.pop();continue}l=e.call(t,r)}catch(p){l=[6,p],i=0}finally{n=s=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}function O2(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}function A2(t,e){for(var r in t)r!=="default"&&!e.hasOwnProperty(r)&&(e[r]=t[r])}function ko(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function du(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,s=[],o;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(a){o={error:a}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}return s}function $2(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(du(arguments[e]));return t}function P2(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;for(var n=Array(t),i=0,e=0;e<r;e++)for(var s=arguments[e],o=0,a=s.length;o<a;o++,i++)n[i]=s[o];return n}function Vn(t){return this instanceof Vn?(this.v=t,this):new Vn(t)}function T2(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(t,e||[]),i,s=[];return i={},o("next"),o("throw"),o("return"),i[Symbol.asyncIterator]=function(){return this},i;function o(y){n[y]&&(i[y]=function(m){return new Promise(function(E,A){s.push([y,m,E,A])>1||a(y,m)})})}function a(y,m){try{c(n[y](m))}catch(E){w(s[0][3],E)}}function c(y){y.value instanceof Vn?Promise.resolve(y.value.v).then(l,p):w(s[0][2],y)}function l(y){a("next",y)}function p(y){a("throw",y)}function w(y,m){y(m),s.shift(),s.length&&a(s[0][0],s[0][1])}}function N2(t){var e,r;return e={},n("next"),n("throw",function(i){throw i}),n("return"),e[Symbol.iterator]=function(){return this},e;function n(i,s){e[i]=t[i]?function(o){return(r=!r)?{value:Vn(t[i](o)),done:i==="return"}:s?s(o):o}:s}}function R2(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof ko=="function"?ko(t):t[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(s){r[s]=t[s]&&function(o){return new Promise(function(a,c){o=t[s](o),i(a,c,o.done,o.value)})}}function i(s,o,a,c){Promise.resolve(c).then(function(l){s({value:l,done:a})},o)}}function L2(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function M2(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}function U2(t){return t&&t.__esModule?t:{default:t}}function F2(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}function B2(t,e,r){if(!e.has(t))throw new TypeError("attempted to set private field on non-instance");return e.set(t,r),r}var j2=Object.freeze({__proto__:null,__extends:_2,get __assign(){return jo},__rest:E2,__decorate:x2,__param:C2,__metadata:S2,__awaiter:I2,__generator:D2,__createBinding:O2,__exportStar:A2,__values:ko,__read:du,__spread:$2,__spreadArrays:P2,__await:Vn,__asyncGenerator:T2,__asyncDelegator:N2,__asyncValues:R2,__makeTemplateObject:L2,__importStar:M2,__importDefault:U2,__classPrivateFieldGet:F2,__classPrivateFieldSet:B2}),fu=$r(j2),Kn={};Object.defineProperty(Kn,"__esModule",{value:!0});function k2(t){if(typeof t!="string")throw new Error(`Cannot safe json parse value of type ${typeof t}`);try{return JSON.parse(t)}catch{return t}}Kn.safeJsonParse=k2;function H2(t){return typeof t=="string"?t:JSON.stringify(t,(e,r)=>typeof r>"u"?null:r)}Kn.safeJsonStringify=H2;var Gn={exports:{}},pu;function z2(){return pu||(pu=1,function(){let t;function e(){}t=e,t.prototype.getItem=function(r){return this.hasOwnProperty(r)?String(this[r]):null},t.prototype.setItem=function(r,n){this[r]=String(n)},t.prototype.removeItem=function(r){delete this[r]},t.prototype.clear=function(){const r=this;Object.keys(r).forEach(function(n){r[n]=void 0,delete r[n]})},t.prototype.key=function(r){return r=r||0,Object.keys(this)[r]},t.prototype.__defineGetter__("length",function(){return Object.keys(this).length}),typeof ut<"u"&&ut.localStorage?Gn.exports=ut.localStorage:typeof window<"u"&&window.localStorage?Gn.exports=window.localStorage:Gn.exports=new e}()),Gn.exports}var Ho={},Yn={},gu;function W2(){if(gu)return Yn;gu=1,Object.defineProperty(Yn,"__esModule",{value:!0}),Yn.IKeyValueStorage=void 0;class t{}return Yn.IKeyValueStorage=t,Yn}var Zn={},mu;function q2(){if(mu)return Zn;mu=1,Object.defineProperty(Zn,"__esModule",{value:!0}),Zn.parseEntry=void 0;const t=Kn;function e(r){var n;return[r[0],t.safeJsonParse((n=r[1])!==null&&n!==void 0?n:"")]}return Zn.parseEntry=e,Zn}var wu;function V2(){return wu||(wu=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=fu;e.__exportStar(W2(),t),e.__exportStar(q2(),t)}(Ho)),Ho}Object.defineProperty(ns,"__esModule",{value:!0}),ns.KeyValueStorage=void 0;const fn=fu,yu=Kn,K2=fn.__importDefault(z2()),G2=V2();class bu{constructor(){this.localStorage=K2.default}getKeys(){return fn.__awaiter(this,void 0,void 0,function*(){return Object.keys(this.localStorage)})}getEntries(){return fn.__awaiter(this,void 0,void 0,function*(){return Object.entries(this.localStorage).map(G2.parseEntry)})}getItem(e){return fn.__awaiter(this,void 0,void 0,function*(){const r=this.localStorage.getItem(e);if(r!==null)return yu.safeJsonParse(r)})}setItem(e,r){return fn.__awaiter(this,void 0,void 0,function*(){this.localStorage.setItem(e,yu.safeJsonStringify(r))})}removeItem(e){return fn.__awaiter(this,void 0,void 0,function*(){this.localStorage.removeItem(e)})}}ns.KeyValueStorage=bu;var Y2=ns.default=bu,Jn={};/*! *****************************************************************************
28
28
  Copyright (c) Microsoft Corporation.
29
29
 
30
30
  Permission to use, copy, modify, and/or distribute this software for any
@@ -37,7 +37,7 @@
37
37
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
38
38
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
39
39
  PERFORMANCE OF THIS SOFTWARE.
40
- ***************************************************************************** */var Ma=function(t,e){return Ma=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)n.hasOwnProperty(i)&&(r[i]=n[i])},Ma(t,e)};function rb(t,e){Ma(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var Ua=function(){return Ua=Object.assign||function(e){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e},Ua.apply(this,arguments)};function nb(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r}function ib(t,e,r,n){var i=arguments.length,o=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,r,o):s(e,r))||o);return i>3&&o&&Object.defineProperty(e,r,o),o}function ob(t,e){return function(r,n){e(r,n,t)}}function sb(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function ab(t,e,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(d){try{u(n.next(d))}catch(y){s(y)}}function l(d){try{u(n.throw(d))}catch(y){s(y)}}function u(d){d.done?o(d.value):i(d.value).then(a,l)}u((n=n.apply(t,e||[])).next())})}function cb(t,e){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,s;return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(u){return function(d){return l([u,d])}}function l(u){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(o=u[0]&2?i.return:u[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,u[1])).done)return o;switch(i=0,o&&(u=[u[0]&2,o.value]),u[0]){case 0:case 1:o=u;break;case 4:return r.label++,{value:u[1],done:!1};case 5:r.label++,i=u[1],u=[0];continue;case 7:u=r.ops.pop(),r.trys.pop();continue;default:if(o=r.trys,!(o=o.length>0&&o[o.length-1])&&(u[0]===6||u[0]===2)){r=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[1]<o[3])){r.label=u[1];break}if(u[0]===6&&r.label<o[1]){r.label=o[1],o=u;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(u);break}o[2]&&r.ops.pop(),r.trys.pop();continue}u=e.call(t,r)}catch(d){u=[6,d],i=0}finally{n=o=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}function lb(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}function ub(t,e){for(var r in t)r!=="default"&&!e.hasOwnProperty(r)&&(e[r]=t[r])}function Ba(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function m0(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,o=[],s;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(a){s={error:a}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(s)throw s.error}}return o}function hb(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(m0(arguments[e]));return t}function fb(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;for(var n=Array(t),i=0,e=0;e<r;e++)for(var o=arguments[e],s=0,a=o.length;s<a;s++,i++)n[i]=o[s];return n}function _i(t){return this instanceof _i?(this.v=t,this):new _i(t)}function db(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(t,e||[]),i,o=[];return i={},s("next"),s("throw"),s("return"),i[Symbol.asyncIterator]=function(){return this},i;function s(m){n[m]&&(i[m]=function(v){return new Promise(function(_,R){o.push([m,v,_,R])>1||a(m,v)})})}function a(m,v){try{l(n[m](v))}catch(_){y(o[0][3],_)}}function l(m){m.value instanceof _i?Promise.resolve(m.value.v).then(u,d):y(o[0][2],m)}function u(m){a("next",m)}function d(m){a("throw",m)}function y(m,v){m(v),o.shift(),o.length&&a(o[0][0],o[0][1])}}function pb(t){var e,r;return e={},n("next"),n("throw",function(i){throw i}),n("return"),e[Symbol.iterator]=function(){return this},e;function n(i,o){e[i]=t[i]?function(s){return(r=!r)?{value:_i(t[i](s)),done:i==="return"}:o?o(s):s}:o}}function gb(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof Ba=="function"?Ba(t):t[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(o){r[o]=t[o]&&function(s){return new Promise(function(a,l){s=t[o](s),i(a,l,s.done,s.value)})}}function i(o,s,a,l){Promise.resolve(l).then(function(u){o({value:u,done:a})},s)}}function mb(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function bb(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}function yb(t){return t&&t.__esModule?t:{default:t}}function wb(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}function vb(t,e,r){if(!e.has(t))throw new TypeError("attempted to set private field on non-instance");return e.set(t,r),r}var _b=Object.freeze({__proto__:null,__extends:rb,get __assign(){return Ua},__rest:nb,__decorate:ib,__param:ob,__metadata:sb,__awaiter:ab,__generator:cb,__createBinding:lb,__exportStar:ub,__values:Ba,__read:m0,__spread:hb,__spreadArrays:fb,__await:_i,__asyncGenerator:db,__asyncDelegator:pb,__asyncValues:gb,__makeTemplateObject:mb,__importStar:bb,__importDefault:yb,__classPrivateFieldGet:wb,__classPrivateFieldSet:vb}),Go=Yr(_b),Ei={},ja={},xi={};class tn{}var Eb=Object.freeze({__proto__:null,IEvents:tn}),xb=Yr(Eb),b0;function Cb(){if(b0)return xi;b0=1,Object.defineProperty(xi,"__esModule",{value:!0}),xi.IHeartBeat=void 0;const t=xb;class e extends t.IEvents{constructor(n){super()}}return xi.IHeartBeat=e,xi}var y0;function w0(){return y0||(y0=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),Go.__exportStar(Cb(),t)}(ja)),ja}var ka={},rn={},v0;function Sb(){if(v0)return rn;v0=1,Object.defineProperty(rn,"__esModule",{value:!0}),rn.HEARTBEAT_EVENTS=rn.HEARTBEAT_INTERVAL=void 0;const t=Fe;return rn.HEARTBEAT_INTERVAL=t.FIVE_SECONDS,rn.HEARTBEAT_EVENTS={pulse:"heartbeat_pulse"},rn}var _0;function E0(){return _0||(_0=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),Go.__exportStar(Sb(),t)}(ka)),ka}var x0;function Ab(){if(x0)return Ei;x0=1,Object.defineProperty(Ei,"__esModule",{value:!0}),Ei.HeartBeat=void 0;const t=Go,e=Dt.exports,r=Fe,n=w0(),i=E0();class o extends n.IHeartBeat{constructor(a){super(a),this.events=new e.EventEmitter,this.interval=i.HEARTBEAT_INTERVAL,this.interval=a?.interval||i.HEARTBEAT_INTERVAL}static init(a){return t.__awaiter(this,void 0,void 0,function*(){const l=new o(a);return yield l.init(),l})}init(){return t.__awaiter(this,void 0,void 0,function*(){yield this.initialize()})}stop(){clearInterval(this.intervalRef)}on(a,l){this.events.on(a,l)}once(a,l){this.events.once(a,l)}off(a,l){this.events.off(a,l)}removeListener(a,l){this.events.removeListener(a,l)}initialize(){return t.__awaiter(this,void 0,void 0,function*(){this.intervalRef=setInterval(()=>this.pulse(),r.toMiliseconds(this.interval))})}pulse(){this.events.emit(i.HEARTBEAT_EVENTS.pulse)}}return Ei.HeartBeat=o,Ei}(function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=Go;e.__exportStar(Ab(),t),e.__exportStar(w0(),t),e.__exportStar(E0(),t)})(vi);var ht={};/*! *****************************************************************************
40
+ ***************************************************************************** */var zo=function(t,e){return zo=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)n.hasOwnProperty(i)&&(r[i]=n[i])},zo(t,e)};function Z2(t,e){zo(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var Wo=function(){return Wo=Object.assign||function(e){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(e[s]=r[s])}return e},Wo.apply(this,arguments)};function J2(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r}function X2(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s}function Q2(t,e){return function(r,n){e(r,n,t)}}function e3(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function t3(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(p){try{l(n.next(p))}catch(w){o(w)}}function c(p){try{l(n.throw(p))}catch(w){o(w)}}function l(p){p.done?s(p.value):i(p.value).then(a,c)}l((n=n.apply(t,e||[])).next())})}function r3(t,e){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,i,s,o;return o={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(l){return function(p){return c([l,p])}}function c(l){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(s=l[0]&2?i.return:l[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,l[1])).done)return s;switch(i=0,s&&(l=[l[0]&2,s.value]),l[0]){case 0:case 1:s=l;break;case 4:return r.label++,{value:l[1],done:!1};case 5:r.label++,i=l[1],l=[0];continue;case 7:l=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(l[0]===6||l[0]===2)){r=0;continue}if(l[0]===3&&(!s||l[1]>s[0]&&l[1]<s[3])){r.label=l[1];break}if(l[0]===6&&r.label<s[1]){r.label=s[1],s=l;break}if(s&&r.label<s[2]){r.label=s[2],r.ops.push(l);break}s[2]&&r.ops.pop(),r.trys.pop();continue}l=e.call(t,r)}catch(p){l=[6,p],i=0}finally{n=s=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}function n3(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}function i3(t,e){for(var r in t)r!=="default"&&!e.hasOwnProperty(r)&&(e[r]=t[r])}function qo(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function vu(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,s=[],o;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(a){o={error:a}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}return s}function s3(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(vu(arguments[e]));return t}function o3(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;for(var n=Array(t),i=0,e=0;e<r;e++)for(var s=arguments[e],o=0,a=s.length;o<a;o++,i++)n[i]=s[o];return n}function Xn(t){return this instanceof Xn?(this.v=t,this):new Xn(t)}function a3(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(t,e||[]),i,s=[];return i={},o("next"),o("throw"),o("return"),i[Symbol.asyncIterator]=function(){return this},i;function o(y){n[y]&&(i[y]=function(m){return new Promise(function(E,A){s.push([y,m,E,A])>1||a(y,m)})})}function a(y,m){try{c(n[y](m))}catch(E){w(s[0][3],E)}}function c(y){y.value instanceof Xn?Promise.resolve(y.value.v).then(l,p):w(s[0][2],y)}function l(y){a("next",y)}function p(y){a("throw",y)}function w(y,m){y(m),s.shift(),s.length&&a(s[0][0],s[0][1])}}function c3(t){var e,r;return e={},n("next"),n("throw",function(i){throw i}),n("return"),e[Symbol.iterator]=function(){return this},e;function n(i,s){e[i]=t[i]?function(o){return(r=!r)?{value:Xn(t[i](o)),done:i==="return"}:s?s(o):o}:s}}function l3(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof qo=="function"?qo(t):t[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(s){r[s]=t[s]&&function(o){return new Promise(function(a,c){o=t[s](o),i(a,c,o.done,o.value)})}}function i(s,o,a,c){Promise.resolve(c).then(function(l){s({value:l,done:a})},o)}}function u3(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function h3(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}function d3(t){return t&&t.__esModule?t:{default:t}}function f3(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}function p3(t,e,r){if(!e.has(t))throw new TypeError("attempted to set private field on non-instance");return e.set(t,r),r}var g3=Object.freeze({__proto__:null,__extends:Z2,get __assign(){return Wo},__rest:J2,__decorate:X2,__param:Q2,__metadata:e3,__awaiter:t3,__generator:r3,__createBinding:n3,__exportStar:i3,__values:qo,__read:vu,__spread:s3,__spreadArrays:o3,__await:Xn,__asyncGenerator:a3,__asyncDelegator:c3,__asyncValues:l3,__makeTemplateObject:u3,__importStar:h3,__importDefault:d3,__classPrivateFieldGet:f3,__classPrivateFieldSet:p3}),is=$r(g3),Qn={},Vo={},ei={};class Mr{}var m3=Object.freeze({__proto__:null,IEvents:Mr}),w3=$r(m3),_u;function y3(){if(_u)return ei;_u=1,Object.defineProperty(ei,"__esModule",{value:!0}),ei.IHeartBeat=void 0;const t=w3;class e extends t.IEvents{constructor(n){super()}}return ei.IHeartBeat=e,ei}var Eu;function xu(){return Eu||(Eu=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),is.__exportStar(y3(),t)}(Vo)),Vo}var Ko={},Ur={},Cu;function b3(){if(Cu)return Ur;Cu=1,Object.defineProperty(Ur,"__esModule",{value:!0}),Ur.HEARTBEAT_EVENTS=Ur.HEARTBEAT_INTERVAL=void 0;const t=me;return Ur.HEARTBEAT_INTERVAL=t.FIVE_SECONDS,Ur.HEARTBEAT_EVENTS={pulse:"heartbeat_pulse"},Ur}var Su;function Iu(){return Su||(Su=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),is.__exportStar(b3(),t)}(Ko)),Ko}var Du;function v3(){if(Du)return Qn;Du=1,Object.defineProperty(Qn,"__esModule",{value:!0}),Qn.HeartBeat=void 0;const t=is,e=_t.exports,r=me,n=xu(),i=Iu();class s extends n.IHeartBeat{constructor(a){super(a),this.events=new e.EventEmitter,this.interval=i.HEARTBEAT_INTERVAL,this.interval=a?.interval||i.HEARTBEAT_INTERVAL}static init(a){return t.__awaiter(this,void 0,void 0,function*(){const c=new s(a);return yield c.init(),c})}init(){return t.__awaiter(this,void 0,void 0,function*(){yield this.initialize()})}stop(){clearInterval(this.intervalRef)}on(a,c){this.events.on(a,c)}once(a,c){this.events.once(a,c)}off(a,c){this.events.off(a,c)}removeListener(a,c){this.events.removeListener(a,c)}initialize(){return t.__awaiter(this,void 0,void 0,function*(){this.intervalRef=setInterval(()=>this.pulse(),r.toMiliseconds(this.interval))})}pulse(){this.events.emit(i.HEARTBEAT_EVENTS.pulse)}}return Qn.HeartBeat=s,Qn}(function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=is;e.__exportStar(v3(),t),e.__exportStar(xu(),t),e.__exportStar(Iu(),t)})(Jn);var je={};/*! *****************************************************************************
41
41
  Copyright (c) Microsoft Corporation.
42
42
 
43
43
  Permission to use, copy, modify, and/or distribute this software for any
@@ -50,7 +50,7 @@
50
50
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
51
51
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
52
52
  PERFORMANCE OF THIS SOFTWARE.
53
- ***************************************************************************** */var Ha=function(t,e){return Ha=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)n.hasOwnProperty(i)&&(r[i]=n[i])},Ha(t,e)};function Ib(t,e){Ha(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var za=function(){return za=Object.assign||function(e){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e},za.apply(this,arguments)};function Ob(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r}function Db(t,e,r,n){var i=arguments.length,o=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,r,o):s(e,r))||o);return i>3&&o&&Object.defineProperty(e,r,o),o}function $b(t,e){return function(r,n){e(r,n,t)}}function Fb(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function Pb(t,e,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(d){try{u(n.next(d))}catch(y){s(y)}}function l(d){try{u(n.throw(d))}catch(y){s(y)}}function u(d){d.done?o(d.value):i(d.value).then(a,l)}u((n=n.apply(t,e||[])).next())})}function Tb(t,e){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,s;return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(u){return function(d){return l([u,d])}}function l(u){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(o=u[0]&2?i.return:u[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,u[1])).done)return o;switch(i=0,o&&(u=[u[0]&2,o.value]),u[0]){case 0:case 1:o=u;break;case 4:return r.label++,{value:u[1],done:!1};case 5:r.label++,i=u[1],u=[0];continue;case 7:u=r.ops.pop(),r.trys.pop();continue;default:if(o=r.trys,!(o=o.length>0&&o[o.length-1])&&(u[0]===6||u[0]===2)){r=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[1]<o[3])){r.label=u[1];break}if(u[0]===6&&r.label<o[1]){r.label=o[1],o=u;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(u);break}o[2]&&r.ops.pop(),r.trys.pop();continue}u=e.call(t,r)}catch(d){u=[6,d],i=0}finally{n=o=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}function Nb(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}function Rb(t,e){for(var r in t)r!=="default"&&!e.hasOwnProperty(r)&&(e[r]=t[r])}function Wa(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function C0(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,o=[],s;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(a){s={error:a}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(s)throw s.error}}return o}function Lb(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(C0(arguments[e]));return t}function Mb(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;for(var n=Array(t),i=0,e=0;e<r;e++)for(var o=arguments[e],s=0,a=o.length;s<a;s++,i++)n[i]=o[s];return n}function Ci(t){return this instanceof Ci?(this.v=t,this):new Ci(t)}function Ub(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(t,e||[]),i,o=[];return i={},s("next"),s("throw"),s("return"),i[Symbol.asyncIterator]=function(){return this},i;function s(m){n[m]&&(i[m]=function(v){return new Promise(function(_,R){o.push([m,v,_,R])>1||a(m,v)})})}function a(m,v){try{l(n[m](v))}catch(_){y(o[0][3],_)}}function l(m){m.value instanceof Ci?Promise.resolve(m.value.v).then(u,d):y(o[0][2],m)}function u(m){a("next",m)}function d(m){a("throw",m)}function y(m,v){m(v),o.shift(),o.length&&a(o[0][0],o[0][1])}}function Bb(t){var e,r;return e={},n("next"),n("throw",function(i){throw i}),n("return"),e[Symbol.iterator]=function(){return this},e;function n(i,o){e[i]=t[i]?function(s){return(r=!r)?{value:Ci(t[i](s)),done:i==="return"}:o?o(s):s}:o}}function jb(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof Wa=="function"?Wa(t):t[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(o){r[o]=t[o]&&function(s){return new Promise(function(a,l){s=t[o](s),i(a,l,s.done,s.value)})}}function i(o,s,a,l){Promise.resolve(l).then(function(u){o({value:u,done:a})},s)}}function kb(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function Hb(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}function zb(t){return t&&t.__esModule?t:{default:t}}function Wb(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}function Vb(t,e,r){if(!e.has(t))throw new TypeError("attempted to set private field on non-instance");return e.set(t,r),r}var qb=Object.freeze({__proto__:null,__extends:Ib,get __assign(){return za},__rest:Ob,__decorate:Db,__param:$b,__metadata:Fb,__awaiter:Pb,__generator:Tb,__createBinding:Nb,__exportStar:Rb,__values:Wa,__read:C0,__spread:Lb,__spreadArrays:Mb,__await:Ci,__asyncGenerator:Ub,__asyncDelegator:Bb,__asyncValues:jb,__makeTemplateObject:kb,__importStar:Hb,__importDefault:zb,__classPrivateFieldGet:Wb,__classPrivateFieldSet:Vb}),Kb=Yr(qb),nn={},S0;function A0(){return S0||(S0=1,Object.defineProperty(nn,"__esModule",{value:!0}),nn.PINO_CUSTOM_CONTEXT_KEY=nn.PINO_LOGGER_DEFAULTS=void 0,nn.PINO_LOGGER_DEFAULTS={level:"info"},nn.PINO_CUSTOM_CONTEXT_KEY="custom_context"),nn}var Ht={},I0;function Gb(){if(I0)return Ht;I0=1,Object.defineProperty(Ht,"__esModule",{value:!0}),Ht.generateChildLogger=Ht.formatChildLoggerContext=Ht.getLoggerContext=Ht.setBrowserLoggerContext=Ht.getBrowserLoggerContext=Ht.getDefaultLoggerOptions=void 0;const t=A0();function e(a){return Object.assign(Object.assign({},a),{level:a?.level||t.PINO_LOGGER_DEFAULTS.level})}Ht.getDefaultLoggerOptions=e;function r(a,l=t.PINO_CUSTOM_CONTEXT_KEY){return a[l]||""}Ht.getBrowserLoggerContext=r;function n(a,l,u=t.PINO_CUSTOM_CONTEXT_KEY){return a[u]=l,a}Ht.setBrowserLoggerContext=n;function i(a,l=t.PINO_CUSTOM_CONTEXT_KEY){let u="";return typeof a.bindings>"u"?u=r(a,l):u=a.bindings().context||"",u}Ht.getLoggerContext=i;function o(a,l,u=t.PINO_CUSTOM_CONTEXT_KEY){const d=i(a,u);return d.trim()?`${d}/${l}`:l}Ht.formatChildLoggerContext=o;function s(a,l,u=t.PINO_CUSTOM_CONTEXT_KEY){const d=o(a,l,u),y=a.child({context:d});return n(y,d,u)}return Ht.generateChildLogger=s,Ht}(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.pino=void 0;const e=Kb,r=e.__importDefault(fi);Object.defineProperty(t,"pino",{enumerable:!0,get:function(){return r.default}}),e.__exportStar(A0(),t),e.__exportStar(Gb(),t)})(ht);class Yb extends tn{constructor(e){super(),this.opts=e,this.protocol="wc",this.version=2}}class Zb extends tn{constructor(e,r){super(),this.core=e,this.logger=r,this.records=new Map}}class Jb{constructor(e,r){this.logger=e,this.core=r}}class Xb extends tn{constructor(e,r){super(),this.relayer=e,this.logger=r}}class Qb extends tn{constructor(e){super()}}class e6{constructor(e,r,n,i){this.core=e,this.logger=r,this.name=n}}class t6 extends tn{constructor(e,r){super(),this.relayer=e,this.logger=r}}class r6 extends tn{constructor(e,r){super(),this.core=e,this.logger=r}}class n6{constructor(e){this.opts=e,this.protocol="wc",this.version=2}}class i6{constructor(e){this.client=e}}function Va(t){if(typeof t!="string")throw new Error(`Cannot safe json parse value of type ${typeof t}`);try{return JSON.parse(t)}catch{return t}}function Si(t){return typeof t=="string"?t:JSON.stringify(t)}var qa={},O0={};(function(t){Object.defineProperty(t,"__esModule",{value:!0});var e=ke,r=rr;t.DIGEST_LENGTH=64,t.BLOCK_SIZE=128;var n=function(){function a(){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 a.prototype._initState=function(){this._stateHi[0]=1779033703,this._stateHi[1]=3144134277,this._stateHi[2]=1013904242,this._stateHi[3]=2773480762,this._stateHi[4]=1359893119,this._stateHi[5]=2600822924,this._stateHi[6]=528734635,this._stateHi[7]=1541459225,this._stateLo[0]=4089235720,this._stateLo[1]=2227873595,this._stateLo[2]=4271175723,this._stateLo[3]=1595750129,this._stateLo[4]=2917565137,this._stateLo[5]=725511199,this._stateLo[6]=4215389547,this._stateLo[7]=327033209},a.prototype.reset=function(){return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this},a.prototype.clean=function(){r.wipe(this._buffer),r.wipe(this._tempHi),r.wipe(this._tempLo),this.reset()},a.prototype.update=function(l,u){if(u===void 0&&(u=l.length),this._finished)throw new Error("SHA512: can't update because hash was finished.");var d=0;if(this._bytesHashed+=u,this._bufferLength>0){for(;this._bufferLength<t.BLOCK_SIZE&&u>0;)this._buffer[this._bufferLength++]=l[d++],u--;this._bufferLength===this.blockSize&&(o(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,this.blockSize),this._bufferLength=0)}for(u>=this.blockSize&&(d=o(this._tempHi,this._tempLo,this._stateHi,this._stateLo,l,d,u),u%=this.blockSize);u>0;)this._buffer[this._bufferLength++]=l[d++],u--;return this},a.prototype.finish=function(l){if(!this._finished){var u=this._bytesHashed,d=this._bufferLength,y=u/536870912|0,m=u<<3,v=u%128<112?128:256;this._buffer[d]=128;for(var _=d+1;_<v-8;_++)this._buffer[_]=0;e.writeUint32BE(y,this._buffer,v-8),e.writeUint32BE(m,this._buffer,v-4),o(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,v),this._finished=!0}for(var _=0;_<this.digestLength/8;_++)e.writeUint32BE(this._stateHi[_],l,_*8),e.writeUint32BE(this._stateLo[_],l,_*8+4);return this},a.prototype.digest=function(){var l=new Uint8Array(this.digestLength);return this.finish(l),l},a.prototype.saveState=function(){if(this._finished)throw new Error("SHA256: cannot save finished state");return{stateHi:new Int32Array(this._stateHi),stateLo:new Int32Array(this._stateLo),buffer:this._bufferLength>0?new Uint8Array(this._buffer):void 0,bufferLength:this._bufferLength,bytesHashed:this._bytesHashed}},a.prototype.restoreState=function(l){return this._stateHi.set(l.stateHi),this._stateLo.set(l.stateLo),this._bufferLength=l.bufferLength,l.buffer&&this._buffer.set(l.buffer),this._bytesHashed=l.bytesHashed,this._finished=!1,this},a.prototype.cleanSavedState=function(l){r.wipe(l.stateHi),r.wipe(l.stateLo),l.buffer&&r.wipe(l.buffer),l.bufferLength=0,l.bytesHashed=0},a}();t.SHA512=n;var i=new Int32Array([1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591]);function o(a,l,u,d,y,m,v){for(var _=u[0],R=u[1],M=u[2],B=u[3],D=u[4],N=u[5],C=u[6],$=u[7],P=d[0],h=d[1],S=d[2],q=d[3],z=d[4],Y=d[5],re=d[6],ie=d[7],E,O,Z,J,H,j,W,V;v>=128;){for(var ce=0;ce<16;ce++){var te=8*ce+m;a[ce]=e.readUint32BE(y,te),l[ce]=e.readUint32BE(y,te+4)}for(var ce=0;ce<80;ce++){var Ce=_,ne=R,Oe=M,T=B,F=D,I=N,c=C,w=$,G=P,Q=h,he=S,be=q,pe=z,ye=Y,ze=re,Ue=ie;if(E=$,O=ie,H=O&65535,j=O>>>16,W=E&65535,V=E>>>16,E=(D>>>14|z<<32-14)^(D>>>18|z<<32-18)^(z>>>41-32|D<<32-(41-32)),O=(z>>>14|D<<32-14)^(z>>>18|D<<32-18)^(D>>>41-32|z<<32-(41-32)),H+=O&65535,j+=O>>>16,W+=E&65535,V+=E>>>16,E=D&N^~D&C,O=z&Y^~z&re,H+=O&65535,j+=O>>>16,W+=E&65535,V+=E>>>16,E=i[ce*2],O=i[ce*2+1],H+=O&65535,j+=O>>>16,W+=E&65535,V+=E>>>16,E=a[ce%16],O=l[ce%16],H+=O&65535,j+=O>>>16,W+=E&65535,V+=E>>>16,j+=H>>>16,W+=j>>>16,V+=W>>>16,Z=W&65535|V<<16,J=H&65535|j<<16,E=Z,O=J,H=O&65535,j=O>>>16,W=E&65535,V=E>>>16,E=(_>>>28|P<<32-28)^(P>>>34-32|_<<32-(34-32))^(P>>>39-32|_<<32-(39-32)),O=(P>>>28|_<<32-28)^(_>>>34-32|P<<32-(34-32))^(_>>>39-32|P<<32-(39-32)),H+=O&65535,j+=O>>>16,W+=E&65535,V+=E>>>16,E=_&R^_&M^R&M,O=P&h^P&S^h&S,H+=O&65535,j+=O>>>16,W+=E&65535,V+=E>>>16,j+=H>>>16,W+=j>>>16,V+=W>>>16,w=W&65535|V<<16,Ue=H&65535|j<<16,E=T,O=be,H=O&65535,j=O>>>16,W=E&65535,V=E>>>16,E=Z,O=J,H+=O&65535,j+=O>>>16,W+=E&65535,V+=E>>>16,j+=H>>>16,W+=j>>>16,V+=W>>>16,T=W&65535|V<<16,be=H&65535|j<<16,R=Ce,M=ne,B=Oe,D=T,N=F,C=I,$=c,_=w,h=G,S=Q,q=he,z=be,Y=pe,re=ye,ie=ze,P=Ue,ce%16===15)for(var te=0;te<16;te++)E=a[te],O=l[te],H=O&65535,j=O>>>16,W=E&65535,V=E>>>16,E=a[(te+9)%16],O=l[(te+9)%16],H+=O&65535,j+=O>>>16,W+=E&65535,V+=E>>>16,Z=a[(te+1)%16],J=l[(te+1)%16],E=(Z>>>1|J<<32-1)^(Z>>>8|J<<32-8)^Z>>>7,O=(J>>>1|Z<<32-1)^(J>>>8|Z<<32-8)^(J>>>7|Z<<32-7),H+=O&65535,j+=O>>>16,W+=E&65535,V+=E>>>16,Z=a[(te+14)%16],J=l[(te+14)%16],E=(Z>>>19|J<<32-19)^(J>>>61-32|Z<<32-(61-32))^Z>>>6,O=(J>>>19|Z<<32-19)^(Z>>>61-32|J<<32-(61-32))^(J>>>6|Z<<32-6),H+=O&65535,j+=O>>>16,W+=E&65535,V+=E>>>16,j+=H>>>16,W+=j>>>16,V+=W>>>16,a[te]=W&65535|V<<16,l[te]=H&65535|j<<16}E=_,O=P,H=O&65535,j=O>>>16,W=E&65535,V=E>>>16,E=u[0],O=d[0],H+=O&65535,j+=O>>>16,W+=E&65535,V+=E>>>16,j+=H>>>16,W+=j>>>16,V+=W>>>16,u[0]=_=W&65535|V<<16,d[0]=P=H&65535|j<<16,E=R,O=h,H=O&65535,j=O>>>16,W=E&65535,V=E>>>16,E=u[1],O=d[1],H+=O&65535,j+=O>>>16,W+=E&65535,V+=E>>>16,j+=H>>>16,W+=j>>>16,V+=W>>>16,u[1]=R=W&65535|V<<16,d[1]=h=H&65535|j<<16,E=M,O=S,H=O&65535,j=O>>>16,W=E&65535,V=E>>>16,E=u[2],O=d[2],H+=O&65535,j+=O>>>16,W+=E&65535,V+=E>>>16,j+=H>>>16,W+=j>>>16,V+=W>>>16,u[2]=M=W&65535|V<<16,d[2]=S=H&65535|j<<16,E=B,O=q,H=O&65535,j=O>>>16,W=E&65535,V=E>>>16,E=u[3],O=d[3],H+=O&65535,j+=O>>>16,W+=E&65535,V+=E>>>16,j+=H>>>16,W+=j>>>16,V+=W>>>16,u[3]=B=W&65535|V<<16,d[3]=q=H&65535|j<<16,E=D,O=z,H=O&65535,j=O>>>16,W=E&65535,V=E>>>16,E=u[4],O=d[4],H+=O&65535,j+=O>>>16,W+=E&65535,V+=E>>>16,j+=H>>>16,W+=j>>>16,V+=W>>>16,u[4]=D=W&65535|V<<16,d[4]=z=H&65535|j<<16,E=N,O=Y,H=O&65535,j=O>>>16,W=E&65535,V=E>>>16,E=u[5],O=d[5],H+=O&65535,j+=O>>>16,W+=E&65535,V+=E>>>16,j+=H>>>16,W+=j>>>16,V+=W>>>16,u[5]=N=W&65535|V<<16,d[5]=Y=H&65535|j<<16,E=C,O=re,H=O&65535,j=O>>>16,W=E&65535,V=E>>>16,E=u[6],O=d[6],H+=O&65535,j+=O>>>16,W+=E&65535,V+=E>>>16,j+=H>>>16,W+=j>>>16,V+=W>>>16,u[6]=C=W&65535|V<<16,d[6]=re=H&65535|j<<16,E=$,O=ie,H=O&65535,j=O>>>16,W=E&65535,V=E>>>16,E=u[7],O=d[7],H+=O&65535,j+=O>>>16,W+=E&65535,V+=E>>>16,j+=H>>>16,W+=j>>>16,V+=W>>>16,u[7]=$=W&65535|V<<16,d[7]=ie=H&65535|j<<16,m+=128,v-=128}return m}function s(a){var l=new n;l.update(a);var u=l.digest();return l.clean(),u}t.hash=s})(O0),function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.convertSecretKeyToX25519=t.convertPublicKeyToX25519=t.verify=t.sign=t.extractPublicKeyFromSecretKey=t.generateKeyPair=t.generateKeyPairFromSeed=t.SEED_LENGTH=t.SECRET_KEY_LENGTH=t.PUBLIC_KEY_LENGTH=t.SIGNATURE_LENGTH=void 0;const e=In,r=O0,n=rr;t.SIGNATURE_LENGTH=64,t.PUBLIC_KEY_LENGTH=32,t.SECRET_KEY_LENGTH=64,t.SEED_LENGTH=32;function i(T){const F=new Float64Array(16);if(T)for(let I=0;I<T.length;I++)F[I]=T[I];return F}const o=new Uint8Array(32);o[0]=9;const s=i(),a=i([1]),l=i([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),u=i([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),d=i([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),y=i([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),m=i([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function v(T,F){for(let I=0;I<16;I++)T[I]=F[I]|0}function _(T){let F=1;for(let I=0;I<16;I++){let c=T[I]+F+65535;F=Math.floor(c/65536),T[I]=c-F*65536}T[0]+=F-1+37*(F-1)}function R(T,F,I){const c=~(I-1);for(let w=0;w<16;w++){const G=c&(T[w]^F[w]);T[w]^=G,F[w]^=G}}function M(T,F){const I=i(),c=i();for(let w=0;w<16;w++)c[w]=F[w];_(c),_(c),_(c);for(let w=0;w<2;w++){I[0]=c[0]-65517;for(let Q=1;Q<15;Q++)I[Q]=c[Q]-65535-(I[Q-1]>>16&1),I[Q-1]&=65535;I[15]=c[15]-32767-(I[14]>>16&1);const G=I[15]>>16&1;I[14]&=65535,R(c,I,1-G)}for(let w=0;w<16;w++)T[2*w]=c[w]&255,T[2*w+1]=c[w]>>8}function B(T,F){let I=0;for(let c=0;c<32;c++)I|=T[c]^F[c];return(1&I-1>>>8)-1}function D(T,F){const I=new Uint8Array(32),c=new Uint8Array(32);return M(I,T),M(c,F),B(I,c)}function N(T){const F=new Uint8Array(32);return M(F,T),F[0]&1}function C(T,F){for(let I=0;I<16;I++)T[I]=F[2*I]+(F[2*I+1]<<8);T[15]&=32767}function $(T,F,I){for(let c=0;c<16;c++)T[c]=F[c]+I[c]}function P(T,F,I){for(let c=0;c<16;c++)T[c]=F[c]-I[c]}function h(T,F,I){let c,w,G=0,Q=0,he=0,be=0,pe=0,ye=0,ze=0,Ue=0,xe=0,Ee=0,ge=0,we=0,ve=0,fe=0,me=0,b=0,f=0,p=0,A=0,L=0,k=0,K=0,se=0,de=0,De=0,Be=0,Pe=0,pt=0,Vt=0,dr=0,$r=0,We=I[0],Te=I[1],Ve=I[2],qe=I[3],Ke=I[4],Ne=I[5],Xe=I[6],Qe=I[7],et=I[8],tt=I[9],rt=I[10],Ze=I[11],Ge=I[12],Ae=I[13],nt=I[14],it=I[15];c=F[0],G+=c*We,Q+=c*Te,he+=c*Ve,be+=c*qe,pe+=c*Ke,ye+=c*Ne,ze+=c*Xe,Ue+=c*Qe,xe+=c*et,Ee+=c*tt,ge+=c*rt,we+=c*Ze,ve+=c*Ge,fe+=c*Ae,me+=c*nt,b+=c*it,c=F[1],Q+=c*We,he+=c*Te,be+=c*Ve,pe+=c*qe,ye+=c*Ke,ze+=c*Ne,Ue+=c*Xe,xe+=c*Qe,Ee+=c*et,ge+=c*tt,we+=c*rt,ve+=c*Ze,fe+=c*Ge,me+=c*Ae,b+=c*nt,f+=c*it,c=F[2],he+=c*We,be+=c*Te,pe+=c*Ve,ye+=c*qe,ze+=c*Ke,Ue+=c*Ne,xe+=c*Xe,Ee+=c*Qe,ge+=c*et,we+=c*tt,ve+=c*rt,fe+=c*Ze,me+=c*Ge,b+=c*Ae,f+=c*nt,p+=c*it,c=F[3],be+=c*We,pe+=c*Te,ye+=c*Ve,ze+=c*qe,Ue+=c*Ke,xe+=c*Ne,Ee+=c*Xe,ge+=c*Qe,we+=c*et,ve+=c*tt,fe+=c*rt,me+=c*Ze,b+=c*Ge,f+=c*Ae,p+=c*nt,A+=c*it,c=F[4],pe+=c*We,ye+=c*Te,ze+=c*Ve,Ue+=c*qe,xe+=c*Ke,Ee+=c*Ne,ge+=c*Xe,we+=c*Qe,ve+=c*et,fe+=c*tt,me+=c*rt,b+=c*Ze,f+=c*Ge,p+=c*Ae,A+=c*nt,L+=c*it,c=F[5],ye+=c*We,ze+=c*Te,Ue+=c*Ve,xe+=c*qe,Ee+=c*Ke,ge+=c*Ne,we+=c*Xe,ve+=c*Qe,fe+=c*et,me+=c*tt,b+=c*rt,f+=c*Ze,p+=c*Ge,A+=c*Ae,L+=c*nt,k+=c*it,c=F[6],ze+=c*We,Ue+=c*Te,xe+=c*Ve,Ee+=c*qe,ge+=c*Ke,we+=c*Ne,ve+=c*Xe,fe+=c*Qe,me+=c*et,b+=c*tt,f+=c*rt,p+=c*Ze,A+=c*Ge,L+=c*Ae,k+=c*nt,K+=c*it,c=F[7],Ue+=c*We,xe+=c*Te,Ee+=c*Ve,ge+=c*qe,we+=c*Ke,ve+=c*Ne,fe+=c*Xe,me+=c*Qe,b+=c*et,f+=c*tt,p+=c*rt,A+=c*Ze,L+=c*Ge,k+=c*Ae,K+=c*nt,se+=c*it,c=F[8],xe+=c*We,Ee+=c*Te,ge+=c*Ve,we+=c*qe,ve+=c*Ke,fe+=c*Ne,me+=c*Xe,b+=c*Qe,f+=c*et,p+=c*tt,A+=c*rt,L+=c*Ze,k+=c*Ge,K+=c*Ae,se+=c*nt,de+=c*it,c=F[9],Ee+=c*We,ge+=c*Te,we+=c*Ve,ve+=c*qe,fe+=c*Ke,me+=c*Ne,b+=c*Xe,f+=c*Qe,p+=c*et,A+=c*tt,L+=c*rt,k+=c*Ze,K+=c*Ge,se+=c*Ae,de+=c*nt,De+=c*it,c=F[10],ge+=c*We,we+=c*Te,ve+=c*Ve,fe+=c*qe,me+=c*Ke,b+=c*Ne,f+=c*Xe,p+=c*Qe,A+=c*et,L+=c*tt,k+=c*rt,K+=c*Ze,se+=c*Ge,de+=c*Ae,De+=c*nt,Be+=c*it,c=F[11],we+=c*We,ve+=c*Te,fe+=c*Ve,me+=c*qe,b+=c*Ke,f+=c*Ne,p+=c*Xe,A+=c*Qe,L+=c*et,k+=c*tt,K+=c*rt,se+=c*Ze,de+=c*Ge,De+=c*Ae,Be+=c*nt,Pe+=c*it,c=F[12],ve+=c*We,fe+=c*Te,me+=c*Ve,b+=c*qe,f+=c*Ke,p+=c*Ne,A+=c*Xe,L+=c*Qe,k+=c*et,K+=c*tt,se+=c*rt,de+=c*Ze,De+=c*Ge,Be+=c*Ae,Pe+=c*nt,pt+=c*it,c=F[13],fe+=c*We,me+=c*Te,b+=c*Ve,f+=c*qe,p+=c*Ke,A+=c*Ne,L+=c*Xe,k+=c*Qe,K+=c*et,se+=c*tt,de+=c*rt,De+=c*Ze,Be+=c*Ge,Pe+=c*Ae,pt+=c*nt,Vt+=c*it,c=F[14],me+=c*We,b+=c*Te,f+=c*Ve,p+=c*qe,A+=c*Ke,L+=c*Ne,k+=c*Xe,K+=c*Qe,se+=c*et,de+=c*tt,De+=c*rt,Be+=c*Ze,Pe+=c*Ge,pt+=c*Ae,Vt+=c*nt,dr+=c*it,c=F[15],b+=c*We,f+=c*Te,p+=c*Ve,A+=c*qe,L+=c*Ke,k+=c*Ne,K+=c*Xe,se+=c*Qe,de+=c*et,De+=c*tt,Be+=c*rt,Pe+=c*Ze,pt+=c*Ge,Vt+=c*Ae,dr+=c*nt,$r+=c*it,G+=38*f,Q+=38*p,he+=38*A,be+=38*L,pe+=38*k,ye+=38*K,ze+=38*se,Ue+=38*de,xe+=38*De,Ee+=38*Be,ge+=38*Pe,we+=38*pt,ve+=38*Vt,fe+=38*dr,me+=38*$r,w=1,c=G+w+65535,w=Math.floor(c/65536),G=c-w*65536,c=Q+w+65535,w=Math.floor(c/65536),Q=c-w*65536,c=he+w+65535,w=Math.floor(c/65536),he=c-w*65536,c=be+w+65535,w=Math.floor(c/65536),be=c-w*65536,c=pe+w+65535,w=Math.floor(c/65536),pe=c-w*65536,c=ye+w+65535,w=Math.floor(c/65536),ye=c-w*65536,c=ze+w+65535,w=Math.floor(c/65536),ze=c-w*65536,c=Ue+w+65535,w=Math.floor(c/65536),Ue=c-w*65536,c=xe+w+65535,w=Math.floor(c/65536),xe=c-w*65536,c=Ee+w+65535,w=Math.floor(c/65536),Ee=c-w*65536,c=ge+w+65535,w=Math.floor(c/65536),ge=c-w*65536,c=we+w+65535,w=Math.floor(c/65536),we=c-w*65536,c=ve+w+65535,w=Math.floor(c/65536),ve=c-w*65536,c=fe+w+65535,w=Math.floor(c/65536),fe=c-w*65536,c=me+w+65535,w=Math.floor(c/65536),me=c-w*65536,c=b+w+65535,w=Math.floor(c/65536),b=c-w*65536,G+=w-1+37*(w-1),w=1,c=G+w+65535,w=Math.floor(c/65536),G=c-w*65536,c=Q+w+65535,w=Math.floor(c/65536),Q=c-w*65536,c=he+w+65535,w=Math.floor(c/65536),he=c-w*65536,c=be+w+65535,w=Math.floor(c/65536),be=c-w*65536,c=pe+w+65535,w=Math.floor(c/65536),pe=c-w*65536,c=ye+w+65535,w=Math.floor(c/65536),ye=c-w*65536,c=ze+w+65535,w=Math.floor(c/65536),ze=c-w*65536,c=Ue+w+65535,w=Math.floor(c/65536),Ue=c-w*65536,c=xe+w+65535,w=Math.floor(c/65536),xe=c-w*65536,c=Ee+w+65535,w=Math.floor(c/65536),Ee=c-w*65536,c=ge+w+65535,w=Math.floor(c/65536),ge=c-w*65536,c=we+w+65535,w=Math.floor(c/65536),we=c-w*65536,c=ve+w+65535,w=Math.floor(c/65536),ve=c-w*65536,c=fe+w+65535,w=Math.floor(c/65536),fe=c-w*65536,c=me+w+65535,w=Math.floor(c/65536),me=c-w*65536,c=b+w+65535,w=Math.floor(c/65536),b=c-w*65536,G+=w-1+37*(w-1),T[0]=G,T[1]=Q,T[2]=he,T[3]=be,T[4]=pe,T[5]=ye,T[6]=ze,T[7]=Ue,T[8]=xe,T[9]=Ee,T[10]=ge,T[11]=we,T[12]=ve,T[13]=fe,T[14]=me,T[15]=b}function S(T,F){h(T,F,F)}function q(T,F){const I=i();let c;for(c=0;c<16;c++)I[c]=F[c];for(c=253;c>=0;c--)S(I,I),c!==2&&c!==4&&h(I,I,F);for(c=0;c<16;c++)T[c]=I[c]}function z(T,F){const I=i();let c;for(c=0;c<16;c++)I[c]=F[c];for(c=250;c>=0;c--)S(I,I),c!==1&&h(I,I,F);for(c=0;c<16;c++)T[c]=I[c]}function Y(T,F){const I=i(),c=i(),w=i(),G=i(),Q=i(),he=i(),be=i(),pe=i(),ye=i();P(I,T[1],T[0]),P(ye,F[1],F[0]),h(I,I,ye),$(c,T[0],T[1]),$(ye,F[0],F[1]),h(c,c,ye),h(w,T[3],F[3]),h(w,w,u),h(G,T[2],F[2]),$(G,G,G),P(Q,c,I),P(he,G,w),$(be,G,w),$(pe,c,I),h(T[0],Q,he),h(T[1],pe,be),h(T[2],be,he),h(T[3],Q,pe)}function re(T,F,I){for(let c=0;c<4;c++)R(T[c],F[c],I)}function ie(T,F){const I=i(),c=i(),w=i();q(w,F[2]),h(I,F[0],w),h(c,F[1],w),M(T,c),T[31]^=N(I)<<7}function E(T,F,I){v(T[0],s),v(T[1],a),v(T[2],a),v(T[3],s);for(let c=255;c>=0;--c){const w=I[c/8|0]>>(c&7)&1;re(T,F,w),Y(F,T),Y(T,T),re(T,F,w)}}function O(T,F){const I=[i(),i(),i(),i()];v(I[0],d),v(I[1],y),v(I[2],a),h(I[3],d,y),E(T,I,F)}function Z(T){if(T.length!==t.SEED_LENGTH)throw new Error(`ed25519: seed must be ${t.SEED_LENGTH} bytes`);const F=(0,r.hash)(T);F[0]&=248,F[31]&=127,F[31]|=64;const I=new Uint8Array(32),c=[i(),i(),i(),i()];O(c,F),ie(I,c);const w=new Uint8Array(64);return w.set(T),w.set(I,32),{publicKey:I,secretKey:w}}t.generateKeyPairFromSeed=Z;function J(T){const F=(0,e.randomBytes)(32,T),I=Z(F);return(0,n.wipe)(F),I}t.generateKeyPair=J;function H(T){if(T.length!==t.SECRET_KEY_LENGTH)throw new Error(`ed25519: secret key must be ${t.SECRET_KEY_LENGTH} bytes`);return new Uint8Array(T.subarray(32))}t.extractPublicKeyFromSecretKey=H;const j=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 W(T,F){let I,c,w,G;for(c=63;c>=32;--c){for(I=0,w=c-32,G=c-12;w<G;++w)F[w]+=I-16*F[c]*j[w-(c-32)],I=Math.floor((F[w]+128)/256),F[w]-=I*256;F[w]+=I,F[c]=0}for(I=0,w=0;w<32;w++)F[w]+=I-(F[31]>>4)*j[w],I=F[w]>>8,F[w]&=255;for(w=0;w<32;w++)F[w]-=I*j[w];for(c=0;c<32;c++)F[c+1]+=F[c]>>8,T[c]=F[c]&255}function V(T){const F=new Float64Array(64);for(let I=0;I<64;I++)F[I]=T[I];for(let I=0;I<64;I++)T[I]=0;W(T,F)}function ce(T,F){const I=new Float64Array(64),c=[i(),i(),i(),i()],w=(0,r.hash)(T.subarray(0,32));w[0]&=248,w[31]&=127,w[31]|=64;const G=new Uint8Array(64);G.set(w.subarray(32),32);const Q=new r.SHA512;Q.update(G.subarray(32)),Q.update(F);const he=Q.digest();Q.clean(),V(he),O(c,he),ie(G,c),Q.reset(),Q.update(G.subarray(0,32)),Q.update(T.subarray(32)),Q.update(F);const be=Q.digest();V(be);for(let pe=0;pe<32;pe++)I[pe]=he[pe];for(let pe=0;pe<32;pe++)for(let ye=0;ye<32;ye++)I[pe+ye]+=be[pe]*w[ye];return W(G.subarray(32),I),G}t.sign=ce;function te(T,F){const I=i(),c=i(),w=i(),G=i(),Q=i(),he=i(),be=i();return v(T[2],a),C(T[1],F),S(w,T[1]),h(G,w,l),P(w,w,T[2]),$(G,T[2],G),S(Q,G),S(he,Q),h(be,he,Q),h(I,be,w),h(I,I,G),z(I,I),h(I,I,w),h(I,I,G),h(I,I,G),h(T[0],I,G),S(c,T[0]),h(c,c,G),D(c,w)&&h(T[0],T[0],m),S(c,T[0]),h(c,c,G),D(c,w)?-1:(N(T[0])===F[31]>>7&&P(T[0],s,T[0]),h(T[3],T[0],T[1]),0)}function Ce(T,F,I){const c=new Uint8Array(32),w=[i(),i(),i(),i()],G=[i(),i(),i(),i()];if(I.length!==t.SIGNATURE_LENGTH)throw new Error(`ed25519: signature must be ${t.SIGNATURE_LENGTH} bytes`);if(te(G,T))return!1;const Q=new r.SHA512;Q.update(I.subarray(0,32)),Q.update(T),Q.update(F);const he=Q.digest();return V(he),E(w,G,he),O(G,I.subarray(32)),Y(w,G),ie(c,w),!B(I,c)}t.verify=Ce;function ne(T){let F=[i(),i(),i(),i()];if(te(F,T))throw new Error("Ed25519: invalid public key");let I=i(),c=i(),w=F[1];$(I,a,w),P(c,a,w),q(c,c),h(I,I,c);let G=new Uint8Array(32);return M(G,I),G}t.convertPublicKeyToX25519=ne;function Oe(T){const F=(0,r.hash)(T.subarray(0,32));F[0]&=248,F[31]&=127,F[31]|=64;const I=new Uint8Array(F.subarray(0,32));return(0,n.wipe)(F),I}t.convertSecretKeyToX25519=Oe}(qa);const o6="EdDSA",s6="JWT",D0=".",$0="base64url",a6="utf8",c6="utf8",l6=":",u6="did",h6="key",F0="base58btc",f6="z",d6="K36",p6=32;function Yo(t){return Zt(Yt(Si(t),a6),$0)}function P0(t){const e=Yt(d6,F0),r=f6+Zt(oa([e,t]),F0);return[u6,h6,r].join(l6)}function g6(t){return Zt(t,$0)}function m6(t){return Yt([Yo(t.header),Yo(t.payload)].join(D0),c6)}function b6(t){return[Yo(t.header),Yo(t.payload),g6(t.signature)].join(D0)}function T0(t=In.randomBytes(p6)){return qa.generateKeyPairFromSeed(t)}async function y6(t,e,r,n,i=Fe.fromMiliseconds(Date.now())){const o={alg:o6,typ:s6},s=P0(n.publicKey),a=i+r,l={iss:s,sub:t,aud:e,iat:i,exp:a},u=m6({header:o,payload:l}),d=qa.sign(n.secretKey,u);return b6({header:o,payload:l,signature:d})}const w6="PARSE_ERROR",v6="INVALID_REQUEST",_6="METHOD_NOT_FOUND",E6="INVALID_PARAMS",N0="INTERNAL_ERROR",Ka="SERVER_ERROR",x6=[-32700,-32600,-32601,-32602,-32603],Ai={[w6]:{code:-32700,message:"Parse error"},[v6]:{code:-32600,message:"Invalid Request"},[_6]:{code:-32601,message:"Method not found"},[E6]:{code:-32602,message:"Invalid params"},[N0]:{code:-32603,message:"Internal error"},[Ka]:{code:-32e3,message:"Server error"}},R0=Ka;function C6(t){return x6.includes(t)}function L0(t){return Object.keys(Ai).includes(t)?Ai[t]:Ai[R0]}function S6(t){const e=Object.values(Ai).find(r=>r.code===t);return e||Ai[R0]}function M0(t,e,r){return t.message.includes("getaddrinfo ENOTFOUND")||t.message.includes("connect ECONNREFUSED")?new Error(`Unavailable ${r} RPC url at ${e}`):t}var U0={};/*! *****************************************************************************
53
+ ***************************************************************************** */var Go=function(t,e){return Go=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)n.hasOwnProperty(i)&&(r[i]=n[i])},Go(t,e)};function _3(t,e){Go(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var Yo=function(){return Yo=Object.assign||function(e){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(e[s]=r[s])}return e},Yo.apply(this,arguments)};function E3(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r}function x3(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s}function C3(t,e){return function(r,n){e(r,n,t)}}function S3(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function I3(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(p){try{l(n.next(p))}catch(w){o(w)}}function c(p){try{l(n.throw(p))}catch(w){o(w)}}function l(p){p.done?s(p.value):i(p.value).then(a,c)}l((n=n.apply(t,e||[])).next())})}function D3(t,e){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,i,s,o;return o={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(l){return function(p){return c([l,p])}}function c(l){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(s=l[0]&2?i.return:l[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,l[1])).done)return s;switch(i=0,s&&(l=[l[0]&2,s.value]),l[0]){case 0:case 1:s=l;break;case 4:return r.label++,{value:l[1],done:!1};case 5:r.label++,i=l[1],l=[0];continue;case 7:l=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(l[0]===6||l[0]===2)){r=0;continue}if(l[0]===3&&(!s||l[1]>s[0]&&l[1]<s[3])){r.label=l[1];break}if(l[0]===6&&r.label<s[1]){r.label=s[1],s=l;break}if(s&&r.label<s[2]){r.label=s[2],r.ops.push(l);break}s[2]&&r.ops.pop(),r.trys.pop();continue}l=e.call(t,r)}catch(p){l=[6,p],i=0}finally{n=s=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}function O3(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}function A3(t,e){for(var r in t)r!=="default"&&!e.hasOwnProperty(r)&&(e[r]=t[r])}function Zo(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function Ou(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,s=[],o;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(a){o={error:a}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}return s}function $3(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(Ou(arguments[e]));return t}function P3(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;for(var n=Array(t),i=0,e=0;e<r;e++)for(var s=arguments[e],o=0,a=s.length;o<a;o++,i++)n[i]=s[o];return n}function ti(t){return this instanceof ti?(this.v=t,this):new ti(t)}function T3(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(t,e||[]),i,s=[];return i={},o("next"),o("throw"),o("return"),i[Symbol.asyncIterator]=function(){return this},i;function o(y){n[y]&&(i[y]=function(m){return new Promise(function(E,A){s.push([y,m,E,A])>1||a(y,m)})})}function a(y,m){try{c(n[y](m))}catch(E){w(s[0][3],E)}}function c(y){y.value instanceof ti?Promise.resolve(y.value.v).then(l,p):w(s[0][2],y)}function l(y){a("next",y)}function p(y){a("throw",y)}function w(y,m){y(m),s.shift(),s.length&&a(s[0][0],s[0][1])}}function N3(t){var e,r;return e={},n("next"),n("throw",function(i){throw i}),n("return"),e[Symbol.iterator]=function(){return this},e;function n(i,s){e[i]=t[i]?function(o){return(r=!r)?{value:ti(t[i](o)),done:i==="return"}:s?s(o):o}:s}}function R3(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof Zo=="function"?Zo(t):t[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(s){r[s]=t[s]&&function(o){return new Promise(function(a,c){o=t[s](o),i(a,c,o.done,o.value)})}}function i(s,o,a,c){Promise.resolve(c).then(function(l){s({value:l,done:a})},o)}}function L3(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function M3(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}function U3(t){return t&&t.__esModule?t:{default:t}}function F3(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}function B3(t,e,r){if(!e.has(t))throw new TypeError("attempted to set private field on non-instance");return e.set(t,r),r}var j3=Object.freeze({__proto__:null,__extends:_3,get __assign(){return Yo},__rest:E3,__decorate:x3,__param:C3,__metadata:S3,__awaiter:I3,__generator:D3,__createBinding:O3,__exportStar:A3,__values:Zo,__read:Ou,__spread:$3,__spreadArrays:P3,__await:ti,__asyncGenerator:T3,__asyncDelegator:N3,__asyncValues:R3,__makeTemplateObject:L3,__importStar:M3,__importDefault:U3,__classPrivateFieldGet:F3,__classPrivateFieldSet:B3}),k3=$r(j3),Fr={},Au;function $u(){return Au||(Au=1,Object.defineProperty(Fr,"__esModule",{value:!0}),Fr.PINO_CUSTOM_CONTEXT_KEY=Fr.PINO_LOGGER_DEFAULTS=void 0,Fr.PINO_LOGGER_DEFAULTS={level:"info"},Fr.PINO_CUSTOM_CONTEXT_KEY="custom_context"),Fr}var At={},Pu;function H3(){if(Pu)return At;Pu=1,Object.defineProperty(At,"__esModule",{value:!0}),At.generateChildLogger=At.formatChildLoggerContext=At.getLoggerContext=At.setBrowserLoggerContext=At.getBrowserLoggerContext=At.getDefaultLoggerOptions=void 0;const t=$u();function e(a){return Object.assign(Object.assign({},a),{level:a?.level||t.PINO_LOGGER_DEFAULTS.level})}At.getDefaultLoggerOptions=e;function r(a,c=t.PINO_CUSTOM_CONTEXT_KEY){return a[c]||""}At.getBrowserLoggerContext=r;function n(a,c,l=t.PINO_CUSTOM_CONTEXT_KEY){return a[l]=c,a}At.setBrowserLoggerContext=n;function i(a,c=t.PINO_CUSTOM_CONTEXT_KEY){let l="";return typeof a.bindings>"u"?l=r(a,c):l=a.bindings().context||"",l}At.getLoggerContext=i;function s(a,c,l=t.PINO_CUSTOM_CONTEXT_KEY){const p=i(a,l);return p.trim()?`${p}/${c}`:c}At.formatChildLoggerContext=s;function o(a,c,l=t.PINO_CUSTOM_CONTEXT_KEY){const p=s(a,c,l),w=a.child({context:p});return n(w,p,l)}return At.generateChildLogger=o,At}(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.pino=void 0;const e=k3,r=e.__importDefault(zn);Object.defineProperty(t,"pino",{enumerable:!0,get:function(){return r.default}}),e.__exportStar($u(),t),e.__exportStar(H3(),t)})(je);class z3 extends Mr{constructor(e){super(),this.opts=e,this.protocol="wc",this.version=2}}class W3 extends Mr{constructor(e,r){super(),this.core=e,this.logger=r,this.records=new Map}}class q3{constructor(e,r){this.logger=e,this.core=r}}class V3 extends Mr{constructor(e,r){super(),this.relayer=e,this.logger=r}}class K3 extends Mr{constructor(e){super()}}class G3{constructor(e,r,n,i){this.core=e,this.logger=r,this.name=n}}class Y3 extends Mr{constructor(e,r){super(),this.relayer=e,this.logger=r}}class Z3 extends Mr{constructor(e,r){super(),this.core=e,this.logger=r}}class J3{constructor(e){this.opts=e,this.protocol="wc",this.version=2}}class X3{constructor(e){this.client=e}}function Jo(t){if(typeof t!="string")throw new Error(`Cannot safe json parse value of type ${typeof t}`);try{return JSON.parse(t)}catch{return t}}function ri(t){return typeof t=="string"?t:JSON.stringify(t)}var Xo={},Tu={};(function(t){Object.defineProperty(t,"__esModule",{value:!0});var e=ve,r=Ut;t.DIGEST_LENGTH=64,t.BLOCK_SIZE=128;var n=function(){function a(){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 a.prototype._initState=function(){this._stateHi[0]=1779033703,this._stateHi[1]=3144134277,this._stateHi[2]=1013904242,this._stateHi[3]=2773480762,this._stateHi[4]=1359893119,this._stateHi[5]=2600822924,this._stateHi[6]=528734635,this._stateHi[7]=1541459225,this._stateLo[0]=4089235720,this._stateLo[1]=2227873595,this._stateLo[2]=4271175723,this._stateLo[3]=1595750129,this._stateLo[4]=2917565137,this._stateLo[5]=725511199,this._stateLo[6]=4215389547,this._stateLo[7]=327033209},a.prototype.reset=function(){return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this},a.prototype.clean=function(){r.wipe(this._buffer),r.wipe(this._tempHi),r.wipe(this._tempLo),this.reset()},a.prototype.update=function(c,l){if(l===void 0&&(l=c.length),this._finished)throw new Error("SHA512: can't update because hash was finished.");var p=0;if(this._bytesHashed+=l,this._bufferLength>0){for(;this._bufferLength<t.BLOCK_SIZE&&l>0;)this._buffer[this._bufferLength++]=c[p++],l--;this._bufferLength===this.blockSize&&(s(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,this.blockSize),this._bufferLength=0)}for(l>=this.blockSize&&(p=s(this._tempHi,this._tempLo,this._stateHi,this._stateLo,c,p,l),l%=this.blockSize);l>0;)this._buffer[this._bufferLength++]=c[p++],l--;return this},a.prototype.finish=function(c){if(!this._finished){var l=this._bytesHashed,p=this._bufferLength,w=l/536870912|0,y=l<<3,m=l%128<112?128:256;this._buffer[p]=128;for(var E=p+1;E<m-8;E++)this._buffer[E]=0;e.writeUint32BE(w,this._buffer,m-8),e.writeUint32BE(y,this._buffer,m-4),s(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,m),this._finished=!0}for(var E=0;E<this.digestLength/8;E++)e.writeUint32BE(this._stateHi[E],c,E*8),e.writeUint32BE(this._stateLo[E],c,E*8+4);return this},a.prototype.digest=function(){var c=new Uint8Array(this.digestLength);return this.finish(c),c},a.prototype.saveState=function(){if(this._finished)throw new Error("SHA256: cannot save finished state");return{stateHi:new Int32Array(this._stateHi),stateLo:new Int32Array(this._stateLo),buffer:this._bufferLength>0?new Uint8Array(this._buffer):void 0,bufferLength:this._bufferLength,bytesHashed:this._bytesHashed}},a.prototype.restoreState=function(c){return this._stateHi.set(c.stateHi),this._stateLo.set(c.stateLo),this._bufferLength=c.bufferLength,c.buffer&&this._buffer.set(c.buffer),this._bytesHashed=c.bytesHashed,this._finished=!1,this},a.prototype.cleanSavedState=function(c){r.wipe(c.stateHi),r.wipe(c.stateLo),c.buffer&&r.wipe(c.buffer),c.bufferLength=0,c.bytesHashed=0},a}();t.SHA512=n;var i=new Int32Array([1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591]);function s(a,c,l,p,w,y,m){for(var E=l[0],A=l[1],N=l[2],M=l[3],x=l[4],D=l[5],b=l[6],I=l[7],O=p[0],h=p[1],_=p[2],H=p[3],j=p[4],q=p[5],X=p[6],re=p[7],C,$,G,K,W,z,J,Y;m>=128;){for(var le=0;le<16;le++){var ee=8*le+y;a[le]=e.readUint32BE(w,ee),c[le]=e.readUint32BE(w,ee+4)}for(var le=0;le<80;le++){var fe=E,ae=A,Ce=N,B=M,F=x,R=D,f=b,P=I,te=O,ie=h,Ee=_,Le=H,$e=j,Me=q,Ye=X,Ke=re;if(C=I,$=re,W=$&65535,z=$>>>16,J=C&65535,Y=C>>>16,C=(x>>>14|j<<32-14)^(x>>>18|j<<32-18)^(j>>>41-32|x<<32-(41-32)),$=(j>>>14|x<<32-14)^(j>>>18|x<<32-18)^(x>>>41-32|j<<32-(41-32)),W+=$&65535,z+=$>>>16,J+=C&65535,Y+=C>>>16,C=x&D^~x&b,$=j&q^~j&X,W+=$&65535,z+=$>>>16,J+=C&65535,Y+=C>>>16,C=i[le*2],$=i[le*2+1],W+=$&65535,z+=$>>>16,J+=C&65535,Y+=C>>>16,C=a[le%16],$=c[le%16],W+=$&65535,z+=$>>>16,J+=C&65535,Y+=C>>>16,z+=W>>>16,J+=z>>>16,Y+=J>>>16,G=J&65535|Y<<16,K=W&65535|z<<16,C=G,$=K,W=$&65535,z=$>>>16,J=C&65535,Y=C>>>16,C=(E>>>28|O<<32-28)^(O>>>34-32|E<<32-(34-32))^(O>>>39-32|E<<32-(39-32)),$=(O>>>28|E<<32-28)^(E>>>34-32|O<<32-(34-32))^(E>>>39-32|O<<32-(39-32)),W+=$&65535,z+=$>>>16,J+=C&65535,Y+=C>>>16,C=E&A^E&N^A&N,$=O&h^O&_^h&_,W+=$&65535,z+=$>>>16,J+=C&65535,Y+=C>>>16,z+=W>>>16,J+=z>>>16,Y+=J>>>16,P=J&65535|Y<<16,Ke=W&65535|z<<16,C=B,$=Le,W=$&65535,z=$>>>16,J=C&65535,Y=C>>>16,C=G,$=K,W+=$&65535,z+=$>>>16,J+=C&65535,Y+=C>>>16,z+=W>>>16,J+=z>>>16,Y+=J>>>16,B=J&65535|Y<<16,Le=W&65535|z<<16,A=fe,N=ae,M=Ce,x=B,D=F,b=R,I=f,E=P,h=te,_=ie,H=Ee,j=Le,q=$e,X=Me,re=Ye,O=Ke,le%16===15)for(var ee=0;ee<16;ee++)C=a[ee],$=c[ee],W=$&65535,z=$>>>16,J=C&65535,Y=C>>>16,C=a[(ee+9)%16],$=c[(ee+9)%16],W+=$&65535,z+=$>>>16,J+=C&65535,Y+=C>>>16,G=a[(ee+1)%16],K=c[(ee+1)%16],C=(G>>>1|K<<32-1)^(G>>>8|K<<32-8)^G>>>7,$=(K>>>1|G<<32-1)^(K>>>8|G<<32-8)^(K>>>7|G<<32-7),W+=$&65535,z+=$>>>16,J+=C&65535,Y+=C>>>16,G=a[(ee+14)%16],K=c[(ee+14)%16],C=(G>>>19|K<<32-19)^(K>>>61-32|G<<32-(61-32))^G>>>6,$=(K>>>19|G<<32-19)^(G>>>61-32|K<<32-(61-32))^(K>>>6|G<<32-6),W+=$&65535,z+=$>>>16,J+=C&65535,Y+=C>>>16,z+=W>>>16,J+=z>>>16,Y+=J>>>16,a[ee]=J&65535|Y<<16,c[ee]=W&65535|z<<16}C=E,$=O,W=$&65535,z=$>>>16,J=C&65535,Y=C>>>16,C=l[0],$=p[0],W+=$&65535,z+=$>>>16,J+=C&65535,Y+=C>>>16,z+=W>>>16,J+=z>>>16,Y+=J>>>16,l[0]=E=J&65535|Y<<16,p[0]=O=W&65535|z<<16,C=A,$=h,W=$&65535,z=$>>>16,J=C&65535,Y=C>>>16,C=l[1],$=p[1],W+=$&65535,z+=$>>>16,J+=C&65535,Y+=C>>>16,z+=W>>>16,J+=z>>>16,Y+=J>>>16,l[1]=A=J&65535|Y<<16,p[1]=h=W&65535|z<<16,C=N,$=_,W=$&65535,z=$>>>16,J=C&65535,Y=C>>>16,C=l[2],$=p[2],W+=$&65535,z+=$>>>16,J+=C&65535,Y+=C>>>16,z+=W>>>16,J+=z>>>16,Y+=J>>>16,l[2]=N=J&65535|Y<<16,p[2]=_=W&65535|z<<16,C=M,$=H,W=$&65535,z=$>>>16,J=C&65535,Y=C>>>16,C=l[3],$=p[3],W+=$&65535,z+=$>>>16,J+=C&65535,Y+=C>>>16,z+=W>>>16,J+=z>>>16,Y+=J>>>16,l[3]=M=J&65535|Y<<16,p[3]=H=W&65535|z<<16,C=x,$=j,W=$&65535,z=$>>>16,J=C&65535,Y=C>>>16,C=l[4],$=p[4],W+=$&65535,z+=$>>>16,J+=C&65535,Y+=C>>>16,z+=W>>>16,J+=z>>>16,Y+=J>>>16,l[4]=x=J&65535|Y<<16,p[4]=j=W&65535|z<<16,C=D,$=q,W=$&65535,z=$>>>16,J=C&65535,Y=C>>>16,C=l[5],$=p[5],W+=$&65535,z+=$>>>16,J+=C&65535,Y+=C>>>16,z+=W>>>16,J+=z>>>16,Y+=J>>>16,l[5]=D=J&65535|Y<<16,p[5]=q=W&65535|z<<16,C=b,$=X,W=$&65535,z=$>>>16,J=C&65535,Y=C>>>16,C=l[6],$=p[6],W+=$&65535,z+=$>>>16,J+=C&65535,Y+=C>>>16,z+=W>>>16,J+=z>>>16,Y+=J>>>16,l[6]=b=J&65535|Y<<16,p[6]=X=W&65535|z<<16,C=I,$=re,W=$&65535,z=$>>>16,J=C&65535,Y=C>>>16,C=l[7],$=p[7],W+=$&65535,z+=$>>>16,J+=C&65535,Y+=C>>>16,z+=W>>>16,J+=z>>>16,Y+=J>>>16,l[7]=I=J&65535|Y<<16,p[7]=re=W&65535|z<<16,y+=128,m-=128}return y}function o(a){var c=new n;c.update(a);var l=c.digest();return c.clean(),l}t.hash=o})(Tu),function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.convertSecretKeyToX25519=t.convertPublicKeyToX25519=t.verify=t.sign=t.extractPublicKeyFromSecretKey=t.generateKeyPair=t.generateKeyPairFromSeed=t.SEED_LENGTH=t.SECRET_KEY_LENGTH=t.PUBLIC_KEY_LENGTH=t.SIGNATURE_LENGTH=void 0;const e=cn,r=Tu,n=Ut;t.SIGNATURE_LENGTH=64,t.PUBLIC_KEY_LENGTH=32,t.SECRET_KEY_LENGTH=64,t.SEED_LENGTH=32;function i(B){const F=new Float64Array(16);if(B)for(let R=0;R<B.length;R++)F[R]=B[R];return F}const s=new Uint8Array(32);s[0]=9;const o=i(),a=i([1]),c=i([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),l=i([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),p=i([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),w=i([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),y=i([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function m(B,F){for(let R=0;R<16;R++)B[R]=F[R]|0}function E(B){let F=1;for(let R=0;R<16;R++){let f=B[R]+F+65535;F=Math.floor(f/65536),B[R]=f-F*65536}B[0]+=F-1+37*(F-1)}function A(B,F,R){const f=~(R-1);for(let P=0;P<16;P++){const te=f&(B[P]^F[P]);B[P]^=te,F[P]^=te}}function N(B,F){const R=i(),f=i();for(let P=0;P<16;P++)f[P]=F[P];E(f),E(f),E(f);for(let P=0;P<2;P++){R[0]=f[0]-65517;for(let ie=1;ie<15;ie++)R[ie]=f[ie]-65535-(R[ie-1]>>16&1),R[ie-1]&=65535;R[15]=f[15]-32767-(R[14]>>16&1);const te=R[15]>>16&1;R[14]&=65535,A(f,R,1-te)}for(let P=0;P<16;P++)B[2*P]=f[P]&255,B[2*P+1]=f[P]>>8}function M(B,F){let R=0;for(let f=0;f<32;f++)R|=B[f]^F[f];return(1&R-1>>>8)-1}function x(B,F){const R=new Uint8Array(32),f=new Uint8Array(32);return N(R,B),N(f,F),M(R,f)}function D(B){const F=new Uint8Array(32);return N(F,B),F[0]&1}function b(B,F){for(let R=0;R<16;R++)B[R]=F[2*R]+(F[2*R+1]<<8);B[15]&=32767}function I(B,F,R){for(let f=0;f<16;f++)B[f]=F[f]+R[f]}function O(B,F,R){for(let f=0;f<16;f++)B[f]=F[f]-R[f]}function h(B,F,R){let f,P,te=0,ie=0,Ee=0,Le=0,$e=0,Me=0,Ye=0,Ke=0,Pe=0,De=0,ge=0,Se=0,Oe=0,pe=0,xe=0,g=0,u=0,d=0,v=0,T=0,U=0,k=0,oe=0,he=0,Ne=0,Fe=0,Re=0,Ht=0,rn=0,Bi=0,Ys=0,tt=R[0],Je=R[1],rt=R[2],nt=R[3],it=R[4],Xe=R[5],ft=R[6],pt=R[7],gt=R[8],mt=R[9],wt=R[10],lt=R[11],st=R[12],Ge=R[13],yt=R[14],bt=R[15];f=F[0],te+=f*tt,ie+=f*Je,Ee+=f*rt,Le+=f*nt,$e+=f*it,Me+=f*Xe,Ye+=f*ft,Ke+=f*pt,Pe+=f*gt,De+=f*mt,ge+=f*wt,Se+=f*lt,Oe+=f*st,pe+=f*Ge,xe+=f*yt,g+=f*bt,f=F[1],ie+=f*tt,Ee+=f*Je,Le+=f*rt,$e+=f*nt,Me+=f*it,Ye+=f*Xe,Ke+=f*ft,Pe+=f*pt,De+=f*gt,ge+=f*mt,Se+=f*wt,Oe+=f*lt,pe+=f*st,xe+=f*Ge,g+=f*yt,u+=f*bt,f=F[2],Ee+=f*tt,Le+=f*Je,$e+=f*rt,Me+=f*nt,Ye+=f*it,Ke+=f*Xe,Pe+=f*ft,De+=f*pt,ge+=f*gt,Se+=f*mt,Oe+=f*wt,pe+=f*lt,xe+=f*st,g+=f*Ge,u+=f*yt,d+=f*bt,f=F[3],Le+=f*tt,$e+=f*Je,Me+=f*rt,Ye+=f*nt,Ke+=f*it,Pe+=f*Xe,De+=f*ft,ge+=f*pt,Se+=f*gt,Oe+=f*mt,pe+=f*wt,xe+=f*lt,g+=f*st,u+=f*Ge,d+=f*yt,v+=f*bt,f=F[4],$e+=f*tt,Me+=f*Je,Ye+=f*rt,Ke+=f*nt,Pe+=f*it,De+=f*Xe,ge+=f*ft,Se+=f*pt,Oe+=f*gt,pe+=f*mt,xe+=f*wt,g+=f*lt,u+=f*st,d+=f*Ge,v+=f*yt,T+=f*bt,f=F[5],Me+=f*tt,Ye+=f*Je,Ke+=f*rt,Pe+=f*nt,De+=f*it,ge+=f*Xe,Se+=f*ft,Oe+=f*pt,pe+=f*gt,xe+=f*mt,g+=f*wt,u+=f*lt,d+=f*st,v+=f*Ge,T+=f*yt,U+=f*bt,f=F[6],Ye+=f*tt,Ke+=f*Je,Pe+=f*rt,De+=f*nt,ge+=f*it,Se+=f*Xe,Oe+=f*ft,pe+=f*pt,xe+=f*gt,g+=f*mt,u+=f*wt,d+=f*lt,v+=f*st,T+=f*Ge,U+=f*yt,k+=f*bt,f=F[7],Ke+=f*tt,Pe+=f*Je,De+=f*rt,ge+=f*nt,Se+=f*it,Oe+=f*Xe,pe+=f*ft,xe+=f*pt,g+=f*gt,u+=f*mt,d+=f*wt,v+=f*lt,T+=f*st,U+=f*Ge,k+=f*yt,oe+=f*bt,f=F[8],Pe+=f*tt,De+=f*Je,ge+=f*rt,Se+=f*nt,Oe+=f*it,pe+=f*Xe,xe+=f*ft,g+=f*pt,u+=f*gt,d+=f*mt,v+=f*wt,T+=f*lt,U+=f*st,k+=f*Ge,oe+=f*yt,he+=f*bt,f=F[9],De+=f*tt,ge+=f*Je,Se+=f*rt,Oe+=f*nt,pe+=f*it,xe+=f*Xe,g+=f*ft,u+=f*pt,d+=f*gt,v+=f*mt,T+=f*wt,U+=f*lt,k+=f*st,oe+=f*Ge,he+=f*yt,Ne+=f*bt,f=F[10],ge+=f*tt,Se+=f*Je,Oe+=f*rt,pe+=f*nt,xe+=f*it,g+=f*Xe,u+=f*ft,d+=f*pt,v+=f*gt,T+=f*mt,U+=f*wt,k+=f*lt,oe+=f*st,he+=f*Ge,Ne+=f*yt,Fe+=f*bt,f=F[11],Se+=f*tt,Oe+=f*Je,pe+=f*rt,xe+=f*nt,g+=f*it,u+=f*Xe,d+=f*ft,v+=f*pt,T+=f*gt,U+=f*mt,k+=f*wt,oe+=f*lt,he+=f*st,Ne+=f*Ge,Fe+=f*yt,Re+=f*bt,f=F[12],Oe+=f*tt,pe+=f*Je,xe+=f*rt,g+=f*nt,u+=f*it,d+=f*Xe,v+=f*ft,T+=f*pt,U+=f*gt,k+=f*mt,oe+=f*wt,he+=f*lt,Ne+=f*st,Fe+=f*Ge,Re+=f*yt,Ht+=f*bt,f=F[13],pe+=f*tt,xe+=f*Je,g+=f*rt,u+=f*nt,d+=f*it,v+=f*Xe,T+=f*ft,U+=f*pt,k+=f*gt,oe+=f*mt,he+=f*wt,Ne+=f*lt,Fe+=f*st,Re+=f*Ge,Ht+=f*yt,rn+=f*bt,f=F[14],xe+=f*tt,g+=f*Je,u+=f*rt,d+=f*nt,v+=f*it,T+=f*Xe,U+=f*ft,k+=f*pt,oe+=f*gt,he+=f*mt,Ne+=f*wt,Fe+=f*lt,Re+=f*st,Ht+=f*Ge,rn+=f*yt,Bi+=f*bt,f=F[15],g+=f*tt,u+=f*Je,d+=f*rt,v+=f*nt,T+=f*it,U+=f*Xe,k+=f*ft,oe+=f*pt,he+=f*gt,Ne+=f*mt,Fe+=f*wt,Re+=f*lt,Ht+=f*st,rn+=f*Ge,Bi+=f*yt,Ys+=f*bt,te+=38*u,ie+=38*d,Ee+=38*v,Le+=38*T,$e+=38*U,Me+=38*k,Ye+=38*oe,Ke+=38*he,Pe+=38*Ne,De+=38*Fe,ge+=38*Re,Se+=38*Ht,Oe+=38*rn,pe+=38*Bi,xe+=38*Ys,P=1,f=te+P+65535,P=Math.floor(f/65536),te=f-P*65536,f=ie+P+65535,P=Math.floor(f/65536),ie=f-P*65536,f=Ee+P+65535,P=Math.floor(f/65536),Ee=f-P*65536,f=Le+P+65535,P=Math.floor(f/65536),Le=f-P*65536,f=$e+P+65535,P=Math.floor(f/65536),$e=f-P*65536,f=Me+P+65535,P=Math.floor(f/65536),Me=f-P*65536,f=Ye+P+65535,P=Math.floor(f/65536),Ye=f-P*65536,f=Ke+P+65535,P=Math.floor(f/65536),Ke=f-P*65536,f=Pe+P+65535,P=Math.floor(f/65536),Pe=f-P*65536,f=De+P+65535,P=Math.floor(f/65536),De=f-P*65536,f=ge+P+65535,P=Math.floor(f/65536),ge=f-P*65536,f=Se+P+65535,P=Math.floor(f/65536),Se=f-P*65536,f=Oe+P+65535,P=Math.floor(f/65536),Oe=f-P*65536,f=pe+P+65535,P=Math.floor(f/65536),pe=f-P*65536,f=xe+P+65535,P=Math.floor(f/65536),xe=f-P*65536,f=g+P+65535,P=Math.floor(f/65536),g=f-P*65536,te+=P-1+37*(P-1),P=1,f=te+P+65535,P=Math.floor(f/65536),te=f-P*65536,f=ie+P+65535,P=Math.floor(f/65536),ie=f-P*65536,f=Ee+P+65535,P=Math.floor(f/65536),Ee=f-P*65536,f=Le+P+65535,P=Math.floor(f/65536),Le=f-P*65536,f=$e+P+65535,P=Math.floor(f/65536),$e=f-P*65536,f=Me+P+65535,P=Math.floor(f/65536),Me=f-P*65536,f=Ye+P+65535,P=Math.floor(f/65536),Ye=f-P*65536,f=Ke+P+65535,P=Math.floor(f/65536),Ke=f-P*65536,f=Pe+P+65535,P=Math.floor(f/65536),Pe=f-P*65536,f=De+P+65535,P=Math.floor(f/65536),De=f-P*65536,f=ge+P+65535,P=Math.floor(f/65536),ge=f-P*65536,f=Se+P+65535,P=Math.floor(f/65536),Se=f-P*65536,f=Oe+P+65535,P=Math.floor(f/65536),Oe=f-P*65536,f=pe+P+65535,P=Math.floor(f/65536),pe=f-P*65536,f=xe+P+65535,P=Math.floor(f/65536),xe=f-P*65536,f=g+P+65535,P=Math.floor(f/65536),g=f-P*65536,te+=P-1+37*(P-1),B[0]=te,B[1]=ie,B[2]=Ee,B[3]=Le,B[4]=$e,B[5]=Me,B[6]=Ye,B[7]=Ke,B[8]=Pe,B[9]=De,B[10]=ge,B[11]=Se,B[12]=Oe,B[13]=pe,B[14]=xe,B[15]=g}function _(B,F){h(B,F,F)}function H(B,F){const R=i();let f;for(f=0;f<16;f++)R[f]=F[f];for(f=253;f>=0;f--)_(R,R),f!==2&&f!==4&&h(R,R,F);for(f=0;f<16;f++)B[f]=R[f]}function j(B,F){const R=i();let f;for(f=0;f<16;f++)R[f]=F[f];for(f=250;f>=0;f--)_(R,R),f!==1&&h(R,R,F);for(f=0;f<16;f++)B[f]=R[f]}function q(B,F){const R=i(),f=i(),P=i(),te=i(),ie=i(),Ee=i(),Le=i(),$e=i(),Me=i();O(R,B[1],B[0]),O(Me,F[1],F[0]),h(R,R,Me),I(f,B[0],B[1]),I(Me,F[0],F[1]),h(f,f,Me),h(P,B[3],F[3]),h(P,P,l),h(te,B[2],F[2]),I(te,te,te),O(ie,f,R),O(Ee,te,P),I(Le,te,P),I($e,f,R),h(B[0],ie,Ee),h(B[1],$e,Le),h(B[2],Le,Ee),h(B[3],ie,$e)}function X(B,F,R){for(let f=0;f<4;f++)A(B[f],F[f],R)}function re(B,F){const R=i(),f=i(),P=i();H(P,F[2]),h(R,F[0],P),h(f,F[1],P),N(B,f),B[31]^=D(R)<<7}function C(B,F,R){m(B[0],o),m(B[1],a),m(B[2],a),m(B[3],o);for(let f=255;f>=0;--f){const P=R[f/8|0]>>(f&7)&1;X(B,F,P),q(F,B),q(B,B),X(B,F,P)}}function $(B,F){const R=[i(),i(),i(),i()];m(R[0],p),m(R[1],w),m(R[2],a),h(R[3],p,w),C(B,R,F)}function G(B){if(B.length!==t.SEED_LENGTH)throw new Error(`ed25519: seed must be ${t.SEED_LENGTH} bytes`);const F=(0,r.hash)(B);F[0]&=248,F[31]&=127,F[31]|=64;const R=new Uint8Array(32),f=[i(),i(),i(),i()];$(f,F),re(R,f);const P=new Uint8Array(64);return P.set(B),P.set(R,32),{publicKey:R,secretKey:P}}t.generateKeyPairFromSeed=G;function K(B){const F=(0,e.randomBytes)(32,B),R=G(F);return(0,n.wipe)(F),R}t.generateKeyPair=K;function W(B){if(B.length!==t.SECRET_KEY_LENGTH)throw new Error(`ed25519: secret key must be ${t.SECRET_KEY_LENGTH} bytes`);return new Uint8Array(B.subarray(32))}t.extractPublicKeyFromSecretKey=W;const z=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 J(B,F){let R,f,P,te;for(f=63;f>=32;--f){for(R=0,P=f-32,te=f-12;P<te;++P)F[P]+=R-16*F[f]*z[P-(f-32)],R=Math.floor((F[P]+128)/256),F[P]-=R*256;F[P]+=R,F[f]=0}for(R=0,P=0;P<32;P++)F[P]+=R-(F[31]>>4)*z[P],R=F[P]>>8,F[P]&=255;for(P=0;P<32;P++)F[P]-=R*z[P];for(f=0;f<32;f++)F[f+1]+=F[f]>>8,B[f]=F[f]&255}function Y(B){const F=new Float64Array(64);for(let R=0;R<64;R++)F[R]=B[R];for(let R=0;R<64;R++)B[R]=0;J(B,F)}function le(B,F){const R=new Float64Array(64),f=[i(),i(),i(),i()],P=(0,r.hash)(B.subarray(0,32));P[0]&=248,P[31]&=127,P[31]|=64;const te=new Uint8Array(64);te.set(P.subarray(32),32);const ie=new r.SHA512;ie.update(te.subarray(32)),ie.update(F);const Ee=ie.digest();ie.clean(),Y(Ee),$(f,Ee),re(te,f),ie.reset(),ie.update(te.subarray(0,32)),ie.update(B.subarray(32)),ie.update(F);const Le=ie.digest();Y(Le);for(let $e=0;$e<32;$e++)R[$e]=Ee[$e];for(let $e=0;$e<32;$e++)for(let Me=0;Me<32;Me++)R[$e+Me]+=Le[$e]*P[Me];return J(te.subarray(32),R),te}t.sign=le;function ee(B,F){const R=i(),f=i(),P=i(),te=i(),ie=i(),Ee=i(),Le=i();return m(B[2],a),b(B[1],F),_(P,B[1]),h(te,P,c),O(P,P,B[2]),I(te,B[2],te),_(ie,te),_(Ee,ie),h(Le,Ee,ie),h(R,Le,P),h(R,R,te),j(R,R),h(R,R,P),h(R,R,te),h(R,R,te),h(B[0],R,te),_(f,B[0]),h(f,f,te),x(f,P)&&h(B[0],B[0],y),_(f,B[0]),h(f,f,te),x(f,P)?-1:(D(B[0])===F[31]>>7&&O(B[0],o,B[0]),h(B[3],B[0],B[1]),0)}function fe(B,F,R){const f=new Uint8Array(32),P=[i(),i(),i(),i()],te=[i(),i(),i(),i()];if(R.length!==t.SIGNATURE_LENGTH)throw new Error(`ed25519: signature must be ${t.SIGNATURE_LENGTH} bytes`);if(ee(te,B))return!1;const ie=new r.SHA512;ie.update(R.subarray(0,32)),ie.update(B),ie.update(F);const Ee=ie.digest();return Y(Ee),C(P,te,Ee),$(te,R.subarray(32)),q(P,te),re(f,P),!M(R,f)}t.verify=fe;function ae(B){let F=[i(),i(),i(),i()];if(ee(F,B))throw new Error("Ed25519: invalid public key");let R=i(),f=i(),P=F[1];I(R,a,P),O(f,a,P),H(f,f),h(R,R,f);let te=new Uint8Array(32);return N(te,R),te}t.convertPublicKeyToX25519=ae;function Ce(B){const F=(0,r.hash)(B.subarray(0,32));F[0]&=248,F[31]&=127,F[31]|=64;const R=new Uint8Array(F.subarray(0,32));return(0,n.wipe)(F),R}t.convertSecretKeyToX25519=Ce}(Xo);const Q3="EdDSA",em="JWT",Nu=".",Ru="base64url",tm="utf8",rm="utf8",nm=":",im="did",sm="key",Lu="base58btc",om="z",am="K36",cm=32;function ss(t){return Tt(Pt(ri(t),tm),Ru)}function Mu(t){const e=Pt(am,Lu),r=om+Tt(uo([e,t]),Lu);return[im,sm,r].join(nm)}function lm(t){return Tt(t,Ru)}function um(t){return Pt([ss(t.header),ss(t.payload)].join(Nu),rm)}function hm(t){return[ss(t.header),ss(t.payload),lm(t.signature)].join(Nu)}function Uu(t=cn.randomBytes(cm)){return Xo.generateKeyPairFromSeed(t)}async function dm(t,e,r,n,i=me.fromMiliseconds(Date.now())){const s={alg:Q3,typ:em},o=Mu(n.publicKey),a=i+r,c={iss:o,sub:t,aud:e,iat:i,exp:a},l=um({header:s,payload:c}),p=Xo.sign(n.secretKey,l);return hm({header:s,payload:c,signature:p})}const fm="PARSE_ERROR",pm="INVALID_REQUEST",gm="METHOD_NOT_FOUND",mm="INVALID_PARAMS",Fu="INTERNAL_ERROR",Qo="SERVER_ERROR",wm=[-32700,-32600,-32601,-32602,-32603],ni={[fm]:{code:-32700,message:"Parse error"},[pm]:{code:-32600,message:"Invalid Request"},[gm]:{code:-32601,message:"Method not found"},[mm]:{code:-32602,message:"Invalid params"},[Fu]:{code:-32603,message:"Internal error"},[Qo]:{code:-32e3,message:"Server error"}},Bu=Qo;function ym(t){return wm.includes(t)}function ju(t){return Object.keys(ni).includes(t)?ni[t]:ni[Bu]}function bm(t){const e=Object.values(ni).find(r=>r.code===t);return e||ni[Bu]}function ku(t,e,r){return t.message.includes("getaddrinfo ENOTFOUND")||t.message.includes("connect ECONNREFUSED")?new Error(`Unavailable ${r} RPC url at ${e}`):t}var Hu={};/*! *****************************************************************************
54
54
  Copyright (c) Microsoft Corporation.
55
55
 
56
56
  Permission to use, copy, modify, and/or distribute this software for any
@@ -63,108 +63,69 @@
63
63
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
64
64
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
65
65
  PERFORMANCE OF THIS SOFTWARE.
66
- ***************************************************************************** */var Ga=function(t,e){return Ga=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)n.hasOwnProperty(i)&&(r[i]=n[i])},Ga(t,e)};function A6(t,e){Ga(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var Ya=function(){return Ya=Object.assign||function(e){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e},Ya.apply(this,arguments)};function I6(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r}function O6(t,e,r,n){var i=arguments.length,o=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,r,o):s(e,r))||o);return i>3&&o&&Object.defineProperty(e,r,o),o}function D6(t,e){return function(r,n){e(r,n,t)}}function $6(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function F6(t,e,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(d){try{u(n.next(d))}catch(y){s(y)}}function l(d){try{u(n.throw(d))}catch(y){s(y)}}function u(d){d.done?o(d.value):i(d.value).then(a,l)}u((n=n.apply(t,e||[])).next())})}function P6(t,e){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,s;return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(u){return function(d){return l([u,d])}}function l(u){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(o=u[0]&2?i.return:u[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,u[1])).done)return o;switch(i=0,o&&(u=[u[0]&2,o.value]),u[0]){case 0:case 1:o=u;break;case 4:return r.label++,{value:u[1],done:!1};case 5:r.label++,i=u[1],u=[0];continue;case 7:u=r.ops.pop(),r.trys.pop();continue;default:if(o=r.trys,!(o=o.length>0&&o[o.length-1])&&(u[0]===6||u[0]===2)){r=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[1]<o[3])){r.label=u[1];break}if(u[0]===6&&r.label<o[1]){r.label=o[1],o=u;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(u);break}o[2]&&r.ops.pop(),r.trys.pop();continue}u=e.call(t,r)}catch(d){u=[6,d],i=0}finally{n=o=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}function T6(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}function N6(t,e){for(var r in t)r!=="default"&&!e.hasOwnProperty(r)&&(e[r]=t[r])}function Za(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function B0(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,o=[],s;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(a){s={error:a}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(s)throw s.error}}return o}function R6(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(B0(arguments[e]));return t}function L6(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;for(var n=Array(t),i=0,e=0;e<r;e++)for(var o=arguments[e],s=0,a=o.length;s<a;s++,i++)n[i]=o[s];return n}function Ii(t){return this instanceof Ii?(this.v=t,this):new Ii(t)}function M6(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(t,e||[]),i,o=[];return i={},s("next"),s("throw"),s("return"),i[Symbol.asyncIterator]=function(){return this},i;function s(m){n[m]&&(i[m]=function(v){return new Promise(function(_,R){o.push([m,v,_,R])>1||a(m,v)})})}function a(m,v){try{l(n[m](v))}catch(_){y(o[0][3],_)}}function l(m){m.value instanceof Ii?Promise.resolve(m.value.v).then(u,d):y(o[0][2],m)}function u(m){a("next",m)}function d(m){a("throw",m)}function y(m,v){m(v),o.shift(),o.length&&a(o[0][0],o[0][1])}}function U6(t){var e,r;return e={},n("next"),n("throw",function(i){throw i}),n("return"),e[Symbol.iterator]=function(){return this},e;function n(i,o){e[i]=t[i]?function(s){return(r=!r)?{value:Ii(t[i](s)),done:i==="return"}:o?o(s):s}:o}}function B6(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof Za=="function"?Za(t):t[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(o){r[o]=t[o]&&function(s){return new Promise(function(a,l){s=t[o](s),i(a,l,s.done,s.value)})}}function i(o,s,a,l){Promise.resolve(l).then(function(u){o({value:u,done:a})},s)}}function j6(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function k6(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}function H6(t){return t&&t.__esModule?t:{default:t}}function z6(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}function W6(t,e,r){if(!e.has(t))throw new TypeError("attempted to set private field on non-instance");return e.set(t,r),r}var V6=Object.freeze({__proto__:null,__extends:A6,get __assign(){return Ya},__rest:I6,__decorate:O6,__param:D6,__metadata:$6,__awaiter:F6,__generator:P6,__createBinding:T6,__exportStar:N6,__values:Za,__read:B0,__spread:R6,__spreadArrays:L6,__await:Ii,__asyncGenerator:M6,__asyncDelegator:U6,__asyncValues:B6,__makeTemplateObject:j6,__importStar:k6,__importDefault:H6,__classPrivateFieldGet:z6,__classPrivateFieldSet:W6}),q6=Yr(V6),Ar={},j0;function K6(){if(j0)return Ar;j0=1,Object.defineProperty(Ar,"__esModule",{value:!0}),Ar.isBrowserCryptoAvailable=Ar.getSubtleCrypto=Ar.getBrowerCrypto=void 0;function t(){return Ot?.crypto||Ot?.msCrypto||{}}Ar.getBrowerCrypto=t;function e(){const n=t();return n.subtle||n.webkitSubtle}Ar.getSubtleCrypto=e;function r(){return!!t()&&!!e()}return Ar.isBrowserCryptoAvailable=r,Ar}var Ir={},k0;function G6(){if(k0)return Ir;k0=1,Object.defineProperty(Ir,"__esModule",{value:!0}),Ir.isBrowser=Ir.isNode=Ir.isReactNative=void 0;function t(){return typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"}Ir.isReactNative=t;function e(){return typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.node<"u"}Ir.isNode=e;function r(){return!t()&&!e()}return Ir.isBrowser=r,Ir}(function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=q6;e.__exportStar(K6(),t),e.__exportStar(G6(),t)})(U0);function Y6(){const t=Date.now()*Math.pow(10,3),e=Math.floor(Math.random()*Math.pow(10,3));return t+e}function Zo(t,e,r){return{id:r||Y6(),jsonrpc:"2.0",method:t,params:e}}function Ja(t,e){return{id:t,jsonrpc:"2.0",result:e}}function Jo(t,e,r){return{id:t,jsonrpc:"2.0",error:Z6(e,r)}}function Z6(t,e){return typeof t>"u"?L0(N0):(typeof t=="string"&&(t=Object.assign(Object.assign({},L0(Ka)),{message:t})),typeof e<"u"&&(t.data=e),C6(t.code)&&(t=S6(t.code)),t)}class J6{}class X6 extends J6{constructor(){super()}}class Q6 extends X6{constructor(e){super()}}const ey="^https?:",ty="^wss?:";function ry(t){const e=t.match(new RegExp(/^\w+:/,"gi"));if(!(!e||!e.length))return e[0]}function H0(t,e){const r=ry(t);return typeof r>"u"?!1:new RegExp(e).test(r)}function z0(t){return H0(t,ey)}function W0(t){return H0(t,ty)}function ny(t){return new RegExp("wss?://localhost(:d{2,5})?").test(t)}function V0(t){return typeof t=="object"&&"id"in t&&"jsonrpc"in t&&t.jsonrpc==="2.0"}function Xa(t){return V0(t)&&"method"in t}function Qa(t){return V0(t)&&(Or(t)||fr(t))}function Or(t){return"result"in t}function fr(t){return"error"in t}class Oi extends Q6{constructor(e){super(e),this.events=new Dt.exports.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,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}off(e,r){this.events.off(e,r)}removeListener(e,r){this.events.removeListener(e,r)}async request(e,r){return this.requestStrict(Zo(e.method,e.params||[]),r)}async requestStrict(e,r){return new Promise(async(n,i)=>{if(!this.connection.connected)try{await this.open()}catch(o){i(o)}this.events.on(`${e.id}`,o=>{fr(o)?i(o.error):n(o.result)});try{await this.connection.send(e,r)}catch(o){i(o)}})}setConnection(e=this.connection){return e}onPayload(e){this.events.emit("payload",e),Qa(e)?this.events.emit(`${e.id}`,e):this.events.emit("message",{type:e.method,data:e.params})}async open(e=this.connection){this.connection===e&&this.connection.connected||(this.connection.connected&&this.close(),typeof e=="string"&&(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",()=>this.events.emit("disconnect")),this.connection.on("error",e=>this.events.emit("error",e)),this.hasRegisteredEventListeners=!0)}}const q0=10,iy=()=>typeof global<"u"&&typeof global.WebSocket<"u"?global.WebSocket:typeof window<"u"&&typeof window.WebSocket<"u"?window.WebSocket:require("ws"),oy=()=>typeof window<"u",sy=iy();class ay{constructor(e){if(this.url=e,this.events=new Dt.exports.EventEmitter,this.registering=!1,!W0(e))throw new Error(`Provided URL is not compatible with WebSocket connection: ${e}`);this.url=e}get connected(){return typeof this.socket<"u"}get connecting(){return this.registering}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}off(e,r){this.events.off(e,r)}removeListener(e,r){this.events.removeListener(e,r)}async open(e=this.url){await this.register(e)}async close(){return new Promise((e,r)=>{if(typeof this.socket>"u"){r(new Error("Connection already closed"));return}this.socket.onclose=()=>{this.onClose(),e()},this.socket.close()})}async send(e,r){typeof this.socket>"u"&&(this.socket=await this.register());try{this.socket.send(Si(e))}catch(n){this.onError(e.id,n)}}register(e=this.url){if(!W0(e))throw new Error(`Provided URL is not compatible with WebSocket connection: ${e}`);if(this.registering){const r=this.events.getMaxListeners();return(this.events.listenerCount("register_error")>=r||this.events.listenerCount("open")>=r)&&this.events.setMaxListeners(r+1),new Promise((n,i)=>{this.events.once("register_error",o=>{this.resetMaxListeners(),i(o)}),this.events.once("open",()=>{if(this.resetMaxListeners(),typeof this.socket>"u")return i(new Error("WebSocket connection is missing or invalid"));n(this.socket)})})}return this.url=e,this.registering=!0,new Promise((r,n)=>{const i=U0.isReactNative()?void 0:{rejectUnauthorized:!ny(e)},o=new sy(e,[],i);oy()?o.onerror=s=>{const a=s;n(this.emitError(a.error))}:o.on("error",s=>{n(this.emitError(s))}),o.onopen=()=>{this.onOpen(o),r(o)}})}onOpen(e){e.onmessage=r=>this.onPayload(r),e.onclose=()=>this.onClose(),this.socket=e,this.registering=!1,this.events.emit("open")}onClose(){this.socket=void 0,this.registering=!1,this.events.emit("close")}onPayload(e){if(typeof e.data>"u")return;const r=typeof e.data=="string"?Va(e.data):e.data;this.events.emit("payload",r)}onError(e,r){const n=this.parseError(r),i=n.message||n.toString(),o=Jo(e,i);this.events.emit("payload",o)}parseError(e,r=this.url){return M0(e,r,"WS")}resetMaxListeners(){this.events.getMaxListeners()>q0&&this.events.setMaxListeners(q0)}emitError(e){const r=this.parseError(new Error(e?.message||`WebSocket connection failed for URL: ${this.url}`));return this.events.emit("register_error",r),r}}var ec={exports:{}};(function(t,e){var r=200,n="__lodash_hash_undefined__",i=1,o=2,s=9007199254740991,a="[object Arguments]",l="[object Array]",u="[object AsyncFunction]",d="[object Boolean]",y="[object Date]",m="[object Error]",v="[object Function]",_="[object GeneratorFunction]",R="[object Map]",M="[object Number]",B="[object Null]",D="[object Object]",N="[object Promise]",C="[object Proxy]",$="[object RegExp]",P="[object Set]",h="[object String]",S="[object Symbol]",q="[object Undefined]",z="[object WeakMap]",Y="[object ArrayBuffer]",re="[object DataView]",ie="[object Float32Array]",E="[object Float64Array]",O="[object Int8Array]",Z="[object Int16Array]",J="[object Int32Array]",H="[object Uint8Array]",j="[object Uint8ClampedArray]",W="[object Uint16Array]",V="[object Uint32Array]",ce=/[\\^$.*+?()[\]{}|]/g,te=/^\[object .+?Constructor\]$/,Ce=/^(?:0|[1-9]\d*)$/,ne={};ne[ie]=ne[E]=ne[O]=ne[Z]=ne[J]=ne[H]=ne[j]=ne[W]=ne[V]=!0,ne[a]=ne[l]=ne[Y]=ne[d]=ne[re]=ne[y]=ne[m]=ne[v]=ne[R]=ne[M]=ne[D]=ne[$]=ne[P]=ne[h]=ne[z]=!1;var Oe=typeof Ot=="object"&&Ot&&Ot.Object===Object&&Ot,T=typeof self=="object"&&self&&self.Object===Object&&self,F=Oe||T||Function("return this")(),I=e&&!e.nodeType&&e,c=I&&!0&&t&&!t.nodeType&&t,w=c&&c.exports===I,G=w&&Oe.process,Q=function(){try{return G&&G.binding&&G.binding("util")}catch{}}(),he=Q&&Q.isTypedArray;function be(g,x){for(var U=-1,X=g==null?0:g.length,Se=0,ae=[];++U<X;){var Re=g[U];x(Re,U,g)&&(ae[Se++]=Re)}return ae}function pe(g,x){for(var U=-1,X=x.length,Se=g.length;++U<X;)g[Se+U]=x[U];return g}function ye(g,x){for(var U=-1,X=g==null?0:g.length;++U<X;)if(x(g[U],U,g))return!0;return!1}function ze(g,x){for(var U=-1,X=Array(g);++U<g;)X[U]=x(U);return X}function Ue(g){return function(x){return g(x)}}function xe(g,x){return g.has(x)}function Ee(g,x){return g?.[x]}function ge(g){var x=-1,U=Array(g.size);return g.forEach(function(X,Se){U[++x]=[Se,X]}),U}function we(g,x){return function(U){return g(x(U))}}function ve(g){var x=-1,U=Array(g.size);return g.forEach(function(X){U[++x]=X}),U}var fe=Array.prototype,me=Function.prototype,b=Object.prototype,f=F["__core-js_shared__"],p=me.toString,A=b.hasOwnProperty,L=function(){var g=/[^.]+$/.exec(f&&f.keys&&f.keys.IE_PROTO||"");return g?"Symbol(src)_1."+g:""}(),k=b.toString,K=RegExp("^"+p.call(A).replace(ce,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),se=w?F.Buffer:void 0,de=F.Symbol,De=F.Uint8Array,Be=b.propertyIsEnumerable,Pe=fe.splice,pt=de?de.toStringTag:void 0,Vt=Object.getOwnPropertySymbols,dr=se?se.isBuffer:void 0,$r=we(Object.keys,Object),We=ar(F,"DataView"),Te=ar(F,"Map"),Ve=ar(F,"Promise"),qe=ar(F,"Set"),Ke=ar(F,"WeakMap"),Ne=ar(Object,"create"),Xe=Kt(We),Qe=Kt(Te),et=Kt(Ve),tt=Kt(qe),rt=Kt(Ke),Ze=de?de.prototype:void 0,Ge=Ze?Ze.valueOf:void 0;function Ae(g){var x=-1,U=g==null?0:g.length;for(this.clear();++x<U;){var X=g[x];this.set(X[0],X[1])}}function nt(){this.__data__=Ne?Ne(null):{},this.size=0}function it(g){var x=this.has(g)&&delete this.__data__[g];return this.size-=x?1:0,x}function Hl(g){var x=this.__data__;if(Ne){var U=x[g];return U===n?void 0:U}return A.call(x,g)?x[g]:void 0}function zl(g){var x=this.__data__;return Ne?x[g]!==void 0:A.call(x,g)}function Wl(g,x){var U=this.__data__;return this.size+=this.has(g)?0:1,U[g]=Ne&&x===void 0?n:x,this}Ae.prototype.clear=nt,Ae.prototype.delete=it,Ae.prototype.get=Hl,Ae.prototype.has=zl,Ae.prototype.set=Wl;function At(g){var x=-1,U=g==null?0:g.length;for(this.clear();++x<U;){var X=g[x];this.set(X[0],X[1])}}function Vl(){this.__data__=[],this.size=0}function ql(g){var x=this.__data__,U=Pr(x,g);if(U<0)return!1;var X=x.length-1;return U==X?x.pop():Pe.call(x,U,1),--this.size,!0}function Kl(g){var x=this.__data__,U=Pr(x,g);return U<0?void 0:x[U][1]}function Gl(g){return Pr(this.__data__,g)>-1}function Yl(g,x){var U=this.__data__,X=Pr(U,g);return X<0?(++this.size,U.push([g,x])):U[X][1]=x,this}At.prototype.clear=Vl,At.prototype.delete=ql,At.prototype.get=Kl,At.prototype.has=Gl,At.prototype.set=Yl;function qt(g){var x=-1,U=g==null?0:g.length;for(this.clear();++x<U;){var X=g[x];this.set(X[0],X[1])}}function Zl(){this.size=0,this.__data__={hash:new Ae,map:new(Te||At),string:new Ae}}function Jl(g){var x=Tr(this,g).delete(g);return this.size-=x?1:0,x}function Xl(g){return Tr(this,g).get(g)}function Ql(g){return Tr(this,g).has(g)}function eu(g,x){var U=Tr(this,g),X=U.size;return U.set(g,x),this.size+=U.size==X?0:1,this}qt.prototype.clear=Zl,qt.prototype.delete=Jl,qt.prototype.get=Xl,qt.prototype.has=Ql,qt.prototype.set=eu;function Fr(g){var x=-1,U=g==null?0:g.length;for(this.__data__=new qt;++x<U;)this.add(g[x])}function tu(g){return this.__data__.set(g,n),this}function ru(g){return this.__data__.has(g)}Fr.prototype.add=Fr.prototype.push=tu,Fr.prototype.has=ru;function Lt(g){var x=this.__data__=new At(g);this.size=x.size}function nu(){this.__data__=new At,this.size=0}function iu(g){var x=this.__data__,U=x.delete(g);return this.size=x.size,U}function ou(g){return this.__data__.get(g)}function su(g){return this.__data__.has(g)}function au(g,x){var U=this.__data__;if(U instanceof At){var X=U.__data__;if(!Te||X.length<r-1)return X.push([g,x]),this.size=++U.size,this;U=this.__data__=new qt(X)}return U.set(g,x),this.size=U.size,this}Lt.prototype.clear=nu,Lt.prototype.delete=iu,Lt.prototype.get=ou,Lt.prototype.has=su,Lt.prototype.set=au;function cu(g,x){var U=Nr(g),X=!U&&xu(g),Se=!U&&!X&&Sn(g),ae=!U&&!X&&!Se&&$o(g),Re=U||X||Se||ae,ot=Re?ze(g.length,String):[],at=ot.length;for(var $e in g)(x||A.call(g,$e))&&!(Re&&($e=="length"||Se&&($e=="offset"||$e=="parent")||ae&&($e=="buffer"||$e=="byteLength"||$e=="byteOffset")||yu($e,at)))&&ot.push($e);return ot}function Pr(g,x){for(var U=g.length;U--;)if(Ao(g[U][0],x))return U;return-1}function lu(g,x,U){var X=x(g);return Nr(g)?X:pe(X,U(g))}function pr(g){return g==null?g===void 0?q:B:pt&&pt in Object(g)?mu(g):Eu(g)}function Eo(g){return gr(g)&&pr(g)==a}function xo(g,x,U,X,Se){return g===x?!0:g==null||x==null||!gr(g)&&!gr(x)?g!==g&&x!==x:uu(g,x,U,X,xo,Se)}function uu(g,x,U,X,Se,ae){var Re=Nr(g),ot=Nr(x),at=Re?l:Mt(g),$e=ot?l:Mt(x);at=at==a?D:at,$e=$e==a?D:$e;var gt=at==D,_t=$e==D,lt=at==$e;if(lt&&Sn(g)){if(!Sn(x))return!1;Re=!0,gt=!1}if(lt&&!gt)return ae||(ae=new Lt),Re||$o(g)?Co(g,x,U,X,Se,ae):pu(g,x,at,U,X,Se,ae);if(!(U&i)){var bt=gt&&A.call(g,"__wrapped__"),yt=_t&&A.call(x,"__wrapped__");if(bt||yt){var Ut=bt?g.value():g,It=yt?x.value():x;return ae||(ae=new Lt),Se(Ut,It,U,X,ae)}}return lt?(ae||(ae=new Lt),gu(g,x,U,X,Se,ae)):!1}function hu(g){if(!Do(g)||vu(g))return!1;var x=Io(g)?K:te;return x.test(Kt(g))}function fu(g){return gr(g)&&Oo(g.length)&&!!ne[pr(g)]}function du(g){if(!_u(g))return $r(g);var x=[];for(var U in Object(g))A.call(g,U)&&U!="constructor"&&x.push(U);return x}function Co(g,x,U,X,Se,ae){var Re=U&i,ot=g.length,at=x.length;if(ot!=at&&!(Re&&at>ot))return!1;var $e=ae.get(g);if($e&&ae.get(x))return $e==x;var gt=-1,_t=!0,lt=U&o?new Fr:void 0;for(ae.set(g,x),ae.set(x,g);++gt<ot;){var bt=g[gt],yt=x[gt];if(X)var Ut=Re?X(yt,bt,gt,x,g,ae):X(bt,yt,gt,g,x,ae);if(Ut!==void 0){if(Ut)continue;_t=!1;break}if(lt){if(!ye(x,function(It,Gt){if(!xe(lt,Gt)&&(bt===It||Se(bt,It,U,X,ae)))return lt.push(Gt)})){_t=!1;break}}else if(!(bt===yt||Se(bt,yt,U,X,ae))){_t=!1;break}}return ae.delete(g),ae.delete(x),_t}function pu(g,x,U,X,Se,ae,Re){switch(U){case re:if(g.byteLength!=x.byteLength||g.byteOffset!=x.byteOffset)return!1;g=g.buffer,x=x.buffer;case Y:return!(g.byteLength!=x.byteLength||!ae(new De(g),new De(x)));case d:case y:case M:return Ao(+g,+x);case m:return g.name==x.name&&g.message==x.message;case $:case h:return g==x+"";case R:var ot=ge;case P:var at=X&i;if(ot||(ot=ve),g.size!=x.size&&!at)return!1;var $e=Re.get(g);if($e)return $e==x;X|=o,Re.set(g,x);var gt=Co(ot(g),ot(x),X,Se,ae,Re);return Re.delete(g),gt;case S:if(Ge)return Ge.call(g)==Ge.call(x)}return!1}function gu(g,x,U,X,Se,ae){var Re=U&i,ot=So(g),at=ot.length,$e=So(x),gt=$e.length;if(at!=gt&&!Re)return!1;for(var _t=at;_t--;){var lt=ot[_t];if(!(Re?lt in x:A.call(x,lt)))return!1}var bt=ae.get(g);if(bt&&ae.get(x))return bt==x;var yt=!0;ae.set(g,x),ae.set(x,g);for(var Ut=Re;++_t<at;){lt=ot[_t];var It=g[lt],Gt=x[lt];if(X)var Fo=Re?X(Gt,It,lt,x,g,ae):X(It,Gt,lt,g,x,ae);if(!(Fo===void 0?It===Gt||Se(It,Gt,U,X,ae):Fo)){yt=!1;break}Ut||(Ut=lt=="constructor")}if(yt&&!Ut){var Rr=g.constructor,Lr=x.constructor;Rr!=Lr&&"constructor"in g&&"constructor"in x&&!(typeof Rr=="function"&&Rr instanceof Rr&&typeof Lr=="function"&&Lr instanceof Lr)&&(yt=!1)}return ae.delete(g),ae.delete(x),yt}function So(g){return lu(g,Au,bu)}function Tr(g,x){var U=g.__data__;return wu(x)?U[typeof x=="string"?"string":"hash"]:U.map}function ar(g,x){var U=Ee(g,x);return hu(U)?U:void 0}function mu(g){var x=A.call(g,pt),U=g[pt];try{g[pt]=void 0;var X=!0}catch{}var Se=k.call(g);return X&&(x?g[pt]=U:delete g[pt]),Se}var bu=Vt?function(g){return g==null?[]:(g=Object(g),be(Vt(g),function(x){return Be.call(g,x)}))}:Iu,Mt=pr;(We&&Mt(new We(new ArrayBuffer(1)))!=re||Te&&Mt(new Te)!=R||Ve&&Mt(Ve.resolve())!=N||qe&&Mt(new qe)!=P||Ke&&Mt(new Ke)!=z)&&(Mt=function(g){var x=pr(g),U=x==D?g.constructor:void 0,X=U?Kt(U):"";if(X)switch(X){case Xe:return re;case Qe:return R;case et:return N;case tt:return P;case rt:return z}return x});function yu(g,x){return x=x??s,!!x&&(typeof g=="number"||Ce.test(g))&&g>-1&&g%1==0&&g<x}function wu(g){var x=typeof g;return x=="string"||x=="number"||x=="symbol"||x=="boolean"?g!=="__proto__":g===null}function vu(g){return!!L&&L in g}function _u(g){var x=g&&g.constructor,U=typeof x=="function"&&x.prototype||b;return g===U}function Eu(g){return k.call(g)}function Kt(g){if(g!=null){try{return p.call(g)}catch{}try{return g+""}catch{}}return""}function Ao(g,x){return g===x||g!==g&&x!==x}var xu=Eo(function(){return arguments}())?Eo:function(g){return gr(g)&&A.call(g,"callee")&&!Be.call(g,"callee")},Nr=Array.isArray;function Cu(g){return g!=null&&Oo(g.length)&&!Io(g)}var Sn=dr||Ou;function Su(g,x){return xo(g,x)}function Io(g){if(!Do(g))return!1;var x=pr(g);return x==v||x==_||x==u||x==C}function Oo(g){return typeof g=="number"&&g>-1&&g%1==0&&g<=s}function Do(g){var x=typeof g;return g!=null&&(x=="object"||x=="function")}function gr(g){return g!=null&&typeof g=="object"}var $o=he?Ue(he):fu;function Au(g){return Cu(g)?cu(g):du(g)}function Iu(){return[]}function Ou(){return!1}t.exports=Su})(ec,ec.exports);var cy=ec.exports,ly=Object.defineProperty,K0=Object.getOwnPropertySymbols,uy=Object.prototype.hasOwnProperty,hy=Object.prototype.propertyIsEnumerable,G0=(t,e,r)=>e in t?ly(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,zt=(t,e)=>{for(var r in e||(e={}))uy.call(e,r)&&G0(t,r,e[r]);if(K0)for(var r of K0(e))hy.call(e,r)&&G0(t,r,e[r]);return t};function fy(t,e){if(t.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),n=0;n<r.length;n++)r[n]=255;for(var i=0;i<t.length;i++){var o=t.charAt(i),s=o.charCodeAt(0);if(r[s]!==255)throw new TypeError(o+" is ambiguous");r[s]=i}var a=t.length,l=t.charAt(0),u=Math.log(a)/Math.log(256),d=Math.log(256)/Math.log(a);function y(_){if(_ instanceof Uint8Array||(ArrayBuffer.isView(_)?_=new Uint8Array(_.buffer,_.byteOffset,_.byteLength):Array.isArray(_)&&(_=Uint8Array.from(_))),!(_ instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(_.length===0)return"";for(var R=0,M=0,B=0,D=_.length;B!==D&&_[B]===0;)B++,R++;for(var N=(D-B)*d+1>>>0,C=new Uint8Array(N);B!==D;){for(var $=_[B],P=0,h=N-1;($!==0||P<M)&&h!==-1;h--,P++)$+=256*C[h]>>>0,C[h]=$%a>>>0,$=$/a>>>0;if($!==0)throw new Error("Non-zero carry");M=P,B++}for(var S=N-M;S!==N&&C[S]===0;)S++;for(var q=l.repeat(R);S<N;++S)q+=t.charAt(C[S]);return q}function m(_){if(typeof _!="string")throw new TypeError("Expected String");if(_.length===0)return new Uint8Array;var R=0;if(_[R]!==" "){for(var M=0,B=0;_[R]===l;)M++,R++;for(var D=(_.length-R)*u+1>>>0,N=new Uint8Array(D);_[R];){var C=r[_.charCodeAt(R)];if(C===255)return;for(var $=0,P=D-1;(C!==0||$<B)&&P!==-1;P--,$++)C+=a*N[P]>>>0,N[P]=C%256>>>0,C=C/256>>>0;if(C!==0)throw new Error("Non-zero carry");B=$,R++}if(_[R]!==" "){for(var h=D-B;h!==D&&N[h]===0;)h++;for(var S=new Uint8Array(M+(D-h)),q=M;h!==D;)S[q++]=N[h++];return S}}}function v(_){var R=m(_);if(R)return R;throw new Error(`Non-${e} character`)}return{encode:y,decodeUnsafe:m,decode:v}}var dy=fy,py=dy;const Y0=t=>{if(t instanceof Uint8Array&&t.constructor.name==="Uint8Array")return t;if(t instanceof ArrayBuffer)return new Uint8Array(t);if(ArrayBuffer.isView(t))return new Uint8Array(t.buffer,t.byteOffset,t.byteLength);throw new Error("Unknown type, must be binary type")},gy=t=>new TextEncoder().encode(t),my=t=>new TextDecoder().decode(t);class by{constructor(e,r,n){this.name=e,this.prefix=r,this.baseEncode=n}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}}class yy{constructor(e,r,n){if(this.name=e,this.prefix=r,r.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=r.codePointAt(0),this.baseDecode=n}decode(e){if(typeof e=="string"){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))}else throw Error("Can only multibase decode strings")}or(e){return Z0(this,e)}}class wy{constructor(e){this.decoders=e}or(e){return Z0(this,e)}decode(e){const r=e[0],n=this.decoders[r];if(n)return n.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const Z0=(t,e)=>new wy(zt(zt({},t.decoders||{[t.prefix]:t}),e.decoders||{[e.prefix]:e}));class vy{constructor(e,r,n,i){this.name=e,this.prefix=r,this.baseEncode=n,this.baseDecode=i,this.encoder=new by(e,r,n),this.decoder=new yy(e,r,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}const Xo=({name:t,prefix:e,encode:r,decode:n})=>new vy(t,e,r,n),Di=({prefix:t,name:e,alphabet:r})=>{const{encode:n,decode:i}=py(r,e);return Xo({prefix:t,name:e,encode:n,decode:o=>Y0(i(o))})},_y=(t,e,r,n)=>{const i={};for(let d=0;d<e.length;++d)i[e[d]]=d;let o=t.length;for(;t[o-1]==="=";)--o;const s=new Uint8Array(o*r/8|0);let a=0,l=0,u=0;for(let d=0;d<o;++d){const y=i[t[d]];if(y===void 0)throw new SyntaxError(`Non-${n} character`);l=l<<r|y,a+=r,a>=8&&(a-=8,s[u++]=255&l>>a)}if(a>=r||255&l<<8-a)throw new SyntaxError("Unexpected end of data");return s},Ey=(t,e,r)=>{const n=e[e.length-1]==="=",i=(1<<r)-1;let o="",s=0,a=0;for(let l=0;l<t.length;++l)for(a=a<<8|t[l],s+=8;s>r;)s-=r,o+=e[i&a>>s];if(s&&(o+=e[i&a<<r-s]),n)for(;o.length*r&7;)o+="=";return o},Tt=({name:t,prefix:e,bitsPerChar:r,alphabet:n})=>Xo({prefix:e,name:t,encode(i){return Ey(i,n,r)},decode(i){return _y(i,n,r,t)}}),xy=Xo({prefix:"\0",name:"identity",encode:t=>my(t),decode:t=>gy(t)});var Cy=Object.freeze({__proto__:null,identity:xy});const Sy=Tt({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var Ay=Object.freeze({__proto__:null,base2:Sy});const Iy=Tt({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var Oy=Object.freeze({__proto__:null,base8:Iy});const Dy=Di({prefix:"9",name:"base10",alphabet:"0123456789"});var $y=Object.freeze({__proto__:null,base10:Dy});const Fy=Tt({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),Py=Tt({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var Ty=Object.freeze({__proto__:null,base16:Fy,base16upper:Py});const Ny=Tt({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),Ry=Tt({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),Ly=Tt({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),My=Tt({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),Uy=Tt({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),By=Tt({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),jy=Tt({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),ky=Tt({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),Hy=Tt({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var zy=Object.freeze({__proto__:null,base32:Ny,base32upper:Ry,base32pad:Ly,base32padupper:My,base32hex:Uy,base32hexupper:By,base32hexpad:jy,base32hexpadupper:ky,base32z:Hy});const Wy=Di({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),Vy=Di({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var qy=Object.freeze({__proto__:null,base36:Wy,base36upper:Vy});const Ky=Di({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),Gy=Di({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var Yy=Object.freeze({__proto__:null,base58btc:Ky,base58flickr:Gy});const Zy=Tt({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),Jy=Tt({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),Xy=Tt({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),Qy=Tt({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var ew=Object.freeze({__proto__:null,base64:Zy,base64pad:Jy,base64url:Xy,base64urlpad:Qy});const J0=Array.from("\u{1F680}\u{1FA90}\u2604\u{1F6F0}\u{1F30C}\u{1F311}\u{1F312}\u{1F313}\u{1F314}\u{1F315}\u{1F316}\u{1F317}\u{1F318}\u{1F30D}\u{1F30F}\u{1F30E}\u{1F409}\u2600\u{1F4BB}\u{1F5A5}\u{1F4BE}\u{1F4BF}\u{1F602}\u2764\u{1F60D}\u{1F923}\u{1F60A}\u{1F64F}\u{1F495}\u{1F62D}\u{1F618}\u{1F44D}\u{1F605}\u{1F44F}\u{1F601}\u{1F525}\u{1F970}\u{1F494}\u{1F496}\u{1F499}\u{1F622}\u{1F914}\u{1F606}\u{1F644}\u{1F4AA}\u{1F609}\u263A\u{1F44C}\u{1F917}\u{1F49C}\u{1F614}\u{1F60E}\u{1F607}\u{1F339}\u{1F926}\u{1F389}\u{1F49E}\u270C\u2728\u{1F937}\u{1F631}\u{1F60C}\u{1F338}\u{1F64C}\u{1F60B}\u{1F497}\u{1F49A}\u{1F60F}\u{1F49B}\u{1F642}\u{1F493}\u{1F929}\u{1F604}\u{1F600}\u{1F5A4}\u{1F603}\u{1F4AF}\u{1F648}\u{1F447}\u{1F3B6}\u{1F612}\u{1F92D}\u2763\u{1F61C}\u{1F48B}\u{1F440}\u{1F62A}\u{1F611}\u{1F4A5}\u{1F64B}\u{1F61E}\u{1F629}\u{1F621}\u{1F92A}\u{1F44A}\u{1F973}\u{1F625}\u{1F924}\u{1F449}\u{1F483}\u{1F633}\u270B\u{1F61A}\u{1F61D}\u{1F634}\u{1F31F}\u{1F62C}\u{1F643}\u{1F340}\u{1F337}\u{1F63B}\u{1F613}\u2B50\u2705\u{1F97A}\u{1F308}\u{1F608}\u{1F918}\u{1F4A6}\u2714\u{1F623}\u{1F3C3}\u{1F490}\u2639\u{1F38A}\u{1F498}\u{1F620}\u261D\u{1F615}\u{1F33A}\u{1F382}\u{1F33B}\u{1F610}\u{1F595}\u{1F49D}\u{1F64A}\u{1F639}\u{1F5E3}\u{1F4AB}\u{1F480}\u{1F451}\u{1F3B5}\u{1F91E}\u{1F61B}\u{1F534}\u{1F624}\u{1F33C}\u{1F62B}\u26BD\u{1F919}\u2615\u{1F3C6}\u{1F92B}\u{1F448}\u{1F62E}\u{1F646}\u{1F37B}\u{1F343}\u{1F436}\u{1F481}\u{1F632}\u{1F33F}\u{1F9E1}\u{1F381}\u26A1\u{1F31E}\u{1F388}\u274C\u270A\u{1F44B}\u{1F630}\u{1F928}\u{1F636}\u{1F91D}\u{1F6B6}\u{1F4B0}\u{1F353}\u{1F4A2}\u{1F91F}\u{1F641}\u{1F6A8}\u{1F4A8}\u{1F92C}\u2708\u{1F380}\u{1F37A}\u{1F913}\u{1F619}\u{1F49F}\u{1F331}\u{1F616}\u{1F476}\u{1F974}\u25B6\u27A1\u2753\u{1F48E}\u{1F4B8}\u2B07\u{1F628}\u{1F31A}\u{1F98B}\u{1F637}\u{1F57A}\u26A0\u{1F645}\u{1F61F}\u{1F635}\u{1F44E}\u{1F932}\u{1F920}\u{1F927}\u{1F4CC}\u{1F535}\u{1F485}\u{1F9D0}\u{1F43E}\u{1F352}\u{1F617}\u{1F911}\u{1F30A}\u{1F92F}\u{1F437}\u260E\u{1F4A7}\u{1F62F}\u{1F486}\u{1F446}\u{1F3A4}\u{1F647}\u{1F351}\u2744\u{1F334}\u{1F4A3}\u{1F438}\u{1F48C}\u{1F4CD}\u{1F940}\u{1F922}\u{1F445}\u{1F4A1}\u{1F4A9}\u{1F450}\u{1F4F8}\u{1F47B}\u{1F910}\u{1F92E}\u{1F3BC}\u{1F975}\u{1F6A9}\u{1F34E}\u{1F34A}\u{1F47C}\u{1F48D}\u{1F4E3}\u{1F942}"),tw=J0.reduce((t,e,r)=>(t[r]=e,t),[]),rw=J0.reduce((t,e,r)=>(t[e.codePointAt(0)]=r,t),[]);function nw(t){return t.reduce((e,r)=>(e+=tw[r],e),"")}function iw(t){const e=[];for(const r of t){const n=rw[r.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${r}`);e.push(n)}return new Uint8Array(e)}const ow=Xo({prefix:"\u{1F680}",name:"base256emoji",encode:nw,decode:iw});var sw=Object.freeze({__proto__:null,base256emoji:ow}),aw=Q0,X0=128,cw=127,lw=~cw,uw=Math.pow(2,31);function Q0(t,e,r){e=e||[],r=r||0;for(var n=r;t>=uw;)e[r++]=t&255|X0,t/=128;for(;t&lw;)e[r++]=t&255|X0,t>>>=7;return e[r]=t|0,Q0.bytes=r-n+1,e}var hw=tc,fw=128,e1=127;function tc(t,n){var r=0,n=n||0,i=0,o=n,s,a=t.length;do{if(o>=a)throw tc.bytes=0,new RangeError("Could not decode varint");s=t[o++],r+=i<28?(s&e1)<<i:(s&e1)*Math.pow(2,i),i+=7}while(s>=fw);return tc.bytes=o-n,r}var dw=Math.pow(2,7),pw=Math.pow(2,14),gw=Math.pow(2,21),mw=Math.pow(2,28),bw=Math.pow(2,35),yw=Math.pow(2,42),ww=Math.pow(2,49),vw=Math.pow(2,56),_w=Math.pow(2,63),Ew=function(t){return t<dw?1:t<pw?2:t<gw?3:t<mw?4:t<bw?5:t<yw?6:t<ww?7:t<vw?8:t<_w?9:10},xw={encode:aw,decode:hw,encodingLength:Ew},t1=xw;const r1=(t,e,r=0)=>(t1.encode(t,e,r),e),n1=t=>t1.encodingLength(t),rc=(t,e)=>{const r=e.byteLength,n=n1(t),i=n+n1(r),o=new Uint8Array(i+r);return r1(t,o,0),r1(r,o,n),o.set(e,i),new Cw(t,r,e,o)};class Cw{constructor(e,r,n,i){this.code=e,this.size=r,this.digest=n,this.bytes=i}}const i1=({name:t,code:e,encode:r})=>new Sw(t,e,r);class Sw{constructor(e,r,n){this.name=e,this.code=r,this.encode=n}digest(e){if(e instanceof Uint8Array){const r=this.encode(e);return r instanceof Uint8Array?rc(this.code,r):r.then(n=>rc(this.code,n))}else throw Error("Unknown type, must be binary type")}}const o1=t=>async e=>new Uint8Array(await crypto.subtle.digest(t,e)),Aw=i1({name:"sha2-256",code:18,encode:o1("SHA-256")}),Iw=i1({name:"sha2-512",code:19,encode:o1("SHA-512")});var Ow=Object.freeze({__proto__:null,sha256:Aw,sha512:Iw});const s1=0,Dw="identity",a1=Y0;var $w=Object.freeze({__proto__:null,identity:{code:s1,name:Dw,encode:a1,digest:t=>rc(s1,a1(t))}});new TextEncoder,new TextDecoder;const c1=zt(zt(zt(zt(zt(zt(zt(zt(zt(zt({},Cy),Ay),Oy),$y),Ty),zy),qy),Yy),ew),sw);zt(zt({},Ow),$w);function Fw(t=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?globalThis.Buffer.allocUnsafe(t):new Uint8Array(t)}function l1(t,e,r,n){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:r},decoder:{decode:n}}}const u1=l1("utf8","u",t=>"u"+new TextDecoder("utf8").decode(t),t=>new TextEncoder().encode(t.substring(1))),nc=l1("ascii","a",t=>{let e="a";for(let r=0;r<t.length;r++)e+=String.fromCharCode(t[r]);return e},t=>{t=t.substring(1);const e=Fw(t.length);for(let r=0;r<t.length;r++)e[r]=t.charCodeAt(r);return e}),Pw=zt({utf8:u1,"utf-8":u1,hex:c1.base16,latin1:nc,ascii:nc,binary:nc},c1);function Tw(t,e="utf8"){const r=Pw[e];if(!r)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(t,"utf8"):r.decoder.decode(`${r.prefix}${t}`)}const h1="wc",Nw=2,ic="core",jr=`${h1}@${2}:${ic}:`,Rw={name:ic,logger:"error"},Lw={database:":memory:"},Mw="crypto",f1="client_ed25519_seed",Uw=Fe.ONE_DAY,Bw="keychain",jw="0.3",kw="messages",Hw="0.3",zw=Fe.SIX_HOURS,Ww="publisher",d1="irn",Vw="error",qw="wss://relay.walletconnect.com",Kw="relayer",jt={message:"relayer_message",connect:"relayer_connect",disconnect:"relayer_disconnect",error:"relayer_error",connection_stalled:"relayer_connection_stalled",transport_closed:"relayer_transport_closed",publish:"relayer_publish"},Gw="_subscription",Qo={payload:"payload",connect:"connect",disconnect:"disconnect",error:"error"},p1=Fe.ONE_SECOND,Yw="2.4.0",Zw="0.3",wr={created:"subscription_created",deleted:"subscription_deleted",expired:"subscription_expired",disabled:"subscription_disabled",sync:"subscription_sync",resubscribed:"subscription_resubscribed"},Jw="subscription",Xw="0.3",Qw=Fe.FIVE_SECONDS*1e3,ev="pairing",tv="0.3",$i={wc_pairingDelete:{req:{ttl:Fe.ONE_DAY,prompt:!1,tag:1e3},res:{ttl:Fe.ONE_DAY,prompt:!1,tag:1001}},wc_pairingPing:{req:{ttl:Fe.THIRTY_SECONDS,prompt:!1,tag:1002},res:{ttl:Fe.THIRTY_SECONDS,prompt:!1,tag:1003}},unregistered_method:{req:{ttl:Fe.ONE_DAY,prompt:!1,tag:0},res:{ttl:Fe.ONE_DAY,prompt:!1,tag:0}}},vr={created:"history_created",updated:"history_updated",deleted:"history_deleted",sync:"history_sync"},rv="history",nv="0.3",iv="expirer",cr={created:"expirer_created",deleted:"expirer_deleted",expired:"expirer_expired",sync:"expirer_sync"},ov="0.3";class sv{constructor(e,r){this.core=e,this.logger=r,this.keychain=new Map,this.name=Bw,this.version=jw,this.initialized=!1,this.storagePrefix=jr,this.init=async()=>{if(!this.initialized){const n=await this.getKeyChain();typeof n<"u"&&(this.keychain=n),this.initialized=!0}},this.has=n=>(this.isInitialized(),this.keychain.has(n)),this.set=async(n,i)=>{this.isInitialized(),this.keychain.set(n,i),await this.persist()},this.get=n=>{this.isInitialized();const i=this.keychain.get(n);if(typeof i>"u"){const{message:o}=ue("NO_MATCHING_KEY",`${this.name}: ${n}`);throw new Error(o)}return i},this.del=async n=>{this.isInitialized(),this.keychain.delete(n),await this.persist()},this.core=e,this.logger=ht.generateChildLogger(r,this.name)}get context(){return ht.getLoggerContext(this.logger)}get storageKey(){return this.storagePrefix+this.version+"//"+this.name}async setKeyChain(e){await this.core.storage.setItem(this.storageKey,Gh(e))}async getKeyChain(){const e=await this.core.storage.getItem(this.storageKey);return typeof e<"u"?Yh(e):void 0}async persist(){await this.setKeyChain(this.keychain)}isInitialized(){if(!this.initialized){const{message:e}=ue("NOT_INITIALIZED",this.name);throw new Error(e)}}}class av{constructor(e,r,n){this.core=e,this.logger=r,this.name=Mw,this.initialized=!1,this.init=async()=>{this.initialized||(await this.keychain.init(),this.initialized=!0)},this.hasKeys=i=>(this.isInitialized(),this.keychain.has(i)),this.getClientId=async()=>{this.isInitialized();const i=await this.getClientSeed(),o=T0(i);return P0(o.publicKey)},this.generateKeyPair=()=>{this.isInitialized();const i=c5();return this.setPrivateKey(i.publicKey,i.privateKey)},this.signJWT=async i=>{this.isInitialized();const o=await this.getClientSeed(),s=T0(o),a=Ca();return await y6(a,i,Uw,s)},this.generateSharedKey=(i,o,s)=>{this.isInitialized();const a=this.getPrivateKey(i),l=l5(a,o);return this.setSymKey(l,s)},this.setSymKey=async(i,o)=>{this.isInitialized();const s=o||u5(i);return await this.keychain.set(s,i),s},this.deleteKeyPair=async i=>{this.isInitialized(),await this.keychain.del(i)},this.deleteSymKey=async i=>{this.isInitialized(),await this.keychain.del(i)},this.encode=async(i,o,s)=>{this.isInitialized();const a=Hh(s),l=Si(o);if(zh(a)){const m=a.senderPublicKey,v=a.receiverPublicKey;i=await this.generateSharedKey(m,v)}const u=this.getSymKey(i),{type:d,senderPublicKey:y}=a;return f5({type:d,symKey:u,message:l,senderPublicKey:y})},this.decode=async(i,o,s)=>{this.isInitialized();const a=g5(o,s);if(zh(a)){const d=a.receiverPublicKey,y=a.senderPublicKey;i=await this.generateSharedKey(d,y)}const l=this.getSymKey(i),u=d5({symKey:l,encoded:o});return Va(u)},this.core=e,this.logger=ht.generateChildLogger(r,this.name),this.keychain=n||new sv(this.core,this.logger)}get context(){return ht.getLoggerContext(this.logger)}getPayloadType(e){const r=Sa(e);return ci(r.type)}async setPrivateKey(e,r){return await this.keychain.set(e,r),e}getPrivateKey(e){return this.keychain.get(e)}async getClientSeed(){let e="";try{e=this.keychain.get(f1)}catch{e=Ca(),await this.keychain.set(f1,e)}return Tw(e,"base16")}getSymKey(e){return this.keychain.get(e)}isInitialized(){if(!this.initialized){const{message:e}=ue("NOT_INITIALIZED",this.name);throw new Error(e)}}}class cv extends Jb{constructor(e,r){super(e,r),this.logger=e,this.core=r,this.messages=new Map,this.name=kw,this.version=Hw,this.initialized=!1,this.storagePrefix=jr,this.init=async()=>{if(!this.initialized){this.logger.trace("Initialized");try{const n=await this.getRelayerMessages();typeof n<"u"&&(this.messages=n),this.logger.debug(`Successfully Restored records for ${this.name}`),this.logger.trace({type:"method",method:"restore",size:this.messages.size})}catch(n){this.logger.debug(`Failed to Restore records for ${this.name}`),this.logger.error(n)}finally{this.initialized=!0}}},this.set=async(n,i)=>{this.isInitialized();const o=zo(i);let s=this.messages.get(n);return typeof s>"u"&&(s={}),typeof s[o]<"u"||(s[o]=i,this.messages.set(n,s),await this.persist()),o},this.get=n=>{this.isInitialized();let i=this.messages.get(n);return typeof i>"u"&&(i={}),i},this.has=(n,i)=>{this.isInitialized();const o=this.get(n),s=zo(i);return typeof o[s]<"u"},this.del=async n=>{this.isInitialized(),this.messages.delete(n),await this.persist()},this.logger=ht.generateChildLogger(e,this.name),this.core=r}get context(){return ht.getLoggerContext(this.logger)}get storageKey(){return this.storagePrefix+this.version+"//"+this.name}async setRelayerMessages(e){await this.core.storage.setItem(this.storageKey,Gh(e))}async getRelayerMessages(){const e=await this.core.storage.getItem(this.storageKey);return typeof e<"u"?Yh(e):void 0}async persist(){await this.setRelayerMessages(this.messages)}isInitialized(){if(!this.initialized){const{message:e}=ue("NOT_INITIALIZED",this.name);throw new Error(e)}}}class lv extends Xb{constructor(e,r){super(e,r),this.relayer=e,this.logger=r,this.events=new Dt.exports.EventEmitter,this.name=Ww,this.queue=new Map,this.publishTimeout=1e4,this.publish=async(n,i,o)=>{this.logger.debug("Publishing Payload"),this.logger.trace({type:"method",method:"publish",params:{topic:n,message:i,opts:o}});try{const s=o?.ttl||zw,a=Aa(o),l=o?.prompt||!1,u=o?.tag||0,d={topic:n,message:i,opts:{ttl:s,relay:a,prompt:l,tag:u}},y=zo(i);this.queue.set(y,d);try{await await Zh(this.rpcPublish(n,i,s,a,l,u),this.publishTimeout),this.relayer.events.emit(jt.publish,d)}catch{this.logger.debug("Publishing Payload stalled"),this.relayer.events.emit(jt.connection_stalled);return}this.onPublish(y,d),this.logger.debug("Successfully Published Payload"),this.logger.trace({type:"method",method:"publish",params:{topic:n,message:i,opts:o}})}catch(s){throw this.logger.debug("Failed to Publish Payload"),this.logger.error(s),s}},this.on=(n,i)=>{this.events.on(n,i)},this.once=(n,i)=>{this.events.once(n,i)},this.off=(n,i)=>{this.events.off(n,i)},this.removeListener=(n,i)=>{this.events.removeListener(n,i)},this.relayer=e,this.logger=ht.generateChildLogger(r,this.name),this.registerEventListeners()}get context(){return ht.getLoggerContext(this.logger)}rpcPublish(e,r,n,i,o,s){var a,l,u,d;const y={method:Ia(i.protocol).publish,params:{topic:e,message:r,ttl:n,prompt:o,tag:s}};return kt((a=y.params)==null?void 0:a.prompt)&&((l=y.params)==null||delete l.prompt),kt((u=y.params)==null?void 0:u.tag)&&((d=y.params)==null||delete d.tag),this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"message",direction:"outgoing",request:y}),this.relayer.provider.request(y)}onPublish(e,r){this.queue.delete(e)}checkQueue(){this.queue.forEach(async e=>{const{topic:r,message:n,opts:i}=e;await this.publish(r,n,i)})}registerEventListeners(){this.relayer.core.heartbeat.on(vi.HEARTBEAT_EVENTS.pulse,()=>{this.checkQueue()})}}class uv{constructor(){this.map=new Map,this.set=(e,r)=>{const n=this.get(e);this.exists(e,r)||this.map.set(e,[...n,r])},this.get=e=>this.map.get(e)||[],this.exists=(e,r)=>this.get(e).includes(r),this.delete=(e,r)=>{if(typeof r>"u"){this.map.delete(e);return}if(!this.map.has(e))return;const n=this.get(e);if(!this.exists(e,r))return;const i=n.filter(o=>o!==r);if(!i.length){this.map.delete(e);return}this.map.set(e,i)},this.clear=()=>{this.map.clear()}}get topics(){return Array.from(this.map.keys())}}var hv=Object.defineProperty,fv=Object.defineProperties,dv=Object.getOwnPropertyDescriptors,g1=Object.getOwnPropertySymbols,pv=Object.prototype.hasOwnProperty,gv=Object.prototype.propertyIsEnumerable,m1=(t,e,r)=>e in t?hv(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,es=(t,e)=>{for(var r in e||(e={}))pv.call(e,r)&&m1(t,r,e[r]);if(g1)for(var r of g1(e))gv.call(e,r)&&m1(t,r,e[r]);return t},oc=(t,e)=>fv(t,dv(e));class mv extends t6{constructor(e,r){super(e,r),this.relayer=e,this.logger=r,this.subscriptions=new Map,this.topicMap=new uv,this.events=new Dt.exports.EventEmitter,this.name=Jw,this.version=Xw,this.pending=new Map,this.cached=[],this.initialized=!1,this.pendingSubscriptionWatchLabel="pending_sub_watch_label",this.pollingInterval=20,this.storagePrefix=jr,this.subscribeTimeout=1e4,this.restartInProgress=!1,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restart(),this.registerEventListeners(),this.onEnable(),this.clientId=await this.relayer.core.crypto.getClientId())},this.subscribe=async(n,i)=>{await this.restartToComplete(),this.isInitialized(),this.logger.debug("Subscribing Topic"),this.logger.trace({type:"method",method:"subscribe",params:{topic:n,opts:i}});try{const o=Aa(i),s={topic:n,relay:o};this.pending.set(n,s);const a=await this.rpcSubscribe(n,o);return this.onSubscribe(a,s),this.logger.debug("Successfully Subscribed Topic"),this.logger.trace({type:"method",method:"subscribe",params:{topic:n,opts:i}}),a}catch(o){throw this.logger.debug("Failed to Subscribe Topic"),this.logger.error(o),o}},this.unsubscribe=async(n,i)=>{await this.restartToComplete(),this.isInitialized(),typeof i?.id<"u"?await this.unsubscribeById(n,i.id,i):await this.unsubscribeByTopic(n,i)},this.isSubscribed=async n=>this.topics.includes(n)?!0:await new Promise((i,o)=>{const s=new Fe.Watch;s.start(this.pendingSubscriptionWatchLabel);const a=setInterval(()=>{!this.pending.has(n)&&this.topics.includes(n)&&(clearInterval(a),s.stop(this.pendingSubscriptionWatchLabel),i(!0)),s.elapsed(this.pendingSubscriptionWatchLabel)>=Qw&&(clearInterval(a),s.stop(this.pendingSubscriptionWatchLabel),o(!1))},this.pollingInterval)}),this.on=(n,i)=>{this.events.on(n,i)},this.once=(n,i)=>{this.events.once(n,i)},this.off=(n,i)=>{this.events.off(n,i)},this.removeListener=(n,i)=>{this.events.removeListener(n,i)},this.restart=async()=>{this.restartInProgress=!0,await this.restore(),await this.reset(),this.restartInProgress=!1},this.relayer=e,this.logger=ht.generateChildLogger(r,this.name),this.clientId=""}get context(){return ht.getLoggerContext(this.logger)}get storageKey(){return this.storagePrefix+this.version+"//"+this.name}get length(){return this.subscriptions.size}get ids(){return Array.from(this.subscriptions.keys())}get values(){return Array.from(this.subscriptions.values())}get topics(){return this.topicMap.topics}hasSubscription(e,r){let n=!1;try{n=this.getSubscription(e).topic===r}catch{}return n}onEnable(){this.cached=[],this.initialized=!0}onDisable(){this.cached=this.values,this.subscriptions.clear(),this.topicMap.clear(),this.initialized=!1}async unsubscribeByTopic(e,r){const n=this.topicMap.get(e);await Promise.all(n.map(async i=>await this.unsubscribeById(e,i,r)))}async unsubscribeById(e,r,n){this.logger.debug("Unsubscribing Topic"),this.logger.trace({type:"method",method:"unsubscribe",params:{topic:e,id:r,opts:n}});try{const i=Aa(n);await this.rpcUnsubscribe(e,r,i);const o=xt("USER_DISCONNECTED",`${this.name}, ${e}`);await this.onUnsubscribe(e,r,o),this.logger.debug("Successfully Unsubscribed Topic"),this.logger.trace({type:"method",method:"unsubscribe",params:{topic:e,id:r,opts:n}})}catch(i){throw this.logger.debug("Failed to Unsubscribe Topic"),this.logger.error(i),i}}async rpcSubscribe(e,r){const n={method:Ia(r.protocol).subscribe,params:{topic:e}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:n});try{await await Zh(this.relayer.provider.request(n),this.subscribeTimeout)}catch{this.logger.debug("Outgoing Relay Payload stalled"),this.relayer.events.emit(jt.connection_stalled)}return zo(e+this.clientId)}rpcUnsubscribe(e,r,n){const i={method:Ia(n.protocol).unsubscribe,params:{topic:e,id:r}};return this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:i}),this.relayer.provider.request(i)}onSubscribe(e,r){this.setSubscription(e,oc(es({},r),{id:e})),this.pending.delete(r.topic)}onResubscribe(e,r){this.addSubscription(e,oc(es({},r),{id:e})),this.pending.delete(r.topic)}async onUnsubscribe(e,r,n){this.events.removeAllListeners(r),this.hasSubscription(r,e)&&this.deleteSubscription(r,n),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,r){this.subscriptions.has(e)||(this.logger.debug("Setting subscription"),this.logger.trace({type:"method",method:"setSubscription",id:e,subscription:r}),this.addSubscription(e,r))}addSubscription(e,r){this.subscriptions.set(e,es({},r)),this.topicMap.set(r.topic,e),this.events.emit(wr.created,r)}getSubscription(e){this.logger.debug("Getting subscription"),this.logger.trace({type:"method",method:"getSubscription",id:e});const r=this.subscriptions.get(e);if(!r){const{message:n}=ue("NO_MATCHING_KEY",`${this.name}: ${e}`);throw new Error(n)}return r}deleteSubscription(e,r){this.logger.debug("Deleting subscription"),this.logger.trace({type:"method",method:"deleteSubscription",id:e,reason:r});const n=this.getSubscription(e);this.subscriptions.delete(e),this.topicMap.delete(n.topic,e),this.events.emit(wr.deleted,oc(es({},n),{reason:r}))}async persist(){await this.setRelayerSubscriptions(this.values),this.events.emit(wr.sync)}async reset(){this.cached.length&&await Promise.all(this.cached.map(async e=>await this.resubscribe(e))),this.events.emit(wr.resubscribed)}async restore(){try{const e=await this.getRelayerSubscriptions();if(typeof e>"u"||!e.length)return;if(this.subscriptions.size){const{message:r}=ue("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(r),this.logger.error(`${this.name}: ${JSON.stringify(this.values)}`),new Error(r)}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 resubscribe(e){if(!this.ids.includes(e.id)){const{topic:r,relay:n}=e,i={topic:r,relay:n};this.pending.set(i.topic,i);const o=await this.rpcSubscribe(i.topic,i.relay);this.onResubscribe(o,i)}}async onConnect(){this.restartInProgress||(await this.restart(),this.onEnable())}onDisconnect(){this.onDisable()}checkPending(){this.relayer.transportExplicitlyClosed||this.pending.forEach(async e=>{const r=await this.rpcSubscribe(e.topic,e.relay);this.onSubscribe(r,e)})}registerEventListeners(){this.relayer.core.heartbeat.on(vi.HEARTBEAT_EVENTS.pulse,()=>{this.checkPending()}),this.relayer.on(jt.connect,async()=>{await this.onConnect()}),this.relayer.on(jt.disconnect,()=>{this.onDisconnect()}),this.events.on(wr.created,async e=>{const r=wr.created;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),await this.persist()}),this.events.on(wr.deleted,async e=>{const r=wr.deleted;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),await this.persist()})}isInitialized(){if(!this.initialized){const{message:e}=ue("NOT_INITIALIZED",this.name);throw new Error(e)}}async restartToComplete(){this.restartInProgress&&await new Promise(e=>{const r=setInterval(()=>{this.restartInProgress||(clearInterval(r),e())},this.pollingInterval)})}}var bv=Object.defineProperty,b1=Object.getOwnPropertySymbols,yv=Object.prototype.hasOwnProperty,wv=Object.prototype.propertyIsEnumerable,y1=(t,e,r)=>e in t?bv(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,vv=(t,e)=>{for(var r in e||(e={}))yv.call(e,r)&&y1(t,r,e[r]);if(b1)for(var r of b1(e))wv.call(e,r)&&y1(t,r,e[r]);return t};class _v extends Qb{constructor(e){super(e),this.protocol="wc",this.version=2,this.events=new Dt.exports.EventEmitter,this.name=Kw,this.transportExplicitlyClosed=!1,this.initialized=!1,this.reconnecting=!1,this.core=e.core,this.logger=typeof e.logger<"u"&&typeof e.logger!="string"?ht.generateChildLogger(e.logger,this.name):fi(ht.getDefaultLoggerOptions({level:e.logger||Vw})),this.messages=new cv(this.logger,e.core),this.subscriber=new mv(this,this.logger),this.publisher=new lv(this,this.logger),this.relayUrl=e?.relayUrl||qw,this.projectId=e.projectId,this.provider={}}async init(){this.logger.trace("Initialized"),this.provider=await this.createProvider(),await Promise.all([this.messages.init(),this.transportOpen(),this.subscriber.init()]),this.registerEventListeners(),this.initialized=!0}get context(){return ht.getLoggerContext(this.logger)}get connected(){return this.provider.connection.connected}get connecting(){return this.provider.connection.connecting}async publish(e,r,n){this.isInitialized(),await this.publisher.publish(e,r,n),await this.recordMessageEvent({topic:e,message:r})}async subscribe(e,r){this.isInitialized();let n="";return await Promise.all([new Promise(i=>{this.subscriber.once(wr.created,o=>{o.topic===e&&i()})}),new Promise(async i=>{n=await this.subscriber.subscribe(e,r),i()})]),n}async unsubscribe(e,r){this.isInitialized(),await this.subscriber.unsubscribe(e,r)}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}off(e,r){this.events.off(e,r)}removeListener(e,r){this.events.removeListener(e,r)}async transportClose(){this.transportExplicitlyClosed=!0,this.connected&&(await this.provider.disconnect(),this.events.emit(jt.transport_closed))}async transportOpen(e){if(!this.reconnecting){this.relayUrl=e||this.relayUrl,this.transportExplicitlyClosed=!1,this.reconnecting=!0;try{await Promise.all([new Promise(r=>{this.initialized||r(),this.subscriber.once(wr.resubscribed,()=>{r()})}),await Promise.race([this.provider.connect(),new Promise((r,n)=>this.once(jt.transport_closed,()=>{n(new Error("closeTransport called before connection was established"))}))])])}catch(r){const n=r;if(!/socket hang up/i.test(n.message))throw r;this.logger.error(r),this.events.emit(jt.transport_closed)}finally{this.reconnecting=!1}}}async restartTransport(e){this.transportExplicitlyClosed||(await this.transportClose(),await new Promise(r=>setTimeout(r,p1)),await this.transportOpen(e))}async createProvider(){const e=await this.core.crypto.signJWT(this.relayUrl);return new Oi(new ay(D5({sdkVersion:Yw,protocol:this.protocol,version:this.version,relayUrl:this.relayUrl,projectId:this.projectId,auth:e})))}async recordMessageEvent(e){const{topic:r,message:n}=e;await this.messages.set(r,n)}async shouldIgnoreMessageEvent(e){const{topic:r,message:n}=e;return await this.subscriber.isSubscribed(r)?this.messages.has(r,n):!0}async onProviderPayload(e){if(this.logger.debug("Incoming Relay Payload"),this.logger.trace({type:"payload",direction:"incoming",payload:e}),Xa(e)){if(!e.method.endsWith(Gw))return;const r=e.params,{topic:n,message:i}=r.data,o={topic:n,message:i};this.logger.debug("Emitting Relayer Payload"),this.logger.trace(vv({type:"event",event:r.id},o)),this.events.emit(r.id,o),await this.acknowledgePayload(e),await this.onMessageEvent(o)}}async onMessageEvent(e){await this.shouldIgnoreMessageEvent(e)||(this.events.emit(jt.message,e),await this.recordMessageEvent(e))}async acknowledgePayload(e){const r=Ja(e.id,!0);await this.provider.connection.send(r)}registerEventListeners(){this.provider.on(Qo.payload,e=>this.onProviderPayload(e)),this.provider.on(Qo.connect,()=>{this.events.emit(jt.connect)}),this.provider.on(Qo.disconnect,()=>{this.events.emit(jt.disconnect),this.attemptToReconnect()}),this.provider.on(Qo.error,e=>this.events.emit(jt.error,e)),this.events.on(jt.connection_stalled,async()=>{await this.restartTransport()})}attemptToReconnect(){this.transportExplicitlyClosed||setTimeout(async()=>{await this.transportOpen()},Fe.toMiliseconds(p1))}isInitialized(){if(!this.initialized){const{message:e}=ue("NOT_INITIALIZED",this.name);throw new Error(e)}}}var Ev=Object.defineProperty,w1=Object.getOwnPropertySymbols,xv=Object.prototype.hasOwnProperty,Cv=Object.prototype.propertyIsEnumerable,v1=(t,e,r)=>e in t?Ev(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,_1=(t,e)=>{for(var r in e||(e={}))xv.call(e,r)&&v1(t,r,e[r]);if(w1)for(var r of w1(e))Cv.call(e,r)&&v1(t,r,e[r]);return t};class ts extends e6{constructor(e,r,n,i=jr,o=void 0){super(e,r,n,i),this.core=e,this.logger=r,this.name=n,this.map=new Map,this.version=Zw,this.cached=[],this.initialized=!1,this.storagePrefix=jr,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(s=>{Z5(s)?this.map.set(s.id,s):J5(s)?this.map.set(s.topic,s):this.getKey&&s!==null&&!kt(s)&&this.map.set(this.getKey(s),s)}),this.cached=[],this.initialized=!0)},this.set=async(s,a)=>{this.isInitialized(),this.map.has(s)?await this.update(s,a):(this.logger.debug("Setting value"),this.logger.trace({type:"method",method:"set",key:s,value:a}),this.map.set(s,a),await this.persist())},this.get=s=>(this.isInitialized(),this.logger.debug("Getting value"),this.logger.trace({type:"method",method:"get",key:s}),this.getData(s)),this.getAll=s=>(this.isInitialized(),s?this.values.filter(a=>Object.keys(s).every(l=>cy(a[l],s[l]))):this.values),this.update=async(s,a)=>{this.isInitialized(),this.logger.debug("Updating value"),this.logger.trace({type:"method",method:"update",key:s,update:a});const l=_1(_1({},this.getData(s)),a);this.map.set(s,l),await this.persist()},this.delete=async(s,a)=>{this.isInitialized(),this.map.has(s)&&(this.logger.debug("Deleting value"),this.logger.trace({type:"method",method:"delete",key:s,reason:a}),this.map.delete(s),await this.persist())},this.logger=ht.generateChildLogger(r,this.name),this.storagePrefix=i,this.getKey=o}get context(){return ht.getLoggerContext(this.logger)}get storageKey(){return this.storagePrefix+this.version+"//"+this.name}get length(){return this.map.size}get keys(){return Array.from(this.map.keys())}get values(){return Array.from(this.map.values())}async setDataStore(e){await this.core.storage.setItem(this.storageKey,e)}async getDataStore(){return await this.core.storage.getItem(this.storageKey)}getData(e){const r=this.map.get(e);if(!r){const{message:n}=ue("NO_MATCHING_KEY",`${this.name}: ${e}`);throw this.logger.error(n),new Error(n)}return r}async persist(){await this.setDataStore(this.values)}async restore(){try{const e=await this.getDataStore();if(typeof e>"u"||!e.length)return;if(this.map.size){const{message:r}=ue("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(r),new Error(r)}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){const{message:e}=ue("NOT_INITIALIZED",this.name);throw new Error(e)}}}class Sv{constructor(e,r){this.core=e,this.logger=r,this.name=ev,this.version=tv,this.events=new Dt.exports,this.initialized=!1,this.storagePrefix=jr,this.ignoredPayloadTypes=[Qr],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:n})=>{this.isInitialized(),this.registeredMethods=[...new Set([...this.registeredMethods,...n])]},this.create=async()=>{this.isInitialized();const n=Ca(),i=await this.core.crypto.setSymKey(n),o=br(Fe.FIVE_MINUTES),s={protocol:d1},a={topic:i,expiry:o,relay:s,active:!1},l=j5({protocol:this.core.protocol,version:this.core.version,topic:i,symKey:n,relay:s});return await this.pairings.set(i,a),await this.core.relayer.subscribe(i),this.core.expirer.set(i,o),{topic:i,uri:l}},this.pair=async n=>{this.isInitialized(),this.isValidPair(n);const{topic:i,symKey:o,relay:s}=U5(n.uri),a=br(Fe.FIVE_MINUTES),l={topic:i,relay:s,expiry:a,active:!1};return await this.pairings.set(i,l),await this.core.crypto.setSymKey(o,i),await this.core.relayer.subscribe(i,{relay:s}),this.core.expirer.set(i,a),n.activatePairing&&await this.activate({topic:i}),l},this.activate=async({topic:n})=>{this.isInitialized();const i=br(Fe.THIRTY_DAYS);await this.pairings.update(n,{active:!0,expiry:i}),this.core.expirer.set(n,i)},this.ping=async n=>{this.isInitialized(),await this.isValidPing(n);const{topic:i}=n;if(this.pairings.keys.includes(i)){const o=await this.sendRequest(i,"wc_pairingPing",{}),{done:s,resolve:a,reject:l}=en();this.events.once(Et("pairing_ping",o),({error:u})=>{u?l(u):a()}),await s()}},this.updateExpiry=async({topic:n,expiry:i})=>{this.isInitialized(),await this.pairings.update(n,{expiry:i})},this.updateMetadata=async({topic:n,metadata:i})=>{this.isInitialized(),await this.pairings.update(n,{peerMetadata:i})},this.getPairings=()=>(this.isInitialized(),this.pairings.values),this.disconnect=async n=>{this.isInitialized(),await this.isValidDisconnect(n);const{topic:i}=n;this.pairings.keys.includes(i)&&(await this.sendRequest(i,"wc_pairingDelete",xt("USER_DISCONNECTED")),await this.deletePairing(i))},this.sendRequest=async(n,i,o)=>{const s=Zo(i,o),a=await this.core.crypto.encode(n,s),l=$i[i].req;return this.core.history.set(n,s),await this.core.relayer.publish(n,a,l),s.id},this.sendResult=async(n,i,o)=>{const s=Ja(n,o),a=await this.core.crypto.encode(i,s),l=await this.core.history.get(i,n),u=$i[l.request.method].res;await this.core.relayer.publish(i,a,u),await this.core.history.resolve(s)},this.sendError=async(n,i,o)=>{const s=Jo(n,o),a=await this.core.crypto.encode(i,s),l=await this.core.history.get(i,n),u=$i[l.request.method]?$i[l.request.method].res:$i.unregistered_method.res;await this.core.relayer.publish(i,a,u),await this.core.history.resolve(s)},this.deletePairing=async(n,i)=>{await this.core.relayer.unsubscribe(n),await Promise.all([this.pairings.delete(n,xt("USER_DISCONNECTED")),this.core.crypto.deleteSymKey(n),i?Promise.resolve():this.core.expirer.del(n)])},this.cleanup=async()=>{const n=this.pairings.getAll().filter(i=>Br(i.expiry));await Promise.all(n.map(i=>this.deletePairing(i.topic)))},this.onRelayEventRequest=n=>{const{topic:i,payload:o}=n,s=o.method;if(this.pairings.keys.includes(i))switch(s){case"wc_pairingPing":return this.onPairingPingRequest(i,o);case"wc_pairingDelete":return this.onPairingDeleteRequest(i,o);default:return this.onUnknownRpcMethodRequest(i,o)}},this.onRelayEventResponse=async n=>{const{topic:i,payload:o}=n,s=(await this.core.history.get(i,o.id)).request.method;if(this.pairings.keys.includes(i))switch(s){case"wc_pairingPing":return this.onPairingPingResponse(i,o);default:return this.onUnknownRpcMethodResponse(s)}},this.onPairingPingRequest=async(n,i)=>{const{id:o}=i;try{this.isValidPing({topic:n}),await this.sendResult(o,n,!0),this.events.emit("pairing_ping",{id:o,topic:n})}catch(s){await this.sendError(o,n,s),this.logger.error(s)}},this.onPairingPingResponse=(n,i)=>{const{id:o}=i;setTimeout(()=>{Or(i)?this.events.emit(Et("pairing_ping",o),{}):fr(i)&&this.events.emit(Et("pairing_ping",o),{error:i.error})},500)},this.onPairingDeleteRequest=async(n,i)=>{const{id:o}=i;try{this.isValidDisconnect({topic:n}),await this.sendResult(o,n,!0),await this.deletePairing(n),this.events.emit("pairing_delete",{id:o,topic:n})}catch(s){await this.sendError(o,n,s),this.logger.error(s)}},this.onUnknownRpcMethodRequest=async(n,i)=>{const{id:o,method:s}=i;try{if(this.registeredMethods.includes(s))return;const a=xt("WC_METHOD_UNSUPPORTED",s);await this.sendError(o,n,a),this.logger.error(a)}catch(a){await this.sendError(o,n,a),this.logger.error(a)}},this.onUnknownRpcMethodResponse=n=>{this.registeredMethods.includes(n)||this.logger.error(xt("WC_METHOD_UNSUPPORTED",n))},this.isValidPair=n=>{if(!Xt(n)){const{message:i}=ue("MISSING_OR_INVALID",`pair() params: ${n}`);throw new Error(i)}if(!Y5(n.uri)){const{message:i}=ue("MISSING_OR_INVALID",`pair() uri: ${n.uri}`);throw new Error(i)}},this.isValidPing=async n=>{if(!Xt(n)){const{message:o}=ue("MISSING_OR_INVALID",`ping() params: ${n}`);throw new Error(o)}const{topic:i}=n;await this.isValidPairingTopic(i)},this.isValidDisconnect=async n=>{if(!Xt(n)){const{message:o}=ue("MISSING_OR_INVALID",`disconnect() params: ${n}`);throw new Error(o)}const{topic:i}=n;await this.isValidPairingTopic(i)},this.isValidPairingTopic=async n=>{if(!$t(n,!1)){const{message:i}=ue("MISSING_OR_INVALID",`pairing topic should be a string: ${n}`);throw new Error(i)}if(!this.pairings.keys.includes(n)){const{message:i}=ue("NO_MATCHING_KEY",`pairing topic doesn't exist: ${n}`);throw new Error(i)}if(Br(this.pairings.get(n).expiry)){await this.deletePairing(n);const{message:i}=ue("EXPIRED",`pairing topic: ${n}`);throw new Error(i)}},this.core=e,this.logger=ht.generateChildLogger(r,this.name),this.pairings=new ts(this.core,this.logger,this.name,this.storagePrefix)}get context(){return ht.getLoggerContext(this.logger)}isInitialized(){if(!this.initialized){const{message:e}=ue("NOT_INITIALIZED",this.name);throw new Error(e)}}registerRelayerEvents(){this.core.relayer.on(jt.message,async e=>{const{topic:r,message:n}=e;if(this.ignoredPayloadTypes.includes(this.core.crypto.getPayloadType(n)))return;const i=await this.core.crypto.decode(r,n);Xa(i)?(this.core.history.set(r,i),this.onRelayEventRequest({topic:r,payload:i})):Qa(i)&&(await this.core.history.resolve(i),this.onRelayEventResponse({topic:r,payload:i}))})}registerExpirerEvents(){this.core.expirer.on(cr.expired,async e=>{const{topic:r}=Xh(e.target);r&&this.pairings.keys.includes(r)&&(await this.deletePairing(r,!0),this.events.emit("pairing_expire",{topic:r}))})}}class Av extends Zb{constructor(e,r){super(e,r),this.core=e,this.logger=r,this.records=new Map,this.events=new Dt.exports.EventEmitter,this.name=rv,this.version=nv,this.cached=[],this.initialized=!1,this.storagePrefix=jr,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(n=>this.records.set(n.id,n)),this.cached=[],this.registerEventListeners(),this.initialized=!0)},this.set=(n,i,o)=>{if(this.isInitialized(),this.logger.debug("Setting JSON-RPC request history record"),this.logger.trace({type:"method",method:"set",topic:n,request:i,chainId:o}),this.records.has(i.id))return;const s={id:i.id,topic:n,request:{method:i.method,params:i.params||null},chainId:o};this.records.set(s.id,s),this.events.emit(vr.created,s)},this.resolve=async n=>{if(this.isInitialized(),this.logger.debug("Updating JSON-RPC response history record"),this.logger.trace({type:"method",method:"update",response:n}),!this.records.has(n.id))return;const i=await this.getRecord(n.id);typeof i.response>"u"&&(i.response=fr(n)?{error:n.error}:{result:n.result},this.records.set(i.id,i),this.events.emit(vr.updated,i))},this.get=async(n,i)=>(this.isInitialized(),this.logger.debug("Getting record"),this.logger.trace({type:"method",method:"get",topic:n,id:i}),await this.getRecord(i)),this.delete=(n,i)=>{this.isInitialized(),this.logger.debug("Deleting record"),this.logger.trace({type:"method",method:"delete",id:i}),this.values.forEach(o=>{if(o.topic===n){if(typeof i<"u"&&o.id!==i)return;this.records.delete(o.id),this.events.emit(vr.deleted,o)}})},this.exists=async(n,i)=>(this.isInitialized(),this.records.has(i)?(await this.getRecord(i)).topic===n:!1),this.on=(n,i)=>{this.events.on(n,i)},this.once=(n,i)=>{this.events.once(n,i)},this.off=(n,i)=>{this.events.off(n,i)},this.removeListener=(n,i)=>{this.events.removeListener(n,i)},this.logger=ht.generateChildLogger(r,this.name)}get context(){return ht.getLoggerContext(this.logger)}get storageKey(){return this.storagePrefix+this.version+"//"+this.name}get size(){return this.records.size}get keys(){return Array.from(this.records.keys())}get values(){return Array.from(this.records.values())}get pending(){const e=[];return this.values.forEach(r=>{if(typeof r.response<"u")return;const n={topic:r.topic,request:Zo(r.request.method,r.request.params,r.id),chainId:r.chainId};return e.push(n)}),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();const r=this.records.get(e);if(!r){const{message:n}=ue("NO_MATCHING_KEY",`${this.name}: ${e}`);throw new Error(n)}return r}async persist(){await this.setJsonRpcRecords(this.values),this.events.emit(vr.sync)}async restore(){try{const e=await this.getJsonRpcRecords();if(typeof e>"u"||!e.length)return;if(this.records.size){const{message:r}=ue("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(r),new Error(r)}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(vr.created,e=>{const r=vr.created;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,record:e}),this.persist()}),this.events.on(vr.updated,e=>{const r=vr.updated;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,record:e}),this.persist()}),this.events.on(vr.deleted,e=>{const r=vr.deleted;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,record:e}),this.persist()})}isInitialized(){if(!this.initialized){const{message:e}=ue("NOT_INITIALIZED",this.name);throw new Error(e)}}}class Iv extends r6{constructor(e,r){super(e,r),this.core=e,this.logger=r,this.expirations=new Map,this.events=new Dt.exports.EventEmitter,this.name=iv,this.version=ov,this.cached=[],this.initialized=!1,this.storagePrefix=jr,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(n=>this.expirations.set(n.target,n)),this.cached=[],this.registerEventListeners(),this.initialized=!0)},this.has=n=>{try{const i=this.formatTarget(n);return typeof this.getExpiration(i)<"u"}catch{return!1}},this.set=(n,i)=>{this.isInitialized();const o=this.formatTarget(n),s={target:o,expiry:i};this.expirations.set(o,s),this.checkExpiry(o,s),this.events.emit(cr.created,{target:o,expiration:s})},this.get=n=>{this.isInitialized();const i=this.formatTarget(n);return this.getExpiration(i)},this.del=n=>{if(this.isInitialized(),this.has(n)){const i=this.formatTarget(n),o=this.getExpiration(i);this.expirations.delete(i),this.events.emit(cr.deleted,{target:i,expiration:o})}},this.on=(n,i)=>{this.events.on(n,i)},this.once=(n,i)=>{this.events.once(n,i)},this.off=(n,i)=>{this.events.off(n,i)},this.removeListener=(n,i)=>{this.events.removeListener(n,i)},this.logger=ht.generateChildLogger(r,this.name)}get context(){return ht.getLoggerContext(this.logger)}get storageKey(){return this.storagePrefix+this.version+"//"+this.name}get length(){return this.expirations.size}get keys(){return Array.from(this.expirations.keys())}get values(){return Array.from(this.expirations.values())}formatTarget(e){if(typeof e=="string")return $5(e);if(typeof e=="number")return F5(e);const{message:r}=ue("UNKNOWN_TYPE",`Target type: ${typeof e}`);throw new Error(r)}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(cr.sync)}async restore(){try{const e=await this.getExpirations();if(typeof e>"u"||!e.length)return;if(this.expirations.size){const{message:r}=ue("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(r),new Error(r)}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){const r=this.expirations.get(e);if(!r){const{message:n}=ue("NO_MATCHING_KEY",`${this.name}: ${e}`);throw this.logger.error(n),new Error(n)}return r}checkExpiry(e,r){const{expiry:n}=r;Fe.toMiliseconds(n)-Date.now()<=0&&this.expire(e,r)}expire(e,r){this.expirations.delete(e),this.events.emit(cr.expired,{target:e,expiration:r})}checkExpirations(){this.expirations.forEach((e,r)=>this.checkExpiry(r,e))}registerEventListeners(){this.core.heartbeat.on(vi.HEARTBEAT_EVENTS.pulse,()=>this.checkExpirations()),this.events.on(cr.created,e=>{const r=cr.created;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),this.persist()}),this.events.on(cr.expired,e=>{const r=cr.expired;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),this.persist()}),this.events.on(cr.deleted,e=>{const r=cr.deleted;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),this.persist()})}isInitialized(){if(!this.initialized){const{message:e}=ue("NOT_INITIALIZED",this.name);throw new Error(e)}}}var Ov=Object.defineProperty,E1=Object.getOwnPropertySymbols,Dv=Object.prototype.hasOwnProperty,$v=Object.prototype.propertyIsEnumerable,x1=(t,e,r)=>e in t?Ov(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,C1=(t,e)=>{for(var r in e||(e={}))Dv.call(e,r)&&x1(t,r,e[r]);if(E1)for(var r of E1(e))$v.call(e,r)&&x1(t,r,e[r]);return t};class sc extends Yb{constructor(e){super(e),this.protocol=h1,this.version=Nw,this.name=ic,this.events=new Dt.exports.EventEmitter,this.initialized=!1,this.on=(n,i)=>this.events.on(n,i),this.once=(n,i)=>this.events.once(n,i),this.off=(n,i)=>this.events.off(n,i),this.removeListener=(n,i)=>this.events.removeListener(n,i),this.projectId=e?.projectId;const r=typeof e?.logger<"u"&&typeof e?.logger!="string"?e.logger:fi(ht.getDefaultLoggerOptions({level:e?.logger||Rw.logger}));this.logger=ht.generateChildLogger(r,this.name),this.heartbeat=new vi.HeartBeat,this.crypto=new av(this,this.logger,e?.keychain),this.history=new Av(this,this.logger),this.expirer=new Iv(this,this.logger),this.storage=e!=null&&e.storage?e.storage:new tb(C1(C1({},Lw),e?.storageOptions)),this.relayer=new _v({core:this,logger:this.logger,relayUrl:e?.relayUrl,projectId:this.projectId}),this.pairing=new Sv(this,this.logger)}static async init(e){const r=new sc(e);return await r.initialize(),r}get context(){return ht.getLoggerContext(this.logger)}async start(){this.initialized||await this.initialize()}async initialize(){this.logger.trace("Initialized");try{await this.crypto.init(),await this.history.init(),await this.expirer.init(),await this.relayer.init(),await this.heartbeat.init(),await this.pairing.init(),this.initialized=!0,this.logger.info("Core Initialization Success")}catch(e){throw this.logger.warn(`Core Initialization Failure at epoch ${Date.now()}`,e),this.logger.error(e.message),e}}}const Fv=sc,S1="wc",A1=2,I1="client",ac=`${S1}@${A1}:${I1}:`,cc={name:I1,logger:"error",controller:!1,relayUrl:"wss://relay.walletconnect.com"},Pv="proposal",Tv="session",rs=Fe.SEVEN_DAYS,Nv="engine",Fi={wc_sessionPropose:{req:{ttl:Fe.FIVE_MINUTES,prompt:!0,tag:1100},res:{ttl:Fe.FIVE_MINUTES,prompt:!1,tag:1101}},wc_sessionSettle:{req:{ttl:Fe.FIVE_MINUTES,prompt:!1,tag:1102},res:{ttl:Fe.FIVE_MINUTES,prompt:!1,tag:1103}},wc_sessionUpdate:{req:{ttl:Fe.ONE_DAY,prompt:!1,tag:1104},res:{ttl:Fe.ONE_DAY,prompt:!1,tag:1105}},wc_sessionExtend:{req:{ttl:Fe.ONE_DAY,prompt:!1,tag:1106},res:{ttl:Fe.ONE_DAY,prompt:!1,tag:1107}},wc_sessionRequest:{req:{ttl:Fe.FIVE_MINUTES,prompt:!0,tag:1108},res:{ttl:Fe.FIVE_MINUTES,prompt:!1,tag:1109}},wc_sessionEvent:{req:{ttl:Fe.FIVE_MINUTES,prompt:!0,tag:1110},res:{ttl:Fe.FIVE_MINUTES,prompt:!1,tag:1111}},wc_sessionDelete:{req:{ttl:Fe.ONE_DAY,prompt:!1,tag:1112},res:{ttl:Fe.ONE_DAY,prompt:!1,tag:1113}},wc_sessionPing:{req:{ttl:Fe.THIRTY_SECONDS,prompt:!1,tag:1114},res:{ttl:Fe.THIRTY_SECONDS,prompt:!1,tag:1115}}},lc={min:Fe.FIVE_MINUTES,max:Fe.SEVEN_DAYS},Rv="request";var Lv=Object.defineProperty,Mv=Object.defineProperties,Uv=Object.getOwnPropertyDescriptors,O1=Object.getOwnPropertySymbols,Bv=Object.prototype.hasOwnProperty,jv=Object.prototype.propertyIsEnumerable,D1=(t,e,r)=>e in t?Lv(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,lr=(t,e)=>{for(var r in e||(e={}))Bv.call(e,r)&&D1(t,r,e[r]);if(O1)for(var r of O1(e))jv.call(e,r)&&D1(t,r,e[r]);return t},uc=(t,e)=>Mv(t,Uv(e));class kv extends i6{constructor(e){super(e),this.name=Nv,this.events=new Dt.exports,this.initialized=!1,this.ignoredPayloadTypes=[Qr],this.init=async()=>{this.initialized||(await this.cleanup(),this.registerRelayerEvents(),this.registerExpirerEvents(),this.client.core.pairing.register({methods:Object.keys(Fi)}),this.initialized=!0)},this.connect=async r=>{this.isInitialized();const n=uc(lr({},r),{requiredNamespaces:r.requiredNamespaces||{},optionalNamespaces:r.optionalNamespaces||{}});await this.isValidConnect(n);const{pairingTopic:i,requiredNamespaces:o,optionalNamespaces:s,sessionProperties:a,relays:l}=n;let u=i,d,y=!1;if(u&&(y=this.client.core.pairing.pairings.get(u).active),!u||!y){const{topic:N,uri:C}=await this.client.core.pairing.create();u=N,d=C}const m=await this.client.core.crypto.generateKeyPair(),v=lr({requiredNamespaces:o,optionalNamespaces:s,relays:l??[{protocol:d1}],proposer:{publicKey:m,metadata:this.client.metadata}},a&&{sessionProperties:a}),{reject:_,resolve:R,done:M}=en();if(this.events.once(Et("session_connect"),async({error:N,session:C})=>{if(N)_(N);else if(C){C.self.publicKey=m;const $=uc(lr({},C),{requiredNamespaces:C.requiredNamespaces,optionalNamespaces:C.optionalNamespaces});await this.client.session.set(C.topic,$),await this.setExpiry(C.topic,C.expiry),u&&await this.client.core.pairing.updateMetadata({topic:u,metadata:C.peer.metadata}),R($)}}),!u){const{message:N}=ue("NO_MATCHING_KEY",`connect() pairing topic: ${u}`);throw new Error(N)}const B=await this.sendRequest(u,"wc_sessionPropose",v),D=br(Fe.FIVE_MINUTES);return await this.setProposal(B,lr({id:B,expiry:D},v)),{uri:d,approval:M}},this.pair=async r=>(this.isInitialized(),await this.client.core.pairing.pair(r)),this.approve=async r=>{this.isInitialized(),await this.isValidApprove(r);const{id:n,relayProtocol:i,namespaces:o,sessionProperties:s}=r,a=this.client.proposal.get(n);let{pairingTopic:l,proposer:u,requiredNamespaces:d,optionalNamespaces:y}=a;hi(d)||(d=W5(o,"approve()"));const m=await this.client.core.crypto.generateKeyPair(),v=u.publicKey,_=await this.client.core.crypto.generateSharedKey(m,v);l&&n&&(await this.client.core.pairing.updateMetadata({topic:l,metadata:u.metadata}),await this.sendResult(n,l,{relay:{protocol:i??"irn"},responderPublicKey:m}),await this.client.proposal.delete(n,xt("USER_DISCONNECTED")),await this.client.core.pairing.activate({topic:l}));const R=lr({relay:{protocol:i??"irn"},namespaces:o,requiredNamespaces:d,optionalNamespaces:y,controller:{publicKey:m,metadata:this.client.metadata},expiry:br(rs)},s&&{sessionProperties:s});await this.client.core.relayer.subscribe(_);const M=await this.sendRequest(_,"wc_sessionSettle",R),{done:B,resolve:D,reject:N}=en();this.events.once(Et("session_approve",M),({error:$})=>{$?N($):D(this.client.session.get(_))});const C=uc(lr({},R),{topic:_,acknowledged:!1,self:R.controller,peer:{publicKey:u.publicKey,metadata:u.metadata},controller:m});return await this.client.session.set(_,C),await this.setExpiry(_,br(rs)),{topic:_,acknowledged:B}},this.reject=async r=>{this.isInitialized(),await this.isValidReject(r);const{id:n,reason:i}=r,{pairingTopic:o}=this.client.proposal.get(n);o&&(await this.sendError(n,o,i),await this.client.proposal.delete(n,xt("USER_DISCONNECTED")))},this.update=async r=>{this.isInitialized(),await this.isValidUpdate(r);const{topic:n,namespaces:i}=r,o=await this.sendRequest(n,"wc_sessionUpdate",{namespaces:i}),{done:s,resolve:a,reject:l}=en();return this.events.once(Et("session_update",o),({error:u})=>{u?l(u):a()}),await this.client.session.update(n,{namespaces:i}),{acknowledged:s}},this.extend=async r=>{this.isInitialized(),await this.isValidExtend(r);const{topic:n}=r,i=await this.sendRequest(n,"wc_sessionExtend",{}),{done:o,resolve:s,reject:a}=en();return this.events.once(Et("session_extend",i),({error:l})=>{l?a(l):s()}),await this.setExpiry(n,br(rs)),{acknowledged:o}},this.request=async r=>{this.isInitialized(),await this.isValidRequest(r);const{chainId:n,request:i,topic:o,expiry:s}=r,a=await this.sendRequest(o,"wc_sessionRequest",{request:i,chainId:n},s),{done:l,resolve:u,reject:d}=en(s);return this.events.once(Et("session_request",a),({error:y,result:m})=>{y?d(y):u(m)}),await l()},this.respond=async r=>{this.isInitialized(),await this.isValidRespond(r);const{topic:n,response:i}=r,{id:o}=i;Or(i)?await this.sendResult(o,n,i.result):fr(i)&&await this.sendError(o,n,i.error),this.deletePendingSessionRequest(r.response.id,{message:"fulfilled",code:0})},this.ping=async r=>{this.isInitialized(),await this.isValidPing(r);const{topic:n}=r;if(this.client.session.keys.includes(n)){const i=await this.sendRequest(n,"wc_sessionPing",{}),{done:o,resolve:s,reject:a}=en();this.events.once(Et("session_ping",i),({error:l})=>{l?a(l):s()}),await o()}else this.client.core.pairing.pairings.keys.includes(n)&&await this.client.core.pairing.ping({topic:n})},this.emit=async r=>{this.isInitialized(),await this.isValidEmit(r);const{topic:n,event:i,chainId:o}=r;await this.sendRequest(n,"wc_sessionEvent",{event:i,chainId:o})},this.disconnect=async r=>{this.isInitialized(),await this.isValidDisconnect(r);const{topic:n}=r;this.client.session.keys.includes(n)?(await this.sendRequest(n,"wc_sessionDelete",xt("USER_DISCONNECTED")),await this.deleteSession(n)):await this.client.core.pairing.disconnect({topic:n})},this.find=r=>(this.isInitialized(),this.client.session.getAll().filter(n=>K5(n,r))),this.getPendingSessionRequests=()=>(this.isInitialized(),this.client.pendingRequest.getAll()),this.deleteSession=async(r,n)=>{const{self:i}=this.client.session.get(r);await this.client.core.relayer.unsubscribe(r),await Promise.all([this.client.session.delete(r,xt("USER_DISCONNECTED")),this.client.core.crypto.deleteKeyPair(i.publicKey),this.client.core.crypto.deleteSymKey(r),n?Promise.resolve():this.client.core.expirer.del(r)])},this.deleteProposal=async(r,n)=>{await Promise.all([this.client.proposal.delete(r,xt("USER_DISCONNECTED")),n?Promise.resolve():this.client.core.expirer.del(r)])},this.deletePendingSessionRequest=async(r,n,i=!1)=>{await Promise.all([this.client.pendingRequest.delete(r,n),i?Promise.resolve():this.client.core.expirer.del(r)])},this.setExpiry=async(r,n)=>{this.client.session.keys.includes(r)&&await this.client.session.update(r,{expiry:n}),this.client.core.expirer.set(r,n)},this.setProposal=async(r,n)=>{await this.client.proposal.set(r,n),this.client.core.expirer.set(r,n.expiry)},this.setPendingSessionRequest=async r=>{const n=Fi.wc_sessionRequest.req.ttl,{id:i,topic:o,params:s}=r;await this.client.pendingRequest.set(i,{id:i,topic:o,params:s}),n&&this.client.core.expirer.set(i,br(n))},this.sendRequest=async(r,n,i,o)=>{const s=Zo(n,i),a=await this.client.core.crypto.encode(r,s),l=Fi[n].req;return o&&(l.ttl=o),this.client.core.history.set(r,s),this.client.core.relayer.publish(r,a,l),s.id},this.sendResult=async(r,n,i)=>{const o=Ja(r,i),s=await this.client.core.crypto.encode(n,o),a=await this.client.core.history.get(n,r),l=Fi[a.request.method].res;this.client.core.relayer.publish(n,s,l),await this.client.core.history.resolve(o)},this.sendError=async(r,n,i)=>{const o=Jo(r,i),s=await this.client.core.crypto.encode(n,o),a=await this.client.core.history.get(n,r),l=Fi[a.request.method].res;this.client.core.relayer.publish(n,s,l),await this.client.core.history.resolve(o)},this.cleanup=async()=>{const r=[],n=[];this.client.session.getAll().forEach(i=>{Br(i.expiry)&&r.push(i.topic)}),this.client.proposal.getAll().forEach(i=>{Br(i.expiry)&&n.push(i.id)}),await Promise.all([...r.map(i=>this.deleteSession(i)),...n.map(i=>this.deleteProposal(i))])},this.onRelayEventRequest=r=>{const{topic:n,payload:i}=r,o=i.method;switch(o){case"wc_sessionPropose":return this.onSessionProposeRequest(n,i);case"wc_sessionSettle":return this.onSessionSettleRequest(n,i);case"wc_sessionUpdate":return this.onSessionUpdateRequest(n,i);case"wc_sessionExtend":return this.onSessionExtendRequest(n,i);case"wc_sessionPing":return this.onSessionPingRequest(n,i);case"wc_sessionDelete":return this.onSessionDeleteRequest(n,i);case"wc_sessionRequest":return this.onSessionRequest(n,i);case"wc_sessionEvent":return this.onSessionEventRequest(n,i);default:return this.client.logger.info(`Unsupported request method ${o}`)}},this.onRelayEventResponse=async r=>{const{topic:n,payload:i}=r,o=(await this.client.core.history.get(n,i.id)).request.method;switch(o){case"wc_sessionPropose":return this.onSessionProposeResponse(n,i);case"wc_sessionSettle":return this.onSessionSettleResponse(n,i);case"wc_sessionUpdate":return this.onSessionUpdateResponse(n,i);case"wc_sessionExtend":return this.onSessionExtendResponse(n,i);case"wc_sessionPing":return this.onSessionPingResponse(n,i);case"wc_sessionRequest":return this.onSessionRequestResponse(n,i);default:return this.client.logger.info(`Unsupported response method ${o}`)}},this.onSessionProposeRequest=async(r,n)=>{const{params:i,id:o}=n;try{this.isValidConnect(lr({},n.params));const s=br(Fe.FIVE_MINUTES),a=lr({id:o,pairingTopic:r,expiry:s},i);await this.setProposal(o,a),this.client.events.emit("session_proposal",{id:o,params:a})}catch(s){await this.sendError(o,r,s),this.client.logger.error(s)}},this.onSessionProposeResponse=async(r,n)=>{const{id:i}=n;if(Or(n)){const{result:o}=n;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",result:o});const s=this.client.proposal.get(i);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",proposal:s});const a=s.proposer.publicKey;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",selfPublicKey:a});const l=o.responderPublicKey;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",peerPublicKey:l});const u=await this.client.core.crypto.generateSharedKey(a,l);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",sessionTopic:u});const d=await this.client.core.relayer.subscribe(u);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",subscriptionId:d}),await this.client.core.pairing.activate({topic:r})}else fr(n)&&(await this.client.proposal.delete(i,xt("USER_DISCONNECTED")),this.events.emit(Et("session_connect"),{error:n.error}))},this.onSessionSettleRequest=async(r,n)=>{const{id:i,params:o}=n;try{this.isValidSessionSettleRequest(o);const{relay:s,controller:a,expiry:l,namespaces:u,requiredNamespaces:d,optionalNamespaces:y,sessionProperties:m}=n.params,v=lr({topic:r,relay:s,expiry:l,namespaces:u,acknowledged:!0,requiredNamespaces:d,optionalNamespaces:y,controller:a.publicKey,self:{publicKey:"",metadata:this.client.metadata},peer:{publicKey:a.publicKey,metadata:a.metadata}},m&&{sessionProperties:m});await this.sendResult(n.id,r,!0),this.events.emit(Et("session_connect"),{session:v})}catch(s){await this.sendError(i,r,s),this.client.logger.error(s)}},this.onSessionSettleResponse=async(r,n)=>{const{id:i}=n;Or(n)?(await this.client.session.update(r,{acknowledged:!0}),this.events.emit(Et("session_approve",i),{})):fr(n)&&(await this.client.session.delete(r,xt("USER_DISCONNECTED")),this.events.emit(Et("session_approve",i),{error:n.error}))},this.onSessionUpdateRequest=async(r,n)=>{const{params:i,id:o}=n;try{this.isValidUpdate(lr({topic:r},i)),await this.client.session.update(r,{namespaces:i.namespaces}),await this.sendResult(o,r,!0),this.client.events.emit("session_update",{id:o,topic:r,params:i})}catch(s){await this.sendError(o,r,s),this.client.logger.error(s)}},this.onSessionUpdateResponse=(r,n)=>{const{id:i}=n;Or(n)?this.events.emit(Et("session_update",i),{}):fr(n)&&this.events.emit(Et("session_update",i),{error:n.error})},this.onSessionExtendRequest=async(r,n)=>{const{id:i}=n;try{this.isValidExtend({topic:r}),await this.setExpiry(r,br(rs)),await this.sendResult(i,r,!0),this.client.events.emit("session_extend",{id:i,topic:r})}catch(o){await this.sendError(i,r,o),this.client.logger.error(o)}},this.onSessionExtendResponse=(r,n)=>{const{id:i}=n;Or(n)?this.events.emit(Et("session_extend",i),{}):fr(n)&&this.events.emit(Et("session_extend",i),{error:n.error})},this.onSessionPingRequest=async(r,n)=>{const{id:i}=n;try{this.isValidPing({topic:r}),await this.sendResult(i,r,!0),this.client.events.emit("session_ping",{id:i,topic:r})}catch(o){await this.sendError(i,r,o),this.client.logger.error(o)}},this.onSessionPingResponse=(r,n)=>{const{id:i}=n;setTimeout(()=>{Or(n)?this.events.emit(Et("session_ping",i),{}):fr(n)&&this.events.emit(Et("session_ping",i),{error:n.error})},500)},this.onSessionDeleteRequest=async(r,n)=>{const{id:i}=n;try{this.isValidDisconnect({topic:r,reason:n.params}),this.client.core.relayer.once(jt.publish,async()=>{await this.deleteSession(r)}),await this.sendResult(i,r,!0),this.client.events.emit("session_delete",{id:i,topic:r})}catch(o){await this.sendError(i,r,o),this.client.logger.error(o)}},this.onSessionRequest=async(r,n)=>{const{id:i,params:o}=n;try{this.isValidRequest(lr({topic:r},o)),await this.setPendingSessionRequest({id:i,topic:r,params:o}),this.client.events.emit("session_request",{id:i,topic:r,params:o})}catch(s){await this.sendError(i,r,s),this.client.logger.error(s)}},this.onSessionRequestResponse=(r,n)=>{const{id:i}=n;Or(n)?this.events.emit(Et("session_request",i),{result:n.result}):fr(n)&&this.events.emit(Et("session_request",i),{error:n.error})},this.onSessionEventRequest=async(r,n)=>{const{id:i,params:o}=n;try{this.isValidEmit(lr({topic:r},o)),this.client.events.emit("session_event",{id:i,topic:r,params:o})}catch(s){await this.sendError(i,r,s),this.client.logger.error(s)}},this.isValidConnect=async r=>{if(!Xt(r)){const{message:l}=ue("MISSING_OR_INVALID",`connect() params: ${JSON.stringify(r)}`);throw new Error(l)}const{pairingTopic:n,requiredNamespaces:i,optionalNamespaces:o,sessionProperties:s,relays:a}=r;if(kt(n)||await this.isValidPairingTopic(n),!om(a,!0)){const{message:l}=ue("MISSING_OR_INVALID",`connect() relays: ${a}`);throw new Error(l)}!kt(i)&&hi(i)!==0&&this.validateNamespaces(i,"requiredNamespaces"),!kt(o)&&hi(o)!==0&&this.validateNamespaces(o,"optionalNamespaces"),kt(s)||this.validateSessionProps(s,"sessionProperties")},this.validateNamespaces=(r,n)=>{const i=im(r,"connect()",n);if(i)throw new Error(i.message)},this.isValidApprove=async r=>{if(!Xt(r))throw new Error(ue("MISSING_OR_INVALID",`approve() params: ${r}`).message);const{id:n,namespaces:i,relayProtocol:o,sessionProperties:s}=r;await this.isValidProposalId(n);const a=this.client.proposal.get(n),l=Wo(i,"approve()");if(l)throw new Error(l.message);const u=$a(a.requiredNamespaces,i,"approve()","requiredNamespaces");if(u)throw new Error(u.message);if(!$t(o,!0)){const{message:d}=ue("MISSING_OR_INVALID",`approve() relayProtocol: ${o}`);throw new Error(d)}if(Object.keys(i).length>Object.keys(a.requiredNamespaces).length){const d=Object.keys(a.optionalNamespaces).filter(v=>i[v]),y={};for(const v in a.optionalNamespaces)d.includes(v)&&(y[v]=a.optionalNamespaces[v]);const m=$a(y,i,"approve()","optionalNamespaces");if(m)throw new Error(m.message)}kt(s)||this.validateSessionProps(s,"sessionProperties")},this.isValidReject=async r=>{if(!Xt(r)){const{message:o}=ue("MISSING_OR_INVALID",`reject() params: ${r}`);throw new Error(o)}const{id:n,reason:i}=r;if(await this.isValidProposalId(n),!am(i)){const{message:o}=ue("MISSING_OR_INVALID",`reject() reason: ${JSON.stringify(i)}`);throw new Error(o)}},this.isValidSessionSettleRequest=r=>{if(!Xt(r)){const{message:u}=ue("MISSING_OR_INVALID",`onSessionSettleRequest() params: ${r}`);throw new Error(u)}const{relay:n,controller:i,namespaces:o,expiry:s}=r;if(!n0(n)){const{message:u}=ue("MISSING_OR_INVALID","onSessionSettleRequest() relay protocol should be a string");throw new Error(u)}const a=X5(i,"onSessionSettleRequest()");if(a)throw new Error(a.message);const l=Wo(o,"onSessionSettleRequest()");if(l)throw new Error(l.message);if(Br(s)){const{message:u}=ue("EXPIRED","onSessionSettleRequest()");throw new Error(u)}},this.isValidUpdate=async r=>{if(!Xt(r)){const{message:l}=ue("MISSING_OR_INVALID",`update() params: ${r}`);throw new Error(l)}const{topic:n,namespaces:i}=r;await this.isValidSessionTopic(n);const o=this.client.session.get(n),s=Wo(i,"update()");if(s)throw new Error(s.message);const a=$a(o.requiredNamespaces,i,"update()","requiredNamespaces");if(a)throw new Error(a.message)},this.isValidExtend=async r=>{if(!Xt(r)){const{message:i}=ue("MISSING_OR_INVALID",`extend() params: ${r}`);throw new Error(i)}const{topic:n}=r;await this.isValidSessionTopic(n)},this.isValidRequest=async r=>{if(!Xt(r)){const{message:l}=ue("MISSING_OR_INVALID",`request() params: ${r}`);throw new Error(l)}const{topic:n,request:i,chainId:o,expiry:s}=r;await this.isValidSessionTopic(n);const{namespaces:a}=this.client.session.get(n);if(!i0(a,o)){const{message:l}=ue("MISSING_OR_INVALID",`request() chainId: ${o}`);throw new Error(l)}if(!cm(i)){const{message:l}=ue("MISSING_OR_INVALID",`request() ${JSON.stringify(i)}`);throw new Error(l)}if(!hm(a,o,i.method)){const{message:l}=ue("MISSING_OR_INVALID",`request() method: ${i.method}`);throw new Error(l)}if(s&&!dm(s,lc)){const{message:l}=ue("MISSING_OR_INVALID",`request() expiry: ${s}. Expiry must be a number (in seconds) between ${lc.min} and ${lc.max}`);throw new Error(l)}},this.isValidRespond=async r=>{if(!Xt(r)){const{message:o}=ue("MISSING_OR_INVALID",`respond() params: ${r}`);throw new Error(o)}const{topic:n,response:i}=r;if(await this.isValidSessionTopic(n),!lm(i)){const{message:o}=ue("MISSING_OR_INVALID",`respond() response: ${JSON.stringify(i)}`);throw new Error(o)}},this.isValidPing=async r=>{if(!Xt(r)){const{message:i}=ue("MISSING_OR_INVALID",`ping() params: ${r}`);throw new Error(i)}const{topic:n}=r;await this.isValidSessionOrPairingTopic(n)},this.isValidEmit=async r=>{if(!Xt(r)){const{message:a}=ue("MISSING_OR_INVALID",`emit() params: ${r}`);throw new Error(a)}const{topic:n,event:i,chainId:o}=r;await this.isValidSessionTopic(n);const{namespaces:s}=this.client.session.get(n);if(!i0(s,o)){const{message:a}=ue("MISSING_OR_INVALID",`emit() chainId: ${o}`);throw new Error(a)}if(!um(i)){const{message:a}=ue("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(i)}`);throw new Error(a)}if(!fm(s,o,i.name)){const{message:a}=ue("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(i)}`);throw new Error(a)}},this.isValidDisconnect=async r=>{if(!Xt(r)){const{message:i}=ue("MISSING_OR_INVALID",`disconnect() params: ${r}`);throw new Error(i)}const{topic:n}=r;await this.isValidSessionOrPairingTopic(n)},this.validateSessionProps=(r,n)=>{Object.values(r).forEach(i=>{if(!$t(i,!1)){const{message:o}=ue("MISSING_OR_INVALID",`${n} must be in Record<string, string> format. Received: ${JSON.stringify(i)}`);throw new Error(o)}})}}isInitialized(){if(!this.initialized){const{message:e}=ue("NOT_INITIALIZED",this.name);throw new Error(e)}}registerRelayerEvents(){this.client.core.relayer.on(jt.message,async e=>{const{topic:r,message:n}=e;if(this.ignoredPayloadTypes.includes(this.client.core.crypto.getPayloadType(n)))return;const i=await this.client.core.crypto.decode(r,n);Xa(i)?(this.client.core.history.set(r,i),this.onRelayEventRequest({topic:r,payload:i})):Qa(i)&&(await this.client.core.history.resolve(i),this.onRelayEventResponse({topic:r,payload:i}))})}registerExpirerEvents(){this.client.core.expirer.on(cr.expired,async e=>{const{topic:r,id:n}=Xh(e.target);if(n&&this.client.pendingRequest.keys.includes(n))return await this.deletePendingSessionRequest(n,ue("EXPIRED"),!0);r?this.client.session.keys.includes(r)&&(await this.deleteSession(r,!0),this.client.events.emit("session_expire",{topic:r})):n&&(await this.deleteProposal(n,!0),this.client.events.emit("proposal_expire",{id:n}))})}isValidPairingTopic(e){if(!$t(e,!1)){const{message:r}=ue("MISSING_OR_INVALID",`pairing topic should be a string: ${e}`);throw new Error(r)}if(!this.client.core.pairing.pairings.keys.includes(e)){const{message:r}=ue("NO_MATCHING_KEY",`pairing topic doesn't exist: ${e}`);throw new Error(r)}if(Br(this.client.core.pairing.pairings.get(e).expiry)){const{message:r}=ue("EXPIRED",`pairing topic: ${e}`);throw new Error(r)}}async isValidSessionTopic(e){if(!$t(e,!1)){const{message:r}=ue("MISSING_OR_INVALID",`session topic should be a string: ${e}`);throw new Error(r)}if(!this.client.session.keys.includes(e)){const{message:r}=ue("NO_MATCHING_KEY",`session topic doesn't exist: ${e}`);throw new Error(r)}if(Br(this.client.session.get(e).expiry)){await this.deleteSession(e);const{message:r}=ue("EXPIRED",`session topic: ${e}`);throw new Error(r)}}async isValidSessionOrPairingTopic(e){if(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($t(e,!1)){const{message:r}=ue("NO_MATCHING_KEY",`session or pairing topic doesn't exist: ${e}`);throw new Error(r)}else{const{message:r}=ue("MISSING_OR_INVALID",`session or pairing topic should be a string: ${e}`);throw new Error(r)}}async isValidProposalId(e){if(!sm(e)){const{message:r}=ue("MISSING_OR_INVALID",`proposal id should be a number: ${e}`);throw new Error(r)}if(!this.client.proposal.keys.includes(e)){const{message:r}=ue("NO_MATCHING_KEY",`proposal id doesn't exist: ${e}`);throw new Error(r)}if(Br(this.client.proposal.get(e).expiry)){await this.deleteProposal(e);const{message:r}=ue("EXPIRED",`proposal id: ${e}`);throw new Error(r)}}}class Hv extends ts{constructor(e,r){super(e,r,Pv,ac),this.core=e,this.logger=r}}class zv extends ts{constructor(e,r){super(e,r,Tv,ac),this.core=e,this.logger=r}}class Wv extends ts{constructor(e,r){super(e,r,Rv,ac),this.core=e,this.logger=r}}class hc extends n6{constructor(e){super(e),this.protocol=S1,this.version=A1,this.name=cc.name,this.events=new Dt.exports.EventEmitter,this.on=(n,i)=>this.events.on(n,i),this.once=(n,i)=>this.events.once(n,i),this.off=(n,i)=>this.events.off(n,i),this.removeListener=(n,i)=>this.events.removeListener(n,i),this.removeAllListeners=n=>this.events.removeAllListeners(n),this.connect=async n=>{try{return await this.engine.connect(n)}catch(i){throw this.logger.error(i.message),i}},this.pair=async n=>{try{return await this.engine.pair(n)}catch(i){throw this.logger.error(i.message),i}},this.approve=async n=>{try{return await this.engine.approve(n)}catch(i){throw this.logger.error(i.message),i}},this.reject=async n=>{try{return await this.engine.reject(n)}catch(i){throw this.logger.error(i.message),i}},this.update=async n=>{try{return await this.engine.update(n)}catch(i){throw this.logger.error(i.message),i}},this.extend=async n=>{try{return await this.engine.extend(n)}catch(i){throw this.logger.error(i.message),i}},this.request=async n=>{try{return await this.engine.request(n)}catch(i){throw this.logger.error(i.message),i}},this.respond=async n=>{try{return await this.engine.respond(n)}catch(i){throw this.logger.error(i.message),i}},this.ping=async n=>{try{return await this.engine.ping(n)}catch(i){throw this.logger.error(i.message),i}},this.emit=async n=>{try{return await this.engine.emit(n)}catch(i){throw this.logger.error(i.message),i}},this.disconnect=async n=>{try{return await this.engine.disconnect(n)}catch(i){throw this.logger.error(i.message),i}},this.find=n=>{try{return this.engine.find(n)}catch(i){throw this.logger.error(i.message),i}},this.getPendingSessionRequests=()=>{try{return this.engine.getPendingSessionRequests()}catch(n){throw this.logger.error(n.message),n}},this.name=e?.name||cc.name,this.metadata=e?.metadata||S5();const r=typeof e?.logger<"u"&&typeof e?.logger!="string"?e.logger:fi(ht.getDefaultLoggerOptions({level:e?.logger||cc.logger}));this.core=e?.core||new Fv(e),this.logger=ht.generateChildLogger(r,this.name),this.session=new zv(this.core,this.logger),this.proposal=new Hv(this.core,this.logger),this.pendingRequest=new Wv(this.core,this.logger),this.engine=new kv(this)}static async init(e){const r=new hc(e);return await r.initialize(),r}get context(){return ht.getLoggerContext(this.logger)}get pairing(){return this.core.pairing.pairings}async initialize(){this.logger.trace("Initialized");try{await this.core.start(),await this.session.init(),await this.proposal.init(),await this.pendingRequest.init(),await this.engine.init(),this.logger.info("SignClient Initialization Success")}catch(e){throw this.logger.info("SignClient Initialization Failure"),this.logger.error(e.message),e}}}var fc={exports:{}};(function(t,e){var r=typeof self<"u"?self:Ot,n=function(){function o(){this.fetch=!1,this.DOMException=r.DOMException}return o.prototype=r,new o}();(function(o){(function(s){var a={searchParams:"URLSearchParams"in o,iterable:"Symbol"in o&&"iterator"in Symbol,blob:"FileReader"in o&&"Blob"in o&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in o,arrayBuffer:"ArrayBuffer"in o};function l(E){return E&&DataView.prototype.isPrototypeOf(E)}if(a.arrayBuffer)var u=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],d=ArrayBuffer.isView||function(E){return E&&u.indexOf(Object.prototype.toString.call(E))>-1};function y(E){if(typeof E!="string"&&(E=String(E)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(E))throw new TypeError("Invalid character in header field name");return E.toLowerCase()}function m(E){return typeof E!="string"&&(E=String(E)),E}function v(E){var O={next:function(){var Z=E.shift();return{done:Z===void 0,value:Z}}};return a.iterable&&(O[Symbol.iterator]=function(){return O}),O}function _(E){this.map={},E instanceof _?E.forEach(function(O,Z){this.append(Z,O)},this):Array.isArray(E)?E.forEach(function(O){this.append(O[0],O[1])},this):E&&Object.getOwnPropertyNames(E).forEach(function(O){this.append(O,E[O])},this)}_.prototype.append=function(E,O){E=y(E),O=m(O);var Z=this.map[E];this.map[E]=Z?Z+", "+O:O},_.prototype.delete=function(E){delete this.map[y(E)]},_.prototype.get=function(E){return E=y(E),this.has(E)?this.map[E]:null},_.prototype.has=function(E){return this.map.hasOwnProperty(y(E))},_.prototype.set=function(E,O){this.map[y(E)]=m(O)},_.prototype.forEach=function(E,O){for(var Z in this.map)this.map.hasOwnProperty(Z)&&E.call(O,this.map[Z],Z,this)},_.prototype.keys=function(){var E=[];return this.forEach(function(O,Z){E.push(Z)}),v(E)},_.prototype.values=function(){var E=[];return this.forEach(function(O){E.push(O)}),v(E)},_.prototype.entries=function(){var E=[];return this.forEach(function(O,Z){E.push([Z,O])}),v(E)},a.iterable&&(_.prototype[Symbol.iterator]=_.prototype.entries);function R(E){if(E.bodyUsed)return Promise.reject(new TypeError("Already read"));E.bodyUsed=!0}function M(E){return new Promise(function(O,Z){E.onload=function(){O(E.result)},E.onerror=function(){Z(E.error)}})}function B(E){var O=new FileReader,Z=M(O);return O.readAsArrayBuffer(E),Z}function D(E){var O=new FileReader,Z=M(O);return O.readAsText(E),Z}function N(E){for(var O=new Uint8Array(E),Z=new Array(O.length),J=0;J<O.length;J++)Z[J]=String.fromCharCode(O[J]);return Z.join("")}function C(E){if(E.slice)return E.slice(0);var O=new Uint8Array(E.byteLength);return O.set(new Uint8Array(E)),O.buffer}function $(){return this.bodyUsed=!1,this._initBody=function(E){this._bodyInit=E,E?typeof E=="string"?this._bodyText=E:a.blob&&Blob.prototype.isPrototypeOf(E)?this._bodyBlob=E:a.formData&&FormData.prototype.isPrototypeOf(E)?this._bodyFormData=E:a.searchParams&&URLSearchParams.prototype.isPrototypeOf(E)?this._bodyText=E.toString():a.arrayBuffer&&a.blob&&l(E)?(this._bodyArrayBuffer=C(E.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):a.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(E)||d(E))?this._bodyArrayBuffer=C(E):this._bodyText=E=Object.prototype.toString.call(E):this._bodyText="",this.headers.get("content-type")||(typeof E=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):a.searchParams&&URLSearchParams.prototype.isPrototypeOf(E)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},a.blob&&(this.blob=function(){var E=R(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)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?R(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(B)}),this.text=function(){var E=R(this);if(E)return E;if(this._bodyBlob)return D(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(N(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},a.formData&&(this.formData=function(){return this.text().then(q)}),this.json=function(){return this.text().then(JSON.parse)},this}var P=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function h(E){var O=E.toUpperCase();return P.indexOf(O)>-1?O:E}function S(E,O){O=O||{};var Z=O.body;if(E instanceof S){if(E.bodyUsed)throw new TypeError("Already read");this.url=E.url,this.credentials=E.credentials,O.headers||(this.headers=new _(E.headers)),this.method=E.method,this.mode=E.mode,this.signal=E.signal,!Z&&E._bodyInit!=null&&(Z=E._bodyInit,E.bodyUsed=!0)}else this.url=String(E);if(this.credentials=O.credentials||this.credentials||"same-origin",(O.headers||!this.headers)&&(this.headers=new _(O.headers)),this.method=h(O.method||this.method||"GET"),this.mode=O.mode||this.mode||null,this.signal=O.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&Z)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(Z)}S.prototype.clone=function(){return new S(this,{body:this._bodyInit})};function q(E){var O=new FormData;return E.trim().split("&").forEach(function(Z){if(Z){var J=Z.split("="),H=J.shift().replace(/\+/g," "),j=J.join("=").replace(/\+/g," ");O.append(decodeURIComponent(H),decodeURIComponent(j))}}),O}function z(E){var O=new _,Z=E.replace(/\r?\n[\t ]+/g," ");return Z.split(/\r?\n/).forEach(function(J){var H=J.split(":"),j=H.shift().trim();if(j){var W=H.join(":").trim();O.append(j,W)}}),O}$.call(S.prototype);function Y(E,O){O||(O={}),this.type="default",this.status=O.status===void 0?200:O.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in O?O.statusText:"OK",this.headers=new _(O.headers),this.url=O.url||"",this._initBody(E)}$.call(Y.prototype),Y.prototype.clone=function(){return new Y(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new _(this.headers),url:this.url})},Y.error=function(){var E=new Y(null,{status:0,statusText:""});return E.type="error",E};var re=[301,302,303,307,308];Y.redirect=function(E,O){if(re.indexOf(O)===-1)throw new RangeError("Invalid status code");return new Y(null,{status:O,headers:{location:E}})},s.DOMException=o.DOMException;try{new s.DOMException}catch{s.DOMException=function(O,Z){this.message=O,this.name=Z;var J=Error(O);this.stack=J.stack},s.DOMException.prototype=Object.create(Error.prototype),s.DOMException.prototype.constructor=s.DOMException}function ie(E,O){return new Promise(function(Z,J){var H=new S(E,O);if(H.signal&&H.signal.aborted)return J(new s.DOMException("Aborted","AbortError"));var j=new XMLHttpRequest;function W(){j.abort()}j.onload=function(){var V={status:j.status,statusText:j.statusText,headers:z(j.getAllResponseHeaders()||"")};V.url="responseURL"in j?j.responseURL:V.headers.get("X-Request-URL");var ce="response"in j?j.response:j.responseText;Z(new Y(ce,V))},j.onerror=function(){J(new TypeError("Network request failed"))},j.ontimeout=function(){J(new TypeError("Network request failed"))},j.onabort=function(){J(new s.DOMException("Aborted","AbortError"))},j.open(H.method,H.url,!0),H.credentials==="include"?j.withCredentials=!0:H.credentials==="omit"&&(j.withCredentials=!1),"responseType"in j&&a.blob&&(j.responseType="blob"),H.headers.forEach(function(V,ce){j.setRequestHeader(ce,V)}),H.signal&&(H.signal.addEventListener("abort",W),j.onreadystatechange=function(){j.readyState===4&&H.signal.removeEventListener("abort",W)}),j.send(typeof H._bodyInit>"u"?null:H._bodyInit)})}return ie.polyfill=!0,o.fetch||(o.fetch=ie,o.Headers=_,o.Request=S,o.Response=Y),s.Headers=_,s.Request=S,s.Response=Y,s.fetch=ie,Object.defineProperty(s,"__esModule",{value:!0}),s})({})})(n),n.fetch.ponyfill=!0,delete n.fetch.polyfill;var i=n;e=i.fetch,e.default=i.fetch,e.fetch=i.fetch,e.Headers=i.Headers,e.Request=i.Request,e.Response=i.Response,t.exports=e})(fc,fc.exports);var $1=Bp(fc.exports);const F1={headers:{Accept:"application/json","Content-Type":"application/json"},method:"POST"},P1=10;class ns{constructor(e){if(this.url=e,this.events=new Dt.exports.EventEmitter,this.isAvailable=!1,this.registering=!1,!z0(e))throw new Error(`Provided URL is not compatible with HTTP connection: ${e}`);this.url=e}get connected(){return this.isAvailable}get connecting(){return this.registering}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}off(e,r){this.events.off(e,r)}removeListener(e,r){this.events.removeListener(e,r)}async open(e=this.url){await this.register(e)}async close(){if(!this.isAvailable)throw new Error("Connection already closed");this.onClose()}async send(e,r){this.isAvailable||await this.register();try{const n=Si(e),o=await(await $1(this.url,Object.assign(Object.assign({},F1),{body:n}))).json();this.onPayload({data:o})}catch(n){this.onError(e.id,n)}}async register(e=this.url){if(!z0(e))throw new Error(`Provided URL is not compatible with HTTP connection: ${e}`);if(this.registering){const r=this.events.getMaxListeners();return(this.events.listenerCount("register_error")>=r||this.events.listenerCount("open")>=r)&&this.events.setMaxListeners(r+1),new Promise((n,i)=>{this.events.once("register_error",o=>{this.resetMaxListeners(),i(o)}),this.events.once("open",()=>{if(this.resetMaxListeners(),typeof this.isAvailable>"u")return i(new Error("HTTP connection is missing or invalid"));n()})})}this.url=e,this.registering=!0;try{const r=Si({id:1,jsonrpc:"2.0",method:"test",params:[]});await $1(e,Object.assign(Object.assign({},F1),{body:r})),this.onOpen()}catch(r){const n=this.parseError(r);throw this.events.emit("register_error",n),this.onClose(),n}}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;const r=typeof e.data=="string"?Va(e.data):e.data;this.events.emit("payload",r)}onError(e,r){const n=this.parseError(r),i=n.message||n.toString(),o=Jo(e,i);this.events.emit("payload",o)}parseError(e,r=this.url){return M0(e,r,"HTTP")}resetMaxListeners(){this.events.getMaxListeners()>P1&&this.events.setMaxListeners(P1)}}var Vv=Object.defineProperty,T1=Object.getOwnPropertySymbols,qv=Object.prototype.hasOwnProperty,Kv=Object.prototype.propertyIsEnumerable,N1=(t,e,r)=>e in t?Vv(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Qt=(t,e)=>{for(var r in e||(e={}))qv.call(e,r)&&N1(t,r,e[r]);if(T1)for(var r of T1(e))Kv.call(e,r)&&N1(t,r,e[r]);return t};function Gv(t){var e;const r=(e=t[Object.keys(t)[0]])==null?void 0:e.chains[0];return[r.split(":")[0],r.split(":")[1]]}function kr(t,e){let r;return e.rpcMap&&(r=e.rpcMap[Yv([t])]),r}function Yv(t){return Number(t[0].split(":")[1])}function is(){if(typeof window<"u")try{const t=window.localStorage.getItem("WALLETCONNECT_DEEPLINK_CHOICE");if(t){const e=JSON.parse(t);window.open(e.href,"_self","noreferrer noopener")}}catch(t){console.error(t)}}var on=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Pi(t){var e=t.default;if(typeof e=="function"){var r=function(){return e.apply(this,arguments)};r.prototype=e.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(t).forEach(function(n){var i=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(r,n,i.get?i:{enumerable:!0,get:function(){return t[n]}})}),r}var os={};/*! *****************************************************************************
67
- Copyright (c) Microsoft Corporation.
68
-
69
- Permission to use, copy, modify, and/or distribute this software for any
70
- purpose with or without fee is hereby granted.
71
-
72
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
73
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
74
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
75
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
76
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
77
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
78
- PERFORMANCE OF THIS SOFTWARE.
79
- ***************************************************************************** */var dc=function(t,e){return dc=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)n.hasOwnProperty(i)&&(r[i]=n[i])},dc(t,e)};function Zv(t,e){dc(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var pc=function(){return pc=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++){e=arguments[r];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},pc.apply(this,arguments)};function Jv(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r}function Xv(t,e,r,n){var i=arguments.length,o=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,r,o):s(e,r))||o);return i>3&&o&&Object.defineProperty(e,r,o),o}function Qv(t,e){return function(r,n){e(r,n,t)}}function e4(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function t4(t,e,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(d){try{u(n.next(d))}catch(y){s(y)}}function l(d){try{u(n.throw(d))}catch(y){s(y)}}function u(d){d.done?o(d.value):i(d.value).then(a,l)}u((n=n.apply(t,e||[])).next())})}function r4(t,e){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,s;return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(u){return function(d){return l([u,d])}}function l(u){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(o=u[0]&2?i.return:u[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,u[1])).done)return o;switch(i=0,o&&(u=[u[0]&2,o.value]),u[0]){case 0:case 1:o=u;break;case 4:return r.label++,{value:u[1],done:!1};case 5:r.label++,i=u[1],u=[0];continue;case 7:u=r.ops.pop(),r.trys.pop();continue;default:if(o=r.trys,!(o=o.length>0&&o[o.length-1])&&(u[0]===6||u[0]===2)){r=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[1]<o[3])){r.label=u[1];break}if(u[0]===6&&r.label<o[1]){r.label=o[1],o=u;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(u);break}o[2]&&r.ops.pop(),r.trys.pop();continue}u=e.call(t,r)}catch(d){u=[6,d],i=0}finally{n=o=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}function n4(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}function i4(t,e){for(var r in t)r!=="default"&&!e.hasOwnProperty(r)&&(e[r]=t[r])}function gc(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function R1(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,o=[],s;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(a){s={error:a}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(s)throw s.error}}return o}function o4(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(R1(arguments[e]));return t}function s4(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;for(var n=Array(t),i=0,e=0;e<r;e++)for(var o=arguments[e],s=0,a=o.length;s<a;s++,i++)n[i]=o[s];return n}function Ti(t){return this instanceof Ti?(this.v=t,this):new Ti(t)}function a4(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(t,e||[]),i,o=[];return i={},s("next"),s("throw"),s("return"),i[Symbol.asyncIterator]=function(){return this},i;function s(m){n[m]&&(i[m]=function(v){return new Promise(function(_,R){o.push([m,v,_,R])>1||a(m,v)})})}function a(m,v){try{l(n[m](v))}catch(_){y(o[0][3],_)}}function l(m){m.value instanceof Ti?Promise.resolve(m.value.v).then(u,d):y(o[0][2],m)}function u(m){a("next",m)}function d(m){a("throw",m)}function y(m,v){m(v),o.shift(),o.length&&a(o[0][0],o[0][1])}}function c4(t){var e,r;return e={},n("next"),n("throw",function(i){throw i}),n("return"),e[Symbol.iterator]=function(){return this},e;function n(i,o){e[i]=t[i]?function(s){return(r=!r)?{value:Ti(t[i](s)),done:i==="return"}:o?o(s):s}:o}}function l4(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof gc=="function"?gc(t):t[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(o){r[o]=t[o]&&function(s){return new Promise(function(a,l){s=t[o](s),i(a,l,s.done,s.value)})}}function i(o,s,a,l){Promise.resolve(l).then(function(u){o({value:u,done:a})},s)}}function u4(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function h4(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}function f4(t){return t&&t.__esModule?t:{default:t}}function d4(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}function p4(t,e,r){if(!e.has(t))throw new TypeError("attempted to set private field on non-instance");return e.set(t,r),r}var g4=Object.freeze({__proto__:null,__extends:Zv,get __assign(){return pc},__rest:Jv,__decorate:Xv,__param:Qv,__metadata:e4,__awaiter:t4,__generator:r4,__createBinding:n4,__exportStar:i4,__values:gc,__read:R1,__spread:o4,__spreadArrays:s4,__await:Ti,__asyncGenerator:a4,__asyncDelegator:c4,__asyncValues:l4,__makeTemplateObject:u4,__importStar:h4,__importDefault:f4,__classPrivateFieldGet:d4,__classPrivateFieldSet:p4}),L1=Pi(g4),Ni={};Object.defineProperty(Ni,"__esModule",{value:!0});function m4(t){if(typeof t!="string")throw new Error(`Cannot safe json parse value of type ${typeof t}`);try{return JSON.parse(t)}catch{return t}}Ni.safeJsonParse=m4;function b4(t){return typeof t=="string"?t:JSON.stringify(t,(e,r)=>typeof r>"u"?null:r)}Ni.safeJsonStringify=b4;var ss={exports:{}},M1;function y4(){return M1||(M1=1,function(){let t;function e(){}t=e,t.prototype.getItem=function(r){return this.hasOwnProperty(r)?String(this[r]):null},t.prototype.setItem=function(r,n){this[r]=String(n)},t.prototype.removeItem=function(r){delete this[r]},t.prototype.clear=function(){const r=this;Object.keys(r).forEach(function(n){r[n]=void 0,delete r[n]})},t.prototype.key=function(r){return r=r||0,Object.keys(this)[r]},t.prototype.__defineGetter__("length",function(){return Object.keys(this).length}),typeof on<"u"&&on.localStorage?ss.exports=on.localStorage:typeof window<"u"&&window.localStorage?ss.exports=window.localStorage:ss.exports=new e}()),ss.exports}var U1={},Ri={},B1;function w4(){if(B1)return Ri;B1=1,Object.defineProperty(Ri,"__esModule",{value:!0}),Ri.IKeyValueStorage=void 0;class t{}return Ri.IKeyValueStorage=t,Ri}var Li={},j1;function v4(){if(j1)return Li;j1=1,Object.defineProperty(Li,"__esModule",{value:!0}),Li.parseEntry=void 0;const t=Ni;function e(r){var n;return[r[0],t.safeJsonParse((n=r[1])!==null&&n!==void 0?n:"")]}return Li.parseEntry=e,Li}var k1;function _4(){return k1||(k1=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=L1;e.__exportStar(w4(),t),e.__exportStar(v4(),t)}(U1)),U1}Object.defineProperty(os,"__esModule",{value:!0}),os.KeyValueStorage=void 0;const Nn=L1,H1=Ni,E4=Nn.__importDefault(y4()),x4=_4();class z1{constructor(){this.localStorage=E4.default}getKeys(){return Nn.__awaiter(this,void 0,void 0,function*(){return Object.keys(this.localStorage)})}getEntries(){return Nn.__awaiter(this,void 0,void 0,function*(){return Object.entries(this.localStorage).map(x4.parseEntry)})}getItem(e){return Nn.__awaiter(this,void 0,void 0,function*(){const r=this.localStorage.getItem(e);if(r!==null)return H1.safeJsonParse(r)})}setItem(e,r){return Nn.__awaiter(this,void 0,void 0,function*(){this.localStorage.setItem(e,H1.safeJsonStringify(r))})}removeItem(e){return Nn.__awaiter(this,void 0,void 0,function*(){this.localStorage.removeItem(e)})}}os.KeyValueStorage=z1,os.default=z1;var C4={};/*! *****************************************************************************
80
- Copyright (c) Microsoft Corporation.
81
-
82
- Permission to use, copy, modify, and/or distribute this software for any
83
- purpose with or without fee is hereby granted.
84
-
85
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
86
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
87
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
88
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
89
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
90
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
91
- PERFORMANCE OF THIS SOFTWARE.
92
- ***************************************************************************** */var mc=function(t,e){return mc=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)n.hasOwnProperty(i)&&(r[i]=n[i])},mc(t,e)};function S4(t,e){mc(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var bc=function(){return bc=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++){e=arguments[r];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},bc.apply(this,arguments)};function A4(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r}function I4(t,e,r,n){var i=arguments.length,o=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,r,o):s(e,r))||o);return i>3&&o&&Object.defineProperty(e,r,o),o}function O4(t,e){return function(r,n){e(r,n,t)}}function D4(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function $4(t,e,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(d){try{u(n.next(d))}catch(y){s(y)}}function l(d){try{u(n.throw(d))}catch(y){s(y)}}function u(d){d.done?o(d.value):i(d.value).then(a,l)}u((n=n.apply(t,e||[])).next())})}function F4(t,e){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,s;return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(u){return function(d){return l([u,d])}}function l(u){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(o=u[0]&2?i.return:u[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,u[1])).done)return o;switch(i=0,o&&(u=[u[0]&2,o.value]),u[0]){case 0:case 1:o=u;break;case 4:return r.label++,{value:u[1],done:!1};case 5:r.label++,i=u[1],u=[0];continue;case 7:u=r.ops.pop(),r.trys.pop();continue;default:if(o=r.trys,!(o=o.length>0&&o[o.length-1])&&(u[0]===6||u[0]===2)){r=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[1]<o[3])){r.label=u[1];break}if(u[0]===6&&r.label<o[1]){r.label=o[1],o=u;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(u);break}o[2]&&r.ops.pop(),r.trys.pop();continue}u=e.call(t,r)}catch(d){u=[6,d],i=0}finally{n=o=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}function P4(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}function T4(t,e){for(var r in t)r!=="default"&&!e.hasOwnProperty(r)&&(e[r]=t[r])}function yc(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function W1(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,o=[],s;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(a){s={error:a}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(s)throw s.error}}return o}function N4(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(W1(arguments[e]));return t}function R4(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;for(var n=Array(t),i=0,e=0;e<r;e++)for(var o=arguments[e],s=0,a=o.length;s<a;s++,i++)n[i]=o[s];return n}function Mi(t){return this instanceof Mi?(this.v=t,this):new Mi(t)}function L4(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(t,e||[]),i,o=[];return i={},s("next"),s("throw"),s("return"),i[Symbol.asyncIterator]=function(){return this},i;function s(m){n[m]&&(i[m]=function(v){return new Promise(function(_,R){o.push([m,v,_,R])>1||a(m,v)})})}function a(m,v){try{l(n[m](v))}catch(_){y(o[0][3],_)}}function l(m){m.value instanceof Mi?Promise.resolve(m.value.v).then(u,d):y(o[0][2],m)}function u(m){a("next",m)}function d(m){a("throw",m)}function y(m,v){m(v),o.shift(),o.length&&a(o[0][0],o[0][1])}}function M4(t){var e,r;return e={},n("next"),n("throw",function(i){throw i}),n("return"),e[Symbol.iterator]=function(){return this},e;function n(i,o){e[i]=t[i]?function(s){return(r=!r)?{value:Mi(t[i](s)),done:i==="return"}:o?o(s):s}:o}}function U4(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof yc=="function"?yc(t):t[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(o){r[o]=t[o]&&function(s){return new Promise(function(a,l){s=t[o](s),i(a,l,s.done,s.value)})}}function i(o,s,a,l){Promise.resolve(l).then(function(u){o({value:u,done:a})},s)}}function B4(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function j4(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}function k4(t){return t&&t.__esModule?t:{default:t}}function H4(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}function z4(t,e,r){if(!e.has(t))throw new TypeError("attempted to set private field on non-instance");return e.set(t,r),r}var W4=Object.freeze({__proto__:null,__extends:S4,get __assign(){return bc},__rest:A4,__decorate:I4,__param:O4,__metadata:D4,__awaiter:$4,__generator:F4,__createBinding:P4,__exportStar:T4,__values:yc,__read:W1,__spread:N4,__spreadArrays:R4,__await:Mi,__asyncGenerator:L4,__asyncDelegator:M4,__asyncValues:U4,__makeTemplateObject:B4,__importStar:j4,__importDefault:k4,__classPrivateFieldGet:H4,__classPrivateFieldSet:z4}),as=Pi(W4),Ui={},wc={};/*! *****************************************************************************
93
- Copyright (c) Microsoft Corporation.
94
-
95
- Permission to use, copy, modify, and/or distribute this software for any
96
- purpose with or without fee is hereby granted.
97
-
98
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
99
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
100
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
101
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
102
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
103
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
104
- PERFORMANCE OF THIS SOFTWARE.
105
- ***************************************************************************** */var vc=function(t,e){return vc=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)n.hasOwnProperty(i)&&(r[i]=n[i])},vc(t,e)};function V4(t,e){vc(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var _c=function(){return _c=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++){e=arguments[r];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},_c.apply(this,arguments)};function q4(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r}function K4(t,e,r,n){var i=arguments.length,o=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,r,o):s(e,r))||o);return i>3&&o&&Object.defineProperty(e,r,o),o}function G4(t,e){return function(r,n){e(r,n,t)}}function Y4(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function Z4(t,e,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(d){try{u(n.next(d))}catch(y){s(y)}}function l(d){try{u(n.throw(d))}catch(y){s(y)}}function u(d){d.done?o(d.value):i(d.value).then(a,l)}u((n=n.apply(t,e||[])).next())})}function J4(t,e){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,s;return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(u){return function(d){return l([u,d])}}function l(u){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(o=u[0]&2?i.return:u[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,u[1])).done)return o;switch(i=0,o&&(u=[u[0]&2,o.value]),u[0]){case 0:case 1:o=u;break;case 4:return r.label++,{value:u[1],done:!1};case 5:r.label++,i=u[1],u=[0];continue;case 7:u=r.ops.pop(),r.trys.pop();continue;default:if(o=r.trys,!(o=o.length>0&&o[o.length-1])&&(u[0]===6||u[0]===2)){r=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[1]<o[3])){r.label=u[1];break}if(u[0]===6&&r.label<o[1]){r.label=o[1],o=u;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(u);break}o[2]&&r.ops.pop(),r.trys.pop();continue}u=e.call(t,r)}catch(d){u=[6,d],i=0}finally{n=o=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}function X4(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}function Q4(t,e){for(var r in t)r!=="default"&&!e.hasOwnProperty(r)&&(e[r]=t[r])}function Ec(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function V1(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,o=[],s;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(a){s={error:a}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(s)throw s.error}}return o}function e_(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(V1(arguments[e]));return t}function t_(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;for(var n=Array(t),i=0,e=0;e<r;e++)for(var o=arguments[e],s=0,a=o.length;s<a;s++,i++)n[i]=o[s];return n}function Bi(t){return this instanceof Bi?(this.v=t,this):new Bi(t)}function r_(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(t,e||[]),i,o=[];return i={},s("next"),s("throw"),s("return"),i[Symbol.asyncIterator]=function(){return this},i;function s(m){n[m]&&(i[m]=function(v){return new Promise(function(_,R){o.push([m,v,_,R])>1||a(m,v)})})}function a(m,v){try{l(n[m](v))}catch(_){y(o[0][3],_)}}function l(m){m.value instanceof Bi?Promise.resolve(m.value.v).then(u,d):y(o[0][2],m)}function u(m){a("next",m)}function d(m){a("throw",m)}function y(m,v){m(v),o.shift(),o.length&&a(o[0][0],o[0][1])}}function n_(t){var e,r;return e={},n("next"),n("throw",function(i){throw i}),n("return"),e[Symbol.iterator]=function(){return this},e;function n(i,o){e[i]=t[i]?function(s){return(r=!r)?{value:Bi(t[i](s)),done:i==="return"}:o?o(s):s}:o}}function i_(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof Ec=="function"?Ec(t):t[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(o){r[o]=t[o]&&function(s){return new Promise(function(a,l){s=t[o](s),i(a,l,s.done,s.value)})}}function i(o,s,a,l){Promise.resolve(l).then(function(u){o({value:u,done:a})},s)}}function o_(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function s_(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}function a_(t){return t&&t.__esModule?t:{default:t}}function c_(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}function l_(t,e,r){if(!e.has(t))throw new TypeError("attempted to set private field on non-instance");return e.set(t,r),r}var u_=Object.freeze({__proto__:null,__extends:V4,get __assign(){return _c},__rest:q4,__decorate:K4,__param:G4,__metadata:Y4,__awaiter:Z4,__generator:J4,__createBinding:X4,__exportStar:Q4,__values:Ec,__read:V1,__spread:e_,__spreadArrays:t_,__await:Bi,__asyncGenerator:r_,__asyncDelegator:n_,__asyncValues:i_,__makeTemplateObject:o_,__importStar:s_,__importDefault:a_,__classPrivateFieldGet:c_,__classPrivateFieldSet:l_}),cs=Pi(u_),q1={},ji={},K1;function h_(){if(K1)return ji;K1=1,Object.defineProperty(ji,"__esModule",{value:!0}),ji.delay=void 0;function t(e){return new Promise(r=>{setTimeout(()=>{r(!0)},e)})}return ji.delay=t,ji}var sn={},G1={},Rn={},Y1;function f_(){return Y1||(Y1=1,Object.defineProperty(Rn,"__esModule",{value:!0}),Rn.ONE_THOUSAND=Rn.ONE_HUNDRED=void 0,Rn.ONE_HUNDRED=100,Rn.ONE_THOUSAND=1e3),Rn}var Z1={},J1;function d_(){return J1||(J1=1,function(t){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=t.ONE_MINUTE*5,t.TEN_MINUTES=t.ONE_MINUTE*10,t.THIRTY_MINUTES=t.ONE_MINUTE*30,t.SIXTY_MINUTES=t.ONE_MINUTE*60,t.ONE_HOUR=t.SIXTY_MINUTES,t.THREE_HOURS=t.ONE_HOUR*3,t.SIX_HOURS=t.ONE_HOUR*6,t.TWELVE_HOURS=t.ONE_HOUR*12,t.TWENTY_FOUR_HOURS=t.ONE_HOUR*24,t.ONE_DAY=t.TWENTY_FOUR_HOURS,t.THREE_DAYS=t.ONE_DAY*3,t.FIVE_DAYS=t.ONE_DAY*5,t.SEVEN_DAYS=t.ONE_DAY*7,t.THIRTY_DAYS=t.ONE_DAY*30,t.ONE_WEEK=t.SEVEN_DAYS,t.TWO_WEEKS=t.ONE_WEEK*2,t.THREE_WEEKS=t.ONE_WEEK*3,t.FOUR_WEEKS=t.ONE_WEEK*4,t.ONE_YEAR=t.ONE_DAY*365}(Z1)),Z1}var X1;function Q1(){return X1||(X1=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=cs;e.__exportStar(f_(),t),e.__exportStar(d_(),t)}(G1)),G1}var ef;function p_(){if(ef)return sn;ef=1,Object.defineProperty(sn,"__esModule",{value:!0}),sn.fromMiliseconds=sn.toMiliseconds=void 0;const t=Q1();function e(n){return n*t.ONE_THOUSAND}sn.toMiliseconds=e;function r(n){return Math.floor(n/t.ONE_THOUSAND)}return sn.fromMiliseconds=r,sn}var tf;function g_(){return tf||(tf=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=cs;e.__exportStar(h_(),t),e.__exportStar(p_(),t)}(q1)),q1}var Ln={},rf;function m_(){if(rf)return Ln;rf=1,Object.defineProperty(Ln,"__esModule",{value:!0}),Ln.Watch=void 0;class t{constructor(){this.timestamps=new Map}start(r){if(this.timestamps.has(r))throw new Error(`Watch already started for label: ${r}`);this.timestamps.set(r,{started:Date.now()})}stop(r){const n=this.get(r);if(typeof n.elapsed<"u")throw new Error(`Watch already stopped for label: ${r}`);const i=Date.now()-n.started;this.timestamps.set(r,{started:n.started,elapsed:i})}get(r){const n=this.timestamps.get(r);if(typeof n>"u")throw new Error(`No timestamp found for label: ${r}`);return n}elapsed(r){const n=this.get(r);return n.elapsed||Date.now()-n.started}}return Ln.Watch=t,Ln.default=t,Ln}var nf={},ki={},of;function b_(){if(of)return ki;of=1,Object.defineProperty(ki,"__esModule",{value:!0}),ki.IWatch=void 0;class t{}return ki.IWatch=t,ki}var sf;function y_(){return sf||(sf=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),cs.__exportStar(b_(),t)}(nf)),nf}(function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=cs;e.__exportStar(g_(),t),e.__exportStar(m_(),t),e.__exportStar(y_(),t),e.__exportStar(Q1(),t)})(wc);var af={},Hi={};class w_{}var v_=Object.freeze({__proto__:null,IEvents:w_}),__=Pi(v_),cf;function E_(){if(cf)return Hi;cf=1,Object.defineProperty(Hi,"__esModule",{value:!0}),Hi.IHeartBeat=void 0;const t=__;class e extends t.IEvents{constructor(n){super()}}return Hi.IHeartBeat=e,Hi}var lf;function uf(){return lf||(lf=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),as.__exportStar(E_(),t)}(af)),af}var hf={},an={},ff;function x_(){if(ff)return an;ff=1,Object.defineProperty(an,"__esModule",{value:!0}),an.HEARTBEAT_EVENTS=an.HEARTBEAT_INTERVAL=void 0;const t=wc;return an.HEARTBEAT_INTERVAL=t.FIVE_SECONDS,an.HEARTBEAT_EVENTS={pulse:"heartbeat_pulse"},an}var df;function pf(){return df||(df=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),as.__exportStar(x_(),t)}(hf)),hf}var gf;function C_(){if(gf)return Ui;gf=1,Object.defineProperty(Ui,"__esModule",{value:!0}),Ui.HeartBeat=void 0;const t=as,e=Dt.exports,r=wc,n=uf(),i=pf();class o extends n.IHeartBeat{constructor(a){super(a),this.events=new e.EventEmitter,this.interval=i.HEARTBEAT_INTERVAL,this.interval=a?.interval||i.HEARTBEAT_INTERVAL}static init(a){return t.__awaiter(this,void 0,void 0,function*(){const l=new o(a);return yield l.init(),l})}init(){return t.__awaiter(this,void 0,void 0,function*(){yield this.initialize()})}stop(){clearInterval(this.intervalRef)}on(a,l){this.events.on(a,l)}once(a,l){this.events.once(a,l)}off(a,l){this.events.off(a,l)}removeListener(a,l){this.events.removeListener(a,l)}initialize(){return t.__awaiter(this,void 0,void 0,function*(){this.intervalRef=setInterval(()=>this.pulse(),r.toMiliseconds(this.interval))})}pulse(){this.events.emit(i.HEARTBEAT_EVENTS.pulse)}}return Ui.HeartBeat=o,Ui}(function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=as;e.__exportStar(C_(),t),e.__exportStar(uf(),t),e.__exportStar(pf(),t)})(C4);var S_={},mf={},ls={},us={};Object.defineProperty(us,"__esModule",{value:!0}),us.BrowserRandomSource=void 0;const bf=65536;class A_{constructor(){this.isAvailable=!1,this.isInstantiated=!1;const e=typeof self<"u"?self.crypto||self.msCrypto:null;e&&e.getRandomValues!==void 0&&(this._crypto=e,this.isAvailable=!0,this.isInstantiated=!0)}randomBytes(e){if(!this.isAvailable||!this._crypto)throw new Error("Browser random byte generator is not available.");const r=new Uint8Array(e);for(let n=0;n<r.length;n+=bf)this._crypto.getRandomValues(r.subarray(n,n+Math.min(r.length-n,bf)));return r}}us.BrowserRandomSource=A_;function I_(t){throw new Error('Could not dynamically require "'+t+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var hs={},Mn={};Object.defineProperty(Mn,"__esModule",{value:!0});function O_(t){for(var e=0;e<t.length;e++)t[e]=0;return t}Mn.wipe=O_;var D_={},$_=Object.freeze({__proto__:null,default:D_}),F_=Pi($_);Object.defineProperty(hs,"__esModule",{value:!0}),hs.NodeRandomSource=void 0;const P_=Mn;class T_{constructor(){if(this.isAvailable=!1,this.isInstantiated=!1,typeof I_<"u"){const e=F_;e&&e.randomBytes&&(this._crypto=e,this.isAvailable=!0,this.isInstantiated=!0)}}randomBytes(e){if(!this.isAvailable||!this._crypto)throw new Error("Node.js random byte generator is not available.");let r=this._crypto.randomBytes(e);if(r.length!==e)throw new Error("NodeRandomSource: got fewer bytes than requested");const n=new Uint8Array(e);for(let i=0;i<n.length;i++)n[i]=r[i];return(0,P_.wipe)(r),n}}hs.NodeRandomSource=T_,Object.defineProperty(ls,"__esModule",{value:!0}),ls.SystemRandomSource=void 0;const N_=us,R_=hs;class L_{constructor(){if(this.isAvailable=!1,this.name="",this._source=new N_.BrowserRandomSource,this._source.isAvailable){this.isAvailable=!0,this.name="Browser";return}if(this._source=new R_.NodeRandomSource,this._source.isAvailable){this.isAvailable=!0,this.name="Node";return}}randomBytes(e){if(!this.isAvailable)throw new Error("System random byte generator is not available.");return this._source.randomBytes(e)}}ls.SystemRandomSource=L_;var Ye={},yf={};(function(t){Object.defineProperty(t,"__esModule",{value:!0});function e(a,l){var u=a>>>16&65535,d=a&65535,y=l>>>16&65535,m=l&65535;return d*m+(u*m+d*y<<16>>>0)|0}t.mul=Math.imul||e;function r(a,l){return a+l|0}t.add=r;function n(a,l){return a-l|0}t.sub=n;function i(a,l){return a<<l|a>>>32-l}t.rotl=i;function o(a,l){return a<<32-l|a>>>l}t.rotr=o;function s(a){return typeof a=="number"&&isFinite(a)&&Math.floor(a)===a}t.isInteger=Number.isInteger||s,t.MAX_SAFE_INTEGER=9007199254740991,t.isSafeInteger=function(a){return t.isInteger(a)&&a>=-t.MAX_SAFE_INTEGER&&a<=t.MAX_SAFE_INTEGER}})(yf),Object.defineProperty(Ye,"__esModule",{value:!0});var wf=yf;function M_(t,e){return e===void 0&&(e=0),(t[e+0]<<8|t[e+1])<<16>>16}Ye.readInt16BE=M_;function U_(t,e){return e===void 0&&(e=0),(t[e+0]<<8|t[e+1])>>>0}Ye.readUint16BE=U_;function B_(t,e){return e===void 0&&(e=0),(t[e+1]<<8|t[e])<<16>>16}Ye.readInt16LE=B_;function j_(t,e){return e===void 0&&(e=0),(t[e+1]<<8|t[e])>>>0}Ye.readUint16LE=j_;function vf(t,e,r){return e===void 0&&(e=new Uint8Array(2)),r===void 0&&(r=0),e[r+0]=t>>>8,e[r+1]=t>>>0,e}Ye.writeUint16BE=vf,Ye.writeInt16BE=vf;function _f(t,e,r){return e===void 0&&(e=new Uint8Array(2)),r===void 0&&(r=0),e[r+0]=t>>>0,e[r+1]=t>>>8,e}Ye.writeUint16LE=_f,Ye.writeInt16LE=_f;function xc(t,e){return e===void 0&&(e=0),t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3]}Ye.readInt32BE=xc;function Cc(t,e){return e===void 0&&(e=0),(t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3])>>>0}Ye.readUint32BE=Cc;function Sc(t,e){return e===void 0&&(e=0),t[e+3]<<24|t[e+2]<<16|t[e+1]<<8|t[e]}Ye.readInt32LE=Sc;function Ac(t,e){return e===void 0&&(e=0),(t[e+3]<<24|t[e+2]<<16|t[e+1]<<8|t[e])>>>0}Ye.readUint32LE=Ac;function fs(t,e,r){return e===void 0&&(e=new Uint8Array(4)),r===void 0&&(r=0),e[r+0]=t>>>24,e[r+1]=t>>>16,e[r+2]=t>>>8,e[r+3]=t>>>0,e}Ye.writeUint32BE=fs,Ye.writeInt32BE=fs;function ds(t,e,r){return e===void 0&&(e=new Uint8Array(4)),r===void 0&&(r=0),e[r+0]=t>>>0,e[r+1]=t>>>8,e[r+2]=t>>>16,e[r+3]=t>>>24,e}Ye.writeUint32LE=ds,Ye.writeInt32LE=ds;function k_(t,e){e===void 0&&(e=0);var r=xc(t,e),n=xc(t,e+4);return r*4294967296+n-(n>>31)*4294967296}Ye.readInt64BE=k_;function H_(t,e){e===void 0&&(e=0);var r=Cc(t,e),n=Cc(t,e+4);return r*4294967296+n}Ye.readUint64BE=H_;function z_(t,e){e===void 0&&(e=0);var r=Sc(t,e),n=Sc(t,e+4);return n*4294967296+r-(r>>31)*4294967296}Ye.readInt64LE=z_;function W_(t,e){e===void 0&&(e=0);var r=Ac(t,e),n=Ac(t,e+4);return n*4294967296+r}Ye.readUint64LE=W_;function Ef(t,e,r){return e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0),fs(t/4294967296>>>0,e,r),fs(t>>>0,e,r+4),e}Ye.writeUint64BE=Ef,Ye.writeInt64BE=Ef;function xf(t,e,r){return e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0),ds(t>>>0,e,r),ds(t/4294967296>>>0,e,r+4),e}Ye.writeUint64LE=xf,Ye.writeInt64LE=xf;function V_(t,e,r){if(r===void 0&&(r=0),t%8!==0)throw new Error("readUintBE supports only bitLengths divisible by 8");if(t/8>e.length-r)throw new Error("readUintBE: array is too short for the given bitLength");for(var n=0,i=1,o=t/8+r-1;o>=r;o--)n+=e[o]*i,i*=256;return n}Ye.readUintBE=V_;function q_(t,e,r){if(r===void 0&&(r=0),t%8!==0)throw new Error("readUintLE supports only bitLengths divisible by 8");if(t/8>e.length-r)throw new Error("readUintLE: array is too short for the given bitLength");for(var n=0,i=1,o=r;o<r+t/8;o++)n+=e[o]*i,i*=256;return n}Ye.readUintLE=q_;function K_(t,e,r,n){if(r===void 0&&(r=new Uint8Array(t/8)),n===void 0&&(n=0),t%8!==0)throw new Error("writeUintBE supports only bitLengths divisible by 8");if(!wf.isSafeInteger(e))throw new Error("writeUintBE value must be an integer");for(var i=1,o=t/8+n-1;o>=n;o--)r[o]=e/i&255,i*=256;return r}Ye.writeUintBE=K_;function G_(t,e,r,n){if(r===void 0&&(r=new Uint8Array(t/8)),n===void 0&&(n=0),t%8!==0)throw new Error("writeUintLE supports only bitLengths divisible by 8");if(!wf.isSafeInteger(e))throw new Error("writeUintLE value must be an integer");for(var i=1,o=n;o<n+t/8;o++)r[o]=e/i&255,i*=256;return r}Ye.writeUintLE=G_;function Y_(t,e){e===void 0&&(e=0);var r=new DataView(t.buffer,t.byteOffset,t.byteLength);return r.getFloat32(e)}Ye.readFloat32BE=Y_;function Z_(t,e){e===void 0&&(e=0);var r=new DataView(t.buffer,t.byteOffset,t.byteLength);return r.getFloat32(e,!0)}Ye.readFloat32LE=Z_;function J_(t,e){e===void 0&&(e=0);var r=new DataView(t.buffer,t.byteOffset,t.byteLength);return r.getFloat64(e)}Ye.readFloat64BE=J_;function X_(t,e){e===void 0&&(e=0);var r=new DataView(t.buffer,t.byteOffset,t.byteLength);return r.getFloat64(e,!0)}Ye.readFloat64LE=X_;function Q_(t,e,r){e===void 0&&(e=new Uint8Array(4)),r===void 0&&(r=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.setFloat32(r,t),e}Ye.writeFloat32BE=Q_;function e8(t,e,r){e===void 0&&(e=new Uint8Array(4)),r===void 0&&(r=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.setFloat32(r,t,!0),e}Ye.writeFloat32LE=e8;function t8(t,e,r){e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.setFloat64(r,t),e}Ye.writeFloat64BE=t8;function r8(t,e,r){e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.setFloat64(r,t,!0),e}Ye.writeFloat64LE=r8,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.randomStringForEntropy=t.randomString=t.randomUint32=t.randomBytes=t.defaultRandomSource=void 0;const e=ls,r=Ye,n=Mn;t.defaultRandomSource=new e.SystemRandomSource;function i(u,d=t.defaultRandomSource){return d.randomBytes(u)}t.randomBytes=i;function o(u=t.defaultRandomSource){const d=i(4,u),y=(0,r.readUint32LE)(d);return(0,n.wipe)(d),y}t.randomUint32=o;const s="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";function a(u,d=s,y=t.defaultRandomSource){if(d.length<2)throw new Error("randomString charset is too short");if(d.length>256)throw new Error("randomString charset is too long");let m="";const v=d.length,_=256-256%v;for(;u>0;){const R=i(Math.ceil(u*256/_),y);for(let M=0;M<R.length&&u>0;M++){const B=R[M];B<_&&(m+=d.charAt(B%v),u--)}(0,n.wipe)(R)}return m}t.randomString=a;function l(u,d=s,y=t.defaultRandomSource){const m=Math.ceil(u/(Math.log(d.length)/Math.LN2));return a(m,d,y)}t.randomStringForEntropy=l}(mf);var Cf={};(function(t){Object.defineProperty(t,"__esModule",{value:!0});var e=Ye,r=Mn;t.DIGEST_LENGTH=64,t.BLOCK_SIZE=128;var n=function(){function a(){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 a.prototype._initState=function(){this._stateHi[0]=1779033703,this._stateHi[1]=3144134277,this._stateHi[2]=1013904242,this._stateHi[3]=2773480762,this._stateHi[4]=1359893119,this._stateHi[5]=2600822924,this._stateHi[6]=528734635,this._stateHi[7]=1541459225,this._stateLo[0]=4089235720,this._stateLo[1]=2227873595,this._stateLo[2]=4271175723,this._stateLo[3]=1595750129,this._stateLo[4]=2917565137,this._stateLo[5]=725511199,this._stateLo[6]=4215389547,this._stateLo[7]=327033209},a.prototype.reset=function(){return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this},a.prototype.clean=function(){r.wipe(this._buffer),r.wipe(this._tempHi),r.wipe(this._tempLo),this.reset()},a.prototype.update=function(l,u){if(u===void 0&&(u=l.length),this._finished)throw new Error("SHA512: can't update because hash was finished.");var d=0;if(this._bytesHashed+=u,this._bufferLength>0){for(;this._bufferLength<t.BLOCK_SIZE&&u>0;)this._buffer[this._bufferLength++]=l[d++],u--;this._bufferLength===this.blockSize&&(o(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,this.blockSize),this._bufferLength=0)}for(u>=this.blockSize&&(d=o(this._tempHi,this._tempLo,this._stateHi,this._stateLo,l,d,u),u%=this.blockSize);u>0;)this._buffer[this._bufferLength++]=l[d++],u--;return this},a.prototype.finish=function(l){if(!this._finished){var u=this._bytesHashed,d=this._bufferLength,y=u/536870912|0,m=u<<3,v=u%128<112?128:256;this._buffer[d]=128;for(var _=d+1;_<v-8;_++)this._buffer[_]=0;e.writeUint32BE(y,this._buffer,v-8),e.writeUint32BE(m,this._buffer,v-4),o(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,v),this._finished=!0}for(var _=0;_<this.digestLength/8;_++)e.writeUint32BE(this._stateHi[_],l,_*8),e.writeUint32BE(this._stateLo[_],l,_*8+4);return this},a.prototype.digest=function(){var l=new Uint8Array(this.digestLength);return this.finish(l),l},a.prototype.saveState=function(){if(this._finished)throw new Error("SHA256: cannot save finished state");return{stateHi:new Int32Array(this._stateHi),stateLo:new Int32Array(this._stateLo),buffer:this._bufferLength>0?new Uint8Array(this._buffer):void 0,bufferLength:this._bufferLength,bytesHashed:this._bytesHashed}},a.prototype.restoreState=function(l){return this._stateHi.set(l.stateHi),this._stateLo.set(l.stateLo),this._bufferLength=l.bufferLength,l.buffer&&this._buffer.set(l.buffer),this._bytesHashed=l.bytesHashed,this._finished=!1,this},a.prototype.cleanSavedState=function(l){r.wipe(l.stateHi),r.wipe(l.stateLo),l.buffer&&r.wipe(l.buffer),l.bufferLength=0,l.bytesHashed=0},a}();t.SHA512=n;var i=new Int32Array([1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591]);function o(a,l,u,d,y,m,v){for(var _=u[0],R=u[1],M=u[2],B=u[3],D=u[4],N=u[5],C=u[6],$=u[7],P=d[0],h=d[1],S=d[2],q=d[3],z=d[4],Y=d[5],re=d[6],ie=d[7],E,O,Z,J,H,j,W,V;v>=128;){for(var ce=0;ce<16;ce++){var te=8*ce+m;a[ce]=e.readUint32BE(y,te),l[ce]=e.readUint32BE(y,te+4)}for(var ce=0;ce<80;ce++){var Ce=_,ne=R,Oe=M,T=B,F=D,I=N,c=C,w=$,G=P,Q=h,he=S,be=q,pe=z,ye=Y,ze=re,Ue=ie;if(E=$,O=ie,H=O&65535,j=O>>>16,W=E&65535,V=E>>>16,E=(D>>>14|z<<32-14)^(D>>>18|z<<32-18)^(z>>>41-32|D<<32-(41-32)),O=(z>>>14|D<<32-14)^(z>>>18|D<<32-18)^(D>>>41-32|z<<32-(41-32)),H+=O&65535,j+=O>>>16,W+=E&65535,V+=E>>>16,E=D&N^~D&C,O=z&Y^~z&re,H+=O&65535,j+=O>>>16,W+=E&65535,V+=E>>>16,E=i[ce*2],O=i[ce*2+1],H+=O&65535,j+=O>>>16,W+=E&65535,V+=E>>>16,E=a[ce%16],O=l[ce%16],H+=O&65535,j+=O>>>16,W+=E&65535,V+=E>>>16,j+=H>>>16,W+=j>>>16,V+=W>>>16,Z=W&65535|V<<16,J=H&65535|j<<16,E=Z,O=J,H=O&65535,j=O>>>16,W=E&65535,V=E>>>16,E=(_>>>28|P<<32-28)^(P>>>34-32|_<<32-(34-32))^(P>>>39-32|_<<32-(39-32)),O=(P>>>28|_<<32-28)^(_>>>34-32|P<<32-(34-32))^(_>>>39-32|P<<32-(39-32)),H+=O&65535,j+=O>>>16,W+=E&65535,V+=E>>>16,E=_&R^_&M^R&M,O=P&h^P&S^h&S,H+=O&65535,j+=O>>>16,W+=E&65535,V+=E>>>16,j+=H>>>16,W+=j>>>16,V+=W>>>16,w=W&65535|V<<16,Ue=H&65535|j<<16,E=T,O=be,H=O&65535,j=O>>>16,W=E&65535,V=E>>>16,E=Z,O=J,H+=O&65535,j+=O>>>16,W+=E&65535,V+=E>>>16,j+=H>>>16,W+=j>>>16,V+=W>>>16,T=W&65535|V<<16,be=H&65535|j<<16,R=Ce,M=ne,B=Oe,D=T,N=F,C=I,$=c,_=w,h=G,S=Q,q=he,z=be,Y=pe,re=ye,ie=ze,P=Ue,ce%16===15)for(var te=0;te<16;te++)E=a[te],O=l[te],H=O&65535,j=O>>>16,W=E&65535,V=E>>>16,E=a[(te+9)%16],O=l[(te+9)%16],H+=O&65535,j+=O>>>16,W+=E&65535,V+=E>>>16,Z=a[(te+1)%16],J=l[(te+1)%16],E=(Z>>>1|J<<32-1)^(Z>>>8|J<<32-8)^Z>>>7,O=(J>>>1|Z<<32-1)^(J>>>8|Z<<32-8)^(J>>>7|Z<<32-7),H+=O&65535,j+=O>>>16,W+=E&65535,V+=E>>>16,Z=a[(te+14)%16],J=l[(te+14)%16],E=(Z>>>19|J<<32-19)^(J>>>61-32|Z<<32-(61-32))^Z>>>6,O=(J>>>19|Z<<32-19)^(Z>>>61-32|J<<32-(61-32))^(J>>>6|Z<<32-6),H+=O&65535,j+=O>>>16,W+=E&65535,V+=E>>>16,j+=H>>>16,W+=j>>>16,V+=W>>>16,a[te]=W&65535|V<<16,l[te]=H&65535|j<<16}E=_,O=P,H=O&65535,j=O>>>16,W=E&65535,V=E>>>16,E=u[0],O=d[0],H+=O&65535,j+=O>>>16,W+=E&65535,V+=E>>>16,j+=H>>>16,W+=j>>>16,V+=W>>>16,u[0]=_=W&65535|V<<16,d[0]=P=H&65535|j<<16,E=R,O=h,H=O&65535,j=O>>>16,W=E&65535,V=E>>>16,E=u[1],O=d[1],H+=O&65535,j+=O>>>16,W+=E&65535,V+=E>>>16,j+=H>>>16,W+=j>>>16,V+=W>>>16,u[1]=R=W&65535|V<<16,d[1]=h=H&65535|j<<16,E=M,O=S,H=O&65535,j=O>>>16,W=E&65535,V=E>>>16,E=u[2],O=d[2],H+=O&65535,j+=O>>>16,W+=E&65535,V+=E>>>16,j+=H>>>16,W+=j>>>16,V+=W>>>16,u[2]=M=W&65535|V<<16,d[2]=S=H&65535|j<<16,E=B,O=q,H=O&65535,j=O>>>16,W=E&65535,V=E>>>16,E=u[3],O=d[3],H+=O&65535,j+=O>>>16,W+=E&65535,V+=E>>>16,j+=H>>>16,W+=j>>>16,V+=W>>>16,u[3]=B=W&65535|V<<16,d[3]=q=H&65535|j<<16,E=D,O=z,H=O&65535,j=O>>>16,W=E&65535,V=E>>>16,E=u[4],O=d[4],H+=O&65535,j+=O>>>16,W+=E&65535,V+=E>>>16,j+=H>>>16,W+=j>>>16,V+=W>>>16,u[4]=D=W&65535|V<<16,d[4]=z=H&65535|j<<16,E=N,O=Y,H=O&65535,j=O>>>16,W=E&65535,V=E>>>16,E=u[5],O=d[5],H+=O&65535,j+=O>>>16,W+=E&65535,V+=E>>>16,j+=H>>>16,W+=j>>>16,V+=W>>>16,u[5]=N=W&65535|V<<16,d[5]=Y=H&65535|j<<16,E=C,O=re,H=O&65535,j=O>>>16,W=E&65535,V=E>>>16,E=u[6],O=d[6],H+=O&65535,j+=O>>>16,W+=E&65535,V+=E>>>16,j+=H>>>16,W+=j>>>16,V+=W>>>16,u[6]=C=W&65535|V<<16,d[6]=re=H&65535|j<<16,E=$,O=ie,H=O&65535,j=O>>>16,W=E&65535,V=E>>>16,E=u[7],O=d[7],H+=O&65535,j+=O>>>16,W+=E&65535,V+=E>>>16,j+=H>>>16,W+=j>>>16,V+=W>>>16,u[7]=$=W&65535|V<<16,d[7]=ie=H&65535|j<<16,m+=128,v-=128}return m}function s(a){var l=new n;l.update(a);var u=l.digest();return l.clean(),u}t.hash=s})(Cf),function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.convertSecretKeyToX25519=t.convertPublicKeyToX25519=t.verify=t.sign=t.extractPublicKeyFromSecretKey=t.generateKeyPair=t.generateKeyPairFromSeed=t.SEED_LENGTH=t.SECRET_KEY_LENGTH=t.PUBLIC_KEY_LENGTH=t.SIGNATURE_LENGTH=void 0;const e=mf,r=Cf,n=Mn;t.SIGNATURE_LENGTH=64,t.PUBLIC_KEY_LENGTH=32,t.SECRET_KEY_LENGTH=64,t.SEED_LENGTH=32;function i(T){const F=new Float64Array(16);if(T)for(let I=0;I<T.length;I++)F[I]=T[I];return F}const o=new Uint8Array(32);o[0]=9;const s=i(),a=i([1]),l=i([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),u=i([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),d=i([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),y=i([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),m=i([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function v(T,F){for(let I=0;I<16;I++)T[I]=F[I]|0}function _(T){let F=1;for(let I=0;I<16;I++){let c=T[I]+F+65535;F=Math.floor(c/65536),T[I]=c-F*65536}T[0]+=F-1+37*(F-1)}function R(T,F,I){const c=~(I-1);for(let w=0;w<16;w++){const G=c&(T[w]^F[w]);T[w]^=G,F[w]^=G}}function M(T,F){const I=i(),c=i();for(let w=0;w<16;w++)c[w]=F[w];_(c),_(c),_(c);for(let w=0;w<2;w++){I[0]=c[0]-65517;for(let Q=1;Q<15;Q++)I[Q]=c[Q]-65535-(I[Q-1]>>16&1),I[Q-1]&=65535;I[15]=c[15]-32767-(I[14]>>16&1);const G=I[15]>>16&1;I[14]&=65535,R(c,I,1-G)}for(let w=0;w<16;w++)T[2*w]=c[w]&255,T[2*w+1]=c[w]>>8}function B(T,F){let I=0;for(let c=0;c<32;c++)I|=T[c]^F[c];return(1&I-1>>>8)-1}function D(T,F){const I=new Uint8Array(32),c=new Uint8Array(32);return M(I,T),M(c,F),B(I,c)}function N(T){const F=new Uint8Array(32);return M(F,T),F[0]&1}function C(T,F){for(let I=0;I<16;I++)T[I]=F[2*I]+(F[2*I+1]<<8);T[15]&=32767}function $(T,F,I){for(let c=0;c<16;c++)T[c]=F[c]+I[c]}function P(T,F,I){for(let c=0;c<16;c++)T[c]=F[c]-I[c]}function h(T,F,I){let c,w,G=0,Q=0,he=0,be=0,pe=0,ye=0,ze=0,Ue=0,xe=0,Ee=0,ge=0,we=0,ve=0,fe=0,me=0,b=0,f=0,p=0,A=0,L=0,k=0,K=0,se=0,de=0,De=0,Be=0,Pe=0,pt=0,Vt=0,dr=0,$r=0,We=I[0],Te=I[1],Ve=I[2],qe=I[3],Ke=I[4],Ne=I[5],Xe=I[6],Qe=I[7],et=I[8],tt=I[9],rt=I[10],Ze=I[11],Ge=I[12],Ae=I[13],nt=I[14],it=I[15];c=F[0],G+=c*We,Q+=c*Te,he+=c*Ve,be+=c*qe,pe+=c*Ke,ye+=c*Ne,ze+=c*Xe,Ue+=c*Qe,xe+=c*et,Ee+=c*tt,ge+=c*rt,we+=c*Ze,ve+=c*Ge,fe+=c*Ae,me+=c*nt,b+=c*it,c=F[1],Q+=c*We,he+=c*Te,be+=c*Ve,pe+=c*qe,ye+=c*Ke,ze+=c*Ne,Ue+=c*Xe,xe+=c*Qe,Ee+=c*et,ge+=c*tt,we+=c*rt,ve+=c*Ze,fe+=c*Ge,me+=c*Ae,b+=c*nt,f+=c*it,c=F[2],he+=c*We,be+=c*Te,pe+=c*Ve,ye+=c*qe,ze+=c*Ke,Ue+=c*Ne,xe+=c*Xe,Ee+=c*Qe,ge+=c*et,we+=c*tt,ve+=c*rt,fe+=c*Ze,me+=c*Ge,b+=c*Ae,f+=c*nt,p+=c*it,c=F[3],be+=c*We,pe+=c*Te,ye+=c*Ve,ze+=c*qe,Ue+=c*Ke,xe+=c*Ne,Ee+=c*Xe,ge+=c*Qe,we+=c*et,ve+=c*tt,fe+=c*rt,me+=c*Ze,b+=c*Ge,f+=c*Ae,p+=c*nt,A+=c*it,c=F[4],pe+=c*We,ye+=c*Te,ze+=c*Ve,Ue+=c*qe,xe+=c*Ke,Ee+=c*Ne,ge+=c*Xe,we+=c*Qe,ve+=c*et,fe+=c*tt,me+=c*rt,b+=c*Ze,f+=c*Ge,p+=c*Ae,A+=c*nt,L+=c*it,c=F[5],ye+=c*We,ze+=c*Te,Ue+=c*Ve,xe+=c*qe,Ee+=c*Ke,ge+=c*Ne,we+=c*Xe,ve+=c*Qe,fe+=c*et,me+=c*tt,b+=c*rt,f+=c*Ze,p+=c*Ge,A+=c*Ae,L+=c*nt,k+=c*it,c=F[6],ze+=c*We,Ue+=c*Te,xe+=c*Ve,Ee+=c*qe,ge+=c*Ke,we+=c*Ne,ve+=c*Xe,fe+=c*Qe,me+=c*et,b+=c*tt,f+=c*rt,p+=c*Ze,A+=c*Ge,L+=c*Ae,k+=c*nt,K+=c*it,c=F[7],Ue+=c*We,xe+=c*Te,Ee+=c*Ve,ge+=c*qe,we+=c*Ke,ve+=c*Ne,fe+=c*Xe,me+=c*Qe,b+=c*et,f+=c*tt,p+=c*rt,A+=c*Ze,L+=c*Ge,k+=c*Ae,K+=c*nt,se+=c*it,c=F[8],xe+=c*We,Ee+=c*Te,ge+=c*Ve,we+=c*qe,ve+=c*Ke,fe+=c*Ne,me+=c*Xe,b+=c*Qe,f+=c*et,p+=c*tt,A+=c*rt,L+=c*Ze,k+=c*Ge,K+=c*Ae,se+=c*nt,de+=c*it,c=F[9],Ee+=c*We,ge+=c*Te,we+=c*Ve,ve+=c*qe,fe+=c*Ke,me+=c*Ne,b+=c*Xe,f+=c*Qe,p+=c*et,A+=c*tt,L+=c*rt,k+=c*Ze,K+=c*Ge,se+=c*Ae,de+=c*nt,De+=c*it,c=F[10],ge+=c*We,we+=c*Te,ve+=c*Ve,fe+=c*qe,me+=c*Ke,b+=c*Ne,f+=c*Xe,p+=c*Qe,A+=c*et,L+=c*tt,k+=c*rt,K+=c*Ze,se+=c*Ge,de+=c*Ae,De+=c*nt,Be+=c*it,c=F[11],we+=c*We,ve+=c*Te,fe+=c*Ve,me+=c*qe,b+=c*Ke,f+=c*Ne,p+=c*Xe,A+=c*Qe,L+=c*et,k+=c*tt,K+=c*rt,se+=c*Ze,de+=c*Ge,De+=c*Ae,Be+=c*nt,Pe+=c*it,c=F[12],ve+=c*We,fe+=c*Te,me+=c*Ve,b+=c*qe,f+=c*Ke,p+=c*Ne,A+=c*Xe,L+=c*Qe,k+=c*et,K+=c*tt,se+=c*rt,de+=c*Ze,De+=c*Ge,Be+=c*Ae,Pe+=c*nt,pt+=c*it,c=F[13],fe+=c*We,me+=c*Te,b+=c*Ve,f+=c*qe,p+=c*Ke,A+=c*Ne,L+=c*Xe,k+=c*Qe,K+=c*et,se+=c*tt,de+=c*rt,De+=c*Ze,Be+=c*Ge,Pe+=c*Ae,pt+=c*nt,Vt+=c*it,c=F[14],me+=c*We,b+=c*Te,f+=c*Ve,p+=c*qe,A+=c*Ke,L+=c*Ne,k+=c*Xe,K+=c*Qe,se+=c*et,de+=c*tt,De+=c*rt,Be+=c*Ze,Pe+=c*Ge,pt+=c*Ae,Vt+=c*nt,dr+=c*it,c=F[15],b+=c*We,f+=c*Te,p+=c*Ve,A+=c*qe,L+=c*Ke,k+=c*Ne,K+=c*Xe,se+=c*Qe,de+=c*et,De+=c*tt,Be+=c*rt,Pe+=c*Ze,pt+=c*Ge,Vt+=c*Ae,dr+=c*nt,$r+=c*it,G+=38*f,Q+=38*p,he+=38*A,be+=38*L,pe+=38*k,ye+=38*K,ze+=38*se,Ue+=38*de,xe+=38*De,Ee+=38*Be,ge+=38*Pe,we+=38*pt,ve+=38*Vt,fe+=38*dr,me+=38*$r,w=1,c=G+w+65535,w=Math.floor(c/65536),G=c-w*65536,c=Q+w+65535,w=Math.floor(c/65536),Q=c-w*65536,c=he+w+65535,w=Math.floor(c/65536),he=c-w*65536,c=be+w+65535,w=Math.floor(c/65536),be=c-w*65536,c=pe+w+65535,w=Math.floor(c/65536),pe=c-w*65536,c=ye+w+65535,w=Math.floor(c/65536),ye=c-w*65536,c=ze+w+65535,w=Math.floor(c/65536),ze=c-w*65536,c=Ue+w+65535,w=Math.floor(c/65536),Ue=c-w*65536,c=xe+w+65535,w=Math.floor(c/65536),xe=c-w*65536,c=Ee+w+65535,w=Math.floor(c/65536),Ee=c-w*65536,c=ge+w+65535,w=Math.floor(c/65536),ge=c-w*65536,c=we+w+65535,w=Math.floor(c/65536),we=c-w*65536,c=ve+w+65535,w=Math.floor(c/65536),ve=c-w*65536,c=fe+w+65535,w=Math.floor(c/65536),fe=c-w*65536,c=me+w+65535,w=Math.floor(c/65536),me=c-w*65536,c=b+w+65535,w=Math.floor(c/65536),b=c-w*65536,G+=w-1+37*(w-1),w=1,c=G+w+65535,w=Math.floor(c/65536),G=c-w*65536,c=Q+w+65535,w=Math.floor(c/65536),Q=c-w*65536,c=he+w+65535,w=Math.floor(c/65536),he=c-w*65536,c=be+w+65535,w=Math.floor(c/65536),be=c-w*65536,c=pe+w+65535,w=Math.floor(c/65536),pe=c-w*65536,c=ye+w+65535,w=Math.floor(c/65536),ye=c-w*65536,c=ze+w+65535,w=Math.floor(c/65536),ze=c-w*65536,c=Ue+w+65535,w=Math.floor(c/65536),Ue=c-w*65536,c=xe+w+65535,w=Math.floor(c/65536),xe=c-w*65536,c=Ee+w+65535,w=Math.floor(c/65536),Ee=c-w*65536,c=ge+w+65535,w=Math.floor(c/65536),ge=c-w*65536,c=we+w+65535,w=Math.floor(c/65536),we=c-w*65536,c=ve+w+65535,w=Math.floor(c/65536),ve=c-w*65536,c=fe+w+65535,w=Math.floor(c/65536),fe=c-w*65536,c=me+w+65535,w=Math.floor(c/65536),me=c-w*65536,c=b+w+65535,w=Math.floor(c/65536),b=c-w*65536,G+=w-1+37*(w-1),T[0]=G,T[1]=Q,T[2]=he,T[3]=be,T[4]=pe,T[5]=ye,T[6]=ze,T[7]=Ue,T[8]=xe,T[9]=Ee,T[10]=ge,T[11]=we,T[12]=ve,T[13]=fe,T[14]=me,T[15]=b}function S(T,F){h(T,F,F)}function q(T,F){const I=i();let c;for(c=0;c<16;c++)I[c]=F[c];for(c=253;c>=0;c--)S(I,I),c!==2&&c!==4&&h(I,I,F);for(c=0;c<16;c++)T[c]=I[c]}function z(T,F){const I=i();let c;for(c=0;c<16;c++)I[c]=F[c];for(c=250;c>=0;c--)S(I,I),c!==1&&h(I,I,F);for(c=0;c<16;c++)T[c]=I[c]}function Y(T,F){const I=i(),c=i(),w=i(),G=i(),Q=i(),he=i(),be=i(),pe=i(),ye=i();P(I,T[1],T[0]),P(ye,F[1],F[0]),h(I,I,ye),$(c,T[0],T[1]),$(ye,F[0],F[1]),h(c,c,ye),h(w,T[3],F[3]),h(w,w,u),h(G,T[2],F[2]),$(G,G,G),P(Q,c,I),P(he,G,w),$(be,G,w),$(pe,c,I),h(T[0],Q,he),h(T[1],pe,be),h(T[2],be,he),h(T[3],Q,pe)}function re(T,F,I){for(let c=0;c<4;c++)R(T[c],F[c],I)}function ie(T,F){const I=i(),c=i(),w=i();q(w,F[2]),h(I,F[0],w),h(c,F[1],w),M(T,c),T[31]^=N(I)<<7}function E(T,F,I){v(T[0],s),v(T[1],a),v(T[2],a),v(T[3],s);for(let c=255;c>=0;--c){const w=I[c/8|0]>>(c&7)&1;re(T,F,w),Y(F,T),Y(T,T),re(T,F,w)}}function O(T,F){const I=[i(),i(),i(),i()];v(I[0],d),v(I[1],y),v(I[2],a),h(I[3],d,y),E(T,I,F)}function Z(T){if(T.length!==t.SEED_LENGTH)throw new Error(`ed25519: seed must be ${t.SEED_LENGTH} bytes`);const F=(0,r.hash)(T);F[0]&=248,F[31]&=127,F[31]|=64;const I=new Uint8Array(32),c=[i(),i(),i(),i()];O(c,F),ie(I,c);const w=new Uint8Array(64);return w.set(T),w.set(I,32),{publicKey:I,secretKey:w}}t.generateKeyPairFromSeed=Z;function J(T){const F=(0,e.randomBytes)(32,T),I=Z(F);return(0,n.wipe)(F),I}t.generateKeyPair=J;function H(T){if(T.length!==t.SECRET_KEY_LENGTH)throw new Error(`ed25519: secret key must be ${t.SECRET_KEY_LENGTH} bytes`);return new Uint8Array(T.subarray(32))}t.extractPublicKeyFromSecretKey=H;const j=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 W(T,F){let I,c,w,G;for(c=63;c>=32;--c){for(I=0,w=c-32,G=c-12;w<G;++w)F[w]+=I-16*F[c]*j[w-(c-32)],I=Math.floor((F[w]+128)/256),F[w]-=I*256;F[w]+=I,F[c]=0}for(I=0,w=0;w<32;w++)F[w]+=I-(F[31]>>4)*j[w],I=F[w]>>8,F[w]&=255;for(w=0;w<32;w++)F[w]-=I*j[w];for(c=0;c<32;c++)F[c+1]+=F[c]>>8,T[c]=F[c]&255}function V(T){const F=new Float64Array(64);for(let I=0;I<64;I++)F[I]=T[I];for(let I=0;I<64;I++)T[I]=0;W(T,F)}function ce(T,F){const I=new Float64Array(64),c=[i(),i(),i(),i()],w=(0,r.hash)(T.subarray(0,32));w[0]&=248,w[31]&=127,w[31]|=64;const G=new Uint8Array(64);G.set(w.subarray(32),32);const Q=new r.SHA512;Q.update(G.subarray(32)),Q.update(F);const he=Q.digest();Q.clean(),V(he),O(c,he),ie(G,c),Q.reset(),Q.update(G.subarray(0,32)),Q.update(T.subarray(32)),Q.update(F);const be=Q.digest();V(be);for(let pe=0;pe<32;pe++)I[pe]=he[pe];for(let pe=0;pe<32;pe++)for(let ye=0;ye<32;ye++)I[pe+ye]+=be[pe]*w[ye];return W(G.subarray(32),I),G}t.sign=ce;function te(T,F){const I=i(),c=i(),w=i(),G=i(),Q=i(),he=i(),be=i();return v(T[2],a),C(T[1],F),S(w,T[1]),h(G,w,l),P(w,w,T[2]),$(G,T[2],G),S(Q,G),S(he,Q),h(be,he,Q),h(I,be,w),h(I,I,G),z(I,I),h(I,I,w),h(I,I,G),h(I,I,G),h(T[0],I,G),S(c,T[0]),h(c,c,G),D(c,w)&&h(T[0],T[0],m),S(c,T[0]),h(c,c,G),D(c,w)?-1:(N(T[0])===F[31]>>7&&P(T[0],s,T[0]),h(T[3],T[0],T[1]),0)}function Ce(T,F,I){const c=new Uint8Array(32),w=[i(),i(),i(),i()],G=[i(),i(),i(),i()];if(I.length!==t.SIGNATURE_LENGTH)throw new Error(`ed25519: signature must be ${t.SIGNATURE_LENGTH} bytes`);if(te(G,T))return!1;const Q=new r.SHA512;Q.update(I.subarray(0,32)),Q.update(T),Q.update(F);const he=Q.digest();return V(he),E(w,G,he),O(G,I.subarray(32)),Y(w,G),ie(c,w),!B(I,c)}t.verify=Ce;function ne(T){let F=[i(),i(),i(),i()];if(te(F,T))throw new Error("Ed25519: invalid public key");let I=i(),c=i(),w=F[1];$(I,a,w),P(c,a,w),q(c,c),h(I,I,c);let G=new Uint8Array(32);return M(G,I),G}t.convertPublicKeyToX25519=ne;function Oe(T){const F=(0,r.hash)(T.subarray(0,32));F[0]&=248,F[31]&=127,F[31]|=64;const I=new Uint8Array(F.subarray(0,32));return(0,n.wipe)(F),I}t.convertSecretKeyToX25519=Oe}(S_);function n8(t,e){if(t.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),n=0;n<r.length;n++)r[n]=255;for(var i=0;i<t.length;i++){var o=t.charAt(i),s=o.charCodeAt(0);if(r[s]!==255)throw new TypeError(o+" is ambiguous");r[s]=i}var a=t.length,l=t.charAt(0),u=Math.log(a)/Math.log(256),d=Math.log(256)/Math.log(a);function y(_){if(_ instanceof Uint8Array||(ArrayBuffer.isView(_)?_=new Uint8Array(_.buffer,_.byteOffset,_.byteLength):Array.isArray(_)&&(_=Uint8Array.from(_))),!(_ instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(_.length===0)return"";for(var R=0,M=0,B=0,D=_.length;B!==D&&_[B]===0;)B++,R++;for(var N=(D-B)*d+1>>>0,C=new Uint8Array(N);B!==D;){for(var $=_[B],P=0,h=N-1;($!==0||P<M)&&h!==-1;h--,P++)$+=256*C[h]>>>0,C[h]=$%a>>>0,$=$/a>>>0;if($!==0)throw new Error("Non-zero carry");M=P,B++}for(var S=N-M;S!==N&&C[S]===0;)S++;for(var q=l.repeat(R);S<N;++S)q+=t.charAt(C[S]);return q}function m(_){if(typeof _!="string")throw new TypeError("Expected String");if(_.length===0)return new Uint8Array;var R=0;if(_[R]!==" "){for(var M=0,B=0;_[R]===l;)M++,R++;for(var D=(_.length-R)*u+1>>>0,N=new Uint8Array(D);_[R];){var C=r[_.charCodeAt(R)];if(C===255)return;for(var $=0,P=D-1;(C!==0||$<B)&&P!==-1;P--,$++)C+=a*N[P]>>>0,N[P]=C%256>>>0,C=C/256>>>0;if(C!==0)throw new Error("Non-zero carry");B=$,R++}if(_[R]!==" "){for(var h=D-B;h!==D&&N[h]===0;)h++;for(var S=new Uint8Array(M+(D-h)),q=M;h!==D;)S[q++]=N[h++];return S}}}function v(_){var R=m(_);if(R)return R;throw new Error(`Non-${e} character`)}return{encode:y,decodeUnsafe:m,decode:v}}var i8=n8,o8=i8;const Sf=t=>{if(t instanceof Uint8Array&&t.constructor.name==="Uint8Array")return t;if(t instanceof ArrayBuffer)return new Uint8Array(t);if(ArrayBuffer.isView(t))return new Uint8Array(t.buffer,t.byteOffset,t.byteLength);throw new Error("Unknown type, must be binary type")},s8=t=>new TextEncoder().encode(t),a8=t=>new TextDecoder().decode(t);class c8{constructor(e,r,n){this.name=e,this.prefix=r,this.baseEncode=n}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}}class l8{constructor(e,r,n){if(this.name=e,this.prefix=r,r.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=r.codePointAt(0),this.baseDecode=n}decode(e){if(typeof e=="string"){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))}else throw Error("Can only multibase decode strings")}or(e){return Af(this,e)}}class u8{constructor(e){this.decoders=e}or(e){return Af(this,e)}decode(e){const r=e[0],n=this.decoders[r];if(n)return n.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const Af=(t,e)=>new u8(Qt(Qt({},t.decoders||{[t.prefix]:t}),e.decoders||{[e.prefix]:e}));class h8{constructor(e,r,n,i){this.name=e,this.prefix=r,this.baseEncode=n,this.baseDecode=i,this.encoder=new c8(e,r,n),this.decoder=new l8(e,r,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}const ps=({name:t,prefix:e,encode:r,decode:n})=>new h8(t,e,r,n),zi=({prefix:t,name:e,alphabet:r})=>{const{encode:n,decode:i}=o8(r,e);return ps({prefix:t,name:e,encode:n,decode:o=>Sf(i(o))})},f8=(t,e,r,n)=>{const i={};for(let d=0;d<e.length;++d)i[e[d]]=d;let o=t.length;for(;t[o-1]==="=";)--o;const s=new Uint8Array(o*r/8|0);let a=0,l=0,u=0;for(let d=0;d<o;++d){const y=i[t[d]];if(y===void 0)throw new SyntaxError(`Non-${n} character`);l=l<<r|y,a+=r,a>=8&&(a-=8,s[u++]=255&l>>a)}if(a>=r||255&l<<8-a)throw new SyntaxError("Unexpected end of data");return s},d8=(t,e,r)=>{const n=e[e.length-1]==="=",i=(1<<r)-1;let o="",s=0,a=0;for(let l=0;l<t.length;++l)for(a=a<<8|t[l],s+=8;s>r;)s-=r,o+=e[i&a>>s];if(s&&(o+=e[i&a<<r-s]),n)for(;o.length*r&7;)o+="=";return o},Nt=({name:t,prefix:e,bitsPerChar:r,alphabet:n})=>ps({prefix:e,name:t,encode(i){return d8(i,n,r)},decode(i){return f8(i,n,r,t)}}),p8=ps({prefix:"\0",name:"identity",encode:t=>a8(t),decode:t=>s8(t)});var g8=Object.freeze({__proto__:null,identity:p8});const m8=Nt({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var b8=Object.freeze({__proto__:null,base2:m8});const y8=Nt({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var w8=Object.freeze({__proto__:null,base8:y8});const v8=zi({prefix:"9",name:"base10",alphabet:"0123456789"});var _8=Object.freeze({__proto__:null,base10:v8});const E8=Nt({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),x8=Nt({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var C8=Object.freeze({__proto__:null,base16:E8,base16upper:x8});const S8=Nt({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),A8=Nt({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),I8=Nt({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),O8=Nt({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),D8=Nt({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),$8=Nt({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),F8=Nt({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),P8=Nt({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),T8=Nt({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var N8=Object.freeze({__proto__:null,base32:S8,base32upper:A8,base32pad:I8,base32padupper:O8,base32hex:D8,base32hexupper:$8,base32hexpad:F8,base32hexpadupper:P8,base32z:T8});const R8=zi({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),L8=zi({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var M8=Object.freeze({__proto__:null,base36:R8,base36upper:L8});const U8=zi({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),B8=zi({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var j8=Object.freeze({__proto__:null,base58btc:U8,base58flickr:B8});const k8=Nt({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),H8=Nt({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),z8=Nt({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),W8=Nt({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var V8=Object.freeze({__proto__:null,base64:k8,base64pad:H8,base64url:z8,base64urlpad:W8});const If=Array.from("\u{1F680}\u{1FA90}\u2604\u{1F6F0}\u{1F30C}\u{1F311}\u{1F312}\u{1F313}\u{1F314}\u{1F315}\u{1F316}\u{1F317}\u{1F318}\u{1F30D}\u{1F30F}\u{1F30E}\u{1F409}\u2600\u{1F4BB}\u{1F5A5}\u{1F4BE}\u{1F4BF}\u{1F602}\u2764\u{1F60D}\u{1F923}\u{1F60A}\u{1F64F}\u{1F495}\u{1F62D}\u{1F618}\u{1F44D}\u{1F605}\u{1F44F}\u{1F601}\u{1F525}\u{1F970}\u{1F494}\u{1F496}\u{1F499}\u{1F622}\u{1F914}\u{1F606}\u{1F644}\u{1F4AA}\u{1F609}\u263A\u{1F44C}\u{1F917}\u{1F49C}\u{1F614}\u{1F60E}\u{1F607}\u{1F339}\u{1F926}\u{1F389}\u{1F49E}\u270C\u2728\u{1F937}\u{1F631}\u{1F60C}\u{1F338}\u{1F64C}\u{1F60B}\u{1F497}\u{1F49A}\u{1F60F}\u{1F49B}\u{1F642}\u{1F493}\u{1F929}\u{1F604}\u{1F600}\u{1F5A4}\u{1F603}\u{1F4AF}\u{1F648}\u{1F447}\u{1F3B6}\u{1F612}\u{1F92D}\u2763\u{1F61C}\u{1F48B}\u{1F440}\u{1F62A}\u{1F611}\u{1F4A5}\u{1F64B}\u{1F61E}\u{1F629}\u{1F621}\u{1F92A}\u{1F44A}\u{1F973}\u{1F625}\u{1F924}\u{1F449}\u{1F483}\u{1F633}\u270B\u{1F61A}\u{1F61D}\u{1F634}\u{1F31F}\u{1F62C}\u{1F643}\u{1F340}\u{1F337}\u{1F63B}\u{1F613}\u2B50\u2705\u{1F97A}\u{1F308}\u{1F608}\u{1F918}\u{1F4A6}\u2714\u{1F623}\u{1F3C3}\u{1F490}\u2639\u{1F38A}\u{1F498}\u{1F620}\u261D\u{1F615}\u{1F33A}\u{1F382}\u{1F33B}\u{1F610}\u{1F595}\u{1F49D}\u{1F64A}\u{1F639}\u{1F5E3}\u{1F4AB}\u{1F480}\u{1F451}\u{1F3B5}\u{1F91E}\u{1F61B}\u{1F534}\u{1F624}\u{1F33C}\u{1F62B}\u26BD\u{1F919}\u2615\u{1F3C6}\u{1F92B}\u{1F448}\u{1F62E}\u{1F646}\u{1F37B}\u{1F343}\u{1F436}\u{1F481}\u{1F632}\u{1F33F}\u{1F9E1}\u{1F381}\u26A1\u{1F31E}\u{1F388}\u274C\u270A\u{1F44B}\u{1F630}\u{1F928}\u{1F636}\u{1F91D}\u{1F6B6}\u{1F4B0}\u{1F353}\u{1F4A2}\u{1F91F}\u{1F641}\u{1F6A8}\u{1F4A8}\u{1F92C}\u2708\u{1F380}\u{1F37A}\u{1F913}\u{1F619}\u{1F49F}\u{1F331}\u{1F616}\u{1F476}\u{1F974}\u25B6\u27A1\u2753\u{1F48E}\u{1F4B8}\u2B07\u{1F628}\u{1F31A}\u{1F98B}\u{1F637}\u{1F57A}\u26A0\u{1F645}\u{1F61F}\u{1F635}\u{1F44E}\u{1F932}\u{1F920}\u{1F927}\u{1F4CC}\u{1F535}\u{1F485}\u{1F9D0}\u{1F43E}\u{1F352}\u{1F617}\u{1F911}\u{1F30A}\u{1F92F}\u{1F437}\u260E\u{1F4A7}\u{1F62F}\u{1F486}\u{1F446}\u{1F3A4}\u{1F647}\u{1F351}\u2744\u{1F334}\u{1F4A3}\u{1F438}\u{1F48C}\u{1F4CD}\u{1F940}\u{1F922}\u{1F445}\u{1F4A1}\u{1F4A9}\u{1F450}\u{1F4F8}\u{1F47B}\u{1F910}\u{1F92E}\u{1F3BC}\u{1F975}\u{1F6A9}\u{1F34E}\u{1F34A}\u{1F47C}\u{1F48D}\u{1F4E3}\u{1F942}"),q8=If.reduce((t,e,r)=>(t[r]=e,t),[]),K8=If.reduce((t,e,r)=>(t[e.codePointAt(0)]=r,t),[]);function G8(t){return t.reduce((e,r)=>(e+=q8[r],e),"")}function Y8(t){const e=[];for(const r of t){const n=K8[r.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${r}`);e.push(n)}return new Uint8Array(e)}const Z8=ps({prefix:"\u{1F680}",name:"base256emoji",encode:G8,decode:Y8});var J8=Object.freeze({__proto__:null,base256emoji:Z8}),X8=Df,Of=128,Q8=127,e7=~Q8,t7=Math.pow(2,31);function Df(t,e,r){e=e||[],r=r||0;for(var n=r;t>=t7;)e[r++]=t&255|Of,t/=128;for(;t&e7;)e[r++]=t&255|Of,t>>>=7;return e[r]=t|0,Df.bytes=r-n+1,e}var r7=Ic,n7=128,$f=127;function Ic(t,n){var r=0,n=n||0,i=0,o=n,s,a=t.length;do{if(o>=a)throw Ic.bytes=0,new RangeError("Could not decode varint");s=t[o++],r+=i<28?(s&$f)<<i:(s&$f)*Math.pow(2,i),i+=7}while(s>=n7);return Ic.bytes=o-n,r}var i7=Math.pow(2,7),o7=Math.pow(2,14),s7=Math.pow(2,21),a7=Math.pow(2,28),c7=Math.pow(2,35),l7=Math.pow(2,42),u7=Math.pow(2,49),h7=Math.pow(2,56),f7=Math.pow(2,63),d7=function(t){return t<i7?1:t<o7?2:t<s7?3:t<a7?4:t<c7?5:t<l7?6:t<u7?7:t<h7?8:t<f7?9:10},p7={encode:X8,decode:r7,encodingLength:d7},Ff=p7;const Pf=(t,e,r=0)=>(Ff.encode(t,e,r),e),Tf=t=>Ff.encodingLength(t),Oc=(t,e)=>{const r=e.byteLength,n=Tf(t),i=n+Tf(r),o=new Uint8Array(i+r);return Pf(t,o,0),Pf(r,o,n),o.set(e,i),new g7(t,r,e,o)};class g7{constructor(e,r,n,i){this.code=e,this.size=r,this.digest=n,this.bytes=i}}const Nf=({name:t,code:e,encode:r})=>new m7(t,e,r);class m7{constructor(e,r,n){this.name=e,this.code=r,this.encode=n}digest(e){if(e instanceof Uint8Array){const r=this.encode(e);return r instanceof Uint8Array?Oc(this.code,r):r.then(n=>Oc(this.code,n))}else throw Error("Unknown type, must be binary type")}}const Rf=t=>async e=>new Uint8Array(await crypto.subtle.digest(t,e)),b7=Nf({name:"sha2-256",code:18,encode:Rf("SHA-256")}),y7=Nf({name:"sha2-512",code:19,encode:Rf("SHA-512")});var w7=Object.freeze({__proto__:null,sha256:b7,sha512:y7});const Lf=0,v7="identity",Mf=Sf;var _7=Object.freeze({__proto__:null,identity:{code:Lf,name:v7,encode:Mf,digest:t=>Oc(Lf,Mf(t))}});new TextEncoder,new TextDecoder,Qt(Qt(Qt(Qt(Qt(Qt(Qt(Qt(Qt(Qt({},g8),b8),w8),_8),C8),N8),M8),j8),V8),J8),Qt(Qt({},w7),_7),(()=>typeof global<"u"&&typeof global.WebSocket<"u"?global.WebSocket:typeof window<"u"&&typeof window.WebSocket<"u"?window.WebSocket:require("ws"))();var Uf={exports:{}};(function(t,e){var r=200,n="__lodash_hash_undefined__",i=1,o=2,s=9007199254740991,a="[object Arguments]",l="[object Array]",u="[object AsyncFunction]",d="[object Boolean]",y="[object Date]",m="[object Error]",v="[object Function]",_="[object GeneratorFunction]",R="[object Map]",M="[object Number]",B="[object Null]",D="[object Object]",N="[object Promise]",C="[object Proxy]",$="[object RegExp]",P="[object Set]",h="[object String]",S="[object Symbol]",q="[object Undefined]",z="[object WeakMap]",Y="[object ArrayBuffer]",re="[object DataView]",ie="[object Float32Array]",E="[object Float64Array]",O="[object Int8Array]",Z="[object Int16Array]",J="[object Int32Array]",H="[object Uint8Array]",j="[object Uint8ClampedArray]",W="[object Uint16Array]",V="[object Uint32Array]",ce=/[\\^$.*+?()[\]{}|]/g,te=/^\[object .+?Constructor\]$/,Ce=/^(?:0|[1-9]\d*)$/,ne={};ne[ie]=ne[E]=ne[O]=ne[Z]=ne[J]=ne[H]=ne[j]=ne[W]=ne[V]=!0,ne[a]=ne[l]=ne[Y]=ne[d]=ne[re]=ne[y]=ne[m]=ne[v]=ne[R]=ne[M]=ne[D]=ne[$]=ne[P]=ne[h]=ne[z]=!1;var Oe=typeof on=="object"&&on&&on.Object===Object&&on,T=typeof self=="object"&&self&&self.Object===Object&&self,F=Oe||T||Function("return this")(),I=e&&!e.nodeType&&e,c=I&&!0&&t&&!t.nodeType&&t,w=c&&c.exports===I,G=w&&Oe.process,Q=function(){try{return G&&G.binding&&G.binding("util")}catch{}}(),he=Q&&Q.isTypedArray;function be(g,x){for(var U=-1,X=g==null?0:g.length,Se=0,ae=[];++U<X;){var Re=g[U];x(Re,U,g)&&(ae[Se++]=Re)}return ae}function pe(g,x){for(var U=-1,X=x.length,Se=g.length;++U<X;)g[Se+U]=x[U];return g}function ye(g,x){for(var U=-1,X=g==null?0:g.length;++U<X;)if(x(g[U],U,g))return!0;return!1}function ze(g,x){for(var U=-1,X=Array(g);++U<g;)X[U]=x(U);return X}function Ue(g){return function(x){return g(x)}}function xe(g,x){return g.has(x)}function Ee(g,x){return g?.[x]}function ge(g){var x=-1,U=Array(g.size);return g.forEach(function(X,Se){U[++x]=[Se,X]}),U}function we(g,x){return function(U){return g(x(U))}}function ve(g){var x=-1,U=Array(g.size);return g.forEach(function(X){U[++x]=X}),U}var fe=Array.prototype,me=Function.prototype,b=Object.prototype,f=F["__core-js_shared__"],p=me.toString,A=b.hasOwnProperty,L=function(){var g=/[^.]+$/.exec(f&&f.keys&&f.keys.IE_PROTO||"");return g?"Symbol(src)_1."+g:""}(),k=b.toString,K=RegExp("^"+p.call(A).replace(ce,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),se=w?F.Buffer:void 0,de=F.Symbol,De=F.Uint8Array,Be=b.propertyIsEnumerable,Pe=fe.splice,pt=de?de.toStringTag:void 0,Vt=Object.getOwnPropertySymbols,dr=se?se.isBuffer:void 0,$r=we(Object.keys,Object),We=ar(F,"DataView"),Te=ar(F,"Map"),Ve=ar(F,"Promise"),qe=ar(F,"Set"),Ke=ar(F,"WeakMap"),Ne=ar(Object,"create"),Xe=Kt(We),Qe=Kt(Te),et=Kt(Ve),tt=Kt(qe),rt=Kt(Ke),Ze=de?de.prototype:void 0,Ge=Ze?Ze.valueOf:void 0;function Ae(g){var x=-1,U=g==null?0:g.length;for(this.clear();++x<U;){var X=g[x];this.set(X[0],X[1])}}function nt(){this.__data__=Ne?Ne(null):{},this.size=0}function it(g){var x=this.has(g)&&delete this.__data__[g];return this.size-=x?1:0,x}function Hl(g){var x=this.__data__;if(Ne){var U=x[g];return U===n?void 0:U}return A.call(x,g)?x[g]:void 0}function zl(g){var x=this.__data__;return Ne?x[g]!==void 0:A.call(x,g)}function Wl(g,x){var U=this.__data__;return this.size+=this.has(g)?0:1,U[g]=Ne&&x===void 0?n:x,this}Ae.prototype.clear=nt,Ae.prototype.delete=it,Ae.prototype.get=Hl,Ae.prototype.has=zl,Ae.prototype.set=Wl;function At(g){var x=-1,U=g==null?0:g.length;for(this.clear();++x<U;){var X=g[x];this.set(X[0],X[1])}}function Vl(){this.__data__=[],this.size=0}function ql(g){var x=this.__data__,U=Pr(x,g);if(U<0)return!1;var X=x.length-1;return U==X?x.pop():Pe.call(x,U,1),--this.size,!0}function Kl(g){var x=this.__data__,U=Pr(x,g);return U<0?void 0:x[U][1]}function Gl(g){return Pr(this.__data__,g)>-1}function Yl(g,x){var U=this.__data__,X=Pr(U,g);return X<0?(++this.size,U.push([g,x])):U[X][1]=x,this}At.prototype.clear=Vl,At.prototype.delete=ql,At.prototype.get=Kl,At.prototype.has=Gl,At.prototype.set=Yl;function qt(g){var x=-1,U=g==null?0:g.length;for(this.clear();++x<U;){var X=g[x];this.set(X[0],X[1])}}function Zl(){this.size=0,this.__data__={hash:new Ae,map:new(Te||At),string:new Ae}}function Jl(g){var x=Tr(this,g).delete(g);return this.size-=x?1:0,x}function Xl(g){return Tr(this,g).get(g)}function Ql(g){return Tr(this,g).has(g)}function eu(g,x){var U=Tr(this,g),X=U.size;return U.set(g,x),this.size+=U.size==X?0:1,this}qt.prototype.clear=Zl,qt.prototype.delete=Jl,qt.prototype.get=Xl,qt.prototype.has=Ql,qt.prototype.set=eu;function Fr(g){var x=-1,U=g==null?0:g.length;for(this.__data__=new qt;++x<U;)this.add(g[x])}function tu(g){return this.__data__.set(g,n),this}function ru(g){return this.__data__.has(g)}Fr.prototype.add=Fr.prototype.push=tu,Fr.prototype.has=ru;function Lt(g){var x=this.__data__=new At(g);this.size=x.size}function nu(){this.__data__=new At,this.size=0}function iu(g){var x=this.__data__,U=x.delete(g);return this.size=x.size,U}function ou(g){return this.__data__.get(g)}function su(g){return this.__data__.has(g)}function au(g,x){var U=this.__data__;if(U instanceof At){var X=U.__data__;if(!Te||X.length<r-1)return X.push([g,x]),this.size=++U.size,this;U=this.__data__=new qt(X)}return U.set(g,x),this.size=U.size,this}Lt.prototype.clear=nu,Lt.prototype.delete=iu,Lt.prototype.get=ou,Lt.prototype.has=su,Lt.prototype.set=au;function cu(g,x){var U=Nr(g),X=!U&&xu(g),Se=!U&&!X&&Sn(g),ae=!U&&!X&&!Se&&$o(g),Re=U||X||Se||ae,ot=Re?ze(g.length,String):[],at=ot.length;for(var $e in g)(x||A.call(g,$e))&&!(Re&&($e=="length"||Se&&($e=="offset"||$e=="parent")||ae&&($e=="buffer"||$e=="byteLength"||$e=="byteOffset")||yu($e,at)))&&ot.push($e);return ot}function Pr(g,x){for(var U=g.length;U--;)if(Ao(g[U][0],x))return U;return-1}function lu(g,x,U){var X=x(g);return Nr(g)?X:pe(X,U(g))}function pr(g){return g==null?g===void 0?q:B:pt&&pt in Object(g)?mu(g):Eu(g)}function Eo(g){return gr(g)&&pr(g)==a}function xo(g,x,U,X,Se){return g===x?!0:g==null||x==null||!gr(g)&&!gr(x)?g!==g&&x!==x:uu(g,x,U,X,xo,Se)}function uu(g,x,U,X,Se,ae){var Re=Nr(g),ot=Nr(x),at=Re?l:Mt(g),$e=ot?l:Mt(x);at=at==a?D:at,$e=$e==a?D:$e;var gt=at==D,_t=$e==D,lt=at==$e;if(lt&&Sn(g)){if(!Sn(x))return!1;Re=!0,gt=!1}if(lt&&!gt)return ae||(ae=new Lt),Re||$o(g)?Co(g,x,U,X,Se,ae):pu(g,x,at,U,X,Se,ae);if(!(U&i)){var bt=gt&&A.call(g,"__wrapped__"),yt=_t&&A.call(x,"__wrapped__");if(bt||yt){var Ut=bt?g.value():g,It=yt?x.value():x;return ae||(ae=new Lt),Se(Ut,It,U,X,ae)}}return lt?(ae||(ae=new Lt),gu(g,x,U,X,Se,ae)):!1}function hu(g){if(!Do(g)||vu(g))return!1;var x=Io(g)?K:te;return x.test(Kt(g))}function fu(g){return gr(g)&&Oo(g.length)&&!!ne[pr(g)]}function du(g){if(!_u(g))return $r(g);var x=[];for(var U in Object(g))A.call(g,U)&&U!="constructor"&&x.push(U);return x}function Co(g,x,U,X,Se,ae){var Re=U&i,ot=g.length,at=x.length;if(ot!=at&&!(Re&&at>ot))return!1;var $e=ae.get(g);if($e&&ae.get(x))return $e==x;var gt=-1,_t=!0,lt=U&o?new Fr:void 0;for(ae.set(g,x),ae.set(x,g);++gt<ot;){var bt=g[gt],yt=x[gt];if(X)var Ut=Re?X(yt,bt,gt,x,g,ae):X(bt,yt,gt,g,x,ae);if(Ut!==void 0){if(Ut)continue;_t=!1;break}if(lt){if(!ye(x,function(It,Gt){if(!xe(lt,Gt)&&(bt===It||Se(bt,It,U,X,ae)))return lt.push(Gt)})){_t=!1;break}}else if(!(bt===yt||Se(bt,yt,U,X,ae))){_t=!1;break}}return ae.delete(g),ae.delete(x),_t}function pu(g,x,U,X,Se,ae,Re){switch(U){case re:if(g.byteLength!=x.byteLength||g.byteOffset!=x.byteOffset)return!1;g=g.buffer,x=x.buffer;case Y:return!(g.byteLength!=x.byteLength||!ae(new De(g),new De(x)));case d:case y:case M:return Ao(+g,+x);case m:return g.name==x.name&&g.message==x.message;case $:case h:return g==x+"";case R:var ot=ge;case P:var at=X&i;if(ot||(ot=ve),g.size!=x.size&&!at)return!1;var $e=Re.get(g);if($e)return $e==x;X|=o,Re.set(g,x);var gt=Co(ot(g),ot(x),X,Se,ae,Re);return Re.delete(g),gt;case S:if(Ge)return Ge.call(g)==Ge.call(x)}return!1}function gu(g,x,U,X,Se,ae){var Re=U&i,ot=So(g),at=ot.length,$e=So(x),gt=$e.length;if(at!=gt&&!Re)return!1;for(var _t=at;_t--;){var lt=ot[_t];if(!(Re?lt in x:A.call(x,lt)))return!1}var bt=ae.get(g);if(bt&&ae.get(x))return bt==x;var yt=!0;ae.set(g,x),ae.set(x,g);for(var Ut=Re;++_t<at;){lt=ot[_t];var It=g[lt],Gt=x[lt];if(X)var Fo=Re?X(Gt,It,lt,x,g,ae):X(It,Gt,lt,g,x,ae);if(!(Fo===void 0?It===Gt||Se(It,Gt,U,X,ae):Fo)){yt=!1;break}Ut||(Ut=lt=="constructor")}if(yt&&!Ut){var Rr=g.constructor,Lr=x.constructor;Rr!=Lr&&"constructor"in g&&"constructor"in x&&!(typeof Rr=="function"&&Rr instanceof Rr&&typeof Lr=="function"&&Lr instanceof Lr)&&(yt=!1)}return ae.delete(g),ae.delete(x),yt}function So(g){return lu(g,Au,bu)}function Tr(g,x){var U=g.__data__;return wu(x)?U[typeof x=="string"?"string":"hash"]:U.map}function ar(g,x){var U=Ee(g,x);return hu(U)?U:void 0}function mu(g){var x=A.call(g,pt),U=g[pt];try{g[pt]=void 0;var X=!0}catch{}var Se=k.call(g);return X&&(x?g[pt]=U:delete g[pt]),Se}var bu=Vt?function(g){return g==null?[]:(g=Object(g),be(Vt(g),function(x){return Be.call(g,x)}))}:Iu,Mt=pr;(We&&Mt(new We(new ArrayBuffer(1)))!=re||Te&&Mt(new Te)!=R||Ve&&Mt(Ve.resolve())!=N||qe&&Mt(new qe)!=P||Ke&&Mt(new Ke)!=z)&&(Mt=function(g){var x=pr(g),U=x==D?g.constructor:void 0,X=U?Kt(U):"";if(X)switch(X){case Xe:return re;case Qe:return R;case et:return N;case tt:return P;case rt:return z}return x});function yu(g,x){return x=x??s,!!x&&(typeof g=="number"||Ce.test(g))&&g>-1&&g%1==0&&g<x}function wu(g){var x=typeof g;return x=="string"||x=="number"||x=="symbol"||x=="boolean"?g!=="__proto__":g===null}function vu(g){return!!L&&L in g}function _u(g){var x=g&&g.constructor,U=typeof x=="function"&&x.prototype||b;return g===U}function Eu(g){return k.call(g)}function Kt(g){if(g!=null){try{return p.call(g)}catch{}try{return g+""}catch{}}return""}function Ao(g,x){return g===x||g!==g&&x!==x}var xu=Eo(function(){return arguments}())?Eo:function(g){return gr(g)&&A.call(g,"callee")&&!Be.call(g,"callee")},Nr=Array.isArray;function Cu(g){return g!=null&&Oo(g.length)&&!Io(g)}var Sn=dr||Ou;function Su(g,x){return xo(g,x)}function Io(g){if(!Do(g))return!1;var x=pr(g);return x==v||x==_||x==u||x==C}function Oo(g){return typeof g=="number"&&g>-1&&g%1==0&&g<=s}function Do(g){var x=typeof g;return g!=null&&(x=="object"||x=="function")}function gr(g){return g!=null&&typeof g=="object"}var $o=he?Ue(he):fu;function Au(g){return Cu(g)?cu(g):du(g)}function Iu(){return[]}function Ou(){return!1}t.exports=Su})(Uf,Uf.exports);var E7=Object.defineProperty,Bf=Object.getOwnPropertySymbols,x7=Object.prototype.hasOwnProperty,C7=Object.prototype.propertyIsEnumerable,jf=(t,e,r)=>e in t?E7(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Wt=(t,e)=>{for(var r in e||(e={}))x7.call(e,r)&&jf(t,r,e[r]);if(Bf)for(var r of Bf(e))C7.call(e,r)&&jf(t,r,e[r]);return t};function S7(t,e){if(t.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),n=0;n<r.length;n++)r[n]=255;for(var i=0;i<t.length;i++){var o=t.charAt(i),s=o.charCodeAt(0);if(r[s]!==255)throw new TypeError(o+" is ambiguous");r[s]=i}var a=t.length,l=t.charAt(0),u=Math.log(a)/Math.log(256),d=Math.log(256)/Math.log(a);function y(_){if(_ instanceof Uint8Array||(ArrayBuffer.isView(_)?_=new Uint8Array(_.buffer,_.byteOffset,_.byteLength):Array.isArray(_)&&(_=Uint8Array.from(_))),!(_ instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(_.length===0)return"";for(var R=0,M=0,B=0,D=_.length;B!==D&&_[B]===0;)B++,R++;for(var N=(D-B)*d+1>>>0,C=new Uint8Array(N);B!==D;){for(var $=_[B],P=0,h=N-1;($!==0||P<M)&&h!==-1;h--,P++)$+=256*C[h]>>>0,C[h]=$%a>>>0,$=$/a>>>0;if($!==0)throw new Error("Non-zero carry");M=P,B++}for(var S=N-M;S!==N&&C[S]===0;)S++;for(var q=l.repeat(R);S<N;++S)q+=t.charAt(C[S]);return q}function m(_){if(typeof _!="string")throw new TypeError("Expected String");if(_.length===0)return new Uint8Array;var R=0;if(_[R]!==" "){for(var M=0,B=0;_[R]===l;)M++,R++;for(var D=(_.length-R)*u+1>>>0,N=new Uint8Array(D);_[R];){var C=r[_.charCodeAt(R)];if(C===255)return;for(var $=0,P=D-1;(C!==0||$<B)&&P!==-1;P--,$++)C+=a*N[P]>>>0,N[P]=C%256>>>0,C=C/256>>>0;if(C!==0)throw new Error("Non-zero carry");B=$,R++}if(_[R]!==" "){for(var h=D-B;h!==D&&N[h]===0;)h++;for(var S=new Uint8Array(M+(D-h)),q=M;h!==D;)S[q++]=N[h++];return S}}}function v(_){var R=m(_);if(R)return R;throw new Error(`Non-${e} character`)}return{encode:y,decodeUnsafe:m,decode:v}}var A7=S7,I7=A7;const kf=t=>{if(t instanceof Uint8Array&&t.constructor.name==="Uint8Array")return t;if(t instanceof ArrayBuffer)return new Uint8Array(t);if(ArrayBuffer.isView(t))return new Uint8Array(t.buffer,t.byteOffset,t.byteLength);throw new Error("Unknown type, must be binary type")},O7=t=>new TextEncoder().encode(t),D7=t=>new TextDecoder().decode(t);class $7{constructor(e,r,n){this.name=e,this.prefix=r,this.baseEncode=n}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}}class F7{constructor(e,r,n){if(this.name=e,this.prefix=r,r.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=r.codePointAt(0),this.baseDecode=n}decode(e){if(typeof e=="string"){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))}else throw Error("Can only multibase decode strings")}or(e){return Hf(this,e)}}class P7{constructor(e){this.decoders=e}or(e){return Hf(this,e)}decode(e){const r=e[0],n=this.decoders[r];if(n)return n.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const Hf=(t,e)=>new P7(Wt(Wt({},t.decoders||{[t.prefix]:t}),e.decoders||{[e.prefix]:e}));class T7{constructor(e,r,n,i){this.name=e,this.prefix=r,this.baseEncode=n,this.baseDecode=i,this.encoder=new $7(e,r,n),this.decoder=new F7(e,r,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}const gs=({name:t,prefix:e,encode:r,decode:n})=>new T7(t,e,r,n),Wi=({prefix:t,name:e,alphabet:r})=>{const{encode:n,decode:i}=I7(r,e);return gs({prefix:t,name:e,encode:n,decode:o=>kf(i(o))})},N7=(t,e,r,n)=>{const i={};for(let d=0;d<e.length;++d)i[e[d]]=d;let o=t.length;for(;t[o-1]==="=";)--o;const s=new Uint8Array(o*r/8|0);let a=0,l=0,u=0;for(let d=0;d<o;++d){const y=i[t[d]];if(y===void 0)throw new SyntaxError(`Non-${n} character`);l=l<<r|y,a+=r,a>=8&&(a-=8,s[u++]=255&l>>a)}if(a>=r||255&l<<8-a)throw new SyntaxError("Unexpected end of data");return s},R7=(t,e,r)=>{const n=e[e.length-1]==="=",i=(1<<r)-1;let o="",s=0,a=0;for(let l=0;l<t.length;++l)for(a=a<<8|t[l],s+=8;s>r;)s-=r,o+=e[i&a>>s];if(s&&(o+=e[i&a<<r-s]),n)for(;o.length*r&7;)o+="=";return o},Rt=({name:t,prefix:e,bitsPerChar:r,alphabet:n})=>gs({prefix:e,name:t,encode(i){return R7(i,n,r)},decode(i){return N7(i,n,r,t)}}),L7=gs({prefix:"\0",name:"identity",encode:t=>D7(t),decode:t=>O7(t)});var M7=Object.freeze({__proto__:null,identity:L7});const U7=Rt({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var B7=Object.freeze({__proto__:null,base2:U7});const j7=Rt({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var k7=Object.freeze({__proto__:null,base8:j7});const H7=Wi({prefix:"9",name:"base10",alphabet:"0123456789"});var z7=Object.freeze({__proto__:null,base10:H7});const W7=Rt({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),V7=Rt({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var q7=Object.freeze({__proto__:null,base16:W7,base16upper:V7});const K7=Rt({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),G7=Rt({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),Y7=Rt({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),Z7=Rt({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),J7=Rt({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),X7=Rt({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),Q7=Rt({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),eE=Rt({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),tE=Rt({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var rE=Object.freeze({__proto__:null,base32:K7,base32upper:G7,base32pad:Y7,base32padupper:Z7,base32hex:J7,base32hexupper:X7,base32hexpad:Q7,base32hexpadupper:eE,base32z:tE});const nE=Wi({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),iE=Wi({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var oE=Object.freeze({__proto__:null,base36:nE,base36upper:iE});const sE=Wi({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),aE=Wi({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var cE=Object.freeze({__proto__:null,base58btc:sE,base58flickr:aE});const lE=Rt({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),uE=Rt({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),hE=Rt({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),fE=Rt({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var dE=Object.freeze({__proto__:null,base64:lE,base64pad:uE,base64url:hE,base64urlpad:fE});const zf=Array.from("\u{1F680}\u{1FA90}\u2604\u{1F6F0}\u{1F30C}\u{1F311}\u{1F312}\u{1F313}\u{1F314}\u{1F315}\u{1F316}\u{1F317}\u{1F318}\u{1F30D}\u{1F30F}\u{1F30E}\u{1F409}\u2600\u{1F4BB}\u{1F5A5}\u{1F4BE}\u{1F4BF}\u{1F602}\u2764\u{1F60D}\u{1F923}\u{1F60A}\u{1F64F}\u{1F495}\u{1F62D}\u{1F618}\u{1F44D}\u{1F605}\u{1F44F}\u{1F601}\u{1F525}\u{1F970}\u{1F494}\u{1F496}\u{1F499}\u{1F622}\u{1F914}\u{1F606}\u{1F644}\u{1F4AA}\u{1F609}\u263A\u{1F44C}\u{1F917}\u{1F49C}\u{1F614}\u{1F60E}\u{1F607}\u{1F339}\u{1F926}\u{1F389}\u{1F49E}\u270C\u2728\u{1F937}\u{1F631}\u{1F60C}\u{1F338}\u{1F64C}\u{1F60B}\u{1F497}\u{1F49A}\u{1F60F}\u{1F49B}\u{1F642}\u{1F493}\u{1F929}\u{1F604}\u{1F600}\u{1F5A4}\u{1F603}\u{1F4AF}\u{1F648}\u{1F447}\u{1F3B6}\u{1F612}\u{1F92D}\u2763\u{1F61C}\u{1F48B}\u{1F440}\u{1F62A}\u{1F611}\u{1F4A5}\u{1F64B}\u{1F61E}\u{1F629}\u{1F621}\u{1F92A}\u{1F44A}\u{1F973}\u{1F625}\u{1F924}\u{1F449}\u{1F483}\u{1F633}\u270B\u{1F61A}\u{1F61D}\u{1F634}\u{1F31F}\u{1F62C}\u{1F643}\u{1F340}\u{1F337}\u{1F63B}\u{1F613}\u2B50\u2705\u{1F97A}\u{1F308}\u{1F608}\u{1F918}\u{1F4A6}\u2714\u{1F623}\u{1F3C3}\u{1F490}\u2639\u{1F38A}\u{1F498}\u{1F620}\u261D\u{1F615}\u{1F33A}\u{1F382}\u{1F33B}\u{1F610}\u{1F595}\u{1F49D}\u{1F64A}\u{1F639}\u{1F5E3}\u{1F4AB}\u{1F480}\u{1F451}\u{1F3B5}\u{1F91E}\u{1F61B}\u{1F534}\u{1F624}\u{1F33C}\u{1F62B}\u26BD\u{1F919}\u2615\u{1F3C6}\u{1F92B}\u{1F448}\u{1F62E}\u{1F646}\u{1F37B}\u{1F343}\u{1F436}\u{1F481}\u{1F632}\u{1F33F}\u{1F9E1}\u{1F381}\u26A1\u{1F31E}\u{1F388}\u274C\u270A\u{1F44B}\u{1F630}\u{1F928}\u{1F636}\u{1F91D}\u{1F6B6}\u{1F4B0}\u{1F353}\u{1F4A2}\u{1F91F}\u{1F641}\u{1F6A8}\u{1F4A8}\u{1F92C}\u2708\u{1F380}\u{1F37A}\u{1F913}\u{1F619}\u{1F49F}\u{1F331}\u{1F616}\u{1F476}\u{1F974}\u25B6\u27A1\u2753\u{1F48E}\u{1F4B8}\u2B07\u{1F628}\u{1F31A}\u{1F98B}\u{1F637}\u{1F57A}\u26A0\u{1F645}\u{1F61F}\u{1F635}\u{1F44E}\u{1F932}\u{1F920}\u{1F927}\u{1F4CC}\u{1F535}\u{1F485}\u{1F9D0}\u{1F43E}\u{1F352}\u{1F617}\u{1F911}\u{1F30A}\u{1F92F}\u{1F437}\u260E\u{1F4A7}\u{1F62F}\u{1F486}\u{1F446}\u{1F3A4}\u{1F647}\u{1F351}\u2744\u{1F334}\u{1F4A3}\u{1F438}\u{1F48C}\u{1F4CD}\u{1F940}\u{1F922}\u{1F445}\u{1F4A1}\u{1F4A9}\u{1F450}\u{1F4F8}\u{1F47B}\u{1F910}\u{1F92E}\u{1F3BC}\u{1F975}\u{1F6A9}\u{1F34E}\u{1F34A}\u{1F47C}\u{1F48D}\u{1F4E3}\u{1F942}"),pE=zf.reduce((t,e,r)=>(t[r]=e,t),[]),gE=zf.reduce((t,e,r)=>(t[e.codePointAt(0)]=r,t),[]);function mE(t){return t.reduce((e,r)=>(e+=pE[r],e),"")}function bE(t){const e=[];for(const r of t){const n=gE[r.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${r}`);e.push(n)}return new Uint8Array(e)}const yE=gs({prefix:"\u{1F680}",name:"base256emoji",encode:mE,decode:bE});var wE=Object.freeze({__proto__:null,base256emoji:yE}),vE=Vf,Wf=128,_E=127,EE=~_E,xE=Math.pow(2,31);function Vf(t,e,r){e=e||[],r=r||0;for(var n=r;t>=xE;)e[r++]=t&255|Wf,t/=128;for(;t&EE;)e[r++]=t&255|Wf,t>>>=7;return e[r]=t|0,Vf.bytes=r-n+1,e}var CE=Dc,SE=128,qf=127;function Dc(t,n){var r=0,n=n||0,i=0,o=n,s,a=t.length;do{if(o>=a)throw Dc.bytes=0,new RangeError("Could not decode varint");s=t[o++],r+=i<28?(s&qf)<<i:(s&qf)*Math.pow(2,i),i+=7}while(s>=SE);return Dc.bytes=o-n,r}var AE=Math.pow(2,7),IE=Math.pow(2,14),OE=Math.pow(2,21),DE=Math.pow(2,28),$E=Math.pow(2,35),FE=Math.pow(2,42),PE=Math.pow(2,49),TE=Math.pow(2,56),NE=Math.pow(2,63),RE=function(t){return t<AE?1:t<IE?2:t<OE?3:t<DE?4:t<$E?5:t<FE?6:t<PE?7:t<TE?8:t<NE?9:10},LE={encode:vE,decode:CE,encodingLength:RE},Kf=LE;const Gf=(t,e,r=0)=>(Kf.encode(t,e,r),e),Yf=t=>Kf.encodingLength(t),$c=(t,e)=>{const r=e.byteLength,n=Yf(t),i=n+Yf(r),o=new Uint8Array(i+r);return Gf(t,o,0),Gf(r,o,n),o.set(e,i),new ME(t,r,e,o)};class ME{constructor(e,r,n,i){this.code=e,this.size=r,this.digest=n,this.bytes=i}}const Zf=({name:t,code:e,encode:r})=>new UE(t,e,r);class UE{constructor(e,r,n){this.name=e,this.code=r,this.encode=n}digest(e){if(e instanceof Uint8Array){const r=this.encode(e);return r instanceof Uint8Array?$c(this.code,r):r.then(n=>$c(this.code,n))}else throw Error("Unknown type, must be binary type")}}const Jf=t=>async e=>new Uint8Array(await crypto.subtle.digest(t,e)),BE=Zf({name:"sha2-256",code:18,encode:Jf("SHA-256")}),jE=Zf({name:"sha2-512",code:19,encode:Jf("SHA-512")});var kE=Object.freeze({__proto__:null,sha256:BE,sha512:jE});const Xf=0,HE="identity",Qf=kf;var zE=Object.freeze({__proto__:null,identity:{code:Xf,name:HE,encode:Qf,digest:t=>$c(Xf,Qf(t))}});new TextEncoder,new TextDecoder;const ed=Wt(Wt(Wt(Wt(Wt(Wt(Wt(Wt(Wt(Wt({},M7),B7),k7),z7),q7),rE),oE),cE),dE),wE);Wt(Wt({},kE),zE);function WE(t=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?globalThis.Buffer.allocUnsafe(t):new Uint8Array(t)}function td(t,e,r,n){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:r},decoder:{decode:n}}}const rd=td("utf8","u",t=>"u"+new TextDecoder("utf8").decode(t),t=>new TextEncoder().encode(t.substring(1))),Fc=td("ascii","a",t=>{let e="a";for(let r=0;r<t.length;r++)e+=String.fromCharCode(t[r]);return e},t=>{t=t.substring(1);const e=WE(t.length);for(let r=0;r<t.length;r++)e[r]=t.charCodeAt(r);return e});Wt({utf8:rd,"utf-8":rd,hex:ed.base16,latin1:Fc,ascii:Fc,binary:Fc},ed);const ms={message:"relayer_message",connect:"relayer_connect",disconnect:"relayer_disconnect",error:"relayer_error",connection_stalled:"relayer_connection_stalled",transport_closed:"relayer_transport_closed",publish:"relayer_publish"};class VE{constructor(e){this.name="eip155",this.namespace=e.namespace,this.client=e.client,this.events=e.events,this.httpProviders=this.createHttpProviders(),this.chainId=this.getDefaultChainId()}async request(e){var r;switch(e.request.method){case"eth_requestAccounts":return this.getAccounts();case"eth_accounts":return this.getAccounts();case"wallet_switchEthereumChain":{const n=e.request.params?(r=e.request.params[0])==null?void 0:r.chainId:"0x0";return this.setDefaultChain(parseInt(n,16).toString()),null}case"eth_chainId":return this.getDefaultChainId()}return this.namespace.methods.includes(e.request.method)?(this.client.core.relayer.once(ms.publish,is),await this.client.request(e)):this.getHttpProvider().request(e.request)}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}setDefaultChain(e,r){if(this.chainId=parseInt(e),!this.httpProviders[e]){const n=r||kr(`${this.name}:${e}`,this.namespace);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,n)}this.events.emit("chainChanged",this.chainId)}requestAccounts(){return this.getAccounts()}createHttpProvider(e,r){const n=r||kr(e,this.namespace);return typeof n>"u"?void 0:new Oi(new ns(n))}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{e[r]=this.createHttpProvider(r)}),e}getAccounts(){const e=this.namespace.accounts;return e?e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2])||[]:[]}getDefaultChainId(){if(this.chainId)return this.chainId;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return parseInt(e.split(":")[1])}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}}class qE{constructor(e){this.name="solana",this.namespace=e.namespace,this.events=e.events,this.client=e.client,this.chainId=this.getDefaultChainId(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getAccounts(){const e=this.namespace.accounts;return e?e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2])||[]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{e[r]=this.createHttpProvider(r)}),e}getDefaultChainId(){if(this.chainId)return this.chainId;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?(this.client.core.relayer.once(ms.publish,is),this.client.request(e)):this.getHttpProvider().request(e.request)}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setDefaultChain(e,r){if(this.chainId=e,!this.httpProviders[e]){const n=r||kr(`${this.name}:${e}`,this.namespace);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,n)}this.events.emit("chainChanged",this.chainId)}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||kr(e,this.namespace);return typeof n>"u"?void 0:new Oi(new ns(n))}}class KE{constructor(e){this.name="cosmos",this.namespace=e.namespace,this.events=e.events,this.client=e.client,this.chainId=this.getDefaultChainId(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getAccounts(){const e=this.namespace.accounts;return e?e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2])||[]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{e[r]=this.createHttpProvider(r)}),e}getDefaultChainId(){if(this.chainId)return this.chainId;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?(this.client.core.relayer.once(ms.publish,is),this.client.request(e)):this.getHttpProvider().request(e.request)}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setDefaultChain(e,r){if(this.chainId=e,!this.httpProviders[e]){const n=r||kr(`${this.name}:${e}`,this.namespace);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,n)}this.events.emit("chainChanged",this.chainId)}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||kr(e,this.namespace);return typeof n>"u"?void 0:new Oi(new ns(n))}}class GE{constructor(e){this.name="cip34",this.namespace=e.namespace,this.events=e.events,this.client=e.client,this.chainId=this.getDefaultChainId(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getAccounts(){const e=this.namespace.accounts;return e?e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2])||[]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{e[r]=this.createHttpProvider(r)}),e}getDefaultChainId(){if(this.chainId)return this.chainId;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?(this.client.core.relayer.once(ms.publish,is),this.client.request(e)):this.getHttpProvider().request(e.request)}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setDefaultChain(e,r){if(this.chainId=e,!this.httpProviders[e]){const n=r||kr(`${this.name}:${e}`,this.namespace);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,n)}this.events.emit("chainChanged",this.chainId)}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||kr(e,this.namespace);return typeof n>"u"?void 0:new Oi(new ns(n))}}const nd="error",YE="wss://relay.walletconnect.com",ZE="wc",JE="universal_provider",id=`${ZE}@${2}:${JE}:`;var XE=Object.defineProperty,QE=Object.defineProperties,e9=Object.getOwnPropertyDescriptors,od=Object.getOwnPropertySymbols,t9=Object.prototype.hasOwnProperty,r9=Object.prototype.propertyIsEnumerable,sd=(t,e,r)=>e in t?XE(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,ad=(t,e)=>{for(var r in e||(e={}))t9.call(e,r)&&sd(t,r,e[r]);if(od)for(var r of od(e))r9.call(e,r)&&sd(t,r,e[r]);return t},n9=(t,e)=>QE(t,e9(e));class Pc{constructor(e){this.events=new Dt.exports,this.rpcProviders={},this.providerOpts=e,this.logger=typeof e?.logger<"u"&&typeof e?.logger!="string"?e.logger:fi(ht.getDefaultLoggerOptions({level:e?.logger||nd}))}static async init(e){const r=new Pc(e);return await r.initialize(),r}async request(e,r){const[n,i]=this.validateChain(r);if(!this.session)throw new Error("Please call connect() before request()");return await this.getProvider(n).request({request:ad({},e),chainId:`${n}:${i}`,topic:this.session.topic})}sendAsync(e,r,n){this.request(e,n).then(i=>r(null,i)).catch(i=>r(i,void 0))}async enable(){if(!this.client)throw new Error("Sign Client not initialized");return this.session||await this.connect({namespaces:this.namespaces}),await this.requestAccounts()}async disconnect(){var e;if(!this.session)throw new Error("Please call connect() before enable()");await this.client.disconnect({topic:(e=this.session)==null?void 0:e.topic,reason:xt("USER_DISCONNECTED")}),await this.cleanup()}async connect(e){if(!this.client)throw new Error("Sign Client not initialized");const{namespaces:r}=e;return this.setNamespaces(r),this.createProviders(),await this.cleanupPendingPairings(),e.skipPairing===!0?void 0:await this.pair(e.pairingTopic)}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}removeListener(e,r){this.events.removeListener(e,r)}off(e,r){this.events.off(e,r)}get isWalletConnect(){return!0}async pair(e){const{uri:r,approval:n}=await this.client.connect({pairingTopic:e,requiredNamespaces:this.namespaces});return r&&(this.uri=r,this.events.emit("display_uri",r)),this.session=await n(),this.onSessionUpdate(),this.onConnect(),this.session}setDefaultChain(e,r){try{const[n,i]=this.validateChain(e);this.getProvider(n).setDefaultChain(i,r)}catch(n){if(!/Please call connect/.test(n.message))throw n}}async cleanupPendingPairings(e={}){this.logger.info("Cleaning up inactive pairings...");const r=this.client.pairing.getAll();if($n(r)){for(const n of r)e.deletePairings?this.client.core.expirer.set(n.topic,0):await this.client.core.relayer.subscriber.unsubscribe(n.topic);this.logger.info(`Inactive pairings cleared: ${r.length}`)}}async checkStorage(){if(this.namespaces=await this.client.core.storage.getItem(`${id}/namespaces`)||{},this.namespaces&&this.createProviders(),this.client.session.length){const e=this.client.session.keys.length-1;this.session=this.client.session.get(this.client.session.keys[e]),this.onSessionUpdate()}}async initialize(){this.logger.trace("Initialized"),await this.createClient(),this.checkStorage(),this.registerEventListeners()}async createClient(){this.client=this.providerOpts.client||await hc.init({logger:this.providerOpts.logger||nd,relayUrl:this.providerOpts.relayUrl||YE,projectId:this.providerOpts.projectId,metadata:this.providerOpts.metadata,storageOptions:this.providerOpts.storageOptions,name:this.providerOpts.name}),this.logger.trace("SignClient Initialized")}createProviders(){if(!this.client)throw new Error("Sign Client not initialized");Object.keys(this.namespaces).forEach(e=>{switch(e){case"eip155":this.rpcProviders[e]=new VE({client:this.client,namespace:this.namespaces[e],events:this.events});break;case"solana":this.rpcProviders[e]=new qE({client:this.client,namespace:this.namespaces[e],events:this.events});break;case"cosmos":this.rpcProviders[e]=new KE({client:this.client,namespace:this.namespaces[e],events:this.events});break;case"polkadot":break;case"cip34":this.rpcProviders[e]=new GE({client:this.client,namespace:this.namespaces[e],events:this.events});break}})}registerEventListeners(){if(typeof this.client>"u")throw new Error("Sign Client is not initialized");this.client.on("session_ping",e=>{this.events.emit("session_ping",e)}),this.client.on("session_event",e=>{const{params:r}=e,{event:n}=r;n.name==="accountsChanged"?this.events.emit("accountsChanged",n.data):n.name==="chainChanged"?this.onChainChanged(n.data,r.chainId):this.events.emit(n.name,n.data),this.events.emit("session_event",e)}),this.client.on("session_update",({topic:e,params:r})=>{var n;const{namespaces:i}=r,o=(n=this.client)==null?void 0:n.session.get(e);this.session=n9(ad({},o),{namespaces:i}),this.onSessionUpdate(),this.events.emit("session_update",{topic:e,params:r})}),this.client.on("session_delete",async e=>{await this.cleanup(),this.events.emit("session_delete",e)})}getProvider(e){if(!this.rpcProviders[e])throw new Error(`Provider not found: ${e}`);return this.rpcProviders[e]}onSessionUpdate(){Object.keys(this.rpcProviders).forEach(e=>{var r;this.getProvider(e).updateNamespace((r=this.session)==null?void 0:r.namespaces[e])})}setNamespaces(e){if(!e||!Object.keys(e).length)throw new Error("Namespaces must be not empty");this.client.core.storage.setItem(`${id}/namespaces`,e),this.namespaces=e}validateChain(e){const[r,n]=e?.split(":")||["",""];if(r&&!Object.keys(this.namespaces).includes(r))throw new Error(`Namespace '${r}' is not configured. Please call connect() first with namespace config.`);return!r||!n?Gv(this.namespaces):[r,n]}async requestAccounts(){const[e]=this.validateChain();return await this.getProvider(e).requestAccounts()}onChainChanged(e,r){const[n,i]=this.validateChain(r);this.getProvider(n).setDefaultChain(i),this.events.emit("chainChanged",e)}onConnect(){this.events.emit("connect",{session:this.session})}async cleanup(){this.session=void 0,await this.cleanupPendingPairings({deletePairings:!0})}}const i9=Pc,o9=Symbol(),cd=Object.getPrototypeOf,Tc=new WeakMap,s9=t=>t&&(Tc.has(t)?Tc.get(t):cd(t)===Object.prototype||cd(t)===Array.prototype),a9=t=>s9(t)&&t[o9]||null,ld=(t,e=!0)=>{Tc.set(t,e)},Nc=t=>typeof t=="object"&&t!==null,cn=new WeakMap,bs=new WeakSet,c9=(t=Object.is,e=(u,d)=>new Proxy(u,d),r=u=>Nc(u)&&!bs.has(u)&&(Array.isArray(u)||!(Symbol.iterator in u))&&!(u instanceof WeakMap)&&!(u instanceof WeakSet)&&!(u instanceof Error)&&!(u instanceof Number)&&!(u instanceof Date)&&!(u instanceof String)&&!(u instanceof RegExp)&&!(u instanceof ArrayBuffer),n=u=>{switch(u.status){case"fulfilled":return u.value;case"rejected":throw u.reason;default:throw u}},i=new WeakMap,o=(u,d,y=n)=>{const m=i.get(u);if(m?.[0]===d)return m[1];const v=Array.isArray(u)?[]:Object.create(Object.getPrototypeOf(u));return ld(v,!0),i.set(u,[d,v]),Reflect.ownKeys(u).forEach(_=>{const R=Reflect.get(u,_);bs.has(R)?(ld(R,!1),v[_]=R):R instanceof Promise?Object.defineProperty(v,_,{get(){return y(R)}}):cn.has(R)?v[_]=u9(R,y):v[_]=R}),Object.freeze(v)},s=new WeakMap,a=[1,1],l=u=>{if(!Nc(u))throw new Error("object required");const d=s.get(u);if(d)return d;let y=a[0];const m=new Set,v=(q,z=++a[0])=>{y!==z&&(y=z,m.forEach(Y=>Y(q,z)))};let _=a[1];const R=(q=++a[1])=>(_!==q&&!m.size&&(_=q,B.forEach(([z])=>{const Y=z[1](q);Y>y&&(y=Y)})),y),M=q=>(z,Y)=>{const re=[...z];re[1]=[q,...re[1]],v(re,Y)},B=new Map,D=(q,z)=>{if(void 0!=="production"&&B.has(q))throw new Error("prop listener already exists");if(m.size){const Y=z[3](M(q));B.set(q,[z,Y])}else B.set(q,[z])},N=q=>{var z;const Y=B.get(q);Y&&(B.delete(q),(z=Y[1])==null||z.call(Y))},C=q=>(m.add(q),m.size===1&&B.forEach(([Y,re],ie)=>{if(void 0!=="production"&&re)throw new Error("remove already exists");const E=Y[3](M(ie));B.set(ie,[Y,E])}),()=>{m.delete(q),m.size===0&&B.forEach(([Y,re],ie)=>{re&&(re(),B.set(ie,[Y]))})}),$=Array.isArray(u)?[]:Object.create(Object.getPrototypeOf(u)),h=e($,{deleteProperty(q,z){const Y=Reflect.get(q,z);N(z);const re=Reflect.deleteProperty(q,z);return re&&v(["delete",[z],Y]),re},set(q,z,Y,re){var ie;const E=Reflect.has(q,z),O=Reflect.get(q,z,re);if(E&&t(O,Y))return!0;N(z),Nc(Y)&&(Y=a9(Y)||Y);let Z=Y;if(!((ie=Object.getOwnPropertyDescriptor(q,z))!=null&&ie.set))if(Y instanceof Promise)Y.then(J=>{Y.status="fulfilled",Y.value=J,v(["resolve",[z],J])}).catch(J=>{Y.status="rejected",Y.reason=J,v(["reject",[z],J])});else{!cn.has(Y)&&r(Y)&&(Z=Hr(Y));const J=!bs.has(Z)&&cn.get(Z);J&&D(z,J)}return Reflect.set(q,z,Z,re),v(["set",[z],Y,O]),!0}});s.set(u,h);const S=[$,R,o,C];return cn.set(h,S),Reflect.ownKeys(u).forEach(q=>{const z=Object.getOwnPropertyDescriptor(u,q);z.get||z.set?Object.defineProperty($,q,z):h[q]=u[q]}),h})=>[l,cn,bs,t,e,r,n,i,o,s,a],[l9]=c9();function Hr(t={}){return l9(t)}function Vi(t,e,r){const n=cn.get(t);void 0!=="production"&&!n&&console.warn("Please use proxy object");let i;const o=[],s=n[3];let a=!1;const u=s(d=>{if(o.push(d),r){e(o.splice(0));return}i||(i=Promise.resolve().then(()=>{i=void 0,a&&e(o.splice(0))}))});return a=!0,()=>{a=!1,u()}}function u9(t,e){const r=cn.get(t);void 0!=="production"&&!r&&console.warn("Please use proxy object");const[n,i,o]=r;return o(n,i(),e)}var ud={},ys={};ys.byteLength=d9,ys.toByteArray=g9,ys.fromByteArray=y9;for(var _r=[],ur=[],h9=typeof Uint8Array<"u"?Uint8Array:Array,Rc="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Un=0,f9=Rc.length;Un<f9;++Un)_r[Un]=Rc[Un],ur[Rc.charCodeAt(Un)]=Un;ur["-".charCodeAt(0)]=62,ur["_".charCodeAt(0)]=63;function hd(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");r===-1&&(r=e);var n=r===e?0:4-r%4;return[r,n]}function d9(t){var e=hd(t),r=e[0],n=e[1];return(r+n)*3/4-n}function p9(t,e,r){return(e+r)*3/4-r}function g9(t){var e,r=hd(t),n=r[0],i=r[1],o=new h9(p9(t,n,i)),s=0,a=i>0?n-4:n,l;for(l=0;l<a;l+=4)e=ur[t.charCodeAt(l)]<<18|ur[t.charCodeAt(l+1)]<<12|ur[t.charCodeAt(l+2)]<<6|ur[t.charCodeAt(l+3)],o[s++]=e>>16&255,o[s++]=e>>8&255,o[s++]=e&255;return i===2&&(e=ur[t.charCodeAt(l)]<<2|ur[t.charCodeAt(l+1)]>>4,o[s++]=e&255),i===1&&(e=ur[t.charCodeAt(l)]<<10|ur[t.charCodeAt(l+1)]<<4|ur[t.charCodeAt(l+2)]>>2,o[s++]=e>>8&255,o[s++]=e&255),o}function m9(t){return _r[t>>18&63]+_r[t>>12&63]+_r[t>>6&63]+_r[t&63]}function b9(t,e,r){for(var n,i=[],o=e;o<r;o+=3)n=(t[o]<<16&16711680)+(t[o+1]<<8&65280)+(t[o+2]&255),i.push(m9(n));return i.join("")}function y9(t){for(var e,r=t.length,n=r%3,i=[],o=16383,s=0,a=r-n;s<a;s+=o)i.push(b9(t,s,s+o>a?a:s+o));return n===1?(e=t[r-1],i.push(_r[e>>2]+_r[e<<4&63]+"==")):n===2&&(e=(t[r-2]<<8)+t[r-1],i.push(_r[e>>10]+_r[e>>4&63]+_r[e<<2&63]+"=")),i.join("")}var Lc={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */Lc.read=function(t,e,r,n,i){var o,s,a=i*8-n-1,l=(1<<a)-1,u=l>>1,d=-7,y=r?i-1:0,m=r?-1:1,v=t[e+y];for(y+=m,o=v&(1<<-d)-1,v>>=-d,d+=a;d>0;o=o*256+t[e+y],y+=m,d-=8);for(s=o&(1<<-d)-1,o>>=-d,d+=n;d>0;s=s*256+t[e+y],y+=m,d-=8);if(o===0)o=1-u;else{if(o===l)return s?NaN:(v?-1:1)*(1/0);s=s+Math.pow(2,n),o=o-u}return(v?-1:1)*s*Math.pow(2,o-n)},Lc.write=function(t,e,r,n,i,o){var s,a,l,u=o*8-i-1,d=(1<<u)-1,y=d>>1,m=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,v=n?0:o-1,_=n?1:-1,R=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=d):(s=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-s))<1&&(s--,l*=2),s+y>=1?e+=m/l:e+=m*Math.pow(2,1-y),e*l>=2&&(s++,l/=2),s+y>=d?(a=0,s=d):s+y>=1?(a=(e*l-1)*Math.pow(2,i),s=s+y):(a=e*Math.pow(2,y-1)*Math.pow(2,i),s=0));i>=8;t[r+v]=a&255,v+=_,a/=256,i-=8);for(s=s<<i|a,u+=i;u>0;t[r+v]=s&255,v+=_,s/=256,u-=8);t[r+v-_]|=R*128};/*!
66
+ ***************************************************************************** */var ea=function(t,e){return ea=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)n.hasOwnProperty(i)&&(r[i]=n[i])},ea(t,e)};function vm(t,e){ea(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var ta=function(){return ta=Object.assign||function(e){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(e[s]=r[s])}return e},ta.apply(this,arguments)};function _m(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r}function Em(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s}function xm(t,e){return function(r,n){e(r,n,t)}}function Cm(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function Sm(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(p){try{l(n.next(p))}catch(w){o(w)}}function c(p){try{l(n.throw(p))}catch(w){o(w)}}function l(p){p.done?s(p.value):i(p.value).then(a,c)}l((n=n.apply(t,e||[])).next())})}function Im(t,e){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,i,s,o;return o={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(l){return function(p){return c([l,p])}}function c(l){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(s=l[0]&2?i.return:l[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,l[1])).done)return s;switch(i=0,s&&(l=[l[0]&2,s.value]),l[0]){case 0:case 1:s=l;break;case 4:return r.label++,{value:l[1],done:!1};case 5:r.label++,i=l[1],l=[0];continue;case 7:l=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(l[0]===6||l[0]===2)){r=0;continue}if(l[0]===3&&(!s||l[1]>s[0]&&l[1]<s[3])){r.label=l[1];break}if(l[0]===6&&r.label<s[1]){r.label=s[1],s=l;break}if(s&&r.label<s[2]){r.label=s[2],r.ops.push(l);break}s[2]&&r.ops.pop(),r.trys.pop();continue}l=e.call(t,r)}catch(p){l=[6,p],i=0}finally{n=s=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}function Dm(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}function Om(t,e){for(var r in t)r!=="default"&&!e.hasOwnProperty(r)&&(e[r]=t[r])}function ra(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function zu(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,s=[],o;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(a){o={error:a}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}return s}function Am(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(zu(arguments[e]));return t}function $m(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;for(var n=Array(t),i=0,e=0;e<r;e++)for(var s=arguments[e],o=0,a=s.length;o<a;o++,i++)n[i]=s[o];return n}function ii(t){return this instanceof ii?(this.v=t,this):new ii(t)}function Pm(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(t,e||[]),i,s=[];return i={},o("next"),o("throw"),o("return"),i[Symbol.asyncIterator]=function(){return this},i;function o(y){n[y]&&(i[y]=function(m){return new Promise(function(E,A){s.push([y,m,E,A])>1||a(y,m)})})}function a(y,m){try{c(n[y](m))}catch(E){w(s[0][3],E)}}function c(y){y.value instanceof ii?Promise.resolve(y.value.v).then(l,p):w(s[0][2],y)}function l(y){a("next",y)}function p(y){a("throw",y)}function w(y,m){y(m),s.shift(),s.length&&a(s[0][0],s[0][1])}}function Tm(t){var e,r;return e={},n("next"),n("throw",function(i){throw i}),n("return"),e[Symbol.iterator]=function(){return this},e;function n(i,s){e[i]=t[i]?function(o){return(r=!r)?{value:ii(t[i](o)),done:i==="return"}:s?s(o):o}:s}}function Nm(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof ra=="function"?ra(t):t[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(s){r[s]=t[s]&&function(o){return new Promise(function(a,c){o=t[s](o),i(a,c,o.done,o.value)})}}function i(s,o,a,c){Promise.resolve(c).then(function(l){s({value:l,done:a})},o)}}function Rm(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function Lm(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}function Mm(t){return t&&t.__esModule?t:{default:t}}function Um(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}function Fm(t,e,r){if(!e.has(t))throw new TypeError("attempted to set private field on non-instance");return e.set(t,r),r}var Bm=Object.freeze({__proto__:null,__extends:vm,get __assign(){return ta},__rest:_m,__decorate:Em,__param:xm,__metadata:Cm,__awaiter:Sm,__generator:Im,__createBinding:Dm,__exportStar:Om,__values:ra,__read:zu,__spread:Am,__spreadArrays:$m,__await:ii,__asyncGenerator:Pm,__asyncDelegator:Tm,__asyncValues:Nm,__makeTemplateObject:Rm,__importStar:Lm,__importDefault:Mm,__classPrivateFieldGet:Um,__classPrivateFieldSet:Fm}),jm=$r(Bm),cr={},Wu;function km(){if(Wu)return cr;Wu=1,Object.defineProperty(cr,"__esModule",{value:!0}),cr.isBrowserCryptoAvailable=cr.getSubtleCrypto=cr.getBrowerCrypto=void 0;function t(){return ut?.crypto||ut?.msCrypto||{}}cr.getBrowerCrypto=t;function e(){const n=t();return n.subtle||n.webkitSubtle}cr.getSubtleCrypto=e;function r(){return!!t()&&!!e()}return cr.isBrowserCryptoAvailable=r,cr}var lr={},qu;function Hm(){if(qu)return lr;qu=1,Object.defineProperty(lr,"__esModule",{value:!0}),lr.isBrowser=lr.isNode=lr.isReactNative=void 0;function t(){return typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"}lr.isReactNative=t;function e(){return typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.node<"u"}lr.isNode=e;function r(){return!t()&&!e()}return lr.isBrowser=r,lr}(function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=jm;e.__exportStar(km(),t),e.__exportStar(Hm(),t)})(Hu);function zm(){const t=Date.now()*Math.pow(10,3),e=Math.floor(Math.random()*Math.pow(10,3));return t+e}function os(t,e,r){return{id:r||zm(),jsonrpc:"2.0",method:t,params:e}}function na(t,e){return{id:t,jsonrpc:"2.0",result:e}}function as(t,e,r){return{id:t,jsonrpc:"2.0",error:Wm(e,r)}}function Wm(t,e){return typeof t>"u"?ju(Fu):(typeof t=="string"&&(t=Object.assign(Object.assign({},ju(Qo)),{message:t})),typeof e<"u"&&(t.data=e),ym(t.code)&&(t=bm(t.code)),t)}class qm{}class Vm extends qm{constructor(){super()}}class Km extends Vm{constructor(e){super()}}const Gm="^https?:",Ym="^wss?:";function Zm(t){const e=t.match(new RegExp(/^\w+:/,"gi"));if(!(!e||!e.length))return e[0]}function Vu(t,e){const r=Zm(t);return typeof r>"u"?!1:new RegExp(e).test(r)}function Ku(t){return Vu(t,Gm)}function Gu(t){return Vu(t,Ym)}function Jm(t){return new RegExp("wss?://localhost(:d{2,5})?").test(t)}function Yu(t){return typeof t=="object"&&"id"in t&&"jsonrpc"in t&&t.jsonrpc==="2.0"}function ia(t){return Yu(t)&&"method"in t}function sa(t){return Yu(t)&&(ur(t)||Zt(t))}function ur(t){return"result"in t}function Zt(t){return"error"in t}class si extends Km{constructor(e){super(e),this.events=new _t.exports.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,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}off(e,r){this.events.off(e,r)}removeListener(e,r){this.events.removeListener(e,r)}async request(e,r){return this.requestStrict(os(e.method,e.params||[]),r)}async requestStrict(e,r){return new Promise(async(n,i)=>{if(!this.connection.connected)try{await this.open()}catch(s){i(s)}this.events.on(`${e.id}`,s=>{Zt(s)?i(s.error):n(s.result)});try{await this.connection.send(e,r)}catch(s){i(s)}})}setConnection(e=this.connection){return e}onPayload(e){this.events.emit("payload",e),sa(e)?this.events.emit(`${e.id}`,e):this.events.emit("message",{type:e.method,data:e.params})}async open(e=this.connection){this.connection===e&&this.connection.connected||(this.connection.connected&&this.close(),typeof e=="string"&&(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",()=>this.events.emit("disconnect")),this.connection.on("error",e=>this.events.emit("error",e)),this.hasRegisteredEventListeners=!0)}}const Zu=10,Xm=()=>typeof global<"u"&&typeof global.WebSocket<"u"?global.WebSocket:typeof window<"u"&&typeof window.WebSocket<"u"?window.WebSocket:require("ws"),Qm=()=>typeof window<"u",e5=Xm();class t5{constructor(e){if(this.url=e,this.events=new _t.exports.EventEmitter,this.registering=!1,!Gu(e))throw new Error(`Provided URL is not compatible with WebSocket connection: ${e}`);this.url=e}get connected(){return typeof this.socket<"u"}get connecting(){return this.registering}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}off(e,r){this.events.off(e,r)}removeListener(e,r){this.events.removeListener(e,r)}async open(e=this.url){await this.register(e)}async close(){return new Promise((e,r)=>{if(typeof this.socket>"u"){r(new Error("Connection already closed"));return}this.socket.onclose=()=>{this.onClose(),e()},this.socket.close()})}async send(e,r){typeof this.socket>"u"&&(this.socket=await this.register());try{this.socket.send(ri(e))}catch(n){this.onError(e.id,n)}}register(e=this.url){if(!Gu(e))throw new Error(`Provided URL is not compatible with WebSocket connection: ${e}`);if(this.registering){const r=this.events.getMaxListeners();return(this.events.listenerCount("register_error")>=r||this.events.listenerCount("open")>=r)&&this.events.setMaxListeners(r+1),new Promise((n,i)=>{this.events.once("register_error",s=>{this.resetMaxListeners(),i(s)}),this.events.once("open",()=>{if(this.resetMaxListeners(),typeof this.socket>"u")return i(new Error("WebSocket connection is missing or invalid"));n(this.socket)})})}return this.url=e,this.registering=!0,new Promise((r,n)=>{const i=Hu.isReactNative()?void 0:{rejectUnauthorized:!Jm(e)},s=new e5(e,[],i);Qm()?s.onerror=o=>{const a=o;n(this.emitError(a.error))}:s.on("error",o=>{n(this.emitError(o))}),s.onopen=()=>{this.onOpen(s),r(s)}})}onOpen(e){e.onmessage=r=>this.onPayload(r),e.onclose=()=>this.onClose(),this.socket=e,this.registering=!1,this.events.emit("open")}onClose(){this.socket=void 0,this.registering=!1,this.events.emit("close")}onPayload(e){if(typeof e.data>"u")return;const r=typeof e.data=="string"?Jo(e.data):e.data;this.events.emit("payload",r)}onError(e,r){const n=this.parseError(r),i=n.message||n.toString(),s=as(e,i);this.events.emit("payload",s)}parseError(e,r=this.url){return ku(e,r,"WS")}resetMaxListeners(){this.events.getMaxListeners()>Zu&&this.events.setMaxListeners(Zu)}emitError(e){const r=this.parseError(new Error(e?.message||`WebSocket connection failed for URL: ${this.url}`));return this.events.emit("register_error",r),r}}var oa={exports:{}};(function(t,e){var r=200,n="__lodash_hash_undefined__",i=1,s=2,o=9007199254740991,a="[object Arguments]",c="[object Array]",l="[object AsyncFunction]",p="[object Boolean]",w="[object Date]",y="[object Error]",m="[object Function]",E="[object GeneratorFunction]",A="[object Map]",N="[object Number]",M="[object Null]",x="[object Object]",D="[object Promise]",b="[object Proxy]",I="[object RegExp]",O="[object Set]",h="[object String]",_="[object Symbol]",H="[object Undefined]",j="[object WeakMap]",q="[object ArrayBuffer]",X="[object DataView]",re="[object Float32Array]",C="[object Float64Array]",$="[object Int8Array]",G="[object Int16Array]",K="[object Int32Array]",W="[object Uint8Array]",z="[object Uint8ClampedArray]",J="[object Uint16Array]",Y="[object Uint32Array]",le=/[\\^$.*+?()[\]{}|]/g,ee=/^\[object .+?Constructor\]$/,fe=/^(?:0|[1-9]\d*)$/,ae={};ae[re]=ae[C]=ae[$]=ae[G]=ae[K]=ae[W]=ae[z]=ae[J]=ae[Y]=!0,ae[a]=ae[c]=ae[q]=ae[p]=ae[X]=ae[w]=ae[y]=ae[m]=ae[A]=ae[N]=ae[x]=ae[I]=ae[O]=ae[h]=ae[j]=!1;var Ce=typeof ut=="object"&&ut&&ut.Object===Object&&ut,B=typeof self=="object"&&self&&self.Object===Object&&self,F=Ce||B||Function("return this")(),R=e&&!e.nodeType&&e,f=R&&!0&&t&&!t.nodeType&&t,P=f&&f.exports===R,te=P&&Ce.process,ie=function(){try{return te&&te.binding&&te.binding("util")}catch{}}(),Ee=ie&&ie.isTypedArray;function Le(S,L){for(var Z=-1,ce=S==null?0:S.length,We=0,Ie=[];++Z<ce;){var Qe=S[Z];L(Qe,Z,S)&&(Ie[We++]=Qe)}return Ie}function $e(S,L){for(var Z=-1,ce=L.length,We=S.length;++Z<ce;)S[We+Z]=L[Z];return S}function Me(S,L){for(var Z=-1,ce=S==null?0:S.length;++Z<ce;)if(L(S[Z],Z,S))return!0;return!1}function Ye(S,L){for(var Z=-1,ce=Array(S);++Z<S;)ce[Z]=L(Z);return ce}function Ke(S){return function(L){return S(L)}}function Pe(S,L){return S.has(L)}function De(S,L){return S?.[L]}function ge(S){var L=-1,Z=Array(S.size);return S.forEach(function(ce,We){Z[++L]=[We,ce]}),Z}function Se(S,L){return function(Z){return S(L(Z))}}function Oe(S){var L=-1,Z=Array(S.size);return S.forEach(function(ce){Z[++L]=ce}),Z}var pe=Array.prototype,xe=Function.prototype,g=Object.prototype,u=F["__core-js_shared__"],d=xe.toString,v=g.hasOwnProperty,T=function(){var S=/[^.]+$/.exec(u&&u.keys&&u.keys.IE_PROTO||"");return S?"Symbol(src)_1."+S:""}(),U=g.toString,k=RegExp("^"+d.call(v).replace(le,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),oe=P?F.Buffer:void 0,he=F.Symbol,Ne=F.Uint8Array,Fe=g.propertyIsEnumerable,Re=pe.splice,Ht=he?he.toStringTag:void 0,rn=Object.getOwnPropertySymbols,Bi=oe?oe.isBuffer:void 0,Ys=Se(Object.keys,Object),tt=Tn(F,"DataView"),Je=Tn(F,"Map"),rt=Tn(F,"Promise"),nt=Tn(F,"Set"),it=Tn(F,"WeakMap"),Xe=Tn(Object,"create"),ft=sn(tt),pt=sn(Je),gt=sn(rt),mt=sn(nt),wt=sn(it),lt=he?he.prototype:void 0,st=lt?lt.valueOf:void 0;function Ge(S){var L=-1,Z=S==null?0:S.length;for(this.clear();++L<Z;){var ce=S[L];this.set(ce[0],ce[1])}}function yt(){this.__data__=Xe?Xe(null):{},this.size=0}function bt(S){var L=this.has(S)&&delete this.__data__[S];return this.size-=L?1:0,L}function M_(S){var L=this.__data__;if(Xe){var Z=L[S];return Z===n?void 0:Z}return v.call(L,S)?L[S]:void 0}function U_(S){var L=this.__data__;return Xe?L[S]!==void 0:v.call(L,S)}function F_(S,L){var Z=this.__data__;return this.size+=this.has(S)?0:1,Z[S]=Xe&&L===void 0?n:L,this}Ge.prototype.clear=yt,Ge.prototype.delete=bt,Ge.prototype.get=M_,Ge.prototype.has=U_,Ge.prototype.set=F_;function dr(S){var L=-1,Z=S==null?0:S.length;for(this.clear();++L<Z;){var ce=S[L];this.set(ce[0],ce[1])}}function B_(){this.__data__=[],this.size=0}function j_(S){var L=this.__data__,Z=Js(L,S);if(Z<0)return!1;var ce=L.length-1;return Z==ce?L.pop():Re.call(L,Z,1),--this.size,!0}function k_(S){var L=this.__data__,Z=Js(L,S);return Z<0?void 0:L[Z][1]}function H_(S){return Js(this.__data__,S)>-1}function z_(S,L){var Z=this.__data__,ce=Js(Z,S);return ce<0?(++this.size,Z.push([S,L])):Z[ce][1]=L,this}dr.prototype.clear=B_,dr.prototype.delete=j_,dr.prototype.get=k_,dr.prototype.has=H_,dr.prototype.set=z_;function nn(S){var L=-1,Z=S==null?0:S.length;for(this.clear();++L<Z;){var ce=S[L];this.set(ce[0],ce[1])}}function W_(){this.size=0,this.__data__={hash:new Ge,map:new(Je||dr),string:new Ge}}function q_(S){var L=Xs(this,S).delete(S);return this.size-=L?1:0,L}function V_(S){return Xs(this,S).get(S)}function K_(S){return Xs(this,S).has(S)}function G_(S,L){var Z=Xs(this,S),ce=Z.size;return Z.set(S,L),this.size+=Z.size==ce?0:1,this}nn.prototype.clear=W_,nn.prototype.delete=q_,nn.prototype.get=V_,nn.prototype.has=K_,nn.prototype.set=G_;function Zs(S){var L=-1,Z=S==null?0:S.length;for(this.__data__=new nn;++L<Z;)this.add(S[L])}function Y_(S){return this.__data__.set(S,n),this}function Z_(S){return this.__data__.has(S)}Zs.prototype.add=Zs.prototype.push=Y_,Zs.prototype.has=Z_;function Ir(S){var L=this.__data__=new dr(S);this.size=L.size}function J_(){this.__data__=new dr,this.size=0}function X_(S){var L=this.__data__,Z=L.delete(S);return this.size=L.size,Z}function Q_(S){return this.__data__.get(S)}function e7(S){return this.__data__.has(S)}function t7(S,L){var Z=this.__data__;if(Z instanceof dr){var ce=Z.__data__;if(!Je||ce.length<r-1)return ce.push([S,L]),this.size=++Z.size,this;Z=this.__data__=new nn(ce)}return Z.set(S,L),this.size=Z.size,this}Ir.prototype.clear=J_,Ir.prototype.delete=X_,Ir.prototype.get=Q_,Ir.prototype.has=e7,Ir.prototype.set=t7;function r7(S,L){var Z=Qs(S),ce=!Z&&w7(S),We=!Z&&!ce&&Tc(S),Ie=!Z&&!ce&&!We&&$d(S),Qe=Z||ce||We||Ie,vt=Qe?Ye(S.length,String):[],Ct=vt.length;for(var Ze in S)(L||v.call(S,Ze))&&!(Qe&&(Ze=="length"||We&&(Ze=="offset"||Ze=="parent")||Ie&&(Ze=="buffer"||Ze=="byteLength"||Ze=="byteOffset")||d7(Ze,Ct)))&&vt.push(Ze);return vt}function Js(S,L){for(var Z=S.length;Z--;)if(Id(S[Z][0],L))return Z;return-1}function n7(S,L,Z){var ce=L(S);return Qs(S)?ce:$e(ce,Z(S))}function ji(S){return S==null?S===void 0?H:M:Ht&&Ht in Object(S)?u7(S):m7(S)}function Ed(S){return ki(S)&&ji(S)==a}function xd(S,L,Z,ce,We){return S===L?!0:S==null||L==null||!ki(S)&&!ki(L)?S!==S&&L!==L:i7(S,L,Z,ce,xd,We)}function i7(S,L,Z,ce,We,Ie){var Qe=Qs(S),vt=Qs(L),Ct=Qe?c:Dr(S),Ze=vt?c:Dr(L);Ct=Ct==a?x:Ct,Ze=Ze==a?x:Ze;var zt=Ct==x,Jt=Ze==x,Dt=Ct==Ze;if(Dt&&Tc(S)){if(!Tc(L))return!1;Qe=!0,zt=!1}if(Dt&&!zt)return Ie||(Ie=new Ir),Qe||$d(S)?Cd(S,L,Z,ce,We,Ie):c7(S,L,Ct,Z,ce,We,Ie);if(!(Z&i)){var Gt=zt&&v.call(S,"__wrapped__"),Yt=Jt&&v.call(L,"__wrapped__");if(Gt||Yt){var Or=Gt?S.value():S,fr=Yt?L.value():L;return Ie||(Ie=new Ir),We(Or,fr,Z,ce,Ie)}}return Dt?(Ie||(Ie=new Ir),l7(S,L,Z,ce,We,Ie)):!1}function s7(S){if(!Ad(S)||p7(S))return!1;var L=Dd(S)?k:ee;return L.test(sn(S))}function o7(S){return ki(S)&&Od(S.length)&&!!ae[ji(S)]}function a7(S){if(!g7(S))return Ys(S);var L=[];for(var Z in Object(S))v.call(S,Z)&&Z!="constructor"&&L.push(Z);return L}function Cd(S,L,Z,ce,We,Ie){var Qe=Z&i,vt=S.length,Ct=L.length;if(vt!=Ct&&!(Qe&&Ct>vt))return!1;var Ze=Ie.get(S);if(Ze&&Ie.get(L))return Ze==L;var zt=-1,Jt=!0,Dt=Z&s?new Zs:void 0;for(Ie.set(S,L),Ie.set(L,S);++zt<vt;){var Gt=S[zt],Yt=L[zt];if(ce)var Or=Qe?ce(Yt,Gt,zt,L,S,Ie):ce(Gt,Yt,zt,S,L,Ie);if(Or!==void 0){if(Or)continue;Jt=!1;break}if(Dt){if(!Me(L,function(fr,on){if(!Pe(Dt,on)&&(Gt===fr||We(Gt,fr,Z,ce,Ie)))return Dt.push(on)})){Jt=!1;break}}else if(!(Gt===Yt||We(Gt,Yt,Z,ce,Ie))){Jt=!1;break}}return Ie.delete(S),Ie.delete(L),Jt}function c7(S,L,Z,ce,We,Ie,Qe){switch(Z){case X:if(S.byteLength!=L.byteLength||S.byteOffset!=L.byteOffset)return!1;S=S.buffer,L=L.buffer;case q:return!(S.byteLength!=L.byteLength||!Ie(new Ne(S),new Ne(L)));case p:case w:case N:return Id(+S,+L);case y:return S.name==L.name&&S.message==L.message;case I:case h:return S==L+"";case A:var vt=ge;case O:var Ct=ce&i;if(vt||(vt=Oe),S.size!=L.size&&!Ct)return!1;var Ze=Qe.get(S);if(Ze)return Ze==L;ce|=s,Qe.set(S,L);var zt=Cd(vt(S),vt(L),ce,We,Ie,Qe);return Qe.delete(S),zt;case _:if(st)return st.call(S)==st.call(L)}return!1}function l7(S,L,Z,ce,We,Ie){var Qe=Z&i,vt=Sd(S),Ct=vt.length,Ze=Sd(L),zt=Ze.length;if(Ct!=zt&&!Qe)return!1;for(var Jt=Ct;Jt--;){var Dt=vt[Jt];if(!(Qe?Dt in L:v.call(L,Dt)))return!1}var Gt=Ie.get(S);if(Gt&&Ie.get(L))return Gt==L;var Yt=!0;Ie.set(S,L),Ie.set(L,S);for(var Or=Qe;++Jt<Ct;){Dt=vt[Jt];var fr=S[Dt],on=L[Dt];if(ce)var Pd=Qe?ce(on,fr,Dt,L,S,Ie):ce(fr,on,Dt,S,L,Ie);if(!(Pd===void 0?fr===on||We(fr,on,Z,ce,Ie):Pd)){Yt=!1;break}Or||(Or=Dt=="constructor")}if(Yt&&!Or){var eo=S.constructor,to=L.constructor;eo!=to&&"constructor"in S&&"constructor"in L&&!(typeof eo=="function"&&eo instanceof eo&&typeof to=="function"&&to instanceof to)&&(Yt=!1)}return Ie.delete(S),Ie.delete(L),Yt}function Sd(S){return n7(S,v7,h7)}function Xs(S,L){var Z=S.__data__;return f7(L)?Z[typeof L=="string"?"string":"hash"]:Z.map}function Tn(S,L){var Z=De(S,L);return s7(Z)?Z:void 0}function u7(S){var L=v.call(S,Ht),Z=S[Ht];try{S[Ht]=void 0;var ce=!0}catch{}var We=U.call(S);return ce&&(L?S[Ht]=Z:delete S[Ht]),We}var h7=rn?function(S){return S==null?[]:(S=Object(S),Le(rn(S),function(L){return Fe.call(S,L)}))}:_7,Dr=ji;(tt&&Dr(new tt(new ArrayBuffer(1)))!=X||Je&&Dr(new Je)!=A||rt&&Dr(rt.resolve())!=D||nt&&Dr(new nt)!=O||it&&Dr(new it)!=j)&&(Dr=function(S){var L=ji(S),Z=L==x?S.constructor:void 0,ce=Z?sn(Z):"";if(ce)switch(ce){case ft:return X;case pt:return A;case gt:return D;case mt:return O;case wt:return j}return L});function d7(S,L){return L=L??o,!!L&&(typeof S=="number"||fe.test(S))&&S>-1&&S%1==0&&S<L}function f7(S){var L=typeof S;return L=="string"||L=="number"||L=="symbol"||L=="boolean"?S!=="__proto__":S===null}function p7(S){return!!T&&T in S}function g7(S){var L=S&&S.constructor,Z=typeof L=="function"&&L.prototype||g;return S===Z}function m7(S){return U.call(S)}function sn(S){if(S!=null){try{return d.call(S)}catch{}try{return S+""}catch{}}return""}function Id(S,L){return S===L||S!==S&&L!==L}var w7=Ed(function(){return arguments}())?Ed:function(S){return ki(S)&&v.call(S,"callee")&&!Fe.call(S,"callee")},Qs=Array.isArray;function y7(S){return S!=null&&Od(S.length)&&!Dd(S)}var Tc=Bi||E7;function b7(S,L){return xd(S,L)}function Dd(S){if(!Ad(S))return!1;var L=ji(S);return L==m||L==E||L==l||L==b}function Od(S){return typeof S=="number"&&S>-1&&S%1==0&&S<=o}function Ad(S){var L=typeof S;return S!=null&&(L=="object"||L=="function")}function ki(S){return S!=null&&typeof S=="object"}var $d=Ee?Ke(Ee):o7;function v7(S){return y7(S)?r7(S):a7(S)}function _7(){return[]}function E7(){return!1}t.exports=b7})(oa,oa.exports);var r5=oa.exports,n5=Object.defineProperty,Ju=Object.getOwnPropertySymbols,i5=Object.prototype.hasOwnProperty,s5=Object.prototype.propertyIsEnumerable,Xu=(t,e,r)=>e in t?n5(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,$t=(t,e)=>{for(var r in e||(e={}))i5.call(e,r)&&Xu(t,r,e[r]);if(Ju)for(var r of Ju(e))s5.call(e,r)&&Xu(t,r,e[r]);return t};function o5(t,e){if(t.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),n=0;n<r.length;n++)r[n]=255;for(var i=0;i<t.length;i++){var s=t.charAt(i),o=s.charCodeAt(0);if(r[o]!==255)throw new TypeError(s+" is ambiguous");r[o]=i}var a=t.length,c=t.charAt(0),l=Math.log(a)/Math.log(256),p=Math.log(256)/Math.log(a);function w(E){if(E instanceof Uint8Array||(ArrayBuffer.isView(E)?E=new Uint8Array(E.buffer,E.byteOffset,E.byteLength):Array.isArray(E)&&(E=Uint8Array.from(E))),!(E instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(E.length===0)return"";for(var A=0,N=0,M=0,x=E.length;M!==x&&E[M]===0;)M++,A++;for(var D=(x-M)*p+1>>>0,b=new Uint8Array(D);M!==x;){for(var I=E[M],O=0,h=D-1;(I!==0||O<N)&&h!==-1;h--,O++)I+=256*b[h]>>>0,b[h]=I%a>>>0,I=I/a>>>0;if(I!==0)throw new Error("Non-zero carry");N=O,M++}for(var _=D-N;_!==D&&b[_]===0;)_++;for(var H=c.repeat(A);_<D;++_)H+=t.charAt(b[_]);return H}function y(E){if(typeof E!="string")throw new TypeError("Expected String");if(E.length===0)return new Uint8Array;var A=0;if(E[A]!==" "){for(var N=0,M=0;E[A]===c;)N++,A++;for(var x=(E.length-A)*l+1>>>0,D=new Uint8Array(x);E[A];){var b=r[E.charCodeAt(A)];if(b===255)return;for(var I=0,O=x-1;(b!==0||I<M)&&O!==-1;O--,I++)b+=a*D[O]>>>0,D[O]=b%256>>>0,b=b/256>>>0;if(b!==0)throw new Error("Non-zero carry");M=I,A++}if(E[A]!==" "){for(var h=x-M;h!==x&&D[h]===0;)h++;for(var _=new Uint8Array(N+(x-h)),H=N;h!==x;)_[H++]=D[h++];return _}}}function m(E){var A=y(E);if(A)return A;throw new Error(`Non-${e} character`)}return{encode:w,decodeUnsafe:y,decode:m}}var a5=o5,c5=a5;const Qu=t=>{if(t instanceof Uint8Array&&t.constructor.name==="Uint8Array")return t;if(t instanceof ArrayBuffer)return new Uint8Array(t);if(ArrayBuffer.isView(t))return new Uint8Array(t.buffer,t.byteOffset,t.byteLength);throw new Error("Unknown type, must be binary type")},l5=t=>new TextEncoder().encode(t),u5=t=>new TextDecoder().decode(t);class h5{constructor(e,r,n){this.name=e,this.prefix=r,this.baseEncode=n}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}}class d5{constructor(e,r,n){if(this.name=e,this.prefix=r,r.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=r.codePointAt(0),this.baseDecode=n}decode(e){if(typeof e=="string"){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))}else throw Error("Can only multibase decode strings")}or(e){return eh(this,e)}}class f5{constructor(e){this.decoders=e}or(e){return eh(this,e)}decode(e){const r=e[0],n=this.decoders[r];if(n)return n.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const eh=(t,e)=>new f5($t($t({},t.decoders||{[t.prefix]:t}),e.decoders||{[e.prefix]:e}));class p5{constructor(e,r,n,i){this.name=e,this.prefix=r,this.baseEncode=n,this.baseDecode=i,this.encoder=new h5(e,r,n),this.decoder=new d5(e,r,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}const cs=({name:t,prefix:e,encode:r,decode:n})=>new p5(t,e,r,n),oi=({prefix:t,name:e,alphabet:r})=>{const{encode:n,decode:i}=c5(r,e);return cs({prefix:t,name:e,encode:n,decode:s=>Qu(i(s))})},g5=(t,e,r,n)=>{const i={};for(let p=0;p<e.length;++p)i[e[p]]=p;let s=t.length;for(;t[s-1]==="=";)--s;const o=new Uint8Array(s*r/8|0);let a=0,c=0,l=0;for(let p=0;p<s;++p){const w=i[t[p]];if(w===void 0)throw new SyntaxError(`Non-${n} character`);c=c<<r|w,a+=r,a>=8&&(a-=8,o[l++]=255&c>>a)}if(a>=r||255&c<<8-a)throw new SyntaxError("Unexpected end of data");return o},m5=(t,e,r)=>{const n=e[e.length-1]==="=",i=(1<<r)-1;let s="",o=0,a=0;for(let c=0;c<t.length;++c)for(a=a<<8|t[c],o+=8;o>r;)o-=r,s+=e[i&a>>o];if(o&&(s+=e[i&a<<r-o]),n)for(;s.length*r&7;)s+="=";return s},xt=({name:t,prefix:e,bitsPerChar:r,alphabet:n})=>cs({prefix:e,name:t,encode(i){return m5(i,n,r)},decode(i){return g5(i,n,r,t)}}),w5=cs({prefix:"\0",name:"identity",encode:t=>u5(t),decode:t=>l5(t)});var y5=Object.freeze({__proto__:null,identity:w5});const b5=xt({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var v5=Object.freeze({__proto__:null,base2:b5});const _5=xt({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var E5=Object.freeze({__proto__:null,base8:_5});const x5=oi({prefix:"9",name:"base10",alphabet:"0123456789"});var C5=Object.freeze({__proto__:null,base10:x5});const S5=xt({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),I5=xt({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var D5=Object.freeze({__proto__:null,base16:S5,base16upper:I5});const O5=xt({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),A5=xt({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),$5=xt({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),P5=xt({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),T5=xt({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),N5=xt({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),R5=xt({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),L5=xt({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),M5=xt({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var U5=Object.freeze({__proto__:null,base32:O5,base32upper:A5,base32pad:$5,base32padupper:P5,base32hex:T5,base32hexupper:N5,base32hexpad:R5,base32hexpadupper:L5,base32z:M5});const F5=oi({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),B5=oi({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var j5=Object.freeze({__proto__:null,base36:F5,base36upper:B5});const k5=oi({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),H5=oi({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var z5=Object.freeze({__proto__:null,base58btc:k5,base58flickr:H5});const W5=xt({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),q5=xt({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),V5=xt({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),K5=xt({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var G5=Object.freeze({__proto__:null,base64:W5,base64pad:q5,base64url:V5,base64urlpad:K5});const th=Array.from("\u{1F680}\u{1FA90}\u2604\u{1F6F0}\u{1F30C}\u{1F311}\u{1F312}\u{1F313}\u{1F314}\u{1F315}\u{1F316}\u{1F317}\u{1F318}\u{1F30D}\u{1F30F}\u{1F30E}\u{1F409}\u2600\u{1F4BB}\u{1F5A5}\u{1F4BE}\u{1F4BF}\u{1F602}\u2764\u{1F60D}\u{1F923}\u{1F60A}\u{1F64F}\u{1F495}\u{1F62D}\u{1F618}\u{1F44D}\u{1F605}\u{1F44F}\u{1F601}\u{1F525}\u{1F970}\u{1F494}\u{1F496}\u{1F499}\u{1F622}\u{1F914}\u{1F606}\u{1F644}\u{1F4AA}\u{1F609}\u263A\u{1F44C}\u{1F917}\u{1F49C}\u{1F614}\u{1F60E}\u{1F607}\u{1F339}\u{1F926}\u{1F389}\u{1F49E}\u270C\u2728\u{1F937}\u{1F631}\u{1F60C}\u{1F338}\u{1F64C}\u{1F60B}\u{1F497}\u{1F49A}\u{1F60F}\u{1F49B}\u{1F642}\u{1F493}\u{1F929}\u{1F604}\u{1F600}\u{1F5A4}\u{1F603}\u{1F4AF}\u{1F648}\u{1F447}\u{1F3B6}\u{1F612}\u{1F92D}\u2763\u{1F61C}\u{1F48B}\u{1F440}\u{1F62A}\u{1F611}\u{1F4A5}\u{1F64B}\u{1F61E}\u{1F629}\u{1F621}\u{1F92A}\u{1F44A}\u{1F973}\u{1F625}\u{1F924}\u{1F449}\u{1F483}\u{1F633}\u270B\u{1F61A}\u{1F61D}\u{1F634}\u{1F31F}\u{1F62C}\u{1F643}\u{1F340}\u{1F337}\u{1F63B}\u{1F613}\u2B50\u2705\u{1F97A}\u{1F308}\u{1F608}\u{1F918}\u{1F4A6}\u2714\u{1F623}\u{1F3C3}\u{1F490}\u2639\u{1F38A}\u{1F498}\u{1F620}\u261D\u{1F615}\u{1F33A}\u{1F382}\u{1F33B}\u{1F610}\u{1F595}\u{1F49D}\u{1F64A}\u{1F639}\u{1F5E3}\u{1F4AB}\u{1F480}\u{1F451}\u{1F3B5}\u{1F91E}\u{1F61B}\u{1F534}\u{1F624}\u{1F33C}\u{1F62B}\u26BD\u{1F919}\u2615\u{1F3C6}\u{1F92B}\u{1F448}\u{1F62E}\u{1F646}\u{1F37B}\u{1F343}\u{1F436}\u{1F481}\u{1F632}\u{1F33F}\u{1F9E1}\u{1F381}\u26A1\u{1F31E}\u{1F388}\u274C\u270A\u{1F44B}\u{1F630}\u{1F928}\u{1F636}\u{1F91D}\u{1F6B6}\u{1F4B0}\u{1F353}\u{1F4A2}\u{1F91F}\u{1F641}\u{1F6A8}\u{1F4A8}\u{1F92C}\u2708\u{1F380}\u{1F37A}\u{1F913}\u{1F619}\u{1F49F}\u{1F331}\u{1F616}\u{1F476}\u{1F974}\u25B6\u27A1\u2753\u{1F48E}\u{1F4B8}\u2B07\u{1F628}\u{1F31A}\u{1F98B}\u{1F637}\u{1F57A}\u26A0\u{1F645}\u{1F61F}\u{1F635}\u{1F44E}\u{1F932}\u{1F920}\u{1F927}\u{1F4CC}\u{1F535}\u{1F485}\u{1F9D0}\u{1F43E}\u{1F352}\u{1F617}\u{1F911}\u{1F30A}\u{1F92F}\u{1F437}\u260E\u{1F4A7}\u{1F62F}\u{1F486}\u{1F446}\u{1F3A4}\u{1F647}\u{1F351}\u2744\u{1F334}\u{1F4A3}\u{1F438}\u{1F48C}\u{1F4CD}\u{1F940}\u{1F922}\u{1F445}\u{1F4A1}\u{1F4A9}\u{1F450}\u{1F4F8}\u{1F47B}\u{1F910}\u{1F92E}\u{1F3BC}\u{1F975}\u{1F6A9}\u{1F34E}\u{1F34A}\u{1F47C}\u{1F48D}\u{1F4E3}\u{1F942}"),Y5=th.reduce((t,e,r)=>(t[r]=e,t),[]),Z5=th.reduce((t,e,r)=>(t[e.codePointAt(0)]=r,t),[]);function J5(t){return t.reduce((e,r)=>(e+=Y5[r],e),"")}function X5(t){const e=[];for(const r of t){const n=Z5[r.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${r}`);e.push(n)}return new Uint8Array(e)}const Q5=cs({prefix:"\u{1F680}",name:"base256emoji",encode:J5,decode:X5});var ew=Object.freeze({__proto__:null,base256emoji:Q5}),tw=nh,rh=128,rw=127,nw=~rw,iw=Math.pow(2,31);function nh(t,e,r){e=e||[],r=r||0;for(var n=r;t>=iw;)e[r++]=t&255|rh,t/=128;for(;t&nw;)e[r++]=t&255|rh,t>>>=7;return e[r]=t|0,nh.bytes=r-n+1,e}var sw=aa,ow=128,ih=127;function aa(t,n){var r=0,n=n||0,i=0,s=n,o,a=t.length;do{if(s>=a)throw aa.bytes=0,new RangeError("Could not decode varint");o=t[s++],r+=i<28?(o&ih)<<i:(o&ih)*Math.pow(2,i),i+=7}while(o>=ow);return aa.bytes=s-n,r}var aw=Math.pow(2,7),cw=Math.pow(2,14),lw=Math.pow(2,21),uw=Math.pow(2,28),hw=Math.pow(2,35),dw=Math.pow(2,42),fw=Math.pow(2,49),pw=Math.pow(2,56),gw=Math.pow(2,63),mw=function(t){return t<aw?1:t<cw?2:t<lw?3:t<uw?4:t<hw?5:t<dw?6:t<fw?7:t<pw?8:t<gw?9:10},ww={encode:tw,decode:sw,encodingLength:mw},sh=ww;const oh=(t,e,r=0)=>(sh.encode(t,e,r),e),ah=t=>sh.encodingLength(t),ca=(t,e)=>{const r=e.byteLength,n=ah(t),i=n+ah(r),s=new Uint8Array(i+r);return oh(t,s,0),oh(r,s,n),s.set(e,i),new yw(t,r,e,s)};class yw{constructor(e,r,n,i){this.code=e,this.size=r,this.digest=n,this.bytes=i}}const ch=({name:t,code:e,encode:r})=>new bw(t,e,r);class bw{constructor(e,r,n){this.name=e,this.code=r,this.encode=n}digest(e){if(e instanceof Uint8Array){const r=this.encode(e);return r instanceof Uint8Array?ca(this.code,r):r.then(n=>ca(this.code,n))}else throw Error("Unknown type, must be binary type")}}const lh=t=>async e=>new Uint8Array(await crypto.subtle.digest(t,e)),vw=ch({name:"sha2-256",code:18,encode:lh("SHA-256")}),_w=ch({name:"sha2-512",code:19,encode:lh("SHA-512")});var Ew=Object.freeze({__proto__:null,sha256:vw,sha512:_w});const uh=0,xw="identity",hh=Qu;var Cw=Object.freeze({__proto__:null,identity:{code:uh,name:xw,encode:hh,digest:t=>ca(uh,hh(t))}});new TextEncoder,new TextDecoder;const dh=$t($t($t($t($t($t($t($t($t($t({},y5),v5),E5),C5),D5),U5),j5),z5),G5),ew);$t($t({},Ew),Cw);function Sw(t=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?globalThis.Buffer.allocUnsafe(t):new Uint8Array(t)}function fh(t,e,r,n){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:r},decoder:{decode:n}}}const ph=fh("utf8","u",t=>"u"+new TextDecoder("utf8").decode(t),t=>new TextEncoder().encode(t.substring(1))),la=fh("ascii","a",t=>{let e="a";for(let r=0;r<t.length;r++)e+=String.fromCharCode(t[r]);return e},t=>{t=t.substring(1);const e=Sw(t.length);for(let r=0;r<t.length;r++)e[r]=t.charCodeAt(r);return e}),Iw=$t({utf8:ph,"utf-8":ph,hex:dh.base16,latin1:la,ascii:la,binary:la},dh);function Dw(t,e="utf8"){const r=Iw[e];if(!r)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(t,"utf8"):r.decoder.decode(`${r.prefix}${t}`)}const gh="wc",Ow=2,ua="core",yr=`${gh}@${2}:${ua}:`,Aw={name:ua,logger:"error"},$w={database:":memory:"},Pw="crypto",mh="client_ed25519_seed",Tw=me.ONE_DAY,Nw="keychain",Rw="0.3",Lw="messages",Mw="0.3",Uw=me.SIX_HOURS,Fw="publisher",wh="irn",Bw="error",yh="wss://relay.walletconnect.com",jw="relayer",It={message:"relayer_message",connect:"relayer_connect",disconnect:"relayer_disconnect",error:"relayer_error",connection_stalled:"relayer_connection_stalled",transport_closed:"relayer_transport_closed",publish:"relayer_publish"},kw="_subscription",ls={payload:"payload",connect:"connect",disconnect:"disconnect",error:"error"},bh=me.ONE_SECOND,Hw="2.4.2",zw="0.3",tr={created:"subscription_created",deleted:"subscription_deleted",expired:"subscription_expired",disabled:"subscription_disabled",sync:"subscription_sync",resubscribed:"subscription_resubscribed"},Ww="subscription",qw="0.3",Vw=me.FIVE_SECONDS*1e3,Kw="pairing",Gw="0.3",ai={wc_pairingDelete:{req:{ttl:me.ONE_DAY,prompt:!1,tag:1e3},res:{ttl:me.ONE_DAY,prompt:!1,tag:1001}},wc_pairingPing:{req:{ttl:me.THIRTY_SECONDS,prompt:!1,tag:1002},res:{ttl:me.THIRTY_SECONDS,prompt:!1,tag:1003}},unregistered_method:{req:{ttl:me.ONE_DAY,prompt:!1,tag:0},res:{ttl:me.ONE_DAY,prompt:!1,tag:0}}},rr={created:"history_created",updated:"history_updated",deleted:"history_deleted",sync:"history_sync"},Yw="history",Zw="0.3",Jw="expirer",Wt={created:"expirer_created",deleted:"expirer_deleted",expired:"expirer_expired",sync:"expirer_sync"},Xw="0.3";class Qw{constructor(e,r){this.core=e,this.logger=r,this.keychain=new Map,this.name=Nw,this.version=Rw,this.initialized=!1,this.storagePrefix=yr,this.init=async()=>{if(!this.initialized){const n=await this.getKeyChain();typeof n<"u"&&(this.keychain=n),this.initialized=!0}},this.has=n=>(this.isInitialized(),this.keychain.has(n)),this.set=async(n,i)=>{this.isInitialized(),this.keychain.set(n,i),await this.persist()},this.get=n=>{this.isInitialized();const i=this.keychain.get(n);if(typeof i>"u"){const{message:s}=se("NO_MATCHING_KEY",`${this.name}: ${n}`);throw new Error(s)}return i},this.del=async n=>{this.isInitialized(),this.keychain.delete(n),await this.persist()},this.core=e,this.logger=je.generateChildLogger(r,this.name)}get context(){return je.getLoggerContext(this.logger)}get storageKey(){return this.storagePrefix+this.version+"//"+this.name}async setKeyChain(e){await this.core.storage.setItem(this.storageKey,Xl(e))}async getKeyChain(){const e=await this.core.storage.getItem(this.storageKey);return typeof e<"u"?Ql(e):void 0}async persist(){await this.setKeyChain(this.keychain)}isInitialized(){if(!this.initialized){const{message:e}=se("NOT_INITIALIZED",this.name);throw new Error(e)}}}class ey{constructor(e,r,n){this.core=e,this.logger=r,this.name=Pw,this.initialized=!1,this.init=async()=>{this.initialized||(await this.keychain.init(),this.initialized=!0)},this.hasKeys=i=>(this.isInitialized(),this.keychain.has(i)),this.getClientId=async()=>{this.isInitialized();const i=await this.getClientSeed(),s=Uu(i);return Mu(s.publicKey)},this.generateKeyPair=()=>{this.isInitialized();const i=rg();return this.setPrivateKey(i.publicKey,i.privateKey)},this.signJWT=async i=>{this.isInitialized();const s=await this.getClientSeed(),o=Uu(s),a=$o();return await dm(a,i,Tw,o)},this.generateSharedKey=(i,s,o)=>{this.isInitialized();const a=this.getPrivateKey(i),c=ng(a,s);return this.setSymKey(c,o)},this.setSymKey=async(i,s)=>{this.isInitialized();const o=s||ig(i);return await this.keychain.set(o,i),o},this.deleteKeyPair=async i=>{this.isInitialized(),await this.keychain.del(i)},this.deleteSymKey=async i=>{this.isInitialized(),await this.keychain.del(i)},this.encode=async(i,s,o)=>{this.isInitialized();const a=Vl(o),c=ri(s);if(Kl(a)){const y=a.senderPublicKey,m=a.receiverPublicKey;i=await this.generateSharedKey(y,m)}const l=this.getSymKey(i),{type:p,senderPublicKey:w}=a;return og({type:p,symKey:l,message:c,senderPublicKey:w})},this.decode=async(i,s,o)=>{this.isInitialized();const a=lg(s,o);if(Kl(a)){const p=a.receiverPublicKey,w=a.senderPublicKey;i=await this.generateSharedKey(p,w)}const c=this.getSymKey(i),l=ag({symKey:c,encoded:s});return Jo(l)},this.core=e,this.logger=je.generateChildLogger(r,this.name),this.keychain=n||new Qw(this.core,this.logger)}get context(){return je.getLoggerContext(this.logger)}getPayloadType(e){const r=Po(e);return Bn(r.type)}async setPrivateKey(e,r){return await this.keychain.set(e,r),e}getPrivateKey(e){return this.keychain.get(e)}async getClientSeed(){let e="";try{e=this.keychain.get(mh)}catch{e=$o(),await this.keychain.set(mh,e)}return Dw(e,"base16")}getSymKey(e){return this.keychain.get(e)}isInitialized(){if(!this.initialized){const{message:e}=se("NOT_INITIALIZED",this.name);throw new Error(e)}}}class ty extends q3{constructor(e,r){super(e,r),this.logger=e,this.core=r,this.messages=new Map,this.name=Lw,this.version=Mw,this.initialized=!1,this.storagePrefix=yr,this.init=async()=>{if(!this.initialized){this.logger.trace("Initialized");try{const n=await this.getRelayerMessages();typeof n<"u"&&(this.messages=n),this.logger.debug(`Successfully Restored records for ${this.name}`),this.logger.trace({type:"method",method:"restore",size:this.messages.size})}catch(n){this.logger.debug(`Failed to Restore records for ${this.name}`),this.logger.error(n)}finally{this.initialized=!0}}},this.set=async(n,i)=>{this.isInitialized();const s=Qi(i);let o=this.messages.get(n);return typeof o>"u"&&(o={}),typeof o[s]<"u"||(o[s]=i,this.messages.set(n,o),await this.persist()),s},this.get=n=>{this.isInitialized();let i=this.messages.get(n);return typeof i>"u"&&(i={}),i},this.has=(n,i)=>{this.isInitialized();const s=this.get(n),o=Qi(i);return typeof s[o]<"u"},this.del=async n=>{this.isInitialized(),this.messages.delete(n),await this.persist()},this.logger=je.generateChildLogger(e,this.name),this.core=r}get context(){return je.getLoggerContext(this.logger)}get storageKey(){return this.storagePrefix+this.version+"//"+this.name}async setRelayerMessages(e){await this.core.storage.setItem(this.storageKey,Xl(e))}async getRelayerMessages(){const e=await this.core.storage.getItem(this.storageKey);return typeof e<"u"?Ql(e):void 0}async persist(){await this.setRelayerMessages(this.messages)}isInitialized(){if(!this.initialized){const{message:e}=se("NOT_INITIALIZED",this.name);throw new Error(e)}}}class ry extends V3{constructor(e,r){super(e,r),this.relayer=e,this.logger=r,this.events=new _t.exports.EventEmitter,this.name=Fw,this.queue=new Map,this.publishTimeout=1e4,this.publish=async(n,i,s)=>{this.logger.debug("Publishing Payload"),this.logger.trace({type:"method",method:"publish",params:{topic:n,message:i,opts:s}});try{const o=s?.ttl||Uw,a=To(s),c=s?.prompt||!1,l=s?.tag||0,p={topic:n,message:i,opts:{ttl:o,relay:a,prompt:c,tag:l}},w=Qi(i);this.queue.set(w,p);try{await await eu(this.rpcPublish(n,i,o,a,c,l),this.publishTimeout),this.relayer.events.emit(It.publish,p)}catch{this.logger.debug("Publishing Payload stalled"),this.relayer.events.emit(It.connection_stalled);return}this.onPublish(w,p),this.logger.debug("Successfully Published Payload"),this.logger.trace({type:"method",method:"publish",params:{topic:n,message:i,opts:s}})}catch(o){throw this.logger.debug("Failed to Publish Payload"),this.logger.error(o),o}},this.on=(n,i)=>{this.events.on(n,i)},this.once=(n,i)=>{this.events.once(n,i)},this.off=(n,i)=>{this.events.off(n,i)},this.removeListener=(n,i)=>{this.events.removeListener(n,i)},this.relayer=e,this.logger=je.generateChildLogger(r,this.name),this.registerEventListeners()}get context(){return je.getLoggerContext(this.logger)}rpcPublish(e,r,n,i,s,o){var a,c,l,p;const w={method:No(i.protocol).publish,params:{topic:e,message:r,ttl:n,prompt:s,tag:o}};return Ot((a=w.params)==null?void 0:a.prompt)&&((c=w.params)==null||delete c.prompt),Ot((l=w.params)==null?void 0:l.tag)&&((p=w.params)==null||delete p.tag),this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"message",direction:"outgoing",request:w}),this.relayer.provider.request(w)}onPublish(e,r){this.queue.delete(e)}checkQueue(){this.queue.forEach(async e=>{const{topic:r,message:n,opts:i}=e;await this.publish(r,n,i)})}registerEventListeners(){this.relayer.core.heartbeat.on(Jn.HEARTBEAT_EVENTS.pulse,()=>{this.checkQueue()})}}class ny{constructor(){this.map=new Map,this.set=(e,r)=>{const n=this.get(e);this.exists(e,r)||this.map.set(e,[...n,r])},this.get=e=>this.map.get(e)||[],this.exists=(e,r)=>this.get(e).includes(r),this.delete=(e,r)=>{if(typeof r>"u"){this.map.delete(e);return}if(!this.map.has(e))return;const n=this.get(e);if(!this.exists(e,r))return;const i=n.filter(s=>s!==r);if(!i.length){this.map.delete(e);return}this.map.set(e,i)},this.clear=()=>{this.map.clear()}}get topics(){return Array.from(this.map.keys())}}var iy=Object.defineProperty,sy=Object.defineProperties,oy=Object.getOwnPropertyDescriptors,vh=Object.getOwnPropertySymbols,ay=Object.prototype.hasOwnProperty,cy=Object.prototype.propertyIsEnumerable,_h=(t,e,r)=>e in t?iy(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,us=(t,e)=>{for(var r in e||(e={}))ay.call(e,r)&&_h(t,r,e[r]);if(vh)for(var r of vh(e))cy.call(e,r)&&_h(t,r,e[r]);return t},ha=(t,e)=>sy(t,oy(e));class ly extends Y3{constructor(e,r){super(e,r),this.relayer=e,this.logger=r,this.subscriptions=new Map,this.topicMap=new ny,this.events=new _t.exports.EventEmitter,this.name=Ww,this.version=qw,this.pending=new Map,this.cached=[],this.initialized=!1,this.pendingSubscriptionWatchLabel="pending_sub_watch_label",this.pollingInterval=20,this.storagePrefix=yr,this.subscribeTimeout=1e4,this.restartInProgress=!1,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restart(),this.registerEventListeners(),this.onEnable(),this.clientId=await this.relayer.core.crypto.getClientId())},this.subscribe=async(n,i)=>{await this.restartToComplete(),this.isInitialized(),this.logger.debug("Subscribing Topic"),this.logger.trace({type:"method",method:"subscribe",params:{topic:n,opts:i}});try{const s=To(i),o={topic:n,relay:s};this.pending.set(n,o);const a=await this.rpcSubscribe(n,s);return this.onSubscribe(a,o),this.logger.debug("Successfully Subscribed Topic"),this.logger.trace({type:"method",method:"subscribe",params:{topic:n,opts:i}}),a}catch(s){throw this.logger.debug("Failed to Subscribe Topic"),this.logger.error(s),s}},this.unsubscribe=async(n,i)=>{await this.restartToComplete(),this.isInitialized(),typeof i?.id<"u"?await this.unsubscribeById(n,i.id,i):await this.unsubscribeByTopic(n,i)},this.isSubscribed=async n=>this.topics.includes(n)?!0:await new Promise((i,s)=>{const o=new me.Watch;o.start(this.pendingSubscriptionWatchLabel);const a=setInterval(()=>{!this.pending.has(n)&&this.topics.includes(n)&&(clearInterval(a),o.stop(this.pendingSubscriptionWatchLabel),i(!0)),o.elapsed(this.pendingSubscriptionWatchLabel)>=Vw&&(clearInterval(a),o.stop(this.pendingSubscriptionWatchLabel),s(!1))},this.pollingInterval)}),this.on=(n,i)=>{this.events.on(n,i)},this.once=(n,i)=>{this.events.once(n,i)},this.off=(n,i)=>{this.events.off(n,i)},this.removeListener=(n,i)=>{this.events.removeListener(n,i)},this.restart=async()=>{this.restartInProgress=!0,await this.restore(),await this.reset(),this.restartInProgress=!1},this.relayer=e,this.logger=je.generateChildLogger(r,this.name),this.clientId=""}get context(){return je.getLoggerContext(this.logger)}get storageKey(){return this.storagePrefix+this.version+"//"+this.name}get length(){return this.subscriptions.size}get ids(){return Array.from(this.subscriptions.keys())}get values(){return Array.from(this.subscriptions.values())}get topics(){return this.topicMap.topics}hasSubscription(e,r){let n=!1;try{n=this.getSubscription(e).topic===r}catch{}return n}onEnable(){this.cached=[],this.initialized=!0}onDisable(){this.cached=this.values,this.subscriptions.clear(),this.topicMap.clear(),this.initialized=!1}async unsubscribeByTopic(e,r){const n=this.topicMap.get(e);await Promise.all(n.map(async i=>await this.unsubscribeById(e,i,r)))}async unsubscribeById(e,r,n){this.logger.debug("Unsubscribing Topic"),this.logger.trace({type:"method",method:"unsubscribe",params:{topic:e,id:r,opts:n}});try{const i=To(n);await this.rpcUnsubscribe(e,r,i);const s=ot("USER_DISCONNECTED",`${this.name}, ${e}`);await this.onUnsubscribe(e,r,s),this.logger.debug("Successfully Unsubscribed Topic"),this.logger.trace({type:"method",method:"unsubscribe",params:{topic:e,id:r,opts:n}})}catch(i){throw this.logger.debug("Failed to Unsubscribe Topic"),this.logger.error(i),i}}async rpcSubscribe(e,r){const n={method:No(r.protocol).subscribe,params:{topic:e}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:n});try{await await eu(this.relayer.provider.request(n),this.subscribeTimeout)}catch{this.logger.debug("Outgoing Relay Payload stalled"),this.relayer.events.emit(It.connection_stalled)}return Qi(e+this.clientId)}rpcUnsubscribe(e,r,n){const i={method:No(n.protocol).unsubscribe,params:{topic:e,id:r}};return this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:i}),this.relayer.provider.request(i)}onSubscribe(e,r){this.setSubscription(e,ha(us({},r),{id:e})),this.pending.delete(r.topic)}onResubscribe(e,r){this.addSubscription(e,ha(us({},r),{id:e})),this.pending.delete(r.topic)}async onUnsubscribe(e,r,n){this.events.removeAllListeners(r),this.hasSubscription(r,e)&&this.deleteSubscription(r,n),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,r){this.subscriptions.has(e)||(this.logger.debug("Setting subscription"),this.logger.trace({type:"method",method:"setSubscription",id:e,subscription:r}),this.addSubscription(e,r))}addSubscription(e,r){this.subscriptions.set(e,us({},r)),this.topicMap.set(r.topic,e),this.events.emit(tr.created,r)}getSubscription(e){this.logger.debug("Getting subscription"),this.logger.trace({type:"method",method:"getSubscription",id:e});const r=this.subscriptions.get(e);if(!r){const{message:n}=se("NO_MATCHING_KEY",`${this.name}: ${e}`);throw new Error(n)}return r}deleteSubscription(e,r){this.logger.debug("Deleting subscription"),this.logger.trace({type:"method",method:"deleteSubscription",id:e,reason:r});const n=this.getSubscription(e);this.subscriptions.delete(e),this.topicMap.delete(n.topic,e),this.events.emit(tr.deleted,ha(us({},n),{reason:r}))}async persist(){await this.setRelayerSubscriptions(this.values),this.events.emit(tr.sync)}async reset(){this.cached.length&&await Promise.all(this.cached.map(async e=>await this.resubscribe(e))),this.events.emit(tr.resubscribed)}async restore(){try{const e=await this.getRelayerSubscriptions();if(typeof e>"u"||!e.length)return;if(this.subscriptions.size){const{message:r}=se("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(r),this.logger.error(`${this.name}: ${JSON.stringify(this.values)}`),new Error(r)}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 resubscribe(e){if(!this.ids.includes(e.id)){const{topic:r,relay:n}=e,i={topic:r,relay:n};this.pending.set(i.topic,i);const s=await this.rpcSubscribe(i.topic,i.relay);this.onResubscribe(s,i)}}async onConnect(){this.restartInProgress||(await this.restart(),this.onEnable())}onDisconnect(){this.onDisable()}checkPending(){this.relayer.transportExplicitlyClosed||this.pending.forEach(async e=>{const r=await this.rpcSubscribe(e.topic,e.relay);this.onSubscribe(r,e)})}registerEventListeners(){this.relayer.core.heartbeat.on(Jn.HEARTBEAT_EVENTS.pulse,()=>{this.checkPending()}),this.relayer.on(It.connect,async()=>{await this.onConnect()}),this.relayer.on(It.disconnect,()=>{this.onDisconnect()}),this.events.on(tr.created,async e=>{const r=tr.created;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),await this.persist()}),this.events.on(tr.deleted,async e=>{const r=tr.deleted;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),await this.persist()})}isInitialized(){if(!this.initialized){const{message:e}=se("NOT_INITIALIZED",this.name);throw new Error(e)}}async restartToComplete(){this.restartInProgress&&await new Promise(e=>{const r=setInterval(()=>{this.restartInProgress||(clearInterval(r),e())},this.pollingInterval)})}}var uy=Object.defineProperty,Eh=Object.getOwnPropertySymbols,hy=Object.prototype.hasOwnProperty,dy=Object.prototype.propertyIsEnumerable,xh=(t,e,r)=>e in t?uy(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,fy=(t,e)=>{for(var r in e||(e={}))hy.call(e,r)&&xh(t,r,e[r]);if(Eh)for(var r of Eh(e))dy.call(e,r)&&xh(t,r,e[r]);return t};class py extends K3{constructor(e){super(e),this.protocol="wc",this.version=2,this.events=new _t.exports.EventEmitter,this.name=jw,this.transportExplicitlyClosed=!1,this.initialized=!1,this.reconnecting=!1,this.core=e.core,this.logger=typeof e.logger<"u"&&typeof e.logger!="string"?je.generateChildLogger(e.logger,this.name):zn(je.getDefaultLoggerOptions({level:e.logger||Bw})),this.messages=new ty(this.logger,e.core),this.subscriber=new ly(this,this.logger),this.publisher=new ry(this,this.logger),this.relayUrl=e?.relayUrl||yh,this.projectId=e.projectId,this.provider={}}async init(){this.logger.trace("Initialized"),this.provider=await this.createProvider(),await Promise.all([this.messages.init(),this.transportOpen(),this.subscriber.init()]),this.registerEventListeners(),this.initialized=!0}get context(){return je.getLoggerContext(this.logger)}get connected(){return this.provider.connection.connected}get connecting(){return this.provider.connection.connecting}async publish(e,r,n){this.isInitialized(),await this.publisher.publish(e,r,n),await this.recordMessageEvent({topic:e,message:r})}async subscribe(e,r){this.isInitialized();let n="";return await Promise.all([new Promise(i=>{this.subscriber.once(tr.created,s=>{s.topic===e&&i()})}),new Promise(async i=>{n=await this.subscriber.subscribe(e,r),i()})]),n}async unsubscribe(e,r){this.isInitialized(),await this.subscriber.unsubscribe(e,r)}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}off(e,r){this.events.off(e,r)}removeListener(e,r){this.events.removeListener(e,r)}async transportClose(){this.transportExplicitlyClosed=!0,this.connected&&(await this.provider.disconnect(),this.events.emit(It.transport_closed))}async transportOpen(e){if(!this.reconnecting){this.relayUrl=e||this.relayUrl,this.transportExplicitlyClosed=!1,this.reconnecting=!0;try{await Promise.all([new Promise(r=>{this.initialized||r(),this.subscriber.once(tr.resubscribed,()=>{r()})}),await Promise.race([this.provider.connect(),new Promise((r,n)=>this.once(It.transport_closed,()=>{n(new Error("closeTransport called before connection was established"))}))])])}catch(r){const n=r;if(!/socket hang up/i.test(n.message))throw r;this.logger.error(r),this.events.emit(It.transport_closed)}finally{this.reconnecting=!1}}}async restartTransport(e){this.transportExplicitlyClosed||(await this.transportClose(),await new Promise(r=>setTimeout(r,bh)),await this.transportOpen(e))}async createProvider(){const e=await this.core.crypto.signJWT(this.relayUrl);return new si(new t5(xg({sdkVersion:Hw,protocol:this.protocol,version:this.version,relayUrl:this.relayUrl,projectId:this.projectId,auth:e})))}async recordMessageEvent(e){const{topic:r,message:n}=e;await this.messages.set(r,n)}async shouldIgnoreMessageEvent(e){const{topic:r,message:n}=e;return await this.subscriber.isSubscribed(r)?this.messages.has(r,n):!0}async onProviderPayload(e){if(this.logger.debug("Incoming Relay Payload"),this.logger.trace({type:"payload",direction:"incoming",payload:e}),ia(e)){if(!e.method.endsWith(kw))return;const r=e.params,{topic:n,message:i}=r.data,s={topic:n,message:i};this.logger.debug("Emitting Relayer Payload"),this.logger.trace(fy({type:"event",event:r.id},s)),this.events.emit(r.id,s),await this.acknowledgePayload(e),await this.onMessageEvent(s)}}async onMessageEvent(e){await this.shouldIgnoreMessageEvent(e)||(this.events.emit(It.message,e),await this.recordMessageEvent(e))}async acknowledgePayload(e){const r=na(e.id,!0);await this.provider.connection.send(r)}registerEventListeners(){this.provider.on(ls.payload,e=>this.onProviderPayload(e)),this.provider.on(ls.connect,()=>{this.events.emit(It.connect)}),this.provider.on(ls.disconnect,()=>{this.events.emit(It.disconnect),this.attemptToReconnect()}),this.provider.on(ls.error,e=>this.events.emit(It.error,e)),this.events.on(It.connection_stalled,async()=>{await this.restartTransport()})}attemptToReconnect(){this.transportExplicitlyClosed||setTimeout(async()=>{await this.transportOpen()},me.toMiliseconds(bh))}isInitialized(){if(!this.initialized){const{message:e}=se("NOT_INITIALIZED",this.name);throw new Error(e)}}}var gy=Object.defineProperty,Ch=Object.getOwnPropertySymbols,my=Object.prototype.hasOwnProperty,wy=Object.prototype.propertyIsEnumerable,Sh=(t,e,r)=>e in t?gy(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Ih=(t,e)=>{for(var r in e||(e={}))my.call(e,r)&&Sh(t,r,e[r]);if(Ch)for(var r of Ch(e))wy.call(e,r)&&Sh(t,r,e[r]);return t};class hs extends G3{constructor(e,r,n,i=yr,s=void 0){super(e,r,n,i),this.core=e,this.logger=r,this.name=n,this.map=new Map,this.version=zw,this.cached=[],this.initialized=!1,this.storagePrefix=yr,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(o=>{Wg(o)?this.map.set(o.id,o):qg(o)?this.map.set(o.topic,o):this.getKey&&o!==null&&!Ot(o)&&this.map.set(this.getKey(o),o)}),this.cached=[],this.initialized=!0)},this.set=async(o,a)=>{this.isInitialized(),this.map.has(o)?await this.update(o,a):(this.logger.debug("Setting value"),this.logger.trace({type:"method",method:"set",key:o,value:a}),this.map.set(o,a),await this.persist())},this.get=o=>(this.isInitialized(),this.logger.debug("Getting value"),this.logger.trace({type:"method",method:"get",key:o}),this.getData(o)),this.getAll=o=>(this.isInitialized(),o?this.values.filter(a=>Object.keys(o).every(c=>r5(a[c],o[c]))):this.values),this.update=async(o,a)=>{this.isInitialized(),this.logger.debug("Updating value"),this.logger.trace({type:"method",method:"update",key:o,update:a});const c=Ih(Ih({},this.getData(o)),a);this.map.set(o,c),await this.persist()},this.delete=async(o,a)=>{this.isInitialized(),this.map.has(o)&&(this.logger.debug("Deleting value"),this.logger.trace({type:"method",method:"delete",key:o,reason:a}),this.map.delete(o),await this.persist())},this.logger=je.generateChildLogger(r,this.name),this.storagePrefix=i,this.getKey=s}get context(){return je.getLoggerContext(this.logger)}get storageKey(){return this.storagePrefix+this.version+"//"+this.name}get length(){return this.map.size}get keys(){return Array.from(this.map.keys())}get values(){return Array.from(this.map.values())}async setDataStore(e){await this.core.storage.setItem(this.storageKey,e)}async getDataStore(){return await this.core.storage.getItem(this.storageKey)}getData(e){const r=this.map.get(e);if(!r){const{message:n}=se("NO_MATCHING_KEY",`${this.name}: ${e}`);throw this.logger.error(n),new Error(n)}return r}async persist(){await this.setDataStore(this.values)}async restore(){try{const e=await this.getDataStore();if(typeof e>"u"||!e.length)return;if(this.map.size){const{message:r}=se("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(r),new Error(r)}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){const{message:e}=se("NOT_INITIALIZED",this.name);throw new Error(e)}}}class yy{constructor(e,r){this.core=e,this.logger=r,this.name=Kw,this.version=Gw,this.events=new _t.exports,this.initialized=!1,this.storagePrefix=yr,this.ignoredPayloadTypes=[Rr],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:n})=>{this.isInitialized(),this.registeredMethods=[...new Set([...this.registeredMethods,...n])]},this.create=async()=>{this.isInitialized();const n=$o(),i=await this.core.crypto.setSymKey(n),s=Qt(me.FIVE_MINUTES),o={protocol:wh},a={topic:i,expiry:s,relay:o,active:!1},c=Rg({protocol:this.core.protocol,version:this.core.version,topic:i,symKey:n,relay:o});return await this.pairings.set(i,a),await this.core.relayer.subscribe(i),this.core.expirer.set(i,s),{topic:i,uri:c}},this.pair=async n=>{this.isInitialized(),this.isValidPair(n);const{topic:i,symKey:s,relay:o}=Tg(n.uri),a=Qt(me.FIVE_MINUTES),c={topic:i,relay:o,expiry:a,active:!1};return await this.pairings.set(i,c),await this.core.crypto.setSymKey(s,i),await this.core.relayer.subscribe(i,{relay:o}),this.core.expirer.set(i,a),n.activatePairing&&await this.activate({topic:i}),c},this.activate=async({topic:n})=>{this.isInitialized();const i=Qt(me.THIRTY_DAYS);await this.pairings.update(n,{active:!0,expiry:i}),this.core.expirer.set(n,i)},this.ping=async n=>{this.isInitialized(),await this.isValidPing(n);const{topic:i}=n;if(this.pairings.keys.includes(i)){const s=await this.sendRequest(i,"wc_pairingPing",{}),{done:o,resolve:a,reject:c}=Lr();this.events.once(et("pairing_ping",s),({error:l})=>{l?c(l):a()}),await o()}},this.updateExpiry=async({topic:n,expiry:i})=>{this.isInitialized(),await this.pairings.update(n,{expiry:i})},this.updateMetadata=async({topic:n,metadata:i})=>{this.isInitialized(),await this.pairings.update(n,{peerMetadata:i})},this.getPairings=()=>(this.isInitialized(),this.pairings.values),this.disconnect=async n=>{this.isInitialized(),await this.isValidDisconnect(n);const{topic:i}=n;this.pairings.keys.includes(i)&&(await this.sendRequest(i,"wc_pairingDelete",ot("USER_DISCONNECTED")),await this.deletePairing(i))},this.sendRequest=async(n,i,s)=>{const o=os(i,s),a=await this.core.crypto.encode(n,o),c=ai[i].req;return this.core.history.set(n,o),await this.core.relayer.publish(n,a,c),o.id},this.sendResult=async(n,i,s)=>{const o=na(n,s),a=await this.core.crypto.encode(i,o),c=await this.core.history.get(i,n),l=ai[c.request.method].res;await this.core.relayer.publish(i,a,l),await this.core.history.resolve(o)},this.sendError=async(n,i,s)=>{const o=as(n,s),a=await this.core.crypto.encode(i,o),c=await this.core.history.get(i,n),l=ai[c.request.method]?ai[c.request.method].res:ai.unregistered_method.res;await this.core.relayer.publish(i,a,l),await this.core.history.resolve(o)},this.deletePairing=async(n,i)=>{await this.core.relayer.unsubscribe(n),await Promise.all([this.pairings.delete(n,ot("USER_DISCONNECTED")),this.core.crypto.deleteSymKey(n),i?Promise.resolve():this.core.expirer.del(n)])},this.cleanup=async()=>{const n=this.pairings.getAll().filter(i=>mr(i.expiry));await Promise.all(n.map(i=>this.deletePairing(i.topic)))},this.onRelayEventRequest=n=>{const{topic:i,payload:s}=n,o=s.method;if(this.pairings.keys.includes(i))switch(o){case"wc_pairingPing":return this.onPairingPingRequest(i,s);case"wc_pairingDelete":return this.onPairingDeleteRequest(i,s);default:return this.onUnknownRpcMethodRequest(i,s)}},this.onRelayEventResponse=async n=>{const{topic:i,payload:s}=n,o=(await this.core.history.get(i,s.id)).request.method;if(this.pairings.keys.includes(i))switch(o){case"wc_pairingPing":return this.onPairingPingResponse(i,s);default:return this.onUnknownRpcMethodResponse(o)}},this.onPairingPingRequest=async(n,i)=>{const{id:s}=i;try{this.isValidPing({topic:n}),await this.sendResult(s,n,!0),this.events.emit("pairing_ping",{id:s,topic:n})}catch(o){await this.sendError(s,n,o),this.logger.error(o)}},this.onPairingPingResponse=(n,i)=>{const{id:s}=i;setTimeout(()=>{ur(i)?this.events.emit(et("pairing_ping",s),{}):Zt(i)&&this.events.emit(et("pairing_ping",s),{error:i.error})},500)},this.onPairingDeleteRequest=async(n,i)=>{const{id:s}=i;try{this.isValidDisconnect({topic:n}),await this.sendResult(s,n,!0),await this.deletePairing(n),this.events.emit("pairing_delete",{id:s,topic:n})}catch(o){await this.sendError(s,n,o),this.logger.error(o)}},this.onUnknownRpcMethodRequest=async(n,i)=>{const{id:s,method:o}=i;try{if(this.registeredMethods.includes(o))return;const a=ot("WC_METHOD_UNSUPPORTED",o);await this.sendError(s,n,a),this.logger.error(a)}catch(a){await this.sendError(s,n,a),this.logger.error(a)}},this.onUnknownRpcMethodResponse=n=>{this.registeredMethods.includes(n)||this.logger.error(ot("WC_METHOD_UNSUPPORTED",n))},this.isValidPair=n=>{if(!Rt(n)){const{message:i}=se("MISSING_OR_INVALID",`pair() params: ${n}`);throw new Error(i)}if(!zg(n.uri)){const{message:i}=se("MISSING_OR_INVALID",`pair() uri: ${n.uri}`);throw new Error(i)}},this.isValidPing=async n=>{if(!Rt(n)){const{message:s}=se("MISSING_OR_INVALID",`ping() params: ${n}`);throw new Error(s)}const{topic:i}=n;await this.isValidPairingTopic(i)},this.isValidDisconnect=async n=>{if(!Rt(n)){const{message:s}=se("MISSING_OR_INVALID",`disconnect() params: ${n}`);throw new Error(s)}const{topic:i}=n;await this.isValidPairingTopic(i)},this.isValidPairingTopic=async n=>{if(!ht(n,!1)){const{message:i}=se("MISSING_OR_INVALID",`pairing topic should be a string: ${n}`);throw new Error(i)}if(!this.pairings.keys.includes(n)){const{message:i}=se("NO_MATCHING_KEY",`pairing topic doesn't exist: ${n}`);throw new Error(i)}if(mr(this.pairings.get(n).expiry)){await this.deletePairing(n);const{message:i}=se("EXPIRED",`pairing topic: ${n}`);throw new Error(i)}},this.core=e,this.logger=je.generateChildLogger(r,this.name),this.pairings=new hs(this.core,this.logger,this.name,this.storagePrefix)}get context(){return je.getLoggerContext(this.logger)}isInitialized(){if(!this.initialized){const{message:e}=se("NOT_INITIALIZED",this.name);throw new Error(e)}}registerRelayerEvents(){this.core.relayer.on(It.message,async e=>{const{topic:r,message:n}=e;if(this.ignoredPayloadTypes.includes(this.core.crypto.getPayloadType(n)))return;const i=await this.core.crypto.decode(r,n);ia(i)?(this.core.history.set(r,i),this.onRelayEventRequest({topic:r,payload:i})):sa(i)&&(await this.core.history.resolve(i),this.onRelayEventResponse({topic:r,payload:i}))})}registerExpirerEvents(){this.core.expirer.on(Wt.expired,async e=>{const{topic:r}=ru(e.target);r&&this.pairings.keys.includes(r)&&(await this.deletePairing(r,!0),this.events.emit("pairing_expire",{topic:r}))})}}class by extends W3{constructor(e,r){super(e,r),this.core=e,this.logger=r,this.records=new Map,this.events=new _t.exports.EventEmitter,this.name=Yw,this.version=Zw,this.cached=[],this.initialized=!1,this.storagePrefix=yr,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(n=>this.records.set(n.id,n)),this.cached=[],this.registerEventListeners(),this.initialized=!0)},this.set=(n,i,s)=>{if(this.isInitialized(),this.logger.debug("Setting JSON-RPC request history record"),this.logger.trace({type:"method",method:"set",topic:n,request:i,chainId:s}),this.records.has(i.id))return;const o={id:i.id,topic:n,request:{method:i.method,params:i.params||null},chainId:s};this.records.set(o.id,o),this.events.emit(rr.created,o)},this.resolve=async n=>{if(this.isInitialized(),this.logger.debug("Updating JSON-RPC response history record"),this.logger.trace({type:"method",method:"update",response:n}),!this.records.has(n.id))return;const i=await this.getRecord(n.id);typeof i.response>"u"&&(i.response=Zt(n)?{error:n.error}:{result:n.result},this.records.set(i.id,i),this.events.emit(rr.updated,i))},this.get=async(n,i)=>(this.isInitialized(),this.logger.debug("Getting record"),this.logger.trace({type:"method",method:"get",topic:n,id:i}),await this.getRecord(i)),this.delete=(n,i)=>{this.isInitialized(),this.logger.debug("Deleting record"),this.logger.trace({type:"method",method:"delete",id:i}),this.values.forEach(s=>{if(s.topic===n){if(typeof i<"u"&&s.id!==i)return;this.records.delete(s.id),this.events.emit(rr.deleted,s)}})},this.exists=async(n,i)=>(this.isInitialized(),this.records.has(i)?(await this.getRecord(i)).topic===n:!1),this.on=(n,i)=>{this.events.on(n,i)},this.once=(n,i)=>{this.events.once(n,i)},this.off=(n,i)=>{this.events.off(n,i)},this.removeListener=(n,i)=>{this.events.removeListener(n,i)},this.logger=je.generateChildLogger(r,this.name)}get context(){return je.getLoggerContext(this.logger)}get storageKey(){return this.storagePrefix+this.version+"//"+this.name}get size(){return this.records.size}get keys(){return Array.from(this.records.keys())}get values(){return Array.from(this.records.values())}get pending(){const e=[];return this.values.forEach(r=>{if(typeof r.response<"u")return;const n={topic:r.topic,request:os(r.request.method,r.request.params,r.id),chainId:r.chainId};return e.push(n)}),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();const r=this.records.get(e);if(!r){const{message:n}=se("NO_MATCHING_KEY",`${this.name}: ${e}`);throw new Error(n)}return r}async persist(){await this.setJsonRpcRecords(this.values),this.events.emit(rr.sync)}async restore(){try{const e=await this.getJsonRpcRecords();if(typeof e>"u"||!e.length)return;if(this.records.size){const{message:r}=se("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(r),new Error(r)}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(rr.created,e=>{const r=rr.created;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,record:e}),this.persist()}),this.events.on(rr.updated,e=>{const r=rr.updated;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,record:e}),this.persist()}),this.events.on(rr.deleted,e=>{const r=rr.deleted;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,record:e}),this.persist()})}isInitialized(){if(!this.initialized){const{message:e}=se("NOT_INITIALIZED",this.name);throw new Error(e)}}}class vy extends Z3{constructor(e,r){super(e,r),this.core=e,this.logger=r,this.expirations=new Map,this.events=new _t.exports.EventEmitter,this.name=Jw,this.version=Xw,this.cached=[],this.initialized=!1,this.storagePrefix=yr,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(n=>this.expirations.set(n.target,n)),this.cached=[],this.registerEventListeners(),this.initialized=!0)},this.has=n=>{try{const i=this.formatTarget(n);return typeof this.getExpiration(i)<"u"}catch{return!1}},this.set=(n,i)=>{this.isInitialized();const s=this.formatTarget(n),o={target:s,expiry:i};this.expirations.set(s,o),this.checkExpiry(s,o),this.events.emit(Wt.created,{target:s,expiration:o})},this.get=n=>{this.isInitialized();const i=this.formatTarget(n);return this.getExpiration(i)},this.del=n=>{if(this.isInitialized(),this.has(n)){const i=this.formatTarget(n),s=this.getExpiration(i);this.expirations.delete(i),this.events.emit(Wt.deleted,{target:i,expiration:s})}},this.on=(n,i)=>{this.events.on(n,i)},this.once=(n,i)=>{this.events.once(n,i)},this.off=(n,i)=>{this.events.off(n,i)},this.removeListener=(n,i)=>{this.events.removeListener(n,i)},this.logger=je.generateChildLogger(r,this.name)}get context(){return je.getLoggerContext(this.logger)}get storageKey(){return this.storagePrefix+this.version+"//"+this.name}get length(){return this.expirations.size}get keys(){return Array.from(this.expirations.keys())}get values(){return Array.from(this.expirations.values())}formatTarget(e){if(typeof e=="string")return Cg(e);if(typeof e=="number")return Sg(e);const{message:r}=se("UNKNOWN_TYPE",`Target type: ${typeof e}`);throw new Error(r)}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(Wt.sync)}async restore(){try{const e=await this.getExpirations();if(typeof e>"u"||!e.length)return;if(this.expirations.size){const{message:r}=se("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(r),new Error(r)}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){const r=this.expirations.get(e);if(!r){const{message:n}=se("NO_MATCHING_KEY",`${this.name}: ${e}`);throw this.logger.error(n),new Error(n)}return r}checkExpiry(e,r){const{expiry:n}=r;me.toMiliseconds(n)-Date.now()<=0&&this.expire(e,r)}expire(e,r){this.expirations.delete(e),this.events.emit(Wt.expired,{target:e,expiration:r})}checkExpirations(){this.core.relayer.connected&&this.expirations.forEach((e,r)=>this.checkExpiry(r,e))}registerEventListeners(){this.core.heartbeat.on(Jn.HEARTBEAT_EVENTS.pulse,()=>this.checkExpirations()),this.events.on(Wt.created,e=>{const r=Wt.created;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),this.persist()}),this.events.on(Wt.expired,e=>{const r=Wt.expired;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),this.persist()}),this.events.on(Wt.deleted,e=>{const r=Wt.deleted;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),this.persist()})}isInitialized(){if(!this.initialized){const{message:e}=se("NOT_INITIALIZED",this.name);throw new Error(e)}}}var _y=Object.defineProperty,Dh=Object.getOwnPropertySymbols,Ey=Object.prototype.hasOwnProperty,xy=Object.prototype.propertyIsEnumerable,Oh=(t,e,r)=>e in t?_y(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Ah=(t,e)=>{for(var r in e||(e={}))Ey.call(e,r)&&Oh(t,r,e[r]);if(Dh)for(var r of Dh(e))xy.call(e,r)&&Oh(t,r,e[r]);return t};class da extends z3{constructor(e){super(e),this.protocol=gh,this.version=Ow,this.name=ua,this.events=new _t.exports.EventEmitter,this.initialized=!1,this.on=(n,i)=>this.events.on(n,i),this.once=(n,i)=>this.events.once(n,i),this.off=(n,i)=>this.events.off(n,i),this.removeListener=(n,i)=>this.events.removeListener(n,i),this.projectId=e?.projectId,this.relayUrl=e?.relayUrl||yh;const r=typeof e?.logger<"u"&&typeof e?.logger!="string"?e.logger:zn(je.getDefaultLoggerOptions({level:e?.logger||Aw.logger}));this.logger=je.generateChildLogger(r,this.name),this.heartbeat=new Jn.HeartBeat,this.crypto=new ey(this,this.logger,e?.keychain),this.history=new by(this,this.logger),this.expirer=new vy(this,this.logger),this.storage=e!=null&&e.storage?e.storage:new Y2(Ah(Ah({},$w),e?.storageOptions)),this.relayer=new py({core:this,logger:this.logger,relayUrl:this.relayUrl,projectId:this.projectId}),this.pairing=new yy(this,this.logger)}static async init(e){const r=new da(e);return await r.initialize(),r}get context(){return je.getLoggerContext(this.logger)}async start(){this.initialized||await this.initialize()}async initialize(){this.logger.trace("Initialized");try{await this.crypto.init(),await this.history.init(),await this.expirer.init(),await this.relayer.init(),await this.heartbeat.init(),await this.pairing.init(),this.initialized=!0,this.logger.info("Core Initialization Success")}catch(e){throw this.logger.warn(`Core Initialization Failure at epoch ${Date.now()}`,e),this.logger.error(e.message),e}}}const Cy=da,$h="wc",Ph=2,Th="client",fa=`${$h}@${Ph}:${Th}:`,pa={name:Th,logger:"error",controller:!1,relayUrl:"wss://relay.walletconnect.com"},Sy="proposal",Iy="session",ds=me.SEVEN_DAYS,Dy="engine",ci={wc_sessionPropose:{req:{ttl:me.FIVE_MINUTES,prompt:!0,tag:1100},res:{ttl:me.FIVE_MINUTES,prompt:!1,tag:1101}},wc_sessionSettle:{req:{ttl:me.FIVE_MINUTES,prompt:!1,tag:1102},res:{ttl:me.FIVE_MINUTES,prompt:!1,tag:1103}},wc_sessionUpdate:{req:{ttl:me.ONE_DAY,prompt:!1,tag:1104},res:{ttl:me.ONE_DAY,prompt:!1,tag:1105}},wc_sessionExtend:{req:{ttl:me.ONE_DAY,prompt:!1,tag:1106},res:{ttl:me.ONE_DAY,prompt:!1,tag:1107}},wc_sessionRequest:{req:{ttl:me.FIVE_MINUTES,prompt:!0,tag:1108},res:{ttl:me.FIVE_MINUTES,prompt:!1,tag:1109}},wc_sessionEvent:{req:{ttl:me.FIVE_MINUTES,prompt:!0,tag:1110},res:{ttl:me.FIVE_MINUTES,prompt:!1,tag:1111}},wc_sessionDelete:{req:{ttl:me.ONE_DAY,prompt:!1,tag:1112},res:{ttl:me.ONE_DAY,prompt:!1,tag:1113}},wc_sessionPing:{req:{ttl:me.THIRTY_SECONDS,prompt:!1,tag:1114},res:{ttl:me.THIRTY_SECONDS,prompt:!1,tag:1115}}},ga={min:me.FIVE_MINUTES,max:me.SEVEN_DAYS},Oy="request";var Ay=Object.defineProperty,$y=Object.defineProperties,Py=Object.getOwnPropertyDescriptors,Nh=Object.getOwnPropertySymbols,Ty=Object.prototype.hasOwnProperty,Ny=Object.prototype.propertyIsEnumerable,Rh=(t,e,r)=>e in t?Ay(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,qt=(t,e)=>{for(var r in e||(e={}))Ty.call(e,r)&&Rh(t,r,e[r]);if(Nh)for(var r of Nh(e))Ny.call(e,r)&&Rh(t,r,e[r]);return t},ma=(t,e)=>$y(t,Py(e));class Ry extends X3{constructor(e){super(e),this.name=Dy,this.events=new _t.exports,this.initialized=!1,this.ignoredPayloadTypes=[Rr],this.init=async()=>{this.initialized||(await this.cleanup(),this.registerRelayerEvents(),this.registerExpirerEvents(),this.client.core.pairing.register({methods:Object.keys(ci)}),this.initialized=!0)},this.connect=async r=>{this.isInitialized();const n=ma(qt({},r),{requiredNamespaces:r.requiredNamespaces||{},optionalNamespaces:r.optionalNamespaces||{}});await this.isValidConnect(n);const{pairingTopic:i,requiredNamespaces:s,optionalNamespaces:o,sessionProperties:a,relays:c}=n;let l=i,p,w=!1;if(l&&(w=this.client.core.pairing.pairings.get(l).active),!l||!w){const{topic:D,uri:b}=await this.client.core.pairing.create();l=D,p=b}const y=await this.client.core.crypto.generateKeyPair(),m=qt({requiredNamespaces:s,optionalNamespaces:o,relays:c??[{protocol:wh}],proposer:{publicKey:y,metadata:this.client.metadata}},a&&{sessionProperties:a}),{reject:E,resolve:A,done:N}=Lr();if(this.events.once(et("session_connect"),async({error:D,session:b})=>{if(D)E(D);else if(b){b.self.publicKey=y;const I=ma(qt({},b),{requiredNamespaces:b.requiredNamespaces,optionalNamespaces:b.optionalNamespaces});await this.client.session.set(b.topic,I),await this.setExpiry(b.topic,b.expiry),l&&await this.client.core.pairing.updateMetadata({topic:l,metadata:b.peer.metadata}),A(I)}}),!l){const{message:D}=se("NO_MATCHING_KEY",`connect() pairing topic: ${l}`);throw new Error(D)}const M=await this.sendRequest(l,"wc_sessionPropose",m),x=Qt(me.FIVE_MINUTES);return await this.setProposal(M,qt({id:M,expiry:x},m)),{uri:p,approval:N}},this.pair=async r=>(this.isInitialized(),await this.client.core.pairing.pair(r)),this.approve=async r=>{this.isInitialized(),await this.isValidApprove(r);const{id:n,relayProtocol:i,namespaces:s,sessionProperties:o}=r,a=this.client.proposal.get(n);let{pairingTopic:c,proposer:l,requiredNamespaces:p,optionalNamespaces:w}=a;Hn(p)||(p=Fg(s,"approve()"));const y=await this.client.core.crypto.generateKeyPair(),m=l.publicKey,E=await this.client.core.crypto.generateSharedKey(y,m);c&&n&&(await this.client.core.pairing.updateMetadata({topic:c,metadata:l.metadata}),await this.sendResult(n,c,{relay:{protocol:i??"irn"},responderPublicKey:y}),await this.client.proposal.delete(n,ot("USER_DISCONNECTED")),await this.client.core.pairing.activate({topic:c}));const A=qt({relay:{protocol:i??"irn"},namespaces:s,requiredNamespaces:p,optionalNamespaces:w,controller:{publicKey:y,metadata:this.client.metadata},expiry:Qt(ds)},o&&{sessionProperties:o});await this.client.core.relayer.subscribe(E);const N=await this.sendRequest(E,"wc_sessionSettle",A),{done:M,resolve:x,reject:D}=Lr();this.events.once(et("session_approve",N),({error:I})=>{I?D(I):x(this.client.session.get(E))});const b=ma(qt({},A),{topic:E,acknowledged:!1,self:A.controller,peer:{publicKey:l.publicKey,metadata:l.metadata},controller:y});return await this.client.session.set(E,b),await this.setExpiry(E,Qt(ds)),{topic:E,acknowledged:M}},this.reject=async r=>{this.isInitialized(),await this.isValidReject(r);const{id:n,reason:i}=r,{pairingTopic:s}=this.client.proposal.get(n);s&&(await this.sendError(n,s,i),await this.client.proposal.delete(n,ot("USER_DISCONNECTED")))},this.update=async r=>{this.isInitialized(),await this.isValidUpdate(r);const{topic:n,namespaces:i}=r,s=await this.sendRequest(n,"wc_sessionUpdate",{namespaces:i}),{done:o,resolve:a,reject:c}=Lr();return this.events.once(et("session_update",s),({error:l})=>{l?c(l):a()}),await this.client.session.update(n,{namespaces:i}),{acknowledged:o}},this.extend=async r=>{this.isInitialized(),await this.isValidExtend(r);const{topic:n}=r,i=await this.sendRequest(n,"wc_sessionExtend",{}),{done:s,resolve:o,reject:a}=Lr();return this.events.once(et("session_extend",i),({error:c})=>{c?a(c):o()}),await this.setExpiry(n,Qt(ds)),{acknowledged:s}},this.request=async r=>{this.isInitialized(),await this.isValidRequest(r);const{chainId:n,request:i,topic:s,expiry:o}=r,a=await this.sendRequest(s,"wc_sessionRequest",{request:i,chainId:n},o),{done:c,resolve:l,reject:p}=Lr(o);return this.events.once(et("session_request",a),({error:w,result:y})=>{w?p(w):l(y)}),this.client.events.emit("session_request_sent",{topic:s,request:i,chainId:n}),await c()},this.respond=async r=>{this.isInitialized(),await this.isValidRespond(r);const{topic:n,response:i}=r,{id:s}=i;ur(i)?await this.sendResult(s,n,i.result):Zt(i)&&await this.sendError(s,n,i.error),this.deletePendingSessionRequest(r.response.id,{message:"fulfilled",code:0})},this.ping=async r=>{this.isInitialized(),await this.isValidPing(r);const{topic:n}=r;if(this.client.session.keys.includes(n)){const i=await this.sendRequest(n,"wc_sessionPing",{}),{done:s,resolve:o,reject:a}=Lr();this.events.once(et("session_ping",i),({error:c})=>{c?a(c):o()}),await s()}else this.client.core.pairing.pairings.keys.includes(n)&&await this.client.core.pairing.ping({topic:n})},this.emit=async r=>{this.isInitialized(),await this.isValidEmit(r);const{topic:n,event:i,chainId:s}=r;await this.sendRequest(n,"wc_sessionEvent",{event:i,chainId:s})},this.disconnect=async r=>{this.isInitialized(),await this.isValidDisconnect(r);const{topic:n}=r;this.client.session.keys.includes(n)?(await this.sendRequest(n,"wc_sessionDelete",ot("USER_DISCONNECTED")),await this.deleteSession(n)):await this.client.core.pairing.disconnect({topic:n})},this.find=r=>(this.isInitialized(),this.client.session.getAll().filter(n=>kg(n,r))),this.getPendingSessionRequests=()=>(this.isInitialized(),this.client.pendingRequest.getAll()),this.deleteSession=async(r,n)=>{const{self:i}=this.client.session.get(r);await this.client.core.relayer.unsubscribe(r),await Promise.all([this.client.session.delete(r,ot("USER_DISCONNECTED")),this.client.core.crypto.deleteKeyPair(i.publicKey),this.client.core.crypto.deleteSymKey(r),n?Promise.resolve():this.client.core.expirer.del(r)])},this.deleteProposal=async(r,n)=>{await Promise.all([this.client.proposal.delete(r,ot("USER_DISCONNECTED")),n?Promise.resolve():this.client.core.expirer.del(r)])},this.deletePendingSessionRequest=async(r,n,i=!1)=>{await Promise.all([this.client.pendingRequest.delete(r,n),i?Promise.resolve():this.client.core.expirer.del(r)])},this.setExpiry=async(r,n)=>{this.client.session.keys.includes(r)&&await this.client.session.update(r,{expiry:n}),this.client.core.expirer.set(r,n)},this.setProposal=async(r,n)=>{await this.client.proposal.set(r,n),this.client.core.expirer.set(r,n.expiry)},this.setPendingSessionRequest=async r=>{const n=ci.wc_sessionRequest.req.ttl,{id:i,topic:s,params:o}=r;await this.client.pendingRequest.set(i,{id:i,topic:s,params:o}),n&&this.client.core.expirer.set(i,Qt(n))},this.sendRequest=async(r,n,i,s)=>{const o=os(n,i),a=await this.client.core.crypto.encode(r,o),c=ci[n].req;return s&&(c.ttl=s),this.client.core.history.set(r,o),this.client.core.relayer.publish(r,a,c),o.id},this.sendResult=async(r,n,i)=>{const s=na(r,i),o=await this.client.core.crypto.encode(n,s),a=await this.client.core.history.get(n,r),c=ci[a.request.method].res;this.client.core.relayer.publish(n,o,c),await this.client.core.history.resolve(s)},this.sendError=async(r,n,i)=>{const s=as(r,i),o=await this.client.core.crypto.encode(n,s),a=await this.client.core.history.get(n,r),c=ci[a.request.method].res;this.client.core.relayer.publish(n,o,c),await this.client.core.history.resolve(s)},this.cleanup=async()=>{const r=[],n=[];this.client.session.getAll().forEach(i=>{mr(i.expiry)&&r.push(i.topic)}),this.client.proposal.getAll().forEach(i=>{mr(i.expiry)&&n.push(i.id)}),await Promise.all([...r.map(i=>this.deleteSession(i)),...n.map(i=>this.deleteProposal(i))])},this.onRelayEventRequest=r=>{const{topic:n,payload:i}=r,s=i.method;switch(s){case"wc_sessionPropose":return this.onSessionProposeRequest(n,i);case"wc_sessionSettle":return this.onSessionSettleRequest(n,i);case"wc_sessionUpdate":return this.onSessionUpdateRequest(n,i);case"wc_sessionExtend":return this.onSessionExtendRequest(n,i);case"wc_sessionPing":return this.onSessionPingRequest(n,i);case"wc_sessionDelete":return this.onSessionDeleteRequest(n,i);case"wc_sessionRequest":return this.onSessionRequest(n,i);case"wc_sessionEvent":return this.onSessionEventRequest(n,i);default:return this.client.logger.info(`Unsupported request method ${s}`)}},this.onRelayEventResponse=async r=>{const{topic:n,payload:i}=r,s=(await this.client.core.history.get(n,i.id)).request.method;switch(s){case"wc_sessionPropose":return this.onSessionProposeResponse(n,i);case"wc_sessionSettle":return this.onSessionSettleResponse(n,i);case"wc_sessionUpdate":return this.onSessionUpdateResponse(n,i);case"wc_sessionExtend":return this.onSessionExtendResponse(n,i);case"wc_sessionPing":return this.onSessionPingResponse(n,i);case"wc_sessionRequest":return this.onSessionRequestResponse(n,i);default:return this.client.logger.info(`Unsupported response method ${s}`)}},this.onSessionProposeRequest=async(r,n)=>{const{params:i,id:s}=n;try{this.isValidConnect(qt({},n.params));const o=Qt(me.FIVE_MINUTES),a=qt({id:s,pairingTopic:r,expiry:o},i);await this.setProposal(s,a),this.client.events.emit("session_proposal",{id:s,params:a})}catch(o){await this.sendError(s,r,o),this.client.logger.error(o)}},this.onSessionProposeResponse=async(r,n)=>{const{id:i}=n;if(ur(n)){const{result:s}=n;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",result:s});const o=this.client.proposal.get(i);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",proposal:o});const a=o.proposer.publicKey;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",selfPublicKey:a});const c=s.responderPublicKey;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",peerPublicKey:c});const l=await this.client.core.crypto.generateSharedKey(a,c);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",sessionTopic:l});const p=await this.client.core.relayer.subscribe(l);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",subscriptionId:p}),await this.client.core.pairing.activate({topic:r})}else Zt(n)&&(await this.client.proposal.delete(i,ot("USER_DISCONNECTED")),this.events.emit(et("session_connect"),{error:n.error}))},this.onSessionSettleRequest=async(r,n)=>{const{id:i,params:s}=n;try{this.isValidSessionSettleRequest(s);const{relay:o,controller:a,expiry:c,namespaces:l,requiredNamespaces:p,optionalNamespaces:w,sessionProperties:y}=n.params,m=qt({topic:r,relay:o,expiry:c,namespaces:l,acknowledged:!0,requiredNamespaces:p,optionalNamespaces:w,controller:a.publicKey,self:{publicKey:"",metadata:this.client.metadata},peer:{publicKey:a.publicKey,metadata:a.metadata}},y&&{sessionProperties:y});await this.sendResult(n.id,r,!0),this.events.emit(et("session_connect"),{session:m})}catch(o){await this.sendError(i,r,o),this.client.logger.error(o)}},this.onSessionSettleResponse=async(r,n)=>{const{id:i}=n;ur(n)?(await this.client.session.update(r,{acknowledged:!0}),this.events.emit(et("session_approve",i),{})):Zt(n)&&(await this.client.session.delete(r,ot("USER_DISCONNECTED")),this.events.emit(et("session_approve",i),{error:n.error}))},this.onSessionUpdateRequest=async(r,n)=>{const{params:i,id:s}=n;try{this.isValidUpdate(qt({topic:r},i)),await this.client.session.update(r,{namespaces:i.namespaces}),await this.sendResult(s,r,!0),this.client.events.emit("session_update",{id:s,topic:r,params:i})}catch(o){await this.sendError(s,r,o),this.client.logger.error(o)}},this.onSessionUpdateResponse=(r,n)=>{const{id:i}=n;ur(n)?this.events.emit(et("session_update",i),{}):Zt(n)&&this.events.emit(et("session_update",i),{error:n.error})},this.onSessionExtendRequest=async(r,n)=>{const{id:i}=n;try{this.isValidExtend({topic:r}),await this.setExpiry(r,Qt(ds)),await this.sendResult(i,r,!0),this.client.events.emit("session_extend",{id:i,topic:r})}catch(s){await this.sendError(i,r,s),this.client.logger.error(s)}},this.onSessionExtendResponse=(r,n)=>{const{id:i}=n;ur(n)?this.events.emit(et("session_extend",i),{}):Zt(n)&&this.events.emit(et("session_extend",i),{error:n.error})},this.onSessionPingRequest=async(r,n)=>{const{id:i}=n;try{this.isValidPing({topic:r}),await this.sendResult(i,r,!0),this.client.events.emit("session_ping",{id:i,topic:r})}catch(s){await this.sendError(i,r,s),this.client.logger.error(s)}},this.onSessionPingResponse=(r,n)=>{const{id:i}=n;setTimeout(()=>{ur(n)?this.events.emit(et("session_ping",i),{}):Zt(n)&&this.events.emit(et("session_ping",i),{error:n.error})},500)},this.onSessionDeleteRequest=async(r,n)=>{const{id:i}=n;try{this.isValidDisconnect({topic:r,reason:n.params}),this.client.core.relayer.once(It.publish,async()=>{await this.deleteSession(r)}),await this.sendResult(i,r,!0),this.client.events.emit("session_delete",{id:i,topic:r})}catch(s){await this.sendError(i,r,s),this.client.logger.error(s)}},this.onSessionRequest=async(r,n)=>{const{id:i,params:s}=n;try{this.isValidRequest(qt({topic:r},s)),await this.setPendingSessionRequest({id:i,topic:r,params:s}),this.client.events.emit("session_request",{id:i,topic:r,params:s})}catch(o){await this.sendError(i,r,o),this.client.logger.error(o)}},this.onSessionRequestResponse=(r,n)=>{const{id:i}=n;ur(n)?this.events.emit(et("session_request",i),{result:n.result}):Zt(n)&&this.events.emit(et("session_request",i),{error:n.error})},this.onSessionEventRequest=async(r,n)=>{const{id:i,params:s}=n;try{this.isValidEmit(qt({topic:r},s)),this.client.events.emit("session_event",{id:i,topic:r,params:s})}catch(o){await this.sendError(i,r,o),this.client.logger.error(o)}},this.isValidConnect=async r=>{if(!Rt(r)){const{message:c}=se("MISSING_OR_INVALID",`connect() params: ${JSON.stringify(r)}`);throw new Error(c)}const{pairingTopic:n,requiredNamespaces:i,optionalNamespaces:s,sessionProperties:o,relays:a}=r;if(Ot(n)||await this.isValidPairingTopic(n),!Qg(a,!0)){const{message:c}=se("MISSING_OR_INVALID",`connect() relays: ${a}`);throw new Error(c)}!Ot(i)&&Hn(i)!==0&&this.validateNamespaces(i,"requiredNamespaces"),!Ot(s)&&Hn(s)!==0&&this.validateNamespaces(s,"optionalNamespaces"),Ot(o)||this.validateSessionProps(o,"sessionProperties")},this.validateNamespaces=(r,n)=>{const i=Xg(r,"connect()",n);if(i)throw new Error(i.message)},this.isValidApprove=async r=>{if(!Rt(r))throw new Error(se("MISSING_OR_INVALID",`approve() params: ${r}`).message);const{id:n,namespaces:i,relayProtocol:s,sessionProperties:o}=r;await this.isValidProposalId(n);const a=this.client.proposal.get(n),c=es(i,"approve()");if(c)throw new Error(c.message);const l=Mo(a.requiredNamespaces,i,"approve()","requiredNamespaces");if(l)throw new Error(l.message);if(!ht(s,!0)){const{message:p}=se("MISSING_OR_INVALID",`approve() relayProtocol: ${s}`);throw new Error(p)}if(Object.keys(i).length>Object.keys(a.requiredNamespaces).length){const p=Object.keys(a.optionalNamespaces).filter(m=>i[m]),w={};for(const m in a.optionalNamespaces)p.includes(m)&&(w[m]=a.optionalNamespaces[m]);const y=Mo(w,i,"approve()","optionalNamespaces");if(y)throw new Error(y.message)}Ot(o)||this.validateSessionProps(o,"sessionProperties")},this.isValidReject=async r=>{if(!Rt(r)){const{message:s}=se("MISSING_OR_INVALID",`reject() params: ${r}`);throw new Error(s)}const{id:n,reason:i}=r;if(await this.isValidProposalId(n),!t2(i)){const{message:s}=se("MISSING_OR_INVALID",`reject() reason: ${JSON.stringify(i)}`);throw new Error(s)}},this.isValidSessionSettleRequest=r=>{if(!Rt(r)){const{message:l}=se("MISSING_OR_INVALID",`onSessionSettleRequest() params: ${r}`);throw new Error(l)}const{relay:n,controller:i,namespaces:s,expiry:o}=r;if(!au(n)){const{message:l}=se("MISSING_OR_INVALID","onSessionSettleRequest() relay protocol should be a string");throw new Error(l)}const a=Vg(i,"onSessionSettleRequest()");if(a)throw new Error(a.message);const c=es(s,"onSessionSettleRequest()");if(c)throw new Error(c.message);if(mr(o)){const{message:l}=se("EXPIRED","onSessionSettleRequest()");throw new Error(l)}},this.isValidUpdate=async r=>{if(!Rt(r)){const{message:c}=se("MISSING_OR_INVALID",`update() params: ${r}`);throw new Error(c)}const{topic:n,namespaces:i}=r;await this.isValidSessionTopic(n);const s=this.client.session.get(n),o=es(i,"update()");if(o)throw new Error(o.message);const a=Mo(s.requiredNamespaces,i,"update()","requiredNamespaces");if(a)throw new Error(a.message)},this.isValidExtend=async r=>{if(!Rt(r)){const{message:i}=se("MISSING_OR_INVALID",`extend() params: ${r}`);throw new Error(i)}const{topic:n}=r;await this.isValidSessionTopic(n)},this.isValidRequest=async r=>{if(!Rt(r)){const{message:c}=se("MISSING_OR_INVALID",`request() params: ${r}`);throw new Error(c)}const{topic:n,request:i,chainId:s,expiry:o}=r;await this.isValidSessionTopic(n);const{namespaces:a}=this.client.session.get(n);if(!cu(a,s)){const{message:c}=se("MISSING_OR_INVALID",`request() chainId: ${s}`);throw new Error(c)}if(!r2(i)){const{message:c}=se("MISSING_OR_INVALID",`request() ${JSON.stringify(i)}`);throw new Error(c)}if(!s2(a,s,i.method)){const{message:c}=se("MISSING_OR_INVALID",`request() method: ${i.method}`);throw new Error(c)}if(o&&!a2(o,ga)){const{message:c}=se("MISSING_OR_INVALID",`request() expiry: ${o}. Expiry must be a number (in seconds) between ${ga.min} and ${ga.max}`);throw new Error(c)}},this.isValidRespond=async r=>{if(!Rt(r)){const{message:s}=se("MISSING_OR_INVALID",`respond() params: ${r}`);throw new Error(s)}const{topic:n,response:i}=r;if(await this.isValidSessionTopic(n),!n2(i)){const{message:s}=se("MISSING_OR_INVALID",`respond() response: ${JSON.stringify(i)}`);throw new Error(s)}},this.isValidPing=async r=>{if(!Rt(r)){const{message:i}=se("MISSING_OR_INVALID",`ping() params: ${r}`);throw new Error(i)}const{topic:n}=r;await this.isValidSessionOrPairingTopic(n)},this.isValidEmit=async r=>{if(!Rt(r)){const{message:a}=se("MISSING_OR_INVALID",`emit() params: ${r}`);throw new Error(a)}const{topic:n,event:i,chainId:s}=r;await this.isValidSessionTopic(n);const{namespaces:o}=this.client.session.get(n);if(!cu(o,s)){const{message:a}=se("MISSING_OR_INVALID",`emit() chainId: ${s}`);throw new Error(a)}if(!i2(i)){const{message:a}=se("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(i)}`);throw new Error(a)}if(!o2(o,s,i.name)){const{message:a}=se("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(i)}`);throw new Error(a)}},this.isValidDisconnect=async r=>{if(!Rt(r)){const{message:i}=se("MISSING_OR_INVALID",`disconnect() params: ${r}`);throw new Error(i)}const{topic:n}=r;await this.isValidSessionOrPairingTopic(n)},this.validateSessionProps=(r,n)=>{Object.values(r).forEach(i=>{if(!ht(i,!1)){const{message:s}=se("MISSING_OR_INVALID",`${n} must be in Record<string, string> format. Received: ${JSON.stringify(i)}`);throw new Error(s)}})}}isInitialized(){if(!this.initialized){const{message:e}=se("NOT_INITIALIZED",this.name);throw new Error(e)}}registerRelayerEvents(){this.client.core.relayer.on(It.message,async e=>{const{topic:r,message:n}=e;if(this.ignoredPayloadTypes.includes(this.client.core.crypto.getPayloadType(n)))return;const i=await this.client.core.crypto.decode(r,n);ia(i)?(this.client.core.history.set(r,i),this.onRelayEventRequest({topic:r,payload:i})):sa(i)&&(await this.client.core.history.resolve(i),this.onRelayEventResponse({topic:r,payload:i}))})}registerExpirerEvents(){this.client.core.expirer.on(Wt.expired,async e=>{const{topic:r,id:n}=ru(e.target);if(n&&this.client.pendingRequest.keys.includes(n))return await this.deletePendingSessionRequest(n,se("EXPIRED"),!0);r?this.client.session.keys.includes(r)&&(await this.deleteSession(r,!0),this.client.events.emit("session_expire",{topic:r})):n&&(await this.deleteProposal(n,!0),this.client.events.emit("proposal_expire",{id:n}))})}isValidPairingTopic(e){if(!ht(e,!1)){const{message:r}=se("MISSING_OR_INVALID",`pairing topic should be a string: ${e}`);throw new Error(r)}if(!this.client.core.pairing.pairings.keys.includes(e)){const{message:r}=se("NO_MATCHING_KEY",`pairing topic doesn't exist: ${e}`);throw new Error(r)}if(mr(this.client.core.pairing.pairings.get(e).expiry)){const{message:r}=se("EXPIRED",`pairing topic: ${e}`);throw new Error(r)}}async isValidSessionTopic(e){if(!ht(e,!1)){const{message:r}=se("MISSING_OR_INVALID",`session topic should be a string: ${e}`);throw new Error(r)}if(!this.client.session.keys.includes(e)){const{message:r}=se("NO_MATCHING_KEY",`session topic doesn't exist: ${e}`);throw new Error(r)}if(mr(this.client.session.get(e).expiry)){await this.deleteSession(e);const{message:r}=se("EXPIRED",`session topic: ${e}`);throw new Error(r)}}async isValidSessionOrPairingTopic(e){if(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(ht(e,!1)){const{message:r}=se("NO_MATCHING_KEY",`session or pairing topic doesn't exist: ${e}`);throw new Error(r)}else{const{message:r}=se("MISSING_OR_INVALID",`session or pairing topic should be a string: ${e}`);throw new Error(r)}}async isValidProposalId(e){if(!e2(e)){const{message:r}=se("MISSING_OR_INVALID",`proposal id should be a number: ${e}`);throw new Error(r)}if(!this.client.proposal.keys.includes(e)){const{message:r}=se("NO_MATCHING_KEY",`proposal id doesn't exist: ${e}`);throw new Error(r)}if(mr(this.client.proposal.get(e).expiry)){await this.deleteProposal(e);const{message:r}=se("EXPIRED",`proposal id: ${e}`);throw new Error(r)}}}class Ly extends hs{constructor(e,r){super(e,r,Sy,fa),this.core=e,this.logger=r}}class My extends hs{constructor(e,r){super(e,r,Iy,fa),this.core=e,this.logger=r}}class Uy extends hs{constructor(e,r){super(e,r,Oy,fa),this.core=e,this.logger=r}}class wa extends J3{constructor(e){super(e),this.protocol=$h,this.version=Ph,this.name=pa.name,this.events=new _t.exports.EventEmitter,this.on=(n,i)=>this.events.on(n,i),this.once=(n,i)=>this.events.once(n,i),this.off=(n,i)=>this.events.off(n,i),this.removeListener=(n,i)=>this.events.removeListener(n,i),this.removeAllListeners=n=>this.events.removeAllListeners(n),this.connect=async n=>{try{return await this.engine.connect(n)}catch(i){throw this.logger.error(i.message),i}},this.pair=async n=>{try{return await this.engine.pair(n)}catch(i){throw this.logger.error(i.message),i}},this.approve=async n=>{try{return await this.engine.approve(n)}catch(i){throw this.logger.error(i.message),i}},this.reject=async n=>{try{return await this.engine.reject(n)}catch(i){throw this.logger.error(i.message),i}},this.update=async n=>{try{return await this.engine.update(n)}catch(i){throw this.logger.error(i.message),i}},this.extend=async n=>{try{return await this.engine.extend(n)}catch(i){throw this.logger.error(i.message),i}},this.request=async n=>{try{return await this.engine.request(n)}catch(i){throw this.logger.error(i.message),i}},this.respond=async n=>{try{return await this.engine.respond(n)}catch(i){throw this.logger.error(i.message),i}},this.ping=async n=>{try{return await this.engine.ping(n)}catch(i){throw this.logger.error(i.message),i}},this.emit=async n=>{try{return await this.engine.emit(n)}catch(i){throw this.logger.error(i.message),i}},this.disconnect=async n=>{try{return await this.engine.disconnect(n)}catch(i){throw this.logger.error(i.message),i}},this.find=n=>{try{return this.engine.find(n)}catch(i){throw this.logger.error(i.message),i}},this.getPendingSessionRequests=()=>{try{return this.engine.getPendingSessionRequests()}catch(n){throw this.logger.error(n.message),n}},this.name=e?.name||pa.name,this.metadata=e?.metadata||bg();const r=typeof e?.logger<"u"&&typeof e?.logger!="string"?e.logger:zn(je.getDefaultLoggerOptions({level:e?.logger||pa.logger}));this.core=e?.core||new Cy(e),this.logger=je.generateChildLogger(r,this.name),this.session=new My(this.core,this.logger),this.proposal=new Ly(this.core,this.logger),this.pendingRequest=new Uy(this.core,this.logger),this.engine=new Ry(this)}static async init(e){const r=new wa(e);return await r.initialize(),r}get context(){return je.getLoggerContext(this.logger)}get pairing(){return this.core.pairing.pairings}async initialize(){this.logger.trace("Initialized");try{await this.core.start(),await this.session.init(),await this.proposal.init(),await this.pendingRequest.init(),await this.engine.init(),this.logger.info("SignClient Initialization Success")}catch(e){throw this.logger.info("SignClient Initialization Failure"),this.logger.error(e.message),e}}}var ya={exports:{}};(function(t,e){var r=typeof self<"u"?self:ut,n=function(){function s(){this.fetch=!1,this.DOMException=r.DOMException}return s.prototype=r,new s}();(function(s){(function(o){var a={searchParams:"URLSearchParams"in s,iterable:"Symbol"in s&&"iterator"in Symbol,blob:"FileReader"in s&&"Blob"in s&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in s,arrayBuffer:"ArrayBuffer"in s};function c(C){return C&&DataView.prototype.isPrototypeOf(C)}if(a.arrayBuffer)var l=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],p=ArrayBuffer.isView||function(C){return C&&l.indexOf(Object.prototype.toString.call(C))>-1};function w(C){if(typeof C!="string"&&(C=String(C)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(C))throw new TypeError("Invalid character in header field name");return C.toLowerCase()}function y(C){return typeof C!="string"&&(C=String(C)),C}function m(C){var $={next:function(){var G=C.shift();return{done:G===void 0,value:G}}};return a.iterable&&($[Symbol.iterator]=function(){return $}),$}function E(C){this.map={},C instanceof E?C.forEach(function($,G){this.append(G,$)},this):Array.isArray(C)?C.forEach(function($){this.append($[0],$[1])},this):C&&Object.getOwnPropertyNames(C).forEach(function($){this.append($,C[$])},this)}E.prototype.append=function(C,$){C=w(C),$=y($);var G=this.map[C];this.map[C]=G?G+", "+$:$},E.prototype.delete=function(C){delete this.map[w(C)]},E.prototype.get=function(C){return C=w(C),this.has(C)?this.map[C]:null},E.prototype.has=function(C){return this.map.hasOwnProperty(w(C))},E.prototype.set=function(C,$){this.map[w(C)]=y($)},E.prototype.forEach=function(C,$){for(var G in this.map)this.map.hasOwnProperty(G)&&C.call($,this.map[G],G,this)},E.prototype.keys=function(){var C=[];return this.forEach(function($,G){C.push(G)}),m(C)},E.prototype.values=function(){var C=[];return this.forEach(function($){C.push($)}),m(C)},E.prototype.entries=function(){var C=[];return this.forEach(function($,G){C.push([G,$])}),m(C)},a.iterable&&(E.prototype[Symbol.iterator]=E.prototype.entries);function A(C){if(C.bodyUsed)return Promise.reject(new TypeError("Already read"));C.bodyUsed=!0}function N(C){return new Promise(function($,G){C.onload=function(){$(C.result)},C.onerror=function(){G(C.error)}})}function M(C){var $=new FileReader,G=N($);return $.readAsArrayBuffer(C),G}function x(C){var $=new FileReader,G=N($);return $.readAsText(C),G}function D(C){for(var $=new Uint8Array(C),G=new Array($.length),K=0;K<$.length;K++)G[K]=String.fromCharCode($[K]);return G.join("")}function b(C){if(C.slice)return C.slice(0);var $=new Uint8Array(C.byteLength);return $.set(new Uint8Array(C)),$.buffer}function I(){return this.bodyUsed=!1,this._initBody=function(C){this._bodyInit=C,C?typeof C=="string"?this._bodyText=C:a.blob&&Blob.prototype.isPrototypeOf(C)?this._bodyBlob=C:a.formData&&FormData.prototype.isPrototypeOf(C)?this._bodyFormData=C:a.searchParams&&URLSearchParams.prototype.isPrototypeOf(C)?this._bodyText=C.toString():a.arrayBuffer&&a.blob&&c(C)?(this._bodyArrayBuffer=b(C.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):a.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(C)||p(C))?this._bodyArrayBuffer=b(C):this._bodyText=C=Object.prototype.toString.call(C):this._bodyText="",this.headers.get("content-type")||(typeof C=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):a.searchParams&&URLSearchParams.prototype.isPrototypeOf(C)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},a.blob&&(this.blob=function(){var C=A(this);if(C)return C;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?A(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(M)}),this.text=function(){var C=A(this);if(C)return C;if(this._bodyBlob)return x(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(D(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},a.formData&&(this.formData=function(){return this.text().then(H)}),this.json=function(){return this.text().then(JSON.parse)},this}var O=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function h(C){var $=C.toUpperCase();return O.indexOf($)>-1?$:C}function _(C,$){$=$||{};var G=$.body;if(C instanceof _){if(C.bodyUsed)throw new TypeError("Already read");this.url=C.url,this.credentials=C.credentials,$.headers||(this.headers=new E(C.headers)),this.method=C.method,this.mode=C.mode,this.signal=C.signal,!G&&C._bodyInit!=null&&(G=C._bodyInit,C.bodyUsed=!0)}else this.url=String(C);if(this.credentials=$.credentials||this.credentials||"same-origin",($.headers||!this.headers)&&(this.headers=new E($.headers)),this.method=h($.method||this.method||"GET"),this.mode=$.mode||this.mode||null,this.signal=$.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&G)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(G)}_.prototype.clone=function(){return new _(this,{body:this._bodyInit})};function H(C){var $=new FormData;return C.trim().split("&").forEach(function(G){if(G){var K=G.split("="),W=K.shift().replace(/\+/g," "),z=K.join("=").replace(/\+/g," ");$.append(decodeURIComponent(W),decodeURIComponent(z))}}),$}function j(C){var $=new E,G=C.replace(/\r?\n[\t ]+/g," ");return G.split(/\r?\n/).forEach(function(K){var W=K.split(":"),z=W.shift().trim();if(z){var J=W.join(":").trim();$.append(z,J)}}),$}I.call(_.prototype);function q(C,$){$||($={}),this.type="default",this.status=$.status===void 0?200:$.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in $?$.statusText:"OK",this.headers=new E($.headers),this.url=$.url||"",this._initBody(C)}I.call(q.prototype),q.prototype.clone=function(){return new q(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new E(this.headers),url:this.url})},q.error=function(){var C=new q(null,{status:0,statusText:""});return C.type="error",C};var X=[301,302,303,307,308];q.redirect=function(C,$){if(X.indexOf($)===-1)throw new RangeError("Invalid status code");return new q(null,{status:$,headers:{location:C}})},o.DOMException=s.DOMException;try{new o.DOMException}catch{o.DOMException=function($,G){this.message=$,this.name=G;var K=Error($);this.stack=K.stack},o.DOMException.prototype=Object.create(Error.prototype),o.DOMException.prototype.constructor=o.DOMException}function re(C,$){return new Promise(function(G,K){var W=new _(C,$);if(W.signal&&W.signal.aborted)return K(new o.DOMException("Aborted","AbortError"));var z=new XMLHttpRequest;function J(){z.abort()}z.onload=function(){var Y={status:z.status,statusText:z.statusText,headers:j(z.getAllResponseHeaders()||"")};Y.url="responseURL"in z?z.responseURL:Y.headers.get("X-Request-URL");var le="response"in z?z.response:z.responseText;G(new q(le,Y))},z.onerror=function(){K(new TypeError("Network request failed"))},z.ontimeout=function(){K(new TypeError("Network request failed"))},z.onabort=function(){K(new o.DOMException("Aborted","AbortError"))},z.open(W.method,W.url,!0),W.credentials==="include"?z.withCredentials=!0:W.credentials==="omit"&&(z.withCredentials=!1),"responseType"in z&&a.blob&&(z.responseType="blob"),W.headers.forEach(function(Y,le){z.setRequestHeader(le,Y)}),W.signal&&(W.signal.addEventListener("abort",J),z.onreadystatechange=function(){z.readyState===4&&W.signal.removeEventListener("abort",J)}),z.send(typeof W._bodyInit>"u"?null:W._bodyInit)})}return re.polyfill=!0,s.fetch||(s.fetch=re,s.Headers=E,s.Request=_,s.Response=q),o.Headers=E,o.Request=_,o.Response=q,o.fetch=re,Object.defineProperty(o,"__esModule",{value:!0}),o})({})})(n),n.fetch.ponyfill=!0,delete n.fetch.polyfill;var i=n;e=i.fetch,e.default=i.fetch,e.fetch=i.fetch,e.Headers=i.Headers,e.Request=i.Request,e.Response=i.Response,t.exports=e})(ya,ya.exports);var Lh=Td(ya.exports);const Mh={headers:{Accept:"application/json","Content-Type":"application/json"},method:"POST"},Uh=10;class fs{constructor(e){if(this.url=e,this.events=new _t.exports.EventEmitter,this.isAvailable=!1,this.registering=!1,!Ku(e))throw new Error(`Provided URL is not compatible with HTTP connection: ${e}`);this.url=e}get connected(){return this.isAvailable}get connecting(){return this.registering}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}off(e,r){this.events.off(e,r)}removeListener(e,r){this.events.removeListener(e,r)}async open(e=this.url){await this.register(e)}async close(){if(!this.isAvailable)throw new Error("Connection already closed");this.onClose()}async send(e,r){this.isAvailable||await this.register();try{const n=ri(e),s=await(await Lh(this.url,Object.assign(Object.assign({},Mh),{body:n}))).json();this.onPayload({data:s})}catch(n){this.onError(e.id,n)}}async register(e=this.url){if(!Ku(e))throw new Error(`Provided URL is not compatible with HTTP connection: ${e}`);if(this.registering){const r=this.events.getMaxListeners();return(this.events.listenerCount("register_error")>=r||this.events.listenerCount("open")>=r)&&this.events.setMaxListeners(r+1),new Promise((n,i)=>{this.events.once("register_error",s=>{this.resetMaxListeners(),i(s)}),this.events.once("open",()=>{if(this.resetMaxListeners(),typeof this.isAvailable>"u")return i(new Error("HTTP connection is missing or invalid"));n()})})}this.url=e,this.registering=!0;try{const r=ri({id:1,jsonrpc:"2.0",method:"test",params:[]});await Lh(e,Object.assign(Object.assign({},Mh),{body:r})),this.onOpen()}catch(r){const n=this.parseError(r);throw this.events.emit("register_error",n),this.onClose(),n}}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;const r=typeof e.data=="string"?Jo(e.data):e.data;this.events.emit("payload",r)}onError(e,r){const n=this.parseError(r),i=n.message||n.toString(),s=as(e,i);this.events.emit("payload",s)}parseError(e,r=this.url){return ku(e,r,"HTTP")}resetMaxListeners(){this.events.getMaxListeners()>Uh&&this.events.setMaxListeners(Uh)}}function Fy(t){var e;const r=(e=t[Object.keys(t)[0]])==null?void 0:e.chains[0];return[r.split(":")[0],r.split(":")[1]]}function br(t,e){let r;return e.rpcMap&&(r=e.rpcMap[By([t])]),r}function By(t){return Number(t[0].split(":")[1])}const ps=(t,e)=>{const r=n=>{n.request!==e.request||n.topic!==e.topic||(t.events.removeListener("session_request_sent",r),jy())};t.on("session_request_sent",r)};function jy(){if(typeof window<"u")try{const t=window.localStorage.getItem("WALLETCONNECT_DEEPLINK_CHOICE");if(t){const e=JSON.parse(t);window.open(e.href,"_self","noreferrer noopener")}}catch(t){console.error(t)}}class ky{constructor(e){this.name="eip155",this.namespace=e.namespace,this.client=e.client,this.events=e.events,this.httpProviders=this.createHttpProviders(),this.chainId=this.getDefaultChainId()}async request(e){var r;switch(e.request.method){case"eth_requestAccounts":return this.getAccounts();case"eth_accounts":return this.getAccounts();case"wallet_switchEthereumChain":{const n=e.request.params?(r=e.request.params[0])==null?void 0:r.chainId:"0x0";return this.setDefaultChain(parseInt(n,16).toString()),null}case"eth_chainId":return this.getDefaultChainId()}return this.namespace.methods.includes(e.request.method)?(ps(this.client,e),await this.client.request(e)):this.getHttpProvider().request(e.request)}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}setDefaultChain(e,r){if(this.chainId=parseInt(e),!this.httpProviders[e]){const n=r||br(`${this.name}:${e}`,this.namespace);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,n)}this.events.emit("chainChanged",this.chainId)}requestAccounts(){return this.getAccounts()}createHttpProvider(e,r){const n=r||br(e,this.namespace);return typeof n>"u"?void 0:new si(new fs(n))}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{e[r]=this.createHttpProvider(r)}),e}getAccounts(){const e=this.namespace.accounts;return e?e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2])||[]:[]}getDefaultChainId(){if(this.chainId)return this.chainId;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return parseInt(e.split(":")[1])}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}}class Hy{constructor(e){this.name="solana",this.namespace=e.namespace,this.events=e.events,this.client=e.client,this.chainId=this.getDefaultChainId(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getAccounts(){const e=this.namespace.accounts;return e?e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2])||[]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{e[r]=this.createHttpProvider(r)}),e}getDefaultChainId(){if(this.chainId)return this.chainId;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?(ps(this.client,e),this.client.request(e)):this.getHttpProvider().request(e.request)}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setDefaultChain(e,r){if(this.chainId=e,!this.httpProviders[e]){const n=r||br(`${this.name}:${e}`,this.namespace);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,n)}this.events.emit("chainChanged",this.chainId)}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||br(e,this.namespace);return typeof n>"u"?void 0:new si(new fs(n))}}class zy{constructor(e){this.name="cosmos",this.namespace=e.namespace,this.events=e.events,this.client=e.client,this.chainId=this.getDefaultChainId(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getAccounts(){const e=this.namespace.accounts;return e?e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2])||[]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{e[r]=this.createHttpProvider(r)}),e}getDefaultChainId(){if(this.chainId)return this.chainId;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?(ps(this.client,e),this.client.request(e)):this.getHttpProvider().request(e.request)}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setDefaultChain(e,r){if(this.chainId=e,!this.httpProviders[e]){const n=r||br(`${this.name}:${e}`,this.namespace);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,n)}this.events.emit("chainChanged",this.chainId)}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||br(e,this.namespace);return typeof n>"u"?void 0:new si(new fs(n))}}class Wy{constructor(e){this.name="cip34",this.namespace=e.namespace,this.events=e.events,this.client=e.client,this.chainId=this.getDefaultChainId(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getAccounts(){const e=this.namespace.accounts;return e?e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2])||[]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{e[r]=this.createHttpProvider(r)}),e}getDefaultChainId(){if(this.chainId)return this.chainId;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?(ps(this.client,e),this.client.request(e)):this.getHttpProvider().request(e.request)}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setDefaultChain(e,r){if(this.chainId=e,!this.httpProviders[e]){const n=r||br(`${this.name}:${e}`,this.namespace);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,n)}this.events.emit("chainChanged",this.chainId)}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||br(e,this.namespace);return typeof n>"u"?void 0:new si(new fs(n))}}const Fh="error",qy="wss://relay.walletconnect.com",Vy="wc",Ky="universal_provider",Bh=`${Vy}@${2}:${Ky}:`;var Gy=Object.defineProperty,Yy=Object.defineProperties,Zy=Object.getOwnPropertyDescriptors,jh=Object.getOwnPropertySymbols,Jy=Object.prototype.hasOwnProperty,Xy=Object.prototype.propertyIsEnumerable,kh=(t,e,r)=>e in t?Gy(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Hh=(t,e)=>{for(var r in e||(e={}))Jy.call(e,r)&&kh(t,r,e[r]);if(jh)for(var r of jh(e))Xy.call(e,r)&&kh(t,r,e[r]);return t},Qy=(t,e)=>Yy(t,Zy(e));class ba{constructor(e){this.events=new _t.exports,this.rpcProviders={},this.providerOpts=e,this.logger=typeof e?.logger<"u"&&typeof e?.logger!="string"?e.logger:zn(je.getDefaultLoggerOptions({level:e?.logger||Fh}))}static async init(e){const r=new ba(e);return await r.initialize(),r}async request(e,r){const[n,i]=this.validateChain(r);if(!this.session)throw new Error("Please call connect() before request()");return await this.getProvider(n).request({request:Hh({},e),chainId:`${n}:${i}`,topic:this.session.topic})}sendAsync(e,r,n){this.request(e,n).then(i=>r(null,i)).catch(i=>r(i,void 0))}async enable(){if(!this.client)throw new Error("Sign Client not initialized");return this.session||await this.connect({namespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties}),await this.requestAccounts()}async disconnect(){var e;if(!this.session)throw new Error("Please call connect() before enable()");await this.client.disconnect({topic:(e=this.session)==null?void 0:e.topic,reason:ot("USER_DISCONNECTED")}),await this.cleanup()}async connect(e){if(!this.client)throw new Error("Sign Client not initialized");if(this.setNamespaces(e),await this.cleanupPendingPairings(),this.createProviders(),!e.skipPairing)return await this.pair(e.pairingTopic)}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}removeListener(e,r){this.events.removeListener(e,r)}off(e,r){this.events.off(e,r)}get isWalletConnect(){return!0}async pair(e){const{uri:r,approval:n}=await this.client.connect({pairingTopic:e,requiredNamespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties});return r&&(this.uri=r,this.events.emit("display_uri",r)),this.session=await n(),this.onSessionUpdate(),this.onConnect(),this.session}setDefaultChain(e,r){try{const[n,i]=this.validateChain(e);this.getProvider(n).setDefaultChain(i,r)}catch(n){if(!/Please call connect/.test(n.message))throw n}}async cleanupPendingPairings(e={}){this.logger.info("Cleaning up inactive pairings...");const r=this.client.pairing.getAll();if(wr(r)){for(const n of r)e.deletePairings?this.client.core.expirer.set(n.topic,0):await this.client.core.relayer.subscriber.unsubscribe(n.topic);this.logger.info(`Inactive pairings cleared: ${r.length}`)}}async checkStorage(){if(this.namespaces=await this.client.core.storage.getItem(`${Bh}/namespaces`)||{},this.namespaces&&this.createProviders(),this.client.session.length){const e=this.client.session.keys.length-1;this.session=this.client.session.get(this.client.session.keys[e]),this.onSessionUpdate()}}async initialize(){this.logger.trace("Initialized"),await this.createClient(),this.checkStorage(),this.registerEventListeners()}async createClient(){this.client=this.providerOpts.client||await wa.init({logger:this.providerOpts.logger||Fh,relayUrl:this.providerOpts.relayUrl||qy,projectId:this.providerOpts.projectId,metadata:this.providerOpts.metadata,storageOptions:this.providerOpts.storageOptions,name:this.providerOpts.name}),this.logger.trace("SignClient Initialized")}createProviders(){if(!this.client)throw new Error("Sign Client not initialized");Object.keys(this.namespaces).forEach(e=>{var r;const n=Object.assign({},this.namespaces[e],(r=this.optionalNamespaces)==null?void 0:r[e]);switch(e){case"eip155":this.rpcProviders[e]=new ky({client:this.client,namespace:n,events:this.events});break;case"solana":this.rpcProviders[e]=new Hy({client:this.client,namespace:n,events:this.events});break;case"cosmos":this.rpcProviders[e]=new zy({client:this.client,namespace:n,events:this.events});break;case"polkadot":break;case"cip34":this.rpcProviders[e]=new Wy({client:this.client,namespace:n,events:this.events});break}})}registerEventListeners(){if(typeof this.client>"u")throw new Error("Sign Client is not initialized");this.client.on("session_ping",e=>{this.events.emit("session_ping",e)}),this.client.on("session_event",e=>{const{params:r}=e,{event:n}=r;n.name==="accountsChanged"?this.events.emit("accountsChanged",n.data):n.name==="chainChanged"?this.onChainChanged(n.data,r.chainId):this.events.emit(n.name,n.data),this.events.emit("session_event",e)}),this.client.on("session_update",({topic:e,params:r})=>{var n;const{namespaces:i}=r,s=(n=this.client)==null?void 0:n.session.get(e);this.session=Qy(Hh({},s),{namespaces:i}),this.onSessionUpdate(),this.events.emit("session_update",{topic:e,params:r})}),this.client.on("session_delete",async e=>{await this.cleanup(),this.events.emit("session_delete",e)})}getProvider(e){if(!this.rpcProviders[e])throw new Error(`Provider not found: ${e}`);return this.rpcProviders[e]}onSessionUpdate(){Object.keys(this.rpcProviders).forEach(e=>{var r;this.getProvider(e).updateNamespace((r=this.session)==null?void 0:r.namespaces[e])})}setNamespaces(e){const{namespaces:r,optionalNamespaces:n,sessionProperties:i}=e;if(!r||!Object.keys(r).length)throw new Error("Namespaces must be not empty");this.client.core.storage.setItem(`${Bh}/namespaces`,r),this.namespaces=r,this.optionalNamespaces=n,this.sessionProperties=i}validateChain(e){const[r,n]=e?.split(":")||["",""];if(r&&!Object.keys(this.namespaces).includes(r))throw new Error(`Namespace '${r}' is not configured. Please call connect() first with namespace config.`);return!r||!n?Fy(this.namespaces):[r,n]}async requestAccounts(){const[e]=this.validateChain();return await this.getProvider(e).requestAccounts()}onChainChanged(e,r){const[n,i]=this.validateChain(r);this.getProvider(n).setDefaultChain(i),this.events.emit("chainChanged",e)}onConnect(){this.events.emit("connect",{session:this.session})}async cleanup(){this.session=void 0,await this.cleanupPendingPairings({deletePairings:!0})}}const eb=ba,tb="wc",rb="ethereum_provider",nb=`${tb}@${2}:${rb}:`;var ib=Object.defineProperty,sb=Object.defineProperties,ob=Object.getOwnPropertyDescriptors,zh=Object.getOwnPropertySymbols,ab=Object.prototype.hasOwnProperty,cb=Object.prototype.propertyIsEnumerable,Wh=(t,e,r)=>e in t?ib(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,lb=(t,e)=>{for(var r in e||(e={}))ab.call(e,r)&&Wh(t,r,e[r]);if(zh)for(var r of zh(e))cb.call(e,r)&&Wh(t,r,e[r]);return t},ub=(t,e)=>sb(t,ob(e));const hb="https://rpc.walletconnect.com/v1/",va=["eth_sendTransaction","personal_sign"],_a=["chainChanged","accountsChanged"];function Ea(t){return Number(t[0].split(":")[1])}function db(t){const{chains:e,optionalChains:r,methods:n,optionalMethods:i,events:s,optionalEvents:o,rpcMap:a}=t;if(!wr(e))throw new Error("Invalid chains");const c=e,l=n||va,p=s||_a,w={[Ea(c)]:a[Ea(c)]},y={chains:c,methods:l,events:p,rpcMap:w},m=s?.filter(M=>!_a.includes(M)),E=n?.filter(M=>!va.includes(M));if(!r&&!o&&!i&&!(m!=null&&m.length)&&!(E!=null&&E.length))return{required:y};const A=m?.length&&E?.length||!r,N={chains:[...new Set(A?c.concat(r||[]):r)],methods:[...new Set(l.concat(i||[]))],events:[...new Set(p.concat(o||[]))],rpcMap:a};return{required:y,optional:N}}class gs{constructor(){this.events=new _t.exports.EventEmitter,this.namespace="eip155",this.accounts=[],this.chainId=1,this.STORAGE_KEY=nb,this.signer={},this.rpc={}}static async init(e){const r=new gs;return await r.initialize(e),r}async request(e){return await this.signer.request(e,this.formatChainId(this.chainId))}sendAsync(e,r){this.signer.sendAsync(e,r,this.formatChainId(this.chainId))}get connected(){return this.signer.client?this.signer.client.core.relayer.connected:!1}get connecting(){return this.signer.client?this.signer.client.core.relayer.connecting:!1}async enable(){return this.session||await this.connect(),await this.request({method:"eth_requestAccounts"})}async connect(e){if(!this.signer.client)throw new Error("Provider not initialized. Call init() first");this.loadConnectOpts(e);const{required:r,optional:n}=db(this.rpc);try{const i=await new Promise(async(o,a)=>{var c;this.rpc.showQrModal&&((c=this.modal)==null||c.subscribeModal(p=>{!p.open&&!this.signer.session&&a(new Error("User rejected the request."))}));const l=await this.signer.connect(ub(lb({namespaces:{[this.namespace]:r}},n&&{optionalNamespaces:{[this.namespace]:n}}),{pairingTopic:e?.pairingTopic}));o(l)});if(!i)return;this.setChainIds(this.rpc.chains);const s=eg(i.namespaces,[this.namespace]);this.setAccounts(s),this.events.emit("connect",{chainId:this.chainId,accounts:this.accounts})}catch(i){throw this.signer.logger.error(i),i}finally{this.modal&&this.modal.closeModal()}}async disconnect(){this.session&&await this.signer.disconnect(),this.reset()}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}removeListener(e,r){this.events.removeListener(e,r)}off(e,r){this.events.off(e,r)}get isWalletConnect(){return!0}get session(){return this.signer.session}registerEventListeners(){this.signer.on("session_event",e=>{const{params:r}=e,{event:n}=r;n.name==="accountsChanged"?(this.accounts=n.data,this.events.emit("accountsChanged",this.accounts)):n.name==="chainChanged"?this.setChainId(this.formatChainId(n.data)):this.events.emit(n.name,n.data),this.events.emit("session_event",e)}),this.signer.on("chainChanged",e=>{this.chainId=e,this.events.emit("chainChanged",e),this.persist()}),this.signer.on("session_update",e=>{this.events.emit("session_update",e)}),this.signer.on("session_delete",e=>{this.reset(),this.events.emit("session_delete",e)}),this.signer.on("display_uri",e=>{var r;this.rpc.showQrModal&&((r=this.modal)==null||r.openModal({uri:e})),this.events.emit("display_uri",e)})}setHttpProvider(e){const r=this.formatChainId(e);this.signer.setDefaultChain(r,this.getRpcUrl(e))}isCompatibleChainId(e){return typeof e=="string"?e.startsWith(`${this.namespace}:`):!1}formatChainId(e){return`${this.namespace}:${e}`}parseChainId(e){return Number(e.split(":")[1])}setChainIds(e){const r=e.filter(n=>this.isCompatibleChainId(n)).map(n=>this.parseChainId(n));r.length&&(this.chainId=r[0],this.events.emit("chainChanged",this.chainId),this.persist())}setChainId(e){if(this.isCompatibleChainId(e)){const r=this.parseChainId(e);this.chainId=r,this.setHttpProvider(r)}}parseAccountId(e){const[r,n,i]=e.split(":");return{chainId:`${r}:${n}`,address:i}}setAccounts(e){this.accounts=e.filter(r=>this.parseChainId(this.parseAccountId(r).chainId)===this.chainId).map(r=>this.parseAccountId(r).address),this.events.emit("accountsChanged",this.accounts)}getRpcConfig(e){var r,n;return{chains:((r=e.chains)==null?void 0:r.map(i=>this.formatChainId(i)))||[`${this.namespace}:1`],optionalChains:e.optionalChains?e.optionalChains.map(i=>this.formatChainId(i)):void 0,methods:e?.methods||va,events:e?.events||_a,optionalMethods:e?.optionalMethods||[],optionalEvents:e?.optionalEvents||[],rpcMap:e?.rpcMap||this.buildRpcMap(e.chains.concat(e.optionalChains||[]),e.projectId),showQrModal:(n=e?.showQrModal)!=null?n:!0,projectId:e.projectId,metadata:e.metadata}}buildRpcMap(e,r){const n={};return e.forEach(i=>{n[i]=this.getRpcUrl(i,r)}),n}async initialize(e){if(this.rpc=this.getRpcConfig(e),this.chainId=Ea(this.rpc.chains),this.signer=await eb.init({projectId:this.rpc.projectId}),this.registerEventListeners(),await this.loadPersistedSession(),this.rpc.showQrModal){const{Web3Modal:r}=await Promise.resolve().then(function(){return Lb});this.modal=new r({walletConnectVersion:2,projectId:this.rpc.projectId,standaloneChains:this.rpc.chains})}}loadConnectOpts(e){if(!e)return;const{chains:r,optionalChains:n,rpcMap:i}=e;r&&wr(r)&&(this.rpc.chains=r.map(s=>this.formatChainId(s)),r.forEach(s=>{this.rpc.rpcMap[s]=i?.[s]||this.getRpcUrl(s)})),n&&wr(n)&&(this.rpc.optionalChains=[],this.rpc.optionalChains=n?.map(s=>this.formatChainId(s)),n.forEach(s=>{this.rpc.rpcMap[s]=i?.[s]||this.getRpcUrl(s)}))}getRpcUrl(e,r){var n;return((n=this.rpc.rpcMap)==null?void 0:n[e])||`${hb}?chainId=eip155:${e}&projectId=${r||this.rpc.projectId}`}async loadPersistedSession(){if(!this.session)return;const e=await this.signer.client.core.storage.getItem(`${this.STORAGE_KEY}/chainId`);this.setChainIds(e?[this.formatChainId(e)]:this.session.namespaces[this.namespace].accounts),this.setAccounts(this.session.namespaces[this.namespace].accounts)}reset(){this.chainId=1,this.accounts=[]}persist(){this.session&&this.signer.client.core.storage.setItem(`${this.STORAGE_KEY}/chainId`,this.chainId)}}const fb=gs,pb=Symbol(),qh=Object.getPrototypeOf,xa=new WeakMap,gb=t=>t&&(xa.has(t)?xa.get(t):qh(t)===Object.prototype||qh(t)===Array.prototype),mb=t=>gb(t)&&t[pb]||null,Vh=(t,e=!0)=>{xa.set(t,e)},Ca=t=>typeof t=="object"&&t!==null,Br=new WeakMap,ms=new WeakSet,wb=(t=Object.is,e=(l,p)=>new Proxy(l,p),r=l=>Ca(l)&&!ms.has(l)&&(Array.isArray(l)||!(Symbol.iterator in l))&&!(l instanceof WeakMap)&&!(l instanceof WeakSet)&&!(l instanceof Error)&&!(l instanceof Number)&&!(l instanceof Date)&&!(l instanceof String)&&!(l instanceof RegExp)&&!(l instanceof ArrayBuffer),n=l=>{switch(l.status){case"fulfilled":return l.value;case"rejected":throw l.reason;default:throw l}},i=new WeakMap,s=(l,p,w=n)=>{const y=i.get(l);if(y?.[0]===p)return y[1];const m=Array.isArray(l)?[]:Object.create(Object.getPrototypeOf(l));return Vh(m,!0),i.set(l,[p,m]),Reflect.ownKeys(l).forEach(E=>{const A=Reflect.get(l,E);ms.has(A)?(Vh(A,!1),m[E]=A):A instanceof Promise?Object.defineProperty(m,E,{get(){return w(A)}}):Br.has(A)?m[E]=bb(A,w):m[E]=A}),Object.freeze(m)},o=new WeakMap,a=[1,1],c=l=>{if(!Ca(l))throw new Error("object required");const p=o.get(l);if(p)return p;let w=a[0];const y=new Set,m=(H,j=++a[0])=>{w!==j&&(w=j,y.forEach(q=>q(H,j)))};let E=a[1];const A=(H=++a[1])=>(E!==H&&!y.size&&(E=H,M.forEach(([j])=>{const q=j[1](H);q>w&&(w=q)})),w),N=H=>(j,q)=>{const X=[...j];X[1]=[H,...X[1]],m(X,q)},M=new Map,x=(H,j)=>{if(void 0!=="production"&&M.has(H))throw new Error("prop listener already exists");if(y.size){const q=j[3](N(H));M.set(H,[j,q])}else M.set(H,[j])},D=H=>{var j;const q=M.get(H);q&&(M.delete(H),(j=q[1])==null||j.call(q))},b=H=>(y.add(H),y.size===1&&M.forEach(([q,X],re)=>{if(void 0!=="production"&&X)throw new Error("remove already exists");const C=q[3](N(re));M.set(re,[q,C])}),()=>{y.delete(H),y.size===0&&M.forEach(([q,X],re)=>{X&&(X(),M.set(re,[q]))})}),I=Array.isArray(l)?[]:Object.create(Object.getPrototypeOf(l)),h=e(I,{deleteProperty(H,j){const q=Reflect.get(H,j);D(j);const X=Reflect.deleteProperty(H,j);return X&&m(["delete",[j],q]),X},set(H,j,q,X){var re;const C=Reflect.has(H,j),$=Reflect.get(H,j,X);if(C&&t($,q))return!0;D(j),Ca(q)&&(q=mb(q)||q);let G=q;if(!((re=Object.getOwnPropertyDescriptor(H,j))!=null&&re.set))if(q instanceof Promise)q.then(K=>{q.status="fulfilled",q.value=K,m(["resolve",[j],K])}).catch(K=>{q.status="rejected",q.reason=K,m(["reject",[j],K])});else{!Br.has(q)&&r(q)&&(G=vr(q));const K=!ms.has(G)&&Br.get(G);K&&x(j,K)}return Reflect.set(H,j,G,X),m(["set",[j],q,$]),!0}});o.set(l,h);const _=[I,A,s,b];return Br.set(h,_),Reflect.ownKeys(l).forEach(H=>{const j=Object.getOwnPropertyDescriptor(l,H);j.get||j.set?Object.defineProperty(I,H,j):h[H]=l[H]}),h})=>[c,Br,ms,t,e,r,n,i,s,o,a],[yb]=wb();function vr(t={}){return yb(t)}function li(t,e,r){const n=Br.get(t);void 0!=="production"&&!n&&console.warn("Please use proxy object");let i;const s=[],o=n[3];let a=!1;const l=o(p=>{if(s.push(p),r){e(s.splice(0));return}i||(i=Promise.resolve().then(()=>{i=void 0,a&&e(s.splice(0))}))});return a=!0,()=>{a=!1,l()}}function bb(t,e){const r=Br.get(t);void 0!=="production"&&!r&&console.warn("Please use proxy object");const[n,i,s]=r;return s(n,i(),e)}var Kh={},ws={};ws.byteLength=Eb,ws.toByteArray=Cb,ws.fromByteArray=Db;for(var nr=[],Vt=[],vb=typeof Uint8Array<"u"?Uint8Array:Array,Sa="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",pn=0,_b=Sa.length;pn<_b;++pn)nr[pn]=Sa[pn],Vt[Sa.charCodeAt(pn)]=pn;Vt["-".charCodeAt(0)]=62,Vt["_".charCodeAt(0)]=63;function Gh(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");r===-1&&(r=e);var n=r===e?0:4-r%4;return[r,n]}function Eb(t){var e=Gh(t),r=e[0],n=e[1];return(r+n)*3/4-n}function xb(t,e,r){return(e+r)*3/4-r}function Cb(t){var e,r=Gh(t),n=r[0],i=r[1],s=new vb(xb(t,n,i)),o=0,a=i>0?n-4:n,c;for(c=0;c<a;c+=4)e=Vt[t.charCodeAt(c)]<<18|Vt[t.charCodeAt(c+1)]<<12|Vt[t.charCodeAt(c+2)]<<6|Vt[t.charCodeAt(c+3)],s[o++]=e>>16&255,s[o++]=e>>8&255,s[o++]=e&255;return i===2&&(e=Vt[t.charCodeAt(c)]<<2|Vt[t.charCodeAt(c+1)]>>4,s[o++]=e&255),i===1&&(e=Vt[t.charCodeAt(c)]<<10|Vt[t.charCodeAt(c+1)]<<4|Vt[t.charCodeAt(c+2)]>>2,s[o++]=e>>8&255,s[o++]=e&255),s}function Sb(t){return nr[t>>18&63]+nr[t>>12&63]+nr[t>>6&63]+nr[t&63]}function Ib(t,e,r){for(var n,i=[],s=e;s<r;s+=3)n=(t[s]<<16&16711680)+(t[s+1]<<8&65280)+(t[s+2]&255),i.push(Sb(n));return i.join("")}function Db(t){for(var e,r=t.length,n=r%3,i=[],s=16383,o=0,a=r-n;o<a;o+=s)i.push(Ib(t,o,o+s>a?a:o+s));return n===1?(e=t[r-1],i.push(nr[e>>2]+nr[e<<4&63]+"==")):n===2&&(e=(t[r-2]<<8)+t[r-1],i.push(nr[e>>10]+nr[e>>4&63]+nr[e<<2&63]+"=")),i.join("")}var Ia={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */Ia.read=function(t,e,r,n,i){var s,o,a=i*8-n-1,c=(1<<a)-1,l=c>>1,p=-7,w=r?i-1:0,y=r?-1:1,m=t[e+w];for(w+=y,s=m&(1<<-p)-1,m>>=-p,p+=a;p>0;s=s*256+t[e+w],w+=y,p-=8);for(o=s&(1<<-p)-1,s>>=-p,p+=n;p>0;o=o*256+t[e+w],w+=y,p-=8);if(s===0)s=1-l;else{if(s===c)return o?NaN:(m?-1:1)*(1/0);o=o+Math.pow(2,n),s=s-l}return(m?-1:1)*o*Math.pow(2,s-n)},Ia.write=function(t,e,r,n,i,s){var o,a,c,l=s*8-i-1,p=(1<<l)-1,w=p>>1,y=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,m=n?0:s-1,E=n?1:-1,A=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,o=p):(o=Math.floor(Math.log(e)/Math.LN2),e*(c=Math.pow(2,-o))<1&&(o--,c*=2),o+w>=1?e+=y/c:e+=y*Math.pow(2,1-w),e*c>=2&&(o++,c/=2),o+w>=p?(a=0,o=p):o+w>=1?(a=(e*c-1)*Math.pow(2,i),o=o+w):(a=e*Math.pow(2,w-1)*Math.pow(2,i),o=0));i>=8;t[r+m]=a&255,m+=E,a/=256,i-=8);for(o=o<<i|a,l+=i;l>0;t[r+m]=o&255,m+=E,o/=256,l-=8);t[r+m-E]|=A*128};/*!
106
67
  * The buffer module from node.js, for the browser.
107
68
  *
108
69
  * @author Feross Aboukhadijeh <https://feross.org>
109
70
  * @license MIT
110
- */(function(t){const e=ys,r=Lc,n=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=a,t.SlowBuffer=D,t.INSPECT_MAX_BYTES=50;const i=2147483647;t.kMaxLength=i,a.TYPED_ARRAY_SUPPORT=o(),!a.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function o(){try{const b=new Uint8Array(1),f={foo:function(){return 42}};return Object.setPrototypeOf(f,Uint8Array.prototype),Object.setPrototypeOf(b,f),b.foo()===42}catch{return!1}}Object.defineProperty(a.prototype,"parent",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.buffer}}),Object.defineProperty(a.prototype,"offset",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.byteOffset}});function s(b){if(b>i)throw new RangeError('The value "'+b+'" is invalid for option "size"');const f=new Uint8Array(b);return Object.setPrototypeOf(f,a.prototype),f}function a(b,f,p){if(typeof b=="number"){if(typeof f=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return y(b)}return l(b,f,p)}a.poolSize=8192;function l(b,f,p){if(typeof b=="string")return m(b,f);if(ArrayBuffer.isView(b))return _(b);if(b==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof b);if(ge(b,ArrayBuffer)||b&&ge(b.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(ge(b,SharedArrayBuffer)||b&&ge(b.buffer,SharedArrayBuffer)))return R(b,f,p);if(typeof b=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const A=b.valueOf&&b.valueOf();if(A!=null&&A!==b)return a.from(A,f,p);const L=M(b);if(L)return L;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof b[Symbol.toPrimitive]=="function")return a.from(b[Symbol.toPrimitive]("string"),f,p);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof b)}a.from=function(b,f,p){return l(b,f,p)},Object.setPrototypeOf(a.prototype,Uint8Array.prototype),Object.setPrototypeOf(a,Uint8Array);function u(b){if(typeof b!="number")throw new TypeError('"size" argument must be of type number');if(b<0)throw new RangeError('The value "'+b+'" is invalid for option "size"')}function d(b,f,p){return u(b),b<=0?s(b):f!==void 0?typeof p=="string"?s(b).fill(f,p):s(b).fill(f):s(b)}a.alloc=function(b,f,p){return d(b,f,p)};function y(b){return u(b),s(b<0?0:B(b)|0)}a.allocUnsafe=function(b){return y(b)},a.allocUnsafeSlow=function(b){return y(b)};function m(b,f){if((typeof f!="string"||f==="")&&(f="utf8"),!a.isEncoding(f))throw new TypeError("Unknown encoding: "+f);const p=N(b,f)|0;let A=s(p);const L=A.write(b,f);return L!==p&&(A=A.slice(0,L)),A}function v(b){const f=b.length<0?0:B(b.length)|0,p=s(f);for(let A=0;A<f;A+=1)p[A]=b[A]&255;return p}function _(b){if(ge(b,Uint8Array)){const f=new Uint8Array(b);return R(f.buffer,f.byteOffset,f.byteLength)}return v(b)}function R(b,f,p){if(f<0||b.byteLength<f)throw new RangeError('"offset" is outside of buffer bounds');if(b.byteLength<f+(p||0))throw new RangeError('"length" is outside of buffer bounds');let A;return f===void 0&&p===void 0?A=new Uint8Array(b):p===void 0?A=new Uint8Array(b,f):A=new Uint8Array(b,f,p),Object.setPrototypeOf(A,a.prototype),A}function M(b){if(a.isBuffer(b)){const f=B(b.length)|0,p=s(f);return p.length===0||b.copy(p,0,0,f),p}if(b.length!==void 0)return typeof b.length!="number"||we(b.length)?s(0):v(b);if(b.type==="Buffer"&&Array.isArray(b.data))return v(b.data)}function B(b){if(b>=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return b|0}function D(b){return+b!=b&&(b=0),a.alloc(+b)}a.isBuffer=function(f){return f!=null&&f._isBuffer===!0&&f!==a.prototype},a.compare=function(f,p){if(ge(f,Uint8Array)&&(f=a.from(f,f.offset,f.byteLength)),ge(p,Uint8Array)&&(p=a.from(p,p.offset,p.byteLength)),!a.isBuffer(f)||!a.isBuffer(p))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(f===p)return 0;let A=f.length,L=p.length;for(let k=0,K=Math.min(A,L);k<K;++k)if(f[k]!==p[k]){A=f[k],L=p[k];break}return A<L?-1:L<A?1:0},a.isEncoding=function(f){switch(String(f).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},a.concat=function(f,p){if(!Array.isArray(f))throw new TypeError('"list" argument must be an Array of Buffers');if(f.length===0)return a.alloc(0);let A;if(p===void 0)for(p=0,A=0;A<f.length;++A)p+=f[A].length;const L=a.allocUnsafe(p);let k=0;for(A=0;A<f.length;++A){let K=f[A];if(ge(K,Uint8Array))k+K.length>L.length?(a.isBuffer(K)||(K=a.from(K)),K.copy(L,k)):Uint8Array.prototype.set.call(L,K,k);else if(a.isBuffer(K))K.copy(L,k);else throw new TypeError('"list" argument must be an Array of Buffers');k+=K.length}return L};function N(b,f){if(a.isBuffer(b))return b.length;if(ArrayBuffer.isView(b)||ge(b,ArrayBuffer))return b.byteLength;if(typeof b!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof b);const p=b.length,A=arguments.length>2&&arguments[2]===!0;if(!A&&p===0)return 0;let L=!1;for(;;)switch(f){case"ascii":case"latin1":case"binary":return p;case"utf8":case"utf-8":return ye(b).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return p*2;case"hex":return p>>>1;case"base64":return xe(b).length;default:if(L)return A?-1:ye(b).length;f=(""+f).toLowerCase(),L=!0}}a.byteLength=N;function C(b,f,p){let A=!1;if((f===void 0||f<0)&&(f=0),f>this.length||((p===void 0||p>this.length)&&(p=this.length),p<=0)||(p>>>=0,f>>>=0,p<=f))return"";for(b||(b="utf8");;)switch(b){case"hex":return j(this,f,p);case"utf8":case"utf-8":return E(this,f,p);case"ascii":return J(this,f,p);case"latin1":case"binary":return H(this,f,p);case"base64":return ie(this,f,p);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return W(this,f,p);default:if(A)throw new TypeError("Unknown encoding: "+b);b=(b+"").toLowerCase(),A=!0}}a.prototype._isBuffer=!0;function $(b,f,p){const A=b[f];b[f]=b[p],b[p]=A}a.prototype.swap16=function(){const f=this.length;if(f%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let p=0;p<f;p+=2)$(this,p,p+1);return this},a.prototype.swap32=function(){const f=this.length;if(f%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let p=0;p<f;p+=4)$(this,p,p+3),$(this,p+1,p+2);return this},a.prototype.swap64=function(){const f=this.length;if(f%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let p=0;p<f;p+=8)$(this,p,p+7),$(this,p+1,p+6),$(this,p+2,p+5),$(this,p+3,p+4);return this},a.prototype.toString=function(){const f=this.length;return f===0?"":arguments.length===0?E(this,0,f):C.apply(this,arguments)},a.prototype.toLocaleString=a.prototype.toString,a.prototype.equals=function(f){if(!a.isBuffer(f))throw new TypeError("Argument must be a Buffer");return this===f?!0:a.compare(this,f)===0},a.prototype.inspect=function(){let f="";const p=t.INSPECT_MAX_BYTES;return f=this.toString("hex",0,p).replace(/(.{2})/g,"$1 ").trim(),this.length>p&&(f+=" ... "),"<Buffer "+f+">"},n&&(a.prototype[n]=a.prototype.inspect),a.prototype.compare=function(f,p,A,L,k){if(ge(f,Uint8Array)&&(f=a.from(f,f.offset,f.byteLength)),!a.isBuffer(f))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof f);if(p===void 0&&(p=0),A===void 0&&(A=f?f.length:0),L===void 0&&(L=0),k===void 0&&(k=this.length),p<0||A>f.length||L<0||k>this.length)throw new RangeError("out of range index");if(L>=k&&p>=A)return 0;if(L>=k)return-1;if(p>=A)return 1;if(p>>>=0,A>>>=0,L>>>=0,k>>>=0,this===f)return 0;let K=k-L,se=A-p;const de=Math.min(K,se),De=this.slice(L,k),Be=f.slice(p,A);for(let Pe=0;Pe<de;++Pe)if(De[Pe]!==Be[Pe]){K=De[Pe],se=Be[Pe];break}return K<se?-1:se<K?1:0};function P(b,f,p,A,L){if(b.length===0)return-1;if(typeof p=="string"?(A=p,p=0):p>2147483647?p=2147483647:p<-2147483648&&(p=-2147483648),p=+p,we(p)&&(p=L?0:b.length-1),p<0&&(p=b.length+p),p>=b.length){if(L)return-1;p=b.length-1}else if(p<0)if(L)p=0;else return-1;if(typeof f=="string"&&(f=a.from(f,A)),a.isBuffer(f))return f.length===0?-1:h(b,f,p,A,L);if(typeof f=="number")return f=f&255,typeof Uint8Array.prototype.indexOf=="function"?L?Uint8Array.prototype.indexOf.call(b,f,p):Uint8Array.prototype.lastIndexOf.call(b,f,p):h(b,[f],p,A,L);throw new TypeError("val must be string, number or Buffer")}function h(b,f,p,A,L){let k=1,K=b.length,se=f.length;if(A!==void 0&&(A=String(A).toLowerCase(),A==="ucs2"||A==="ucs-2"||A==="utf16le"||A==="utf-16le")){if(b.length<2||f.length<2)return-1;k=2,K/=2,se/=2,p/=2}function de(Be,Pe){return k===1?Be[Pe]:Be.readUInt16BE(Pe*k)}let De;if(L){let Be=-1;for(De=p;De<K;De++)if(de(b,De)===de(f,Be===-1?0:De-Be)){if(Be===-1&&(Be=De),De-Be+1===se)return Be*k}else Be!==-1&&(De-=De-Be),Be=-1}else for(p+se>K&&(p=K-se),De=p;De>=0;De--){let Be=!0;for(let Pe=0;Pe<se;Pe++)if(de(b,De+Pe)!==de(f,Pe)){Be=!1;break}if(Be)return De}return-1}a.prototype.includes=function(f,p,A){return this.indexOf(f,p,A)!==-1},a.prototype.indexOf=function(f,p,A){return P(this,f,p,A,!0)},a.prototype.lastIndexOf=function(f,p,A){return P(this,f,p,A,!1)};function S(b,f,p,A){p=Number(p)||0;const L=b.length-p;A?(A=Number(A),A>L&&(A=L)):A=L;const k=f.length;A>k/2&&(A=k/2);let K;for(K=0;K<A;++K){const se=parseInt(f.substr(K*2,2),16);if(we(se))return K;b[p+K]=se}return K}function q(b,f,p,A){return Ee(ye(f,b.length-p),b,p,A)}function z(b,f,p,A){return Ee(ze(f),b,p,A)}function Y(b,f,p,A){return Ee(xe(f),b,p,A)}function re(b,f,p,A){return Ee(Ue(f,b.length-p),b,p,A)}a.prototype.write=function(f,p,A,L){if(p===void 0)L="utf8",A=this.length,p=0;else if(A===void 0&&typeof p=="string")L=p,A=this.length,p=0;else if(isFinite(p))p=p>>>0,isFinite(A)?(A=A>>>0,L===void 0&&(L="utf8")):(L=A,A=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const k=this.length-p;if((A===void 0||A>k)&&(A=k),f.length>0&&(A<0||p<0)||p>this.length)throw new RangeError("Attempt to write outside buffer bounds");L||(L="utf8");let K=!1;for(;;)switch(L){case"hex":return S(this,f,p,A);case"utf8":case"utf-8":return q(this,f,p,A);case"ascii":case"latin1":case"binary":return z(this,f,p,A);case"base64":return Y(this,f,p,A);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return re(this,f,p,A);default:if(K)throw new TypeError("Unknown encoding: "+L);L=(""+L).toLowerCase(),K=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function ie(b,f,p){return f===0&&p===b.length?e.fromByteArray(b):e.fromByteArray(b.slice(f,p))}function E(b,f,p){p=Math.min(b.length,p);const A=[];let L=f;for(;L<p;){const k=b[L];let K=null,se=k>239?4:k>223?3:k>191?2:1;if(L+se<=p){let de,De,Be,Pe;switch(se){case 1:k<128&&(K=k);break;case 2:de=b[L+1],(de&192)===128&&(Pe=(k&31)<<6|de&63,Pe>127&&(K=Pe));break;case 3:de=b[L+1],De=b[L+2],(de&192)===128&&(De&192)===128&&(Pe=(k&15)<<12|(de&63)<<6|De&63,Pe>2047&&(Pe<55296||Pe>57343)&&(K=Pe));break;case 4:de=b[L+1],De=b[L+2],Be=b[L+3],(de&192)===128&&(De&192)===128&&(Be&192)===128&&(Pe=(k&15)<<18|(de&63)<<12|(De&63)<<6|Be&63,Pe>65535&&Pe<1114112&&(K=Pe))}}K===null?(K=65533,se=1):K>65535&&(K-=65536,A.push(K>>>10&1023|55296),K=56320|K&1023),A.push(K),L+=se}return Z(A)}const O=4096;function Z(b){const f=b.length;if(f<=O)return String.fromCharCode.apply(String,b);let p="",A=0;for(;A<f;)p+=String.fromCharCode.apply(String,b.slice(A,A+=O));return p}function J(b,f,p){let A="";p=Math.min(b.length,p);for(let L=f;L<p;++L)A+=String.fromCharCode(b[L]&127);return A}function H(b,f,p){let A="";p=Math.min(b.length,p);for(let L=f;L<p;++L)A+=String.fromCharCode(b[L]);return A}function j(b,f,p){const A=b.length;(!f||f<0)&&(f=0),(!p||p<0||p>A)&&(p=A);let L="";for(let k=f;k<p;++k)L+=ve[b[k]];return L}function W(b,f,p){const A=b.slice(f,p);let L="";for(let k=0;k<A.length-1;k+=2)L+=String.fromCharCode(A[k]+A[k+1]*256);return L}a.prototype.slice=function(f,p){const A=this.length;f=~~f,p=p===void 0?A:~~p,f<0?(f+=A,f<0&&(f=0)):f>A&&(f=A),p<0?(p+=A,p<0&&(p=0)):p>A&&(p=A),p<f&&(p=f);const L=this.subarray(f,p);return Object.setPrototypeOf(L,a.prototype),L};function V(b,f,p){if(b%1!==0||b<0)throw new RangeError("offset is not uint");if(b+f>p)throw new RangeError("Trying to access beyond buffer length")}a.prototype.readUintLE=a.prototype.readUIntLE=function(f,p,A){f=f>>>0,p=p>>>0,A||V(f,p,this.length);let L=this[f],k=1,K=0;for(;++K<p&&(k*=256);)L+=this[f+K]*k;return L},a.prototype.readUintBE=a.prototype.readUIntBE=function(f,p,A){f=f>>>0,p=p>>>0,A||V(f,p,this.length);let L=this[f+--p],k=1;for(;p>0&&(k*=256);)L+=this[f+--p]*k;return L},a.prototype.readUint8=a.prototype.readUInt8=function(f,p){return f=f>>>0,p||V(f,1,this.length),this[f]},a.prototype.readUint16LE=a.prototype.readUInt16LE=function(f,p){return f=f>>>0,p||V(f,2,this.length),this[f]|this[f+1]<<8},a.prototype.readUint16BE=a.prototype.readUInt16BE=function(f,p){return f=f>>>0,p||V(f,2,this.length),this[f]<<8|this[f+1]},a.prototype.readUint32LE=a.prototype.readUInt32LE=function(f,p){return f=f>>>0,p||V(f,4,this.length),(this[f]|this[f+1]<<8|this[f+2]<<16)+this[f+3]*16777216},a.prototype.readUint32BE=a.prototype.readUInt32BE=function(f,p){return f=f>>>0,p||V(f,4,this.length),this[f]*16777216+(this[f+1]<<16|this[f+2]<<8|this[f+3])},a.prototype.readBigUInt64LE=fe(function(f){f=f>>>0,Q(f,"offset");const p=this[f],A=this[f+7];(p===void 0||A===void 0)&&he(f,this.length-8);const L=p+this[++f]*2**8+this[++f]*2**16+this[++f]*2**24,k=this[++f]+this[++f]*2**8+this[++f]*2**16+A*2**24;return BigInt(L)+(BigInt(k)<<BigInt(32))}),a.prototype.readBigUInt64BE=fe(function(f){f=f>>>0,Q(f,"offset");const p=this[f],A=this[f+7];(p===void 0||A===void 0)&&he(f,this.length-8);const L=p*2**24+this[++f]*2**16+this[++f]*2**8+this[++f],k=this[++f]*2**24+this[++f]*2**16+this[++f]*2**8+A;return(BigInt(L)<<BigInt(32))+BigInt(k)}),a.prototype.readIntLE=function(f,p,A){f=f>>>0,p=p>>>0,A||V(f,p,this.length);let L=this[f],k=1,K=0;for(;++K<p&&(k*=256);)L+=this[f+K]*k;return k*=128,L>=k&&(L-=Math.pow(2,8*p)),L},a.prototype.readIntBE=function(f,p,A){f=f>>>0,p=p>>>0,A||V(f,p,this.length);let L=p,k=1,K=this[f+--L];for(;L>0&&(k*=256);)K+=this[f+--L]*k;return k*=128,K>=k&&(K-=Math.pow(2,8*p)),K},a.prototype.readInt8=function(f,p){return f=f>>>0,p||V(f,1,this.length),this[f]&128?(255-this[f]+1)*-1:this[f]},a.prototype.readInt16LE=function(f,p){f=f>>>0,p||V(f,2,this.length);const A=this[f]|this[f+1]<<8;return A&32768?A|4294901760:A},a.prototype.readInt16BE=function(f,p){f=f>>>0,p||V(f,2,this.length);const A=this[f+1]|this[f]<<8;return A&32768?A|4294901760:A},a.prototype.readInt32LE=function(f,p){return f=f>>>0,p||V(f,4,this.length),this[f]|this[f+1]<<8|this[f+2]<<16|this[f+3]<<24},a.prototype.readInt32BE=function(f,p){return f=f>>>0,p||V(f,4,this.length),this[f]<<24|this[f+1]<<16|this[f+2]<<8|this[f+3]},a.prototype.readBigInt64LE=fe(function(f){f=f>>>0,Q(f,"offset");const p=this[f],A=this[f+7];(p===void 0||A===void 0)&&he(f,this.length-8);const L=this[f+4]+this[f+5]*2**8+this[f+6]*2**16+(A<<24);return(BigInt(L)<<BigInt(32))+BigInt(p+this[++f]*2**8+this[++f]*2**16+this[++f]*2**24)}),a.prototype.readBigInt64BE=fe(function(f){f=f>>>0,Q(f,"offset");const p=this[f],A=this[f+7];(p===void 0||A===void 0)&&he(f,this.length-8);const L=(p<<24)+this[++f]*2**16+this[++f]*2**8+this[++f];return(BigInt(L)<<BigInt(32))+BigInt(this[++f]*2**24+this[++f]*2**16+this[++f]*2**8+A)}),a.prototype.readFloatLE=function(f,p){return f=f>>>0,p||V(f,4,this.length),r.read(this,f,!0,23,4)},a.prototype.readFloatBE=function(f,p){return f=f>>>0,p||V(f,4,this.length),r.read(this,f,!1,23,4)},a.prototype.readDoubleLE=function(f,p){return f=f>>>0,p||V(f,8,this.length),r.read(this,f,!0,52,8)},a.prototype.readDoubleBE=function(f,p){return f=f>>>0,p||V(f,8,this.length),r.read(this,f,!1,52,8)};function ce(b,f,p,A,L,k){if(!a.isBuffer(b))throw new TypeError('"buffer" argument must be a Buffer instance');if(f>L||f<k)throw new RangeError('"value" argument is out of bounds');if(p+A>b.length)throw new RangeError("Index out of range")}a.prototype.writeUintLE=a.prototype.writeUIntLE=function(f,p,A,L){if(f=+f,p=p>>>0,A=A>>>0,!L){const se=Math.pow(2,8*A)-1;ce(this,f,p,A,se,0)}let k=1,K=0;for(this[p]=f&255;++K<A&&(k*=256);)this[p+K]=f/k&255;return p+A},a.prototype.writeUintBE=a.prototype.writeUIntBE=function(f,p,A,L){if(f=+f,p=p>>>0,A=A>>>0,!L){const se=Math.pow(2,8*A)-1;ce(this,f,p,A,se,0)}let k=A-1,K=1;for(this[p+k]=f&255;--k>=0&&(K*=256);)this[p+k]=f/K&255;return p+A},a.prototype.writeUint8=a.prototype.writeUInt8=function(f,p,A){return f=+f,p=p>>>0,A||ce(this,f,p,1,255,0),this[p]=f&255,p+1},a.prototype.writeUint16LE=a.prototype.writeUInt16LE=function(f,p,A){return f=+f,p=p>>>0,A||ce(this,f,p,2,65535,0),this[p]=f&255,this[p+1]=f>>>8,p+2},a.prototype.writeUint16BE=a.prototype.writeUInt16BE=function(f,p,A){return f=+f,p=p>>>0,A||ce(this,f,p,2,65535,0),this[p]=f>>>8,this[p+1]=f&255,p+2},a.prototype.writeUint32LE=a.prototype.writeUInt32LE=function(f,p,A){return f=+f,p=p>>>0,A||ce(this,f,p,4,4294967295,0),this[p+3]=f>>>24,this[p+2]=f>>>16,this[p+1]=f>>>8,this[p]=f&255,p+4},a.prototype.writeUint32BE=a.prototype.writeUInt32BE=function(f,p,A){return f=+f,p=p>>>0,A||ce(this,f,p,4,4294967295,0),this[p]=f>>>24,this[p+1]=f>>>16,this[p+2]=f>>>8,this[p+3]=f&255,p+4};function te(b,f,p,A,L){G(f,A,L,b,p,7);let k=Number(f&BigInt(4294967295));b[p++]=k,k=k>>8,b[p++]=k,k=k>>8,b[p++]=k,k=k>>8,b[p++]=k;let K=Number(f>>BigInt(32)&BigInt(4294967295));return b[p++]=K,K=K>>8,b[p++]=K,K=K>>8,b[p++]=K,K=K>>8,b[p++]=K,p}function Ce(b,f,p,A,L){G(f,A,L,b,p,7);let k=Number(f&BigInt(4294967295));b[p+7]=k,k=k>>8,b[p+6]=k,k=k>>8,b[p+5]=k,k=k>>8,b[p+4]=k;let K=Number(f>>BigInt(32)&BigInt(4294967295));return b[p+3]=K,K=K>>8,b[p+2]=K,K=K>>8,b[p+1]=K,K=K>>8,b[p]=K,p+8}a.prototype.writeBigUInt64LE=fe(function(f,p=0){return te(this,f,p,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeBigUInt64BE=fe(function(f,p=0){return Ce(this,f,p,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeIntLE=function(f,p,A,L){if(f=+f,p=p>>>0,!L){const de=Math.pow(2,8*A-1);ce(this,f,p,A,de-1,-de)}let k=0,K=1,se=0;for(this[p]=f&255;++k<A&&(K*=256);)f<0&&se===0&&this[p+k-1]!==0&&(se=1),this[p+k]=(f/K>>0)-se&255;return p+A},a.prototype.writeIntBE=function(f,p,A,L){if(f=+f,p=p>>>0,!L){const de=Math.pow(2,8*A-1);ce(this,f,p,A,de-1,-de)}let k=A-1,K=1,se=0;for(this[p+k]=f&255;--k>=0&&(K*=256);)f<0&&se===0&&this[p+k+1]!==0&&(se=1),this[p+k]=(f/K>>0)-se&255;return p+A},a.prototype.writeInt8=function(f,p,A){return f=+f,p=p>>>0,A||ce(this,f,p,1,127,-128),f<0&&(f=255+f+1),this[p]=f&255,p+1},a.prototype.writeInt16LE=function(f,p,A){return f=+f,p=p>>>0,A||ce(this,f,p,2,32767,-32768),this[p]=f&255,this[p+1]=f>>>8,p+2},a.prototype.writeInt16BE=function(f,p,A){return f=+f,p=p>>>0,A||ce(this,f,p,2,32767,-32768),this[p]=f>>>8,this[p+1]=f&255,p+2},a.prototype.writeInt32LE=function(f,p,A){return f=+f,p=p>>>0,A||ce(this,f,p,4,2147483647,-2147483648),this[p]=f&255,this[p+1]=f>>>8,this[p+2]=f>>>16,this[p+3]=f>>>24,p+4},a.prototype.writeInt32BE=function(f,p,A){return f=+f,p=p>>>0,A||ce(this,f,p,4,2147483647,-2147483648),f<0&&(f=4294967295+f+1),this[p]=f>>>24,this[p+1]=f>>>16,this[p+2]=f>>>8,this[p+3]=f&255,p+4},a.prototype.writeBigInt64LE=fe(function(f,p=0){return te(this,f,p,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),a.prototype.writeBigInt64BE=fe(function(f,p=0){return Ce(this,f,p,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function ne(b,f,p,A,L,k){if(p+A>b.length)throw new RangeError("Index out of range");if(p<0)throw new RangeError("Index out of range")}function Oe(b,f,p,A,L){return f=+f,p=p>>>0,L||ne(b,f,p,4),r.write(b,f,p,A,23,4),p+4}a.prototype.writeFloatLE=function(f,p,A){return Oe(this,f,p,!0,A)},a.prototype.writeFloatBE=function(f,p,A){return Oe(this,f,p,!1,A)};function T(b,f,p,A,L){return f=+f,p=p>>>0,L||ne(b,f,p,8),r.write(b,f,p,A,52,8),p+8}a.prototype.writeDoubleLE=function(f,p,A){return T(this,f,p,!0,A)},a.prototype.writeDoubleBE=function(f,p,A){return T(this,f,p,!1,A)},a.prototype.copy=function(f,p,A,L){if(!a.isBuffer(f))throw new TypeError("argument should be a Buffer");if(A||(A=0),!L&&L!==0&&(L=this.length),p>=f.length&&(p=f.length),p||(p=0),L>0&&L<A&&(L=A),L===A||f.length===0||this.length===0)return 0;if(p<0)throw new RangeError("targetStart out of bounds");if(A<0||A>=this.length)throw new RangeError("Index out of range");if(L<0)throw new RangeError("sourceEnd out of bounds");L>this.length&&(L=this.length),f.length-p<L-A&&(L=f.length-p+A);const k=L-A;return this===f&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(p,A,L):Uint8Array.prototype.set.call(f,this.subarray(A,L),p),k},a.prototype.fill=function(f,p,A,L){if(typeof f=="string"){if(typeof p=="string"?(L=p,p=0,A=this.length):typeof A=="string"&&(L=A,A=this.length),L!==void 0&&typeof L!="string")throw new TypeError("encoding must be a string");if(typeof L=="string"&&!a.isEncoding(L))throw new TypeError("Unknown encoding: "+L);if(f.length===1){const K=f.charCodeAt(0);(L==="utf8"&&K<128||L==="latin1")&&(f=K)}}else typeof f=="number"?f=f&255:typeof f=="boolean"&&(f=Number(f));if(p<0||this.length<p||this.length<A)throw new RangeError("Out of range index");if(A<=p)return this;p=p>>>0,A=A===void 0?this.length:A>>>0,f||(f=0);let k;if(typeof f=="number")for(k=p;k<A;++k)this[k]=f;else{const K=a.isBuffer(f)?f:a.from(f,L),se=K.length;if(se===0)throw new TypeError('The value "'+f+'" is invalid for argument "value"');for(k=0;k<A-p;++k)this[k+p]=K[k%se]}return this};const F={};function I(b,f,p){F[b]=class extends p{constructor(){super(),Object.defineProperty(this,"message",{value:f.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${b}]`,this.stack,delete this.name}get code(){return b}set code(L){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:L,writable:!0})}toString(){return`${this.name} [${b}]: ${this.message}`}}}I("ERR_BUFFER_OUT_OF_BOUNDS",function(b){return b?`${b} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),I("ERR_INVALID_ARG_TYPE",function(b,f){return`The "${b}" argument must be of type number. Received type ${typeof f}`},TypeError),I("ERR_OUT_OF_RANGE",function(b,f,p){let A=`The value of "${b}" is out of range.`,L=p;return Number.isInteger(p)&&Math.abs(p)>2**32?L=c(String(p)):typeof p=="bigint"&&(L=String(p),(p>BigInt(2)**BigInt(32)||p<-(BigInt(2)**BigInt(32)))&&(L=c(L)),L+="n"),A+=` It must be ${f}. Received ${L}`,A},RangeError);function c(b){let f="",p=b.length;const A=b[0]==="-"?1:0;for(;p>=A+4;p-=3)f=`_${b.slice(p-3,p)}${f}`;return`${b.slice(0,p)}${f}`}function w(b,f,p){Q(f,"offset"),(b[f]===void 0||b[f+p]===void 0)&&he(f,b.length-(p+1))}function G(b,f,p,A,L,k){if(b>p||b<f){const K=typeof f=="bigint"?"n":"";let se;throw k>3?f===0||f===BigInt(0)?se=`>= 0${K} and < 2${K} ** ${(k+1)*8}${K}`:se=`>= -(2${K} ** ${(k+1)*8-1}${K}) and < 2 ** ${(k+1)*8-1}${K}`:se=`>= ${f}${K} and <= ${p}${K}`,new F.ERR_OUT_OF_RANGE("value",se,b)}w(A,L,k)}function Q(b,f){if(typeof b!="number")throw new F.ERR_INVALID_ARG_TYPE(f,"number",b)}function he(b,f,p){throw Math.floor(b)!==b?(Q(b,p),new F.ERR_OUT_OF_RANGE(p||"offset","an integer",b)):f<0?new F.ERR_BUFFER_OUT_OF_BOUNDS:new F.ERR_OUT_OF_RANGE(p||"offset",`>= ${p?1:0} and <= ${f}`,b)}const be=/[^+/0-9A-Za-z-_]/g;function pe(b){if(b=b.split("=")[0],b=b.trim().replace(be,""),b.length<2)return"";for(;b.length%4!==0;)b=b+"=";return b}function ye(b,f){f=f||1/0;let p;const A=b.length;let L=null;const k=[];for(let K=0;K<A;++K){if(p=b.charCodeAt(K),p>55295&&p<57344){if(!L){if(p>56319){(f-=3)>-1&&k.push(239,191,189);continue}else if(K+1===A){(f-=3)>-1&&k.push(239,191,189);continue}L=p;continue}if(p<56320){(f-=3)>-1&&k.push(239,191,189),L=p;continue}p=(L-55296<<10|p-56320)+65536}else L&&(f-=3)>-1&&k.push(239,191,189);if(L=null,p<128){if((f-=1)<0)break;k.push(p)}else if(p<2048){if((f-=2)<0)break;k.push(p>>6|192,p&63|128)}else if(p<65536){if((f-=3)<0)break;k.push(p>>12|224,p>>6&63|128,p&63|128)}else if(p<1114112){if((f-=4)<0)break;k.push(p>>18|240,p>>12&63|128,p>>6&63|128,p&63|128)}else throw new Error("Invalid code point")}return k}function ze(b){const f=[];for(let p=0;p<b.length;++p)f.push(b.charCodeAt(p)&255);return f}function Ue(b,f){let p,A,L;const k=[];for(let K=0;K<b.length&&!((f-=2)<0);++K)p=b.charCodeAt(K),A=p>>8,L=p%256,k.push(L),k.push(A);return k}function xe(b){return e.toByteArray(pe(b))}function Ee(b,f,p,A){let L;for(L=0;L<A&&!(L+p>=f.length||L>=b.length);++L)f[L+p]=b[L];return L}function ge(b,f){return b instanceof f||b!=null&&b.constructor!=null&&b.constructor.name!=null&&b.constructor.name===f.name}function we(b){return b!==b}const ve=function(){const b="0123456789abcdef",f=new Array(256);for(let p=0;p<16;++p){const A=p*16;for(let L=0;L<16;++L)f[A+L]=b[p]+b[L]}return f}();function fe(b){return typeof BigInt>"u"?me:b}function me(){throw new Error("BigInt not supported")}})(ud);const ft=Hr({selectedChain:void 0,chains:void 0,standaloneChains:void 0,standaloneUri:void 0,address:void 0,profileName:void 0,profileAvatar:void 0,profileLoading:!1,balanceLoading:!1,balance:void 0,isConnected:!1,isStandalone:!1,isCustomDesktop:!1,isCustomMobile:!1,isDataLoaded:!1,isUiLoaded:!1,walletConnectVersion:1}),oe={state:ft,subscribe(t){return Vi(ft,()=>t(ft))},setChains(t){ft.chains=t},setStandaloneChains(t){ft.standaloneChains=t},setStandaloneUri(t){ft.standaloneUri=t},getSelectedChain(){const t=wt.client().getNetwork().chain;return t&&(ft.selectedChain=t),ft.selectedChain},setSelectedChain(t){ft.selectedChain=t},setIsStandalone(t){ft.isStandalone=t},setIsCustomDesktop(t){ft.isCustomDesktop=t},setIsCustomMobile(t){ft.isCustomMobile=t},getAccount(){const t=wt.client().getAccount();ft.address=t.address,ft.isConnected=t.isConnected},setAddress(t){ft.address=t},setIsConnected(t){ft.isConnected=t},setProfileName(t){ft.profileName=t},setProfileAvatar(t){ft.profileAvatar=t},setProfileLoading(t){ft.profileLoading=t},setBalanceLoading(t){ft.balanceLoading=t},setBalance(t){ft.balance=t},setIsDataLoaded(t){ft.isDataLoaded=t},setIsUiLoaded(t){ft.isUiLoaded=t},setWalletConnectVersion(t){ft.walletConnectVersion=t},resetEnsProfile(){ft.profileName=void 0,ft.profileAvatar=void 0},resetBalance(){ft.balance=void 0},resetAccount(){ft.address=void 0,ft.isConnected=!1,oe.resetEnsProfile(),oe.resetBalance()}},qi=Hr({initialized:!1,ethereumClient:void 0}),wt={setEthereumClient(t){!qi.initialized&&t&&(qi.ethereumClient=t,oe.setChains(t.chains),qi.initialized=!0)},client(){if(qi.ethereumClient)return qi.ethereumClient;throw new Error("ClientCtrl has no client set")}},ct={WALLETCONNECT_DEEPLINK_CHOICE:"WALLETCONNECT_DEEPLINK_CHOICE",isMobile(){return typeof window<"u"?Boolean(window.matchMedia("(pointer:coarse)").matches||/Android|webOS|iPhone|iPad|iPod|BlackBerry|Opera Mini/u.test(navigator.userAgent)):!1},isAndroid(){return ct.isMobile()&&navigator.userAgent.toLowerCase().includes("android")},isEmptyObject(t){return Object.getPrototypeOf(t)===Object.prototype&&Object.getOwnPropertyNames(t).length===0&&Object.getOwnPropertySymbols(t).length===0},isHttpUrl(t){return t.startsWith("http://")||t.startsWith("https://")},formatNativeUrl(t,e,r){if(ct.isHttpUrl(t))return this.formatUniversalUrl(t,e,r);let n=t;n.includes("://")||(n=t.replaceAll("/","").replaceAll(":",""),n=`${n}://`),this.setWalletConnectDeepLink(n,r);const i=encodeURIComponent(e);return`${n}wc?uri=${i}`},formatUniversalUrl(t,e,r){if(!ct.isHttpUrl(t))return this.formatNativeUrl(t,e,r);let n=t;t.endsWith("/")&&(n=t.slice(0,-1)),this.setWalletConnectDeepLink(n,r);const i=encodeURIComponent(e);return`${n}/wc?uri=${i}`},async wait(t){return new Promise(e=>{setTimeout(e,t)})},openHref(t,e="_self"){window.open(t,e,"noreferrer noopener")},setWalletConnectDeepLink(t,e){localStorage.setItem(ct.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:t,name:e}))},setWalletConnectAndroidDeepLink(t){const[e]=t.split("?");localStorage.setItem(ct.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:e,name:"Android"}))},removeWalletConnectDeepLink(){localStorage.removeItem(ct.WALLETCONNECT_DEEPLINK_CHOICE)},isNull(t){return t===null}};function w9(){return typeof matchMedia<"u"&&matchMedia("(prefers-color-scheme: dark)").matches}const Ki=Hr({projectId:"",themeMode:w9()?"dark":"light",themeColor:"default",themeBackground:ct.isMobile()?"themeColor":"gradient",themeZIndex:89,mobileWallets:void 0,desktopWallets:void 0,walletImages:void 0,chainImages:void 0,tokenImages:void 0,standaloneChains:void 0,enableStandaloneMode:!1,enableNetworkView:!1,enableAccountView:!0,defaultChain:void 0,explorerAllowList:void 0,explorerDenyList:void 0,termsOfServiceUrl:void 0,privacyPolicyUrl:void 0}),vt={state:Ki,subscribe(t){return Vi(Ki,()=>t(Ki))},setConfig(t){var e,r,n,i;if(oe.setStandaloneChains(t.standaloneChains),oe.setIsStandalone(Boolean((e=t.standaloneChains)==null?void 0:e.length)||Boolean(t.enableStandaloneMode)),oe.setIsCustomMobile(Boolean((r=t.mobileWallets)==null?void 0:r.length)),oe.setIsCustomDesktop(Boolean((n=t.desktopWallets)==null?void 0:n.length)),oe.setWalletConnectVersion((i=t.walletConnectVersion)!=null?i:1),t.defaultChain)oe.setSelectedChain(t.defaultChain);else if(!oe.state.isStandalone){const o=wt.client().getDefaultChain();oe.setSelectedChain(o)}Object.assign(Ki,t)},setThemeConfig(t){Object.assign(Ki,t)}},fd="https://explorer-api.walletconnect.com";function v9(t){const e=Object.fromEntries(Object.entries(t).filter(([r,n])=>typeof n<"u"&&n!==null&&n!=="").map(([r,n])=>[r,n.toString()]));return new URLSearchParams(e).toString()}const ws={async fetchWallets(t,e){const r=v9(e),n=`${fd}/v3/wallets?projectId=${t}&${r}`;return(await fetch(n)).json()},formatImageUrl(t,e){return`${fd}/v3/logo/lg/${e}?projectId=${t}`}},ln=Hr({wallets:{listings:[],total:0,page:1},search:{listings:[],total:0,page:1},previewWallets:[],recomendedWallets:[]});function vs(){const{projectId:t}=vt.state;if(!t)throw new Error("projectId is required to work with explorer api");return t}const Ct={state:ln,async getPreviewWallets(t){const{listings:e}=await ws.fetchWallets(vs(),t);return ln.previewWallets=Object.values(e),ln.previewWallets},async getRecomendedWallets(){const{listings:t}=await ws.fetchWallets(vs(),{page:1,entries:6});ln.recomendedWallets=Object.values(t)},async getPaginatedWallets(t){const{page:e,search:r}=t,{listings:n,total:i}=await ws.fetchWallets(vs(),t),o=Object.values(n),s=r?"search":"wallets";return ln[s]={listings:[...ln[s].listings,...o],total:i,page:e??1},{listings:o,total:i}},getImageUrl(t){return ws.formatImageUrl(vs(),t)},resetSearch(){ln.search={listings:[],total:0,page:1}}},nr=Hr({history:["ConnectWallet"],view:"ConnectWallet",data:void 0}),st={state:nr,subscribe(t){return Vi(nr,()=>t(nr))},push(t,e){t!==nr.view&&(nr.view=t,e&&(nr.data=e),nr.history.push(t))},replace(t){nr.view=t,nr.history=[t]},goBack(){if(nr.history.length>1){nr.history.pop();const[t]=nr.history.slice(-1);nr.view=t}}},Bn=Hr({open:!1}),Ft={state:Bn,subscribe(t){return Vi(Bn,()=>t(Bn))},async open(t){return new Promise(e=>{const{isConnected:r,isStandalone:n,isUiLoaded:i,isDataLoaded:o}=oe.state,{enableNetworkView:s}=vt.state;if(n?(oe.setStandaloneUri(t?.uri),oe.setStandaloneChains(t?.standaloneChains),st.replace("ConnectWallet")):t!=null&&t.route?st.replace(t.route):r?st.replace("Account"):s?st.replace("SelectNetwork"):st.replace("ConnectWallet"),i&&o)Bn.open=!0,e();else{const a=setInterval(()=>{oe.state.isUiLoaded&&oe.state.isDataLoaded&&(clearInterval(a),Bn.open=!0,e())},200)}})},close(){Bn.open=!1}},un=Hr({open:!1,message:"",variant:"success"}),er={state:un,subscribe(t){return Vi(un,()=>t(un))},openToast(t,e){un.open=!0,un.message=t,un.variant=e},closeToast(){un.open=!1}};typeof window<"u"&&(window.Buffer||(window.Buffer=ud.Buffer),window.global||(window.global=window),window.process||(window.process={env:{}}));var _9=Object.defineProperty,dd=Object.getOwnPropertySymbols,E9=Object.prototype.hasOwnProperty,x9=Object.prototype.propertyIsEnumerable,pd=(t,e,r)=>e in t?_9(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,C9=(t,e)=>{for(var r in e||(e={}))E9.call(e,r)&&pd(t,r,e[r]);if(dd)for(var r of dd(e))x9.call(e,r)&&pd(t,r,e[r]);return t};class S9{constructor(e){this.openModal=Ft.open,this.closeModal=Ft.close,this.subscribeModal=Ft.subscribe,this.setTheme=vt.setThemeConfig,vt.setConfig(C9({enableStandaloneMode:!0},e)),this.initUi()}async initUi(){if(typeof window<"u"){await Promise.resolve().then(function(){return $I});const e=document.createElement("w3m-modal");document.body.insertAdjacentElement("beforeend",e),oe.setIsUiLoaded(!0)}}}const A9="https://rpc.walletconnect.com/v1/",I9=["eth_requestAccounts","eth_accounts","eth_chainId","eth_sendTransaction","eth_signTransaction","eth_sign","eth_signTypedData","personal_sign"],O9=["chainChanged","accountsChanged"];function D9(t){return Number(t[0].split(":")[1])}class _s{constructor(){this.events=new Dt.exports.EventEmitter,this.namespace="eip155",this.accounts=[],this.chainId=1,this.signer={},this.rpc={}}static async init(e){const r=new _s;return await r.initialize(e),r}async request(e){return await this.signer.request(e,this.formatChainId(this.chainId))}sendAsync(e,r){this.signer.sendAsync(e,r,this.formatChainId(this.chainId))}get connected(){return this.signer.client?this.signer.client.core.relayer.connected:!1}get connecting(){return this.signer.client?this.signer.client.core.relayer.connecting:!1}async enable(){return this.session||await this.connect(),await this.request({method:"eth_requestAccounts"})}async connect(e){if(!this.signer.client)throw new Error("Provider not initialized. Call init() first");this.loadConnectOpts(e);try{const r=await this.signer.connect({namespaces:{[this.namespace]:{chains:this.rpc.chains,methods:this.rpc.methods,events:this.rpc.events,rpcMap:this.rpc.rpcMap}},pairingTopic:e?.pairingTopic});if(!r)return;this.setChainIds(this.rpc.chains);const n=s5(r.namespaces,[this.namespace]);this.setAccounts(n),this.events.emit("connect",{chainId:this.chainId,accounts:this.accounts})}catch(r){throw new Error(r.message)}finally{this.modal&&this.modal.closeModal()}}async disconnect(){this.session&&await this.signer.disconnect(),this.reset()}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}removeListener(e,r){this.events.removeListener(e,r)}off(e,r){this.events.off(e,r)}get isWalletConnect(){return!0}get session(){return this.signer.session}registerEventListeners(){this.signer.on("session_event",e=>{const{params:r}=e;if(!this.rpc.chains.includes(r.chainId))return;const{event:n}=r;n.name==="accountsChanged"?(this.accounts=n.data,this.events.emit("accountsChanged",this.accounts)):n.name==="chainChanged"?this.setChainId(this.formatChainId(n.data)):this.events.emit(n.name,n.data),this.events.emit("session_event",e)}),this.signer.on("chainChanged",e=>{this.chainId=e,this.events.emit("chainChanged",e)}),this.signer.on("session_update",e=>{this.events.emit("session_update",e)}),this.signer.on("session_delete",e=>{this.reset(),this.events.emit("session_delete",e)}),this.signer.on("display_uri",e=>{var r;this.rpc.showQrModal&&((r=this.modal)==null||r.openModal({uri:e})),this.events.emit("display_uri",e)})}setHttpProvider(e){const r=this.formatChainId(e);this.signer.setDefaultChain(r,this.getRpcUrl(e))}isCompatibleChainId(e){return typeof e=="string"?e.startsWith(`${this.namespace}:`):!1}formatChainId(e){return`${this.namespace}:${e}`}parseChainId(e){return Number(e.split(":")[1])}setChainIds(e){const r=e.filter(n=>this.isCompatibleChainId(n)).map(n=>this.parseChainId(n));r.length&&(this.chainId=r[0],this.events.emit("chainChanged",this.chainId))}setChainId(e){if(this.isCompatibleChainId(e)){const r=this.parseChainId(e);this.chainId=r,this.setHttpProvider(r)}}parseAccountId(e){const[r,n,i]=e.split(":");return{chainId:`${r}:${n}`,address:i}}setAccounts(e){this.accounts=e.filter(r=>this.parseChainId(this.parseAccountId(r).chainId)===this.chainId).map(r=>this.parseAccountId(r).address),this.events.emit("accountsChanged",this.accounts)}getRpcConfig(e){var r;return{chains:e.chains.map(n=>this.formatChainId(n))||[`${this.namespace}:1`],methods:e?.methods||I9,events:e?.events||O9,rpcMap:e?.rpcMap||this.buildRpcMap(e.chains,e.projectId),showQrModal:(r=e?.showQrModal)!=null?r:!0,projectId:e.projectId,metadata:e.metadata}}buildRpcMap(e,r){const n={};return e.forEach(i=>{n[i]=this.getRpcUrl(i,r)}),n}async initialize(e){this.rpc=this.getRpcConfig(e),this.chainId=D9(this.rpc.chains),this.signer=await i9.init({projectId:this.rpc.projectId}),this.registerEventListeners(),this.loadPersistedSession(),this.rpc.showQrModal&&(this.modal=new S9({walletConnectVersion:2,projectId:this.rpc.projectId,standaloneChains:this.rpc.chains}))}loadConnectOpts(e){if(!e)return;const{chains:r,rpcMap:n}=e;!$n(r)||!r||(this.rpc.chains=this.rpc.chains.concat(r.map(i=>this.formatChainId(i))),this.rpc.chains=[...new Set(this.rpc.chains)],r.forEach(i=>{this.rpc.rpcMap[i]=n?.[i]||this.getRpcUrl(i)}))}getRpcUrl(e,r){var n;return((n=this.rpc.rpcMap)==null?void 0:n[e])||`${A9}?chainId=eip155:${e}&projectId=${r||this.rpc.projectId}`}loadPersistedSession(){this.session&&(this.setChainIds(this.session.namespaces[this.namespace].accounts),this.setAccounts(this.session.namespaces[this.namespace].accounts))}reset(){this.chainId=1,this.accounts=[]}}const $9=_s;/**
71
+ */(function(t){const e=ws,r=Ia,n=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=a,t.SlowBuffer=x,t.INSPECT_MAX_BYTES=50;const i=2147483647;t.kMaxLength=i,a.TYPED_ARRAY_SUPPORT=s(),!a.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function s(){try{const g=new Uint8Array(1),u={foo:function(){return 42}};return Object.setPrototypeOf(u,Uint8Array.prototype),Object.setPrototypeOf(g,u),g.foo()===42}catch{return!1}}Object.defineProperty(a.prototype,"parent",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.buffer}}),Object.defineProperty(a.prototype,"offset",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.byteOffset}});function o(g){if(g>i)throw new RangeError('The value "'+g+'" is invalid for option "size"');const u=new Uint8Array(g);return Object.setPrototypeOf(u,a.prototype),u}function a(g,u,d){if(typeof g=="number"){if(typeof u=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return w(g)}return c(g,u,d)}a.poolSize=8192;function c(g,u,d){if(typeof g=="string")return y(g,u);if(ArrayBuffer.isView(g))return E(g);if(g==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof g);if(ge(g,ArrayBuffer)||g&&ge(g.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(ge(g,SharedArrayBuffer)||g&&ge(g.buffer,SharedArrayBuffer)))return A(g,u,d);if(typeof g=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const v=g.valueOf&&g.valueOf();if(v!=null&&v!==g)return a.from(v,u,d);const T=N(g);if(T)return T;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof g[Symbol.toPrimitive]=="function")return a.from(g[Symbol.toPrimitive]("string"),u,d);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof g)}a.from=function(g,u,d){return c(g,u,d)},Object.setPrototypeOf(a.prototype,Uint8Array.prototype),Object.setPrototypeOf(a,Uint8Array);function l(g){if(typeof g!="number")throw new TypeError('"size" argument must be of type number');if(g<0)throw new RangeError('The value "'+g+'" is invalid for option "size"')}function p(g,u,d){return l(g),g<=0?o(g):u!==void 0?typeof d=="string"?o(g).fill(u,d):o(g).fill(u):o(g)}a.alloc=function(g,u,d){return p(g,u,d)};function w(g){return l(g),o(g<0?0:M(g)|0)}a.allocUnsafe=function(g){return w(g)},a.allocUnsafeSlow=function(g){return w(g)};function y(g,u){if((typeof u!="string"||u==="")&&(u="utf8"),!a.isEncoding(u))throw new TypeError("Unknown encoding: "+u);const d=D(g,u)|0;let v=o(d);const T=v.write(g,u);return T!==d&&(v=v.slice(0,T)),v}function m(g){const u=g.length<0?0:M(g.length)|0,d=o(u);for(let v=0;v<u;v+=1)d[v]=g[v]&255;return d}function E(g){if(ge(g,Uint8Array)){const u=new Uint8Array(g);return A(u.buffer,u.byteOffset,u.byteLength)}return m(g)}function A(g,u,d){if(u<0||g.byteLength<u)throw new RangeError('"offset" is outside of buffer bounds');if(g.byteLength<u+(d||0))throw new RangeError('"length" is outside of buffer bounds');let v;return u===void 0&&d===void 0?v=new Uint8Array(g):d===void 0?v=new Uint8Array(g,u):v=new Uint8Array(g,u,d),Object.setPrototypeOf(v,a.prototype),v}function N(g){if(a.isBuffer(g)){const u=M(g.length)|0,d=o(u);return d.length===0||g.copy(d,0,0,u),d}if(g.length!==void 0)return typeof g.length!="number"||Se(g.length)?o(0):m(g);if(g.type==="Buffer"&&Array.isArray(g.data))return m(g.data)}function M(g){if(g>=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return g|0}function x(g){return+g!=g&&(g=0),a.alloc(+g)}a.isBuffer=function(u){return u!=null&&u._isBuffer===!0&&u!==a.prototype},a.compare=function(u,d){if(ge(u,Uint8Array)&&(u=a.from(u,u.offset,u.byteLength)),ge(d,Uint8Array)&&(d=a.from(d,d.offset,d.byteLength)),!a.isBuffer(u)||!a.isBuffer(d))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(u===d)return 0;let v=u.length,T=d.length;for(let U=0,k=Math.min(v,T);U<k;++U)if(u[U]!==d[U]){v=u[U],T=d[U];break}return v<T?-1:T<v?1:0},a.isEncoding=function(u){switch(String(u).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},a.concat=function(u,d){if(!Array.isArray(u))throw new TypeError('"list" argument must be an Array of Buffers');if(u.length===0)return a.alloc(0);let v;if(d===void 0)for(d=0,v=0;v<u.length;++v)d+=u[v].length;const T=a.allocUnsafe(d);let U=0;for(v=0;v<u.length;++v){let k=u[v];if(ge(k,Uint8Array))U+k.length>T.length?(a.isBuffer(k)||(k=a.from(k)),k.copy(T,U)):Uint8Array.prototype.set.call(T,k,U);else if(a.isBuffer(k))k.copy(T,U);else throw new TypeError('"list" argument must be an Array of Buffers');U+=k.length}return T};function D(g,u){if(a.isBuffer(g))return g.length;if(ArrayBuffer.isView(g)||ge(g,ArrayBuffer))return g.byteLength;if(typeof g!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof g);const d=g.length,v=arguments.length>2&&arguments[2]===!0;if(!v&&d===0)return 0;let T=!1;for(;;)switch(u){case"ascii":case"latin1":case"binary":return d;case"utf8":case"utf-8":return Me(g).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return d*2;case"hex":return d>>>1;case"base64":return Pe(g).length;default:if(T)return v?-1:Me(g).length;u=(""+u).toLowerCase(),T=!0}}a.byteLength=D;function b(g,u,d){let v=!1;if((u===void 0||u<0)&&(u=0),u>this.length||((d===void 0||d>this.length)&&(d=this.length),d<=0)||(d>>>=0,u>>>=0,d<=u))return"";for(g||(g="utf8");;)switch(g){case"hex":return z(this,u,d);case"utf8":case"utf-8":return C(this,u,d);case"ascii":return K(this,u,d);case"latin1":case"binary":return W(this,u,d);case"base64":return re(this,u,d);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return J(this,u,d);default:if(v)throw new TypeError("Unknown encoding: "+g);g=(g+"").toLowerCase(),v=!0}}a.prototype._isBuffer=!0;function I(g,u,d){const v=g[u];g[u]=g[d],g[d]=v}a.prototype.swap16=function(){const u=this.length;if(u%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let d=0;d<u;d+=2)I(this,d,d+1);return this},a.prototype.swap32=function(){const u=this.length;if(u%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let d=0;d<u;d+=4)I(this,d,d+3),I(this,d+1,d+2);return this},a.prototype.swap64=function(){const u=this.length;if(u%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let d=0;d<u;d+=8)I(this,d,d+7),I(this,d+1,d+6),I(this,d+2,d+5),I(this,d+3,d+4);return this},a.prototype.toString=function(){const u=this.length;return u===0?"":arguments.length===0?C(this,0,u):b.apply(this,arguments)},a.prototype.toLocaleString=a.prototype.toString,a.prototype.equals=function(u){if(!a.isBuffer(u))throw new TypeError("Argument must be a Buffer");return this===u?!0:a.compare(this,u)===0},a.prototype.inspect=function(){let u="";const d=t.INSPECT_MAX_BYTES;return u=this.toString("hex",0,d).replace(/(.{2})/g,"$1 ").trim(),this.length>d&&(u+=" ... "),"<Buffer "+u+">"},n&&(a.prototype[n]=a.prototype.inspect),a.prototype.compare=function(u,d,v,T,U){if(ge(u,Uint8Array)&&(u=a.from(u,u.offset,u.byteLength)),!a.isBuffer(u))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof u);if(d===void 0&&(d=0),v===void 0&&(v=u?u.length:0),T===void 0&&(T=0),U===void 0&&(U=this.length),d<0||v>u.length||T<0||U>this.length)throw new RangeError("out of range index");if(T>=U&&d>=v)return 0;if(T>=U)return-1;if(d>=v)return 1;if(d>>>=0,v>>>=0,T>>>=0,U>>>=0,this===u)return 0;let k=U-T,oe=v-d;const he=Math.min(k,oe),Ne=this.slice(T,U),Fe=u.slice(d,v);for(let Re=0;Re<he;++Re)if(Ne[Re]!==Fe[Re]){k=Ne[Re],oe=Fe[Re];break}return k<oe?-1:oe<k?1:0};function O(g,u,d,v,T){if(g.length===0)return-1;if(typeof d=="string"?(v=d,d=0):d>2147483647?d=2147483647:d<-2147483648&&(d=-2147483648),d=+d,Se(d)&&(d=T?0:g.length-1),d<0&&(d=g.length+d),d>=g.length){if(T)return-1;d=g.length-1}else if(d<0)if(T)d=0;else return-1;if(typeof u=="string"&&(u=a.from(u,v)),a.isBuffer(u))return u.length===0?-1:h(g,u,d,v,T);if(typeof u=="number")return u=u&255,typeof Uint8Array.prototype.indexOf=="function"?T?Uint8Array.prototype.indexOf.call(g,u,d):Uint8Array.prototype.lastIndexOf.call(g,u,d):h(g,[u],d,v,T);throw new TypeError("val must be string, number or Buffer")}function h(g,u,d,v,T){let U=1,k=g.length,oe=u.length;if(v!==void 0&&(v=String(v).toLowerCase(),v==="ucs2"||v==="ucs-2"||v==="utf16le"||v==="utf-16le")){if(g.length<2||u.length<2)return-1;U=2,k/=2,oe/=2,d/=2}function he(Fe,Re){return U===1?Fe[Re]:Fe.readUInt16BE(Re*U)}let Ne;if(T){let Fe=-1;for(Ne=d;Ne<k;Ne++)if(he(g,Ne)===he(u,Fe===-1?0:Ne-Fe)){if(Fe===-1&&(Fe=Ne),Ne-Fe+1===oe)return Fe*U}else Fe!==-1&&(Ne-=Ne-Fe),Fe=-1}else for(d+oe>k&&(d=k-oe),Ne=d;Ne>=0;Ne--){let Fe=!0;for(let Re=0;Re<oe;Re++)if(he(g,Ne+Re)!==he(u,Re)){Fe=!1;break}if(Fe)return Ne}return-1}a.prototype.includes=function(u,d,v){return this.indexOf(u,d,v)!==-1},a.prototype.indexOf=function(u,d,v){return O(this,u,d,v,!0)},a.prototype.lastIndexOf=function(u,d,v){return O(this,u,d,v,!1)};function _(g,u,d,v){d=Number(d)||0;const T=g.length-d;v?(v=Number(v),v>T&&(v=T)):v=T;const U=u.length;v>U/2&&(v=U/2);let k;for(k=0;k<v;++k){const oe=parseInt(u.substr(k*2,2),16);if(Se(oe))return k;g[d+k]=oe}return k}function H(g,u,d,v){return De(Me(u,g.length-d),g,d,v)}function j(g,u,d,v){return De(Ye(u),g,d,v)}function q(g,u,d,v){return De(Pe(u),g,d,v)}function X(g,u,d,v){return De(Ke(u,g.length-d),g,d,v)}a.prototype.write=function(u,d,v,T){if(d===void 0)T="utf8",v=this.length,d=0;else if(v===void 0&&typeof d=="string")T=d,v=this.length,d=0;else if(isFinite(d))d=d>>>0,isFinite(v)?(v=v>>>0,T===void 0&&(T="utf8")):(T=v,v=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const U=this.length-d;if((v===void 0||v>U)&&(v=U),u.length>0&&(v<0||d<0)||d>this.length)throw new RangeError("Attempt to write outside buffer bounds");T||(T="utf8");let k=!1;for(;;)switch(T){case"hex":return _(this,u,d,v);case"utf8":case"utf-8":return H(this,u,d,v);case"ascii":case"latin1":case"binary":return j(this,u,d,v);case"base64":return q(this,u,d,v);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return X(this,u,d,v);default:if(k)throw new TypeError("Unknown encoding: "+T);T=(""+T).toLowerCase(),k=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function re(g,u,d){return u===0&&d===g.length?e.fromByteArray(g):e.fromByteArray(g.slice(u,d))}function C(g,u,d){d=Math.min(g.length,d);const v=[];let T=u;for(;T<d;){const U=g[T];let k=null,oe=U>239?4:U>223?3:U>191?2:1;if(T+oe<=d){let he,Ne,Fe,Re;switch(oe){case 1:U<128&&(k=U);break;case 2:he=g[T+1],(he&192)===128&&(Re=(U&31)<<6|he&63,Re>127&&(k=Re));break;case 3:he=g[T+1],Ne=g[T+2],(he&192)===128&&(Ne&192)===128&&(Re=(U&15)<<12|(he&63)<<6|Ne&63,Re>2047&&(Re<55296||Re>57343)&&(k=Re));break;case 4:he=g[T+1],Ne=g[T+2],Fe=g[T+3],(he&192)===128&&(Ne&192)===128&&(Fe&192)===128&&(Re=(U&15)<<18|(he&63)<<12|(Ne&63)<<6|Fe&63,Re>65535&&Re<1114112&&(k=Re))}}k===null?(k=65533,oe=1):k>65535&&(k-=65536,v.push(k>>>10&1023|55296),k=56320|k&1023),v.push(k),T+=oe}return G(v)}const $=4096;function G(g){const u=g.length;if(u<=$)return String.fromCharCode.apply(String,g);let d="",v=0;for(;v<u;)d+=String.fromCharCode.apply(String,g.slice(v,v+=$));return d}function K(g,u,d){let v="";d=Math.min(g.length,d);for(let T=u;T<d;++T)v+=String.fromCharCode(g[T]&127);return v}function W(g,u,d){let v="";d=Math.min(g.length,d);for(let T=u;T<d;++T)v+=String.fromCharCode(g[T]);return v}function z(g,u,d){const v=g.length;(!u||u<0)&&(u=0),(!d||d<0||d>v)&&(d=v);let T="";for(let U=u;U<d;++U)T+=Oe[g[U]];return T}function J(g,u,d){const v=g.slice(u,d);let T="";for(let U=0;U<v.length-1;U+=2)T+=String.fromCharCode(v[U]+v[U+1]*256);return T}a.prototype.slice=function(u,d){const v=this.length;u=~~u,d=d===void 0?v:~~d,u<0?(u+=v,u<0&&(u=0)):u>v&&(u=v),d<0?(d+=v,d<0&&(d=0)):d>v&&(d=v),d<u&&(d=u);const T=this.subarray(u,d);return Object.setPrototypeOf(T,a.prototype),T};function Y(g,u,d){if(g%1!==0||g<0)throw new RangeError("offset is not uint");if(g+u>d)throw new RangeError("Trying to access beyond buffer length")}a.prototype.readUintLE=a.prototype.readUIntLE=function(u,d,v){u=u>>>0,d=d>>>0,v||Y(u,d,this.length);let T=this[u],U=1,k=0;for(;++k<d&&(U*=256);)T+=this[u+k]*U;return T},a.prototype.readUintBE=a.prototype.readUIntBE=function(u,d,v){u=u>>>0,d=d>>>0,v||Y(u,d,this.length);let T=this[u+--d],U=1;for(;d>0&&(U*=256);)T+=this[u+--d]*U;return T},a.prototype.readUint8=a.prototype.readUInt8=function(u,d){return u=u>>>0,d||Y(u,1,this.length),this[u]},a.prototype.readUint16LE=a.prototype.readUInt16LE=function(u,d){return u=u>>>0,d||Y(u,2,this.length),this[u]|this[u+1]<<8},a.prototype.readUint16BE=a.prototype.readUInt16BE=function(u,d){return u=u>>>0,d||Y(u,2,this.length),this[u]<<8|this[u+1]},a.prototype.readUint32LE=a.prototype.readUInt32LE=function(u,d){return u=u>>>0,d||Y(u,4,this.length),(this[u]|this[u+1]<<8|this[u+2]<<16)+this[u+3]*16777216},a.prototype.readUint32BE=a.prototype.readUInt32BE=function(u,d){return u=u>>>0,d||Y(u,4,this.length),this[u]*16777216+(this[u+1]<<16|this[u+2]<<8|this[u+3])},a.prototype.readBigUInt64LE=pe(function(u){u=u>>>0,ie(u,"offset");const d=this[u],v=this[u+7];(d===void 0||v===void 0)&&Ee(u,this.length-8);const T=d+this[++u]*2**8+this[++u]*2**16+this[++u]*2**24,U=this[++u]+this[++u]*2**8+this[++u]*2**16+v*2**24;return BigInt(T)+(BigInt(U)<<BigInt(32))}),a.prototype.readBigUInt64BE=pe(function(u){u=u>>>0,ie(u,"offset");const d=this[u],v=this[u+7];(d===void 0||v===void 0)&&Ee(u,this.length-8);const T=d*2**24+this[++u]*2**16+this[++u]*2**8+this[++u],U=this[++u]*2**24+this[++u]*2**16+this[++u]*2**8+v;return(BigInt(T)<<BigInt(32))+BigInt(U)}),a.prototype.readIntLE=function(u,d,v){u=u>>>0,d=d>>>0,v||Y(u,d,this.length);let T=this[u],U=1,k=0;for(;++k<d&&(U*=256);)T+=this[u+k]*U;return U*=128,T>=U&&(T-=Math.pow(2,8*d)),T},a.prototype.readIntBE=function(u,d,v){u=u>>>0,d=d>>>0,v||Y(u,d,this.length);let T=d,U=1,k=this[u+--T];for(;T>0&&(U*=256);)k+=this[u+--T]*U;return U*=128,k>=U&&(k-=Math.pow(2,8*d)),k},a.prototype.readInt8=function(u,d){return u=u>>>0,d||Y(u,1,this.length),this[u]&128?(255-this[u]+1)*-1:this[u]},a.prototype.readInt16LE=function(u,d){u=u>>>0,d||Y(u,2,this.length);const v=this[u]|this[u+1]<<8;return v&32768?v|4294901760:v},a.prototype.readInt16BE=function(u,d){u=u>>>0,d||Y(u,2,this.length);const v=this[u+1]|this[u]<<8;return v&32768?v|4294901760:v},a.prototype.readInt32LE=function(u,d){return u=u>>>0,d||Y(u,4,this.length),this[u]|this[u+1]<<8|this[u+2]<<16|this[u+3]<<24},a.prototype.readInt32BE=function(u,d){return u=u>>>0,d||Y(u,4,this.length),this[u]<<24|this[u+1]<<16|this[u+2]<<8|this[u+3]},a.prototype.readBigInt64LE=pe(function(u){u=u>>>0,ie(u,"offset");const d=this[u],v=this[u+7];(d===void 0||v===void 0)&&Ee(u,this.length-8);const T=this[u+4]+this[u+5]*2**8+this[u+6]*2**16+(v<<24);return(BigInt(T)<<BigInt(32))+BigInt(d+this[++u]*2**8+this[++u]*2**16+this[++u]*2**24)}),a.prototype.readBigInt64BE=pe(function(u){u=u>>>0,ie(u,"offset");const d=this[u],v=this[u+7];(d===void 0||v===void 0)&&Ee(u,this.length-8);const T=(d<<24)+this[++u]*2**16+this[++u]*2**8+this[++u];return(BigInt(T)<<BigInt(32))+BigInt(this[++u]*2**24+this[++u]*2**16+this[++u]*2**8+v)}),a.prototype.readFloatLE=function(u,d){return u=u>>>0,d||Y(u,4,this.length),r.read(this,u,!0,23,4)},a.prototype.readFloatBE=function(u,d){return u=u>>>0,d||Y(u,4,this.length),r.read(this,u,!1,23,4)},a.prototype.readDoubleLE=function(u,d){return u=u>>>0,d||Y(u,8,this.length),r.read(this,u,!0,52,8)},a.prototype.readDoubleBE=function(u,d){return u=u>>>0,d||Y(u,8,this.length),r.read(this,u,!1,52,8)};function le(g,u,d,v,T,U){if(!a.isBuffer(g))throw new TypeError('"buffer" argument must be a Buffer instance');if(u>T||u<U)throw new RangeError('"value" argument is out of bounds');if(d+v>g.length)throw new RangeError("Index out of range")}a.prototype.writeUintLE=a.prototype.writeUIntLE=function(u,d,v,T){if(u=+u,d=d>>>0,v=v>>>0,!T){const oe=Math.pow(2,8*v)-1;le(this,u,d,v,oe,0)}let U=1,k=0;for(this[d]=u&255;++k<v&&(U*=256);)this[d+k]=u/U&255;return d+v},a.prototype.writeUintBE=a.prototype.writeUIntBE=function(u,d,v,T){if(u=+u,d=d>>>0,v=v>>>0,!T){const oe=Math.pow(2,8*v)-1;le(this,u,d,v,oe,0)}let U=v-1,k=1;for(this[d+U]=u&255;--U>=0&&(k*=256);)this[d+U]=u/k&255;return d+v},a.prototype.writeUint8=a.prototype.writeUInt8=function(u,d,v){return u=+u,d=d>>>0,v||le(this,u,d,1,255,0),this[d]=u&255,d+1},a.prototype.writeUint16LE=a.prototype.writeUInt16LE=function(u,d,v){return u=+u,d=d>>>0,v||le(this,u,d,2,65535,0),this[d]=u&255,this[d+1]=u>>>8,d+2},a.prototype.writeUint16BE=a.prototype.writeUInt16BE=function(u,d,v){return u=+u,d=d>>>0,v||le(this,u,d,2,65535,0),this[d]=u>>>8,this[d+1]=u&255,d+2},a.prototype.writeUint32LE=a.prototype.writeUInt32LE=function(u,d,v){return u=+u,d=d>>>0,v||le(this,u,d,4,4294967295,0),this[d+3]=u>>>24,this[d+2]=u>>>16,this[d+1]=u>>>8,this[d]=u&255,d+4},a.prototype.writeUint32BE=a.prototype.writeUInt32BE=function(u,d,v){return u=+u,d=d>>>0,v||le(this,u,d,4,4294967295,0),this[d]=u>>>24,this[d+1]=u>>>16,this[d+2]=u>>>8,this[d+3]=u&255,d+4};function ee(g,u,d,v,T){te(u,v,T,g,d,7);let U=Number(u&BigInt(4294967295));g[d++]=U,U=U>>8,g[d++]=U,U=U>>8,g[d++]=U,U=U>>8,g[d++]=U;let k=Number(u>>BigInt(32)&BigInt(4294967295));return g[d++]=k,k=k>>8,g[d++]=k,k=k>>8,g[d++]=k,k=k>>8,g[d++]=k,d}function fe(g,u,d,v,T){te(u,v,T,g,d,7);let U=Number(u&BigInt(4294967295));g[d+7]=U,U=U>>8,g[d+6]=U,U=U>>8,g[d+5]=U,U=U>>8,g[d+4]=U;let k=Number(u>>BigInt(32)&BigInt(4294967295));return g[d+3]=k,k=k>>8,g[d+2]=k,k=k>>8,g[d+1]=k,k=k>>8,g[d]=k,d+8}a.prototype.writeBigUInt64LE=pe(function(u,d=0){return ee(this,u,d,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeBigUInt64BE=pe(function(u,d=0){return fe(this,u,d,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeIntLE=function(u,d,v,T){if(u=+u,d=d>>>0,!T){const he=Math.pow(2,8*v-1);le(this,u,d,v,he-1,-he)}let U=0,k=1,oe=0;for(this[d]=u&255;++U<v&&(k*=256);)u<0&&oe===0&&this[d+U-1]!==0&&(oe=1),this[d+U]=(u/k>>0)-oe&255;return d+v},a.prototype.writeIntBE=function(u,d,v,T){if(u=+u,d=d>>>0,!T){const he=Math.pow(2,8*v-1);le(this,u,d,v,he-1,-he)}let U=v-1,k=1,oe=0;for(this[d+U]=u&255;--U>=0&&(k*=256);)u<0&&oe===0&&this[d+U+1]!==0&&(oe=1),this[d+U]=(u/k>>0)-oe&255;return d+v},a.prototype.writeInt8=function(u,d,v){return u=+u,d=d>>>0,v||le(this,u,d,1,127,-128),u<0&&(u=255+u+1),this[d]=u&255,d+1},a.prototype.writeInt16LE=function(u,d,v){return u=+u,d=d>>>0,v||le(this,u,d,2,32767,-32768),this[d]=u&255,this[d+1]=u>>>8,d+2},a.prototype.writeInt16BE=function(u,d,v){return u=+u,d=d>>>0,v||le(this,u,d,2,32767,-32768),this[d]=u>>>8,this[d+1]=u&255,d+2},a.prototype.writeInt32LE=function(u,d,v){return u=+u,d=d>>>0,v||le(this,u,d,4,2147483647,-2147483648),this[d]=u&255,this[d+1]=u>>>8,this[d+2]=u>>>16,this[d+3]=u>>>24,d+4},a.prototype.writeInt32BE=function(u,d,v){return u=+u,d=d>>>0,v||le(this,u,d,4,2147483647,-2147483648),u<0&&(u=4294967295+u+1),this[d]=u>>>24,this[d+1]=u>>>16,this[d+2]=u>>>8,this[d+3]=u&255,d+4},a.prototype.writeBigInt64LE=pe(function(u,d=0){return ee(this,u,d,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),a.prototype.writeBigInt64BE=pe(function(u,d=0){return fe(this,u,d,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function ae(g,u,d,v,T,U){if(d+v>g.length)throw new RangeError("Index out of range");if(d<0)throw new RangeError("Index out of range")}function Ce(g,u,d,v,T){return u=+u,d=d>>>0,T||ae(g,u,d,4),r.write(g,u,d,v,23,4),d+4}a.prototype.writeFloatLE=function(u,d,v){return Ce(this,u,d,!0,v)},a.prototype.writeFloatBE=function(u,d,v){return Ce(this,u,d,!1,v)};function B(g,u,d,v,T){return u=+u,d=d>>>0,T||ae(g,u,d,8),r.write(g,u,d,v,52,8),d+8}a.prototype.writeDoubleLE=function(u,d,v){return B(this,u,d,!0,v)},a.prototype.writeDoubleBE=function(u,d,v){return B(this,u,d,!1,v)},a.prototype.copy=function(u,d,v,T){if(!a.isBuffer(u))throw new TypeError("argument should be a Buffer");if(v||(v=0),!T&&T!==0&&(T=this.length),d>=u.length&&(d=u.length),d||(d=0),T>0&&T<v&&(T=v),T===v||u.length===0||this.length===0)return 0;if(d<0)throw new RangeError("targetStart out of bounds");if(v<0||v>=this.length)throw new RangeError("Index out of range");if(T<0)throw new RangeError("sourceEnd out of bounds");T>this.length&&(T=this.length),u.length-d<T-v&&(T=u.length-d+v);const U=T-v;return this===u&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(d,v,T):Uint8Array.prototype.set.call(u,this.subarray(v,T),d),U},a.prototype.fill=function(u,d,v,T){if(typeof u=="string"){if(typeof d=="string"?(T=d,d=0,v=this.length):typeof v=="string"&&(T=v,v=this.length),T!==void 0&&typeof T!="string")throw new TypeError("encoding must be a string");if(typeof T=="string"&&!a.isEncoding(T))throw new TypeError("Unknown encoding: "+T);if(u.length===1){const k=u.charCodeAt(0);(T==="utf8"&&k<128||T==="latin1")&&(u=k)}}else typeof u=="number"?u=u&255:typeof u=="boolean"&&(u=Number(u));if(d<0||this.length<d||this.length<v)throw new RangeError("Out of range index");if(v<=d)return this;d=d>>>0,v=v===void 0?this.length:v>>>0,u||(u=0);let U;if(typeof u=="number")for(U=d;U<v;++U)this[U]=u;else{const k=a.isBuffer(u)?u:a.from(u,T),oe=k.length;if(oe===0)throw new TypeError('The value "'+u+'" is invalid for argument "value"');for(U=0;U<v-d;++U)this[U+d]=k[U%oe]}return this};const F={};function R(g,u,d){F[g]=class extends d{constructor(){super(),Object.defineProperty(this,"message",{value:u.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${g}]`,this.stack,delete this.name}get code(){return g}set code(T){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:T,writable:!0})}toString(){return`${this.name} [${g}]: ${this.message}`}}}R("ERR_BUFFER_OUT_OF_BOUNDS",function(g){return g?`${g} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),R("ERR_INVALID_ARG_TYPE",function(g,u){return`The "${g}" argument must be of type number. Received type ${typeof u}`},TypeError),R("ERR_OUT_OF_RANGE",function(g,u,d){let v=`The value of "${g}" is out of range.`,T=d;return Number.isInteger(d)&&Math.abs(d)>2**32?T=f(String(d)):typeof d=="bigint"&&(T=String(d),(d>BigInt(2)**BigInt(32)||d<-(BigInt(2)**BigInt(32)))&&(T=f(T)),T+="n"),v+=` It must be ${u}. Received ${T}`,v},RangeError);function f(g){let u="",d=g.length;const v=g[0]==="-"?1:0;for(;d>=v+4;d-=3)u=`_${g.slice(d-3,d)}${u}`;return`${g.slice(0,d)}${u}`}function P(g,u,d){ie(u,"offset"),(g[u]===void 0||g[u+d]===void 0)&&Ee(u,g.length-(d+1))}function te(g,u,d,v,T,U){if(g>d||g<u){const k=typeof u=="bigint"?"n":"";let oe;throw U>3?u===0||u===BigInt(0)?oe=`>= 0${k} and < 2${k} ** ${(U+1)*8}${k}`:oe=`>= -(2${k} ** ${(U+1)*8-1}${k}) and < 2 ** ${(U+1)*8-1}${k}`:oe=`>= ${u}${k} and <= ${d}${k}`,new F.ERR_OUT_OF_RANGE("value",oe,g)}P(v,T,U)}function ie(g,u){if(typeof g!="number")throw new F.ERR_INVALID_ARG_TYPE(u,"number",g)}function Ee(g,u,d){throw Math.floor(g)!==g?(ie(g,d),new F.ERR_OUT_OF_RANGE(d||"offset","an integer",g)):u<0?new F.ERR_BUFFER_OUT_OF_BOUNDS:new F.ERR_OUT_OF_RANGE(d||"offset",`>= ${d?1:0} and <= ${u}`,g)}const Le=/[^+/0-9A-Za-z-_]/g;function $e(g){if(g=g.split("=")[0],g=g.trim().replace(Le,""),g.length<2)return"";for(;g.length%4!==0;)g=g+"=";return g}function Me(g,u){u=u||1/0;let d;const v=g.length;let T=null;const U=[];for(let k=0;k<v;++k){if(d=g.charCodeAt(k),d>55295&&d<57344){if(!T){if(d>56319){(u-=3)>-1&&U.push(239,191,189);continue}else if(k+1===v){(u-=3)>-1&&U.push(239,191,189);continue}T=d;continue}if(d<56320){(u-=3)>-1&&U.push(239,191,189),T=d;continue}d=(T-55296<<10|d-56320)+65536}else T&&(u-=3)>-1&&U.push(239,191,189);if(T=null,d<128){if((u-=1)<0)break;U.push(d)}else if(d<2048){if((u-=2)<0)break;U.push(d>>6|192,d&63|128)}else if(d<65536){if((u-=3)<0)break;U.push(d>>12|224,d>>6&63|128,d&63|128)}else if(d<1114112){if((u-=4)<0)break;U.push(d>>18|240,d>>12&63|128,d>>6&63|128,d&63|128)}else throw new Error("Invalid code point")}return U}function Ye(g){const u=[];for(let d=0;d<g.length;++d)u.push(g.charCodeAt(d)&255);return u}function Ke(g,u){let d,v,T;const U=[];for(let k=0;k<g.length&&!((u-=2)<0);++k)d=g.charCodeAt(k),v=d>>8,T=d%256,U.push(T),U.push(v);return U}function Pe(g){return e.toByteArray($e(g))}function De(g,u,d,v){let T;for(T=0;T<v&&!(T+d>=u.length||T>=g.length);++T)u[T+d]=g[T];return T}function ge(g,u){return g instanceof u||g!=null&&g.constructor!=null&&g.constructor.name!=null&&g.constructor.name===u.name}function Se(g){return g!==g}const Oe=function(){const g="0123456789abcdef",u=new Array(256);for(let d=0;d<16;++d){const v=d*16;for(let T=0;T<16;++T)u[v+T]=g[d]+g[T]}return u}();function pe(g){return typeof BigInt>"u"?xe:g}function xe(){throw new Error("BigInt not supported")}})(Kh);const ke=vr({selectedChain:void 0,chains:void 0,standaloneChains:void 0,standaloneUri:void 0,address:void 0,profileName:void 0,profileAvatar:void 0,profileLoading:!1,balanceLoading:!1,balance:void 0,isConnected:!1,isStandalone:!1,isCustomDesktop:!1,isCustomMobile:!1,isDataLoaded:!1,isUiLoaded:!1,walletConnectVersion:1}),Q={state:ke,subscribe(t){return li(ke,()=>t(ke))},setChains(t){ke.chains=t},setStandaloneChains(t){ke.standaloneChains=t},setStandaloneUri(t){ke.standaloneUri=t},getSelectedChain(){const t=qe.client().getNetwork().chain;return t&&(ke.selectedChain=t),ke.selectedChain},setSelectedChain(t){ke.selectedChain=t},setIsStandalone(t){ke.isStandalone=t},setIsCustomDesktop(t){ke.isCustomDesktop=t},setIsCustomMobile(t){ke.isCustomMobile=t},getAccount(){const t=qe.client().getAccount();ke.address=t.address,ke.isConnected=t.isConnected},setAddress(t){ke.address=t},setIsConnected(t){ke.isConnected=t},setProfileName(t){ke.profileName=t},setProfileAvatar(t){ke.profileAvatar=t},setProfileLoading(t){ke.profileLoading=t},setBalanceLoading(t){ke.balanceLoading=t},setBalance(t){ke.balance=t},setIsDataLoaded(t){ke.isDataLoaded=t},setIsUiLoaded(t){ke.isUiLoaded=t},setWalletConnectVersion(t){ke.walletConnectVersion=t},resetEnsProfile(){ke.profileName=void 0,ke.profileAvatar=void 0},resetBalance(){ke.balance=void 0},resetAccount(){ke.address=void 0,ke.isConnected=!1,Q.resetEnsProfile(),Q.resetBalance()}},ui=vr({initialized:!1,ethereumClient:void 0}),qe={setEthereumClient(t){!ui.initialized&&t&&(ui.ethereumClient=t,Q.setChains(t.chains),ui.initialized=!0)},client(){if(ui.ethereumClient)return ui.ethereumClient;throw new Error("ClientCtrl has no client set")}},Ue={WALLETCONNECT_DEEPLINK_CHOICE:"WALLETCONNECT_DEEPLINK_CHOICE",isMobile(){return typeof window<"u"?Boolean(window.matchMedia("(pointer:coarse)").matches||/Android|webOS|iPhone|iPad|iPod|BlackBerry|Opera Mini/u.test(navigator.userAgent)):!1},isAndroid(){return Ue.isMobile()&&navigator.userAgent.toLowerCase().includes("android")},isEmptyObject(t){return Object.getPrototypeOf(t)===Object.prototype&&Object.getOwnPropertyNames(t).length===0&&Object.getOwnPropertySymbols(t).length===0},isHttpUrl(t){return t.startsWith("http://")||t.startsWith("https://")},formatNativeUrl(t,e,r){if(Ue.isHttpUrl(t))return this.formatUniversalUrl(t,e,r);let n=t;n.includes("://")||(n=t.replaceAll("/","").replaceAll(":",""),n=`${n}://`),this.setWalletConnectDeepLink(n,r);const i=encodeURIComponent(e);return`${n}wc?uri=${i}`},formatUniversalUrl(t,e,r){if(!Ue.isHttpUrl(t))return this.formatNativeUrl(t,e,r);let n=t;t.endsWith("/")&&(n=t.slice(0,-1)),this.setWalletConnectDeepLink(n,r);const i=encodeURIComponent(e);return`${n}/wc?uri=${i}`},async wait(t){return new Promise(e=>{setTimeout(e,t)})},openHref(t,e="_self"){window.open(t,e,"noreferrer noopener")},setWalletConnectDeepLink(t,e){localStorage.setItem(Ue.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:t,name:e}))},setWalletConnectAndroidDeepLink(t){const[e]=t.split("?");localStorage.setItem(Ue.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:e,name:"Android"}))},removeWalletConnectDeepLink(){localStorage.removeItem(Ue.WALLETCONNECT_DEEPLINK_CHOICE)},isNull(t){return t===null}};function Ob(){return typeof matchMedia<"u"&&matchMedia("(prefers-color-scheme: dark)").matches}const hi=vr({projectId:"",themeMode:Ob()?"dark":"light",themeColor:"default",themeBackground:Ue.isMobile()?"themeColor":"gradient",themeZIndex:89,mobileWallets:void 0,desktopWallets:void 0,walletImages:void 0,chainImages:void 0,tokenImages:void 0,standaloneChains:void 0,enableStandaloneMode:!1,enableNetworkView:!1,enableAccountView:!0,defaultChain:void 0,explorerAllowList:void 0,explorerDenyList:void 0,termsOfServiceUrl:void 0,privacyPolicyUrl:void 0}),Ve={state:hi,subscribe(t){return li(hi,()=>t(hi))},setConfig(t){var e,r,n,i;if(Q.setStandaloneChains(t.standaloneChains),Q.setIsStandalone(Boolean((e=t.standaloneChains)==null?void 0:e.length)||Boolean(t.enableStandaloneMode)),Q.setIsCustomMobile(Boolean((r=t.mobileWallets)==null?void 0:r.length)),Q.setIsCustomDesktop(Boolean((n=t.desktopWallets)==null?void 0:n.length)),Q.setWalletConnectVersion((i=t.walletConnectVersion)!=null?i:1),t.defaultChain)Q.setSelectedChain(t.defaultChain);else if(!Q.state.isStandalone){const s=qe.client().getDefaultChain();Q.setSelectedChain(s)}Object.assign(hi,t)},setThemeConfig(t){Object.assign(hi,t)}},Yh="https://explorer-api.walletconnect.com";function Ab(t){const e=Object.fromEntries(Object.entries(t).filter(([r,n])=>typeof n<"u"&&n!==null&&n!=="").map(([r,n])=>[r,n.toString()]));return new URLSearchParams(e).toString()}const ys={async fetchWallets(t,e){const r=Ab(e),n=`${Yh}/v3/wallets?projectId=${t}&${r}`;return(await fetch(n)).json()},formatImageUrl(t,e){return`${Yh}/v3/logo/lg/${e}?projectId=${t}`}},jr=vr({wallets:{listings:[],total:0,page:1},search:{listings:[],total:0,page:1},previewWallets:[],recomendedWallets:[]});function bs(){const{projectId:t}=Ve.state;if(!t)throw new Error("projectId is required to work with explorer api");return t}const at={state:jr,async getPreviewWallets(t){const{listings:e}=await ys.fetchWallets(bs(),t);return jr.previewWallets=Object.values(e),jr.previewWallets},async getRecomendedWallets(){const{listings:t}=await ys.fetchWallets(bs(),{page:1,entries:6});jr.recomendedWallets=Object.values(t)},async getPaginatedWallets(t){const{page:e,search:r}=t,{listings:n,total:i}=await ys.fetchWallets(bs(),t),s=Object.values(n),o=r?"search":"wallets";return jr[o]={listings:[...jr[o].listings,...s],total:i,page:e??1},{listings:s,total:i}},getImageUrl(t){return ys.formatImageUrl(bs(),t)},resetSearch(){jr.search={listings:[],total:0,page:1}}},Ft=vr({history:["ConnectWallet"],view:"ConnectWallet",data:void 0}),Te={state:Ft,subscribe(t){return li(Ft,()=>t(Ft))},push(t,e){t!==Ft.view&&(Ft.view=t,e&&(Ft.data=e),Ft.history.push(t))},replace(t){Ft.view=t,Ft.history=[t]},goBack(){if(Ft.history.length>1){Ft.history.pop();const[t]=Ft.history.slice(-1);Ft.view=t}}},gn=vr({open:!1}),dt={state:gn,subscribe(t){return li(gn,()=>t(gn))},async open(t){return new Promise(e=>{const{isConnected:r,isStandalone:n,isUiLoaded:i,isDataLoaded:s}=Q.state,{enableNetworkView:o}=Ve.state;if(n?(Q.setStandaloneUri(t?.uri),Q.setStandaloneChains(t?.standaloneChains),Te.replace("ConnectWallet")):t!=null&&t.route?Te.replace(t.route):r?Te.replace("Account"):o?Te.replace("SelectNetwork"):Te.replace("ConnectWallet"),i&&s)gn.open=!0,e();else{const a=setInterval(()=>{Q.state.isUiLoaded&&Q.state.isDataLoaded&&(clearInterval(a),gn.open=!0,e())},200)}})},close(){gn.open=!1}},kr=vr({open:!1,message:"",variant:"success"}),Lt={state:kr,subscribe(t){return li(kr,()=>t(kr))},openToast(t,e){kr.open=!0,kr.message=t,kr.variant=e},closeToast(){kr.open=!1}};typeof window<"u"&&(window.Buffer||(window.Buffer=Kh.Buffer),window.global||(window.global=window),window.process||(window.process={env:{}}));var $b=Object.defineProperty,Zh=Object.getOwnPropertySymbols,Pb=Object.prototype.hasOwnProperty,Tb=Object.prototype.propertyIsEnumerable,Jh=(t,e,r)=>e in t?$b(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Nb=(t,e)=>{for(var r in e||(e={}))Pb.call(e,r)&&Jh(t,r,e[r]);if(Zh)for(var r of Zh(e))Tb.call(e,r)&&Jh(t,r,e[r]);return t};class Rb{constructor(e){this.openModal=dt.open,this.closeModal=dt.close,this.subscribeModal=dt.subscribe,this.setTheme=Ve.setThemeConfig,Ve.setConfig(Nb({enableStandaloneMode:!0},e)),this.initUi()}async initUi(){if(typeof window<"u"){await Promise.resolve().then(function(){return L_});const e=document.createElement("w3m-modal");document.body.insertAdjacentElement("beforeend",e),Q.setIsUiLoaded(!0)}}}var Lb=Object.freeze({__proto__:null,Web3Modal:Rb});/**
111
72
  * @license
112
73
  * Copyright 2019 Google LLC
113
74
  * SPDX-License-Identifier: BSD-3-Clause
114
- */const Es=window,Mc=Es.ShadowRoot&&(Es.ShadyCSS===void 0||Es.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Uc=Symbol(),gd=new WeakMap;class md{constructor(e,r,n){if(this._$cssResult$=!0,n!==Uc)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=r}get styleSheet(){let e=this.o;const r=this.t;if(Mc&&e===void 0){const n=r!==void 0&&r.length===1;n&&(e=gd.get(r)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&gd.set(r,e))}return e}toString(){return this.cssText}}const F9=t=>new md(typeof t=="string"?t:t+"",void 0,Uc),He=(t,...e)=>{const r=t.length===1?t[0]:e.reduce((n,i,o)=>n+(s=>{if(s._$cssResult$===!0)return s.cssText;if(typeof s=="number")return s;throw Error("Value passed to 'css' function must be a 'css' function result: "+s+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+t[o+1],t[0]);return new md(r,t,Uc)},P9=(t,e)=>{Mc?t.adoptedStyleSheets=e.map(r=>r instanceof CSSStyleSheet?r:r.styleSheet):e.forEach(r=>{const n=document.createElement("style"),i=Es.litNonce;i!==void 0&&n.setAttribute("nonce",i),n.textContent=r.cssText,t.appendChild(n)})},bd=Mc?t=>t:t=>t instanceof CSSStyleSheet?(e=>{let r="";for(const n of e.cssRules)r+=n.cssText;return F9(r)})(t):t;/**
75
+ */const vs=window,Da=vs.ShadowRoot&&(vs.ShadyCSS===void 0||vs.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Oa=Symbol(),Xh=new WeakMap;class Qh{constructor(e,r,n){if(this._$cssResult$=!0,n!==Oa)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=r}get styleSheet(){let e=this.o;const r=this.t;if(Da&&e===void 0){const n=r!==void 0&&r.length===1;n&&(e=Xh.get(r)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&Xh.set(r,e))}return e}toString(){return this.cssText}}const Mb=t=>new Qh(typeof t=="string"?t:t+"",void 0,Oa),_e=(t,...e)=>{const r=t.length===1?t[0]:e.reduce((n,i,s)=>n+(o=>{if(o._$cssResult$===!0)return o.cssText;if(typeof o=="number")return o;throw Error("Value passed to 'css' function must be a 'css' function result: "+o+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+t[s+1],t[0]);return new Qh(r,t,Oa)},Ub=(t,e)=>{Da?t.adoptedStyleSheets=e.map(r=>r instanceof CSSStyleSheet?r:r.styleSheet):e.forEach(r=>{const n=document.createElement("style"),i=vs.litNonce;i!==void 0&&n.setAttribute("nonce",i),n.textContent=r.cssText,t.appendChild(n)})},e0=Da?t=>t:t=>t instanceof CSSStyleSheet?(e=>{let r="";for(const n of e.cssRules)r+=n.cssText;return Mb(r)})(t):t;/**
115
76
  * @license
116
77
  * Copyright 2017 Google LLC
117
78
  * SPDX-License-Identifier: BSD-3-Clause
118
- */var Bc;const xs=window,yd=xs.trustedTypes,T9=yd?yd.emptyScript:"",wd=xs.reactiveElementPolyfillSupport,jc={toAttribute(t,e){switch(e){case Boolean:t=t?T9:null;break;case Object:case Array:t=t==null?t:JSON.stringify(t)}return t},fromAttribute(t,e){let r=t;switch(e){case Boolean:r=t!==null;break;case Number:r=t===null?null:Number(t);break;case Object:case Array:try{r=JSON.parse(t)}catch{r=null}}return r}},vd=(t,e)=>e!==t&&(e==e||t==t),kc={attribute:!0,type:String,converter:jc,reflect:!1,hasChanged:vd};class jn extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this.u()}static addInitializer(e){var r;this.finalize(),((r=this.h)!==null&&r!==void 0?r:this.h=[]).push(e)}static get observedAttributes(){this.finalize();const e=[];return this.elementProperties.forEach((r,n)=>{const i=this._$Ep(n,r);i!==void 0&&(this._$Ev.set(i,n),e.push(i))}),e}static createProperty(e,r=kc){if(r.state&&(r.attribute=!1),this.finalize(),this.elementProperties.set(e,r),!r.noAccessor&&!this.prototype.hasOwnProperty(e)){const n=typeof e=="symbol"?Symbol():"__"+e,i=this.getPropertyDescriptor(e,n,r);i!==void 0&&Object.defineProperty(this.prototype,e,i)}}static getPropertyDescriptor(e,r,n){return{get(){return this[r]},set(i){const o=this[e];this[r]=i,this.requestUpdate(e,o,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)||kc}static finalize(){if(this.hasOwnProperty("finalized"))return!1;this.finalized=!0;const e=Object.getPrototypeOf(this);if(e.finalize(),e.h!==void 0&&(this.h=[...e.h]),this.elementProperties=new Map(e.elementProperties),this._$Ev=new Map,this.hasOwnProperty("properties")){const r=this.properties,n=[...Object.getOwnPropertyNames(r),...Object.getOwnPropertySymbols(r)];for(const i of n)this.createProperty(i,r[i])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(e){const r=[];if(Array.isArray(e)){const n=new Set(e.flat(1/0).reverse());for(const i of n)r.unshift(bd(i))}else e!==void 0&&r.push(bd(e));return r}static _$Ep(e,r){const n=r.attribute;return n===!1?void 0:typeof n=="string"?n:typeof e=="string"?e.toLowerCase():void 0}u(){var e;this._$E_=new Promise(r=>this.enableUpdating=r),this._$AL=new Map,this._$Eg(),this.requestUpdate(),(e=this.constructor.h)===null||e===void 0||e.forEach(r=>r(this))}addController(e){var r,n;((r=this._$ES)!==null&&r!==void 0?r:this._$ES=[]).push(e),this.renderRoot!==void 0&&this.isConnected&&((n=e.hostConnected)===null||n===void 0||n.call(e))}removeController(e){var r;(r=this._$ES)===null||r===void 0||r.splice(this._$ES.indexOf(e)>>>0,1)}_$Eg(){this.constructor.elementProperties.forEach((e,r)=>{this.hasOwnProperty(r)&&(this._$Ei.set(r,this[r]),delete this[r])})}createRenderRoot(){var e;const r=(e=this.shadowRoot)!==null&&e!==void 0?e:this.attachShadow(this.constructor.shadowRootOptions);return P9(r,this.constructor.elementStyles),r}connectedCallback(){var e;this.renderRoot===void 0&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(e=this._$ES)===null||e===void 0||e.forEach(r=>{var n;return(n=r.hostConnected)===null||n===void 0?void 0:n.call(r)})}enableUpdating(e){}disconnectedCallback(){var e;(e=this._$ES)===null||e===void 0||e.forEach(r=>{var n;return(n=r.hostDisconnected)===null||n===void 0?void 0:n.call(r)})}attributeChangedCallback(e,r,n){this._$AK(e,n)}_$EO(e,r,n=kc){var i;const o=this.constructor._$Ep(e,n);if(o!==void 0&&n.reflect===!0){const s=(((i=n.converter)===null||i===void 0?void 0:i.toAttribute)!==void 0?n.converter:jc).toAttribute(r,n.type);this._$El=e,s==null?this.removeAttribute(o):this.setAttribute(o,s),this._$El=null}}_$AK(e,r){var n;const i=this.constructor,o=i._$Ev.get(e);if(o!==void 0&&this._$El!==o){const s=i.getPropertyOptions(o),a=typeof s.converter=="function"?{fromAttribute:s.converter}:((n=s.converter)===null||n===void 0?void 0:n.fromAttribute)!==void 0?s.converter:jc;this._$El=o,this[o]=a.fromAttribute(r,s.type),this._$El=null}}requestUpdate(e,r,n){let i=!0;e!==void 0&&(((n=n||this.constructor.getPropertyOptions(e)).hasChanged||vd)(this[e],r)?(this._$AL.has(e)||this._$AL.set(e,r),n.reflect===!0&&this._$El!==e&&(this._$EC===void 0&&(this._$EC=new Map),this._$EC.set(e,n))):i=!1),!this.isUpdatePending&&i&&(this._$E_=this._$Ej())}async _$Ej(){this.isUpdatePending=!0;try{await this._$E_}catch(r){Promise.reject(r)}const e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var e;if(!this.isUpdatePending)return;this.hasUpdated,this._$Ei&&(this._$Ei.forEach((i,o)=>this[o]=i),this._$Ei=void 0);let r=!1;const n=this._$AL;try{r=this.shouldUpdate(n),r?(this.willUpdate(n),(e=this._$ES)===null||e===void 0||e.forEach(i=>{var o;return(o=i.hostUpdate)===null||o===void 0?void 0:o.call(i)}),this.update(n)):this._$Ek()}catch(i){throw r=!1,this._$Ek(),i}r&&this._$AE(n)}willUpdate(e){}_$AE(e){var r;(r=this._$ES)===null||r===void 0||r.forEach(n=>{var i;return(i=n.hostUpdated)===null||i===void 0?void 0:i.call(n)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$Ek(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$E_}shouldUpdate(e){return!0}update(e){this._$EC!==void 0&&(this._$EC.forEach((r,n)=>this._$EO(n,this[n],r)),this._$EC=void 0),this._$Ek()}updated(e){}firstUpdated(e){}}jn.finalized=!0,jn.elementProperties=new Map,jn.elementStyles=[],jn.shadowRootOptions={mode:"open"},wd?.({ReactiveElement:jn}),((Bc=xs.reactiveElementVersions)!==null&&Bc!==void 0?Bc:xs.reactiveElementVersions=[]).push("1.6.1");/**
79
+ */var Aa;const _s=window,t0=_s.trustedTypes,Fb=t0?t0.emptyScript:"",r0=_s.reactiveElementPolyfillSupport,$a={toAttribute(t,e){switch(e){case Boolean:t=t?Fb:null;break;case Object:case Array:t=t==null?t:JSON.stringify(t)}return t},fromAttribute(t,e){let r=t;switch(e){case Boolean:r=t!==null;break;case Number:r=t===null?null:Number(t);break;case Object:case Array:try{r=JSON.parse(t)}catch{r=null}}return r}},n0=(t,e)=>e!==t&&(e==e||t==t),Pa={attribute:!0,type:String,converter:$a,reflect:!1,hasChanged:n0};class mn extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this.u()}static addInitializer(e){var r;this.finalize(),((r=this.h)!==null&&r!==void 0?r:this.h=[]).push(e)}static get observedAttributes(){this.finalize();const e=[];return this.elementProperties.forEach((r,n)=>{const i=this._$Ep(n,r);i!==void 0&&(this._$Ev.set(i,n),e.push(i))}),e}static createProperty(e,r=Pa){if(r.state&&(r.attribute=!1),this.finalize(),this.elementProperties.set(e,r),!r.noAccessor&&!this.prototype.hasOwnProperty(e)){const n=typeof e=="symbol"?Symbol():"__"+e,i=this.getPropertyDescriptor(e,n,r);i!==void 0&&Object.defineProperty(this.prototype,e,i)}}static getPropertyDescriptor(e,r,n){return{get(){return this[r]},set(i){const s=this[e];this[r]=i,this.requestUpdate(e,s,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)||Pa}static finalize(){if(this.hasOwnProperty("finalized"))return!1;this.finalized=!0;const e=Object.getPrototypeOf(this);if(e.finalize(),e.h!==void 0&&(this.h=[...e.h]),this.elementProperties=new Map(e.elementProperties),this._$Ev=new Map,this.hasOwnProperty("properties")){const r=this.properties,n=[...Object.getOwnPropertyNames(r),...Object.getOwnPropertySymbols(r)];for(const i of n)this.createProperty(i,r[i])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(e){const r=[];if(Array.isArray(e)){const n=new Set(e.flat(1/0).reverse());for(const i of n)r.unshift(e0(i))}else e!==void 0&&r.push(e0(e));return r}static _$Ep(e,r){const n=r.attribute;return n===!1?void 0:typeof n=="string"?n:typeof e=="string"?e.toLowerCase():void 0}u(){var e;this._$E_=new Promise(r=>this.enableUpdating=r),this._$AL=new Map,this._$Eg(),this.requestUpdate(),(e=this.constructor.h)===null||e===void 0||e.forEach(r=>r(this))}addController(e){var r,n;((r=this._$ES)!==null&&r!==void 0?r:this._$ES=[]).push(e),this.renderRoot!==void 0&&this.isConnected&&((n=e.hostConnected)===null||n===void 0||n.call(e))}removeController(e){var r;(r=this._$ES)===null||r===void 0||r.splice(this._$ES.indexOf(e)>>>0,1)}_$Eg(){this.constructor.elementProperties.forEach((e,r)=>{this.hasOwnProperty(r)&&(this._$Ei.set(r,this[r]),delete this[r])})}createRenderRoot(){var e;const r=(e=this.shadowRoot)!==null&&e!==void 0?e:this.attachShadow(this.constructor.shadowRootOptions);return Ub(r,this.constructor.elementStyles),r}connectedCallback(){var e;this.renderRoot===void 0&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(e=this._$ES)===null||e===void 0||e.forEach(r=>{var n;return(n=r.hostConnected)===null||n===void 0?void 0:n.call(r)})}enableUpdating(e){}disconnectedCallback(){var e;(e=this._$ES)===null||e===void 0||e.forEach(r=>{var n;return(n=r.hostDisconnected)===null||n===void 0?void 0:n.call(r)})}attributeChangedCallback(e,r,n){this._$AK(e,n)}_$EO(e,r,n=Pa){var i;const s=this.constructor._$Ep(e,n);if(s!==void 0&&n.reflect===!0){const o=(((i=n.converter)===null||i===void 0?void 0:i.toAttribute)!==void 0?n.converter:$a).toAttribute(r,n.type);this._$El=e,o==null?this.removeAttribute(s):this.setAttribute(s,o),this._$El=null}}_$AK(e,r){var n;const i=this.constructor,s=i._$Ev.get(e);if(s!==void 0&&this._$El!==s){const o=i.getPropertyOptions(s),a=typeof o.converter=="function"?{fromAttribute:o.converter}:((n=o.converter)===null||n===void 0?void 0:n.fromAttribute)!==void 0?o.converter:$a;this._$El=s,this[s]=a.fromAttribute(r,o.type),this._$El=null}}requestUpdate(e,r,n){let i=!0;e!==void 0&&(((n=n||this.constructor.getPropertyOptions(e)).hasChanged||n0)(this[e],r)?(this._$AL.has(e)||this._$AL.set(e,r),n.reflect===!0&&this._$El!==e&&(this._$EC===void 0&&(this._$EC=new Map),this._$EC.set(e,n))):i=!1),!this.isUpdatePending&&i&&(this._$E_=this._$Ej())}async _$Ej(){this.isUpdatePending=!0;try{await this._$E_}catch(r){Promise.reject(r)}const e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var e;if(!this.isUpdatePending)return;this.hasUpdated,this._$Ei&&(this._$Ei.forEach((i,s)=>this[s]=i),this._$Ei=void 0);let r=!1;const n=this._$AL;try{r=this.shouldUpdate(n),r?(this.willUpdate(n),(e=this._$ES)===null||e===void 0||e.forEach(i=>{var s;return(s=i.hostUpdate)===null||s===void 0?void 0:s.call(i)}),this.update(n)):this._$Ek()}catch(i){throw r=!1,this._$Ek(),i}r&&this._$AE(n)}willUpdate(e){}_$AE(e){var r;(r=this._$ES)===null||r===void 0||r.forEach(n=>{var i;return(i=n.hostUpdated)===null||i===void 0?void 0:i.call(n)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$Ek(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$E_}shouldUpdate(e){return!0}update(e){this._$EC!==void 0&&(this._$EC.forEach((r,n)=>this._$EO(n,this[n],r)),this._$EC=void 0),this._$Ek()}updated(e){}firstUpdated(e){}}mn.finalized=!0,mn.elementProperties=new Map,mn.elementStyles=[],mn.shadowRootOptions={mode:"open"},r0?.({ReactiveElement:mn}),((Aa=_s.reactiveElementVersions)!==null&&Aa!==void 0?Aa:_s.reactiveElementVersions=[]).push("1.6.1");/**
119
80
  * @license
120
81
  * Copyright 2017 Google LLC
121
82
  * SPDX-License-Identifier: BSD-3-Clause
122
- */var Hc;const Cs=window,kn=Cs.trustedTypes,_d=kn?kn.createPolicy("lit-html",{createHTML:t=>t}):void 0,zr=`lit$${(Math.random()+"").slice(9)}$`,Ed="?"+zr,N9=`<${Ed}>`,Hn=document,Gi=(t="")=>Hn.createComment(t),Yi=t=>t===null||typeof t!="object"&&typeof t!="function",xd=Array.isArray,R9=t=>xd(t)||typeof t?.[Symbol.iterator]=="function",Zi=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Cd=/-->/g,Sd=/>/g,hn=RegExp(`>|[
83
+ */var Ta;const Es=window,wn=Es.trustedTypes,i0=wn?wn.createPolicy("lit-html",{createHTML:t=>t}):void 0,_r=`lit$${(Math.random()+"").slice(9)}$`,s0="?"+_r,Bb=`<${s0}>`,yn=document,di=(t="")=>yn.createComment(t),fi=t=>t===null||typeof t!="object"&&typeof t!="function",o0=Array.isArray,jb=t=>o0(t)||typeof t?.[Symbol.iterator]=="function",pi=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,a0=/-->/g,c0=/>/g,Hr=RegExp(`>|[
123
84
  \f\r](?:([^\\s"'>=/]+)([
124
85
  \f\r]*=[
125
86
  \f\r]*(?:[^
126
- \f\r"'\`<>=]|("|')|))|$)`,"g"),Ad=/'/g,Id=/"/g,Od=/^(?:script|style|textarea|title)$/i,Dd=t=>(e,...r)=>({_$litType$:t,strings:e,values:r}),ee=Dd(1),Je=Dd(2),fn=Symbol.for("lit-noChange"),St=Symbol.for("lit-nothing"),$d=new WeakMap,zn=Hn.createTreeWalker(Hn,129,null,!1),L9=(t,e)=>{const r=t.length-1,n=[];let i,o=e===2?"<svg>":"",s=Zi;for(let l=0;l<r;l++){const u=t[l];let d,y,m=-1,v=0;for(;v<u.length&&(s.lastIndex=v,y=s.exec(u),y!==null);)v=s.lastIndex,s===Zi?y[1]==="!--"?s=Cd:y[1]!==void 0?s=Sd:y[2]!==void 0?(Od.test(y[2])&&(i=RegExp("</"+y[2],"g")),s=hn):y[3]!==void 0&&(s=hn):s===hn?y[0]===">"?(s=i??Zi,m=-1):y[1]===void 0?m=-2:(m=s.lastIndex-y[2].length,d=y[1],s=y[3]===void 0?hn:y[3]==='"'?Id:Ad):s===Id||s===Ad?s=hn:s===Cd||s===Sd?s=Zi:(s=hn,i=void 0);const _=s===hn&&t[l+1].startsWith("/>")?" ":"";o+=s===Zi?u+N9:m>=0?(n.push(d),u.slice(0,m)+"$lit$"+u.slice(m)+zr+_):u+zr+(m===-2?(n.push(void 0),l):_)}const a=o+(t[r]||"<?>")+(e===2?"</svg>":"");if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return[_d!==void 0?_d.createHTML(a):a,n]};class Ji{constructor({strings:e,_$litType$:r},n){let i;this.parts=[];let o=0,s=0;const a=e.length-1,l=this.parts,[u,d]=L9(e,r);if(this.el=Ji.createElement(u,n),zn.currentNode=this.el.content,r===2){const y=this.el.content,m=y.firstChild;m.remove(),y.append(...m.childNodes)}for(;(i=zn.nextNode())!==null&&l.length<a;){if(i.nodeType===1){if(i.hasAttributes()){const y=[];for(const m of i.getAttributeNames())if(m.endsWith("$lit$")||m.startsWith(zr)){const v=d[s++];if(y.push(m),v!==void 0){const _=i.getAttribute(v.toLowerCase()+"$lit$").split(zr),R=/([.?@])?(.*)/.exec(v);l.push({type:1,index:o,name:R[2],strings:_,ctor:R[1]==="."?U9:R[1]==="?"?j9:R[1]==="@"?k9:Ss})}else l.push({type:6,index:o})}for(const m of y)i.removeAttribute(m)}if(Od.test(i.tagName)){const y=i.textContent.split(zr),m=y.length-1;if(m>0){i.textContent=kn?kn.emptyScript:"";for(let v=0;v<m;v++)i.append(y[v],Gi()),zn.nextNode(),l.push({type:2,index:++o});i.append(y[m],Gi())}}}else if(i.nodeType===8)if(i.data===Ed)l.push({type:2,index:o});else{let y=-1;for(;(y=i.data.indexOf(zr,y+1))!==-1;)l.push({type:7,index:o}),y+=zr.length-1}o++}}static createElement(e,r){const n=Hn.createElement("template");return n.innerHTML=e,n}}function Wn(t,e,r=t,n){var i,o,s,a;if(e===fn)return e;let l=n!==void 0?(i=r._$Co)===null||i===void 0?void 0:i[n]:r._$Cl;const u=Yi(e)?void 0:e._$litDirective$;return l?.constructor!==u&&((o=l?._$AO)===null||o===void 0||o.call(l,!1),u===void 0?l=void 0:(l=new u(t),l._$AT(t,r,n)),n!==void 0?((s=(a=r)._$Co)!==null&&s!==void 0?s:a._$Co=[])[n]=l:r._$Cl=l),l!==void 0&&(e=Wn(t,l._$AS(t,e.values),l,n)),e}class M9{constructor(e,r){this.u=[],this._$AN=void 0,this._$AD=e,this._$AM=r}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}v(e){var r;const{el:{content:n},parts:i}=this._$AD,o=((r=e?.creationScope)!==null&&r!==void 0?r:Hn).importNode(n,!0);zn.currentNode=o;let s=zn.nextNode(),a=0,l=0,u=i[0];for(;u!==void 0;){if(a===u.index){let d;u.type===2?d=new Xi(s,s.nextSibling,this,e):u.type===1?d=new u.ctor(s,u.name,u.strings,this,e):u.type===6&&(d=new H9(s,this,e)),this.u.push(d),u=i[++l]}a!==u?.index&&(s=zn.nextNode(),a++)}return o}p(e){let r=0;for(const n of this.u)n!==void 0&&(n.strings!==void 0?(n._$AI(e,n,r),r+=n.strings.length-2):n._$AI(e[r])),r++}}class Xi{constructor(e,r,n,i){var o;this.type=2,this._$AH=St,this._$AN=void 0,this._$AA=e,this._$AB=r,this._$AM=n,this.options=i,this._$Cm=(o=i?.isConnected)===null||o===void 0||o}get _$AU(){var e,r;return(r=(e=this._$AM)===null||e===void 0?void 0:e._$AU)!==null&&r!==void 0?r:this._$Cm}get parentNode(){let e=this._$AA.parentNode;const r=this._$AM;return r!==void 0&&e.nodeType===11&&(e=r.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,r=this){e=Wn(this,e,r),Yi(e)?e===St||e==null||e===""?(this._$AH!==St&&this._$AR(),this._$AH=St):e!==this._$AH&&e!==fn&&this.g(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):R9(e)?this.k(e):this.g(e)}O(e,r=this._$AB){return this._$AA.parentNode.insertBefore(e,r)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}g(e){this._$AH!==St&&Yi(this._$AH)?this._$AA.nextSibling.data=e:this.T(Hn.createTextNode(e)),this._$AH=e}$(e){var r;const{values:n,_$litType$:i}=e,o=typeof i=="number"?this._$AC(e):(i.el===void 0&&(i.el=Ji.createElement(i.h,this.options)),i);if(((r=this._$AH)===null||r===void 0?void 0:r._$AD)===o)this._$AH.p(n);else{const s=new M9(o,this),a=s.v(this.options);s.p(n),this.T(a),this._$AH=s}}_$AC(e){let r=$d.get(e.strings);return r===void 0&&$d.set(e.strings,r=new Ji(e)),r}k(e){xd(this._$AH)||(this._$AH=[],this._$AR());const r=this._$AH;let n,i=0;for(const o of e)i===r.length?r.push(n=new Xi(this.O(Gi()),this.O(Gi()),this,this.options)):n=r[i],n._$AI(o),i++;i<r.length&&(this._$AR(n&&n._$AB.nextSibling,i),r.length=i)}_$AR(e=this._$AA.nextSibling,r){var n;for((n=this._$AP)===null||n===void 0||n.call(this,!1,!0,r);e&&e!==this._$AB;){const i=e.nextSibling;e.remove(),e=i}}setConnected(e){var r;this._$AM===void 0&&(this._$Cm=e,(r=this._$AP)===null||r===void 0||r.call(this,e))}}class Ss{constructor(e,r,n,i,o){this.type=1,this._$AH=St,this._$AN=void 0,this.element=e,this.name=r,this._$AM=i,this.options=o,n.length>2||n[0]!==""||n[1]!==""?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=St}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(e,r=this,n,i){const o=this.strings;let s=!1;if(o===void 0)e=Wn(this,e,r,0),s=!Yi(e)||e!==this._$AH&&e!==fn,s&&(this._$AH=e);else{const a=e;let l,u;for(e=o[0],l=0;l<o.length-1;l++)u=Wn(this,a[n+l],r,l),u===fn&&(u=this._$AH[l]),s||(s=!Yi(u)||u!==this._$AH[l]),u===St?e=St:e!==St&&(e+=(u??"")+o[l+1]),this._$AH[l]=u}s&&!i&&this.j(e)}j(e){e===St?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}}class U9 extends Ss{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===St?void 0:e}}const B9=kn?kn.emptyScript:"";class j9 extends Ss{constructor(){super(...arguments),this.type=4}j(e){e&&e!==St?this.element.setAttribute(this.name,B9):this.element.removeAttribute(this.name)}}class k9 extends Ss{constructor(e,r,n,i,o){super(e,r,n,i,o),this.type=5}_$AI(e,r=this){var n;if((e=(n=Wn(this,e,r,0))!==null&&n!==void 0?n:St)===fn)return;const i=this._$AH,o=e===St&&i!==St||e.capture!==i.capture||e.once!==i.once||e.passive!==i.passive,s=e!==St&&(i===St||o);o&&this.element.removeEventListener(this.name,this,i),s&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){var r,n;typeof this._$AH=="function"?this._$AH.call((n=(r=this.options)===null||r===void 0?void 0:r.host)!==null&&n!==void 0?n:this.element,e):this._$AH.handleEvent(e)}}class H9{constructor(e,r,n){this.element=e,this.type=6,this._$AN=void 0,this._$AM=r,this.options=n}get _$AU(){return this._$AM._$AU}_$AI(e){Wn(this,e)}}const Fd=Cs.litHtmlPolyfillSupport;Fd?.(Ji,Xi),((Hc=Cs.litHtmlVersions)!==null&&Hc!==void 0?Hc:Cs.litHtmlVersions=[]).push("2.6.1");const z9=(t,e,r)=>{var n,i;const o=(n=r?.renderBefore)!==null&&n!==void 0?n:e;let s=o._$litPart$;if(s===void 0){const a=(i=r?.renderBefore)!==null&&i!==void 0?i:null;o._$litPart$=s=new Xi(e.insertBefore(Gi(),a),a,void 0,r??{})}return s._$AI(t),s};/**
87
+ \f\r"'\`<>=]|("|')|))|$)`,"g"),l0=/'/g,u0=/"/g,h0=/^(?:script|style|textarea|title)$/i,d0=t=>(e,...r)=>({_$litType$:t,strings:e,values:r}),V=d0(1),Ae=d0(2),zr=Symbol.for("lit-noChange"),ct=Symbol.for("lit-nothing"),f0=new WeakMap,bn=yn.createTreeWalker(yn,129,null,!1),kb=(t,e)=>{const r=t.length-1,n=[];let i,s=e===2?"<svg>":"",o=pi;for(let c=0;c<r;c++){const l=t[c];let p,w,y=-1,m=0;for(;m<l.length&&(o.lastIndex=m,w=o.exec(l),w!==null);)m=o.lastIndex,o===pi?w[1]==="!--"?o=a0:w[1]!==void 0?o=c0:w[2]!==void 0?(h0.test(w[2])&&(i=RegExp("</"+w[2],"g")),o=Hr):w[3]!==void 0&&(o=Hr):o===Hr?w[0]===">"?(o=i??pi,y=-1):w[1]===void 0?y=-2:(y=o.lastIndex-w[2].length,p=w[1],o=w[3]===void 0?Hr:w[3]==='"'?u0:l0):o===u0||o===l0?o=Hr:o===a0||o===c0?o=pi:(o=Hr,i=void 0);const E=o===Hr&&t[c+1].startsWith("/>")?" ":"";s+=o===pi?l+Bb:y>=0?(n.push(p),l.slice(0,y)+"$lit$"+l.slice(y)+_r+E):l+_r+(y===-2?(n.push(void 0),c):E)}const a=s+(t[r]||"<?>")+(e===2?"</svg>":"");if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return[i0!==void 0?i0.createHTML(a):a,n]};class gi{constructor({strings:e,_$litType$:r},n){let i;this.parts=[];let s=0,o=0;const a=e.length-1,c=this.parts,[l,p]=kb(e,r);if(this.el=gi.createElement(l,n),bn.currentNode=this.el.content,r===2){const w=this.el.content,y=w.firstChild;y.remove(),w.append(...y.childNodes)}for(;(i=bn.nextNode())!==null&&c.length<a;){if(i.nodeType===1){if(i.hasAttributes()){const w=[];for(const y of i.getAttributeNames())if(y.endsWith("$lit$")||y.startsWith(_r)){const m=p[o++];if(w.push(y),m!==void 0){const E=i.getAttribute(m.toLowerCase()+"$lit$").split(_r),A=/([.?@])?(.*)/.exec(m);c.push({type:1,index:s,name:A[2],strings:E,ctor:A[1]==="."?zb:A[1]==="?"?qb:A[1]==="@"?Vb:xs})}else c.push({type:6,index:s})}for(const y of w)i.removeAttribute(y)}if(h0.test(i.tagName)){const w=i.textContent.split(_r),y=w.length-1;if(y>0){i.textContent=wn?wn.emptyScript:"";for(let m=0;m<y;m++)i.append(w[m],di()),bn.nextNode(),c.push({type:2,index:++s});i.append(w[y],di())}}}else if(i.nodeType===8)if(i.data===s0)c.push({type:2,index:s});else{let w=-1;for(;(w=i.data.indexOf(_r,w+1))!==-1;)c.push({type:7,index:s}),w+=_r.length-1}s++}}static createElement(e,r){const n=yn.createElement("template");return n.innerHTML=e,n}}function vn(t,e,r=t,n){var i,s,o,a;if(e===zr)return e;let c=n!==void 0?(i=r._$Co)===null||i===void 0?void 0:i[n]:r._$Cl;const l=fi(e)?void 0:e._$litDirective$;return c?.constructor!==l&&((s=c?._$AO)===null||s===void 0||s.call(c,!1),l===void 0?c=void 0:(c=new l(t),c._$AT(t,r,n)),n!==void 0?((o=(a=r)._$Co)!==null&&o!==void 0?o:a._$Co=[])[n]=c:r._$Cl=c),c!==void 0&&(e=vn(t,c._$AS(t,e.values),c,n)),e}class Hb{constructor(e,r){this.u=[],this._$AN=void 0,this._$AD=e,this._$AM=r}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}v(e){var r;const{el:{content:n},parts:i}=this._$AD,s=((r=e?.creationScope)!==null&&r!==void 0?r:yn).importNode(n,!0);bn.currentNode=s;let o=bn.nextNode(),a=0,c=0,l=i[0];for(;l!==void 0;){if(a===l.index){let p;l.type===2?p=new mi(o,o.nextSibling,this,e):l.type===1?p=new l.ctor(o,l.name,l.strings,this,e):l.type===6&&(p=new Kb(o,this,e)),this.u.push(p),l=i[++c]}a!==l?.index&&(o=bn.nextNode(),a++)}return s}p(e){let r=0;for(const n of this.u)n!==void 0&&(n.strings!==void 0?(n._$AI(e,n,r),r+=n.strings.length-2):n._$AI(e[r])),r++}}class mi{constructor(e,r,n,i){var s;this.type=2,this._$AH=ct,this._$AN=void 0,this._$AA=e,this._$AB=r,this._$AM=n,this.options=i,this._$Cm=(s=i?.isConnected)===null||s===void 0||s}get _$AU(){var e,r;return(r=(e=this._$AM)===null||e===void 0?void 0:e._$AU)!==null&&r!==void 0?r:this._$Cm}get parentNode(){let e=this._$AA.parentNode;const r=this._$AM;return r!==void 0&&e.nodeType===11&&(e=r.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,r=this){e=vn(this,e,r),fi(e)?e===ct||e==null||e===""?(this._$AH!==ct&&this._$AR(),this._$AH=ct):e!==this._$AH&&e!==zr&&this.g(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):jb(e)?this.k(e):this.g(e)}O(e,r=this._$AB){return this._$AA.parentNode.insertBefore(e,r)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}g(e){this._$AH!==ct&&fi(this._$AH)?this._$AA.nextSibling.data=e:this.T(yn.createTextNode(e)),this._$AH=e}$(e){var r;const{values:n,_$litType$:i}=e,s=typeof i=="number"?this._$AC(e):(i.el===void 0&&(i.el=gi.createElement(i.h,this.options)),i);if(((r=this._$AH)===null||r===void 0?void 0:r._$AD)===s)this._$AH.p(n);else{const o=new Hb(s,this),a=o.v(this.options);o.p(n),this.T(a),this._$AH=o}}_$AC(e){let r=f0.get(e.strings);return r===void 0&&f0.set(e.strings,r=new gi(e)),r}k(e){o0(this._$AH)||(this._$AH=[],this._$AR());const r=this._$AH;let n,i=0;for(const s of e)i===r.length?r.push(n=new mi(this.O(di()),this.O(di()),this,this.options)):n=r[i],n._$AI(s),i++;i<r.length&&(this._$AR(n&&n._$AB.nextSibling,i),r.length=i)}_$AR(e=this._$AA.nextSibling,r){var n;for((n=this._$AP)===null||n===void 0||n.call(this,!1,!0,r);e&&e!==this._$AB;){const i=e.nextSibling;e.remove(),e=i}}setConnected(e){var r;this._$AM===void 0&&(this._$Cm=e,(r=this._$AP)===null||r===void 0||r.call(this,e))}}class xs{constructor(e,r,n,i,s){this.type=1,this._$AH=ct,this._$AN=void 0,this.element=e,this.name=r,this._$AM=i,this.options=s,n.length>2||n[0]!==""||n[1]!==""?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=ct}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(e,r=this,n,i){const s=this.strings;let o=!1;if(s===void 0)e=vn(this,e,r,0),o=!fi(e)||e!==this._$AH&&e!==zr,o&&(this._$AH=e);else{const a=e;let c,l;for(e=s[0],c=0;c<s.length-1;c++)l=vn(this,a[n+c],r,c),l===zr&&(l=this._$AH[c]),o||(o=!fi(l)||l!==this._$AH[c]),l===ct?e=ct:e!==ct&&(e+=(l??"")+s[c+1]),this._$AH[c]=l}o&&!i&&this.j(e)}j(e){e===ct?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}}class zb extends xs{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===ct?void 0:e}}const Wb=wn?wn.emptyScript:"";class qb extends xs{constructor(){super(...arguments),this.type=4}j(e){e&&e!==ct?this.element.setAttribute(this.name,Wb):this.element.removeAttribute(this.name)}}class Vb extends xs{constructor(e,r,n,i,s){super(e,r,n,i,s),this.type=5}_$AI(e,r=this){var n;if((e=(n=vn(this,e,r,0))!==null&&n!==void 0?n:ct)===zr)return;const i=this._$AH,s=e===ct&&i!==ct||e.capture!==i.capture||e.once!==i.once||e.passive!==i.passive,o=e!==ct&&(i===ct||s);s&&this.element.removeEventListener(this.name,this,i),o&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){var r,n;typeof this._$AH=="function"?this._$AH.call((n=(r=this.options)===null||r===void 0?void 0:r.host)!==null&&n!==void 0?n:this.element,e):this._$AH.handleEvent(e)}}class Kb{constructor(e,r,n){this.element=e,this.type=6,this._$AN=void 0,this._$AM=r,this.options=n}get _$AU(){return this._$AM._$AU}_$AI(e){vn(this,e)}}const p0=Es.litHtmlPolyfillSupport;p0?.(gi,mi),((Ta=Es.litHtmlVersions)!==null&&Ta!==void 0?Ta:Es.litHtmlVersions=[]).push("2.6.1");const Gb=(t,e,r)=>{var n,i;const s=(n=r?.renderBefore)!==null&&n!==void 0?n:e;let o=s._$litPart$;if(o===void 0){const a=(i=r?.renderBefore)!==null&&i!==void 0?i:null;s._$litPart$=o=new mi(e.insertBefore(di(),a),a,void 0,r??{})}return o._$AI(t),o};/**
127
88
  * @license
128
89
  * Copyright 2017 Google LLC
129
90
  * SPDX-License-Identifier: BSD-3-Clause
130
- */var zc,Wc;class Ie extends jn{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var e,r;const n=super.createRenderRoot();return(e=(r=this.renderOptions).renderBefore)!==null&&e!==void 0||(r.renderBefore=n.firstChild),n}update(e){const r=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=z9(r,this.renderRoot,this.renderOptions)}connectedCallback(){var e;super.connectedCallback(),(e=this._$Do)===null||e===void 0||e.setConnected(!0)}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this._$Do)===null||e===void 0||e.setConnected(!1)}render(){return fn}}Ie.finalized=!0,Ie._$litElement$=!0,(zc=globalThis.litElementHydrateSupport)===null||zc===void 0||zc.call(globalThis,{LitElement:Ie});const Pd=globalThis.litElementPolyfillSupport;Pd?.({LitElement:Ie}),((Wc=globalThis.litElementVersions)!==null&&Wc!==void 0?Wc:globalThis.litElementVersions=[]).push("3.2.2");/**
91
+ */var Na,Ra;class de extends mn{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var e,r;const n=super.createRenderRoot();return(e=(r=this.renderOptions).renderBefore)!==null&&e!==void 0||(r.renderBefore=n.firstChild),n}update(e){const r=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=Gb(r,this.renderRoot,this.renderOptions)}connectedCallback(){var e;super.connectedCallback(),(e=this._$Do)===null||e===void 0||e.setConnected(!0)}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this._$Do)===null||e===void 0||e.setConnected(!1)}render(){return zr}}de.finalized=!0,de._$litElement$=!0,(Na=globalThis.litElementHydrateSupport)===null||Na===void 0||Na.call(globalThis,{LitElement:de});const g0=globalThis.litElementPolyfillSupport;g0?.({LitElement:de}),((Ra=globalThis.litElementVersions)!==null&&Ra!==void 0?Ra:globalThis.litElementVersions=[]).push("3.2.2");/**
131
92
  * @license
132
93
  * Copyright 2017 Google LLC
133
94
  * SPDX-License-Identifier: BSD-3-Clause
134
- */const Le=t=>e=>typeof e=="function"?((r,n)=>(customElements.define(r,n),n))(t,e):((r,n)=>{const{kind:i,elements:o}=n;return{kind:i,elements:o,finisher(s){customElements.define(r,s)}}})(t,e);/**
95
+ */const we=t=>e=>typeof e=="function"?((r,n)=>(customElements.define(r,n),n))(t,e):((r,n)=>{const{kind:i,elements:s}=n;return{kind:i,elements:s,finisher(o){customElements.define(r,o)}}})(t,e);/**
135
96
  * @license
136
97
  * Copyright 2017 Google LLC
137
98
  * SPDX-License-Identifier: BSD-3-Clause
138
- */const W9=(t,e)=>e.kind==="method"&&e.descriptor&&!("value"in e.descriptor)?{...e,finisher(r){r.createProperty(e.key,t)}}:{kind:"field",key:Symbol(),placement:"own",descriptor:{},originalKey:e.key,initializer(){typeof e.initializer=="function"&&(this[e.key]=e.initializer.call(this))},finisher(r){r.createProperty(e.key,t)}};function je(t){return(e,r)=>r!==void 0?((n,i,o)=>{i.constructor.createProperty(o,n)})(t,e,r):W9(t,e)}/**
99
+ */const Yb=(t,e)=>e.kind==="method"&&e.descriptor&&!("value"in e.descriptor)?{...e,finisher(r){r.createProperty(e.key,t)}}:{kind:"field",key:Symbol(),placement:"own",descriptor:{},originalKey:e.key,initializer(){typeof e.initializer=="function"&&(this[e.key]=e.initializer.call(this))},finisher(r){r.createProperty(e.key,t)}};function be(t){return(e,r)=>r!==void 0?((n,i,s)=>{i.constructor.createProperty(s,n)})(t,e,r):Yb(t,e)}/**
139
100
  * @license
140
101
  * Copyright 2017 Google LLC
141
102
  * SPDX-License-Identifier: BSD-3-Clause
142
- */function ut(t){return je({...t,state:!0})}/**
103
+ */function Be(t){return be({...t,state:!0})}/**
143
104
  * @license
144
105
  * Copyright 2021 Google LLC
145
106
  * SPDX-License-Identifier: BSD-3-Clause
146
- */var Vc;((Vc=window.HTMLSlotElement)===null||Vc===void 0?void 0:Vc.prototype.assignedElements)!=null;/**
107
+ */var La;((La=window.HTMLSlotElement)===null||La===void 0?void 0:La.prototype.assignedElements)!=null;/**
147
108
  * @license
148
109
  * Copyright 2017 Google LLC
149
110
  * SPDX-License-Identifier: BSD-3-Clause
150
- */const V9={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},q9=t=>(...e)=>({_$litDirective$:t,values:e});class K9{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,r,n){this._$Ct=e,this._$AM=r,this._$Ci=n}_$AS(e,r){return this.update(e,r)}update(e,r){return this.render(...r)}}/**
111
+ */const Zb={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},Jb=t=>(...e)=>({_$litDirective$:t,values:e});class Xb{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,r,n){this._$Ct=e,this._$AM=r,this._$Ci=n}_$AS(e,r){return this.update(e,r)}update(e,r){return this.render(...r)}}/**
151
112
  * @license
152
113
  * Copyright 2018 Google LLC
153
114
  * SPDX-License-Identifier: BSD-3-Clause
154
- */const tr=q9(class extends K9{constructor(t){var e;if(super(t),t.type!==V9.ATTRIBUTE||t.name!=="class"||((e=t.strings)===null||e===void 0?void 0:e.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(t){return" "+Object.keys(t).filter(e=>t[e]).join(" ")+" "}update(t,[e]){var r,n;if(this.nt===void 0){this.nt=new Set,t.strings!==void 0&&(this.st=new Set(t.strings.join(" ").split(/\s/).filter(o=>o!=="")));for(const o in e)e[o]&&!(!((r=this.st)===null||r===void 0)&&r.has(o))&&this.nt.add(o);return this.render(e)}const i=t.element.classList;this.nt.forEach(o=>{o in e||(i.remove(o),this.nt.delete(o))});for(const o in e){const s=!!e[o];s===this.nt.has(o)||!((n=this.st)===null||n===void 0)&&n.has(o)||(s?(i.add(o),this.nt.add(o)):(i.remove(o),this.nt.delete(o)))}return fn}});function G9(t,e){t.indexOf(e)===-1&&t.push(e)}const Td=(t,e,r)=>Math.min(Math.max(r,t),e),hr={duration:.3,delay:0,endDelay:0,repeat:0,easing:"ease"},Qi=t=>typeof t=="number",Vn=t=>Array.isArray(t)&&!Qi(t[0]),Y9=(t,e,r)=>{const n=e-t;return((r-t)%n+n)%n+t};function Z9(t,e){return Vn(t)?t[Y9(0,t.length,e)]:t}const Nd=(t,e,r)=>-r*t+r*e+t,Rd=()=>{},Er=t=>t,qc=(t,e,r)=>e-t===0?1:(r-t)/(e-t);function Ld(t,e){const r=t[t.length-1];for(let n=1;n<=e;n++){const i=qc(0,e,n);t.push(Nd(r,1,i))}}function J9(t){const e=[0];return Ld(e,t-1),e}function X9(t,e=J9(t.length),r=Er){const n=t.length,i=n-e.length;return i>0&&Ld(e,i),o=>{let s=0;for(;s<n-2&&!(o<e[s+1]);s++);let a=Td(0,1,qc(e[s],e[s+1],o));return a=Z9(r,s)(a),Nd(t[s],t[s+1],a)}}const Md=t=>Array.isArray(t)&&Qi(t[0]),Kc=t=>typeof t=="object"&&Boolean(t.createAnimation),dn=t=>typeof t=="function",Ud=t=>typeof t=="string",qn={ms:t=>t*1e3,s:t=>t/1e3};function Q9(t,e){return e?t*(1e3/e):0}const Bd=(t,e,r)=>(((1-3*r+3*e)*t+(3*r-6*e))*t+3*e)*t,ex=1e-7,tx=12;function rx(t,e,r,n,i){let o,s,a=0;do s=e+(r-e)/2,o=Bd(s,n,i)-t,o>0?r=s:e=s;while(Math.abs(o)>ex&&++a<tx);return s}function eo(t,e,r,n){if(t===e&&r===n)return Er;const i=o=>rx(o,0,1,t,r);return o=>o===0||o===1?o:Bd(i(o),e,n)}const nx=(t,e="end")=>r=>{r=e==="end"?Math.min(r,.999):Math.max(r,.001);const n=r*t,i=e==="end"?Math.floor(n):Math.ceil(n);return Td(0,1,i/t)},jd={ease:eo(.25,.1,.25,1),"ease-in":eo(.42,0,1,1),"ease-in-out":eo(.42,0,.58,1),"ease-out":eo(0,0,.58,1)},ix=/\((.*?)\)/;function kd(t){if(dn(t))return t;if(Md(t))return eo(...t);if(jd[t])return jd[t];if(t.startsWith("steps")){const e=ix.exec(t);if(e){const r=e[1].split(",");return nx(parseFloat(r[0]),r[1].trim())}}return Er}class Hd{constructor(e,r=[0,1],{easing:n,duration:i=hr.duration,delay:o=hr.delay,endDelay:s=hr.endDelay,repeat:a=hr.repeat,offset:l,direction:u="normal"}={}){if(this.startTime=null,this.rate=1,this.t=0,this.cancelTimestamp=null,this.easing=Er,this.duration=0,this.totalDuration=0,this.repeat=0,this.playState="idle",this.finished=new Promise((y,m)=>{this.resolve=y,this.reject=m}),n=n||hr.easing,Kc(n)){const y=n.createAnimation(r);n=y.easing,r=y.keyframes||r,i=y.duration||i}this.repeat=a,this.easing=Vn(n)?Er:kd(n),this.updateDuration(i);const d=X9(r,l,Vn(n)?n.map(kd):Er);this.tick=y=>{var m;o=o;let v=0;this.pauseTime!==void 0?v=this.pauseTime:v=(y-this.startTime)*this.rate,this.t=v,v/=1e3,v=Math.max(v-o,0),this.playState==="finished"&&this.pauseTime===void 0&&(v=this.totalDuration);const _=v/this.duration;let R=Math.floor(_),M=_%1;!M&&_>=1&&(M=1),M===1&&R--;const B=R%2;(u==="reverse"||u==="alternate"&&B||u==="alternate-reverse"&&!B)&&(M=1-M);const D=v>=this.totalDuration?1:Math.min(M,1),N=d(this.easing(D));e(N),this.pauseTime===void 0&&(this.playState==="finished"||v>=this.totalDuration+s)?(this.playState="finished",(m=this.resolve)===null||m===void 0||m.call(this,N)):this.playState!=="idle"&&(this.frameRequestId=requestAnimationFrame(this.tick))},this.play()}play(){const e=performance.now();this.playState="running",this.pauseTime!==void 0?this.startTime=e-this.pauseTime:this.startTime||(this.startTime=e),this.cancelTimestamp=this.startTime,this.pauseTime=void 0,this.frameRequestId=requestAnimationFrame(this.tick)}pause(){this.playState="paused",this.pauseTime=this.t}finish(){this.playState="finished",this.tick(0)}stop(){var e;this.playState="idle",this.frameRequestId!==void 0&&cancelAnimationFrame(this.frameRequestId),(e=this.reject)===null||e===void 0||e.call(this,!1)}cancel(){this.stop(),this.tick(this.cancelTimestamp)}reverse(){this.rate*=-1}commitStyles(){}updateDuration(e){this.duration=e,this.totalDuration=e*(this.repeat+1)}get currentTime(){return this.t}set currentTime(e){this.pauseTime!==void 0||this.rate===0?this.pauseTime=e:this.startTime=performance.now()-e/this.rate}get playbackRate(){return this.rate}set playbackRate(e){this.rate=e}}var Gc=function(){};process.env.NODE_ENV!=="production"&&(Gc=function(t,e){if(!t)throw new Error(e)});class ox{setAnimation(e){this.animation=e,e?.finished.then(()=>this.clearAnimation()).catch(()=>{})}clearAnimation(){this.animation=this.generator=void 0}}const Yc=new WeakMap;function zd(t){return Yc.has(t)||Yc.set(t,{transforms:[],values:new Map}),Yc.get(t)}function sx(t,e){return t.has(e)||t.set(e,new ox),t.get(e)}const ax=["","X","Y","Z"],cx=["translate","scale","rotate","skew"],As={x:"translateX",y:"translateY",z:"translateZ"},Wd={syntax:"<angle>",initialValue:"0deg",toDefaultUnit:t=>t+"deg"},lx={translate:{syntax:"<length-percentage>",initialValue:"0px",toDefaultUnit:t=>t+"px"},rotate:Wd,scale:{syntax:"<number>",initialValue:1,toDefaultUnit:Er},skew:Wd},Kn=new Map,Zc=t=>`--motion-${t}`,Is=["x","y","z"];cx.forEach(t=>{ax.forEach(e=>{Is.push(t+e),Kn.set(Zc(t+e),lx[t])})});const ux=(t,e)=>Is.indexOf(t)-Is.indexOf(e),hx=new Set(Is),Vd=t=>hx.has(t),fx=(t,e)=>{As[e]&&(e=As[e]);const{transforms:r}=zd(t);G9(r,e),t.style.transform=dx(r)},dx=t=>t.sort(ux).reduce(px,"").trim(),px=(t,e)=>`${t} ${e}(var(${Zc(e)}))`,Jc=t=>t.startsWith("--"),qd=new Set;function gx(t){if(!qd.has(t)){qd.add(t);try{const{syntax:e,initialValue:r}=Kn.has(t)?Kn.get(t):{};CSS.registerProperty({name:t,inherits:!1,syntax:e,initialValue:r})}catch{}}}const Xc=(t,e)=>document.createElement("div").animate(t,e),Kd={cssRegisterProperty:()=>typeof CSS<"u"&&Object.hasOwnProperty.call(CSS,"registerProperty"),waapi:()=>Object.hasOwnProperty.call(Element.prototype,"animate"),partialKeyframes:()=>{try{Xc({opacity:[1]})}catch{return!1}return!0},finished:()=>Boolean(Xc({opacity:[0,1]},{duration:.001}).finished),linearEasing:()=>{try{Xc({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0}},Qc={},Gn={};for(const t in Kd)Gn[t]=()=>(Qc[t]===void 0&&(Qc[t]=Kd[t]()),Qc[t]);const mx=.015,bx=(t,e)=>{let r="";const n=Math.round(e/mx);for(let i=0;i<n;i++)r+=t(qc(0,n-1,i))+", ";return r.substring(0,r.length-2)},Gd=(t,e)=>dn(t)?Gn.linearEasing()?`linear(${bx(t,e)})`:hr.easing:Md(t)?yx(t):t,yx=([t,e,r,n])=>`cubic-bezier(${t}, ${e}, ${r}, ${n})`;function wx(t,e){for(let r=0;r<t.length;r++)t[r]===null&&(t[r]=r?t[r-1]:e());return t}const vx=t=>Array.isArray(t)?t:[t];function Os(t){return As[t]&&(t=As[t]),Vd(t)?Zc(t):t}const Ds={get:(t,e)=>{e=Os(e);let r=Jc(e)?t.style.getPropertyValue(e):getComputedStyle(t)[e];if(!r&&r!==0){const n=Kn.get(e);n&&(r=n.initialValue)}return r},set:(t,e,r)=>{e=Os(e),Jc(e)?t.style.setProperty(e,r):t.style[e]=r}};function Yd(t,e=!0){if(!(!t||t.playState==="finished"))try{t.stop?t.stop():(e&&t.commitStyles(),t.cancel())}catch{}}function Zd(t,e){var r;let n=e?.toDefaultUnit||Er;const i=t[t.length-1];if(Ud(i)){const o=((r=i.match(/(-?[\d.]+)([a-z%]*)/))===null||r===void 0?void 0:r[2])||"";o&&(n=s=>s+o)}return n}function _x(){return window.__MOTION_DEV_TOOLS_RECORD}function Ex(t,e,r,n={},i){const o=_x(),s=n.record!==!1&&o;let a,{duration:l=hr.duration,delay:u=hr.delay,endDelay:d=hr.endDelay,repeat:y=hr.repeat,easing:m=hr.easing,persist:v=!1,direction:_,offset:R,allowWebkitAcceleration:M=!1}=n;const B=zd(t),D=Vd(e);let N=Gn.waapi();D&&fx(t,e);const C=Os(e),$=sx(B.values,C),P=Kn.get(C);return Yd($.animation,!(Kc(m)&&$.generator)&&n.record!==!1),()=>{const h=()=>{var z,Y;return(Y=(z=Ds.get(t,C))!==null&&z!==void 0?z:P?.initialValue)!==null&&Y!==void 0?Y:0};let S=wx(vx(r),h);const q=Zd(S,P);if(Kc(m)){const z=m.createAnimation(S,e!=="opacity",h,C,$);m=z.easing,S=z.keyframes||S,l=z.duration||l}if(Jc(C)&&(Gn.cssRegisterProperty()?gx(C):N=!1),D&&!Gn.linearEasing()&&(dn(m)||Vn(m)&&m.some(dn))&&(N=!1),N){P&&(S=S.map(re=>Qi(re)?P.toDefaultUnit(re):re)),S.length===1&&(!Gn.partialKeyframes()||s)&&S.unshift(h());const z={delay:qn.ms(u),duration:qn.ms(l),endDelay:qn.ms(d),easing:Vn(m)?void 0:Gd(m,l),direction:_,iterations:y+1,fill:"both"};a=t.animate({[C]:S,offset:R,easing:Vn(m)?m.map(re=>Gd(re,l)):void 0},z),a.finished||(a.finished=new Promise((re,ie)=>{a.onfinish=re,a.oncancel=ie}));const Y=S[S.length-1];a.finished.then(()=>{v||(Ds.set(t,C,Y),a.cancel())}).catch(Rd),M||(a.playbackRate=1.000001)}else if(i&&D)S=S.map(z=>typeof z=="string"?parseFloat(z):z),S.length===1&&S.unshift(parseFloat(h())),a=new i(z=>{Ds.set(t,C,q?q(z):z)},S,Object.assign(Object.assign({},n),{duration:l,easing:m}));else{const z=S[S.length-1];Ds.set(t,C,P&&Qi(z)?P.toDefaultUnit(z):z)}return s&&o(t,e,S,{duration:l,delay:u,easing:m,repeat:y,offset:R},"motion-one"),$.setAnimation(a),a}}const xx=(t,e)=>t[e]?Object.assign(Object.assign({},t),t[e]):Object.assign({},t);function Jd(t,e){var r;return typeof t=="string"?e?((r=e[t])!==null&&r!==void 0||(e[t]=document.querySelectorAll(t)),t=e[t]):t=document.querySelectorAll(t):t instanceof Element&&(t=[t]),Array.from(t||[])}const Cx=t=>t(),Xd=(t,e,r=hr.duration)=>new Proxy({animations:t.map(Cx).filter(Boolean),duration:r,options:e},Ax),Sx=t=>t.animations[0],Ax={get:(t,e)=>{const r=Sx(t);switch(e){case"duration":return t.duration;case"currentTime":return qn.s(r?.[e]||0);case"playbackRate":case"playState":return r?.[e];case"finished":return t.finished||(t.finished=Promise.all(t.animations.map(Ix)).catch(Rd)),t.finished;case"stop":return()=>{t.animations.forEach(n=>Yd(n))};case"forEachNative":return n=>{t.animations.forEach(i=>n(i,t))};default:return typeof r?.[e]>"u"?void 0:()=>t.animations.forEach(n=>n[e]())}},set:(t,e,r)=>{switch(e){case"currentTime":r=qn.ms(r);case"currentTime":case"playbackRate":for(let n=0;n<t.animations.length;n++)t.animations[n][e]=r;return!0}return!1}},Ix=t=>t.finished;function Ox(t,e,r){return dn(t)?t(e,r):t}function Dx(t){return function(r,n,i={}){r=Jd(r);const o=r.length;Gc(Boolean(o),"No valid element provided."),Gc(Boolean(n),"No keyframes defined.");const s=[];for(let a=0;a<o;a++){const l=r[a];for(const u in n){const d=xx(i,u);d.delay=Ox(d.delay,a,o);const y=Ex(l,u,n[u],d,t);s.push(y)}}return Xd(s,i,i.duration)}}const $x=Dx(Hd);function Fx(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r}const Px=5;function Qd(t,e,r){const n=Math.max(e-Px,0);return Q9(r-t(n),e-n)}const Yn={stiffness:100,damping:10,mass:1},Tx=(t=Yn.stiffness,e=Yn.damping,r=Yn.mass)=>e/(2*Math.sqrt(t*r));function Nx(t,e,r){return t<e&&r>=e||t>e&&r<=e}const Rx=({stiffness:t=Yn.stiffness,damping:e=Yn.damping,mass:r=Yn.mass,from:n=0,to:i=1,velocity:o=0,restSpeed:s=2,restDistance:a=.5}={})=>{o=o?qn.s(o):0;const l={done:!1,hasReachedTarget:!1,current:n,target:i},u=i-n,d=Math.sqrt(t/r)/1e3,y=Tx(t,e,r);let m;if(y<1){const v=d*Math.sqrt(1-y*y);m=_=>i-Math.exp(-y*d*_)*((-o+y*d*u)/v*Math.sin(v*_)+u*Math.cos(v*_))}else m=v=>i-Math.exp(-d*v)*(u+(-o+d*u)*v);return v=>{l.current=m(v);const _=v===0?o:Qd(m,v,l.current),R=Math.abs(_)<=s,M=Math.abs(i-l.current)<=a;return l.done=R&&M,l.hasReachedTarget=Nx(n,i,l.current),l}},el=10,Lx=1e4;function Mx(t,e=Er){let r,n=el,i=t(0);const o=[e(i.current)];for(;!i.done&&n<Lx;)i=t(n),o.push(e(i.done?i.target:i.current)),r===void 0&&i.hasReachedTarget&&(r=n),n+=el;const s=n-el;return o.length===1&&o.push(i.current),{keyframes:o,duration:s/1e3,overshootDuration:(r??s)/1e3}}function ep(t){return Qi(t)&&!isNaN(t)}function tl(t){return Ud(t)?parseFloat(t):t}function Ux(t){const e=new WeakMap;return(r={})=>{const n=new Map,i=(s=0,a=100,l=0,u=!1)=>{const d=`${s}-${a}-${l}-${u}`;return n.has(d)||n.set(d,t(Object.assign({from:s,to:a,velocity:l,restSpeed:u?.05:2,restDistance:u?.01:.5},r))),n.get(d)},o=(s,a)=>(e.has(s)||e.set(s,Mx(s,a)),e.get(s));return{createAnimation:(s,a=!0,l,u,d)=>{let y,m,v,_=0,R=Er;const M=s.length;if(a){R=Zd(s,u?Kn.get(Os(u)):void 0);const B=s[M-1];if(v=tl(B),M>1&&s[0]!==null)m=tl(s[0]);else{const D=d?.generator;if(D){const{animation:N,generatorStartTime:C}=d,$=N?.startTime||C||0,P=N?.currentTime||performance.now()-$,h=D(P).current;m=h,_=Qd(S=>D(S).current,P,h)}else l&&(m=tl(l()))}}if(ep(m)&&ep(v)){const B=i(m,v,_,u?.includes("scale"));y=Object.assign(Object.assign({},o(B,R)),{easing:"linear"}),d&&(d.generator=B,d.generatorStartTime=performance.now())}return y||(y={easing:"ease",duration:o(i(0,100)).overshootDuration}),y}}}}const $s=Ux(Rx),Bx={any:0,all:1};function jx(t,e,{root:r,margin:n,amount:i="any"}={}){if(typeof IntersectionObserver>"u")return()=>{};const o=Jd(t),s=new WeakMap,a=u=>{u.forEach(d=>{const y=s.get(d.target);if(d.isIntersecting!==Boolean(y))if(d.isIntersecting){const m=e(d);dn(m)?s.set(d.target,m):l.unobserve(d.target)}else y&&(y(d),s.delete(d.target))})},l=new IntersectionObserver(a,{root:r,rootMargin:n,threshold:typeof i=="number"?i:Bx[i]});return o.forEach(u=>l.observe(u)),()=>l.disconnect()}function rl(t,e,r){t.dispatchEvent(new CustomEvent(e,{detail:{originalEvent:r}}))}function tp(t,e,r){t.dispatchEvent(new CustomEvent(e,{detail:{originalEntry:r}}))}const kx={isActive:t=>Boolean(t.inView),subscribe:(t,{enable:e,disable:r},{inViewOptions:n={}})=>{const{once:i}=n,o=Fx(n,["once"]);return jx(t,s=>{if(e(),tp(t,"viewenter",s),!i)return a=>{r(),tp(t,"viewleave",a)}},o)}},rp=(t,e,r)=>n=>{n.pointerType&&n.pointerType!=="mouse"||(r(),rl(t,e,n))};[...Object.keys({inView:kx,hover:{isActive:t=>Boolean(t.hover),subscribe:(t,{enable:e,disable:r})=>{const n=rp(t,"hoverstart",e),i=rp(t,"hoverend",r);return t.addEventListener("pointerenter",n),t.addEventListener("pointerleave",i),()=>{t.removeEventListener("pointerenter",n),t.removeEventListener("pointerleave",i)}}},press:{isActive:t=>Boolean(t.press),subscribe:(t,{enable:e,disable:r})=>{const n=o=>{r(),rl(t,"pressend",o),window.removeEventListener("pointerup",n)},i=o=>{e(),rl(t,"pressstart",o),window.addEventListener("pointerup",n)};return t.addEventListener("pointerdown",i),()=>{t.removeEventListener("pointerdown",i),window.removeEventListener("pointerup",n)}}}})];function Hx(t,e={}){return Xd([()=>{const r=new Hd(t,[0,1],e);return r.finished.catch(()=>{}),r}],e,e.duration)}function Wr(t,e,r){return(dn(t)?Hx:$x)(t,e,r)}/**
115
+ */const Mt=Jb(class extends Xb{constructor(t){var e;if(super(t),t.type!==Zb.ATTRIBUTE||t.name!=="class"||((e=t.strings)===null||e===void 0?void 0:e.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(t){return" "+Object.keys(t).filter(e=>t[e]).join(" ")+" "}update(t,[e]){var r,n;if(this.nt===void 0){this.nt=new Set,t.strings!==void 0&&(this.st=new Set(t.strings.join(" ").split(/\s/).filter(s=>s!=="")));for(const s in e)e[s]&&!(!((r=this.st)===null||r===void 0)&&r.has(s))&&this.nt.add(s);return this.render(e)}const i=t.element.classList;this.nt.forEach(s=>{s in e||(i.remove(s),this.nt.delete(s))});for(const s in e){const o=!!e[s];o===this.nt.has(s)||!((n=this.st)===null||n===void 0)&&n.has(s)||(o?(i.add(s),this.nt.add(s)):(i.remove(s),this.nt.delete(s)))}return zr}});function Qb(t,e){t.indexOf(e)===-1&&t.push(e)}const m0=(t,e,r)=>Math.min(Math.max(r,t),e),Kt={duration:.3,delay:0,endDelay:0,repeat:0,easing:"ease"},wi=t=>typeof t=="number",_n=t=>Array.isArray(t)&&!wi(t[0]),ev=(t,e,r)=>{const n=e-t;return((r-t)%n+n)%n+t};function tv(t,e){return _n(t)?t[ev(0,t.length,e)]:t}const w0=(t,e,r)=>-r*t+r*e+t,y0=()=>{},ir=t=>t,Ma=(t,e,r)=>e-t===0?1:(r-t)/(e-t);function b0(t,e){const r=t[t.length-1];for(let n=1;n<=e;n++){const i=Ma(0,e,n);t.push(w0(r,1,i))}}function rv(t){const e=[0];return b0(e,t-1),e}function nv(t,e=rv(t.length),r=ir){const n=t.length,i=n-e.length;return i>0&&b0(e,i),s=>{let o=0;for(;o<n-2&&!(s<e[o+1]);o++);let a=m0(0,1,Ma(e[o],e[o+1],s));return a=tv(r,o)(a),w0(t[o],t[o+1],a)}}const v0=t=>Array.isArray(t)&&wi(t[0]),Ua=t=>typeof t=="object"&&Boolean(t.createAnimation),Wr=t=>typeof t=="function",_0=t=>typeof t=="string",En={ms:t=>t*1e3,s:t=>t/1e3};function iv(t,e){return e?t*(1e3/e):0}const E0=(t,e,r)=>(((1-3*r+3*e)*t+(3*r-6*e))*t+3*e)*t,sv=1e-7,ov=12;function av(t,e,r,n,i){let s,o,a=0;do o=e+(r-e)/2,s=E0(o,n,i)-t,s>0?r=o:e=o;while(Math.abs(s)>sv&&++a<ov);return o}function yi(t,e,r,n){if(t===e&&r===n)return ir;const i=s=>av(s,0,1,t,r);return s=>s===0||s===1?s:E0(i(s),e,n)}const cv=(t,e="end")=>r=>{r=e==="end"?Math.min(r,.999):Math.max(r,.001);const n=r*t,i=e==="end"?Math.floor(n):Math.ceil(n);return m0(0,1,i/t)},x0={ease:yi(.25,.1,.25,1),"ease-in":yi(.42,0,1,1),"ease-in-out":yi(.42,0,.58,1),"ease-out":yi(0,0,.58,1)},lv=/\((.*?)\)/;function C0(t){if(Wr(t))return t;if(v0(t))return yi(...t);if(x0[t])return x0[t];if(t.startsWith("steps")){const e=lv.exec(t);if(e){const r=e[1].split(",");return cv(parseFloat(r[0]),r[1].trim())}}return ir}class S0{constructor(e,r=[0,1],{easing:n,duration:i=Kt.duration,delay:s=Kt.delay,endDelay:o=Kt.endDelay,repeat:a=Kt.repeat,offset:c,direction:l="normal"}={}){if(this.startTime=null,this.rate=1,this.t=0,this.cancelTimestamp=null,this.easing=ir,this.duration=0,this.totalDuration=0,this.repeat=0,this.playState="idle",this.finished=new Promise((w,y)=>{this.resolve=w,this.reject=y}),n=n||Kt.easing,Ua(n)){const w=n.createAnimation(r);n=w.easing,r=w.keyframes||r,i=w.duration||i}this.repeat=a,this.easing=_n(n)?ir:C0(n),this.updateDuration(i);const p=nv(r,c,_n(n)?n.map(C0):ir);this.tick=w=>{var y;s=s;let m=0;this.pauseTime!==void 0?m=this.pauseTime:m=(w-this.startTime)*this.rate,this.t=m,m/=1e3,m=Math.max(m-s,0),this.playState==="finished"&&this.pauseTime===void 0&&(m=this.totalDuration);const E=m/this.duration;let A=Math.floor(E),N=E%1;!N&&E>=1&&(N=1),N===1&&A--;const M=A%2;(l==="reverse"||l==="alternate"&&M||l==="alternate-reverse"&&!M)&&(N=1-N);const x=m>=this.totalDuration?1:Math.min(N,1),D=p(this.easing(x));e(D),this.pauseTime===void 0&&(this.playState==="finished"||m>=this.totalDuration+o)?(this.playState="finished",(y=this.resolve)===null||y===void 0||y.call(this,D)):this.playState!=="idle"&&(this.frameRequestId=requestAnimationFrame(this.tick))},this.play()}play(){const e=performance.now();this.playState="running",this.pauseTime!==void 0?this.startTime=e-this.pauseTime:this.startTime||(this.startTime=e),this.cancelTimestamp=this.startTime,this.pauseTime=void 0,this.frameRequestId=requestAnimationFrame(this.tick)}pause(){this.playState="paused",this.pauseTime=this.t}finish(){this.playState="finished",this.tick(0)}stop(){var e;this.playState="idle",this.frameRequestId!==void 0&&cancelAnimationFrame(this.frameRequestId),(e=this.reject)===null||e===void 0||e.call(this,!1)}cancel(){this.stop(),this.tick(this.cancelTimestamp)}reverse(){this.rate*=-1}commitStyles(){}updateDuration(e){this.duration=e,this.totalDuration=e*(this.repeat+1)}get currentTime(){return this.t}set currentTime(e){this.pauseTime!==void 0||this.rate===0?this.pauseTime=e:this.startTime=performance.now()-e/this.rate}get playbackRate(){return this.rate}set playbackRate(e){this.rate=e}}var Fa=function(){};process.env.NODE_ENV!=="production"&&(Fa=function(t,e){if(!t)throw new Error(e)});class uv{setAnimation(e){this.animation=e,e?.finished.then(()=>this.clearAnimation()).catch(()=>{})}clearAnimation(){this.animation=this.generator=void 0}}const Ba=new WeakMap;function I0(t){return Ba.has(t)||Ba.set(t,{transforms:[],values:new Map}),Ba.get(t)}function hv(t,e){return t.has(e)||t.set(e,new uv),t.get(e)}const dv=["","X","Y","Z"],fv=["translate","scale","rotate","skew"],Cs={x:"translateX",y:"translateY",z:"translateZ"},D0={syntax:"<angle>",initialValue:"0deg",toDefaultUnit:t=>t+"deg"},pv={translate:{syntax:"<length-percentage>",initialValue:"0px",toDefaultUnit:t=>t+"px"},rotate:D0,scale:{syntax:"<number>",initialValue:1,toDefaultUnit:ir},skew:D0},xn=new Map,ja=t=>`--motion-${t}`,Ss=["x","y","z"];fv.forEach(t=>{dv.forEach(e=>{Ss.push(t+e),xn.set(ja(t+e),pv[t])})});const gv=(t,e)=>Ss.indexOf(t)-Ss.indexOf(e),mv=new Set(Ss),O0=t=>mv.has(t),wv=(t,e)=>{Cs[e]&&(e=Cs[e]);const{transforms:r}=I0(t);Qb(r,e),t.style.transform=yv(r)},yv=t=>t.sort(gv).reduce(bv,"").trim(),bv=(t,e)=>`${t} ${e}(var(${ja(e)}))`,ka=t=>t.startsWith("--"),A0=new Set;function vv(t){if(!A0.has(t)){A0.add(t);try{const{syntax:e,initialValue:r}=xn.has(t)?xn.get(t):{};CSS.registerProperty({name:t,inherits:!1,syntax:e,initialValue:r})}catch{}}}const Ha=(t,e)=>document.createElement("div").animate(t,e),$0={cssRegisterProperty:()=>typeof CSS<"u"&&Object.hasOwnProperty.call(CSS,"registerProperty"),waapi:()=>Object.hasOwnProperty.call(Element.prototype,"animate"),partialKeyframes:()=>{try{Ha({opacity:[1]})}catch{return!1}return!0},finished:()=>Boolean(Ha({opacity:[0,1]},{duration:.001}).finished),linearEasing:()=>{try{Ha({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0}},za={},Cn={};for(const t in $0)Cn[t]=()=>(za[t]===void 0&&(za[t]=$0[t]()),za[t]);const _v=.015,Ev=(t,e)=>{let r="";const n=Math.round(e/_v);for(let i=0;i<n;i++)r+=t(Ma(0,n-1,i))+", ";return r.substring(0,r.length-2)},P0=(t,e)=>Wr(t)?Cn.linearEasing()?`linear(${Ev(t,e)})`:Kt.easing:v0(t)?xv(t):t,xv=([t,e,r,n])=>`cubic-bezier(${t}, ${e}, ${r}, ${n})`;function Cv(t,e){for(let r=0;r<t.length;r++)t[r]===null&&(t[r]=r?t[r-1]:e());return t}const Sv=t=>Array.isArray(t)?t:[t];function Is(t){return Cs[t]&&(t=Cs[t]),O0(t)?ja(t):t}const Ds={get:(t,e)=>{e=Is(e);let r=ka(e)?t.style.getPropertyValue(e):getComputedStyle(t)[e];if(!r&&r!==0){const n=xn.get(e);n&&(r=n.initialValue)}return r},set:(t,e,r)=>{e=Is(e),ka(e)?t.style.setProperty(e,r):t.style[e]=r}};function T0(t,e=!0){if(!(!t||t.playState==="finished"))try{t.stop?t.stop():(e&&t.commitStyles(),t.cancel())}catch{}}function N0(t,e){var r;let n=e?.toDefaultUnit||ir;const i=t[t.length-1];if(_0(i)){const s=((r=i.match(/(-?[\d.]+)([a-z%]*)/))===null||r===void 0?void 0:r[2])||"";s&&(n=o=>o+s)}return n}function Iv(){return window.__MOTION_DEV_TOOLS_RECORD}function Dv(t,e,r,n={},i){const s=Iv(),o=n.record!==!1&&s;let a,{duration:c=Kt.duration,delay:l=Kt.delay,endDelay:p=Kt.endDelay,repeat:w=Kt.repeat,easing:y=Kt.easing,persist:m=!1,direction:E,offset:A,allowWebkitAcceleration:N=!1}=n;const M=I0(t),x=O0(e);let D=Cn.waapi();x&&wv(t,e);const b=Is(e),I=hv(M.values,b),O=xn.get(b);return T0(I.animation,!(Ua(y)&&I.generator)&&n.record!==!1),()=>{const h=()=>{var j,q;return(q=(j=Ds.get(t,b))!==null&&j!==void 0?j:O?.initialValue)!==null&&q!==void 0?q:0};let _=Cv(Sv(r),h);const H=N0(_,O);if(Ua(y)){const j=y.createAnimation(_,e!=="opacity",h,b,I);y=j.easing,_=j.keyframes||_,c=j.duration||c}if(ka(b)&&(Cn.cssRegisterProperty()?vv(b):D=!1),x&&!Cn.linearEasing()&&(Wr(y)||_n(y)&&y.some(Wr))&&(D=!1),D){O&&(_=_.map(X=>wi(X)?O.toDefaultUnit(X):X)),_.length===1&&(!Cn.partialKeyframes()||o)&&_.unshift(h());const j={delay:En.ms(l),duration:En.ms(c),endDelay:En.ms(p),easing:_n(y)?void 0:P0(y,c),direction:E,iterations:w+1,fill:"both"};a=t.animate({[b]:_,offset:A,easing:_n(y)?y.map(X=>P0(X,c)):void 0},j),a.finished||(a.finished=new Promise((X,re)=>{a.onfinish=X,a.oncancel=re}));const q=_[_.length-1];a.finished.then(()=>{m||(Ds.set(t,b,q),a.cancel())}).catch(y0),N||(a.playbackRate=1.000001)}else if(i&&x)_=_.map(j=>typeof j=="string"?parseFloat(j):j),_.length===1&&_.unshift(parseFloat(h())),a=new i(j=>{Ds.set(t,b,H?H(j):j)},_,Object.assign(Object.assign({},n),{duration:c,easing:y}));else{const j=_[_.length-1];Ds.set(t,b,O&&wi(j)?O.toDefaultUnit(j):j)}return o&&s(t,e,_,{duration:c,delay:l,easing:y,repeat:w,offset:A},"motion-one"),I.setAnimation(a),a}}const Ov=(t,e)=>t[e]?Object.assign(Object.assign({},t),t[e]):Object.assign({},t);function R0(t,e){var r;return typeof t=="string"?e?((r=e[t])!==null&&r!==void 0||(e[t]=document.querySelectorAll(t)),t=e[t]):t=document.querySelectorAll(t):t instanceof Element&&(t=[t]),Array.from(t||[])}const Av=t=>t(),L0=(t,e,r=Kt.duration)=>new Proxy({animations:t.map(Av).filter(Boolean),duration:r,options:e},Pv),$v=t=>t.animations[0],Pv={get:(t,e)=>{const r=$v(t);switch(e){case"duration":return t.duration;case"currentTime":return En.s(r?.[e]||0);case"playbackRate":case"playState":return r?.[e];case"finished":return t.finished||(t.finished=Promise.all(t.animations.map(Tv)).catch(y0)),t.finished;case"stop":return()=>{t.animations.forEach(n=>T0(n))};case"forEachNative":return n=>{t.animations.forEach(i=>n(i,t))};default:return typeof r?.[e]>"u"?void 0:()=>t.animations.forEach(n=>n[e]())}},set:(t,e,r)=>{switch(e){case"currentTime":r=En.ms(r);case"currentTime":case"playbackRate":for(let n=0;n<t.animations.length;n++)t.animations[n][e]=r;return!0}return!1}},Tv=t=>t.finished;function Nv(t,e,r){return Wr(t)?t(e,r):t}function Rv(t){return function(r,n,i={}){r=R0(r);const s=r.length;Fa(Boolean(s),"No valid element provided."),Fa(Boolean(n),"No keyframes defined.");const o=[];for(let a=0;a<s;a++){const c=r[a];for(const l in n){const p=Ov(i,l);p.delay=Nv(p.delay,a,s);const w=Dv(c,l,n[l],p,t);o.push(w)}}return L0(o,i,i.duration)}}const Lv=Rv(S0);function Mv(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r}const Uv=5;function M0(t,e,r){const n=Math.max(e-Uv,0);return iv(r-t(n),e-n)}const Sn={stiffness:100,damping:10,mass:1},Fv=(t=Sn.stiffness,e=Sn.damping,r=Sn.mass)=>e/(2*Math.sqrt(t*r));function Bv(t,e,r){return t<e&&r>=e||t>e&&r<=e}const jv=({stiffness:t=Sn.stiffness,damping:e=Sn.damping,mass:r=Sn.mass,from:n=0,to:i=1,velocity:s=0,restSpeed:o=2,restDistance:a=.5}={})=>{s=s?En.s(s):0;const c={done:!1,hasReachedTarget:!1,current:n,target:i},l=i-n,p=Math.sqrt(t/r)/1e3,w=Fv(t,e,r);let y;if(w<1){const m=p*Math.sqrt(1-w*w);y=E=>i-Math.exp(-w*p*E)*((-s+w*p*l)/m*Math.sin(m*E)+l*Math.cos(m*E))}else y=m=>i-Math.exp(-p*m)*(l+(-s+p*l)*m);return m=>{c.current=y(m);const E=m===0?s:M0(y,m,c.current),A=Math.abs(E)<=o,N=Math.abs(i-c.current)<=a;return c.done=A&&N,c.hasReachedTarget=Bv(n,i,c.current),c}},Wa=10,kv=1e4;function Hv(t,e=ir){let r,n=Wa,i=t(0);const s=[e(i.current)];for(;!i.done&&n<kv;)i=t(n),s.push(e(i.done?i.target:i.current)),r===void 0&&i.hasReachedTarget&&(r=n),n+=Wa;const o=n-Wa;return s.length===1&&s.push(i.current),{keyframes:s,duration:o/1e3,overshootDuration:(r??o)/1e3}}function U0(t){return wi(t)&&!isNaN(t)}function qa(t){return _0(t)?parseFloat(t):t}function zv(t){const e=new WeakMap;return(r={})=>{const n=new Map,i=(o=0,a=100,c=0,l=!1)=>{const p=`${o}-${a}-${c}-${l}`;return n.has(p)||n.set(p,t(Object.assign({from:o,to:a,velocity:c,restSpeed:l?.05:2,restDistance:l?.01:.5},r))),n.get(p)},s=(o,a)=>(e.has(o)||e.set(o,Hv(o,a)),e.get(o));return{createAnimation:(o,a=!0,c,l,p)=>{let w,y,m,E=0,A=ir;const N=o.length;if(a){A=N0(o,l?xn.get(Is(l)):void 0);const M=o[N-1];if(m=qa(M),N>1&&o[0]!==null)y=qa(o[0]);else{const x=p?.generator;if(x){const{animation:D,generatorStartTime:b}=p,I=D?.startTime||b||0,O=D?.currentTime||performance.now()-I,h=x(O).current;y=h,E=M0(_=>x(_).current,O,h)}else c&&(y=qa(c()))}}if(U0(y)&&U0(m)){const M=i(y,m,E,l?.includes("scale"));w=Object.assign(Object.assign({},s(M,A)),{easing:"linear"}),p&&(p.generator=M,p.generatorStartTime=performance.now())}return w||(w={easing:"ease",duration:s(i(0,100)).overshootDuration}),w}}}}const Os=zv(jv),Wv={any:0,all:1};function qv(t,e,{root:r,margin:n,amount:i="any"}={}){if(typeof IntersectionObserver>"u")return()=>{};const s=R0(t),o=new WeakMap,a=l=>{l.forEach(p=>{const w=o.get(p.target);if(p.isIntersecting!==Boolean(w))if(p.isIntersecting){const y=e(p);Wr(y)?o.set(p.target,y):c.unobserve(p.target)}else w&&(w(p),o.delete(p.target))})},c=new IntersectionObserver(a,{root:r,rootMargin:n,threshold:typeof i=="number"?i:Wv[i]});return s.forEach(l=>c.observe(l)),()=>c.disconnect()}function Va(t,e,r){t.dispatchEvent(new CustomEvent(e,{detail:{originalEvent:r}}))}function F0(t,e,r){t.dispatchEvent(new CustomEvent(e,{detail:{originalEntry:r}}))}const Vv={isActive:t=>Boolean(t.inView),subscribe:(t,{enable:e,disable:r},{inViewOptions:n={}})=>{const{once:i}=n,s=Mv(n,["once"]);return qv(t,o=>{if(e(),F0(t,"viewenter",o),!i)return a=>{r(),F0(t,"viewleave",a)}},s)}},B0=(t,e,r)=>n=>{n.pointerType&&n.pointerType!=="mouse"||(r(),Va(t,e,n))};[...Object.keys({inView:Vv,hover:{isActive:t=>Boolean(t.hover),subscribe:(t,{enable:e,disable:r})=>{const n=B0(t,"hoverstart",e),i=B0(t,"hoverend",r);return t.addEventListener("pointerenter",n),t.addEventListener("pointerleave",i),()=>{t.removeEventListener("pointerenter",n),t.removeEventListener("pointerleave",i)}}},press:{isActive:t=>Boolean(t.press),subscribe:(t,{enable:e,disable:r})=>{const n=s=>{r(),Va(t,"pressend",s),window.removeEventListener("pointerup",n)},i=s=>{e(),Va(t,"pressstart",s),window.addEventListener("pointerup",n)};return t.addEventListener("pointerdown",i),()=>{t.removeEventListener("pointerdown",i),window.removeEventListener("pointerup",n)}}}})];function Kv(t,e={}){return L0([()=>{const r=new S0(t,[0,1],e);return r.finished.catch(()=>{}),r}],e,e.duration)}function Er(t,e,r){return(Wr(t)?Kv:Lv)(t,e,r)}/**
155
116
  * @license
156
117
  * Copyright 2018 Google LLC
157
118
  * SPDX-License-Identifier: BSD-3-Clause
158
- */const ir=t=>t??St;var to={},zx=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then},np={},or={};let nl;const Wx=[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];or.getSymbolSize=function(e){if(!e)throw new Error('"version" cannot be null or undefined');if(e<1||e>40)throw new Error('"version" should be in range from 1 to 40');return e*4+17},or.getSymbolTotalCodewords=function(e){return Wx[e]},or.getBCHDigit=function(t){let e=0;for(;t!==0;)e++,t>>>=1;return e},or.setToSJISFunction=function(e){if(typeof e!="function")throw new Error('"toSJISFunc" is not a valid function.');nl=e},or.isKanjiModeEnabled=function(){return typeof nl<"u"},or.toSJIS=function(e){return nl(e)};var Fs={};(function(t){t.L={bit:1},t.M={bit:0},t.Q={bit:3},t.H={bit:2};function e(r){if(typeof r!="string")throw new Error("Param is not a string");switch(r.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 new Error("Unknown EC Level: "+r)}}t.isValid=function(n){return n&&typeof n.bit<"u"&&n.bit>=0&&n.bit<4},t.from=function(n,i){if(t.isValid(n))return n;try{return e(n)}catch{return i}}})(Fs);function ip(){this.buffer=[],this.length=0}ip.prototype={get:function(t){const e=Math.floor(t/8);return(this.buffer[e]>>>7-t%8&1)===1},put:function(t,e){for(let r=0;r<e;r++)this.putBit((t>>>e-r-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(t){const e=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),t&&(this.buffer[e]|=128>>>this.length%8),this.length++}};var Vx=ip;function ro(t){if(!t||t<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=t,this.data=new Uint8Array(t*t),this.reservedBit=new Uint8Array(t*t)}ro.prototype.set=function(t,e,r,n){const i=t*this.size+e;this.data[i]=r,n&&(this.reservedBit[i]=!0)},ro.prototype.get=function(t,e){return this.data[t*this.size+e]},ro.prototype.xor=function(t,e,r){this.data[t*this.size+e]^=r},ro.prototype.isReserved=function(t,e){return this.reservedBit[t*this.size+e]};var qx=ro,op={};(function(t){const e=or.getSymbolSize;t.getRowColCoords=function(n){if(n===1)return[];const i=Math.floor(n/7)+2,o=e(n),s=o===145?26:Math.ceil((o-13)/(2*i-2))*2,a=[o-7];for(let l=1;l<i-1;l++)a[l]=a[l-1]-s;return a.push(6),a.reverse()},t.getPositions=function(n){const i=[],o=t.getRowColCoords(n),s=o.length;for(let a=0;a<s;a++)for(let l=0;l<s;l++)a===0&&l===0||a===0&&l===s-1||a===s-1&&l===0||i.push([o[a],o[l]]);return i}})(op);var sp={};const Kx=or.getSymbolSize,ap=7;sp.getPositions=function(e){const r=Kx(e);return[[0,0],[r-ap,0],[0,r-ap]]};var cp={};(function(t){t.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};const e={N1:3,N2:3,N3:40,N4:10};t.isValid=function(i){return i!=null&&i!==""&&!isNaN(i)&&i>=0&&i<=7},t.from=function(i){return t.isValid(i)?parseInt(i,10):void 0},t.getPenaltyN1=function(i){const o=i.size;let s=0,a=0,l=0,u=null,d=null;for(let y=0;y<o;y++){a=l=0,u=d=null;for(let m=0;m<o;m++){let v=i.get(y,m);v===u?a++:(a>=5&&(s+=e.N1+(a-5)),u=v,a=1),v=i.get(m,y),v===d?l++:(l>=5&&(s+=e.N1+(l-5)),d=v,l=1)}a>=5&&(s+=e.N1+(a-5)),l>=5&&(s+=e.N1+(l-5))}return s},t.getPenaltyN2=function(i){const o=i.size;let s=0;for(let a=0;a<o-1;a++)for(let l=0;l<o-1;l++){const u=i.get(a,l)+i.get(a,l+1)+i.get(a+1,l)+i.get(a+1,l+1);(u===4||u===0)&&s++}return s*e.N2},t.getPenaltyN3=function(i){const o=i.size;let s=0,a=0,l=0;for(let u=0;u<o;u++){a=l=0;for(let d=0;d<o;d++)a=a<<1&2047|i.get(u,d),d>=10&&(a===1488||a===93)&&s++,l=l<<1&2047|i.get(d,u),d>=10&&(l===1488||l===93)&&s++}return s*e.N3},t.getPenaltyN4=function(i){let o=0;const s=i.data.length;for(let l=0;l<s;l++)o+=i.data[l];return Math.abs(Math.ceil(o*100/s/5)-10)*e.N4};function r(n,i,o){switch(n){case t.Patterns.PATTERN000:return(i+o)%2===0;case t.Patterns.PATTERN001:return i%2===0;case t.Patterns.PATTERN010:return o%3===0;case t.Patterns.PATTERN011:return(i+o)%3===0;case t.Patterns.PATTERN100:return(Math.floor(i/2)+Math.floor(o/3))%2===0;case t.Patterns.PATTERN101:return i*o%2+i*o%3===0;case t.Patterns.PATTERN110:return(i*o%2+i*o%3)%2===0;case t.Patterns.PATTERN111:return(i*o%3+(i+o)%2)%2===0;default:throw new Error("bad maskPattern:"+n)}}t.applyMask=function(i,o){const s=o.size;for(let a=0;a<s;a++)for(let l=0;l<s;l++)o.isReserved(l,a)||o.xor(l,a,r(i,l,a))},t.getBestMask=function(i,o){const s=Object.keys(t.Patterns).length;let a=0,l=1/0;for(let u=0;u<s;u++){o(u),t.applyMask(u,i);const d=t.getPenaltyN1(i)+t.getPenaltyN2(i)+t.getPenaltyN3(i)+t.getPenaltyN4(i);t.applyMask(u,i),d<l&&(l=d,a=u)}return a}})(cp);var Ps={};const Vr=Fs,Ts=[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],Ns=[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];Ps.getBlocksCount=function(e,r){switch(r){case Vr.L:return Ts[(e-1)*4+0];case Vr.M:return Ts[(e-1)*4+1];case Vr.Q:return Ts[(e-1)*4+2];case Vr.H:return Ts[(e-1)*4+3];default:return}},Ps.getTotalCodewordsCount=function(e,r){switch(r){case Vr.L:return Ns[(e-1)*4+0];case Vr.M:return Ns[(e-1)*4+1];case Vr.Q:return Ns[(e-1)*4+2];case Vr.H:return Ns[(e-1)*4+3];default:return}};var lp={},Rs={};const no=new Uint8Array(512),Ls=new Uint8Array(256);(function(){let e=1;for(let r=0;r<255;r++)no[r]=e,Ls[e]=r,e<<=1,e&256&&(e^=285);for(let r=255;r<512;r++)no[r]=no[r-255]})(),Rs.log=function(e){if(e<1)throw new Error("log("+e+")");return Ls[e]},Rs.exp=function(e){return no[e]},Rs.mul=function(e,r){return e===0||r===0?0:no[Ls[e]+Ls[r]]},function(t){const e=Rs;t.mul=function(n,i){const o=new Uint8Array(n.length+i.length-1);for(let s=0;s<n.length;s++)for(let a=0;a<i.length;a++)o[s+a]^=e.mul(n[s],i[a]);return o},t.mod=function(n,i){let o=new Uint8Array(n);for(;o.length-i.length>=0;){const s=o[0];for(let l=0;l<i.length;l++)o[l]^=e.mul(i[l],s);let a=0;for(;a<o.length&&o[a]===0;)a++;o=o.slice(a)}return o},t.generateECPolynomial=function(n){let i=new Uint8Array([1]);for(let o=0;o<n;o++)i=t.mul(i,new Uint8Array([1,e.exp(o)]));return i}}(lp);const up=lp;function il(t){this.genPoly=void 0,this.degree=t,this.degree&&this.initialize(this.degree)}il.prototype.initialize=function(e){this.degree=e,this.genPoly=up.generateECPolynomial(this.degree)},il.prototype.encode=function(e){if(!this.genPoly)throw new Error("Encoder not initialized");const r=new Uint8Array(e.length+this.degree);r.set(e);const n=up.mod(r,this.genPoly),i=this.degree-n.length;if(i>0){const o=new Uint8Array(this.degree);return o.set(n,i),o}return n};var Gx=il,hp={},qr={},ol={};ol.isValid=function(e){return!isNaN(e)&&e>=1&&e<=40};var xr={};const fp="[0-9]+",Yx="[A-Z $%*+\\-./:]+";let io="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";io=io.replace(/u/g,"\\u");const Zx="(?:(?![A-Z0-9 $%*+\\-./:]|"+io+`)(?:.|[\r
159
- ]))+`;xr.KANJI=new RegExp(io,"g"),xr.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),xr.BYTE=new RegExp(Zx,"g"),xr.NUMERIC=new RegExp(fp,"g"),xr.ALPHANUMERIC=new RegExp(Yx,"g");const Jx=new RegExp("^"+io+"$"),Xx=new RegExp("^"+fp+"$"),Qx=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");xr.testKanji=function(e){return Jx.test(e)},xr.testNumeric=function(e){return Xx.test(e)},xr.testAlphanumeric=function(e){return Qx.test(e)},function(t){const e=ol,r=xr;t.NUMERIC={id:"Numeric",bit:1<<0,ccBits:[10,12,14]},t.ALPHANUMERIC={id:"Alphanumeric",bit:1<<1,ccBits:[9,11,13]},t.BYTE={id:"Byte",bit:1<<2,ccBits:[8,16,16]},t.KANJI={id:"Kanji",bit:1<<3,ccBits:[8,10,12]},t.MIXED={bit:-1},t.getCharCountIndicator=function(o,s){if(!o.ccBits)throw new Error("Invalid mode: "+o);if(!e.isValid(s))throw new Error("Invalid version: "+s);return s>=1&&s<10?o.ccBits[0]:s<27?o.ccBits[1]:o.ccBits[2]},t.getBestModeForData=function(o){return r.testNumeric(o)?t.NUMERIC:r.testAlphanumeric(o)?t.ALPHANUMERIC:r.testKanji(o)?t.KANJI:t.BYTE},t.toString=function(o){if(o&&o.id)return o.id;throw new Error("Invalid mode")},t.isValid=function(o){return o&&o.bit&&o.ccBits};function n(i){if(typeof i!="string")throw new Error("Param is not a string");switch(i.toLowerCase()){case"numeric":return t.NUMERIC;case"alphanumeric":return t.ALPHANUMERIC;case"kanji":return t.KANJI;case"byte":return t.BYTE;default:throw new Error("Unknown mode: "+i)}}t.from=function(o,s){if(t.isValid(o))return o;try{return n(o)}catch{return s}}}(qr),function(t){const e=or,r=Ps,n=Fs,i=qr,o=ol,s=1<<12|1<<11|1<<10|1<<9|1<<8|1<<5|1<<2|1<<0,a=e.getBCHDigit(s);function l(m,v,_){for(let R=1;R<=40;R++)if(v<=t.getCapacity(R,_,m))return R}function u(m,v){return i.getCharCountIndicator(m,v)+4}function d(m,v){let _=0;return m.forEach(function(R){const M=u(R.mode,v);_+=M+R.getBitsLength()}),_}function y(m,v){for(let _=1;_<=40;_++)if(d(m,_)<=t.getCapacity(_,v,i.MIXED))return _}t.from=function(v,_){return o.isValid(v)?parseInt(v,10):_},t.getCapacity=function(v,_,R){if(!o.isValid(v))throw new Error("Invalid QR Code version");typeof R>"u"&&(R=i.BYTE);const M=e.getSymbolTotalCodewords(v),B=r.getTotalCodewordsCount(v,_),D=(M-B)*8;if(R===i.MIXED)return D;const N=D-u(R,v);switch(R){case i.NUMERIC:return Math.floor(N/10*3);case i.ALPHANUMERIC:return Math.floor(N/11*2);case i.KANJI:return Math.floor(N/13);case i.BYTE:default:return Math.floor(N/8)}},t.getBestVersionForData=function(v,_){let R;const M=n.from(_,n.M);if(Array.isArray(v)){if(v.length>1)return y(v,M);if(v.length===0)return 1;R=v[0]}else R=v;return l(R.mode,R.getLength(),M)},t.getEncodedBits=function(v){if(!o.isValid(v)||v<7)throw new Error("Invalid QR Code version");let _=v<<12;for(;e.getBCHDigit(_)-a>=0;)_^=s<<e.getBCHDigit(_)-a;return v<<12|_}}(hp);var dp={};const sl=or,pp=1<<10|1<<8|1<<5|1<<4|1<<2|1<<1|1<<0,eC=1<<14|1<<12|1<<10|1<<4|1<<1,gp=sl.getBCHDigit(pp);dp.getEncodedBits=function(e,r){const n=e.bit<<3|r;let i=n<<10;for(;sl.getBCHDigit(i)-gp>=0;)i^=pp<<sl.getBCHDigit(i)-gp;return(n<<10|i)^eC};var mp={};const tC=qr;function Zn(t){this.mode=tC.NUMERIC,this.data=t.toString()}Zn.getBitsLength=function(e){return 10*Math.floor(e/3)+(e%3?e%3*3+1:0)},Zn.prototype.getLength=function(){return this.data.length},Zn.prototype.getBitsLength=function(){return Zn.getBitsLength(this.data.length)},Zn.prototype.write=function(e){let r,n,i;for(r=0;r+3<=this.data.length;r+=3)n=this.data.substr(r,3),i=parseInt(n,10),e.put(i,10);const o=this.data.length-r;o>0&&(n=this.data.substr(r),i=parseInt(n,10),e.put(i,o*3+1))};var rC=Zn;const nC=qr,al=["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 Jn(t){this.mode=nC.ALPHANUMERIC,this.data=t}Jn.getBitsLength=function(e){return 11*Math.floor(e/2)+6*(e%2)},Jn.prototype.getLength=function(){return this.data.length},Jn.prototype.getBitsLength=function(){return Jn.getBitsLength(this.data.length)},Jn.prototype.write=function(e){let r;for(r=0;r+2<=this.data.length;r+=2){let n=al.indexOf(this.data[r])*45;n+=al.indexOf(this.data[r+1]),e.put(n,11)}this.data.length%2&&e.put(al.indexOf(this.data[r]),6)};var iC=Jn,oC=function(e){for(var r=[],n=e.length,i=0;i<n;i++){var o=e.charCodeAt(i);if(o>=55296&&o<=56319&&n>i+1){var s=e.charCodeAt(i+1);s>=56320&&s<=57343&&(o=(o-55296)*1024+s-56320+65536,i+=1)}if(o<128){r.push(o);continue}if(o<2048){r.push(o>>6|192),r.push(o&63|128);continue}if(o<55296||o>=57344&&o<65536){r.push(o>>12|224),r.push(o>>6&63|128),r.push(o&63|128);continue}if(o>=65536&&o<=1114111){r.push(o>>18|240),r.push(o>>12&63|128),r.push(o>>6&63|128),r.push(o&63|128);continue}r.push(239,191,189)}return new Uint8Array(r).buffer};const sC=oC,aC=qr;function Xn(t){this.mode=aC.BYTE,typeof t=="string"&&(t=sC(t)),this.data=new Uint8Array(t)}Xn.getBitsLength=function(e){return e*8},Xn.prototype.getLength=function(){return this.data.length},Xn.prototype.getBitsLength=function(){return Xn.getBitsLength(this.data.length)},Xn.prototype.write=function(t){for(let e=0,r=this.data.length;e<r;e++)t.put(this.data[e],8)};var cC=Xn;const lC=qr,uC=or;function Qn(t){this.mode=lC.KANJI,this.data=t}Qn.getBitsLength=function(e){return e*13},Qn.prototype.getLength=function(){return this.data.length},Qn.prototype.getBitsLength=function(){return Qn.getBitsLength(this.data.length)},Qn.prototype.write=function(t){let e;for(e=0;e<this.data.length;e++){let r=uC.toSJIS(this.data[e]);if(r>=33088&&r<=40956)r-=33088;else if(r>=57408&&r<=60351)r-=49472;else throw new Error("Invalid SJIS character: "+this.data[e]+`
160
- Make sure your charset is UTF-8`);r=(r>>>8&255)*192+(r&255),t.put(r,13)}};var hC=Qn,bp={exports:{}};(function(t){var e={single_source_shortest_paths:function(r,n,i){var o={},s={};s[n]=0;var a=e.PriorityQueue.make();a.push(n,0);for(var l,u,d,y,m,v,_,R,M;!a.empty();){l=a.pop(),u=l.value,y=l.cost,m=r[u]||{};for(d in m)m.hasOwnProperty(d)&&(v=m[d],_=y+v,R=s[d],M=typeof s[d]>"u",(M||R>_)&&(s[d]=_,a.push(d,_),o[d]=u))}if(typeof i<"u"&&typeof s[i]>"u"){var B=["Could not find a path from ",n," to ",i,"."].join("");throw new Error(B)}return o},extract_shortest_path_from_predecessor_list:function(r,n){for(var i=[],o=n;o;)i.push(o),r[o],o=r[o];return i.reverse(),i},find_path:function(r,n,i){var o=e.single_source_shortest_paths(r,n,i);return e.extract_shortest_path_from_predecessor_list(o,i)},PriorityQueue:{make:function(r){var n=e.PriorityQueue,i={},o;r=r||{};for(o in n)n.hasOwnProperty(o)&&(i[o]=n[o]);return i.queue=[],i.sorter=r.sorter||n.default_sorter,i},default_sorter:function(r,n){return r.cost-n.cost},push:function(r,n){var i={value:r,cost:n};this.queue.push(i),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};t.exports=e})(bp),function(t){const e=qr,r=rC,n=iC,i=cC,o=hC,s=xr,a=or,l=bp.exports;function u(B){return unescape(encodeURIComponent(B)).length}function d(B,D,N){const C=[];let $;for(;($=B.exec(N))!==null;)C.push({data:$[0],index:$.index,mode:D,length:$[0].length});return C}function y(B){const D=d(s.NUMERIC,e.NUMERIC,B),N=d(s.ALPHANUMERIC,e.ALPHANUMERIC,B);let C,$;return a.isKanjiModeEnabled()?(C=d(s.BYTE,e.BYTE,B),$=d(s.KANJI,e.KANJI,B)):(C=d(s.BYTE_KANJI,e.BYTE,B),$=[]),D.concat(N,C,$).sort(function(h,S){return h.index-S.index}).map(function(h){return{data:h.data,mode:h.mode,length:h.length}})}function m(B,D){switch(D){case e.NUMERIC:return r.getBitsLength(B);case e.ALPHANUMERIC:return n.getBitsLength(B);case e.KANJI:return o.getBitsLength(B);case e.BYTE:return i.getBitsLength(B)}}function v(B){return B.reduce(function(D,N){const C=D.length-1>=0?D[D.length-1]:null;return C&&C.mode===N.mode?(D[D.length-1].data+=N.data,D):(D.push(N),D)},[])}function _(B){const D=[];for(let N=0;N<B.length;N++){const C=B[N];switch(C.mode){case e.NUMERIC:D.push([C,{data:C.data,mode:e.ALPHANUMERIC,length:C.length},{data:C.data,mode:e.BYTE,length:C.length}]);break;case e.ALPHANUMERIC:D.push([C,{data:C.data,mode:e.BYTE,length:C.length}]);break;case e.KANJI:D.push([C,{data:C.data,mode:e.BYTE,length:u(C.data)}]);break;case e.BYTE:D.push([{data:C.data,mode:e.BYTE,length:u(C.data)}])}}return D}function R(B,D){const N={},C={start:{}};let $=["start"];for(let P=0;P<B.length;P++){const h=B[P],S=[];for(let q=0;q<h.length;q++){const z=h[q],Y=""+P+q;S.push(Y),N[Y]={node:z,lastCount:0},C[Y]={};for(let re=0;re<$.length;re++){const ie=$[re];N[ie]&&N[ie].node.mode===z.mode?(C[ie][Y]=m(N[ie].lastCount+z.length,z.mode)-m(N[ie].lastCount,z.mode),N[ie].lastCount+=z.length):(N[ie]&&(N[ie].lastCount=z.length),C[ie][Y]=m(z.length,z.mode)+4+e.getCharCountIndicator(z.mode,D))}}$=S}for(let P=0;P<$.length;P++)C[$[P]].end=0;return{map:C,table:N}}function M(B,D){let N;const C=e.getBestModeForData(B);if(N=e.from(D,C),N!==e.BYTE&&N.bit<C.bit)throw new Error('"'+B+'" cannot be encoded with mode '+e.toString(N)+`.
161
- Suggested mode is: `+e.toString(C));switch(N===e.KANJI&&!a.isKanjiModeEnabled()&&(N=e.BYTE),N){case e.NUMERIC:return new r(B);case e.ALPHANUMERIC:return new n(B);case e.KANJI:return new o(B);case e.BYTE:return new i(B)}}t.fromArray=function(D){return D.reduce(function(N,C){return typeof C=="string"?N.push(M(C,null)):C.data&&N.push(M(C.data,C.mode)),N},[])},t.fromString=function(D,N){const C=y(D,a.isKanjiModeEnabled()),$=_(C),P=R($,N),h=l.find_path(P.map,"start","end"),S=[];for(let q=1;q<h.length-1;q++)S.push(P.table[h[q]].node);return t.fromArray(v(S))},t.rawSplit=function(D){return t.fromArray(y(D,a.isKanjiModeEnabled()))}}(mp);const Ms=or,cl=Fs,fC=Vx,dC=qx,pC=op,gC=sp,ll=cp,ul=Ps,mC=Gx,Us=hp,bC=dp,yC=qr,hl=mp;function wC(t,e){const r=t.size,n=gC.getPositions(e);for(let i=0;i<n.length;i++){const o=n[i][0],s=n[i][1];for(let a=-1;a<=7;a++)if(!(o+a<=-1||r<=o+a))for(let l=-1;l<=7;l++)s+l<=-1||r<=s+l||(a>=0&&a<=6&&(l===0||l===6)||l>=0&&l<=6&&(a===0||a===6)||a>=2&&a<=4&&l>=2&&l<=4?t.set(o+a,s+l,!0,!0):t.set(o+a,s+l,!1,!0))}}function vC(t){const e=t.size;for(let r=8;r<e-8;r++){const n=r%2===0;t.set(r,6,n,!0),t.set(6,r,n,!0)}}function _C(t,e){const r=pC.getPositions(e);for(let n=0;n<r.length;n++){const i=r[n][0],o=r[n][1];for(let s=-2;s<=2;s++)for(let a=-2;a<=2;a++)s===-2||s===2||a===-2||a===2||s===0&&a===0?t.set(i+s,o+a,!0,!0):t.set(i+s,o+a,!1,!0)}}function EC(t,e){const r=t.size,n=Us.getEncodedBits(e);let i,o,s;for(let a=0;a<18;a++)i=Math.floor(a/3),o=a%3+r-8-3,s=(n>>a&1)===1,t.set(i,o,s,!0),t.set(o,i,s,!0)}function fl(t,e,r){const n=t.size,i=bC.getEncodedBits(e,r);let o,s;for(o=0;o<15;o++)s=(i>>o&1)===1,o<6?t.set(o,8,s,!0):o<8?t.set(o+1,8,s,!0):t.set(n-15+o,8,s,!0),o<8?t.set(8,n-o-1,s,!0):o<9?t.set(8,15-o-1+1,s,!0):t.set(8,15-o-1,s,!0);t.set(n-8,8,1,!0)}function xC(t,e){const r=t.size;let n=-1,i=r-1,o=7,s=0;for(let a=r-1;a>0;a-=2)for(a===6&&a--;;){for(let l=0;l<2;l++)if(!t.isReserved(i,a-l)){let u=!1;s<e.length&&(u=(e[s]>>>o&1)===1),t.set(i,a-l,u),o--,o===-1&&(s++,o=7)}if(i+=n,i<0||r<=i){i-=n,n=-n;break}}}function CC(t,e,r){const n=new fC;r.forEach(function(l){n.put(l.mode.bit,4),n.put(l.getLength(),yC.getCharCountIndicator(l.mode,t)),l.write(n)});const i=Ms.getSymbolTotalCodewords(t),o=ul.getTotalCodewordsCount(t,e),s=(i-o)*8;for(n.getLengthInBits()+4<=s&&n.put(0,4);n.getLengthInBits()%8!==0;)n.putBit(0);const a=(s-n.getLengthInBits())/8;for(let l=0;l<a;l++)n.put(l%2?17:236,8);return SC(n,t,e)}function SC(t,e,r){const n=Ms.getSymbolTotalCodewords(e),i=ul.getTotalCodewordsCount(e,r),o=n-i,s=ul.getBlocksCount(e,r),a=n%s,l=s-a,u=Math.floor(n/s),d=Math.floor(o/s),y=d+1,m=u-d,v=new mC(m);let _=0;const R=new Array(s),M=new Array(s);let B=0;const D=new Uint8Array(t.buffer);for(let h=0;h<s;h++){const S=h<l?d:y;R[h]=D.slice(_,_+S),M[h]=v.encode(R[h]),_+=S,B=Math.max(B,S)}const N=new Uint8Array(n);let C=0,$,P;for($=0;$<B;$++)for(P=0;P<s;P++)$<R[P].length&&(N[C++]=R[P][$]);for($=0;$<m;$++)for(P=0;P<s;P++)N[C++]=M[P][$];return N}function AC(t,e,r,n){let i;if(Array.isArray(t))i=hl.fromArray(t);else if(typeof t=="string"){let u=e;if(!u){const d=hl.rawSplit(t);u=Us.getBestVersionForData(d,r)}i=hl.fromString(t,u||40)}else throw new Error("Invalid data");const o=Us.getBestVersionForData(i,r);if(!o)throw new Error("The amount of data is too big to be stored in a QR Code");if(!e)e=o;else if(e<o)throw new Error(`
119
+ */const Bt=t=>t??ct;var bi={},Gv=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then},j0={},jt={};let Ka;const Yv=[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];jt.getSymbolSize=function(e){if(!e)throw new Error('"version" cannot be null or undefined');if(e<1||e>40)throw new Error('"version" should be in range from 1 to 40');return e*4+17},jt.getSymbolTotalCodewords=function(e){return Yv[e]},jt.getBCHDigit=function(t){let e=0;for(;t!==0;)e++,t>>>=1;return e},jt.setToSJISFunction=function(e){if(typeof e!="function")throw new Error('"toSJISFunc" is not a valid function.');Ka=e},jt.isKanjiModeEnabled=function(){return typeof Ka<"u"},jt.toSJIS=function(e){return Ka(e)};var As={};(function(t){t.L={bit:1},t.M={bit:0},t.Q={bit:3},t.H={bit:2};function e(r){if(typeof r!="string")throw new Error("Param is not a string");switch(r.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 new Error("Unknown EC Level: "+r)}}t.isValid=function(n){return n&&typeof n.bit<"u"&&n.bit>=0&&n.bit<4},t.from=function(n,i){if(t.isValid(n))return n;try{return e(n)}catch{return i}}})(As);function k0(){this.buffer=[],this.length=0}k0.prototype={get:function(t){const e=Math.floor(t/8);return(this.buffer[e]>>>7-t%8&1)===1},put:function(t,e){for(let r=0;r<e;r++)this.putBit((t>>>e-r-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(t){const e=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),t&&(this.buffer[e]|=128>>>this.length%8),this.length++}};var Zv=k0;function vi(t){if(!t||t<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=t,this.data=new Uint8Array(t*t),this.reservedBit=new Uint8Array(t*t)}vi.prototype.set=function(t,e,r,n){const i=t*this.size+e;this.data[i]=r,n&&(this.reservedBit[i]=!0)},vi.prototype.get=function(t,e){return this.data[t*this.size+e]},vi.prototype.xor=function(t,e,r){this.data[t*this.size+e]^=r},vi.prototype.isReserved=function(t,e){return this.reservedBit[t*this.size+e]};var Jv=vi,H0={};(function(t){const e=jt.getSymbolSize;t.getRowColCoords=function(n){if(n===1)return[];const i=Math.floor(n/7)+2,s=e(n),o=s===145?26:Math.ceil((s-13)/(2*i-2))*2,a=[s-7];for(let c=1;c<i-1;c++)a[c]=a[c-1]-o;return a.push(6),a.reverse()},t.getPositions=function(n){const i=[],s=t.getRowColCoords(n),o=s.length;for(let a=0;a<o;a++)for(let c=0;c<o;c++)a===0&&c===0||a===0&&c===o-1||a===o-1&&c===0||i.push([s[a],s[c]]);return i}})(H0);var z0={};const Xv=jt.getSymbolSize,W0=7;z0.getPositions=function(e){const r=Xv(e);return[[0,0],[r-W0,0],[0,r-W0]]};var q0={};(function(t){t.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};const e={N1:3,N2:3,N3:40,N4:10};t.isValid=function(i){return i!=null&&i!==""&&!isNaN(i)&&i>=0&&i<=7},t.from=function(i){return t.isValid(i)?parseInt(i,10):void 0},t.getPenaltyN1=function(i){const s=i.size;let o=0,a=0,c=0,l=null,p=null;for(let w=0;w<s;w++){a=c=0,l=p=null;for(let y=0;y<s;y++){let m=i.get(w,y);m===l?a++:(a>=5&&(o+=e.N1+(a-5)),l=m,a=1),m=i.get(y,w),m===p?c++:(c>=5&&(o+=e.N1+(c-5)),p=m,c=1)}a>=5&&(o+=e.N1+(a-5)),c>=5&&(o+=e.N1+(c-5))}return o},t.getPenaltyN2=function(i){const s=i.size;let o=0;for(let a=0;a<s-1;a++)for(let c=0;c<s-1;c++){const l=i.get(a,c)+i.get(a,c+1)+i.get(a+1,c)+i.get(a+1,c+1);(l===4||l===0)&&o++}return o*e.N2},t.getPenaltyN3=function(i){const s=i.size;let o=0,a=0,c=0;for(let l=0;l<s;l++){a=c=0;for(let p=0;p<s;p++)a=a<<1&2047|i.get(l,p),p>=10&&(a===1488||a===93)&&o++,c=c<<1&2047|i.get(p,l),p>=10&&(c===1488||c===93)&&o++}return o*e.N3},t.getPenaltyN4=function(i){let s=0;const o=i.data.length;for(let c=0;c<o;c++)s+=i.data[c];return Math.abs(Math.ceil(s*100/o/5)-10)*e.N4};function r(n,i,s){switch(n){case t.Patterns.PATTERN000:return(i+s)%2===0;case t.Patterns.PATTERN001:return i%2===0;case t.Patterns.PATTERN010:return s%3===0;case t.Patterns.PATTERN011:return(i+s)%3===0;case t.Patterns.PATTERN100:return(Math.floor(i/2)+Math.floor(s/3))%2===0;case t.Patterns.PATTERN101:return i*s%2+i*s%3===0;case t.Patterns.PATTERN110:return(i*s%2+i*s%3)%2===0;case t.Patterns.PATTERN111:return(i*s%3+(i+s)%2)%2===0;default:throw new Error("bad maskPattern:"+n)}}t.applyMask=function(i,s){const o=s.size;for(let a=0;a<o;a++)for(let c=0;c<o;c++)s.isReserved(c,a)||s.xor(c,a,r(i,c,a))},t.getBestMask=function(i,s){const o=Object.keys(t.Patterns).length;let a=0,c=1/0;for(let l=0;l<o;l++){s(l),t.applyMask(l,i);const p=t.getPenaltyN1(i)+t.getPenaltyN2(i)+t.getPenaltyN3(i)+t.getPenaltyN4(i);t.applyMask(l,i),p<c&&(c=p,a=l)}return a}})(q0);var $s={};const xr=As,Ps=[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],Ts=[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];$s.getBlocksCount=function(e,r){switch(r){case xr.L:return Ps[(e-1)*4+0];case xr.M:return Ps[(e-1)*4+1];case xr.Q:return Ps[(e-1)*4+2];case xr.H:return Ps[(e-1)*4+3];default:return}},$s.getTotalCodewordsCount=function(e,r){switch(r){case xr.L:return Ts[(e-1)*4+0];case xr.M:return Ts[(e-1)*4+1];case xr.Q:return Ts[(e-1)*4+2];case xr.H:return Ts[(e-1)*4+3];default:return}};var V0={},Ns={};const _i=new Uint8Array(512),Rs=new Uint8Array(256);(function(){let e=1;for(let r=0;r<255;r++)_i[r]=e,Rs[e]=r,e<<=1,e&256&&(e^=285);for(let r=255;r<512;r++)_i[r]=_i[r-255]})(),Ns.log=function(e){if(e<1)throw new Error("log("+e+")");return Rs[e]},Ns.exp=function(e){return _i[e]},Ns.mul=function(e,r){return e===0||r===0?0:_i[Rs[e]+Rs[r]]},function(t){const e=Ns;t.mul=function(n,i){const s=new Uint8Array(n.length+i.length-1);for(let o=0;o<n.length;o++)for(let a=0;a<i.length;a++)s[o+a]^=e.mul(n[o],i[a]);return s},t.mod=function(n,i){let s=new Uint8Array(n);for(;s.length-i.length>=0;){const o=s[0];for(let c=0;c<i.length;c++)s[c]^=e.mul(i[c],o);let a=0;for(;a<s.length&&s[a]===0;)a++;s=s.slice(a)}return s},t.generateECPolynomial=function(n){let i=new Uint8Array([1]);for(let s=0;s<n;s++)i=t.mul(i,new Uint8Array([1,e.exp(s)]));return i}}(V0);const K0=V0;function Ga(t){this.genPoly=void 0,this.degree=t,this.degree&&this.initialize(this.degree)}Ga.prototype.initialize=function(e){this.degree=e,this.genPoly=K0.generateECPolynomial(this.degree)},Ga.prototype.encode=function(e){if(!this.genPoly)throw new Error("Encoder not initialized");const r=new Uint8Array(e.length+this.degree);r.set(e);const n=K0.mod(r,this.genPoly),i=this.degree-n.length;if(i>0){const s=new Uint8Array(this.degree);return s.set(n,i),s}return n};var Qv=Ga,G0={},Cr={},Ya={};Ya.isValid=function(e){return!isNaN(e)&&e>=1&&e<=40};var sr={};const Y0="[0-9]+",e6="[A-Z $%*+\\-./:]+";let Ei="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";Ei=Ei.replace(/u/g,"\\u");const t6="(?:(?![A-Z0-9 $%*+\\-./:]|"+Ei+`)(?:.|[\r
120
+ ]))+`;sr.KANJI=new RegExp(Ei,"g"),sr.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),sr.BYTE=new RegExp(t6,"g"),sr.NUMERIC=new RegExp(Y0,"g"),sr.ALPHANUMERIC=new RegExp(e6,"g");const r6=new RegExp("^"+Ei+"$"),n6=new RegExp("^"+Y0+"$"),i6=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");sr.testKanji=function(e){return r6.test(e)},sr.testNumeric=function(e){return n6.test(e)},sr.testAlphanumeric=function(e){return i6.test(e)},function(t){const e=Ya,r=sr;t.NUMERIC={id:"Numeric",bit:1<<0,ccBits:[10,12,14]},t.ALPHANUMERIC={id:"Alphanumeric",bit:1<<1,ccBits:[9,11,13]},t.BYTE={id:"Byte",bit:1<<2,ccBits:[8,16,16]},t.KANJI={id:"Kanji",bit:1<<3,ccBits:[8,10,12]},t.MIXED={bit:-1},t.getCharCountIndicator=function(s,o){if(!s.ccBits)throw new Error("Invalid mode: "+s);if(!e.isValid(o))throw new Error("Invalid version: "+o);return o>=1&&o<10?s.ccBits[0]:o<27?s.ccBits[1]:s.ccBits[2]},t.getBestModeForData=function(s){return r.testNumeric(s)?t.NUMERIC:r.testAlphanumeric(s)?t.ALPHANUMERIC:r.testKanji(s)?t.KANJI:t.BYTE},t.toString=function(s){if(s&&s.id)return s.id;throw new Error("Invalid mode")},t.isValid=function(s){return s&&s.bit&&s.ccBits};function n(i){if(typeof i!="string")throw new Error("Param is not a string");switch(i.toLowerCase()){case"numeric":return t.NUMERIC;case"alphanumeric":return t.ALPHANUMERIC;case"kanji":return t.KANJI;case"byte":return t.BYTE;default:throw new Error("Unknown mode: "+i)}}t.from=function(s,o){if(t.isValid(s))return s;try{return n(s)}catch{return o}}}(Cr),function(t){const e=jt,r=$s,n=As,i=Cr,s=Ya,o=1<<12|1<<11|1<<10|1<<9|1<<8|1<<5|1<<2|1<<0,a=e.getBCHDigit(o);function c(y,m,E){for(let A=1;A<=40;A++)if(m<=t.getCapacity(A,E,y))return A}function l(y,m){return i.getCharCountIndicator(y,m)+4}function p(y,m){let E=0;return y.forEach(function(A){const N=l(A.mode,m);E+=N+A.getBitsLength()}),E}function w(y,m){for(let E=1;E<=40;E++)if(p(y,E)<=t.getCapacity(E,m,i.MIXED))return E}t.from=function(m,E){return s.isValid(m)?parseInt(m,10):E},t.getCapacity=function(m,E,A){if(!s.isValid(m))throw new Error("Invalid QR Code version");typeof A>"u"&&(A=i.BYTE);const N=e.getSymbolTotalCodewords(m),M=r.getTotalCodewordsCount(m,E),x=(N-M)*8;if(A===i.MIXED)return x;const D=x-l(A,m);switch(A){case i.NUMERIC:return Math.floor(D/10*3);case i.ALPHANUMERIC:return Math.floor(D/11*2);case i.KANJI:return Math.floor(D/13);case i.BYTE:default:return Math.floor(D/8)}},t.getBestVersionForData=function(m,E){let A;const N=n.from(E,n.M);if(Array.isArray(m)){if(m.length>1)return w(m,N);if(m.length===0)return 1;A=m[0]}else A=m;return c(A.mode,A.getLength(),N)},t.getEncodedBits=function(m){if(!s.isValid(m)||m<7)throw new Error("Invalid QR Code version");let E=m<<12;for(;e.getBCHDigit(E)-a>=0;)E^=o<<e.getBCHDigit(E)-a;return m<<12|E}}(G0);var Z0={};const Za=jt,J0=1<<10|1<<8|1<<5|1<<4|1<<2|1<<1|1<<0,s6=1<<14|1<<12|1<<10|1<<4|1<<1,X0=Za.getBCHDigit(J0);Z0.getEncodedBits=function(e,r){const n=e.bit<<3|r;let i=n<<10;for(;Za.getBCHDigit(i)-X0>=0;)i^=J0<<Za.getBCHDigit(i)-X0;return(n<<10|i)^s6};var Q0={};const o6=Cr;function In(t){this.mode=o6.NUMERIC,this.data=t.toString()}In.getBitsLength=function(e){return 10*Math.floor(e/3)+(e%3?e%3*3+1:0)},In.prototype.getLength=function(){return this.data.length},In.prototype.getBitsLength=function(){return In.getBitsLength(this.data.length)},In.prototype.write=function(e){let r,n,i;for(r=0;r+3<=this.data.length;r+=3)n=this.data.substr(r,3),i=parseInt(n,10),e.put(i,10);const s=this.data.length-r;s>0&&(n=this.data.substr(r),i=parseInt(n,10),e.put(i,s*3+1))};var a6=In;const c6=Cr,Ja=["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 Dn(t){this.mode=c6.ALPHANUMERIC,this.data=t}Dn.getBitsLength=function(e){return 11*Math.floor(e/2)+6*(e%2)},Dn.prototype.getLength=function(){return this.data.length},Dn.prototype.getBitsLength=function(){return Dn.getBitsLength(this.data.length)},Dn.prototype.write=function(e){let r;for(r=0;r+2<=this.data.length;r+=2){let n=Ja.indexOf(this.data[r])*45;n+=Ja.indexOf(this.data[r+1]),e.put(n,11)}this.data.length%2&&e.put(Ja.indexOf(this.data[r]),6)};var l6=Dn,u6=function(e){for(var r=[],n=e.length,i=0;i<n;i++){var s=e.charCodeAt(i);if(s>=55296&&s<=56319&&n>i+1){var o=e.charCodeAt(i+1);o>=56320&&o<=57343&&(s=(s-55296)*1024+o-56320+65536,i+=1)}if(s<128){r.push(s);continue}if(s<2048){r.push(s>>6|192),r.push(s&63|128);continue}if(s<55296||s>=57344&&s<65536){r.push(s>>12|224),r.push(s>>6&63|128),r.push(s&63|128);continue}if(s>=65536&&s<=1114111){r.push(s>>18|240),r.push(s>>12&63|128),r.push(s>>6&63|128),r.push(s&63|128);continue}r.push(239,191,189)}return new Uint8Array(r).buffer};const h6=u6,d6=Cr;function On(t){this.mode=d6.BYTE,typeof t=="string"&&(t=h6(t)),this.data=new Uint8Array(t)}On.getBitsLength=function(e){return e*8},On.prototype.getLength=function(){return this.data.length},On.prototype.getBitsLength=function(){return On.getBitsLength(this.data.length)},On.prototype.write=function(t){for(let e=0,r=this.data.length;e<r;e++)t.put(this.data[e],8)};var f6=On;const p6=Cr,g6=jt;function An(t){this.mode=p6.KANJI,this.data=t}An.getBitsLength=function(e){return e*13},An.prototype.getLength=function(){return this.data.length},An.prototype.getBitsLength=function(){return An.getBitsLength(this.data.length)},An.prototype.write=function(t){let e;for(e=0;e<this.data.length;e++){let r=g6.toSJIS(this.data[e]);if(r>=33088&&r<=40956)r-=33088;else if(r>=57408&&r<=60351)r-=49472;else throw new Error("Invalid SJIS character: "+this.data[e]+`
121
+ Make sure your charset is UTF-8`);r=(r>>>8&255)*192+(r&255),t.put(r,13)}};var m6=An,ed={exports:{}};(function(t){var e={single_source_shortest_paths:function(r,n,i){var s={},o={};o[n]=0;var a=e.PriorityQueue.make();a.push(n,0);for(var c,l,p,w,y,m,E,A,N;!a.empty();){c=a.pop(),l=c.value,w=c.cost,y=r[l]||{};for(p in y)y.hasOwnProperty(p)&&(m=y[p],E=w+m,A=o[p],N=typeof o[p]>"u",(N||A>E)&&(o[p]=E,a.push(p,E),s[p]=l))}if(typeof i<"u"&&typeof o[i]>"u"){var M=["Could not find a path from ",n," to ",i,"."].join("");throw new Error(M)}return s},extract_shortest_path_from_predecessor_list:function(r,n){for(var i=[],s=n;s;)i.push(s),r[s],s=r[s];return i.reverse(),i},find_path:function(r,n,i){var s=e.single_source_shortest_paths(r,n,i);return e.extract_shortest_path_from_predecessor_list(s,i)},PriorityQueue:{make:function(r){var n=e.PriorityQueue,i={},s;r=r||{};for(s in n)n.hasOwnProperty(s)&&(i[s]=n[s]);return i.queue=[],i.sorter=r.sorter||n.default_sorter,i},default_sorter:function(r,n){return r.cost-n.cost},push:function(r,n){var i={value:r,cost:n};this.queue.push(i),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};t.exports=e})(ed),function(t){const e=Cr,r=a6,n=l6,i=f6,s=m6,o=sr,a=jt,c=ed.exports;function l(M){return unescape(encodeURIComponent(M)).length}function p(M,x,D){const b=[];let I;for(;(I=M.exec(D))!==null;)b.push({data:I[0],index:I.index,mode:x,length:I[0].length});return b}function w(M){const x=p(o.NUMERIC,e.NUMERIC,M),D=p(o.ALPHANUMERIC,e.ALPHANUMERIC,M);let b,I;return a.isKanjiModeEnabled()?(b=p(o.BYTE,e.BYTE,M),I=p(o.KANJI,e.KANJI,M)):(b=p(o.BYTE_KANJI,e.BYTE,M),I=[]),x.concat(D,b,I).sort(function(h,_){return h.index-_.index}).map(function(h){return{data:h.data,mode:h.mode,length:h.length}})}function y(M,x){switch(x){case e.NUMERIC:return r.getBitsLength(M);case e.ALPHANUMERIC:return n.getBitsLength(M);case e.KANJI:return s.getBitsLength(M);case e.BYTE:return i.getBitsLength(M)}}function m(M){return M.reduce(function(x,D){const b=x.length-1>=0?x[x.length-1]:null;return b&&b.mode===D.mode?(x[x.length-1].data+=D.data,x):(x.push(D),x)},[])}function E(M){const x=[];for(let D=0;D<M.length;D++){const b=M[D];switch(b.mode){case e.NUMERIC:x.push([b,{data:b.data,mode:e.ALPHANUMERIC,length:b.length},{data:b.data,mode:e.BYTE,length:b.length}]);break;case e.ALPHANUMERIC:x.push([b,{data:b.data,mode:e.BYTE,length:b.length}]);break;case e.KANJI:x.push([b,{data:b.data,mode:e.BYTE,length:l(b.data)}]);break;case e.BYTE:x.push([{data:b.data,mode:e.BYTE,length:l(b.data)}])}}return x}function A(M,x){const D={},b={start:{}};let I=["start"];for(let O=0;O<M.length;O++){const h=M[O],_=[];for(let H=0;H<h.length;H++){const j=h[H],q=""+O+H;_.push(q),D[q]={node:j,lastCount:0},b[q]={};for(let X=0;X<I.length;X++){const re=I[X];D[re]&&D[re].node.mode===j.mode?(b[re][q]=y(D[re].lastCount+j.length,j.mode)-y(D[re].lastCount,j.mode),D[re].lastCount+=j.length):(D[re]&&(D[re].lastCount=j.length),b[re][q]=y(j.length,j.mode)+4+e.getCharCountIndicator(j.mode,x))}}I=_}for(let O=0;O<I.length;O++)b[I[O]].end=0;return{map:b,table:D}}function N(M,x){let D;const b=e.getBestModeForData(M);if(D=e.from(x,b),D!==e.BYTE&&D.bit<b.bit)throw new Error('"'+M+'" cannot be encoded with mode '+e.toString(D)+`.
122
+ Suggested mode is: `+e.toString(b));switch(D===e.KANJI&&!a.isKanjiModeEnabled()&&(D=e.BYTE),D){case e.NUMERIC:return new r(M);case e.ALPHANUMERIC:return new n(M);case e.KANJI:return new s(M);case e.BYTE:return new i(M)}}t.fromArray=function(x){return x.reduce(function(D,b){return typeof b=="string"?D.push(N(b,null)):b.data&&D.push(N(b.data,b.mode)),D},[])},t.fromString=function(x,D){const b=w(x,a.isKanjiModeEnabled()),I=E(b),O=A(I,D),h=c.find_path(O.map,"start","end"),_=[];for(let H=1;H<h.length-1;H++)_.push(O.table[h[H]].node);return t.fromArray(m(_))},t.rawSplit=function(x){return t.fromArray(w(x,a.isKanjiModeEnabled()))}}(Q0);const Ls=jt,Xa=As,w6=Zv,y6=Jv,b6=H0,v6=z0,Qa=q0,ec=$s,_6=Qv,Ms=G0,E6=Z0,x6=Cr,tc=Q0;function C6(t,e){const r=t.size,n=v6.getPositions(e);for(let i=0;i<n.length;i++){const s=n[i][0],o=n[i][1];for(let a=-1;a<=7;a++)if(!(s+a<=-1||r<=s+a))for(let c=-1;c<=7;c++)o+c<=-1||r<=o+c||(a>=0&&a<=6&&(c===0||c===6)||c>=0&&c<=6&&(a===0||a===6)||a>=2&&a<=4&&c>=2&&c<=4?t.set(s+a,o+c,!0,!0):t.set(s+a,o+c,!1,!0))}}function S6(t){const e=t.size;for(let r=8;r<e-8;r++){const n=r%2===0;t.set(r,6,n,!0),t.set(6,r,n,!0)}}function I6(t,e){const r=b6.getPositions(e);for(let n=0;n<r.length;n++){const i=r[n][0],s=r[n][1];for(let o=-2;o<=2;o++)for(let a=-2;a<=2;a++)o===-2||o===2||a===-2||a===2||o===0&&a===0?t.set(i+o,s+a,!0,!0):t.set(i+o,s+a,!1,!0)}}function D6(t,e){const r=t.size,n=Ms.getEncodedBits(e);let i,s,o;for(let a=0;a<18;a++)i=Math.floor(a/3),s=a%3+r-8-3,o=(n>>a&1)===1,t.set(i,s,o,!0),t.set(s,i,o,!0)}function rc(t,e,r){const n=t.size,i=E6.getEncodedBits(e,r);let s,o;for(s=0;s<15;s++)o=(i>>s&1)===1,s<6?t.set(s,8,o,!0):s<8?t.set(s+1,8,o,!0):t.set(n-15+s,8,o,!0),s<8?t.set(8,n-s-1,o,!0):s<9?t.set(8,15-s-1+1,o,!0):t.set(8,15-s-1,o,!0);t.set(n-8,8,1,!0)}function O6(t,e){const r=t.size;let n=-1,i=r-1,s=7,o=0;for(let a=r-1;a>0;a-=2)for(a===6&&a--;;){for(let c=0;c<2;c++)if(!t.isReserved(i,a-c)){let l=!1;o<e.length&&(l=(e[o]>>>s&1)===1),t.set(i,a-c,l),s--,s===-1&&(o++,s=7)}if(i+=n,i<0||r<=i){i-=n,n=-n;break}}}function A6(t,e,r){const n=new w6;r.forEach(function(c){n.put(c.mode.bit,4),n.put(c.getLength(),x6.getCharCountIndicator(c.mode,t)),c.write(n)});const i=Ls.getSymbolTotalCodewords(t),s=ec.getTotalCodewordsCount(t,e),o=(i-s)*8;for(n.getLengthInBits()+4<=o&&n.put(0,4);n.getLengthInBits()%8!==0;)n.putBit(0);const a=(o-n.getLengthInBits())/8;for(let c=0;c<a;c++)n.put(c%2?17:236,8);return $6(n,t,e)}function $6(t,e,r){const n=Ls.getSymbolTotalCodewords(e),i=ec.getTotalCodewordsCount(e,r),s=n-i,o=ec.getBlocksCount(e,r),a=n%o,c=o-a,l=Math.floor(n/o),p=Math.floor(s/o),w=p+1,y=l-p,m=new _6(y);let E=0;const A=new Array(o),N=new Array(o);let M=0;const x=new Uint8Array(t.buffer);for(let h=0;h<o;h++){const _=h<c?p:w;A[h]=x.slice(E,E+_),N[h]=m.encode(A[h]),E+=_,M=Math.max(M,_)}const D=new Uint8Array(n);let b=0,I,O;for(I=0;I<M;I++)for(O=0;O<o;O++)I<A[O].length&&(D[b++]=A[O][I]);for(I=0;I<y;I++)for(O=0;O<o;O++)D[b++]=N[O][I];return D}function P6(t,e,r,n){let i;if(Array.isArray(t))i=tc.fromArray(t);else if(typeof t=="string"){let l=e;if(!l){const p=tc.rawSplit(t);l=Ms.getBestVersionForData(p,r)}i=tc.fromString(t,l||40)}else throw new Error("Invalid data");const s=Ms.getBestVersionForData(i,r);if(!s)throw new Error("The amount of data is too big to be stored in a QR Code");if(!e)e=s;else if(e<s)throw new Error(`
162
123
  The chosen QR Code version cannot contain this amount of data.
163
- Minimum version required to store current data is: `+o+`.
164
- `);const s=CC(e,r,i),a=Ms.getSymbolSize(e),l=new dC(a);return wC(l,e),vC(l),_C(l,e),fl(l,r,0),e>=7&&EC(l,e),xC(l,s),isNaN(n)&&(n=ll.getBestMask(l,fl.bind(null,l,r))),ll.applyMask(n,l),fl(l,r,n),{modules:l,version:e,errorCorrectionLevel:r,maskPattern:n,segments:i}}np.create=function(e,r){if(typeof e>"u"||e==="")throw new Error("No input text");let n=cl.M,i,o;return typeof r<"u"&&(n=cl.from(r.errorCorrectionLevel,cl.M),i=Us.from(r.version),o=ll.from(r.maskPattern),r.toSJISFunc&&Ms.setToSJISFunction(r.toSJISFunc)),AC(e,i,n,o)};var yp={},dl={};(function(t){function e(r){if(typeof r=="number"&&(r=r.toString()),typeof r!="string")throw new Error("Color should be defined as hex string");let n=r.slice().replace("#","").split("");if(n.length<3||n.length===5||n.length>8)throw new Error("Invalid hex color: "+r);(n.length===3||n.length===4)&&(n=Array.prototype.concat.apply([],n.map(function(o){return[o,o]}))),n.length===6&&n.push("F","F");const i=parseInt(n.join(""),16);return{r:i>>24&255,g:i>>16&255,b:i>>8&255,a:i&255,hex:"#"+n.slice(0,6).join("")}}t.getOptions=function(n){n||(n={}),n.color||(n.color={});const i=typeof n.margin>"u"||n.margin===null||n.margin<0?4:n.margin,o=n.width&&n.width>=21?n.width:void 0,s=n.scale||4;return{width:o,scale:o?4:s,margin:i,color:{dark:e(n.color.dark||"#000000ff"),light:e(n.color.light||"#ffffffff")},type:n.type,rendererOpts:n.rendererOpts||{}}},t.getScale=function(n,i){return i.width&&i.width>=n+i.margin*2?i.width/(n+i.margin*2):i.scale},t.getImageWidth=function(n,i){const o=t.getScale(n,i);return Math.floor((n+i.margin*2)*o)},t.qrToImageData=function(n,i,o){const s=i.modules.size,a=i.modules.data,l=t.getScale(s,o),u=Math.floor((s+o.margin*2)*l),d=o.margin*l,y=[o.color.light,o.color.dark];for(let m=0;m<u;m++)for(let v=0;v<u;v++){let _=(m*u+v)*4,R=o.color.light;if(m>=d&&v>=d&&m<u-d&&v<u-d){const M=Math.floor((m-d)/l),B=Math.floor((v-d)/l);R=y[a[M*s+B]?1:0]}n[_++]=R.r,n[_++]=R.g,n[_++]=R.b,n[_]=R.a}}})(dl),function(t){const e=dl;function r(i,o,s){i.clearRect(0,0,o.width,o.height),o.style||(o.style={}),o.height=s,o.width=s,o.style.height=s+"px",o.style.width=s+"px"}function n(){try{return document.createElement("canvas")}catch{throw new Error("You need to specify a canvas element")}}t.render=function(o,s,a){let l=a,u=s;typeof l>"u"&&(!s||!s.getContext)&&(l=s,s=void 0),s||(u=n()),l=e.getOptions(l);const d=e.getImageWidth(o.modules.size,l),y=u.getContext("2d"),m=y.createImageData(d,d);return e.qrToImageData(m.data,o,l),r(y,u,d),y.putImageData(m,0,0),u},t.renderToDataURL=function(o,s,a){let l=a;typeof l>"u"&&(!s||!s.getContext)&&(l=s,s=void 0),l||(l={});const u=t.render(o,s,l),d=l.type||"image/png",y=l.rendererOpts||{};return u.toDataURL(d,y.quality)}}(yp);var wp={};const IC=dl;function vp(t,e){const r=t.a/255,n=e+'="'+t.hex+'"';return r<1?n+" "+e+'-opacity="'+r.toFixed(2).slice(1)+'"':n}function pl(t,e,r){let n=t+e;return typeof r<"u"&&(n+=" "+r),n}function OC(t,e,r){let n="",i=0,o=!1,s=0;for(let a=0;a<t.length;a++){const l=Math.floor(a%e),u=Math.floor(a/e);!l&&!o&&(o=!0),t[a]?(s++,a>0&&l>0&&t[a-1]||(n+=o?pl("M",l+r,.5+u+r):pl("m",i,0),i=0,o=!1),l+1<e&&t[a+1]||(n+=pl("h",s),s=0)):i++}return n}wp.render=function(e,r,n){const i=IC.getOptions(r),o=e.modules.size,s=e.modules.data,a=o+i.margin*2,l=i.color.light.a?"<path "+vp(i.color.light,"fill")+' d="M0 0h'+a+"v"+a+'H0z"/>':"",u="<path "+vp(i.color.dark,"stroke")+' d="'+OC(s,o,i.margin)+'"/>',d='viewBox="0 0 '+a+" "+a+'"',m='<svg xmlns="http://www.w3.org/2000/svg" '+(i.width?'width="'+i.width+'" height="'+i.width+'" ':"")+d+' shape-rendering="crispEdges">'+l+u+`</svg>
165
- `;return typeof n=="function"&&n(null,m),m};const DC=zx,gl=np,_p=yp,$C=wp;function ml(t,e,r,n,i){const o=[].slice.call(arguments,1),s=o.length,a=typeof o[s-1]=="function";if(!a&&!DC())throw new Error("Callback required as last argument");if(a){if(s<2)throw new Error("Too few arguments provided");s===2?(i=r,r=e,e=n=void 0):s===3&&(e.getContext&&typeof i>"u"?(i=n,n=void 0):(i=n,n=r,r=e,e=void 0))}else{if(s<1)throw new Error("Too few arguments provided");return s===1?(r=e,e=n=void 0):s===2&&!e.getContext&&(n=r,r=e,e=void 0),new Promise(function(l,u){try{const d=gl.create(r,n);l(t(d,e,n))}catch(d){u(d)}})}try{const l=gl.create(r,n);i(null,t(l,e,n))}catch(l){i(l)}}to.create=gl.create,to.toCanvas=ml.bind(null,_p.render),to.toDataURL=ml.bind(null,_p.renderToDataURL),to.toString=ml.bind(null,function(t,e,r){return $C.render(t,r)});var FC=Object.defineProperty,Ep=Object.getOwnPropertySymbols,PC=Object.prototype.hasOwnProperty,TC=Object.prototype.propertyIsEnumerable,xp=(t,e,r)=>e in t?FC(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Cp=(t,e)=>{for(var r in e||(e={}))PC.call(e,r)&&xp(t,r,e[r]);if(Ep)for(var r of Ep(e))TC.call(e,r)&&xp(t,r,e[r]);return t};function Sp(){return{default:{light:{inverse:"rgb(255,255,255)",foreground:"rgb(51,150,255)",background:"rgb(232,242,252)"},dark:{inverse:"rgb(255,255,255)",foreground:"rgb(71,161,255)",background:"rgb(21,38,55)"}},magenta:{light:{inverse:"rgb(255,255,255)",foreground:"rgb(198,83,128)",background:"rgb(244,221,230)"},dark:{inverse:"rgb(255,255,255)",foreground:"rgb(203,77,140)",background:"rgb(57,35,43)"}},blue:{light:{inverse:"rgb(255,255,255)",foreground:"rgb(61,92,245)",background:"rgb(232,235,252)"},dark:{inverse:"rgb(255,255,255)",foreground:"rgb(81,109,251)",background:"rgb(28,33,59)"}},orange:{light:{inverse:"rgb(255,255,255)",foreground:"rgb(234,140,46)",background:"rgb(244,236,221)"},dark:{inverse:"rgb(0,0,0)",foreground:"rgb(255,166,76)",background:"rgb(57,50,34)"}},green:{light:{inverse:"rgb(255,255,255)",foreground:"rgb(38,181,98)",background:"rgb(218,246,218)"},dark:{inverse:"rgb(0,0,0)",foreground:"rgb(38,217,98)",background:"rgb(35,52,40)"}},purple:{light:{inverse:"rgb(255,255,255)",foreground:"rgb(121,76,255)",background:"rgb(225,218,246)"},dark:{inverse:"rgb(255,255,255)",foreground:"rgb(144,110,247)",background:"rgb(36,31,51)"}},teal:{light:{inverse:"rgb(255,255,255)",foreground:"rgb(43,182,182)",background:"rgb(217,242,238)"},dark:{inverse:"rgb(0,0,0)",foreground:"rgb(54,226,226)",background:"rgb(29,48,52)"}},blackWhite:{light:{inverse:"rgb(255,255,255)",foreground:"rgb(20,20,20)",background:"rgb(255,255,255)"},dark:{inverse:"rgb(0,0,0)",foreground:"rgb(255,255,255)",background:"rgb(20,20,20)"}}}}function NC(){return{light:{foreground:{1:"rgb(20,20,20)",2:"rgb(121,134,134)",3:"rgb(158,169,169)"},background:{1:"rgb(255,255,255)",2:"rgb(241,243,243)",3:"rgb(228,231,231)"},overlay:"rgba(0,0,0,0.1)"},dark:{foreground:{1:"rgb(228,231,231)",2:"rgb(148,158,158)",3:"rgb(110,119,119)"},background:{1:"rgb(20,20,20)",2:"rgb(39,42,42)",3:"rgb(59,64,64)"},overlay:"rgba(255,255,255,0.1"}}}function RC(){return{default:{1:"#B6B9C9",2:"#C653C6",3:"#794DFF",4:"#2EB8B8"},blue:{1:"#E8EBFD",2:"#C653C6",3:"#2DD2C5",4:"#3D5CF5"},magenta:{1:"#F4DDE6",2:"#E0D452",3:"#F09475",4:"#D1618D"},orange:{1:"#F4ECDD",2:"#B4EB47",3:"#3075E8",4:"#EB9947"},green:{1:"#DAF6DA",2:"#E06B92",3:"#99E54D",4:"#26B562"},purple:{1:"#E1DAF6",2:"#EB9947",3:"#E06B92",4:"#794DFF"},teal:{1:"#D9F2EE",2:"#F09475",3:"#794DFF",4:"#2EB8B8"},blackWhite:{1:"#E3E8E8",2:"#98AEAE",3:"#516767",4:"#242E2E"}}}const _e={color(){var t,e;const r=(t=vt.state.themeColor)!=null?t:"default",n=(e=vt.state.themeMode)!=null?e:"dark",i=Sp()[r][n],o=NC()[n],s=RC()[r];return{foreground:Cp({accent:i.foreground,inverse:i.inverse},o.foreground),background:Cp({accent:i.background},o.background),gradient:s,overlay:o.overlay,error:"rgb(242, 90, 103)"}},setTheme(){const t=document.querySelector(":root"),{themeZIndex:e}=vt.state;if(t){const r={"--w3m-color-fg-accent":_e.color().foreground.accent,"--w3m-color-fg-inverse":_e.color().foreground.inverse,"--w3m-color-fg-1":_e.color().foreground[1],"--w3m-color-fg-2":_e.color().foreground[2],"--w3m-color-fg-3":_e.color().foreground[3],"--w3m-color-bg-1":_e.color().background[1],"--w3m-color-bg-2":_e.color().background[2],"--w3m-color-bg-3":_e.color().background[3],"--w3m-color-overlay":_e.color().overlay,"--w3m-color-err":_e.color().error,"--w3m-color-success":Sp().green.light.foreground,"--w3m-gradient-1":_e.color().gradient[1],"--w3m-gradient-2":_e.color().gradient[2],"--w3m-gradient-3":_e.color().gradient[3],"--w3m-gradient-4":_e.color().gradient[4],"--w3m-modal-z-index":`${e}`};Object.entries(r).forEach(([n,i])=>t.style.setProperty(n,i))}},globalCss:He`*,::after,::before{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;backface-visibility:hidden}button{cursor:pointer;display:flex;justify-content:center;align-items:center;position:relative;border:none;background-color:transparent}button::after{content:'';position:absolute;inset:0;transition:background-color,.2s ease}button:disabled{cursor:not-allowed}button svg,button w3m-text{position:relative;z-index:1}input{border:none;outline:0;appearance:none}img{display:block}::selection{color:var(--w3m-color-fg-inverse);background:var(--w3m-color-fg-accent)}`},LC=He`button{display:flex;border-radius:10px;flex-direction:column;transition:background-color .2s ease;justify-content:center;padding:5px;width:100px}button:hover{background-color:var(--w3m-color-overlay)}button>div{display:flex;justify-content:center;align-items:center;width:32px;height:32px;box-shadow:inset 0 0 0 1px var(--w3m-color-overlay);background-color:var(--w3m-color-fg-accent);border-radius:50%;margin-bottom:4px}button path{fill:var(--w3m-color-fg-inverse)}`;var MC=Object.defineProperty,UC=Object.getOwnPropertyDescriptor,Bs=(t,e,r,n)=>{for(var i=n>1?void 0:n?UC(e,r):e,o=t.length-1,s;o>=0;o--)(s=t[o])&&(i=(n?s(e,r,i):s(i))||i);return n&&i&&MC(e,r,i),i};let ei=class extends Ie{constructor(){super(...arguments),this.icon=void 0,this.label="",this.onClick=()=>null}render(){return ee`<button @click="${this.onClick}"><div>${this.icon}</div><w3m-text variant="xsmall-normal" color="accent">${this.label}</w3m-text></button>`}};ei.styles=[_e.globalCss,LC],Bs([je()],ei.prototype,"icon",2),Bs([je()],ei.prototype,"label",2),Bs([je()],ei.prototype,"onClick",2),ei=Bs([Le("w3m-box-button")],ei);const BC=He`button{border-radius:28px;height:28px;padding:0 10px;background-color:var(--w3m-color-fg-accent)}button path{fill:var(--w3m-color-fg-inverse)}button::after{border-radius:inherit;border:1px solid var(--w3m-color-overlay)}button:disabled::after{background-color:transparent}.w3m-icon-left svg{margin-right:5px}.w3m-icon-right svg{margin-left:5px}button:hover::after{background-color:var(--w3m-color-overlay)}button:disabled{background-color:var(--w3m-color-bg-3)}`;var jC=Object.defineProperty,kC=Object.getOwnPropertyDescriptor,oo=(t,e,r,n)=>{for(var i=n>1?void 0:n?kC(e,r):e,o=t.length-1,s;o>=0;o--)(s=t[o])&&(i=(n?s(e,r,i):s(i))||i);return n&&i&&jC(e,r,i),i};let pn=class extends Ie{constructor(){super(...arguments),this.disabled=!1,this.iconLeft=void 0,this.iconRight=void 0,this.onClick=()=>null}render(){const t={"w3m-icon-left":this.iconLeft!==void 0,"w3m-icon-right":this.iconRight!==void 0};return ee`<button class="${tr(t)}" ?disabled="${this.disabled}" @click="${this.onClick}">${this.iconLeft}<w3m-text variant="small-normal" color="inverse"><slot></slot></w3m-text>${this.iconRight}</button>`}};pn.styles=[_e.globalCss,BC],oo([je()],pn.prototype,"disabled",2),oo([je()],pn.prototype,"iconLeft",2),oo([je()],pn.prototype,"iconRight",2),oo([je()],pn.prototype,"onClick",2),pn=oo([Le("w3m-button")],pn);const HC=He`:host{display:inline-block}button{padding:0 15px 1px;height:40px;border-radius:10px;color:var(--w3m-color-fg-inverse);background-color:var(--w3m-color-fg-accent)}button::after{content:'';inset:0;position:absolute;background-color:transparent;border-radius:inherit;transition:background-color .2s ease;border:1px solid var(--w3m-color-overlay)}button:hover::after{background-color:var(--w3m-color-overlay)}button:disabled{padding-bottom:0;background-color:var(--w3m-color-bg-3);color:var(--w3m-color-fg-3)}.w3m-secondary{color:var(--w3m-color-fg-accent);background-color:transparent}.w3m-secondary::after{display:none}`;var zC=Object.defineProperty,WC=Object.getOwnPropertyDescriptor,bl=(t,e,r,n)=>{for(var i=n>1?void 0:n?WC(e,r):e,o=t.length-1,s;o>=0;o--)(s=t[o])&&(i=(n?s(e,r,i):s(i))||i);return n&&i&&zC(e,r,i),i};let so=class extends Ie{constructor(){super(...arguments),this.disabled=!1,this.variant="primary"}render(){const t={"w3m-secondary":this.variant==="secondary"};return ee`<button ?disabled="${this.disabled}" class="${tr(t)}"><slot></slot></button>`}};so.styles=[_e.globalCss,HC],bl([je()],so.prototype,"disabled",2),bl([je()],so.prototype,"variant",2),so=bl([Le("w3m-button-big")],so);let VC=class{constructor(...t){this.angle=0,this.t=1253106,this.last=0,this.height=500,this.amp=300,this.seed=15,this.freqX=14e-5,this.freqY=29e-5,this.freqDelta=1e-5,this.activeColors=[1,1,1,1],this.isMetaKey=!1,this.playing=!1,Ap(this,"resize",()=>{this.width=window.innerWidth,this.minigl.setSize(this.width,this.height),this.minigl.setOrthographicCamera(),this.xSegCount=Math.ceil(this.width*this.conf.density[0]),this.ySegCount=Math.ceil(this.height*this.conf.density[1]),this.mesh.geometry.setTopology(this.xSegCount,this.ySegCount),this.mesh.geometry.setSize(this.width,this.height),this.mesh.material.uniforms.u_shadow_power.value=this.width<550?5:6}),Ap(this,"animate",e=>{if(this.playing){if(this.shouldSkipFrame(e)||(this.t+=Math.min(e-this.last,1e3/15),this.last=e,this.mesh.material.uniforms.u_time.value=this.t,this.minigl.render()),this.last!==0&&this.isStatic)return this.minigl.render();requestAnimationFrame(this.animate)}})}play(t){this.el=t,this.connect()}stop(){this.playing=!1}async connect(){this.shaderFiles={vertex:"varying vec3 v_color;void main(){float time=u_time*u_global.noiseSpeed;vec2 noiseCoord=resolution*uvNorm*u_global.noiseFreq;vec2 st=1.-uvNorm.xy;float tilt=resolution.y/2.0*uvNorm.y;float incline=resolution.x*uvNorm.x/2.0*u_vertDeform.incline;float offset=resolution.x/2.0*u_vertDeform.incline*mix(u_vertDeform.offsetBottom,u_vertDeform.offsetTop,uv.y);float noise=snoise(vec3(noiseCoord.x*u_vertDeform.noiseFreq.x+time*u_vertDeform.noiseFlow,noiseCoord.y*u_vertDeform.noiseFreq.y,time*u_vertDeform.noiseSpeed+u_vertDeform.noiseSeed))*u_vertDeform.noiseAmp;noise*=1.0-pow(abs(uvNorm.y),2.0);noise=max(0.0,noise);vec3 pos=vec3(position.x,position.y+tilt+incline+noise-offset,position.z);if(u_active_colors[0]==1.){v_color=u_baseColor;}for(int i=0;i<u_waveLayers_length;i++){if(u_active_colors[i+1]==1.){WaveLayers layer=u_waveLayers[i];float noise=smoothstep(layer.noiseFloor,layer.noiseCeil,snoise(vec3(noiseCoord.x*layer.noiseFreq.x+time*layer.noiseFlow,noiseCoord.y*layer.noiseFreq.y,time*layer.noiseSpeed+layer.noiseSeed))/2.0+0.5);v_color=blendNormal(v_color,layer.color,pow(noise,4.));}}gl_Position=projectionMatrix*modelViewMatrix*vec4(pos,1.0);}",noise:`
124
+ Minimum version required to store current data is: `+s+`.
125
+ `);const o=A6(e,r,i),a=Ls.getSymbolSize(e),c=new y6(a);return C6(c,e),S6(c),I6(c,e),rc(c,r,0),e>=7&&D6(c,e),O6(c,o),isNaN(n)&&(n=Qa.getBestMask(c,rc.bind(null,c,r))),Qa.applyMask(n,c),rc(c,r,n),{modules:c,version:e,errorCorrectionLevel:r,maskPattern:n,segments:i}}j0.create=function(e,r){if(typeof e>"u"||e==="")throw new Error("No input text");let n=Xa.M,i,s;return typeof r<"u"&&(n=Xa.from(r.errorCorrectionLevel,Xa.M),i=Ms.from(r.version),s=Qa.from(r.maskPattern),r.toSJISFunc&&Ls.setToSJISFunction(r.toSJISFunc)),P6(e,i,n,s)};var td={},nc={};(function(t){function e(r){if(typeof r=="number"&&(r=r.toString()),typeof r!="string")throw new Error("Color should be defined as hex string");let n=r.slice().replace("#","").split("");if(n.length<3||n.length===5||n.length>8)throw new Error("Invalid hex color: "+r);(n.length===3||n.length===4)&&(n=Array.prototype.concat.apply([],n.map(function(s){return[s,s]}))),n.length===6&&n.push("F","F");const i=parseInt(n.join(""),16);return{r:i>>24&255,g:i>>16&255,b:i>>8&255,a:i&255,hex:"#"+n.slice(0,6).join("")}}t.getOptions=function(n){n||(n={}),n.color||(n.color={});const i=typeof n.margin>"u"||n.margin===null||n.margin<0?4:n.margin,s=n.width&&n.width>=21?n.width:void 0,o=n.scale||4;return{width:s,scale:s?4:o,margin:i,color:{dark:e(n.color.dark||"#000000ff"),light:e(n.color.light||"#ffffffff")},type:n.type,rendererOpts:n.rendererOpts||{}}},t.getScale=function(n,i){return i.width&&i.width>=n+i.margin*2?i.width/(n+i.margin*2):i.scale},t.getImageWidth=function(n,i){const s=t.getScale(n,i);return Math.floor((n+i.margin*2)*s)},t.qrToImageData=function(n,i,s){const o=i.modules.size,a=i.modules.data,c=t.getScale(o,s),l=Math.floor((o+s.margin*2)*c),p=s.margin*c,w=[s.color.light,s.color.dark];for(let y=0;y<l;y++)for(let m=0;m<l;m++){let E=(y*l+m)*4,A=s.color.light;if(y>=p&&m>=p&&y<l-p&&m<l-p){const N=Math.floor((y-p)/c),M=Math.floor((m-p)/c);A=w[a[N*o+M]?1:0]}n[E++]=A.r,n[E++]=A.g,n[E++]=A.b,n[E]=A.a}}})(nc),function(t){const e=nc;function r(i,s,o){i.clearRect(0,0,s.width,s.height),s.style||(s.style={}),s.height=o,s.width=o,s.style.height=o+"px",s.style.width=o+"px"}function n(){try{return document.createElement("canvas")}catch{throw new Error("You need to specify a canvas element")}}t.render=function(s,o,a){let c=a,l=o;typeof c>"u"&&(!o||!o.getContext)&&(c=o,o=void 0),o||(l=n()),c=e.getOptions(c);const p=e.getImageWidth(s.modules.size,c),w=l.getContext("2d"),y=w.createImageData(p,p);return e.qrToImageData(y.data,s,c),r(w,l,p),w.putImageData(y,0,0),l},t.renderToDataURL=function(s,o,a){let c=a;typeof c>"u"&&(!o||!o.getContext)&&(c=o,o=void 0),c||(c={});const l=t.render(s,o,c),p=c.type||"image/png",w=c.rendererOpts||{};return l.toDataURL(p,w.quality)}}(td);var rd={};const T6=nc;function nd(t,e){const r=t.a/255,n=e+'="'+t.hex+'"';return r<1?n+" "+e+'-opacity="'+r.toFixed(2).slice(1)+'"':n}function ic(t,e,r){let n=t+e;return typeof r<"u"&&(n+=" "+r),n}function N6(t,e,r){let n="",i=0,s=!1,o=0;for(let a=0;a<t.length;a++){const c=Math.floor(a%e),l=Math.floor(a/e);!c&&!s&&(s=!0),t[a]?(o++,a>0&&c>0&&t[a-1]||(n+=s?ic("M",c+r,.5+l+r):ic("m",i,0),i=0,s=!1),c+1<e&&t[a+1]||(n+=ic("h",o),o=0)):i++}return n}rd.render=function(e,r,n){const i=T6.getOptions(r),s=e.modules.size,o=e.modules.data,a=s+i.margin*2,c=i.color.light.a?"<path "+nd(i.color.light,"fill")+' d="M0 0h'+a+"v"+a+'H0z"/>':"",l="<path "+nd(i.color.dark,"stroke")+' d="'+N6(o,s,i.margin)+'"/>',p='viewBox="0 0 '+a+" "+a+'"',y='<svg xmlns="http://www.w3.org/2000/svg" '+(i.width?'width="'+i.width+'" height="'+i.width+'" ':"")+p+' shape-rendering="crispEdges">'+c+l+`</svg>
126
+ `;return typeof n=="function"&&n(null,y),y};const R6=Gv,sc=j0,id=td,L6=rd;function oc(t,e,r,n,i){const s=[].slice.call(arguments,1),o=s.length,a=typeof s[o-1]=="function";if(!a&&!R6())throw new Error("Callback required as last argument");if(a){if(o<2)throw new Error("Too few arguments provided");o===2?(i=r,r=e,e=n=void 0):o===3&&(e.getContext&&typeof i>"u"?(i=n,n=void 0):(i=n,n=r,r=e,e=void 0))}else{if(o<1)throw new Error("Too few arguments provided");return o===1?(r=e,e=n=void 0):o===2&&!e.getContext&&(n=r,r=e,e=void 0),new Promise(function(c,l){try{const p=sc.create(r,n);c(t(p,e,n))}catch(p){l(p)}})}try{const c=sc.create(r,n);i(null,t(c,e,n))}catch(c){i(c)}}bi.create=sc.create,bi.toCanvas=oc.bind(null,id.render),bi.toDataURL=oc.bind(null,id.renderToDataURL),bi.toString=oc.bind(null,function(t,e,r){return L6.render(t,r)});var M6=Object.defineProperty,sd=Object.getOwnPropertySymbols,U6=Object.prototype.hasOwnProperty,F6=Object.prototype.propertyIsEnumerable,od=(t,e,r)=>e in t?M6(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,ad=(t,e)=>{for(var r in e||(e={}))U6.call(e,r)&&od(t,r,e[r]);if(sd)for(var r of sd(e))F6.call(e,r)&&od(t,r,e[r]);return t};function cd(){return{default:{light:{inverse:"rgb(255,255,255)",foreground:"rgb(51,150,255)",background:"rgb(232,242,252)"},dark:{inverse:"rgb(255,255,255)",foreground:"rgb(71,161,255)",background:"rgb(21,38,55)"}},magenta:{light:{inverse:"rgb(255,255,255)",foreground:"rgb(198,83,128)",background:"rgb(244,221,230)"},dark:{inverse:"rgb(255,255,255)",foreground:"rgb(203,77,140)",background:"rgb(57,35,43)"}},blue:{light:{inverse:"rgb(255,255,255)",foreground:"rgb(61,92,245)",background:"rgb(232,235,252)"},dark:{inverse:"rgb(255,255,255)",foreground:"rgb(81,109,251)",background:"rgb(28,33,59)"}},orange:{light:{inverse:"rgb(255,255,255)",foreground:"rgb(234,140,46)",background:"rgb(244,236,221)"},dark:{inverse:"rgb(0,0,0)",foreground:"rgb(255,166,76)",background:"rgb(57,50,34)"}},green:{light:{inverse:"rgb(255,255,255)",foreground:"rgb(38,181,98)",background:"rgb(218,246,218)"},dark:{inverse:"rgb(0,0,0)",foreground:"rgb(38,217,98)",background:"rgb(35,52,40)"}},purple:{light:{inverse:"rgb(255,255,255)",foreground:"rgb(121,76,255)",background:"rgb(225,218,246)"},dark:{inverse:"rgb(255,255,255)",foreground:"rgb(144,110,247)",background:"rgb(36,31,51)"}},teal:{light:{inverse:"rgb(255,255,255)",foreground:"rgb(43,182,182)",background:"rgb(217,242,238)"},dark:{inverse:"rgb(0,0,0)",foreground:"rgb(54,226,226)",background:"rgb(29,48,52)"}},blackWhite:{light:{inverse:"rgb(255,255,255)",foreground:"rgb(20,20,20)",background:"rgb(255,255,255)"},dark:{inverse:"rgb(0,0,0)",foreground:"rgb(255,255,255)",background:"rgb(20,20,20)"}}}}function B6(){return{light:{foreground:{1:"rgb(20,20,20)",2:"rgb(121,134,134)",3:"rgb(158,169,169)"},background:{1:"rgb(255,255,255)",2:"rgb(241,243,243)",3:"rgb(228,231,231)"},overlay:"rgba(0,0,0,0.1)"},dark:{foreground:{1:"rgb(228,231,231)",2:"rgb(148,158,158)",3:"rgb(110,119,119)"},background:{1:"rgb(20,20,20)",2:"rgb(39,42,42)",3:"rgb(59,64,64)"},overlay:"rgba(255,255,255,0.1"}}}function j6(){return{default:{1:"#B6B9C9",2:"#C653C6",3:"#794DFF",4:"#2EB8B8"},blue:{1:"#E8EBFD",2:"#C653C6",3:"#2DD2C5",4:"#3D5CF5"},magenta:{1:"#F4DDE6",2:"#E0D452",3:"#F09475",4:"#D1618D"},orange:{1:"#F4ECDD",2:"#B4EB47",3:"#3075E8",4:"#EB9947"},green:{1:"#DAF6DA",2:"#E06B92",3:"#99E54D",4:"#26B562"},purple:{1:"#E1DAF6",2:"#EB9947",3:"#E06B92",4:"#794DFF"},teal:{1:"#D9F2EE",2:"#F09475",3:"#794DFF",4:"#2EB8B8"},blackWhite:{1:"#E3E8E8",2:"#98AEAE",3:"#516767",4:"#242E2E"}}}const ue={color(){var t,e;const r=(t=Ve.state.themeColor)!=null?t:"default",n=(e=Ve.state.themeMode)!=null?e:"dark",i=cd()[r][n],s=B6()[n],o=j6()[r];return{foreground:ad({accent:i.foreground,inverse:i.inverse},s.foreground),background:ad({accent:i.background},s.background),gradient:o,overlay:s.overlay,error:"rgb(242, 90, 103)"}},setTheme(){const t=document.querySelector(":root"),{themeZIndex:e}=Ve.state;if(t){const r={"--w3m-color-fg-accent":ue.color().foreground.accent,"--w3m-color-fg-inverse":ue.color().foreground.inverse,"--w3m-color-fg-1":ue.color().foreground[1],"--w3m-color-fg-2":ue.color().foreground[2],"--w3m-color-fg-3":ue.color().foreground[3],"--w3m-color-bg-1":ue.color().background[1],"--w3m-color-bg-2":ue.color().background[2],"--w3m-color-bg-3":ue.color().background[3],"--w3m-color-overlay":ue.color().overlay,"--w3m-color-err":ue.color().error,"--w3m-color-success":cd().green.light.foreground,"--w3m-gradient-1":ue.color().gradient[1],"--w3m-gradient-2":ue.color().gradient[2],"--w3m-gradient-3":ue.color().gradient[3],"--w3m-gradient-4":ue.color().gradient[4],"--w3m-modal-z-index":`${e}`};Object.entries(r).forEach(([n,i])=>t.style.setProperty(n,i))}},globalCss:_e`*,::after,::before{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;backface-visibility:hidden}button{cursor:pointer;display:flex;justify-content:center;align-items:center;position:relative;border:none;background-color:transparent}button::after{content:'';position:absolute;inset:0;transition:background-color,.2s ease}button:disabled{cursor:not-allowed}button svg,button w3m-text{position:relative;z-index:1}input{border:none;outline:0;appearance:none}img{display:block}::selection{color:var(--w3m-color-fg-inverse);background:var(--w3m-color-fg-accent)}`},k6=_e`button{display:flex;border-radius:10px;flex-direction:column;transition:background-color .2s ease;justify-content:center;padding:5px;width:100px}button:hover{background-color:var(--w3m-color-overlay)}button>div{display:flex;justify-content:center;align-items:center;width:32px;height:32px;box-shadow:inset 0 0 0 1px var(--w3m-color-overlay);background-color:var(--w3m-color-fg-accent);border-radius:50%;margin-bottom:4px}button path{fill:var(--w3m-color-fg-inverse)}`;var H6=Object.defineProperty,z6=Object.getOwnPropertyDescriptor,Us=(t,e,r,n)=>{for(var i=n>1?void 0:n?z6(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&H6(e,r,i),i};let $n=class extends de{constructor(){super(...arguments),this.icon=void 0,this.label="",this.onClick=()=>null}render(){return V`<button @click="${this.onClick}"><div>${this.icon}</div><w3m-text variant="xsmall-normal" color="accent">${this.label}</w3m-text></button>`}};$n.styles=[ue.globalCss,k6],Us([be()],$n.prototype,"icon",2),Us([be()],$n.prototype,"label",2),Us([be()],$n.prototype,"onClick",2),$n=Us([we("w3m-box-button")],$n);const W6=_e`button{border-radius:28px;height:28px;padding:0 10px;background-color:var(--w3m-color-fg-accent)}button path{fill:var(--w3m-color-fg-inverse)}button::after{border-radius:inherit;border:1px solid var(--w3m-color-overlay)}button:disabled::after{background-color:transparent}.w3m-icon-left svg{margin-right:5px}.w3m-icon-right svg{margin-left:5px}button:hover::after{background-color:var(--w3m-color-overlay)}button:disabled{background-color:var(--w3m-color-bg-3)}`;var q6=Object.defineProperty,V6=Object.getOwnPropertyDescriptor,xi=(t,e,r,n)=>{for(var i=n>1?void 0:n?V6(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&q6(e,r,i),i};let qr=class extends de{constructor(){super(...arguments),this.disabled=!1,this.iconLeft=void 0,this.iconRight=void 0,this.onClick=()=>null}render(){const t={"w3m-icon-left":this.iconLeft!==void 0,"w3m-icon-right":this.iconRight!==void 0};return V`<button class="${Mt(t)}" ?disabled="${this.disabled}" @click="${this.onClick}">${this.iconLeft}<w3m-text variant="small-normal" color="inverse"><slot></slot></w3m-text>${this.iconRight}</button>`}};qr.styles=[ue.globalCss,W6],xi([be()],qr.prototype,"disabled",2),xi([be()],qr.prototype,"iconLeft",2),xi([be()],qr.prototype,"iconRight",2),xi([be()],qr.prototype,"onClick",2),qr=xi([we("w3m-button")],qr);const K6=_e`:host{display:inline-block}button{padding:0 15px 1px;height:40px;border-radius:10px;color:var(--w3m-color-fg-inverse);background-color:var(--w3m-color-fg-accent)}button::after{content:'';inset:0;position:absolute;background-color:transparent;border-radius:inherit;transition:background-color .2s ease;border:1px solid var(--w3m-color-overlay)}button:hover::after{background-color:var(--w3m-color-overlay)}button:disabled{padding-bottom:0;background-color:var(--w3m-color-bg-3);color:var(--w3m-color-fg-3)}.w3m-secondary{color:var(--w3m-color-fg-accent);background-color:transparent}.w3m-secondary::after{display:none}`;var G6=Object.defineProperty,Y6=Object.getOwnPropertyDescriptor,ac=(t,e,r,n)=>{for(var i=n>1?void 0:n?Y6(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&G6(e,r,i),i};let Ci=class extends de{constructor(){super(...arguments),this.disabled=!1,this.variant="primary"}render(){const t={"w3m-secondary":this.variant==="secondary"};return V`<button ?disabled="${this.disabled}" class="${Mt(t)}"><slot></slot></button>`}};Ci.styles=[ue.globalCss,K6],ac([be()],Ci.prototype,"disabled",2),ac([be()],Ci.prototype,"variant",2),Ci=ac([we("w3m-button-big")],Ci);let Z6=class{constructor(...t){this.angle=0,this.t=1253106,this.last=0,this.height=500,this.amp=300,this.seed=15,this.freqX=14e-5,this.freqY=29e-5,this.freqDelta=1e-5,this.activeColors=[1,1,1,1],this.isMetaKey=!1,this.playing=!1,ld(this,"resize",()=>{this.width=window.innerWidth,this.minigl.setSize(this.width,this.height),this.minigl.setOrthographicCamera(),this.xSegCount=Math.ceil(this.width*this.conf.density[0]),this.ySegCount=Math.ceil(this.height*this.conf.density[1]),this.mesh.geometry.setTopology(this.xSegCount,this.ySegCount),this.mesh.geometry.setSize(this.width,this.height),this.mesh.material.uniforms.u_shadow_power.value=this.width<550?5:6}),ld(this,"animate",e=>{if(this.playing){if(this.shouldSkipFrame(e)||(this.t+=Math.min(e-this.last,1e3/15),this.last=e,this.mesh.material.uniforms.u_time.value=this.t,this.minigl.render()),this.last!==0&&this.isStatic)return this.minigl.render();requestAnimationFrame(this.animate)}})}play(t){this.el=t,this.connect()}stop(){this.playing=!1}async connect(){this.shaderFiles={vertex:"varying vec3 v_color;void main(){float time=u_time*u_global.noiseSpeed;vec2 noiseCoord=resolution*uvNorm*u_global.noiseFreq;vec2 st=1.-uvNorm.xy;float tilt=resolution.y/2.0*uvNorm.y;float incline=resolution.x*uvNorm.x/2.0*u_vertDeform.incline;float offset=resolution.x/2.0*u_vertDeform.incline*mix(u_vertDeform.offsetBottom,u_vertDeform.offsetTop,uv.y);float noise=snoise(vec3(noiseCoord.x*u_vertDeform.noiseFreq.x+time*u_vertDeform.noiseFlow,noiseCoord.y*u_vertDeform.noiseFreq.y,time*u_vertDeform.noiseSpeed+u_vertDeform.noiseSeed))*u_vertDeform.noiseAmp;noise*=1.0-pow(abs(uvNorm.y),2.0);noise=max(0.0,noise);vec3 pos=vec3(position.x,position.y+tilt+incline+noise-offset,position.z);if(u_active_colors[0]==1.){v_color=u_baseColor;}for(int i=0;i<u_waveLayers_length;i++){if(u_active_colors[i+1]==1.){WaveLayers layer=u_waveLayers[i];float noise=smoothstep(layer.noiseFloor,layer.noiseCeil,snoise(vec3(noiseCoord.x*layer.noiseFreq.x+time*layer.noiseFlow,noiseCoord.y*layer.noiseFreq.y,time*layer.noiseSpeed+layer.noiseSeed))/2.0+0.5);v_color=blendNormal(v_color,layer.color,pow(noise,4.));}}gl_Position=projectionMatrix*modelViewMatrix*vec4(pos,1.0);}",noise:`
166
127
  // MIT License: Copyright (C) 2011 Ashima Arts. All rights reserved. https://github.com/ashima/webgl-noise, https://github.com/stegu/webgl-noise
167
128
  vec3 mod289(vec3 x){return x-floor(x*(1.0/289.0))*289.0;}vec4 mod289(vec4 x){return x-floor(x*(1.0/289.0))*289.0;}vec4 permute(vec4 x){return mod289(((x*34.0)+1.0)*x);}vec4 taylorInvSqrt(vec4 r){return 1.79284291400159-0.85373472095314*r;}float snoise(vec3 v){const vec2 C=vec2(1.0/6.0,1.0/3.0);const vec4 D=vec4(0.0,0.5,1.0,2.0);vec3 i=floor(v+dot(v,C.yyy));vec3 x0=v-i+dot(i,C.xxx);vec3 g=step(x0.yzx,x0.xyz);vec3 l=1.0-g;vec3 i1=min(g.xyz,l.zxy);vec3 i2=max(g.xyz,l.zxy);vec3 x1=x0-i1+C.xxx;vec3 x2=x0-i2+C.yyy;vec3 x3=x0-D.yyy;i=mod289(i);vec4 p=permute(permute(permute(i.z+vec4(0.0,i1.z,i2.z,1.0))+i.y+vec4(0.0,i1.y,i2.y,1.0))+i.x+vec4(0.0,i1.x,i2.x,1.0));float n_=0.142857142857;vec3 ns=n_*D.wyz-D.xzx;vec4 j=p-49.0*floor(p*ns.z*ns.z);vec4 x_=floor(j*ns.z);vec4 y_=floor(j-7.0*x_);vec4 x=x_*ns.x+ns.yyyy;vec4 y=y_*ns.x+ns.yyyy;vec4 h=1.0-abs(x)-abs(y);vec4 b0=vec4(x.xy,y.xy);vec4 b1=vec4(x.zw,y.zw);vec4 s0=floor(b0)*2.0+1.0;vec4 s1=floor(b1)*2.0+1.0;vec4 sh=-step(h,vec4(0.0));vec4 a0=b0.xzyw+s0.xzyw*sh.xxyy;vec4 a1=b1.xzyw+s1.xzyw*sh.zzww;vec3 p0=vec3(a0.xy,h.x);vec3 p1=vec3(a0.zw,h.y);vec3 p2=vec3(a1.xy,h.z);vec3 p3=vec3(a1.zw,h.w);vec4 norm=taylorInvSqrt(vec4(dot(p0,p0),dot(p1,p1),dot(p2,p2),dot(p3,p3)));p0*=norm.x;p1*=norm.y;p2*=norm.z;p3*=norm.w;vec4 m=max(0.6-vec4(dot(x0,x0),dot(x1,x1),dot(x2,x2),dot(x3,x3)),0.0);m=m*m;return 42.0*dot(m*m,vec4(dot(p0,x0),dot(p1,x1),dot(p2,x2),dot(p3,x3)));}`,blend:`
168
129
  // MIT Licence: Copyright (C) 2015 Jamie Owen. All rights reserved. https://github.com/jamieowen/glsl-blend
169
- vec3 blendNormal(vec3 base, vec3 blend){return blend;}vec3 blendNormal(vec3 base,vec3 blend,float opacity){return (blendNormal(base,blend)*opacity+base*(1.0-opacity));}float blendScreen(float base,float blend){return 1.0-((1.0-base)*(1.0-blend));}vec3 blendScreen(vec3 base,vec3 blend){return vec3(blendScreen(base.r,blend.r),blendScreen(base.g,blend.g),blendScreen(base.b,blend.b));}vec3 blendScreen(vec3 base,vec3 blend,float opacity){return (blendScreen(base, blend)*opacity+base*(1.0-opacity));}vec3 blendMultiply(vec3 base,vec3 blend){return base*blend;}vec3 blendMultiply(vec3 base,vec3 blend,float opacity){return (blendMultiply(base,blend)*opacity+base*(1.0-opacity));}float blendOverlay(float base,float blend){return base<0.5?(2.0*base*blend):(1.0-2.0*(1.0-base)*(1.0-blend));}vec3 blendOverlay(vec3 base,vec3 blend){return vec3(blendOverlay(base.r,blend.r),blendOverlay(base.g,blend.g),blendOverlay(base.b,blend.b));}vec3 blendOverlay(vec3 base,vec3 blend,float opacity){return (blendOverlay(base,blend)*opacity+base*(1.0-opacity));}vec3 blendHardLight(vec3 base,vec3 blend){return blendOverlay(blend,base);}vec3 blendHardLight(vec3 base,vec3 blend,float opacity){return (blendHardLight(base,blend)*opacity+base*(1.0-opacity));}float blendSoftLight(float base,float blend){return (blend<0.5)?(2.0*base*blend+base*base*(1.0-2.0*blend)):(sqrt(base)*(2.0*blend-1.0)+2.0*base*(1.0-blend));}vec3 blendSoftLight(vec3 base,vec3 blend){return vec3(blendSoftLight(base.r,blend.r),blendSoftLight(base.g,blend.g),blendSoftLight(base.b,blend.b));}vec3 blendSoftLight(vec3 base,vec3 blend,float opacity){return (blendSoftLight(base,blend)*opacity+base*(1.0-opacity));}float blendColorDodge(float base,float blend){return (blend==1.0)?blend:min(base/(1.0-blend),1.0);}vec3 blendColorDodge(vec3 base,vec3 blend){return vec3(blendColorDodge(base.r,blend.r),blendColorDodge(base.g,blend.g),blendColorDodge(base.b,blend.b));}vec3 blendColorDodge(vec3 base,vec3 blend,float opacity){return (blendColorDodge(base, blend)*opacity+base*(1.0-opacity));}float blendColorBurn(float base,float blend){return (blend==0.0)?blend:max((1.0-((1.0-base)/blend)),0.0);}vec3 blendColorBurn(vec3 base,vec3 blend){return vec3(blendColorBurn(base.r,blend.r),blendColorBurn(base.g,blend.g),blendColorBurn(base.b,blend.b));}vec3 blendColorBurn(vec3 base,vec3 blend,float opacity){return (blendColorBurn(base, blend)*opacity+base*(1.0-opacity));}float blendVividLight(float base,float blend){return (blend<0.5)?blendColorBurn(base,(2.0*blend)):blendColorDodge(base,(2.0*(blend-0.5)));}vec3 blendVividLight(vec3 base,vec3 blend){return vec3(blendVividLight(base.r,blend.r),blendVividLight(base.g,blend.g),blendVividLight(base.b,blend.b));}vec3 blendVividLight(vec3 base,vec3 blend,float opacity){return (blendVividLight(base,blend)*opacity+base*(1.0-opacity));}float blendLighten(float base,float blend){return max(blend,base);}vec3 blendLighten(vec3 base,vec3 blend){return vec3(blendLighten(base.r,blend.r),blendLighten(base.g,blend.g),blendLighten(base.b,blend.b));}vec3 blendLighten(vec3 base,vec3 blend,float opacity){return (blendLighten(base,blend)*opacity+base*(1.0-opacity));}float blendLinearBurn(float base,float blend){return max(base+blend-1.0,0.0);}vec3 blendLinearBurn(vec3 base,vec3 blend){return max(base+blend-vec3(1.0),vec3(0.0));}vec3 blendLinearBurn(vec3 base,vec3 blend,float opacity){return (blendLinearBurn(base, blend)*opacity+base*(1.0-opacity));}float blendLinearDodge(float base,float blend){return min(base+blend,1.0);}vec3 blendLinearDodge(vec3 base,vec3 blend){return min(base+blend,vec3(1.0));}vec3 blendLinearDodge(vec3 base,vec3 blend,float opacity){return (blendLinearDodge(base,blend)*opacity+base*(1.0-opacity));}float blendLinearLight(float base,float blend){return blend<0.5?blendLinearBurn(base,(2.0*blend)):blendLinearDodge(base,(2.0*(blend-0.5)));}vec3 blendLinearLight(vec3 base,vec3 blend){return vec3(blendLinearLight(base.r,blend.r),blendLinearLight(base.g,blend.g),blendLinearLight(base.b,blend.b));}vec3 blendLinearLight(vec3 base,vec3 blend,float opacity){return (blendLinearLight(base,blend)*opacity+base*(1.0-opacity));}`,fragment:"varying vec3 v_color;void main(){vec3 color=v_color;if(u_darken_top==1.0){vec2 st=gl_FragCoord.xy/resolution.xy;color.g-=pow(st.y+sin(-12.0)*st.x,u_shadow_power)*0.4;}gl_FragColor=vec4(color,1.0);}"},this.conf={density:[.06,.16]},this.minigl=new KC(this.el,null,null,!0),requestAnimationFrame(()=>{this.el&&(this.computedCanvasStyle=getComputedStyle(this.el),this.waitForCssVars())})}initMaterial(){this.uniforms={u_time:new this.minigl.Uniform({value:0}),u_shadow_power:new this.minigl.Uniform({value:5}),u_darken_top:new this.minigl.Uniform({value:this.el.dataset.jsDarkenTop===""?1:0}),u_active_colors:new this.minigl.Uniform({value:this.activeColors,type:"vec4"}),u_global:new this.minigl.Uniform({value:{noiseFreq:new this.minigl.Uniform({value:[this.freqX,this.freqY],type:"vec2"}),noiseSpeed:new this.minigl.Uniform({value:5e-6})},type:"struct"}),u_vertDeform:new this.minigl.Uniform({value:{incline:new this.minigl.Uniform({value:Math.sin(this.angle)/Math.cos(this.angle)}),offsetTop:new this.minigl.Uniform({value:-.5}),offsetBottom:new this.minigl.Uniform({value:-.5}),noiseFreq:new this.minigl.Uniform({value:[3,4],type:"vec2"}),noiseAmp:new this.minigl.Uniform({value:this.amp}),noiseSpeed:new this.minigl.Uniform({value:10}),noiseFlow:new this.minigl.Uniform({value:3}),noiseSeed:new this.minigl.Uniform({value:this.seed})},type:"struct",excludeFrom:"fragment"}),u_baseColor:new this.minigl.Uniform({value:this.sectionColors[0],type:"vec3",excludeFrom:"fragment"}),u_waveLayers:new this.minigl.Uniform({value:[],excludeFrom:"fragment",type:"array"})};for(let t=1;t<this.sectionColors.length;t+=1)this.uniforms.u_waveLayers.value.push(new this.minigl.Uniform({value:{color:new this.minigl.Uniform({value:this.sectionColors[t],type:"vec3"}),noiseFreq:new this.minigl.Uniform({value:[2+t/this.sectionColors.length,3+t/this.sectionColors.length],type:"vec2"}),noiseSpeed:new this.minigl.Uniform({value:11+.3*t}),noiseFlow:new this.minigl.Uniform({value:6.5+.3*t}),noiseSeed:new this.minigl.Uniform({value:this.seed+10*t}),noiseFloor:new this.minigl.Uniform({value:.1}),noiseCeil:new this.minigl.Uniform({value:.63+.07*t})},type:"struct"}));return this.vertexShader=[this.shaderFiles.noise,this.shaderFiles.blend,this.shaderFiles.vertex].join(""),new this.minigl.Material(this.vertexShader,this.shaderFiles.fragment,this.uniforms)}initMesh(){this.material=this.initMaterial(),this.geometry=new this.minigl.PlaneGeometry,this.mesh=new this.minigl.Mesh(this.geometry,this.material)}shouldSkipFrame(t){return!!window.document.hidden||parseInt(t,10)%2==0||void 0}updateFrequency(t){this.freqX+=t,this.freqY+=t}toggleColor(t){this.activeColors[t]=this.activeColors[t]===0?1:0}init(){this.playing=!0,this.initGradientColors(),this.initMesh(),this.resize(),requestAnimationFrame(this.animate)}waitForCssVars(){this.computedCanvasStyle&&this.computedCanvasStyle.getPropertyValue("--w3m-gradient-1").indexOf("#")!==-1?this.init():this.init()}initGradientColors(){this.sectionColors=["--w3m-gradient-1","--w3m-gradient-2","--w3m-gradient-3","--w3m-gradient-4"].map(t=>{let e=this.computedCanvasStyle.getPropertyValue(t).trim();return e.length===4&&(e=`#${e.substr(1).split("").map(r=>r+r).join("")}`),e&&`0x${e.substr(1)}`}).filter(Boolean).map(qC)}};function qC(t){return[(t>>16&255)/255,(t>>8&255)/255,(255&t)/255]}function Ap(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}let KC=class{constructor(t,e,r){const n=this;n.canvas=t,n.gl=n.canvas.getContext("webgl",{antialias:!0}),n.meshes=[];const i=n.gl;e&&r&&this.setSize(e,r),Object.defineProperties(n,{Material:{enumerable:!1,value:class{constructor(s,a,l={}){const u=this;function d(v,_){const R=i.createShader(v);return i.shaderSource(R,_),i.compileShader(R),i.getShaderParameter(R,i.COMPILE_STATUS)||console.error(i.getShaderInfoLog(R)),R}function y(v,_){return Object.entries(v).map(([R,M])=>M.getDeclaration(R,_)).join("")}u.uniforms=l,u.uniformInstances=[];const m="precision highp float;";u.vertexSource=`${m} attribute vec4 position;attribute vec2 uv;attribute vec2 uvNorm;${y(n.commonUniforms,"vertex")} ${y(l,"vertex")} ${s}`,u.Source=`${m} ${y(n.commonUniforms,"fragment")} ${y(l,"fragment")} ${a} `,u.vertexShader=d(i.VERTEX_SHADER,u.vertexSource),u.fragmentShader=d(i.FRAGMENT_SHADER,u.Source),u.program=i.createProgram(),i.attachShader(u.program,u.vertexShader),i.attachShader(u.program,u.fragmentShader),i.linkProgram(u.program),i.getProgramParameter(u.program,i.LINK_STATUS)||console.error(i.getProgramInfoLog(u.program)),i.useProgram(u.program),u.attachUniforms(void 0,n.commonUniforms),u.attachUniforms(void 0,u.uniforms)}attachUniforms(s,a){const l=this;s===void 0?Object.entries(a).forEach(([u,d])=>{l.attachUniforms(u,d)}):a.type=="array"?a.value.forEach((u,d)=>l.attachUniforms(`${s}[${d}]`,u)):a.type=="struct"?Object.entries(a.value).forEach(([u,d])=>l.attachUniforms(`${s}.${u}`,d)):l.uniformInstances.push({uniform:a,location:i.getUniformLocation(l.program,s)})}}},Uniform:{enumerable:!1,value:class{constructor(s){this.type="float",Object.assign(this,s),this.typeFn={float:"1f",int:"1i",vec2:"2fv",vec3:"3fv",vec4:"4fv",mat4:"Matrix4fv"}[this.type]||"1f",this.update()}update(s){this.value!==void 0&&i[`uniform${this.typeFn}`](s,this.typeFn.indexOf("Matrix")===0?this.transpose:this.value,this.typeFn.indexOf("Matrix")===0?this.value:null)}getDeclaration(s,a,l){const u=this;if(u.excludeFrom!==a){if(u.type==="array")return u.value[0].getDeclaration(s,a,u.value.length)+`const int ${s}_length=${u.value.length};`;if(u.type==="struct"){let d=s.replace("u_","");return d=d.charAt(0).toUpperCase()+d.slice(1),`uniform struct ${d} {`+Object.entries(u.value).map(([y,m])=>m.getDeclaration(y,a).replace(/^uniform/,"")).join("")+`} ${s}${l>0?`[${l}]`:""};`}return`uniform ${u.type} ${s}${l>0?`[${l}]`:""};`}}}},PlaneGeometry:{enumerable:!1,value:class{constructor(s,a,l,u,d){i.createBuffer(),this.attributes={position:new n.Attribute({target:i.ARRAY_BUFFER,size:3}),uv:new n.Attribute({target:i.ARRAY_BUFFER,size:2}),uvNorm:new n.Attribute({target:i.ARRAY_BUFFER,size:2}),index:new n.Attribute({target:i.ELEMENT_ARRAY_BUFFER,size:3,type:i.UNSIGNED_SHORT})},this.setTopology(l,u),this.setSize(s,a,d)}setTopology(s=1,a=1){const l=this;l.xSegCount=s,l.ySegCount=a,l.vertexCount=(l.xSegCount+1)*(l.ySegCount+1),l.quadCount=l.xSegCount*l.ySegCount*2,l.attributes.uv.values=new Float32Array(2*l.vertexCount),l.attributes.uvNorm.values=new Float32Array(2*l.vertexCount),l.attributes.index.values=new Uint16Array(3*l.quadCount);for(let u=0;u<=l.ySegCount;u++)for(let d=0;d<=l.xSegCount;d++){const y=u*(l.xSegCount+1)+d;if(l.attributes.uv.values[2*y]=d/l.xSegCount,l.attributes.uv.values[2*y+1]=1-u/l.ySegCount,l.attributes.uvNorm.values[2*y]=d/l.xSegCount*2-1,l.attributes.uvNorm.values[2*y+1]=1-u/l.ySegCount*2,d<l.xSegCount&&u<l.ySegCount){const m=u*l.xSegCount+d;l.attributes.index.values[6*m]=y,l.attributes.index.values[6*m+1]=y+1+l.xSegCount,l.attributes.index.values[6*m+2]=y+1,l.attributes.index.values[6*m+3]=y+1,l.attributes.index.values[6*m+4]=y+1+l.xSegCount,l.attributes.index.values[6*m+5]=y+2+l.xSegCount}}l.attributes.uv.update(),l.attributes.uvNorm.update(),l.attributes.index.update()}setSize(s=1,a=1,l="xz"){const u=this;u.width=s,u.height=a,u.orientation=l,u.attributes.position.values&&u.attributes.position.values.length===3*u.vertexCount||(u.attributes.position.values=new Float32Array(3*u.vertexCount));const d=s/-2,y=a/-2,m=s/u.xSegCount,v=a/u.ySegCount;for(let _=0;_<=u.ySegCount;_++){const R=y+_*v;for(let M=0;M<=u.xSegCount;M++){const B=d+M*m,D=_*(u.xSegCount+1)+M;u.attributes.position.values[3*D+"xyz".indexOf(l[0])]=B,u.attributes.position.values[3*D+"xyz".indexOf(l[1])]=-R}}u.attributes.position.update()}}},Mesh:{enumerable:!1,value:class{constructor(s,a){const l=this;l.geometry=s,l.material=a,l.attributeInstances=[],Object.entries(l.geometry.attributes).forEach(([u,d])=>{l.attributeInstances.push({attribute:d,location:d.attach(u,l.material.program)})}),n.meshes.push(l)}draw(){i.useProgram(this.material.program),this.material.uniformInstances.forEach(({uniform:s,location:a})=>s.update(a)),this.attributeInstances.forEach(({attribute:s,location:a})=>s.use(a)),i.drawElements(i.TRIANGLES,this.geometry.attributes.index.values.length,i.UNSIGNED_SHORT,0)}remove(){n.meshes=n.meshes.filter(s=>s!=this)}}},Attribute:{enumerable:!1,value:class{constructor(s){this.type=i.FLOAT,this.normalized=!1,this.buffer=i.createBuffer(),Object.assign(this,s),this.update()}update(){this.values!==void 0&&(i.bindBuffer(this.target,this.buffer),i.bufferData(this.target,this.values,i.STATIC_DRAW))}attach(s,a){const l=i.getAttribLocation(a,s);return this.target===i.ARRAY_BUFFER&&(i.enableVertexAttribArray(l),i.vertexAttribPointer(l,this.size,this.type,this.normalized,0,0)),l}use(s){i.bindBuffer(this.target,this.buffer),this.target===i.ARRAY_BUFFER&&(i.enableVertexAttribArray(s),i.vertexAttribPointer(s,this.size,this.type,this.normalized,0,0))}}}});const o=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];n.commonUniforms={projectionMatrix:new n.Uniform({type:"mat4",value:o}),modelViewMatrix:new n.Uniform({type:"mat4",value:o}),resolution:new n.Uniform({type:"vec2",value:[1,1]}),aspectRatio:new n.Uniform({type:"float",value:1})}}setSize(t=640,e=480){this.width=t,this.height=e,this.canvas.width=t,this.canvas.height=e,this.gl.viewport(0,0,t,e),this.commonUniforms.resolution.value=[t,e],this.commonUniforms.aspectRatio.value=t/e}setOrthographicCamera(t=0,e=0,r=0,n=-2e3,i=2e3){this.commonUniforms.projectionMatrix.value=[2/this.width,0,0,0,0,2/this.height,0,0,0,0,2/(n-i),0,t,e,r,1]}render(){this.gl.clearColor(0,0,0,0),this.gl.clearDepth(1),this.meshes.forEach(t=>t.draw())}};const Me={CROSS_ICON:Je`<svg width="12" height="12" viewBox="0 0 12 12"><path d="M9.94 11A.75.75 0 1 0 11 9.94L7.414 6.353a.5.5 0 0 1 0-.708L11 2.061A.75.75 0 1 0 9.94 1L6.353 4.586a.5.5 0 0 1-.708 0L2.061 1A.75.75 0 0 0 1 2.06l3.586 3.586a.5.5 0 0 1 0 .708L1 9.939A.75.75 0 1 0 2.06 11l3.586-3.586a.5.5 0 0 1 .708 0L9.939 11Z" fill="#fff"/></svg>`,NOISE_TEXTURE:Je`<svg id="w3m-transparent-noise"><filter id="w3m-noise"><feTurbulence type="fractalNoise" baseFrequency="0.8"/></filter><rect width="100%" height="100%" filter="url(#w3m-noise)"/></svg>`,WALLET_CONNECT_LOGO:Je`<svg width="178" height="29" viewBox="0 0 178 29" id="w3m-wc-logo"><path d="M10.683 7.926c5.284-5.17 13.85-5.17 19.134 0l.636.623a.652.652 0 0 1 0 .936l-2.176 2.129a.343.343 0 0 1-.478 0l-.875-.857c-3.686-3.607-9.662-3.607-13.348 0l-.937.918a.343.343 0 0 1-.479 0l-2.175-2.13a.652.652 0 0 1 0-.936l.698-.683Zm23.633 4.403 1.935 1.895a.652.652 0 0 1 0 .936l-8.73 8.543a.687.687 0 0 1-.956 0L20.37 17.64a.172.172 0 0 0-.239 0l-6.195 6.063a.687.687 0 0 1-.957 0l-8.73-8.543a.652.652 0 0 1 0-.936l1.936-1.895a.687.687 0 0 1 .957 0l6.196 6.064a.172.172 0 0 0 .239 0l6.195-6.064a.687.687 0 0 1 .957 0l6.196 6.064a.172.172 0 0 0 .24 0l6.195-6.064a.687.687 0 0 1 .956 0ZM48.093 20.948l2.338-9.355c.139-.515.258-1.07.416-1.942.12.872.258 1.427.357 1.942l2.022 9.355h4.181l3.528-13.874h-3.21l-1.943 8.523a24.825 24.825 0 0 0-.456 2.457c-.158-.931-.317-1.625-.495-2.438l-1.883-8.542h-4.201l-2.042 8.542a41.204 41.204 0 0 0-.475 2.438 41.208 41.208 0 0 0-.476-2.438l-1.903-8.542h-3.349l3.508 13.874h4.083ZM63.33 21.304c1.585 0 2.596-.654 3.11-1.605-.059.297-.078.595-.078.892v.357h2.655V15.22c0-2.735-1.248-4.32-4.3-4.32-2.636 0-4.36 1.466-4.52 3.487h2.914c.1-.891.734-1.426 1.705-1.426.911 0 1.407.515 1.407 1.11 0 .435-.258.693-1.03.792l-1.388.159c-2.061.257-3.825 1.01-3.825 3.19 0 1.982 1.645 3.092 3.35 3.092Zm.891-2.041c-.773 0-1.348-.436-1.348-1.19 0-.733.655-1.09 1.645-1.268l.674-.119c.575-.118.892-.218 1.09-.396v.912c0 1.228-.892 2.06-2.06 2.06ZM70.398 7.074v13.874h2.874V7.074h-2.874ZM74.934 7.074v13.874h2.874V7.074h-2.874ZM84.08 21.304c2.735 0 4.5-1.546 4.697-3.567h-2.893c-.139.892-.892 1.387-1.804 1.387-1.228 0-2.12-.99-2.14-2.358h6.897v-.555c0-3.21-1.764-5.312-4.816-5.312-2.933 0-4.994 2.062-4.994 5.173 0 3.37 2.12 5.232 5.053 5.232Zm-2.16-6.421c.119-1.11.932-1.922 2.081-1.922 1.11 0 1.883.772 1.903 1.922H81.92ZM94.92 21.146c.633 0 1.248-.1 1.525-.179v-2.18c-.218.04-.475.06-.693.06-1.05 0-1.427-.595-1.427-1.566v-3.805h2.338v-2.24h-2.338V7.788H91.47v3.448H89.37v2.24h2.1v4.201c0 2.3 1.15 3.469 3.45 3.469ZM104.62 21.304c3.924 0 6.302-2.299 6.599-5.608h-3.111c-.238 1.803-1.506 3.032-3.369 3.032-2.2 0-3.746-1.784-3.746-4.796 0-2.953 1.605-4.638 3.805-4.638 1.883 0 2.953 1.15 3.171 2.834h3.191c-.317-3.448-2.854-5.41-6.342-5.41-3.984 0-7.036 2.695-7.036 7.214 0 4.677 2.676 7.372 6.838 7.372ZM117.449 21.304c2.993 0 5.114-1.882 5.114-5.172 0-3.23-2.121-5.233-5.114-5.233-2.972 0-5.093 2.002-5.093 5.233 0 3.29 2.101 5.172 5.093 5.172Zm0-2.22c-1.327 0-2.18-1.09-2.18-2.952 0-1.903.892-2.973 2.18-2.973 1.308 0 2.2 1.07 2.2 2.973 0 1.862-.872 2.953-2.2 2.953ZM126.569 20.948v-5.689c0-1.208.753-2.1 1.823-2.1 1.011 0 1.606.773 1.606 2.06v5.729h2.873v-6.144c0-2.339-1.229-3.905-3.428-3.905-1.526 0-2.458.734-2.953 1.606a5.31 5.31 0 0 0 .079-.892v-.377h-2.874v9.712h2.874ZM137.464 20.948v-5.689c0-1.208.753-2.1 1.823-2.1 1.011 0 1.606.773 1.606 2.06v5.729h2.873v-6.144c0-2.339-1.228-3.905-3.428-3.905-1.526 0-2.458.734-2.953 1.606a5.31 5.31 0 0 0 .079-.892v-.377h-2.874v9.712h2.874ZM149.949 21.304c2.735 0 4.499-1.546 4.697-3.567h-2.893c-.139.892-.892 1.387-1.804 1.387-1.228 0-2.12-.99-2.14-2.358h6.897v-.555c0-3.21-1.764-5.312-4.816-5.312-2.933 0-4.994 2.062-4.994 5.173 0 3.37 2.12 5.232 5.053 5.232Zm-2.16-6.421c.119-1.11.932-1.922 2.081-1.922 1.11 0 1.883.772 1.903 1.922h-3.984ZM160.876 21.304c3.013 0 4.658-1.645 4.975-4.201h-2.874c-.099 1.07-.713 1.982-2.001 1.982-1.309 0-2.2-1.21-2.2-2.993 0-1.942 1.03-2.933 2.259-2.933 1.209 0 1.803.872 1.883 1.882h2.873c-.218-2.358-1.823-4.142-4.776-4.142-2.874 0-5.153 1.903-5.153 5.193 0 3.25 1.923 5.212 5.014 5.212ZM172.067 21.146c.634 0 1.248-.1 1.526-.179v-2.18c-.218.04-.476.06-.694.06-1.05 0-1.427-.595-1.427-1.566v-3.805h2.339v-2.24h-2.339V7.788h-2.854v3.448h-2.1v2.24h2.1v4.201c0 2.3 1.15 3.469 3.449 3.469Z" fill="#fff"/></svg>`,WALLET_CONNECT_ICON:Je`<svg width="28" height="20" viewBox="0 0 28 20"><g clip-path="url(#a)"><path d="M7.386 6.482c3.653-3.576 9.575-3.576 13.228 0l.44.43a.451.451 0 0 1 0 .648L19.55 9.033a.237.237 0 0 1-.33 0l-.606-.592c-2.548-2.496-6.68-2.496-9.228 0l-.648.634a.237.237 0 0 1-.33 0L6.902 7.602a.451.451 0 0 1 0-.647l.483-.473Zm16.338 3.046 1.339 1.31a.451.451 0 0 1 0 .648l-6.035 5.909a.475.475 0 0 1-.662 0L14.083 13.2a.119.119 0 0 0-.166 0l-4.283 4.194a.475.475 0 0 1-.662 0l-6.035-5.91a.451.451 0 0 1 0-.647l1.338-1.31a.475.475 0 0 1 .662 0l4.283 4.194c.046.044.12.044.166 0l4.283-4.194a.475.475 0 0 1 .662 0l4.283 4.194c.046.044.12.044.166 0l4.283-4.194a.475.475 0 0 1 .662 0Z" fill="#000000"/></g><defs><clipPath id="a"><path fill="#ffffff" d="M0 0h28v20H0z"/></clipPath></defs></svg>`,WALLET_CONNECT_ICON_COLORED:Je`<svg width="96" height="96" fill="none"><path fill="#fff" d="M25.322 33.597c12.525-12.263 32.83-12.263 45.355 0l1.507 1.476a1.547 1.547 0 0 1 0 2.22l-5.156 5.048a.814.814 0 0 1-1.134 0l-2.074-2.03c-8.737-8.555-22.903-8.555-31.64 0l-2.222 2.175a.814.814 0 0 1-1.134 0l-5.156-5.049a1.547 1.547 0 0 1 0-2.22l1.654-1.62Zm56.019 10.44 4.589 4.494a1.547 1.547 0 0 1 0 2.22l-20.693 20.26a1.628 1.628 0 0 1-2.267 0L48.283 56.632a.407.407 0 0 0-.567 0L33.03 71.012a1.628 1.628 0 0 1-2.268 0L10.07 50.75a1.547 1.547 0 0 1 0-2.22l4.59-4.494a1.628 1.628 0 0 1 2.267 0l14.687 14.38c.156.153.41.153.567 0l14.685-14.38a1.628 1.628 0 0 1 2.268 0l14.687 14.38c.156.153.41.153.567 0l14.686-14.38a1.628 1.628 0 0 1 2.268 0Z"/><path stroke="#000" d="M25.672 33.954c12.33-12.072 32.325-12.072 44.655 0l1.508 1.476a1.047 1.047 0 0 1 0 1.506l-5.157 5.048a.314.314 0 0 1-.434 0l-2.074-2.03c-8.932-8.746-23.409-8.746-32.34 0l-2.222 2.174a.314.314 0 0 1-.434 0l-5.157-5.048a1.047 1.047 0 0 1 0-1.506l1.655-1.62Zm55.319 10.44 4.59 4.494a1.047 1.047 0 0 1 0 1.506l-20.694 20.26a1.128 1.128 0 0 1-1.568 0l-14.686-14.38a.907.907 0 0 0-1.267 0L32.68 70.655a1.128 1.128 0 0 1-1.568 0L10.42 50.394a1.047 1.047 0 0 1 0-1.506l4.59-4.493a1.128 1.128 0 0 1 1.567 0l14.687 14.379a.907.907 0 0 0 1.266 0l-.35-.357.35.357 14.686-14.38a1.128 1.128 0 0 1 1.568 0l14.687 14.38a.907.907 0 0 0 1.267 0l14.686-14.38a1.128 1.128 0 0 1 1.568 0Z"/></svg>`,BACK_ICON:Je`<svg width="10" height="18" viewBox="0 0 10 18"><path fill-rule="evenodd" clip-rule="evenodd" d="M8.735.179a.75.75 0 0 1 .087 1.057L2.92 8.192a1.25 1.25 0 0 0 0 1.617l5.902 6.956a.75.75 0 1 1-1.144.97L1.776 10.78a2.75 2.75 0 0 1 0-3.559L7.678.265A.75.75 0 0 1 8.735.18Z" fill="#fff"/></svg>`,COPY_ICON:Je`<svg width="24" height="24" fill="none"><path fill="#fff" fill-rule="evenodd" d="M7.01 7.01c.03-1.545.138-2.5.535-3.28A5 5 0 0 1 9.73 1.545C10.8 1 12.2 1 15 1c2.8 0 4.2 0 5.27.545a5 5 0 0 1 2.185 2.185C23 4.8 23 6.2 23 9c0 2.8 0 4.2-.545 5.27a5 5 0 0 1-2.185 2.185c-.78.397-1.735.505-3.28.534l-.001.01c-.03 1.54-.138 2.493-.534 3.27a5 5 0 0 1-2.185 2.186C13.2 23 11.8 23 9 23c-2.8 0-4.2 0-5.27-.545a5 5 0 0 1-2.185-2.185C1 19.2 1 17.8 1 15c0-2.8 0-4.2.545-5.27A5 5 0 0 1 3.73 7.545C4.508 7.149 5.46 7.04 7 7.01h.01ZM15 15.5c-1.425 0-2.403-.001-3.162-.063-.74-.06-1.139-.172-1.427-.319a3.5 3.5 0 0 1-1.53-1.529c-.146-.288-.257-.686-.318-1.427C8.501 11.403 8.5 10.425 8.5 9c0-1.425.001-2.403.063-3.162.06-.74.172-1.139.318-1.427a3.5 3.5 0 0 1 1.53-1.53c.288-.146.686-.257 1.427-.318.759-.062 1.737-.063 3.162-.063 1.425 0 2.403.001 3.162.063.74.06 1.139.172 1.427.318a3.5 3.5 0 0 1 1.53 1.53c.146.288.257.686.318 1.427.062.759.063 1.737.063 3.162 0 1.425-.001 2.403-.063 3.162-.06.74-.172 1.139-.319 1.427a3.5 3.5 0 0 1-1.529 1.53c-.288.146-.686.257-1.427.318-.759.062-1.737.063-3.162.063ZM7 8.511c-.444.009-.825.025-1.162.052-.74.06-1.139.172-1.427.318a3.5 3.5 0 0 0-1.53 1.53c-.146.288-.257.686-.318 1.427-.062.759-.063 1.737-.063 3.162 0 1.425.001 2.403.063 3.162.06.74.172 1.139.318 1.427a3.5 3.5 0 0 0 1.53 1.53c.288.146.686.257 1.427.318.759.062 1.737.063 3.162.063 1.425 0 2.403-.001 3.162-.063.74-.06 1.139-.172 1.427-.319a3.5 3.5 0 0 0 1.53-1.53c.146-.287.257-.685.318-1.426.027-.337.043-.718.052-1.162H15c-2.8 0-4.2 0-5.27-.545a5 5 0 0 1-2.185-2.185C7 13.2 7 11.8 7 9v-.489Z" clip-rule="evenodd"/></svg>`,RETRY_ICON:Je`<svg width="15" height="16" viewBox="0 0 15 16"><path d="M6.464 2.03A.75.75 0 0 0 5.403.97L2.08 4.293a1 1 0 0 0 0 1.414L5.403 9.03a.75.75 0 0 0 1.06-1.06L4.672 6.177a.25.25 0 0 1 .177-.427h2.085a4 4 0 1 1-3.93 4.746c-.077-.407-.405-.746-.82-.746-.414 0-.755.338-.7.748a5.501 5.501 0 1 0 5.45-6.248H4.848a.25.25 0 0 1-.177-.427L6.464 2.03Z" fill="#fff"/></svg>`,DESKTOP_ICON:Je`<svg width="16" height="16" viewBox="0 0 16 16"><path fill-rule="evenodd" clip-rule="evenodd" d="M0 5.98c0-1.85 0-2.775.394-3.466a3 3 0 0 1 1.12-1.12C2.204 1 3.13 1 4.98 1h6.04c1.85 0 2.775 0 3.466.394a3 3 0 0 1 1.12 1.12C16 3.204 16 4.13 16 5.98v1.04c0 1.85 0 2.775-.394 3.466a3 3 0 0 1-1.12 1.12C13.796 12 12.87 12 11.02 12H4.98c-1.85 0-2.775 0-3.466-.394a3 3 0 0 1-1.12-1.12C0 9.796 0 8.87 0 7.02V5.98ZM4.98 2.5h6.04c.953 0 1.568.001 2.034.043.446.04.608.108.69.154a1.5 1.5 0 0 1 .559.56c.046.08.114.243.154.69.042.465.043 1.08.043 2.033v1.04c0 .952-.001 1.568-.043 2.034-.04.446-.108.608-.154.69a1.499 1.499 0 0 1-.56.559c-.08.046-.243.114-.69.154-.466.042-1.08.043-2.033.043H4.98c-.952 0-1.568-.001-2.034-.043-.446-.04-.608-.108-.69-.154a1.5 1.5 0 0 1-.559-.56c-.046-.08-.114-.243-.154-.69-.042-.465-.043-1.08-.043-2.033V5.98c0-.952.001-1.568.043-2.034.04-.446.108-.608.154-.69a1.5 1.5 0 0 1 .56-.559c.08-.046.243-.114.69-.154.465-.042 1.08-.043 2.033-.043Z" fill="#fff"/><path d="M4 14.25a.75.75 0 0 1 .75-.75h6.5a.75.75 0 0 1 0 1.5h-6.5a.75.75 0 0 1-.75-.75Z" fill="#fff"/></svg>`,MOBILE_ICON:Je`<svg width="16" height="16" viewBox="0 0 16 16"><path d="M6.75 5a1.25 1.25 0 1 0 0-2.5 1.25 1.25 0 0 0 0 2.5Z" fill="#fff"/><path fill-rule="evenodd" clip-rule="evenodd" d="M3 4.98c0-1.85 0-2.775.394-3.466a3 3 0 0 1 1.12-1.12C5.204 0 6.136 0 8 0s2.795 0 3.486.394a3 3 0 0 1 1.12 1.12C13 2.204 13 3.13 13 4.98v6.04c0 1.85 0 2.775-.394 3.466a3 3 0 0 1-1.12 1.12C10.796 16 9.864 16 8 16s-2.795 0-3.486-.394a3 3 0 0 1-1.12-1.12C3 13.796 3 12.87 3 11.02V4.98Zm8.5 0v6.04c0 .953-.001 1.568-.043 2.034-.04.446-.108.608-.154.69a1.499 1.499 0 0 1-.56.559c-.08.045-.242.113-.693.154-.47.042-1.091.043-2.05.043-.959 0-1.58-.001-2.05-.043-.45-.04-.613-.109-.693-.154a1.5 1.5 0 0 1-.56-.56c-.046-.08-.114-.243-.154-.69-.042-.466-.043-1.08-.043-2.033V4.98c0-.952.001-1.568.043-2.034.04-.446.108-.608.154-.69a1.5 1.5 0 0 1 .56-.559c.08-.045.243-.113.693-.154C6.42 1.501 7.041 1.5 8 1.5c.959 0 1.58.001 2.05.043.45.04.613.109.693.154a1.5 1.5 0 0 1 .56.56c.046.08.114.243.154.69.042.465.043 1.08.043 2.033Z" fill="#fff"/></svg>`,ARROW_DOWN_ICON:Je`<svg width="14" height="14" viewBox="0 0 14 14"><path d="M2.28 7.47a.75.75 0 0 0-1.06 1.06l5.25 5.25a.75.75 0 0 0 1.06 0l5.25-5.25a.75.75 0 0 0-1.06-1.06l-3.544 3.543a.25.25 0 0 1-.426-.177V.75a.75.75 0 0 0-1.5 0v10.086a.25.25 0 0 1-.427.176L2.28 7.47Z" fill="#fff"/></svg>`,ARROW_UP_RIGHT_ICON:Je`<svg width="15" height="14" fill="none"><path d="M4.5 1.75A.75.75 0 0 1 5.25 1H12a1.5 1.5 0 0 1 1.5 1.5v6.75a.75.75 0 0 1-1.5 0V4.164a.25.25 0 0 0-.427-.176L4.061 11.5A.75.75 0 0 1 3 10.44l7.513-7.513a.25.25 0 0 0-.177-.427H5.25a.75.75 0 0 1-.75-.75Z" fill="#fff"/></svg>`,ARROW_RIGHT_ICON:Je`<svg width="6" height="14" viewBox="0 0 6 14"><path fill-rule="evenodd" clip-rule="evenodd" d="M2.181 1.099a.75.75 0 0 1 1.024.279l2.433 4.258a2.75 2.75 0 0 1 0 2.729l-2.433 4.257a.75.75 0 1 1-1.303-.744L4.335 7.62a1.25 1.25 0 0 0 0-1.24L1.902 2.122a.75.75 0 0 1 .28-1.023Z" fill="#fff"/></svg>`,QRCODE_ICON:Je`<svg width="25" height="24" viewBox="0 0 25 24"><path d="M23.748 9a.748.748 0 0 0 .748-.752c-.018-2.596-.128-4.07-.784-5.22a6 6 0 0 0-2.24-2.24c-1.15-.656-2.624-.766-5.22-.784a.748.748 0 0 0-.752.748c0 .414.335.749.748.752 1.015.007 1.82.028 2.494.088.995.09 1.561.256 1.988.5.7.398 1.28.978 1.679 1.678.243.427.41.993.498 1.988.061.675.082 1.479.09 2.493a.753.753 0 0 0 .75.749ZM3.527.788C4.677.132 6.152.022 8.747.004A.748.748 0 0 1 9.5.752a.753.753 0 0 1-.749.752c-1.014.007-1.818.028-2.493.088-.995.09-1.561.256-1.988.5-.7.398-1.28.978-1.679 1.678-.243.427-.41.993-.499 1.988-.06.675-.081 1.479-.088 2.493A.753.753 0 0 1 1.252 9a.748.748 0 0 1-.748-.752c.018-2.596.128-4.07.784-5.22a6 6 0 0 1 2.24-2.24ZM1.252 15a.748.748 0 0 0-.748.752c.018 2.596.128 4.07.784 5.22a6 6 0 0 0 2.24 2.24c1.15.656 2.624.766 5.22.784a.748.748 0 0 0 .752-.748.753.753 0 0 0-.749-.752c-1.014-.007-1.818-.028-2.493-.089-.995-.089-1.561-.255-1.988-.498a4.5 4.5 0 0 1-1.679-1.68c-.243-.426-.41-.992-.499-1.987-.06-.675-.081-1.479-.088-2.493A.753.753 0 0 0 1.252 15ZM22.996 15.749a.753.753 0 0 1 .752-.749c.415 0 .751.338.748.752-.018 2.596-.128 4.07-.784 5.22a6 6 0 0 1-2.24 2.24c-1.15.656-2.624.766-5.22.784a.748.748 0 0 1-.752-.748c0-.414.335-.749.748-.752 1.015-.007 1.82-.028 2.494-.089.995-.089 1.561-.255 1.988-.498a4.5 4.5 0 0 0 1.679-1.68c.243-.426.41-.992.498-1.987.061-.675.082-1.479.09-2.493Z" fill="#fff"/><path fill-rule="evenodd" clip-rule="evenodd" d="M7 4a2.5 2.5 0 0 0-2.5 2.5v2A2.5 2.5 0 0 0 7 11h2a2.5 2.5 0 0 0 2.5-2.5v-2A2.5 2.5 0 0 0 9 4H7Zm2 1.5H7a1 1 0 0 0-1 1v2a1 1 0 0 0 1 1h2a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1ZM13.5 6.5A2.5 2.5 0 0 1 16 4h2a2.5 2.5 0 0 1 2.5 2.5v2A2.5 2.5 0 0 1 18 11h-2a2.5 2.5 0 0 1-2.5-2.5v-2Zm2.5-1h2a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1h-2a1 1 0 0 1-1-1v-2a1 1 0 0 1 1-1ZM7 13a2.5 2.5 0 0 0-2.5 2.5v2A2.5 2.5 0 0 0 7 20h2a2.5 2.5 0 0 0 2.5-2.5v-2A2.5 2.5 0 0 0 9 13H7Zm2 1.5H7a1 1 0 0 0-1 1v2a1 1 0 0 0 1 1h2a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1Z" fill="#fff"/><path d="M13.5 15.5c0-.465 0-.697.038-.89a2 2 0 0 1 1.572-1.572C15.303 13 15.535 13 16 13v2.5h-2.5ZM18 13c.465 0 .697 0 .89.038a2 2 0 0 1 1.572 1.572c.038.193.038.425.038.89H18V13ZM18 17.5h2.5c0 .465 0 .697-.038.89a2 2 0 0 1-1.572 1.572C18.697 20 18.465 20 18 20v-2.5ZM13.5 17.5H16V20c-.465 0-.697 0-.89-.038a2 2 0 0 1-1.572-1.572c-.038-.193-.038-.425-.038-.89Z" fill="#fff"/></svg>`,SCAN_ICON:Je`<svg width="16" height="16" fill="none"><path fill="#fff" d="M10 15.216c0 .422.347.763.768.74 1.202-.064 2.025-.222 2.71-.613a5.001 5.001 0 0 0 1.865-1.866c.39-.684.549-1.507.613-2.709a.735.735 0 0 0-.74-.768.768.768 0 0 0-.76.732c-.009.157-.02.306-.032.447-.073.812-.206 1.244-.384 1.555-.31.545-.761.996-1.306 1.306-.311.178-.743.311-1.555.384-.141.013-.29.023-.447.032a.768.768 0 0 0-.732.76ZM10 .784c0 .407.325.737.732.76.157.009.306.02.447.032.812.073 1.244.206 1.555.384a3.5 3.5 0 0 1 1.306 1.306c.178.311.311.743.384 1.555.013.142.023.29.032.447a.768.768 0 0 0 .76.732.734.734 0 0 0 .74-.768c-.064-1.202-.222-2.025-.613-2.71A5 5 0 0 0 13.477.658c-.684-.39-1.507-.549-2.709-.613a.735.735 0 0 0-.768.74ZM5.232.044A.735.735 0 0 1 6 .784a.768.768 0 0 1-.732.76c-.157.009-.305.02-.447.032-.812.073-1.244.206-1.555.384A3.5 3.5 0 0 0 1.96 3.266c-.178.311-.311.743-.384 1.555-.013.142-.023.29-.032.447A.768.768 0 0 1 .784 6a.735.735 0 0 1-.74-.768c.064-1.202.222-2.025.613-2.71A5 5 0 0 1 2.523.658C3.207.267 4.03.108 5.233.044ZM5.268 14.456a.768.768 0 0 1 .732.76.734.734 0 0 1-.768.74c-1.202-.064-2.025-.222-2.71-.613a5 5 0 0 1-1.865-1.866c-.39-.684-.549-1.507-.613-2.709A.735.735 0 0 1 .784 10c.407 0 .737.325.76.732.009.157.02.306.032.447.073.812.206 1.244.384 1.555a3.5 3.5 0 0 0 1.306 1.306c.311.178.743.311 1.555.384.142.013.29.023.447.032Z"/></svg>`,CHECKMARK_ICON:Je`<svg width="13" height="12" viewBox="0 0 13 12"><path fill-rule="evenodd" clip-rule="evenodd" d="M12.155.132a.75.75 0 0 1 .232 1.035L5.821 11.535a1 1 0 0 1-1.626.09L.665 7.21a.75.75 0 1 1 1.17-.937L4.71 9.867a.25.25 0 0 0 .406-.023L11.12.364a.75.75 0 0 1 1.035-.232Z" fill="#fff"/></svg>`,HELP_ETH_IMG:Je`<svg width="60" height="60" fill="none" viewBox="0 0 60 60"><g clip-path="url(#j)"><rect width="60" height="60" rx="30" fill="#987DE8"/><path fill-rule="evenodd" clip-rule="evenodd" d="m15.48 28.367 11.966-19.3c1.174-1.892 3.927-1.892 5.1 0l11.97 19.306a6 6 0 0 1 .9 3.142v.028a6 6 0 0 1-1.154 3.56L33.227 50.208c-1.599 2.188-4.864 2.188-6.461 0L15.733 35.095a6 6 0 0 1-1.154-3.538v-.029a6 6 0 0 1 .9-3.161Z" fill="#fff"/><path d="M30.84 10.112a.992.992 0 0 0-.844-.464V24.5l12.598 5.53c.081-.466-.001-.963-.27-1.398L30.84 10.112Z" fill="#643CDD"/><path d="M29.996 9.648a.991.991 0 0 0-.845.465l-11.489 18.53a1.991 1.991 0 0 0-.264 1.387l12.598-5.53V9.648Z" fill="#BDADEB"/><path d="M29.996 50.544a.994.994 0 0 0 .808-.41l11.235-15.38c.307-.434-.193-.988-.658-.72L31.49 39.71a2.998 2.998 0 0 1-1.494.398v10.437Z" fill="#643CDD"/><path d="M17.966 34.762 29.19 50.134c.2.274.503.41.807.41V40.108a2.998 2.998 0 0 1-1.493-.398l-9.884-5.676c-.468-.27-.971.292-.653.728Z" fill="#BDADEB"/><path d="M42.594 30.03 29.996 24.5v13.138a3 3 0 0 0 1.495-.399l10.149-5.83c.525-.31.856-.823.954-1.38Z" fill="#401AB3"/><path d="M29.996 37.638V24.462l-12.598 5.566c.098.564.437 1.083.974 1.392l10.13 5.82c.462.265.978.398 1.494.398Z" fill="#7C5AE2"/></g><rect class="help-img-highlight" x=".5" y=".5" width="59" height="59" rx="29.5"/><defs><clipPath id="j"><rect width="60" height="60" rx="30" fill="#fff"/></clipPath></defs></svg>`,HELP_PAINTING_IMG:Je`<svg width="60" height="60" fill="none" viewBox="0 0 60 60"><g clip-path="url(#k)"><rect width="60" height="60" rx="3" fill="#C653C6"/><path d="M52.094 47.344c0-4.246-1.436-9.557-5.885-12.4a2.876 2.876 0 0 0-1.615-3.891v-.819a4.037 4.037 0 0 0-1.34-3.007 4.75 4.75 0 0 0-2.41-6.252v-5.506c0-6.248-5.065-11.313-11.313-11.313-6.247 0-11.312 5.065-11.312 11.313v2.152a3.343 3.343 0 0 0-1.18 5.045 4.738 4.738 0 0 0-1.633 3.584 4.73 4.73 0 0 0 .956 2.858 5.218 5.218 0 0 0-2.358 6.815c-3.06 4.129-6.098 8.298-6.098 15.64 0 2.668.364 4.856.731 6.385.184.765.368 1.366.509 1.78a12.721 12.721 0 0 0 .225.611l.015.037.005.011.001.004v.002h.001l.92-.393-.92.394.26.606h38.26l.291-.49-.86-.51.86.51v-.001l.002-.002.002-.005.01-.017.035-.06.127-.225c.108-.195.26-.477.441-.835.363-.714.845-1.732 1.328-2.953.959-2.427 1.945-5.725 1.945-9.068Z" fill="#E87DE8" stroke="#fff" stroke-width="2"/><path fill-rule="evenodd" clip-rule="evenodd" d="M26.5 29.5c-3-.5-5.5-3-5.503-7l.002-7c0-.466 0-.698.026-.893a3 3 0 0 1 2.582-2.582c.195-.026.428-.026.893-.026 2 0 2.5-2.5 2.5-2.5s0 2.5 2.5 2.5c1.398 0 2.097 0 2.648.229a3 3 0 0 1 1.624 1.623c.228.552.228 1.25.228 2.649v6c0 4-3 7-6.5 7 1.35.23 4 0 6.5-2v9.53C34 38.5 31.495 40 28 40s-6-1.5-6-2.97L24 34l2.5 1.5v-6ZM26 47h4.5c2.5 0 3 4 3 5.5h-3l-1-1.5H26v-4Zm-6.25 5.5H24V57h-8c0-1 1-4.5 3.75-4.5Z" fill="#fff"/></g><rect class="help-img-highlight" x=".5" y=".5" width="59" height="59" rx="2.5"/><defs><clipPath id="k"><rect width="60" height="60" rx="3" fill="#fff"/></clipPath></defs></svg>`,HELP_CHART_IMG:Je`<svg width="60" height="60" fill="none" viewBox="0 0 60 60"><g clip-path="url(#l)"><path d="M0 25.01C0 15.76 0 11.133 1.97 7.678a15 15 0 0 1 5.598-5.597C11.023.11 15.648.11 24.9.11h10.2c9.251 0 13.877 0 17.332 1.97a15 15 0 0 1 5.597 5.597C60 11.133 60 15.758 60 25.01v10.2c0 9.252 0 13.877-1.97 17.332a15 15 0 0 1-5.598 5.598c-3.455 1.97-8.08 1.97-17.332 1.97H24.9c-9.251 0-13.877 0-17.332-1.97a14.999 14.999 0 0 1-5.597-5.598C0 49.087 0 44.462 0 35.21v-10.2Z" fill="#1DC956"/><path d="M.5 25.01c0-4.635 0-8.078.244-10.795.244-2.71.726-4.65 1.66-6.289a14.5 14.5 0 0 1 5.412-5.41c1.639-.936 3.579-1.418 6.289-1.661C16.822.61 20.265.61 24.9.61h10.2c4.635 0 8.078 0 10.795.245 2.71.243 4.65.725 6.29 1.66a14.5 14.5 0 0 1 5.41 5.411c.935 1.64 1.417 3.579 1.66 6.29.244 2.717.245 6.16.245 10.794v10.2c0 4.635 0 8.078-.244 10.795-.244 2.71-.726 4.65-1.66 6.29a14.5 14.5 0 0 1-5.412 5.41c-1.639.936-3.579 1.418-6.289 1.661-2.717.244-6.16.244-10.795.244H24.9c-4.635 0-8.078 0-10.795-.244-2.71-.243-4.65-.725-6.29-1.66a14.5 14.5 0 0 1-5.41-5.412C1.47 50.655.988 48.716.745 46.005.5 43.288.5 39.845.5 35.21v-10.2Z" stroke="#fff" stroke-opacity=".1"/><path d="M16.109 60c-3.833-.179-6.41-.645-8.541-1.86a15 15 0 0 1-5.598-5.598C.553 50.057.155 46.967.043 41.985l4.146-1.382a4 4 0 0 0 2.48-2.39l4.654-12.409a2 2 0 0 1 2.505-1.195l2.526.842a2 2 0 0 0 2.422-1.003l2.968-5.938c.81-1.62 3.185-1.415 3.705.32l3.774 12.581a2 2 0 0 0 3.025 1.09l3.342-2.228c.27-.18.49-.422.646-.706l5.297-9.712a2 2 0 0 1 1.428-1.016l4.134-.689a2 2 0 0 1 1.61.437l3.892 3.243a2 2 0 0 0 2.694-.122l4.633-4.632C60 19.28 60 21.88 60 25.01v10.2c0 9.252 0 13.877-1.97 17.332a14.998 14.998 0 0 1-5.598 5.598c-2.131 1.215-4.708 1.681-8.54 1.86H16.108Z" fill="#2BEE6C"/><path d="M.072 43.03a112.37 112.37 0 0 1-.048-2.093l3.85-1.283a3 3 0 0 0 1.86-1.793l4.653-12.408a3 3 0 0 1 3.758-1.793l2.526.842a1 1 0 0 0 1.21-.501l2.97-5.938c1.214-2.43 4.775-2.123 5.556.48l3.774 12.58a1 1 0 0 0 1.513.545l3.341-2.227a1 1 0 0 0 .323-.353l5.298-9.712a3 3 0 0 1 2.14-1.523l4.135-.69a3 3 0 0 1 2.414.655l3.892 3.244a1 1 0 0 0 1.347-.061l5.28-5.28c.046.845.077 1.752.097 2.732l-3.962 3.962a3 3 0 0 1-4.042.183l-3.893-3.243a1 1 0 0 0-.804-.218l-4.135.689a1 1 0 0 0-.714.507l-5.297 9.712c-.233.427-.565.79-.97 1.06l-3.34 2.228a3 3 0 0 1-4.538-1.635l-3.775-12.58c-.26-.868-1.447-.97-1.852-.16l-2.969 5.937a3 3 0 0 1-3.632 1.505l-2.526-.842a1 1 0 0 0-1.252.597L7.606 38.564a5 5 0 0 1-3.1 2.988L.072 43.029Z" fill="#fff"/><path fill-rule="evenodd" clip-rule="evenodd" d="M49.5 19a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0Z" fill="#2BEE6C"/><path d="M47.5 19a3.5 3.5 0 1 1-7 0 3.5 3.5 0 0 1 7 0Z" fill="#fff"/><path d="M45 .283v59.654c-.63.042-1.294.074-2 .098V.185c.706.025 1.37.056 2 .098Z" fill="#fff"/><path class="help-img-highlight" d="M.5 25.01c0-4.635 0-8.078.244-10.795.244-2.71.726-4.65 1.66-6.289a14.5 14.5 0 0 1 5.412-5.41c1.639-.936 3.579-1.418 6.289-1.661C16.822.61 20.265.61 24.9.61h10.2c4.635 0 8.078 0 10.795.245 2.71.243 4.65.725 6.29 1.66a14.5 14.5 0 0 1 5.41 5.411c.935 1.64 1.417 3.579 1.66 6.29.244 2.717.245 6.16.245 10.794v10.2c0 4.635 0 8.078-.244 10.795-.244 2.71-.726 4.65-1.66 6.29a14.5 14.5 0 0 1-5.412 5.41c-1.639.936-3.579 1.418-6.289 1.661-2.717.244-6.16.244-10.795.244H24.9c-4.635 0-8.078 0-10.795-.244-2.71-.243-4.65-.725-6.29-1.66a14.5 14.5 0 0 1-5.41-5.412C1.47 50.655.988 48.716.745 46.005.5 43.288.5 39.845.5 35.21v-10.2Z"/></g><defs><clipPath id="l"><path fill="#fff" d="M0 0h60v60H0z"/></clipPath></defs></svg>`,HELP_KEY_IMG:Je`<svg width="60" height="60" fill="none" viewBox="0 0 60 60"><g clip-path="url(#m)"><path fill="#EB8B47" d="M0 24.9c0-9.252 0-13.878 1.97-17.332A15 15 0 0 1 7.569 1.97C11.023 0 15.648 0 24.9 0h10.2c9.251 0 13.877 0 17.332 1.97a15 15 0 0 1 5.597 5.598C60 11.022 60 15.648 60 24.899v10.2c0 9.252 0 13.878-1.97 17.332a15.001 15.001 0 0 1-5.598 5.598c-3.455 1.97-8.08 1.97-17.332 1.97H24.9c-9.251 0-13.877 0-17.332-1.97a15 15 0 0 1-5.597-5.598C0 48.977 0 44.351 0 35.1V24.9Z"/><path class="help-img-highlight" d="M.5 24.9c0-4.635 0-8.078.244-10.795.244-2.71.726-4.65 1.66-6.29a14.5 14.5 0 0 1 5.412-5.41C9.455 1.468 11.395.986 14.105.743 16.822.5 20.265.5 24.9.5h10.2c4.635 0 8.078 0 10.795.244 2.71.243 4.65.725 6.29 1.66a14.5 14.5 0 0 1 5.41 5.411c.935 1.64 1.417 3.58 1.66 6.29.244 2.717.245 6.16.245 10.794v10.2c0 4.635 0 8.078-.244 10.796-.244 2.71-.726 4.65-1.66 6.289a14.5 14.5 0 0 1-5.412 5.41c-1.639.936-3.579 1.418-6.289 1.661-2.717.244-6.16.244-10.795.244H24.9c-4.635 0-8.078 0-10.795-.244-2.71-.243-4.65-.725-6.29-1.66a14.5 14.5 0 0 1-5.41-5.411c-.935-1.64-1.417-3.58-1.66-6.29C.5 43.178.5 39.734.5 35.1V24.9Z"/><path fill="#FF974C" stroke="#fff" stroke-width="2" d="M39.192 29.192c5.077-5.077 5.077-13.308 0-18.385-5.076-5.077-13.308-5.077-18.384 0-5.077 5.077-5.077 13.308 0 18.385l1.287 1.291c1.137 1.142 1.706 1.712 2.097 2.387.267.462.472.957.608 1.473.2.755.2 1.56.2 3.171V48.75c0 1.077 0 1.615.134 2.119a4 4 0 0 0 .407.984c.262.45.643.831 1.404 1.592l.294.295c.654.654.982.981 1.365 1.086.26.07.533.07.792 0 .383-.105.71-.432 1.365-1.086l3.478-3.479c.655-.654.982-.981 1.087-1.365a1.5 1.5 0 0 0 0-.791c-.105-.384-.432-.711-1.087-1.365l-.478-.479c-.655-.654-.982-.981-1.087-1.365a1.5 1.5 0 0 1 0-.791c.105-.384.432-.711 1.087-1.365l.478-.479c.655-.654.982-.981 1.087-1.365a1.5 1.5 0 0 0 0-.791c-.105-.384-.432-.711-1.087-1.365l-.492-.493c-.65-.65-.974-.974-1.08-1.355a1.5 1.5 0 0 1-.003-.788c.102-.382.425-.71 1.069-1.364l5.46-5.547Z"/><circle cx="30" cy="17" r="4" fill="#EB8B47" stroke="#fff" stroke-width="2"/></g><defs><clipPath id="m"><path fill="#fff" d="M0 0h60v60H0z"/></clipPath></defs></svg>`,HELP_USER_IMG:Je`<svg width="60" height="60" fill="none" viewBox="0 0 60 60"><g clip-path="url(#n)"><rect width="60" height="60" fill="#00ACE6" rx="30"/><path fill="#1AC6FF" stroke="#fff" stroke-width="2" d="M59 73c0 16.016-12.984 29-29 29S1 89.016 1 73c0-16.017 11-29 29-29s29 12.983 29 29ZM18.69 19.902a11 11 0 0 1 9.281-8.692 14.842 14.842 0 0 1 4.058 0 11 11 0 0 1 9.28 8.692c.178.866.322 1.75.44 2.625.132.977.132 1.968 0 2.945a39.467 39.467 0 0 1-.44 2.625 11 11 0 0 1-9.28 8.692 14.862 14.862 0 0 1-4.058 0 11 11 0 0 1-9.28-8.692 39.467 39.467 0 0 1-.44-2.625 11.004 11.004 0 0 1 0-2.945c.118-.876.262-1.759.44-2.625Z"/><circle cx="24.5" cy="23.5" r="1.5" fill="#fff"/><circle cx="35.5" cy="23.5" r="1.5" fill="#fff"/><path stroke="#fff" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m31 20-3 8h4"/></g><rect class="help-img-highlight" width="59" height="59" x=".5" y=".5" rx="29.5"/><defs><clipPath id="n"><rect width="60" height="60" fill="#fff" rx="30"/></clipPath></defs></svg>`,HELP_LOCK_IMG:Je`<svg width="60" height="60" fill="none" viewBox="0 0 60 60"><rect width="60" height="60" fill="#C653C6" rx="3"/><path fill="#fff" d="M20.034 15.216C20 15.607 20 16.07 20 17v2.808c0 1.13 0 1.696-.2 2.11a1.78 1.78 0 0 1-.584.714c-.366.28-1.051.42-2.423.7a7.076 7.076 0 0 0-1.597.511 9.001 9.001 0 0 0-4.353 4.353C10 30.005 10 32.336 10 37c0 4.663 0 6.995.843 8.804a9.001 9.001 0 0 0 4.353 4.353C17.005 51 19.336 51 24 51h12c4.663 0 6.995 0 8.804-.843a9.001 9.001 0 0 0 4.353-4.353C50 43.995 50 41.664 50 37c0-4.663 0-6.995-.843-8.804a9.001 9.001 0 0 0-4.353-4.353 7.076 7.076 0 0 0-1.597-.511c-1.372-.28-2.057-.42-2.423-.7a1.78 1.78 0 0 1-.583-.715C40 21.505 40 20.94 40 19.809V17c0-.929 0-1.393-.034-1.784a9 9 0 0 0-8.182-8.182C31.393 7 30.93 7 30 7s-1.393 0-1.784.034a9 9 0 0 0-8.182 8.182Z"/><path fill="#E87DE8" d="M22 17c0-.929 0-1.393.044-1.784a7 7 0 0 1 6.172-6.172C28.606 9 29.071 9 30 9s1.393 0 1.784.044a7 7 0 0 1 6.172 6.172c.044.39.044.855.044 1.784v4.5a1.5 1.5 0 0 1-3 0V17c0-.93 0-1.394-.077-1.78a4 4 0 0 0-3.143-3.143C31.394 12 30.93 12 30 12s-1.394 0-1.78.077a4 4 0 0 0-3.143 3.143C25 15.606 25 16.07 25 17v4.5a1.5 1.5 0 0 1-3 0V17Z"/><path fill="#E87DE8" fill-rule="evenodd" d="M12 36.62c0-4.317 0-6.476.92-8.088a7 7 0 0 1 2.612-2.612c1.612-.92 3.77-.92 8.088-.92h6.855c.469 0 .703 0 .906.017 2.73.222 4.364 2.438 4.619 4.983.27-2.698 2.111-5 5.015-5A6.985 6.985 0 0 1 48 31.985v5.395c0 4.317 0 6.476-.92 8.088a7 7 0 0 1-2.612 2.612c-1.612.92-3.77.92-8.088.92h-5.855c-.469 0-.703 0-.906-.017-2.73-.222-4.364-2.438-4.619-4.983-.258 2.583-1.943 4.818-4.714 4.99-.155.01-.335.01-.694.01-.55 0-.825 0-1.057-.015a7 7 0 0 1-6.52-6.52C12 42.233 12 41.958 12 41.408V36.62Zm21.24-.273a4 4 0 1 0-6.478 0c.985 1.36 1.479 2.039 1.564 2.229.178.398.176.818.174 1.247V42.5a1.5 1.5 0 0 0 3 0v-2.677c-.002-.429-.004-.85.174-1.247.085-.19.579-.87 1.565-2.229Z" clip-rule="evenodd"/><rect class="help-img-highlight" width="59" height="59" x=".5" y=".5" rx="2.5"/></svg>`,HELP_COMPAS_IMG:Je`<svg width="60" height="60" fill="none" viewBox="0 0 60 60"><rect width="60" height="60" fill="#1DC956" rx="30"/><circle cx="30" cy="29.999" r="3" fill="#fff"/><path fill="#2BEE6C" stroke="#fff" stroke-width="2" d="m45.316 17.9-.88-.425.88.424a7.9 7.9 0 0 1 .026-.053c.093-.192.21-.432.26-.687l-.819-.162.819.162a2 2 0 0 0-.239-1.405c-.132-.224-.32-.412-.472-.562a8.415 8.415 0 0 1-.042-.042l-.042-.042c-.15-.151-.338-.34-.562-.472l-.508.862.508-.862a2 2 0 0 0-1.405-.239c-.255.05-.495.167-.687.26l-.053.026-15.05 7.246-.108.052c-1.131.545-1.843.887-2.456 1.374a6.994 6.994 0 0 0-1.13 1.13c-.487.613-.83 1.325-1.375 2.457l-.051.108-7.247 15.05-.025.053c-.094.192-.21.431-.26.686a2 2 0 0 0 .239 1.406l.855-.505-.856.505c.133.224.321.411.473.562l.042.042.041.042c.15.151.338.34.563.472a2 2 0 0 0 1.405.239l-.195-.981.195.98c.255-.05.494-.166.686-.26l.054-.025-.419-.87.419.87 15.05-7.247.107-.051c1.132-.545 1.844-.888 2.457-1.374a7.002 7.002 0 0 0 1.13-1.13c.487-.614.83-1.325 1.374-2.457l.052-.108 7.246-15.05Z"/><path fill="#1DC956" d="m33.376 32.723-2.669-3.43-14.85 14.849.206.205a1 1 0 0 0 1.141.194l15.105-7.273a3 3 0 0 0 1.067-4.545Z"/><path fill="#86F999" d="m26.624 27.276 2.669 3.43 14.85-14.849-.206-.205a1 1 0 0 0-1.141-.194L27.69 22.731a3 3 0 0 0-1.067 4.545Z"/><circle cx="30" cy="30" r="3" fill="#fff" transform="rotate(45 30 30)"/><rect class="help-img-highlight" width="59" height="59" x=".5" y=".5" rx="29.5"/></svg>`,HELP_NOUN_IMG:Je`<svg width="60" height="60" fill="none" viewBox="0 0 60 60"><rect width="60" height="60" fill="#794CFF" rx="3"/><path fill="#987DE8" stroke="#fff" stroke-width="2" d="M33 22.5v-1H16v5H8.5V36H13v-5h3v7.5h17V31h1v7.5h17v-17H34v5h-1v-4Z"/><path fill="#fff" d="M37.5 25h10v10h-10z"/><path fill="#4019B2" d="M42.5 25h5v10h-5z"/><path fill="#fff" d="M19.5 25h10v10h-10z"/><path fill="#4019B2" d="M24.5 25h5v10h-5z"/><path fill="#fff" d="M12 30.5h4V37h-4v-6.5Z"/><rect class="help-img-highlight" width="59" height="59" x=".5" y=".5" rx="2.5"/></svg>`,HELP_DAO_IMG:Je`<svg width="60" height="60" fill="none" viewBox="0 0 60 60"><g clip-path="url(#o)"><path fill="#EB8B47" d="M0 24.9c0-9.252 0-13.878 1.97-17.332A15 15 0 0 1 7.569 1.97C11.023 0 15.648 0 24.9 0h10.2c9.251 0 13.877 0 17.332 1.97a15 15 0 0 1 5.597 5.598C60 11.022 60 15.648 60 24.899v10.2c0 9.252 0 13.878-1.97 17.332a15.001 15.001 0 0 1-5.598 5.598c-3.455 1.97-8.08 1.97-17.332 1.97H24.9c-9.251 0-13.877 0-17.332-1.97a15 15 0 0 1-5.597-5.598C0 48.977 0 44.351 0 35.1V24.9Z"/><path class="help-img-highlight" d="M.5 24.9c0-4.635 0-8.078.244-10.795.244-2.71.726-4.65 1.66-6.29a14.5 14.5 0 0 1 5.412-5.41C9.455 1.468 11.395.986 14.105.743 16.822.5 20.265.5 24.9.5h10.2c4.635 0 8.078 0 10.795.244 2.71.243 4.65.725 6.29 1.66a14.5 14.5 0 0 1 5.41 5.411c.935 1.64 1.417 3.58 1.66 6.29.244 2.717.245 6.16.245 10.794v10.2c0 4.635 0 8.078-.244 10.796-.244 2.71-.726 4.65-1.66 6.289a14.5 14.5 0 0 1-5.412 5.41c-1.639.936-3.579 1.418-6.289 1.661-2.717.244-6.16.244-10.795.244H24.9c-4.635 0-8.078 0-10.795-.244-2.71-.243-4.65-.725-6.29-1.66a14.5 14.5 0 0 1-5.41-5.411c-.935-1.64-1.417-3.58-1.66-6.29C.5 43.178.5 39.734.5 35.1V24.9Z"/><path fill="#FF974C" stroke="#fff" stroke-width="2" d="M19 52c5.523 0 10-4.477 10-10s-4.477-10-10-10S9 36.477 9 42s4.477 10 10 10Z"/><path fill="#fff" fill-rule="evenodd" d="M42.844 8.326a1 1 0 0 0-1.687 0L28.978 27.463A1 1 0 0 0 29.822 29h24.357a1 1 0 0 0 .843-1.537L42.844 8.326Z" clip-rule="evenodd"/><path fill="#FF974C" fill-rule="evenodd" d="M42.335 11.646c.324.115.571.504 1.066 1.28l7.332 11.523c.562.883.843 1.325.792 1.69a1 1 0 0 1-.342.623c-.28.238-.803.238-1.85.238H34.667c-1.047 0-1.57 0-1.85-.238a1 1 0 0 1-.342-.623c-.051-.365.23-.806.792-1.69l7.332-11.523c.495-.776.742-1.165 1.066-1.28a1 1 0 0 1 .67 0ZM35 27a7 7 0 0 0 7-7 7 7 0 0 0 7 7H35Z" clip-rule="evenodd"/><path fill="#FF974C" stroke="#fff" stroke-width="2" d="M10.106 9.357c-.109.32-.107.682-.106.975V25.668c-.001.293-.003.654.106.975a2 2 0 0 0 1.251 1.25c.32.11.682.108.975.107H19c5.523 0 10-4.477 10-10S24.523 8 19 8h-6.668c-.293-.001-.654-.003-.975.106a2 2 0 0 0-1.25 1.251Z"/><circle cx="19" cy="18" r="4" fill="#EB8B47" stroke="#fff" stroke-width="2"/><circle cx="19" cy="41.999" r="4" fill="#EB8B47" stroke="#fff" stroke-width="2"/></g><defs><clipPath id="o"><path fill="#fff" d="M0 0h60v60H0z"/></clipPath></defs></svg>`,SEARCH_ICON:Je`<svg width="20" height="21"><path fill-rule="evenodd" clip-rule="evenodd" d="M12.432 13.992c-.354-.353-.91-.382-1.35-.146a5.5 5.5 0 1 1 2.265-2.265c-.237.441-.208.997.145 1.35l3.296 3.296a.75.75 0 1 1-1.06 1.061l-3.296-3.296Zm.06-5a4 4 0 1 1-8 0 4 4 0 0 1 8 0Z" fill="#949E9E"/></svg>`,HELP_ICON:Je`<svg width="11" height="17" viewBox="0 0 11 17"><path fill="#fff" d="M5.22 2.97c-1.07 0-2.25.843-2.25 2.25a.75.75 0 0 1-1.5 0c0-2.393 2.019-3.75 3.75-3.75 1.73 0 3.75 1.357 3.75 3.75 0 1.64-1.038 2.466-1.785 3.057-.802.635-1.215.984-1.215 1.693a.75.75 0 1 1-1.5 0c0-1.466.985-2.24 1.681-2.788l.103-.081C7.007 6.504 7.47 6.08 7.47 5.22c0-1.407-1.181-2.25-2.25-2.25ZM5.22 14.97a1.25 1.25 0 1 0 0-2.5 1.25 1.25 0 0 0 0 2.5Z"/></svg>`,WALLET_ICON:Je`<svg width="15" height="14" fill="none" viewBox="0 0 15 14"><path fill="#fff" fill-rule="evenodd" d="M.64 9.2v-3h.001c.009-1.857.07-2.886.525-3.682a4 4 0 0 1 1.492-1.493C3.58.5 4.813.5 7.28.5h3.735c.58 0 .871 0 1.114.04A3 3 0 0 1 14.6 3.011c.04.243.04.533.04 1.114 0 .58 0 .871-.04 1.114a3 3 0 0 1-2.471 2.47c-.243.041-.533.041-1.114.041h-.777c.178.307.302.648.362 1.011.04.243.04.533.04 1.114 0 .58 0 .871-.04 1.114a3 3 0 0 1-2.471 2.47c-.243.041-.533.041-1.114.041H4.507A3.867 3.867 0 0 1 .64 9.633V9.2ZM7.28 2h3.735c.64 0 .779.005.87.02a1.5 1.5 0 0 1 1.235 1.236c.015.09.02.229.02.869s-.005.779-.02.87a1.5 1.5 0 0 1-1.236 1.235c-.09.015-.229.02-.869.02H4.023c-.697 0-1.345.21-1.883.572V6.25h.001c.004-.791.015-1.383.059-1.867.056-.629.157-.926.269-1.122a2.5 2.5 0 0 1 .932-.933c.197-.111.494-.212 1.123-.268C5.173 2 6.019 2 7.28 2Zm-.265 5.75H4.023c-1.04 0-1.883.843-1.883 1.883A2.367 2.367 0 0 0 4.507 12h2.508c.64 0 .779-.005.87-.02a1.5 1.5 0 0 0 1.235-1.236c.015-.09.02-.229.02-.869s-.005-.779-.02-.87A1.5 1.5 0 0 0 7.884 7.77c-.09-.015-.228-.02-.869-.02Z" clip-rule="evenodd"/></svg>`,NETWORK_PLACEHOLDER:Je`<svg width="28" height="28" fill="none" viewBox="0 0 28 28"><mask id="p" width="26" height="28" x="1" y="0" maskUnits="userSpaceOnUse" style="mask-type:alpha"><path fill="#D9D9D9" d="M12 1.172a4 4 0 0 1 4 0l8.124 4.69a4 4 0 0 1 2 3.465v9.381a4 4 0 0 1-2 3.464L16 26.862a4 4 0 0 1-4 0l-8.124-4.69a4 4 0 0 1-2-3.464V9.327a4 4 0 0 1 2-3.464L12 1.173Z"/></mask><g mask="url(#p)"><path id="network-placeholder-fill" fill="#fff" d="M0 0h28v28H0z"/><path id="network-placeholder-dash" stroke="#000" stroke-dasharray="2 2" d="m8.953 2.931 2.032-1.173.25.433 1.015-.586c.269-.155.553-.271.844-.35l-.13-.483a4.003 4.003 0 0 1 2.071 0l-.13.483c.293.079.576.195.845.35l1.016.586.25-.433 2.03 1.173-.25.433 2.032 1.173.25-.433 2.03 1.172-.25.433 1.016.587c.269.155.512.342.725.556l.354-.354a4.003 4.003 0 0 1 1.035 1.794l-.483.129c.078.292.12.596.12.906v1.172h.5v2.346h-.5v2.345h.5v2.345h-.5v1.173c0 .31-.042.614-.12.906l.483.13a4.003 4.003 0 0 1-1.035 1.793l-.354-.354a3.498 3.498 0 0 1-.725.556l-1.015.586.25.434-2.031 1.172-.25-.433-2.031 1.173.25.433-2.031 1.172-.25-.433-1.016.587a3.494 3.494 0 0 1-.844.35l.13.482a4.003 4.003 0 0 1-2.071 0l.13-.483a3.496 3.496 0 0 1-.845-.35l-1.015-.586-.25.433-2.032-1.172.25-.433-2.03-1.173-.25.433L4.89 22.76l.25-.434-1.015-.586a3.498 3.498 0 0 1-.725-.556l-.354.354a4.003 4.003 0 0 1-1.035-1.794l.483-.13a3.497 3.497 0 0 1-.12-.905v-1.173h-.5V15.19h.5v-2.345h-.5v-2.346h.5V9.327c0-.31.042-.614.12-.906l-.483-.13a4.003 4.003 0 0 1 1.035-1.793l.354.354c.213-.214.456-.401.725-.556l1.015-.587-.25-.433 2.031-1.172.25.433 2.031-1.173-.25-.433Z"/><path fill="#798686" stroke="#fff" d="M14.243 13.563 14 13.428l-.243.135-6.388 3.549-.024.013c-.432.24-.79.44-1.053.622-.266.184-.516.405-.636.722a1.5 1.5 0 0 0 0 1.062c.12.317.37.538.636.722.263.183.62.382 1.053.622l.024.013 3.164 1.758.088.049c1.164.646 1.857 1.032 2.607 1.162.51.09 1.033.09 1.544 0 .75-.13 1.443-.516 2.606-1.162l.09-.05 3.163-1.757.024-.013c.432-.24.79-.44 1.053-.622.266-.184.516-.405.636-.722l-.468-.177.468.177a1.5 1.5 0 0 0 0-1.062l-.468.177.468-.177c-.12-.317-.37-.538-.636-.722-.263-.183-.62-.382-1.053-.622l-.024-.013-6.388-3.55Z"/><path fill="#9EA9A9" stroke="#fff" d="M14.243 8.563 14 8.428l-.243.135-6.388 3.549-.024.013c-.432.24-.79.44-1.053.622-.266.184-.516.405-.636.722a1.5 1.5 0 0 0 0 1.062c.12.316.37.537.636.722.263.183.62.382 1.053.622l.024.013 3.164 1.758.088.049c1.164.646 1.857 1.032 2.607 1.162.51.09 1.033.09 1.544 0 .75-.13 1.443-.516 2.606-1.162l.09-.05 3.163-1.757.024-.013c.432-.24.79-.44 1.053-.622.266-.184.516-.405.636-.722l-.468-.177.468.177a1.5 1.5 0 0 0 0-1.062l-.468.177.468-.177c-.12-.316-.37-.537-.636-.722-.263-.183-.62-.382-1.053-.622l-.024-.013-6.388-3.55Z"/><path fill="#C9CFCF" stroke="#fff" d="m22.344 9.53-.468-.176.468.177a1.5 1.5 0 0 0 0-1.062l-.468.177.468-.177c-.12-.317-.37-.537-.636-.722-.263-.183-.62-.382-1.053-.622l-.024-.013-3.163-1.758-.09-.05c-1.163-.645-1.856-1.03-2.606-1.161a4.5 4.5 0 0 0-1.544 0c-.75.13-1.443.516-2.607 1.162l-.088.05-3.164 1.757-.024.013c-.432.24-.79.44-1.053.622-.266.185-.516.405-.636.722a1.5 1.5 0 0 0 0 1.062c.12.317.37.537.636.722.263.183.62.382 1.053.622l.024.013 3.164 1.758.088.049c1.164.646 1.857 1.032 2.607 1.162.51.09 1.033.09 1.544 0 .75-.13 1.443-.516 2.606-1.162l.09-.05 3.163-1.757.024-.013c.432-.24.79-.44 1.053-.622.266-.184.516-.405.636-.722Z"/></g></svg>`,WALLET_PLACEHOLDER:Je`<svg width="60" height="60" fill="none" viewBox="0 0 60 60"><g clip-path="url(#q)"><path id="wallet-placeholder-fill" fill="#fff" d="M0 24.9c0-9.251 0-13.877 1.97-17.332a15 15 0 0 1 5.598-5.597C11.023 0 15.648 0 24.9 0h10.2c9.252 0 13.877 0 17.332 1.97a15 15 0 0 1 5.597 5.598C60 11.023 60 15.648 60 24.9v10.2c0 9.252 0 13.877-1.97 17.332a15.001 15.001 0 0 1-5.598 5.597C48.977 60 44.352 60 35.1 60H24.9c-9.251 0-13.877 0-17.332-1.97a15 15 0 0 1-5.597-5.598C0 48.977 0 44.352 0 35.1V24.9Z"/><path id="wallet-placeholder-dash" stroke="#000" stroke-dasharray="4 4" stroke-width="1.5" d="M.04 41.708a231.598 231.598 0 0 1-.039-4.403l.75-.001L.75 35.1v-2.55H0v-5.1h.75V24.9l.001-2.204h-.75c.003-1.617.011-3.077.039-4.404l.75.016c.034-1.65.099-3.08.218-4.343l-.746-.07c.158-1.678.412-3.083.82-4.316l.713.236c.224-.679.497-1.296.827-1.875a14.25 14.25 0 0 1 1.05-1.585L3.076 5.9A15 15 0 0 1 5.9 3.076l.455.596a14.25 14.25 0 0 1 1.585-1.05c.579-.33 1.196-.603 1.875-.827l-.236-.712C10.812.674 12.217.42 13.895.262l.07.746C15.23.89 16.66.824 18.308.79l-.016-.75C19.62.012 21.08.004 22.695.001l.001.75L24.9.75h2.55V0h5.1v.75h2.55l2.204.001v-.75c1.617.003 3.077.011 4.404.039l-.016.75c1.65.034 3.08.099 4.343.218l.07-.746c1.678.158 3.083.412 4.316.82l-.236.713c.679.224 1.296.497 1.875.827a14.24 14.24 0 0 1 1.585 1.05l.455-.596A14.999 14.999 0 0 1 56.924 5.9l-.596.455c.384.502.735 1.032 1.05 1.585.33.579.602 1.196.827 1.875l.712-.236c.409 1.233.663 2.638.822 4.316l-.747.07c.119 1.264.184 2.694.218 4.343l.75-.016c.028 1.327.036 2.787.039 4.403l-.75.001.001 2.204v2.55H60v5.1h-.75v2.55l-.001 2.204h.75a231.431 231.431 0 0 1-.039 4.404l-.75-.016c-.034 1.65-.099 3.08-.218 4.343l.747.07c-.159 1.678-.413 3.083-.822 4.316l-.712-.236a10.255 10.255 0 0 1-.827 1.875 14.242 14.242 0 0 1-1.05 1.585l.596.455a14.997 14.997 0 0 1-2.824 2.824l-.455-.596c-.502.384-1.032.735-1.585 1.05-.579.33-1.196.602-1.875.827l.236.712c-1.233.409-2.638.663-4.316.822l-.07-.747c-1.264.119-2.694.184-4.343.218l.016.75c-1.327.028-2.787.036-4.403.039l-.001-.75-2.204.001h-2.55V60h-5.1v-.75H24.9l-2.204-.001v.75a231.431 231.431 0 0 1-4.404-.039l.016-.75c-1.65-.034-3.08-.099-4.343-.218l-.07.747c-1.678-.159-3.083-.413-4.316-.822l.236-.712a10.258 10.258 0 0 1-1.875-.827 14.252 14.252 0 0 1-1.585-1.05l-.455.596A14.999 14.999 0 0 1 3.076 54.1l.596-.455a14.24 14.24 0 0 1-1.05-1.585 10.259 10.259 0 0 1-.827-1.875l-.712.236C.674 49.188.42 47.783.262 46.105l.746-.07C.89 44.77.824 43.34.79 41.692l-.75.016Z"/><path fill="#fff" fill-rule="evenodd" d="M35.643 32.145c-.297-.743-.445-1.114-.401-1.275a.42.42 0 0 1 .182-.27c.134-.1.463-.1 1.123-.1.742 0 1.499.046 2.236-.05a6 6 0 0 0 5.166-5.166c.051-.39.051-.855.051-1.784 0-.928 0-1.393-.051-1.783a6 6 0 0 0-5.166-5.165c-.39-.052-.854-.052-1.783-.052h-7.72c-4.934 0-7.401 0-9.244 1.051a8 8 0 0 0-2.985 2.986C16.057 22.28 16.003 24.58 16 29 15.998 31.075 16 33.15 16 35.224A7.778 7.778 0 0 0 23.778 43H28.5c1.394 0 2.09 0 2.67-.116a6 6 0 0 0 4.715-4.714c.115-.58.115-1.301.115-2.744 0-1.31 0-1.964-.114-2.49a4.998 4.998 0 0 0-.243-.792Z" clip-rule="evenodd"/><path fill="#9EA9A9" fill-rule="evenodd" d="M37 18h-7.72c-2.494 0-4.266.002-5.647.126-1.361.122-2.197.354-2.854.728a6.5 6.5 0 0 0-2.425 2.426c-.375.657-.607 1.492-.729 2.853-.11 1.233-.123 2.777-.125 4.867 0 .7 0 1.05.097 1.181.096.13.182.181.343.2.163.02.518-.18 1.229-.581a6.195 6.195 0 0 1 3.053-.8H37c.977 0 1.32-.003 1.587-.038a4.5 4.5 0 0 0 3.874-3.874c.036-.268.039-.611.039-1.588 0-.976-.003-1.319-.038-1.587a4.5 4.5 0 0 0-3.875-3.874C38.32 18.004 37.977 18 37 18Zm-7.364 12.5h-7.414a4.722 4.722 0 0 0-4.722 4.723 6.278 6.278 0 0 0 6.278 6.278H28.5c1.466 0 1.98-.008 2.378-.087a4.5 4.5 0 0 0 3.535-3.536c.08-.397.087-.933.087-2.451 0-1.391-.009-1.843-.08-2.17a3.5 3.5 0 0 0-2.676-2.676c-.328-.072-.762-.08-2.108-.08Z" clip-rule="evenodd"/></g><defs><clipPath id="q"><path fill="#fff" d="M0 0h60v60H0z"/></clipPath></defs></svg>`,TOKEN_PLACEHOLDER:Je`<svg width="60" height="60" viewBox="0 0 60 60" fill="none"><rect id="token-placeholder-fill" width="58" height="58" x="1" y="1" fill="#fff" rx="29"/><path fill="#3B4040" stroke="#fff" stroke-width="2" d="M32 10a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v5.566c0 .357.192.685.495.875a16.001 16.001 0 0 1 4.256 3.894c.667.88.33 2.113-.627 2.665l-2.494 1.44c-.956.552-2.166.204-2.913-.609a9.12 9.12 0 1 0 .064 12.267c.739-.82 1.945-1.181 2.907-.64l2.509 1.415c.962.542 1.312 1.77.654 2.658a16 16 0 0 1-4.356 4.028c-.303.19-.495.518-.495.875V50a2 2 0 0 1-2 2h-2a2 2 0 0 1-2-2v-2.992c0-.602-.528-1.065-1.13-1.032-.579.032-1.16.032-1.74 0-.602-.032-1.13.43-1.13 1.032V50a2 2 0 0 1-2 2h-2a2 2 0 0 1-2-2v-5.566c0-.357-.192-.685-.495-.875a16 16 0 0 1 0-27.118c.303-.19.495-.517.495-.875V10a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v2.992c0 .601.528 1.064 1.13 1.032.58-.032 1.161-.032 1.74 0 .602.033 1.13-.43 1.13-1.032V10Z"/><rect id="token-placeholder-dash" width="58" height="58" x="1" y="1" stroke="#000" stroke-dasharray="6 6" stroke-width="2" rx="29"/></svg>`,ACCOUNT_COPY:Je`<svg width="14" height="14" fill="none" viewBox="0 0 14 14"><path fill="#fff" fill-rule="evenodd" d="M4.003 4.005c.012-1.225.074-1.936.391-2.491a3 3 0 0 1 1.12-1.12C6.204 0 7.136 0 9 0s2.795 0 3.486.394a3 3 0 0 1 1.12 1.12C14 2.204 14 3.136 14 5s0 2.795-.394 3.486a3 3 0 0 1-1.12 1.12c-.555.317-1.266.379-2.491.391l.002.003c-.012 1.222-.075 1.932-.391 2.486a3 3 0 0 1-1.12 1.12C7.796 14 6.864 14 5 14s-2.795 0-3.486-.394a3 3 0 0 1-1.12-1.12C0 11.796 0 10.864 0 9s0-2.795.394-3.486a3 3 0 0 1 1.12-1.12c.554-.316 1.264-.379 2.486-.391l.003.002ZM9 8.5c-.959 0-1.58-.001-2.05-.043-.45-.04-.613-.109-.693-.154a1.5 1.5 0 0 1-.56-.56c-.045-.08-.113-.243-.154-.693C5.501 6.58 5.5 5.959 5.5 5c0-.959.001-1.58.043-2.05.04-.45.109-.613.154-.693a1.5 1.5 0 0 1 .56-.56c.08-.045.243-.113.693-.154C7.42 1.501 8.041 1.5 9 1.5c.959 0 1.58.001 2.05.043.45.04.613.109.693.154a1.5 1.5 0 0 1 .56.56c.045.08.113.243.154.693.042.47.043 1.091.043 2.05 0 .959-.001 1.58-.043 2.05-.04.45-.109.613-.154.693a1.5 1.5 0 0 1-.56.56c-.08.045-.242.113-.693.154-.47.042-1.091.043-2.05.043ZM4 5.503a13.77 13.77 0 0 0-1.05.04c-.45.04-.613.109-.693.154a1.5 1.5 0 0 0-.56.56c-.045.08-.113.243-.154.693C1.501 7.42 1.5 8.041 1.5 9c0 .959.001 1.58.043 2.05.04.45.109.613.154.693a1.5 1.5 0 0 0 .56.56c.08.045.243.113.693.154.47.042 1.091.043 2.05.043.959 0 1.58-.001 2.05-.043.45-.04.613-.109.693-.154a1.5 1.5 0 0 0 .56-.56c.045-.08.113-.242.154-.693.025-.283.035-.619.04-1.05-1.534-.003-2.358-.037-2.983-.394a3 3 0 0 1-1.12-1.12c-.357-.625-.39-1.449-.394-2.983Z" clip-rule="evenodd"/></svg>`,ACCOUNT_DISCONNECT:Je`<svg width="16" height="14" fill="none" viewBox="0 0 16 14"><path fill="#fff" d="M9.677 1.5h-2.61c-1.261 0-2.107.001-2.757.06-.629.056-.926.157-1.122.268a2.5 2.5 0 0 0-.933.933c-.112.196-.212.493-.269 1.122-.058.65-.06 1.496-.06 2.757v.72c0 1.26.002 2.107.06 2.756.057.63.157.927.27 1.123a2.5 2.5 0 0 0 .932.933c.196.111.493.212 1.122.268.65.059 1.496.06 2.757.06h2.61a.75.75 0 1 1 0 1.5h-2.61c-2.467 0-3.7 0-4.622-.525a4 4 0 0 1-1.493-1.493C.427 11.06.427 9.827.427 7.36v-.72c0-2.467 0-3.7.525-4.622A4 4 0 0 1 2.445.525C3.366 0 4.6 0 7.067 0h2.61a.75.75 0 1 1 0 1.5Z"/><path fill="#fff" d="M10.896 11.03a.75.75 0 0 1 0-1.06l1.793-1.793a.25.25 0 0 0-.176-.427H8.177a.75.75 0 0 1 0-1.5h4.336a.25.25 0 0 0 .176-.427L10.896 4.03a.75.75 0 0 1 1.061-1.06l3.323 3.323a1 1 0 0 1 0 1.414l-3.323 3.323a.75.75 0 0 1-1.06 0Z"/></svg>`},GC={1:"692ed6ba-e569-459a-556a-776476829e00",42161:"600a9a04-c1b9-42ca-6785-9b4b6ff85200",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"};var Cr=(t=>(t.metaMask="metaMask",t.trust="trust",t.phantom="phantom",t.brave="brave",t.spotEthWallet="spotEthWallet",t.exodus="exodus",t.tokenPocket="tokenPocket",t.frame="frame",t.tally="tally",t.coinbaseWallet="coinbaseWallet",t.core="core",t.bitkeep="bitkeep",t.mathWallet="mathWallet",t.opera="opera",t.tokenary="tokenary",t["1inch"]="1inch",t.kuCoinWallet="kuCoinWallet",t.ledger="ledger",t))(Cr||{});const gn={injectedPreset:{metaMask:{name:"MetaMask",icon:"619537c0-2ff3-4c78-9ed8-a05e7567f300",url:"https://metamask.io",isMobile:!0,isInjected:!0},trust:{name:"Trust",icon:"0528ee7e-16d1-4089-21e3-bbfb41933100",url:"https://trustwallet.com",isMobile:!0,isInjected:!0},spotEthWallet:{name:"Spot",icon:"1bf33a89-b049-4a1c-d1f6-4dd7419ee400",url:"https://www.spot-wallet.com",isMobile:!0,isInjected:!0},phantom:{name:"Phantom",icon:"62471a22-33cb-4e65-5b54-c3d9ea24b900",url:"https://phantom.app",isInjected:!0},core:{name:"Core",icon:"35f9c46e-cc57-4aa7-315d-e6ccb2a1d600",url:"https://core.app",isMobile:!0,isInjected:!0},bitkeep:{name:"BitKeep",icon:"3f7075d0-4ab7-4db5-404d-3e4c05e6fe00",url:"https://bitkeep.com",isMobile:!0,isInjected:!0},tokenPocket:{name:"TokenPocket",icon:"f3119826-4ef5-4d31-4789-d4ae5c18e400",url:"https://www.tokenpocket.pro",isMobile:!0,isInjected:!0},mathWallet:{name:"MathWallet",icon:"26a8f588-3231-4411-60ce-5bb6b805a700",url:"https://mathwallet.org",isMobile:!0,isInjected:!0},exodus:{name:"Exodus",icon:"4c16cad4-cac9-4643-6726-c696efaf5200",url:"https://www.exodus.com",isMobile:!0,isDesktop:!0,isInjected:!0},kuCoinWallet:{name:"KuCoin Wallet",icon:"1e47340b-8fd7-4ad6-17e7-b2bd651fae00",url:"https://kuwallet.com",isMobile:!0,isInjected:!0},ledger:{name:"Ledger",icon:"a7f416de-aa03-4c5e-3280-ab49269aef00",url:"https://www.ledger.com",isDesktop:!0},brave:{name:"Brave",icon:"125e828e-9936-4451-a8f2-949c119b7400",url:"https://brave.com/wallet",isInjected:!0},frame:{name:"Frame",icon:"cd492418-ea85-4ef1-aeed-1c9e20b58900",url:"https://frame.sh",isInjected:!0},tally:{name:"Tally",icon:"98d2620c-9fc8-4a1c-31bc-78d59d00a300",url:"https://tallyho.org",isInjected:!0},coinbaseWallet:{name:"Coinbase",icon:"f8068a7f-83d7-4190-1f94-78154a12c600",url:"https://www.coinbase.com/wallet",isInjected:!0},opera:{name:"Opera",icon:"877fa1a4-304d-4d45-ca8e-f76d1a556f00",url:"https://www.opera.com/crypto",isInjected:!0},tokenary:{name:"Tokenary",icon:"5e481041-dc3c-4a81-373a-76bbde91b800",url:"https://tokenary.io",isDesktop:!0,isInjected:!0},["1inch"]:{name:"1inch Wallet",icon:"dce1ee99-403f-44a9-9f94-20de30616500",url:"https://1inch.io/wallet",isMobile:!0}},getInjectedId(t){if(t.toUpperCase()!=="INJECTED"&&t.length)return t;const{ethereum:e,spotEthWallet:r,coinbaseWalletExtension:n}=window;return e?e.isTrust||e.isTrustWallet?"trust":e.isPhantom?"phantom":e.isBraveWallet?"brave":r?"spotEthWallet":e.isExodus?"exodus":e.isTokenPocket?"tokenPocket":e.isFrame?"frame":e.isTally?"tally":n?"coinbaseWallet":e.isAvalanche?"core":e.isBitKeep?"bitkeep":e.isMathWallet?"mathWallet":e.isOpera?"opera":e.isTokenary?"tokenary":e.isOneInchIOSWallet||e.isOneInchAndroidWallet?"1inch":e.isKuCoinWallet?"kuCoinWallet":e.isMetaMask?"metaMask":"injected":"metaMask"},getInjectedName(t){var e,r;if(t.length&&t.toUpperCase()!=="INJECTED")return t;const n=gn.getInjectedId("");return(r=(e=gn.injectedPreset[n])==null?void 0:e.name)!=null?r:"Injected"}},YC={ETH:{icon:"692ed6ba-e569-459a-556a-776476829e00"},WETH:{icon:"692ed6ba-e569-459a-556a-776476829e00"},AVAX:{icon:"30c46e53-e989-45fb-4549-be3bd4eb3b00"},FTM:{icon:"06b26297-fe0c-4733-5d6b-ffa5498aac00"},BNB:{icon:"93564157-2e8e-4ce7-81df-b264dbee9b00"},MATIC:{icon:"41d04d42-da3b-4453-8506-668cc0727900"},OP:{icon:"ab9c186a-c52f-464b-2906-ca59d760a400"},xDAI:{icon:"02b53f6a-e3d4-479e-1cb4-21178987d100"},EVMOS:{icon:"f926ff41-260d-4028-635e-91913fc28e00"},METIS:{icon:"3897a66d-40b9-4833-162f-a2c90531c900"},IOTX:{icon:"34e68754-e536-40da-c153-6ef2e7188a00"}};var ZC=Object.defineProperty,Ip=Object.getOwnPropertySymbols,JC=Object.prototype.hasOwnProperty,XC=Object.prototype.propertyIsEnumerable,Op=(t,e,r)=>e in t?ZC(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,QC=(t,e)=>{for(var r in e||(e={}))JC.call(e,r)&&Op(t,r,e[r]);if(Ip)for(var r of Ip(e))XC.call(e,r)&&Op(t,r,e[r]);return t};const le={MOBILE_BREAKPOINT:600,W3M_RECENT_WALLET:"W3M_RECENT_WALLET",rejectStandaloneButtonComponent(){const{isStandalone:t}=oe.state;if(t)throw new Error("Web3Modal button components are not available in standalone mode.")},getShadowRootElement(t,e){const r=t.renderRoot.querySelector(e);if(!r)throw new Error(`${e} not found`);return r},getWalletId(t){return gn.getInjectedId(t)},getWalletIcon(t){var e,r;const n=(e=gn.injectedPreset[t])==null?void 0:e.icon,{projectId:i,walletImages:o}=vt.state;return(r=o?.[t])!=null?r:i&&n?Ct.getImageUrl(n):""},getWalletName(t,e=!1){const r=gn.getInjectedName(t);return e?r.split(" ")[0]:r},getChainIcon(t){var e;const r=GC[t],{projectId:n,chainImages:i}=vt.state;return(e=i?.[t])!=null?e:n&&r?Ct.getImageUrl(r):""},getTokenIcon(t){var e,r;const n=(e=YC[t])==null?void 0:e.icon,{projectId:i,tokenImages:o}=vt.state;return(r=o?.[t])!=null?r:i&&n?Ct.getImageUrl(n):""},isMobileAnimation(){return window.innerWidth<=le.MOBILE_BREAKPOINT},async preloadImage(t){return new Promise((e,r)=>{const n=new Image;n.onload=e,n.onerror=r,n.src=t})},getErrorMessage(t){return t instanceof Error?t.message:"Unknown Error"},debounce(t,e=500){let r;return(...n)=>{function i(){t(...n)}r&&clearTimeout(r),r=setTimeout(i,e)}},async handleMobileLinking(t){const{standaloneUri:e,selectedChain:r}=oe.state,{links:n,name:i}=t;function o(s){let a="";n!=null&&n.universal?a=ct.formatUniversalUrl(n.universal,s,i):n!=null&&n.native&&(a=ct.formatNativeUrl(n.native,s,i)),ct.openHref(a)}e?(le.setRecentWallet(t),o(e)):(await wt.client().connectWalletConnect(s=>{o(s)},r?.id),le.setRecentWallet(t),Ft.close())},async handleAndroidLinking(){const{standaloneUri:t,selectedChain:e}=oe.state;t?ct.openHref(t):(await wt.client().connectWalletConnect(r=>{ct.setWalletConnectAndroidDeepLink(r),ct.openHref(r)},e?.id),Ft.close())},async handleUriCopy(){const{standaloneUri:t}=oe.state;if(t)await navigator.clipboard.writeText(t);else{const e=wt.client().walletConnectUri;await navigator.clipboard.writeText(e)}er.openToast("Link copied","success")},async handleConnectorConnection(t,e){try{const{selectedChain:r}=oe.state;await wt.client().connectConnector(t,r?.id),Ft.close()}catch(r){console.error(r),e?e():er.openToast(le.getErrorMessage(r),"error")}},getCustomWallets(){var t;const{desktopWallets:e,mobileWallets:r}=vt.state;return(t=ct.isMobile()?r:e)!=null?t:[]},getCustomImageUrls(){const{chainImages:t,walletImages:e}=vt.state,r=Object.values(t??{}),n=Object.values(e??{});return Object.values([...r,...n])},getConnectorImageUrls(){return wt.client().getConnectors().map(({id:t})=>gn.getInjectedId(t)).map(t=>le.getWalletIcon(t))},truncate(t,e=8){return t.length<=e?t:`${t.substring(0,4)}...${t.substring(t.length-4)}`},generateAvatarColors(t){var e;const r=(e=t.match(/.{1,7}/g))==null?void 0:e.splice(0,5),n=[];r?.forEach(o=>{let s=0;for(let l=0;l<o.length;l+=1)s=o.charCodeAt(l)+((s<<5)-s),s=s&s;const a=[0,0,0];for(let l=0;l<3;l+=1){const u=s>>l*8&255;a[l]=u}n.push(`rgb(${a[0]}, ${a[1]}, ${a[2]})`)});const i=document.querySelector(":root");if(i){const o={"--w3m-color-av-1":n[0],"--w3m-color-av-2":n[1],"--w3m-color-av-3":n[2],"--w3m-color-av-4":n[3],"--w3m-color-av-5":n[4]};Object.entries(o).forEach(([s,a])=>i.style.setProperty(s,a))}},setRecentWallet(t){const{walletConnectVersion:e}=oe.state;localStorage.setItem(le.W3M_RECENT_WALLET,JSON.stringify({[e]:t}))},getRecentWallet(){const t=localStorage.getItem(le.W3M_RECENT_WALLET);if(t){const{walletConnectVersion:e}=oe.state,r=JSON.parse(t);if(r[e])return r[e]}},getExtensionWallets(){const t=[];for(const[e,r]of Object.entries(gn.injectedPreset))e!==Cr.coinbaseWallet&&r&&r.isInjected&&!r.isDesktop&&t.push(QC({id:e},r));return t},caseSafeIncludes(t,e){return t.toUpperCase().includes(e.toUpperCase())}},eS=He`#w3m-transparent-noise,.w3m-canvas,.w3m-color-placeholder,.w3m-gradient-placeholder,.w3m-highlight{inset:0;position:absolute;display:block;pointer-events:none;width:100%;height:100px;border-radius:8px 8px 0 0;transform:translateY(-5px)}.w3m-gradient-placeholder{background:linear-gradient(var(--w3m-gradient-1),var(--w3m-gradient-2),var(--w3m-gradient-3),var(--w3m-gradient-4))}.w3m-color-placeholder{background-color:var(--w3m-color-fg-accent)}.w3m-highlight{border:1px solid var(--w3m-color-overlay)}.w3m-canvas{opacity:0;transition:opacity 2s ease;box-shadow:0 8px 28px -6px rgba(10,16,31,.12),0 18px 88px -4px rgba(10,16,31,.14)}.w3m-canvas-visible{opacity:1}#w3m-transparent-noise{mix-blend-mode:multiply;opacity:.35}.w3m-toolbar{height:28px;display:flex;position:relative;margin:5px 15px 5px 5px;justify-content:space-between;align-items:center}.w3m-toolbar img,.w3m-toolbar svg{height:28px;object-position:left center;object-fit:contain}#w3m-wc-logo path{fill:var(--w3m-color-fg-inverse)}.w3m-action-btn{width:28px;height:28px;border-radius:50%;border:0;display:flex;justify-content:center;align-items:center;cursor:pointer;transition:background-color,.2s ease;background-color:var(--w3m-color-bg-1);box-shadow:0 0 0 1px var(--w3m-color-overlay),0 2px 4px -2px rgba(0,0,0,.12),0 4px 4px -2px rgba(0,0,0,.08)}.w3m-action-btn:hover{background-color:var(--w3m-color-bg-2)}.w3m-action-btn svg{display:block;object-position:center}.w3m-action-btn path{fill:var(--w3m-color-fg-1)}.w3m-actions{display:flex}.w3m-actions button:first-child{margin-right:16px}.w3m-help-active button:first-child{background-color:var(--w3m-color-fg-1)}.w3m-help-active button:first-child path{fill:var(--w3m-color-bg-1)}`;var tS=Object.defineProperty,rS=Object.getOwnPropertyDescriptor,yl=(t,e,r,n)=>{for(var i=n>1?void 0:n?rS(e,r):e,o=t.length-1,s;o>=0;o--)(s=t[o])&&(i=(n?s(e,r,i):s(i))||i);return n&&i&&tS(e,r,i),i};const Dp=new VC;let ao=class extends Ie{constructor(){super(),this.open=!1,this.isHelp=!1,this.unsubscribeRouter=void 0,this.playTimeout=void 0,this.unsubscribeRouter=st.subscribe(t=>{this.isHelp=t.view==="Help"})}firstUpdated(){const{themeBackground:t}=vt.state;t==="gradient"&&(this.playTimeout=setTimeout(()=>{Dp.play(this.canvasEl),this.open=!0},800))}disconnectedCallback(){var t;(t=this.unsubscribeRouter)==null||t.call(this),clearTimeout(this.playTimeout),Dp.stop()}get canvasEl(){return le.getShadowRootElement(this,".w3m-canvas")}onHelp(){st.push("Help")}render(){const{themeBackground:t}=vt.state,e={"w3m-canvas":!0,"w3m-canvas-visible":this.open},r={"w3m-actions":!0,"w3m-help-active":this.isHelp};return ee`${t==="themeColor"?ee`<div class="w3m-color-placeholder"></div>`:null} ${t==="gradient"?ee`<div class="w3m-gradient-placeholder"></div><canvas class="${tr(e)}"></canvas>${Me.NOISE_TEXTURE}`:null}<div class="w3m-highlight"></div><div class="w3m-toolbar">${Me.WALLET_CONNECT_LOGO}<div class="${tr(r)}"><button class="w3m-action-btn" @click="${this.onHelp}">${Me.HELP_ICON}</button> <button class="w3m-action-btn" @click="${Ft.close}">${Me.CROSS_ICON}</button></div></div>`}};ao.styles=[_e.globalCss,eS],yl([ut()],ao.prototype,"open",2),yl([ut()],ao.prototype,"isHelp",2),ao=yl([Le("w3m-modal-backcard")],ao);const nS=He`main{padding:20px;padding-top:0;width:100%}`;var iS=Object.defineProperty,oS=Object.getOwnPropertyDescriptor,sS=(t,e,r,n)=>{for(var i=n>1?void 0:n?oS(e,r):e,o=t.length-1,s;o>=0;o--)(s=t[o])&&(i=(n?s(e,r,i):s(i))||i);return n&&i&&iS(e,r,i),i};let wl=class extends Ie{render(){return ee`<main><slot></slot></main>`}};wl.styles=[_e.globalCss,nS],wl=sS([Le("w3m-modal-content")],wl);const aS=He`footer{padding:10px;display:flex;flex-direction:column;align-items:inherit;justify-content:inherit;border-top:1px solid var(--w3m-color-bg-2)}`;var cS=Object.defineProperty,lS=Object.getOwnPropertyDescriptor,uS=(t,e,r,n)=>{for(var i=n>1?void 0:n?lS(e,r):e,o=t.length-1,s;o>=0;o--)(s=t[o])&&(i=(n?s(e,r,i):s(i))||i);return n&&i&&cS(e,r,i),i};let vl=class extends Ie{render(){return ee`<footer><slot></slot></footer>`}};vl.styles=[_e.globalCss,aS],vl=uS([Le("w3m-modal-footer")],vl);const hS=He`header{display:flex;justify-content:center;align-items:center;padding:20px;position:relative}.w3m-border{border-bottom:1px solid var(--w3m-color-bg-2);margin-bottom:20px}header button{padding:15px 20px;transition:opacity .2s ease}@media(hover:hover){header button:hover{opacity:.5}}.w3m-back-btn{position:absolute;left:0}.w3m-action-btn{position:absolute;right:0}path{fill:var(--w3m-color-fg-accent)}`;var fS=Object.defineProperty,dS=Object.getOwnPropertyDescriptor,co=(t,e,r,n)=>{for(var i=n>1?void 0:n?dS(e,r):e,o=t.length-1,s;o>=0;o--)(s=t[o])&&(i=(n?s(e,r,i):s(i))||i);return n&&i&&fS(e,r,i),i};let mn=class extends Ie{constructor(){super(...arguments),this.title="",this.onAction=void 0,this.actionIcon=void 0,this.border=!1}backBtnTemplate(){return ee`<button class="w3m-back-btn" @click="${st.goBack}">${Me.BACK_ICON}</button>`}actionBtnTemplate(){return ee`<button class="w3m-action-btn" @click="${this.onAction}">${this.actionIcon}</button>`}render(){const t={"w3m-border":this.border},e=st.state.history.length>1,r=this.title?ee`<w3m-text variant="large-bold">${this.title}</w3m-text>`:ee`<slot></slot>`;return ee`<header class="${tr(t)}">${e?this.backBtnTemplate():null} ${r} ${this.onAction?this.actionBtnTemplate():null}</header>`}};mn.styles=[_e.globalCss,hS],co([je()],mn.prototype,"title",2),co([je()],mn.prototype,"onAction",2),co([je()],mn.prototype,"actionIcon",2),co([je()],mn.prototype,"border",2),mn=co([Le("w3m-modal-header")],mn);const pS=He`.w3m-router{overflow:hidden;will-change:transform}.w3m-content{display:flex;flex-direction:column}`;var gS=Object.defineProperty,mS=Object.getOwnPropertyDescriptor,_l=(t,e,r,n)=>{for(var i=n>1?void 0:n?mS(e,r):e,o=t.length-1,s;o>=0;o--)(s=t[o])&&(i=(n?s(e,r,i):s(i))||i);return n&&i&&gS(e,r,i),i};let lo=class extends Ie{constructor(){super(),this.view=st.state.view,this.prevView=st.state.view,this.unsubscribe=void 0,this.oldHeight="0px",this.resizeObserver=void 0,this.unsubscribe=st.subscribe(t=>{this.view!==t.view&&this.onChangeRoute()})}firstUpdated(){this.resizeObserver=new ResizeObserver(([t])=>{const e=`${t.contentRect.height}px`;this.oldHeight!=="0px"&&(Wr(this.routerEl,{height:[this.oldHeight,e]},{duration:.2}),Wr(this.routerEl,{opacity:[0,1],scale:[.99,1]},{duration:.37,delay:.03})),this.oldHeight=e}),this.resizeObserver.observe(this.contentEl)}disconnectedCallback(){var t,e;(t=this.unsubscribe)==null||t.call(this),(e=this.resizeObserver)==null||e.disconnect()}get routerEl(){return le.getShadowRootElement(this,".w3m-router")}get contentEl(){return le.getShadowRootElement(this,".w3m-content")}viewTemplate(){switch(this.view){case"ConnectWallet":return ee`<w3m-connect-wallet-view></w3m-connect-wallet-view>`;case"SelectNetwork":return ee`<w3m-select-network-view></w3m-select-network-view>`;case"InjectedConnector":return ee`<w3m-injected-connector-view></w3m-injected-connector-view>`;case"InstallConnector":return ee`<w3m-install-connector-view></w3m-install-connector-view>`;case"GetWallet":return ee`<w3m-get-wallet-view></w3m-get-wallet-view>`;case"DesktopConnector":return ee`<w3m-desktop-connector-view></w3m-desktop-connector-view>`;case"WalletExplorer":return ee`<w3m-wallet-explorer-view></w3m-wallet-explorer-view>`;case"Qrcode":return ee`<w3m-qrcode-view></w3m-qrcode-view>`;case"Help":return ee`<w3m-help-view></w3m-help-view>`;case"Account":return ee`<w3m-account-view></w3m-account-view>`;case"SwitchNetwork":return ee`<w3m-switch-network-view></w3m-switch-network-view>`;default:return ee`<div>Not Found</div>`}}async onChangeRoute(){await Wr(this.routerEl,{opacity:[1,0],scale:[1,1.02]},{duration:.15}).finished,this.view=st.state.view}render(){return ee`<div class="w3m-router"><div class="w3m-content">${this.viewTemplate()}</div></div>`}};lo.styles=[_e.globalCss,pS],_l([ut()],lo.prototype,"view",2),_l([ut()],lo.prototype,"prevView",2),lo=_l([Le("w3m-modal-router")],lo);const bS=He`div{height:36px;width:max-content;display:flex;justify-content:center;align-items:center;padding:10px 15px;position:absolute;top:12px;box-shadow:0 6px 14px -6px rgba(10,16,31,.3),0 10px 32px -4px rgba(10,16,31,.15);z-index:2;left:50%;transform:translateX(-50%);pointer-events:none;backdrop-filter:blur(20px) saturate(1.8);-webkit-backdrop-filter:blur(20px) saturate(1.8);border-radius:36px;border:1px solid var(--w3m-color-overlay);background-color:var(--w3m-color-overlay)}svg{margin-right:5px}@-moz-document url-prefix(){div{background-color:var(--w3m-color-bg-3)}}.w3m-success path{fill:var(--w3m-color-fg-accent)}.w3m-error path{fill:var(--w3m-color-err)}`;var yS=Object.defineProperty,wS=Object.getOwnPropertyDescriptor,$p=(t,e,r,n)=>{for(var i=n>1?void 0:n?wS(e,r):e,o=t.length-1,s;o>=0;o--)(s=t[o])&&(i=(n?s(e,r,i):s(i))||i);return n&&i&&yS(e,r,i),i};let js=class extends Ie{constructor(){super(),this.open=!1,this.unsubscribe=void 0,this.timeout=void 0,this.unsubscribe=er.subscribe(t=>{t.open?(this.open=!0,this.timeout=setTimeout(()=>er.closeToast(),2200)):(this.open=!1,clearTimeout(this.timeout))})}disconnectedCallback(){var t;(t=this.unsubscribe)==null||t.call(this),clearTimeout(this.timeout),er.closeToast()}render(){const{message:t,variant:e}=er.state,r={"w3m-success":e==="success","w3m-error":e==="error"};return this.open?ee`<div class="${tr(r)}">${e==="success"?Me.CHECKMARK_ICON:null} ${e==="error"?Me.CROSS_ICON:null}<w3m-text variant="small-normal">${t}</w3m-text></div>`:null}};js.styles=[_e.globalCss,bS],$p([ut()],js.prototype,"open",2),js=$p([Le("w3m-modal-toast")],js);const vS=He`button{padding:5px;border-radius:10px;transition:all .2s ease;display:flex;flex-direction:column;align-items:center;justify-content:center;width:80px;height:90px}w3m-network-image{width:54px;height:59px}w3m-text{width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-align:center;margin-top:5px}button:hover{background-color:var(--w3m-color-overlay)}`;var _S=Object.defineProperty,ES=Object.getOwnPropertyDescriptor,ks=(t,e,r,n)=>{for(var i=n>1?void 0:n?ES(e,r):e,o=t.length-1,s;o>=0;o--)(s=t[o])&&(i=(n?s(e,r,i):s(i))||i);return n&&i&&_S(e,r,i),i};let ti=class extends Ie{constructor(){super(...arguments),this.onClick=()=>null,this.name="",this.chainId=""}render(){return ee`<button @click="${this.onClick}"><w3m-network-image chainId="${this.chainId}"></w3m-network-image><w3m-text variant="xsmall-normal">${this.name}</w3m-text></button>`}};ti.styles=[_e.globalCss,vS],ks([je()],ti.prototype,"onClick",2),ks([je()],ti.prototype,"name",2),ks([je()],ti.prototype,"chainId",2),ti=ks([Le("w3m-network-button")],ti);const xS=He`div{width:inherit;height:inherit}.polygon-stroke{stroke:var(--w3m-color-overlay)}svg{width:100%;height:100%;margin:0}#network-placeholder-fill{fill:var(--w3m-color-bg-3)}#network-placeholder-dash{stroke:var(--w3m-color-overlay)}`;var CS=Object.defineProperty,SS=Object.getOwnPropertyDescriptor,Fp=(t,e,r,n)=>{for(var i=n>1?void 0:n?SS(e,r):e,o=t.length-1,s;o>=0;o--)(s=t[o])&&(i=(n?s(e,r,i):s(i))||i);return n&&i&&CS(e,r,i),i};let Hs=class extends Ie{constructor(){super(...arguments),this.chainId=""}render(){const t=le.getChainIcon(this.chainId);return t?ee`<div><svg width="54" height="59" viewBox="0 0 54 59" fill="none"><defs><clipPath id="polygon"><path d="M17.033 4.964c3.852-2.262 5.778-3.393 7.84-3.77a11.807 11.807 0 0 1 4.254 0c2.062.377 3.988 1.508 7.84 3.77l6.066 3.562c3.852 2.263 5.777 3.394 7.13 5.022a12.268 12.268 0 0 1 2.127 3.747c.71 2.006.71 4.268.71 8.793v7.124c0 4.525 0 6.787-.71 8.793a12.268 12.268 0 0 1-2.126 3.747c-1.354 1.628-3.28 2.76-7.131 5.022l-6.066 3.562c-3.852 2.262-5.778 3.393-7.84 3.771a11.814 11.814 0 0 1-4.254 0c-2.062-.378-3.988-1.509-7.84-3.77l-6.066-3.563c-3.852-2.263-5.778-3.394-7.13-5.022a12.268 12.268 0 0 1-2.127-3.747C1 40 1 37.737 1 33.212v-7.124c0-4.525 0-6.787.71-8.793a12.268 12.268 0 0 1 2.127-3.747c1.352-1.628 3.278-2.76 7.13-5.022l6.066-3.562Z"/></clipPath></defs><image clip-path="url(#polygon)" href="${t}" width="58" height="59" x="-2" y="0"/><path class="polygon-stroke" d="M17.22 5.295c3.877-2.277 5.737-3.363 7.72-3.726a11.44 11.44 0 0 1 4.12 0c1.983.363 3.844 1.45 7.72 3.726l6.065 3.562c3.876 2.276 5.731 3.372 7.032 4.938a11.896 11.896 0 0 1 2.06 3.63c.683 1.928.688 4.11.688 8.663v7.124c0 4.553-.005 6.735-.688 8.664a11.896 11.896 0 0 1-2.06 3.63c-1.3 1.565-3.156 2.66-7.032 4.937l-6.065 3.563c-3.877 2.276-5.737 3.362-7.72 3.725a11.46 11.46 0 0 1-4.12 0c-1.983-.363-3.844-1.449-7.72-3.726l-6.065-3.562c-3.876-2.276-5.731-3.372-7.032-4.938a11.885 11.885 0 0 1-2.06-3.63c-.682-1.928-.688-4.11-.688-8.663v-7.124c0-4.553.006-6.735.688-8.664a11.885 11.885 0 0 1 2.06-3.63c1.3-1.565 3.156-2.66 7.032-4.937l6.065-3.562Z" stroke="#fff"/></svg></div>`:ee`${Me.NETWORK_PLACEHOLDER}`}};Hs.styles=[_e.globalCss,xS],Fp([je()],Hs.prototype,"chainId",2),Hs=Fp([Le("w3m-network-image")],Hs);const AS=.1,Pp=2.5,Dr=7;function El(t,e,r){return t===e?!1:(t-e<0?e-t:t-e)<=r+AS}function IS(t,e){const r=Array.prototype.slice.call(to.create(t,{errorCorrectionLevel:e}).modules.data,0),n=Math.sqrt(r.length);return r.reduce((i,o,s)=>(s%n===0?i.push([o]):i[i.length-1].push(o))&&i,[])}const OS={generate(t,e,r,n){const i=n==="light"?"#141414":"#fff",o=n==="light"?"#fff":"#141414",s=[],a=IS(t,"Q"),l=e/a.length,u=[{x:0,y:0},{x:1,y:0},{x:0,y:1}];u.forEach(({x:R,y:M})=>{const B=(a.length-Dr)*l*R,D=(a.length-Dr)*l*M,N=.32;for(let C=0;C<u.length;C+=1){const $=l*(Dr-C*2);s.push(Je`<rect fill="${C%2===0?i:o}" height="${$}" rx="${$*N}" ry="${$*N}" width="${$}" x="${B+l*C}" y="${D+l*C}">`)}});const d=Math.floor((r+25)/l),y=a.length/2-d/2,m=a.length/2+d/2-1,v=[];a.forEach((R,M)=>{R.forEach((B,D)=>{if(a[M][D]&&!(M<Dr&&D<Dr||M>a.length-(Dr+1)&&D<Dr||M<Dr&&D>a.length-(Dr+1))&&!(M>y&&M<m&&D>y&&D<m)){const N=M*l+l/2,C=D*l+l/2;v.push([N,C])}})});const _={};return v.forEach(([R,M])=>{_[R]?_[R].push(M):_[R]=[M]}),Object.entries(_).map(([R,M])=>{const B=M.filter(D=>M.every(N=>!El(D,N,l)));return[Number(R),B]}).forEach(([R,M])=>{M.forEach(B=>{s.push(Je`<circle cx="${R}" cy="${B}" fill="${i}" r="${l/Pp}">`)})}),Object.entries(_).filter(([R,M])=>M.length>1).map(([R,M])=>{const B=M.filter(D=>M.some(N=>El(D,N,l)));return[Number(R),B]}).map(([R,M])=>{M.sort((D,N)=>D<N?-1:1);const B=[];for(const D of M){const N=B.find(C=>C.some($=>El(D,$,l)));N?N.push(D):B.push([D])}return[R,B.map(D=>[D[0],D[D.length-1]])]}).forEach(([R,M])=>{M.forEach(([B,D])=>{s.push(Je`<line x1="${R}" x2="${R}" y1="${B}" y2="${D}" stroke="${i}" stroke-width="${l/(Pp/2)}" stroke-linecap="round">`)})}),s}},DS=He`@keyframes fadeIn{0%{opacity:0}100%{opacity:1}}div{position:relative;user-select:none;display:block;overflow:hidden;width:100%;aspect-ratio:1/1;animation:fadeIn ease .2s}svg:first-child,w3m-wallet-image{position:absolute;top:50%;left:50%;transform:translateY(-50%) translateX(-50%)}w3m-wallet-image{transform:translateY(-50%) translateX(-50%)}w3m-wallet-image{width:25%;height:25%;border-radius:15px}svg:first-child{transform:translateY(-50%) translateX(-50%) scale(.9)}svg:first-child path:first-child{fill:var(--w3m-color-fg-accent)}svg:first-child path:last-child{stroke:var(--w3m-color-overlay)}`;var $S=Object.defineProperty,FS=Object.getOwnPropertyDescriptor,uo=(t,e,r,n)=>{for(var i=n>1?void 0:n?FS(e,r):e,o=t.length-1,s;o>=0;o--)(s=t[o])&&(i=(n?s(e,r,i):s(i))||i);return n&&i&&$S(e,r,i),i};let bn=class extends Ie{constructor(){super(...arguments),this.uri="",this.size=0,this.logoSrc="",this.walletId=""}svgTemplate(){var t;const e=(t=vt.state.themeMode)!=null?t:"light";return Je`<svg height="${this.size}" width="${this.size}">${OS.generate(this.uri,this.size,this.size/4,e)}</svg>`}render(){return ee`<div>${this.walletId||this.logoSrc?ee`<w3m-wallet-image walletId="${ir(this.walletId)}" src="${ir(this.logoSrc)}"></w3m-wallet-image>`:Me.WALLET_CONNECT_ICON_COLORED} ${this.svgTemplate()}</div>`}};bn.styles=[_e.globalCss,DS],uo([je()],bn.prototype,"uri",2),uo([je({type:Number})],bn.prototype,"size",2),uo([je()],bn.prototype,"logoSrc",2),uo([je()],bn.prototype,"walletId",2),bn=uo([Le("w3m-qrcode")],bn);const PS=He`:host{position:relative;height:28px;width:75%}input{width:100%;height:100%;line-height:28px!important;border-radius:28px;font-style:normal;font-family:-apple-system,system-ui,BlinkMacSystemFont,'Segoe UI',Roboto,Ubuntu,'Helvetica Neue',sans-serif;font-feature-settings:'case' on;font-weight:500;font-size:16px;letter-spacing:-.03em;padding:0 10px 0 34px;transition:.2s all ease;color:transparent;position:absolute;background-color:var(--w3m-color-bg-3);box-shadow:inset 0 0 0 1px var(--w3m-color-overlay)}input::placeholder{color:transparent}svg{margin-right:4px}.w3m-placeholder{top:0;left:50%;transform:translateX(-50%);transition:.2s all ease;pointer-events:none;display:flex;align-items:center;justify-content:center;height:100%;width:fit-content;position:relative}input:focus-within+.w3m-placeholder,input:not(:placeholder-shown)+.w3m-placeholder{transform:translateX(10px);left:0}w3m-text{opacity:1;transition:.2s opacity ease}input:focus-within+.w3m-placeholder w3m-text,input:not(:placeholder-shown)+.w3m-placeholder w3m-text{opacity:0}input:focus-within,input:not(:placeholder-shown){color:var(--w3m-color-fg-1)}input:focus-within{box-shadow:inset 0 0 0 1px var(--w3m-color-fg-accent)}path{fill:var(--w3m-color-fg-2)}`;var TS=Object.defineProperty,NS=Object.getOwnPropertyDescriptor,Tp=(t,e,r,n)=>{for(var i=n>1?void 0:n?NS(e,r):e,o=t.length-1,s;o>=0;o--)(s=t[o])&&(i=(n?s(e,r,i):s(i))||i);return n&&i&&TS(e,r,i),i};let zs=class extends Ie{constructor(){super(...arguments),this.onChange=()=>null}render(){const t=ct.isMobile()?"Search mobile wallets":"Search desktop wallets";return ee`<input type="text" @input="${this.onChange}" placeholder="${t}"><div class="w3m-placeholder">${Me.SEARCH_ICON}<w3m-text color="secondary" variant="medium-thin">${t}</w3m-text></div>`}};zs.styles=[_e.globalCss,PS],Tp([je()],zs.prototype,"onChange",2),zs=Tp([Le("w3m-search-input")],zs);const RS=He`@keyframes rotate{100%{transform:rotate(360deg)}}@keyframes dash{0%{stroke-dasharray:1,150;stroke-dashoffset:0}50%{stroke-dasharray:90,150;stroke-dashoffset:-35}100%{stroke-dasharray:90,150;stroke-dashoffset:-124}}svg{animation:rotate 2s linear infinite;display:flex;justify-content:center;align-items:center}svg circle{stroke-linecap:round;animation:dash 1.5s ease infinite;stroke:var(--w3m-color-fg-accent)}`;var LS=Object.defineProperty,MS=Object.getOwnPropertyDescriptor,US=(t,e,r,n)=>{for(var i=n>1?void 0:n?MS(e,r):e,o=t.length-1,s;o>=0;o--)(s=t[o])&&(i=(n?s(e,r,i):s(i))||i);return n&&i&&LS(e,r,i),i};let xl=class extends Ie{render(){return ee`<svg viewBox="0 0 50 50" width="24" height="24"><circle cx="25" cy="25" r="20" fill="none" stroke-width="4" stroke="#fff"/></svg>`}};xl.styles=[_e.globalCss,RS],xl=US([Le("w3m-spinner")],xl);const BS=He`span{font-style:normal;font-family:-apple-system,system-ui,BlinkMacSystemFont,'Segoe UI',Roboto,Ubuntu,'Helvetica Neue',sans-serif;font-feature-settings:'tnum' on,'lnum' on,'case' on}.w3m-xxsmall-bold{font-weight:700;font-size:10px;line-height:12px;letter-spacing:.02em;text-transform:uppercase}.w3m-xsmall-normal{font-weight:600;font-size:12px;line-height:14px;letter-spacing:-.03em}.w3m-small-thin{font-weight:500;font-size:14px;line-height:16px;letter-spacing:-.03em}.w3m-small-normal{font-weight:600;font-size:14px;line-height:16px;letter-spacing:-.03em}.w3m-medium-thin{font-weight:500;font-size:16px;line-height:20px;letter-spacing:-.03em}.w3m-medium-normal{font-weight:600;font-size:16px;line-height:20px;letter-spacing:-.03em}.w3m-medium-bold{font-weight:700;font-size:16px;line-height:20px;letter-spacing:-.03em}.w3m-large-bold{font-weight:600;font-size:20px;line-height:24px;letter-spacing:-.03em}:host(*){color:var(--w3m-color-fg-1)}.w3m-color-primary{color:var(--w3m-color-fg-1)}.w3m-color-secondary{color:var(--w3m-color-fg-2)}.w3m-color-tertiary{color:var(--w3m-color-fg-3)}.w3m-color-inverse{color:var(--w3m-color-fg-inverse)}.w3m-color-accnt{color:var(--w3m-color-fg-accent)}.w3m-color-error{color:var(--w3m-color-err)}`;var jS=Object.defineProperty,kS=Object.getOwnPropertyDescriptor,Cl=(t,e,r,n)=>{for(var i=n>1?void 0:n?kS(e,r):e,o=t.length-1,s;o>=0;o--)(s=t[o])&&(i=(n?s(e,r,i):s(i))||i);return n&&i&&jS(e,r,i),i};let ho=class extends Ie{constructor(){super(...arguments),this.variant="medium-normal",this.color="primary"}render(){const t={"w3m-large-bold":this.variant==="large-bold","w3m-medium-bold":this.variant==="medium-bold","w3m-medium-normal":this.variant==="medium-normal","w3m-medium-thin":this.variant==="medium-thin","w3m-small-normal":this.variant==="small-normal","w3m-small-thin":this.variant==="small-thin","w3m-xsmall-normal":this.variant==="xsmall-normal","w3m-xxsmall-bold":this.variant==="xxsmall-bold","w3m-color-primary":this.color==="primary","w3m-color-secondary":this.color==="secondary","w3m-color-tertiary":this.color==="tertiary","w3m-color-inverse":this.color==="inverse","w3m-color-accnt":this.color==="accent","w3m-color-error":this.color==="error"};return ee`<span class="${tr(t)}"><slot></slot></span>`}};ho.styles=[_e.globalCss,BS],Cl([je()],ho.prototype,"variant",2),Cl([je()],ho.prototype,"color",2),ho=Cl([Le("w3m-text")],ho);const HS=He`div{overflow:hidden;position:relative;border-radius:50%}div::after{content:'';position:absolute;inset:0;border-radius:50%;border:1px solid var(--w3m-color-overlay)}div img{width:100%;height:100%;object-fit:cover;object-position:center}svg{width:100%;height:100%}#token-placeholder-fill{fill:var(--w3m-color-bg-3)}#token-placeholder-dash{stroke:var(--w3m-color-overlay)}`;var zS=Object.defineProperty,WS=Object.getOwnPropertyDescriptor,Np=(t,e,r,n)=>{for(var i=n>1?void 0:n?WS(e,r):e,o=t.length-1,s;o>=0;o--)(s=t[o])&&(i=(n?s(e,r,i):s(i))||i);return n&&i&&zS(e,r,i),i};let Ws=class extends Ie{constructor(){super(...arguments),this.symbol=void 0}render(){var t;const e=le.getTokenIcon((t=this.symbol)!=null?t:"");return e?ee`<div><img src="${e}" alt="${this.id}"></div>`:Me.TOKEN_PLACEHOLDER}};Ws.styles=[_e.globalCss,HS],Np([je()],Ws.prototype,"symbol",2),Ws=Np([Le("w3m-token-image")],Ws);const VS=He`button{transition:all .2s ease;width:100%;height:100%;border-radius:10px;display:flex;align-items:flex-start}button:hover{background-color:var(--w3m-color-overlay)}button>div{width:80px;padding:5px 0;display:flex;flex-direction:column;align-items:center}w3m-text{width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-align:center}w3m-wallet-image{height:60px;width:60px;transition:all .2s ease;border-radius:15px;margin-bottom:5px}.w3m-sublabel{margin-top:2px}`;var qS=Object.defineProperty,KS=Object.getOwnPropertyDescriptor,Kr=(t,e,r,n)=>{for(var i=n>1?void 0:n?KS(e,r):e,o=t.length-1,s;o>=0;o--)(s=t[o])&&(i=(n?s(e,r,i):s(i))||i);return n&&i&&qS(e,r,i),i};let Sr=class extends Ie{constructor(){super(...arguments),this.onClick=()=>null,this.name="",this.walletId="",this.label=void 0,this.src=void 0,this.installed=!1,this.recent=!1}sublabelTemplate(){return this.recent?ee`<w3m-text class="w3m-sublabel" variant="xxsmall-bold" color="tertiary">RECENT</w3m-text>`:this.installed?ee`<w3m-text class="w3m-sublabel" variant="xxsmall-bold" color="tertiary">INSTALLED</w3m-text>`:null}render(){var t;return ee`<button @click="${this.onClick}"><div><w3m-wallet-image walletId="${this.walletId}" .src="${this.src}"></w3m-wallet-image><w3m-text variant="xsmall-normal">${(t=this.label)!=null?t:le.getWalletName(this.name,!0)}</w3m-text>${this.sublabelTemplate()}</div></button>`}};Sr.styles=[_e.globalCss,VS],Kr([je()],Sr.prototype,"onClick",2),Kr([je()],Sr.prototype,"name",2),Kr([je()],Sr.prototype,"walletId",2),Kr([je()],Sr.prototype,"label",2),Kr([je()],Sr.prototype,"src",2),Kr([je()],Sr.prototype,"installed",2),Kr([je()],Sr.prototype,"recent",2),Sr=Kr([Le("w3m-wallet-button")],Sr);const GS=He`div{overflow:hidden;position:relative;border-radius:inherit;width:100%;height:100%}svg{position:relative;width:100%;height:100%}div::after{content:'';position:absolute;inset:0;border-radius:inherit;border:1px solid var(--w3m-color-overlay)}div img{width:100%;height:100%;object-fit:cover;object-position:center}#wallet-placeholder-fill{fill:var(--w3m-color-bg-3)}#wallet-placeholder-dash{stroke:var(--w3m-color-overlay)}`;var YS=Object.defineProperty,ZS=Object.getOwnPropertyDescriptor,Sl=(t,e,r,n)=>{for(var i=n>1?void 0:n?ZS(e,r):e,o=t.length-1,s;o>=0;o--)(s=t[o])&&(i=(n?s(e,r,i):s(i))||i);return n&&i&&YS(e,r,i),i};let fo=class extends Ie{constructor(){super(...arguments),this.walletId=void 0,this.src=void 0}render(){var t;const e=le.getWalletId((t=this.walletId)!=null?t:""),r=le.getWalletId(e),n=this.src?this.src:le.getWalletIcon(r);return ee`${n.length?ee`<div><img src="${n}" alt="${this.id}"></div>`:Me.WALLET_PLACEHOLDER}`}};fo.styles=[_e.globalCss,GS],Sl([je()],fo.prototype,"walletId",2),Sl([je()],fo.prototype,"src",2),fo=Sl([Le("w3m-wallet-image")],fo);const JS=He`:host{all:initial}div{display:flex;align-items:center;background-color:var(--w3m-color-overlay);box-shadow:inset 0 0 0 1px var(--w3m-color-overlay);border-radius:10px;padding:4px 4px 4px 8px}div button{border-radius:16px;padding:4px 8px 4px 4px;height:auto;margin-left:10px;color:var(--w3m-color-fg-inverse);background-color:var(--w3m-color-fg-accent)}button::after{content:'';inset:0;position:absolute;background-color:transparent;border-radius:inherit;transition:background-color .2s ease;border:1px solid var(--w3m-color-overlay)}button:hover::after{background-color:var(--w3m-color-overlay)}w3m-avatar{margin-right:6px}w3m-button-big w3m-avatar{margin-left:-5px}`;var XS=Object.defineProperty,QS=Object.getOwnPropertyDescriptor,Rp=(t,e,r,n)=>{for(var i=n>1?void 0:n?QS(e,r):e,o=t.length-1,s;o>=0;o--)(s=t[o])&&(i=(n?s(e,r,i):s(i))||i);return n&&i&&XS(e,r,i),i};let po=class extends Ie{constructor(){super(),this.balance="hide",le.rejectStandaloneButtonComponent()}onOpen(){const{isStandalone:t}=oe.state;t||Ft.open({route:"Account"})}accountTemplate(){return ee`<w3m-avatar></w3m-avatar><w3m-address-text></w3m-address-text>`}render(){return this.balance==="show"?ee`<div><w3m-balance></w3m-balance><button @click="${this.onOpen}">${this.accountTemplate()}</button></div>`:ee`<w3m-button-big @click="${this.onOpen}">${this.accountTemplate()}</w3m-button-big>`}};po.styles=[_e.globalCss,JS],Rp([je()],po.prototype,"balance",2),po=Rp([Le("w3m-account-button")],po);const eA=He`button{display:flex;border-radius:10px;flex-direction:column;transition:background-color .2s ease;justify-content:center;padding:5px;width:100px}button:hover{background-color:var(--w3m-color-overlay)}button:disabled{pointer-events:none}w3m-network-image{width:32px;height:32px}w3m-text{margin-top:4px}`;var tA=Object.defineProperty,rA=Object.getOwnPropertyDescriptor,Al=(t,e,r,n)=>{for(var i=n>1?void 0:n?rA(e,r):e,o=t.length-1,s;o>=0;o--)(s=t[o])&&(i=(n?s(e,r,i):s(i))||i);return n&&i&&tA(e,r,i),i};let go=class extends Ie{constructor(){super(),this.chainId="",this.label="",this.unsubscribeNetwork=void 0;const{selectedChain:t}=oe.state;this.chainId=t?.id.toString(),this.label=t?.name,this.unsubscribeNetwork=oe.subscribe(({selectedChain:e})=>{this.chainId=e?.id.toString(),this.label=e?.name})}disconnectedCallback(){var t;(t=this.unsubscribeNetwork)==null||t.call(this)}onClick(){st.push("SelectNetwork")}render(){const{chains:t}=oe.state,e=t&&t.length>1;return ee`<button @click="${this.onClick}" ?disabled="${!e}"><w3m-network-image chainId="${ir(this.chainId)}"></w3m-network-image><w3m-text variant="xsmall-normal" color="accent">${this.label}</w3m-text></button>`}};go.styles=[_e.globalCss,eA],Al([ut()],go.prototype,"chainId",2),Al([ut()],go.prototype,"label",2),go=Al([Le("w3m-account-network-button")],go);const nA=He`@keyframes slide{0%{background-position:0 0}100%{background-position:200px 0}}w3m-text{padding:1px 0}.w3m-loading{background:linear-gradient(270deg,var(--w3m-color-fg-1) 36.33%,var(--w3m-color-fg-3) 42.07%,var(--w3m-color-fg-1) 83.3%);background-size:200px 100%;background-clip:text;-webkit-background-clip:text;-webkit-text-fill-color:transparent;animation-name:slide;animation-duration:1.5s;animation-iteration-count:infinite;animation-timing-function:linear}`;var iA=Object.defineProperty,oA=Object.getOwnPropertyDescriptor,mo=(t,e,r,n)=>{for(var i=n>1?void 0:n?oA(e,r):e,o=t.length-1,s;o>=0;o--)(s=t[o])&&(i=(n?s(e,r,i):s(i))||i);return n&&i&&iA(e,r,i),i};let yn=class extends Ie{constructor(){super(),this.address=void 0,this.name=void 0,this.loading=!0,this.variant="button",this.unsubscribeAccount=void 0,this.address=oe.state.address,this.name=oe.state.profileName,this.loading=Boolean(oe.state.profileLoading),this.unsubscribeAccount=oe.subscribe(({address:t,profileName:e,profileLoading:r})=>{this.address=t,this.name=e,this.loading=Boolean(r)})}disconnectedCallback(){var t;(t=this.unsubscribeAccount)==null||t.call(this)}render(){var t;const e=this.variant==="button",r={"w3m-loading":this.loading};return ee`<w3m-text class="${tr(r)}" variant="${e?"medium-normal":"large-bold"}" color="${e?"inverse":"primary"}">${this.name?this.name:le.truncate((t=this.address)!=null?t:"")}</w3m-text>`}};yn.styles=[_e.globalCss,nA],mo([ut()],yn.prototype,"address",2),mo([ut()],yn.prototype,"name",2),mo([ut()],yn.prototype,"loading",2),mo([je()],yn.prototype,"variant",2),yn=mo([Le("w3m-address-text")],yn);const sA=He`@keyframes scroll{0%{transform:translate3d(0,0,0)}100%{transform:translate3d(calc(-70px * 10),0,0)}}.w3m-slider{position:relative;overflow-x:hidden;padding:10px 0;margin:0 -20px}.w3m-slider::after,.w3m-slider::before{content:'';height:100%;width:50px;z-index:2;position:absolute;background:linear-gradient(to right,var(--w3m-color-bg-1) 0,transparent 100%);top:0}.w3m-slider::before{left:0}.w3m-slider::after{right:0;transform:rotateZ(180deg)}.w3m-track{display:flex;width:calc(70px * 20);animation:scroll 20s linear infinite}.w3m-action{padding:30px 0 10px 0;display:flex;justify-content:center;align-items:center;flex-direction:column}.w3m-action w3m-button-big:last-child{margin-top:10px}w3m-wallet-image{width:60px;height:60px;margin:0 5px;box-shadow:0 2px 4px -2px rgba(0,0,0,.12),0 4px 4px -2px rgba(0,0,0,.08);border-radius:15px}`;var aA=Object.defineProperty,cA=Object.getOwnPropertyDescriptor,lA=(t,e,r,n)=>{for(var i=n>1?void 0:n?cA(e,r):e,o=t.length-1,s;o>=0;o--)(s=t[o])&&(i=(n?s(e,r,i):s(i))||i);return n&&i&&aA(e,r,i),i};let Il=class extends Ie{onGoToQrcode(){st.push("Qrcode")}onGoToGetWallet(){st.push("GetWallet")}render(){const{previewWallets:t}=Ct.state,e=t.length,r=[...t,...t];return ee`<w3m-modal-header title="Connect your wallet" .onAction="${this.onGoToQrcode}" .actionIcon="${Me.QRCODE_ICON}"></w3m-modal-header><w3m-modal-content>${e?ee`<div class="w3m-slider"><div class="w3m-track">${r.map(({image_url:n})=>ee`<w3m-wallet-image src="${n.lg}"></w3m-wallet-image>`)}</div></div>`:null}<div class="w3m-action"><w3m-button-big @click="${le.handleAndroidLinking}"><w3m-text variant="medium-normal" color="inverse">Select Wallet</w3m-text></w3m-button-big><w3m-button-big variant="secondary" @click="${this.onGoToGetWallet}"><w3m-text variant="medium-normal" color="accent">I don’t have a wallet</w3m-text></w3m-button-big></div></w3m-modal-content>`}};Il.styles=[_e.globalCss,sA],Il=lA([Le("w3m-android-wallet-selection")],Il);const uA=He`@keyframes slide{0%{transform:translateX(-50px)}100%{transform:translateX(200px)}}.w3m-placeholder,img{border-radius:50%;box-shadow:inset 0 0 0 1px var(--w3m-color-overlay);display:block;position:relative;overflow:hidden!important;background-color:var(--w3m-color-av-1);background-image:radial-gradient(at 66% 77%,var(--w3m-color-av-2) 0,transparent 50%),radial-gradient(at 29% 97%,var(--w3m-color-av-3) 0,transparent 50%),radial-gradient(at 99% 86%,var(--w3m-color-av-4) 0,transparent 50%),radial-gradient(at 29% 88%,var(--w3m-color-av-5) 0,transparent 50%);transform:translateZ(0)}.w3m-loader{width:50px;height:100%;background:linear-gradient(270deg,transparent 0,rgba(255,255,255,.4) 30%,transparent 100%);animation-name:slide;animation-duration:1.5s;transform:translateX(-50px);animation-iteration-count:infinite;animation-timing-function:linear;animation-delay:.55s}.w3m-small{width:24px;height:24px}.w3m-medium{width:60px;height:60px}`;var hA=Object.defineProperty,fA=Object.getOwnPropertyDescriptor,bo=(t,e,r,n)=>{for(var i=n>1?void 0:n?fA(e,r):e,o=t.length-1,s;o>=0;o--)(s=t[o])&&(i=(n?s(e,r,i):s(i))||i);return n&&i&&hA(e,r,i),i};let wn=class extends Ie{constructor(){super(),this.address=void 0,this.avatar=void 0,this.loading=!0,this.size="small",this.unsubscribeAccount=void 0,this.address=oe.state.address,this.avatar=oe.state.profileAvatar,this.loading=Boolean(oe.state.profileLoading),this.unsubscribeAccount=oe.subscribe(({address:t,profileAvatar:e,profileLoading:r})=>{this.address=t,this.avatar=e,this.loading=Boolean(r)})}disconnectedCallback(){var t;(t=this.unsubscribeAccount)==null||t.call(this)}render(){const t={"w3m-placeholder":!0,"w3m-small":this.size==="small","w3m-medium":this.size==="medium"};return this.avatar?ee`<img class="${tr(t)}" src="${this.avatar}">`:this.address?(le.generateAvatarColors(this.address),ee`<div class="${tr(t)}">${this.loading?ee`<div class="w3m-loader"></div>`:null}</div>`):null}};wn.styles=[_e.globalCss,uA],bo([ut()],wn.prototype,"address",2),bo([ut()],wn.prototype,"avatar",2),bo([ut()],wn.prototype,"loading",2),bo([je()],wn.prototype,"size",2),wn=bo([Le("w3m-avatar")],wn);const dA=He`div{display:flex;align-items:center}w3m-token-image{width:28px;height:28px;margin-right:6px}`;var pA=Object.defineProperty,gA=Object.getOwnPropertyDescriptor,Ol=(t,e,r,n)=>{for(var i=n>1?void 0:n?gA(e,r):e,o=t.length-1,s;o>=0;o--)(s=t[o])&&(i=(n?s(e,r,i):s(i))||i);return n&&i&&pA(e,r,i),i};let yo=class extends Ie{constructor(){var t,e;super(),this.symbol=void 0,this.amount=void 0,this.unsubscribeAccount=void 0,this.symbol=(t=oe.state.balance)==null?void 0:t.symbol,this.amount=(e=oe.state.balance)==null?void 0:e.amount,this.unsubscribeAccount=oe.subscribe(({balance:r})=>{this.symbol=r?.symbol,this.amount=r?.amount})}disconnectedCallback(){var t;(t=this.unsubscribeAccount)==null||t.call(this)}render(){let t="_._";return this.amount==="0.0"&&(t=0),this.amount&&this.amount.length>6&&(t=parseFloat(this.amount).toFixed(3)),ee`<div><w3m-token-image symbol="${ir(this.symbol)}"></w3m-token-image><w3m-text variant="medium-normal" color="primary">${t} ${this.symbol}</w3m-text></div>`}};yo.styles=[_e.globalCss,dA],Ol([ut()],yo.prototype,"symbol",2),Ol([ut()],yo.prototype,"amount",2),yo=Ol([Le("w3m-balance")],yo);const mA=He`:host{all:initial}svg{width:28px;height:20px;margin:-1px 3px 0 -5px}svg path{fill:var(--w3m-color-fg-inverse)}button:disabled svg path{fill:var(--w3m-color-fg-3)}w3m-spinner{margin:0 10px 0 0}`;var bA=Object.defineProperty,yA=Object.getOwnPropertyDescriptor,Vs=(t,e,r,n)=>{for(var i=n>1?void 0:n?yA(e,r):e,o=t.length-1,s;o>=0;o--)(s=t[o])&&(i=(n?s(e,r,i):s(i))||i);return n&&i&&bA(e,r,i),i};let vn=class extends Ie{constructor(){super(),this.loading=!1,this.label="Connect Wallet",this.icon="show",this.modalUnsub=void 0,le.rejectStandaloneButtonComponent(),this.modalUnsub=Ft.subscribe(t=>{t.open&&(this.loading=!0),t.open||(this.loading=!1)})}disconnectedCallback(){var t;(t=this.modalUnsub)==null||t.call(this)}iconTemplate(){return this.icon==="show"?Me.WALLET_CONNECT_ICON:null}onClick(){oe.state.isConnected?this.onDisconnect():this.onConnect()}onConnect(){this.loading=!0;const{enableNetworkView:t}=vt.state,{chains:e,selectedChain:r}=oe.state,n=e?.length&&e.length>1;t||n&&!r?Ft.open({route:"SelectNetwork"}):Ft.open({route:"ConnectWallet"})}onDisconnect(){wt.client().disconnect(),oe.resetAccount()}render(){return ee`<w3m-button-big .disabled="${this.loading}" @click="${this.onClick}">${this.loading?ee`<w3m-spinner></w3m-spinner><w3m-text variant="medium-normal" color="accent">Connecting...</w3m-text>`:ee`${this.iconTemplate()}<w3m-text variant="medium-normal" color="inverse">${this.label}</w3m-text>`}</w3m-button-big>`}};vn.styles=[_e.globalCss,mA],Vs([ut()],vn.prototype,"loading",2),Vs([je()],vn.prototype,"label",2),Vs([je()],vn.prototype,"icon",2),vn=Vs([Le("w3m-connect-button")],vn);var wA=Object.defineProperty,vA=Object.getOwnPropertyDescriptor,wo=(t,e,r,n)=>{for(var i=n>1?void 0:n?vA(e,r):e,o=t.length-1,s;o>=0;o--)(s=t[o])&&(i=(n?s(e,r,i):s(i))||i);return n&&i&&wA(e,r,i),i};let _n=class extends Ie{constructor(){super(),this.isConnected=!1,this.label="Connect Wallet",this.icon="show",this.balance="hide",this.unsubscribeAccount=void 0,le.rejectStandaloneButtonComponent(),this.isConnected=oe.state.isConnected,this.unsubscribeAccount=oe.subscribe(({isConnected:t})=>{this.isConnected=t})}disconnectedCallback(){var t;(t=this.unsubscribeAccount)==null||t.call(this)}render(){const{enableAccountView:t}=vt.state;return this.isConnected&&t?ee`<w3m-account-button balance="${ir(this.balance)}"></w3m-account-button>`:ee`<w3m-connect-button label="${this.isConnected?"Disconnect":ir(this.label)}" icon="${ir(this.icon)}"></w3m-connect-button>`}};wo([ut()],_n.prototype,"isConnected",2),wo([je()],_n.prototype,"label",2),wo([je()],_n.prototype,"icon",2),wo([je()],_n.prototype,"balance",2),_n=wo([Le("w3m-core-button")],_n);const sr={allowedExplorerListings(t){const{explorerAllowList:e,explorerDenyList:r}=vt.state;let n=[...t];return e&&(n=n.filter(i=>e.includes(i.id))),r&&(n=n.filter(i=>!r.includes(i.id))),n},walletsWithInjected(t){let e=[...t??[]];if(window.ethereum){const r=le.getWalletName("");e=e.filter(({name:n})=>!le.caseSafeIncludes(n,r))}return e},connectorWallets(){const{isStandalone:t}=oe.state;if(t)return[];let e=wt.client().getConnectors();return!window.ethereum&&ct.isMobile()&&(e=e.filter(({id:r})=>r!=="injected"&&r!==Cr.metaMask)),e},walletTemplatesWithRecent(t,e){let r=[...t];if(e){const n=le.getRecentWallet();r=r.filter(i=>!i.values.includes(n?.name)),r.splice(1,0,e)}return r},deduplicateExplorerListingsFromConnectors(t){const{isStandalone:e}=oe.state;if(e)return t;const r=wt.client().getConnectors().map(({name:n})=>n.toUpperCase());return t.filter(({name:n})=>!r.includes(n.toUpperCase()))}},_A=He`.w3m-grid{display:grid;grid-template-columns:repeat(4,80px);justify-content:space-between}.w3m-desktop-title,.w3m-mobile-title{display:flex;align-items:center}.w3m-mobile-title{justify-content:space-between;margin-bottom:20px;margin-top:-10px}.w3m-desktop-title{margin-bottom:10px;padding:0 10px}.w3m-subtitle{display:flex;align-items:center}.w3m-subtitle:last-child path{fill:var(--w3m-color-fg-3)}.w3m-desktop-title svg,.w3m-mobile-title svg{margin-right:6px}.w3m-desktop-title path,.w3m-mobile-title path{fill:var(--w3m-color-fg-accent)}`;var EA=Object.defineProperty,xA=Object.getOwnPropertyDescriptor,CA=(t,e,r,n)=>{for(var i=n>1?void 0:n?xA(e,r):e,o=t.length-1,s;o>=0;o--)(s=t[o])&&(i=(n?s(e,r,i):s(i))||i);return n&&i&&EA(e,r,i),i};let Dl=class extends Ie{onDesktopWallet(t){st.push("DesktopConnector",{DesktopConnector:t})}onInjectedWallet(){st.push("InjectedConnector")}onInstallConnector(){st.push("InstallConnector",{InstallConnector:{id:"metaMask",name:"MetaMask",isMobile:!0,url:"https://metamask.io"}})}async onConnectorWallet(t){window.ethereum?t==="injected"||t===Cr.metaMask?this.onInjectedWallet():await le.handleConnectorConnection(t):this.onInstallConnector()}desktopWalletsTemplate(){const{desktopWallets:t}=vt.state;return t?.map(({id:e,name:r,links:{universal:n,native:i}})=>ee`<w3m-wallet-button walletId="${e}" name="${r}" .onClick="${()=>this.onDesktopWallet({name:r,walletId:e,universal:n,native:i})}"></w3m-wallet-button>`)}previewWalletsTemplate(){let t=sr.allowedExplorerListings(Ct.state.previewWallets);return t=sr.deduplicateExplorerListingsFromConnectors(t),t.map(({name:e,desktop:{universal:r,native:n},homepage:i,image_url:o,id:s})=>ee`<w3m-wallet-button src="${o.lg}" name="${e}" .onClick="${()=>this.onDesktopWallet({walletId:s,name:e,native:n,universal:r||i,icon:o.lg})}"></w3m-wallet-button>`)}connectorWalletsTemplate(){return sr.connectorWallets().map(({id:t,name:e,ready:r})=>ee`<w3m-wallet-button .installed="${["injected","metaMask"].includes(t)&&r}" name="${e}" walletId="${t}" .onClick="${async()=>this.onConnectorWallet(t)}"></w3m-wallet-button>`)}recentWalletTemplate(){const t=le.getRecentWallet();if(!t)return;const{id:e,name:r,links:n,image:i}=t;return ee`<w3m-wallet-button .recent="${!0}" name="${r}" walletId="${ir(e)}" src="${ir(i)}" .onClick="${()=>this.onDesktopWallet({name:r,walletId:e,universal:n?.universal,native:n?.native,icon:i})}"></w3m-wallet-button>`}render(){const{standaloneUri:t}=oe.state,e=this.desktopWalletsTemplate(),r=this.previewWalletsTemplate(),n=this.connectorWalletsTemplate(),i=this.recentWalletTemplate(),o=[...e??[],...r],s=[...n,...o],a=sr.walletTemplatesWithRecent(s,i),l=sr.walletTemplatesWithRecent(o,i),u=t?l:a,d=u.length>4;let y=[];d?y=u.filter(v=>!v.values.includes(Cr.coinbaseWallet)).slice(0,3):y=u;const m=Boolean(y.length);return ee`<w3m-modal-header border="${!0}" title="Connect your wallet" .onAction="${le.handleUriCopy}" .actionIcon="${Me.COPY_ICON}"></w3m-modal-header><w3m-modal-content><div class="w3m-mobile-title"><div class="w3m-subtitle">${Me.MOBILE_ICON}<w3m-text variant="small-normal" color="accent">Mobile</w3m-text></div><div class="w3m-subtitle">${Me.SCAN_ICON}<w3m-text variant="small-normal" color="secondary">Scan with your wallet</w3m-text></div></div><w3m-walletconnect-qr></w3m-walletconnect-qr></w3m-modal-content>${m?ee`<w3m-modal-footer><div class="w3m-desktop-title">${Me.DESKTOP_ICON}<w3m-text variant="small-normal" color="accent">Desktop</w3m-text></div><div class="w3m-grid">${y} ${d?ee`<w3m-view-all-wallets-button></w3m-view-all-wallets-button>`:null}</div></w3m-modal-footer>`:null}`}};Dl.styles=[_e.globalCss,_A],Dl=CA([Le("w3m-desktop-wallet-selection")],Dl);const SA=He`div{background-color:var(--w3m-color-bg-2);padding:10px 20px 15px 20px;border-top:1px solid var(--w3m-color-bg-3);text-align:center}a{color:var(--w3m-color-fg-accent);text-decoration:none;transition:opacity .2s ease-in-out}a:hover{opacity:.8}`;var AA=Object.defineProperty,IA=Object.getOwnPropertyDescriptor,OA=(t,e,r,n)=>{for(var i=n>1?void 0:n?IA(e,r):e,o=t.length-1,s;o>=0;o--)(s=t[o])&&(i=(n?s(e,r,i):s(i))||i);return n&&i&&AA(e,r,i),i};let $l=class extends Ie{render(){const{termsOfServiceUrl:t,privacyPolicyUrl:e}=vt.state;return t??e?ee`<div><w3m-text variant="small-normal" color="secondary">By connecting your wallet, you agree to our<br>${t?ee`<a href="${t}" target="_blank" rel="noopener noreferrer">Terms of Service</a>`:null} ${t&&e?"and":null} ${e?ee`<a href="${e}" target="_blank" rel="noopener noreferrer">Privacy Policy</a>`:null}</w3m-text></div>`:null}};$l.styles=[_e.globalCss,SA],$l=OA([Le("w3m-legal-notice")],$l);const DA=He`.w3m-grid{display:grid;grid-template-columns:repeat(4,80px);margin:0 -10px;justify-content:space-between;row-gap:10px}`;var $A=Object.defineProperty,FA=Object.getOwnPropertyDescriptor,PA=(t,e,r,n)=>{for(var i=n>1?void 0:n?FA(e,r):e,o=t.length-1,s;o>=0;o--)(s=t[o])&&(i=(n?s(e,r,i):s(i))||i);return n&&i&&$A(e,r,i),i};let Fl=class extends Ie{onGoToQrcode(){st.push("Qrcode")}async onConnectorWallet(t){await le.handleConnectorConnection(t)}mobileWalletsTemplate(){const{mobileWallets:t}=vt.state,e=sr.walletsWithInjected(t);if(e.length)return e.map(({id:r,name:n,links:{universal:i,native:o}})=>ee`<w3m-wallet-button name="${n}" walletId="${r}" .onClick="${async()=>le.handleMobileLinking({links:{native:o,universal:i},name:n,id:r})}"></w3m-wallet-button>`)}previewWalletsTemplate(){const{previewWallets:t}=Ct.state;let e=sr.walletsWithInjected(t);return e=sr.allowedExplorerListings(e),e=sr.deduplicateExplorerListingsFromConnectors(e),e.map(({image_url:r,name:n,mobile:{native:i,universal:o},id:s})=>ee`<w3m-wallet-button name="${n}" src="${r.lg}" .onClick="${async()=>le.handleMobileLinking({links:{native:i,universal:o},name:n,id:s,image:r.lg})}"></w3m-wallet-button>`)}connectorWalletsTemplate(){let t=sr.connectorWallets();return window.ethereum||(t=t.filter(({id:e})=>e!=="injected"&&e!==Cr.metaMask)),t.map(({name:e,id:r,ready:n})=>ee`<w3m-wallet-button .installed="${["injected","metaMask"].includes(r)&&n}" name="${e}" walletId="${r}" .onClick="${async()=>this.onConnectorWallet(r)}"></w3m-wallet-button>`)}recentWalletTemplate(){const t=le.getRecentWallet();if(!t)return;const{id:e,name:r,links:n,image:i}=t;return ee`<w3m-wallet-button .recent="${!0}" name="${r}" walletId="${ir(e)}" src="${ir(i)}" .onClick="${async()=>le.handleMobileLinking({name:r,id:e,links:n,image:i})}"></w3m-wallet-button>`}render(){const{standaloneUri:t}=oe.state,e=this.connectorWalletsTemplate(),r=this.mobileWalletsTemplate(),n=this.previewWalletsTemplate(),i=this.recentWalletTemplate(),o=r??n,s=[...e,...o],a=sr.walletTemplatesWithRecent(s,i),l=sr.walletTemplatesWithRecent(o,i),u=t?l:a,d=u.length>8;let y=[];d?y=u.filter(R=>!R.values.includes(Cr.coinbaseWallet)).slice(0,7):y=u;const m=y.slice(0,4),v=y.slice(4,8),_=Boolean(y.length);return ee`<w3m-modal-header title="Connect your wallet" .onAction="${this.onGoToQrcode}" .actionIcon="${Me.QRCODE_ICON}"></w3m-modal-header>${_?ee`<w3m-modal-content><div class="w3m-grid">${m} ${v.length?ee`${v} ${d?ee`<w3m-view-all-wallets-button></w3m-view-all-wallets-button>`:null}`:null}</div></w3m-modal-content>`:null}`}};Fl.styles=[_e.globalCss,DA],Fl=PA([Le("w3m-mobile-wallet-selection")],Fl);const TA=He`:host{all:initial}.w3m-overlay{inset:0;position:fixed;z-index:var(--w3m-modal-z-index);overflow:hidden;display:flex;justify-content:center;align-items:center;background-color:rgba(0,0,0,.3);opacity:0;pointer-events:none}.w3m-open{pointer-events:auto}.w3m-container{position:relative;max-width:360px;width:100%;outline:0}.w3m-card{width:100%;position:relative;transform:translateY(5px);border-radius:30px;overflow:hidden;box-shadow:0 6px 14px -6px rgba(10,16,31,.12),0 10px 32px -4px rgba(10,16,31,.1),0 0 0 1px var(--w3m-color-overlay);background-color:var(--w3m-color-bg-1);color:var(--w3m-color-fg-1)}@media(max-width:600px){.w3m-container{max-width:440px}.w3m-card{border-radius:40px 40px 0 0}.w3m-overlay{align-items:flex-end}}@media(max-width:600px){.w3m-container{max-width:440px}.w3m-card{transform:translateY(5px);border-radius:40px 40px 0 0}.w3m-overlay{align-items:flex-end}}`;var NA=Object.defineProperty,RA=Object.getOwnPropertyDescriptor,qs=(t,e,r,n)=>{for(var i=n>1?void 0:n?RA(e,r):e,o=t.length-1,s;o>=0;o--)(s=t[o])&&(i=(n?s(e,r,i):s(i))||i);return n&&i&&NA(e,r,i),i};let En=class extends Ie{constructor(){if(super(),this.open=!1,this.preload=!0,this.activeChainId=void 0,this.unsubscribeModal=void 0,this.unsubscribeConfig=void 0,this.unwatchAccount=void 0,this.unwatchNetwork=void 0,this.abortController=void 0,_e.setTheme(),this.unsubscribeConfig=vt.subscribe(_e.setTheme),this.unsubscribeModal=Ft.subscribe(t=>{t.open?this.onOpenModalEvent():this.onCloseModalEvent()}),!oe.state.isStandalone){oe.getAccount();const t=oe.getSelectedChain();this.activeChainId=t?.id,this.fetchEnsProfile(),this.fetchBalance(),this.unwatchNetwork=wt.client().watchNetwork(e=>{const r=e.chain;r&&this.activeChainId!==r.id&&(oe.setSelectedChain(r),this.activeChainId=r.id,oe.resetBalance(),this.fetchBalance())}),this.unwatchAccount=wt.client().watchAccount(e=>{const{address:r}=oe.state;e.address!==r&&(this.fetchEnsProfile(e.address),this.fetchBalance(e.address)),oe.setAddress(e.address),oe.setIsConnected(e.isConnected)})}this.preloadModalData()}disconnectedCallback(){var t,e,r,n;(t=this.unsubscribeModal)==null||t.call(this),(e=this.unsubscribeConfig)==null||e.call(this),(r=this.unwatchAccount)==null||r.call(this),(n=this.unwatchNetwork)==null||n.call(this)}get overlayEl(){return le.getShadowRootElement(this,".w3m-overlay")}get containerEl(){return le.getShadowRootElement(this,".w3m-container")}async fetchEnsProfile(t){try{if(vt.state.enableAccountView){oe.setProfileLoading(!0);const e=t??oe.state.address,{id:r}=wt.client().getDefaultChain();if(e&&r===1){const[n,i]=await Promise.all([wt.client().fetchEnsName({address:e,chainId:1}),wt.client().fetchEnsAvatar({address:e,chainId:1})]);i&&await le.preloadImage(i),oe.setProfileName(n),oe.setProfileAvatar(i)}}}catch(e){console.error(e),er.openToast(le.getErrorMessage(e),"error")}finally{oe.setProfileLoading(!1)}}async fetchBalance(t){try{if(vt.state.enableAccountView){oe.setBalanceLoading(!0);const e=t??oe.state.address;if(e){const r=await wt.client().fetchBalance({address:e});oe.setBalance({amount:r.formatted,symbol:r.symbol})}}}catch(e){console.error(e),er.openToast(le.getErrorMessage(e),"error")}finally{oe.setBalanceLoading(!1)}}toggleBodyScroll(t){document.querySelector("body")&&(t?document.getElementById("w3m-styles")?.remove():document.head.insertAdjacentHTML("beforeend",'<style id="w3m-styles">html,body{touch-action:none;overflow:hidden;overscroll-behavior:contain;}</style>'))}async preloadExplorerData(){var t;const{standaloneChains:e,chains:r,walletConnectVersion:n}=oe.state,i=e?.join(",");await Promise.all([Ct.getPreviewWallets({page:1,entries:10,chains:i,device:ct.isMobile()?"mobile":"desktop",version:n}),Ct.getRecomendedWallets()]),oe.setIsDataLoaded(!0);const{previewWallets:o,recomendedWallets:s}=Ct.state,a=(t=r?.map(u=>le.getChainIcon(u.id)))!=null?t:[],l=[...o,...s].map(u=>u.image_url.lg);await this.preloadExplorerImages([...a,...l])}async preloadExplorerImages(t){t.length&&await Promise.all(t.map(async e=>le.preloadImage(e)))}async preloadCustomImages(){const t=le.getCustomImageUrls();t.length&&await Promise.all(t.map(async e=>le.preloadImage(e)))}async preloadConnectorImages(){if(!oe.state.isStandalone){const t=le.getConnectorImageUrls();t.length&&await Promise.all(t.map(async e=>le.preloadImage(e)))}}async preloadModalData(){try{this.preload&&(this.preload=!1,await Promise.all([this.preloadExplorerData(),this.preloadCustomImages(),this.preloadConnectorImages()]))}catch(t){console.error(t),er.openToast("Failed preloading","error")}}onCloseModal(t){t.target===t.currentTarget&&Ft.close()}async onOpenModalEvent(){await this.preloadModalData(),this.toggleBodyScroll(!1);const t=.2;await Wr(this.containerEl,{y:0},{duration:0}).finished,Wr(this.overlayEl,{opacity:[0,1]},{duration:.2,delay:t}),Wr(this.containerEl,le.isMobileAnimation()?{y:["50vh",0]}:{scale:[.98,1]},{scale:{easing:$s({velocity:.4})},y:{easing:$s({mass:.5})},delay:t}),this.addKeyboardEvents(),this.open=!0}async onCloseModalEvent(){this.toggleBodyScroll(!0),this.removeKeyboardEvents(),await Promise.all([Wr(this.containerEl,le.isMobileAnimation()?{y:[0,"50vh"]}:{scale:[1,.98]},{scale:{easing:$s({velocity:0})},y:{easing:$s({mass:.5})}}).finished,Wr(this.overlayEl,{opacity:[1,0]},{duration:.2}).finished]),this.open=!1}addKeyboardEvents(){this.abortController=new AbortController,window.addEventListener("keydown",t=>{var e;t.key==="Escape"?Ft.close():t.key==="Tab"&&((e=t.target)!=null&&e.tagName.includes("W3M-")||this.containerEl.focus())},this.abortController),this.containerEl.focus()}removeKeyboardEvents(){var t;(t=this.abortController)==null||t.abort(),this.abortController=void 0}render(){const t={"w3m-overlay":!0,"w3m-open":this.open};return ee`<div id="w3m-modal" class="${tr(t)}" @click="${this.onCloseModal}" role="alertdialog" aria-modal="true"><div class="w3m-container" tabindex="0">${this.open?ee`<w3m-modal-backcard></w3m-modal-backcard><div class="w3m-card"><w3m-modal-router></w3m-modal-router><w3m-modal-toast></w3m-modal-toast></div>`:null}</div></div>`}};En.styles=[_e.globalCss,TA],qs([ut()],En.prototype,"open",2),qs([ut()],En.prototype,"preload",2),qs([ut()],En.prototype,"activeChainId",2),En=qs([Le("w3m-modal")],En);const LA=He`:host{all:initial}w3m-network-image{margin-left:-6px;margin-right:6px;width:28px;height:28px}`;var MA=Object.defineProperty,UA=Object.getOwnPropertyDescriptor,Ks=(t,e,r,n)=>{for(var i=n>1?void 0:n?UA(e,r):e,o=t.length-1,s;o>=0;o--)(s=t[o])&&(i=(n?s(e,r,i):s(i))||i);return n&&i&&MA(e,r,i),i};let xn=class extends Ie{constructor(){super(),this.chainId="",this.label="",this.wrongNetwork=!1,this.unsubscribeNetwork=void 0,le.rejectStandaloneButtonComponent();const{selectedChain:t}=oe.state;this.onSetChainData(t),this.unsubscribeNetwork=oe.subscribe(({selectedChain:e})=>{this.onSetChainData(e)})}disconnectedCallback(){var t;(t=this.unsubscribeNetwork)==null||t.call(this)}onSetChainData(t){if(t){const{chains:e}=oe.state,r=e?.map(n=>n.id);this.chainId=t.id.toString(),this.wrongNetwork=!(r!=null&&r.includes(t.id)),this.label=this.wrongNetwork?"Wrong Network":t.name}}onClick(){Ft.open({route:"SelectNetwork"})}render(){var t;const{chains:e}=oe.state,r=e&&e.length>1;return ee`<w3m-button-big @click="${this.onClick}" ?disabled="${!r}"><w3m-network-image chainId="${ir(this.chainId)}"></w3m-network-image><w3m-text variant="medium-normal" color="inverse">${(t=this.label)!=null&&t.length?this.label:"Select Network"}</w3m-text></w3m-button-big>`}};xn.styles=[_e.globalCss,LA],Ks([ut()],xn.prototype,"chainId",2),Ks([ut()],xn.prototype,"label",2),Ks([ut()],xn.prototype,"wrongNetwork",2),xn=Ks([Le("w3m-network-switch")],xn);const BA=He`button{display:flex;flex-direction:column;padding:5px 10px;border-radius:10px;transition:background-color .2s ease;height:100%;justify-content:flex-start}.w3m-icons{width:60px;height:60px;display:flex;flex-wrap:wrap;padding:7px;border-radius:15px;justify-content:space-between;align-items:center;margin-bottom:5px;background-color:var(--w3m-color-bg-2);box-shadow:inset 0 0 0 1px var(--w3m-color-overlay)}button:hover{background-color:var(--w3m-color-overlay)}.w3m-icons img{width:21px;height:21px;object-fit:cover;object-position:center;border-radius:8px;border:1px solid var(--w3m-color-overlay)}.w3m-icons svg{width:21px;height:21px}.w3m-icons img:nth-child(1),.w3m-icons img:nth-child(2),.w3m-icons svg:nth-child(1),.w3m-icons svg:nth-child(2){margin-bottom:4px}w3m-text{width:100%;text-align:center}#wallet-placeholder-fill{fill:var(--w3m-color-bg-3)}#wallet-placeholder-dash{stroke:var(--w3m-color-overlay)}`;var jA=Object.defineProperty,kA=Object.getOwnPropertyDescriptor,HA=(t,e,r,n)=>{for(var i=n>1?void 0:n?kA(e,r):e,o=t.length-1,s;o>=0;o--)(s=t[o])&&(i=(n?s(e,r,i):s(i))||i);return n&&i&&jA(e,r,i),i};let Pl=class extends Ie{onClick(){st.push("WalletExplorer")}render(){const{previewWallets:t}=Ct.state,e=le.getCustomWallets(),r=[...t,...e].reverse().slice(0,4);return ee`<button @click="${this.onClick}"><div class="w3m-icons">${r.map(n=>{var i;const o=(i=n.image_url)==null?void 0:i.lg;if(o)return ee`<img src="${o}">`;const s=le.getWalletId(n.id),a=le.getWalletIcon(s);return a?ee`<img src="${a}">`:Me.WALLET_PLACEHOLDER})}</div><w3m-text variant="xsmall-normal">View All</w3m-text></button>`}};Pl.styles=[_e.globalCss,BA],Pl=HA([Le("w3m-view-all-wallets-button")],Pl);const zA=He`.w3m-qr-container{width:100%;display:flex;justify-content:center;align-items:center;aspect-ratio:1/1}`;var WA=Object.defineProperty,VA=Object.getOwnPropertyDescriptor,Lp=(t,e,r,n)=>{for(var i=n>1?void 0:n?VA(e,r):e,o=t.length-1,s;o>=0;o--)(s=t[o])&&(i=(n?s(e,r,i):s(i))||i);return n&&i&&WA(e,r,i),i};let Gs=class extends Ie{constructor(){super(),this.uri="",this.createConnectionAndWait()}get overlayEl(){return le.getShadowRootElement(this,".w3m-qr-container")}async createConnectionAndWait(t=0){var e;try{const{standaloneUri:r}=oe.state;r?setTimeout(()=>this.uri=r,0):(await wt.client().connectWalletConnect(n=>this.uri=n,(e=oe.state.selectedChain)==null?void 0:e.id),Ft.close())}catch(r){console.error(r),er.openToast("Connection request declined","error"),t<2&&this.createConnectionAndWait(t+1)}}render(){return ee`<div class="w3m-qr-container">${this.uri?ee`<w3m-qrcode size="${this.overlayEl.offsetWidth}" uri="${this.uri}"></w3m-qrcode>`:ee`<w3m-spinner></w3m-spinner>`}</div>`}};Gs.styles=[_e.globalCss,zA],Lp([ut()],Gs.prototype,"uri",2),Gs=Lp([Le("w3m-walletconnect-qr")],Gs);const qA=He`.w3m-profile{display:flex;justify-content:space-between;align-items:flex-start;padding-top:20px}.w3m-connection-badge{background-color:var(--w3m-color-bg-2);box-shadow:inset 0 0 0 1px var(--w3m-color-overlay);padding:6px 10px 6px 26px;position:relative;border-radius:28px}.w3m-connection-badge::before{content:'';position:absolute;width:10px;height:10px;left:10px;background-color:var(--w3m-color-success);border-radius:50%;top:50%;margin-top:-5px;box-shadow:0 1px 4px 1px var(--w3m-color-success),inset 0 0 0 1px var(--w3m-color-overlay)}.w3m-footer{display:flex;justify-content:space-between}w3m-address-text{margin-top:10px;display:block}.w3m-balance{border-top:1px solid var(--w3m-color-bg-2);padding:11px 20px}`;var KA=Object.defineProperty,GA=Object.getOwnPropertyDescriptor,YA=(t,e,r,n)=>{for(var i=n>1?void 0:n?GA(e,r):e,o=t.length-1,s;o>=0;o--)(s=t[o])&&(i=(n?s(e,r,i):s(i))||i);return n&&i&&KA(e,r,i),i};let Tl=class extends Ie{onDisconnect(){Ft.close(),wt.client().disconnect(),oe.resetAccount()}async onCopyAddress(){var t;await navigator.clipboard.writeText((t=oe.state.address)!=null?t:""),er.openToast("Address copied","success")}render(){return ee`<w3m-modal-content><div class="w3m-profile"><div class="w3m-info"><w3m-avatar size="medium"></w3m-avatar><w3m-address-text variant="modal"></w3m-address-text></div><div class="w3m-connection-badge"><w3m-text variant="small-normal" color="secondary">Connected</w3m-text></div></div></w3m-modal-content><div class="w3m-balance"><w3m-balance></w3m-balance></div><w3m-modal-footer><div class="w3m-footer"><w3m-account-network-button></w3m-account-network-button><w3m-box-button label="Copy Address" .onClick="${this.onCopyAddress}" .icon="${Me.ACCOUNT_COPY}"></w3m-box-button><w3m-box-button label="Disconnect" .onClick="${this.onDisconnect}" .icon="${Me.ACCOUNT_DISCONNECT}"></w3m-box-button></div></w3m-modal-footer>`}};Tl.styles=[_e.globalCss,qA],Tl=YA([Le("w3m-account-view")],Tl);var ZA=Object.defineProperty,JA=Object.getOwnPropertyDescriptor,XA=(t,e,r,n)=>{for(var i=n>1?void 0:n?JA(e,r):e,o=t.length-1,s;o>=0;o--)(s=t[o])&&(i=(n?s(e,r,i):s(i))||i);return n&&i&&ZA(e,r,i),i};let Nl=class extends Ie{viewTemplate(){return ct.isAndroid()?ee`<w3m-android-wallet-selection></w3m-android-wallet-selection>`:ct.isMobile()?ee`<w3m-mobile-wallet-selection></w3m-mobile-wallet-selection>`:ee`<w3m-desktop-wallet-selection></w3m-desktop-wallet-selection>`}render(){return ee`${this.viewTemplate()}<w3m-legal-notice></w3m-legal-notice>`}};Nl.styles=[_e.globalCss],Nl=XA([Le("w3m-connect-wallet-view")],Nl);const QA=He`.w3m-wrapper{display:flex;align-items:center;justify-content:center;width:100%;aspect-ratio:1/1;flex-direction:column}.w3m-connecting-title{display:flex;align-items:center;justify-content:center;margin-bottom:16px}w3m-spinner{margin-right:10px}w3m-wallet-image{border-radius:15px;width:25%;aspect-ratio:1/1;margin-bottom:20px}.w3m-install-actions{display:flex}.w3m-install-actions w3m-button{margin:0 5px;opacity:1}`;var eI=Object.defineProperty,tI=Object.getOwnPropertyDescriptor,Mp=(t,e,r,n)=>{for(var i=n>1?void 0:n?tI(e,r):e,o=t.length-1,s;o>=0;o--)(s=t[o])&&(i=(n?s(e,r,i):s(i))||i);return n&&i&&eI(e,r,i),i};let Ys=class extends Ie{constructor(){super(),this.uri="",this.createConnectionAndWait()}getRouterData(){var t;const e=(t=st.state.data)==null?void 0:t.DesktopConnector;if(!e)throw new Error("Missing router data");return e}onFormatAndRedirect(t){const{native:e,universal:r,name:n}=this.getRouterData();if(e){const i=ct.formatNativeUrl(e,t,n);ct.openHref(i)}else if(r){const i=ct.formatUniversalUrl(r,t,n);ct.openHref(i,"_blank")}}async createConnectionAndWait(t=0){var e;const{standaloneUri:r}=oe.state,{name:n,walletId:i,native:o,universal:s,icon:a}=this.getRouterData(),l={name:n,id:i,links:{native:o,universal:s},image:a};if(r)le.setRecentWallet(l),this.onFormatAndRedirect(r);else try{await wt.client().connectWalletConnect(u=>{this.uri=u,this.onFormatAndRedirect(u)},(e=oe.state.selectedChain)==null?void 0:e.id),le.setRecentWallet(l),Ft.close()}catch(u){console.error(u),er.openToast("Connection request declined","error"),t<2&&this.createConnectionAndWait(t+1)}}onConnectWithMobile(){st.push("Qrcode")}onGoToWallet(){const{universal:t,name:e}=this.getRouterData();if(t){const r=ct.formatUniversalUrl(t,this.uri,e);ct.openHref(r,"_blank")}}render(){const{name:t,icon:e,universal:r,walletId:n}=this.getRouterData(),i=le.getWalletName(t);return ee`<w3m-modal-header title="${i}"></w3m-modal-header><w3m-modal-content><div class="w3m-wrapper">${e?ee`<w3m-wallet-image src="${e}" size="lg"></w3m-wallet-image>`:ee`<w3m-wallet-image size="lg" walletid="${ir(n)}"></w3m-wallet-image>`}<div class="w3m-connecting-title"><w3m-spinner></w3m-spinner><w3m-text variant="large-bold" color="secondary">${`Continue in ${i}...`}</w3m-text></div><div class="w3m-install-actions"><w3m-button .onClick="${async()=>this.createConnectionAndWait()}" .iconRight="${Me.RETRY_ICON}">Retry</w3m-button>${r?ee`<w3m-button .onClick="${this.onGoToWallet.bind(this)}" .iconLeft="${Me.ARROW_UP_RIGHT_ICON}">Go to Wallet</w3m-button>`:ee`<w3m-button .onClick="${this.onConnectWithMobile}" .iconLeft="${Me.MOBILE_ICON}">Connect with Mobile</w3m-button>`}</div></div></w3m-modal-content>`}};Ys.styles=[_e.globalCss,QA],Mp([ut()],Ys.prototype,"uri",2),Ys=Mp([Le("w3m-desktop-connector-view")],Ys);const rI=He`.w3m-info-text{margin:5px 0 15px;max-width:320px;text-align:center}.w3m-wallet-item{margin:0 -20px 0 0;padding-right:20px;display:flex;align-items:center;border-bottom:1px solid var(--w3m-color-bg-2)}.w3m-wallet-item:last-child{margin-bottom:-20px;border-bottom:0}.w3m-wallet-content{margin-left:20px;height:60px;display:flex;flex:1;align-items:center;justify-content:space-between}.w3m-footer-actions{display:flex;flex-direction:column;align-items:center;padding:20px 0;border-top:1px solid var(--w3m-color-bg-2)}w3m-wallet-image{display:block;width:40px;height:40px;border-radius:10px}`;var nI=Object.defineProperty,iI=Object.getOwnPropertyDescriptor,oI=(t,e,r,n)=>{for(var i=n>1?void 0:n?iI(e,r):e,o=t.length-1,s;o>=0;o--)(s=t[o])&&(i=(n?s(e,r,i):s(i))||i);return n&&i&&nI(e,r,i),i};let Rl=class extends Ie{constructor(){super(...arguments),this.explorerUrl="https://explorer.walletconnect.com/"}onGet(t){ct.openHref(t,"_blank")}onExplore(){ct.openHref(this.explorerUrl,"_blank")}render(){const{recomendedWallets:t}=Ct.state,e=le.getCustomWallets().slice(0,6),r=t.length,n=e.length;return ee`<w3m-modal-header title="Get a wallet"></w3m-modal-header><w3m-modal-content>${r?t.map(({name:i,image_url:o,homepage:s})=>ee`<div class="w3m-wallet-item"><w3m-wallet-image src="${o.lg}"></w3m-wallet-image><div class="w3m-wallet-content"><w3m-text variant="medium-normal">${i}</w3m-text><w3m-button .iconRight="${Me.ARROW_RIGHT_ICON}" .onClick="${()=>this.onGet(s)}">Get</w3m-button></div></div>`):null} ${n?e.map(({name:i,id:o,links:s})=>ee`<div class="w3m-wallet-item"><w3m-wallet-image walletId="${o}"></w3m-wallet-image><div class="w3m-wallet-content"><w3m-text variant="medium-normal">${i}</w3m-text><w3m-button .iconRight="${Me.ARROW_RIGHT_ICON}" .onClick="${()=>this.onGet(s.universal)}">Get</w3m-button></div></div>`):null}</w3m-modal-content><div class="w3m-footer-actions"><w3m-text variant="medium-normal">Not what you're looking for?</w3m-text><w3m-text variant="small-thin" color="secondary" class="w3m-info-text">With hundreds of wallets out there, there's something for everyone</w3m-text><w3m-button .onClick="${this.onExplore.bind(this)}" .iconRight="${Me.ARROW_UP_RIGHT_ICON}">Explore Wallets</w3m-button></div>`}};Rl.styles=[_e.globalCss,rI],Rl=oI([Le("w3m-get-wallet-view")],Rl);const sI=He`.w3m-footer-actions{display:flex;justify-content:center}.w3m-footer-actions w3m-button{margin:0 5px}.w3m-info-container{display:flex;flex-direction:column;justify-content:center;align-items:center;margin-bottom:20px}.w3m-info-container:last-child{margin-bottom:0}.w3m-info-text{margin-top:5px;text-align:center}.w3m-images svg{margin:0 2px 5px;width:55px;height:55px}.help-img-highlight{stroke:var(--w3m-color-overlay)}`;var aI=Object.defineProperty,cI=Object.getOwnPropertyDescriptor,lI=(t,e,r,n)=>{for(var i=n>1?void 0:n?cI(e,r):e,o=t.length-1,s;o>=0;o--)(s=t[o])&&(i=(n?s(e,r,i):s(i))||i);return n&&i&&aI(e,r,i),i};let Ll=class extends Ie{constructor(){super(...arguments),this.learnUrl="https://ethereum.org/en/wallets/"}onGet(){st.push("GetWallet")}onLearnMore(){ct.openHref(this.learnUrl,"_blank")}render(){return ee`<w3m-modal-header title="What is a wallet?"></w3m-modal-header><w3m-modal-content><div class="w3m-info-container"><div class="w3m-images">${Me.HELP_CHART_IMG} ${Me.HELP_PAINTING_IMG} ${Me.HELP_ETH_IMG}</div><w3m-text variant="medium-normal">A home for your digital assets</w3m-text><w3m-text variant="small-thin" color="secondary" class="w3m-info-text">A wallet lets you store, send and receive digital assets like cryptocurrencies and NFTs.</w3m-text></div><div class="w3m-info-container"><div class="w3m-images">${Me.HELP_KEY_IMG} ${Me.HELP_USER_IMG} ${Me.HELP_LOCK_IMG}</div><w3m-text variant="medium-normal">One login for all of web3</w3m-text><w3m-text variant="small-thin" color="secondary" class="w3m-info-text">Log in to any app by connecting your wallet. Say goodbye to countless passwords!</w3m-text></div><div class="w3m-info-container"><div class="w3m-images">${Me.HELP_COMPAS_IMG} ${Me.HELP_NOUN_IMG} ${Me.HELP_DAO_IMG}</div><w3m-text variant="medium-normal">Your gateway to a new web</w3m-text><w3m-text variant="small-thin" color="secondary" class="w3m-info-text">With your wallet, you can explore and interact with DeFi, NFTs, DAOs, and much more.</w3m-text></div><div class="w3m-footer-actions"><w3m-button .onClick="${this.onGet.bind(this)}" .iconLeft="${Me.WALLET_ICON}">Get a Wallet</w3m-button><w3m-button .onClick="${this.onLearnMore.bind(this)}" .iconRight="${Me.ARROW_UP_RIGHT_ICON}">Learn More</w3m-button></div></w3m-modal-content>`}};Ll.styles=[_e.globalCss,sI],Ll=lI([Le("w3m-help-view")],Ll);const uI=He`.w3m-injected-wrapper{display:flex;align-items:center;justify-content:center;width:100%;aspect-ratio:1/1;flex-direction:column}.w3m-connecting-title{display:flex;align-items:center;justify-content:center;margin-bottom:20px}w3m-spinner{margin-right:10px}w3m-wallet-image{border-radius:15px;width:25%;aspect-ratio:1/1;margin-bottom:20px}w3m-button{opacity:0}.w3m-injected-error w3m-button{opacity:1}`;var hI=Object.defineProperty,fI=Object.getOwnPropertyDescriptor,Ml=(t,e,r,n)=>{for(var i=n>1?void 0:n?fI(e,r):e,o=t.length-1,s;o>=0;o--)(s=t[o])&&(i=(n?s(e,r,i):s(i))||i);return n&&i&&hI(e,r,i),i};let vo=class extends Ie{constructor(){super(),this.connecting=!0,this.error=!1,this.connector=wt.client().getConnectorById("injected"),this.onConnect()}async onConnect(){const{ready:t}=this.connector;t&&(this.error=!1,this.connecting=!0,await le.handleConnectorConnection("injected",()=>{this.error=!0,this.connecting=!1}))}render(){const t=le.getWalletName(this.connector.name),e=le.getWalletId(this.connector.id),r={"w3m-injected-wrapper":!0,"w3m-injected-error":this.error};return ee`<w3m-modal-header title="${t}"></w3m-modal-header><w3m-modal-content><div class="${tr(r)}"><w3m-wallet-image walletId="${e}" size="lg"></w3m-wallet-image><div class="w3m-connecting-title">${this.connecting?ee`<w3m-spinner></w3m-spinner>`:null}<w3m-text variant="large-bold" color="${this.error?"error":"secondary"}">${this.error?"Connection declined":`Continue in ${t}...`}</w3m-text></div><w3m-button .onClick="${this.onConnect.bind(this)}" .disabled="${!this.error}" .iconRight="${Me.RETRY_ICON}">Try Again</w3m-button></div></w3m-modal-content>`}};vo.styles=[_e.globalCss,uI],Ml([ut()],vo.prototype,"connecting",2),Ml([ut()],vo.prototype,"error",2),vo=Ml([Le("w3m-injected-connector-view")],vo);const dI=He`.w3m-injected-wrapper{display:flex;align-items:center;justify-content:center;width:100%;aspect-ratio:1/1;flex-direction:column}.w3m-connecting-title{display:flex;align-items:center;justify-content:center;margin-bottom:16px}.w3m-install-title{display:flex;align-items:center;justify-content:center;flex-direction:column}.w3m-install-title w3m-text:last-child{margin-top:10px;max-width:240px}.w3m-install-actions{display:flex;margin-top:15px;align-items:center;flex-direction:column}@media(max-width:355px){.w3m-install-actions{flex-direction:column;align-items:center}}w3m-wallet-image{border-radius:15px;width:25%;aspect-ratio:1/1;margin-bottom:20px}w3m-button{opacity:0}.w3m-install-actions w3m-button{margin:5px;opacity:1}.w3m-info-text{text-align:center}`;var pI=Object.defineProperty,gI=Object.getOwnPropertyDescriptor,mI=(t,e,r,n)=>{for(var i=n>1?void 0:n?gI(e,r):e,o=t.length-1,s;o>=0;o--)(s=t[o])&&(i=(n?s(e,r,i):s(i))||i);return n&&i&&pI(e,r,i),i};let Ul=class extends Ie{getRouterData(){var t;const e=(t=st.state.data)==null?void 0:t.InstallConnector;if(!e)throw new Error("Missing router data");return e}onInstall(){const{url:t}=this.getRouterData();ct.openHref(t,"_blank")}onMobile(){const{name:t}=this.getRouterData();st.push("ConnectWallet"),er.openToast(`Scan the code with ${t}`,"success")}render(){const{name:t,id:e,isMobile:r}=this.getRouterData();return ee`<w3m-modal-header title="${t}"></w3m-modal-header><w3m-modal-content><div class="w3m-injected-wrapper"><w3m-wallet-image walletId="${e}" size="lg"></w3m-wallet-image><div class="w3m-install-title"><w3m-text variant="large-bold">Install ${t}</w3m-text><w3m-text color="secondary" variant="medium-thin" class="w3m-info-text">To connect ${t}, install the browser extension.</w3m-text></div><div class="w3m-install-actions"><w3m-button .onClick="${this.onInstall.bind(this)}" .iconLeft="${Me.ARROW_DOWN_ICON}">Install Extension</w3m-button>${r?ee`<w3m-button .onClick="${this.onMobile.bind(this)}" .iconLeft="${Me.MOBILE_ICON}">${t} Mobile</w3m-button>`:null}</div></div></w3m-modal-content>`}};Ul.styles=[_e.globalCss,dI],Ul=mI([Le("w3m-install-connector-view")],Ul);var bI=Object.defineProperty,yI=Object.getOwnPropertyDescriptor,wI=(t,e,r,n)=>{for(var i=n>1?void 0:n?yI(e,r):e,o=t.length-1,s;o>=0;o--)(s=t[o])&&(i=(n?s(e,r,i):s(i))||i);return n&&i&&bI(e,r,i),i};let Bl=class extends Ie{render(){return ee`<w3m-modal-header title="Scan the code" .onAction="${le.handleUriCopy}" .actionIcon="${Me.COPY_ICON}"></w3m-modal-header><w3m-modal-content><w3m-walletconnect-qr></w3m-walletconnect-qr></w3m-modal-content>`}};Bl.styles=[_e.globalCss],Bl=wI([Le("w3m-qrcode-view")],Bl);const vI=He`.w3m-grid{display:grid;grid-template-columns:repeat(4,80px);margin:-5px -10px;justify-content:space-between}`;var _I=Object.defineProperty,EI=Object.getOwnPropertyDescriptor,xI=(t,e,r,n)=>{for(var i=n>1?void 0:n?EI(e,r):e,o=t.length-1,s;o>=0;o--)(s=t[o])&&(i=(n?s(e,r,i):s(i))||i);return n&&i&&_I(e,r,i),i};let jl=class extends Ie{async onSelectChain(t){const{isConnected:e,selectedChain:r,walletConnectVersion:n}=oe.state;e?r?.id===t.id?st.replace("Account"):n===2?(await wt.client().switchNetwork({chainId:t.id}),st.replace("Account")):st.push("SwitchNetwork",{SwitchNetwork:t}):(st.push("ConnectWallet"),oe.setSelectedChain(t))}render(){const{chains:t}=oe.state;return ee`<w3m-modal-header title="Select network"></w3m-modal-header><w3m-modal-content><div class="w3m-grid">${t?.map(e=>ee`<w3m-network-button name="${e.name}" chainId="${e.id}" .onClick="${async()=>this.onSelectChain(e)}">${e.name}</w3m-network-button>`)}</div></w3m-modal-content>`}};jl.styles=[_e.globalCss,vI],jl=xI([Le("w3m-select-network-view")],jl);const CI=He`.w3m-wrapper{display:flex;align-items:center;justify-content:center;width:100%;aspect-ratio:1/1;flex-direction:column}.w3m-connecting-title{display:flex;align-items:center;justify-content:center;margin-bottom:16px}w3m-spinner{margin-right:10px}w3m-network-image{width:96px;height:96px;margin-bottom:20px}w3m-button{opacity:0}.w3m-error w3m-button{opacity:1}`;var SI=Object.defineProperty,AI=Object.getOwnPropertyDescriptor,Up=(t,e,r,n)=>{for(var i=n>1?void 0:n?AI(e,r):e,o=t.length-1,s;o>=0;o--)(s=t[o])&&(i=(n?s(e,r,i):s(i))||i);return n&&i&&SI(e,r,i),i};let Zs=class extends Ie{constructor(){super(),this.error=!1,this.onSwitchNetwork()}getRouterData(){var t;const e=(t=st.state.data)==null?void 0:t.SwitchNetwork;if(!e)throw new Error("Missing router data");return e}async onSwitchNetwork(){try{this.error=!1;const t=this.getRouterData();await wt.client().switchNetwork({chainId:t.id}),oe.setSelectedChain(t),st.replace("Account")}catch{this.error=!0}}render(){const{id:t,name:e}=this.getRouterData(),r={"w3m-wrapper":!0,"w3m-error":this.error};return ee`<w3m-modal-header title="${`Connect to ${e}`}"></w3m-modal-header><w3m-modal-content><div class="${tr(r)}"><w3m-network-image chainId="${t}"></w3m-network-image><div class="w3m-connecting-title">${this.error?null:ee`<w3m-spinner></w3m-spinner>`}<w3m-text variant="large-bold" color="${this.error?"error":"secondary"}">${this.error?"Connection declined":"Approve in your wallet"}</w3m-text></div><w3m-button .onClick="${this.onSwitchNetwork.bind(this)}" .disabled="${!this.error}" .iconRight="${Me.RETRY_ICON}">Try Again</w3m-button></div></w3m-modal-content>`}};Zs.styles=[_e.globalCss,CI],Up([ut()],Zs.prototype,"error",2),Zs=Up([Le("w3m-switch-network-view")],Zs);const II=He`w3m-modal-content{height:clamp(200px,60vh,600px);display:block;overflow:scroll;scrollbar-width:none;position:relative;margin-top:1px}.w3m-grid{display:grid;grid-template-columns:repeat(4,80px);justify-content:space-between;margin:-15px -10px;padding-top:20px}w3m-modal-content::after,w3m-modal-content::before{content:'';position:fixed;pointer-events:none;z-index:1;width:100%;height:20px;opacity:1}w3m-modal-content::before{box-shadow:0 -1px 0 0 var(--w3m-color-bg-1);background:linear-gradient(var(--w3m-color-bg-1),rgba(255,255,255,0))}w3m-modal-content::after{box-shadow:0 1px 0 0 var(--w3m-color-bg-1);background:linear-gradient(rgba(255,255,255,0),var(--w3m-color-bg-1));top:calc(100% - 20px)}w3m-modal-content::-webkit-scrollbar{display:none}.w3m-placeholder-block{display:flex;justify-content:center;align-items:center;height:100px;overflow:hidden}.w3m-empty,.w3m-loading{display:flex}.w3m-loading .w3m-placeholder-block{height:100%}.w3m-end-reached .w3m-placeholder-block{height:0;opacity:0}.w3m-empty .w3m-placeholder-block{opacity:1;height:100%}w3m-wallet-button{margin:calc((100% - 60px)/ 3) 0}`;var OI=Object.defineProperty,DI=Object.getOwnPropertyDescriptor,_o=(t,e,r,n)=>{for(var i=n>1?void 0:n?DI(e,r):e,o=t.length-1,s;o>=0;o--)(s=t[o])&&(i=(n?s(e,r,i):s(i))||i);return n&&i&&OI(e,r,i),i};const kl=40;let Cn=class extends Ie{constructor(){super(...arguments),this.loading=!Ct.state.wallets.listings.length,this.firstFetch=!Ct.state.wallets.listings.length,this.search="",this.endReached=!1,this.intersectionObserver=void 0,this.searchDebounce=le.debounce(t=>{t.length>=3?(this.firstFetch=!0,this.endReached=!1,this.search=t,Ct.resetSearch(),this.fetchWallets()):this.search&&(this.search="",this.endReached=this.isLastPage(),Ct.resetSearch())})}firstUpdated(){this.createPaginationObserver()}disconnectedCallback(){var t;(t=this.intersectionObserver)==null||t.disconnect()}get placeholderEl(){return le.getShadowRootElement(this,".w3m-placeholder-block")}createPaginationObserver(){this.intersectionObserver=new IntersectionObserver(([t])=>{t.isIntersecting&&!(this.search&&this.firstFetch)&&this.fetchWallets()}),this.intersectionObserver.observe(this.placeholderEl)}isLastPage(){const{wallets:t,search:e}=Ct.state,{listings:r,total:n}=this.search?e:t;return n<=kl||r.length>=n}async fetchWallets(){var t;const{wallets:e,search:r}=Ct.state,n=le.getExtensionWallets(),{listings:i,total:o,page:s}=this.search?r:e;if(!this.endReached&&(this.firstFetch||o>kl&&i.length<o))try{this.loading=!0;const a=(t=oe.state.standaloneChains)==null?void 0:t.join(","),{listings:l}=await Ct.getPaginatedWallets({page:this.firstFetch?1:s+1,entries:kl,device:ct.isMobile()?"mobile":"desktop",search:this.search,version:oe.state.walletConnectVersion,chains:a}),u=l.map(({image_url:y})=>y.lg),d=n.map(({id:y})=>le.getWalletIcon(y));await Promise.all([...u.map(async y=>le.preloadImage(y)),...d.map(async y=>le.preloadImage(y)),ct.wait(300)]),this.endReached=this.isLastPage()}catch(a){console.error(a),er.openToast(le.getErrorMessage(a),"error")}finally{this.loading=!1,this.firstFetch=!1}}onConnectCustom({name:t,id:e,links:r}){ct.isMobile()?le.handleMobileLinking({links:r,name:t,id:e}):st.push("DesktopConnector",{DesktopConnector:{name:t,walletId:e,universal:r.universal,native:r.native}})}onConnectListing(t){if(ct.isMobile()){const{id:e,image_url:r}=t,{native:n,universal:i}=t.mobile;le.handleMobileLinking({links:{native:n,universal:i},name:t.name,id:e,image:r.lg})}else st.push("DesktopConnector",{DesktopConnector:{name:t.name,icon:t.image_url.lg,universal:t.desktop.universal||t.homepage,native:t.desktop.native}})}onConnectExtension(t){le.getWalletId("")===t.id?st.push("InjectedConnector"):st.push("InstallConnector",{InstallConnector:t})}onSearchChange(t){const{value:e}=t.target;this.searchDebounce(e)}coinbaseConnectorTemplate(){try{const t=wt.client().getConnectorById(Cr.coinbaseWallet);return ee`<w3m-wallet-button name="${t.name}" walletId="${t.id}" .onClick="${async()=>le.handleConnectorConnection(Cr.coinbaseWallet)}"></w3m-wallet-button>`}catch{return null}}render(){const{wallets:t,search:e}=Ct.state,{isStandalone:r}=oe.state;let{listings:n}=this.search?e:t;n=sr.allowedExplorerListings(n);const i=this.loading&&!n.length,o=this.search.length>=3,s=!i&&(!o||le.caseSafeIncludes(Cr.coinbaseWallet,this.search));let a=!r&&!ct.isMobile()?le.getExtensionWallets():[],l=le.getCustomWallets();o&&(a=a.filter(({name:m})=>le.caseSafeIncludes(m,this.search)),l=l.filter(({name:m})=>le.caseSafeIncludes(m,this.search)));const u=!this.loading&&!n.length&&!a.length&&!s,d=Math.max(a.length,n.length),y={"w3m-loading":i,"w3m-end-reached":this.endReached||!this.loading,"w3m-empty":u};return ee`<w3m-modal-header><w3m-search-input .onChange="${this.onSearchChange.bind(this)}"></w3m-search-input></w3m-modal-header><w3m-modal-content class="${tr(y)}"><div class="w3m-grid">${i?null:[...Array(d)].map((m,v)=>ee`${l[v]?ee`<w3m-wallet-button name="${l[v].name}" walletId="${l[v].id}" .onClick="${()=>this.onConnectCustom(l[v])}"></w3m-wallet-button>`:null} ${a[v]?ee`<w3m-wallet-button name="${a[v].name}" walletId="${a[v].id}" .onClick="${()=>this.onConnectExtension(a[v])}"></w3m-wallet-button>`:null} ${n[v]?ee`<w3m-wallet-button src="${n[v].image_url.lg}" name="${n[v].name}" walletId="${n[v].id}" .onClick="${()=>this.onConnectListing(n[v])}"></w3m-wallet-button>`:null}`)} ${s?this.coinbaseConnectorTemplate():null}</div><div class="w3m-placeholder-block">${u?ee`<w3m-text variant="large-bold" color="secondary">No results found</w3m-text>`:null} ${!u&&this.loading?ee`<w3m-spinner></w3m-spinner>`:null}</div></w3m-modal-content>`}};Cn.styles=[_e.globalCss,II],_o([ut()],Cn.prototype,"loading",2),_o([ut()],Cn.prototype,"firstFetch",2),_o([ut()],Cn.prototype,"search",2),_o([ut()],Cn.prototype,"endReached",2),Cn=_o([Le("w3m-wallet-explorer-view")],Cn);var $I=Object.freeze({__proto__:null,get W3mAccountButton(){return po},get W3mConnectButton(){return vn},get W3mCoreButton(){return _n},get W3mModal(){return En},get W3mNetworkSwitch(){return xn}});Gr.EthereumProvider=$9,Gr.default=_s,Object.defineProperty(Gr,"__esModule",{value:!0})});
130
+ vec3 blendNormal(vec3 base, vec3 blend){return blend;}vec3 blendNormal(vec3 base,vec3 blend,float opacity){return (blendNormal(base,blend)*opacity+base*(1.0-opacity));}float blendScreen(float base,float blend){return 1.0-((1.0-base)*(1.0-blend));}vec3 blendScreen(vec3 base,vec3 blend){return vec3(blendScreen(base.r,blend.r),blendScreen(base.g,blend.g),blendScreen(base.b,blend.b));}vec3 blendScreen(vec3 base,vec3 blend,float opacity){return (blendScreen(base, blend)*opacity+base*(1.0-opacity));}vec3 blendMultiply(vec3 base,vec3 blend){return base*blend;}vec3 blendMultiply(vec3 base,vec3 blend,float opacity){return (blendMultiply(base,blend)*opacity+base*(1.0-opacity));}float blendOverlay(float base,float blend){return base<0.5?(2.0*base*blend):(1.0-2.0*(1.0-base)*(1.0-blend));}vec3 blendOverlay(vec3 base,vec3 blend){return vec3(blendOverlay(base.r,blend.r),blendOverlay(base.g,blend.g),blendOverlay(base.b,blend.b));}vec3 blendOverlay(vec3 base,vec3 blend,float opacity){return (blendOverlay(base,blend)*opacity+base*(1.0-opacity));}vec3 blendHardLight(vec3 base,vec3 blend){return blendOverlay(blend,base);}vec3 blendHardLight(vec3 base,vec3 blend,float opacity){return (blendHardLight(base,blend)*opacity+base*(1.0-opacity));}float blendSoftLight(float base,float blend){return (blend<0.5)?(2.0*base*blend+base*base*(1.0-2.0*blend)):(sqrt(base)*(2.0*blend-1.0)+2.0*base*(1.0-blend));}vec3 blendSoftLight(vec3 base,vec3 blend){return vec3(blendSoftLight(base.r,blend.r),blendSoftLight(base.g,blend.g),blendSoftLight(base.b,blend.b));}vec3 blendSoftLight(vec3 base,vec3 blend,float opacity){return (blendSoftLight(base,blend)*opacity+base*(1.0-opacity));}float blendColorDodge(float base,float blend){return (blend==1.0)?blend:min(base/(1.0-blend),1.0);}vec3 blendColorDodge(vec3 base,vec3 blend){return vec3(blendColorDodge(base.r,blend.r),blendColorDodge(base.g,blend.g),blendColorDodge(base.b,blend.b));}vec3 blendColorDodge(vec3 base,vec3 blend,float opacity){return (blendColorDodge(base, blend)*opacity+base*(1.0-opacity));}float blendColorBurn(float base,float blend){return (blend==0.0)?blend:max((1.0-((1.0-base)/blend)),0.0);}vec3 blendColorBurn(vec3 base,vec3 blend){return vec3(blendColorBurn(base.r,blend.r),blendColorBurn(base.g,blend.g),blendColorBurn(base.b,blend.b));}vec3 blendColorBurn(vec3 base,vec3 blend,float opacity){return (blendColorBurn(base, blend)*opacity+base*(1.0-opacity));}float blendVividLight(float base,float blend){return (blend<0.5)?blendColorBurn(base,(2.0*blend)):blendColorDodge(base,(2.0*(blend-0.5)));}vec3 blendVividLight(vec3 base,vec3 blend){return vec3(blendVividLight(base.r,blend.r),blendVividLight(base.g,blend.g),blendVividLight(base.b,blend.b));}vec3 blendVividLight(vec3 base,vec3 blend,float opacity){return (blendVividLight(base,blend)*opacity+base*(1.0-opacity));}float blendLighten(float base,float blend){return max(blend,base);}vec3 blendLighten(vec3 base,vec3 blend){return vec3(blendLighten(base.r,blend.r),blendLighten(base.g,blend.g),blendLighten(base.b,blend.b));}vec3 blendLighten(vec3 base,vec3 blend,float opacity){return (blendLighten(base,blend)*opacity+base*(1.0-opacity));}float blendLinearBurn(float base,float blend){return max(base+blend-1.0,0.0);}vec3 blendLinearBurn(vec3 base,vec3 blend){return max(base+blend-vec3(1.0),vec3(0.0));}vec3 blendLinearBurn(vec3 base,vec3 blend,float opacity){return (blendLinearBurn(base, blend)*opacity+base*(1.0-opacity));}float blendLinearDodge(float base,float blend){return min(base+blend,1.0);}vec3 blendLinearDodge(vec3 base,vec3 blend){return min(base+blend,vec3(1.0));}vec3 blendLinearDodge(vec3 base,vec3 blend,float opacity){return (blendLinearDodge(base,blend)*opacity+base*(1.0-opacity));}float blendLinearLight(float base,float blend){return blend<0.5?blendLinearBurn(base,(2.0*blend)):blendLinearDodge(base,(2.0*(blend-0.5)));}vec3 blendLinearLight(vec3 base,vec3 blend){return vec3(blendLinearLight(base.r,blend.r),blendLinearLight(base.g,blend.g),blendLinearLight(base.b,blend.b));}vec3 blendLinearLight(vec3 base,vec3 blend,float opacity){return (blendLinearLight(base,blend)*opacity+base*(1.0-opacity));}`,fragment:"varying vec3 v_color;void main(){vec3 color=v_color;if(u_darken_top==1.0){vec2 st=gl_FragCoord.xy/resolution.xy;color.g-=pow(st.y+sin(-12.0)*st.x,u_shadow_power)*0.4;}gl_FragColor=vec4(color,1.0);}"},this.conf={density:[.06,.16]},this.minigl=new X6(this.el,null,null,!0),requestAnimationFrame(()=>{this.el&&(this.computedCanvasStyle=getComputedStyle(this.el),this.waitForCssVars())})}initMaterial(){this.uniforms={u_time:new this.minigl.Uniform({value:0}),u_shadow_power:new this.minigl.Uniform({value:5}),u_darken_top:new this.minigl.Uniform({value:this.el.dataset.jsDarkenTop===""?1:0}),u_active_colors:new this.minigl.Uniform({value:this.activeColors,type:"vec4"}),u_global:new this.minigl.Uniform({value:{noiseFreq:new this.minigl.Uniform({value:[this.freqX,this.freqY],type:"vec2"}),noiseSpeed:new this.minigl.Uniform({value:5e-6})},type:"struct"}),u_vertDeform:new this.minigl.Uniform({value:{incline:new this.minigl.Uniform({value:Math.sin(this.angle)/Math.cos(this.angle)}),offsetTop:new this.minigl.Uniform({value:-.5}),offsetBottom:new this.minigl.Uniform({value:-.5}),noiseFreq:new this.minigl.Uniform({value:[3,4],type:"vec2"}),noiseAmp:new this.minigl.Uniform({value:this.amp}),noiseSpeed:new this.minigl.Uniform({value:10}),noiseFlow:new this.minigl.Uniform({value:3}),noiseSeed:new this.minigl.Uniform({value:this.seed})},type:"struct",excludeFrom:"fragment"}),u_baseColor:new this.minigl.Uniform({value:this.sectionColors[0],type:"vec3",excludeFrom:"fragment"}),u_waveLayers:new this.minigl.Uniform({value:[],excludeFrom:"fragment",type:"array"})};for(let t=1;t<this.sectionColors.length;t+=1)this.uniforms.u_waveLayers.value.push(new this.minigl.Uniform({value:{color:new this.minigl.Uniform({value:this.sectionColors[t],type:"vec3"}),noiseFreq:new this.minigl.Uniform({value:[2+t/this.sectionColors.length,3+t/this.sectionColors.length],type:"vec2"}),noiseSpeed:new this.minigl.Uniform({value:11+.3*t}),noiseFlow:new this.minigl.Uniform({value:6.5+.3*t}),noiseSeed:new this.minigl.Uniform({value:this.seed+10*t}),noiseFloor:new this.minigl.Uniform({value:.1}),noiseCeil:new this.minigl.Uniform({value:.63+.07*t})},type:"struct"}));return this.vertexShader=[this.shaderFiles.noise,this.shaderFiles.blend,this.shaderFiles.vertex].join(""),new this.minigl.Material(this.vertexShader,this.shaderFiles.fragment,this.uniforms)}initMesh(){this.material=this.initMaterial(),this.geometry=new this.minigl.PlaneGeometry,this.mesh=new this.minigl.Mesh(this.geometry,this.material)}shouldSkipFrame(t){return!!window.document.hidden||parseInt(t,10)%2==0||void 0}updateFrequency(t){this.freqX+=t,this.freqY+=t}toggleColor(t){this.activeColors[t]=this.activeColors[t]===0?1:0}init(){this.playing=!0,this.initGradientColors(),this.initMesh(),this.resize(),requestAnimationFrame(this.animate)}waitForCssVars(){this.computedCanvasStyle&&this.computedCanvasStyle.getPropertyValue("--w3m-gradient-1").indexOf("#")!==-1?this.init():this.init()}initGradientColors(){this.sectionColors=["--w3m-gradient-1","--w3m-gradient-2","--w3m-gradient-3","--w3m-gradient-4"].map(t=>{let e=this.computedCanvasStyle.getPropertyValue(t).trim();return e.length===4&&(e=`#${e.substr(1).split("").map(r=>r+r).join("")}`),e&&`0x${e.substr(1)}`}).filter(Boolean).map(J6)}};function J6(t){return[(t>>16&255)/255,(t>>8&255)/255,(255&t)/255]}function ld(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}let X6=class{constructor(t,e,r){const n=this;n.canvas=t,n.gl=n.canvas.getContext("webgl",{antialias:!0}),n.meshes=[];const i=n.gl;e&&r&&this.setSize(e,r),Object.defineProperties(n,{Material:{enumerable:!1,value:class{constructor(o,a,c={}){const l=this;function p(m,E){const A=i.createShader(m);return i.shaderSource(A,E),i.compileShader(A),i.getShaderParameter(A,i.COMPILE_STATUS)||console.error(i.getShaderInfoLog(A)),A}function w(m,E){return Object.entries(m).map(([A,N])=>N.getDeclaration(A,E)).join("")}l.uniforms=c,l.uniformInstances=[];const y="precision highp float;";l.vertexSource=`${y} attribute vec4 position;attribute vec2 uv;attribute vec2 uvNorm;${w(n.commonUniforms,"vertex")} ${w(c,"vertex")} ${o}`,l.Source=`${y} ${w(n.commonUniforms,"fragment")} ${w(c,"fragment")} ${a} `,l.vertexShader=p(i.VERTEX_SHADER,l.vertexSource),l.fragmentShader=p(i.FRAGMENT_SHADER,l.Source),l.program=i.createProgram(),i.attachShader(l.program,l.vertexShader),i.attachShader(l.program,l.fragmentShader),i.linkProgram(l.program),i.getProgramParameter(l.program,i.LINK_STATUS)||console.error(i.getProgramInfoLog(l.program)),i.useProgram(l.program),l.attachUniforms(void 0,n.commonUniforms),l.attachUniforms(void 0,l.uniforms)}attachUniforms(o,a){const c=this;o===void 0?Object.entries(a).forEach(([l,p])=>{c.attachUniforms(l,p)}):a.type=="array"?a.value.forEach((l,p)=>c.attachUniforms(`${o}[${p}]`,l)):a.type=="struct"?Object.entries(a.value).forEach(([l,p])=>c.attachUniforms(`${o}.${l}`,p)):c.uniformInstances.push({uniform:a,location:i.getUniformLocation(c.program,o)})}}},Uniform:{enumerable:!1,value:class{constructor(o){this.type="float",Object.assign(this,o),this.typeFn={float:"1f",int:"1i",vec2:"2fv",vec3:"3fv",vec4:"4fv",mat4:"Matrix4fv"}[this.type]||"1f",this.update()}update(o){this.value!==void 0&&i[`uniform${this.typeFn}`](o,this.typeFn.indexOf("Matrix")===0?this.transpose:this.value,this.typeFn.indexOf("Matrix")===0?this.value:null)}getDeclaration(o,a,c){const l=this;if(l.excludeFrom!==a){if(l.type==="array")return l.value[0].getDeclaration(o,a,l.value.length)+`const int ${o}_length=${l.value.length};`;if(l.type==="struct"){let p=o.replace("u_","");return p=p.charAt(0).toUpperCase()+p.slice(1),`uniform struct ${p} {`+Object.entries(l.value).map(([w,y])=>y.getDeclaration(w,a).replace(/^uniform/,"")).join("")+`} ${o}${c>0?`[${c}]`:""};`}return`uniform ${l.type} ${o}${c>0?`[${c}]`:""};`}}}},PlaneGeometry:{enumerable:!1,value:class{constructor(o,a,c,l,p){i.createBuffer(),this.attributes={position:new n.Attribute({target:i.ARRAY_BUFFER,size:3}),uv:new n.Attribute({target:i.ARRAY_BUFFER,size:2}),uvNorm:new n.Attribute({target:i.ARRAY_BUFFER,size:2}),index:new n.Attribute({target:i.ELEMENT_ARRAY_BUFFER,size:3,type:i.UNSIGNED_SHORT})},this.setTopology(c,l),this.setSize(o,a,p)}setTopology(o=1,a=1){const c=this;c.xSegCount=o,c.ySegCount=a,c.vertexCount=(c.xSegCount+1)*(c.ySegCount+1),c.quadCount=c.xSegCount*c.ySegCount*2,c.attributes.uv.values=new Float32Array(2*c.vertexCount),c.attributes.uvNorm.values=new Float32Array(2*c.vertexCount),c.attributes.index.values=new Uint16Array(3*c.quadCount);for(let l=0;l<=c.ySegCount;l++)for(let p=0;p<=c.xSegCount;p++){const w=l*(c.xSegCount+1)+p;if(c.attributes.uv.values[2*w]=p/c.xSegCount,c.attributes.uv.values[2*w+1]=1-l/c.ySegCount,c.attributes.uvNorm.values[2*w]=p/c.xSegCount*2-1,c.attributes.uvNorm.values[2*w+1]=1-l/c.ySegCount*2,p<c.xSegCount&&l<c.ySegCount){const y=l*c.xSegCount+p;c.attributes.index.values[6*y]=w,c.attributes.index.values[6*y+1]=w+1+c.xSegCount,c.attributes.index.values[6*y+2]=w+1,c.attributes.index.values[6*y+3]=w+1,c.attributes.index.values[6*y+4]=w+1+c.xSegCount,c.attributes.index.values[6*y+5]=w+2+c.xSegCount}}c.attributes.uv.update(),c.attributes.uvNorm.update(),c.attributes.index.update()}setSize(o=1,a=1,c="xz"){const l=this;l.width=o,l.height=a,l.orientation=c,l.attributes.position.values&&l.attributes.position.values.length===3*l.vertexCount||(l.attributes.position.values=new Float32Array(3*l.vertexCount));const p=o/-2,w=a/-2,y=o/l.xSegCount,m=a/l.ySegCount;for(let E=0;E<=l.ySegCount;E++){const A=w+E*m;for(let N=0;N<=l.xSegCount;N++){const M=p+N*y,x=E*(l.xSegCount+1)+N;l.attributes.position.values[3*x+"xyz".indexOf(c[0])]=M,l.attributes.position.values[3*x+"xyz".indexOf(c[1])]=-A}}l.attributes.position.update()}}},Mesh:{enumerable:!1,value:class{constructor(o,a){const c=this;c.geometry=o,c.material=a,c.attributeInstances=[],Object.entries(c.geometry.attributes).forEach(([l,p])=>{c.attributeInstances.push({attribute:p,location:p.attach(l,c.material.program)})}),n.meshes.push(c)}draw(){i.useProgram(this.material.program),this.material.uniformInstances.forEach(({uniform:o,location:a})=>o.update(a)),this.attributeInstances.forEach(({attribute:o,location:a})=>o.use(a)),i.drawElements(i.TRIANGLES,this.geometry.attributes.index.values.length,i.UNSIGNED_SHORT,0)}remove(){n.meshes=n.meshes.filter(o=>o!=this)}}},Attribute:{enumerable:!1,value:class{constructor(o){this.type=i.FLOAT,this.normalized=!1,this.buffer=i.createBuffer(),Object.assign(this,o),this.update()}update(){this.values!==void 0&&(i.bindBuffer(this.target,this.buffer),i.bufferData(this.target,this.values,i.STATIC_DRAW))}attach(o,a){const c=i.getAttribLocation(a,o);return this.target===i.ARRAY_BUFFER&&(i.enableVertexAttribArray(c),i.vertexAttribPointer(c,this.size,this.type,this.normalized,0,0)),c}use(o){i.bindBuffer(this.target,this.buffer),this.target===i.ARRAY_BUFFER&&(i.enableVertexAttribArray(o),i.vertexAttribPointer(o,this.size,this.type,this.normalized,0,0))}}}});const s=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];n.commonUniforms={projectionMatrix:new n.Uniform({type:"mat4",value:s}),modelViewMatrix:new n.Uniform({type:"mat4",value:s}),resolution:new n.Uniform({type:"vec2",value:[1,1]}),aspectRatio:new n.Uniform({type:"float",value:1})}}setSize(t=640,e=480){this.width=t,this.height=e,this.canvas.width=t,this.canvas.height=e,this.gl.viewport(0,0,t,e),this.commonUniforms.resolution.value=[t,e],this.commonUniforms.aspectRatio.value=t/e}setOrthographicCamera(t=0,e=0,r=0,n=-2e3,i=2e3){this.commonUniforms.projectionMatrix.value=[2/this.width,0,0,0,0,2/this.height,0,0,0,0,2/(n-i),0,t,e,r,1]}render(){this.gl.clearColor(0,0,0,0),this.gl.clearDepth(1),this.meshes.forEach(t=>t.draw())}};const ye={CROSS_ICON:Ae`<svg width="12" height="12" viewBox="0 0 12 12"><path d="M9.94 11A.75.75 0 1 0 11 9.94L7.414 6.353a.5.5 0 0 1 0-.708L11 2.061A.75.75 0 1 0 9.94 1L6.353 4.586a.5.5 0 0 1-.708 0L2.061 1A.75.75 0 0 0 1 2.06l3.586 3.586a.5.5 0 0 1 0 .708L1 9.939A.75.75 0 1 0 2.06 11l3.586-3.586a.5.5 0 0 1 .708 0L9.939 11Z" fill="#fff"/></svg>`,NOISE_TEXTURE:Ae`<svg id="w3m-transparent-noise"><filter id="w3m-noise"><feTurbulence type="fractalNoise" baseFrequency="0.8"/></filter><rect width="100%" height="100%" filter="url(#w3m-noise)"/></svg>`,WALLET_CONNECT_LOGO:Ae`<svg width="178" height="29" viewBox="0 0 178 29" id="w3m-wc-logo"><path d="M10.683 7.926c5.284-5.17 13.85-5.17 19.134 0l.636.623a.652.652 0 0 1 0 .936l-2.176 2.129a.343.343 0 0 1-.478 0l-.875-.857c-3.686-3.607-9.662-3.607-13.348 0l-.937.918a.343.343 0 0 1-.479 0l-2.175-2.13a.652.652 0 0 1 0-.936l.698-.683Zm23.633 4.403 1.935 1.895a.652.652 0 0 1 0 .936l-8.73 8.543a.687.687 0 0 1-.956 0L20.37 17.64a.172.172 0 0 0-.239 0l-6.195 6.063a.687.687 0 0 1-.957 0l-8.73-8.543a.652.652 0 0 1 0-.936l1.936-1.895a.687.687 0 0 1 .957 0l6.196 6.064a.172.172 0 0 0 .239 0l6.195-6.064a.687.687 0 0 1 .957 0l6.196 6.064a.172.172 0 0 0 .24 0l6.195-6.064a.687.687 0 0 1 .956 0ZM48.093 20.948l2.338-9.355c.139-.515.258-1.07.416-1.942.12.872.258 1.427.357 1.942l2.022 9.355h4.181l3.528-13.874h-3.21l-1.943 8.523a24.825 24.825 0 0 0-.456 2.457c-.158-.931-.317-1.625-.495-2.438l-1.883-8.542h-4.201l-2.042 8.542a41.204 41.204 0 0 0-.475 2.438 41.208 41.208 0 0 0-.476-2.438l-1.903-8.542h-3.349l3.508 13.874h4.083ZM63.33 21.304c1.585 0 2.596-.654 3.11-1.605-.059.297-.078.595-.078.892v.357h2.655V15.22c0-2.735-1.248-4.32-4.3-4.32-2.636 0-4.36 1.466-4.52 3.487h2.914c.1-.891.734-1.426 1.705-1.426.911 0 1.407.515 1.407 1.11 0 .435-.258.693-1.03.792l-1.388.159c-2.061.257-3.825 1.01-3.825 3.19 0 1.982 1.645 3.092 3.35 3.092Zm.891-2.041c-.773 0-1.348-.436-1.348-1.19 0-.733.655-1.09 1.645-1.268l.674-.119c.575-.118.892-.218 1.09-.396v.912c0 1.228-.892 2.06-2.06 2.06ZM70.398 7.074v13.874h2.874V7.074h-2.874ZM74.934 7.074v13.874h2.874V7.074h-2.874ZM84.08 21.304c2.735 0 4.5-1.546 4.697-3.567h-2.893c-.139.892-.892 1.387-1.804 1.387-1.228 0-2.12-.99-2.14-2.358h6.897v-.555c0-3.21-1.764-5.312-4.816-5.312-2.933 0-4.994 2.062-4.994 5.173 0 3.37 2.12 5.232 5.053 5.232Zm-2.16-6.421c.119-1.11.932-1.922 2.081-1.922 1.11 0 1.883.772 1.903 1.922H81.92ZM94.92 21.146c.633 0 1.248-.1 1.525-.179v-2.18c-.218.04-.475.06-.693.06-1.05 0-1.427-.595-1.427-1.566v-3.805h2.338v-2.24h-2.338V7.788H91.47v3.448H89.37v2.24h2.1v4.201c0 2.3 1.15 3.469 3.45 3.469ZM104.62 21.304c3.924 0 6.302-2.299 6.599-5.608h-3.111c-.238 1.803-1.506 3.032-3.369 3.032-2.2 0-3.746-1.784-3.746-4.796 0-2.953 1.605-4.638 3.805-4.638 1.883 0 2.953 1.15 3.171 2.834h3.191c-.317-3.448-2.854-5.41-6.342-5.41-3.984 0-7.036 2.695-7.036 7.214 0 4.677 2.676 7.372 6.838 7.372ZM117.449 21.304c2.993 0 5.114-1.882 5.114-5.172 0-3.23-2.121-5.233-5.114-5.233-2.972 0-5.093 2.002-5.093 5.233 0 3.29 2.101 5.172 5.093 5.172Zm0-2.22c-1.327 0-2.18-1.09-2.18-2.952 0-1.903.892-2.973 2.18-2.973 1.308 0 2.2 1.07 2.2 2.973 0 1.862-.872 2.953-2.2 2.953ZM126.569 20.948v-5.689c0-1.208.753-2.1 1.823-2.1 1.011 0 1.606.773 1.606 2.06v5.729h2.873v-6.144c0-2.339-1.229-3.905-3.428-3.905-1.526 0-2.458.734-2.953 1.606a5.31 5.31 0 0 0 .079-.892v-.377h-2.874v9.712h2.874ZM137.464 20.948v-5.689c0-1.208.753-2.1 1.823-2.1 1.011 0 1.606.773 1.606 2.06v5.729h2.873v-6.144c0-2.339-1.228-3.905-3.428-3.905-1.526 0-2.458.734-2.953 1.606a5.31 5.31 0 0 0 .079-.892v-.377h-2.874v9.712h2.874ZM149.949 21.304c2.735 0 4.499-1.546 4.697-3.567h-2.893c-.139.892-.892 1.387-1.804 1.387-1.228 0-2.12-.99-2.14-2.358h6.897v-.555c0-3.21-1.764-5.312-4.816-5.312-2.933 0-4.994 2.062-4.994 5.173 0 3.37 2.12 5.232 5.053 5.232Zm-2.16-6.421c.119-1.11.932-1.922 2.081-1.922 1.11 0 1.883.772 1.903 1.922h-3.984ZM160.876 21.304c3.013 0 4.658-1.645 4.975-4.201h-2.874c-.099 1.07-.713 1.982-2.001 1.982-1.309 0-2.2-1.21-2.2-2.993 0-1.942 1.03-2.933 2.259-2.933 1.209 0 1.803.872 1.883 1.882h2.873c-.218-2.358-1.823-4.142-4.776-4.142-2.874 0-5.153 1.903-5.153 5.193 0 3.25 1.923 5.212 5.014 5.212ZM172.067 21.146c.634 0 1.248-.1 1.526-.179v-2.18c-.218.04-.476.06-.694.06-1.05 0-1.427-.595-1.427-1.566v-3.805h2.339v-2.24h-2.339V7.788h-2.854v3.448h-2.1v2.24h2.1v4.201c0 2.3 1.15 3.469 3.449 3.469Z" fill="#fff"/></svg>`,WALLET_CONNECT_ICON:Ae`<svg width="28" height="20" viewBox="0 0 28 20"><g clip-path="url(#a)"><path d="M7.386 6.482c3.653-3.576 9.575-3.576 13.228 0l.44.43a.451.451 0 0 1 0 .648L19.55 9.033a.237.237 0 0 1-.33 0l-.606-.592c-2.548-2.496-6.68-2.496-9.228 0l-.648.634a.237.237 0 0 1-.33 0L6.902 7.602a.451.451 0 0 1 0-.647l.483-.473Zm16.338 3.046 1.339 1.31a.451.451 0 0 1 0 .648l-6.035 5.909a.475.475 0 0 1-.662 0L14.083 13.2a.119.119 0 0 0-.166 0l-4.283 4.194a.475.475 0 0 1-.662 0l-6.035-5.91a.451.451 0 0 1 0-.647l1.338-1.31a.475.475 0 0 1 .662 0l4.283 4.194c.046.044.12.044.166 0l4.283-4.194a.475.475 0 0 1 .662 0l4.283 4.194c.046.044.12.044.166 0l4.283-4.194a.475.475 0 0 1 .662 0Z" fill="#000000"/></g><defs><clipPath id="a"><path fill="#ffffff" d="M0 0h28v20H0z"/></clipPath></defs></svg>`,WALLET_CONNECT_ICON_COLORED:Ae`<svg width="96" height="96" fill="none"><path fill="#fff" d="M25.322 33.597c12.525-12.263 32.83-12.263 45.355 0l1.507 1.476a1.547 1.547 0 0 1 0 2.22l-5.156 5.048a.814.814 0 0 1-1.134 0l-2.074-2.03c-8.737-8.555-22.903-8.555-31.64 0l-2.222 2.175a.814.814 0 0 1-1.134 0l-5.156-5.049a1.547 1.547 0 0 1 0-2.22l1.654-1.62Zm56.019 10.44 4.589 4.494a1.547 1.547 0 0 1 0 2.22l-20.693 20.26a1.628 1.628 0 0 1-2.267 0L48.283 56.632a.407.407 0 0 0-.567 0L33.03 71.012a1.628 1.628 0 0 1-2.268 0L10.07 50.75a1.547 1.547 0 0 1 0-2.22l4.59-4.494a1.628 1.628 0 0 1 2.267 0l14.687 14.38c.156.153.41.153.567 0l14.685-14.38a1.628 1.628 0 0 1 2.268 0l14.687 14.38c.156.153.41.153.567 0l14.686-14.38a1.628 1.628 0 0 1 2.268 0Z"/><path stroke="#000" d="M25.672 33.954c12.33-12.072 32.325-12.072 44.655 0l1.508 1.476a1.047 1.047 0 0 1 0 1.506l-5.157 5.048a.314.314 0 0 1-.434 0l-2.074-2.03c-8.932-8.746-23.409-8.746-32.34 0l-2.222 2.174a.314.314 0 0 1-.434 0l-5.157-5.048a1.047 1.047 0 0 1 0-1.506l1.655-1.62Zm55.319 10.44 4.59 4.494a1.047 1.047 0 0 1 0 1.506l-20.694 20.26a1.128 1.128 0 0 1-1.568 0l-14.686-14.38a.907.907 0 0 0-1.267 0L32.68 70.655a1.128 1.128 0 0 1-1.568 0L10.42 50.394a1.047 1.047 0 0 1 0-1.506l4.59-4.493a1.128 1.128 0 0 1 1.567 0l14.687 14.379a.907.907 0 0 0 1.266 0l-.35-.357.35.357 14.686-14.38a1.128 1.128 0 0 1 1.568 0l14.687 14.38a.907.907 0 0 0 1.267 0l14.686-14.38a1.128 1.128 0 0 1 1.568 0Z"/></svg>`,BACK_ICON:Ae`<svg width="10" height="18" viewBox="0 0 10 18"><path fill-rule="evenodd" clip-rule="evenodd" d="M8.735.179a.75.75 0 0 1 .087 1.057L2.92 8.192a1.25 1.25 0 0 0 0 1.617l5.902 6.956a.75.75 0 1 1-1.144.97L1.776 10.78a2.75 2.75 0 0 1 0-3.559L7.678.265A.75.75 0 0 1 8.735.18Z" fill="#fff"/></svg>`,COPY_ICON:Ae`<svg width="24" height="24" fill="none"><path fill="#fff" fill-rule="evenodd" d="M7.01 7.01c.03-1.545.138-2.5.535-3.28A5 5 0 0 1 9.73 1.545C10.8 1 12.2 1 15 1c2.8 0 4.2 0 5.27.545a5 5 0 0 1 2.185 2.185C23 4.8 23 6.2 23 9c0 2.8 0 4.2-.545 5.27a5 5 0 0 1-2.185 2.185c-.78.397-1.735.505-3.28.534l-.001.01c-.03 1.54-.138 2.493-.534 3.27a5 5 0 0 1-2.185 2.186C13.2 23 11.8 23 9 23c-2.8 0-4.2 0-5.27-.545a5 5 0 0 1-2.185-2.185C1 19.2 1 17.8 1 15c0-2.8 0-4.2.545-5.27A5 5 0 0 1 3.73 7.545C4.508 7.149 5.46 7.04 7 7.01h.01ZM15 15.5c-1.425 0-2.403-.001-3.162-.063-.74-.06-1.139-.172-1.427-.319a3.5 3.5 0 0 1-1.53-1.529c-.146-.288-.257-.686-.318-1.427C8.501 11.403 8.5 10.425 8.5 9c0-1.425.001-2.403.063-3.162.06-.74.172-1.139.318-1.427a3.5 3.5 0 0 1 1.53-1.53c.288-.146.686-.257 1.427-.318.759-.062 1.737-.063 3.162-.063 1.425 0 2.403.001 3.162.063.74.06 1.139.172 1.427.318a3.5 3.5 0 0 1 1.53 1.53c.146.288.257.686.318 1.427.062.759.063 1.737.063 3.162 0 1.425-.001 2.403-.063 3.162-.06.74-.172 1.139-.319 1.427a3.5 3.5 0 0 1-1.529 1.53c-.288.146-.686.257-1.427.318-.759.062-1.737.063-3.162.063ZM7 8.511c-.444.009-.825.025-1.162.052-.74.06-1.139.172-1.427.318a3.5 3.5 0 0 0-1.53 1.53c-.146.288-.257.686-.318 1.427-.062.759-.063 1.737-.063 3.162 0 1.425.001 2.403.063 3.162.06.74.172 1.139.318 1.427a3.5 3.5 0 0 0 1.53 1.53c.288.146.686.257 1.427.318.759.062 1.737.063 3.162.063 1.425 0 2.403-.001 3.162-.063.74-.06 1.139-.172 1.427-.319a3.5 3.5 0 0 0 1.53-1.53c.146-.287.257-.685.318-1.426.027-.337.043-.718.052-1.162H15c-2.8 0-4.2 0-5.27-.545a5 5 0 0 1-2.185-2.185C7 13.2 7 11.8 7 9v-.489Z" clip-rule="evenodd"/></svg>`,RETRY_ICON:Ae`<svg width="15" height="16" viewBox="0 0 15 16"><path d="M6.464 2.03A.75.75 0 0 0 5.403.97L2.08 4.293a1 1 0 0 0 0 1.414L5.403 9.03a.75.75 0 0 0 1.06-1.06L4.672 6.177a.25.25 0 0 1 .177-.427h2.085a4 4 0 1 1-3.93 4.746c-.077-.407-.405-.746-.82-.746-.414 0-.755.338-.7.748a5.501 5.501 0 1 0 5.45-6.248H4.848a.25.25 0 0 1-.177-.427L6.464 2.03Z" fill="#fff"/></svg>`,DESKTOP_ICON:Ae`<svg width="16" height="16" viewBox="0 0 16 16"><path fill-rule="evenodd" clip-rule="evenodd" d="M0 5.98c0-1.85 0-2.775.394-3.466a3 3 0 0 1 1.12-1.12C2.204 1 3.13 1 4.98 1h6.04c1.85 0 2.775 0 3.466.394a3 3 0 0 1 1.12 1.12C16 3.204 16 4.13 16 5.98v1.04c0 1.85 0 2.775-.394 3.466a3 3 0 0 1-1.12 1.12C13.796 12 12.87 12 11.02 12H4.98c-1.85 0-2.775 0-3.466-.394a3 3 0 0 1-1.12-1.12C0 9.796 0 8.87 0 7.02V5.98ZM4.98 2.5h6.04c.953 0 1.568.001 2.034.043.446.04.608.108.69.154a1.5 1.5 0 0 1 .559.56c.046.08.114.243.154.69.042.465.043 1.08.043 2.033v1.04c0 .952-.001 1.568-.043 2.034-.04.446-.108.608-.154.69a1.499 1.499 0 0 1-.56.559c-.08.046-.243.114-.69.154-.466.042-1.08.043-2.033.043H4.98c-.952 0-1.568-.001-2.034-.043-.446-.04-.608-.108-.69-.154a1.5 1.5 0 0 1-.559-.56c-.046-.08-.114-.243-.154-.69-.042-.465-.043-1.08-.043-2.033V5.98c0-.952.001-1.568.043-2.034.04-.446.108-.608.154-.69a1.5 1.5 0 0 1 .56-.559c.08-.046.243-.114.69-.154.465-.042 1.08-.043 2.033-.043Z" fill="#fff"/><path d="M4 14.25a.75.75 0 0 1 .75-.75h6.5a.75.75 0 0 1 0 1.5h-6.5a.75.75 0 0 1-.75-.75Z" fill="#fff"/></svg>`,MOBILE_ICON:Ae`<svg width="16" height="16" viewBox="0 0 16 16"><path d="M6.75 5a1.25 1.25 0 1 0 0-2.5 1.25 1.25 0 0 0 0 2.5Z" fill="#fff"/><path fill-rule="evenodd" clip-rule="evenodd" d="M3 4.98c0-1.85 0-2.775.394-3.466a3 3 0 0 1 1.12-1.12C5.204 0 6.136 0 8 0s2.795 0 3.486.394a3 3 0 0 1 1.12 1.12C13 2.204 13 3.13 13 4.98v6.04c0 1.85 0 2.775-.394 3.466a3 3 0 0 1-1.12 1.12C10.796 16 9.864 16 8 16s-2.795 0-3.486-.394a3 3 0 0 1-1.12-1.12C3 13.796 3 12.87 3 11.02V4.98Zm8.5 0v6.04c0 .953-.001 1.568-.043 2.034-.04.446-.108.608-.154.69a1.499 1.499 0 0 1-.56.559c-.08.045-.242.113-.693.154-.47.042-1.091.043-2.05.043-.959 0-1.58-.001-2.05-.043-.45-.04-.613-.109-.693-.154a1.5 1.5 0 0 1-.56-.56c-.046-.08-.114-.243-.154-.69-.042-.466-.043-1.08-.043-2.033V4.98c0-.952.001-1.568.043-2.034.04-.446.108-.608.154-.69a1.5 1.5 0 0 1 .56-.559c.08-.045.243-.113.693-.154C6.42 1.501 7.041 1.5 8 1.5c.959 0 1.58.001 2.05.043.45.04.613.109.693.154a1.5 1.5 0 0 1 .56.56c.046.08.114.243.154.69.042.465.043 1.08.043 2.033Z" fill="#fff"/></svg>`,ARROW_DOWN_ICON:Ae`<svg width="14" height="14" viewBox="0 0 14 14"><path d="M2.28 7.47a.75.75 0 0 0-1.06 1.06l5.25 5.25a.75.75 0 0 0 1.06 0l5.25-5.25a.75.75 0 0 0-1.06-1.06l-3.544 3.543a.25.25 0 0 1-.426-.177V.75a.75.75 0 0 0-1.5 0v10.086a.25.25 0 0 1-.427.176L2.28 7.47Z" fill="#fff"/></svg>`,ARROW_UP_RIGHT_ICON:Ae`<svg width="15" height="14" fill="none"><path d="M4.5 1.75A.75.75 0 0 1 5.25 1H12a1.5 1.5 0 0 1 1.5 1.5v6.75a.75.75 0 0 1-1.5 0V4.164a.25.25 0 0 0-.427-.176L4.061 11.5A.75.75 0 0 1 3 10.44l7.513-7.513a.25.25 0 0 0-.177-.427H5.25a.75.75 0 0 1-.75-.75Z" fill="#fff"/></svg>`,ARROW_RIGHT_ICON:Ae`<svg width="6" height="14" viewBox="0 0 6 14"><path fill-rule="evenodd" clip-rule="evenodd" d="M2.181 1.099a.75.75 0 0 1 1.024.279l2.433 4.258a2.75 2.75 0 0 1 0 2.729l-2.433 4.257a.75.75 0 1 1-1.303-.744L4.335 7.62a1.25 1.25 0 0 0 0-1.24L1.902 2.122a.75.75 0 0 1 .28-1.023Z" fill="#fff"/></svg>`,QRCODE_ICON:Ae`<svg width="25" height="24" viewBox="0 0 25 24"><path d="M23.748 9a.748.748 0 0 0 .748-.752c-.018-2.596-.128-4.07-.784-5.22a6 6 0 0 0-2.24-2.24c-1.15-.656-2.624-.766-5.22-.784a.748.748 0 0 0-.752.748c0 .414.335.749.748.752 1.015.007 1.82.028 2.494.088.995.09 1.561.256 1.988.5.7.398 1.28.978 1.679 1.678.243.427.41.993.498 1.988.061.675.082 1.479.09 2.493a.753.753 0 0 0 .75.749ZM3.527.788C4.677.132 6.152.022 8.747.004A.748.748 0 0 1 9.5.752a.753.753 0 0 1-.749.752c-1.014.007-1.818.028-2.493.088-.995.09-1.561.256-1.988.5-.7.398-1.28.978-1.679 1.678-.243.427-.41.993-.499 1.988-.06.675-.081 1.479-.088 2.493A.753.753 0 0 1 1.252 9a.748.748 0 0 1-.748-.752c.018-2.596.128-4.07.784-5.22a6 6 0 0 1 2.24-2.24ZM1.252 15a.748.748 0 0 0-.748.752c.018 2.596.128 4.07.784 5.22a6 6 0 0 0 2.24 2.24c1.15.656 2.624.766 5.22.784a.748.748 0 0 0 .752-.748.753.753 0 0 0-.749-.752c-1.014-.007-1.818-.028-2.493-.089-.995-.089-1.561-.255-1.988-.498a4.5 4.5 0 0 1-1.679-1.68c-.243-.426-.41-.992-.499-1.987-.06-.675-.081-1.479-.088-2.493A.753.753 0 0 0 1.252 15ZM22.996 15.749a.753.753 0 0 1 .752-.749c.415 0 .751.338.748.752-.018 2.596-.128 4.07-.784 5.22a6 6 0 0 1-2.24 2.24c-1.15.656-2.624.766-5.22.784a.748.748 0 0 1-.752-.748c0-.414.335-.749.748-.752 1.015-.007 1.82-.028 2.494-.089.995-.089 1.561-.255 1.988-.498a4.5 4.5 0 0 0 1.679-1.68c.243-.426.41-.992.498-1.987.061-.675.082-1.479.09-2.493Z" fill="#fff"/><path fill-rule="evenodd" clip-rule="evenodd" d="M7 4a2.5 2.5 0 0 0-2.5 2.5v2A2.5 2.5 0 0 0 7 11h2a2.5 2.5 0 0 0 2.5-2.5v-2A2.5 2.5 0 0 0 9 4H7Zm2 1.5H7a1 1 0 0 0-1 1v2a1 1 0 0 0 1 1h2a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1ZM13.5 6.5A2.5 2.5 0 0 1 16 4h2a2.5 2.5 0 0 1 2.5 2.5v2A2.5 2.5 0 0 1 18 11h-2a2.5 2.5 0 0 1-2.5-2.5v-2Zm2.5-1h2a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1h-2a1 1 0 0 1-1-1v-2a1 1 0 0 1 1-1ZM7 13a2.5 2.5 0 0 0-2.5 2.5v2A2.5 2.5 0 0 0 7 20h2a2.5 2.5 0 0 0 2.5-2.5v-2A2.5 2.5 0 0 0 9 13H7Zm2 1.5H7a1 1 0 0 0-1 1v2a1 1 0 0 0 1 1h2a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1Z" fill="#fff"/><path d="M13.5 15.5c0-.465 0-.697.038-.89a2 2 0 0 1 1.572-1.572C15.303 13 15.535 13 16 13v2.5h-2.5ZM18 13c.465 0 .697 0 .89.038a2 2 0 0 1 1.572 1.572c.038.193.038.425.038.89H18V13ZM18 17.5h2.5c0 .465 0 .697-.038.89a2 2 0 0 1-1.572 1.572C18.697 20 18.465 20 18 20v-2.5ZM13.5 17.5H16V20c-.465 0-.697 0-.89-.038a2 2 0 0 1-1.572-1.572c-.038-.193-.038-.425-.038-.89Z" fill="#fff"/></svg>`,SCAN_ICON:Ae`<svg width="16" height="16" fill="none"><path fill="#fff" d="M10 15.216c0 .422.347.763.768.74 1.202-.064 2.025-.222 2.71-.613a5.001 5.001 0 0 0 1.865-1.866c.39-.684.549-1.507.613-2.709a.735.735 0 0 0-.74-.768.768.768 0 0 0-.76.732c-.009.157-.02.306-.032.447-.073.812-.206 1.244-.384 1.555-.31.545-.761.996-1.306 1.306-.311.178-.743.311-1.555.384-.141.013-.29.023-.447.032a.768.768 0 0 0-.732.76ZM10 .784c0 .407.325.737.732.76.157.009.306.02.447.032.812.073 1.244.206 1.555.384a3.5 3.5 0 0 1 1.306 1.306c.178.311.311.743.384 1.555.013.142.023.29.032.447a.768.768 0 0 0 .76.732.734.734 0 0 0 .74-.768c-.064-1.202-.222-2.025-.613-2.71A5 5 0 0 0 13.477.658c-.684-.39-1.507-.549-2.709-.613a.735.735 0 0 0-.768.74ZM5.232.044A.735.735 0 0 1 6 .784a.768.768 0 0 1-.732.76c-.157.009-.305.02-.447.032-.812.073-1.244.206-1.555.384A3.5 3.5 0 0 0 1.96 3.266c-.178.311-.311.743-.384 1.555-.013.142-.023.29-.032.447A.768.768 0 0 1 .784 6a.735.735 0 0 1-.74-.768c.064-1.202.222-2.025.613-2.71A5 5 0 0 1 2.523.658C3.207.267 4.03.108 5.233.044ZM5.268 14.456a.768.768 0 0 1 .732.76.734.734 0 0 1-.768.74c-1.202-.064-2.025-.222-2.71-.613a5 5 0 0 1-1.865-1.866c-.39-.684-.549-1.507-.613-2.709A.735.735 0 0 1 .784 10c.407 0 .737.325.76.732.009.157.02.306.032.447.073.812.206 1.244.384 1.555a3.5 3.5 0 0 0 1.306 1.306c.311.178.743.311 1.555.384.142.013.29.023.447.032Z"/></svg>`,CHECKMARK_ICON:Ae`<svg width="13" height="12" viewBox="0 0 13 12"><path fill-rule="evenodd" clip-rule="evenodd" d="M12.155.132a.75.75 0 0 1 .232 1.035L5.821 11.535a1 1 0 0 1-1.626.09L.665 7.21a.75.75 0 1 1 1.17-.937L4.71 9.867a.25.25 0 0 0 .406-.023L11.12.364a.75.75 0 0 1 1.035-.232Z" fill="#fff"/></svg>`,HELP_ETH_IMG:Ae`<svg width="60" height="60" fill="none" viewBox="0 0 60 60"><g clip-path="url(#j)"><rect width="60" height="60" rx="30" fill="#987DE8"/><path fill-rule="evenodd" clip-rule="evenodd" d="m15.48 28.367 11.966-19.3c1.174-1.892 3.927-1.892 5.1 0l11.97 19.306a6 6 0 0 1 .9 3.142v.028a6 6 0 0 1-1.154 3.56L33.227 50.208c-1.599 2.188-4.864 2.188-6.461 0L15.733 35.095a6 6 0 0 1-1.154-3.538v-.029a6 6 0 0 1 .9-3.161Z" fill="#fff"/><path d="M30.84 10.112a.992.992 0 0 0-.844-.464V24.5l12.598 5.53c.081-.466-.001-.963-.27-1.398L30.84 10.112Z" fill="#643CDD"/><path d="M29.996 9.648a.991.991 0 0 0-.845.465l-11.489 18.53a1.991 1.991 0 0 0-.264 1.387l12.598-5.53V9.648Z" fill="#BDADEB"/><path d="M29.996 50.544a.994.994 0 0 0 .808-.41l11.235-15.38c.307-.434-.193-.988-.658-.72L31.49 39.71a2.998 2.998 0 0 1-1.494.398v10.437Z" fill="#643CDD"/><path d="M17.966 34.762 29.19 50.134c.2.274.503.41.807.41V40.108a2.998 2.998 0 0 1-1.493-.398l-9.884-5.676c-.468-.27-.971.292-.653.728Z" fill="#BDADEB"/><path d="M42.594 30.03 29.996 24.5v13.138a3 3 0 0 0 1.495-.399l10.149-5.83c.525-.31.856-.823.954-1.38Z" fill="#401AB3"/><path d="M29.996 37.638V24.462l-12.598 5.566c.098.564.437 1.083.974 1.392l10.13 5.82c.462.265.978.398 1.494.398Z" fill="#7C5AE2"/></g><rect class="help-img-highlight" x=".5" y=".5" width="59" height="59" rx="29.5"/><defs><clipPath id="j"><rect width="60" height="60" rx="30" fill="#fff"/></clipPath></defs></svg>`,HELP_PAINTING_IMG:Ae`<svg width="60" height="60" fill="none" viewBox="0 0 60 60"><g clip-path="url(#k)"><rect width="60" height="60" rx="3" fill="#C653C6"/><path d="M52.094 47.344c0-4.246-1.436-9.557-5.885-12.4a2.876 2.876 0 0 0-1.615-3.891v-.819a4.037 4.037 0 0 0-1.34-3.007 4.75 4.75 0 0 0-2.41-6.252v-5.506c0-6.248-5.065-11.313-11.313-11.313-6.247 0-11.312 5.065-11.312 11.313v2.152a3.343 3.343 0 0 0-1.18 5.045 4.738 4.738 0 0 0-1.633 3.584 4.73 4.73 0 0 0 .956 2.858 5.218 5.218 0 0 0-2.358 6.815c-3.06 4.129-6.098 8.298-6.098 15.64 0 2.668.364 4.856.731 6.385.184.765.368 1.366.509 1.78a12.721 12.721 0 0 0 .225.611l.015.037.005.011.001.004v.002h.001l.92-.393-.92.394.26.606h38.26l.291-.49-.86-.51.86.51v-.001l.002-.002.002-.005.01-.017.035-.06.127-.225c.108-.195.26-.477.441-.835.363-.714.845-1.732 1.328-2.953.959-2.427 1.945-5.725 1.945-9.068Z" fill="#E87DE8" stroke="#fff" stroke-width="2"/><path fill-rule="evenodd" clip-rule="evenodd" d="M26.5 29.5c-3-.5-5.5-3-5.503-7l.002-7c0-.466 0-.698.026-.893a3 3 0 0 1 2.582-2.582c.195-.026.428-.026.893-.026 2 0 2.5-2.5 2.5-2.5s0 2.5 2.5 2.5c1.398 0 2.097 0 2.648.229a3 3 0 0 1 1.624 1.623c.228.552.228 1.25.228 2.649v6c0 4-3 7-6.5 7 1.35.23 4 0 6.5-2v9.53C34 38.5 31.495 40 28 40s-6-1.5-6-2.97L24 34l2.5 1.5v-6ZM26 47h4.5c2.5 0 3 4 3 5.5h-3l-1-1.5H26v-4Zm-6.25 5.5H24V57h-8c0-1 1-4.5 3.75-4.5Z" fill="#fff"/></g><rect class="help-img-highlight" x=".5" y=".5" width="59" height="59" rx="2.5"/><defs><clipPath id="k"><rect width="60" height="60" rx="3" fill="#fff"/></clipPath></defs></svg>`,HELP_CHART_IMG:Ae`<svg width="60" height="60" fill="none" viewBox="0 0 60 60"><g clip-path="url(#l)"><path d="M0 25.01C0 15.76 0 11.133 1.97 7.678a15 15 0 0 1 5.598-5.597C11.023.11 15.648.11 24.9.11h10.2c9.251 0 13.877 0 17.332 1.97a15 15 0 0 1 5.597 5.597C60 11.133 60 15.758 60 25.01v10.2c0 9.252 0 13.877-1.97 17.332a15 15 0 0 1-5.598 5.598c-3.455 1.97-8.08 1.97-17.332 1.97H24.9c-9.251 0-13.877 0-17.332-1.97a14.999 14.999 0 0 1-5.597-5.598C0 49.087 0 44.462 0 35.21v-10.2Z" fill="#1DC956"/><path d="M.5 25.01c0-4.635 0-8.078.244-10.795.244-2.71.726-4.65 1.66-6.289a14.5 14.5 0 0 1 5.412-5.41c1.639-.936 3.579-1.418 6.289-1.661C16.822.61 20.265.61 24.9.61h10.2c4.635 0 8.078 0 10.795.245 2.71.243 4.65.725 6.29 1.66a14.5 14.5 0 0 1 5.41 5.411c.935 1.64 1.417 3.579 1.66 6.29.244 2.717.245 6.16.245 10.794v10.2c0 4.635 0 8.078-.244 10.795-.244 2.71-.726 4.65-1.66 6.29a14.5 14.5 0 0 1-5.412 5.41c-1.639.936-3.579 1.418-6.289 1.661-2.717.244-6.16.244-10.795.244H24.9c-4.635 0-8.078 0-10.795-.244-2.71-.243-4.65-.725-6.29-1.66a14.5 14.5 0 0 1-5.41-5.412C1.47 50.655.988 48.716.745 46.005.5 43.288.5 39.845.5 35.21v-10.2Z" stroke="#fff" stroke-opacity=".1"/><path d="M16.109 60c-3.833-.179-6.41-.645-8.541-1.86a15 15 0 0 1-5.598-5.598C.553 50.057.155 46.967.043 41.985l4.146-1.382a4 4 0 0 0 2.48-2.39l4.654-12.409a2 2 0 0 1 2.505-1.195l2.526.842a2 2 0 0 0 2.422-1.003l2.968-5.938c.81-1.62 3.185-1.415 3.705.32l3.774 12.581a2 2 0 0 0 3.025 1.09l3.342-2.228c.27-.18.49-.422.646-.706l5.297-9.712a2 2 0 0 1 1.428-1.016l4.134-.689a2 2 0 0 1 1.61.437l3.892 3.243a2 2 0 0 0 2.694-.122l4.633-4.632C60 19.28 60 21.88 60 25.01v10.2c0 9.252 0 13.877-1.97 17.332a14.998 14.998 0 0 1-5.598 5.598c-2.131 1.215-4.708 1.681-8.54 1.86H16.108Z" fill="#2BEE6C"/><path d="M.072 43.03a112.37 112.37 0 0 1-.048-2.093l3.85-1.283a3 3 0 0 0 1.86-1.793l4.653-12.408a3 3 0 0 1 3.758-1.793l2.526.842a1 1 0 0 0 1.21-.501l2.97-5.938c1.214-2.43 4.775-2.123 5.556.48l3.774 12.58a1 1 0 0 0 1.513.545l3.341-2.227a1 1 0 0 0 .323-.353l5.298-9.712a3 3 0 0 1 2.14-1.523l4.135-.69a3 3 0 0 1 2.414.655l3.892 3.244a1 1 0 0 0 1.347-.061l5.28-5.28c.046.845.077 1.752.097 2.732l-3.962 3.962a3 3 0 0 1-4.042.183l-3.893-3.243a1 1 0 0 0-.804-.218l-4.135.689a1 1 0 0 0-.714.507l-5.297 9.712c-.233.427-.565.79-.97 1.06l-3.34 2.228a3 3 0 0 1-4.538-1.635l-3.775-12.58c-.26-.868-1.447-.97-1.852-.16l-2.969 5.937a3 3 0 0 1-3.632 1.505l-2.526-.842a1 1 0 0 0-1.252.597L7.606 38.564a5 5 0 0 1-3.1 2.988L.072 43.029Z" fill="#fff"/><path fill-rule="evenodd" clip-rule="evenodd" d="M49.5 19a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0Z" fill="#2BEE6C"/><path d="M47.5 19a3.5 3.5 0 1 1-7 0 3.5 3.5 0 0 1 7 0Z" fill="#fff"/><path d="M45 .283v59.654c-.63.042-1.294.074-2 .098V.185c.706.025 1.37.056 2 .098Z" fill="#fff"/><path class="help-img-highlight" d="M.5 25.01c0-4.635 0-8.078.244-10.795.244-2.71.726-4.65 1.66-6.289a14.5 14.5 0 0 1 5.412-5.41c1.639-.936 3.579-1.418 6.289-1.661C16.822.61 20.265.61 24.9.61h10.2c4.635 0 8.078 0 10.795.245 2.71.243 4.65.725 6.29 1.66a14.5 14.5 0 0 1 5.41 5.411c.935 1.64 1.417 3.579 1.66 6.29.244 2.717.245 6.16.245 10.794v10.2c0 4.635 0 8.078-.244 10.795-.244 2.71-.726 4.65-1.66 6.29a14.5 14.5 0 0 1-5.412 5.41c-1.639.936-3.579 1.418-6.289 1.661-2.717.244-6.16.244-10.795.244H24.9c-4.635 0-8.078 0-10.795-.244-2.71-.243-4.65-.725-6.29-1.66a14.5 14.5 0 0 1-5.41-5.412C1.47 50.655.988 48.716.745 46.005.5 43.288.5 39.845.5 35.21v-10.2Z"/></g><defs><clipPath id="l"><path fill="#fff" d="M0 0h60v60H0z"/></clipPath></defs></svg>`,HELP_KEY_IMG:Ae`<svg width="60" height="60" fill="none" viewBox="0 0 60 60"><g clip-path="url(#m)"><path fill="#EB8B47" d="M0 24.9c0-9.252 0-13.878 1.97-17.332A15 15 0 0 1 7.569 1.97C11.023 0 15.648 0 24.9 0h10.2c9.251 0 13.877 0 17.332 1.97a15 15 0 0 1 5.597 5.598C60 11.022 60 15.648 60 24.899v10.2c0 9.252 0 13.878-1.97 17.332a15.001 15.001 0 0 1-5.598 5.598c-3.455 1.97-8.08 1.97-17.332 1.97H24.9c-9.251 0-13.877 0-17.332-1.97a15 15 0 0 1-5.597-5.598C0 48.977 0 44.351 0 35.1V24.9Z"/><path class="help-img-highlight" d="M.5 24.9c0-4.635 0-8.078.244-10.795.244-2.71.726-4.65 1.66-6.29a14.5 14.5 0 0 1 5.412-5.41C9.455 1.468 11.395.986 14.105.743 16.822.5 20.265.5 24.9.5h10.2c4.635 0 8.078 0 10.795.244 2.71.243 4.65.725 6.29 1.66a14.5 14.5 0 0 1 5.41 5.411c.935 1.64 1.417 3.58 1.66 6.29.244 2.717.245 6.16.245 10.794v10.2c0 4.635 0 8.078-.244 10.796-.244 2.71-.726 4.65-1.66 6.289a14.5 14.5 0 0 1-5.412 5.41c-1.639.936-3.579 1.418-6.289 1.661-2.717.244-6.16.244-10.795.244H24.9c-4.635 0-8.078 0-10.795-.244-2.71-.243-4.65-.725-6.29-1.66a14.5 14.5 0 0 1-5.41-5.411c-.935-1.64-1.417-3.58-1.66-6.29C.5 43.178.5 39.734.5 35.1V24.9Z"/><path fill="#FF974C" stroke="#fff" stroke-width="2" d="M39.192 29.192c5.077-5.077 5.077-13.308 0-18.385-5.076-5.077-13.308-5.077-18.384 0-5.077 5.077-5.077 13.308 0 18.385l1.287 1.291c1.137 1.142 1.706 1.712 2.097 2.387.267.462.472.957.608 1.473.2.755.2 1.56.2 3.171V48.75c0 1.077 0 1.615.134 2.119a4 4 0 0 0 .407.984c.262.45.643.831 1.404 1.592l.294.295c.654.654.982.981 1.365 1.086.26.07.533.07.792 0 .383-.105.71-.432 1.365-1.086l3.478-3.479c.655-.654.982-.981 1.087-1.365a1.5 1.5 0 0 0 0-.791c-.105-.384-.432-.711-1.087-1.365l-.478-.479c-.655-.654-.982-.981-1.087-1.365a1.5 1.5 0 0 1 0-.791c.105-.384.432-.711 1.087-1.365l.478-.479c.655-.654.982-.981 1.087-1.365a1.5 1.5 0 0 0 0-.791c-.105-.384-.432-.711-1.087-1.365l-.492-.493c-.65-.65-.974-.974-1.08-1.355a1.5 1.5 0 0 1-.003-.788c.102-.382.425-.71 1.069-1.364l5.46-5.547Z"/><circle cx="30" cy="17" r="4" fill="#EB8B47" stroke="#fff" stroke-width="2"/></g><defs><clipPath id="m"><path fill="#fff" d="M0 0h60v60H0z"/></clipPath></defs></svg>`,HELP_USER_IMG:Ae`<svg width="60" height="60" fill="none" viewBox="0 0 60 60"><g clip-path="url(#n)"><rect width="60" height="60" fill="#00ACE6" rx="30"/><path fill="#1AC6FF" stroke="#fff" stroke-width="2" d="M59 73c0 16.016-12.984 29-29 29S1 89.016 1 73c0-16.017 11-29 29-29s29 12.983 29 29ZM18.69 19.902a11 11 0 0 1 9.281-8.692 14.842 14.842 0 0 1 4.058 0 11 11 0 0 1 9.28 8.692c.178.866.322 1.75.44 2.625.132.977.132 1.968 0 2.945a39.467 39.467 0 0 1-.44 2.625 11 11 0 0 1-9.28 8.692 14.862 14.862 0 0 1-4.058 0 11 11 0 0 1-9.28-8.692 39.467 39.467 0 0 1-.44-2.625 11.004 11.004 0 0 1 0-2.945c.118-.876.262-1.759.44-2.625Z"/><circle cx="24.5" cy="23.5" r="1.5" fill="#fff"/><circle cx="35.5" cy="23.5" r="1.5" fill="#fff"/><path stroke="#fff" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m31 20-3 8h4"/></g><rect class="help-img-highlight" width="59" height="59" x=".5" y=".5" rx="29.5"/><defs><clipPath id="n"><rect width="60" height="60" fill="#fff" rx="30"/></clipPath></defs></svg>`,HELP_LOCK_IMG:Ae`<svg width="60" height="60" fill="none" viewBox="0 0 60 60"><rect width="60" height="60" fill="#C653C6" rx="3"/><path fill="#fff" d="M20.034 15.216C20 15.607 20 16.07 20 17v2.808c0 1.13 0 1.696-.2 2.11a1.78 1.78 0 0 1-.584.714c-.366.28-1.051.42-2.423.7a7.076 7.076 0 0 0-1.597.511 9.001 9.001 0 0 0-4.353 4.353C10 30.005 10 32.336 10 37c0 4.663 0 6.995.843 8.804a9.001 9.001 0 0 0 4.353 4.353C17.005 51 19.336 51 24 51h12c4.663 0 6.995 0 8.804-.843a9.001 9.001 0 0 0 4.353-4.353C50 43.995 50 41.664 50 37c0-4.663 0-6.995-.843-8.804a9.001 9.001 0 0 0-4.353-4.353 7.076 7.076 0 0 0-1.597-.511c-1.372-.28-2.057-.42-2.423-.7a1.78 1.78 0 0 1-.583-.715C40 21.505 40 20.94 40 19.809V17c0-.929 0-1.393-.034-1.784a9 9 0 0 0-8.182-8.182C31.393 7 30.93 7 30 7s-1.393 0-1.784.034a9 9 0 0 0-8.182 8.182Z"/><path fill="#E87DE8" d="M22 17c0-.929 0-1.393.044-1.784a7 7 0 0 1 6.172-6.172C28.606 9 29.071 9 30 9s1.393 0 1.784.044a7 7 0 0 1 6.172 6.172c.044.39.044.855.044 1.784v4.5a1.5 1.5 0 0 1-3 0V17c0-.93 0-1.394-.077-1.78a4 4 0 0 0-3.143-3.143C31.394 12 30.93 12 30 12s-1.394 0-1.78.077a4 4 0 0 0-3.143 3.143C25 15.606 25 16.07 25 17v4.5a1.5 1.5 0 0 1-3 0V17Z"/><path fill="#E87DE8" fill-rule="evenodd" d="M12 36.62c0-4.317 0-6.476.92-8.088a7 7 0 0 1 2.612-2.612c1.612-.92 3.77-.92 8.088-.92h6.855c.469 0 .703 0 .906.017 2.73.222 4.364 2.438 4.619 4.983.27-2.698 2.111-5 5.015-5A6.985 6.985 0 0 1 48 31.985v5.395c0 4.317 0 6.476-.92 8.088a7 7 0 0 1-2.612 2.612c-1.612.92-3.77.92-8.088.92h-5.855c-.469 0-.703 0-.906-.017-2.73-.222-4.364-2.438-4.619-4.983-.258 2.583-1.943 4.818-4.714 4.99-.155.01-.335.01-.694.01-.55 0-.825 0-1.057-.015a7 7 0 0 1-6.52-6.52C12 42.233 12 41.958 12 41.408V36.62Zm21.24-.273a4 4 0 1 0-6.478 0c.985 1.36 1.479 2.039 1.564 2.229.178.398.176.818.174 1.247V42.5a1.5 1.5 0 0 0 3 0v-2.677c-.002-.429-.004-.85.174-1.247.085-.19.579-.87 1.565-2.229Z" clip-rule="evenodd"/><rect class="help-img-highlight" width="59" height="59" x=".5" y=".5" rx="2.5"/></svg>`,HELP_COMPAS_IMG:Ae`<svg width="60" height="60" fill="none" viewBox="0 0 60 60"><rect width="60" height="60" fill="#1DC956" rx="30"/><circle cx="30" cy="29.999" r="3" fill="#fff"/><path fill="#2BEE6C" stroke="#fff" stroke-width="2" d="m45.316 17.9-.88-.425.88.424a7.9 7.9 0 0 1 .026-.053c.093-.192.21-.432.26-.687l-.819-.162.819.162a2 2 0 0 0-.239-1.405c-.132-.224-.32-.412-.472-.562a8.415 8.415 0 0 1-.042-.042l-.042-.042c-.15-.151-.338-.34-.562-.472l-.508.862.508-.862a2 2 0 0 0-1.405-.239c-.255.05-.495.167-.687.26l-.053.026-15.05 7.246-.108.052c-1.131.545-1.843.887-2.456 1.374a6.994 6.994 0 0 0-1.13 1.13c-.487.613-.83 1.325-1.375 2.457l-.051.108-7.247 15.05-.025.053c-.094.192-.21.431-.26.686a2 2 0 0 0 .239 1.406l.855-.505-.856.505c.133.224.321.411.473.562l.042.042.041.042c.15.151.338.34.563.472a2 2 0 0 0 1.405.239l-.195-.981.195.98c.255-.05.494-.166.686-.26l.054-.025-.419-.87.419.87 15.05-7.247.107-.051c1.132-.545 1.844-.888 2.457-1.374a7.002 7.002 0 0 0 1.13-1.13c.487-.614.83-1.325 1.374-2.457l.052-.108 7.246-15.05Z"/><path fill="#1DC956" d="m33.376 32.723-2.669-3.43-14.85 14.849.206.205a1 1 0 0 0 1.141.194l15.105-7.273a3 3 0 0 0 1.067-4.545Z"/><path fill="#86F999" d="m26.624 27.276 2.669 3.43 14.85-14.849-.206-.205a1 1 0 0 0-1.141-.194L27.69 22.731a3 3 0 0 0-1.067 4.545Z"/><circle cx="30" cy="30" r="3" fill="#fff" transform="rotate(45 30 30)"/><rect class="help-img-highlight" width="59" height="59" x=".5" y=".5" rx="29.5"/></svg>`,HELP_NOUN_IMG:Ae`<svg width="60" height="60" fill="none" viewBox="0 0 60 60"><rect width="60" height="60" fill="#794CFF" rx="3"/><path fill="#987DE8" stroke="#fff" stroke-width="2" d="M33 22.5v-1H16v5H8.5V36H13v-5h3v7.5h17V31h1v7.5h17v-17H34v5h-1v-4Z"/><path fill="#fff" d="M37.5 25h10v10h-10z"/><path fill="#4019B2" d="M42.5 25h5v10h-5z"/><path fill="#fff" d="M19.5 25h10v10h-10z"/><path fill="#4019B2" d="M24.5 25h5v10h-5z"/><path fill="#fff" d="M12 30.5h4V37h-4v-6.5Z"/><rect class="help-img-highlight" width="59" height="59" x=".5" y=".5" rx="2.5"/></svg>`,HELP_DAO_IMG:Ae`<svg width="60" height="60" fill="none" viewBox="0 0 60 60"><g clip-path="url(#o)"><path fill="#EB8B47" d="M0 24.9c0-9.252 0-13.878 1.97-17.332A15 15 0 0 1 7.569 1.97C11.023 0 15.648 0 24.9 0h10.2c9.251 0 13.877 0 17.332 1.97a15 15 0 0 1 5.597 5.598C60 11.022 60 15.648 60 24.899v10.2c0 9.252 0 13.878-1.97 17.332a15.001 15.001 0 0 1-5.598 5.598c-3.455 1.97-8.08 1.97-17.332 1.97H24.9c-9.251 0-13.877 0-17.332-1.97a15 15 0 0 1-5.597-5.598C0 48.977 0 44.351 0 35.1V24.9Z"/><path class="help-img-highlight" d="M.5 24.9c0-4.635 0-8.078.244-10.795.244-2.71.726-4.65 1.66-6.29a14.5 14.5 0 0 1 5.412-5.41C9.455 1.468 11.395.986 14.105.743 16.822.5 20.265.5 24.9.5h10.2c4.635 0 8.078 0 10.795.244 2.71.243 4.65.725 6.29 1.66a14.5 14.5 0 0 1 5.41 5.411c.935 1.64 1.417 3.58 1.66 6.29.244 2.717.245 6.16.245 10.794v10.2c0 4.635 0 8.078-.244 10.796-.244 2.71-.726 4.65-1.66 6.289a14.5 14.5 0 0 1-5.412 5.41c-1.639.936-3.579 1.418-6.289 1.661-2.717.244-6.16.244-10.795.244H24.9c-4.635 0-8.078 0-10.795-.244-2.71-.243-4.65-.725-6.29-1.66a14.5 14.5 0 0 1-5.41-5.411c-.935-1.64-1.417-3.58-1.66-6.29C.5 43.178.5 39.734.5 35.1V24.9Z"/><path fill="#FF974C" stroke="#fff" stroke-width="2" d="M19 52c5.523 0 10-4.477 10-10s-4.477-10-10-10S9 36.477 9 42s4.477 10 10 10Z"/><path fill="#fff" fill-rule="evenodd" d="M42.844 8.326a1 1 0 0 0-1.687 0L28.978 27.463A1 1 0 0 0 29.822 29h24.357a1 1 0 0 0 .843-1.537L42.844 8.326Z" clip-rule="evenodd"/><path fill="#FF974C" fill-rule="evenodd" d="M42.335 11.646c.324.115.571.504 1.066 1.28l7.332 11.523c.562.883.843 1.325.792 1.69a1 1 0 0 1-.342.623c-.28.238-.803.238-1.85.238H34.667c-1.047 0-1.57 0-1.85-.238a1 1 0 0 1-.342-.623c-.051-.365.23-.806.792-1.69l7.332-11.523c.495-.776.742-1.165 1.066-1.28a1 1 0 0 1 .67 0ZM35 27a7 7 0 0 0 7-7 7 7 0 0 0 7 7H35Z" clip-rule="evenodd"/><path fill="#FF974C" stroke="#fff" stroke-width="2" d="M10.106 9.357c-.109.32-.107.682-.106.975V25.668c-.001.293-.003.654.106.975a2 2 0 0 0 1.251 1.25c.32.11.682.108.975.107H19c5.523 0 10-4.477 10-10S24.523 8 19 8h-6.668c-.293-.001-.654-.003-.975.106a2 2 0 0 0-1.25 1.251Z"/><circle cx="19" cy="18" r="4" fill="#EB8B47" stroke="#fff" stroke-width="2"/><circle cx="19" cy="41.999" r="4" fill="#EB8B47" stroke="#fff" stroke-width="2"/></g><defs><clipPath id="o"><path fill="#fff" d="M0 0h60v60H0z"/></clipPath></defs></svg>`,SEARCH_ICON:Ae`<svg width="20" height="21"><path fill-rule="evenodd" clip-rule="evenodd" d="M12.432 13.992c-.354-.353-.91-.382-1.35-.146a5.5 5.5 0 1 1 2.265-2.265c-.237.441-.208.997.145 1.35l3.296 3.296a.75.75 0 1 1-1.06 1.061l-3.296-3.296Zm.06-5a4 4 0 1 1-8 0 4 4 0 0 1 8 0Z" fill="#949E9E"/></svg>`,HELP_ICON:Ae`<svg width="11" height="17" viewBox="0 0 11 17"><path fill="#fff" d="M5.22 2.97c-1.07 0-2.25.843-2.25 2.25a.75.75 0 0 1-1.5 0c0-2.393 2.019-3.75 3.75-3.75 1.73 0 3.75 1.357 3.75 3.75 0 1.64-1.038 2.466-1.785 3.057-.802.635-1.215.984-1.215 1.693a.75.75 0 1 1-1.5 0c0-1.466.985-2.24 1.681-2.788l.103-.081C7.007 6.504 7.47 6.08 7.47 5.22c0-1.407-1.181-2.25-2.25-2.25ZM5.22 14.97a1.25 1.25 0 1 0 0-2.5 1.25 1.25 0 0 0 0 2.5Z"/></svg>`,WALLET_ICON:Ae`<svg width="15" height="14" fill="none" viewBox="0 0 15 14"><path fill="#fff" fill-rule="evenodd" d="M.64 9.2v-3h.001c.009-1.857.07-2.886.525-3.682a4 4 0 0 1 1.492-1.493C3.58.5 4.813.5 7.28.5h3.735c.58 0 .871 0 1.114.04A3 3 0 0 1 14.6 3.011c.04.243.04.533.04 1.114 0 .58 0 .871-.04 1.114a3 3 0 0 1-2.471 2.47c-.243.041-.533.041-1.114.041h-.777c.178.307.302.648.362 1.011.04.243.04.533.04 1.114 0 .58 0 .871-.04 1.114a3 3 0 0 1-2.471 2.47c-.243.041-.533.041-1.114.041H4.507A3.867 3.867 0 0 1 .64 9.633V9.2ZM7.28 2h3.735c.64 0 .779.005.87.02a1.5 1.5 0 0 1 1.235 1.236c.015.09.02.229.02.869s-.005.779-.02.87a1.5 1.5 0 0 1-1.236 1.235c-.09.015-.229.02-.869.02H4.023c-.697 0-1.345.21-1.883.572V6.25h.001c.004-.791.015-1.383.059-1.867.056-.629.157-.926.269-1.122a2.5 2.5 0 0 1 .932-.933c.197-.111.494-.212 1.123-.268C5.173 2 6.019 2 7.28 2Zm-.265 5.75H4.023c-1.04 0-1.883.843-1.883 1.883A2.367 2.367 0 0 0 4.507 12h2.508c.64 0 .779-.005.87-.02a1.5 1.5 0 0 0 1.235-1.236c.015-.09.02-.229.02-.869s-.005-.779-.02-.87A1.5 1.5 0 0 0 7.884 7.77c-.09-.015-.228-.02-.869-.02Z" clip-rule="evenodd"/></svg>`,NETWORK_PLACEHOLDER:Ae`<svg width="28" height="28" fill="none" viewBox="0 0 28 28"><mask id="p" width="26" height="28" x="1" y="0" maskUnits="userSpaceOnUse" style="mask-type:alpha"><path fill="#D9D9D9" d="M12 1.172a4 4 0 0 1 4 0l8.124 4.69a4 4 0 0 1 2 3.465v9.381a4 4 0 0 1-2 3.464L16 26.862a4 4 0 0 1-4 0l-8.124-4.69a4 4 0 0 1-2-3.464V9.327a4 4 0 0 1 2-3.464L12 1.173Z"/></mask><g mask="url(#p)"><path id="network-placeholder-fill" fill="#fff" d="M0 0h28v28H0z"/><path id="network-placeholder-dash" stroke="#000" stroke-dasharray="2 2" d="m8.953 2.931 2.032-1.173.25.433 1.015-.586c.269-.155.553-.271.844-.35l-.13-.483a4.003 4.003 0 0 1 2.071 0l-.13.483c.293.079.576.195.845.35l1.016.586.25-.433 2.03 1.173-.25.433 2.032 1.173.25-.433 2.03 1.172-.25.433 1.016.587c.269.155.512.342.725.556l.354-.354a4.003 4.003 0 0 1 1.035 1.794l-.483.129c.078.292.12.596.12.906v1.172h.5v2.346h-.5v2.345h.5v2.345h-.5v1.173c0 .31-.042.614-.12.906l.483.13a4.003 4.003 0 0 1-1.035 1.793l-.354-.354a3.498 3.498 0 0 1-.725.556l-1.015.586.25.434-2.031 1.172-.25-.433-2.031 1.173.25.433-2.031 1.172-.25-.433-1.016.587a3.494 3.494 0 0 1-.844.35l.13.482a4.003 4.003 0 0 1-2.071 0l.13-.483a3.496 3.496 0 0 1-.845-.35l-1.015-.586-.25.433-2.032-1.172.25-.433-2.03-1.173-.25.433L4.89 22.76l.25-.434-1.015-.586a3.498 3.498 0 0 1-.725-.556l-.354.354a4.003 4.003 0 0 1-1.035-1.794l.483-.13a3.497 3.497 0 0 1-.12-.905v-1.173h-.5V15.19h.5v-2.345h-.5v-2.346h.5V9.327c0-.31.042-.614.12-.906l-.483-.13a4.003 4.003 0 0 1 1.035-1.793l.354.354c.213-.214.456-.401.725-.556l1.015-.587-.25-.433 2.031-1.172.25.433 2.031-1.173-.25-.433Z"/><path fill="#798686" stroke="#fff" d="M14.243 13.563 14 13.428l-.243.135-6.388 3.549-.024.013c-.432.24-.79.44-1.053.622-.266.184-.516.405-.636.722a1.5 1.5 0 0 0 0 1.062c.12.317.37.538.636.722.263.183.62.382 1.053.622l.024.013 3.164 1.758.088.049c1.164.646 1.857 1.032 2.607 1.162.51.09 1.033.09 1.544 0 .75-.13 1.443-.516 2.606-1.162l.09-.05 3.163-1.757.024-.013c.432-.24.79-.44 1.053-.622.266-.184.516-.405.636-.722l-.468-.177.468.177a1.5 1.5 0 0 0 0-1.062l-.468.177.468-.177c-.12-.317-.37-.538-.636-.722-.263-.183-.62-.382-1.053-.622l-.024-.013-6.388-3.55Z"/><path fill="#9EA9A9" stroke="#fff" d="M14.243 8.563 14 8.428l-.243.135-6.388 3.549-.024.013c-.432.24-.79.44-1.053.622-.266.184-.516.405-.636.722a1.5 1.5 0 0 0 0 1.062c.12.316.37.537.636.722.263.183.62.382 1.053.622l.024.013 3.164 1.758.088.049c1.164.646 1.857 1.032 2.607 1.162.51.09 1.033.09 1.544 0 .75-.13 1.443-.516 2.606-1.162l.09-.05 3.163-1.757.024-.013c.432-.24.79-.44 1.053-.622.266-.184.516-.405.636-.722l-.468-.177.468.177a1.5 1.5 0 0 0 0-1.062l-.468.177.468-.177c-.12-.316-.37-.537-.636-.722-.263-.183-.62-.382-1.053-.622l-.024-.013-6.388-3.55Z"/><path fill="#C9CFCF" stroke="#fff" d="m22.344 9.53-.468-.176.468.177a1.5 1.5 0 0 0 0-1.062l-.468.177.468-.177c-.12-.317-.37-.537-.636-.722-.263-.183-.62-.382-1.053-.622l-.024-.013-3.163-1.758-.09-.05c-1.163-.645-1.856-1.03-2.606-1.161a4.5 4.5 0 0 0-1.544 0c-.75.13-1.443.516-2.607 1.162l-.088.05-3.164 1.757-.024.013c-.432.24-.79.44-1.053.622-.266.185-.516.405-.636.722a1.5 1.5 0 0 0 0 1.062c.12.317.37.537.636.722.263.183.62.382 1.053.622l.024.013 3.164 1.758.088.049c1.164.646 1.857 1.032 2.607 1.162.51.09 1.033.09 1.544 0 .75-.13 1.443-.516 2.606-1.162l.09-.05 3.163-1.757.024-.013c.432-.24.79-.44 1.053-.622.266-.184.516-.405.636-.722Z"/></g></svg>`,WALLET_PLACEHOLDER:Ae`<svg width="60" height="60" fill="none" viewBox="0 0 60 60"><g clip-path="url(#q)"><path id="wallet-placeholder-fill" fill="#fff" d="M0 24.9c0-9.251 0-13.877 1.97-17.332a15 15 0 0 1 5.598-5.597C11.023 0 15.648 0 24.9 0h10.2c9.252 0 13.877 0 17.332 1.97a15 15 0 0 1 5.597 5.598C60 11.023 60 15.648 60 24.9v10.2c0 9.252 0 13.877-1.97 17.332a15.001 15.001 0 0 1-5.598 5.597C48.977 60 44.352 60 35.1 60H24.9c-9.251 0-13.877 0-17.332-1.97a15 15 0 0 1-5.597-5.598C0 48.977 0 44.352 0 35.1V24.9Z"/><path id="wallet-placeholder-dash" stroke="#000" stroke-dasharray="4 4" stroke-width="1.5" d="M.04 41.708a231.598 231.598 0 0 1-.039-4.403l.75-.001L.75 35.1v-2.55H0v-5.1h.75V24.9l.001-2.204h-.75c.003-1.617.011-3.077.039-4.404l.75.016c.034-1.65.099-3.08.218-4.343l-.746-.07c.158-1.678.412-3.083.82-4.316l.713.236c.224-.679.497-1.296.827-1.875a14.25 14.25 0 0 1 1.05-1.585L3.076 5.9A15 15 0 0 1 5.9 3.076l.455.596a14.25 14.25 0 0 1 1.585-1.05c.579-.33 1.196-.603 1.875-.827l-.236-.712C10.812.674 12.217.42 13.895.262l.07.746C15.23.89 16.66.824 18.308.79l-.016-.75C19.62.012 21.08.004 22.695.001l.001.75L24.9.75h2.55V0h5.1v.75h2.55l2.204.001v-.75c1.617.003 3.077.011 4.404.039l-.016.75c1.65.034 3.08.099 4.343.218l.07-.746c1.678.158 3.083.412 4.316.82l-.236.713c.679.224 1.296.497 1.875.827a14.24 14.24 0 0 1 1.585 1.05l.455-.596A14.999 14.999 0 0 1 56.924 5.9l-.596.455c.384.502.735 1.032 1.05 1.585.33.579.602 1.196.827 1.875l.712-.236c.409 1.233.663 2.638.822 4.316l-.747.07c.119 1.264.184 2.694.218 4.343l.75-.016c.028 1.327.036 2.787.039 4.403l-.75.001.001 2.204v2.55H60v5.1h-.75v2.55l-.001 2.204h.75a231.431 231.431 0 0 1-.039 4.404l-.75-.016c-.034 1.65-.099 3.08-.218 4.343l.747.07c-.159 1.678-.413 3.083-.822 4.316l-.712-.236a10.255 10.255 0 0 1-.827 1.875 14.242 14.242 0 0 1-1.05 1.585l.596.455a14.997 14.997 0 0 1-2.824 2.824l-.455-.596c-.502.384-1.032.735-1.585 1.05-.579.33-1.196.602-1.875.827l.236.712c-1.233.409-2.638.663-4.316.822l-.07-.747c-1.264.119-2.694.184-4.343.218l.016.75c-1.327.028-2.787.036-4.403.039l-.001-.75-2.204.001h-2.55V60h-5.1v-.75H24.9l-2.204-.001v.75a231.431 231.431 0 0 1-4.404-.039l.016-.75c-1.65-.034-3.08-.099-4.343-.218l-.07.747c-1.678-.159-3.083-.413-4.316-.822l.236-.712a10.258 10.258 0 0 1-1.875-.827 14.252 14.252 0 0 1-1.585-1.05l-.455.596A14.999 14.999 0 0 1 3.076 54.1l.596-.455a14.24 14.24 0 0 1-1.05-1.585 10.259 10.259 0 0 1-.827-1.875l-.712.236C.674 49.188.42 47.783.262 46.105l.746-.07C.89 44.77.824 43.34.79 41.692l-.75.016Z"/><path fill="#fff" fill-rule="evenodd" d="M35.643 32.145c-.297-.743-.445-1.114-.401-1.275a.42.42 0 0 1 .182-.27c.134-.1.463-.1 1.123-.1.742 0 1.499.046 2.236-.05a6 6 0 0 0 5.166-5.166c.051-.39.051-.855.051-1.784 0-.928 0-1.393-.051-1.783a6 6 0 0 0-5.166-5.165c-.39-.052-.854-.052-1.783-.052h-7.72c-4.934 0-7.401 0-9.244 1.051a8 8 0 0 0-2.985 2.986C16.057 22.28 16.003 24.58 16 29 15.998 31.075 16 33.15 16 35.224A7.778 7.778 0 0 0 23.778 43H28.5c1.394 0 2.09 0 2.67-.116a6 6 0 0 0 4.715-4.714c.115-.58.115-1.301.115-2.744 0-1.31 0-1.964-.114-2.49a4.998 4.998 0 0 0-.243-.792Z" clip-rule="evenodd"/><path fill="#9EA9A9" fill-rule="evenodd" d="M37 18h-7.72c-2.494 0-4.266.002-5.647.126-1.361.122-2.197.354-2.854.728a6.5 6.5 0 0 0-2.425 2.426c-.375.657-.607 1.492-.729 2.853-.11 1.233-.123 2.777-.125 4.867 0 .7 0 1.05.097 1.181.096.13.182.181.343.2.163.02.518-.18 1.229-.581a6.195 6.195 0 0 1 3.053-.8H37c.977 0 1.32-.003 1.587-.038a4.5 4.5 0 0 0 3.874-3.874c.036-.268.039-.611.039-1.588 0-.976-.003-1.319-.038-1.587a4.5 4.5 0 0 0-3.875-3.874C38.32 18.004 37.977 18 37 18Zm-7.364 12.5h-7.414a4.722 4.722 0 0 0-4.722 4.723 6.278 6.278 0 0 0 6.278 6.278H28.5c1.466 0 1.98-.008 2.378-.087a4.5 4.5 0 0 0 3.535-3.536c.08-.397.087-.933.087-2.451 0-1.391-.009-1.843-.08-2.17a3.5 3.5 0 0 0-2.676-2.676c-.328-.072-.762-.08-2.108-.08Z" clip-rule="evenodd"/></g><defs><clipPath id="q"><path fill="#fff" d="M0 0h60v60H0z"/></clipPath></defs></svg>`,TOKEN_PLACEHOLDER:Ae`<svg width="60" height="60" viewBox="0 0 60 60" fill="none"><rect id="token-placeholder-fill" width="58" height="58" x="1" y="1" fill="#fff" rx="29"/><path fill="#3B4040" stroke="#fff" stroke-width="2" d="M32 10a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v5.566c0 .357.192.685.495.875a16.001 16.001 0 0 1 4.256 3.894c.667.88.33 2.113-.627 2.665l-2.494 1.44c-.956.552-2.166.204-2.913-.609a9.12 9.12 0 1 0 .064 12.267c.739-.82 1.945-1.181 2.907-.64l2.509 1.415c.962.542 1.312 1.77.654 2.658a16 16 0 0 1-4.356 4.028c-.303.19-.495.518-.495.875V50a2 2 0 0 1-2 2h-2a2 2 0 0 1-2-2v-2.992c0-.602-.528-1.065-1.13-1.032-.579.032-1.16.032-1.74 0-.602-.032-1.13.43-1.13 1.032V50a2 2 0 0 1-2 2h-2a2 2 0 0 1-2-2v-5.566c0-.357-.192-.685-.495-.875a16 16 0 0 1 0-27.118c.303-.19.495-.517.495-.875V10a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v2.992c0 .601.528 1.064 1.13 1.032.58-.032 1.161-.032 1.74 0 .602.033 1.13-.43 1.13-1.032V10Z"/><rect id="token-placeholder-dash" width="58" height="58" x="1" y="1" stroke="#000" stroke-dasharray="6 6" stroke-width="2" rx="29"/></svg>`,ACCOUNT_COPY:Ae`<svg width="14" height="14" fill="none" viewBox="0 0 14 14"><path fill="#fff" fill-rule="evenodd" d="M4.003 4.005c.012-1.225.074-1.936.391-2.491a3 3 0 0 1 1.12-1.12C6.204 0 7.136 0 9 0s2.795 0 3.486.394a3 3 0 0 1 1.12 1.12C14 2.204 14 3.136 14 5s0 2.795-.394 3.486a3 3 0 0 1-1.12 1.12c-.555.317-1.266.379-2.491.391l.002.003c-.012 1.222-.075 1.932-.391 2.486a3 3 0 0 1-1.12 1.12C7.796 14 6.864 14 5 14s-2.795 0-3.486-.394a3 3 0 0 1-1.12-1.12C0 11.796 0 10.864 0 9s0-2.795.394-3.486a3 3 0 0 1 1.12-1.12c.554-.316 1.264-.379 2.486-.391l.003.002ZM9 8.5c-.959 0-1.58-.001-2.05-.043-.45-.04-.613-.109-.693-.154a1.5 1.5 0 0 1-.56-.56c-.045-.08-.113-.243-.154-.693C5.501 6.58 5.5 5.959 5.5 5c0-.959.001-1.58.043-2.05.04-.45.109-.613.154-.693a1.5 1.5 0 0 1 .56-.56c.08-.045.243-.113.693-.154C7.42 1.501 8.041 1.5 9 1.5c.959 0 1.58.001 2.05.043.45.04.613.109.693.154a1.5 1.5 0 0 1 .56.56c.045.08.113.243.154.693.042.47.043 1.091.043 2.05 0 .959-.001 1.58-.043 2.05-.04.45-.109.613-.154.693a1.5 1.5 0 0 1-.56.56c-.08.045-.242.113-.693.154-.47.042-1.091.043-2.05.043ZM4 5.503a13.77 13.77 0 0 0-1.05.04c-.45.04-.613.109-.693.154a1.5 1.5 0 0 0-.56.56c-.045.08-.113.243-.154.693C1.501 7.42 1.5 8.041 1.5 9c0 .959.001 1.58.043 2.05.04.45.109.613.154.693a1.5 1.5 0 0 0 .56.56c.08.045.243.113.693.154.47.042 1.091.043 2.05.043.959 0 1.58-.001 2.05-.043.45-.04.613-.109.693-.154a1.5 1.5 0 0 0 .56-.56c.045-.08.113-.242.154-.693.025-.283.035-.619.04-1.05-1.534-.003-2.358-.037-2.983-.394a3 3 0 0 1-1.12-1.12c-.357-.625-.39-1.449-.394-2.983Z" clip-rule="evenodd"/></svg>`,ACCOUNT_DISCONNECT:Ae`<svg width="16" height="14" fill="none" viewBox="0 0 16 14"><path fill="#fff" d="M9.677 1.5h-2.61c-1.261 0-2.107.001-2.757.06-.629.056-.926.157-1.122.268a2.5 2.5 0 0 0-.933.933c-.112.196-.212.493-.269 1.122-.058.65-.06 1.496-.06 2.757v.72c0 1.26.002 2.107.06 2.756.057.63.157.927.27 1.123a2.5 2.5 0 0 0 .932.933c.196.111.493.212 1.122.268.65.059 1.496.06 2.757.06h2.61a.75.75 0 1 1 0 1.5h-2.61c-2.467 0-3.7 0-4.622-.525a4 4 0 0 1-1.493-1.493C.427 11.06.427 9.827.427 7.36v-.72c0-2.467 0-3.7.525-4.622A4 4 0 0 1 2.445.525C3.366 0 4.6 0 7.067 0h2.61a.75.75 0 1 1 0 1.5Z"/><path fill="#fff" d="M10.896 11.03a.75.75 0 0 1 0-1.06l1.793-1.793a.25.25 0 0 0-.176-.427H8.177a.75.75 0 0 1 0-1.5h4.336a.25.25 0 0 0 .176-.427L10.896 4.03a.75.75 0 0 1 1.061-1.06l3.323 3.323a1 1 0 0 1 0 1.414l-3.323 3.323a.75.75 0 0 1-1.06 0Z"/></svg>`},Q6={1:"692ed6ba-e569-459a-556a-776476829e00",42161:"600a9a04-c1b9-42ca-6785-9b4b6ff85200",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"};var or=(t=>(t.metaMask="metaMask",t.trust="trust",t.phantom="phantom",t.brave="brave",t.spotEthWallet="spotEthWallet",t.exodus="exodus",t.tokenPocket="tokenPocket",t.frame="frame",t.tally="tally",t.coinbaseWallet="coinbaseWallet",t.core="core",t.bitkeep="bitkeep",t.mathWallet="mathWallet",t.opera="opera",t.tokenary="tokenary",t["1inch"]="1inch",t.kuCoinWallet="kuCoinWallet",t.ledger="ledger",t))(or||{});const Vr={injectedPreset:{metaMask:{name:"MetaMask",icon:"619537c0-2ff3-4c78-9ed8-a05e7567f300",url:"https://metamask.io",isMobile:!0,isInjected:!0},trust:{name:"Trust",icon:"0528ee7e-16d1-4089-21e3-bbfb41933100",url:"https://trustwallet.com",isMobile:!0,isInjected:!0},spotEthWallet:{name:"Spot",icon:"1bf33a89-b049-4a1c-d1f6-4dd7419ee400",url:"https://www.spot-wallet.com",isMobile:!0,isInjected:!0},phantom:{name:"Phantom",icon:"62471a22-33cb-4e65-5b54-c3d9ea24b900",url:"https://phantom.app",isInjected:!0},core:{name:"Core",icon:"35f9c46e-cc57-4aa7-315d-e6ccb2a1d600",url:"https://core.app",isMobile:!0,isInjected:!0},bitkeep:{name:"BitKeep",icon:"3f7075d0-4ab7-4db5-404d-3e4c05e6fe00",url:"https://bitkeep.com",isMobile:!0,isInjected:!0},tokenPocket:{name:"TokenPocket",icon:"f3119826-4ef5-4d31-4789-d4ae5c18e400",url:"https://www.tokenpocket.pro",isMobile:!0,isInjected:!0},mathWallet:{name:"MathWallet",icon:"26a8f588-3231-4411-60ce-5bb6b805a700",url:"https://mathwallet.org",isMobile:!0,isInjected:!0},exodus:{name:"Exodus",icon:"4c16cad4-cac9-4643-6726-c696efaf5200",url:"https://www.exodus.com",isMobile:!0,isDesktop:!0,isInjected:!0},kuCoinWallet:{name:"KuCoin Wallet",icon:"1e47340b-8fd7-4ad6-17e7-b2bd651fae00",url:"https://kuwallet.com",isMobile:!0,isInjected:!0},ledger:{name:"Ledger",icon:"a7f416de-aa03-4c5e-3280-ab49269aef00",url:"https://www.ledger.com",isDesktop:!0},brave:{name:"Brave",icon:"125e828e-9936-4451-a8f2-949c119b7400",url:"https://brave.com/wallet",isInjected:!0},frame:{name:"Frame",icon:"cd492418-ea85-4ef1-aeed-1c9e20b58900",url:"https://frame.sh",isInjected:!0},tally:{name:"Tally",icon:"98d2620c-9fc8-4a1c-31bc-78d59d00a300",url:"https://tallyho.org",isInjected:!0},coinbaseWallet:{name:"Coinbase",icon:"f8068a7f-83d7-4190-1f94-78154a12c600",url:"https://www.coinbase.com/wallet",isInjected:!0},opera:{name:"Opera",icon:"877fa1a4-304d-4d45-ca8e-f76d1a556f00",url:"https://www.opera.com/crypto",isInjected:!0},tokenary:{name:"Tokenary",icon:"5e481041-dc3c-4a81-373a-76bbde91b800",url:"https://tokenary.io",isDesktop:!0,isInjected:!0},["1inch"]:{name:"1inch Wallet",icon:"dce1ee99-403f-44a9-9f94-20de30616500",url:"https://1inch.io/wallet",isMobile:!0}},getInjectedId(t){if(t.toUpperCase()!=="INJECTED"&&t.length)return t;const{ethereum:e,spotEthWallet:r,coinbaseWalletExtension:n}=window;return e?e.isTrust||e.isTrustWallet?"trust":e.isPhantom?"phantom":e.isBraveWallet?"brave":r?"spotEthWallet":e.isExodus?"exodus":e.isTokenPocket?"tokenPocket":e.isFrame?"frame":e.isTally?"tally":n?"coinbaseWallet":e.isAvalanche?"core":e.isBitKeep?"bitkeep":e.isMathWallet?"mathWallet":e.isOpera?"opera":e.isTokenary?"tokenary":e.isOneInchIOSWallet||e.isOneInchAndroidWallet?"1inch":e.isKuCoinWallet?"kuCoinWallet":e.isMetaMask?"metaMask":"injected":"metaMask"},getInjectedName(t){var e,r;if(t.length&&t.toUpperCase()!=="INJECTED")return t;const n=Vr.getInjectedId("");return(r=(e=Vr.injectedPreset[n])==null?void 0:e.name)!=null?r:"Injected"}},e4={ETH:{icon:"692ed6ba-e569-459a-556a-776476829e00"},WETH:{icon:"692ed6ba-e569-459a-556a-776476829e00"},AVAX:{icon:"30c46e53-e989-45fb-4549-be3bd4eb3b00"},FTM:{icon:"06b26297-fe0c-4733-5d6b-ffa5498aac00"},BNB:{icon:"93564157-2e8e-4ce7-81df-b264dbee9b00"},MATIC:{icon:"41d04d42-da3b-4453-8506-668cc0727900"},OP:{icon:"ab9c186a-c52f-464b-2906-ca59d760a400"},xDAI:{icon:"02b53f6a-e3d4-479e-1cb4-21178987d100"},EVMOS:{icon:"f926ff41-260d-4028-635e-91913fc28e00"},METIS:{icon:"3897a66d-40b9-4833-162f-a2c90531c900"},IOTX:{icon:"34e68754-e536-40da-c153-6ef2e7188a00"}};var t4=Object.defineProperty,ud=Object.getOwnPropertySymbols,r4=Object.prototype.hasOwnProperty,n4=Object.prototype.propertyIsEnumerable,hd=(t,e,r)=>e in t?t4(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,i4=(t,e)=>{for(var r in e||(e={}))r4.call(e,r)&&hd(t,r,e[r]);if(ud)for(var r of ud(e))n4.call(e,r)&&hd(t,r,e[r]);return t};const ne={MOBILE_BREAKPOINT:600,W3M_RECENT_WALLET:"W3M_RECENT_WALLET",rejectStandaloneButtonComponent(){const{isStandalone:t}=Q.state;if(t)throw new Error("Web3Modal button components are not available in standalone mode.")},getShadowRootElement(t,e){const r=t.renderRoot.querySelector(e);if(!r)throw new Error(`${e} not found`);return r},getWalletId(t){return Vr.getInjectedId(t)},getWalletIcon(t){var e,r;const n=(e=Vr.injectedPreset[t])==null?void 0:e.icon,{projectId:i,walletImages:s}=Ve.state;return(r=s?.[t])!=null?r:i&&n?at.getImageUrl(n):""},getWalletName(t,e=!1){const r=Vr.getInjectedName(t);return e?r.split(" ")[0]:r},getChainIcon(t){var e;const r=Q6[t],{projectId:n,chainImages:i}=Ve.state;return(e=i?.[t])!=null?e:n&&r?at.getImageUrl(r):""},getTokenIcon(t){var e,r;const n=(e=e4[t])==null?void 0:e.icon,{projectId:i,tokenImages:s}=Ve.state;return(r=s?.[t])!=null?r:i&&n?at.getImageUrl(n):""},isMobileAnimation(){return window.innerWidth<=ne.MOBILE_BREAKPOINT},async preloadImage(t){return new Promise((e,r)=>{const n=new Image;n.onload=e,n.onerror=r,n.src=t})},getErrorMessage(t){return t instanceof Error?t.message:"Unknown Error"},debounce(t,e=500){let r;return(...n)=>{function i(){t(...n)}r&&clearTimeout(r),r=setTimeout(i,e)}},async handleMobileLinking(t){const{standaloneUri:e,selectedChain:r}=Q.state,{links:n,name:i}=t;function s(o){let a="";n!=null&&n.universal?a=Ue.formatUniversalUrl(n.universal,o,i):n!=null&&n.native&&(a=Ue.formatNativeUrl(n.native,o,i)),Ue.openHref(a)}e?(ne.setRecentWallet(t),s(e)):(await qe.client().connectWalletConnect(o=>{s(o)},r?.id),ne.setRecentWallet(t),dt.close())},async handleAndroidLinking(){const{standaloneUri:t,selectedChain:e}=Q.state;t?Ue.openHref(t):(await qe.client().connectWalletConnect(r=>{Ue.setWalletConnectAndroidDeepLink(r),Ue.openHref(r)},e?.id),dt.close())},async handleUriCopy(){const{standaloneUri:t}=Q.state;if(t)await navigator.clipboard.writeText(t);else{const e=qe.client().walletConnectUri;await navigator.clipboard.writeText(e)}Lt.openToast("Link copied","success")},async handleConnectorConnection(t,e){try{const{selectedChain:r}=Q.state;await qe.client().connectConnector(t,r?.id),dt.close()}catch(r){console.error(r),e?e():Lt.openToast(ne.getErrorMessage(r),"error")}},getCustomWallets(){var t;const{desktopWallets:e,mobileWallets:r}=Ve.state;return(t=Ue.isMobile()?r:e)!=null?t:[]},getCustomImageUrls(){const{chainImages:t,walletImages:e}=Ve.state,r=Object.values(t??{}),n=Object.values(e??{});return Object.values([...r,...n])},getConnectorImageUrls(){return qe.client().getConnectors().map(({id:t})=>Vr.getInjectedId(t)).map(t=>ne.getWalletIcon(t))},truncate(t,e=8){return t.length<=e?t:`${t.substring(0,4)}...${t.substring(t.length-4)}`},generateAvatarColors(t){var e;const r=(e=t.match(/.{1,7}/g))==null?void 0:e.splice(0,5),n=[];r?.forEach(s=>{let o=0;for(let c=0;c<s.length;c+=1)o=s.charCodeAt(c)+((o<<5)-o),o=o&o;const a=[0,0,0];for(let c=0;c<3;c+=1){const l=o>>c*8&255;a[c]=l}n.push(`rgb(${a[0]}, ${a[1]}, ${a[2]})`)});const i=document.querySelector(":root");if(i){const s={"--w3m-color-av-1":n[0],"--w3m-color-av-2":n[1],"--w3m-color-av-3":n[2],"--w3m-color-av-4":n[3],"--w3m-color-av-5":n[4]};Object.entries(s).forEach(([o,a])=>i.style.setProperty(o,a))}},setRecentWallet(t){const{walletConnectVersion:e}=Q.state;localStorage.setItem(ne.W3M_RECENT_WALLET,JSON.stringify({[e]:t}))},getRecentWallet(){const t=localStorage.getItem(ne.W3M_RECENT_WALLET);if(t){const{walletConnectVersion:e}=Q.state,r=JSON.parse(t);if(r[e])return r[e]}},getExtensionWallets(){const t=[];for(const[e,r]of Object.entries(Vr.injectedPreset))e!==or.coinbaseWallet&&r&&r.isInjected&&!r.isDesktop&&t.push(i4({id:e},r));return t},caseSafeIncludes(t,e){return t.toUpperCase().includes(e.toUpperCase())}},s4=_e`#w3m-transparent-noise,.w3m-canvas,.w3m-color-placeholder,.w3m-gradient-placeholder,.w3m-highlight{inset:0;position:absolute;display:block;pointer-events:none;width:100%;height:100px;border-radius:8px 8px 0 0;transform:translateY(-5px)}.w3m-gradient-placeholder{background:linear-gradient(var(--w3m-gradient-1),var(--w3m-gradient-2),var(--w3m-gradient-3),var(--w3m-gradient-4))}.w3m-color-placeholder{background-color:var(--w3m-color-fg-accent)}.w3m-highlight{border:1px solid var(--w3m-color-overlay)}.w3m-canvas{opacity:0;transition:opacity 2s ease;box-shadow:0 8px 28px -6px rgba(10,16,31,.12),0 18px 88px -4px rgba(10,16,31,.14)}.w3m-canvas-visible{opacity:1}#w3m-transparent-noise{mix-blend-mode:multiply;opacity:.35}.w3m-toolbar{height:28px;display:flex;position:relative;margin:5px 15px 5px 5px;justify-content:space-between;align-items:center}.w3m-toolbar img,.w3m-toolbar svg{height:28px;object-position:left center;object-fit:contain}#w3m-wc-logo path{fill:var(--w3m-color-fg-inverse)}.w3m-action-btn{width:28px;height:28px;border-radius:50%;border:0;display:flex;justify-content:center;align-items:center;cursor:pointer;transition:background-color,.2s ease;background-color:var(--w3m-color-bg-1);box-shadow:0 0 0 1px var(--w3m-color-overlay),0 2px 4px -2px rgba(0,0,0,.12),0 4px 4px -2px rgba(0,0,0,.08)}.w3m-action-btn:hover{background-color:var(--w3m-color-bg-2)}.w3m-action-btn svg{display:block;object-position:center}.w3m-action-btn path{fill:var(--w3m-color-fg-1)}.w3m-actions{display:flex}.w3m-actions button:first-child{margin-right:16px}.w3m-help-active button:first-child{background-color:var(--w3m-color-fg-1)}.w3m-help-active button:first-child path{fill:var(--w3m-color-bg-1)}`;var o4=Object.defineProperty,a4=Object.getOwnPropertyDescriptor,cc=(t,e,r,n)=>{for(var i=n>1?void 0:n?a4(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&o4(e,r,i),i};const dd=new Z6;let Si=class extends de{constructor(){super(),this.open=!1,this.isHelp=!1,this.unsubscribeRouter=void 0,this.playTimeout=void 0,this.unsubscribeRouter=Te.subscribe(t=>{this.isHelp=t.view==="Help"})}firstUpdated(){const{themeBackground:t}=Ve.state;t==="gradient"&&(this.playTimeout=setTimeout(()=>{dd.play(this.canvasEl),this.open=!0},800))}disconnectedCallback(){var t;(t=this.unsubscribeRouter)==null||t.call(this),clearTimeout(this.playTimeout),dd.stop()}get canvasEl(){return ne.getShadowRootElement(this,".w3m-canvas")}onHelp(){Te.push("Help")}render(){const{themeBackground:t}=Ve.state,e={"w3m-canvas":!0,"w3m-canvas-visible":this.open},r={"w3m-actions":!0,"w3m-help-active":this.isHelp};return V`${t==="themeColor"?V`<div class="w3m-color-placeholder"></div>`:null} ${t==="gradient"?V`<div class="w3m-gradient-placeholder"></div><canvas class="${Mt(e)}"></canvas>${ye.NOISE_TEXTURE}`:null}<div class="w3m-highlight"></div><div class="w3m-toolbar">${ye.WALLET_CONNECT_LOGO}<div class="${Mt(r)}"><button class="w3m-action-btn" @click="${this.onHelp}">${ye.HELP_ICON}</button> <button class="w3m-action-btn" @click="${dt.close}">${ye.CROSS_ICON}</button></div></div>`}};Si.styles=[ue.globalCss,s4],cc([Be()],Si.prototype,"open",2),cc([Be()],Si.prototype,"isHelp",2),Si=cc([we("w3m-modal-backcard")],Si);const c4=_e`main{padding:20px;padding-top:0;width:100%}`;var l4=Object.defineProperty,u4=Object.getOwnPropertyDescriptor,h4=(t,e,r,n)=>{for(var i=n>1?void 0:n?u4(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&l4(e,r,i),i};let lc=class extends de{render(){return V`<main><slot></slot></main>`}};lc.styles=[ue.globalCss,c4],lc=h4([we("w3m-modal-content")],lc);const d4=_e`footer{padding:10px;display:flex;flex-direction:column;align-items:inherit;justify-content:inherit;border-top:1px solid var(--w3m-color-bg-2)}`;var f4=Object.defineProperty,p4=Object.getOwnPropertyDescriptor,g4=(t,e,r,n)=>{for(var i=n>1?void 0:n?p4(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&f4(e,r,i),i};let uc=class extends de{render(){return V`<footer><slot></slot></footer>`}};uc.styles=[ue.globalCss,d4],uc=g4([we("w3m-modal-footer")],uc);const m4=_e`header{display:flex;justify-content:center;align-items:center;padding:20px;position:relative}.w3m-border{border-bottom:1px solid var(--w3m-color-bg-2);margin-bottom:20px}header button{padding:15px 20px;transition:opacity .2s ease}@media(hover:hover){header button:hover{opacity:.5}}.w3m-back-btn{position:absolute;left:0}.w3m-action-btn{position:absolute;right:0}path{fill:var(--w3m-color-fg-accent)}`;var w4=Object.defineProperty,y4=Object.getOwnPropertyDescriptor,Ii=(t,e,r,n)=>{for(var i=n>1?void 0:n?y4(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&w4(e,r,i),i};let Kr=class extends de{constructor(){super(...arguments),this.title="",this.onAction=void 0,this.actionIcon=void 0,this.border=!1}backBtnTemplate(){return V`<button class="w3m-back-btn" @click="${Te.goBack}">${ye.BACK_ICON}</button>`}actionBtnTemplate(){return V`<button class="w3m-action-btn" @click="${this.onAction}">${this.actionIcon}</button>`}render(){const t={"w3m-border":this.border},e=Te.state.history.length>1,r=this.title?V`<w3m-text variant="large-bold">${this.title}</w3m-text>`:V`<slot></slot>`;return V`<header class="${Mt(t)}">${e?this.backBtnTemplate():null} ${r} ${this.onAction?this.actionBtnTemplate():null}</header>`}};Kr.styles=[ue.globalCss,m4],Ii([be()],Kr.prototype,"title",2),Ii([be()],Kr.prototype,"onAction",2),Ii([be()],Kr.prototype,"actionIcon",2),Ii([be()],Kr.prototype,"border",2),Kr=Ii([we("w3m-modal-header")],Kr);const b4=_e`.w3m-router{overflow:hidden;will-change:transform}.w3m-content{display:flex;flex-direction:column}`;var v4=Object.defineProperty,_4=Object.getOwnPropertyDescriptor,hc=(t,e,r,n)=>{for(var i=n>1?void 0:n?_4(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&v4(e,r,i),i};let Di=class extends de{constructor(){super(),this.view=Te.state.view,this.prevView=Te.state.view,this.unsubscribe=void 0,this.oldHeight="0px",this.resizeObserver=void 0,this.unsubscribe=Te.subscribe(t=>{this.view!==t.view&&this.onChangeRoute()})}firstUpdated(){this.resizeObserver=new ResizeObserver(([t])=>{const e=`${t.contentRect.height}px`;this.oldHeight!=="0px"&&(Er(this.routerEl,{height:[this.oldHeight,e]},{duration:.2}),Er(this.routerEl,{opacity:[0,1],scale:[.99,1]},{duration:.37,delay:.03})),this.oldHeight=e}),this.resizeObserver.observe(this.contentEl)}disconnectedCallback(){var t,e;(t=this.unsubscribe)==null||t.call(this),(e=this.resizeObserver)==null||e.disconnect()}get routerEl(){return ne.getShadowRootElement(this,".w3m-router")}get contentEl(){return ne.getShadowRootElement(this,".w3m-content")}viewTemplate(){switch(this.view){case"ConnectWallet":return V`<w3m-connect-wallet-view></w3m-connect-wallet-view>`;case"SelectNetwork":return V`<w3m-select-network-view></w3m-select-network-view>`;case"InjectedConnector":return V`<w3m-injected-connector-view></w3m-injected-connector-view>`;case"InstallConnector":return V`<w3m-install-connector-view></w3m-install-connector-view>`;case"GetWallet":return V`<w3m-get-wallet-view></w3m-get-wallet-view>`;case"DesktopConnector":return V`<w3m-desktop-connector-view></w3m-desktop-connector-view>`;case"WalletExplorer":return V`<w3m-wallet-explorer-view></w3m-wallet-explorer-view>`;case"Qrcode":return V`<w3m-qrcode-view></w3m-qrcode-view>`;case"Help":return V`<w3m-help-view></w3m-help-view>`;case"Account":return V`<w3m-account-view></w3m-account-view>`;case"SwitchNetwork":return V`<w3m-switch-network-view></w3m-switch-network-view>`;default:return V`<div>Not Found</div>`}}async onChangeRoute(){await Er(this.routerEl,{opacity:[1,0],scale:[1,1.02]},{duration:.15}).finished,this.view=Te.state.view}render(){return V`<div class="w3m-router"><div class="w3m-content">${this.viewTemplate()}</div></div>`}};Di.styles=[ue.globalCss,b4],hc([Be()],Di.prototype,"view",2),hc([Be()],Di.prototype,"prevView",2),Di=hc([we("w3m-modal-router")],Di);const E4=_e`div{height:36px;width:max-content;display:flex;justify-content:center;align-items:center;padding:10px 15px;position:absolute;top:12px;box-shadow:0 6px 14px -6px rgba(10,16,31,.3),0 10px 32px -4px rgba(10,16,31,.15);z-index:2;left:50%;transform:translateX(-50%);pointer-events:none;backdrop-filter:blur(20px) saturate(1.8);-webkit-backdrop-filter:blur(20px) saturate(1.8);border-radius:36px;border:1px solid var(--w3m-color-overlay);background-color:var(--w3m-color-overlay)}svg{margin-right:5px}@-moz-document url-prefix(){div{background-color:var(--w3m-color-bg-3)}}.w3m-success path{fill:var(--w3m-color-fg-accent)}.w3m-error path{fill:var(--w3m-color-err)}`;var x4=Object.defineProperty,C4=Object.getOwnPropertyDescriptor,fd=(t,e,r,n)=>{for(var i=n>1?void 0:n?C4(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&x4(e,r,i),i};let Fs=class extends de{constructor(){super(),this.open=!1,this.unsubscribe=void 0,this.timeout=void 0,this.unsubscribe=Lt.subscribe(t=>{t.open?(this.open=!0,this.timeout=setTimeout(()=>Lt.closeToast(),2200)):(this.open=!1,clearTimeout(this.timeout))})}disconnectedCallback(){var t;(t=this.unsubscribe)==null||t.call(this),clearTimeout(this.timeout),Lt.closeToast()}render(){const{message:t,variant:e}=Lt.state,r={"w3m-success":e==="success","w3m-error":e==="error"};return this.open?V`<div class="${Mt(r)}">${e==="success"?ye.CHECKMARK_ICON:null} ${e==="error"?ye.CROSS_ICON:null}<w3m-text variant="small-normal">${t}</w3m-text></div>`:null}};Fs.styles=[ue.globalCss,E4],fd([Be()],Fs.prototype,"open",2),Fs=fd([we("w3m-modal-toast")],Fs);const S4=_e`button{padding:5px;border-radius:10px;transition:all .2s ease;display:flex;flex-direction:column;align-items:center;justify-content:center;width:80px;height:90px}w3m-network-image{width:54px;height:59px}w3m-text{width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-align:center;margin-top:5px}button:hover{background-color:var(--w3m-color-overlay)}`;var I4=Object.defineProperty,D4=Object.getOwnPropertyDescriptor,Bs=(t,e,r,n)=>{for(var i=n>1?void 0:n?D4(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&I4(e,r,i),i};let Pn=class extends de{constructor(){super(...arguments),this.onClick=()=>null,this.name="",this.chainId=""}render(){return V`<button @click="${this.onClick}"><w3m-network-image chainId="${this.chainId}"></w3m-network-image><w3m-text variant="xsmall-normal">${this.name}</w3m-text></button>`}};Pn.styles=[ue.globalCss,S4],Bs([be()],Pn.prototype,"onClick",2),Bs([be()],Pn.prototype,"name",2),Bs([be()],Pn.prototype,"chainId",2),Pn=Bs([we("w3m-network-button")],Pn);const O4=_e`div{width:inherit;height:inherit}.polygon-stroke{stroke:var(--w3m-color-overlay)}svg{width:100%;height:100%;margin:0}#network-placeholder-fill{fill:var(--w3m-color-bg-3)}#network-placeholder-dash{stroke:var(--w3m-color-overlay)}`;var A4=Object.defineProperty,$4=Object.getOwnPropertyDescriptor,pd=(t,e,r,n)=>{for(var i=n>1?void 0:n?$4(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&A4(e,r,i),i};let js=class extends de{constructor(){super(...arguments),this.chainId=""}render(){const t=ne.getChainIcon(this.chainId);return t?V`<div><svg width="54" height="59" viewBox="0 0 54 59" fill="none"><defs><clipPath id="polygon"><path d="M17.033 4.964c3.852-2.262 5.778-3.393 7.84-3.77a11.807 11.807 0 0 1 4.254 0c2.062.377 3.988 1.508 7.84 3.77l6.066 3.562c3.852 2.263 5.777 3.394 7.13 5.022a12.268 12.268 0 0 1 2.127 3.747c.71 2.006.71 4.268.71 8.793v7.124c0 4.525 0 6.787-.71 8.793a12.268 12.268 0 0 1-2.126 3.747c-1.354 1.628-3.28 2.76-7.131 5.022l-6.066 3.562c-3.852 2.262-5.778 3.393-7.84 3.771a11.814 11.814 0 0 1-4.254 0c-2.062-.378-3.988-1.509-7.84-3.77l-6.066-3.563c-3.852-2.263-5.778-3.394-7.13-5.022a12.268 12.268 0 0 1-2.127-3.747C1 40 1 37.737 1 33.212v-7.124c0-4.525 0-6.787.71-8.793a12.268 12.268 0 0 1 2.127-3.747c1.352-1.628 3.278-2.76 7.13-5.022l6.066-3.562Z"/></clipPath></defs><image clip-path="url(#polygon)" href="${t}" width="58" height="59" x="-2" y="0"/><path class="polygon-stroke" d="M17.22 5.295c3.877-2.277 5.737-3.363 7.72-3.726a11.44 11.44 0 0 1 4.12 0c1.983.363 3.844 1.45 7.72 3.726l6.065 3.562c3.876 2.276 5.731 3.372 7.032 4.938a11.896 11.896 0 0 1 2.06 3.63c.683 1.928.688 4.11.688 8.663v7.124c0 4.553-.005 6.735-.688 8.664a11.896 11.896 0 0 1-2.06 3.63c-1.3 1.565-3.156 2.66-7.032 4.937l-6.065 3.563c-3.877 2.276-5.737 3.362-7.72 3.725a11.46 11.46 0 0 1-4.12 0c-1.983-.363-3.844-1.449-7.72-3.726l-6.065-3.562c-3.876-2.276-5.731-3.372-7.032-4.938a11.885 11.885 0 0 1-2.06-3.63c-.682-1.928-.688-4.11-.688-8.663v-7.124c0-4.553.006-6.735.688-8.664a11.885 11.885 0 0 1 2.06-3.63c1.3-1.565 3.156-2.66 7.032-4.937l6.065-3.562Z" stroke="#fff"/></svg></div>`:V`${ye.NETWORK_PLACEHOLDER}`}};js.styles=[ue.globalCss,O4],pd([be()],js.prototype,"chainId",2),js=pd([we("w3m-network-image")],js);const P4=.1,gd=2.5,hr=7;function dc(t,e,r){return t===e?!1:(t-e<0?e-t:t-e)<=r+P4}function T4(t,e){const r=Array.prototype.slice.call(bi.create(t,{errorCorrectionLevel:e}).modules.data,0),n=Math.sqrt(r.length);return r.reduce((i,s,o)=>(o%n===0?i.push([s]):i[i.length-1].push(s))&&i,[])}const N4={generate(t,e,r,n){const i=n==="light"?"#141414":"#fff",s=n==="light"?"#fff":"#141414",o=[],a=T4(t,"Q"),c=e/a.length,l=[{x:0,y:0},{x:1,y:0},{x:0,y:1}];l.forEach(({x:A,y:N})=>{const M=(a.length-hr)*c*A,x=(a.length-hr)*c*N,D=.32;for(let b=0;b<l.length;b+=1){const I=c*(hr-b*2);o.push(Ae`<rect fill="${b%2===0?i:s}" height="${I}" rx="${I*D}" ry="${I*D}" width="${I}" x="${M+c*b}" y="${x+c*b}">`)}});const p=Math.floor((r+25)/c),w=a.length/2-p/2,y=a.length/2+p/2-1,m=[];a.forEach((A,N)=>{A.forEach((M,x)=>{if(a[N][x]&&!(N<hr&&x<hr||N>a.length-(hr+1)&&x<hr||N<hr&&x>a.length-(hr+1))&&!(N>w&&N<y&&x>w&&x<y)){const D=N*c+c/2,b=x*c+c/2;m.push([D,b])}})});const E={};return m.forEach(([A,N])=>{E[A]?E[A].push(N):E[A]=[N]}),Object.entries(E).map(([A,N])=>{const M=N.filter(x=>N.every(D=>!dc(x,D,c)));return[Number(A),M]}).forEach(([A,N])=>{N.forEach(M=>{o.push(Ae`<circle cx="${A}" cy="${M}" fill="${i}" r="${c/gd}">`)})}),Object.entries(E).filter(([A,N])=>N.length>1).map(([A,N])=>{const M=N.filter(x=>N.some(D=>dc(x,D,c)));return[Number(A),M]}).map(([A,N])=>{N.sort((x,D)=>x<D?-1:1);const M=[];for(const x of N){const D=M.find(b=>b.some(I=>dc(x,I,c)));D?D.push(x):M.push([x])}return[A,M.map(x=>[x[0],x[x.length-1]])]}).forEach(([A,N])=>{N.forEach(([M,x])=>{o.push(Ae`<line x1="${A}" x2="${A}" y1="${M}" y2="${x}" stroke="${i}" stroke-width="${c/(gd/2)}" stroke-linecap="round">`)})}),o}},R4=_e`@keyframes fadeIn{0%{opacity:0}100%{opacity:1}}div{position:relative;user-select:none;display:block;overflow:hidden;width:100%;aspect-ratio:1/1;animation:fadeIn ease .2s}svg:first-child,w3m-wallet-image{position:absolute;top:50%;left:50%;transform:translateY(-50%) translateX(-50%)}w3m-wallet-image{transform:translateY(-50%) translateX(-50%)}w3m-wallet-image{width:25%;height:25%;border-radius:15px}svg:first-child{transform:translateY(-50%) translateX(-50%) scale(.9)}svg:first-child path:first-child{fill:var(--w3m-color-fg-accent)}svg:first-child path:last-child{stroke:var(--w3m-color-overlay)}`;var L4=Object.defineProperty,M4=Object.getOwnPropertyDescriptor,Oi=(t,e,r,n)=>{for(var i=n>1?void 0:n?M4(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&L4(e,r,i),i};let Gr=class extends de{constructor(){super(...arguments),this.uri="",this.size=0,this.logoSrc="",this.walletId=""}svgTemplate(){var t;const e=(t=Ve.state.themeMode)!=null?t:"light";return Ae`<svg height="${this.size}" width="${this.size}">${N4.generate(this.uri,this.size,this.size/4,e)}</svg>`}render(){return V`<div>${this.walletId||this.logoSrc?V`<w3m-wallet-image walletId="${Bt(this.walletId)}" src="${Bt(this.logoSrc)}"></w3m-wallet-image>`:ye.WALLET_CONNECT_ICON_COLORED} ${this.svgTemplate()}</div>`}};Gr.styles=[ue.globalCss,R4],Oi([be()],Gr.prototype,"uri",2),Oi([be({type:Number})],Gr.prototype,"size",2),Oi([be()],Gr.prototype,"logoSrc",2),Oi([be()],Gr.prototype,"walletId",2),Gr=Oi([we("w3m-qrcode")],Gr);const U4=_e`:host{position:relative;height:28px;width:75%}input{width:100%;height:100%;line-height:28px!important;border-radius:28px;font-style:normal;font-family:-apple-system,system-ui,BlinkMacSystemFont,'Segoe UI',Roboto,Ubuntu,'Helvetica Neue',sans-serif;font-feature-settings:'case' on;font-weight:500;font-size:16px;letter-spacing:-.03em;padding:0 10px 0 34px;transition:.2s all ease;color:transparent;position:absolute;background-color:var(--w3m-color-bg-3);box-shadow:inset 0 0 0 1px var(--w3m-color-overlay)}input::placeholder{color:transparent}svg{margin-right:4px}.w3m-placeholder{top:0;left:50%;transform:translateX(-50%);transition:.2s all ease;pointer-events:none;display:flex;align-items:center;justify-content:center;height:100%;width:fit-content;position:relative}input:focus-within+.w3m-placeholder,input:not(:placeholder-shown)+.w3m-placeholder{transform:translateX(10px);left:0}w3m-text{opacity:1;transition:.2s opacity ease}input:focus-within+.w3m-placeholder w3m-text,input:not(:placeholder-shown)+.w3m-placeholder w3m-text{opacity:0}input:focus-within,input:not(:placeholder-shown){color:var(--w3m-color-fg-1)}input:focus-within{box-shadow:inset 0 0 0 1px var(--w3m-color-fg-accent)}path{fill:var(--w3m-color-fg-2)}`;var F4=Object.defineProperty,B4=Object.getOwnPropertyDescriptor,md=(t,e,r,n)=>{for(var i=n>1?void 0:n?B4(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&F4(e,r,i),i};let ks=class extends de{constructor(){super(...arguments),this.onChange=()=>null}render(){const t=Ue.isMobile()?"Search mobile wallets":"Search desktop wallets";return V`<input type="text" @input="${this.onChange}" placeholder="${t}"><div class="w3m-placeholder">${ye.SEARCH_ICON}<w3m-text color="secondary" variant="medium-thin">${t}</w3m-text></div>`}};ks.styles=[ue.globalCss,U4],md([be()],ks.prototype,"onChange",2),ks=md([we("w3m-search-input")],ks);const j4=_e`@keyframes rotate{100%{transform:rotate(360deg)}}@keyframes dash{0%{stroke-dasharray:1,150;stroke-dashoffset:0}50%{stroke-dasharray:90,150;stroke-dashoffset:-35}100%{stroke-dasharray:90,150;stroke-dashoffset:-124}}svg{animation:rotate 2s linear infinite;display:flex;justify-content:center;align-items:center}svg circle{stroke-linecap:round;animation:dash 1.5s ease infinite;stroke:var(--w3m-color-fg-accent)}`;var k4=Object.defineProperty,H4=Object.getOwnPropertyDescriptor,z4=(t,e,r,n)=>{for(var i=n>1?void 0:n?H4(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&k4(e,r,i),i};let fc=class extends de{render(){return V`<svg viewBox="0 0 50 50" width="24" height="24"><circle cx="25" cy="25" r="20" fill="none" stroke-width="4" stroke="#fff"/></svg>`}};fc.styles=[ue.globalCss,j4],fc=z4([we("w3m-spinner")],fc);const W4=_e`span{font-style:normal;font-family:-apple-system,system-ui,BlinkMacSystemFont,'Segoe UI',Roboto,Ubuntu,'Helvetica Neue',sans-serif;font-feature-settings:'tnum' on,'lnum' on,'case' on}.w3m-xxsmall-bold{font-weight:700;font-size:10px;line-height:12px;letter-spacing:.02em;text-transform:uppercase}.w3m-xsmall-normal{font-weight:600;font-size:12px;line-height:14px;letter-spacing:-.03em}.w3m-small-thin{font-weight:500;font-size:14px;line-height:16px;letter-spacing:-.03em}.w3m-small-normal{font-weight:600;font-size:14px;line-height:16px;letter-spacing:-.03em}.w3m-medium-thin{font-weight:500;font-size:16px;line-height:20px;letter-spacing:-.03em}.w3m-medium-normal{font-weight:600;font-size:16px;line-height:20px;letter-spacing:-.03em}.w3m-medium-bold{font-weight:700;font-size:16px;line-height:20px;letter-spacing:-.03em}.w3m-large-bold{font-weight:600;font-size:20px;line-height:24px;letter-spacing:-.03em}:host(*){color:var(--w3m-color-fg-1)}.w3m-color-primary{color:var(--w3m-color-fg-1)}.w3m-color-secondary{color:var(--w3m-color-fg-2)}.w3m-color-tertiary{color:var(--w3m-color-fg-3)}.w3m-color-inverse{color:var(--w3m-color-fg-inverse)}.w3m-color-accnt{color:var(--w3m-color-fg-accent)}.w3m-color-error{color:var(--w3m-color-err)}`;var q4=Object.defineProperty,V4=Object.getOwnPropertyDescriptor,pc=(t,e,r,n)=>{for(var i=n>1?void 0:n?V4(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&q4(e,r,i),i};let Ai=class extends de{constructor(){super(...arguments),this.variant="medium-normal",this.color="primary"}render(){const t={"w3m-large-bold":this.variant==="large-bold","w3m-medium-bold":this.variant==="medium-bold","w3m-medium-normal":this.variant==="medium-normal","w3m-medium-thin":this.variant==="medium-thin","w3m-small-normal":this.variant==="small-normal","w3m-small-thin":this.variant==="small-thin","w3m-xsmall-normal":this.variant==="xsmall-normal","w3m-xxsmall-bold":this.variant==="xxsmall-bold","w3m-color-primary":this.color==="primary","w3m-color-secondary":this.color==="secondary","w3m-color-tertiary":this.color==="tertiary","w3m-color-inverse":this.color==="inverse","w3m-color-accnt":this.color==="accent","w3m-color-error":this.color==="error"};return V`<span class="${Mt(t)}"><slot></slot></span>`}};Ai.styles=[ue.globalCss,W4],pc([be()],Ai.prototype,"variant",2),pc([be()],Ai.prototype,"color",2),Ai=pc([we("w3m-text")],Ai);const K4=_e`div{overflow:hidden;position:relative;border-radius:50%}div::after{content:'';position:absolute;inset:0;border-radius:50%;border:1px solid var(--w3m-color-overlay)}div img{width:100%;height:100%;object-fit:cover;object-position:center}svg{width:100%;height:100%}#token-placeholder-fill{fill:var(--w3m-color-bg-3)}#token-placeholder-dash{stroke:var(--w3m-color-overlay)}`;var G4=Object.defineProperty,Y4=Object.getOwnPropertyDescriptor,wd=(t,e,r,n)=>{for(var i=n>1?void 0:n?Y4(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&G4(e,r,i),i};let Hs=class extends de{constructor(){super(...arguments),this.symbol=void 0}render(){var t;const e=ne.getTokenIcon((t=this.symbol)!=null?t:"");return e?V`<div><img src="${e}" alt="${this.id}"></div>`:ye.TOKEN_PLACEHOLDER}};Hs.styles=[ue.globalCss,K4],wd([be()],Hs.prototype,"symbol",2),Hs=wd([we("w3m-token-image")],Hs);const Z4=_e`button{transition:all .2s ease;width:100%;height:100%;border-radius:10px;display:flex;align-items:flex-start}button:hover{background-color:var(--w3m-color-overlay)}button>div{width:80px;padding:5px 0;display:flex;flex-direction:column;align-items:center}w3m-text{width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-align:center}w3m-wallet-image{height:60px;width:60px;transition:all .2s ease;border-radius:15px;margin-bottom:5px}.w3m-sublabel{margin-top:2px}`;var J4=Object.defineProperty,X4=Object.getOwnPropertyDescriptor,Sr=(t,e,r,n)=>{for(var i=n>1?void 0:n?X4(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&J4(e,r,i),i};let ar=class extends de{constructor(){super(...arguments),this.onClick=()=>null,this.name="",this.walletId="",this.label=void 0,this.src=void 0,this.installed=!1,this.recent=!1}sublabelTemplate(){return this.recent?V`<w3m-text class="w3m-sublabel" variant="xxsmall-bold" color="tertiary">RECENT</w3m-text>`:this.installed?V`<w3m-text class="w3m-sublabel" variant="xxsmall-bold" color="tertiary">INSTALLED</w3m-text>`:null}render(){var t;return V`<button @click="${this.onClick}"><div><w3m-wallet-image walletId="${this.walletId}" .src="${this.src}"></w3m-wallet-image><w3m-text variant="xsmall-normal">${(t=this.label)!=null?t:ne.getWalletName(this.name,!0)}</w3m-text>${this.sublabelTemplate()}</div></button>`}};ar.styles=[ue.globalCss,Z4],Sr([be()],ar.prototype,"onClick",2),Sr([be()],ar.prototype,"name",2),Sr([be()],ar.prototype,"walletId",2),Sr([be()],ar.prototype,"label",2),Sr([be()],ar.prototype,"src",2),Sr([be()],ar.prototype,"installed",2),Sr([be()],ar.prototype,"recent",2),ar=Sr([we("w3m-wallet-button")],ar);const Q4=_e`div{overflow:hidden;position:relative;border-radius:inherit;width:100%;height:100%}svg{position:relative;width:100%;height:100%}div::after{content:'';position:absolute;inset:0;border-radius:inherit;border:1px solid var(--w3m-color-overlay)}div img{width:100%;height:100%;object-fit:cover;object-position:center}#wallet-placeholder-fill{fill:var(--w3m-color-bg-3)}#wallet-placeholder-dash{stroke:var(--w3m-color-overlay)}`;var e8=Object.defineProperty,t8=Object.getOwnPropertyDescriptor,gc=(t,e,r,n)=>{for(var i=n>1?void 0:n?t8(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&e8(e,r,i),i};let $i=class extends de{constructor(){super(...arguments),this.walletId=void 0,this.src=void 0}render(){var t;const e=ne.getWalletId((t=this.walletId)!=null?t:""),r=ne.getWalletId(e),n=this.src?this.src:ne.getWalletIcon(r);return V`${n.length?V`<div><img src="${n}" alt="${this.id}"></div>`:ye.WALLET_PLACEHOLDER}`}};$i.styles=[ue.globalCss,Q4],gc([be()],$i.prototype,"walletId",2),gc([be()],$i.prototype,"src",2),$i=gc([we("w3m-wallet-image")],$i);const r8=_e`:host{all:initial}div{display:flex;align-items:center;background-color:var(--w3m-color-overlay);box-shadow:inset 0 0 0 1px var(--w3m-color-overlay);border-radius:10px;padding:4px 4px 4px 8px}div button{border-radius:16px;padding:4px 8px 4px 4px;height:auto;margin-left:10px;color:var(--w3m-color-fg-inverse);background-color:var(--w3m-color-fg-accent)}button::after{content:'';inset:0;position:absolute;background-color:transparent;border-radius:inherit;transition:background-color .2s ease;border:1px solid var(--w3m-color-overlay)}button:hover::after{background-color:var(--w3m-color-overlay)}w3m-avatar{margin-right:6px}w3m-button-big w3m-avatar{margin-left:-5px}`;var n8=Object.defineProperty,i8=Object.getOwnPropertyDescriptor,yd=(t,e,r,n)=>{for(var i=n>1?void 0:n?i8(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&n8(e,r,i),i};let Pi=class extends de{constructor(){super(),this.balance="hide",ne.rejectStandaloneButtonComponent()}onOpen(){const{isStandalone:t}=Q.state;t||dt.open({route:"Account"})}accountTemplate(){return V`<w3m-avatar></w3m-avatar><w3m-address-text></w3m-address-text>`}render(){return this.balance==="show"?V`<div><w3m-balance></w3m-balance><button @click="${this.onOpen}">${this.accountTemplate()}</button></div>`:V`<w3m-button-big @click="${this.onOpen}">${this.accountTemplate()}</w3m-button-big>`}};Pi.styles=[ue.globalCss,r8],yd([be()],Pi.prototype,"balance",2),Pi=yd([we("w3m-account-button")],Pi);const s8=_e`button{display:flex;border-radius:10px;flex-direction:column;transition:background-color .2s ease;justify-content:center;padding:5px;width:100px}button:hover{background-color:var(--w3m-color-overlay)}button:disabled{pointer-events:none}w3m-network-image{width:32px;height:32px}w3m-text{margin-top:4px}`;var o8=Object.defineProperty,a8=Object.getOwnPropertyDescriptor,mc=(t,e,r,n)=>{for(var i=n>1?void 0:n?a8(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&o8(e,r,i),i};let Ti=class extends de{constructor(){super(),this.chainId="",this.label="",this.unsubscribeNetwork=void 0;const{selectedChain:t}=Q.state;this.chainId=t?.id.toString(),this.label=t?.name,this.unsubscribeNetwork=Q.subscribe(({selectedChain:e})=>{this.chainId=e?.id.toString(),this.label=e?.name})}disconnectedCallback(){var t;(t=this.unsubscribeNetwork)==null||t.call(this)}onClick(){Te.push("SelectNetwork")}render(){const{chains:t}=Q.state,e=t&&t.length>1;return V`<button @click="${this.onClick}" ?disabled="${!e}"><w3m-network-image chainId="${Bt(this.chainId)}"></w3m-network-image><w3m-text variant="xsmall-normal" color="accent">${this.label}</w3m-text></button>`}};Ti.styles=[ue.globalCss,s8],mc([Be()],Ti.prototype,"chainId",2),mc([Be()],Ti.prototype,"label",2),Ti=mc([we("w3m-account-network-button")],Ti);const c8=_e`@keyframes slide{0%{background-position:0 0}100%{background-position:200px 0}}w3m-text{padding:1px 0}.w3m-loading{background:linear-gradient(270deg,var(--w3m-color-fg-1) 36.33%,var(--w3m-color-fg-3) 42.07%,var(--w3m-color-fg-1) 83.3%);background-size:200px 100%;background-clip:text;-webkit-background-clip:text;-webkit-text-fill-color:transparent;animation-name:slide;animation-duration:1.5s;animation-iteration-count:infinite;animation-timing-function:linear}`;var l8=Object.defineProperty,u8=Object.getOwnPropertyDescriptor,Ni=(t,e,r,n)=>{for(var i=n>1?void 0:n?u8(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&l8(e,r,i),i};let Yr=class extends de{constructor(){super(),this.address=void 0,this.name=void 0,this.loading=!0,this.variant="button",this.unsubscribeAccount=void 0,this.address=Q.state.address,this.name=Q.state.profileName,this.loading=Boolean(Q.state.profileLoading),this.unsubscribeAccount=Q.subscribe(({address:t,profileName:e,profileLoading:r})=>{this.address=t,this.name=e,this.loading=Boolean(r)})}disconnectedCallback(){var t;(t=this.unsubscribeAccount)==null||t.call(this)}render(){var t;const e=this.variant==="button",r={"w3m-loading":this.loading};return V`<w3m-text class="${Mt(r)}" variant="${e?"medium-normal":"large-bold"}" color="${e?"inverse":"primary"}">${this.name?this.name:ne.truncate((t=this.address)!=null?t:"")}</w3m-text>`}};Yr.styles=[ue.globalCss,c8],Ni([Be()],Yr.prototype,"address",2),Ni([Be()],Yr.prototype,"name",2),Ni([Be()],Yr.prototype,"loading",2),Ni([be()],Yr.prototype,"variant",2),Yr=Ni([we("w3m-address-text")],Yr);const h8=_e`@keyframes scroll{0%{transform:translate3d(0,0,0)}100%{transform:translate3d(calc(-70px * 10),0,0)}}.w3m-slider{position:relative;overflow-x:hidden;padding:10px 0;margin:0 -20px}.w3m-slider::after,.w3m-slider::before{content:'';height:100%;width:50px;z-index:2;position:absolute;background:linear-gradient(to right,var(--w3m-color-bg-1) 0,transparent 100%);top:0}.w3m-slider::before{left:0}.w3m-slider::after{right:0;transform:rotateZ(180deg)}.w3m-track{display:flex;width:calc(70px * 20);animation:scroll 20s linear infinite}.w3m-action{padding:30px 0 10px 0;display:flex;justify-content:center;align-items:center;flex-direction:column}.w3m-action w3m-button-big:last-child{margin-top:10px}w3m-wallet-image{width:60px;height:60px;margin:0 5px;box-shadow:0 2px 4px -2px rgba(0,0,0,.12),0 4px 4px -2px rgba(0,0,0,.08);border-radius:15px}`;var d8=Object.defineProperty,f8=Object.getOwnPropertyDescriptor,p8=(t,e,r,n)=>{for(var i=n>1?void 0:n?f8(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&d8(e,r,i),i};let wc=class extends de{onGoToQrcode(){Te.push("Qrcode")}onGoToGetWallet(){Te.push("GetWallet")}render(){const{previewWallets:t}=at.state,e=t.length,r=[...t,...t];return V`<w3m-modal-header title="Connect your wallet" .onAction="${this.onGoToQrcode}" .actionIcon="${ye.QRCODE_ICON}"></w3m-modal-header><w3m-modal-content>${e?V`<div class="w3m-slider"><div class="w3m-track">${r.map(({image_url:n})=>V`<w3m-wallet-image src="${n.lg}"></w3m-wallet-image>`)}</div></div>`:null}<div class="w3m-action"><w3m-button-big @click="${ne.handleAndroidLinking}"><w3m-text variant="medium-normal" color="inverse">Select Wallet</w3m-text></w3m-button-big><w3m-button-big variant="secondary" @click="${this.onGoToGetWallet}"><w3m-text variant="medium-normal" color="accent">I don’t have a wallet</w3m-text></w3m-button-big></div></w3m-modal-content>`}};wc.styles=[ue.globalCss,h8],wc=p8([we("w3m-android-wallet-selection")],wc);const g8=_e`@keyframes slide{0%{transform:translateX(-50px)}100%{transform:translateX(200px)}}.w3m-placeholder,img{border-radius:50%;box-shadow:inset 0 0 0 1px var(--w3m-color-overlay);display:block;position:relative;overflow:hidden!important;background-color:var(--w3m-color-av-1);background-image:radial-gradient(at 66% 77%,var(--w3m-color-av-2) 0,transparent 50%),radial-gradient(at 29% 97%,var(--w3m-color-av-3) 0,transparent 50%),radial-gradient(at 99% 86%,var(--w3m-color-av-4) 0,transparent 50%),radial-gradient(at 29% 88%,var(--w3m-color-av-5) 0,transparent 50%);transform:translateZ(0)}.w3m-loader{width:50px;height:100%;background:linear-gradient(270deg,transparent 0,rgba(255,255,255,.4) 30%,transparent 100%);animation-name:slide;animation-duration:1.5s;transform:translateX(-50px);animation-iteration-count:infinite;animation-timing-function:linear;animation-delay:.55s}.w3m-small{width:24px;height:24px}.w3m-medium{width:60px;height:60px}`;var m8=Object.defineProperty,w8=Object.getOwnPropertyDescriptor,Ri=(t,e,r,n)=>{for(var i=n>1?void 0:n?w8(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&m8(e,r,i),i};let Zr=class extends de{constructor(){super(),this.address=void 0,this.avatar=void 0,this.loading=!0,this.size="small",this.unsubscribeAccount=void 0,this.address=Q.state.address,this.avatar=Q.state.profileAvatar,this.loading=Boolean(Q.state.profileLoading),this.unsubscribeAccount=Q.subscribe(({address:t,profileAvatar:e,profileLoading:r})=>{this.address=t,this.avatar=e,this.loading=Boolean(r)})}disconnectedCallback(){var t;(t=this.unsubscribeAccount)==null||t.call(this)}render(){const t={"w3m-placeholder":!0,"w3m-small":this.size==="small","w3m-medium":this.size==="medium"};return this.avatar?V`<img class="${Mt(t)}" src="${this.avatar}">`:this.address?(ne.generateAvatarColors(this.address),V`<div class="${Mt(t)}">${this.loading?V`<div class="w3m-loader"></div>`:null}</div>`):null}};Zr.styles=[ue.globalCss,g8],Ri([Be()],Zr.prototype,"address",2),Ri([Be()],Zr.prototype,"avatar",2),Ri([Be()],Zr.prototype,"loading",2),Ri([be()],Zr.prototype,"size",2),Zr=Ri([we("w3m-avatar")],Zr);const y8=_e`div{display:flex;align-items:center}w3m-token-image{width:28px;height:28px;margin-right:6px}`;var b8=Object.defineProperty,v8=Object.getOwnPropertyDescriptor,yc=(t,e,r,n)=>{for(var i=n>1?void 0:n?v8(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&b8(e,r,i),i};let Li=class extends de{constructor(){var t,e;super(),this.symbol=void 0,this.amount=void 0,this.unsubscribeAccount=void 0,this.symbol=(t=Q.state.balance)==null?void 0:t.symbol,this.amount=(e=Q.state.balance)==null?void 0:e.amount,this.unsubscribeAccount=Q.subscribe(({balance:r})=>{this.symbol=r?.symbol,this.amount=r?.amount})}disconnectedCallback(){var t;(t=this.unsubscribeAccount)==null||t.call(this)}render(){let t="_._";return this.amount==="0.0"&&(t=0),this.amount&&this.amount.length>6&&(t=parseFloat(this.amount).toFixed(3)),V`<div><w3m-token-image symbol="${Bt(this.symbol)}"></w3m-token-image><w3m-text variant="medium-normal" color="primary">${t} ${this.symbol}</w3m-text></div>`}};Li.styles=[ue.globalCss,y8],yc([Be()],Li.prototype,"symbol",2),yc([Be()],Li.prototype,"amount",2),Li=yc([we("w3m-balance")],Li);const _8=_e`:host{all:initial}svg{width:28px;height:20px;margin:-1px 3px 0 -5px}svg path{fill:var(--w3m-color-fg-inverse)}button:disabled svg path{fill:var(--w3m-color-fg-3)}w3m-spinner{margin:0 10px 0 0}`;var E8=Object.defineProperty,x8=Object.getOwnPropertyDescriptor,zs=(t,e,r,n)=>{for(var i=n>1?void 0:n?x8(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&E8(e,r,i),i};let Jr=class extends de{constructor(){super(),this.loading=!1,this.label="Connect Wallet",this.icon="show",this.modalUnsub=void 0,ne.rejectStandaloneButtonComponent(),this.modalUnsub=dt.subscribe(t=>{t.open&&(this.loading=!0),t.open||(this.loading=!1)})}disconnectedCallback(){var t;(t=this.modalUnsub)==null||t.call(this)}iconTemplate(){return this.icon==="show"?ye.WALLET_CONNECT_ICON:null}onClick(){Q.state.isConnected?this.onDisconnect():this.onConnect()}onConnect(){this.loading=!0;const{enableNetworkView:t}=Ve.state,{chains:e,selectedChain:r}=Q.state,n=e?.length&&e.length>1;t||n&&!r?dt.open({route:"SelectNetwork"}):dt.open({route:"ConnectWallet"})}onDisconnect(){qe.client().disconnect(),Q.resetAccount()}render(){return V`<w3m-button-big .disabled="${this.loading}" @click="${this.onClick}">${this.loading?V`<w3m-spinner></w3m-spinner><w3m-text variant="medium-normal" color="accent">Connecting...</w3m-text>`:V`${this.iconTemplate()}<w3m-text variant="medium-normal" color="inverse">${this.label}</w3m-text>`}</w3m-button-big>`}};Jr.styles=[ue.globalCss,_8],zs([Be()],Jr.prototype,"loading",2),zs([be()],Jr.prototype,"label",2),zs([be()],Jr.prototype,"icon",2),Jr=zs([we("w3m-connect-button")],Jr);var C8=Object.defineProperty,S8=Object.getOwnPropertyDescriptor,Mi=(t,e,r,n)=>{for(var i=n>1?void 0:n?S8(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&C8(e,r,i),i};let Xr=class extends de{constructor(){super(),this.isConnected=!1,this.label="Connect Wallet",this.icon="show",this.balance="hide",this.unsubscribeAccount=void 0,ne.rejectStandaloneButtonComponent(),this.isConnected=Q.state.isConnected,this.unsubscribeAccount=Q.subscribe(({isConnected:t})=>{this.isConnected=t})}disconnectedCallback(){var t;(t=this.unsubscribeAccount)==null||t.call(this)}render(){const{enableAccountView:t}=Ve.state;return this.isConnected&&t?V`<w3m-account-button balance="${Bt(this.balance)}"></w3m-account-button>`:V`<w3m-connect-button label="${this.isConnected?"Disconnect":Bt(this.label)}" icon="${Bt(this.icon)}"></w3m-connect-button>`}};Mi([Be()],Xr.prototype,"isConnected",2),Mi([be()],Xr.prototype,"label",2),Mi([be()],Xr.prototype,"icon",2),Mi([be()],Xr.prototype,"balance",2),Xr=Mi([we("w3m-core-button")],Xr);const kt={allowedExplorerListings(t){const{explorerAllowList:e,explorerDenyList:r}=Ve.state;let n=[...t];return e&&(n=n.filter(i=>e.includes(i.id))),r&&(n=n.filter(i=>!r.includes(i.id))),n},walletsWithInjected(t){let e=[...t??[]];if(window.ethereum){const r=ne.getWalletName("");e=e.filter(({name:n})=>!ne.caseSafeIncludes(n,r))}return e},connectorWallets(){const{isStandalone:t}=Q.state;if(t)return[];let e=qe.client().getConnectors();return!window.ethereum&&Ue.isMobile()&&(e=e.filter(({id:r})=>r!=="injected"&&r!==or.metaMask)),e},walletTemplatesWithRecent(t,e){let r=[...t];if(e){const n=ne.getRecentWallet();r=r.filter(i=>!i.values.includes(n?.name)),r.splice(1,0,e)}return r},deduplicateExplorerListingsFromConnectors(t){const{isStandalone:e}=Q.state;if(e)return t;const r=qe.client().getConnectors().map(({name:n})=>n.toUpperCase());return t.filter(({name:n})=>!r.includes(n.toUpperCase()))}},I8=_e`.w3m-grid{display:grid;grid-template-columns:repeat(4,80px);justify-content:space-between}.w3m-desktop-title,.w3m-mobile-title{display:flex;align-items:center}.w3m-mobile-title{justify-content:space-between;margin-bottom:20px;margin-top:-10px}.w3m-desktop-title{margin-bottom:10px;padding:0 10px}.w3m-subtitle{display:flex;align-items:center}.w3m-subtitle:last-child path{fill:var(--w3m-color-fg-3)}.w3m-desktop-title svg,.w3m-mobile-title svg{margin-right:6px}.w3m-desktop-title path,.w3m-mobile-title path{fill:var(--w3m-color-fg-accent)}`;var D8=Object.defineProperty,O8=Object.getOwnPropertyDescriptor,A8=(t,e,r,n)=>{for(var i=n>1?void 0:n?O8(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&D8(e,r,i),i};let bc=class extends de{onDesktopWallet(t){Te.push("DesktopConnector",{DesktopConnector:t})}onInjectedWallet(){Te.push("InjectedConnector")}onInstallConnector(){Te.push("InstallConnector",{InstallConnector:{id:"metaMask",name:"MetaMask",isMobile:!0,url:"https://metamask.io"}})}async onConnectorWallet(t){window.ethereum?t==="injected"||t===or.metaMask?this.onInjectedWallet():await ne.handleConnectorConnection(t):this.onInstallConnector()}desktopWalletsTemplate(){const{desktopWallets:t}=Ve.state;return t?.map(({id:e,name:r,links:{universal:n,native:i}})=>V`<w3m-wallet-button walletId="${e}" name="${r}" .onClick="${()=>this.onDesktopWallet({name:r,walletId:e,universal:n,native:i})}"></w3m-wallet-button>`)}previewWalletsTemplate(){let t=kt.allowedExplorerListings(at.state.previewWallets);return t=kt.deduplicateExplorerListingsFromConnectors(t),t.map(({name:e,desktop:{universal:r,native:n},homepage:i,image_url:s,id:o})=>V`<w3m-wallet-button src="${s.lg}" name="${e}" .onClick="${()=>this.onDesktopWallet({walletId:o,name:e,native:n,universal:r||i,icon:s.lg})}"></w3m-wallet-button>`)}connectorWalletsTemplate(){return kt.connectorWallets().map(({id:t,name:e,ready:r})=>V`<w3m-wallet-button .installed="${["injected","metaMask"].includes(t)&&r}" name="${e}" walletId="${t}" .onClick="${async()=>this.onConnectorWallet(t)}"></w3m-wallet-button>`)}recentWalletTemplate(){const t=ne.getRecentWallet();if(!t)return;const{id:e,name:r,links:n,image:i}=t;return V`<w3m-wallet-button .recent="${!0}" name="${r}" walletId="${Bt(e)}" src="${Bt(i)}" .onClick="${()=>this.onDesktopWallet({name:r,walletId:e,universal:n?.universal,native:n?.native,icon:i})}"></w3m-wallet-button>`}render(){const{standaloneUri:t}=Q.state,e=this.desktopWalletsTemplate(),r=this.previewWalletsTemplate(),n=this.connectorWalletsTemplate(),i=this.recentWalletTemplate(),s=[...e??[],...r],o=[...n,...s],a=kt.walletTemplatesWithRecent(o,i),c=kt.walletTemplatesWithRecent(s,i),l=t?c:a,p=l.length>4;let w=[];p?w=l.filter(m=>!m.values.includes(or.coinbaseWallet)).slice(0,3):w=l;const y=Boolean(w.length);return V`<w3m-modal-header border="${!0}" title="Connect your wallet" .onAction="${ne.handleUriCopy}" .actionIcon="${ye.COPY_ICON}"></w3m-modal-header><w3m-modal-content><div class="w3m-mobile-title"><div class="w3m-subtitle">${ye.MOBILE_ICON}<w3m-text variant="small-normal" color="accent">Mobile</w3m-text></div><div class="w3m-subtitle">${ye.SCAN_ICON}<w3m-text variant="small-normal" color="secondary">Scan with your wallet</w3m-text></div></div><w3m-walletconnect-qr></w3m-walletconnect-qr></w3m-modal-content>${y?V`<w3m-modal-footer><div class="w3m-desktop-title">${ye.DESKTOP_ICON}<w3m-text variant="small-normal" color="accent">Desktop</w3m-text></div><div class="w3m-grid">${w} ${p?V`<w3m-view-all-wallets-button></w3m-view-all-wallets-button>`:null}</div></w3m-modal-footer>`:null}`}};bc.styles=[ue.globalCss,I8],bc=A8([we("w3m-desktop-wallet-selection")],bc);const $8=_e`div{background-color:var(--w3m-color-bg-2);padding:10px 20px 15px 20px;border-top:1px solid var(--w3m-color-bg-3);text-align:center}a{color:var(--w3m-color-fg-accent);text-decoration:none;transition:opacity .2s ease-in-out}a:hover{opacity:.8}`;var P8=Object.defineProperty,T8=Object.getOwnPropertyDescriptor,N8=(t,e,r,n)=>{for(var i=n>1?void 0:n?T8(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&P8(e,r,i),i};let vc=class extends de{render(){const{termsOfServiceUrl:t,privacyPolicyUrl:e}=Ve.state;return t??e?V`<div><w3m-text variant="small-normal" color="secondary">By connecting your wallet, you agree to our<br>${t?V`<a href="${t}" target="_blank" rel="noopener noreferrer">Terms of Service</a>`:null} ${t&&e?"and":null} ${e?V`<a href="${e}" target="_blank" rel="noopener noreferrer">Privacy Policy</a>`:null}</w3m-text></div>`:null}};vc.styles=[ue.globalCss,$8],vc=N8([we("w3m-legal-notice")],vc);const R8=_e`.w3m-grid{display:grid;grid-template-columns:repeat(4,80px);margin:0 -10px;justify-content:space-between;row-gap:10px}`;var L8=Object.defineProperty,M8=Object.getOwnPropertyDescriptor,U8=(t,e,r,n)=>{for(var i=n>1?void 0:n?M8(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&L8(e,r,i),i};let _c=class extends de{onGoToQrcode(){Te.push("Qrcode")}async onConnectorWallet(t){await ne.handleConnectorConnection(t)}mobileWalletsTemplate(){const{mobileWallets:t}=Ve.state,e=kt.walletsWithInjected(t);if(e.length)return e.map(({id:r,name:n,links:{universal:i,native:s}})=>V`<w3m-wallet-button name="${n}" walletId="${r}" .onClick="${async()=>ne.handleMobileLinking({links:{native:s,universal:i},name:n,id:r})}"></w3m-wallet-button>`)}previewWalletsTemplate(){const{previewWallets:t}=at.state;let e=kt.walletsWithInjected(t);return e=kt.allowedExplorerListings(e),e=kt.deduplicateExplorerListingsFromConnectors(e),e.map(({image_url:r,name:n,mobile:{native:i,universal:s},id:o})=>V`<w3m-wallet-button name="${n}" src="${r.lg}" .onClick="${async()=>ne.handleMobileLinking({links:{native:i,universal:s},name:n,id:o,image:r.lg})}"></w3m-wallet-button>`)}connectorWalletsTemplate(){let t=kt.connectorWallets();return window.ethereum||(t=t.filter(({id:e})=>e!=="injected"&&e!==or.metaMask)),t.map(({name:e,id:r,ready:n})=>V`<w3m-wallet-button .installed="${["injected","metaMask"].includes(r)&&n}" name="${e}" walletId="${r}" .onClick="${async()=>this.onConnectorWallet(r)}"></w3m-wallet-button>`)}recentWalletTemplate(){const t=ne.getRecentWallet();if(!t)return;const{id:e,name:r,links:n,image:i}=t;return V`<w3m-wallet-button .recent="${!0}" name="${r}" walletId="${Bt(e)}" src="${Bt(i)}" .onClick="${async()=>ne.handleMobileLinking({name:r,id:e,links:n,image:i})}"></w3m-wallet-button>`}render(){const{standaloneUri:t}=Q.state,e=this.connectorWalletsTemplate(),r=this.mobileWalletsTemplate(),n=this.previewWalletsTemplate(),i=this.recentWalletTemplate(),s=r??n,o=[...e,...s],a=kt.walletTemplatesWithRecent(o,i),c=kt.walletTemplatesWithRecent(s,i),l=t?c:a,p=l.length>8;let w=[];p?w=l.filter(A=>!A.values.includes(or.coinbaseWallet)).slice(0,7):w=l;const y=w.slice(0,4),m=w.slice(4,8),E=Boolean(w.length);return V`<w3m-modal-header title="Connect your wallet" .onAction="${this.onGoToQrcode}" .actionIcon="${ye.QRCODE_ICON}"></w3m-modal-header>${E?V`<w3m-modal-content><div class="w3m-grid">${y} ${m.length?V`${m} ${p?V`<w3m-view-all-wallets-button></w3m-view-all-wallets-button>`:null}`:null}</div></w3m-modal-content>`:null}`}};_c.styles=[ue.globalCss,R8],_c=U8([we("w3m-mobile-wallet-selection")],_c);const F8=_e`:host{all:initial}.w3m-overlay{inset:0;position:fixed;z-index:var(--w3m-modal-z-index);overflow:hidden;display:flex;justify-content:center;align-items:center;background-color:rgba(0,0,0,.3);opacity:0;pointer-events:none}.w3m-open{pointer-events:auto}.w3m-container{position:relative;max-width:360px;width:100%;outline:0}.w3m-card{width:100%;position:relative;transform:translateY(5px);border-radius:30px;overflow:hidden;box-shadow:0 6px 14px -6px rgba(10,16,31,.12),0 10px 32px -4px rgba(10,16,31,.1),0 0 0 1px var(--w3m-color-overlay);background-color:var(--w3m-color-bg-1);color:var(--w3m-color-fg-1)}@media(max-width:600px){.w3m-container{max-width:440px}.w3m-card{border-radius:40px 40px 0 0}.w3m-overlay{align-items:flex-end}}@media(max-width:600px){.w3m-container{max-width:440px}.w3m-card{transform:translateY(5px);border-radius:40px 40px 0 0}.w3m-overlay{align-items:flex-end}}`;var B8=Object.defineProperty,j8=Object.getOwnPropertyDescriptor,Ws=(t,e,r,n)=>{for(var i=n>1?void 0:n?j8(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&B8(e,r,i),i};let Qr=class extends de{constructor(){if(super(),this.open=!1,this.preload=!0,this.activeChainId=void 0,this.unsubscribeModal=void 0,this.unsubscribeConfig=void 0,this.unwatchAccount=void 0,this.unwatchNetwork=void 0,this.abortController=void 0,ue.setTheme(),this.unsubscribeConfig=Ve.subscribe(ue.setTheme),this.unsubscribeModal=dt.subscribe(t=>{t.open?this.onOpenModalEvent():this.onCloseModalEvent()}),!Q.state.isStandalone){Q.getAccount();const t=Q.getSelectedChain();this.activeChainId=t?.id,this.fetchEnsProfile(),this.fetchBalance(),this.unwatchNetwork=qe.client().watchNetwork(e=>{const r=e.chain;r&&this.activeChainId!==r.id&&(Q.setSelectedChain(r),this.activeChainId=r.id,Q.resetBalance(),this.fetchBalance())}),this.unwatchAccount=qe.client().watchAccount(e=>{const{address:r}=Q.state;e.address!==r&&(this.fetchEnsProfile(e.address),this.fetchBalance(e.address)),Q.setAddress(e.address),Q.setIsConnected(e.isConnected)})}this.preloadModalData()}disconnectedCallback(){var t,e,r,n;(t=this.unsubscribeModal)==null||t.call(this),(e=this.unsubscribeConfig)==null||e.call(this),(r=this.unwatchAccount)==null||r.call(this),(n=this.unwatchNetwork)==null||n.call(this)}get overlayEl(){return ne.getShadowRootElement(this,".w3m-overlay")}get containerEl(){return ne.getShadowRootElement(this,".w3m-container")}async fetchEnsProfile(t){try{if(Ve.state.enableAccountView){Q.setProfileLoading(!0);const e=t??Q.state.address,{id:r}=qe.client().getDefaultChain();if(e&&r===1){const[n,i]=await Promise.all([qe.client().fetchEnsName({address:e,chainId:1}),qe.client().fetchEnsAvatar({address:e,chainId:1})]);i&&await ne.preloadImage(i),Q.setProfileName(n),Q.setProfileAvatar(i)}}}catch(e){console.error(e),Lt.openToast(ne.getErrorMessage(e),"error")}finally{Q.setProfileLoading(!1)}}async fetchBalance(t){try{if(Ve.state.enableAccountView){Q.setBalanceLoading(!0);const e=t??Q.state.address;if(e){const r=await qe.client().fetchBalance({address:e});Q.setBalance({amount:r.formatted,symbol:r.symbol})}}}catch(e){console.error(e),Lt.openToast(ne.getErrorMessage(e),"error")}finally{Q.setBalanceLoading(!1)}}toggleBodyScroll(t){document.querySelector("body")&&(t?document.getElementById("w3m-styles")?.remove():document.head.insertAdjacentHTML("beforeend",'<style id="w3m-styles">html,body{touch-action:none;overflow:hidden;overscroll-behavior:contain;}</style>'))}async preloadExplorerData(){var t;const{standaloneChains:e,chains:r,walletConnectVersion:n}=Q.state,i=e?.join(",");await Promise.all([at.getPreviewWallets({page:1,entries:10,chains:i,device:Ue.isMobile()?"mobile":"desktop",version:n}),at.getRecomendedWallets()]),Q.setIsDataLoaded(!0);const{previewWallets:s,recomendedWallets:o}=at.state,a=(t=r?.map(l=>ne.getChainIcon(l.id)))!=null?t:[],c=[...s,...o].map(l=>l.image_url.lg);await this.preloadExplorerImages([...a,...c])}async preloadExplorerImages(t){t.length&&await Promise.all(t.map(async e=>ne.preloadImage(e)))}async preloadCustomImages(){const t=ne.getCustomImageUrls();t.length&&await Promise.all(t.map(async e=>ne.preloadImage(e)))}async preloadConnectorImages(){if(!Q.state.isStandalone){const t=ne.getConnectorImageUrls();t.length&&await Promise.all(t.map(async e=>ne.preloadImage(e)))}}async preloadModalData(){try{this.preload&&(this.preload=!1,await Promise.all([this.preloadExplorerData(),this.preloadCustomImages(),this.preloadConnectorImages()]))}catch(t){console.error(t),Lt.openToast("Failed preloading","error")}}onCloseModal(t){t.target===t.currentTarget&&dt.close()}async onOpenModalEvent(){await this.preloadModalData(),this.toggleBodyScroll(!1);const t=.2;await Er(this.containerEl,{y:0},{duration:0}).finished,Er(this.overlayEl,{opacity:[0,1]},{duration:.2,delay:t}),Er(this.containerEl,ne.isMobileAnimation()?{y:["50vh",0]}:{scale:[.98,1]},{scale:{easing:Os({velocity:.4})},y:{easing:Os({mass:.5})},delay:t}),this.addKeyboardEvents(),this.open=!0}async onCloseModalEvent(){this.toggleBodyScroll(!0),this.removeKeyboardEvents(),await Promise.all([Er(this.containerEl,ne.isMobileAnimation()?{y:[0,"50vh"]}:{scale:[1,.98]},{scale:{easing:Os({velocity:0})},y:{easing:Os({mass:.5})}}).finished,Er(this.overlayEl,{opacity:[1,0]},{duration:.2}).finished]),this.open=!1}addKeyboardEvents(){this.abortController=new AbortController,window.addEventListener("keydown",t=>{var e;t.key==="Escape"?dt.close():t.key==="Tab"&&((e=t.target)!=null&&e.tagName.includes("W3M-")||this.containerEl.focus())},this.abortController),this.containerEl.focus()}removeKeyboardEvents(){var t;(t=this.abortController)==null||t.abort(),this.abortController=void 0}render(){const t={"w3m-overlay":!0,"w3m-open":this.open};return V`<div id="w3m-modal" class="${Mt(t)}" @click="${this.onCloseModal}" role="alertdialog" aria-modal="true"><div class="w3m-container" tabindex="0">${this.open?V`<w3m-modal-backcard></w3m-modal-backcard><div class="w3m-card"><w3m-modal-router></w3m-modal-router><w3m-modal-toast></w3m-modal-toast></div>`:null}</div></div>`}};Qr.styles=[ue.globalCss,F8],Ws([Be()],Qr.prototype,"open",2),Ws([Be()],Qr.prototype,"preload",2),Ws([Be()],Qr.prototype,"activeChainId",2),Qr=Ws([we("w3m-modal")],Qr);const k8=_e`:host{all:initial}w3m-network-image{margin-left:-6px;margin-right:6px;width:28px;height:28px}`;var H8=Object.defineProperty,z8=Object.getOwnPropertyDescriptor,qs=(t,e,r,n)=>{for(var i=n>1?void 0:n?z8(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&H8(e,r,i),i};let en=class extends de{constructor(){super(),this.chainId="",this.label="",this.wrongNetwork=!1,this.unsubscribeNetwork=void 0,ne.rejectStandaloneButtonComponent();const{selectedChain:t}=Q.state;this.onSetChainData(t),this.unsubscribeNetwork=Q.subscribe(({selectedChain:e})=>{this.onSetChainData(e)})}disconnectedCallback(){var t;(t=this.unsubscribeNetwork)==null||t.call(this)}onSetChainData(t){if(t){const{chains:e}=Q.state,r=e?.map(n=>n.id);this.chainId=t.id.toString(),this.wrongNetwork=!(r!=null&&r.includes(t.id)),this.label=this.wrongNetwork?"Wrong Network":t.name}}onClick(){dt.open({route:"SelectNetwork"})}render(){var t;const{chains:e}=Q.state,r=e&&e.length>1;return V`<w3m-button-big @click="${this.onClick}" ?disabled="${!r}"><w3m-network-image chainId="${Bt(this.chainId)}"></w3m-network-image><w3m-text variant="medium-normal" color="inverse">${(t=this.label)!=null&&t.length?this.label:"Select Network"}</w3m-text></w3m-button-big>`}};en.styles=[ue.globalCss,k8],qs([Be()],en.prototype,"chainId",2),qs([Be()],en.prototype,"label",2),qs([Be()],en.prototype,"wrongNetwork",2),en=qs([we("w3m-network-switch")],en);const W8=_e`button{display:flex;flex-direction:column;padding:5px 10px;border-radius:10px;transition:background-color .2s ease;height:100%;justify-content:flex-start}.w3m-icons{width:60px;height:60px;display:flex;flex-wrap:wrap;padding:7px;border-radius:15px;justify-content:space-between;align-items:center;margin-bottom:5px;background-color:var(--w3m-color-bg-2);box-shadow:inset 0 0 0 1px var(--w3m-color-overlay)}button:hover{background-color:var(--w3m-color-overlay)}.w3m-icons img{width:21px;height:21px;object-fit:cover;object-position:center;border-radius:8px;border:1px solid var(--w3m-color-overlay)}.w3m-icons svg{width:21px;height:21px}.w3m-icons img:nth-child(1),.w3m-icons img:nth-child(2),.w3m-icons svg:nth-child(1),.w3m-icons svg:nth-child(2){margin-bottom:4px}w3m-text{width:100%;text-align:center}#wallet-placeholder-fill{fill:var(--w3m-color-bg-3)}#wallet-placeholder-dash{stroke:var(--w3m-color-overlay)}`;var q8=Object.defineProperty,V8=Object.getOwnPropertyDescriptor,K8=(t,e,r,n)=>{for(var i=n>1?void 0:n?V8(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&q8(e,r,i),i};let Ec=class extends de{onClick(){Te.push("WalletExplorer")}render(){const{previewWallets:t}=at.state,e=ne.getCustomWallets(),r=[...t,...e].reverse().slice(0,4);return V`<button @click="${this.onClick}"><div class="w3m-icons">${r.map(n=>{var i;const s=(i=n.image_url)==null?void 0:i.lg;if(s)return V`<img src="${s}">`;const o=ne.getWalletId(n.id),a=ne.getWalletIcon(o);return a?V`<img src="${a}">`:ye.WALLET_PLACEHOLDER})}</div><w3m-text variant="xsmall-normal">View All</w3m-text></button>`}};Ec.styles=[ue.globalCss,W8],Ec=K8([we("w3m-view-all-wallets-button")],Ec);const G8=_e`.w3m-qr-container{width:100%;display:flex;justify-content:center;align-items:center;aspect-ratio:1/1}`;var Y8=Object.defineProperty,Z8=Object.getOwnPropertyDescriptor,bd=(t,e,r,n)=>{for(var i=n>1?void 0:n?Z8(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&Y8(e,r,i),i};let Vs=class extends de{constructor(){super(),this.uri="",this.createConnectionAndWait()}get overlayEl(){return ne.getShadowRootElement(this,".w3m-qr-container")}async createConnectionAndWait(t=0){var e;try{const{standaloneUri:r}=Q.state;r?setTimeout(()=>this.uri=r,0):(await qe.client().connectWalletConnect(n=>this.uri=n,(e=Q.state.selectedChain)==null?void 0:e.id),dt.close())}catch(r){console.error(r),Lt.openToast("Connection request declined","error"),t<2&&this.createConnectionAndWait(t+1)}}render(){return V`<div class="w3m-qr-container">${this.uri?V`<w3m-qrcode size="${this.overlayEl.offsetWidth}" uri="${this.uri}"></w3m-qrcode>`:V`<w3m-spinner></w3m-spinner>`}</div>`}};Vs.styles=[ue.globalCss,G8],bd([Be()],Vs.prototype,"uri",2),Vs=bd([we("w3m-walletconnect-qr")],Vs);const J8=_e`.w3m-profile{display:flex;justify-content:space-between;align-items:flex-start;padding-top:20px}.w3m-connection-badge{background-color:var(--w3m-color-bg-2);box-shadow:inset 0 0 0 1px var(--w3m-color-overlay);padding:6px 10px 6px 26px;position:relative;border-radius:28px}.w3m-connection-badge::before{content:'';position:absolute;width:10px;height:10px;left:10px;background-color:var(--w3m-color-success);border-radius:50%;top:50%;margin-top:-5px;box-shadow:0 1px 4px 1px var(--w3m-color-success),inset 0 0 0 1px var(--w3m-color-overlay)}.w3m-footer{display:flex;justify-content:space-between}w3m-address-text{margin-top:10px;display:block}.w3m-balance{border-top:1px solid var(--w3m-color-bg-2);padding:11px 20px}`;var X8=Object.defineProperty,Q8=Object.getOwnPropertyDescriptor,e_=(t,e,r,n)=>{for(var i=n>1?void 0:n?Q8(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&X8(e,r,i),i};let xc=class extends de{onDisconnect(){dt.close(),qe.client().disconnect(),Q.resetAccount()}async onCopyAddress(){var t;await navigator.clipboard.writeText((t=Q.state.address)!=null?t:""),Lt.openToast("Address copied","success")}render(){return V`<w3m-modal-content><div class="w3m-profile"><div class="w3m-info"><w3m-avatar size="medium"></w3m-avatar><w3m-address-text variant="modal"></w3m-address-text></div><div class="w3m-connection-badge"><w3m-text variant="small-normal" color="secondary">Connected</w3m-text></div></div></w3m-modal-content><div class="w3m-balance"><w3m-balance></w3m-balance></div><w3m-modal-footer><div class="w3m-footer"><w3m-account-network-button></w3m-account-network-button><w3m-box-button label="Copy Address" .onClick="${this.onCopyAddress}" .icon="${ye.ACCOUNT_COPY}"></w3m-box-button><w3m-box-button label="Disconnect" .onClick="${this.onDisconnect}" .icon="${ye.ACCOUNT_DISCONNECT}"></w3m-box-button></div></w3m-modal-footer>`}};xc.styles=[ue.globalCss,J8],xc=e_([we("w3m-account-view")],xc);var t_=Object.defineProperty,r_=Object.getOwnPropertyDescriptor,n_=(t,e,r,n)=>{for(var i=n>1?void 0:n?r_(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&t_(e,r,i),i};let Cc=class extends de{viewTemplate(){return Ue.isAndroid()?V`<w3m-android-wallet-selection></w3m-android-wallet-selection>`:Ue.isMobile()?V`<w3m-mobile-wallet-selection></w3m-mobile-wallet-selection>`:V`<w3m-desktop-wallet-selection></w3m-desktop-wallet-selection>`}render(){return V`${this.viewTemplate()}<w3m-legal-notice></w3m-legal-notice>`}};Cc.styles=[ue.globalCss],Cc=n_([we("w3m-connect-wallet-view")],Cc);const i_=_e`.w3m-wrapper{display:flex;align-items:center;justify-content:center;width:100%;aspect-ratio:1/1;flex-direction:column}.w3m-connecting-title{display:flex;align-items:center;justify-content:center;margin-bottom:16px}w3m-spinner{margin-right:10px}w3m-wallet-image{border-radius:15px;width:25%;aspect-ratio:1/1;margin-bottom:20px}.w3m-install-actions{display:flex}.w3m-install-actions w3m-button{margin:0 5px;opacity:1}`;var s_=Object.defineProperty,o_=Object.getOwnPropertyDescriptor,vd=(t,e,r,n)=>{for(var i=n>1?void 0:n?o_(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&s_(e,r,i),i};let Ks=class extends de{constructor(){super(),this.uri="",this.createConnectionAndWait()}getRouterData(){var t;const e=(t=Te.state.data)==null?void 0:t.DesktopConnector;if(!e)throw new Error("Missing router data");return e}onFormatAndRedirect(t){const{native:e,universal:r,name:n}=this.getRouterData();if(e){const i=Ue.formatNativeUrl(e,t,n);Ue.openHref(i)}else if(r){const i=Ue.formatUniversalUrl(r,t,n);Ue.openHref(i,"_blank")}}async createConnectionAndWait(t=0){var e;const{standaloneUri:r}=Q.state,{name:n,walletId:i,native:s,universal:o,icon:a}=this.getRouterData(),c={name:n,id:i,links:{native:s,universal:o},image:a};if(r)ne.setRecentWallet(c),this.onFormatAndRedirect(r);else try{await qe.client().connectWalletConnect(l=>{this.uri=l,this.onFormatAndRedirect(l)},(e=Q.state.selectedChain)==null?void 0:e.id),ne.setRecentWallet(c),dt.close()}catch(l){console.error(l),Lt.openToast("Connection request declined","error"),t<2&&this.createConnectionAndWait(t+1)}}onConnectWithMobile(){Te.push("Qrcode")}onGoToWallet(){const{universal:t,name:e}=this.getRouterData();if(t){const r=Ue.formatUniversalUrl(t,this.uri,e);Ue.openHref(r,"_blank")}}render(){const{name:t,icon:e,universal:r,walletId:n}=this.getRouterData(),i=ne.getWalletName(t);return V`<w3m-modal-header title="${i}"></w3m-modal-header><w3m-modal-content><div class="w3m-wrapper">${e?V`<w3m-wallet-image src="${e}" size="lg"></w3m-wallet-image>`:V`<w3m-wallet-image size="lg" walletid="${Bt(n)}"></w3m-wallet-image>`}<div class="w3m-connecting-title"><w3m-spinner></w3m-spinner><w3m-text variant="large-bold" color="secondary">${`Continue in ${i}...`}</w3m-text></div><div class="w3m-install-actions"><w3m-button .onClick="${async()=>this.createConnectionAndWait()}" .iconRight="${ye.RETRY_ICON}">Retry</w3m-button>${r?V`<w3m-button .onClick="${this.onGoToWallet.bind(this)}" .iconLeft="${ye.ARROW_UP_RIGHT_ICON}">Go to Wallet</w3m-button>`:V`<w3m-button .onClick="${this.onConnectWithMobile}" .iconLeft="${ye.MOBILE_ICON}">Connect with Mobile</w3m-button>`}</div></div></w3m-modal-content>`}};Ks.styles=[ue.globalCss,i_],vd([Be()],Ks.prototype,"uri",2),Ks=vd([we("w3m-desktop-connector-view")],Ks);const a_=_e`.w3m-info-text{margin:5px 0 15px;max-width:320px;text-align:center}.w3m-wallet-item{margin:0 -20px 0 0;padding-right:20px;display:flex;align-items:center;border-bottom:1px solid var(--w3m-color-bg-2)}.w3m-wallet-item:last-child{margin-bottom:-20px;border-bottom:0}.w3m-wallet-content{margin-left:20px;height:60px;display:flex;flex:1;align-items:center;justify-content:space-between}.w3m-footer-actions{display:flex;flex-direction:column;align-items:center;padding:20px 0;border-top:1px solid var(--w3m-color-bg-2)}w3m-wallet-image{display:block;width:40px;height:40px;border-radius:10px}`;var c_=Object.defineProperty,l_=Object.getOwnPropertyDescriptor,u_=(t,e,r,n)=>{for(var i=n>1?void 0:n?l_(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&c_(e,r,i),i};let Sc=class extends de{constructor(){super(...arguments),this.explorerUrl="https://explorer.walletconnect.com/"}onGet(t){Ue.openHref(t,"_blank")}onExplore(){Ue.openHref(this.explorerUrl,"_blank")}render(){const{recomendedWallets:t}=at.state,e=ne.getCustomWallets().slice(0,6),r=t.length,n=e.length;return V`<w3m-modal-header title="Get a wallet"></w3m-modal-header><w3m-modal-content>${r?t.map(({name:i,image_url:s,homepage:o})=>V`<div class="w3m-wallet-item"><w3m-wallet-image src="${s.lg}"></w3m-wallet-image><div class="w3m-wallet-content"><w3m-text variant="medium-normal">${i}</w3m-text><w3m-button .iconRight="${ye.ARROW_RIGHT_ICON}" .onClick="${()=>this.onGet(o)}">Get</w3m-button></div></div>`):null} ${n?e.map(({name:i,id:s,links:o})=>V`<div class="w3m-wallet-item"><w3m-wallet-image walletId="${s}"></w3m-wallet-image><div class="w3m-wallet-content"><w3m-text variant="medium-normal">${i}</w3m-text><w3m-button .iconRight="${ye.ARROW_RIGHT_ICON}" .onClick="${()=>this.onGet(o.universal)}">Get</w3m-button></div></div>`):null}</w3m-modal-content><div class="w3m-footer-actions"><w3m-text variant="medium-normal">Not what you're looking for?</w3m-text><w3m-text variant="small-thin" color="secondary" class="w3m-info-text">With hundreds of wallets out there, there's something for everyone</w3m-text><w3m-button .onClick="${this.onExplore.bind(this)}" .iconRight="${ye.ARROW_UP_RIGHT_ICON}">Explore Wallets</w3m-button></div>`}};Sc.styles=[ue.globalCss,a_],Sc=u_([we("w3m-get-wallet-view")],Sc);const h_=_e`.w3m-footer-actions{display:flex;justify-content:center}.w3m-footer-actions w3m-button{margin:0 5px}.w3m-info-container{display:flex;flex-direction:column;justify-content:center;align-items:center;margin-bottom:20px}.w3m-info-container:last-child{margin-bottom:0}.w3m-info-text{margin-top:5px;text-align:center}.w3m-images svg{margin:0 2px 5px;width:55px;height:55px}.help-img-highlight{stroke:var(--w3m-color-overlay)}`;var d_=Object.defineProperty,f_=Object.getOwnPropertyDescriptor,p_=(t,e,r,n)=>{for(var i=n>1?void 0:n?f_(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&d_(e,r,i),i};let Ic=class extends de{constructor(){super(...arguments),this.learnUrl="https://ethereum.org/en/wallets/"}onGet(){Te.push("GetWallet")}onLearnMore(){Ue.openHref(this.learnUrl,"_blank")}render(){return V`<w3m-modal-header title="What is a wallet?"></w3m-modal-header><w3m-modal-content><div class="w3m-info-container"><div class="w3m-images">${ye.HELP_CHART_IMG} ${ye.HELP_PAINTING_IMG} ${ye.HELP_ETH_IMG}</div><w3m-text variant="medium-normal">A home for your digital assets</w3m-text><w3m-text variant="small-thin" color="secondary" class="w3m-info-text">A wallet lets you store, send and receive digital assets like cryptocurrencies and NFTs.</w3m-text></div><div class="w3m-info-container"><div class="w3m-images">${ye.HELP_KEY_IMG} ${ye.HELP_USER_IMG} ${ye.HELP_LOCK_IMG}</div><w3m-text variant="medium-normal">One login for all of web3</w3m-text><w3m-text variant="small-thin" color="secondary" class="w3m-info-text">Log in to any app by connecting your wallet. Say goodbye to countless passwords!</w3m-text></div><div class="w3m-info-container"><div class="w3m-images">${ye.HELP_COMPAS_IMG} ${ye.HELP_NOUN_IMG} ${ye.HELP_DAO_IMG}</div><w3m-text variant="medium-normal">Your gateway to a new web</w3m-text><w3m-text variant="small-thin" color="secondary" class="w3m-info-text">With your wallet, you can explore and interact with DeFi, NFTs, DAOs, and much more.</w3m-text></div><div class="w3m-footer-actions"><w3m-button .onClick="${this.onGet.bind(this)}" .iconLeft="${ye.WALLET_ICON}">Get a Wallet</w3m-button><w3m-button .onClick="${this.onLearnMore.bind(this)}" .iconRight="${ye.ARROW_UP_RIGHT_ICON}">Learn More</w3m-button></div></w3m-modal-content>`}};Ic.styles=[ue.globalCss,h_],Ic=p_([we("w3m-help-view")],Ic);const g_=_e`.w3m-injected-wrapper{display:flex;align-items:center;justify-content:center;width:100%;aspect-ratio:1/1;flex-direction:column}.w3m-connecting-title{display:flex;align-items:center;justify-content:center;margin-bottom:20px}w3m-spinner{margin-right:10px}w3m-wallet-image{border-radius:15px;width:25%;aspect-ratio:1/1;margin-bottom:20px}w3m-button{opacity:0}.w3m-injected-error w3m-button{opacity:1}`;var m_=Object.defineProperty,w_=Object.getOwnPropertyDescriptor,Dc=(t,e,r,n)=>{for(var i=n>1?void 0:n?w_(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&m_(e,r,i),i};let Ui=class extends de{constructor(){super(),this.connecting=!0,this.error=!1,this.connector=qe.client().getConnectorById("injected"),this.onConnect()}async onConnect(){const{ready:t}=this.connector;t&&(this.error=!1,this.connecting=!0,await ne.handleConnectorConnection("injected",()=>{this.error=!0,this.connecting=!1}))}render(){const t=ne.getWalletName(this.connector.name),e=ne.getWalletId(this.connector.id),r={"w3m-injected-wrapper":!0,"w3m-injected-error":this.error};return V`<w3m-modal-header title="${t}"></w3m-modal-header><w3m-modal-content><div class="${Mt(r)}"><w3m-wallet-image walletId="${e}" size="lg"></w3m-wallet-image><div class="w3m-connecting-title">${this.connecting?V`<w3m-spinner></w3m-spinner>`:null}<w3m-text variant="large-bold" color="${this.error?"error":"secondary"}">${this.error?"Connection declined":`Continue in ${t}...`}</w3m-text></div><w3m-button .onClick="${this.onConnect.bind(this)}" .disabled="${!this.error}" .iconRight="${ye.RETRY_ICON}">Try Again</w3m-button></div></w3m-modal-content>`}};Ui.styles=[ue.globalCss,g_],Dc([Be()],Ui.prototype,"connecting",2),Dc([Be()],Ui.prototype,"error",2),Ui=Dc([we("w3m-injected-connector-view")],Ui);const y_=_e`.w3m-injected-wrapper{display:flex;align-items:center;justify-content:center;width:100%;aspect-ratio:1/1;flex-direction:column}.w3m-connecting-title{display:flex;align-items:center;justify-content:center;margin-bottom:16px}.w3m-install-title{display:flex;align-items:center;justify-content:center;flex-direction:column}.w3m-install-title w3m-text:last-child{margin-top:10px;max-width:240px}.w3m-install-actions{display:flex;margin-top:15px;align-items:center;flex-direction:column}@media(max-width:355px){.w3m-install-actions{flex-direction:column;align-items:center}}w3m-wallet-image{border-radius:15px;width:25%;aspect-ratio:1/1;margin-bottom:20px}w3m-button{opacity:0}.w3m-install-actions w3m-button{margin:5px;opacity:1}.w3m-info-text{text-align:center}`;var b_=Object.defineProperty,v_=Object.getOwnPropertyDescriptor,__=(t,e,r,n)=>{for(var i=n>1?void 0:n?v_(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&b_(e,r,i),i};let Oc=class extends de{getRouterData(){var t;const e=(t=Te.state.data)==null?void 0:t.InstallConnector;if(!e)throw new Error("Missing router data");return e}onInstall(){const{url:t}=this.getRouterData();Ue.openHref(t,"_blank")}onMobile(){const{name:t}=this.getRouterData();Te.push("ConnectWallet"),Lt.openToast(`Scan the code with ${t}`,"success")}render(){const{name:t,id:e,isMobile:r}=this.getRouterData();return V`<w3m-modal-header title="${t}"></w3m-modal-header><w3m-modal-content><div class="w3m-injected-wrapper"><w3m-wallet-image walletId="${e}" size="lg"></w3m-wallet-image><div class="w3m-install-title"><w3m-text variant="large-bold">Install ${t}</w3m-text><w3m-text color="secondary" variant="medium-thin" class="w3m-info-text">To connect ${t}, install the browser extension.</w3m-text></div><div class="w3m-install-actions"><w3m-button .onClick="${this.onInstall.bind(this)}" .iconLeft="${ye.ARROW_DOWN_ICON}">Install Extension</w3m-button>${r?V`<w3m-button .onClick="${this.onMobile.bind(this)}" .iconLeft="${ye.MOBILE_ICON}">${t} Mobile</w3m-button>`:null}</div></div></w3m-modal-content>`}};Oc.styles=[ue.globalCss,y_],Oc=__([we("w3m-install-connector-view")],Oc);var E_=Object.defineProperty,x_=Object.getOwnPropertyDescriptor,C_=(t,e,r,n)=>{for(var i=n>1?void 0:n?x_(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&E_(e,r,i),i};let Ac=class extends de{render(){return V`<w3m-modal-header title="Scan the code" .onAction="${ne.handleUriCopy}" .actionIcon="${ye.COPY_ICON}"></w3m-modal-header><w3m-modal-content><w3m-walletconnect-qr></w3m-walletconnect-qr></w3m-modal-content>`}};Ac.styles=[ue.globalCss],Ac=C_([we("w3m-qrcode-view")],Ac);const S_=_e`.w3m-grid{display:grid;grid-template-columns:repeat(4,80px);margin:-5px -10px;justify-content:space-between}`;var I_=Object.defineProperty,D_=Object.getOwnPropertyDescriptor,O_=(t,e,r,n)=>{for(var i=n>1?void 0:n?D_(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&I_(e,r,i),i};let $c=class extends de{async onSelectChain(t){const{isConnected:e,selectedChain:r,walletConnectVersion:n}=Q.state;e?r?.id===t.id?Te.replace("Account"):n===2?(await qe.client().switchNetwork({chainId:t.id}),Te.replace("Account")):Te.push("SwitchNetwork",{SwitchNetwork:t}):(Te.push("ConnectWallet"),Q.setSelectedChain(t))}render(){const{chains:t}=Q.state;return V`<w3m-modal-header title="Select network"></w3m-modal-header><w3m-modal-content><div class="w3m-grid">${t?.map(e=>V`<w3m-network-button name="${e.name}" chainId="${e.id}" .onClick="${async()=>this.onSelectChain(e)}">${e.name}</w3m-network-button>`)}</div></w3m-modal-content>`}};$c.styles=[ue.globalCss,S_],$c=O_([we("w3m-select-network-view")],$c);const A_=_e`.w3m-wrapper{display:flex;align-items:center;justify-content:center;width:100%;aspect-ratio:1/1;flex-direction:column}.w3m-connecting-title{display:flex;align-items:center;justify-content:center;margin-bottom:16px}w3m-spinner{margin-right:10px}w3m-network-image{width:96px;height:96px;margin-bottom:20px}w3m-button{opacity:0}.w3m-error w3m-button{opacity:1}`;var $_=Object.defineProperty,P_=Object.getOwnPropertyDescriptor,_d=(t,e,r,n)=>{for(var i=n>1?void 0:n?P_(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&$_(e,r,i),i};let Gs=class extends de{constructor(){super(),this.error=!1,this.onSwitchNetwork()}getRouterData(){var t;const e=(t=Te.state.data)==null?void 0:t.SwitchNetwork;if(!e)throw new Error("Missing router data");return e}async onSwitchNetwork(){try{this.error=!1;const t=this.getRouterData();await qe.client().switchNetwork({chainId:t.id}),Q.setSelectedChain(t),Te.replace("Account")}catch{this.error=!0}}render(){const{id:t,name:e}=this.getRouterData(),r={"w3m-wrapper":!0,"w3m-error":this.error};return V`<w3m-modal-header title="${`Connect to ${e}`}"></w3m-modal-header><w3m-modal-content><div class="${Mt(r)}"><w3m-network-image chainId="${t}"></w3m-network-image><div class="w3m-connecting-title">${this.error?null:V`<w3m-spinner></w3m-spinner>`}<w3m-text variant="large-bold" color="${this.error?"error":"secondary"}">${this.error?"Connection declined":"Approve in your wallet"}</w3m-text></div><w3m-button .onClick="${this.onSwitchNetwork.bind(this)}" .disabled="${!this.error}" .iconRight="${ye.RETRY_ICON}">Try Again</w3m-button></div></w3m-modal-content>`}};Gs.styles=[ue.globalCss,A_],_d([Be()],Gs.prototype,"error",2),Gs=_d([we("w3m-switch-network-view")],Gs);const T_=_e`w3m-modal-content{height:clamp(200px,60vh,600px);display:block;overflow:scroll;scrollbar-width:none;position:relative;margin-top:1px}.w3m-grid{display:grid;grid-template-columns:repeat(4,80px);justify-content:space-between;margin:-15px -10px;padding-top:20px}w3m-modal-content::after,w3m-modal-content::before{content:'';position:fixed;pointer-events:none;z-index:1;width:100%;height:20px;opacity:1}w3m-modal-content::before{box-shadow:0 -1px 0 0 var(--w3m-color-bg-1);background:linear-gradient(var(--w3m-color-bg-1),rgba(255,255,255,0))}w3m-modal-content::after{box-shadow:0 1px 0 0 var(--w3m-color-bg-1);background:linear-gradient(rgba(255,255,255,0),var(--w3m-color-bg-1));top:calc(100% - 20px)}w3m-modal-content::-webkit-scrollbar{display:none}.w3m-placeholder-block{display:flex;justify-content:center;align-items:center;height:100px;overflow:hidden}.w3m-empty,.w3m-loading{display:flex}.w3m-loading .w3m-placeholder-block{height:100%}.w3m-end-reached .w3m-placeholder-block{height:0;opacity:0}.w3m-empty .w3m-placeholder-block{opacity:1;height:100%}w3m-wallet-button{margin:calc((100% - 60px)/ 3) 0}`;var N_=Object.defineProperty,R_=Object.getOwnPropertyDescriptor,Fi=(t,e,r,n)=>{for(var i=n>1?void 0:n?R_(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&N_(e,r,i),i};const Pc=40;let tn=class extends de{constructor(){super(...arguments),this.loading=!at.state.wallets.listings.length,this.firstFetch=!at.state.wallets.listings.length,this.search="",this.endReached=!1,this.intersectionObserver=void 0,this.searchDebounce=ne.debounce(t=>{t.length>=3?(this.firstFetch=!0,this.endReached=!1,this.search=t,at.resetSearch(),this.fetchWallets()):this.search&&(this.search="",this.endReached=this.isLastPage(),at.resetSearch())})}firstUpdated(){this.createPaginationObserver()}disconnectedCallback(){var t;(t=this.intersectionObserver)==null||t.disconnect()}get placeholderEl(){return ne.getShadowRootElement(this,".w3m-placeholder-block")}createPaginationObserver(){this.intersectionObserver=new IntersectionObserver(([t])=>{t.isIntersecting&&!(this.search&&this.firstFetch)&&this.fetchWallets()}),this.intersectionObserver.observe(this.placeholderEl)}isLastPage(){const{wallets:t,search:e}=at.state,{listings:r,total:n}=this.search?e:t;return n<=Pc||r.length>=n}async fetchWallets(){var t;const{wallets:e,search:r}=at.state,n=ne.getExtensionWallets(),{listings:i,total:s,page:o}=this.search?r:e;if(!this.endReached&&(this.firstFetch||s>Pc&&i.length<s))try{this.loading=!0;const a=(t=Q.state.standaloneChains)==null?void 0:t.join(","),{listings:c}=await at.getPaginatedWallets({page:this.firstFetch?1:o+1,entries:Pc,device:Ue.isMobile()?"mobile":"desktop",search:this.search,version:Q.state.walletConnectVersion,chains:a}),l=c.map(({image_url:w})=>w.lg),p=n.map(({id:w})=>ne.getWalletIcon(w));await Promise.all([...l.map(async w=>ne.preloadImage(w)),...p.map(async w=>ne.preloadImage(w)),Ue.wait(300)]),this.endReached=this.isLastPage()}catch(a){console.error(a),Lt.openToast(ne.getErrorMessage(a),"error")}finally{this.loading=!1,this.firstFetch=!1}}onConnectCustom({name:t,id:e,links:r}){Ue.isMobile()?ne.handleMobileLinking({links:r,name:t,id:e}):Te.push("DesktopConnector",{DesktopConnector:{name:t,walletId:e,universal:r.universal,native:r.native}})}onConnectListing(t){if(Ue.isMobile()){const{id:e,image_url:r}=t,{native:n,universal:i}=t.mobile;ne.handleMobileLinking({links:{native:n,universal:i},name:t.name,id:e,image:r.lg})}else Te.push("DesktopConnector",{DesktopConnector:{name:t.name,icon:t.image_url.lg,universal:t.desktop.universal||t.homepage,native:t.desktop.native}})}onConnectExtension(t){ne.getWalletId("")===t.id?Te.push("InjectedConnector"):Te.push("InstallConnector",{InstallConnector:t})}onSearchChange(t){const{value:e}=t.target;this.searchDebounce(e)}coinbaseConnectorTemplate(){try{const t=qe.client().getConnectorById(or.coinbaseWallet);return V`<w3m-wallet-button name="${t.name}" walletId="${t.id}" .onClick="${async()=>ne.handleConnectorConnection(or.coinbaseWallet)}"></w3m-wallet-button>`}catch{return null}}render(){const{wallets:t,search:e}=at.state,{isStandalone:r}=Q.state;let{listings:n}=this.search?e:t;n=kt.allowedExplorerListings(n);const i=this.loading&&!n.length,s=this.search.length>=3,o=!i&&(!s||ne.caseSafeIncludes(or.coinbaseWallet,this.search));let a=!r&&!Ue.isMobile()?ne.getExtensionWallets():[],c=ne.getCustomWallets();s&&(a=a.filter(({name:y})=>ne.caseSafeIncludes(y,this.search)),c=c.filter(({name:y})=>ne.caseSafeIncludes(y,this.search)));const l=!this.loading&&!n.length&&!a.length&&!o,p=Math.max(a.length,n.length),w={"w3m-loading":i,"w3m-end-reached":this.endReached||!this.loading,"w3m-empty":l};return V`<w3m-modal-header><w3m-search-input .onChange="${this.onSearchChange.bind(this)}"></w3m-search-input></w3m-modal-header><w3m-modal-content class="${Mt(w)}"><div class="w3m-grid">${i?null:[...Array(p)].map((y,m)=>V`${c[m]?V`<w3m-wallet-button name="${c[m].name}" walletId="${c[m].id}" .onClick="${()=>this.onConnectCustom(c[m])}"></w3m-wallet-button>`:null} ${a[m]?V`<w3m-wallet-button name="${a[m].name}" walletId="${a[m].id}" .onClick="${()=>this.onConnectExtension(a[m])}"></w3m-wallet-button>`:null} ${n[m]?V`<w3m-wallet-button src="${n[m].image_url.lg}" name="${n[m].name}" walletId="${n[m].id}" .onClick="${()=>this.onConnectListing(n[m])}"></w3m-wallet-button>`:null}`)} ${o?this.coinbaseConnectorTemplate():null}</div><div class="w3m-placeholder-block">${l?V`<w3m-text variant="large-bold" color="secondary">No results found</w3m-text>`:null} ${!l&&this.loading?V`<w3m-spinner></w3m-spinner>`:null}</div></w3m-modal-content>`}};tn.styles=[ue.globalCss,T_],Fi([Be()],tn.prototype,"loading",2),Fi([Be()],tn.prototype,"firstFetch",2),Fi([Be()],tn.prototype,"search",2),Fi([Be()],tn.prototype,"endReached",2),tn=Fi([we("w3m-wallet-explorer-view")],tn);var L_=Object.freeze({__proto__:null,get W3mAccountButton(){return Pi},get W3mConnectButton(){return Jr},get W3mCoreButton(){return Xr},get W3mModal(){return Qr},get W3mNetworkSwitch(){return en}});Ar.EthereumProvider=fb,Ar.default=gs,Object.defineProperty(Ar,"__esModule",{value:!0})});
170
131
  //# sourceMappingURL=index.umd.js.map