@walletconnect/ethereum-provider 2.11.0 → 2.11.1

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(hn,wr){typeof exports=="object"&&typeof module<"u"?wr(exports):typeof define=="function"&&define.amd?define(["exports"],wr):(hn=typeof globalThis<"u"?globalThis:hn||self,wr(hn["@walletconnect/ethereum-provider"]={}))})(this,function(hn){"use strict";var wr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ow(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}function Ai(r){var e=r.default;if(typeof e=="function"){var t=function(){return e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(r).forEach(function(n){var i=Object.getOwnPropertyDescriptor(r,n);Object.defineProperty(t,n,i.get?i:{enumerable:!0,get:function(){return r[n]}})}),t}var lr={exports:{}},gs=typeof Reflect=="object"?Reflect:null,Rd=gs&&typeof gs.apply=="function"?gs.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)},Ea;gs&&typeof gs.ownKeys=="function"?Ea=gs.ownKeys:Object.getOwnPropertySymbols?Ea=function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Ea=function(e){return Object.getOwnPropertyNames(e)};function Cw(r){console&&console.warn&&console.warn(r)}var Nd=Number.isNaN||function(e){return e!==e};function pt(){pt.init.call(this)}lr.exports=pt,lr.exports.once=Tw,pt.EventEmitter=pt,pt.prototype._events=void 0,pt.prototype._eventsCount=0,pt.prototype._maxListeners=void 0;var Ld=10;function xa(r){if(typeof r!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof r)}Object.defineProperty(pt,"defaultMaxListeners",{enumerable:!0,get:function(){return Ld},set:function(r){if(typeof r!="number"||r<0||Nd(r))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+r+".");Ld=r}}),pt.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},pt.prototype.setMaxListeners=function(e){if(typeof e!="number"||e<0||Nd(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 Md(r){return r._maxListeners===void 0?pt.defaultMaxListeners:r._maxListeners}pt.prototype.getMaxListeners=function(){return Md(this)},pt.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var i=e==="error",a=this._events;if(a!==void 0)i=i&&a.error===void 0;else if(!i)return!1;if(i){var c;if(t.length>0&&(c=t[0]),c instanceof Error)throw c;var u=new Error("Unhandled error."+(c?" ("+c.message+")":""));throw u.context=c,u}var d=a[e];if(d===void 0)return!1;if(typeof d=="function")Rd(d,this,t);else for(var h=d.length,m=kd(d,h),n=0;n<h;++n)Rd(m[n],this,t);return!0};function Ud(r,e,t,n){var i,a,c;if(xa(t),a=r._events,a===void 0?(a=r._events=Object.create(null),r._eventsCount=0):(a.newListener!==void 0&&(r.emit("newListener",e,t.listener?t.listener:t),a=r._events),c=a[e]),c===void 0)c=a[e]=t,++r._eventsCount;else if(typeof c=="function"?c=a[e]=n?[t,c]:[c,t]:n?c.unshift(t):c.push(t),i=Md(r),i>0&&c.length>i&&!c.warned){c.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+c.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=r,u.type=e,u.count=c.length,Cw(u)}return r}pt.prototype.addListener=function(e,t){return Ud(this,e,t,!1)},pt.prototype.on=pt.prototype.addListener,pt.prototype.prependListener=function(e,t){return Ud(this,e,t,!0)};function $w(){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 jd(r,e,t){var n={fired:!1,wrapFn:void 0,target:r,type:e,listener:t},i=$w.bind(n);return i.listener=t,n.wrapFn=i,i}pt.prototype.once=function(e,t){return xa(t),this.on(e,jd(this,e,t)),this},pt.prototype.prependOnceListener=function(e,t){return xa(t),this.prependListener(e,jd(this,e,t)),this},pt.prototype.removeListener=function(e,t){var n,i,a,c,u;if(xa(t),i=this._events,i===void 0)return this;if(n=i[e],n===void 0)return this;if(n===t||n.listener===t)--this._eventsCount===0?this._events=Object.create(null):(delete i[e],i.removeListener&&this.emit("removeListener",e,n.listener||t));else if(typeof n!="function"){for(a=-1,c=n.length-1;c>=0;c--)if(n[c]===t||n[c].listener===t){u=n[c].listener,a=c;break}if(a<0)return this;a===0?n.shift():Aw(n,a),n.length===1&&(i[e]=n[0]),i.removeListener!==void 0&&this.emit("removeListener",e,u||t)}return this},pt.prototype.off=pt.prototype.removeListener,pt.prototype.removeAllListeners=function(e){var t,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 a=Object.keys(n),c;for(i=0;i<a.length;++i)c=a[i],c!=="removeListener"&&this.removeAllListeners(c);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(t=n[e],typeof t=="function")this.removeListener(e,t);else if(t!==void 0)for(i=t.length-1;i>=0;i--)this.removeListener(e,t[i]);return this};function Fd(r,e,t){var n=r._events;if(n===void 0)return[];var i=n[e];return i===void 0?[]:typeof i=="function"?t?[i.listener||i]:[i]:t?Pw(i):kd(i,i.length)}pt.prototype.listeners=function(e){return Fd(this,e,!0)},pt.prototype.rawListeners=function(e){return Fd(this,e,!1)},pt.listenerCount=function(r,e){return typeof r.listenerCount=="function"?r.listenerCount(e):Bd.call(r,e)},pt.prototype.listenerCount=Bd;function Bd(r){var e=this._events;if(e!==void 0){var t=e[r];if(typeof t=="function")return 1;if(t!==void 0)return t.length}return 0}pt.prototype.eventNames=function(){return this._eventsCount>0?Ea(this._events):[]};function kd(r,e){for(var t=new Array(e),n=0;n<e;++n)t[n]=r[n];return t}function Aw(r,e){for(;e+1<r.length;e++)r[e]=r[e+1];r.pop()}function Pw(r){for(var e=new Array(r.length),t=0;t<e.length;++t)e[t]=r[t].listener||r[t];return e}function Tw(r,e){return new Promise(function(t,n){function i(c){r.removeListener(e,a),n(c)}function a(){typeof r.removeListener=="function"&&r.removeListener("error",i),t([].slice.call(arguments))}Hd(r,e,a,{once:!0}),e!=="error"&&Rw(r,i,{once:!0})})}function Rw(r,e,t){typeof r.on=="function"&&Hd(r,"error",e,t)}function Hd(r,e,t,n){if(typeof r.on=="function")n.once?r.once(e,t):r.on(e,t);else if(typeof r.addEventListener=="function")r.addEventListener(e,function i(a){n.once&&r.removeEventListener(e,i),t(a)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof r)}var Tl={},Ia={},Me={},zd={};(function(r){Object.defineProperty(r,"__esModule",{value:!0});function e(u,d){var h=u>>>16&65535,m=u&65535,y=d>>>16&65535,w=d&65535;return m*w+(h*w+m*y<<16>>>0)|0}r.mul=Math.imul||e;function t(u,d){return u+d|0}r.add=t;function n(u,d){return u-d|0}r.sub=n;function i(u,d){return u<<d|u>>>32-d}r.rotl=i;function a(u,d){return u<<32-d|u>>>d}r.rotr=a;function c(u){return typeof u=="number"&&isFinite(u)&&Math.floor(u)===u}r.isInteger=Number.isInteger||c,r.MAX_SAFE_INTEGER=9007199254740991,r.isSafeInteger=function(u){return r.isInteger(u)&&u>=-r.MAX_SAFE_INTEGER&&u<=r.MAX_SAFE_INTEGER}})(zd),Object.defineProperty(Me,"__esModule",{value:!0});var qd=zd;function Nw(r,e){return e===void 0&&(e=0),(r[e+0]<<8|r[e+1])<<16>>16}Me.readInt16BE=Nw;function Lw(r,e){return e===void 0&&(e=0),(r[e+0]<<8|r[e+1])>>>0}Me.readUint16BE=Lw;function Mw(r,e){return e===void 0&&(e=0),(r[e+1]<<8|r[e])<<16>>16}Me.readInt16LE=Mw;function Uw(r,e){return e===void 0&&(e=0),(r[e+1]<<8|r[e])>>>0}Me.readUint16LE=Uw;function Wd(r,e,t){return e===void 0&&(e=new Uint8Array(2)),t===void 0&&(t=0),e[t+0]=r>>>8,e[t+1]=r>>>0,e}Me.writeUint16BE=Wd,Me.writeInt16BE=Wd;function Kd(r,e,t){return e===void 0&&(e=new Uint8Array(2)),t===void 0&&(t=0),e[t+0]=r>>>0,e[t+1]=r>>>8,e}Me.writeUint16LE=Kd,Me.writeInt16LE=Kd;function Rl(r,e){return e===void 0&&(e=0),r[e]<<24|r[e+1]<<16|r[e+2]<<8|r[e+3]}Me.readInt32BE=Rl;function Nl(r,e){return e===void 0&&(e=0),(r[e]<<24|r[e+1]<<16|r[e+2]<<8|r[e+3])>>>0}Me.readUint32BE=Nl;function Ll(r,e){return e===void 0&&(e=0),r[e+3]<<24|r[e+2]<<16|r[e+1]<<8|r[e]}Me.readInt32LE=Ll;function Ml(r,e){return e===void 0&&(e=0),(r[e+3]<<24|r[e+2]<<16|r[e+1]<<8|r[e])>>>0}Me.readUint32LE=Ml;function Da(r,e,t){return e===void 0&&(e=new Uint8Array(4)),t===void 0&&(t=0),e[t+0]=r>>>24,e[t+1]=r>>>16,e[t+2]=r>>>8,e[t+3]=r>>>0,e}Me.writeUint32BE=Da,Me.writeInt32BE=Da;function Sa(r,e,t){return e===void 0&&(e=new Uint8Array(4)),t===void 0&&(t=0),e[t+0]=r>>>0,e[t+1]=r>>>8,e[t+2]=r>>>16,e[t+3]=r>>>24,e}Me.writeUint32LE=Sa,Me.writeInt32LE=Sa;function jw(r,e){e===void 0&&(e=0);var t=Rl(r,e),n=Rl(r,e+4);return t*4294967296+n-(n>>31)*4294967296}Me.readInt64BE=jw;function Fw(r,e){e===void 0&&(e=0);var t=Nl(r,e),n=Nl(r,e+4);return t*4294967296+n}Me.readUint64BE=Fw;function Bw(r,e){e===void 0&&(e=0);var t=Ll(r,e),n=Ll(r,e+4);return n*4294967296+t-(t>>31)*4294967296}Me.readInt64LE=Bw;function kw(r,e){e===void 0&&(e=0);var t=Ml(r,e),n=Ml(r,e+4);return n*4294967296+t}Me.readUint64LE=kw;function Vd(r,e,t){return e===void 0&&(e=new Uint8Array(8)),t===void 0&&(t=0),Da(r/4294967296>>>0,e,t),Da(r>>>0,e,t+4),e}Me.writeUint64BE=Vd,Me.writeInt64BE=Vd;function Gd(r,e,t){return e===void 0&&(e=new Uint8Array(8)),t===void 0&&(t=0),Sa(r>>>0,e,t),Sa(r/4294967296>>>0,e,t+4),e}Me.writeUint64LE=Gd,Me.writeInt64LE=Gd;function Hw(r,e,t){if(t===void 0&&(t=0),r%8!==0)throw new Error("readUintBE supports only bitLengths divisible by 8");if(r/8>e.length-t)throw new Error("readUintBE: array is too short for the given bitLength");for(var n=0,i=1,a=r/8+t-1;a>=t;a--)n+=e[a]*i,i*=256;return n}Me.readUintBE=Hw;function zw(r,e,t){if(t===void 0&&(t=0),r%8!==0)throw new Error("readUintLE supports only bitLengths divisible by 8");if(r/8>e.length-t)throw new Error("readUintLE: array is too short for the given bitLength");for(var n=0,i=1,a=t;a<t+r/8;a++)n+=e[a]*i,i*=256;return n}Me.readUintLE=zw;function qw(r,e,t,n){if(t===void 0&&(t=new Uint8Array(r/8)),n===void 0&&(n=0),r%8!==0)throw new Error("writeUintBE supports only bitLengths divisible by 8");if(!qd.isSafeInteger(e))throw new Error("writeUintBE value must be an integer");for(var i=1,a=r/8+n-1;a>=n;a--)t[a]=e/i&255,i*=256;return t}Me.writeUintBE=qw;function Ww(r,e,t,n){if(t===void 0&&(t=new Uint8Array(r/8)),n===void 0&&(n=0),r%8!==0)throw new Error("writeUintLE supports only bitLengths divisible by 8");if(!qd.isSafeInteger(e))throw new Error("writeUintLE value must be an integer");for(var i=1,a=n;a<n+r/8;a++)t[a]=e/i&255,i*=256;return t}Me.writeUintLE=Ww;function Kw(r,e){e===void 0&&(e=0);var t=new DataView(r.buffer,r.byteOffset,r.byteLength);return t.getFloat32(e)}Me.readFloat32BE=Kw;function Vw(r,e){e===void 0&&(e=0);var t=new DataView(r.buffer,r.byteOffset,r.byteLength);return t.getFloat32(e,!0)}Me.readFloat32LE=Vw;function Gw(r,e){e===void 0&&(e=0);var t=new DataView(r.buffer,r.byteOffset,r.byteLength);return t.getFloat64(e)}Me.readFloat64BE=Gw;function Yw(r,e){e===void 0&&(e=0);var t=new DataView(r.buffer,r.byteOffset,r.byteLength);return t.getFloat64(e,!0)}Me.readFloat64LE=Yw;function Jw(r,e,t){e===void 0&&(e=new Uint8Array(4)),t===void 0&&(t=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.setFloat32(t,r),e}Me.writeFloat32BE=Jw;function Zw(r,e,t){e===void 0&&(e=new Uint8Array(4)),t===void 0&&(t=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.setFloat32(t,r,!0),e}Me.writeFloat32LE=Zw;function Qw(r,e,t){e===void 0&&(e=new Uint8Array(8)),t===void 0&&(t=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.setFloat64(t,r),e}Me.writeFloat64BE=Qw;function Xw(r,e,t){e===void 0&&(e=new Uint8Array(8)),t===void 0&&(t=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.setFloat64(t,r,!0),e}Me.writeFloat64LE=Xw;var zr={};Object.defineProperty(zr,"__esModule",{value:!0});function ey(r){for(var e=0;e<r.length;e++)r[e]=0;return r}zr.wipe=ey,Object.defineProperty(Ia,"__esModule",{value:!0});var dr=Me,Ul=zr,ty=20;function ry(r,e,t){for(var n=1634760805,i=857760878,a=2036477234,c=1797285236,u=t[3]<<24|t[2]<<16|t[1]<<8|t[0],d=t[7]<<24|t[6]<<16|t[5]<<8|t[4],h=t[11]<<24|t[10]<<16|t[9]<<8|t[8],m=t[15]<<24|t[14]<<16|t[13]<<8|t[12],y=t[19]<<24|t[18]<<16|t[17]<<8|t[16],w=t[23]<<24|t[22]<<16|t[21]<<8|t[20],E=t[27]<<24|t[26]<<16|t[25]<<8|t[24],I=t[31]<<24|t[30]<<16|t[29]<<8|t[28],T=e[3]<<24|e[2]<<16|e[1]<<8|e[0],U=e[7]<<24|e[6]<<16|e[5]<<8|e[4],F=e[11]<<24|e[10]<<16|e[9]<<8|e[8],$=e[15]<<24|e[14]<<16|e[13]<<8|e[12],P=n,O=i,A=a,x=c,f=u,b=d,q=h,j=m,V=y,se=w,ce=E,D=I,N=T,X=U,ee=F,Y=$,J=0;J<ty;J+=2)P=P+f|0,N^=P,N=N>>>32-16|N<<16,V=V+N|0,f^=V,f=f>>>32-12|f<<12,O=O+b|0,X^=O,X=X>>>32-16|X<<16,se=se+X|0,b^=se,b=b>>>32-12|b<<12,A=A+q|0,ee^=A,ee=ee>>>32-16|ee<<16,ce=ce+ee|0,q^=ce,q=q>>>32-12|q<<12,x=x+j|0,Y^=x,Y=Y>>>32-16|Y<<16,D=D+Y|0,j^=D,j=j>>>32-12|j<<12,A=A+q|0,ee^=A,ee=ee>>>32-8|ee<<8,ce=ce+ee|0,q^=ce,q=q>>>32-7|q<<7,x=x+j|0,Y^=x,Y=Y>>>32-8|Y<<8,D=D+Y|0,j^=D,j=j>>>32-7|j<<7,O=O+b|0,X^=O,X=X>>>32-8|X<<8,se=se+X|0,b^=se,b=b>>>32-7|b<<7,P=P+f|0,N^=P,N=N>>>32-8|N<<8,V=V+N|0,f^=V,f=f>>>32-7|f<<7,P=P+b|0,Y^=P,Y=Y>>>32-16|Y<<16,ce=ce+Y|0,b^=ce,b=b>>>32-12|b<<12,O=O+q|0,N^=O,N=N>>>32-16|N<<16,D=D+N|0,q^=D,q=q>>>32-12|q<<12,A=A+j|0,X^=A,X=X>>>32-16|X<<16,V=V+X|0,j^=V,j=j>>>32-12|j<<12,x=x+f|0,ee^=x,ee=ee>>>32-16|ee<<16,se=se+ee|0,f^=se,f=f>>>32-12|f<<12,A=A+j|0,X^=A,X=X>>>32-8|X<<8,V=V+X|0,j^=V,j=j>>>32-7|j<<7,x=x+f|0,ee^=x,ee=ee>>>32-8|ee<<8,se=se+ee|0,f^=se,f=f>>>32-7|f<<7,O=O+q|0,N^=O,N=N>>>32-8|N<<8,D=D+N|0,q^=D,q=q>>>32-7|q<<7,P=P+b|0,Y^=P,Y=Y>>>32-8|Y<<8,ce=ce+Y|0,b^=ce,b=b>>>32-7|b<<7;dr.writeUint32LE(P+n|0,r,0),dr.writeUint32LE(O+i|0,r,4),dr.writeUint32LE(A+a|0,r,8),dr.writeUint32LE(x+c|0,r,12),dr.writeUint32LE(f+u|0,r,16),dr.writeUint32LE(b+d|0,r,20),dr.writeUint32LE(q+h|0,r,24),dr.writeUint32LE(j+m|0,r,28),dr.writeUint32LE(V+y|0,r,32),dr.writeUint32LE(se+w|0,r,36),dr.writeUint32LE(ce+E|0,r,40),dr.writeUint32LE(D+I|0,r,44),dr.writeUint32LE(N+T|0,r,48),dr.writeUint32LE(X+U|0,r,52),dr.writeUint32LE(ee+F|0,r,56),dr.writeUint32LE(Y+$|0,r,60)}function Yd(r,e,t,n,i){if(i===void 0&&(i=0),r.length!==32)throw new Error("ChaCha: key size must be 32 bytes");if(n.length<t.length)throw new Error("ChaCha: destination is shorter than source");var a,c;if(i===0){if(e.length!==8&&e.length!==12)throw new Error("ChaCha nonce must be 8 or 12 bytes");a=new Uint8Array(16),c=a.length-e.length,a.set(e,c)}else{if(e.length!==16)throw new Error("ChaCha nonce with counter must be 16 bytes");a=e,c=i}for(var u=new Uint8Array(64),d=0;d<t.length;d+=64){ry(u,a,r);for(var h=d;h<d+64&&h<t.length;h++)n[h]=t[h]^u[h-d];iy(a,0,c)}return Ul.wipe(u),i===0&&Ul.wipe(a),n}Ia.streamXOR=Yd;function ny(r,e,t,n){return n===void 0&&(n=0),Ul.wipe(t),Yd(r,e,t,t,n)}Ia.stream=ny;function iy(r,e,t){for(var n=1;t--;)n=n+(r[e]&255)|0,r[e]=n&255,n>>>=8,e++;if(n>0)throw new Error("ChaCha: counter overflow")}var Jd={},ri={};Object.defineProperty(ri,"__esModule",{value:!0});function sy(r,e,t){return~(r-1)&e|r-1&t}ri.select=sy;function oy(r,e){return(r|0)-(e|0)-1>>>31&1}ri.lessOrEqual=oy;function Zd(r,e){if(r.length!==e.length)return 0;for(var t=0,n=0;n<r.length;n++)t|=r[n]^e[n];return 1&t-1>>>8}ri.compare=Zd;function ay(r,e){return r.length===0||e.length===0?!1:Zd(r,e)!==0}ri.equal=ay,function(r){Object.defineProperty(r,"__esModule",{value:!0});var e=ri,t=zr;r.DIGEST_LENGTH=16;var n=function(){function c(u){this.digestLength=r.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 d=u[0]|u[1]<<8;this._r[0]=d&8191;var h=u[2]|u[3]<<8;this._r[1]=(d>>>13|h<<3)&8191;var m=u[4]|u[5]<<8;this._r[2]=(h>>>10|m<<6)&7939;var y=u[6]|u[7]<<8;this._r[3]=(m>>>7|y<<9)&8191;var w=u[8]|u[9]<<8;this._r[4]=(y>>>4|w<<12)&255,this._r[5]=w>>>1&8190;var E=u[10]|u[11]<<8;this._r[6]=(w>>>14|E<<2)&8191;var I=u[12]|u[13]<<8;this._r[7]=(E>>>11|I<<5)&8065;var T=u[14]|u[15]<<8;this._r[8]=(I>>>8|T<<8)&8191,this._r[9]=T>>>5&127,this._pad[0]=u[16]|u[17]<<8,this._pad[1]=u[18]|u[19]<<8,this._pad[2]=u[20]|u[21]<<8,this._pad[3]=u[22]|u[23]<<8,this._pad[4]=u[24]|u[25]<<8,this._pad[5]=u[26]|u[27]<<8,this._pad[6]=u[28]|u[29]<<8,this._pad[7]=u[30]|u[31]<<8}return c.prototype._blocks=function(u,d,h){for(var m=this._fin?0:2048,y=this._h[0],w=this._h[1],E=this._h[2],I=this._h[3],T=this._h[4],U=this._h[5],F=this._h[6],$=this._h[7],P=this._h[8],O=this._h[9],A=this._r[0],x=this._r[1],f=this._r[2],b=this._r[3],q=this._r[4],j=this._r[5],V=this._r[6],se=this._r[7],ce=this._r[8],D=this._r[9];h>=16;){var N=u[d+0]|u[d+1]<<8;y+=N&8191;var X=u[d+2]|u[d+3]<<8;w+=(N>>>13|X<<3)&8191;var ee=u[d+4]|u[d+5]<<8;E+=(X>>>10|ee<<6)&8191;var Y=u[d+6]|u[d+7]<<8;I+=(ee>>>7|Y<<9)&8191;var J=u[d+8]|u[d+9]<<8;T+=(Y>>>4|J<<12)&8191,U+=J>>>1&8191;var Q=u[d+10]|u[d+11]<<8;F+=(J>>>14|Q<<2)&8191;var ie=u[d+12]|u[d+13]<<8;$+=(Q>>>11|ie<<5)&8191;var Ee=u[d+14]|u[d+15]<<8;P+=(ie>>>8|Ee<<8)&8191,O+=Ee>>>5|m;var ae=0,xe=ae;xe+=y*A,xe+=w*(5*D),xe+=E*(5*ce),xe+=I*(5*se),xe+=T*(5*V),ae=xe>>>13,xe&=8191,xe+=U*(5*j),xe+=F*(5*q),xe+=$*(5*b),xe+=P*(5*f),xe+=O*(5*x),ae+=xe>>>13,xe&=8191;var de=ae;de+=y*x,de+=w*A,de+=E*(5*D),de+=I*(5*ce),de+=T*(5*se),ae=de>>>13,de&=8191,de+=U*(5*V),de+=F*(5*j),de+=$*(5*q),de+=P*(5*b),de+=O*(5*f),ae+=de>>>13,de&=8191;var be=ae;be+=y*f,be+=w*x,be+=E*A,be+=I*(5*D),be+=T*(5*ce),ae=be>>>13,be&=8191,be+=U*(5*se),be+=F*(5*V),be+=$*(5*j),be+=P*(5*q),be+=O*(5*b),ae+=be>>>13,be&=8191;var K=ae;K+=y*b,K+=w*f,K+=E*x,K+=I*A,K+=T*(5*D),ae=K>>>13,K&=8191,K+=U*(5*ce),K+=F*(5*se),K+=$*(5*V),K+=P*(5*j),K+=O*(5*q),ae+=K>>>13,K&=8191;var W=ae;W+=y*q,W+=w*b,W+=E*f,W+=I*x,W+=T*A,ae=W>>>13,W&=8191,W+=U*(5*D),W+=F*(5*ce),W+=$*(5*se),W+=P*(5*V),W+=O*(5*j),ae+=W>>>13,W&=8191;var B=ae;B+=y*j,B+=w*q,B+=E*b,B+=I*f,B+=T*x,ae=B>>>13,B&=8191,B+=U*A,B+=F*(5*D),B+=$*(5*ce),B+=P*(5*se),B+=O*(5*V),ae+=B>>>13,B&=8191;var g=ae;g+=y*V,g+=w*j,g+=E*q,g+=I*b,g+=T*f,ae=g>>>13,g&=8191,g+=U*x,g+=F*A,g+=$*(5*D),g+=P*(5*ce),g+=O*(5*se),ae+=g>>>13,g&=8191;var L=ae;L+=y*se,L+=w*V,L+=E*j,L+=I*q,L+=T*b,ae=L>>>13,L&=8191,L+=U*f,L+=F*x,L+=$*A,L+=P*(5*D),L+=O*(5*ce),ae+=L>>>13,L&=8191;var le=ae;le+=y*ce,le+=w*se,le+=E*V,le+=I*j,le+=T*q,ae=le>>>13,le&=8191,le+=U*b,le+=F*f,le+=$*x,le+=P*A,le+=O*(5*D),ae+=le>>>13,le&=8191;var pe=ae;pe+=y*D,pe+=w*ce,pe+=E*se,pe+=I*V,pe+=T*j,ae=pe>>>13,pe&=8191,pe+=U*q,pe+=F*b,pe+=$*f,pe+=P*x,pe+=O*A,ae+=pe>>>13,pe&=8191,ae=(ae<<2)+ae|0,ae=ae+xe|0,xe=ae&8191,ae=ae>>>13,de+=ae,y=xe,w=de,E=be,I=K,T=W,U=B,F=g,$=L,P=le,O=pe,d+=16,h-=16}this._h[0]=y,this._h[1]=w,this._h[2]=E,this._h[3]=I,this._h[4]=T,this._h[5]=U,this._h[6]=F,this._h[7]=$,this._h[8]=P,this._h[9]=O},c.prototype.finish=function(u,d){d===void 0&&(d=0);var h=new Uint16Array(10),m,y,w,E;if(this._leftover){for(E=this._leftover,this._buffer[E++]=1;E<16;E++)this._buffer[E]=0;this._fin=1,this._blocks(this._buffer,0,16)}for(m=this._h[1]>>>13,this._h[1]&=8191,E=2;E<10;E++)this._h[E]+=m,m=this._h[E]>>>13,this._h[E]&=8191;for(this._h[0]+=m*5,m=this._h[0]>>>13,this._h[0]&=8191,this._h[1]+=m,m=this._h[1]>>>13,this._h[1]&=8191,this._h[2]+=m,h[0]=this._h[0]+5,m=h[0]>>>13,h[0]&=8191,E=1;E<10;E++)h[E]=this._h[E]+m,m=h[E]>>>13,h[E]&=8191;for(h[9]-=8192,y=(m^1)-1,E=0;E<10;E++)h[E]&=y;for(y=~y,E=0;E<10;E++)this._h[E]=this._h[E]&y|h[E];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,w=this._h[0]+this._pad[0],this._h[0]=w&65535,E=1;E<8;E++)w=(this._h[E]+this._pad[E]|0)+(w>>>16)|0,this._h[E]=w&65535;return u[d+0]=this._h[0]>>>0,u[d+1]=this._h[0]>>>8,u[d+2]=this._h[1]>>>0,u[d+3]=this._h[1]>>>8,u[d+4]=this._h[2]>>>0,u[d+5]=this._h[2]>>>8,u[d+6]=this._h[3]>>>0,u[d+7]=this._h[3]>>>8,u[d+8]=this._h[4]>>>0,u[d+9]=this._h[4]>>>8,u[d+10]=this._h[5]>>>0,u[d+11]=this._h[5]>>>8,u[d+12]=this._h[6]>>>0,u[d+13]=this._h[6]>>>8,u[d+14]=this._h[7]>>>0,u[d+15]=this._h[7]>>>8,this._finished=!0,this},c.prototype.update=function(u){var d=0,h=u.length,m;if(this._leftover){m=16-this._leftover,m>h&&(m=h);for(var y=0;y<m;y++)this._buffer[this._leftover+y]=u[d+y];if(h-=m,d+=m,this._leftover+=m,this._leftover<16)return this;this._blocks(this._buffer,0,16),this._leftover=0}if(h>=16&&(m=h-h%16,this._blocks(u,d,m),d+=m,h-=m),h){for(var y=0;y<h;y++)this._buffer[this._leftover+y]=u[d+y];this._leftover+=h}return this},c.prototype.digest=function(){if(this._finished)throw new Error("Poly1305 was finished");var u=new Uint8Array(16);return this.finish(u),u},c.prototype.clean=function(){return t.wipe(this._buffer),t.wipe(this._r),t.wipe(this._h),t.wipe(this._pad),this._leftover=0,this._fin=0,this._finished=!0,this},c}();r.Poly1305=n;function i(c,u){var d=new n(c);d.update(u);var h=d.digest();return d.clean(),h}r.oneTimeAuth=i;function a(c,u){return c.length!==r.DIGEST_LENGTH||u.length!==r.DIGEST_LENGTH?!1:e.equal(c,u)}r.equal=a}(Jd),function(r){Object.defineProperty(r,"__esModule",{value:!0});var e=Ia,t=Jd,n=zr,i=Me,a=ri;r.KEY_LENGTH=32,r.NONCE_LENGTH=12,r.TAG_LENGTH=16;var c=new Uint8Array(16),u=function(){function d(h){if(this.nonceLength=r.NONCE_LENGTH,this.tagLength=r.TAG_LENGTH,h.length!==r.KEY_LENGTH)throw new Error("ChaCha20Poly1305 needs 32-byte key");this._key=new Uint8Array(h)}return d.prototype.seal=function(h,m,y,w){if(h.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");var E=new Uint8Array(16);E.set(h,E.length-h.length);var I=new Uint8Array(32);e.stream(this._key,E,I,4);var T=m.length+this.tagLength,U;if(w){if(w.length!==T)throw new Error("ChaCha20Poly1305: incorrect destination length");U=w}else U=new Uint8Array(T);return e.streamXOR(this._key,E,m,U,4),this._authenticate(U.subarray(U.length-this.tagLength,U.length),I,U.subarray(0,U.length-this.tagLength),y),n.wipe(E),U},d.prototype.open=function(h,m,y,w){if(h.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");if(m.length<this.tagLength)return null;var E=new Uint8Array(16);E.set(h,E.length-h.length);var I=new Uint8Array(32);e.stream(this._key,E,I,4);var T=new Uint8Array(this.tagLength);if(this._authenticate(T,I,m.subarray(0,m.length-this.tagLength),y),!a.equal(T,m.subarray(m.length-this.tagLength,m.length)))return null;var U=m.length-this.tagLength,F;if(w){if(w.length!==U)throw new Error("ChaCha20Poly1305: incorrect destination length");F=w}else F=new Uint8Array(U);return e.streamXOR(this._key,E,m.subarray(0,m.length-this.tagLength),F,4),n.wipe(E),F},d.prototype.clean=function(){return n.wipe(this._key),this},d.prototype._authenticate=function(h,m,y,w){var E=new t.Poly1305(m);w&&(E.update(w),w.length%16>0&&E.update(c.subarray(w.length%16))),E.update(y),y.length%16>0&&E.update(c.subarray(y.length%16));var I=new Uint8Array(8);w&&i.writeUint64LE(w.length,I),E.update(I),i.writeUint64LE(y.length,I),E.update(I);for(var T=E.digest(),U=0;U<T.length;U++)h[U]=T[U];E.clean(),n.wipe(T),n.wipe(I)},d}();r.ChaCha20Poly1305=u}(Tl);var Qd={},ho={},jl={};Object.defineProperty(jl,"__esModule",{value:!0});function cy(r){return typeof r.saveState<"u"&&typeof r.restoreState<"u"&&typeof r.cleanSavedState<"u"}jl.isSerializableHash=cy,Object.defineProperty(ho,"__esModule",{value:!0});var _n=jl,ly=ri,uy=zr,Xd=function(){function r(e,t){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);t.length>this.blockSize?this._inner.update(t).finish(n).clean():n.set(t);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),_n.isSerializableHash(this._inner)&&_n.isSerializableHash(this._outer)&&(this._innerKeyedState=this._inner.saveState(),this._outerKeyedState=this._outer.saveState()),uy.wipe(n)}return r.prototype.reset=function(){if(!_n.isSerializableHash(this._inner)||!_n.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},r.prototype.clean=function(){_n.isSerializableHash(this._inner)&&this._inner.cleanSavedState(this._innerKeyedState),_n.isSerializableHash(this._outer)&&this._outer.cleanSavedState(this._outerKeyedState),this._inner.clean(),this._outer.clean()},r.prototype.update=function(e){return this._inner.update(e),this},r.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)},r.prototype.digest=function(){var e=new Uint8Array(this.digestLength);return this.finish(e),e},r.prototype.saveState=function(){if(!_n.isSerializableHash(this._inner))throw new Error("hmac: can't saveState() because hash doesn't implement it");return this._inner.saveState()},r.prototype.restoreState=function(e){if(!_n.isSerializableHash(this._inner)||!_n.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},r.prototype.cleanSavedState=function(e){if(!_n.isSerializableHash(this._inner))throw new Error("hmac: can't cleanSavedState() because hash doesn't implement it");this._inner.cleanSavedState(e)},r}();ho.HMAC=Xd;function hy(r,e,t){var n=new Xd(r,e);n.update(t);var i=n.digest();return n.clean(),i}ho.hmac=hy,ho.equal=ly.equal,Object.defineProperty(Qd,"__esModule",{value:!0});var e0=ho,t0=zr,fy=function(){function r(e,t,n,i){n===void 0&&(n=new Uint8Array(0)),this._counter=new Uint8Array(1),this._hash=e,this._info=i;var a=e0.hmac(this._hash,n,t);this._hmac=new e0.HMAC(e,a),this._buffer=new Uint8Array(this._hmac.digestLength),this._bufpos=this._buffer.length}return r.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},r.prototype.expand=function(e){for(var t=new Uint8Array(e),n=0;n<t.length;n++)this._bufpos===this._buffer.length&&this._fillBuffer(),t[n]=this._buffer[this._bufpos++];return t},r.prototype.clean=function(){this._hmac.clean(),t0.wipe(this._buffer),t0.wipe(this._counter),this._bufpos=0},r}(),dy=Qd.HKDF=fy,ms={},Oa={},Ca={};Object.defineProperty(Ca,"__esModule",{value:!0}),Ca.BrowserRandomSource=void 0;const r0=65536;class py{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 t=new Uint8Array(e);for(let n=0;n<t.length;n+=r0)this._crypto.getRandomValues(t.subarray(n,n+Math.min(t.length-n,r0)));return t}}Ca.BrowserRandomSource=py;function gy(r){throw new Error('Could not dynamically require "'+r+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var $a={},my={},vy=Object.freeze({__proto__:null,default:my}),wy=Ai(vy);Object.defineProperty($a,"__esModule",{value:!0}),$a.NodeRandomSource=void 0;const yy=zr;class by{constructor(){if(this.isAvailable=!1,this.isInstantiated=!1,typeof gy<"u"){const e=wy;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 t=this._crypto.randomBytes(e);if(t.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]=t[i];return(0,yy.wipe)(t),n}}$a.NodeRandomSource=by,Object.defineProperty(Oa,"__esModule",{value:!0}),Oa.SystemRandomSource=void 0;const _y=Ca,Ey=$a;class xy{constructor(){if(this.isAvailable=!1,this.name="",this._source=new _y.BrowserRandomSource,this._source.isAvailable){this.isAvailable=!0,this.name="Browser";return}if(this._source=new Ey.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)}}Oa.SystemRandomSource=xy,function(r){Object.defineProperty(r,"__esModule",{value:!0}),r.randomStringForEntropy=r.randomString=r.randomUint32=r.randomBytes=r.defaultRandomSource=void 0;const e=Oa,t=Me,n=zr;r.defaultRandomSource=new e.SystemRandomSource;function i(h,m=r.defaultRandomSource){return m.randomBytes(h)}r.randomBytes=i;function a(h=r.defaultRandomSource){const m=i(4,h),y=(0,t.readUint32LE)(m);return(0,n.wipe)(m),y}r.randomUint32=a;const c="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";function u(h,m=c,y=r.defaultRandomSource){if(m.length<2)throw new Error("randomString charset is too short");if(m.length>256)throw new Error("randomString charset is too long");let w="";const E=m.length,I=256-256%E;for(;h>0;){const T=i(Math.ceil(h*256/I),y);for(let U=0;U<T.length&&h>0;U++){const F=T[U];F<I&&(w+=m.charAt(F%E),h--)}(0,n.wipe)(T)}return w}r.randomString=u;function d(h,m=c,y=r.defaultRandomSource){const w=Math.ceil(h/(Math.log(m.length)/Math.LN2));return u(w,m,y)}r.randomStringForEntropy=d}(ms);var Aa={};(function(r){Object.defineProperty(r,"__esModule",{value:!0});var e=Me,t=zr;r.DIGEST_LENGTH=32,r.BLOCK_SIZE=64;var n=function(){function u(){this.digestLength=r.DIGEST_LENGTH,this.blockSize=r.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 u.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},u.prototype.reset=function(){return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this},u.prototype.clean=function(){t.wipe(this._buffer),t.wipe(this._temp),this.reset()},u.prototype.update=function(d,h){if(h===void 0&&(h=d.length),this._finished)throw new Error("SHA256: can't update because hash was finished.");var m=0;if(this._bytesHashed+=h,this._bufferLength>0){for(;this._bufferLength<this.blockSize&&h>0;)this._buffer[this._bufferLength++]=d[m++],h--;this._bufferLength===this.blockSize&&(a(this._temp,this._state,this._buffer,0,this.blockSize),this._bufferLength=0)}for(h>=this.blockSize&&(m=a(this._temp,this._state,d,m,h),h%=this.blockSize);h>0;)this._buffer[this._bufferLength++]=d[m++],h--;return this},u.prototype.finish=function(d){if(!this._finished){var h=this._bytesHashed,m=this._bufferLength,y=h/536870912|0,w=h<<3,E=h%64<56?64:128;this._buffer[m]=128;for(var I=m+1;I<E-8;I++)this._buffer[I]=0;e.writeUint32BE(y,this._buffer,E-8),e.writeUint32BE(w,this._buffer,E-4),a(this._temp,this._state,this._buffer,0,E),this._finished=!0}for(var I=0;I<this.digestLength/4;I++)e.writeUint32BE(this._state[I],d,I*4);return this},u.prototype.digest=function(){var d=new Uint8Array(this.digestLength);return this.finish(d),d},u.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}},u.prototype.restoreState=function(d){return this._state.set(d.state),this._bufferLength=d.bufferLength,d.buffer&&this._buffer.set(d.buffer),this._bytesHashed=d.bytesHashed,this._finished=!1,this},u.prototype.cleanSavedState=function(d){t.wipe(d.state),d.buffer&&t.wipe(d.buffer),d.bufferLength=0,d.bytesHashed=0},u}();r.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 a(u,d,h,m,y){for(;y>=64;){for(var w=d[0],E=d[1],I=d[2],T=d[3],U=d[4],F=d[5],$=d[6],P=d[7],O=0;O<16;O++){var A=m+O*4;u[O]=e.readUint32BE(h,A)}for(var O=16;O<64;O++){var x=u[O-2],f=(x>>>17|x<<32-17)^(x>>>19|x<<32-19)^x>>>10;x=u[O-15];var b=(x>>>7|x<<32-7)^(x>>>18|x<<32-18)^x>>>3;u[O]=(f+u[O-7]|0)+(b+u[O-16]|0)}for(var O=0;O<64;O++){var f=(((U>>>6|U<<26)^(U>>>11|U<<21)^(U>>>25|U<<7))+(U&F^~U&$)|0)+(P+(i[O]+u[O]|0)|0)|0,b=((w>>>2|w<<32-2)^(w>>>13|w<<32-13)^(w>>>22|w<<32-22))+(w&E^w&I^E&I)|0;P=$,$=F,F=U,U=T+f|0,T=I,I=E,E=w,w=f+b|0}d[0]+=w,d[1]+=E,d[2]+=I,d[3]+=T,d[4]+=U,d[5]+=F,d[6]+=$,d[7]+=P,m+=64,y-=64}return m}function c(u){var d=new n;d.update(u);var h=d.digest();return d.clean(),h}r.hash=c})(Aa);var Fl={};(function(r){Object.defineProperty(r,"__esModule",{value:!0}),r.sharedKey=r.generateKeyPair=r.generateKeyPairFromSeed=r.scalarMultBase=r.scalarMult=r.SHARED_KEY_LENGTH=r.SECRET_KEY_LENGTH=r.PUBLIC_KEY_LENGTH=void 0;const e=ms,t=zr;r.PUBLIC_KEY_LENGTH=32,r.SECRET_KEY_LENGTH=32,r.SHARED_KEY_LENGTH=32;function n(O){const A=new Float64Array(16);if(O)for(let x=0;x<O.length;x++)A[x]=O[x];return A}const i=new Uint8Array(32);i[0]=9;const a=n([56129,1]);function c(O){let A=1;for(let x=0;x<16;x++){let f=O[x]+A+65535;A=Math.floor(f/65536),O[x]=f-A*65536}O[0]+=A-1+37*(A-1)}function u(O,A,x){const f=~(x-1);for(let b=0;b<16;b++){const q=f&(O[b]^A[b]);O[b]^=q,A[b]^=q}}function d(O,A){const x=n(),f=n();for(let b=0;b<16;b++)f[b]=A[b];c(f),c(f),c(f);for(let b=0;b<2;b++){x[0]=f[0]-65517;for(let j=1;j<15;j++)x[j]=f[j]-65535-(x[j-1]>>16&1),x[j-1]&=65535;x[15]=f[15]-32767-(x[14]>>16&1);const q=x[15]>>16&1;x[14]&=65535,u(f,x,1-q)}for(let b=0;b<16;b++)O[2*b]=f[b]&255,O[2*b+1]=f[b]>>8}function h(O,A){for(let x=0;x<16;x++)O[x]=A[2*x]+(A[2*x+1]<<8);O[15]&=32767}function m(O,A,x){for(let f=0;f<16;f++)O[f]=A[f]+x[f]}function y(O,A,x){for(let f=0;f<16;f++)O[f]=A[f]-x[f]}function w(O,A,x){let f,b,q=0,j=0,V=0,se=0,ce=0,D=0,N=0,X=0,ee=0,Y=0,J=0,Q=0,ie=0,Ee=0,ae=0,xe=0,de=0,be=0,K=0,W=0,B=0,g=0,L=0,le=0,pe=0,Oe=0,Ke=0,Je=0,ke=0,Dt=0,St=0,ze=x[0],Ce=x[1],Ue=x[2],je=x[3],qe=x[4],Ae=x[5],Fe=x[6],Se=x[7],Te=x[8],Ve=x[9],$e=x[10],Ze=x[11],et=x[12],at=x[13],ct=x[14],nt=x[15];f=A[0],q+=f*ze,j+=f*Ce,V+=f*Ue,se+=f*je,ce+=f*qe,D+=f*Ae,N+=f*Fe,X+=f*Se,ee+=f*Te,Y+=f*Ve,J+=f*$e,Q+=f*Ze,ie+=f*et,Ee+=f*at,ae+=f*ct,xe+=f*nt,f=A[1],j+=f*ze,V+=f*Ce,se+=f*Ue,ce+=f*je,D+=f*qe,N+=f*Ae,X+=f*Fe,ee+=f*Se,Y+=f*Te,J+=f*Ve,Q+=f*$e,ie+=f*Ze,Ee+=f*et,ae+=f*at,xe+=f*ct,de+=f*nt,f=A[2],V+=f*ze,se+=f*Ce,ce+=f*Ue,D+=f*je,N+=f*qe,X+=f*Ae,ee+=f*Fe,Y+=f*Se,J+=f*Te,Q+=f*Ve,ie+=f*$e,Ee+=f*Ze,ae+=f*et,xe+=f*at,de+=f*ct,be+=f*nt,f=A[3],se+=f*ze,ce+=f*Ce,D+=f*Ue,N+=f*je,X+=f*qe,ee+=f*Ae,Y+=f*Fe,J+=f*Se,Q+=f*Te,ie+=f*Ve,Ee+=f*$e,ae+=f*Ze,xe+=f*et,de+=f*at,be+=f*ct,K+=f*nt,f=A[4],ce+=f*ze,D+=f*Ce,N+=f*Ue,X+=f*je,ee+=f*qe,Y+=f*Ae,J+=f*Fe,Q+=f*Se,ie+=f*Te,Ee+=f*Ve,ae+=f*$e,xe+=f*Ze,de+=f*et,be+=f*at,K+=f*ct,W+=f*nt,f=A[5],D+=f*ze,N+=f*Ce,X+=f*Ue,ee+=f*je,Y+=f*qe,J+=f*Ae,Q+=f*Fe,ie+=f*Se,Ee+=f*Te,ae+=f*Ve,xe+=f*$e,de+=f*Ze,be+=f*et,K+=f*at,W+=f*ct,B+=f*nt,f=A[6],N+=f*ze,X+=f*Ce,ee+=f*Ue,Y+=f*je,J+=f*qe,Q+=f*Ae,ie+=f*Fe,Ee+=f*Se,ae+=f*Te,xe+=f*Ve,de+=f*$e,be+=f*Ze,K+=f*et,W+=f*at,B+=f*ct,g+=f*nt,f=A[7],X+=f*ze,ee+=f*Ce,Y+=f*Ue,J+=f*je,Q+=f*qe,ie+=f*Ae,Ee+=f*Fe,ae+=f*Se,xe+=f*Te,de+=f*Ve,be+=f*$e,K+=f*Ze,W+=f*et,B+=f*at,g+=f*ct,L+=f*nt,f=A[8],ee+=f*ze,Y+=f*Ce,J+=f*Ue,Q+=f*je,ie+=f*qe,Ee+=f*Ae,ae+=f*Fe,xe+=f*Se,de+=f*Te,be+=f*Ve,K+=f*$e,W+=f*Ze,B+=f*et,g+=f*at,L+=f*ct,le+=f*nt,f=A[9],Y+=f*ze,J+=f*Ce,Q+=f*Ue,ie+=f*je,Ee+=f*qe,ae+=f*Ae,xe+=f*Fe,de+=f*Se,be+=f*Te,K+=f*Ve,W+=f*$e,B+=f*Ze,g+=f*et,L+=f*at,le+=f*ct,pe+=f*nt,f=A[10],J+=f*ze,Q+=f*Ce,ie+=f*Ue,Ee+=f*je,ae+=f*qe,xe+=f*Ae,de+=f*Fe,be+=f*Se,K+=f*Te,W+=f*Ve,B+=f*$e,g+=f*Ze,L+=f*et,le+=f*at,pe+=f*ct,Oe+=f*nt,f=A[11],Q+=f*ze,ie+=f*Ce,Ee+=f*Ue,ae+=f*je,xe+=f*qe,de+=f*Ae,be+=f*Fe,K+=f*Se,W+=f*Te,B+=f*Ve,g+=f*$e,L+=f*Ze,le+=f*et,pe+=f*at,Oe+=f*ct,Ke+=f*nt,f=A[12],ie+=f*ze,Ee+=f*Ce,ae+=f*Ue,xe+=f*je,de+=f*qe,be+=f*Ae,K+=f*Fe,W+=f*Se,B+=f*Te,g+=f*Ve,L+=f*$e,le+=f*Ze,pe+=f*et,Oe+=f*at,Ke+=f*ct,Je+=f*nt,f=A[13],Ee+=f*ze,ae+=f*Ce,xe+=f*Ue,de+=f*je,be+=f*qe,K+=f*Ae,W+=f*Fe,B+=f*Se,g+=f*Te,L+=f*Ve,le+=f*$e,pe+=f*Ze,Oe+=f*et,Ke+=f*at,Je+=f*ct,ke+=f*nt,f=A[14],ae+=f*ze,xe+=f*Ce,de+=f*Ue,be+=f*je,K+=f*qe,W+=f*Ae,B+=f*Fe,g+=f*Se,L+=f*Te,le+=f*Ve,pe+=f*$e,Oe+=f*Ze,Ke+=f*et,Je+=f*at,ke+=f*ct,Dt+=f*nt,f=A[15],xe+=f*ze,de+=f*Ce,be+=f*Ue,K+=f*je,W+=f*qe,B+=f*Ae,g+=f*Fe,L+=f*Se,le+=f*Te,pe+=f*Ve,Oe+=f*$e,Ke+=f*Ze,Je+=f*et,ke+=f*at,Dt+=f*ct,St+=f*nt,q+=38*de,j+=38*be,V+=38*K,se+=38*W,ce+=38*B,D+=38*g,N+=38*L,X+=38*le,ee+=38*pe,Y+=38*Oe,J+=38*Ke,Q+=38*Je,ie+=38*ke,Ee+=38*Dt,ae+=38*St,b=1,f=q+b+65535,b=Math.floor(f/65536),q=f-b*65536,f=j+b+65535,b=Math.floor(f/65536),j=f-b*65536,f=V+b+65535,b=Math.floor(f/65536),V=f-b*65536,f=se+b+65535,b=Math.floor(f/65536),se=f-b*65536,f=ce+b+65535,b=Math.floor(f/65536),ce=f-b*65536,f=D+b+65535,b=Math.floor(f/65536),D=f-b*65536,f=N+b+65535,b=Math.floor(f/65536),N=f-b*65536,f=X+b+65535,b=Math.floor(f/65536),X=f-b*65536,f=ee+b+65535,b=Math.floor(f/65536),ee=f-b*65536,f=Y+b+65535,b=Math.floor(f/65536),Y=f-b*65536,f=J+b+65535,b=Math.floor(f/65536),J=f-b*65536,f=Q+b+65535,b=Math.floor(f/65536),Q=f-b*65536,f=ie+b+65535,b=Math.floor(f/65536),ie=f-b*65536,f=Ee+b+65535,b=Math.floor(f/65536),Ee=f-b*65536,f=ae+b+65535,b=Math.floor(f/65536),ae=f-b*65536,f=xe+b+65535,b=Math.floor(f/65536),xe=f-b*65536,q+=b-1+37*(b-1),b=1,f=q+b+65535,b=Math.floor(f/65536),q=f-b*65536,f=j+b+65535,b=Math.floor(f/65536),j=f-b*65536,f=V+b+65535,b=Math.floor(f/65536),V=f-b*65536,f=se+b+65535,b=Math.floor(f/65536),se=f-b*65536,f=ce+b+65535,b=Math.floor(f/65536),ce=f-b*65536,f=D+b+65535,b=Math.floor(f/65536),D=f-b*65536,f=N+b+65535,b=Math.floor(f/65536),N=f-b*65536,f=X+b+65535,b=Math.floor(f/65536),X=f-b*65536,f=ee+b+65535,b=Math.floor(f/65536),ee=f-b*65536,f=Y+b+65535,b=Math.floor(f/65536),Y=f-b*65536,f=J+b+65535,b=Math.floor(f/65536),J=f-b*65536,f=Q+b+65535,b=Math.floor(f/65536),Q=f-b*65536,f=ie+b+65535,b=Math.floor(f/65536),ie=f-b*65536,f=Ee+b+65535,b=Math.floor(f/65536),Ee=f-b*65536,f=ae+b+65535,b=Math.floor(f/65536),ae=f-b*65536,f=xe+b+65535,b=Math.floor(f/65536),xe=f-b*65536,q+=b-1+37*(b-1),O[0]=q,O[1]=j,O[2]=V,O[3]=se,O[4]=ce,O[5]=D,O[6]=N,O[7]=X,O[8]=ee,O[9]=Y,O[10]=J,O[11]=Q,O[12]=ie,O[13]=Ee,O[14]=ae,O[15]=xe}function E(O,A){w(O,A,A)}function I(O,A){const x=n();for(let f=0;f<16;f++)x[f]=A[f];for(let f=253;f>=0;f--)E(x,x),f!==2&&f!==4&&w(x,x,A);for(let f=0;f<16;f++)O[f]=x[f]}function T(O,A){const x=new Uint8Array(32),f=new Float64Array(80),b=n(),q=n(),j=n(),V=n(),se=n(),ce=n();for(let ee=0;ee<31;ee++)x[ee]=O[ee];x[31]=O[31]&127|64,x[0]&=248,h(f,A);for(let ee=0;ee<16;ee++)q[ee]=f[ee];b[0]=V[0]=1;for(let ee=254;ee>=0;--ee){const Y=x[ee>>>3]>>>(ee&7)&1;u(b,q,Y),u(j,V,Y),m(se,b,j),y(b,b,j),m(j,q,V),y(q,q,V),E(V,se),E(ce,b),w(b,j,b),w(j,q,se),m(se,b,j),y(b,b,j),E(q,b),y(j,V,ce),w(b,j,a),m(b,b,V),w(j,j,b),w(b,V,ce),w(V,q,f),E(q,se),u(b,q,Y),u(j,V,Y)}for(let ee=0;ee<16;ee++)f[ee+16]=b[ee],f[ee+32]=j[ee],f[ee+48]=q[ee],f[ee+64]=V[ee];const D=f.subarray(32),N=f.subarray(16);I(D,D),w(N,N,D);const X=new Uint8Array(32);return d(X,N),X}r.scalarMult=T;function U(O){return T(O,i)}r.scalarMultBase=U;function F(O){if(O.length!==r.SECRET_KEY_LENGTH)throw new Error(`x25519: seed must be ${r.SECRET_KEY_LENGTH} bytes`);const A=new Uint8Array(O);return{publicKey:U(A),secretKey:A}}r.generateKeyPairFromSeed=F;function $(O){const A=(0,e.randomBytes)(32,O),x=F(A);return(0,t.wipe)(A),x}r.generateKeyPair=$;function P(O,A,x=!1){if(O.length!==r.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect secret key length");if(A.length!==r.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect public key length");const f=T(O,A);if(x){let b=0;for(let q=0;q<f.length;q++)b|=f[q];if(b===0)throw new Error("X25519: invalid shared key")}return f}r.sharedKey=P})(Fl);function Bl(r){return globalThis.Buffer!=null?new Uint8Array(r.buffer,r.byteOffset,r.byteLength):r}function n0(r=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?Bl(globalThis.Buffer.allocUnsafe(r)):new Uint8Array(r)}function kl(r,e){e||(e=r.reduce((i,a)=>i+a.length,0));const t=n0(e);let n=0;for(const i of r)t.set(i,n),n+=i.length;return Bl(t)}function Iy(r,e){if(r.length>=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),n=0;n<t.length;n++)t[n]=255;for(var i=0;i<r.length;i++){var a=r.charAt(i),c=a.charCodeAt(0);if(t[c]!==255)throw new TypeError(a+" is ambiguous");t[c]=i}var u=r.length,d=r.charAt(0),h=Math.log(u)/Math.log(256),m=Math.log(256)/Math.log(u);function y(I){if(I instanceof Uint8Array||(ArrayBuffer.isView(I)?I=new Uint8Array(I.buffer,I.byteOffset,I.byteLength):Array.isArray(I)&&(I=Uint8Array.from(I))),!(I instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(I.length===0)return"";for(var T=0,U=0,F=0,$=I.length;F!==$&&I[F]===0;)F++,T++;for(var P=($-F)*m+1>>>0,O=new Uint8Array(P);F!==$;){for(var A=I[F],x=0,f=P-1;(A!==0||x<U)&&f!==-1;f--,x++)A+=256*O[f]>>>0,O[f]=A%u>>>0,A=A/u>>>0;if(A!==0)throw new Error("Non-zero carry");U=x,F++}for(var b=P-U;b!==P&&O[b]===0;)b++;for(var q=d.repeat(T);b<P;++b)q+=r.charAt(O[b]);return q}function w(I){if(typeof I!="string")throw new TypeError("Expected String");if(I.length===0)return new Uint8Array;var T=0;if(I[T]!==" "){for(var U=0,F=0;I[T]===d;)U++,T++;for(var $=(I.length-T)*h+1>>>0,P=new Uint8Array($);I[T];){var O=t[I.charCodeAt(T)];if(O===255)return;for(var A=0,x=$-1;(O!==0||A<F)&&x!==-1;x--,A++)O+=u*P[x]>>>0,P[x]=O%256>>>0,O=O/256>>>0;if(O!==0)throw new Error("Non-zero carry");F=A,T++}if(I[T]!==" "){for(var f=$-F;f!==$&&P[f]===0;)f++;for(var b=new Uint8Array(U+($-f)),q=U;f!==$;)b[q++]=P[f++];return b}}}function E(I){var T=w(I);if(T)return T;throw new Error(`Non-${e} character`)}return{encode:y,decodeUnsafe:w,decode:E}}var Dy=Iy,Sy=Dy;const i0=r=>{if(r instanceof Uint8Array&&r.constructor.name==="Uint8Array")return r;if(r instanceof ArrayBuffer)return new Uint8Array(r);if(ArrayBuffer.isView(r))return new Uint8Array(r.buffer,r.byteOffset,r.byteLength);throw new Error("Unknown type, must be binary type")},Oy=r=>new TextEncoder().encode(r),Cy=r=>new TextDecoder().decode(r);class $y{constructor(e,t,n){this.name=e,this.prefix=t,this.baseEncode=n}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}}class Ay{constructor(e,t,n){if(this.name=e,this.prefix=t,t.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=t.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 s0(this,e)}}class Py{constructor(e){this.decoders=e}or(e){return s0(this,e)}decode(e){const t=e[0],n=this.decoders[t];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 s0=(r,e)=>new Py({...r.decoders||{[r.prefix]:r},...e.decoders||{[e.prefix]:e}});class Ty{constructor(e,t,n,i){this.name=e,this.prefix=t,this.baseEncode=n,this.baseDecode=i,this.encoder=new $y(e,t,n),this.decoder=new Ay(e,t,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}const Pa=({name:r,prefix:e,encode:t,decode:n})=>new Ty(r,e,t,n),fo=({prefix:r,name:e,alphabet:t})=>{const{encode:n,decode:i}=Sy(t,e);return Pa({prefix:r,name:e,encode:n,decode:a=>i0(i(a))})},Ry=(r,e,t,n)=>{const i={};for(let m=0;m<e.length;++m)i[e[m]]=m;let a=r.length;for(;r[a-1]==="=";)--a;const c=new Uint8Array(a*t/8|0);let u=0,d=0,h=0;for(let m=0;m<a;++m){const y=i[r[m]];if(y===void 0)throw new SyntaxError(`Non-${n} character`);d=d<<t|y,u+=t,u>=8&&(u-=8,c[h++]=255&d>>u)}if(u>=t||255&d<<8-u)throw new SyntaxError("Unexpected end of data");return c},Ny=(r,e,t)=>{const n=e[e.length-1]==="=",i=(1<<t)-1;let a="",c=0,u=0;for(let d=0;d<r.length;++d)for(u=u<<8|r[d],c+=8;c>t;)c-=t,a+=e[i&u>>c];if(c&&(a+=e[i&u<<t-c]),n)for(;a.length*t&7;)a+="=";return a},ur=({name:r,prefix:e,bitsPerChar:t,alphabet:n})=>Pa({prefix:e,name:r,encode(i){return Ny(i,n,t)},decode(i){return Ry(i,n,t,r)}}),Ly=Pa({prefix:"\0",name:"identity",encode:r=>Cy(r),decode:r=>Oy(r)});var My=Object.freeze({__proto__:null,identity:Ly});const Uy=ur({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var jy=Object.freeze({__proto__:null,base2:Uy});const Fy=ur({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var By=Object.freeze({__proto__:null,base8:Fy});const ky=fo({prefix:"9",name:"base10",alphabet:"0123456789"});var Hy=Object.freeze({__proto__:null,base10:ky});const zy=ur({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),qy=ur({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var Wy=Object.freeze({__proto__:null,base16:zy,base16upper:qy});const Ky=ur({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),Vy=ur({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),Gy=ur({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),Yy=ur({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),Jy=ur({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),Zy=ur({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),Qy=ur({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),Xy=ur({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),eb=ur({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var tb=Object.freeze({__proto__:null,base32:Ky,base32upper:Vy,base32pad:Gy,base32padupper:Yy,base32hex:Jy,base32hexupper:Zy,base32hexpad:Qy,base32hexpadupper:Xy,base32z:eb});const rb=fo({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),nb=fo({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var ib=Object.freeze({__proto__:null,base36:rb,base36upper:nb});const sb=fo({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),ob=fo({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var ab=Object.freeze({__proto__:null,base58btc:sb,base58flickr:ob});const cb=ur({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),lb=ur({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),ub=ur({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),hb=ur({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var fb=Object.freeze({__proto__:null,base64:cb,base64pad:lb,base64url:ub,base64urlpad:hb});const o0=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}"),db=o0.reduce((r,e,t)=>(r[t]=e,r),[]),pb=o0.reduce((r,e,t)=>(r[e.codePointAt(0)]=t,r),[]);function gb(r){return r.reduce((e,t)=>(e+=db[t],e),"")}function mb(r){const e=[];for(const t of r){const n=pb[t.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${t}`);e.push(n)}return new Uint8Array(e)}const vb=Pa({prefix:"\u{1F680}",name:"base256emoji",encode:gb,decode:mb});var wb=Object.freeze({__proto__:null,base256emoji:vb}),yb=c0,a0=128,bb=127,_b=~bb,Eb=Math.pow(2,31);function c0(r,e,t){e=e||[],t=t||0;for(var n=t;r>=Eb;)e[t++]=r&255|a0,r/=128;for(;r&_b;)e[t++]=r&255|a0,r>>>=7;return e[t]=r|0,c0.bytes=t-n+1,e}var xb=Hl,Ib=128,l0=127;function Hl(r,n){var t=0,n=n||0,i=0,a=n,c,u=r.length;do{if(a>=u)throw Hl.bytes=0,new RangeError("Could not decode varint");c=r[a++],t+=i<28?(c&l0)<<i:(c&l0)*Math.pow(2,i),i+=7}while(c>=Ib);return Hl.bytes=a-n,t}var Db=Math.pow(2,7),Sb=Math.pow(2,14),Ob=Math.pow(2,21),Cb=Math.pow(2,28),$b=Math.pow(2,35),Ab=Math.pow(2,42),Pb=Math.pow(2,49),Tb=Math.pow(2,56),Rb=Math.pow(2,63),Nb=function(r){return r<Db?1:r<Sb?2:r<Ob?3:r<Cb?4:r<$b?5:r<Ab?6:r<Pb?7:r<Tb?8:r<Rb?9:10},Lb={encode:yb,decode:xb,encodingLength:Nb},u0=Lb;const h0=(r,e,t=0)=>(u0.encode(r,e,t),e),f0=r=>u0.encodingLength(r),zl=(r,e)=>{const t=e.byteLength,n=f0(r),i=n+f0(t),a=new Uint8Array(i+t);return h0(r,a,0),h0(t,a,n),a.set(e,i),new Mb(r,t,e,a)};class Mb{constructor(e,t,n,i){this.code=e,this.size=t,this.digest=n,this.bytes=i}}const d0=({name:r,code:e,encode:t})=>new Ub(r,e,t);class Ub{constructor(e,t,n){this.name=e,this.code=t,this.encode=n}digest(e){if(e instanceof Uint8Array){const t=this.encode(e);return t instanceof Uint8Array?zl(this.code,t):t.then(n=>zl(this.code,n))}else throw Error("Unknown type, must be binary type")}}const p0=r=>async e=>new Uint8Array(await crypto.subtle.digest(r,e)),jb=d0({name:"sha2-256",code:18,encode:p0("SHA-256")}),Fb=d0({name:"sha2-512",code:19,encode:p0("SHA-512")});var Bb=Object.freeze({__proto__:null,sha256:jb,sha512:Fb});const g0=0,kb="identity",m0=i0;var Hb=Object.freeze({__proto__:null,identity:{code:g0,name:kb,encode:m0,digest:r=>zl(g0,m0(r))}});new TextEncoder,new TextDecoder;const v0={...My,...jy,...By,...Hy,...Wy,...tb,...ib,...ab,...fb,...wb};({...Bb,...Hb});function w0(r,e,t,n){return{name:r,prefix:e,encoder:{name:r,prefix:e,encode:t},decoder:{decode:n}}}const y0=w0("utf8","u",r=>"u"+new TextDecoder("utf8").decode(r),r=>new TextEncoder().encode(r.substring(1))),ql=w0("ascii","a",r=>{let e="a";for(let t=0;t<r.length;t++)e+=String.fromCharCode(r[t]);return e},r=>{r=r.substring(1);const e=n0(r.length);for(let t=0;t<r.length;t++)e[t]=r.charCodeAt(t);return e}),b0={utf8:y0,"utf-8":y0,hex:v0.base16,latin1:ql,ascii:ql,binary:ql,...v0};function Pr(r,e="utf8"){const t=b0[e];if(!t)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?Bl(globalThis.Buffer.from(r,"utf-8")):t.decoder.decode(`${t.prefix}${r}`)}function yr(r,e="utf8"){const t=b0[e];if(!t)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(r.buffer,r.byteOffset,r.byteLength).toString("utf8"):t.encoder.encode(r).substring(1)}var _0=function(r,e,t){if(t||arguments.length===2)for(var n=0,i=e.length,a;n<i;n++)(a||!(n in e))&&(a||(a=Array.prototype.slice.call(e,0,n)),a[n]=e[n]);return r.concat(a||Array.prototype.slice.call(e))},zb=function(){function r(e,t,n){this.name=e,this.version=t,this.os=n,this.type="browser"}return r}(),qb=function(){function r(e){this.version=e,this.type="node",this.name="node",this.os=process.platform}return r}(),Wb=function(){function r(e,t,n,i){this.name=e,this.version=t,this.os=n,this.bot=i,this.type="bot-device"}return r}(),Kb=function(){function r(){this.type="bot",this.bot=!0,this.name="bot",this.version=null,this.os=null}return r}(),Vb=function(){function r(){this.type="react-native",this.name="react-native",this.version=null,this.os=null}return r}(),Gb=/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/,Yb=/(nuhk|curl|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/,E0=3,Jb=[["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",Gb]],x0=[["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 Zb(r){return r?I0(r):typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"?new Vb:typeof navigator<"u"?I0(navigator.userAgent):e2()}function Qb(r){return r!==""&&Jb.reduce(function(e,t){var n=t[0],i=t[1];if(e)return e;var a=i.exec(r);return!!a&&[n,a]},!1)}function I0(r){var e=Qb(r);if(!e)return null;var t=e[0],n=e[1];if(t==="searchbot")return new Kb;var i=n[1]&&n[1].split(".").join("_").split("_").slice(0,3);i?i.length<E0&&(i=_0(_0([],i,!0),t2(E0-i.length),!0)):i=[];var a=i.join("."),c=Xb(r),u=Yb.exec(r);return u&&u[1]?new Wb(t,a,c,u[1]):new zb(t,a,c)}function Xb(r){for(var e=0,t=x0.length;e<t;e++){var n=x0[e],i=n[0],a=n[1],c=a.exec(r);if(c)return i}return null}function e2(){var r=typeof process<"u"&&process.version;return r?new qb(process.version.slice(1)):null}function t2(r){for(var e=[],t=0;t<r;t++)e.push("0");return e}var we={};/*! *****************************************************************************
1
+ (function(fn,yr){typeof exports=="object"&&typeof module<"u"?yr(exports):typeof define=="function"&&define.amd?define(["exports"],yr):(fn=typeof globalThis<"u"?globalThis:fn||self,yr(fn["@walletconnect/ethereum-provider"]={}))})(this,function(fn){"use strict";var yr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Oy(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}function Pi(r){var e=r.default;if(typeof e=="function"){var t=function(){return e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(r).forEach(function(n){var i=Object.getOwnPropertyDescriptor(r,n);Object.defineProperty(t,n,i.get?i:{enumerable:!0,get:function(){return r[n]}})}),t}var lr={exports:{}},ms=typeof Reflect=="object"?Reflect:null,Rd=ms&&typeof ms.apply=="function"?ms.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)},Ea;ms&&typeof ms.ownKeys=="function"?Ea=ms.ownKeys:Object.getOwnPropertySymbols?Ea=function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Ea=function(e){return Object.getOwnPropertyNames(e)};function $y(r){console&&console.warn&&console.warn(r)}var Nd=Number.isNaN||function(e){return e!==e};function pt(){pt.init.call(this)}lr.exports=pt,lr.exports.once=Ry,pt.EventEmitter=pt,pt.prototype._events=void 0,pt.prototype._eventsCount=0,pt.prototype._maxListeners=void 0;var Ld=10;function xa(r){if(typeof r!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof r)}Object.defineProperty(pt,"defaultMaxListeners",{enumerable:!0,get:function(){return Ld},set:function(r){if(typeof r!="number"||r<0||Nd(r))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+r+".");Ld=r}}),pt.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},pt.prototype.setMaxListeners=function(e){if(typeof e!="number"||e<0||Nd(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 Md(r){return r._maxListeners===void 0?pt.defaultMaxListeners:r._maxListeners}pt.prototype.getMaxListeners=function(){return Md(this)},pt.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var i=e==="error",a=this._events;if(a!==void 0)i=i&&a.error===void 0;else if(!i)return!1;if(i){var c;if(t.length>0&&(c=t[0]),c instanceof Error)throw c;var u=new Error("Unhandled error."+(c?" ("+c.message+")":""));throw u.context=c,u}var f=a[e];if(f===void 0)return!1;if(typeof f=="function")Rd(f,this,t);else for(var h=f.length,m=kd(f,h),n=0;n<h;++n)Rd(m[n],this,t);return!0};function Ud(r,e,t,n){var i,a,c;if(xa(t),a=r._events,a===void 0?(a=r._events=Object.create(null),r._eventsCount=0):(a.newListener!==void 0&&(r.emit("newListener",e,t.listener?t.listener:t),a=r._events),c=a[e]),c===void 0)c=a[e]=t,++r._eventsCount;else if(typeof c=="function"?c=a[e]=n?[t,c]:[c,t]:n?c.unshift(t):c.push(t),i=Md(r),i>0&&c.length>i&&!c.warned){c.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+c.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=r,u.type=e,u.count=c.length,$y(u)}return r}pt.prototype.addListener=function(e,t){return Ud(this,e,t,!1)},pt.prototype.on=pt.prototype.addListener,pt.prototype.prependListener=function(e,t){return Ud(this,e,t,!0)};function Ay(){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 jd(r,e,t){var n={fired:!1,wrapFn:void 0,target:r,type:e,listener:t},i=Ay.bind(n);return i.listener=t,n.wrapFn=i,i}pt.prototype.once=function(e,t){return xa(t),this.on(e,jd(this,e,t)),this},pt.prototype.prependOnceListener=function(e,t){return xa(t),this.prependListener(e,jd(this,e,t)),this},pt.prototype.removeListener=function(e,t){var n,i,a,c,u;if(xa(t),i=this._events,i===void 0)return this;if(n=i[e],n===void 0)return this;if(n===t||n.listener===t)--this._eventsCount===0?this._events=Object.create(null):(delete i[e],i.removeListener&&this.emit("removeListener",e,n.listener||t));else if(typeof n!="function"){for(a=-1,c=n.length-1;c>=0;c--)if(n[c]===t||n[c].listener===t){u=n[c].listener,a=c;break}if(a<0)return this;a===0?n.shift():Py(n,a),n.length===1&&(i[e]=n[0]),i.removeListener!==void 0&&this.emit("removeListener",e,u||t)}return this},pt.prototype.off=pt.prototype.removeListener,pt.prototype.removeAllListeners=function(e){var t,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 a=Object.keys(n),c;for(i=0;i<a.length;++i)c=a[i],c!=="removeListener"&&this.removeAllListeners(c);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(t=n[e],typeof t=="function")this.removeListener(e,t);else if(t!==void 0)for(i=t.length-1;i>=0;i--)this.removeListener(e,t[i]);return this};function Fd(r,e,t){var n=r._events;if(n===void 0)return[];var i=n[e];return i===void 0?[]:typeof i=="function"?t?[i.listener||i]:[i]:t?Ty(i):kd(i,i.length)}pt.prototype.listeners=function(e){return Fd(this,e,!0)},pt.prototype.rawListeners=function(e){return Fd(this,e,!1)},pt.listenerCount=function(r,e){return typeof r.listenerCount=="function"?r.listenerCount(e):Bd.call(r,e)},pt.prototype.listenerCount=Bd;function Bd(r){var e=this._events;if(e!==void 0){var t=e[r];if(typeof t=="function")return 1;if(t!==void 0)return t.length}return 0}pt.prototype.eventNames=function(){return this._eventsCount>0?Ea(this._events):[]};function kd(r,e){for(var t=new Array(e),n=0;n<e;++n)t[n]=r[n];return t}function Py(r,e){for(;e+1<r.length;e++)r[e]=r[e+1];r.pop()}function Ty(r){for(var e=new Array(r.length),t=0;t<e.length;++t)e[t]=r[t].listener||r[t];return e}function Ry(r,e){return new Promise(function(t,n){function i(c){r.removeListener(e,a),n(c)}function a(){typeof r.removeListener=="function"&&r.removeListener("error",i),t([].slice.call(arguments))}qd(r,e,a,{once:!0}),e!=="error"&&Ny(r,i,{once:!0})})}function Ny(r,e,t){typeof r.on=="function"&&qd(r,"error",e,t)}function qd(r,e,t,n){if(typeof r.on=="function")n.once?r.once(e,t):r.on(e,t);else if(typeof r.addEventListener=="function")r.addEventListener(e,function i(a){n.once&&r.removeEventListener(e,i),t(a)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof r)}var Pl={},Ia={},Me={},zd={};(function(r){Object.defineProperty(r,"__esModule",{value:!0});function e(u,f){var h=u>>>16&65535,m=u&65535,w=f>>>16&65535,y=f&65535;return m*y+(h*y+m*w<<16>>>0)|0}r.mul=Math.imul||e;function t(u,f){return u+f|0}r.add=t;function n(u,f){return u-f|0}r.sub=n;function i(u,f){return u<<f|u>>>32-f}r.rotl=i;function a(u,f){return u<<32-f|u>>>f}r.rotr=a;function c(u){return typeof u=="number"&&isFinite(u)&&Math.floor(u)===u}r.isInteger=Number.isInteger||c,r.MAX_SAFE_INTEGER=9007199254740991,r.isSafeInteger=function(u){return r.isInteger(u)&&u>=-r.MAX_SAFE_INTEGER&&u<=r.MAX_SAFE_INTEGER}})(zd),Object.defineProperty(Me,"__esModule",{value:!0});var Hd=zd;function Ly(r,e){return e===void 0&&(e=0),(r[e+0]<<8|r[e+1])<<16>>16}Me.readInt16BE=Ly;function My(r,e){return e===void 0&&(e=0),(r[e+0]<<8|r[e+1])>>>0}Me.readUint16BE=My;function Uy(r,e){return e===void 0&&(e=0),(r[e+1]<<8|r[e])<<16>>16}Me.readInt16LE=Uy;function jy(r,e){return e===void 0&&(e=0),(r[e+1]<<8|r[e])>>>0}Me.readUint16LE=jy;function Wd(r,e,t){return e===void 0&&(e=new Uint8Array(2)),t===void 0&&(t=0),e[t+0]=r>>>8,e[t+1]=r>>>0,e}Me.writeUint16BE=Wd,Me.writeInt16BE=Wd;function Kd(r,e,t){return e===void 0&&(e=new Uint8Array(2)),t===void 0&&(t=0),e[t+0]=r>>>0,e[t+1]=r>>>8,e}Me.writeUint16LE=Kd,Me.writeInt16LE=Kd;function Tl(r,e){return e===void 0&&(e=0),r[e]<<24|r[e+1]<<16|r[e+2]<<8|r[e+3]}Me.readInt32BE=Tl;function Rl(r,e){return e===void 0&&(e=0),(r[e]<<24|r[e+1]<<16|r[e+2]<<8|r[e+3])>>>0}Me.readUint32BE=Rl;function Nl(r,e){return e===void 0&&(e=0),r[e+3]<<24|r[e+2]<<16|r[e+1]<<8|r[e]}Me.readInt32LE=Nl;function Ll(r,e){return e===void 0&&(e=0),(r[e+3]<<24|r[e+2]<<16|r[e+1]<<8|r[e])>>>0}Me.readUint32LE=Ll;function Da(r,e,t){return e===void 0&&(e=new Uint8Array(4)),t===void 0&&(t=0),e[t+0]=r>>>24,e[t+1]=r>>>16,e[t+2]=r>>>8,e[t+3]=r>>>0,e}Me.writeUint32BE=Da,Me.writeInt32BE=Da;function Sa(r,e,t){return e===void 0&&(e=new Uint8Array(4)),t===void 0&&(t=0),e[t+0]=r>>>0,e[t+1]=r>>>8,e[t+2]=r>>>16,e[t+3]=r>>>24,e}Me.writeUint32LE=Sa,Me.writeInt32LE=Sa;function Fy(r,e){e===void 0&&(e=0);var t=Tl(r,e),n=Tl(r,e+4);return t*4294967296+n-(n>>31)*4294967296}Me.readInt64BE=Fy;function By(r,e){e===void 0&&(e=0);var t=Rl(r,e),n=Rl(r,e+4);return t*4294967296+n}Me.readUint64BE=By;function ky(r,e){e===void 0&&(e=0);var t=Nl(r,e),n=Nl(r,e+4);return n*4294967296+t-(t>>31)*4294967296}Me.readInt64LE=ky;function qy(r,e){e===void 0&&(e=0);var t=Ll(r,e),n=Ll(r,e+4);return n*4294967296+t}Me.readUint64LE=qy;function Vd(r,e,t){return e===void 0&&(e=new Uint8Array(8)),t===void 0&&(t=0),Da(r/4294967296>>>0,e,t),Da(r>>>0,e,t+4),e}Me.writeUint64BE=Vd,Me.writeInt64BE=Vd;function Gd(r,e,t){return e===void 0&&(e=new Uint8Array(8)),t===void 0&&(t=0),Sa(r>>>0,e,t),Sa(r/4294967296>>>0,e,t+4),e}Me.writeUint64LE=Gd,Me.writeInt64LE=Gd;function zy(r,e,t){if(t===void 0&&(t=0),r%8!==0)throw new Error("readUintBE supports only bitLengths divisible by 8");if(r/8>e.length-t)throw new Error("readUintBE: array is too short for the given bitLength");for(var n=0,i=1,a=r/8+t-1;a>=t;a--)n+=e[a]*i,i*=256;return n}Me.readUintBE=zy;function Hy(r,e,t){if(t===void 0&&(t=0),r%8!==0)throw new Error("readUintLE supports only bitLengths divisible by 8");if(r/8>e.length-t)throw new Error("readUintLE: array is too short for the given bitLength");for(var n=0,i=1,a=t;a<t+r/8;a++)n+=e[a]*i,i*=256;return n}Me.readUintLE=Hy;function Wy(r,e,t,n){if(t===void 0&&(t=new Uint8Array(r/8)),n===void 0&&(n=0),r%8!==0)throw new Error("writeUintBE supports only bitLengths divisible by 8");if(!Hd.isSafeInteger(e))throw new Error("writeUintBE value must be an integer");for(var i=1,a=r/8+n-1;a>=n;a--)t[a]=e/i&255,i*=256;return t}Me.writeUintBE=Wy;function Ky(r,e,t,n){if(t===void 0&&(t=new Uint8Array(r/8)),n===void 0&&(n=0),r%8!==0)throw new Error("writeUintLE supports only bitLengths divisible by 8");if(!Hd.isSafeInteger(e))throw new Error("writeUintLE value must be an integer");for(var i=1,a=n;a<n+r/8;a++)t[a]=e/i&255,i*=256;return t}Me.writeUintLE=Ky;function Vy(r,e){e===void 0&&(e=0);var t=new DataView(r.buffer,r.byteOffset,r.byteLength);return t.getFloat32(e)}Me.readFloat32BE=Vy;function Gy(r,e){e===void 0&&(e=0);var t=new DataView(r.buffer,r.byteOffset,r.byteLength);return t.getFloat32(e,!0)}Me.readFloat32LE=Gy;function Yy(r,e){e===void 0&&(e=0);var t=new DataView(r.buffer,r.byteOffset,r.byteLength);return t.getFloat64(e)}Me.readFloat64BE=Yy;function Jy(r,e){e===void 0&&(e=0);var t=new DataView(r.buffer,r.byteOffset,r.byteLength);return t.getFloat64(e,!0)}Me.readFloat64LE=Jy;function Zy(r,e,t){e===void 0&&(e=new Uint8Array(4)),t===void 0&&(t=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.setFloat32(t,r),e}Me.writeFloat32BE=Zy;function Qy(r,e,t){e===void 0&&(e=new Uint8Array(4)),t===void 0&&(t=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.setFloat32(t,r,!0),e}Me.writeFloat32LE=Qy;function Xy(r,e,t){e===void 0&&(e=new Uint8Array(8)),t===void 0&&(t=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.setFloat64(t,r),e}Me.writeFloat64BE=Xy;function ew(r,e,t){e===void 0&&(e=new Uint8Array(8)),t===void 0&&(t=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.setFloat64(t,r,!0),e}Me.writeFloat64LE=ew;var zr={};Object.defineProperty(zr,"__esModule",{value:!0});function tw(r){for(var e=0;e<r.length;e++)r[e]=0;return r}zr.wipe=tw,Object.defineProperty(Ia,"__esModule",{value:!0});var dr=Me,Ml=zr,rw=20;function nw(r,e,t){for(var n=1634760805,i=857760878,a=2036477234,c=1797285236,u=t[3]<<24|t[2]<<16|t[1]<<8|t[0],f=t[7]<<24|t[6]<<16|t[5]<<8|t[4],h=t[11]<<24|t[10]<<16|t[9]<<8|t[8],m=t[15]<<24|t[14]<<16|t[13]<<8|t[12],w=t[19]<<24|t[18]<<16|t[17]<<8|t[16],y=t[23]<<24|t[22]<<16|t[21]<<8|t[20],x=t[27]<<24|t[26]<<16|t[25]<<8|t[24],S=t[31]<<24|t[30]<<16|t[29]<<8|t[28],P=e[3]<<24|e[2]<<16|e[1]<<8|e[0],U=e[7]<<24|e[6]<<16|e[5]<<8|e[4],j=e[11]<<24|e[10]<<16|e[9]<<8|e[8],A=e[15]<<24|e[14]<<16|e[13]<<8|e[12],T=n,C=i,$=a,E=c,d=u,b=f,H=h,F=m,V=w,se=y,ce=x,I=S,N=P,X=U,ee=j,Y=A,J=0;J<rw;J+=2)T=T+d|0,N^=T,N=N>>>32-16|N<<16,V=V+N|0,d^=V,d=d>>>32-12|d<<12,C=C+b|0,X^=C,X=X>>>32-16|X<<16,se=se+X|0,b^=se,b=b>>>32-12|b<<12,$=$+H|0,ee^=$,ee=ee>>>32-16|ee<<16,ce=ce+ee|0,H^=ce,H=H>>>32-12|H<<12,E=E+F|0,Y^=E,Y=Y>>>32-16|Y<<16,I=I+Y|0,F^=I,F=F>>>32-12|F<<12,$=$+H|0,ee^=$,ee=ee>>>32-8|ee<<8,ce=ce+ee|0,H^=ce,H=H>>>32-7|H<<7,E=E+F|0,Y^=E,Y=Y>>>32-8|Y<<8,I=I+Y|0,F^=I,F=F>>>32-7|F<<7,C=C+b|0,X^=C,X=X>>>32-8|X<<8,se=se+X|0,b^=se,b=b>>>32-7|b<<7,T=T+d|0,N^=T,N=N>>>32-8|N<<8,V=V+N|0,d^=V,d=d>>>32-7|d<<7,T=T+b|0,Y^=T,Y=Y>>>32-16|Y<<16,ce=ce+Y|0,b^=ce,b=b>>>32-12|b<<12,C=C+H|0,N^=C,N=N>>>32-16|N<<16,I=I+N|0,H^=I,H=H>>>32-12|H<<12,$=$+F|0,X^=$,X=X>>>32-16|X<<16,V=V+X|0,F^=V,F=F>>>32-12|F<<12,E=E+d|0,ee^=E,ee=ee>>>32-16|ee<<16,se=se+ee|0,d^=se,d=d>>>32-12|d<<12,$=$+F|0,X^=$,X=X>>>32-8|X<<8,V=V+X|0,F^=V,F=F>>>32-7|F<<7,E=E+d|0,ee^=E,ee=ee>>>32-8|ee<<8,se=se+ee|0,d^=se,d=d>>>32-7|d<<7,C=C+H|0,N^=C,N=N>>>32-8|N<<8,I=I+N|0,H^=I,H=H>>>32-7|H<<7,T=T+b|0,Y^=T,Y=Y>>>32-8|Y<<8,ce=ce+Y|0,b^=ce,b=b>>>32-7|b<<7;dr.writeUint32LE(T+n|0,r,0),dr.writeUint32LE(C+i|0,r,4),dr.writeUint32LE($+a|0,r,8),dr.writeUint32LE(E+c|0,r,12),dr.writeUint32LE(d+u|0,r,16),dr.writeUint32LE(b+f|0,r,20),dr.writeUint32LE(H+h|0,r,24),dr.writeUint32LE(F+m|0,r,28),dr.writeUint32LE(V+w|0,r,32),dr.writeUint32LE(se+y|0,r,36),dr.writeUint32LE(ce+x|0,r,40),dr.writeUint32LE(I+S|0,r,44),dr.writeUint32LE(N+P|0,r,48),dr.writeUint32LE(X+U|0,r,52),dr.writeUint32LE(ee+j|0,r,56),dr.writeUint32LE(Y+A|0,r,60)}function Yd(r,e,t,n,i){if(i===void 0&&(i=0),r.length!==32)throw new Error("ChaCha: key size must be 32 bytes");if(n.length<t.length)throw new Error("ChaCha: destination is shorter than source");var a,c;if(i===0){if(e.length!==8&&e.length!==12)throw new Error("ChaCha nonce must be 8 or 12 bytes");a=new Uint8Array(16),c=a.length-e.length,a.set(e,c)}else{if(e.length!==16)throw new Error("ChaCha nonce with counter must be 16 bytes");a=e,c=i}for(var u=new Uint8Array(64),f=0;f<t.length;f+=64){nw(u,a,r);for(var h=f;h<f+64&&h<t.length;h++)n[h]=t[h]^u[h-f];sw(a,0,c)}return Ml.wipe(u),i===0&&Ml.wipe(a),n}Ia.streamXOR=Yd;function iw(r,e,t,n){return n===void 0&&(n=0),Ml.wipe(t),Yd(r,e,t,t,n)}Ia.stream=iw;function sw(r,e,t){for(var n=1;t--;)n=n+(r[e]&255)|0,r[e]=n&255,n>>>=8,e++;if(n>0)throw new Error("ChaCha: counter overflow")}var Jd={},ni={};Object.defineProperty(ni,"__esModule",{value:!0});function ow(r,e,t){return~(r-1)&e|r-1&t}ni.select=ow;function aw(r,e){return(r|0)-(e|0)-1>>>31&1}ni.lessOrEqual=aw;function Zd(r,e){if(r.length!==e.length)return 0;for(var t=0,n=0;n<r.length;n++)t|=r[n]^e[n];return 1&t-1>>>8}ni.compare=Zd;function cw(r,e){return r.length===0||e.length===0?!1:Zd(r,e)!==0}ni.equal=cw,function(r){Object.defineProperty(r,"__esModule",{value:!0});var e=ni,t=zr;r.DIGEST_LENGTH=16;var n=function(){function c(u){this.digestLength=r.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 f=u[0]|u[1]<<8;this._r[0]=f&8191;var h=u[2]|u[3]<<8;this._r[1]=(f>>>13|h<<3)&8191;var m=u[4]|u[5]<<8;this._r[2]=(h>>>10|m<<6)&7939;var w=u[6]|u[7]<<8;this._r[3]=(m>>>7|w<<9)&8191;var y=u[8]|u[9]<<8;this._r[4]=(w>>>4|y<<12)&255,this._r[5]=y>>>1&8190;var x=u[10]|u[11]<<8;this._r[6]=(y>>>14|x<<2)&8191;var S=u[12]|u[13]<<8;this._r[7]=(x>>>11|S<<5)&8065;var P=u[14]|u[15]<<8;this._r[8]=(S>>>8|P<<8)&8191,this._r[9]=P>>>5&127,this._pad[0]=u[16]|u[17]<<8,this._pad[1]=u[18]|u[19]<<8,this._pad[2]=u[20]|u[21]<<8,this._pad[3]=u[22]|u[23]<<8,this._pad[4]=u[24]|u[25]<<8,this._pad[5]=u[26]|u[27]<<8,this._pad[6]=u[28]|u[29]<<8,this._pad[7]=u[30]|u[31]<<8}return c.prototype._blocks=function(u,f,h){for(var m=this._fin?0:2048,w=this._h[0],y=this._h[1],x=this._h[2],S=this._h[3],P=this._h[4],U=this._h[5],j=this._h[6],A=this._h[7],T=this._h[8],C=this._h[9],$=this._r[0],E=this._r[1],d=this._r[2],b=this._r[3],H=this._r[4],F=this._r[5],V=this._r[6],se=this._r[7],ce=this._r[8],I=this._r[9];h>=16;){var N=u[f+0]|u[f+1]<<8;w+=N&8191;var X=u[f+2]|u[f+3]<<8;y+=(N>>>13|X<<3)&8191;var ee=u[f+4]|u[f+5]<<8;x+=(X>>>10|ee<<6)&8191;var Y=u[f+6]|u[f+7]<<8;S+=(ee>>>7|Y<<9)&8191;var J=u[f+8]|u[f+9]<<8;P+=(Y>>>4|J<<12)&8191,U+=J>>>1&8191;var Q=u[f+10]|u[f+11]<<8;j+=(J>>>14|Q<<2)&8191;var ie=u[f+12]|u[f+13]<<8;A+=(Q>>>11|ie<<5)&8191;var Ee=u[f+14]|u[f+15]<<8;T+=(ie>>>8|Ee<<8)&8191,C+=Ee>>>5|m;var ae=0,xe=ae;xe+=w*$,xe+=y*(5*I),xe+=x*(5*ce),xe+=S*(5*se),xe+=P*(5*V),ae=xe>>>13,xe&=8191,xe+=U*(5*F),xe+=j*(5*H),xe+=A*(5*b),xe+=T*(5*d),xe+=C*(5*E),ae+=xe>>>13,xe&=8191;var de=ae;de+=w*E,de+=y*$,de+=x*(5*I),de+=S*(5*ce),de+=P*(5*se),ae=de>>>13,de&=8191,de+=U*(5*V),de+=j*(5*F),de+=A*(5*H),de+=T*(5*b),de+=C*(5*d),ae+=de>>>13,de&=8191;var be=ae;be+=w*d,be+=y*E,be+=x*$,be+=S*(5*I),be+=P*(5*ce),ae=be>>>13,be&=8191,be+=U*(5*se),be+=j*(5*V),be+=A*(5*F),be+=T*(5*H),be+=C*(5*b),ae+=be>>>13,be&=8191;var K=ae;K+=w*b,K+=y*d,K+=x*E,K+=S*$,K+=P*(5*I),ae=K>>>13,K&=8191,K+=U*(5*ce),K+=j*(5*se),K+=A*(5*V),K+=T*(5*F),K+=C*(5*H),ae+=K>>>13,K&=8191;var W=ae;W+=w*H,W+=y*b,W+=x*d,W+=S*E,W+=P*$,ae=W>>>13,W&=8191,W+=U*(5*I),W+=j*(5*ce),W+=A*(5*se),W+=T*(5*V),W+=C*(5*F),ae+=W>>>13,W&=8191;var B=ae;B+=w*F,B+=y*H,B+=x*b,B+=S*d,B+=P*E,ae=B>>>13,B&=8191,B+=U*$,B+=j*(5*I),B+=A*(5*ce),B+=T*(5*se),B+=C*(5*V),ae+=B>>>13,B&=8191;var g=ae;g+=w*V,g+=y*F,g+=x*H,g+=S*b,g+=P*d,ae=g>>>13,g&=8191,g+=U*E,g+=j*$,g+=A*(5*I),g+=T*(5*ce),g+=C*(5*se),ae+=g>>>13,g&=8191;var L=ae;L+=w*se,L+=y*V,L+=x*F,L+=S*H,L+=P*b,ae=L>>>13,L&=8191,L+=U*d,L+=j*E,L+=A*$,L+=T*(5*I),L+=C*(5*ce),ae+=L>>>13,L&=8191;var le=ae;le+=w*ce,le+=y*se,le+=x*V,le+=S*F,le+=P*H,ae=le>>>13,le&=8191,le+=U*b,le+=j*d,le+=A*E,le+=T*$,le+=C*(5*I),ae+=le>>>13,le&=8191;var pe=ae;pe+=w*I,pe+=y*ce,pe+=x*se,pe+=S*V,pe+=P*F,ae=pe>>>13,pe&=8191,pe+=U*H,pe+=j*b,pe+=A*d,pe+=T*E,pe+=C*$,ae+=pe>>>13,pe&=8191,ae=(ae<<2)+ae|0,ae=ae+xe|0,xe=ae&8191,ae=ae>>>13,de+=ae,w=xe,y=de,x=be,S=K,P=W,U=B,j=g,A=L,T=le,C=pe,f+=16,h-=16}this._h[0]=w,this._h[1]=y,this._h[2]=x,this._h[3]=S,this._h[4]=P,this._h[5]=U,this._h[6]=j,this._h[7]=A,this._h[8]=T,this._h[9]=C},c.prototype.finish=function(u,f){f===void 0&&(f=0);var h=new Uint16Array(10),m,w,y,x;if(this._leftover){for(x=this._leftover,this._buffer[x++]=1;x<16;x++)this._buffer[x]=0;this._fin=1,this._blocks(this._buffer,0,16)}for(m=this._h[1]>>>13,this._h[1]&=8191,x=2;x<10;x++)this._h[x]+=m,m=this._h[x]>>>13,this._h[x]&=8191;for(this._h[0]+=m*5,m=this._h[0]>>>13,this._h[0]&=8191,this._h[1]+=m,m=this._h[1]>>>13,this._h[1]&=8191,this._h[2]+=m,h[0]=this._h[0]+5,m=h[0]>>>13,h[0]&=8191,x=1;x<10;x++)h[x]=this._h[x]+m,m=h[x]>>>13,h[x]&=8191;for(h[9]-=8192,w=(m^1)-1,x=0;x<10;x++)h[x]&=w;for(w=~w,x=0;x<10;x++)this._h[x]=this._h[x]&w|h[x];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,x=1;x<8;x++)y=(this._h[x]+this._pad[x]|0)+(y>>>16)|0,this._h[x]=y&65535;return u[f+0]=this._h[0]>>>0,u[f+1]=this._h[0]>>>8,u[f+2]=this._h[1]>>>0,u[f+3]=this._h[1]>>>8,u[f+4]=this._h[2]>>>0,u[f+5]=this._h[2]>>>8,u[f+6]=this._h[3]>>>0,u[f+7]=this._h[3]>>>8,u[f+8]=this._h[4]>>>0,u[f+9]=this._h[4]>>>8,u[f+10]=this._h[5]>>>0,u[f+11]=this._h[5]>>>8,u[f+12]=this._h[6]>>>0,u[f+13]=this._h[6]>>>8,u[f+14]=this._h[7]>>>0,u[f+15]=this._h[7]>>>8,this._finished=!0,this},c.prototype.update=function(u){var f=0,h=u.length,m;if(this._leftover){m=16-this._leftover,m>h&&(m=h);for(var w=0;w<m;w++)this._buffer[this._leftover+w]=u[f+w];if(h-=m,f+=m,this._leftover+=m,this._leftover<16)return this;this._blocks(this._buffer,0,16),this._leftover=0}if(h>=16&&(m=h-h%16,this._blocks(u,f,m),f+=m,h-=m),h){for(var w=0;w<h;w++)this._buffer[this._leftover+w]=u[f+w];this._leftover+=h}return this},c.prototype.digest=function(){if(this._finished)throw new Error("Poly1305 was finished");var u=new Uint8Array(16);return this.finish(u),u},c.prototype.clean=function(){return t.wipe(this._buffer),t.wipe(this._r),t.wipe(this._h),t.wipe(this._pad),this._leftover=0,this._fin=0,this._finished=!0,this},c}();r.Poly1305=n;function i(c,u){var f=new n(c);f.update(u);var h=f.digest();return f.clean(),h}r.oneTimeAuth=i;function a(c,u){return c.length!==r.DIGEST_LENGTH||u.length!==r.DIGEST_LENGTH?!1:e.equal(c,u)}r.equal=a}(Jd),function(r){Object.defineProperty(r,"__esModule",{value:!0});var e=Ia,t=Jd,n=zr,i=Me,a=ni;r.KEY_LENGTH=32,r.NONCE_LENGTH=12,r.TAG_LENGTH=16;var c=new Uint8Array(16),u=function(){function f(h){if(this.nonceLength=r.NONCE_LENGTH,this.tagLength=r.TAG_LENGTH,h.length!==r.KEY_LENGTH)throw new Error("ChaCha20Poly1305 needs 32-byte key");this._key=new Uint8Array(h)}return f.prototype.seal=function(h,m,w,y){if(h.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");var x=new Uint8Array(16);x.set(h,x.length-h.length);var S=new Uint8Array(32);e.stream(this._key,x,S,4);var P=m.length+this.tagLength,U;if(y){if(y.length!==P)throw new Error("ChaCha20Poly1305: incorrect destination length");U=y}else U=new Uint8Array(P);return e.streamXOR(this._key,x,m,U,4),this._authenticate(U.subarray(U.length-this.tagLength,U.length),S,U.subarray(0,U.length-this.tagLength),w),n.wipe(x),U},f.prototype.open=function(h,m,w,y){if(h.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");if(m.length<this.tagLength)return null;var x=new Uint8Array(16);x.set(h,x.length-h.length);var S=new Uint8Array(32);e.stream(this._key,x,S,4);var P=new Uint8Array(this.tagLength);if(this._authenticate(P,S,m.subarray(0,m.length-this.tagLength),w),!a.equal(P,m.subarray(m.length-this.tagLength,m.length)))return null;var U=m.length-this.tagLength,j;if(y){if(y.length!==U)throw new Error("ChaCha20Poly1305: incorrect destination length");j=y}else j=new Uint8Array(U);return e.streamXOR(this._key,x,m.subarray(0,m.length-this.tagLength),j,4),n.wipe(x),j},f.prototype.clean=function(){return n.wipe(this._key),this},f.prototype._authenticate=function(h,m,w,y){var x=new t.Poly1305(m);y&&(x.update(y),y.length%16>0&&x.update(c.subarray(y.length%16))),x.update(w),w.length%16>0&&x.update(c.subarray(w.length%16));var S=new Uint8Array(8);y&&i.writeUint64LE(y.length,S),x.update(S),i.writeUint64LE(w.length,S),x.update(S);for(var P=x.digest(),U=0;U<P.length;U++)h[U]=P[U];x.clean(),n.wipe(P),n.wipe(S)},f}();r.ChaCha20Poly1305=u}(Pl);var Qd={},fo={},Ul={};Object.defineProperty(Ul,"__esModule",{value:!0});function lw(r){return typeof r.saveState<"u"&&typeof r.restoreState<"u"&&typeof r.cleanSavedState<"u"}Ul.isSerializableHash=lw,Object.defineProperty(fo,"__esModule",{value:!0});var _n=Ul,uw=ni,hw=zr,Xd=function(){function r(e,t){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);t.length>this.blockSize?this._inner.update(t).finish(n).clean():n.set(t);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),_n.isSerializableHash(this._inner)&&_n.isSerializableHash(this._outer)&&(this._innerKeyedState=this._inner.saveState(),this._outerKeyedState=this._outer.saveState()),hw.wipe(n)}return r.prototype.reset=function(){if(!_n.isSerializableHash(this._inner)||!_n.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},r.prototype.clean=function(){_n.isSerializableHash(this._inner)&&this._inner.cleanSavedState(this._innerKeyedState),_n.isSerializableHash(this._outer)&&this._outer.cleanSavedState(this._outerKeyedState),this._inner.clean(),this._outer.clean()},r.prototype.update=function(e){return this._inner.update(e),this},r.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)},r.prototype.digest=function(){var e=new Uint8Array(this.digestLength);return this.finish(e),e},r.prototype.saveState=function(){if(!_n.isSerializableHash(this._inner))throw new Error("hmac: can't saveState() because hash doesn't implement it");return this._inner.saveState()},r.prototype.restoreState=function(e){if(!_n.isSerializableHash(this._inner)||!_n.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},r.prototype.cleanSavedState=function(e){if(!_n.isSerializableHash(this._inner))throw new Error("hmac: can't cleanSavedState() because hash doesn't implement it");this._inner.cleanSavedState(e)},r}();fo.HMAC=Xd;function fw(r,e,t){var n=new Xd(r,e);n.update(t);var i=n.digest();return n.clean(),i}fo.hmac=fw,fo.equal=uw.equal,Object.defineProperty(Qd,"__esModule",{value:!0});var e0=fo,t0=zr,dw=function(){function r(e,t,n,i){n===void 0&&(n=new Uint8Array(0)),this._counter=new Uint8Array(1),this._hash=e,this._info=i;var a=e0.hmac(this._hash,n,t);this._hmac=new e0.HMAC(e,a),this._buffer=new Uint8Array(this._hmac.digestLength),this._bufpos=this._buffer.length}return r.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},r.prototype.expand=function(e){for(var t=new Uint8Array(e),n=0;n<t.length;n++)this._bufpos===this._buffer.length&&this._fillBuffer(),t[n]=this._buffer[this._bufpos++];return t},r.prototype.clean=function(){this._hmac.clean(),t0.wipe(this._buffer),t0.wipe(this._counter),this._bufpos=0},r}(),pw=Qd.HKDF=dw,vs={},Ca={},Oa={};Object.defineProperty(Oa,"__esModule",{value:!0}),Oa.BrowserRandomSource=void 0;const r0=65536;class gw{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 t=new Uint8Array(e);for(let n=0;n<t.length;n+=r0)this._crypto.getRandomValues(t.subarray(n,n+Math.min(t.length-n,r0)));return t}}Oa.BrowserRandomSource=gw;function mw(r){throw new Error('Could not dynamically require "'+r+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var $a={},vw={},yw=Object.freeze({__proto__:null,default:vw}),ww=Pi(yw);Object.defineProperty($a,"__esModule",{value:!0}),$a.NodeRandomSource=void 0;const bw=zr;class _w{constructor(){if(this.isAvailable=!1,this.isInstantiated=!1,typeof mw<"u"){const e=ww;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 t=this._crypto.randomBytes(e);if(t.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]=t[i];return(0,bw.wipe)(t),n}}$a.NodeRandomSource=_w,Object.defineProperty(Ca,"__esModule",{value:!0}),Ca.SystemRandomSource=void 0;const Ew=Oa,xw=$a;class Iw{constructor(){if(this.isAvailable=!1,this.name="",this._source=new Ew.BrowserRandomSource,this._source.isAvailable){this.isAvailable=!0,this.name="Browser";return}if(this._source=new xw.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)}}Ca.SystemRandomSource=Iw,function(r){Object.defineProperty(r,"__esModule",{value:!0}),r.randomStringForEntropy=r.randomString=r.randomUint32=r.randomBytes=r.defaultRandomSource=void 0;const e=Ca,t=Me,n=zr;r.defaultRandomSource=new e.SystemRandomSource;function i(h,m=r.defaultRandomSource){return m.randomBytes(h)}r.randomBytes=i;function a(h=r.defaultRandomSource){const m=i(4,h),w=(0,t.readUint32LE)(m);return(0,n.wipe)(m),w}r.randomUint32=a;const c="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";function u(h,m=c,w=r.defaultRandomSource){if(m.length<2)throw new Error("randomString charset is too short");if(m.length>256)throw new Error("randomString charset is too long");let y="";const x=m.length,S=256-256%x;for(;h>0;){const P=i(Math.ceil(h*256/S),w);for(let U=0;U<P.length&&h>0;U++){const j=P[U];j<S&&(y+=m.charAt(j%x),h--)}(0,n.wipe)(P)}return y}r.randomString=u;function f(h,m=c,w=r.defaultRandomSource){const y=Math.ceil(h/(Math.log(m.length)/Math.LN2));return u(y,m,w)}r.randomStringForEntropy=f}(vs);var Aa={};(function(r){Object.defineProperty(r,"__esModule",{value:!0});var e=Me,t=zr;r.DIGEST_LENGTH=32,r.BLOCK_SIZE=64;var n=function(){function u(){this.digestLength=r.DIGEST_LENGTH,this.blockSize=r.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 u.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},u.prototype.reset=function(){return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this},u.prototype.clean=function(){t.wipe(this._buffer),t.wipe(this._temp),this.reset()},u.prototype.update=function(f,h){if(h===void 0&&(h=f.length),this._finished)throw new Error("SHA256: can't update because hash was finished.");var m=0;if(this._bytesHashed+=h,this._bufferLength>0){for(;this._bufferLength<this.blockSize&&h>0;)this._buffer[this._bufferLength++]=f[m++],h--;this._bufferLength===this.blockSize&&(a(this._temp,this._state,this._buffer,0,this.blockSize),this._bufferLength=0)}for(h>=this.blockSize&&(m=a(this._temp,this._state,f,m,h),h%=this.blockSize);h>0;)this._buffer[this._bufferLength++]=f[m++],h--;return this},u.prototype.finish=function(f){if(!this._finished){var h=this._bytesHashed,m=this._bufferLength,w=h/536870912|0,y=h<<3,x=h%64<56?64:128;this._buffer[m]=128;for(var S=m+1;S<x-8;S++)this._buffer[S]=0;e.writeUint32BE(w,this._buffer,x-8),e.writeUint32BE(y,this._buffer,x-4),a(this._temp,this._state,this._buffer,0,x),this._finished=!0}for(var S=0;S<this.digestLength/4;S++)e.writeUint32BE(this._state[S],f,S*4);return this},u.prototype.digest=function(){var f=new Uint8Array(this.digestLength);return this.finish(f),f},u.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}},u.prototype.restoreState=function(f){return this._state.set(f.state),this._bufferLength=f.bufferLength,f.buffer&&this._buffer.set(f.buffer),this._bytesHashed=f.bytesHashed,this._finished=!1,this},u.prototype.cleanSavedState=function(f){t.wipe(f.state),f.buffer&&t.wipe(f.buffer),f.bufferLength=0,f.bytesHashed=0},u}();r.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 a(u,f,h,m,w){for(;w>=64;){for(var y=f[0],x=f[1],S=f[2],P=f[3],U=f[4],j=f[5],A=f[6],T=f[7],C=0;C<16;C++){var $=m+C*4;u[C]=e.readUint32BE(h,$)}for(var C=16;C<64;C++){var E=u[C-2],d=(E>>>17|E<<32-17)^(E>>>19|E<<32-19)^E>>>10;E=u[C-15];var b=(E>>>7|E<<32-7)^(E>>>18|E<<32-18)^E>>>3;u[C]=(d+u[C-7]|0)+(b+u[C-16]|0)}for(var C=0;C<64;C++){var d=(((U>>>6|U<<26)^(U>>>11|U<<21)^(U>>>25|U<<7))+(U&j^~U&A)|0)+(T+(i[C]+u[C]|0)|0)|0,b=((y>>>2|y<<32-2)^(y>>>13|y<<32-13)^(y>>>22|y<<32-22))+(y&x^y&S^x&S)|0;T=A,A=j,j=U,U=P+d|0,P=S,S=x,x=y,y=d+b|0}f[0]+=y,f[1]+=x,f[2]+=S,f[3]+=P,f[4]+=U,f[5]+=j,f[6]+=A,f[7]+=T,m+=64,w-=64}return m}function c(u){var f=new n;f.update(u);var h=f.digest();return f.clean(),h}r.hash=c})(Aa);var jl={};(function(r){Object.defineProperty(r,"__esModule",{value:!0}),r.sharedKey=r.generateKeyPair=r.generateKeyPairFromSeed=r.scalarMultBase=r.scalarMult=r.SHARED_KEY_LENGTH=r.SECRET_KEY_LENGTH=r.PUBLIC_KEY_LENGTH=void 0;const e=vs,t=zr;r.PUBLIC_KEY_LENGTH=32,r.SECRET_KEY_LENGTH=32,r.SHARED_KEY_LENGTH=32;function n(C){const $=new Float64Array(16);if(C)for(let E=0;E<C.length;E++)$[E]=C[E];return $}const i=new Uint8Array(32);i[0]=9;const a=n([56129,1]);function c(C){let $=1;for(let E=0;E<16;E++){let d=C[E]+$+65535;$=Math.floor(d/65536),C[E]=d-$*65536}C[0]+=$-1+37*($-1)}function u(C,$,E){const d=~(E-1);for(let b=0;b<16;b++){const H=d&(C[b]^$[b]);C[b]^=H,$[b]^=H}}function f(C,$){const E=n(),d=n();for(let b=0;b<16;b++)d[b]=$[b];c(d),c(d),c(d);for(let b=0;b<2;b++){E[0]=d[0]-65517;for(let F=1;F<15;F++)E[F]=d[F]-65535-(E[F-1]>>16&1),E[F-1]&=65535;E[15]=d[15]-32767-(E[14]>>16&1);const H=E[15]>>16&1;E[14]&=65535,u(d,E,1-H)}for(let b=0;b<16;b++)C[2*b]=d[b]&255,C[2*b+1]=d[b]>>8}function h(C,$){for(let E=0;E<16;E++)C[E]=$[2*E]+($[2*E+1]<<8);C[15]&=32767}function m(C,$,E){for(let d=0;d<16;d++)C[d]=$[d]+E[d]}function w(C,$,E){for(let d=0;d<16;d++)C[d]=$[d]-E[d]}function y(C,$,E){let d,b,H=0,F=0,V=0,se=0,ce=0,I=0,N=0,X=0,ee=0,Y=0,J=0,Q=0,ie=0,Ee=0,ae=0,xe=0,de=0,be=0,K=0,W=0,B=0,g=0,L=0,le=0,pe=0,Ce=0,Ke=0,Je=0,ke=0,St=0,Ct=0,ze=E[0],Oe=E[1],Ue=E[2],je=E[3],He=E[4],Ae=E[5],Fe=E[6],Se=E[7],Te=E[8],Ve=E[9],$e=E[10],Ze=E[11],et=E[12],at=E[13],ct=E[14],nt=E[15];d=$[0],H+=d*ze,F+=d*Oe,V+=d*Ue,se+=d*je,ce+=d*He,I+=d*Ae,N+=d*Fe,X+=d*Se,ee+=d*Te,Y+=d*Ve,J+=d*$e,Q+=d*Ze,ie+=d*et,Ee+=d*at,ae+=d*ct,xe+=d*nt,d=$[1],F+=d*ze,V+=d*Oe,se+=d*Ue,ce+=d*je,I+=d*He,N+=d*Ae,X+=d*Fe,ee+=d*Se,Y+=d*Te,J+=d*Ve,Q+=d*$e,ie+=d*Ze,Ee+=d*et,ae+=d*at,xe+=d*ct,de+=d*nt,d=$[2],V+=d*ze,se+=d*Oe,ce+=d*Ue,I+=d*je,N+=d*He,X+=d*Ae,ee+=d*Fe,Y+=d*Se,J+=d*Te,Q+=d*Ve,ie+=d*$e,Ee+=d*Ze,ae+=d*et,xe+=d*at,de+=d*ct,be+=d*nt,d=$[3],se+=d*ze,ce+=d*Oe,I+=d*Ue,N+=d*je,X+=d*He,ee+=d*Ae,Y+=d*Fe,J+=d*Se,Q+=d*Te,ie+=d*Ve,Ee+=d*$e,ae+=d*Ze,xe+=d*et,de+=d*at,be+=d*ct,K+=d*nt,d=$[4],ce+=d*ze,I+=d*Oe,N+=d*Ue,X+=d*je,ee+=d*He,Y+=d*Ae,J+=d*Fe,Q+=d*Se,ie+=d*Te,Ee+=d*Ve,ae+=d*$e,xe+=d*Ze,de+=d*et,be+=d*at,K+=d*ct,W+=d*nt,d=$[5],I+=d*ze,N+=d*Oe,X+=d*Ue,ee+=d*je,Y+=d*He,J+=d*Ae,Q+=d*Fe,ie+=d*Se,Ee+=d*Te,ae+=d*Ve,xe+=d*$e,de+=d*Ze,be+=d*et,K+=d*at,W+=d*ct,B+=d*nt,d=$[6],N+=d*ze,X+=d*Oe,ee+=d*Ue,Y+=d*je,J+=d*He,Q+=d*Ae,ie+=d*Fe,Ee+=d*Se,ae+=d*Te,xe+=d*Ve,de+=d*$e,be+=d*Ze,K+=d*et,W+=d*at,B+=d*ct,g+=d*nt,d=$[7],X+=d*ze,ee+=d*Oe,Y+=d*Ue,J+=d*je,Q+=d*He,ie+=d*Ae,Ee+=d*Fe,ae+=d*Se,xe+=d*Te,de+=d*Ve,be+=d*$e,K+=d*Ze,W+=d*et,B+=d*at,g+=d*ct,L+=d*nt,d=$[8],ee+=d*ze,Y+=d*Oe,J+=d*Ue,Q+=d*je,ie+=d*He,Ee+=d*Ae,ae+=d*Fe,xe+=d*Se,de+=d*Te,be+=d*Ve,K+=d*$e,W+=d*Ze,B+=d*et,g+=d*at,L+=d*ct,le+=d*nt,d=$[9],Y+=d*ze,J+=d*Oe,Q+=d*Ue,ie+=d*je,Ee+=d*He,ae+=d*Ae,xe+=d*Fe,de+=d*Se,be+=d*Te,K+=d*Ve,W+=d*$e,B+=d*Ze,g+=d*et,L+=d*at,le+=d*ct,pe+=d*nt,d=$[10],J+=d*ze,Q+=d*Oe,ie+=d*Ue,Ee+=d*je,ae+=d*He,xe+=d*Ae,de+=d*Fe,be+=d*Se,K+=d*Te,W+=d*Ve,B+=d*$e,g+=d*Ze,L+=d*et,le+=d*at,pe+=d*ct,Ce+=d*nt,d=$[11],Q+=d*ze,ie+=d*Oe,Ee+=d*Ue,ae+=d*je,xe+=d*He,de+=d*Ae,be+=d*Fe,K+=d*Se,W+=d*Te,B+=d*Ve,g+=d*$e,L+=d*Ze,le+=d*et,pe+=d*at,Ce+=d*ct,Ke+=d*nt,d=$[12],ie+=d*ze,Ee+=d*Oe,ae+=d*Ue,xe+=d*je,de+=d*He,be+=d*Ae,K+=d*Fe,W+=d*Se,B+=d*Te,g+=d*Ve,L+=d*$e,le+=d*Ze,pe+=d*et,Ce+=d*at,Ke+=d*ct,Je+=d*nt,d=$[13],Ee+=d*ze,ae+=d*Oe,xe+=d*Ue,de+=d*je,be+=d*He,K+=d*Ae,W+=d*Fe,B+=d*Se,g+=d*Te,L+=d*Ve,le+=d*$e,pe+=d*Ze,Ce+=d*et,Ke+=d*at,Je+=d*ct,ke+=d*nt,d=$[14],ae+=d*ze,xe+=d*Oe,de+=d*Ue,be+=d*je,K+=d*He,W+=d*Ae,B+=d*Fe,g+=d*Se,L+=d*Te,le+=d*Ve,pe+=d*$e,Ce+=d*Ze,Ke+=d*et,Je+=d*at,ke+=d*ct,St+=d*nt,d=$[15],xe+=d*ze,de+=d*Oe,be+=d*Ue,K+=d*je,W+=d*He,B+=d*Ae,g+=d*Fe,L+=d*Se,le+=d*Te,pe+=d*Ve,Ce+=d*$e,Ke+=d*Ze,Je+=d*et,ke+=d*at,St+=d*ct,Ct+=d*nt,H+=38*de,F+=38*be,V+=38*K,se+=38*W,ce+=38*B,I+=38*g,N+=38*L,X+=38*le,ee+=38*pe,Y+=38*Ce,J+=38*Ke,Q+=38*Je,ie+=38*ke,Ee+=38*St,ae+=38*Ct,b=1,d=H+b+65535,b=Math.floor(d/65536),H=d-b*65536,d=F+b+65535,b=Math.floor(d/65536),F=d-b*65536,d=V+b+65535,b=Math.floor(d/65536),V=d-b*65536,d=se+b+65535,b=Math.floor(d/65536),se=d-b*65536,d=ce+b+65535,b=Math.floor(d/65536),ce=d-b*65536,d=I+b+65535,b=Math.floor(d/65536),I=d-b*65536,d=N+b+65535,b=Math.floor(d/65536),N=d-b*65536,d=X+b+65535,b=Math.floor(d/65536),X=d-b*65536,d=ee+b+65535,b=Math.floor(d/65536),ee=d-b*65536,d=Y+b+65535,b=Math.floor(d/65536),Y=d-b*65536,d=J+b+65535,b=Math.floor(d/65536),J=d-b*65536,d=Q+b+65535,b=Math.floor(d/65536),Q=d-b*65536,d=ie+b+65535,b=Math.floor(d/65536),ie=d-b*65536,d=Ee+b+65535,b=Math.floor(d/65536),Ee=d-b*65536,d=ae+b+65535,b=Math.floor(d/65536),ae=d-b*65536,d=xe+b+65535,b=Math.floor(d/65536),xe=d-b*65536,H+=b-1+37*(b-1),b=1,d=H+b+65535,b=Math.floor(d/65536),H=d-b*65536,d=F+b+65535,b=Math.floor(d/65536),F=d-b*65536,d=V+b+65535,b=Math.floor(d/65536),V=d-b*65536,d=se+b+65535,b=Math.floor(d/65536),se=d-b*65536,d=ce+b+65535,b=Math.floor(d/65536),ce=d-b*65536,d=I+b+65535,b=Math.floor(d/65536),I=d-b*65536,d=N+b+65535,b=Math.floor(d/65536),N=d-b*65536,d=X+b+65535,b=Math.floor(d/65536),X=d-b*65536,d=ee+b+65535,b=Math.floor(d/65536),ee=d-b*65536,d=Y+b+65535,b=Math.floor(d/65536),Y=d-b*65536,d=J+b+65535,b=Math.floor(d/65536),J=d-b*65536,d=Q+b+65535,b=Math.floor(d/65536),Q=d-b*65536,d=ie+b+65535,b=Math.floor(d/65536),ie=d-b*65536,d=Ee+b+65535,b=Math.floor(d/65536),Ee=d-b*65536,d=ae+b+65535,b=Math.floor(d/65536),ae=d-b*65536,d=xe+b+65535,b=Math.floor(d/65536),xe=d-b*65536,H+=b-1+37*(b-1),C[0]=H,C[1]=F,C[2]=V,C[3]=se,C[4]=ce,C[5]=I,C[6]=N,C[7]=X,C[8]=ee,C[9]=Y,C[10]=J,C[11]=Q,C[12]=ie,C[13]=Ee,C[14]=ae,C[15]=xe}function x(C,$){y(C,$,$)}function S(C,$){const E=n();for(let d=0;d<16;d++)E[d]=$[d];for(let d=253;d>=0;d--)x(E,E),d!==2&&d!==4&&y(E,E,$);for(let d=0;d<16;d++)C[d]=E[d]}function P(C,$){const E=new Uint8Array(32),d=new Float64Array(80),b=n(),H=n(),F=n(),V=n(),se=n(),ce=n();for(let ee=0;ee<31;ee++)E[ee]=C[ee];E[31]=C[31]&127|64,E[0]&=248,h(d,$);for(let ee=0;ee<16;ee++)H[ee]=d[ee];b[0]=V[0]=1;for(let ee=254;ee>=0;--ee){const Y=E[ee>>>3]>>>(ee&7)&1;u(b,H,Y),u(F,V,Y),m(se,b,F),w(b,b,F),m(F,H,V),w(H,H,V),x(V,se),x(ce,b),y(b,F,b),y(F,H,se),m(se,b,F),w(b,b,F),x(H,b),w(F,V,ce),y(b,F,a),m(b,b,V),y(F,F,b),y(b,V,ce),y(V,H,d),x(H,se),u(b,H,Y),u(F,V,Y)}for(let ee=0;ee<16;ee++)d[ee+16]=b[ee],d[ee+32]=F[ee],d[ee+48]=H[ee],d[ee+64]=V[ee];const I=d.subarray(32),N=d.subarray(16);S(I,I),y(N,N,I);const X=new Uint8Array(32);return f(X,N),X}r.scalarMult=P;function U(C){return P(C,i)}r.scalarMultBase=U;function j(C){if(C.length!==r.SECRET_KEY_LENGTH)throw new Error(`x25519: seed must be ${r.SECRET_KEY_LENGTH} bytes`);const $=new Uint8Array(C);return{publicKey:U($),secretKey:$}}r.generateKeyPairFromSeed=j;function A(C){const $=(0,e.randomBytes)(32,C),E=j($);return(0,t.wipe)($),E}r.generateKeyPair=A;function T(C,$,E=!1){if(C.length!==r.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect secret key length");if($.length!==r.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect public key length");const d=P(C,$);if(E){let b=0;for(let H=0;H<d.length;H++)b|=d[H];if(b===0)throw new Error("X25519: invalid shared key")}return d}r.sharedKey=T})(jl);function Fl(r){return globalThis.Buffer!=null?new Uint8Array(r.buffer,r.byteOffset,r.byteLength):r}function n0(r=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?Fl(globalThis.Buffer.allocUnsafe(r)):new Uint8Array(r)}function Bl(r,e){e||(e=r.reduce((i,a)=>i+a.length,0));const t=n0(e);let n=0;for(const i of r)t.set(i,n),n+=i.length;return Fl(t)}function Dw(r,e){if(r.length>=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),n=0;n<t.length;n++)t[n]=255;for(var i=0;i<r.length;i++){var a=r.charAt(i),c=a.charCodeAt(0);if(t[c]!==255)throw new TypeError(a+" is ambiguous");t[c]=i}var u=r.length,f=r.charAt(0),h=Math.log(u)/Math.log(256),m=Math.log(256)/Math.log(u);function w(S){if(S instanceof Uint8Array||(ArrayBuffer.isView(S)?S=new Uint8Array(S.buffer,S.byteOffset,S.byteLength):Array.isArray(S)&&(S=Uint8Array.from(S))),!(S instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(S.length===0)return"";for(var P=0,U=0,j=0,A=S.length;j!==A&&S[j]===0;)j++,P++;for(var T=(A-j)*m+1>>>0,C=new Uint8Array(T);j!==A;){for(var $=S[j],E=0,d=T-1;($!==0||E<U)&&d!==-1;d--,E++)$+=256*C[d]>>>0,C[d]=$%u>>>0,$=$/u>>>0;if($!==0)throw new Error("Non-zero carry");U=E,j++}for(var b=T-U;b!==T&&C[b]===0;)b++;for(var H=f.repeat(P);b<T;++b)H+=r.charAt(C[b]);return H}function y(S){if(typeof S!="string")throw new TypeError("Expected String");if(S.length===0)return new Uint8Array;var P=0;if(S[P]!==" "){for(var U=0,j=0;S[P]===f;)U++,P++;for(var A=(S.length-P)*h+1>>>0,T=new Uint8Array(A);S[P];){var C=t[S.charCodeAt(P)];if(C===255)return;for(var $=0,E=A-1;(C!==0||$<j)&&E!==-1;E--,$++)C+=u*T[E]>>>0,T[E]=C%256>>>0,C=C/256>>>0;if(C!==0)throw new Error("Non-zero carry");j=$,P++}if(S[P]!==" "){for(var d=A-j;d!==A&&T[d]===0;)d++;for(var b=new Uint8Array(U+(A-d)),H=U;d!==A;)b[H++]=T[d++];return b}}}function x(S){var P=y(S);if(P)return P;throw new Error(`Non-${e} character`)}return{encode:w,decodeUnsafe:y,decode:x}}var Sw=Dw,Cw=Sw;const i0=r=>{if(r instanceof Uint8Array&&r.constructor.name==="Uint8Array")return r;if(r instanceof ArrayBuffer)return new Uint8Array(r);if(ArrayBuffer.isView(r))return new Uint8Array(r.buffer,r.byteOffset,r.byteLength);throw new Error("Unknown type, must be binary type")},Ow=r=>new TextEncoder().encode(r),$w=r=>new TextDecoder().decode(r);class Aw{constructor(e,t,n){this.name=e,this.prefix=t,this.baseEncode=n}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}}class Pw{constructor(e,t,n){if(this.name=e,this.prefix=t,t.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=t.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 s0(this,e)}}class Tw{constructor(e){this.decoders=e}or(e){return s0(this,e)}decode(e){const t=e[0],n=this.decoders[t];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 s0=(r,e)=>new Tw({...r.decoders||{[r.prefix]:r},...e.decoders||{[e.prefix]:e}});class Rw{constructor(e,t,n,i){this.name=e,this.prefix=t,this.baseEncode=n,this.baseDecode=i,this.encoder=new Aw(e,t,n),this.decoder=new Pw(e,t,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}const Pa=({name:r,prefix:e,encode:t,decode:n})=>new Rw(r,e,t,n),po=({prefix:r,name:e,alphabet:t})=>{const{encode:n,decode:i}=Cw(t,e);return Pa({prefix:r,name:e,encode:n,decode:a=>i0(i(a))})},Nw=(r,e,t,n)=>{const i={};for(let m=0;m<e.length;++m)i[e[m]]=m;let a=r.length;for(;r[a-1]==="=";)--a;const c=new Uint8Array(a*t/8|0);let u=0,f=0,h=0;for(let m=0;m<a;++m){const w=i[r[m]];if(w===void 0)throw new SyntaxError(`Non-${n} character`);f=f<<t|w,u+=t,u>=8&&(u-=8,c[h++]=255&f>>u)}if(u>=t||255&f<<8-u)throw new SyntaxError("Unexpected end of data");return c},Lw=(r,e,t)=>{const n=e[e.length-1]==="=",i=(1<<t)-1;let a="",c=0,u=0;for(let f=0;f<r.length;++f)for(u=u<<8|r[f],c+=8;c>t;)c-=t,a+=e[i&u>>c];if(c&&(a+=e[i&u<<t-c]),n)for(;a.length*t&7;)a+="=";return a},ur=({name:r,prefix:e,bitsPerChar:t,alphabet:n})=>Pa({prefix:e,name:r,encode(i){return Lw(i,n,t)},decode(i){return Nw(i,n,t,r)}}),Mw=Pa({prefix:"\0",name:"identity",encode:r=>$w(r),decode:r=>Ow(r)});var Uw=Object.freeze({__proto__:null,identity:Mw});const jw=ur({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var Fw=Object.freeze({__proto__:null,base2:jw});const Bw=ur({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var kw=Object.freeze({__proto__:null,base8:Bw});const qw=po({prefix:"9",name:"base10",alphabet:"0123456789"});var zw=Object.freeze({__proto__:null,base10:qw});const Hw=ur({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),Ww=ur({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var Kw=Object.freeze({__proto__:null,base16:Hw,base16upper:Ww});const Vw=ur({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),Gw=ur({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),Yw=ur({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),Jw=ur({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),Zw=ur({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),Qw=ur({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),Xw=ur({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),eb=ur({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),tb=ur({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var rb=Object.freeze({__proto__:null,base32:Vw,base32upper:Gw,base32pad:Yw,base32padupper:Jw,base32hex:Zw,base32hexupper:Qw,base32hexpad:Xw,base32hexpadupper:eb,base32z:tb});const nb=po({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),ib=po({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var sb=Object.freeze({__proto__:null,base36:nb,base36upper:ib});const ob=po({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),ab=po({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var cb=Object.freeze({__proto__:null,base58btc:ob,base58flickr:ab});const lb=ur({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),ub=ur({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),hb=ur({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),fb=ur({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var db=Object.freeze({__proto__:null,base64:lb,base64pad:ub,base64url:hb,base64urlpad:fb});const o0=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}"),pb=o0.reduce((r,e,t)=>(r[t]=e,r),[]),gb=o0.reduce((r,e,t)=>(r[e.codePointAt(0)]=t,r),[]);function mb(r){return r.reduce((e,t)=>(e+=pb[t],e),"")}function vb(r){const e=[];for(const t of r){const n=gb[t.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${t}`);e.push(n)}return new Uint8Array(e)}const yb=Pa({prefix:"\u{1F680}",name:"base256emoji",encode:mb,decode:vb});var wb=Object.freeze({__proto__:null,base256emoji:yb}),bb=c0,a0=128,_b=127,Eb=~_b,xb=Math.pow(2,31);function c0(r,e,t){e=e||[],t=t||0;for(var n=t;r>=xb;)e[t++]=r&255|a0,r/=128;for(;r&Eb;)e[t++]=r&255|a0,r>>>=7;return e[t]=r|0,c0.bytes=t-n+1,e}var Ib=kl,Db=128,l0=127;function kl(r,n){var t=0,n=n||0,i=0,a=n,c,u=r.length;do{if(a>=u)throw kl.bytes=0,new RangeError("Could not decode varint");c=r[a++],t+=i<28?(c&l0)<<i:(c&l0)*Math.pow(2,i),i+=7}while(c>=Db);return kl.bytes=a-n,t}var Sb=Math.pow(2,7),Cb=Math.pow(2,14),Ob=Math.pow(2,21),$b=Math.pow(2,28),Ab=Math.pow(2,35),Pb=Math.pow(2,42),Tb=Math.pow(2,49),Rb=Math.pow(2,56),Nb=Math.pow(2,63),Lb=function(r){return r<Sb?1:r<Cb?2:r<Ob?3:r<$b?4:r<Ab?5:r<Pb?6:r<Tb?7:r<Rb?8:r<Nb?9:10},Mb={encode:bb,decode:Ib,encodingLength:Lb},u0=Mb;const h0=(r,e,t=0)=>(u0.encode(r,e,t),e),f0=r=>u0.encodingLength(r),ql=(r,e)=>{const t=e.byteLength,n=f0(r),i=n+f0(t),a=new Uint8Array(i+t);return h0(r,a,0),h0(t,a,n),a.set(e,i),new Ub(r,t,e,a)};class Ub{constructor(e,t,n,i){this.code=e,this.size=t,this.digest=n,this.bytes=i}}const d0=({name:r,code:e,encode:t})=>new jb(r,e,t);class jb{constructor(e,t,n){this.name=e,this.code=t,this.encode=n}digest(e){if(e instanceof Uint8Array){const t=this.encode(e);return t instanceof Uint8Array?ql(this.code,t):t.then(n=>ql(this.code,n))}else throw Error("Unknown type, must be binary type")}}const p0=r=>async e=>new Uint8Array(await crypto.subtle.digest(r,e)),Fb=d0({name:"sha2-256",code:18,encode:p0("SHA-256")}),Bb=d0({name:"sha2-512",code:19,encode:p0("SHA-512")});var kb=Object.freeze({__proto__:null,sha256:Fb,sha512:Bb});const g0=0,qb="identity",m0=i0;var zb=Object.freeze({__proto__:null,identity:{code:g0,name:qb,encode:m0,digest:r=>ql(g0,m0(r))}});new TextEncoder,new TextDecoder;const v0={...Uw,...Fw,...kw,...zw,...Kw,...rb,...sb,...cb,...db,...wb};({...kb,...zb});function y0(r,e,t,n){return{name:r,prefix:e,encoder:{name:r,prefix:e,encode:t},decoder:{decode:n}}}const w0=y0("utf8","u",r=>"u"+new TextDecoder("utf8").decode(r),r=>new TextEncoder().encode(r.substring(1))),zl=y0("ascii","a",r=>{let e="a";for(let t=0;t<r.length;t++)e+=String.fromCharCode(r[t]);return e},r=>{r=r.substring(1);const e=n0(r.length);for(let t=0;t<r.length;t++)e[t]=r.charCodeAt(t);return e}),b0={utf8:w0,"utf-8":w0,hex:v0.base16,latin1:zl,ascii:zl,binary:zl,...v0};function Tr(r,e="utf8"){const t=b0[e];if(!t)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?Fl(globalThis.Buffer.from(r,"utf-8")):t.decoder.decode(`${t.prefix}${r}`)}function wr(r,e="utf8"){const t=b0[e];if(!t)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(r.buffer,r.byteOffset,r.byteLength).toString("utf8"):t.encoder.encode(r).substring(1)}var _0=function(r,e,t){if(t||arguments.length===2)for(var n=0,i=e.length,a;n<i;n++)(a||!(n in e))&&(a||(a=Array.prototype.slice.call(e,0,n)),a[n]=e[n]);return r.concat(a||Array.prototype.slice.call(e))},Hb=function(){function r(e,t,n){this.name=e,this.version=t,this.os=n,this.type="browser"}return r}(),Wb=function(){function r(e){this.version=e,this.type="node",this.name="node",this.os=process.platform}return r}(),Kb=function(){function r(e,t,n,i){this.name=e,this.version=t,this.os=n,this.bot=i,this.type="bot-device"}return r}(),Vb=function(){function r(){this.type="bot",this.bot=!0,this.name="bot",this.version=null,this.os=null}return r}(),Gb=function(){function r(){this.type="react-native",this.name="react-native",this.version=null,this.os=null}return r}(),Yb=/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/,Jb=/(nuhk|curl|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/,E0=3,Zb=[["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",Yb]],x0=[["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 Qb(r){return r?I0(r):typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"?new Gb:typeof navigator<"u"?I0(navigator.userAgent):t2()}function Xb(r){return r!==""&&Zb.reduce(function(e,t){var n=t[0],i=t[1];if(e)return e;var a=i.exec(r);return!!a&&[n,a]},!1)}function I0(r){var e=Xb(r);if(!e)return null;var t=e[0],n=e[1];if(t==="searchbot")return new Vb;var i=n[1]&&n[1].split(".").join("_").split("_").slice(0,3);i?i.length<E0&&(i=_0(_0([],i,!0),r2(E0-i.length),!0)):i=[];var a=i.join("."),c=e2(r),u=Jb.exec(r);return u&&u[1]?new Kb(t,a,c,u[1]):new Hb(t,a,c)}function e2(r){for(var e=0,t=x0.length;e<t;e++){var n=x0[e],i=n[0],a=n[1],c=a.exec(r);if(c)return i}return null}function t2(){var r=typeof process<"u"&&process.version;return r?new Wb(process.version.slice(1)):null}function r2(r){for(var e=[],t=0;t<r;t++)e.push("0");return e}var ye={};/*! *****************************************************************************
2
2
  Copyright (c) Microsoft Corporation.
3
3
 
4
4
  Permission to use, copy, modify, and/or distribute this software for any
@@ -11,13 +11,13 @@
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 Wl=function(r,e){return Wl=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)n.hasOwnProperty(i)&&(t[i]=n[i])},Wl(r,e)};function r2(r,e){Wl(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var Kl=function(){return Kl=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++){t=arguments[n];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e},Kl.apply(this,arguments)};function n2(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(t[n[i]]=r[n[i]]);return t}function i2(r,e,t,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(r,e,t,n);else for(var u=r.length-1;u>=0;u--)(c=r[u])&&(a=(i<3?c(a):i>3?c(e,t,a):c(e,t))||a);return i>3&&a&&Object.defineProperty(e,t,a),a}function s2(r,e){return function(t,n){e(t,n,r)}}function o2(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)}function a2(r,e,t,n){function i(a){return a instanceof t?a:new t(function(c){c(a)})}return new(t||(t=Promise))(function(a,c){function u(m){try{h(n.next(m))}catch(y){c(y)}}function d(m){try{h(n.throw(m))}catch(y){c(y)}}function h(m){m.done?a(m.value):i(m.value).then(u,d)}h((n=n.apply(r,e||[])).next())})}function c2(r,e){var t={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,i,a,c;return c={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function u(h){return function(m){return d([h,m])}}function d(h){if(n)throw new TypeError("Generator is already executing.");for(;t;)try{if(n=1,i&&(a=h[0]&2?i.return:h[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,h[1])).done)return a;switch(i=0,a&&(h=[h[0]&2,a.value]),h[0]){case 0:case 1:a=h;break;case 4:return t.label++,{value:h[1],done:!1};case 5:t.label++,i=h[1],h=[0];continue;case 7:h=t.ops.pop(),t.trys.pop();continue;default:if(a=t.trys,!(a=a.length>0&&a[a.length-1])&&(h[0]===6||h[0]===2)){t=0;continue}if(h[0]===3&&(!a||h[1]>a[0]&&h[1]<a[3])){t.label=h[1];break}if(h[0]===6&&t.label<a[1]){t.label=a[1],a=h;break}if(a&&t.label<a[2]){t.label=a[2],t.ops.push(h);break}a[2]&&t.ops.pop(),t.trys.pop();continue}h=e.call(r,t)}catch(m){h=[6,m],i=0}finally{n=a=0}if(h[0]&5)throw h[1];return{value:h[0]?h[1]:void 0,done:!0}}}function l2(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}function u2(r,e){for(var t in r)t!=="default"&&!e.hasOwnProperty(t)&&(e[t]=r[t])}function Vl(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],n=0;if(t)return t.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function D0(r,e){var t=typeof Symbol=="function"&&r[Symbol.iterator];if(!t)return r;var n=t.call(r),i,a=[],c;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)a.push(i.value)}catch(u){c={error:u}}finally{try{i&&!i.done&&(t=n.return)&&t.call(n)}finally{if(c)throw c.error}}return a}function h2(){for(var r=[],e=0;e<arguments.length;e++)r=r.concat(D0(arguments[e]));return r}function f2(){for(var r=0,e=0,t=arguments.length;e<t;e++)r+=arguments[e].length;for(var n=Array(r),i=0,e=0;e<t;e++)for(var a=arguments[e],c=0,u=a.length;c<u;c++,i++)n[i]=a[c];return n}function po(r){return this instanceof po?(this.v=r,this):new po(r)}function d2(r,e,t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=t.apply(r,e||[]),i,a=[];return i={},c("next"),c("throw"),c("return"),i[Symbol.asyncIterator]=function(){return this},i;function c(w){n[w]&&(i[w]=function(E){return new Promise(function(I,T){a.push([w,E,I,T])>1||u(w,E)})})}function u(w,E){try{d(n[w](E))}catch(I){y(a[0][3],I)}}function d(w){w.value instanceof po?Promise.resolve(w.value.v).then(h,m):y(a[0][2],w)}function h(w){u("next",w)}function m(w){u("throw",w)}function y(w,E){w(E),a.shift(),a.length&&u(a[0][0],a[0][1])}}function p2(r){var e,t;return e={},n("next"),n("throw",function(i){throw i}),n("return"),e[Symbol.iterator]=function(){return this},e;function n(i,a){e[i]=r[i]?function(c){return(t=!t)?{value:po(r[i](c)),done:i==="return"}:a?a(c):c}:a}}function g2(r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=r[Symbol.asyncIterator],t;return e?e.call(r):(r=typeof Vl=="function"?Vl(r):r[Symbol.iterator](),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(a){t[a]=r[a]&&function(c){return new Promise(function(u,d){c=r[a](c),i(u,d,c.done,c.value)})}}function i(a,c,u,d){Promise.resolve(d).then(function(h){a({value:h,done:u})},c)}}function m2(r,e){return Object.defineProperty?Object.defineProperty(r,"raw",{value:e}):r.raw=e,r}function v2(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)Object.hasOwnProperty.call(r,t)&&(e[t]=r[t]);return e.default=r,e}function w2(r){return r&&r.__esModule?r:{default:r}}function y2(r,e){if(!e.has(r))throw new TypeError("attempted to get private field on non-instance");return e.get(r)}function b2(r,e,t){if(!e.has(r))throw new TypeError("attempted to set private field on non-instance");return e.set(r,t),t}var _2=Object.freeze({__proto__:null,__extends:r2,get __assign(){return Kl},__rest:n2,__decorate:i2,__param:s2,__metadata:o2,__awaiter:a2,__generator:c2,__createBinding:l2,__exportStar:u2,__values:Vl,__read:D0,__spread:h2,__spreadArrays:f2,__await:po,__asyncGenerator:d2,__asyncDelegator:p2,__asyncValues:g2,__makeTemplateObject:m2,__importStar:v2,__importDefault:w2,__classPrivateFieldGet:y2,__classPrivateFieldSet:b2}),Ta=Ai(_2),Gl={},go={},S0;function E2(){if(S0)return go;S0=1,Object.defineProperty(go,"__esModule",{value:!0}),go.delay=void 0;function r(e){return new Promise(t=>{setTimeout(()=>{t(!0)},e)})}return go.delay=r,go}var Pi={},Yl={},Ti={},O0;function x2(){return O0||(O0=1,Object.defineProperty(Ti,"__esModule",{value:!0}),Ti.ONE_THOUSAND=Ti.ONE_HUNDRED=void 0,Ti.ONE_HUNDRED=100,Ti.ONE_THOUSAND=1e3),Ti}var Jl={},C0;function I2(){return C0||(C0=1,function(r){Object.defineProperty(r,"__esModule",{value:!0}),r.ONE_YEAR=r.FOUR_WEEKS=r.THREE_WEEKS=r.TWO_WEEKS=r.ONE_WEEK=r.THIRTY_DAYS=r.SEVEN_DAYS=r.FIVE_DAYS=r.THREE_DAYS=r.ONE_DAY=r.TWENTY_FOUR_HOURS=r.TWELVE_HOURS=r.SIX_HOURS=r.THREE_HOURS=r.ONE_HOUR=r.SIXTY_MINUTES=r.THIRTY_MINUTES=r.TEN_MINUTES=r.FIVE_MINUTES=r.ONE_MINUTE=r.SIXTY_SECONDS=r.THIRTY_SECONDS=r.TEN_SECONDS=r.FIVE_SECONDS=r.ONE_SECOND=void 0,r.ONE_SECOND=1,r.FIVE_SECONDS=5,r.TEN_SECONDS=10,r.THIRTY_SECONDS=30,r.SIXTY_SECONDS=60,r.ONE_MINUTE=r.SIXTY_SECONDS,r.FIVE_MINUTES=r.ONE_MINUTE*5,r.TEN_MINUTES=r.ONE_MINUTE*10,r.THIRTY_MINUTES=r.ONE_MINUTE*30,r.SIXTY_MINUTES=r.ONE_MINUTE*60,r.ONE_HOUR=r.SIXTY_MINUTES,r.THREE_HOURS=r.ONE_HOUR*3,r.SIX_HOURS=r.ONE_HOUR*6,r.TWELVE_HOURS=r.ONE_HOUR*12,r.TWENTY_FOUR_HOURS=r.ONE_HOUR*24,r.ONE_DAY=r.TWENTY_FOUR_HOURS,r.THREE_DAYS=r.ONE_DAY*3,r.FIVE_DAYS=r.ONE_DAY*5,r.SEVEN_DAYS=r.ONE_DAY*7,r.THIRTY_DAYS=r.ONE_DAY*30,r.ONE_WEEK=r.SEVEN_DAYS,r.TWO_WEEKS=r.ONE_WEEK*2,r.THREE_WEEKS=r.ONE_WEEK*3,r.FOUR_WEEKS=r.ONE_WEEK*4,r.ONE_YEAR=r.ONE_DAY*365}(Jl)),Jl}var $0;function A0(){return $0||($0=1,function(r){Object.defineProperty(r,"__esModule",{value:!0});const e=Ta;e.__exportStar(x2(),r),e.__exportStar(I2(),r)}(Yl)),Yl}var P0;function D2(){if(P0)return Pi;P0=1,Object.defineProperty(Pi,"__esModule",{value:!0}),Pi.fromMiliseconds=Pi.toMiliseconds=void 0;const r=A0();function e(n){return n*r.ONE_THOUSAND}Pi.toMiliseconds=e;function t(n){return Math.floor(n/r.ONE_THOUSAND)}return Pi.fromMiliseconds=t,Pi}var T0;function S2(){return T0||(T0=1,function(r){Object.defineProperty(r,"__esModule",{value:!0});const e=Ta;e.__exportStar(E2(),r),e.__exportStar(D2(),r)}(Gl)),Gl}var vs={},R0;function O2(){if(R0)return vs;R0=1,Object.defineProperty(vs,"__esModule",{value:!0}),vs.Watch=void 0;class r{constructor(){this.timestamps=new Map}start(t){if(this.timestamps.has(t))throw new Error(`Watch already started for label: ${t}`);this.timestamps.set(t,{started:Date.now()})}stop(t){const n=this.get(t);if(typeof n.elapsed<"u")throw new Error(`Watch already stopped for label: ${t}`);const i=Date.now()-n.started;this.timestamps.set(t,{started:n.started,elapsed:i})}get(t){const n=this.timestamps.get(t);if(typeof n>"u")throw new Error(`No timestamp found for label: ${t}`);return n}elapsed(t){const n=this.get(t);return n.elapsed||Date.now()-n.started}}return vs.Watch=r,vs.default=r,vs}var Zl={},mo={},N0;function C2(){if(N0)return mo;N0=1,Object.defineProperty(mo,"__esModule",{value:!0}),mo.IWatch=void 0;class r{}return mo.IWatch=r,mo}var L0;function $2(){return L0||(L0=1,function(r){Object.defineProperty(r,"__esModule",{value:!0}),Ta.__exportStar(C2(),r)}(Zl)),Zl}(function(r){Object.defineProperty(r,"__esModule",{value:!0});const e=Ta;e.__exportStar(S2(),r),e.__exportStar(O2(),r),e.__exportStar($2(),r),e.__exportStar(A0(),r)})(we);var bt={};Object.defineProperty(bt,"__esModule",{value:!0}),bt.getLocalStorage=bt.getLocalStorageOrThrow=bt.getCrypto=bt.getCryptoOrThrow=M0=bt.getLocation=bt.getLocationOrThrow=Xl=bt.getNavigator=bt.getNavigatorOrThrow=Ql=bt.getDocument=bt.getDocumentOrThrow=bt.getFromWindowOrThrow=bt.getFromWindow=void 0;function Ri(r){let e;return typeof window<"u"&&typeof window[r]<"u"&&(e=window[r]),e}bt.getFromWindow=Ri;function ws(r){const e=Ri(r);if(!e)throw new Error(`${r} is not defined in Window`);return e}bt.getFromWindowOrThrow=ws;function A2(){return ws("document")}bt.getDocumentOrThrow=A2;function P2(){return Ri("document")}var Ql=bt.getDocument=P2;function T2(){return ws("navigator")}bt.getNavigatorOrThrow=T2;function R2(){return Ri("navigator")}var Xl=bt.getNavigator=R2;function N2(){return ws("location")}bt.getLocationOrThrow=N2;function L2(){return Ri("location")}var M0=bt.getLocation=L2;function M2(){return ws("crypto")}bt.getCryptoOrThrow=M2;function U2(){return Ri("crypto")}bt.getCrypto=U2;function j2(){return ws("localStorage")}bt.getLocalStorageOrThrow=j2;function F2(){return Ri("localStorage")}bt.getLocalStorage=F2;var eu={};Object.defineProperty(eu,"__esModule",{value:!0});var U0=eu.getWindowMetadata=void 0;const j0=bt;function B2(){let r,e;try{r=j0.getDocumentOrThrow(),e=j0.getLocationOrThrow()}catch{return null}function t(){const y=r.getElementsByTagName("link"),w=[];for(let E=0;E<y.length;E++){const I=y[E],T=I.getAttribute("rel");if(T&&T.toLowerCase().indexOf("icon")>-1){const U=I.getAttribute("href");if(U)if(U.toLowerCase().indexOf("https:")===-1&&U.toLowerCase().indexOf("http:")===-1&&U.indexOf("//")!==0){let F=e.protocol+"//"+e.host;if(U.indexOf("/")===0)F+=U;else{const $=e.pathname.split("/");$.pop();const P=$.join("/");F+=P+"/"+U}w.push(F)}else if(U.indexOf("//")===0){const F=e.protocol+U;w.push(F)}else w.push(U)}}return w}function n(...y){const w=r.getElementsByTagName("meta");for(let E=0;E<w.length;E++){const I=w[E],T=["itemprop","property","name"].map(U=>I.getAttribute(U)).filter(U=>U?y.includes(U):!1);if(T.length&&T){const U=I.getAttribute("content");if(U)return U}}return""}function i(){let y=n("name","og:site_name","og:title","twitter:title");return y||(y=r.title),y}function a(){return n("description","og:description","twitter:description","keywords")}const c=i(),u=a(),d=e.origin,h=t();return{description:u,url:d,icons:h,name:c}}U0=eu.getWindowMetadata=B2;var vo={},k2=r=>encodeURIComponent(r).replace(/[!'()*]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`),F0="%[a-f0-9]{2}",B0=new RegExp("("+F0+")|([^%]+?)","gi"),k0=new RegExp("("+F0+")+","gi");function tu(r,e){try{return[decodeURIComponent(r.join(""))]}catch{}if(r.length===1)return r;e=e||1;var t=r.slice(0,e),n=r.slice(e);return Array.prototype.concat.call([],tu(t),tu(n))}function H2(r){try{return decodeURIComponent(r)}catch{for(var e=r.match(B0)||[],t=1;t<e.length;t++)r=tu(e,t).join(""),e=r.match(B0)||[];return r}}function z2(r){for(var e={"%FE%FF":"\uFFFD\uFFFD","%FF%FE":"\uFFFD\uFFFD"},t=k0.exec(r);t;){try{e[t[0]]=decodeURIComponent(t[0])}catch{var n=H2(t[0]);n!==t[0]&&(e[t[0]]=n)}t=k0.exec(r)}e["%C2"]="\uFFFD";for(var i=Object.keys(e),a=0;a<i.length;a++){var c=i[a];r=r.replace(new RegExp(c,"g"),e[c])}return r}var q2=function(r){if(typeof r!="string")throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof r+"`");try{return r=r.replace(/\+/g," "),decodeURIComponent(r)}catch{return z2(r)}},W2=(r,e)=>{if(!(typeof r=="string"&&typeof e=="string"))throw new TypeError("Expected the arguments to be of type `string`");if(e==="")return[r];const t=r.indexOf(e);return t===-1?[r]:[r.slice(0,t),r.slice(t+e.length)]},K2=function(r,e){for(var t={},n=Object.keys(r),i=Array.isArray(e),a=0;a<n.length;a++){var c=n[a],u=r[c];(i?e.indexOf(c)!==-1:e(c,u,r))&&(t[c]=u)}return t};(function(r){const e=k2,t=q2,n=W2,i=K2,a=$=>$==null,c=Symbol("encodeFragmentIdentifier");function u($){switch($.arrayFormat){case"index":return P=>(O,A)=>{const x=O.length;return A===void 0||$.skipNull&&A===null||$.skipEmptyString&&A===""?O:A===null?[...O,[m(P,$),"[",x,"]"].join("")]:[...O,[m(P,$),"[",m(x,$),"]=",m(A,$)].join("")]};case"bracket":return P=>(O,A)=>A===void 0||$.skipNull&&A===null||$.skipEmptyString&&A===""?O:A===null?[...O,[m(P,$),"[]"].join("")]:[...O,[m(P,$),"[]=",m(A,$)].join("")];case"colon-list-separator":return P=>(O,A)=>A===void 0||$.skipNull&&A===null||$.skipEmptyString&&A===""?O:A===null?[...O,[m(P,$),":list="].join("")]:[...O,[m(P,$),":list=",m(A,$)].join("")];case"comma":case"separator":case"bracket-separator":{const P=$.arrayFormat==="bracket-separator"?"[]=":"=";return O=>(A,x)=>x===void 0||$.skipNull&&x===null||$.skipEmptyString&&x===""?A:(x=x===null?"":x,A.length===0?[[m(O,$),P,m(x,$)].join("")]:[[A,m(x,$)].join($.arrayFormatSeparator)])}default:return P=>(O,A)=>A===void 0||$.skipNull&&A===null||$.skipEmptyString&&A===""?O:A===null?[...O,m(P,$)]:[...O,[m(P,$),"=",m(A,$)].join("")]}}function d($){let P;switch($.arrayFormat){case"index":return(O,A,x)=>{if(P=/\[(\d*)\]$/.exec(O),O=O.replace(/\[\d*\]$/,""),!P){x[O]=A;return}x[O]===void 0&&(x[O]={}),x[O][P[1]]=A};case"bracket":return(O,A,x)=>{if(P=/(\[\])$/.exec(O),O=O.replace(/\[\]$/,""),!P){x[O]=A;return}if(x[O]===void 0){x[O]=[A];return}x[O]=[].concat(x[O],A)};case"colon-list-separator":return(O,A,x)=>{if(P=/(:list)$/.exec(O),O=O.replace(/:list$/,""),!P){x[O]=A;return}if(x[O]===void 0){x[O]=[A];return}x[O]=[].concat(x[O],A)};case"comma":case"separator":return(O,A,x)=>{const f=typeof A=="string"&&A.includes($.arrayFormatSeparator),b=typeof A=="string"&&!f&&y(A,$).includes($.arrayFormatSeparator);A=b?y(A,$):A;const q=f||b?A.split($.arrayFormatSeparator).map(j=>y(j,$)):A===null?A:y(A,$);x[O]=q};case"bracket-separator":return(O,A,x)=>{const f=/(\[\])$/.test(O);if(O=O.replace(/\[\]$/,""),!f){x[O]=A&&y(A,$);return}const b=A===null?[]:A.split($.arrayFormatSeparator).map(q=>y(q,$));if(x[O]===void 0){x[O]=b;return}x[O]=[].concat(x[O],b)};default:return(O,A,x)=>{if(x[O]===void 0){x[O]=A;return}x[O]=[].concat(x[O],A)}}}function h($){if(typeof $!="string"||$.length!==1)throw new TypeError("arrayFormatSeparator must be single character string")}function m($,P){return P.encode?P.strict?e($):encodeURIComponent($):$}function y($,P){return P.decode?t($):$}function w($){return Array.isArray($)?$.sort():typeof $=="object"?w(Object.keys($)).sort((P,O)=>Number(P)-Number(O)).map(P=>$[P]):$}function E($){const P=$.indexOf("#");return P!==-1&&($=$.slice(0,P)),$}function I($){let P="";const O=$.indexOf("#");return O!==-1&&(P=$.slice(O)),P}function T($){$=E($);const P=$.indexOf("?");return P===-1?"":$.slice(P+1)}function U($,P){return P.parseNumbers&&!Number.isNaN(Number($))&&typeof $=="string"&&$.trim()!==""?$=Number($):P.parseBooleans&&$!==null&&($.toLowerCase()==="true"||$.toLowerCase()==="false")&&($=$.toLowerCase()==="true"),$}function F($,P){P=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},P),h(P.arrayFormatSeparator);const O=d(P),A=Object.create(null);if(typeof $!="string"||($=$.trim().replace(/^[?#&]/,""),!$))return A;for(const x of $.split("&")){if(x==="")continue;let[f,b]=n(P.decode?x.replace(/\+/g," "):x,"=");b=b===void 0?null:["comma","separator","bracket-separator"].includes(P.arrayFormat)?b:y(b,P),O(y(f,P),b,A)}for(const x of Object.keys(A)){const f=A[x];if(typeof f=="object"&&f!==null)for(const b of Object.keys(f))f[b]=U(f[b],P);else A[x]=U(f,P)}return P.sort===!1?A:(P.sort===!0?Object.keys(A).sort():Object.keys(A).sort(P.sort)).reduce((x,f)=>{const b=A[f];return b&&typeof b=="object"&&!Array.isArray(b)?x[f]=w(b):x[f]=b,x},Object.create(null))}r.extract=T,r.parse=F,r.stringify=($,P)=>{if(!$)return"";P=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},P),h(P.arrayFormatSeparator);const O=b=>P.skipNull&&a($[b])||P.skipEmptyString&&$[b]==="",A=u(P),x={};for(const b of Object.keys($))O(b)||(x[b]=$[b]);const f=Object.keys(x);return P.sort!==!1&&f.sort(P.sort),f.map(b=>{const q=$[b];return q===void 0?"":q===null?m(b,P):Array.isArray(q)?q.length===0&&P.arrayFormat==="bracket-separator"?m(b,P)+"[]":q.reduce(A(b),[]).join("&"):m(b,P)+"="+m(q,P)}).filter(b=>b.length>0).join("&")},r.parseUrl=($,P)=>{P=Object.assign({decode:!0},P);const[O,A]=n($,"#");return Object.assign({url:O.split("?")[0]||"",query:F(T($),P)},P&&P.parseFragmentIdentifier&&A?{fragmentIdentifier:y(A,P)}:{})},r.stringifyUrl=($,P)=>{P=Object.assign({encode:!0,strict:!0,[c]:!0},P);const O=E($.url).split("?")[0]||"",A=r.extract($.url),x=r.parse(A,{sort:!1}),f=Object.assign(x,$.query);let b=r.stringify(f,P);b&&(b=`?${b}`);let q=I($.url);return $.fragmentIdentifier&&(q=`#${P[c]?m($.fragmentIdentifier,P):$.fragmentIdentifier}`),`${O}${b}${q}`},r.pick=($,P,O)=>{O=Object.assign({parseFragmentIdentifier:!0,[c]:!1},O);const{url:A,query:x,fragmentIdentifier:f}=r.parseUrl($,O);return r.stringifyUrl({url:A,query:i(x,P),fragmentIdentifier:f},O)},r.exclude=($,P,O)=>{const A=Array.isArray(P)?x=>!P.includes(x):(x,f)=>!P(x,f);return r.pick($,A,O)}})(vo);const V2={waku:{publish:"waku_publish",batchPublish:"waku_batchPublish",subscribe:"waku_subscribe",batchSubscribe:"waku_batchSubscribe",subscription:"waku_subscription",unsubscribe:"waku_unsubscribe",batchUnsubscribe:"waku_batchUnsubscribe"},irn:{publish:"irn_publish",batchPublish:"irn_batchPublish",subscribe:"irn_subscribe",batchSubscribe:"irn_batchSubscribe",subscription:"irn_subscription",unsubscribe:"irn_unsubscribe",batchUnsubscribe:"irn_batchUnsubscribe"},iridium:{publish:"iridium_publish",batchPublish:"iridium_batchPublish",subscribe:"iridium_subscribe",batchSubscribe:"iridium_batchSubscribe",subscription:"iridium_subscription",unsubscribe:"iridium_unsubscribe",batchUnsubscribe:"iridium_batchUnsubscribe"}},G2=":";function Y2(r){const[e,t]=r.split(G2);return{namespace:e,reference:t}}function J2(r,e=[]){const t=[];return Object.keys(r).forEach(n=>{if(e.length&&!e.includes(n))return;const i=r[n];t.push(...i.accounts)}),t}function H0(r,e){return r.includes(":")?[r]:e.chains||[]}const z0="base10",br="base16",ru="base64pad",nu="utf8",q0=0,Ni=1,Z2=0,W0=1,iu=12,su=32;function Q2(){const r=Fl.generateKeyPair();return{privateKey:yr(r.secretKey,br),publicKey:yr(r.publicKey,br)}}function ou(){const r=ms.randomBytes(su);return yr(r,br)}function X2(r,e){const t=Fl.sharedKey(Pr(r,br),Pr(e,br),!0),n=new dy(Aa.SHA256,t).expand(su);return yr(n,br)}function e_(r){const e=Aa.hash(Pr(r,br));return yr(e,br)}function ys(r){const e=Aa.hash(Pr(r,nu));return yr(e,br)}function t_(r){return Pr(`${r}`,z0)}function wo(r){return Number(yr(r,z0))}function r_(r){const e=t_(typeof r.type<"u"?r.type:q0);if(wo(e)===Ni&&typeof r.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");const t=typeof r.senderPublicKey<"u"?Pr(r.senderPublicKey,br):void 0,n=typeof r.iv<"u"?Pr(r.iv,br):ms.randomBytes(iu),i=new Tl.ChaCha20Poly1305(Pr(r.symKey,br)).seal(n,Pr(r.message,nu));return i_({type:e,sealed:i,iv:n,senderPublicKey:t})}function n_(r){const e=new Tl.ChaCha20Poly1305(Pr(r.symKey,br)),{sealed:t,iv:n}=Ra(r.encoded),i=e.open(n,t);if(i===null)throw new Error("Failed to decrypt");return yr(i,nu)}function i_(r){if(wo(r.type)===Ni){if(typeof r.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");return yr(kl([r.type,r.senderPublicKey,r.iv,r.sealed]),ru)}return yr(kl([r.type,r.iv,r.sealed]),ru)}function Ra(r){const e=Pr(r,ru),t=e.slice(Z2,W0),n=W0;if(wo(t)===Ni){const u=n+su,d=u+iu,h=e.slice(n,u),m=e.slice(u,d),y=e.slice(d);return{type:t,sealed:y,iv:m,senderPublicKey:h}}const i=n+iu,a=e.slice(n,i),c=e.slice(i);return{type:t,sealed:c,iv:a}}function s_(r,e){const t=Ra(r);return K0({type:wo(t.type),senderPublicKey:typeof t.senderPublicKey<"u"?yr(t.senderPublicKey,br):void 0,receiverPublicKey:e?.receiverPublicKey})}function K0(r){const e=r?.type||q0;if(e===Ni){if(typeof r?.senderPublicKey>"u")throw new Error("missing sender public key");if(typeof r?.receiverPublicKey>"u")throw new Error("missing receiver public key")}return{type:e,senderPublicKey:r?.senderPublicKey,receiverPublicKey:r?.receiverPublicKey}}function V0(r){return r.type===Ni&&typeof r.senderPublicKey=="string"&&typeof r.receiverPublicKey=="string"}var o_=Object.defineProperty,G0=Object.getOwnPropertySymbols,a_=Object.prototype.hasOwnProperty,c_=Object.prototype.propertyIsEnumerable,Y0=(r,e,t)=>e in r?o_(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,J0=(r,e)=>{for(var t in e||(e={}))a_.call(e,t)&&Y0(r,t,e[t]);if(G0)for(var t of G0(e))c_.call(e,t)&&Y0(r,t,e[t]);return r};const l_="ReactNative",qr={reactNative:"react-native",node:"node",browser:"browser",unknown:"unknown"},u_="js";function au(){return typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.node<"u"}function bs(){return!Ql()&&!!Xl()&&navigator.product===l_}function _s(){return!au()&&!!Xl()&&!!Ql()}function yo(){return bs()?qr.reactNative:au()?qr.node:_s()?qr.browser:qr.unknown}function h_(){var r;try{return bs()&&typeof global<"u"&&typeof(global==null?void 0:global.Application)<"u"?(r=global.Application)==null?void 0:r.applicationId:void 0}catch{return}}function f_(r,e){let t=vo.parse(r);return t=J0(J0({},t),e),r=vo.stringify(t),r}function d_(){return U0()||{name:"",description:"",url:"",icons:[""]}}function p_(){if(yo()===qr.reactNative&&typeof global<"u"&&typeof(global==null?void 0:global.Platform)<"u"){const{OS:t,Version:n}=global.Platform;return[t,n].join("-")}const r=Zb();if(r===null)return"unknown";const e=r.os?r.os.replace(" ","").toLowerCase():"unknown";return r.type==="browser"?[e,r.name,r.version].join("-"):[e,r.version].join("-")}function g_(){var r;const e=yo();return e===qr.browser?[e,((r=M0())==null?void 0:r.host)||"unknown"].join(":"):e}function m_(r,e,t){const n=p_(),i=g_();return[[r,e].join("-"),[u_,t].join("-"),n,i].join("/")}function v_({protocol:r,version:e,relayUrl:t,sdkVersion:n,auth:i,projectId:a,useOnCloseEvent:c,bundleId:u}){const d=t.split("?"),h=m_(r,e,n),m={auth:i,ua:h,projectId:a,useOnCloseEvent:c||void 0,origin:u||void 0},y=f_(d[1]||"",m);return d[0]+"?"+y}function Li(r,e){return r.filter(t=>e.includes(t)).length===r.length}function Z0(r){return Object.fromEntries(r.entries())}function Q0(r){return new Map(Object.entries(r))}function Es(r=we.FIVE_MINUTES,e){const t=we.toMiliseconds(r||we.FIVE_MINUTES);let n,i,a;return{resolve:c=>{a&&n&&(clearTimeout(a),n(c))},reject:c=>{a&&i&&(clearTimeout(a),i(c))},done:()=>new Promise((c,u)=>{a=setTimeout(()=>{u(new Error(e))},t),n=c,i=u})}}function bo(r,e,t){return new Promise(async(n,i)=>{const a=setTimeout(()=>i(new Error(t)),e);try{const c=await r;n(c)}catch(c){i(c)}clearTimeout(a)})}function X0(r,e){if(typeof e=="string"&&e.startsWith(`${r}:`))return e;if(r.toLowerCase()==="topic"){if(typeof e!="string")throw new Error('Value must be "string" for expirer target type: topic');return`topic:${e}`}else if(r.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: ${r}`)}function w_(r){return X0("topic",r)}function y_(r){return X0("id",r)}function ep(r){const[e,t]=r.split(":"),n={id:void 0,topic:void 0};if(e==="topic"&&typeof t=="string")n.topic=t;else if(e==="id"&&Number.isInteger(Number(t)))n.id=Number(t);else throw new Error(`Invalid target, expected id:number or topic:string, got ${e}:${t}`);return n}function fn(r,e){return we.fromMiliseconds((e||Date.now())+we.toMiliseconds(r))}function ni(r){return Date.now()>=we.toMiliseconds(r)}function Vt(r,e){return`${r}${e?`:${e}`:""}`}function cu(r=[],e=[]){return[...new Set([...r,...e])]}async function b_({id:r,topic:e,wcDeepLink:t}){try{if(!t)return;const n=typeof t=="string"?JSON.parse(t):t;let i=n?.href;if(typeof i!="string")return;i.endsWith("/")&&(i=i.slice(0,-1));const a=`${i}/wc?requestId=${r}&sessionTopic=${e}`,c=yo();c===qr.browser?a.startsWith("https://")?window.open(a,"_blank","noreferrer noopener"):window.open(a,"_self","noreferrer noopener"):c===qr.reactNative&&typeof(global==null?void 0:global.Linking)<"u"&&await global.Linking.openURL(a)}catch(n){console.error(n)}}async function __(r,e){try{return await r.getItem(e)||(_s()?localStorage.getItem(e):void 0)}catch(t){console.error(t)}}const E_="irn";function lu(r){return r?.relay||{protocol:E_}}function Na(r){const e=V2[r];if(typeof e>"u")throw new Error(`Relay Protocol not supported: ${r}`);return e}var x_=Object.defineProperty,tp=Object.getOwnPropertySymbols,I_=Object.prototype.hasOwnProperty,D_=Object.prototype.propertyIsEnumerable,rp=(r,e,t)=>e in r?x_(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,S_=(r,e)=>{for(var t in e||(e={}))I_.call(e,t)&&rp(r,t,e[t]);if(tp)for(var t of tp(e))D_.call(e,t)&&rp(r,t,e[t]);return r};function O_(r,e="-"){const t={},n="relay"+e;return Object.keys(r).forEach(i=>{if(i.startsWith(n)){const a=i.replace(n,""),c=r[i];t[a]=c}}),t}function np(r){r=r.includes("wc://")?r.replace("wc://",""):r,r=r.includes("wc:")?r.replace("wc:",""):r;const e=r.indexOf(":"),t=r.indexOf("?")!==-1?r.indexOf("?"):void 0,n=r.substring(0,e),i=r.substring(e+1,t).split("@"),a=typeof t<"u"?r.substring(t):"",c=vo.parse(a);return{protocol:n,topic:C_(i[0]),version:parseInt(i[1],10),symKey:c.symKey,relay:O_(c)}}function C_(r){return r.startsWith("//")?r.substring(2):r}function $_(r,e="-"){const t="relay",n={};return Object.keys(r).forEach(i=>{const a=t+e+i;r[i]&&(n[a]=r[i])}),n}function A_(r){return`${r.protocol}:${r.topic}@${r.version}?`+vo.stringify(S_({symKey:r.symKey},$_(r.relay)))}function xs(r){const e=[];return r.forEach(t=>{const[n,i]=t.split(":");e.push(`${n}:${i}`)}),e}function P_(r){const e=[];return Object.values(r).forEach(t=>{e.push(...xs(t.accounts))}),e}function T_(r,e){const t=[];return Object.values(r).forEach(n=>{xs(n.accounts).includes(e)&&t.push(...n.methods)}),t}function R_(r,e){const t=[];return Object.values(r).forEach(n=>{xs(n.accounts).includes(e)&&t.push(...n.events)}),t}function N_(r,e){const t=Ma(r,e);if(t)throw new Error(t.message);const n={};for(const[i,a]of Object.entries(r))n[i]={methods:a.methods,events:a.events,chains:a.accounts.map(c=>`${c.split(":")[0]}:${c.split(":")[1]}`)};return n}function uu(r){return r.includes(":")}function _o(r){return uu(r)?r.split(":")[0]:r}const L_={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}},M_={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 he(r,e){const{message:t,code:n}=M_[r];return{message:e?`${t} ${e}`:t,code:n}}function Rt(r,e){const{message:t,code:n}=L_[r];return{message:e?`${t} ${e}`:t,code:n}}function En(r,e){return Array.isArray(r)?typeof e<"u"&&r.length?r.every(e):!0:!1}function Is(r){return Object.getPrototypeOf(r)===Object.prototype&&Object.keys(r).length}function _r(r){return typeof r>"u"}function ir(r,e){return e&&_r(r)?!0:typeof r=="string"&&!!r.trim().length}function hu(r,e){return e&&_r(r)?!0:typeof r=="number"&&!isNaN(r)}function U_(r,e){const{requiredNamespaces:t}=e,n=Object.keys(r.namespaces),i=Object.keys(t);let a=!0;return Li(i,n)?(n.forEach(c=>{const{accounts:u,methods:d,events:h}=r.namespaces[c],m=xs(u),y=t[c];(!Li(H0(c,y),m)||!Li(y.methods,d)||!Li(y.events,h))&&(a=!1)}),a):!1}function La(r){return ir(r,!1)&&r.includes(":")?r.split(":").length===2:!1}function j_(r){if(ir(r,!1)&&r.includes(":")){const e=r.split(":");if(e.length===3){const t=e[0]+":"+e[1];return!!e[2]&&La(t)}}return!1}function F_(r){if(ir(r,!1))try{return typeof new URL(r)<"u"}catch{return!1}return!1}function B_(r){var e;return(e=r?.proposer)==null?void 0:e.publicKey}function k_(r){return r?.topic}function H_(r,e){let t=null;return ir(r?.publicKey,!1)||(t=he("MISSING_OR_INVALID",`${e} controller public key should be a string`)),t}function ip(r){let e=!0;return En(r)?r.length&&(e=r.every(t=>ir(t,!1))):e=!1,e}function z_(r,e,t){let n=null;return En(e)&&e.length?e.forEach(i=>{n||La(i)||(n=Rt("UNSUPPORTED_CHAINS",`${t}, chain ${i} should be a string and conform to "namespace:chainId" format`))}):La(r)||(n=Rt("UNSUPPORTED_CHAINS",`${t}, chains must be defined as "namespace:chainId" e.g. "eip155:1": {...} in the namespace key OR as an array of CAIP-2 chainIds e.g. eip155: { chains: ["eip155:1", "eip155:5"] }`)),n}function q_(r,e,t){let n=null;return Object.entries(r).forEach(([i,a])=>{if(n)return;const c=z_(i,H0(i,a),`${e} ${t}`);c&&(n=c)}),n}function W_(r,e){let t=null;return En(r)?r.forEach(n=>{t||j_(n)||(t=Rt("UNSUPPORTED_ACCOUNTS",`${e}, account ${n} should be a string and conform to "namespace:chainId:address" format`))}):t=Rt("UNSUPPORTED_ACCOUNTS",`${e}, accounts should be an array of strings conforming to "namespace:chainId:address" format`),t}function K_(r,e){let t=null;return Object.values(r).forEach(n=>{if(t)return;const i=W_(n?.accounts,`${e} namespace`);i&&(t=i)}),t}function V_(r,e){let t=null;return ip(r?.methods)?ip(r?.events)||(t=Rt("UNSUPPORTED_EVENTS",`${e}, events should be an array of strings or empty array for no events`)):t=Rt("UNSUPPORTED_METHODS",`${e}, methods should be an array of strings or empty array for no methods`),t}function sp(r,e){let t=null;return Object.values(r).forEach(n=>{if(t)return;const i=V_(n,`${e}, namespace`);i&&(t=i)}),t}function G_(r,e,t){let n=null;if(r&&Is(r)){const i=sp(r,e);i&&(n=i);const a=q_(r,e,t);a&&(n=a)}else n=he("MISSING_OR_INVALID",`${e}, ${t} should be an object with data`);return n}function Ma(r,e){let t=null;if(r&&Is(r)){const n=sp(r,e);n&&(t=n);const i=K_(r,e);i&&(t=i)}else t=he("MISSING_OR_INVALID",`${e}, namespaces should be an object with data`);return t}function op(r){return ir(r.protocol,!0)}function Y_(r,e){let t=!1;return e&&!r?t=!0:r&&En(r)&&r.length&&r.forEach(n=>{t=op(n)}),t}function J_(r){return typeof r=="number"}function Tr(r){return typeof r<"u"&&typeof r!==null}function Z_(r){return!(!r||typeof r!="object"||!r.code||!hu(r.code,!1)||!r.message||!ir(r.message,!1))}function Q_(r){return!(_r(r)||!ir(r.method,!1))}function X_(r){return!(_r(r)||_r(r.result)&&_r(r.error)||!hu(r.id,!1)||!ir(r.jsonrpc,!1))}function e3(r){return!(_r(r)||!ir(r.name,!1))}function ap(r,e){return!(!La(e)||!P_(r).includes(e))}function t3(r,e,t){return ir(t,!1)?T_(r,e).includes(t):!1}function r3(r,e,t){return ir(t,!1)?R_(r,e).includes(t):!1}function cp(r,e,t){let n=null;const i=n3(r),a=i3(e),c=Object.keys(i),u=Object.keys(a),d=lp(Object.keys(r)),h=lp(Object.keys(e)),m=d.filter(y=>!h.includes(y));return m.length&&(n=he("NON_CONFORMING_NAMESPACES",`${t} namespaces keys don't satisfy requiredNamespaces.
14
+ ***************************************************************************** */var Hl=function(r,e){return Hl=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)n.hasOwnProperty(i)&&(t[i]=n[i])},Hl(r,e)};function n2(r,e){Hl(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var Wl=function(){return Wl=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++){t=arguments[n];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e},Wl.apply(this,arguments)};function i2(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(t[n[i]]=r[n[i]]);return t}function s2(r,e,t,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(r,e,t,n);else for(var u=r.length-1;u>=0;u--)(c=r[u])&&(a=(i<3?c(a):i>3?c(e,t,a):c(e,t))||a);return i>3&&a&&Object.defineProperty(e,t,a),a}function o2(r,e){return function(t,n){e(t,n,r)}}function a2(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)}function c2(r,e,t,n){function i(a){return a instanceof t?a:new t(function(c){c(a)})}return new(t||(t=Promise))(function(a,c){function u(m){try{h(n.next(m))}catch(w){c(w)}}function f(m){try{h(n.throw(m))}catch(w){c(w)}}function h(m){m.done?a(m.value):i(m.value).then(u,f)}h((n=n.apply(r,e||[])).next())})}function l2(r,e){var t={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,i,a,c;return c={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function u(h){return function(m){return f([h,m])}}function f(h){if(n)throw new TypeError("Generator is already executing.");for(;t;)try{if(n=1,i&&(a=h[0]&2?i.return:h[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,h[1])).done)return a;switch(i=0,a&&(h=[h[0]&2,a.value]),h[0]){case 0:case 1:a=h;break;case 4:return t.label++,{value:h[1],done:!1};case 5:t.label++,i=h[1],h=[0];continue;case 7:h=t.ops.pop(),t.trys.pop();continue;default:if(a=t.trys,!(a=a.length>0&&a[a.length-1])&&(h[0]===6||h[0]===2)){t=0;continue}if(h[0]===3&&(!a||h[1]>a[0]&&h[1]<a[3])){t.label=h[1];break}if(h[0]===6&&t.label<a[1]){t.label=a[1],a=h;break}if(a&&t.label<a[2]){t.label=a[2],t.ops.push(h);break}a[2]&&t.ops.pop(),t.trys.pop();continue}h=e.call(r,t)}catch(m){h=[6,m],i=0}finally{n=a=0}if(h[0]&5)throw h[1];return{value:h[0]?h[1]:void 0,done:!0}}}function u2(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}function h2(r,e){for(var t in r)t!=="default"&&!e.hasOwnProperty(t)&&(e[t]=r[t])}function Kl(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],n=0;if(t)return t.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function D0(r,e){var t=typeof Symbol=="function"&&r[Symbol.iterator];if(!t)return r;var n=t.call(r),i,a=[],c;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)a.push(i.value)}catch(u){c={error:u}}finally{try{i&&!i.done&&(t=n.return)&&t.call(n)}finally{if(c)throw c.error}}return a}function f2(){for(var r=[],e=0;e<arguments.length;e++)r=r.concat(D0(arguments[e]));return r}function d2(){for(var r=0,e=0,t=arguments.length;e<t;e++)r+=arguments[e].length;for(var n=Array(r),i=0,e=0;e<t;e++)for(var a=arguments[e],c=0,u=a.length;c<u;c++,i++)n[i]=a[c];return n}function go(r){return this instanceof go?(this.v=r,this):new go(r)}function p2(r,e,t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=t.apply(r,e||[]),i,a=[];return i={},c("next"),c("throw"),c("return"),i[Symbol.asyncIterator]=function(){return this},i;function c(y){n[y]&&(i[y]=function(x){return new Promise(function(S,P){a.push([y,x,S,P])>1||u(y,x)})})}function u(y,x){try{f(n[y](x))}catch(S){w(a[0][3],S)}}function f(y){y.value instanceof go?Promise.resolve(y.value.v).then(h,m):w(a[0][2],y)}function h(y){u("next",y)}function m(y){u("throw",y)}function w(y,x){y(x),a.shift(),a.length&&u(a[0][0],a[0][1])}}function g2(r){var e,t;return e={},n("next"),n("throw",function(i){throw i}),n("return"),e[Symbol.iterator]=function(){return this},e;function n(i,a){e[i]=r[i]?function(c){return(t=!t)?{value:go(r[i](c)),done:i==="return"}:a?a(c):c}:a}}function m2(r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=r[Symbol.asyncIterator],t;return e?e.call(r):(r=typeof Kl=="function"?Kl(r):r[Symbol.iterator](),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(a){t[a]=r[a]&&function(c){return new Promise(function(u,f){c=r[a](c),i(u,f,c.done,c.value)})}}function i(a,c,u,f){Promise.resolve(f).then(function(h){a({value:h,done:u})},c)}}function v2(r,e){return Object.defineProperty?Object.defineProperty(r,"raw",{value:e}):r.raw=e,r}function y2(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)Object.hasOwnProperty.call(r,t)&&(e[t]=r[t]);return e.default=r,e}function w2(r){return r&&r.__esModule?r:{default:r}}function b2(r,e){if(!e.has(r))throw new TypeError("attempted to get private field on non-instance");return e.get(r)}function _2(r,e,t){if(!e.has(r))throw new TypeError("attempted to set private field on non-instance");return e.set(r,t),t}var E2=Object.freeze({__proto__:null,__extends:n2,get __assign(){return Wl},__rest:i2,__decorate:s2,__param:o2,__metadata:a2,__awaiter:c2,__generator:l2,__createBinding:u2,__exportStar:h2,__values:Kl,__read:D0,__spread:f2,__spreadArrays:d2,__await:go,__asyncGenerator:p2,__asyncDelegator:g2,__asyncValues:m2,__makeTemplateObject:v2,__importStar:y2,__importDefault:w2,__classPrivateFieldGet:b2,__classPrivateFieldSet:_2}),Ta=Pi(E2),Vl={},mo={},S0;function x2(){if(S0)return mo;S0=1,Object.defineProperty(mo,"__esModule",{value:!0}),mo.delay=void 0;function r(e){return new Promise(t=>{setTimeout(()=>{t(!0)},e)})}return mo.delay=r,mo}var Ti={},Gl={},Ri={},C0;function I2(){return C0||(C0=1,Object.defineProperty(Ri,"__esModule",{value:!0}),Ri.ONE_THOUSAND=Ri.ONE_HUNDRED=void 0,Ri.ONE_HUNDRED=100,Ri.ONE_THOUSAND=1e3),Ri}var Yl={},O0;function D2(){return O0||(O0=1,function(r){Object.defineProperty(r,"__esModule",{value:!0}),r.ONE_YEAR=r.FOUR_WEEKS=r.THREE_WEEKS=r.TWO_WEEKS=r.ONE_WEEK=r.THIRTY_DAYS=r.SEVEN_DAYS=r.FIVE_DAYS=r.THREE_DAYS=r.ONE_DAY=r.TWENTY_FOUR_HOURS=r.TWELVE_HOURS=r.SIX_HOURS=r.THREE_HOURS=r.ONE_HOUR=r.SIXTY_MINUTES=r.THIRTY_MINUTES=r.TEN_MINUTES=r.FIVE_MINUTES=r.ONE_MINUTE=r.SIXTY_SECONDS=r.THIRTY_SECONDS=r.TEN_SECONDS=r.FIVE_SECONDS=r.ONE_SECOND=void 0,r.ONE_SECOND=1,r.FIVE_SECONDS=5,r.TEN_SECONDS=10,r.THIRTY_SECONDS=30,r.SIXTY_SECONDS=60,r.ONE_MINUTE=r.SIXTY_SECONDS,r.FIVE_MINUTES=r.ONE_MINUTE*5,r.TEN_MINUTES=r.ONE_MINUTE*10,r.THIRTY_MINUTES=r.ONE_MINUTE*30,r.SIXTY_MINUTES=r.ONE_MINUTE*60,r.ONE_HOUR=r.SIXTY_MINUTES,r.THREE_HOURS=r.ONE_HOUR*3,r.SIX_HOURS=r.ONE_HOUR*6,r.TWELVE_HOURS=r.ONE_HOUR*12,r.TWENTY_FOUR_HOURS=r.ONE_HOUR*24,r.ONE_DAY=r.TWENTY_FOUR_HOURS,r.THREE_DAYS=r.ONE_DAY*3,r.FIVE_DAYS=r.ONE_DAY*5,r.SEVEN_DAYS=r.ONE_DAY*7,r.THIRTY_DAYS=r.ONE_DAY*30,r.ONE_WEEK=r.SEVEN_DAYS,r.TWO_WEEKS=r.ONE_WEEK*2,r.THREE_WEEKS=r.ONE_WEEK*3,r.FOUR_WEEKS=r.ONE_WEEK*4,r.ONE_YEAR=r.ONE_DAY*365}(Yl)),Yl}var $0;function A0(){return $0||($0=1,function(r){Object.defineProperty(r,"__esModule",{value:!0});const e=Ta;e.__exportStar(I2(),r),e.__exportStar(D2(),r)}(Gl)),Gl}var P0;function S2(){if(P0)return Ti;P0=1,Object.defineProperty(Ti,"__esModule",{value:!0}),Ti.fromMiliseconds=Ti.toMiliseconds=void 0;const r=A0();function e(n){return n*r.ONE_THOUSAND}Ti.toMiliseconds=e;function t(n){return Math.floor(n/r.ONE_THOUSAND)}return Ti.fromMiliseconds=t,Ti}var T0;function C2(){return T0||(T0=1,function(r){Object.defineProperty(r,"__esModule",{value:!0});const e=Ta;e.__exportStar(x2(),r),e.__exportStar(S2(),r)}(Vl)),Vl}var ys={},R0;function O2(){if(R0)return ys;R0=1,Object.defineProperty(ys,"__esModule",{value:!0}),ys.Watch=void 0;class r{constructor(){this.timestamps=new Map}start(t){if(this.timestamps.has(t))throw new Error(`Watch already started for label: ${t}`);this.timestamps.set(t,{started:Date.now()})}stop(t){const n=this.get(t);if(typeof n.elapsed<"u")throw new Error(`Watch already stopped for label: ${t}`);const i=Date.now()-n.started;this.timestamps.set(t,{started:n.started,elapsed:i})}get(t){const n=this.timestamps.get(t);if(typeof n>"u")throw new Error(`No timestamp found for label: ${t}`);return n}elapsed(t){const n=this.get(t);return n.elapsed||Date.now()-n.started}}return ys.Watch=r,ys.default=r,ys}var Jl={},vo={},N0;function $2(){if(N0)return vo;N0=1,Object.defineProperty(vo,"__esModule",{value:!0}),vo.IWatch=void 0;class r{}return vo.IWatch=r,vo}var L0;function A2(){return L0||(L0=1,function(r){Object.defineProperty(r,"__esModule",{value:!0}),Ta.__exportStar($2(),r)}(Jl)),Jl}(function(r){Object.defineProperty(r,"__esModule",{value:!0});const e=Ta;e.__exportStar(C2(),r),e.__exportStar(O2(),r),e.__exportStar(A2(),r),e.__exportStar(A0(),r)})(ye);var bt={};Object.defineProperty(bt,"__esModule",{value:!0}),bt.getLocalStorage=bt.getLocalStorageOrThrow=bt.getCrypto=bt.getCryptoOrThrow=M0=bt.getLocation=bt.getLocationOrThrow=Ql=bt.getNavigator=bt.getNavigatorOrThrow=Zl=bt.getDocument=bt.getDocumentOrThrow=bt.getFromWindowOrThrow=bt.getFromWindow=void 0;function Ni(r){let e;return typeof window<"u"&&typeof window[r]<"u"&&(e=window[r]),e}bt.getFromWindow=Ni;function ws(r){const e=Ni(r);if(!e)throw new Error(`${r} is not defined in Window`);return e}bt.getFromWindowOrThrow=ws;function P2(){return ws("document")}bt.getDocumentOrThrow=P2;function T2(){return Ni("document")}var Zl=bt.getDocument=T2;function R2(){return ws("navigator")}bt.getNavigatorOrThrow=R2;function N2(){return Ni("navigator")}var Ql=bt.getNavigator=N2;function L2(){return ws("location")}bt.getLocationOrThrow=L2;function M2(){return Ni("location")}var M0=bt.getLocation=M2;function U2(){return ws("crypto")}bt.getCryptoOrThrow=U2;function j2(){return Ni("crypto")}bt.getCrypto=j2;function F2(){return ws("localStorage")}bt.getLocalStorageOrThrow=F2;function B2(){return Ni("localStorage")}bt.getLocalStorage=B2;var Xl={};Object.defineProperty(Xl,"__esModule",{value:!0});var U0=Xl.getWindowMetadata=void 0;const j0=bt;function k2(){let r,e;try{r=j0.getDocumentOrThrow(),e=j0.getLocationOrThrow()}catch{return null}function t(){const w=r.getElementsByTagName("link"),y=[];for(let x=0;x<w.length;x++){const S=w[x],P=S.getAttribute("rel");if(P&&P.toLowerCase().indexOf("icon")>-1){const U=S.getAttribute("href");if(U)if(U.toLowerCase().indexOf("https:")===-1&&U.toLowerCase().indexOf("http:")===-1&&U.indexOf("//")!==0){let j=e.protocol+"//"+e.host;if(U.indexOf("/")===0)j+=U;else{const A=e.pathname.split("/");A.pop();const T=A.join("/");j+=T+"/"+U}y.push(j)}else if(U.indexOf("//")===0){const j=e.protocol+U;y.push(j)}else y.push(U)}}return y}function n(...w){const y=r.getElementsByTagName("meta");for(let x=0;x<y.length;x++){const S=y[x],P=["itemprop","property","name"].map(U=>S.getAttribute(U)).filter(U=>U?w.includes(U):!1);if(P.length&&P){const U=S.getAttribute("content");if(U)return U}}return""}function i(){let w=n("name","og:site_name","og:title","twitter:title");return w||(w=r.title),w}function a(){return n("description","og:description","twitter:description","keywords")}const c=i(),u=a(),f=e.origin,h=t();return{description:u,url:f,icons:h,name:c}}U0=Xl.getWindowMetadata=k2;var yo={},q2=r=>encodeURIComponent(r).replace(/[!'()*]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`),F0="%[a-f0-9]{2}",B0=new RegExp("("+F0+")|([^%]+?)","gi"),k0=new RegExp("("+F0+")+","gi");function eu(r,e){try{return[decodeURIComponent(r.join(""))]}catch{}if(r.length===1)return r;e=e||1;var t=r.slice(0,e),n=r.slice(e);return Array.prototype.concat.call([],eu(t),eu(n))}function z2(r){try{return decodeURIComponent(r)}catch{for(var e=r.match(B0)||[],t=1;t<e.length;t++)r=eu(e,t).join(""),e=r.match(B0)||[];return r}}function H2(r){for(var e={"%FE%FF":"\uFFFD\uFFFD","%FF%FE":"\uFFFD\uFFFD"},t=k0.exec(r);t;){try{e[t[0]]=decodeURIComponent(t[0])}catch{var n=z2(t[0]);n!==t[0]&&(e[t[0]]=n)}t=k0.exec(r)}e["%C2"]="\uFFFD";for(var i=Object.keys(e),a=0;a<i.length;a++){var c=i[a];r=r.replace(new RegExp(c,"g"),e[c])}return r}var W2=function(r){if(typeof r!="string")throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof r+"`");try{return r=r.replace(/\+/g," "),decodeURIComponent(r)}catch{return H2(r)}},K2=(r,e)=>{if(!(typeof r=="string"&&typeof e=="string"))throw new TypeError("Expected the arguments to be of type `string`");if(e==="")return[r];const t=r.indexOf(e);return t===-1?[r]:[r.slice(0,t),r.slice(t+e.length)]},V2=function(r,e){for(var t={},n=Object.keys(r),i=Array.isArray(e),a=0;a<n.length;a++){var c=n[a],u=r[c];(i?e.indexOf(c)!==-1:e(c,u,r))&&(t[c]=u)}return t};(function(r){const e=q2,t=W2,n=K2,i=V2,a=A=>A==null,c=Symbol("encodeFragmentIdentifier");function u(A){switch(A.arrayFormat){case"index":return T=>(C,$)=>{const E=C.length;return $===void 0||A.skipNull&&$===null||A.skipEmptyString&&$===""?C:$===null?[...C,[m(T,A),"[",E,"]"].join("")]:[...C,[m(T,A),"[",m(E,A),"]=",m($,A)].join("")]};case"bracket":return T=>(C,$)=>$===void 0||A.skipNull&&$===null||A.skipEmptyString&&$===""?C:$===null?[...C,[m(T,A),"[]"].join("")]:[...C,[m(T,A),"[]=",m($,A)].join("")];case"colon-list-separator":return T=>(C,$)=>$===void 0||A.skipNull&&$===null||A.skipEmptyString&&$===""?C:$===null?[...C,[m(T,A),":list="].join("")]:[...C,[m(T,A),":list=",m($,A)].join("")];case"comma":case"separator":case"bracket-separator":{const T=A.arrayFormat==="bracket-separator"?"[]=":"=";return C=>($,E)=>E===void 0||A.skipNull&&E===null||A.skipEmptyString&&E===""?$:(E=E===null?"":E,$.length===0?[[m(C,A),T,m(E,A)].join("")]:[[$,m(E,A)].join(A.arrayFormatSeparator)])}default:return T=>(C,$)=>$===void 0||A.skipNull&&$===null||A.skipEmptyString&&$===""?C:$===null?[...C,m(T,A)]:[...C,[m(T,A),"=",m($,A)].join("")]}}function f(A){let T;switch(A.arrayFormat){case"index":return(C,$,E)=>{if(T=/\[(\d*)\]$/.exec(C),C=C.replace(/\[\d*\]$/,""),!T){E[C]=$;return}E[C]===void 0&&(E[C]={}),E[C][T[1]]=$};case"bracket":return(C,$,E)=>{if(T=/(\[\])$/.exec(C),C=C.replace(/\[\]$/,""),!T){E[C]=$;return}if(E[C]===void 0){E[C]=[$];return}E[C]=[].concat(E[C],$)};case"colon-list-separator":return(C,$,E)=>{if(T=/(:list)$/.exec(C),C=C.replace(/:list$/,""),!T){E[C]=$;return}if(E[C]===void 0){E[C]=[$];return}E[C]=[].concat(E[C],$)};case"comma":case"separator":return(C,$,E)=>{const d=typeof $=="string"&&$.includes(A.arrayFormatSeparator),b=typeof $=="string"&&!d&&w($,A).includes(A.arrayFormatSeparator);$=b?w($,A):$;const H=d||b?$.split(A.arrayFormatSeparator).map(F=>w(F,A)):$===null?$:w($,A);E[C]=H};case"bracket-separator":return(C,$,E)=>{const d=/(\[\])$/.test(C);if(C=C.replace(/\[\]$/,""),!d){E[C]=$&&w($,A);return}const b=$===null?[]:$.split(A.arrayFormatSeparator).map(H=>w(H,A));if(E[C]===void 0){E[C]=b;return}E[C]=[].concat(E[C],b)};default:return(C,$,E)=>{if(E[C]===void 0){E[C]=$;return}E[C]=[].concat(E[C],$)}}}function h(A){if(typeof A!="string"||A.length!==1)throw new TypeError("arrayFormatSeparator must be single character string")}function m(A,T){return T.encode?T.strict?e(A):encodeURIComponent(A):A}function w(A,T){return T.decode?t(A):A}function y(A){return Array.isArray(A)?A.sort():typeof A=="object"?y(Object.keys(A)).sort((T,C)=>Number(T)-Number(C)).map(T=>A[T]):A}function x(A){const T=A.indexOf("#");return T!==-1&&(A=A.slice(0,T)),A}function S(A){let T="";const C=A.indexOf("#");return C!==-1&&(T=A.slice(C)),T}function P(A){A=x(A);const T=A.indexOf("?");return T===-1?"":A.slice(T+1)}function U(A,T){return T.parseNumbers&&!Number.isNaN(Number(A))&&typeof A=="string"&&A.trim()!==""?A=Number(A):T.parseBooleans&&A!==null&&(A.toLowerCase()==="true"||A.toLowerCase()==="false")&&(A=A.toLowerCase()==="true"),A}function j(A,T){T=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},T),h(T.arrayFormatSeparator);const C=f(T),$=Object.create(null);if(typeof A!="string"||(A=A.trim().replace(/^[?#&]/,""),!A))return $;for(const E of A.split("&")){if(E==="")continue;let[d,b]=n(T.decode?E.replace(/\+/g," "):E,"=");b=b===void 0?null:["comma","separator","bracket-separator"].includes(T.arrayFormat)?b:w(b,T),C(w(d,T),b,$)}for(const E of Object.keys($)){const d=$[E];if(typeof d=="object"&&d!==null)for(const b of Object.keys(d))d[b]=U(d[b],T);else $[E]=U(d,T)}return T.sort===!1?$:(T.sort===!0?Object.keys($).sort():Object.keys($).sort(T.sort)).reduce((E,d)=>{const b=$[d];return b&&typeof b=="object"&&!Array.isArray(b)?E[d]=y(b):E[d]=b,E},Object.create(null))}r.extract=P,r.parse=j,r.stringify=(A,T)=>{if(!A)return"";T=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},T),h(T.arrayFormatSeparator);const C=b=>T.skipNull&&a(A[b])||T.skipEmptyString&&A[b]==="",$=u(T),E={};for(const b of Object.keys(A))C(b)||(E[b]=A[b]);const d=Object.keys(E);return T.sort!==!1&&d.sort(T.sort),d.map(b=>{const H=A[b];return H===void 0?"":H===null?m(b,T):Array.isArray(H)?H.length===0&&T.arrayFormat==="bracket-separator"?m(b,T)+"[]":H.reduce($(b),[]).join("&"):m(b,T)+"="+m(H,T)}).filter(b=>b.length>0).join("&")},r.parseUrl=(A,T)=>{T=Object.assign({decode:!0},T);const[C,$]=n(A,"#");return Object.assign({url:C.split("?")[0]||"",query:j(P(A),T)},T&&T.parseFragmentIdentifier&&$?{fragmentIdentifier:w($,T)}:{})},r.stringifyUrl=(A,T)=>{T=Object.assign({encode:!0,strict:!0,[c]:!0},T);const C=x(A.url).split("?")[0]||"",$=r.extract(A.url),E=r.parse($,{sort:!1}),d=Object.assign(E,A.query);let b=r.stringify(d,T);b&&(b=`?${b}`);let H=S(A.url);return A.fragmentIdentifier&&(H=`#${T[c]?m(A.fragmentIdentifier,T):A.fragmentIdentifier}`),`${C}${b}${H}`},r.pick=(A,T,C)=>{C=Object.assign({parseFragmentIdentifier:!0,[c]:!1},C);const{url:$,query:E,fragmentIdentifier:d}=r.parseUrl(A,C);return r.stringifyUrl({url:$,query:i(E,T),fragmentIdentifier:d},C)},r.exclude=(A,T,C)=>{const $=Array.isArray(T)?E=>!T.includes(E):(E,d)=>!T(E,d);return r.pick(A,$,C)}})(yo);const G2={waku:{publish:"waku_publish",batchPublish:"waku_batchPublish",subscribe:"waku_subscribe",batchSubscribe:"waku_batchSubscribe",subscription:"waku_subscription",unsubscribe:"waku_unsubscribe",batchUnsubscribe:"waku_batchUnsubscribe"},irn:{publish:"irn_publish",batchPublish:"irn_batchPublish",subscribe:"irn_subscribe",batchSubscribe:"irn_batchSubscribe",subscription:"irn_subscription",unsubscribe:"irn_unsubscribe",batchUnsubscribe:"irn_batchUnsubscribe"},iridium:{publish:"iridium_publish",batchPublish:"iridium_batchPublish",subscribe:"iridium_subscribe",batchSubscribe:"iridium_batchSubscribe",subscription:"iridium_subscription",unsubscribe:"iridium_unsubscribe",batchUnsubscribe:"iridium_batchUnsubscribe"}},Y2=":";function J2(r){const[e,t]=r.split(Y2);return{namespace:e,reference:t}}function Z2(r,e=[]){const t=[];return Object.keys(r).forEach(n=>{if(e.length&&!e.includes(n))return;const i=r[n];t.push(...i.accounts)}),t}function q0(r,e){return r.includes(":")?[r]:e.chains||[]}const z0="base10",br="base16",tu="base64pad",ru="utf8",H0=0,Li=1,Q2=0,W0=1,nu=12,iu=32;function X2(){const r=jl.generateKeyPair();return{privateKey:wr(r.secretKey,br),publicKey:wr(r.publicKey,br)}}function su(){const r=vs.randomBytes(iu);return wr(r,br)}function e_(r,e){const t=jl.sharedKey(Tr(r,br),Tr(e,br),!0),n=new pw(Aa.SHA256,t).expand(iu);return wr(n,br)}function t_(r){const e=Aa.hash(Tr(r,br));return wr(e,br)}function bs(r){const e=Aa.hash(Tr(r,ru));return wr(e,br)}function r_(r){return Tr(`${r}`,z0)}function wo(r){return Number(wr(r,z0))}function n_(r){const e=r_(typeof r.type<"u"?r.type:H0);if(wo(e)===Li&&typeof r.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");const t=typeof r.senderPublicKey<"u"?Tr(r.senderPublicKey,br):void 0,n=typeof r.iv<"u"?Tr(r.iv,br):vs.randomBytes(nu),i=new Pl.ChaCha20Poly1305(Tr(r.symKey,br)).seal(n,Tr(r.message,ru));return s_({type:e,sealed:i,iv:n,senderPublicKey:t})}function i_(r){const e=new Pl.ChaCha20Poly1305(Tr(r.symKey,br)),{sealed:t,iv:n}=Ra(r.encoded),i=e.open(n,t);if(i===null)throw new Error("Failed to decrypt");return wr(i,ru)}function s_(r){if(wo(r.type)===Li){if(typeof r.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");return wr(Bl([r.type,r.senderPublicKey,r.iv,r.sealed]),tu)}return wr(Bl([r.type,r.iv,r.sealed]),tu)}function Ra(r){const e=Tr(r,tu),t=e.slice(Q2,W0),n=W0;if(wo(t)===Li){const u=n+iu,f=u+nu,h=e.slice(n,u),m=e.slice(u,f),w=e.slice(f);return{type:t,sealed:w,iv:m,senderPublicKey:h}}const i=n+nu,a=e.slice(n,i),c=e.slice(i);return{type:t,sealed:c,iv:a}}function o_(r,e){const t=Ra(r);return K0({type:wo(t.type),senderPublicKey:typeof t.senderPublicKey<"u"?wr(t.senderPublicKey,br):void 0,receiverPublicKey:e?.receiverPublicKey})}function K0(r){const e=r?.type||H0;if(e===Li){if(typeof r?.senderPublicKey>"u")throw new Error("missing sender public key");if(typeof r?.receiverPublicKey>"u")throw new Error("missing receiver public key")}return{type:e,senderPublicKey:r?.senderPublicKey,receiverPublicKey:r?.receiverPublicKey}}function V0(r){return r.type===Li&&typeof r.senderPublicKey=="string"&&typeof r.receiverPublicKey=="string"}var a_=Object.defineProperty,G0=Object.getOwnPropertySymbols,c_=Object.prototype.hasOwnProperty,l_=Object.prototype.propertyIsEnumerable,Y0=(r,e,t)=>e in r?a_(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,J0=(r,e)=>{for(var t in e||(e={}))c_.call(e,t)&&Y0(r,t,e[t]);if(G0)for(var t of G0(e))l_.call(e,t)&&Y0(r,t,e[t]);return r};const u_="ReactNative",Hr={reactNative:"react-native",node:"node",browser:"browser",unknown:"unknown"},h_="js";function ou(){return typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.node<"u"}function _s(){return!Zl()&&!!Ql()&&navigator.product===u_}function Es(){return!ou()&&!!Ql()&&!!Zl()}function bo(){return _s()?Hr.reactNative:ou()?Hr.node:Es()?Hr.browser:Hr.unknown}function f_(){var r;try{return _s()&&typeof global<"u"&&typeof(global==null?void 0:global.Application)<"u"?(r=global.Application)==null?void 0:r.applicationId:void 0}catch{return}}function d_(r,e){let t=yo.parse(r);return t=J0(J0({},t),e),r=yo.stringify(t),r}function p_(){return U0()||{name:"",description:"",url:"",icons:[""]}}function g_(){if(bo()===Hr.reactNative&&typeof global<"u"&&typeof(global==null?void 0:global.Platform)<"u"){const{OS:t,Version:n}=global.Platform;return[t,n].join("-")}const r=Qb();if(r===null)return"unknown";const e=r.os?r.os.replace(" ","").toLowerCase():"unknown";return r.type==="browser"?[e,r.name,r.version].join("-"):[e,r.version].join("-")}function m_(){var r;const e=bo();return e===Hr.browser?[e,((r=M0())==null?void 0:r.host)||"unknown"].join(":"):e}function v_(r,e,t){const n=g_(),i=m_();return[[r,e].join("-"),[h_,t].join("-"),n,i].join("/")}function y_({protocol:r,version:e,relayUrl:t,sdkVersion:n,auth:i,projectId:a,useOnCloseEvent:c,bundleId:u}){const f=t.split("?"),h=v_(r,e,n),m={auth:i,ua:h,projectId:a,useOnCloseEvent:c||void 0,origin:u||void 0},w=d_(f[1]||"",m);return f[0]+"?"+w}function Mi(r,e){return r.filter(t=>e.includes(t)).length===r.length}function Z0(r){return Object.fromEntries(r.entries())}function Q0(r){return new Map(Object.entries(r))}function xs(r=ye.FIVE_MINUTES,e){const t=ye.toMiliseconds(r||ye.FIVE_MINUTES);let n,i,a;return{resolve:c=>{a&&n&&(clearTimeout(a),n(c))},reject:c=>{a&&i&&(clearTimeout(a),i(c))},done:()=>new Promise((c,u)=>{a=setTimeout(()=>{u(new Error(e))},t),n=c,i=u})}}function _o(r,e,t){return new Promise(async(n,i)=>{const a=setTimeout(()=>i(new Error(t)),e);try{const c=await r;n(c)}catch(c){i(c)}clearTimeout(a)})}function X0(r,e){if(typeof e=="string"&&e.startsWith(`${r}:`))return e;if(r.toLowerCase()==="topic"){if(typeof e!="string")throw new Error('Value must be "string" for expirer target type: topic');return`topic:${e}`}else if(r.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: ${r}`)}function w_(r){return X0("topic",r)}function b_(r){return X0("id",r)}function ep(r){const[e,t]=r.split(":"),n={id:void 0,topic:void 0};if(e==="topic"&&typeof t=="string")n.topic=t;else if(e==="id"&&Number.isInteger(Number(t)))n.id=Number(t);else throw new Error(`Invalid target, expected id:number or topic:string, got ${e}:${t}`);return n}function Wr(r,e){return ye.fromMiliseconds((e||Date.now())+ye.toMiliseconds(r))}function ii(r){return Date.now()>=ye.toMiliseconds(r)}function qt(r,e){return`${r}${e?`:${e}`:""}`}function au(r=[],e=[]){return[...new Set([...r,...e])]}async function __({id:r,topic:e,wcDeepLink:t}){try{if(!t)return;const n=typeof t=="string"?JSON.parse(t):t;let i=n?.href;if(typeof i!="string")return;i.endsWith("/")&&(i=i.slice(0,-1));const a=`${i}/wc?requestId=${r}&sessionTopic=${e}`,c=bo();c===Hr.browser?a.startsWith("https://")?window.open(a,"_blank","noreferrer noopener"):window.open(a,"_self","noreferrer noopener"):c===Hr.reactNative&&typeof(global==null?void 0:global.Linking)<"u"&&await global.Linking.openURL(a)}catch(n){console.error(n)}}async function E_(r,e){try{return await r.getItem(e)||(Es()?localStorage.getItem(e):void 0)}catch(t){console.error(t)}}const x_="irn";function cu(r){return r?.relay||{protocol:x_}}function Na(r){const e=G2[r];if(typeof e>"u")throw new Error(`Relay Protocol not supported: ${r}`);return e}var I_=Object.defineProperty,D_=Object.defineProperties,S_=Object.getOwnPropertyDescriptors,tp=Object.getOwnPropertySymbols,C_=Object.prototype.hasOwnProperty,O_=Object.prototype.propertyIsEnumerable,rp=(r,e,t)=>e in r?I_(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,$_=(r,e)=>{for(var t in e||(e={}))C_.call(e,t)&&rp(r,t,e[t]);if(tp)for(var t of tp(e))O_.call(e,t)&&rp(r,t,e[t]);return r},A_=(r,e)=>D_(r,S_(e));function P_(r,e="-"){const t={},n="relay"+e;return Object.keys(r).forEach(i=>{if(i.startsWith(n)){const a=i.replace(n,""),c=r[i];t[a]=c}}),t}function np(r){r=r.includes("wc://")?r.replace("wc://",""):r,r=r.includes("wc:")?r.replace("wc:",""):r;const e=r.indexOf(":"),t=r.indexOf("?")!==-1?r.indexOf("?"):void 0,n=r.substring(0,e),i=r.substring(e+1,t).split("@"),a=typeof t<"u"?r.substring(t):"",c=yo.parse(a);return{protocol:n,topic:T_(i[0]),version:parseInt(i[1],10),symKey:c.symKey,relay:P_(c),expiryTimestamp:c.expiryTimestamp?parseInt(c.expiryTimestamp,10):void 0}}function T_(r){return r.startsWith("//")?r.substring(2):r}function R_(r,e="-"){const t="relay",n={};return Object.keys(r).forEach(i=>{const a=t+e+i;r[i]&&(n[a]=r[i])}),n}function N_(r){return`${r.protocol}:${r.topic}@${r.version}?`+yo.stringify(A_($_({symKey:r.symKey},R_(r.relay)),{expiryTimestamp:r.expiryTimestamp}))}function Is(r){const e=[];return r.forEach(t=>{const[n,i]=t.split(":");e.push(`${n}:${i}`)}),e}function L_(r){const e=[];return Object.values(r).forEach(t=>{e.push(...Is(t.accounts))}),e}function M_(r,e){const t=[];return Object.values(r).forEach(n=>{Is(n.accounts).includes(e)&&t.push(...n.methods)}),t}function U_(r,e){const t=[];return Object.values(r).forEach(n=>{Is(n.accounts).includes(e)&&t.push(...n.events)}),t}function lu(r){return r.includes(":")}function Eo(r){return lu(r)?r.split(":")[0]:r}const j_={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}},F_={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(r,e){const{message:t,code:n}=F_[r];return{message:e?`${t} ${e}`:t,code:n}}function It(r,e){const{message:t,code:n}=j_[r];return{message:e?`${t} ${e}`:t,code:n}}function En(r,e){return Array.isArray(r)?typeof e<"u"&&r.length?r.every(e):!0:!1}function xo(r){return Object.getPrototypeOf(r)===Object.prototype&&Object.keys(r).length}function _r(r){return typeof r>"u"}function ir(r,e){return e&&_r(r)?!0:typeof r=="string"&&!!r.trim().length}function uu(r,e){return e&&_r(r)?!0:typeof r=="number"&&!isNaN(r)}function B_(r,e){const{requiredNamespaces:t}=e,n=Object.keys(r.namespaces),i=Object.keys(t);let a=!0;return Mi(i,n)?(n.forEach(c=>{const{accounts:u,methods:f,events:h}=r.namespaces[c],m=Is(u),w=t[c];(!Mi(q0(c,w),m)||!Mi(w.methods,f)||!Mi(w.events,h))&&(a=!1)}),a):!1}function La(r){return ir(r,!1)&&r.includes(":")?r.split(":").length===2:!1}function k_(r){if(ir(r,!1)&&r.includes(":")){const e=r.split(":");if(e.length===3){const t=e[0]+":"+e[1];return!!e[2]&&La(t)}}return!1}function q_(r){if(ir(r,!1))try{return typeof new URL(r)<"u"}catch{return!1}return!1}function z_(r){var e;return(e=r?.proposer)==null?void 0:e.publicKey}function H_(r){return r?.topic}function W_(r,e){let t=null;return ir(r?.publicKey,!1)||(t=ue("MISSING_OR_INVALID",`${e} controller public key should be a string`)),t}function ip(r){let e=!0;return En(r)?r.length&&(e=r.every(t=>ir(t,!1))):e=!1,e}function K_(r,e,t){let n=null;return En(e)&&e.length?e.forEach(i=>{n||La(i)||(n=It("UNSUPPORTED_CHAINS",`${t}, chain ${i} should be a string and conform to "namespace:chainId" format`))}):La(r)||(n=It("UNSUPPORTED_CHAINS",`${t}, chains must be defined as "namespace:chainId" e.g. "eip155:1": {...} in the namespace key OR as an array of CAIP-2 chainIds e.g. eip155: { chains: ["eip155:1", "eip155:5"] }`)),n}function V_(r,e,t){let n=null;return Object.entries(r).forEach(([i,a])=>{if(n)return;const c=K_(i,q0(i,a),`${e} ${t}`);c&&(n=c)}),n}function G_(r,e){let t=null;return En(r)?r.forEach(n=>{t||k_(n)||(t=It("UNSUPPORTED_ACCOUNTS",`${e}, account ${n} should be a string and conform to "namespace:chainId:address" format`))}):t=It("UNSUPPORTED_ACCOUNTS",`${e}, accounts should be an array of strings conforming to "namespace:chainId:address" format`),t}function Y_(r,e){let t=null;return Object.values(r).forEach(n=>{if(t)return;const i=G_(n?.accounts,`${e} namespace`);i&&(t=i)}),t}function J_(r,e){let t=null;return ip(r?.methods)?ip(r?.events)||(t=It("UNSUPPORTED_EVENTS",`${e}, events should be an array of strings or empty array for no events`)):t=It("UNSUPPORTED_METHODS",`${e}, methods should be an array of strings or empty array for no methods`),t}function sp(r,e){let t=null;return Object.values(r).forEach(n=>{if(t)return;const i=J_(n,`${e}, namespace`);i&&(t=i)}),t}function Z_(r,e,t){let n=null;if(r&&xo(r)){const i=sp(r,e);i&&(n=i);const a=V_(r,e,t);a&&(n=a)}else n=ue("MISSING_OR_INVALID",`${e}, ${t} should be an object with data`);return n}function hu(r,e){let t=null;if(r&&xo(r)){const n=sp(r,e);n&&(t=n);const i=Y_(r,e);i&&(t=i)}else t=ue("MISSING_OR_INVALID",`${e}, namespaces should be an object with data`);return t}function op(r){return ir(r.protocol,!0)}function Q_(r,e){let t=!1;return e&&!r?t=!0:r&&En(r)&&r.length&&r.forEach(n=>{t=op(n)}),t}function X_(r){return typeof r=="number"}function Rr(r){return typeof r<"u"&&typeof r!==null}function e3(r){return!(!r||typeof r!="object"||!r.code||!uu(r.code,!1)||!r.message||!ir(r.message,!1))}function t3(r){return!(_r(r)||!ir(r.method,!1))}function r3(r){return!(_r(r)||_r(r.result)&&_r(r.error)||!uu(r.id,!1)||!ir(r.jsonrpc,!1))}function n3(r){return!(_r(r)||!ir(r.name,!1))}function ap(r,e){return!(!La(e)||!L_(r).includes(e))}function i3(r,e,t){return ir(t,!1)?M_(r,e).includes(t):!1}function s3(r,e,t){return ir(t,!1)?U_(r,e).includes(t):!1}function cp(r,e,t){let n=null;const i=o3(r),a=a3(e),c=Object.keys(i),u=Object.keys(a),f=lp(Object.keys(r)),h=lp(Object.keys(e)),m=f.filter(w=>!h.includes(w));return m.length&&(n=ue("NON_CONFORMING_NAMESPACES",`${t} namespaces keys don't satisfy requiredNamespaces.
15
15
  Required: ${m.toString()}
16
- Received: ${Object.keys(e).toString()}`)),Li(c,u)||(n=he("NON_CONFORMING_NAMESPACES",`${t} namespaces chains don't satisfy required namespaces.
16
+ Received: ${Object.keys(e).toString()}`)),Mi(c,u)||(n=ue("NON_CONFORMING_NAMESPACES",`${t} namespaces chains don't satisfy required namespaces.
17
17
  Required: ${c.toString()}
18
- Approved: ${u.toString()}`)),Object.keys(e).forEach(y=>{if(!y.includes(":")||n)return;const w=xs(e[y].accounts);w.includes(y)||(n=he("NON_CONFORMING_NAMESPACES",`${t} namespaces accounts don't satisfy namespace accounts for ${y}
19
- Required: ${y}
20
- Approved: ${w.toString()}`))}),c.forEach(y=>{n||(Li(i[y].methods,a[y].methods)?Li(i[y].events,a[y].events)||(n=he("NON_CONFORMING_NAMESPACES",`${t} namespaces events don't satisfy namespace events for ${y}`)):n=he("NON_CONFORMING_NAMESPACES",`${t} namespaces methods don't satisfy namespace methods for ${y}`))}),n}function n3(r){const e={};return Object.keys(r).forEach(t=>{var n;t.includes(":")?e[t]=r[t]:(n=r[t].chains)==null||n.forEach(i=>{e[i]={methods:r[t].methods,events:r[t].events}})}),e}function lp(r){return[...new Set(r.map(e=>e.includes(":")?e.split(":")[0]:e))]}function i3(r){const e={};return Object.keys(r).forEach(t=>{if(t.includes(":"))e[t]=r[t];else{const n=xs(r[t].accounts);n?.forEach(i=>{e[i]={accounts:r[t].accounts.filter(a=>a.includes(`${i}:`)),methods:r[t].methods,events:r[t].events}})}}),e}function s3(r,e){return hu(r,!1)&&r<=e.max&&r>=e.min}function up(){const r=yo();return new Promise(e=>{switch(r){case qr.browser:e(o3());break;case qr.reactNative:e(a3());break;case qr.node:e(c3());break;default:e(!0)}})}function o3(){return _s()&&navigator?.onLine}async function a3(){if(bs()&&typeof global<"u"&&global!=null&&global.NetInfo){const r=await(global==null?void 0:global.NetInfo.fetch());return r?.isConnected}return!0}function c3(){return!0}function l3(r){switch(yo()){case qr.browser:u3(r);break;case qr.reactNative:h3(r);break}}function u3(r){!bs()&&_s()&&(window.addEventListener("online",()=>r(!0)),window.addEventListener("offline",()=>r(!1)))}function h3(r){bs()&&typeof global<"u"&&global!=null&&global.NetInfo&&global?.NetInfo.addEventListener(e=>r(e?.isConnected))}const fu={};class Ua{static get(e){return fu[e]}static set(e,t){fu[e]=t}static delete(e){delete fu[e]}}const f3=/"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,d3=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,p3=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/;function g3(r,e){if(r==="__proto__"||r==="constructor"&&e&&typeof e=="object"&&"prototype"in e){m3(r);return}return e}function m3(r){console.warn(`[destr] Dropping "${r}" key to prevent prototype pollution.`)}function ja(r,e={}){if(typeof r!="string")return r;const t=r.trim();if(r[0]==='"'&&r.at(-1)==='"'&&!r.includes("\\"))return t.slice(1,-1);if(t.length<=9){const n=t.toLowerCase();if(n==="true")return!0;if(n==="false")return!1;if(n==="undefined")return;if(n==="null")return null;if(n==="nan")return Number.NaN;if(n==="infinity")return Number.POSITIVE_INFINITY;if(n==="-infinity")return Number.NEGATIVE_INFINITY}if(!p3.test(r)){if(e.strict)throw new SyntaxError("[destr] Invalid JSON");return r}try{if(f3.test(r)||d3.test(r)){if(e.strict)throw new Error("[destr] Possible prototype pollution");return JSON.parse(r,g3)}return JSON.parse(r)}catch(n){if(e.strict)throw n;return r}}function v3(r){return!r||typeof r.then!="function"?Promise.resolve(r):r}function sr(r,...e){try{return v3(r(...e))}catch(t){return Promise.reject(t)}}function w3(r){const e=typeof r;return r===null||e!=="object"&&e!=="function"}function y3(r){const e=Object.getPrototypeOf(r);return!e||e.isPrototypeOf(Object)}function Fa(r){if(w3(r))return String(r);if(y3(r)||Array.isArray(r))return JSON.stringify(r);if(typeof r.toJSON=="function")return Fa(r.toJSON());throw new Error("[unstorage] Cannot stringify value!")}function hp(){if(typeof Buffer===void 0)throw new TypeError("[unstorage] Buffer is not supported!")}const du="base64:";function b3(r){if(typeof r=="string")return r;hp();const e=Buffer.from(r).toString("base64");return du+e}function _3(r){return typeof r!="string"||!r.startsWith(du)?r:(hp(),Buffer.from(r.slice(du.length),"base64"))}function Rr(r){return r?r.split("?")[0].replace(/[/\\]/g,":").replace(/:+/g,":").replace(/^:|:$/g,""):""}function E3(...r){return Rr(r.join(":"))}function Ba(r){return r=Rr(r),r?r+":":""}function kT(r){return r}const x3="memory",I3=()=>{const r=new Map;return{name:x3,options:{},hasItem(e){return r.has(e)},getItem(e){return r.get(e)||null},getItemRaw(e){return r.get(e)||null},setItem(e,t){r.set(e,t)},setItemRaw(e,t){r.set(e,t)},removeItem(e){r.delete(e)},getKeys(){return Array.from(r.keys())},clear(){r.clear()},dispose(){r.clear()}}};function D3(r={}){const e={mounts:{"":r.driver||I3()},mountpoints:[""],watching:!1,watchListeners:[],unwatch:{}},t=h=>{for(const m of e.mountpoints)if(h.startsWith(m))return{base:m,relativeKey:h.slice(m.length),driver:e.mounts[m]};return{base:"",relativeKey:h,driver:e.mounts[""]}},n=(h,m)=>e.mountpoints.filter(y=>y.startsWith(h)||m&&h.startsWith(y)).map(y=>({relativeBase:h.length>y.length?h.slice(y.length):void 0,mountpoint:y,driver:e.mounts[y]})),i=(h,m)=>{if(e.watching){m=Rr(m);for(const y of e.watchListeners)y(h,m)}},a=async()=>{if(!e.watching){e.watching=!0;for(const h in e.mounts)e.unwatch[h]=await fp(e.mounts[h],i,h)}},c=async()=>{if(e.watching){for(const h in e.unwatch)await e.unwatch[h]();e.unwatch={},e.watching=!1}},u=(h,m,y)=>{const w=new Map,E=I=>{let T=w.get(I.base);return T||(T={driver:I.driver,base:I.base,items:[]},w.set(I.base,T)),T};for(const I of h){const T=typeof I=="string",U=Rr(T?I:I.key),F=T?void 0:I.value,$=T||!I.options?m:{...m,...I.options},P=t(U);E(P).items.push({key:U,value:F,relativeKey:P.relativeKey,options:$})}return Promise.all([...w.values()].map(I=>y(I))).then(I=>I.flat())},d={hasItem(h,m={}){h=Rr(h);const{relativeKey:y,driver:w}=t(h);return sr(w.hasItem,y,m)},getItem(h,m={}){h=Rr(h);const{relativeKey:y,driver:w}=t(h);return sr(w.getItem,y,m).then(E=>ja(E))},getItems(h,m){return u(h,m,y=>y.driver.getItems?sr(y.driver.getItems,y.items.map(w=>({key:w.relativeKey,options:w.options})),m).then(w=>w.map(E=>({key:E3(y.base,E.key),value:ja(E.value)}))):Promise.all(y.items.map(w=>sr(y.driver.getItem,w.relativeKey,w.options).then(E=>({key:w.key,value:ja(E)})))))},getItemRaw(h,m={}){h=Rr(h);const{relativeKey:y,driver:w}=t(h);return w.getItemRaw?sr(w.getItemRaw,y,m):sr(w.getItem,y,m).then(E=>_3(E))},async setItem(h,m,y={}){if(m===void 0)return d.removeItem(h);h=Rr(h);const{relativeKey:w,driver:E}=t(h);E.setItem&&(await sr(E.setItem,w,Fa(m),y),E.watch||i("update",h))},async setItems(h,m){await u(h,m,async y=>{y.driver.setItems&&await sr(y.driver.setItems,y.items.map(w=>({key:w.relativeKey,value:Fa(w.value),options:w.options})),m),y.driver.setItem&&await Promise.all(y.items.map(w=>sr(y.driver.setItem,w.relativeKey,Fa(w.value),w.options)))})},async setItemRaw(h,m,y={}){if(m===void 0)return d.removeItem(h,y);h=Rr(h);const{relativeKey:w,driver:E}=t(h);if(E.setItemRaw)await sr(E.setItemRaw,w,m,y);else if(E.setItem)await sr(E.setItem,w,b3(m),y);else return;E.watch||i("update",h)},async removeItem(h,m={}){typeof m=="boolean"&&(m={removeMeta:m}),h=Rr(h);const{relativeKey:y,driver:w}=t(h);w.removeItem&&(await sr(w.removeItem,y,m),(m.removeMeta||m.removeMata)&&await sr(w.removeItem,y+"$",m),w.watch||i("remove",h))},async getMeta(h,m={}){typeof m=="boolean"&&(m={nativeOnly:m}),h=Rr(h);const{relativeKey:y,driver:w}=t(h),E=Object.create(null);if(w.getMeta&&Object.assign(E,await sr(w.getMeta,y,m)),!m.nativeOnly){const I=await sr(w.getItem,y+"$",m).then(T=>ja(T));I&&typeof I=="object"&&(typeof I.atime=="string"&&(I.atime=new Date(I.atime)),typeof I.mtime=="string"&&(I.mtime=new Date(I.mtime)),Object.assign(E,I))}return E},setMeta(h,m,y={}){return this.setItem(h+"$",m,y)},removeMeta(h,m={}){return this.removeItem(h+"$",m)},async getKeys(h,m={}){h=Ba(h);const y=n(h,!0);let w=[];const E=[];for(const I of y){const U=(await sr(I.driver.getKeys,I.relativeBase,m)).map(F=>I.mountpoint+Rr(F)).filter(F=>!w.some($=>F.startsWith($)));E.push(...U),w=[I.mountpoint,...w.filter(F=>!F.startsWith(I.mountpoint))]}return h?E.filter(I=>I.startsWith(h)&&!I.endsWith("$")):E.filter(I=>!I.endsWith("$"))},async clear(h,m={}){h=Ba(h),await Promise.all(n(h,!1).map(async y=>{if(y.driver.clear)return sr(y.driver.clear,y.relativeBase,m);if(y.driver.removeItem){const w=await y.driver.getKeys(y.relativeBase||"",m);return Promise.all(w.map(E=>y.driver.removeItem(E,m)))}}))},async dispose(){await Promise.all(Object.values(e.mounts).map(h=>dp(h)))},async watch(h){return await a(),e.watchListeners.push(h),async()=>{e.watchListeners=e.watchListeners.filter(m=>m!==h),e.watchListeners.length===0&&await c()}},async unwatch(){e.watchListeners=[],await c()},mount(h,m){if(h=Ba(h),h&&e.mounts[h])throw new Error(`already mounted at ${h}`);return h&&(e.mountpoints.push(h),e.mountpoints.sort((y,w)=>w.length-y.length)),e.mounts[h]=m,e.watching&&Promise.resolve(fp(m,i,h)).then(y=>{e.unwatch[h]=y}).catch(console.error),d},async unmount(h,m=!0){h=Ba(h),!(!h||!e.mounts[h])&&(e.watching&&h in e.unwatch&&(e.unwatch[h](),delete e.unwatch[h]),m&&await dp(e.mounts[h]),e.mountpoints=e.mountpoints.filter(y=>y!==h),delete e.mounts[h])},getMount(h=""){h=Rr(h)+":";const m=t(h);return{driver:m.driver,base:m.base}},getMounts(h="",m={}){return h=Rr(h),n(h,m.parents).map(w=>({driver:w.driver,base:w.mountpoint}))}};return d}function fp(r,e,t){return r.watch?r.watch((n,i)=>e(n,t+i)):()=>{}}async function dp(r){typeof r.dispose=="function"&&await sr(r.dispose)}function Mi(r){return new Promise((e,t)=>{r.oncomplete=r.onsuccess=()=>e(r.result),r.onabort=r.onerror=()=>t(r.error)})}function pp(r,e){const t=indexedDB.open(r);t.onupgradeneeded=()=>t.result.createObjectStore(e);const n=Mi(t);return(i,a)=>n.then(c=>a(c.transaction(e,i).objectStore(e)))}let pu;function Eo(){return pu||(pu=pp("keyval-store","keyval")),pu}function gp(r,e=Eo()){return e("readonly",t=>Mi(t.get(r)))}function S3(r,e,t=Eo()){return t("readwrite",n=>(n.put(e,r),Mi(n.transaction)))}function O3(r,e=Eo()){return e("readwrite",t=>(t.delete(r),Mi(t.transaction)))}function C3(r=Eo()){return r("readwrite",e=>(e.clear(),Mi(e.transaction)))}function $3(r,e){return r.openCursor().onsuccess=function(){this.result&&(e(this.result),this.result.continue())},Mi(r.transaction)}function A3(r=Eo()){return r("readonly",e=>{if(e.getAllKeys)return Mi(e.getAllKeys());const t=[];return $3(e,n=>t.push(n.key)).then(()=>t)})}const P3=r=>JSON.stringify(r,(e,t)=>typeof t=="bigint"?t.toString()+"n":t),T3=r=>{const e=/([\[:])?(\d{17,}|(?:[9](?:[1-9]07199254740991|0[1-9]7199254740991|00[8-9]199254740991|007[2-9]99254740991|007199[3-9]54740991|0071992[6-9]4740991|00719925[5-9]740991|007199254[8-9]40991|0071992547[5-9]0991|00719925474[1-9]991|00719925474099[2-9])))([,\}\]])/g,t=r.replace(e,'$1"$2n"$3');return JSON.parse(t,(n,i)=>typeof i=="string"&&i.match(/^\d+n$/)?BigInt(i.substring(0,i.length-1)):i)};function xo(r){if(typeof r!="string")throw new Error(`Cannot safe json parse value of type ${typeof r}`);try{return T3(r)}catch{return r}}function Ui(r){return typeof r=="string"?r:P3(r)||""}const R3="idb-keyval";var N3=(r={})=>{const e=r.base&&r.base.length>0?`${r.base}:`:"",t=i=>e+i;let n;return r.dbName&&r.storeName&&(n=pp(r.dbName,r.storeName)),{name:R3,options:r,async hasItem(i){return!(typeof await gp(t(i),n)>"u")},async getItem(i){return await gp(t(i),n)??null},setItem(i,a){return S3(t(i),a,n)},removeItem(i){return O3(t(i),n)},getKeys(){return A3(n)},clear(){return C3(n)}}};const L3="WALLET_CONNECT_V2_INDEXED_DB",M3="keyvaluestorage";class U3{constructor(){this.indexedDb=D3({driver:N3({dbName:L3,storeName:M3})})}async getKeys(){return this.indexedDb.getKeys()}async getEntries(){return(await this.indexedDb.getItems(await this.indexedDb.getKeys())).map(e=>[e.key,e.value])}async getItem(e){const t=await this.indexedDb.getItem(e);if(t!==null)return t}async setItem(e,t){await this.indexedDb.setItem(e,Ui(t))}async removeItem(e){await this.indexedDb.removeItem(e)}}var gu=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},ka={exports:{}};(function(){let r;function e(){}r=e,r.prototype.getItem=function(t){return this.hasOwnProperty(t)?String(this[t]):null},r.prototype.setItem=function(t,n){this[t]=String(n)},r.prototype.removeItem=function(t){delete this[t]},r.prototype.clear=function(){const t=this;Object.keys(t).forEach(function(n){t[n]=void 0,delete t[n]})},r.prototype.key=function(t){return t=t||0,Object.keys(this)[t]},r.prototype.__defineGetter__("length",function(){return Object.keys(this).length}),typeof gu<"u"&&gu.localStorage?ka.exports=gu.localStorage:typeof window<"u"&&window.localStorage?ka.exports=window.localStorage:ka.exports=new e})();function j3(r){var e;return[r[0],xo((e=r[1])!=null?e:"")]}class F3{constructor(){this.localStorage=ka.exports}async getKeys(){return Object.keys(this.localStorage)}async getEntries(){return Object.entries(this.localStorage).map(j3)}async getItem(e){const t=this.localStorage.getItem(e);if(t!==null)return xo(t)}async setItem(e,t){this.localStorage.setItem(e,Ui(t))}async removeItem(e){this.localStorage.removeItem(e)}}const B3="wc_storage_version",mp=1,k3=async(r,e,t)=>{const n=B3,i=await e.getItem(n);if(i&&i>=mp){t(e);return}const a=await r.getKeys();if(!a.length){t(e);return}const c=[];for(;a.length;){const u=a.shift();if(!u)continue;const d=u.toLowerCase();if(d.includes("wc@")||d.includes("walletconnect")||d.includes("wc_")||d.includes("wallet_connect")){const h=await r.getItem(u);await e.setItem(u,h),c.push(u)}}await e.setItem(n,mp),t(e),H3(r,c)},H3=async(r,e)=>{e.length&&e.forEach(async t=>{await r.removeItem(t)})};class z3{constructor(){this.initialized=!1,this.setInitialized=t=>{this.storage=t,this.initialized=!0};const e=new F3;this.storage=e;try{const t=new U3;k3(e,t,this.setInitialized)}catch{this.initialized=!0}}async getKeys(){return await this.initialize(),this.storage.getKeys()}async getEntries(){return await this.initialize(),this.storage.getEntries()}async getItem(e){return await this.initialize(),this.storage.getItem(e)}async setItem(e,t){return await this.initialize(),this.storage.setItem(e,t)}async removeItem(e){return await this.initialize(),this.storage.removeItem(e)}async initialize(){this.initialized||await new Promise(e=>{const t=setInterval(()=>{this.initialized&&(clearInterval(t),e())},20)})}}var Ds={};/*! *****************************************************************************
18
+ Approved: ${u.toString()}`)),Object.keys(e).forEach(w=>{if(!w.includes(":")||n)return;const y=Is(e[w].accounts);y.includes(w)||(n=ue("NON_CONFORMING_NAMESPACES",`${t} namespaces accounts don't satisfy namespace accounts for ${w}
19
+ Required: ${w}
20
+ Approved: ${y.toString()}`))}),c.forEach(w=>{n||(Mi(i[w].methods,a[w].methods)?Mi(i[w].events,a[w].events)||(n=ue("NON_CONFORMING_NAMESPACES",`${t} namespaces events don't satisfy namespace events for ${w}`)):n=ue("NON_CONFORMING_NAMESPACES",`${t} namespaces methods don't satisfy namespace methods for ${w}`))}),n}function o3(r){const e={};return Object.keys(r).forEach(t=>{var n;t.includes(":")?e[t]=r[t]:(n=r[t].chains)==null||n.forEach(i=>{e[i]={methods:r[t].methods,events:r[t].events}})}),e}function lp(r){return[...new Set(r.map(e=>e.includes(":")?e.split(":")[0]:e))]}function a3(r){const e={};return Object.keys(r).forEach(t=>{if(t.includes(":"))e[t]=r[t];else{const n=Is(r[t].accounts);n?.forEach(i=>{e[i]={accounts:r[t].accounts.filter(a=>a.includes(`${i}:`)),methods:r[t].methods,events:r[t].events}})}}),e}function c3(r,e){return uu(r,!1)&&r<=e.max&&r>=e.min}function up(){const r=bo();return new Promise(e=>{switch(r){case Hr.browser:e(l3());break;case Hr.reactNative:e(u3());break;case Hr.node:e(h3());break;default:e(!0)}})}function l3(){return Es()&&navigator?.onLine}async function u3(){if(_s()&&typeof global<"u"&&global!=null&&global.NetInfo){const r=await(global==null?void 0:global.NetInfo.fetch());return r?.isConnected}return!0}function h3(){return!0}function f3(r){switch(bo()){case Hr.browser:d3(r);break;case Hr.reactNative:p3(r);break}}function d3(r){!_s()&&Es()&&(window.addEventListener("online",()=>r(!0)),window.addEventListener("offline",()=>r(!1)))}function p3(r){_s()&&typeof global<"u"&&global!=null&&global.NetInfo&&global?.NetInfo.addEventListener(e=>r(e?.isConnected))}const fu={};class Ma{static get(e){return fu[e]}static set(e,t){fu[e]=t}static delete(e){delete fu[e]}}const g3=/"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,m3=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,v3=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/;function y3(r,e){if(r==="__proto__"||r==="constructor"&&e&&typeof e=="object"&&"prototype"in e){w3(r);return}return e}function w3(r){console.warn(`[destr] Dropping "${r}" key to prevent prototype pollution.`)}function Ua(r,e={}){if(typeof r!="string")return r;const t=r.trim();if(r[0]==='"'&&r.at(-1)==='"'&&!r.includes("\\"))return t.slice(1,-1);if(t.length<=9){const n=t.toLowerCase();if(n==="true")return!0;if(n==="false")return!1;if(n==="undefined")return;if(n==="null")return null;if(n==="nan")return Number.NaN;if(n==="infinity")return Number.POSITIVE_INFINITY;if(n==="-infinity")return Number.NEGATIVE_INFINITY}if(!v3.test(r)){if(e.strict)throw new SyntaxError("[destr] Invalid JSON");return r}try{if(g3.test(r)||m3.test(r)){if(e.strict)throw new Error("[destr] Possible prototype pollution");return JSON.parse(r,y3)}return JSON.parse(r)}catch(n){if(e.strict)throw n;return r}}function b3(r){return!r||typeof r.then!="function"?Promise.resolve(r):r}function sr(r,...e){try{return b3(r(...e))}catch(t){return Promise.reject(t)}}function _3(r){const e=typeof r;return r===null||e!=="object"&&e!=="function"}function E3(r){const e=Object.getPrototypeOf(r);return!e||e.isPrototypeOf(Object)}function ja(r){if(_3(r))return String(r);if(E3(r)||Array.isArray(r))return JSON.stringify(r);if(typeof r.toJSON=="function")return ja(r.toJSON());throw new Error("[unstorage] Cannot stringify value!")}function hp(){if(typeof Buffer===void 0)throw new TypeError("[unstorage] Buffer is not supported!")}const du="base64:";function x3(r){if(typeof r=="string")return r;hp();const e=Buffer.from(r).toString("base64");return du+e}function I3(r){return typeof r!="string"||!r.startsWith(du)?r:(hp(),Buffer.from(r.slice(du.length),"base64"))}function Nr(r){return r?r.split("?")[0].replace(/[/\\]/g,":").replace(/:+/g,":").replace(/^:|:$/g,""):""}function D3(...r){return Nr(r.join(":"))}function Fa(r){return r=Nr(r),r?r+":":""}function zT(r){return r}const S3="memory",C3=()=>{const r=new Map;return{name:S3,options:{},hasItem(e){return r.has(e)},getItem(e){return r.get(e)||null},getItemRaw(e){return r.get(e)||null},setItem(e,t){r.set(e,t)},setItemRaw(e,t){r.set(e,t)},removeItem(e){r.delete(e)},getKeys(){return Array.from(r.keys())},clear(){r.clear()},dispose(){r.clear()}}};function O3(r={}){const e={mounts:{"":r.driver||C3()},mountpoints:[""],watching:!1,watchListeners:[],unwatch:{}},t=h=>{for(const m of e.mountpoints)if(h.startsWith(m))return{base:m,relativeKey:h.slice(m.length),driver:e.mounts[m]};return{base:"",relativeKey:h,driver:e.mounts[""]}},n=(h,m)=>e.mountpoints.filter(w=>w.startsWith(h)||m&&h.startsWith(w)).map(w=>({relativeBase:h.length>w.length?h.slice(w.length):void 0,mountpoint:w,driver:e.mounts[w]})),i=(h,m)=>{if(e.watching){m=Nr(m);for(const w of e.watchListeners)w(h,m)}},a=async()=>{if(!e.watching){e.watching=!0;for(const h in e.mounts)e.unwatch[h]=await fp(e.mounts[h],i,h)}},c=async()=>{if(e.watching){for(const h in e.unwatch)await e.unwatch[h]();e.unwatch={},e.watching=!1}},u=(h,m,w)=>{const y=new Map,x=S=>{let P=y.get(S.base);return P||(P={driver:S.driver,base:S.base,items:[]},y.set(S.base,P)),P};for(const S of h){const P=typeof S=="string",U=Nr(P?S:S.key),j=P?void 0:S.value,A=P||!S.options?m:{...m,...S.options},T=t(U);x(T).items.push({key:U,value:j,relativeKey:T.relativeKey,options:A})}return Promise.all([...y.values()].map(S=>w(S))).then(S=>S.flat())},f={hasItem(h,m={}){h=Nr(h);const{relativeKey:w,driver:y}=t(h);return sr(y.hasItem,w,m)},getItem(h,m={}){h=Nr(h);const{relativeKey:w,driver:y}=t(h);return sr(y.getItem,w,m).then(x=>Ua(x))},getItems(h,m){return u(h,m,w=>w.driver.getItems?sr(w.driver.getItems,w.items.map(y=>({key:y.relativeKey,options:y.options})),m).then(y=>y.map(x=>({key:D3(w.base,x.key),value:Ua(x.value)}))):Promise.all(w.items.map(y=>sr(w.driver.getItem,y.relativeKey,y.options).then(x=>({key:y.key,value:Ua(x)})))))},getItemRaw(h,m={}){h=Nr(h);const{relativeKey:w,driver:y}=t(h);return y.getItemRaw?sr(y.getItemRaw,w,m):sr(y.getItem,w,m).then(x=>I3(x))},async setItem(h,m,w={}){if(m===void 0)return f.removeItem(h);h=Nr(h);const{relativeKey:y,driver:x}=t(h);x.setItem&&(await sr(x.setItem,y,ja(m),w),x.watch||i("update",h))},async setItems(h,m){await u(h,m,async w=>{w.driver.setItems&&await sr(w.driver.setItems,w.items.map(y=>({key:y.relativeKey,value:ja(y.value),options:y.options})),m),w.driver.setItem&&await Promise.all(w.items.map(y=>sr(w.driver.setItem,y.relativeKey,ja(y.value),y.options)))})},async setItemRaw(h,m,w={}){if(m===void 0)return f.removeItem(h,w);h=Nr(h);const{relativeKey:y,driver:x}=t(h);if(x.setItemRaw)await sr(x.setItemRaw,y,m,w);else if(x.setItem)await sr(x.setItem,y,x3(m),w);else return;x.watch||i("update",h)},async removeItem(h,m={}){typeof m=="boolean"&&(m={removeMeta:m}),h=Nr(h);const{relativeKey:w,driver:y}=t(h);y.removeItem&&(await sr(y.removeItem,w,m),(m.removeMeta||m.removeMata)&&await sr(y.removeItem,w+"$",m),y.watch||i("remove",h))},async getMeta(h,m={}){typeof m=="boolean"&&(m={nativeOnly:m}),h=Nr(h);const{relativeKey:w,driver:y}=t(h),x=Object.create(null);if(y.getMeta&&Object.assign(x,await sr(y.getMeta,w,m)),!m.nativeOnly){const S=await sr(y.getItem,w+"$",m).then(P=>Ua(P));S&&typeof S=="object"&&(typeof S.atime=="string"&&(S.atime=new Date(S.atime)),typeof S.mtime=="string"&&(S.mtime=new Date(S.mtime)),Object.assign(x,S))}return x},setMeta(h,m,w={}){return this.setItem(h+"$",m,w)},removeMeta(h,m={}){return this.removeItem(h+"$",m)},async getKeys(h,m={}){h=Fa(h);const w=n(h,!0);let y=[];const x=[];for(const S of w){const U=(await sr(S.driver.getKeys,S.relativeBase,m)).map(j=>S.mountpoint+Nr(j)).filter(j=>!y.some(A=>j.startsWith(A)));x.push(...U),y=[S.mountpoint,...y.filter(j=>!j.startsWith(S.mountpoint))]}return h?x.filter(S=>S.startsWith(h)&&!S.endsWith("$")):x.filter(S=>!S.endsWith("$"))},async clear(h,m={}){h=Fa(h),await Promise.all(n(h,!1).map(async w=>{if(w.driver.clear)return sr(w.driver.clear,w.relativeBase,m);if(w.driver.removeItem){const y=await w.driver.getKeys(w.relativeBase||"",m);return Promise.all(y.map(x=>w.driver.removeItem(x,m)))}}))},async dispose(){await Promise.all(Object.values(e.mounts).map(h=>dp(h)))},async watch(h){return await a(),e.watchListeners.push(h),async()=>{e.watchListeners=e.watchListeners.filter(m=>m!==h),e.watchListeners.length===0&&await c()}},async unwatch(){e.watchListeners=[],await c()},mount(h,m){if(h=Fa(h),h&&e.mounts[h])throw new Error(`already mounted at ${h}`);return h&&(e.mountpoints.push(h),e.mountpoints.sort((w,y)=>y.length-w.length)),e.mounts[h]=m,e.watching&&Promise.resolve(fp(m,i,h)).then(w=>{e.unwatch[h]=w}).catch(console.error),f},async unmount(h,m=!0){h=Fa(h),!(!h||!e.mounts[h])&&(e.watching&&h in e.unwatch&&(e.unwatch[h](),delete e.unwatch[h]),m&&await dp(e.mounts[h]),e.mountpoints=e.mountpoints.filter(w=>w!==h),delete e.mounts[h])},getMount(h=""){h=Nr(h)+":";const m=t(h);return{driver:m.driver,base:m.base}},getMounts(h="",m={}){return h=Nr(h),n(h,m.parents).map(y=>({driver:y.driver,base:y.mountpoint}))}};return f}function fp(r,e,t){return r.watch?r.watch((n,i)=>e(n,t+i)):()=>{}}async function dp(r){typeof r.dispose=="function"&&await sr(r.dispose)}function Ui(r){return new Promise((e,t)=>{r.oncomplete=r.onsuccess=()=>e(r.result),r.onabort=r.onerror=()=>t(r.error)})}function pp(r,e){const t=indexedDB.open(r);t.onupgradeneeded=()=>t.result.createObjectStore(e);const n=Ui(t);return(i,a)=>n.then(c=>a(c.transaction(e,i).objectStore(e)))}let pu;function Io(){return pu||(pu=pp("keyval-store","keyval")),pu}function gp(r,e=Io()){return e("readonly",t=>Ui(t.get(r)))}function $3(r,e,t=Io()){return t("readwrite",n=>(n.put(e,r),Ui(n.transaction)))}function A3(r,e=Io()){return e("readwrite",t=>(t.delete(r),Ui(t.transaction)))}function P3(r=Io()){return r("readwrite",e=>(e.clear(),Ui(e.transaction)))}function T3(r,e){return r.openCursor().onsuccess=function(){this.result&&(e(this.result),this.result.continue())},Ui(r.transaction)}function R3(r=Io()){return r("readonly",e=>{if(e.getAllKeys)return Ui(e.getAllKeys());const t=[];return T3(e,n=>t.push(n.key)).then(()=>t)})}const N3=r=>JSON.stringify(r,(e,t)=>typeof t=="bigint"?t.toString()+"n":t),L3=r=>{const e=/([\[:])?(\d{17,}|(?:[9](?:[1-9]07199254740991|0[1-9]7199254740991|00[8-9]199254740991|007[2-9]99254740991|007199[3-9]54740991|0071992[6-9]4740991|00719925[5-9]740991|007199254[8-9]40991|0071992547[5-9]0991|00719925474[1-9]991|00719925474099[2-9])))([,\}\]])/g,t=r.replace(e,'$1"$2n"$3');return JSON.parse(t,(n,i)=>typeof i=="string"&&i.match(/^\d+n$/)?BigInt(i.substring(0,i.length-1)):i)};function Do(r){if(typeof r!="string")throw new Error(`Cannot safe json parse value of type ${typeof r}`);try{return L3(r)}catch{return r}}function ji(r){return typeof r=="string"?r:N3(r)||""}const M3="idb-keyval";var U3=(r={})=>{const e=r.base&&r.base.length>0?`${r.base}:`:"",t=i=>e+i;let n;return r.dbName&&r.storeName&&(n=pp(r.dbName,r.storeName)),{name:M3,options:r,async hasItem(i){return!(typeof await gp(t(i),n)>"u")},async getItem(i){return await gp(t(i),n)??null},setItem(i,a){return $3(t(i),a,n)},removeItem(i){return A3(t(i),n)},getKeys(){return R3(n)},clear(){return P3(n)}}};const j3="WALLET_CONNECT_V2_INDEXED_DB",F3="keyvaluestorage";class B3{constructor(){this.indexedDb=O3({driver:U3({dbName:j3,storeName:F3})})}async getKeys(){return this.indexedDb.getKeys()}async getEntries(){return(await this.indexedDb.getItems(await this.indexedDb.getKeys())).map(e=>[e.key,e.value])}async getItem(e){const t=await this.indexedDb.getItem(e);if(t!==null)return t}async setItem(e,t){await this.indexedDb.setItem(e,ji(t))}async removeItem(e){await this.indexedDb.removeItem(e)}}var gu=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Ba={exports:{}};(function(){let r;function e(){}r=e,r.prototype.getItem=function(t){return this.hasOwnProperty(t)?String(this[t]):null},r.prototype.setItem=function(t,n){this[t]=String(n)},r.prototype.removeItem=function(t){delete this[t]},r.prototype.clear=function(){const t=this;Object.keys(t).forEach(function(n){t[n]=void 0,delete t[n]})},r.prototype.key=function(t){return t=t||0,Object.keys(this)[t]},r.prototype.__defineGetter__("length",function(){return Object.keys(this).length}),typeof gu<"u"&&gu.localStorage?Ba.exports=gu.localStorage:typeof window<"u"&&window.localStorage?Ba.exports=window.localStorage:Ba.exports=new e})();function k3(r){var e;return[r[0],Do((e=r[1])!=null?e:"")]}class q3{constructor(){this.localStorage=Ba.exports}async getKeys(){return Object.keys(this.localStorage)}async getEntries(){return Object.entries(this.localStorage).map(k3)}async getItem(e){const t=this.localStorage.getItem(e);if(t!==null)return Do(t)}async setItem(e,t){this.localStorage.setItem(e,ji(t))}async removeItem(e){this.localStorage.removeItem(e)}}const z3="wc_storage_version",mp=1,H3=async(r,e,t)=>{const n=z3,i=await e.getItem(n);if(i&&i>=mp){t(e);return}const a=await r.getKeys();if(!a.length){t(e);return}const c=[];for(;a.length;){const u=a.shift();if(!u)continue;const f=u.toLowerCase();if(f.includes("wc@")||f.includes("walletconnect")||f.includes("wc_")||f.includes("wallet_connect")){const h=await r.getItem(u);await e.setItem(u,h),c.push(u)}}await e.setItem(n,mp),t(e),W3(r,c)},W3=async(r,e)=>{e.length&&e.forEach(async t=>{await r.removeItem(t)})};class K3{constructor(){this.initialized=!1,this.setInitialized=t=>{this.storage=t,this.initialized=!0};const e=new q3;this.storage=e;try{const t=new B3;H3(e,t,this.setInitialized)}catch{this.initialized=!0}}async getKeys(){return await this.initialize(),this.storage.getKeys()}async getEntries(){return await this.initialize(),this.storage.getEntries()}async getItem(e){return await this.initialize(),this.storage.getItem(e)}async setItem(e,t){return await this.initialize(),this.storage.setItem(e,t)}async removeItem(e){return await this.initialize(),this.storage.removeItem(e)}async initialize(){this.initialized||await new Promise(e=>{const t=setInterval(()=>{this.initialized&&(clearInterval(t),e())},20)})}}var Ds={};/*! *****************************************************************************
21
21
  Copyright (c) Microsoft Corporation.
22
22
 
23
23
  Permission to use, copy, modify, and/or distribute this software for any
@@ -30,7 +30,7 @@
30
30
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
31
31
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
32
32
  PERFORMANCE OF THIS SOFTWARE.
33
- ***************************************************************************** */var mu=function(r,e){return mu=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)n.hasOwnProperty(i)&&(t[i]=n[i])},mu(r,e)};function q3(r,e){mu(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var vu=function(){return vu=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++){t=arguments[n];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e},vu.apply(this,arguments)};function W3(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(t[n[i]]=r[n[i]]);return t}function K3(r,e,t,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(r,e,t,n);else for(var u=r.length-1;u>=0;u--)(c=r[u])&&(a=(i<3?c(a):i>3?c(e,t,a):c(e,t))||a);return i>3&&a&&Object.defineProperty(e,t,a),a}function V3(r,e){return function(t,n){e(t,n,r)}}function G3(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)}function Y3(r,e,t,n){function i(a){return a instanceof t?a:new t(function(c){c(a)})}return new(t||(t=Promise))(function(a,c){function u(m){try{h(n.next(m))}catch(y){c(y)}}function d(m){try{h(n.throw(m))}catch(y){c(y)}}function h(m){m.done?a(m.value):i(m.value).then(u,d)}h((n=n.apply(r,e||[])).next())})}function J3(r,e){var t={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,i,a,c;return c={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function u(h){return function(m){return d([h,m])}}function d(h){if(n)throw new TypeError("Generator is already executing.");for(;t;)try{if(n=1,i&&(a=h[0]&2?i.return:h[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,h[1])).done)return a;switch(i=0,a&&(h=[h[0]&2,a.value]),h[0]){case 0:case 1:a=h;break;case 4:return t.label++,{value:h[1],done:!1};case 5:t.label++,i=h[1],h=[0];continue;case 7:h=t.ops.pop(),t.trys.pop();continue;default:if(a=t.trys,!(a=a.length>0&&a[a.length-1])&&(h[0]===6||h[0]===2)){t=0;continue}if(h[0]===3&&(!a||h[1]>a[0]&&h[1]<a[3])){t.label=h[1];break}if(h[0]===6&&t.label<a[1]){t.label=a[1],a=h;break}if(a&&t.label<a[2]){t.label=a[2],t.ops.push(h);break}a[2]&&t.ops.pop(),t.trys.pop();continue}h=e.call(r,t)}catch(m){h=[6,m],i=0}finally{n=a=0}if(h[0]&5)throw h[1];return{value:h[0]?h[1]:void 0,done:!0}}}function Z3(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}function Q3(r,e){for(var t in r)t!=="default"&&!e.hasOwnProperty(t)&&(e[t]=r[t])}function wu(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],n=0;if(t)return t.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function vp(r,e){var t=typeof Symbol=="function"&&r[Symbol.iterator];if(!t)return r;var n=t.call(r),i,a=[],c;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)a.push(i.value)}catch(u){c={error:u}}finally{try{i&&!i.done&&(t=n.return)&&t.call(n)}finally{if(c)throw c.error}}return a}function X3(){for(var r=[],e=0;e<arguments.length;e++)r=r.concat(vp(arguments[e]));return r}function e5(){for(var r=0,e=0,t=arguments.length;e<t;e++)r+=arguments[e].length;for(var n=Array(r),i=0,e=0;e<t;e++)for(var a=arguments[e],c=0,u=a.length;c<u;c++,i++)n[i]=a[c];return n}function Io(r){return this instanceof Io?(this.v=r,this):new Io(r)}function t5(r,e,t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=t.apply(r,e||[]),i,a=[];return i={},c("next"),c("throw"),c("return"),i[Symbol.asyncIterator]=function(){return this},i;function c(w){n[w]&&(i[w]=function(E){return new Promise(function(I,T){a.push([w,E,I,T])>1||u(w,E)})})}function u(w,E){try{d(n[w](E))}catch(I){y(a[0][3],I)}}function d(w){w.value instanceof Io?Promise.resolve(w.value.v).then(h,m):y(a[0][2],w)}function h(w){u("next",w)}function m(w){u("throw",w)}function y(w,E){w(E),a.shift(),a.length&&u(a[0][0],a[0][1])}}function r5(r){var e,t;return e={},n("next"),n("throw",function(i){throw i}),n("return"),e[Symbol.iterator]=function(){return this},e;function n(i,a){e[i]=r[i]?function(c){return(t=!t)?{value:Io(r[i](c)),done:i==="return"}:a?a(c):c}:a}}function n5(r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=r[Symbol.asyncIterator],t;return e?e.call(r):(r=typeof wu=="function"?wu(r):r[Symbol.iterator](),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(a){t[a]=r[a]&&function(c){return new Promise(function(u,d){c=r[a](c),i(u,d,c.done,c.value)})}}function i(a,c,u,d){Promise.resolve(d).then(function(h){a({value:h,done:u})},c)}}function i5(r,e){return Object.defineProperty?Object.defineProperty(r,"raw",{value:e}):r.raw=e,r}function s5(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)Object.hasOwnProperty.call(r,t)&&(e[t]=r[t]);return e.default=r,e}function o5(r){return r&&r.__esModule?r:{default:r}}function a5(r,e){if(!e.has(r))throw new TypeError("attempted to get private field on non-instance");return e.get(r)}function c5(r,e,t){if(!e.has(r))throw new TypeError("attempted to set private field on non-instance");return e.set(r,t),t}var l5=Object.freeze({__proto__:null,__extends:q3,get __assign(){return vu},__rest:W3,__decorate:K3,__param:V3,__metadata:G3,__awaiter:Y3,__generator:J3,__createBinding:Z3,__exportStar:Q3,__values:wu,__read:vp,__spread:X3,__spreadArrays:e5,__await:Io,__asyncGenerator:t5,__asyncDelegator:r5,__asyncValues:n5,__makeTemplateObject:i5,__importStar:s5,__importDefault:o5,__classPrivateFieldGet:a5,__classPrivateFieldSet:c5}),Ha=Ai(l5),Do={},yu={},So={};class ji{}var u5=Object.freeze({__proto__:null,IEvents:ji}),h5=Ai(u5),wp;function f5(){if(wp)return So;wp=1,Object.defineProperty(So,"__esModule",{value:!0}),So.IHeartBeat=void 0;const r=h5;class e extends r.IEvents{constructor(n){super()}}return So.IHeartBeat=e,So}var yp;function bp(){return yp||(yp=1,function(r){Object.defineProperty(r,"__esModule",{value:!0}),Ha.__exportStar(f5(),r)}(yu)),yu}var bu={},Fi={},_p;function d5(){if(_p)return Fi;_p=1,Object.defineProperty(Fi,"__esModule",{value:!0}),Fi.HEARTBEAT_EVENTS=Fi.HEARTBEAT_INTERVAL=void 0;const r=we;return Fi.HEARTBEAT_INTERVAL=r.FIVE_SECONDS,Fi.HEARTBEAT_EVENTS={pulse:"heartbeat_pulse"},Fi}var Ep;function xp(){return Ep||(Ep=1,function(r){Object.defineProperty(r,"__esModule",{value:!0}),Ha.__exportStar(d5(),r)}(bu)),bu}var Ip;function p5(){if(Ip)return Do;Ip=1,Object.defineProperty(Do,"__esModule",{value:!0}),Do.HeartBeat=void 0;const r=Ha,e=lr.exports,t=we,n=bp(),i=xp();class a extends n.IHeartBeat{constructor(u){super(u),this.events=new e.EventEmitter,this.interval=i.HEARTBEAT_INTERVAL,this.interval=u?.interval||i.HEARTBEAT_INTERVAL}static init(u){return r.__awaiter(this,void 0,void 0,function*(){const d=new a(u);return yield d.init(),d})}init(){return r.__awaiter(this,void 0,void 0,function*(){yield this.initialize()})}stop(){clearInterval(this.intervalRef)}on(u,d){this.events.on(u,d)}once(u,d){this.events.once(u,d)}off(u,d){this.events.off(u,d)}removeListener(u,d){this.events.removeListener(u,d)}initialize(){return r.__awaiter(this,void 0,void 0,function*(){this.intervalRef=setInterval(()=>this.pulse(),t.toMiliseconds(this.interval))})}pulse(){this.events.emit(i.HEARTBEAT_EVENTS.pulse)}}return Do.HeartBeat=a,Do}(function(r){Object.defineProperty(r,"__esModule",{value:!0});const e=Ha;e.__exportStar(p5(),r),e.__exportStar(bp(),r),e.__exportStar(xp(),r)})(Ds);var Xe={};/*! *****************************************************************************
33
+ ***************************************************************************** */var mu=function(r,e){return mu=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)n.hasOwnProperty(i)&&(t[i]=n[i])},mu(r,e)};function V3(r,e){mu(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var vu=function(){return vu=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++){t=arguments[n];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e},vu.apply(this,arguments)};function G3(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(t[n[i]]=r[n[i]]);return t}function Y3(r,e,t,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(r,e,t,n);else for(var u=r.length-1;u>=0;u--)(c=r[u])&&(a=(i<3?c(a):i>3?c(e,t,a):c(e,t))||a);return i>3&&a&&Object.defineProperty(e,t,a),a}function J3(r,e){return function(t,n){e(t,n,r)}}function Z3(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)}function Q3(r,e,t,n){function i(a){return a instanceof t?a:new t(function(c){c(a)})}return new(t||(t=Promise))(function(a,c){function u(m){try{h(n.next(m))}catch(w){c(w)}}function f(m){try{h(n.throw(m))}catch(w){c(w)}}function h(m){m.done?a(m.value):i(m.value).then(u,f)}h((n=n.apply(r,e||[])).next())})}function X3(r,e){var t={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,i,a,c;return c={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function u(h){return function(m){return f([h,m])}}function f(h){if(n)throw new TypeError("Generator is already executing.");for(;t;)try{if(n=1,i&&(a=h[0]&2?i.return:h[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,h[1])).done)return a;switch(i=0,a&&(h=[h[0]&2,a.value]),h[0]){case 0:case 1:a=h;break;case 4:return t.label++,{value:h[1],done:!1};case 5:t.label++,i=h[1],h=[0];continue;case 7:h=t.ops.pop(),t.trys.pop();continue;default:if(a=t.trys,!(a=a.length>0&&a[a.length-1])&&(h[0]===6||h[0]===2)){t=0;continue}if(h[0]===3&&(!a||h[1]>a[0]&&h[1]<a[3])){t.label=h[1];break}if(h[0]===6&&t.label<a[1]){t.label=a[1],a=h;break}if(a&&t.label<a[2]){t.label=a[2],t.ops.push(h);break}a[2]&&t.ops.pop(),t.trys.pop();continue}h=e.call(r,t)}catch(m){h=[6,m],i=0}finally{n=a=0}if(h[0]&5)throw h[1];return{value:h[0]?h[1]:void 0,done:!0}}}function e5(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}function t5(r,e){for(var t in r)t!=="default"&&!e.hasOwnProperty(t)&&(e[t]=r[t])}function yu(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],n=0;if(t)return t.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function vp(r,e){var t=typeof Symbol=="function"&&r[Symbol.iterator];if(!t)return r;var n=t.call(r),i,a=[],c;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)a.push(i.value)}catch(u){c={error:u}}finally{try{i&&!i.done&&(t=n.return)&&t.call(n)}finally{if(c)throw c.error}}return a}function r5(){for(var r=[],e=0;e<arguments.length;e++)r=r.concat(vp(arguments[e]));return r}function n5(){for(var r=0,e=0,t=arguments.length;e<t;e++)r+=arguments[e].length;for(var n=Array(r),i=0,e=0;e<t;e++)for(var a=arguments[e],c=0,u=a.length;c<u;c++,i++)n[i]=a[c];return n}function So(r){return this instanceof So?(this.v=r,this):new So(r)}function i5(r,e,t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=t.apply(r,e||[]),i,a=[];return i={},c("next"),c("throw"),c("return"),i[Symbol.asyncIterator]=function(){return this},i;function c(y){n[y]&&(i[y]=function(x){return new Promise(function(S,P){a.push([y,x,S,P])>1||u(y,x)})})}function u(y,x){try{f(n[y](x))}catch(S){w(a[0][3],S)}}function f(y){y.value instanceof So?Promise.resolve(y.value.v).then(h,m):w(a[0][2],y)}function h(y){u("next",y)}function m(y){u("throw",y)}function w(y,x){y(x),a.shift(),a.length&&u(a[0][0],a[0][1])}}function s5(r){var e,t;return e={},n("next"),n("throw",function(i){throw i}),n("return"),e[Symbol.iterator]=function(){return this},e;function n(i,a){e[i]=r[i]?function(c){return(t=!t)?{value:So(r[i](c)),done:i==="return"}:a?a(c):c}:a}}function o5(r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=r[Symbol.asyncIterator],t;return e?e.call(r):(r=typeof yu=="function"?yu(r):r[Symbol.iterator](),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(a){t[a]=r[a]&&function(c){return new Promise(function(u,f){c=r[a](c),i(u,f,c.done,c.value)})}}function i(a,c,u,f){Promise.resolve(f).then(function(h){a({value:h,done:u})},c)}}function a5(r,e){return Object.defineProperty?Object.defineProperty(r,"raw",{value:e}):r.raw=e,r}function c5(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)Object.hasOwnProperty.call(r,t)&&(e[t]=r[t]);return e.default=r,e}function l5(r){return r&&r.__esModule?r:{default:r}}function u5(r,e){if(!e.has(r))throw new TypeError("attempted to get private field on non-instance");return e.get(r)}function h5(r,e,t){if(!e.has(r))throw new TypeError("attempted to set private field on non-instance");return e.set(r,t),t}var f5=Object.freeze({__proto__:null,__extends:V3,get __assign(){return vu},__rest:G3,__decorate:Y3,__param:J3,__metadata:Z3,__awaiter:Q3,__generator:X3,__createBinding:e5,__exportStar:t5,__values:yu,__read:vp,__spread:r5,__spreadArrays:n5,__await:So,__asyncGenerator:i5,__asyncDelegator:s5,__asyncValues:o5,__makeTemplateObject:a5,__importStar:c5,__importDefault:l5,__classPrivateFieldGet:u5,__classPrivateFieldSet:h5}),ka=Pi(f5),Co={},wu={},Oo={};class Fi{}var d5=Object.freeze({__proto__:null,IEvents:Fi}),p5=Pi(d5),yp;function g5(){if(yp)return Oo;yp=1,Object.defineProperty(Oo,"__esModule",{value:!0}),Oo.IHeartBeat=void 0;const r=p5;class e extends r.IEvents{constructor(n){super()}}return Oo.IHeartBeat=e,Oo}var wp;function bp(){return wp||(wp=1,function(r){Object.defineProperty(r,"__esModule",{value:!0}),ka.__exportStar(g5(),r)}(wu)),wu}var bu={},Bi={},_p;function m5(){if(_p)return Bi;_p=1,Object.defineProperty(Bi,"__esModule",{value:!0}),Bi.HEARTBEAT_EVENTS=Bi.HEARTBEAT_INTERVAL=void 0;const r=ye;return Bi.HEARTBEAT_INTERVAL=r.FIVE_SECONDS,Bi.HEARTBEAT_EVENTS={pulse:"heartbeat_pulse"},Bi}var Ep;function xp(){return Ep||(Ep=1,function(r){Object.defineProperty(r,"__esModule",{value:!0}),ka.__exportStar(m5(),r)}(bu)),bu}var Ip;function v5(){if(Ip)return Co;Ip=1,Object.defineProperty(Co,"__esModule",{value:!0}),Co.HeartBeat=void 0;const r=ka,e=lr.exports,t=ye,n=bp(),i=xp();class a extends n.IHeartBeat{constructor(u){super(u),this.events=new e.EventEmitter,this.interval=i.HEARTBEAT_INTERVAL,this.interval=u?.interval||i.HEARTBEAT_INTERVAL}static init(u){return r.__awaiter(this,void 0,void 0,function*(){const f=new a(u);return yield f.init(),f})}init(){return r.__awaiter(this,void 0,void 0,function*(){yield this.initialize()})}stop(){clearInterval(this.intervalRef)}on(u,f){this.events.on(u,f)}once(u,f){this.events.once(u,f)}off(u,f){this.events.off(u,f)}removeListener(u,f){this.events.removeListener(u,f)}initialize(){return r.__awaiter(this,void 0,void 0,function*(){this.intervalRef=setInterval(()=>this.pulse(),t.toMiliseconds(this.interval))})}pulse(){this.events.emit(i.HEARTBEAT_EVENTS.pulse)}}return Co.HeartBeat=a,Co}(function(r){Object.defineProperty(r,"__esModule",{value:!0});const e=ka;e.__exportStar(v5(),r),e.__exportStar(bp(),r),e.__exportStar(xp(),r)})(Ds);var Xe={};/*! *****************************************************************************
34
34
  Copyright (c) Microsoft Corporation.
35
35
 
36
36
  Permission to use, copy, modify, and/or distribute this software for any
@@ -43,7 +43,7 @@
43
43
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
44
44
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
45
45
  PERFORMANCE OF THIS SOFTWARE.
46
- ***************************************************************************** */var _u=function(r,e){return _u=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)n.hasOwnProperty(i)&&(t[i]=n[i])},_u(r,e)};function g5(r,e){_u(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var Eu=function(){return Eu=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++){t=arguments[n];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e},Eu.apply(this,arguments)};function m5(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(t[n[i]]=r[n[i]]);return t}function v5(r,e,t,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(r,e,t,n);else for(var u=r.length-1;u>=0;u--)(c=r[u])&&(a=(i<3?c(a):i>3?c(e,t,a):c(e,t))||a);return i>3&&a&&Object.defineProperty(e,t,a),a}function w5(r,e){return function(t,n){e(t,n,r)}}function y5(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)}function b5(r,e,t,n){function i(a){return a instanceof t?a:new t(function(c){c(a)})}return new(t||(t=Promise))(function(a,c){function u(m){try{h(n.next(m))}catch(y){c(y)}}function d(m){try{h(n.throw(m))}catch(y){c(y)}}function h(m){m.done?a(m.value):i(m.value).then(u,d)}h((n=n.apply(r,e||[])).next())})}function _5(r,e){var t={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,i,a,c;return c={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function u(h){return function(m){return d([h,m])}}function d(h){if(n)throw new TypeError("Generator is already executing.");for(;t;)try{if(n=1,i&&(a=h[0]&2?i.return:h[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,h[1])).done)return a;switch(i=0,a&&(h=[h[0]&2,a.value]),h[0]){case 0:case 1:a=h;break;case 4:return t.label++,{value:h[1],done:!1};case 5:t.label++,i=h[1],h=[0];continue;case 7:h=t.ops.pop(),t.trys.pop();continue;default:if(a=t.trys,!(a=a.length>0&&a[a.length-1])&&(h[0]===6||h[0]===2)){t=0;continue}if(h[0]===3&&(!a||h[1]>a[0]&&h[1]<a[3])){t.label=h[1];break}if(h[0]===6&&t.label<a[1]){t.label=a[1],a=h;break}if(a&&t.label<a[2]){t.label=a[2],t.ops.push(h);break}a[2]&&t.ops.pop(),t.trys.pop();continue}h=e.call(r,t)}catch(m){h=[6,m],i=0}finally{n=a=0}if(h[0]&5)throw h[1];return{value:h[0]?h[1]:void 0,done:!0}}}function E5(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}function x5(r,e){for(var t in r)t!=="default"&&!e.hasOwnProperty(t)&&(e[t]=r[t])}function xu(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],n=0;if(t)return t.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function Dp(r,e){var t=typeof Symbol=="function"&&r[Symbol.iterator];if(!t)return r;var n=t.call(r),i,a=[],c;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)a.push(i.value)}catch(u){c={error:u}}finally{try{i&&!i.done&&(t=n.return)&&t.call(n)}finally{if(c)throw c.error}}return a}function I5(){for(var r=[],e=0;e<arguments.length;e++)r=r.concat(Dp(arguments[e]));return r}function D5(){for(var r=0,e=0,t=arguments.length;e<t;e++)r+=arguments[e].length;for(var n=Array(r),i=0,e=0;e<t;e++)for(var a=arguments[e],c=0,u=a.length;c<u;c++,i++)n[i]=a[c];return n}function Oo(r){return this instanceof Oo?(this.v=r,this):new Oo(r)}function S5(r,e,t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=t.apply(r,e||[]),i,a=[];return i={},c("next"),c("throw"),c("return"),i[Symbol.asyncIterator]=function(){return this},i;function c(w){n[w]&&(i[w]=function(E){return new Promise(function(I,T){a.push([w,E,I,T])>1||u(w,E)})})}function u(w,E){try{d(n[w](E))}catch(I){y(a[0][3],I)}}function d(w){w.value instanceof Oo?Promise.resolve(w.value.v).then(h,m):y(a[0][2],w)}function h(w){u("next",w)}function m(w){u("throw",w)}function y(w,E){w(E),a.shift(),a.length&&u(a[0][0],a[0][1])}}function O5(r){var e,t;return e={},n("next"),n("throw",function(i){throw i}),n("return"),e[Symbol.iterator]=function(){return this},e;function n(i,a){e[i]=r[i]?function(c){return(t=!t)?{value:Oo(r[i](c)),done:i==="return"}:a?a(c):c}:a}}function C5(r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=r[Symbol.asyncIterator],t;return e?e.call(r):(r=typeof xu=="function"?xu(r):r[Symbol.iterator](),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(a){t[a]=r[a]&&function(c){return new Promise(function(u,d){c=r[a](c),i(u,d,c.done,c.value)})}}function i(a,c,u,d){Promise.resolve(d).then(function(h){a({value:h,done:u})},c)}}function $5(r,e){return Object.defineProperty?Object.defineProperty(r,"raw",{value:e}):r.raw=e,r}function A5(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)Object.hasOwnProperty.call(r,t)&&(e[t]=r[t]);return e.default=r,e}function P5(r){return r&&r.__esModule?r:{default:r}}function T5(r,e){if(!e.has(r))throw new TypeError("attempted to get private field on non-instance");return e.get(r)}function R5(r,e,t){if(!e.has(r))throw new TypeError("attempted to set private field on non-instance");return e.set(r,t),t}var N5=Object.freeze({__proto__:null,__extends:g5,get __assign(){return Eu},__rest:m5,__decorate:v5,__param:w5,__metadata:y5,__awaiter:b5,__generator:_5,__createBinding:E5,__exportStar:x5,__values:xu,__read:Dp,__spread:I5,__spreadArrays:D5,__await:Oo,__asyncGenerator:S5,__asyncDelegator:O5,__asyncValues:C5,__makeTemplateObject:$5,__importStar:A5,__importDefault:P5,__classPrivateFieldGet:T5,__classPrivateFieldSet:R5}),L5=Ai(N5),Iu,Sp;function M5(){if(Sp)return Iu;Sp=1;function r(t){try{return JSON.stringify(t)}catch{return'"[Circular]"'}}Iu=e;function e(t,n,i){var a=i&&i.stringify||r,c=1;if(typeof t=="object"&&t!==null){var u=n.length+c;if(u===1)return t;var d=new Array(u);d[0]=a(t);for(var h=1;h<u;h++)d[h]=a(n[h]);return d.join(" ")}if(typeof t!="string")return t;var m=n.length;if(m===0)return t;for(var y="",w=1-c,E=-1,I=t&&t.length||0,T=0;T<I;){if(t.charCodeAt(T)===37&&T+1<I){switch(E=E>-1?E:0,t.charCodeAt(T+1)){case 100:case 102:if(w>=m||n[w]==null)break;E<T&&(y+=t.slice(E,T)),y+=Number(n[w]),E=T+2,T++;break;case 105:if(w>=m||n[w]==null)break;E<T&&(y+=t.slice(E,T)),y+=Math.floor(Number(n[w])),E=T+2,T++;break;case 79:case 111:case 106:if(w>=m||n[w]===void 0)break;E<T&&(y+=t.slice(E,T));var U=typeof n[w];if(U==="string"){y+="'"+n[w]+"'",E=T+2,T++;break}if(U==="function"){y+=n[w].name||"<anonymous>",E=T+2,T++;break}y+=a(n[w]),E=T+2,T++;break;case 115:if(w>=m)break;E<T&&(y+=t.slice(E,T)),y+=String(n[w]),E=T+2,T++;break;case 37:E<T&&(y+=t.slice(E,T)),y+="%",E=T+2,T++,w--;break}++w}++T}return E===-1?t:(E<I&&(y+=t.slice(E)),y)}return Iu}var Du,Op;function U5(){if(Op)return Du;Op=1;const r=M5();Du=i;const e=A().console||{},t={mapHttpRequest:I,mapHttpResponse:I,wrapRequestSerializer:T,wrapResponseSerializer:T,wrapErrorSerializer:T,req:I,res:I,err:w};function n(x,f){return Array.isArray(x)?x.filter(function(q){return q!=="!stdSerializers.err"}):x===!0?Object.keys(f):!1}function i(x){x=x||{},x.browser=x.browser||{};const f=x.browser.transmit;if(f&&typeof f.send!="function")throw Error("pino: transmit option must have a send function");const b=x.browser.write||e;x.browser.write&&(x.browser.asObject=!0);const q=x.serializers||{},j=n(x.browser.serialize,q);let V=x.browser.serialize;Array.isArray(x.browser.serialize)&&x.browser.serialize.indexOf("!stdSerializers.err")>-1&&(V=!1);const se=["error","fatal","warn","info","debug","trace"];typeof b=="function"&&(b.error=b.fatal=b.warn=b.info=b.debug=b.trace=b),x.enabled===!1&&(x.level="silent");const ce=x.level||"info",D=Object.create(b);D.log||(D.log=U),Object.defineProperty(D,"levelVal",{get:X}),Object.defineProperty(D,"level",{get:ee,set:Y});const N={transmit:f,serialize:j,asObject:x.browser.asObject,levels:se,timestamp:E(x)};D.levels=i.levels,D.level=ce,D.setMaxListeners=D.getMaxListeners=D.emit=D.addListener=D.on=D.prependListener=D.once=D.prependOnceListener=D.removeListener=D.removeAllListeners=D.listeners=D.listenerCount=D.eventNames=D.write=D.flush=U,D.serializers=q,D._serialize=j,D._stdErrSerialize=V,D.child=J,f&&(D._logEvent=y());function X(){return this.level==="silent"?1/0:this.levels.values[this.level]}function ee(){return this._level}function Y(Q){if(Q!=="silent"&&!this.levels.values[Q])throw Error("unknown level "+Q);this._level=Q,a(N,D,"error","log"),a(N,D,"fatal","error"),a(N,D,"warn","error"),a(N,D,"info","log"),a(N,D,"debug","log"),a(N,D,"trace","log")}function J(Q,ie){if(!Q)throw new Error("missing bindings for child Pino");ie=ie||{},j&&Q.serializers&&(ie.serializers=Q.serializers);const Ee=ie.serializers;if(j&&Ee){var ae=Object.assign({},q,Ee),xe=x.browser.serialize===!0?Object.keys(ae):j;delete Q.serializers,d([Q],xe,ae,this._stdErrSerialize)}function de(be){this._childLevel=(be._childLevel|0)+1,this.error=h(be,Q,"error"),this.fatal=h(be,Q,"fatal"),this.warn=h(be,Q,"warn"),this.info=h(be,Q,"info"),this.debug=h(be,Q,"debug"),this.trace=h(be,Q,"trace"),ae&&(this.serializers=ae,this._serialize=xe),f&&(this._logEvent=y([].concat(be._logEvent.bindings,Q)))}return de.prototype=this,new de(this)}return D}i.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"}},i.stdSerializers=t,i.stdTimeFunctions=Object.assign({},{nullTime:F,epochTime:$,unixTime:P,isoTime:O});function a(x,f,b,q){const j=Object.getPrototypeOf(f);f[b]=f.levelVal>f.levels.values[b]?U:j[b]?j[b]:e[b]||e[q]||U,c(x,f,b)}function c(x,f,b){!x.transmit&&f[b]===U||(f[b]=function(q){return function(){const V=x.timestamp(),se=new Array(arguments.length),ce=Object.getPrototypeOf&&Object.getPrototypeOf(this)===e?e:this;for(var D=0;D<se.length;D++)se[D]=arguments[D];if(x.serialize&&!x.asObject&&d(se,this._serialize,this.serializers,this._stdErrSerialize),x.asObject?q.call(ce,u(this,b,se,V)):q.apply(ce,se),x.transmit){const N=x.transmit.level||f.level,X=i.levels.values[N],ee=i.levels.values[b];if(ee<X)return;m(this,{ts:V,methodLevel:b,methodValue:ee,transmitLevel:N,transmitValue:i.levels.values[x.transmit.level||f.level],send:x.transmit.send,val:f.levelVal},se)}}}(f[b]))}function u(x,f,b,q){x._serialize&&d(b,x._serialize,x.serializers,x._stdErrSerialize);const j=b.slice();let V=j[0];const se={};q&&(se.time=q),se.level=i.levels.values[f];let ce=(x._childLevel|0)+1;if(ce<1&&(ce=1),V!==null&&typeof V=="object"){for(;ce--&&typeof j[0]=="object";)Object.assign(se,j.shift());V=j.length?r(j.shift(),j):void 0}else typeof V=="string"&&(V=r(j.shift(),j));return V!==void 0&&(se.msg=V),se}function d(x,f,b,q){for(const j in x)if(q&&x[j]instanceof Error)x[j]=i.stdSerializers.err(x[j]);else if(typeof x[j]=="object"&&!Array.isArray(x[j]))for(const V in x[j])f&&f.indexOf(V)>-1&&V in b&&(x[j][V]=b[V](x[j][V]))}function h(x,f,b){return function(){const q=new Array(1+arguments.length);q[0]=f;for(var j=1;j<q.length;j++)q[j]=arguments[j-1];return x[b].apply(this,q)}}function m(x,f,b){const q=f.send,j=f.ts,V=f.methodLevel,se=f.methodValue,ce=f.val,D=x._logEvent.bindings;d(b,x._serialize||Object.keys(x.serializers),x.serializers,x._stdErrSerialize===void 0?!0:x._stdErrSerialize),x._logEvent.ts=j,x._logEvent.messages=b.filter(function(N){return D.indexOf(N)===-1}),x._logEvent.level.label=V,x._logEvent.level.value=se,q(V,x._logEvent,ce),x._logEvent=y(D)}function y(x){return{ts:0,messages:[],bindings:x||[],level:{label:"",value:0}}}function w(x){const f={type:x.constructor.name,msg:x.message,stack:x.stack};for(const b in x)f[b]===void 0&&(f[b]=x[b]);return f}function E(x){return typeof x.timestamp=="function"?x.timestamp:x.timestamp===!1?F:$}function I(){return{}}function T(x){return x}function U(){}function F(){return!1}function $(){return Date.now()}function P(){return Math.round(Date.now()/1e3)}function O(){return new Date(Date.now()).toISOString()}function A(){function x(f){return typeof f<"u"&&f}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 x(self)||x(window)||x(this)||{}}}return Du}var Bi={},Cp;function $p(){return Cp||(Cp=1,Object.defineProperty(Bi,"__esModule",{value:!0}),Bi.PINO_CUSTOM_CONTEXT_KEY=Bi.PINO_LOGGER_DEFAULTS=void 0,Bi.PINO_LOGGER_DEFAULTS={level:"info"},Bi.PINO_CUSTOM_CONTEXT_KEY="custom_context"),Bi}var Er={},Ap;function j5(){if(Ap)return Er;Ap=1,Object.defineProperty(Er,"__esModule",{value:!0}),Er.generateChildLogger=Er.formatChildLoggerContext=Er.getLoggerContext=Er.setBrowserLoggerContext=Er.getBrowserLoggerContext=Er.getDefaultLoggerOptions=void 0;const r=$p();function e(u){return Object.assign(Object.assign({},u),{level:u?.level||r.PINO_LOGGER_DEFAULTS.level})}Er.getDefaultLoggerOptions=e;function t(u,d=r.PINO_CUSTOM_CONTEXT_KEY){return u[d]||""}Er.getBrowserLoggerContext=t;function n(u,d,h=r.PINO_CUSTOM_CONTEXT_KEY){return u[h]=d,u}Er.setBrowserLoggerContext=n;function i(u,d=r.PINO_CUSTOM_CONTEXT_KEY){let h="";return typeof u.bindings>"u"?h=t(u,d):h=u.bindings().context||"",h}Er.getLoggerContext=i;function a(u,d,h=r.PINO_CUSTOM_CONTEXT_KEY){const m=i(u,h);return m.trim()?`${m}/${d}`:d}Er.formatChildLoggerContext=a;function c(u,d,h=r.PINO_CUSTOM_CONTEXT_KEY){const m=a(u,d,h),y=u.child({context:m});return n(y,m,h)}return Er.generateChildLogger=c,Er}(function(r){Object.defineProperty(r,"__esModule",{value:!0}),r.pino=void 0;const e=L5,t=e.__importDefault(U5());Object.defineProperty(r,"pino",{enumerable:!0,get:function(){return t.default}}),e.__exportStar($p(),r),e.__exportStar(j5(),r)})(Xe);class F5 extends ji{constructor(e){super(),this.opts=e,this.protocol="wc",this.version=2}}class B5 extends ji{constructor(e,t){super(),this.core=e,this.logger=t,this.records=new Map}}class k5{constructor(e,t){this.logger=e,this.core=t}}class H5 extends ji{constructor(e,t){super(),this.relayer=e,this.logger=t}}class z5 extends ji{constructor(e){super()}}class q5{constructor(e,t,n,i){this.core=e,this.logger=t,this.name=n}}class W5 extends ji{constructor(e,t){super(),this.relayer=e,this.logger=t}}class K5 extends ji{constructor(e,t){super(),this.core=e,this.logger=t}}class V5{constructor(e,t){this.projectId=e,this.logger=t}}class G5{constructor(e,t){this.projectId=e,this.logger=t}}class Y5{constructor(e){this.opts=e,this.protocol="wc",this.version=2}}class J5{constructor(e){this.client=e}}var Su={},Pp={};(function(r){Object.defineProperty(r,"__esModule",{value:!0});var e=Me,t=zr;r.DIGEST_LENGTH=64,r.BLOCK_SIZE=128;var n=function(){function u(){this.digestLength=r.DIGEST_LENGTH,this.blockSize=r.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 u.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},u.prototype.reset=function(){return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this},u.prototype.clean=function(){t.wipe(this._buffer),t.wipe(this._tempHi),t.wipe(this._tempLo),this.reset()},u.prototype.update=function(d,h){if(h===void 0&&(h=d.length),this._finished)throw new Error("SHA512: can't update because hash was finished.");var m=0;if(this._bytesHashed+=h,this._bufferLength>0){for(;this._bufferLength<r.BLOCK_SIZE&&h>0;)this._buffer[this._bufferLength++]=d[m++],h--;this._bufferLength===this.blockSize&&(a(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,this.blockSize),this._bufferLength=0)}for(h>=this.blockSize&&(m=a(this._tempHi,this._tempLo,this._stateHi,this._stateLo,d,m,h),h%=this.blockSize);h>0;)this._buffer[this._bufferLength++]=d[m++],h--;return this},u.prototype.finish=function(d){if(!this._finished){var h=this._bytesHashed,m=this._bufferLength,y=h/536870912|0,w=h<<3,E=h%128<112?128:256;this._buffer[m]=128;for(var I=m+1;I<E-8;I++)this._buffer[I]=0;e.writeUint32BE(y,this._buffer,E-8),e.writeUint32BE(w,this._buffer,E-4),a(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,E),this._finished=!0}for(var I=0;I<this.digestLength/8;I++)e.writeUint32BE(this._stateHi[I],d,I*8),e.writeUint32BE(this._stateLo[I],d,I*8+4);return this},u.prototype.digest=function(){var d=new Uint8Array(this.digestLength);return this.finish(d),d},u.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}},u.prototype.restoreState=function(d){return this._stateHi.set(d.stateHi),this._stateLo.set(d.stateLo),this._bufferLength=d.bufferLength,d.buffer&&this._buffer.set(d.buffer),this._bytesHashed=d.bytesHashed,this._finished=!1,this},u.prototype.cleanSavedState=function(d){t.wipe(d.stateHi),t.wipe(d.stateLo),d.buffer&&t.wipe(d.buffer),d.bufferLength=0,d.bytesHashed=0},u}();r.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 a(u,d,h,m,y,w,E){for(var I=h[0],T=h[1],U=h[2],F=h[3],$=h[4],P=h[5],O=h[6],A=h[7],x=m[0],f=m[1],b=m[2],q=m[3],j=m[4],V=m[5],se=m[6],ce=m[7],D,N,X,ee,Y,J,Q,ie;E>=128;){for(var Ee=0;Ee<16;Ee++){var ae=8*Ee+w;u[Ee]=e.readUint32BE(y,ae),d[Ee]=e.readUint32BE(y,ae+4)}for(var Ee=0;Ee<80;Ee++){var xe=I,de=T,be=U,K=F,W=$,B=P,g=O,L=A,le=x,pe=f,Oe=b,Ke=q,Je=j,ke=V,Dt=se,St=ce;if(D=A,N=ce,Y=N&65535,J=N>>>16,Q=D&65535,ie=D>>>16,D=($>>>14|j<<32-14)^($>>>18|j<<32-18)^(j>>>41-32|$<<32-(41-32)),N=(j>>>14|$<<32-14)^(j>>>18|$<<32-18)^($>>>41-32|j<<32-(41-32)),Y+=N&65535,J+=N>>>16,Q+=D&65535,ie+=D>>>16,D=$&P^~$&O,N=j&V^~j&se,Y+=N&65535,J+=N>>>16,Q+=D&65535,ie+=D>>>16,D=i[Ee*2],N=i[Ee*2+1],Y+=N&65535,J+=N>>>16,Q+=D&65535,ie+=D>>>16,D=u[Ee%16],N=d[Ee%16],Y+=N&65535,J+=N>>>16,Q+=D&65535,ie+=D>>>16,J+=Y>>>16,Q+=J>>>16,ie+=Q>>>16,X=Q&65535|ie<<16,ee=Y&65535|J<<16,D=X,N=ee,Y=N&65535,J=N>>>16,Q=D&65535,ie=D>>>16,D=(I>>>28|x<<32-28)^(x>>>34-32|I<<32-(34-32))^(x>>>39-32|I<<32-(39-32)),N=(x>>>28|I<<32-28)^(I>>>34-32|x<<32-(34-32))^(I>>>39-32|x<<32-(39-32)),Y+=N&65535,J+=N>>>16,Q+=D&65535,ie+=D>>>16,D=I&T^I&U^T&U,N=x&f^x&b^f&b,Y+=N&65535,J+=N>>>16,Q+=D&65535,ie+=D>>>16,J+=Y>>>16,Q+=J>>>16,ie+=Q>>>16,L=Q&65535|ie<<16,St=Y&65535|J<<16,D=K,N=Ke,Y=N&65535,J=N>>>16,Q=D&65535,ie=D>>>16,D=X,N=ee,Y+=N&65535,J+=N>>>16,Q+=D&65535,ie+=D>>>16,J+=Y>>>16,Q+=J>>>16,ie+=Q>>>16,K=Q&65535|ie<<16,Ke=Y&65535|J<<16,T=xe,U=de,F=be,$=K,P=W,O=B,A=g,I=L,f=le,b=pe,q=Oe,j=Ke,V=Je,se=ke,ce=Dt,x=St,Ee%16===15)for(var ae=0;ae<16;ae++)D=u[ae],N=d[ae],Y=N&65535,J=N>>>16,Q=D&65535,ie=D>>>16,D=u[(ae+9)%16],N=d[(ae+9)%16],Y+=N&65535,J+=N>>>16,Q+=D&65535,ie+=D>>>16,X=u[(ae+1)%16],ee=d[(ae+1)%16],D=(X>>>1|ee<<32-1)^(X>>>8|ee<<32-8)^X>>>7,N=(ee>>>1|X<<32-1)^(ee>>>8|X<<32-8)^(ee>>>7|X<<32-7),Y+=N&65535,J+=N>>>16,Q+=D&65535,ie+=D>>>16,X=u[(ae+14)%16],ee=d[(ae+14)%16],D=(X>>>19|ee<<32-19)^(ee>>>61-32|X<<32-(61-32))^X>>>6,N=(ee>>>19|X<<32-19)^(X>>>61-32|ee<<32-(61-32))^(ee>>>6|X<<32-6),Y+=N&65535,J+=N>>>16,Q+=D&65535,ie+=D>>>16,J+=Y>>>16,Q+=J>>>16,ie+=Q>>>16,u[ae]=Q&65535|ie<<16,d[ae]=Y&65535|J<<16}D=I,N=x,Y=N&65535,J=N>>>16,Q=D&65535,ie=D>>>16,D=h[0],N=m[0],Y+=N&65535,J+=N>>>16,Q+=D&65535,ie+=D>>>16,J+=Y>>>16,Q+=J>>>16,ie+=Q>>>16,h[0]=I=Q&65535|ie<<16,m[0]=x=Y&65535|J<<16,D=T,N=f,Y=N&65535,J=N>>>16,Q=D&65535,ie=D>>>16,D=h[1],N=m[1],Y+=N&65535,J+=N>>>16,Q+=D&65535,ie+=D>>>16,J+=Y>>>16,Q+=J>>>16,ie+=Q>>>16,h[1]=T=Q&65535|ie<<16,m[1]=f=Y&65535|J<<16,D=U,N=b,Y=N&65535,J=N>>>16,Q=D&65535,ie=D>>>16,D=h[2],N=m[2],Y+=N&65535,J+=N>>>16,Q+=D&65535,ie+=D>>>16,J+=Y>>>16,Q+=J>>>16,ie+=Q>>>16,h[2]=U=Q&65535|ie<<16,m[2]=b=Y&65535|J<<16,D=F,N=q,Y=N&65535,J=N>>>16,Q=D&65535,ie=D>>>16,D=h[3],N=m[3],Y+=N&65535,J+=N>>>16,Q+=D&65535,ie+=D>>>16,J+=Y>>>16,Q+=J>>>16,ie+=Q>>>16,h[3]=F=Q&65535|ie<<16,m[3]=q=Y&65535|J<<16,D=$,N=j,Y=N&65535,J=N>>>16,Q=D&65535,ie=D>>>16,D=h[4],N=m[4],Y+=N&65535,J+=N>>>16,Q+=D&65535,ie+=D>>>16,J+=Y>>>16,Q+=J>>>16,ie+=Q>>>16,h[4]=$=Q&65535|ie<<16,m[4]=j=Y&65535|J<<16,D=P,N=V,Y=N&65535,J=N>>>16,Q=D&65535,ie=D>>>16,D=h[5],N=m[5],Y+=N&65535,J+=N>>>16,Q+=D&65535,ie+=D>>>16,J+=Y>>>16,Q+=J>>>16,ie+=Q>>>16,h[5]=P=Q&65535|ie<<16,m[5]=V=Y&65535|J<<16,D=O,N=se,Y=N&65535,J=N>>>16,Q=D&65535,ie=D>>>16,D=h[6],N=m[6],Y+=N&65535,J+=N>>>16,Q+=D&65535,ie+=D>>>16,J+=Y>>>16,Q+=J>>>16,ie+=Q>>>16,h[6]=O=Q&65535|ie<<16,m[6]=se=Y&65535|J<<16,D=A,N=ce,Y=N&65535,J=N>>>16,Q=D&65535,ie=D>>>16,D=h[7],N=m[7],Y+=N&65535,J+=N>>>16,Q+=D&65535,ie+=D>>>16,J+=Y>>>16,Q+=J>>>16,ie+=Q>>>16,h[7]=A=Q&65535|ie<<16,m[7]=ce=Y&65535|J<<16,w+=128,E-=128}return w}function c(u){var d=new n;d.update(u);var h=d.digest();return d.clean(),h}r.hash=c})(Pp),function(r){Object.defineProperty(r,"__esModule",{value:!0}),r.convertSecretKeyToX25519=r.convertPublicKeyToX25519=r.verify=r.sign=r.extractPublicKeyFromSecretKey=r.generateKeyPair=r.generateKeyPairFromSeed=r.SEED_LENGTH=r.SECRET_KEY_LENGTH=r.PUBLIC_KEY_LENGTH=r.SIGNATURE_LENGTH=void 0;const e=ms,t=Pp,n=zr;r.SIGNATURE_LENGTH=64,r.PUBLIC_KEY_LENGTH=32,r.SECRET_KEY_LENGTH=64,r.SEED_LENGTH=32;function i(K){const W=new Float64Array(16);if(K)for(let B=0;B<K.length;B++)W[B]=K[B];return W}const a=new Uint8Array(32);a[0]=9;const c=i(),u=i([1]),d=i([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),h=i([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),m=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]),w=i([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function E(K,W){for(let B=0;B<16;B++)K[B]=W[B]|0}function I(K){let W=1;for(let B=0;B<16;B++){let g=K[B]+W+65535;W=Math.floor(g/65536),K[B]=g-W*65536}K[0]+=W-1+37*(W-1)}function T(K,W,B){const g=~(B-1);for(let L=0;L<16;L++){const le=g&(K[L]^W[L]);K[L]^=le,W[L]^=le}}function U(K,W){const B=i(),g=i();for(let L=0;L<16;L++)g[L]=W[L];I(g),I(g),I(g);for(let L=0;L<2;L++){B[0]=g[0]-65517;for(let pe=1;pe<15;pe++)B[pe]=g[pe]-65535-(B[pe-1]>>16&1),B[pe-1]&=65535;B[15]=g[15]-32767-(B[14]>>16&1);const le=B[15]>>16&1;B[14]&=65535,T(g,B,1-le)}for(let L=0;L<16;L++)K[2*L]=g[L]&255,K[2*L+1]=g[L]>>8}function F(K,W){let B=0;for(let g=0;g<32;g++)B|=K[g]^W[g];return(1&B-1>>>8)-1}function $(K,W){const B=new Uint8Array(32),g=new Uint8Array(32);return U(B,K),U(g,W),F(B,g)}function P(K){const W=new Uint8Array(32);return U(W,K),W[0]&1}function O(K,W){for(let B=0;B<16;B++)K[B]=W[2*B]+(W[2*B+1]<<8);K[15]&=32767}function A(K,W,B){for(let g=0;g<16;g++)K[g]=W[g]+B[g]}function x(K,W,B){for(let g=0;g<16;g++)K[g]=W[g]-B[g]}function f(K,W,B){let g,L,le=0,pe=0,Oe=0,Ke=0,Je=0,ke=0,Dt=0,St=0,ze=0,Ce=0,Ue=0,je=0,qe=0,Ae=0,Fe=0,Se=0,Te=0,Ve=0,$e=0,Ze=0,et=0,at=0,ct=0,nt=0,Dr=0,Ur=0,Cn=0,Sr=0,qn=0,yi=0,ts=0,Lt=B[0],Ot=B[1],Mt=B[2],Ut=B[3],Pt=B[4],Ct=B[5],Gt=B[6],Yt=B[7],jt=B[8],Jt=B[9],Ft=B[10],zt=B[11],Bt=B[12],_t=B[13],Zt=B[14],Qt=B[15];g=W[0],le+=g*Lt,pe+=g*Ot,Oe+=g*Mt,Ke+=g*Ut,Je+=g*Pt,ke+=g*Ct,Dt+=g*Gt,St+=g*Yt,ze+=g*jt,Ce+=g*Jt,Ue+=g*Ft,je+=g*zt,qe+=g*Bt,Ae+=g*_t,Fe+=g*Zt,Se+=g*Qt,g=W[1],pe+=g*Lt,Oe+=g*Ot,Ke+=g*Mt,Je+=g*Ut,ke+=g*Pt,Dt+=g*Ct,St+=g*Gt,ze+=g*Yt,Ce+=g*jt,Ue+=g*Jt,je+=g*Ft,qe+=g*zt,Ae+=g*Bt,Fe+=g*_t,Se+=g*Zt,Te+=g*Qt,g=W[2],Oe+=g*Lt,Ke+=g*Ot,Je+=g*Mt,ke+=g*Ut,Dt+=g*Pt,St+=g*Ct,ze+=g*Gt,Ce+=g*Yt,Ue+=g*jt,je+=g*Jt,qe+=g*Ft,Ae+=g*zt,Fe+=g*Bt,Se+=g*_t,Te+=g*Zt,Ve+=g*Qt,g=W[3],Ke+=g*Lt,Je+=g*Ot,ke+=g*Mt,Dt+=g*Ut,St+=g*Pt,ze+=g*Ct,Ce+=g*Gt,Ue+=g*Yt,je+=g*jt,qe+=g*Jt,Ae+=g*Ft,Fe+=g*zt,Se+=g*Bt,Te+=g*_t,Ve+=g*Zt,$e+=g*Qt,g=W[4],Je+=g*Lt,ke+=g*Ot,Dt+=g*Mt,St+=g*Ut,ze+=g*Pt,Ce+=g*Ct,Ue+=g*Gt,je+=g*Yt,qe+=g*jt,Ae+=g*Jt,Fe+=g*Ft,Se+=g*zt,Te+=g*Bt,Ve+=g*_t,$e+=g*Zt,Ze+=g*Qt,g=W[5],ke+=g*Lt,Dt+=g*Ot,St+=g*Mt,ze+=g*Ut,Ce+=g*Pt,Ue+=g*Ct,je+=g*Gt,qe+=g*Yt,Ae+=g*jt,Fe+=g*Jt,Se+=g*Ft,Te+=g*zt,Ve+=g*Bt,$e+=g*_t,Ze+=g*Zt,et+=g*Qt,g=W[6],Dt+=g*Lt,St+=g*Ot,ze+=g*Mt,Ce+=g*Ut,Ue+=g*Pt,je+=g*Ct,qe+=g*Gt,Ae+=g*Yt,Fe+=g*jt,Se+=g*Jt,Te+=g*Ft,Ve+=g*zt,$e+=g*Bt,Ze+=g*_t,et+=g*Zt,at+=g*Qt,g=W[7],St+=g*Lt,ze+=g*Ot,Ce+=g*Mt,Ue+=g*Ut,je+=g*Pt,qe+=g*Ct,Ae+=g*Gt,Fe+=g*Yt,Se+=g*jt,Te+=g*Jt,Ve+=g*Ft,$e+=g*zt,Ze+=g*Bt,et+=g*_t,at+=g*Zt,ct+=g*Qt,g=W[8],ze+=g*Lt,Ce+=g*Ot,Ue+=g*Mt,je+=g*Ut,qe+=g*Pt,Ae+=g*Ct,Fe+=g*Gt,Se+=g*Yt,Te+=g*jt,Ve+=g*Jt,$e+=g*Ft,Ze+=g*zt,et+=g*Bt,at+=g*_t,ct+=g*Zt,nt+=g*Qt,g=W[9],Ce+=g*Lt,Ue+=g*Ot,je+=g*Mt,qe+=g*Ut,Ae+=g*Pt,Fe+=g*Ct,Se+=g*Gt,Te+=g*Yt,Ve+=g*jt,$e+=g*Jt,Ze+=g*Ft,et+=g*zt,at+=g*Bt,ct+=g*_t,nt+=g*Zt,Dr+=g*Qt,g=W[10],Ue+=g*Lt,je+=g*Ot,qe+=g*Mt,Ae+=g*Ut,Fe+=g*Pt,Se+=g*Ct,Te+=g*Gt,Ve+=g*Yt,$e+=g*jt,Ze+=g*Jt,et+=g*Ft,at+=g*zt,ct+=g*Bt,nt+=g*_t,Dr+=g*Zt,Ur+=g*Qt,g=W[11],je+=g*Lt,qe+=g*Ot,Ae+=g*Mt,Fe+=g*Ut,Se+=g*Pt,Te+=g*Ct,Ve+=g*Gt,$e+=g*Yt,Ze+=g*jt,et+=g*Jt,at+=g*Ft,ct+=g*zt,nt+=g*Bt,Dr+=g*_t,Ur+=g*Zt,Cn+=g*Qt,g=W[12],qe+=g*Lt,Ae+=g*Ot,Fe+=g*Mt,Se+=g*Ut,Te+=g*Pt,Ve+=g*Ct,$e+=g*Gt,Ze+=g*Yt,et+=g*jt,at+=g*Jt,ct+=g*Ft,nt+=g*zt,Dr+=g*Bt,Ur+=g*_t,Cn+=g*Zt,Sr+=g*Qt,g=W[13],Ae+=g*Lt,Fe+=g*Ot,Se+=g*Mt,Te+=g*Ut,Ve+=g*Pt,$e+=g*Ct,Ze+=g*Gt,et+=g*Yt,at+=g*jt,ct+=g*Jt,nt+=g*Ft,Dr+=g*zt,Ur+=g*Bt,Cn+=g*_t,Sr+=g*Zt,qn+=g*Qt,g=W[14],Fe+=g*Lt,Se+=g*Ot,Te+=g*Mt,Ve+=g*Ut,$e+=g*Pt,Ze+=g*Ct,et+=g*Gt,at+=g*Yt,ct+=g*jt,nt+=g*Jt,Dr+=g*Ft,Ur+=g*zt,Cn+=g*Bt,Sr+=g*_t,qn+=g*Zt,yi+=g*Qt,g=W[15],Se+=g*Lt,Te+=g*Ot,Ve+=g*Mt,$e+=g*Ut,Ze+=g*Pt,et+=g*Ct,at+=g*Gt,ct+=g*Yt,nt+=g*jt,Dr+=g*Jt,Ur+=g*Ft,Cn+=g*zt,Sr+=g*Bt,qn+=g*_t,yi+=g*Zt,ts+=g*Qt,le+=38*Te,pe+=38*Ve,Oe+=38*$e,Ke+=38*Ze,Je+=38*et,ke+=38*at,Dt+=38*ct,St+=38*nt,ze+=38*Dr,Ce+=38*Ur,Ue+=38*Cn,je+=38*Sr,qe+=38*qn,Ae+=38*yi,Fe+=38*ts,L=1,g=le+L+65535,L=Math.floor(g/65536),le=g-L*65536,g=pe+L+65535,L=Math.floor(g/65536),pe=g-L*65536,g=Oe+L+65535,L=Math.floor(g/65536),Oe=g-L*65536,g=Ke+L+65535,L=Math.floor(g/65536),Ke=g-L*65536,g=Je+L+65535,L=Math.floor(g/65536),Je=g-L*65536,g=ke+L+65535,L=Math.floor(g/65536),ke=g-L*65536,g=Dt+L+65535,L=Math.floor(g/65536),Dt=g-L*65536,g=St+L+65535,L=Math.floor(g/65536),St=g-L*65536,g=ze+L+65535,L=Math.floor(g/65536),ze=g-L*65536,g=Ce+L+65535,L=Math.floor(g/65536),Ce=g-L*65536,g=Ue+L+65535,L=Math.floor(g/65536),Ue=g-L*65536,g=je+L+65535,L=Math.floor(g/65536),je=g-L*65536,g=qe+L+65535,L=Math.floor(g/65536),qe=g-L*65536,g=Ae+L+65535,L=Math.floor(g/65536),Ae=g-L*65536,g=Fe+L+65535,L=Math.floor(g/65536),Fe=g-L*65536,g=Se+L+65535,L=Math.floor(g/65536),Se=g-L*65536,le+=L-1+37*(L-1),L=1,g=le+L+65535,L=Math.floor(g/65536),le=g-L*65536,g=pe+L+65535,L=Math.floor(g/65536),pe=g-L*65536,g=Oe+L+65535,L=Math.floor(g/65536),Oe=g-L*65536,g=Ke+L+65535,L=Math.floor(g/65536),Ke=g-L*65536,g=Je+L+65535,L=Math.floor(g/65536),Je=g-L*65536,g=ke+L+65535,L=Math.floor(g/65536),ke=g-L*65536,g=Dt+L+65535,L=Math.floor(g/65536),Dt=g-L*65536,g=St+L+65535,L=Math.floor(g/65536),St=g-L*65536,g=ze+L+65535,L=Math.floor(g/65536),ze=g-L*65536,g=Ce+L+65535,L=Math.floor(g/65536),Ce=g-L*65536,g=Ue+L+65535,L=Math.floor(g/65536),Ue=g-L*65536,g=je+L+65535,L=Math.floor(g/65536),je=g-L*65536,g=qe+L+65535,L=Math.floor(g/65536),qe=g-L*65536,g=Ae+L+65535,L=Math.floor(g/65536),Ae=g-L*65536,g=Fe+L+65535,L=Math.floor(g/65536),Fe=g-L*65536,g=Se+L+65535,L=Math.floor(g/65536),Se=g-L*65536,le+=L-1+37*(L-1),K[0]=le,K[1]=pe,K[2]=Oe,K[3]=Ke,K[4]=Je,K[5]=ke,K[6]=Dt,K[7]=St,K[8]=ze,K[9]=Ce,K[10]=Ue,K[11]=je,K[12]=qe,K[13]=Ae,K[14]=Fe,K[15]=Se}function b(K,W){f(K,W,W)}function q(K,W){const B=i();let g;for(g=0;g<16;g++)B[g]=W[g];for(g=253;g>=0;g--)b(B,B),g!==2&&g!==4&&f(B,B,W);for(g=0;g<16;g++)K[g]=B[g]}function j(K,W){const B=i();let g;for(g=0;g<16;g++)B[g]=W[g];for(g=250;g>=0;g--)b(B,B),g!==1&&f(B,B,W);for(g=0;g<16;g++)K[g]=B[g]}function V(K,W){const B=i(),g=i(),L=i(),le=i(),pe=i(),Oe=i(),Ke=i(),Je=i(),ke=i();x(B,K[1],K[0]),x(ke,W[1],W[0]),f(B,B,ke),A(g,K[0],K[1]),A(ke,W[0],W[1]),f(g,g,ke),f(L,K[3],W[3]),f(L,L,h),f(le,K[2],W[2]),A(le,le,le),x(pe,g,B),x(Oe,le,L),A(Ke,le,L),A(Je,g,B),f(K[0],pe,Oe),f(K[1],Je,Ke),f(K[2],Ke,Oe),f(K[3],pe,Je)}function se(K,W,B){for(let g=0;g<4;g++)T(K[g],W[g],B)}function ce(K,W){const B=i(),g=i(),L=i();q(L,W[2]),f(B,W[0],L),f(g,W[1],L),U(K,g),K[31]^=P(B)<<7}function D(K,W,B){E(K[0],c),E(K[1],u),E(K[2],u),E(K[3],c);for(let g=255;g>=0;--g){const L=B[g/8|0]>>(g&7)&1;se(K,W,L),V(W,K),V(K,K),se(K,W,L)}}function N(K,W){const B=[i(),i(),i(),i()];E(B[0],m),E(B[1],y),E(B[2],u),f(B[3],m,y),D(K,B,W)}function X(K){if(K.length!==r.SEED_LENGTH)throw new Error(`ed25519: seed must be ${r.SEED_LENGTH} bytes`);const W=(0,t.hash)(K);W[0]&=248,W[31]&=127,W[31]|=64;const B=new Uint8Array(32),g=[i(),i(),i(),i()];N(g,W),ce(B,g);const L=new Uint8Array(64);return L.set(K),L.set(B,32),{publicKey:B,secretKey:L}}r.generateKeyPairFromSeed=X;function ee(K){const W=(0,e.randomBytes)(32,K),B=X(W);return(0,n.wipe)(W),B}r.generateKeyPair=ee;function Y(K){if(K.length!==r.SECRET_KEY_LENGTH)throw new Error(`ed25519: secret key must be ${r.SECRET_KEY_LENGTH} bytes`);return new Uint8Array(K.subarray(32))}r.extractPublicKeyFromSecretKey=Y;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 Q(K,W){let B,g,L,le;for(g=63;g>=32;--g){for(B=0,L=g-32,le=g-12;L<le;++L)W[L]+=B-16*W[g]*J[L-(g-32)],B=Math.floor((W[L]+128)/256),W[L]-=B*256;W[L]+=B,W[g]=0}for(B=0,L=0;L<32;L++)W[L]+=B-(W[31]>>4)*J[L],B=W[L]>>8,W[L]&=255;for(L=0;L<32;L++)W[L]-=B*J[L];for(g=0;g<32;g++)W[g+1]+=W[g]>>8,K[g]=W[g]&255}function ie(K){const W=new Float64Array(64);for(let B=0;B<64;B++)W[B]=K[B];for(let B=0;B<64;B++)K[B]=0;Q(K,W)}function Ee(K,W){const B=new Float64Array(64),g=[i(),i(),i(),i()],L=(0,t.hash)(K.subarray(0,32));L[0]&=248,L[31]&=127,L[31]|=64;const le=new Uint8Array(64);le.set(L.subarray(32),32);const pe=new t.SHA512;pe.update(le.subarray(32)),pe.update(W);const Oe=pe.digest();pe.clean(),ie(Oe),N(g,Oe),ce(le,g),pe.reset(),pe.update(le.subarray(0,32)),pe.update(K.subarray(32)),pe.update(W);const Ke=pe.digest();ie(Ke);for(let Je=0;Je<32;Je++)B[Je]=Oe[Je];for(let Je=0;Je<32;Je++)for(let ke=0;ke<32;ke++)B[Je+ke]+=Ke[Je]*L[ke];return Q(le.subarray(32),B),le}r.sign=Ee;function ae(K,W){const B=i(),g=i(),L=i(),le=i(),pe=i(),Oe=i(),Ke=i();return E(K[2],u),O(K[1],W),b(L,K[1]),f(le,L,d),x(L,L,K[2]),A(le,K[2],le),b(pe,le),b(Oe,pe),f(Ke,Oe,pe),f(B,Ke,L),f(B,B,le),j(B,B),f(B,B,L),f(B,B,le),f(B,B,le),f(K[0],B,le),b(g,K[0]),f(g,g,le),$(g,L)&&f(K[0],K[0],w),b(g,K[0]),f(g,g,le),$(g,L)?-1:(P(K[0])===W[31]>>7&&x(K[0],c,K[0]),f(K[3],K[0],K[1]),0)}function xe(K,W,B){const g=new Uint8Array(32),L=[i(),i(),i(),i()],le=[i(),i(),i(),i()];if(B.length!==r.SIGNATURE_LENGTH)throw new Error(`ed25519: signature must be ${r.SIGNATURE_LENGTH} bytes`);if(ae(le,K))return!1;const pe=new t.SHA512;pe.update(B.subarray(0,32)),pe.update(K),pe.update(W);const Oe=pe.digest();return ie(Oe),D(L,le,Oe),N(le,B.subarray(32)),V(L,le),ce(g,L),!F(B,g)}r.verify=xe;function de(K){let W=[i(),i(),i(),i()];if(ae(W,K))throw new Error("Ed25519: invalid public key");let B=i(),g=i(),L=W[1];A(B,u,L),x(g,u,L),q(g,g),f(B,B,g);let le=new Uint8Array(32);return U(le,B),le}r.convertPublicKeyToX25519=de;function be(K){const W=(0,t.hash)(K.subarray(0,32));W[0]&=248,W[31]&=127,W[31]|=64;const B=new Uint8Array(W.subarray(0,32));return(0,n.wipe)(W),B}r.convertSecretKeyToX25519=be}(Su);const Z5="EdDSA",Q5="JWT",Tp=".",Rp="base64url",X5="utf8",e6="utf8",t6=":",r6="did",n6="key",Np="base58btc",i6="z",s6="K36",o6=32;function za(r){return yr(Pr(Ui(r),X5),Rp)}function Lp(r){const e=Pr(s6,Np),t=i6+yr(kl([e,r]),Np);return[r6,n6,t].join(t6)}function a6(r){return yr(r,Rp)}function c6(r){return Pr([za(r.header),za(r.payload)].join(Tp),e6)}function l6(r){return[za(r.header),za(r.payload),a6(r.signature)].join(Tp)}function Mp(r=ms.randomBytes(o6)){return Su.generateKeyPairFromSeed(r)}async function u6(r,e,t,n,i=we.fromMiliseconds(Date.now())){const a={alg:Z5,typ:Q5},c=Lp(n.publicKey),u=i+t,d={iss:c,sub:r,aud:e,iat:i,exp:u},h=c6({header:a,payload:d}),m=Su.sign(n.secretKey,h);return l6({header:a,payload:d,signature:m})}const h6="PARSE_ERROR",f6="INVALID_REQUEST",d6="METHOD_NOT_FOUND",p6="INVALID_PARAMS",Up="INTERNAL_ERROR",Ou="SERVER_ERROR",g6=[-32700,-32600,-32601,-32602,-32603],Co={[h6]:{code:-32700,message:"Parse error"},[f6]:{code:-32600,message:"Invalid Request"},[d6]:{code:-32601,message:"Method not found"},[p6]:{code:-32602,message:"Invalid params"},[Up]:{code:-32603,message:"Internal error"},[Ou]:{code:-32e3,message:"Server error"}},jp=Ou;function m6(r){return g6.includes(r)}function Fp(r){return Object.keys(Co).includes(r)?Co[r]:Co[jp]}function v6(r){const e=Object.values(Co).find(t=>t.code===r);return e||Co[jp]}function Bp(r,e,t){return r.message.includes("getaddrinfo ENOTFOUND")||r.message.includes("connect ECONNREFUSED")?new Error(`Unavailable ${t} RPC url at ${e}`):r}var kp={};/*! *****************************************************************************
46
+ ***************************************************************************** */var _u=function(r,e){return _u=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)n.hasOwnProperty(i)&&(t[i]=n[i])},_u(r,e)};function y5(r,e){_u(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var Eu=function(){return Eu=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++){t=arguments[n];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e},Eu.apply(this,arguments)};function w5(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(t[n[i]]=r[n[i]]);return t}function b5(r,e,t,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(r,e,t,n);else for(var u=r.length-1;u>=0;u--)(c=r[u])&&(a=(i<3?c(a):i>3?c(e,t,a):c(e,t))||a);return i>3&&a&&Object.defineProperty(e,t,a),a}function _5(r,e){return function(t,n){e(t,n,r)}}function E5(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)}function x5(r,e,t,n){function i(a){return a instanceof t?a:new t(function(c){c(a)})}return new(t||(t=Promise))(function(a,c){function u(m){try{h(n.next(m))}catch(w){c(w)}}function f(m){try{h(n.throw(m))}catch(w){c(w)}}function h(m){m.done?a(m.value):i(m.value).then(u,f)}h((n=n.apply(r,e||[])).next())})}function I5(r,e){var t={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,i,a,c;return c={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function u(h){return function(m){return f([h,m])}}function f(h){if(n)throw new TypeError("Generator is already executing.");for(;t;)try{if(n=1,i&&(a=h[0]&2?i.return:h[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,h[1])).done)return a;switch(i=0,a&&(h=[h[0]&2,a.value]),h[0]){case 0:case 1:a=h;break;case 4:return t.label++,{value:h[1],done:!1};case 5:t.label++,i=h[1],h=[0];continue;case 7:h=t.ops.pop(),t.trys.pop();continue;default:if(a=t.trys,!(a=a.length>0&&a[a.length-1])&&(h[0]===6||h[0]===2)){t=0;continue}if(h[0]===3&&(!a||h[1]>a[0]&&h[1]<a[3])){t.label=h[1];break}if(h[0]===6&&t.label<a[1]){t.label=a[1],a=h;break}if(a&&t.label<a[2]){t.label=a[2],t.ops.push(h);break}a[2]&&t.ops.pop(),t.trys.pop();continue}h=e.call(r,t)}catch(m){h=[6,m],i=0}finally{n=a=0}if(h[0]&5)throw h[1];return{value:h[0]?h[1]:void 0,done:!0}}}function D5(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}function S5(r,e){for(var t in r)t!=="default"&&!e.hasOwnProperty(t)&&(e[t]=r[t])}function xu(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],n=0;if(t)return t.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function Dp(r,e){var t=typeof Symbol=="function"&&r[Symbol.iterator];if(!t)return r;var n=t.call(r),i,a=[],c;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)a.push(i.value)}catch(u){c={error:u}}finally{try{i&&!i.done&&(t=n.return)&&t.call(n)}finally{if(c)throw c.error}}return a}function C5(){for(var r=[],e=0;e<arguments.length;e++)r=r.concat(Dp(arguments[e]));return r}function O5(){for(var r=0,e=0,t=arguments.length;e<t;e++)r+=arguments[e].length;for(var n=Array(r),i=0,e=0;e<t;e++)for(var a=arguments[e],c=0,u=a.length;c<u;c++,i++)n[i]=a[c];return n}function $o(r){return this instanceof $o?(this.v=r,this):new $o(r)}function $5(r,e,t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=t.apply(r,e||[]),i,a=[];return i={},c("next"),c("throw"),c("return"),i[Symbol.asyncIterator]=function(){return this},i;function c(y){n[y]&&(i[y]=function(x){return new Promise(function(S,P){a.push([y,x,S,P])>1||u(y,x)})})}function u(y,x){try{f(n[y](x))}catch(S){w(a[0][3],S)}}function f(y){y.value instanceof $o?Promise.resolve(y.value.v).then(h,m):w(a[0][2],y)}function h(y){u("next",y)}function m(y){u("throw",y)}function w(y,x){y(x),a.shift(),a.length&&u(a[0][0],a[0][1])}}function A5(r){var e,t;return e={},n("next"),n("throw",function(i){throw i}),n("return"),e[Symbol.iterator]=function(){return this},e;function n(i,a){e[i]=r[i]?function(c){return(t=!t)?{value:$o(r[i](c)),done:i==="return"}:a?a(c):c}:a}}function P5(r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=r[Symbol.asyncIterator],t;return e?e.call(r):(r=typeof xu=="function"?xu(r):r[Symbol.iterator](),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(a){t[a]=r[a]&&function(c){return new Promise(function(u,f){c=r[a](c),i(u,f,c.done,c.value)})}}function i(a,c,u,f){Promise.resolve(f).then(function(h){a({value:h,done:u})},c)}}function T5(r,e){return Object.defineProperty?Object.defineProperty(r,"raw",{value:e}):r.raw=e,r}function R5(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)Object.hasOwnProperty.call(r,t)&&(e[t]=r[t]);return e.default=r,e}function N5(r){return r&&r.__esModule?r:{default:r}}function L5(r,e){if(!e.has(r))throw new TypeError("attempted to get private field on non-instance");return e.get(r)}function M5(r,e,t){if(!e.has(r))throw new TypeError("attempted to set private field on non-instance");return e.set(r,t),t}var U5=Object.freeze({__proto__:null,__extends:y5,get __assign(){return Eu},__rest:w5,__decorate:b5,__param:_5,__metadata:E5,__awaiter:x5,__generator:I5,__createBinding:D5,__exportStar:S5,__values:xu,__read:Dp,__spread:C5,__spreadArrays:O5,__await:$o,__asyncGenerator:$5,__asyncDelegator:A5,__asyncValues:P5,__makeTemplateObject:T5,__importStar:R5,__importDefault:N5,__classPrivateFieldGet:L5,__classPrivateFieldSet:M5}),j5=Pi(U5),Iu,Sp;function F5(){if(Sp)return Iu;Sp=1;function r(t){try{return JSON.stringify(t)}catch{return'"[Circular]"'}}Iu=e;function e(t,n,i){var a=i&&i.stringify||r,c=1;if(typeof t=="object"&&t!==null){var u=n.length+c;if(u===1)return t;var f=new Array(u);f[0]=a(t);for(var h=1;h<u;h++)f[h]=a(n[h]);return f.join(" ")}if(typeof t!="string")return t;var m=n.length;if(m===0)return t;for(var w="",y=1-c,x=-1,S=t&&t.length||0,P=0;P<S;){if(t.charCodeAt(P)===37&&P+1<S){switch(x=x>-1?x:0,t.charCodeAt(P+1)){case 100:case 102:if(y>=m||n[y]==null)break;x<P&&(w+=t.slice(x,P)),w+=Number(n[y]),x=P+2,P++;break;case 105:if(y>=m||n[y]==null)break;x<P&&(w+=t.slice(x,P)),w+=Math.floor(Number(n[y])),x=P+2,P++;break;case 79:case 111:case 106:if(y>=m||n[y]===void 0)break;x<P&&(w+=t.slice(x,P));var U=typeof n[y];if(U==="string"){w+="'"+n[y]+"'",x=P+2,P++;break}if(U==="function"){w+=n[y].name||"<anonymous>",x=P+2,P++;break}w+=a(n[y]),x=P+2,P++;break;case 115:if(y>=m)break;x<P&&(w+=t.slice(x,P)),w+=String(n[y]),x=P+2,P++;break;case 37:x<P&&(w+=t.slice(x,P)),w+="%",x=P+2,P++,y--;break}++y}++P}return x===-1?t:(x<S&&(w+=t.slice(x)),w)}return Iu}var Du,Cp;function B5(){if(Cp)return Du;Cp=1;const r=F5();Du=i;const e=$().console||{},t={mapHttpRequest:S,mapHttpResponse:S,wrapRequestSerializer:P,wrapResponseSerializer:P,wrapErrorSerializer:P,req:S,res:S,err:y};function n(E,d){return Array.isArray(E)?E.filter(function(H){return H!=="!stdSerializers.err"}):E===!0?Object.keys(d):!1}function i(E){E=E||{},E.browser=E.browser||{};const d=E.browser.transmit;if(d&&typeof d.send!="function")throw Error("pino: transmit option must have a send function");const b=E.browser.write||e;E.browser.write&&(E.browser.asObject=!0);const H=E.serializers||{},F=n(E.browser.serialize,H);let V=E.browser.serialize;Array.isArray(E.browser.serialize)&&E.browser.serialize.indexOf("!stdSerializers.err")>-1&&(V=!1);const se=["error","fatal","warn","info","debug","trace"];typeof b=="function"&&(b.error=b.fatal=b.warn=b.info=b.debug=b.trace=b),E.enabled===!1&&(E.level="silent");const ce=E.level||"info",I=Object.create(b);I.log||(I.log=U),Object.defineProperty(I,"levelVal",{get:X}),Object.defineProperty(I,"level",{get:ee,set:Y});const N={transmit:d,serialize:F,asObject:E.browser.asObject,levels:se,timestamp:x(E)};I.levels=i.levels,I.level=ce,I.setMaxListeners=I.getMaxListeners=I.emit=I.addListener=I.on=I.prependListener=I.once=I.prependOnceListener=I.removeListener=I.removeAllListeners=I.listeners=I.listenerCount=I.eventNames=I.write=I.flush=U,I.serializers=H,I._serialize=F,I._stdErrSerialize=V,I.child=J,d&&(I._logEvent=w());function X(){return this.level==="silent"?1/0:this.levels.values[this.level]}function ee(){return this._level}function Y(Q){if(Q!=="silent"&&!this.levels.values[Q])throw Error("unknown level "+Q);this._level=Q,a(N,I,"error","log"),a(N,I,"fatal","error"),a(N,I,"warn","error"),a(N,I,"info","log"),a(N,I,"debug","log"),a(N,I,"trace","log")}function J(Q,ie){if(!Q)throw new Error("missing bindings for child Pino");ie=ie||{},F&&Q.serializers&&(ie.serializers=Q.serializers);const Ee=ie.serializers;if(F&&Ee){var ae=Object.assign({},H,Ee),xe=E.browser.serialize===!0?Object.keys(ae):F;delete Q.serializers,f([Q],xe,ae,this._stdErrSerialize)}function de(be){this._childLevel=(be._childLevel|0)+1,this.error=h(be,Q,"error"),this.fatal=h(be,Q,"fatal"),this.warn=h(be,Q,"warn"),this.info=h(be,Q,"info"),this.debug=h(be,Q,"debug"),this.trace=h(be,Q,"trace"),ae&&(this.serializers=ae,this._serialize=xe),d&&(this._logEvent=w([].concat(be._logEvent.bindings,Q)))}return de.prototype=this,new de(this)}return I}i.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"}},i.stdSerializers=t,i.stdTimeFunctions=Object.assign({},{nullTime:j,epochTime:A,unixTime:T,isoTime:C});function a(E,d,b,H){const F=Object.getPrototypeOf(d);d[b]=d.levelVal>d.levels.values[b]?U:F[b]?F[b]:e[b]||e[H]||U,c(E,d,b)}function c(E,d,b){!E.transmit&&d[b]===U||(d[b]=function(H){return function(){const V=E.timestamp(),se=new Array(arguments.length),ce=Object.getPrototypeOf&&Object.getPrototypeOf(this)===e?e:this;for(var I=0;I<se.length;I++)se[I]=arguments[I];if(E.serialize&&!E.asObject&&f(se,this._serialize,this.serializers,this._stdErrSerialize),E.asObject?H.call(ce,u(this,b,se,V)):H.apply(ce,se),E.transmit){const N=E.transmit.level||d.level,X=i.levels.values[N],ee=i.levels.values[b];if(ee<X)return;m(this,{ts:V,methodLevel:b,methodValue:ee,transmitLevel:N,transmitValue:i.levels.values[E.transmit.level||d.level],send:E.transmit.send,val:d.levelVal},se)}}}(d[b]))}function u(E,d,b,H){E._serialize&&f(b,E._serialize,E.serializers,E._stdErrSerialize);const F=b.slice();let V=F[0];const se={};H&&(se.time=H),se.level=i.levels.values[d];let ce=(E._childLevel|0)+1;if(ce<1&&(ce=1),V!==null&&typeof V=="object"){for(;ce--&&typeof F[0]=="object";)Object.assign(se,F.shift());V=F.length?r(F.shift(),F):void 0}else typeof V=="string"&&(V=r(F.shift(),F));return V!==void 0&&(se.msg=V),se}function f(E,d,b,H){for(const F in E)if(H&&E[F]instanceof Error)E[F]=i.stdSerializers.err(E[F]);else if(typeof E[F]=="object"&&!Array.isArray(E[F]))for(const V in E[F])d&&d.indexOf(V)>-1&&V in b&&(E[F][V]=b[V](E[F][V]))}function h(E,d,b){return function(){const H=new Array(1+arguments.length);H[0]=d;for(var F=1;F<H.length;F++)H[F]=arguments[F-1];return E[b].apply(this,H)}}function m(E,d,b){const H=d.send,F=d.ts,V=d.methodLevel,se=d.methodValue,ce=d.val,I=E._logEvent.bindings;f(b,E._serialize||Object.keys(E.serializers),E.serializers,E._stdErrSerialize===void 0?!0:E._stdErrSerialize),E._logEvent.ts=F,E._logEvent.messages=b.filter(function(N){return I.indexOf(N)===-1}),E._logEvent.level.label=V,E._logEvent.level.value=se,H(V,E._logEvent,ce),E._logEvent=w(I)}function w(E){return{ts:0,messages:[],bindings:E||[],level:{label:"",value:0}}}function y(E){const d={type:E.constructor.name,msg:E.message,stack:E.stack};for(const b in E)d[b]===void 0&&(d[b]=E[b]);return d}function x(E){return typeof E.timestamp=="function"?E.timestamp:E.timestamp===!1?j:A}function S(){return{}}function P(E){return E}function U(){}function j(){return!1}function A(){return Date.now()}function T(){return Math.round(Date.now()/1e3)}function C(){return new Date(Date.now()).toISOString()}function $(){function E(d){return typeof d<"u"&&d}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 E(self)||E(window)||E(this)||{}}}return Du}var ki={},Op;function $p(){return Op||(Op=1,Object.defineProperty(ki,"__esModule",{value:!0}),ki.PINO_CUSTOM_CONTEXT_KEY=ki.PINO_LOGGER_DEFAULTS=void 0,ki.PINO_LOGGER_DEFAULTS={level:"info"},ki.PINO_CUSTOM_CONTEXT_KEY="custom_context"),ki}var Er={},Ap;function k5(){if(Ap)return Er;Ap=1,Object.defineProperty(Er,"__esModule",{value:!0}),Er.generateChildLogger=Er.formatChildLoggerContext=Er.getLoggerContext=Er.setBrowserLoggerContext=Er.getBrowserLoggerContext=Er.getDefaultLoggerOptions=void 0;const r=$p();function e(u){return Object.assign(Object.assign({},u),{level:u?.level||r.PINO_LOGGER_DEFAULTS.level})}Er.getDefaultLoggerOptions=e;function t(u,f=r.PINO_CUSTOM_CONTEXT_KEY){return u[f]||""}Er.getBrowserLoggerContext=t;function n(u,f,h=r.PINO_CUSTOM_CONTEXT_KEY){return u[h]=f,u}Er.setBrowserLoggerContext=n;function i(u,f=r.PINO_CUSTOM_CONTEXT_KEY){let h="";return typeof u.bindings>"u"?h=t(u,f):h=u.bindings().context||"",h}Er.getLoggerContext=i;function a(u,f,h=r.PINO_CUSTOM_CONTEXT_KEY){const m=i(u,h);return m.trim()?`${m}/${f}`:f}Er.formatChildLoggerContext=a;function c(u,f,h=r.PINO_CUSTOM_CONTEXT_KEY){const m=a(u,f,h),w=u.child({context:m});return n(w,m,h)}return Er.generateChildLogger=c,Er}(function(r){Object.defineProperty(r,"__esModule",{value:!0}),r.pino=void 0;const e=j5,t=e.__importDefault(B5());Object.defineProperty(r,"pino",{enumerable:!0,get:function(){return t.default}}),e.__exportStar($p(),r),e.__exportStar(k5(),r)})(Xe);class q5 extends Fi{constructor(e){super(),this.opts=e,this.protocol="wc",this.version=2}}class z5 extends Fi{constructor(e,t){super(),this.core=e,this.logger=t,this.records=new Map}}class H5{constructor(e,t){this.logger=e,this.core=t}}class W5 extends Fi{constructor(e,t){super(),this.relayer=e,this.logger=t}}class K5 extends Fi{constructor(e){super()}}class V5{constructor(e,t,n,i){this.core=e,this.logger=t,this.name=n}}class G5 extends Fi{constructor(e,t){super(),this.relayer=e,this.logger=t}}class Y5 extends Fi{constructor(e,t){super(),this.core=e,this.logger=t}}class J5{constructor(e,t){this.projectId=e,this.logger=t}}class Z5{constructor(e,t){this.projectId=e,this.logger=t}}class Q5{constructor(e){this.opts=e,this.protocol="wc",this.version=2}}class X5{constructor(e){this.client=e}}var Su={},Pp={};(function(r){Object.defineProperty(r,"__esModule",{value:!0});var e=Me,t=zr;r.DIGEST_LENGTH=64,r.BLOCK_SIZE=128;var n=function(){function u(){this.digestLength=r.DIGEST_LENGTH,this.blockSize=r.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 u.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},u.prototype.reset=function(){return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this},u.prototype.clean=function(){t.wipe(this._buffer),t.wipe(this._tempHi),t.wipe(this._tempLo),this.reset()},u.prototype.update=function(f,h){if(h===void 0&&(h=f.length),this._finished)throw new Error("SHA512: can't update because hash was finished.");var m=0;if(this._bytesHashed+=h,this._bufferLength>0){for(;this._bufferLength<r.BLOCK_SIZE&&h>0;)this._buffer[this._bufferLength++]=f[m++],h--;this._bufferLength===this.blockSize&&(a(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,this.blockSize),this._bufferLength=0)}for(h>=this.blockSize&&(m=a(this._tempHi,this._tempLo,this._stateHi,this._stateLo,f,m,h),h%=this.blockSize);h>0;)this._buffer[this._bufferLength++]=f[m++],h--;return this},u.prototype.finish=function(f){if(!this._finished){var h=this._bytesHashed,m=this._bufferLength,w=h/536870912|0,y=h<<3,x=h%128<112?128:256;this._buffer[m]=128;for(var S=m+1;S<x-8;S++)this._buffer[S]=0;e.writeUint32BE(w,this._buffer,x-8),e.writeUint32BE(y,this._buffer,x-4),a(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,x),this._finished=!0}for(var S=0;S<this.digestLength/8;S++)e.writeUint32BE(this._stateHi[S],f,S*8),e.writeUint32BE(this._stateLo[S],f,S*8+4);return this},u.prototype.digest=function(){var f=new Uint8Array(this.digestLength);return this.finish(f),f},u.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}},u.prototype.restoreState=function(f){return this._stateHi.set(f.stateHi),this._stateLo.set(f.stateLo),this._bufferLength=f.bufferLength,f.buffer&&this._buffer.set(f.buffer),this._bytesHashed=f.bytesHashed,this._finished=!1,this},u.prototype.cleanSavedState=function(f){t.wipe(f.stateHi),t.wipe(f.stateLo),f.buffer&&t.wipe(f.buffer),f.bufferLength=0,f.bytesHashed=0},u}();r.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 a(u,f,h,m,w,y,x){for(var S=h[0],P=h[1],U=h[2],j=h[3],A=h[4],T=h[5],C=h[6],$=h[7],E=m[0],d=m[1],b=m[2],H=m[3],F=m[4],V=m[5],se=m[6],ce=m[7],I,N,X,ee,Y,J,Q,ie;x>=128;){for(var Ee=0;Ee<16;Ee++){var ae=8*Ee+y;u[Ee]=e.readUint32BE(w,ae),f[Ee]=e.readUint32BE(w,ae+4)}for(var Ee=0;Ee<80;Ee++){var xe=S,de=P,be=U,K=j,W=A,B=T,g=C,L=$,le=E,pe=d,Ce=b,Ke=H,Je=F,ke=V,St=se,Ct=ce;if(I=$,N=ce,Y=N&65535,J=N>>>16,Q=I&65535,ie=I>>>16,I=(A>>>14|F<<32-14)^(A>>>18|F<<32-18)^(F>>>41-32|A<<32-(41-32)),N=(F>>>14|A<<32-14)^(F>>>18|A<<32-18)^(A>>>41-32|F<<32-(41-32)),Y+=N&65535,J+=N>>>16,Q+=I&65535,ie+=I>>>16,I=A&T^~A&C,N=F&V^~F&se,Y+=N&65535,J+=N>>>16,Q+=I&65535,ie+=I>>>16,I=i[Ee*2],N=i[Ee*2+1],Y+=N&65535,J+=N>>>16,Q+=I&65535,ie+=I>>>16,I=u[Ee%16],N=f[Ee%16],Y+=N&65535,J+=N>>>16,Q+=I&65535,ie+=I>>>16,J+=Y>>>16,Q+=J>>>16,ie+=Q>>>16,X=Q&65535|ie<<16,ee=Y&65535|J<<16,I=X,N=ee,Y=N&65535,J=N>>>16,Q=I&65535,ie=I>>>16,I=(S>>>28|E<<32-28)^(E>>>34-32|S<<32-(34-32))^(E>>>39-32|S<<32-(39-32)),N=(E>>>28|S<<32-28)^(S>>>34-32|E<<32-(34-32))^(S>>>39-32|E<<32-(39-32)),Y+=N&65535,J+=N>>>16,Q+=I&65535,ie+=I>>>16,I=S&P^S&U^P&U,N=E&d^E&b^d&b,Y+=N&65535,J+=N>>>16,Q+=I&65535,ie+=I>>>16,J+=Y>>>16,Q+=J>>>16,ie+=Q>>>16,L=Q&65535|ie<<16,Ct=Y&65535|J<<16,I=K,N=Ke,Y=N&65535,J=N>>>16,Q=I&65535,ie=I>>>16,I=X,N=ee,Y+=N&65535,J+=N>>>16,Q+=I&65535,ie+=I>>>16,J+=Y>>>16,Q+=J>>>16,ie+=Q>>>16,K=Q&65535|ie<<16,Ke=Y&65535|J<<16,P=xe,U=de,j=be,A=K,T=W,C=B,$=g,S=L,d=le,b=pe,H=Ce,F=Ke,V=Je,se=ke,ce=St,E=Ct,Ee%16===15)for(var ae=0;ae<16;ae++)I=u[ae],N=f[ae],Y=N&65535,J=N>>>16,Q=I&65535,ie=I>>>16,I=u[(ae+9)%16],N=f[(ae+9)%16],Y+=N&65535,J+=N>>>16,Q+=I&65535,ie+=I>>>16,X=u[(ae+1)%16],ee=f[(ae+1)%16],I=(X>>>1|ee<<32-1)^(X>>>8|ee<<32-8)^X>>>7,N=(ee>>>1|X<<32-1)^(ee>>>8|X<<32-8)^(ee>>>7|X<<32-7),Y+=N&65535,J+=N>>>16,Q+=I&65535,ie+=I>>>16,X=u[(ae+14)%16],ee=f[(ae+14)%16],I=(X>>>19|ee<<32-19)^(ee>>>61-32|X<<32-(61-32))^X>>>6,N=(ee>>>19|X<<32-19)^(X>>>61-32|ee<<32-(61-32))^(ee>>>6|X<<32-6),Y+=N&65535,J+=N>>>16,Q+=I&65535,ie+=I>>>16,J+=Y>>>16,Q+=J>>>16,ie+=Q>>>16,u[ae]=Q&65535|ie<<16,f[ae]=Y&65535|J<<16}I=S,N=E,Y=N&65535,J=N>>>16,Q=I&65535,ie=I>>>16,I=h[0],N=m[0],Y+=N&65535,J+=N>>>16,Q+=I&65535,ie+=I>>>16,J+=Y>>>16,Q+=J>>>16,ie+=Q>>>16,h[0]=S=Q&65535|ie<<16,m[0]=E=Y&65535|J<<16,I=P,N=d,Y=N&65535,J=N>>>16,Q=I&65535,ie=I>>>16,I=h[1],N=m[1],Y+=N&65535,J+=N>>>16,Q+=I&65535,ie+=I>>>16,J+=Y>>>16,Q+=J>>>16,ie+=Q>>>16,h[1]=P=Q&65535|ie<<16,m[1]=d=Y&65535|J<<16,I=U,N=b,Y=N&65535,J=N>>>16,Q=I&65535,ie=I>>>16,I=h[2],N=m[2],Y+=N&65535,J+=N>>>16,Q+=I&65535,ie+=I>>>16,J+=Y>>>16,Q+=J>>>16,ie+=Q>>>16,h[2]=U=Q&65535|ie<<16,m[2]=b=Y&65535|J<<16,I=j,N=H,Y=N&65535,J=N>>>16,Q=I&65535,ie=I>>>16,I=h[3],N=m[3],Y+=N&65535,J+=N>>>16,Q+=I&65535,ie+=I>>>16,J+=Y>>>16,Q+=J>>>16,ie+=Q>>>16,h[3]=j=Q&65535|ie<<16,m[3]=H=Y&65535|J<<16,I=A,N=F,Y=N&65535,J=N>>>16,Q=I&65535,ie=I>>>16,I=h[4],N=m[4],Y+=N&65535,J+=N>>>16,Q+=I&65535,ie+=I>>>16,J+=Y>>>16,Q+=J>>>16,ie+=Q>>>16,h[4]=A=Q&65535|ie<<16,m[4]=F=Y&65535|J<<16,I=T,N=V,Y=N&65535,J=N>>>16,Q=I&65535,ie=I>>>16,I=h[5],N=m[5],Y+=N&65535,J+=N>>>16,Q+=I&65535,ie+=I>>>16,J+=Y>>>16,Q+=J>>>16,ie+=Q>>>16,h[5]=T=Q&65535|ie<<16,m[5]=V=Y&65535|J<<16,I=C,N=se,Y=N&65535,J=N>>>16,Q=I&65535,ie=I>>>16,I=h[6],N=m[6],Y+=N&65535,J+=N>>>16,Q+=I&65535,ie+=I>>>16,J+=Y>>>16,Q+=J>>>16,ie+=Q>>>16,h[6]=C=Q&65535|ie<<16,m[6]=se=Y&65535|J<<16,I=$,N=ce,Y=N&65535,J=N>>>16,Q=I&65535,ie=I>>>16,I=h[7],N=m[7],Y+=N&65535,J+=N>>>16,Q+=I&65535,ie+=I>>>16,J+=Y>>>16,Q+=J>>>16,ie+=Q>>>16,h[7]=$=Q&65535|ie<<16,m[7]=ce=Y&65535|J<<16,y+=128,x-=128}return y}function c(u){var f=new n;f.update(u);var h=f.digest();return f.clean(),h}r.hash=c})(Pp),function(r){Object.defineProperty(r,"__esModule",{value:!0}),r.convertSecretKeyToX25519=r.convertPublicKeyToX25519=r.verify=r.sign=r.extractPublicKeyFromSecretKey=r.generateKeyPair=r.generateKeyPairFromSeed=r.SEED_LENGTH=r.SECRET_KEY_LENGTH=r.PUBLIC_KEY_LENGTH=r.SIGNATURE_LENGTH=void 0;const e=vs,t=Pp,n=zr;r.SIGNATURE_LENGTH=64,r.PUBLIC_KEY_LENGTH=32,r.SECRET_KEY_LENGTH=64,r.SEED_LENGTH=32;function i(K){const W=new Float64Array(16);if(K)for(let B=0;B<K.length;B++)W[B]=K[B];return W}const a=new Uint8Array(32);a[0]=9;const c=i(),u=i([1]),f=i([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),h=i([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),m=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 x(K,W){for(let B=0;B<16;B++)K[B]=W[B]|0}function S(K){let W=1;for(let B=0;B<16;B++){let g=K[B]+W+65535;W=Math.floor(g/65536),K[B]=g-W*65536}K[0]+=W-1+37*(W-1)}function P(K,W,B){const g=~(B-1);for(let L=0;L<16;L++){const le=g&(K[L]^W[L]);K[L]^=le,W[L]^=le}}function U(K,W){const B=i(),g=i();for(let L=0;L<16;L++)g[L]=W[L];S(g),S(g),S(g);for(let L=0;L<2;L++){B[0]=g[0]-65517;for(let pe=1;pe<15;pe++)B[pe]=g[pe]-65535-(B[pe-1]>>16&1),B[pe-1]&=65535;B[15]=g[15]-32767-(B[14]>>16&1);const le=B[15]>>16&1;B[14]&=65535,P(g,B,1-le)}for(let L=0;L<16;L++)K[2*L]=g[L]&255,K[2*L+1]=g[L]>>8}function j(K,W){let B=0;for(let g=0;g<32;g++)B|=K[g]^W[g];return(1&B-1>>>8)-1}function A(K,W){const B=new Uint8Array(32),g=new Uint8Array(32);return U(B,K),U(g,W),j(B,g)}function T(K){const W=new Uint8Array(32);return U(W,K),W[0]&1}function C(K,W){for(let B=0;B<16;B++)K[B]=W[2*B]+(W[2*B+1]<<8);K[15]&=32767}function $(K,W,B){for(let g=0;g<16;g++)K[g]=W[g]+B[g]}function E(K,W,B){for(let g=0;g<16;g++)K[g]=W[g]-B[g]}function d(K,W,B){let g,L,le=0,pe=0,Ce=0,Ke=0,Je=0,ke=0,St=0,Ct=0,ze=0,Oe=0,Ue=0,je=0,He=0,Ae=0,Fe=0,Se=0,Te=0,Ve=0,$e=0,Ze=0,et=0,at=0,ct=0,nt=0,Sr=0,Ur=0,On=0,Cr=0,Wn=0,bi=0,rs=0,Lt=B[0],Ot=B[1],Mt=B[2],Ut=B[3],Tt=B[4],$t=B[5],Gt=B[6],Yt=B[7],jt=B[8],Jt=B[9],Ft=B[10],Ht=B[11],Bt=B[12],_t=B[13],Zt=B[14],Qt=B[15];g=W[0],le+=g*Lt,pe+=g*Ot,Ce+=g*Mt,Ke+=g*Ut,Je+=g*Tt,ke+=g*$t,St+=g*Gt,Ct+=g*Yt,ze+=g*jt,Oe+=g*Jt,Ue+=g*Ft,je+=g*Ht,He+=g*Bt,Ae+=g*_t,Fe+=g*Zt,Se+=g*Qt,g=W[1],pe+=g*Lt,Ce+=g*Ot,Ke+=g*Mt,Je+=g*Ut,ke+=g*Tt,St+=g*$t,Ct+=g*Gt,ze+=g*Yt,Oe+=g*jt,Ue+=g*Jt,je+=g*Ft,He+=g*Ht,Ae+=g*Bt,Fe+=g*_t,Se+=g*Zt,Te+=g*Qt,g=W[2],Ce+=g*Lt,Ke+=g*Ot,Je+=g*Mt,ke+=g*Ut,St+=g*Tt,Ct+=g*$t,ze+=g*Gt,Oe+=g*Yt,Ue+=g*jt,je+=g*Jt,He+=g*Ft,Ae+=g*Ht,Fe+=g*Bt,Se+=g*_t,Te+=g*Zt,Ve+=g*Qt,g=W[3],Ke+=g*Lt,Je+=g*Ot,ke+=g*Mt,St+=g*Ut,Ct+=g*Tt,ze+=g*$t,Oe+=g*Gt,Ue+=g*Yt,je+=g*jt,He+=g*Jt,Ae+=g*Ft,Fe+=g*Ht,Se+=g*Bt,Te+=g*_t,Ve+=g*Zt,$e+=g*Qt,g=W[4],Je+=g*Lt,ke+=g*Ot,St+=g*Mt,Ct+=g*Ut,ze+=g*Tt,Oe+=g*$t,Ue+=g*Gt,je+=g*Yt,He+=g*jt,Ae+=g*Jt,Fe+=g*Ft,Se+=g*Ht,Te+=g*Bt,Ve+=g*_t,$e+=g*Zt,Ze+=g*Qt,g=W[5],ke+=g*Lt,St+=g*Ot,Ct+=g*Mt,ze+=g*Ut,Oe+=g*Tt,Ue+=g*$t,je+=g*Gt,He+=g*Yt,Ae+=g*jt,Fe+=g*Jt,Se+=g*Ft,Te+=g*Ht,Ve+=g*Bt,$e+=g*_t,Ze+=g*Zt,et+=g*Qt,g=W[6],St+=g*Lt,Ct+=g*Ot,ze+=g*Mt,Oe+=g*Ut,Ue+=g*Tt,je+=g*$t,He+=g*Gt,Ae+=g*Yt,Fe+=g*jt,Se+=g*Jt,Te+=g*Ft,Ve+=g*Ht,$e+=g*Bt,Ze+=g*_t,et+=g*Zt,at+=g*Qt,g=W[7],Ct+=g*Lt,ze+=g*Ot,Oe+=g*Mt,Ue+=g*Ut,je+=g*Tt,He+=g*$t,Ae+=g*Gt,Fe+=g*Yt,Se+=g*jt,Te+=g*Jt,Ve+=g*Ft,$e+=g*Ht,Ze+=g*Bt,et+=g*_t,at+=g*Zt,ct+=g*Qt,g=W[8],ze+=g*Lt,Oe+=g*Ot,Ue+=g*Mt,je+=g*Ut,He+=g*Tt,Ae+=g*$t,Fe+=g*Gt,Se+=g*Yt,Te+=g*jt,Ve+=g*Jt,$e+=g*Ft,Ze+=g*Ht,et+=g*Bt,at+=g*_t,ct+=g*Zt,nt+=g*Qt,g=W[9],Oe+=g*Lt,Ue+=g*Ot,je+=g*Mt,He+=g*Ut,Ae+=g*Tt,Fe+=g*$t,Se+=g*Gt,Te+=g*Yt,Ve+=g*jt,$e+=g*Jt,Ze+=g*Ft,et+=g*Ht,at+=g*Bt,ct+=g*_t,nt+=g*Zt,Sr+=g*Qt,g=W[10],Ue+=g*Lt,je+=g*Ot,He+=g*Mt,Ae+=g*Ut,Fe+=g*Tt,Se+=g*$t,Te+=g*Gt,Ve+=g*Yt,$e+=g*jt,Ze+=g*Jt,et+=g*Ft,at+=g*Ht,ct+=g*Bt,nt+=g*_t,Sr+=g*Zt,Ur+=g*Qt,g=W[11],je+=g*Lt,He+=g*Ot,Ae+=g*Mt,Fe+=g*Ut,Se+=g*Tt,Te+=g*$t,Ve+=g*Gt,$e+=g*Yt,Ze+=g*jt,et+=g*Jt,at+=g*Ft,ct+=g*Ht,nt+=g*Bt,Sr+=g*_t,Ur+=g*Zt,On+=g*Qt,g=W[12],He+=g*Lt,Ae+=g*Ot,Fe+=g*Mt,Se+=g*Ut,Te+=g*Tt,Ve+=g*$t,$e+=g*Gt,Ze+=g*Yt,et+=g*jt,at+=g*Jt,ct+=g*Ft,nt+=g*Ht,Sr+=g*Bt,Ur+=g*_t,On+=g*Zt,Cr+=g*Qt,g=W[13],Ae+=g*Lt,Fe+=g*Ot,Se+=g*Mt,Te+=g*Ut,Ve+=g*Tt,$e+=g*$t,Ze+=g*Gt,et+=g*Yt,at+=g*jt,ct+=g*Jt,nt+=g*Ft,Sr+=g*Ht,Ur+=g*Bt,On+=g*_t,Cr+=g*Zt,Wn+=g*Qt,g=W[14],Fe+=g*Lt,Se+=g*Ot,Te+=g*Mt,Ve+=g*Ut,$e+=g*Tt,Ze+=g*$t,et+=g*Gt,at+=g*Yt,ct+=g*jt,nt+=g*Jt,Sr+=g*Ft,Ur+=g*Ht,On+=g*Bt,Cr+=g*_t,Wn+=g*Zt,bi+=g*Qt,g=W[15],Se+=g*Lt,Te+=g*Ot,Ve+=g*Mt,$e+=g*Ut,Ze+=g*Tt,et+=g*$t,at+=g*Gt,ct+=g*Yt,nt+=g*jt,Sr+=g*Jt,Ur+=g*Ft,On+=g*Ht,Cr+=g*Bt,Wn+=g*_t,bi+=g*Zt,rs+=g*Qt,le+=38*Te,pe+=38*Ve,Ce+=38*$e,Ke+=38*Ze,Je+=38*et,ke+=38*at,St+=38*ct,Ct+=38*nt,ze+=38*Sr,Oe+=38*Ur,Ue+=38*On,je+=38*Cr,He+=38*Wn,Ae+=38*bi,Fe+=38*rs,L=1,g=le+L+65535,L=Math.floor(g/65536),le=g-L*65536,g=pe+L+65535,L=Math.floor(g/65536),pe=g-L*65536,g=Ce+L+65535,L=Math.floor(g/65536),Ce=g-L*65536,g=Ke+L+65535,L=Math.floor(g/65536),Ke=g-L*65536,g=Je+L+65535,L=Math.floor(g/65536),Je=g-L*65536,g=ke+L+65535,L=Math.floor(g/65536),ke=g-L*65536,g=St+L+65535,L=Math.floor(g/65536),St=g-L*65536,g=Ct+L+65535,L=Math.floor(g/65536),Ct=g-L*65536,g=ze+L+65535,L=Math.floor(g/65536),ze=g-L*65536,g=Oe+L+65535,L=Math.floor(g/65536),Oe=g-L*65536,g=Ue+L+65535,L=Math.floor(g/65536),Ue=g-L*65536,g=je+L+65535,L=Math.floor(g/65536),je=g-L*65536,g=He+L+65535,L=Math.floor(g/65536),He=g-L*65536,g=Ae+L+65535,L=Math.floor(g/65536),Ae=g-L*65536,g=Fe+L+65535,L=Math.floor(g/65536),Fe=g-L*65536,g=Se+L+65535,L=Math.floor(g/65536),Se=g-L*65536,le+=L-1+37*(L-1),L=1,g=le+L+65535,L=Math.floor(g/65536),le=g-L*65536,g=pe+L+65535,L=Math.floor(g/65536),pe=g-L*65536,g=Ce+L+65535,L=Math.floor(g/65536),Ce=g-L*65536,g=Ke+L+65535,L=Math.floor(g/65536),Ke=g-L*65536,g=Je+L+65535,L=Math.floor(g/65536),Je=g-L*65536,g=ke+L+65535,L=Math.floor(g/65536),ke=g-L*65536,g=St+L+65535,L=Math.floor(g/65536),St=g-L*65536,g=Ct+L+65535,L=Math.floor(g/65536),Ct=g-L*65536,g=ze+L+65535,L=Math.floor(g/65536),ze=g-L*65536,g=Oe+L+65535,L=Math.floor(g/65536),Oe=g-L*65536,g=Ue+L+65535,L=Math.floor(g/65536),Ue=g-L*65536,g=je+L+65535,L=Math.floor(g/65536),je=g-L*65536,g=He+L+65535,L=Math.floor(g/65536),He=g-L*65536,g=Ae+L+65535,L=Math.floor(g/65536),Ae=g-L*65536,g=Fe+L+65535,L=Math.floor(g/65536),Fe=g-L*65536,g=Se+L+65535,L=Math.floor(g/65536),Se=g-L*65536,le+=L-1+37*(L-1),K[0]=le,K[1]=pe,K[2]=Ce,K[3]=Ke,K[4]=Je,K[5]=ke,K[6]=St,K[7]=Ct,K[8]=ze,K[9]=Oe,K[10]=Ue,K[11]=je,K[12]=He,K[13]=Ae,K[14]=Fe,K[15]=Se}function b(K,W){d(K,W,W)}function H(K,W){const B=i();let g;for(g=0;g<16;g++)B[g]=W[g];for(g=253;g>=0;g--)b(B,B),g!==2&&g!==4&&d(B,B,W);for(g=0;g<16;g++)K[g]=B[g]}function F(K,W){const B=i();let g;for(g=0;g<16;g++)B[g]=W[g];for(g=250;g>=0;g--)b(B,B),g!==1&&d(B,B,W);for(g=0;g<16;g++)K[g]=B[g]}function V(K,W){const B=i(),g=i(),L=i(),le=i(),pe=i(),Ce=i(),Ke=i(),Je=i(),ke=i();E(B,K[1],K[0]),E(ke,W[1],W[0]),d(B,B,ke),$(g,K[0],K[1]),$(ke,W[0],W[1]),d(g,g,ke),d(L,K[3],W[3]),d(L,L,h),d(le,K[2],W[2]),$(le,le,le),E(pe,g,B),E(Ce,le,L),$(Ke,le,L),$(Je,g,B),d(K[0],pe,Ce),d(K[1],Je,Ke),d(K[2],Ke,Ce),d(K[3],pe,Je)}function se(K,W,B){for(let g=0;g<4;g++)P(K[g],W[g],B)}function ce(K,W){const B=i(),g=i(),L=i();H(L,W[2]),d(B,W[0],L),d(g,W[1],L),U(K,g),K[31]^=T(B)<<7}function I(K,W,B){x(K[0],c),x(K[1],u),x(K[2],u),x(K[3],c);for(let g=255;g>=0;--g){const L=B[g/8|0]>>(g&7)&1;se(K,W,L),V(W,K),V(K,K),se(K,W,L)}}function N(K,W){const B=[i(),i(),i(),i()];x(B[0],m),x(B[1],w),x(B[2],u),d(B[3],m,w),I(K,B,W)}function X(K){if(K.length!==r.SEED_LENGTH)throw new Error(`ed25519: seed must be ${r.SEED_LENGTH} bytes`);const W=(0,t.hash)(K);W[0]&=248,W[31]&=127,W[31]|=64;const B=new Uint8Array(32),g=[i(),i(),i(),i()];N(g,W),ce(B,g);const L=new Uint8Array(64);return L.set(K),L.set(B,32),{publicKey:B,secretKey:L}}r.generateKeyPairFromSeed=X;function ee(K){const W=(0,e.randomBytes)(32,K),B=X(W);return(0,n.wipe)(W),B}r.generateKeyPair=ee;function Y(K){if(K.length!==r.SECRET_KEY_LENGTH)throw new Error(`ed25519: secret key must be ${r.SECRET_KEY_LENGTH} bytes`);return new Uint8Array(K.subarray(32))}r.extractPublicKeyFromSecretKey=Y;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 Q(K,W){let B,g,L,le;for(g=63;g>=32;--g){for(B=0,L=g-32,le=g-12;L<le;++L)W[L]+=B-16*W[g]*J[L-(g-32)],B=Math.floor((W[L]+128)/256),W[L]-=B*256;W[L]+=B,W[g]=0}for(B=0,L=0;L<32;L++)W[L]+=B-(W[31]>>4)*J[L],B=W[L]>>8,W[L]&=255;for(L=0;L<32;L++)W[L]-=B*J[L];for(g=0;g<32;g++)W[g+1]+=W[g]>>8,K[g]=W[g]&255}function ie(K){const W=new Float64Array(64);for(let B=0;B<64;B++)W[B]=K[B];for(let B=0;B<64;B++)K[B]=0;Q(K,W)}function Ee(K,W){const B=new Float64Array(64),g=[i(),i(),i(),i()],L=(0,t.hash)(K.subarray(0,32));L[0]&=248,L[31]&=127,L[31]|=64;const le=new Uint8Array(64);le.set(L.subarray(32),32);const pe=new t.SHA512;pe.update(le.subarray(32)),pe.update(W);const Ce=pe.digest();pe.clean(),ie(Ce),N(g,Ce),ce(le,g),pe.reset(),pe.update(le.subarray(0,32)),pe.update(K.subarray(32)),pe.update(W);const Ke=pe.digest();ie(Ke);for(let Je=0;Je<32;Je++)B[Je]=Ce[Je];for(let Je=0;Je<32;Je++)for(let ke=0;ke<32;ke++)B[Je+ke]+=Ke[Je]*L[ke];return Q(le.subarray(32),B),le}r.sign=Ee;function ae(K,W){const B=i(),g=i(),L=i(),le=i(),pe=i(),Ce=i(),Ke=i();return x(K[2],u),C(K[1],W),b(L,K[1]),d(le,L,f),E(L,L,K[2]),$(le,K[2],le),b(pe,le),b(Ce,pe),d(Ke,Ce,pe),d(B,Ke,L),d(B,B,le),F(B,B),d(B,B,L),d(B,B,le),d(B,B,le),d(K[0],B,le),b(g,K[0]),d(g,g,le),A(g,L)&&d(K[0],K[0],y),b(g,K[0]),d(g,g,le),A(g,L)?-1:(T(K[0])===W[31]>>7&&E(K[0],c,K[0]),d(K[3],K[0],K[1]),0)}function xe(K,W,B){const g=new Uint8Array(32),L=[i(),i(),i(),i()],le=[i(),i(),i(),i()];if(B.length!==r.SIGNATURE_LENGTH)throw new Error(`ed25519: signature must be ${r.SIGNATURE_LENGTH} bytes`);if(ae(le,K))return!1;const pe=new t.SHA512;pe.update(B.subarray(0,32)),pe.update(K),pe.update(W);const Ce=pe.digest();return ie(Ce),I(L,le,Ce),N(le,B.subarray(32)),V(L,le),ce(g,L),!j(B,g)}r.verify=xe;function de(K){let W=[i(),i(),i(),i()];if(ae(W,K))throw new Error("Ed25519: invalid public key");let B=i(),g=i(),L=W[1];$(B,u,L),E(g,u,L),H(g,g),d(B,B,g);let le=new Uint8Array(32);return U(le,B),le}r.convertPublicKeyToX25519=de;function be(K){const W=(0,t.hash)(K.subarray(0,32));W[0]&=248,W[31]&=127,W[31]|=64;const B=new Uint8Array(W.subarray(0,32));return(0,n.wipe)(W),B}r.convertSecretKeyToX25519=be}(Su);const e6="EdDSA",t6="JWT",Tp=".",Rp="base64url",r6="utf8",n6="utf8",i6=":",s6="did",o6="key",Np="base58btc",a6="z",c6="K36",l6=32;function qa(r){return wr(Tr(ji(r),r6),Rp)}function Lp(r){const e=Tr(c6,Np),t=a6+wr(Bl([e,r]),Np);return[s6,o6,t].join(i6)}function u6(r){return wr(r,Rp)}function h6(r){return Tr([qa(r.header),qa(r.payload)].join(Tp),n6)}function f6(r){return[qa(r.header),qa(r.payload),u6(r.signature)].join(Tp)}function Mp(r=vs.randomBytes(l6)){return Su.generateKeyPairFromSeed(r)}async function d6(r,e,t,n,i=ye.fromMiliseconds(Date.now())){const a={alg:e6,typ:t6},c=Lp(n.publicKey),u=i+t,f={iss:c,sub:r,aud:e,iat:i,exp:u},h=h6({header:a,payload:f}),m=Su.sign(n.secretKey,h);return f6({header:a,payload:f,signature:m})}const p6="PARSE_ERROR",g6="INVALID_REQUEST",m6="METHOD_NOT_FOUND",v6="INVALID_PARAMS",Up="INTERNAL_ERROR",Cu="SERVER_ERROR",y6=[-32700,-32600,-32601,-32602,-32603],Ao={[p6]:{code:-32700,message:"Parse error"},[g6]:{code:-32600,message:"Invalid Request"},[m6]:{code:-32601,message:"Method not found"},[v6]:{code:-32602,message:"Invalid params"},[Up]:{code:-32603,message:"Internal error"},[Cu]:{code:-32e3,message:"Server error"}},jp=Cu;function w6(r){return y6.includes(r)}function Fp(r){return Object.keys(Ao).includes(r)?Ao[r]:Ao[jp]}function b6(r){const e=Object.values(Ao).find(t=>t.code===r);return e||Ao[jp]}function Bp(r,e,t){return r.message.includes("getaddrinfo ENOTFOUND")||r.message.includes("connect ECONNREFUSED")?new Error(`Unavailable ${t} RPC url at ${e}`):r}var kp={};/*! *****************************************************************************
47
47
  Copyright (c) Microsoft Corporation.
48
48
 
49
49
  Permission to use, copy, modify, and/or distribute this software for any
@@ -56,51 +56,51 @@
56
56
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
57
57
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
58
58
  PERFORMANCE OF THIS SOFTWARE.
59
- ***************************************************************************** */var Cu=function(r,e){return Cu=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)n.hasOwnProperty(i)&&(t[i]=n[i])},Cu(r,e)};function w6(r,e){Cu(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var $u=function(){return $u=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++){t=arguments[n];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e},$u.apply(this,arguments)};function y6(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(t[n[i]]=r[n[i]]);return t}function b6(r,e,t,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(r,e,t,n);else for(var u=r.length-1;u>=0;u--)(c=r[u])&&(a=(i<3?c(a):i>3?c(e,t,a):c(e,t))||a);return i>3&&a&&Object.defineProperty(e,t,a),a}function _6(r,e){return function(t,n){e(t,n,r)}}function E6(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)}function x6(r,e,t,n){function i(a){return a instanceof t?a:new t(function(c){c(a)})}return new(t||(t=Promise))(function(a,c){function u(m){try{h(n.next(m))}catch(y){c(y)}}function d(m){try{h(n.throw(m))}catch(y){c(y)}}function h(m){m.done?a(m.value):i(m.value).then(u,d)}h((n=n.apply(r,e||[])).next())})}function I6(r,e){var t={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,i,a,c;return c={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function u(h){return function(m){return d([h,m])}}function d(h){if(n)throw new TypeError("Generator is already executing.");for(;t;)try{if(n=1,i&&(a=h[0]&2?i.return:h[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,h[1])).done)return a;switch(i=0,a&&(h=[h[0]&2,a.value]),h[0]){case 0:case 1:a=h;break;case 4:return t.label++,{value:h[1],done:!1};case 5:t.label++,i=h[1],h=[0];continue;case 7:h=t.ops.pop(),t.trys.pop();continue;default:if(a=t.trys,!(a=a.length>0&&a[a.length-1])&&(h[0]===6||h[0]===2)){t=0;continue}if(h[0]===3&&(!a||h[1]>a[0]&&h[1]<a[3])){t.label=h[1];break}if(h[0]===6&&t.label<a[1]){t.label=a[1],a=h;break}if(a&&t.label<a[2]){t.label=a[2],t.ops.push(h);break}a[2]&&t.ops.pop(),t.trys.pop();continue}h=e.call(r,t)}catch(m){h=[6,m],i=0}finally{n=a=0}if(h[0]&5)throw h[1];return{value:h[0]?h[1]:void 0,done:!0}}}function D6(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}function S6(r,e){for(var t in r)t!=="default"&&!e.hasOwnProperty(t)&&(e[t]=r[t])}function Au(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],n=0;if(t)return t.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function Hp(r,e){var t=typeof Symbol=="function"&&r[Symbol.iterator];if(!t)return r;var n=t.call(r),i,a=[],c;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)a.push(i.value)}catch(u){c={error:u}}finally{try{i&&!i.done&&(t=n.return)&&t.call(n)}finally{if(c)throw c.error}}return a}function O6(){for(var r=[],e=0;e<arguments.length;e++)r=r.concat(Hp(arguments[e]));return r}function C6(){for(var r=0,e=0,t=arguments.length;e<t;e++)r+=arguments[e].length;for(var n=Array(r),i=0,e=0;e<t;e++)for(var a=arguments[e],c=0,u=a.length;c<u;c++,i++)n[i]=a[c];return n}function $o(r){return this instanceof $o?(this.v=r,this):new $o(r)}function $6(r,e,t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=t.apply(r,e||[]),i,a=[];return i={},c("next"),c("throw"),c("return"),i[Symbol.asyncIterator]=function(){return this},i;function c(w){n[w]&&(i[w]=function(E){return new Promise(function(I,T){a.push([w,E,I,T])>1||u(w,E)})})}function u(w,E){try{d(n[w](E))}catch(I){y(a[0][3],I)}}function d(w){w.value instanceof $o?Promise.resolve(w.value.v).then(h,m):y(a[0][2],w)}function h(w){u("next",w)}function m(w){u("throw",w)}function y(w,E){w(E),a.shift(),a.length&&u(a[0][0],a[0][1])}}function A6(r){var e,t;return e={},n("next"),n("throw",function(i){throw i}),n("return"),e[Symbol.iterator]=function(){return this},e;function n(i,a){e[i]=r[i]?function(c){return(t=!t)?{value:$o(r[i](c)),done:i==="return"}:a?a(c):c}:a}}function P6(r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=r[Symbol.asyncIterator],t;return e?e.call(r):(r=typeof Au=="function"?Au(r):r[Symbol.iterator](),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(a){t[a]=r[a]&&function(c){return new Promise(function(u,d){c=r[a](c),i(u,d,c.done,c.value)})}}function i(a,c,u,d){Promise.resolve(d).then(function(h){a({value:h,done:u})},c)}}function T6(r,e){return Object.defineProperty?Object.defineProperty(r,"raw",{value:e}):r.raw=e,r}function R6(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)Object.hasOwnProperty.call(r,t)&&(e[t]=r[t]);return e.default=r,e}function N6(r){return r&&r.__esModule?r:{default:r}}function L6(r,e){if(!e.has(r))throw new TypeError("attempted to get private field on non-instance");return e.get(r)}function M6(r,e,t){if(!e.has(r))throw new TypeError("attempted to set private field on non-instance");return e.set(r,t),t}var U6=Object.freeze({__proto__:null,__extends:w6,get __assign(){return $u},__rest:y6,__decorate:b6,__param:_6,__metadata:E6,__awaiter:x6,__generator:I6,__createBinding:D6,__exportStar:S6,__values:Au,__read:Hp,__spread:O6,__spreadArrays:C6,__await:$o,__asyncGenerator:$6,__asyncDelegator:A6,__asyncValues:P6,__makeTemplateObject:T6,__importStar:R6,__importDefault:N6,__classPrivateFieldGet:L6,__classPrivateFieldSet:M6}),j6=Ai(U6),Nn={},zp;function F6(){if(zp)return Nn;zp=1,Object.defineProperty(Nn,"__esModule",{value:!0}),Nn.isBrowserCryptoAvailable=Nn.getSubtleCrypto=Nn.getBrowerCrypto=void 0;function r(){return wr?.crypto||wr?.msCrypto||{}}Nn.getBrowerCrypto=r;function e(){const n=r();return n.subtle||n.webkitSubtle}Nn.getSubtleCrypto=e;function t(){return!!r()&&!!e()}return Nn.isBrowserCryptoAvailable=t,Nn}var Ln={},qp;function B6(){if(qp)return Ln;qp=1,Object.defineProperty(Ln,"__esModule",{value:!0}),Ln.isBrowser=Ln.isNode=Ln.isReactNative=void 0;function r(){return typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"}Ln.isReactNative=r;function e(){return typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.node<"u"}Ln.isNode=e;function t(){return!r()&&!e()}return Ln.isBrowser=t,Ln}(function(r){Object.defineProperty(r,"__esModule",{value:!0});const e=j6;e.__exportStar(F6(),r),e.__exportStar(B6(),r)})(kp);function Pu(r=3){const e=Date.now()*Math.pow(10,r),t=Math.floor(Math.random()*Math.pow(10,r));return e+t}function Wp(r=6){return BigInt(Pu(r))}function Ss(r,e,t){return{id:t||Pu(),jsonrpc:"2.0",method:r,params:e}}function qa(r,e){return{id:r,jsonrpc:"2.0",result:e}}function Wa(r,e,t){return{id:r,jsonrpc:"2.0",error:k6(e,t)}}function k6(r,e){return typeof r>"u"?Fp(Up):(typeof r=="string"&&(r=Object.assign(Object.assign({},Fp(Ou)),{message:r})),typeof e<"u"&&(r.data=e),m6(r.code)&&(r=v6(r.code)),r)}class H6{}class z6 extends H6{constructor(){super()}}class q6 extends z6{constructor(e){super()}}const W6="^https?:",K6="^wss?:";function V6(r){const e=r.match(new RegExp(/^\w+:/,"gi"));if(!(!e||!e.length))return e[0]}function Kp(r,e){const t=V6(r);return typeof t>"u"?!1:new RegExp(e).test(t)}function Vp(r){return Kp(r,W6)}function Gp(r){return Kp(r,K6)}function G6(r){return new RegExp("wss?://localhost(:d{2,5})?").test(r)}function Yp(r){return typeof r=="object"&&"id"in r&&"jsonrpc"in r&&r.jsonrpc==="2.0"}function Tu(r){return Yp(r)&&"method"in r}function Ka(r){return Yp(r)&&(Mn(r)||dn(r))}function Mn(r){return"result"in r}function dn(r){return"error"in r}class Un extends q6{constructor(e){super(e),this.events=new lr.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,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}off(e,t){this.events.off(e,t)}removeListener(e,t){this.events.removeListener(e,t)}async request(e,t){return this.requestStrict(Ss(e.method,e.params||[],e.id||Wp().toString()),t)}async requestStrict(e,t){return new Promise(async(n,i)=>{if(!this.connection.connected)try{await this.open()}catch(a){i(a)}this.events.on(`${e.id}`,a=>{dn(a)?i(a.error):n(a.result)});try{await this.connection.send(e,t)}catch(a){i(a)}})}setConnection(e=this.connection){return e}onPayload(e){this.events.emit("payload",e),Ka(e)?this.events.emit(`${e.id}`,e):this.events.emit("message",{type:e.method,data:e.params})}onClose(e){e&&e.code===3e3&&this.events.emit("error",new Error(`WebSocket connection closed abnormally with code: ${e.code} ${e.reason?`(${e.reason})`:""}`)),this.events.emit("disconnect")}async open(e=this.connection){this.connection===e&&this.connection.connected||(this.connection.connected&&this.close(),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",e=>this.onClose(e)),this.connection.on("error",e=>this.events.emit("error",e)),this.connection.on("register_error",e=>this.onClose()),this.hasRegisteredEventListeners=!0)}}const Y6=()=>typeof WebSocket<"u"?WebSocket:typeof global<"u"&&typeof global.WebSocket<"u"?global.WebSocket:typeof window<"u"&&typeof window.WebSocket<"u"?window.WebSocket:typeof self<"u"&&typeof self.WebSocket<"u"?self.WebSocket:require("ws"),J6=()=>typeof WebSocket<"u"||typeof global<"u"&&typeof global.WebSocket<"u"||typeof window<"u"&&typeof window.WebSocket<"u"||typeof self<"u"&&typeof self.WebSocket<"u",Jp=r=>r.split("?")[0],Zp=10,Z6=Y6();class Q6{constructor(e){if(this.url=e,this.events=new lr.exports.EventEmitter,this.registering=!1,!Gp(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,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}off(e,t){this.events.off(e,t)}removeListener(e,t){this.events.removeListener(e,t)}async open(e=this.url){await this.register(e)}async close(){return new Promise((e,t)=>{if(typeof this.socket>"u"){t(new Error("Connection already closed"));return}this.socket.onclose=n=>{this.onClose(n),e()},this.socket.close()})}async send(e){typeof this.socket>"u"&&(this.socket=await this.register());try{this.socket.send(Ui(e))}catch(t){this.onError(e.id,t)}}register(e=this.url){if(!Gp(e))throw new Error(`Provided URL is not compatible with WebSocket connection: ${e}`);if(this.registering){const t=this.events.getMaxListeners();return(this.events.listenerCount("register_error")>=t||this.events.listenerCount("open")>=t)&&this.events.setMaxListeners(t+1),new Promise((n,i)=>{this.events.once("register_error",a=>{this.resetMaxListeners(),i(a)}),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((t,n)=>{const i=new URLSearchParams(e).get("origin"),a=kp.isReactNative()?{headers:{origin:i}}:{rejectUnauthorized:!G6(e)},c=new Z6(e,[],a);J6()?c.onerror=u=>{const d=u;n(this.emitError(d.error))}:c.on("error",u=>{n(this.emitError(u))}),c.onopen=()=>{this.onOpen(c),t(c)}})}onOpen(e){e.onmessage=t=>this.onPayload(t),e.onclose=t=>this.onClose(t),this.socket=e,this.registering=!1,this.events.emit("open")}onClose(e){this.socket=void 0,this.registering=!1,this.events.emit("close",e)}onPayload(e){if(typeof e.data>"u")return;const t=typeof e.data=="string"?xo(e.data):e.data;this.events.emit("payload",t)}onError(e,t){const n=this.parseError(t),i=n.message||n.toString(),a=Wa(e,i);this.events.emit("payload",a)}parseError(e,t=this.url){return Bp(e,Jp(t),"WS")}resetMaxListeners(){this.events.getMaxListeners()>Zp&&this.events.setMaxListeners(Zp)}emitError(e){const t=this.parseError(new Error(e?.message||`WebSocket connection failed for host: ${Jp(this.url)}`));return this.events.emit("register_error",t),t}}var Ru={exports:{}};(function(r,e){var t=200,n="__lodash_hash_undefined__",i=1,a=2,c=9007199254740991,u="[object Arguments]",d="[object Array]",h="[object AsyncFunction]",m="[object Boolean]",y="[object Date]",w="[object Error]",E="[object Function]",I="[object GeneratorFunction]",T="[object Map]",U="[object Number]",F="[object Null]",$="[object Object]",P="[object Promise]",O="[object Proxy]",A="[object RegExp]",x="[object Set]",f="[object String]",b="[object Symbol]",q="[object Undefined]",j="[object WeakMap]",V="[object ArrayBuffer]",se="[object DataView]",ce="[object Float32Array]",D="[object Float64Array]",N="[object Int8Array]",X="[object Int16Array]",ee="[object Int32Array]",Y="[object Uint8Array]",J="[object Uint8ClampedArray]",Q="[object Uint16Array]",ie="[object Uint32Array]",Ee=/[\\^$.*+?()[\]{}|]/g,ae=/^\[object .+?Constructor\]$/,xe=/^(?:0|[1-9]\d*)$/,de={};de[ce]=de[D]=de[N]=de[X]=de[ee]=de[Y]=de[J]=de[Q]=de[ie]=!0,de[u]=de[d]=de[V]=de[m]=de[se]=de[y]=de[w]=de[E]=de[T]=de[U]=de[$]=de[A]=de[x]=de[f]=de[j]=!1;var be=typeof wr=="object"&&wr&&wr.Object===Object&&wr,K=typeof self=="object"&&self&&self.Object===Object&&self,W=be||K||Function("return this")(),B=e&&!e.nodeType&&e,g=B&&!0&&r&&!r.nodeType&&r,L=g&&g.exports===B,le=L&&be.process,pe=function(){try{return le&&le.binding&&le.binding("util")}catch{}}(),Oe=pe&&pe.isTypedArray;function Ke(C,k){for(var ne=-1,ge=C==null?0:C.length,vt=0,Ne=[];++ne<ge;){var Et=C[ne];k(Et,ne,C)&&(Ne[vt++]=Et)}return Ne}function Je(C,k){for(var ne=-1,ge=k.length,vt=C.length;++ne<ge;)C[vt+ne]=k[ne];return C}function ke(C,k){for(var ne=-1,ge=C==null?0:C.length;++ne<ge;)if(k(C[ne],ne,C))return!0;return!1}function Dt(C,k){for(var ne=-1,ge=Array(C);++ne<C;)ge[ne]=k(ne);return ge}function St(C){return function(k){return C(k)}}function ze(C,k){return C.has(k)}function Ce(C,k){return C?.[k]}function Ue(C){var k=-1,ne=Array(C.size);return C.forEach(function(ge,vt){ne[++k]=[vt,ge]}),ne}function je(C,k){return function(ne){return C(k(ne))}}function qe(C){var k=-1,ne=Array(C.size);return C.forEach(function(ge){ne[++k]=ge}),ne}var Ae=Array.prototype,Fe=Function.prototype,Se=Object.prototype,Te=W["__core-js_shared__"],Ve=Fe.toString,$e=Se.hasOwnProperty,Ze=function(){var C=/[^.]+$/.exec(Te&&Te.keys&&Te.keys.IE_PROTO||"");return C?"Symbol(src)_1."+C:""}(),et=Se.toString,at=RegExp("^"+Ve.call($e).replace(Ee,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ct=L?W.Buffer:void 0,nt=W.Symbol,Dr=W.Uint8Array,Ur=Se.propertyIsEnumerable,Cn=Ae.splice,Sr=nt?nt.toStringTag:void 0,qn=Object.getOwnPropertySymbols,yi=ct?ct.isBuffer:void 0,ts=je(Object.keys,Object),Lt=Vr(W,"DataView"),Ot=Vr(W,"Map"),Mt=Vr(W,"Promise"),Ut=Vr(W,"Set"),Pt=Vr(W,"WeakMap"),Ct=Vr(Object,"create"),Gt=Kn(Lt),Yt=Kn(Ot),jt=Kn(Mt),Jt=Kn(Ut),Ft=Kn(Pt),zt=nt?nt.prototype:void 0,Bt=zt?zt.valueOf:void 0;function _t(C){var k=-1,ne=C==null?0:C.length;for(this.clear();++k<ne;){var ge=C[k];this.set(ge[0],ge[1])}}function Zt(){this.__data__=Ct?Ct(null):{},this.size=0}function Qt(C){var k=this.has(C)&&delete this.__data__[C];return this.size-=k?1:0,k}function lf(C){var k=this.__data__;if(Ct){var ne=k[C];return ne===n?void 0:ne}return $e.call(k,C)?k[C]:void 0}function uf(C){var k=this.__data__;return Ct?k[C]!==void 0:$e.call(k,C)}function hf(C,k){var ne=this.__data__;return this.size+=this.has(C)?0:1,ne[C]=Ct&&k===void 0?n:k,this}_t.prototype.clear=Zt,_t.prototype.delete=Qt,_t.prototype.get=lf,_t.prototype.has=uf,_t.prototype.set=hf;function tn(C){var k=-1,ne=C==null?0:C.length;for(this.clear();++k<ne;){var ge=C[k];this.set(ge[0],ge[1])}}function ff(){this.__data__=[],this.size=0}function df(C){var k=this.__data__,ne=rs(k,C);if(ne<0)return!1;var ge=k.length-1;return ne==ge?k.pop():Cn.call(k,ne,1),--this.size,!0}function pf(C){var k=this.__data__,ne=rs(k,C);return ne<0?void 0:k[ne][1]}function gf(C){return rs(this.__data__,C)>-1}function mf(C,k){var ne=this.__data__,ge=rs(ne,C);return ge<0?(++this.size,ne.push([C,k])):ne[ge][1]=k,this}tn.prototype.clear=ff,tn.prototype.delete=df,tn.prototype.get=pf,tn.prototype.has=gf,tn.prototype.set=mf;function Wn(C){var k=-1,ne=C==null?0:C.length;for(this.clear();++k<ne;){var ge=C[k];this.set(ge[0],ge[1])}}function Ws(){this.size=0,this.__data__={hash:new _t,map:new(Ot||tn),string:new _t}}function vf(C){var k=bi(this,C).delete(C);return this.size-=k?1:0,k}function Ks(C){return bi(this,C).get(C)}function wf(C){return bi(this,C).has(C)}function yf(C,k){var ne=bi(this,C),ge=ne.size;return ne.set(C,k),this.size+=ne.size==ge?0:1,this}Wn.prototype.clear=Ws,Wn.prototype.delete=vf,Wn.prototype.get=Ks,Wn.prototype.has=wf,Wn.prototype.set=yf;function Vs(C){var k=-1,ne=C==null?0:C.length;for(this.__data__=new Wn;++k<ne;)this.add(C[k])}function Cc(C){return this.__data__.set(C,n),this}function $c(C){return this.__data__.has(C)}Vs.prototype.add=Vs.prototype.push=Cc,Vs.prototype.has=$c;function gn(C){var k=this.__data__=new tn(C);this.size=k.size}function bf(){this.__data__=new tn,this.size=0}function _f(C){var k=this.__data__,ne=k.delete(C);return this.size=k.size,ne}function Ef(C){return this.__data__.get(C)}function xf(C){return this.__data__.has(C)}function Ac(C,k){var ne=this.__data__;if(ne instanceof tn){var ge=ne.__data__;if(!Ot||ge.length<t-1)return ge.push([C,k]),this.size=++ne.size,this;ne=this.__data__=new Wn(ge)}return ne.set(C,k),this.size=ne.size,this}gn.prototype.clear=bf,gn.prototype.delete=_f,gn.prototype.get=Ef,gn.prototype.has=xf,gn.prototype.set=Ac;function Pc(C,k){var ne=Js(C),ge=!ne&&zc(C),vt=!ne&&!ge&&sa(C),Ne=!ne&&!ge&&!vt&&Kc(C),Et=ne||ge||vt||Ne,Xt=Et?Dt(C.length,String):[],it=Xt.length;for(var wt in C)(k||$e.call(C,wt))&&!(Et&&(wt=="length"||vt&&(wt=="offset"||wt=="parent")||Ne&&(wt=="buffer"||wt=="byteLength"||wt=="byteOffset")||jc(wt,it)))&&Xt.push(wt);return Xt}function rs(C,k){for(var ne=C.length;ne--;)if(Hc(C[ne][0],k))return ne;return-1}function na(C,k,ne){var ge=k(C);return Js(C)?ge:Je(ge,ne(C))}function ns(C){return C==null?C===void 0?q:F:Sr&&Sr in Object(C)?Mc(C):Sf(C)}function ia(C){return ss(C)&&ns(C)==u}function is(C,k,ne,ge,vt){return C===k?!0:C==null||k==null||!ss(C)&&!ss(k)?C!==C&&k!==k:Tc(C,k,ne,ge,is,vt)}function Tc(C,k,ne,ge,vt,Ne){var Et=Js(C),Xt=Js(k),it=Et?d:$n(C),wt=Xt?d:$n(k);it=it==u?$:it,wt=wt==u?$:wt;var qt=it==$,jr=wt==$,er=it==wt;if(er&&sa(C)){if(!sa(k))return!1;Et=!0,qt=!1}if(er&&!qt)return Ne||(Ne=new gn),Et||Kc(C)?Gs(C,k,ne,ge,vt,Ne):Df(C,k,it,ne,ge,vt,Ne);if(!(ne&i)){var xt=qt&&$e.call(C,"__wrapped__"),Or=jr&&$e.call(k,"__wrapped__");if(xt||Or){var mn=xt?C.value():C,rn=Or?k.value():k;return Ne||(Ne=new gn),vt(mn,rn,ne,ge,Ne)}}return er?(Ne||(Ne=new gn),Lc(C,k,ne,ge,vt,Ne)):!1}function If(C){if(!Wc(C)||Bc(C))return!1;var k=Zs(C)?at:ae;return k.test(Kn(C))}function Rc(C){return ss(C)&&qc(C.length)&&!!de[ns(C)]}function Nc(C){if(!kc(C))return ts(C);var k=[];for(var ne in Object(C))$e.call(C,ne)&&ne!="constructor"&&k.push(ne);return k}function Gs(C,k,ne,ge,vt,Ne){var Et=ne&i,Xt=C.length,it=k.length;if(Xt!=it&&!(Et&&it>Xt))return!1;var wt=Ne.get(C);if(wt&&Ne.get(k))return wt==k;var qt=-1,jr=!0,er=ne&a?new Vs:void 0;for(Ne.set(C,k),Ne.set(k,C);++qt<Xt;){var xt=C[qt],Or=k[qt];if(ge)var mn=Et?ge(Or,xt,qt,k,C,Ne):ge(xt,Or,qt,C,k,Ne);if(mn!==void 0){if(mn)continue;jr=!1;break}if(er){if(!ke(k,function(rn,An){if(!ze(er,An)&&(xt===rn||vt(xt,rn,ne,ge,Ne)))return er.push(An)})){jr=!1;break}}else if(!(xt===Or||vt(xt,Or,ne,ge,Ne))){jr=!1;break}}return Ne.delete(C),Ne.delete(k),jr}function Df(C,k,ne,ge,vt,Ne,Et){switch(ne){case se:if(C.byteLength!=k.byteLength||C.byteOffset!=k.byteOffset)return!1;C=C.buffer,k=k.buffer;case V:return!(C.byteLength!=k.byteLength||!Ne(new Dr(C),new Dr(k)));case m:case y:case U:return Hc(+C,+k);case w:return C.name==k.name&&C.message==k.message;case A:case f:return C==k+"";case T:var Xt=Ue;case x:var it=ge&i;if(Xt||(Xt=qe),C.size!=k.size&&!it)return!1;var wt=Et.get(C);if(wt)return wt==k;ge|=a,Et.set(C,k);var qt=Gs(Xt(C),Xt(k),ge,vt,Ne,Et);return Et.delete(C),qt;case b:if(Bt)return Bt.call(C)==Bt.call(k)}return!1}function Lc(C,k,ne,ge,vt,Ne){var Et=ne&i,Xt=Ys(C),it=Xt.length,wt=Ys(k),qt=wt.length;if(it!=qt&&!Et)return!1;for(var jr=it;jr--;){var er=Xt[jr];if(!(Et?er in k:$e.call(k,er)))return!1}var xt=Ne.get(C);if(xt&&Ne.get(k))return xt==k;var Or=!0;Ne.set(C,k),Ne.set(k,C);for(var mn=Et;++jr<it;){er=Xt[jr];var rn=C[er],An=k[er];if(ge)var oa=Et?ge(An,rn,er,k,C,Ne):ge(rn,An,er,C,k,Ne);if(!(oa===void 0?rn===An||vt(rn,An,ne,ge,Ne):oa)){Or=!1;break}mn||(mn=er=="constructor")}if(Or&&!mn){var os=C.constructor,ar=k.constructor;os!=ar&&"constructor"in C&&"constructor"in k&&!(typeof os=="function"&&os instanceof os&&typeof ar=="function"&&ar instanceof ar)&&(Or=!1)}return Ne.delete(C),Ne.delete(k),Or}function Ys(C){return na(C,$f,Uc)}function bi(C,k){var ne=C.__data__;return Fc(k)?ne[typeof k=="string"?"string":"hash"]:ne.map}function Vr(C,k){var ne=Ce(C,k);return If(ne)?ne:void 0}function Mc(C){var k=$e.call(C,Sr),ne=C[Sr];try{C[Sr]=void 0;var ge=!0}catch{}var vt=et.call(C);return ge&&(k?C[Sr]=ne:delete C[Sr]),vt}var Uc=qn?function(C){return C==null?[]:(C=Object(C),Ke(qn(C),function(k){return Ur.call(C,k)}))}:mt,$n=ns;(Lt&&$n(new Lt(new ArrayBuffer(1)))!=se||Ot&&$n(new Ot)!=T||Mt&&$n(Mt.resolve())!=P||Ut&&$n(new Ut)!=x||Pt&&$n(new Pt)!=j)&&($n=function(C){var k=ns(C),ne=k==$?C.constructor:void 0,ge=ne?Kn(ne):"";if(ge)switch(ge){case Gt:return se;case Yt:return T;case jt:return P;case Jt:return x;case Ft:return j}return k});function jc(C,k){return k=k??c,!!k&&(typeof C=="number"||xe.test(C))&&C>-1&&C%1==0&&C<k}function Fc(C){var k=typeof C;return k=="string"||k=="number"||k=="symbol"||k=="boolean"?C!=="__proto__":C===null}function Bc(C){return!!Ze&&Ze in C}function kc(C){var k=C&&C.constructor,ne=typeof k=="function"&&k.prototype||Se;return C===ne}function Sf(C){return et.call(C)}function Kn(C){if(C!=null){try{return Ve.call(C)}catch{}try{return C+""}catch{}}return""}function Hc(C,k){return C===k||C!==C&&k!==k}var zc=ia(function(){return arguments}())?ia:function(C){return ss(C)&&$e.call(C,"callee")&&!Ur.call(C,"callee")},Js=Array.isArray;function Of(C){return C!=null&&qc(C.length)&&!Zs(C)}var sa=yi||gt;function Cf(C,k){return is(C,k)}function Zs(C){if(!Wc(C))return!1;var k=ns(C);return k==E||k==I||k==h||k==O}function qc(C){return typeof C=="number"&&C>-1&&C%1==0&&C<=c}function Wc(C){var k=typeof C;return C!=null&&(k=="object"||k=="function")}function ss(C){return C!=null&&typeof C=="object"}var Kc=Oe?St(Oe):Rc;function $f(C){return Of(C)?Pc(C):Nc(C)}function mt(){return[]}function gt(){return!1}r.exports=Cf})(Ru,Ru.exports);var X6=Ru.exports;function eE(r,e){return e=e||{},new Promise(function(t,n){var i=new XMLHttpRequest,a=[],c=[],u={},d=function(){return{ok:(i.status/100|0)==2,statusText:i.statusText,status:i.status,url:i.responseURL,text:function(){return Promise.resolve(i.responseText)},json:function(){return Promise.resolve(i.responseText).then(JSON.parse)},blob:function(){return Promise.resolve(new Blob([i.response]))},clone:d,headers:{keys:function(){return a},entries:function(){return c},get:function(m){return u[m.toLowerCase()]},has:function(m){return m.toLowerCase()in u}}}};for(var h in i.open(e.method||"get",r,!0),i.onload=function(){i.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,function(m,y,w){a.push(y=y.toLowerCase()),c.push([y,w]),u[y]=u[y]?u[y]+","+w:w}),t(d())},i.onerror=n,i.withCredentials=e.credentials=="include",e.headers)i.setRequestHeader(h,e.headers[h]);i.send(e.body||null)})}var tE=Object.freeze({__proto__:null,default:eE}),Qp=Ai(tE),rE=self.fetch||(self.fetch=Qp.default||Qp),nE=Object.defineProperty,Xp=Object.getOwnPropertySymbols,iE=Object.prototype.hasOwnProperty,sE=Object.prototype.propertyIsEnumerable,e1=(r,e,t)=>e in r?nE(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,xr=(r,e)=>{for(var t in e||(e={}))iE.call(e,t)&&e1(r,t,e[t]);if(Xp)for(var t of Xp(e))sE.call(e,t)&&e1(r,t,e[t]);return r};function oE(r,e){if(r.length>=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),n=0;n<t.length;n++)t[n]=255;for(var i=0;i<r.length;i++){var a=r.charAt(i),c=a.charCodeAt(0);if(t[c]!==255)throw new TypeError(a+" is ambiguous");t[c]=i}var u=r.length,d=r.charAt(0),h=Math.log(u)/Math.log(256),m=Math.log(256)/Math.log(u);function y(I){if(I instanceof Uint8Array||(ArrayBuffer.isView(I)?I=new Uint8Array(I.buffer,I.byteOffset,I.byteLength):Array.isArray(I)&&(I=Uint8Array.from(I))),!(I instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(I.length===0)return"";for(var T=0,U=0,F=0,$=I.length;F!==$&&I[F]===0;)F++,T++;for(var P=($-F)*m+1>>>0,O=new Uint8Array(P);F!==$;){for(var A=I[F],x=0,f=P-1;(A!==0||x<U)&&f!==-1;f--,x++)A+=256*O[f]>>>0,O[f]=A%u>>>0,A=A/u>>>0;if(A!==0)throw new Error("Non-zero carry");U=x,F++}for(var b=P-U;b!==P&&O[b]===0;)b++;for(var q=d.repeat(T);b<P;++b)q+=r.charAt(O[b]);return q}function w(I){if(typeof I!="string")throw new TypeError("Expected String");if(I.length===0)return new Uint8Array;var T=0;if(I[T]!==" "){for(var U=0,F=0;I[T]===d;)U++,T++;for(var $=(I.length-T)*h+1>>>0,P=new Uint8Array($);I[T];){var O=t[I.charCodeAt(T)];if(O===255)return;for(var A=0,x=$-1;(O!==0||A<F)&&x!==-1;x--,A++)O+=u*P[x]>>>0,P[x]=O%256>>>0,O=O/256>>>0;if(O!==0)throw new Error("Non-zero carry");F=A,T++}if(I[T]!==" "){for(var f=$-F;f!==$&&P[f]===0;)f++;for(var b=new Uint8Array(U+($-f)),q=U;f!==$;)b[q++]=P[f++];return b}}}function E(I){var T=w(I);if(T)return T;throw new Error(`Non-${e} character`)}return{encode:y,decodeUnsafe:w,decode:E}}var aE=oE,cE=aE;const t1=r=>{if(r instanceof Uint8Array&&r.constructor.name==="Uint8Array")return r;if(r instanceof ArrayBuffer)return new Uint8Array(r);if(ArrayBuffer.isView(r))return new Uint8Array(r.buffer,r.byteOffset,r.byteLength);throw new Error("Unknown type, must be binary type")},lE=r=>new TextEncoder().encode(r),uE=r=>new TextDecoder().decode(r);class hE{constructor(e,t,n){this.name=e,this.prefix=t,this.baseEncode=n}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}}class fE{constructor(e,t,n){if(this.name=e,this.prefix=t,t.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=t.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 r1(this,e)}}class dE{constructor(e){this.decoders=e}or(e){return r1(this,e)}decode(e){const t=e[0],n=this.decoders[t];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 r1=(r,e)=>new dE(xr(xr({},r.decoders||{[r.prefix]:r}),e.decoders||{[e.prefix]:e}));class pE{constructor(e,t,n,i){this.name=e,this.prefix=t,this.baseEncode=n,this.baseDecode=i,this.encoder=new hE(e,t,n),this.decoder=new fE(e,t,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}const Va=({name:r,prefix:e,encode:t,decode:n})=>new pE(r,e,t,n),Ao=({prefix:r,name:e,alphabet:t})=>{const{encode:n,decode:i}=cE(t,e);return Va({prefix:r,name:e,encode:n,decode:a=>t1(i(a))})},gE=(r,e,t,n)=>{const i={};for(let m=0;m<e.length;++m)i[e[m]]=m;let a=r.length;for(;r[a-1]==="=";)--a;const c=new Uint8Array(a*t/8|0);let u=0,d=0,h=0;for(let m=0;m<a;++m){const y=i[r[m]];if(y===void 0)throw new SyntaxError(`Non-${n} character`);d=d<<t|y,u+=t,u>=8&&(u-=8,c[h++]=255&d>>u)}if(u>=t||255&d<<8-u)throw new SyntaxError("Unexpected end of data");return c},mE=(r,e,t)=>{const n=e[e.length-1]==="=",i=(1<<t)-1;let a="",c=0,u=0;for(let d=0;d<r.length;++d)for(u=u<<8|r[d],c+=8;c>t;)c-=t,a+=e[i&u>>c];if(c&&(a+=e[i&u<<t-c]),n)for(;a.length*t&7;)a+="=";return a},hr=({name:r,prefix:e,bitsPerChar:t,alphabet:n})=>Va({prefix:e,name:r,encode(i){return mE(i,n,t)},decode(i){return gE(i,n,t,r)}}),vE=Va({prefix:"\0",name:"identity",encode:r=>uE(r),decode:r=>lE(r)});var wE=Object.freeze({__proto__:null,identity:vE});const yE=hr({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var bE=Object.freeze({__proto__:null,base2:yE});const _E=hr({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var EE=Object.freeze({__proto__:null,base8:_E});const xE=Ao({prefix:"9",name:"base10",alphabet:"0123456789"});var IE=Object.freeze({__proto__:null,base10:xE});const DE=hr({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),SE=hr({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var OE=Object.freeze({__proto__:null,base16:DE,base16upper:SE});const CE=hr({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),$E=hr({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),AE=hr({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),PE=hr({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),TE=hr({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),RE=hr({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),NE=hr({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),LE=hr({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),ME=hr({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var UE=Object.freeze({__proto__:null,base32:CE,base32upper:$E,base32pad:AE,base32padupper:PE,base32hex:TE,base32hexupper:RE,base32hexpad:NE,base32hexpadupper:LE,base32z:ME});const jE=Ao({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),FE=Ao({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var BE=Object.freeze({__proto__:null,base36:jE,base36upper:FE});const kE=Ao({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),HE=Ao({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var zE=Object.freeze({__proto__:null,base58btc:kE,base58flickr:HE});const qE=hr({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),WE=hr({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),KE=hr({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),VE=hr({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var GE=Object.freeze({__proto__:null,base64:qE,base64pad:WE,base64url:KE,base64urlpad:VE});const n1=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}"),YE=n1.reduce((r,e,t)=>(r[t]=e,r),[]),JE=n1.reduce((r,e,t)=>(r[e.codePointAt(0)]=t,r),[]);function ZE(r){return r.reduce((e,t)=>(e+=YE[t],e),"")}function QE(r){const e=[];for(const t of r){const n=JE[t.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${t}`);e.push(n)}return new Uint8Array(e)}const XE=Va({prefix:"\u{1F680}",name:"base256emoji",encode:ZE,decode:QE});var e4=Object.freeze({__proto__:null,base256emoji:XE}),t4=s1,i1=128,r4=127,n4=~r4,i4=Math.pow(2,31);function s1(r,e,t){e=e||[],t=t||0;for(var n=t;r>=i4;)e[t++]=r&255|i1,r/=128;for(;r&n4;)e[t++]=r&255|i1,r>>>=7;return e[t]=r|0,s1.bytes=t-n+1,e}var s4=Nu,o4=128,o1=127;function Nu(r,n){var t=0,n=n||0,i=0,a=n,c,u=r.length;do{if(a>=u)throw Nu.bytes=0,new RangeError("Could not decode varint");c=r[a++],t+=i<28?(c&o1)<<i:(c&o1)*Math.pow(2,i),i+=7}while(c>=o4);return Nu.bytes=a-n,t}var a4=Math.pow(2,7),c4=Math.pow(2,14),l4=Math.pow(2,21),u4=Math.pow(2,28),h4=Math.pow(2,35),f4=Math.pow(2,42),d4=Math.pow(2,49),p4=Math.pow(2,56),g4=Math.pow(2,63),m4=function(r){return r<a4?1:r<c4?2:r<l4?3:r<u4?4:r<h4?5:r<f4?6:r<d4?7:r<p4?8:r<g4?9:10},v4={encode:t4,decode:s4,encodingLength:m4},a1=v4;const c1=(r,e,t=0)=>(a1.encode(r,e,t),e),l1=r=>a1.encodingLength(r),Lu=(r,e)=>{const t=e.byteLength,n=l1(r),i=n+l1(t),a=new Uint8Array(i+t);return c1(r,a,0),c1(t,a,n),a.set(e,i),new w4(r,t,e,a)};class w4{constructor(e,t,n,i){this.code=e,this.size=t,this.digest=n,this.bytes=i}}const u1=({name:r,code:e,encode:t})=>new y4(r,e,t);class y4{constructor(e,t,n){this.name=e,this.code=t,this.encode=n}digest(e){if(e instanceof Uint8Array){const t=this.encode(e);return t instanceof Uint8Array?Lu(this.code,t):t.then(n=>Lu(this.code,n))}else throw Error("Unknown type, must be binary type")}}const h1=r=>async e=>new Uint8Array(await crypto.subtle.digest(r,e)),b4=u1({name:"sha2-256",code:18,encode:h1("SHA-256")}),_4=u1({name:"sha2-512",code:19,encode:h1("SHA-512")});var E4=Object.freeze({__proto__:null,sha256:b4,sha512:_4});const f1=0,x4="identity",d1=t1;var I4=Object.freeze({__proto__:null,identity:{code:f1,name:x4,encode:d1,digest:r=>Lu(f1,d1(r))}});new TextEncoder,new TextDecoder;const p1=xr(xr(xr(xr(xr(xr(xr(xr(xr(xr({},wE),bE),EE),IE),OE),UE),BE),zE),GE),e4);xr(xr({},E4),I4);function g1(r){return globalThis.Buffer!=null?new Uint8Array(r.buffer,r.byteOffset,r.byteLength):r}function D4(r=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?g1(globalThis.Buffer.allocUnsafe(r)):new Uint8Array(r)}function m1(r,e,t,n){return{name:r,prefix:e,encoder:{name:r,prefix:e,encode:t},decoder:{decode:n}}}const v1=m1("utf8","u",r=>"u"+new TextDecoder("utf8").decode(r),r=>new TextEncoder().encode(r.substring(1))),Mu=m1("ascii","a",r=>{let e="a";for(let t=0;t<r.length;t++)e+=String.fromCharCode(r[t]);return e},r=>{r=r.substring(1);const e=D4(r.length);for(let t=0;t<r.length;t++)e[t]=r.charCodeAt(t);return e}),S4=xr({utf8:v1,"utf-8":v1,hex:p1.base16,latin1:Mu,ascii:Mu,binary:Mu},p1);function O4(r,e="utf8"){const t=S4[e];if(!t)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?g1(globalThis.Buffer.from(r,"utf-8")):t.decoder.decode(`${t.prefix}${r}`)}const w1="wc",C4=2,Uu="core",ii=`${w1}@2:${Uu}:`,$4={name:Uu,logger:"error"},A4={database:":memory:"},P4="crypto",y1="client_ed25519_seed",T4=we.ONE_DAY,R4="keychain",N4="0.3",L4="messages",M4="0.3",U4=we.SIX_HOURS,j4="publisher",b1="irn",F4="error",_1="wss://relay.walletconnect.com",E1="wss://relay.walletconnect.org",B4="relayer",pr={message:"relayer_message",message_ack:"relayer_message_ack",connect:"relayer_connect",disconnect:"relayer_disconnect",error:"relayer_error",connection_stalled:"relayer_connection_stalled",transport_closed:"relayer_transport_closed",publish:"relayer_publish"},k4="_subscription",jn={payload:"payload",connect:"connect",disconnect:"disconnect",error:"error"},H4=we.ONE_SECOND,z4="2.11.0",q4=1e4,W4="0.3",K4="WALLETCONNECT_CLIENT_ID",pn={created:"subscription_created",deleted:"subscription_deleted",expired:"subscription_expired",disabled:"subscription_disabled",sync:"subscription_sync",resubscribed:"subscription_resubscribed"},V4="subscription",G4="0.3",Y4=we.FIVE_SECONDS*1e3,J4="pairing",Z4="0.3",Po={wc_pairingDelete:{req:{ttl:we.ONE_DAY,prompt:!1,tag:1e3},res:{ttl:we.ONE_DAY,prompt:!1,tag:1001}},wc_pairingPing:{req:{ttl:we.THIRTY_SECONDS,prompt:!1,tag:1002},res:{ttl:we.THIRTY_SECONDS,prompt:!1,tag:1003}},unregistered_method:{req:{ttl:we.ONE_DAY,prompt:!1,tag:0},res:{ttl:we.ONE_DAY,prompt:!1,tag:0}}},To={create:"pairing_create",expire:"pairing_expire",delete:"pairing_delete",ping:"pairing_ping"},xn={created:"history_created",updated:"history_updated",deleted:"history_deleted",sync:"history_sync"},Q4="history",X4="0.3",e8="expirer",Xr={created:"expirer_created",deleted:"expirer_deleted",expired:"expirer_expired",sync:"expirer_sync"},t8="0.3",ju="verify-api",Os="https://verify.walletconnect.com",Fu="https://verify.walletconnect.org",r8=[Os,Fu],n8="echo",i8="https://echo.walletconnect.com";class s8{constructor(e,t){this.core=e,this.logger=t,this.keychain=new Map,this.name=R4,this.version=N4,this.initialized=!1,this.storagePrefix=ii,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:a}=he("NO_MATCHING_KEY",`${this.name}: ${n}`);throw new Error(a)}return i},this.del=async n=>{this.isInitialized(),this.keychain.delete(n),await this.persist()},this.core=e,this.logger=Xe.generateChildLogger(t,this.name)}get context(){return Xe.getLoggerContext(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}async setKeyChain(e){await this.core.storage.setItem(this.storageKey,Z0(e))}async getKeyChain(){const e=await this.core.storage.getItem(this.storageKey);return typeof e<"u"?Q0(e):void 0}async persist(){await this.setKeyChain(this.keychain)}isInitialized(){if(!this.initialized){const{message:e}=he("NOT_INITIALIZED",this.name);throw new Error(e)}}}class o8{constructor(e,t,n){this.core=e,this.logger=t,this.name=P4,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(),a=Mp(i);return Lp(a.publicKey)},this.generateKeyPair=()=>{this.isInitialized();const i=Q2();return this.setPrivateKey(i.publicKey,i.privateKey)},this.signJWT=async i=>{this.isInitialized();const a=await this.getClientSeed(),c=Mp(a),u=ou();return await u6(u,i,T4,c)},this.generateSharedKey=(i,a,c)=>{this.isInitialized();const u=this.getPrivateKey(i),d=X2(u,a);return this.setSymKey(d,c)},this.setSymKey=async(i,a)=>{this.isInitialized();const c=a||e_(i);return await this.keychain.set(c,i),c},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,a,c)=>{this.isInitialized();const u=K0(c),d=Ui(a);if(V0(u)){const w=u.senderPublicKey,E=u.receiverPublicKey;i=await this.generateSharedKey(w,E)}const h=this.getSymKey(i),{type:m,senderPublicKey:y}=u;return r_({type:m,symKey:h,message:d,senderPublicKey:y})},this.decode=async(i,a,c)=>{this.isInitialized();const u=s_(a,c);if(V0(u)){const d=u.receiverPublicKey,h=u.senderPublicKey;i=await this.generateSharedKey(d,h)}try{const d=this.getSymKey(i),h=n_({symKey:d,encoded:a});return xo(h)}catch(d){this.logger.error(`Failed to decode message from topic: '${i}', clientId: '${await this.getClientId()}'`),this.logger.error(d)}},this.getPayloadType=i=>{const a=Ra(i);return wo(a.type)},this.getPayloadSenderPublicKey=i=>{const a=Ra(i);return a.senderPublicKey?yr(a.senderPublicKey,br):void 0},this.core=e,this.logger=Xe.generateChildLogger(t,this.name),this.keychain=n||new s8(this.core,this.logger)}get context(){return Xe.getLoggerContext(this.logger)}async setPrivateKey(e,t){return await this.keychain.set(e,t),e}getPrivateKey(e){return this.keychain.get(e)}async getClientSeed(){let e="";try{e=this.keychain.get(y1)}catch{e=ou(),await this.keychain.set(y1,e)}return O4(e,"base16")}getSymKey(e){return this.keychain.get(e)}isInitialized(){if(!this.initialized){const{message:e}=he("NOT_INITIALIZED",this.name);throw new Error(e)}}}class a8 extends k5{constructor(e,t){super(e,t),this.logger=e,this.core=t,this.messages=new Map,this.name=L4,this.version=M4,this.initialized=!1,this.storagePrefix=ii,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 a=ys(i);let c=this.messages.get(n);return typeof c>"u"&&(c={}),typeof c[a]<"u"||(c[a]=i,this.messages.set(n,c),await this.persist()),a},this.get=n=>{this.isInitialized();let i=this.messages.get(n);return typeof i>"u"&&(i={}),i},this.has=(n,i)=>{this.isInitialized();const a=this.get(n),c=ys(i);return typeof a[c]<"u"},this.del=async n=>{this.isInitialized(),this.messages.delete(n),await this.persist()},this.logger=Xe.generateChildLogger(e,this.name),this.core=t}get context(){return Xe.getLoggerContext(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}async setRelayerMessages(e){await this.core.storage.setItem(this.storageKey,Z0(e))}async getRelayerMessages(){const e=await this.core.storage.getItem(this.storageKey);return typeof e<"u"?Q0(e):void 0}async persist(){await this.setRelayerMessages(this.messages)}isInitialized(){if(!this.initialized){const{message:e}=he("NOT_INITIALIZED",this.name);throw new Error(e)}}}class c8 extends H5{constructor(e,t){super(e,t),this.relayer=e,this.logger=t,this.events=new lr.exports.EventEmitter,this.name=j4,this.queue=new Map,this.publishTimeout=we.toMiliseconds(we.TEN_SECONDS),this.needsTransportRestart=!1,this.publish=async(n,i,a)=>{var c;this.logger.debug("Publishing Payload"),this.logger.trace({type:"method",method:"publish",params:{topic:n,message:i,opts:a}});try{const u=a?.ttl||U4,d=lu(a),h=a?.prompt||!1,m=a?.tag||0,y=a?.id||Wp().toString(),w={topic:n,message:i,opts:{ttl:u,relay:d,prompt:h,tag:m,id:y}},E=setTimeout(()=>this.queue.set(y,w),this.publishTimeout);try{await await bo(this.rpcPublish(n,i,u,d,h,m,y),this.publishTimeout,"Failed to publish payload, please try again."),this.removeRequestFromQueue(y),this.relayer.events.emit(pr.publish,w)}catch(I){if(this.logger.debug("Publishing Payload stalled"),this.needsTransportRestart=!0,(c=a?.internal)!=null&&c.throwOnFailedPublish)throw this.removeRequestFromQueue(y),I;return}finally{clearTimeout(E)}this.logger.debug("Successfully Published Payload"),this.logger.trace({type:"method",method:"publish",params:{topic:n,message:i,opts:a}})}catch(u){throw this.logger.debug("Failed to Publish Payload"),this.logger.error(u),u}},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=Xe.generateChildLogger(t,this.name),this.registerEventListeners()}get context(){return Xe.getLoggerContext(this.logger)}rpcPublish(e,t,n,i,a,c,u){var d,h,m,y;const w={method:Na(i.protocol).publish,params:{topic:e,message:t,ttl:n,prompt:a,tag:c},id:u};return _r((d=w.params)==null?void 0:d.prompt)&&((h=w.params)==null||delete h.prompt),_r((m=w.params)==null?void 0:m.tag)&&((y=w.params)==null||delete y.tag),this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"message",direction:"outgoing",request:w}),this.relayer.request(w)}removeRequestFromQueue(e){this.queue.delete(e)}checkQueue(){this.queue.forEach(async e=>{const{topic:t,message:n,opts:i}=e;await this.publish(t,n,i)})}registerEventListeners(){this.relayer.core.heartbeat.on(Ds.HEARTBEAT_EVENTS.pulse,()=>{if(this.needsTransportRestart){this.needsTransportRestart=!1,this.relayer.events.emit(pr.connection_stalled);return}this.checkQueue()}),this.relayer.on(pr.message_ack,e=>{this.removeRequestFromQueue(e.id.toString())})}}class l8{constructor(){this.map=new Map,this.set=(e,t)=>{const n=this.get(e);this.exists(e,t)||this.map.set(e,[...n,t])},this.get=e=>this.map.get(e)||[],this.exists=(e,t)=>this.get(e).includes(t),this.delete=(e,t)=>{if(typeof t>"u"){this.map.delete(e);return}if(!this.map.has(e))return;const n=this.get(e);if(!this.exists(e,t))return;const i=n.filter(a=>a!==t);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 u8=Object.defineProperty,h8=Object.defineProperties,f8=Object.getOwnPropertyDescriptors,x1=Object.getOwnPropertySymbols,d8=Object.prototype.hasOwnProperty,p8=Object.prototype.propertyIsEnumerable,I1=(r,e,t)=>e in r?u8(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,Ro=(r,e)=>{for(var t in e||(e={}))d8.call(e,t)&&I1(r,t,e[t]);if(x1)for(var t of x1(e))p8.call(e,t)&&I1(r,t,e[t]);return r},Bu=(r,e)=>h8(r,f8(e));class g8 extends W5{constructor(e,t){super(e,t),this.relayer=e,this.logger=t,this.subscriptions=new Map,this.topicMap=new l8,this.events=new lr.exports.EventEmitter,this.name=V4,this.version=G4,this.pending=new Map,this.cached=[],this.initialized=!1,this.pendingSubscriptionWatchLabel="pending_sub_watch_label",this.pollingInterval=20,this.storagePrefix=ii,this.subscribeTimeout=1e4,this.restartInProgress=!1,this.batchSubscribeTopicsLimit=500,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),this.registerEventListeners(),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 a=lu(i),c={topic:n,relay:a};this.pending.set(n,c);const u=await this.rpcSubscribe(n,a);return this.onSubscribe(u,c),this.logger.debug("Successfully Subscribed Topic"),this.logger.trace({type:"method",method:"subscribe",params:{topic:n,opts:i}}),u}catch(a){throw this.logger.debug("Failed to Subscribe Topic"),this.logger.error(a),a}},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,a)=>{const c=new we.Watch;c.start(this.pendingSubscriptionWatchLabel);const u=setInterval(()=>{!this.pending.has(n)&&this.topics.includes(n)&&(clearInterval(u),c.stop(this.pendingSubscriptionWatchLabel),i(!0)),c.elapsed(this.pendingSubscriptionWatchLabel)>=Y4&&(clearInterval(u),c.stop(this.pendingSubscriptionWatchLabel),a(new Error("Subscription resolution timeout")))},this.pollingInterval)}).catch(()=>!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.restart=async()=>{this.restartInProgress=!0,await this.restore(),await this.reset(),this.restartInProgress=!1},this.relayer=e,this.logger=Xe.generateChildLogger(t,this.name),this.clientId=""}get context(){return Xe.getLoggerContext(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.relayer.core.customStoragePrefix+"//"+this.name}get length(){return this.subscriptions.size}get ids(){return Array.from(this.subscriptions.keys())}get values(){return Array.from(this.subscriptions.values())}get topics(){return this.topicMap.topics}hasSubscription(e,t){let n=!1;try{n=this.getSubscription(e).topic===t}catch{}return n}onEnable(){this.cached=[],this.initialized=!0}onDisable(){this.cached=this.values,this.subscriptions.clear(),this.topicMap.clear()}async unsubscribeByTopic(e,t){const n=this.topicMap.get(e);await Promise.all(n.map(async i=>await this.unsubscribeById(e,i,t)))}async unsubscribeById(e,t,n){this.logger.debug("Unsubscribing Topic"),this.logger.trace({type:"method",method:"unsubscribe",params:{topic:e,id:t,opts:n}});try{const i=lu(n);await this.rpcUnsubscribe(e,t,i);const a=Rt("USER_DISCONNECTED",`${this.name}, ${e}`);await this.onUnsubscribe(e,t,a),this.logger.debug("Successfully Unsubscribed Topic"),this.logger.trace({type:"method",method:"unsubscribe",params:{topic:e,id:t,opts:n}})}catch(i){throw this.logger.debug("Failed to Unsubscribe Topic"),this.logger.error(i),i}}async rpcSubscribe(e,t){const n={method:Na(t.protocol).subscribe,params:{topic:e}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:n});try{await await bo(this.relayer.request(n),this.subscribeTimeout)}catch{this.logger.debug("Outgoing Relay Subscribe Payload stalled"),this.relayer.events.emit(pr.connection_stalled)}return ys(e+this.clientId)}async rpcBatchSubscribe(e){if(!e.length)return;const t=e[0].relay,n={method:Na(t.protocol).batchSubscribe,params:{topics:e.map(i=>i.topic)}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:n});try{return await await bo(this.relayer.request(n),this.subscribeTimeout)}catch{this.logger.debug("Outgoing Relay Payload stalled"),this.relayer.events.emit(pr.connection_stalled)}}rpcUnsubscribe(e,t,n){const i={method:Na(n.protocol).unsubscribe,params:{topic:e,id:t}};return this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:i}),this.relayer.request(i)}onSubscribe(e,t){this.setSubscription(e,Bu(Ro({},t),{id:e})),this.pending.delete(t.topic)}onBatchSubscribe(e){e.length&&e.forEach(t=>{this.setSubscription(t.id,Ro({},t)),this.pending.delete(t.topic)})}async onUnsubscribe(e,t,n){this.events.removeAllListeners(t),this.hasSubscription(t,e)&&this.deleteSubscription(t,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,t){this.subscriptions.has(e)||(this.logger.debug("Setting subscription"),this.logger.trace({type:"method",method:"setSubscription",id:e,subscription:t}),this.addSubscription(e,t))}addSubscription(e,t){this.subscriptions.set(e,Ro({},t)),this.topicMap.set(t.topic,e),this.events.emit(pn.created,t)}getSubscription(e){this.logger.debug("Getting subscription"),this.logger.trace({type:"method",method:"getSubscription",id:e});const t=this.subscriptions.get(e);if(!t){const{message:n}=he("NO_MATCHING_KEY",`${this.name}: ${e}`);throw new Error(n)}return t}deleteSubscription(e,t){this.logger.debug("Deleting subscription"),this.logger.trace({type:"method",method:"deleteSubscription",id:e,reason:t});const n=this.getSubscription(e);this.subscriptions.delete(e),this.topicMap.delete(n.topic,e),this.events.emit(pn.deleted,Bu(Ro({},n),{reason:t}))}async persist(){await this.setRelayerSubscriptions(this.values),this.events.emit(pn.sync)}async reset(){if(this.cached.length){const e=Math.ceil(this.cached.length/this.batchSubscribeTopicsLimit);for(let t=0;t<e;t++){const n=this.cached.splice(0,this.batchSubscribeTopicsLimit);await this.batchSubscribe(n)}}this.events.emit(pn.resubscribed)}async restore(){try{const e=await this.getRelayerSubscriptions();if(typeof e>"u"||!e.length)return;if(this.subscriptions.size){const{message:t}=he("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(t),this.logger.error(`${this.name}: ${JSON.stringify(this.values)}`),new Error(t)}this.cached=e,this.logger.debug(`Successfully Restored subscriptions for ${this.name}`),this.logger.trace({type:"method",method:"restore",subscriptions:this.values})}catch(e){this.logger.debug(`Failed to Restore subscriptions for ${this.name}`),this.logger.error(e)}}async batchSubscribe(e){if(!e.length)return;const t=await this.rpcBatchSubscribe(e);En(t)&&this.onBatchSubscribe(t.map((n,i)=>Bu(Ro({},e[i]),{id:n})))}async onConnect(){this.restartInProgress||(await this.restart(),this.onEnable())}onDisconnect(){this.onDisable()}async checkPending(){if(!this.initialized||this.relayer.transportExplicitlyClosed)return;const e=[];this.pending.forEach(t=>{e.push(t)}),await this.batchSubscribe(e)}registerEventListeners(){this.relayer.core.heartbeat.on(Ds.HEARTBEAT_EVENTS.pulse,async()=>{await this.checkPending()}),this.relayer.on(pr.connect,async()=>{await this.onConnect()}),this.relayer.on(pr.disconnect,()=>{this.onDisconnect()}),this.events.on(pn.created,async e=>{const t=pn.created;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,data:e}),await this.persist()}),this.events.on(pn.deleted,async e=>{const t=pn.deleted;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,data:e}),await this.persist()})}isInitialized(){if(!this.initialized){const{message:e}=he("NOT_INITIALIZED",this.name);throw new Error(e)}}async restartToComplete(){this.restartInProgress&&await new Promise(e=>{const t=setInterval(()=>{this.restartInProgress||(clearInterval(t),e())},this.pollingInterval)})}}var m8=Object.defineProperty,D1=Object.getOwnPropertySymbols,v8=Object.prototype.hasOwnProperty,w8=Object.prototype.propertyIsEnumerable,S1=(r,e,t)=>e in r?m8(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,y8=(r,e)=>{for(var t in e||(e={}))v8.call(e,t)&&S1(r,t,e[t]);if(D1)for(var t of D1(e))w8.call(e,t)&&S1(r,t,e[t]);return r};class b8 extends z5{constructor(e){super(e),this.protocol="wc",this.version=2,this.events=new lr.exports.EventEmitter,this.name=B4,this.transportExplicitlyClosed=!1,this.initialized=!1,this.connectionAttemptInProgress=!1,this.connectionStatusPollingInterval=20,this.staleConnectionErrors=["socket hang up","socket stalled"],this.hasExperiencedNetworkDisruption=!1,this.request=async t=>{this.logger.debug("Publishing Request Payload");try{return await this.toEstablishConnection(),await this.provider.request(t)}catch(n){throw this.logger.debug("Failed to Publish Request"),this.logger.error(n),n}},this.onPayloadHandler=t=>{this.onProviderPayload(t)},this.onConnectHandler=()=>{this.events.emit(pr.connect)},this.onDisconnectHandler=()=>{this.onProviderDisconnect()},this.onProviderErrorHandler=t=>{this.logger.error(t),this.events.emit(pr.error,t),this.logger.info("Fatal socket error received, closing transport"),this.transportClose()},this.registerProviderListeners=()=>{this.provider.on(jn.payload,this.onPayloadHandler),this.provider.on(jn.connect,this.onConnectHandler),this.provider.on(jn.disconnect,this.onDisconnectHandler),this.provider.on(jn.error,this.onProviderErrorHandler)},this.core=e.core,this.logger=typeof e.logger<"u"&&typeof e.logger!="string"?Xe.generateChildLogger(e.logger,this.name):Xe.pino(Xe.getDefaultLoggerOptions({level:e.logger||F4})),this.messages=new a8(this.logger,e.core),this.subscriber=new g8(this,this.logger),this.publisher=new c8(this,this.logger),this.relayUrl=e?.relayUrl||_1,this.projectId=e.projectId,this.bundleId=h_(),this.provider={}}async init(){this.logger.trace("Initialized"),this.registerEventListeners(),await this.createProvider(),await Promise.all([this.messages.init(),this.subscriber.init()]);try{await this.transportOpen()}catch{this.logger.warn(`Connection via ${this.relayUrl} failed, attempting to connect via failover domain ${E1}...`),await this.restartTransport(E1)}this.initialized=!0,setTimeout(async()=>{this.subscriber.topics.length===0&&(this.logger.info("No topics subscribed to after init, closing transport"),await this.transportClose(),this.transportExplicitlyClosed=!1)},q4)}get context(){return Xe.getLoggerContext(this.logger)}get connected(){return this.provider.connection.connected}get connecting(){return this.provider.connection.connecting}async publish(e,t,n){this.isInitialized(),await this.publisher.publish(e,t,n),await this.recordMessageEvent({topic:e,message:t,publishedAt:Date.now()})}async subscribe(e,t){var n;this.isInitialized();let i=((n=this.subscriber.topicMap.get(e))==null?void 0:n[0])||"";if(i)return i;let a;const c=u=>{u.topic===e&&(this.subscriber.off(pn.created,c),a())};return await Promise.all([new Promise(u=>{a=u,this.subscriber.on(pn.created,c)}),new Promise(async u=>{i=await this.subscriber.subscribe(e,t),u()})]),i}async unsubscribe(e,t){this.isInitialized(),await this.subscriber.unsubscribe(e,t)}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}off(e,t){this.events.off(e,t)}removeListener(e,t){this.events.removeListener(e,t)}async transportClose(){this.transportExplicitlyClosed=!0,this.hasExperiencedNetworkDisruption&&this.connected?await bo(this.provider.disconnect(),1e3,"provider.disconnect()").catch(()=>this.onProviderDisconnect()):this.connected&&await this.provider.disconnect()}async transportOpen(e){if(this.transportExplicitlyClosed=!1,await this.confirmOnlineStateOrThrow(),!this.connectionAttemptInProgress){e&&e!==this.relayUrl&&(this.relayUrl=e,await this.transportClose(),await this.createProvider()),this.connectionAttemptInProgress=!0;try{await Promise.all([new Promise(t=>{if(!this.initialized)return t();this.subscriber.once(pn.resubscribed,()=>{t()})}),new Promise(async(t,n)=>{try{await bo(this.provider.connect(),1e4,`Socket stalled when trying to connect to ${this.relayUrl}`)}catch(i){n(i);return}t()})])}catch(t){this.logger.error(t);const n=t;if(!this.isConnectionStalled(n.message))throw t;this.provider.events.emit(jn.disconnect)}finally{this.connectionAttemptInProgress=!1,this.hasExperiencedNetworkDisruption=!1}}}async restartTransport(e){await this.confirmOnlineStateOrThrow(),!this.connectionAttemptInProgress&&(this.relayUrl=e||this.relayUrl,await this.transportClose(),await this.createProvider(),await this.transportOpen())}async confirmOnlineStateOrThrow(){if(!await up())throw new Error("No internet connection detected. Please restart your network and try again.")}isConnectionStalled(e){return this.staleConnectionErrors.some(t=>e.includes(t))}async createProvider(){this.provider.connection&&this.unregisterProviderListeners();const e=await this.core.crypto.signJWT(this.relayUrl);this.provider=new Un(new Q6(v_({sdkVersion:z4,protocol:this.protocol,version:this.version,relayUrl:this.relayUrl,projectId:this.projectId,auth:e,useOnCloseEvent:!0,bundleId:this.bundleId}))),this.registerProviderListeners()}async recordMessageEvent(e){const{topic:t,message:n}=e;await this.messages.set(t,n)}async shouldIgnoreMessageEvent(e){const{topic:t,message:n}=e;if(!n||n.length===0)return this.logger.debug(`Ignoring invalid/empty message: ${n}`),!0;if(!await this.subscriber.isSubscribed(t))return this.logger.debug(`Ignoring message for non-subscribed topic ${t}`),!0;const i=this.messages.has(t,n);return i&&this.logger.debug(`Ignoring duplicate message: ${n}`),i}async onProviderPayload(e){if(this.logger.debug("Incoming Relay Payload"),this.logger.trace({type:"payload",direction:"incoming",payload:e}),Tu(e)){if(!e.method.endsWith(k4))return;const t=e.params,{topic:n,message:i,publishedAt:a}=t.data,c={topic:n,message:i,publishedAt:a};this.logger.debug("Emitting Relayer Payload"),this.logger.trace(y8({type:"event",event:t.id},c)),this.events.emit(t.id,c),await this.acknowledgePayload(e),await this.onMessageEvent(c)}else Ka(e)&&this.events.emit(pr.message_ack,e)}async onMessageEvent(e){await this.shouldIgnoreMessageEvent(e)||(this.events.emit(pr.message,e),await this.recordMessageEvent(e))}async acknowledgePayload(e){const t=qa(e.id,!0);await this.provider.connection.send(t)}unregisterProviderListeners(){this.provider.off(jn.payload,this.onPayloadHandler),this.provider.off(jn.connect,this.onConnectHandler),this.provider.off(jn.disconnect,this.onDisconnectHandler),this.provider.off(jn.error,this.onProviderErrorHandler)}async registerEventListeners(){this.events.on(pr.connection_stalled,()=>{this.restartTransport().catch(t=>this.logger.error(t))});let e=await up();l3(async t=>{this.initialized&&e!==t&&(e=t,t?await this.restartTransport().catch(n=>this.logger.error(n)):(this.hasExperiencedNetworkDisruption=!0,await this.transportClose().catch(n=>this.logger.error(n))))})}onProviderDisconnect(){this.events.emit(pr.disconnect),this.attemptToReconnect()}attemptToReconnect(){this.transportExplicitlyClosed||(this.logger.info("attemptToReconnect called. Connecting..."),setTimeout(async()=>{await this.restartTransport().catch(e=>this.logger.error(e))},we.toMiliseconds(H4)))}isInitialized(){if(!this.initialized){const{message:e}=he("NOT_INITIALIZED",this.name);throw new Error(e)}}async toEstablishConnection(){if(await this.confirmOnlineStateOrThrow(),!this.connected){if(this.connectionAttemptInProgress)return await new Promise(e=>{const t=setInterval(()=>{this.connected&&(clearInterval(t),e())},this.connectionStatusPollingInterval)});await this.restartTransport()}}}var _8=Object.defineProperty,O1=Object.getOwnPropertySymbols,E8=Object.prototype.hasOwnProperty,x8=Object.prototype.propertyIsEnumerable,C1=(r,e,t)=>e in r?_8(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,$1=(r,e)=>{for(var t in e||(e={}))E8.call(e,t)&&C1(r,t,e[t]);if(O1)for(var t of O1(e))x8.call(e,t)&&C1(r,t,e[t]);return r};class Ga extends q5{constructor(e,t,n,i=ii,a=void 0){super(e,t,n,i),this.core=e,this.logger=t,this.name=n,this.map=new Map,this.version=W4,this.cached=[],this.initialized=!1,this.storagePrefix=ii,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(c=>{this.getKey&&c!==null&&!_r(c)?this.map.set(this.getKey(c),c):B_(c)?this.map.set(c.id,c):k_(c)&&this.map.set(c.topic,c)}),this.cached=[],this.initialized=!0)},this.set=async(c,u)=>{this.isInitialized(),this.map.has(c)?await this.update(c,u):(this.logger.debug("Setting value"),this.logger.trace({type:"method",method:"set",key:c,value:u}),this.map.set(c,u),await this.persist())},this.get=c=>(this.isInitialized(),this.logger.debug("Getting value"),this.logger.trace({type:"method",method:"get",key:c}),this.getData(c)),this.getAll=c=>(this.isInitialized(),c?this.values.filter(u=>Object.keys(c).every(d=>X6(u[d],c[d]))):this.values),this.update=async(c,u)=>{this.isInitialized(),this.logger.debug("Updating value"),this.logger.trace({type:"method",method:"update",key:c,update:u});const d=$1($1({},this.getData(c)),u);this.map.set(c,d),await this.persist()},this.delete=async(c,u)=>{this.isInitialized(),this.map.has(c)&&(this.logger.debug("Deleting value"),this.logger.trace({type:"method",method:"delete",key:c,reason:u}),this.map.delete(c),await this.persist())},this.logger=Xe.generateChildLogger(t,this.name),this.storagePrefix=i,this.getKey=a}get context(){return Xe.getLoggerContext(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get length(){return this.map.size}get keys(){return Array.from(this.map.keys())}get values(){return Array.from(this.map.values())}async setDataStore(e){await this.core.storage.setItem(this.storageKey,e)}async getDataStore(){return await this.core.storage.getItem(this.storageKey)}getData(e){const t=this.map.get(e);if(!t){const{message:n}=he("NO_MATCHING_KEY",`${this.name}: ${e}`);throw this.logger.error(n),new Error(n)}return t}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:t}=he("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(t),new Error(t)}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}=he("NOT_INITIALIZED",this.name);throw new Error(e)}}}class I8{constructor(e,t){this.core=e,this.logger=t,this.name=J4,this.version=Z4,this.events=new lr.exports,this.initialized=!1,this.storagePrefix=ii,this.ignoredPayloadTypes=[Ni],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=ou(),i=await this.core.crypto.setSymKey(n),a=fn(we.FIVE_MINUTES),c={protocol:b1},u={topic:i,expiry:a,relay:c,active:!1},d=A_({protocol:this.core.protocol,version:this.core.version,topic:i,symKey:n,relay:c});return await this.pairings.set(i,u),await this.core.relayer.subscribe(i),this.core.expirer.set(i,a),{topic:i,uri:d}},this.pair=async n=>{this.isInitialized(),this.isValidPair(n);const{topic:i,symKey:a,relay:c}=np(n.uri);let u;if(this.pairings.keys.includes(i)&&(u=this.pairings.get(i),u.active))throw new Error(`Pairing already exists: ${i}. Please try again with a new connection URI.`);const d=fn(we.FIVE_MINUTES),h={topic:i,relay:c,expiry:d,active:!1};return await this.pairings.set(i,h),this.core.expirer.set(i,d),n.activatePairing&&await this.activate({topic:i}),this.events.emit(To.create,h),this.core.crypto.keychain.has(i)||(await this.core.crypto.setSymKey(a,i),await this.core.relayer.subscribe(i,{relay:c})),h},this.activate=async({topic:n})=>{this.isInitialized();const i=fn(we.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 a=await this.sendRequest(i,"wc_pairingPing",{}),{done:c,resolve:u,reject:d}=Es();this.events.once(Vt("pairing_ping",a),({error:h})=>{h?d(h):u()}),await c()}},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",Rt("USER_DISCONNECTED")),await this.deletePairing(i))},this.sendRequest=async(n,i,a)=>{const c=Ss(i,a),u=await this.core.crypto.encode(n,c),d=Po[i].req;return this.core.history.set(n,c),this.core.relayer.publish(n,u,d),c.id},this.sendResult=async(n,i,a)=>{const c=qa(n,a),u=await this.core.crypto.encode(i,c),d=await this.core.history.get(i,n),h=Po[d.request.method].res;await this.core.relayer.publish(i,u,h),await this.core.history.resolve(c)},this.sendError=async(n,i,a)=>{const c=Wa(n,a),u=await this.core.crypto.encode(i,c),d=await this.core.history.get(i,n),h=Po[d.request.method]?Po[d.request.method].res:Po.unregistered_method.res;await this.core.relayer.publish(i,u,h),await this.core.history.resolve(c)},this.deletePairing=async(n,i)=>{await this.core.relayer.unsubscribe(n),await Promise.all([this.pairings.delete(n,Rt("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=>ni(i.expiry));await Promise.all(n.map(i=>this.deletePairing(i.topic)))},this.onRelayEventRequest=n=>{const{topic:i,payload:a}=n;switch(a.method){case"wc_pairingPing":return this.onPairingPingRequest(i,a);case"wc_pairingDelete":return this.onPairingDeleteRequest(i,a);default:return this.onUnknownRpcMethodRequest(i,a)}},this.onRelayEventResponse=async n=>{const{topic:i,payload:a}=n,c=(await this.core.history.get(i,a.id)).request.method;switch(c){case"wc_pairingPing":return this.onPairingPingResponse(i,a);default:return this.onUnknownRpcMethodResponse(c)}},this.onPairingPingRequest=async(n,i)=>{const{id:a}=i;try{this.isValidPing({topic:n}),await this.sendResult(a,n,!0),this.events.emit(To.ping,{id:a,topic:n})}catch(c){await this.sendError(a,n,c),this.logger.error(c)}},this.onPairingPingResponse=(n,i)=>{const{id:a}=i;setTimeout(()=>{Mn(i)?this.events.emit(Vt("pairing_ping",a),{}):dn(i)&&this.events.emit(Vt("pairing_ping",a),{error:i.error})},500)},this.onPairingDeleteRequest=async(n,i)=>{const{id:a}=i;try{this.isValidDisconnect({topic:n}),await this.deletePairing(n),this.events.emit(To.delete,{id:a,topic:n})}catch(c){await this.sendError(a,n,c),this.logger.error(c)}},this.onUnknownRpcMethodRequest=async(n,i)=>{const{id:a,method:c}=i;try{if(this.registeredMethods.includes(c))return;const u=Rt("WC_METHOD_UNSUPPORTED",c);await this.sendError(a,n,u),this.logger.error(u)}catch(u){await this.sendError(a,n,u),this.logger.error(u)}},this.onUnknownRpcMethodResponse=n=>{this.registeredMethods.includes(n)||this.logger.error(Rt("WC_METHOD_UNSUPPORTED",n))},this.isValidPair=n=>{var i;if(!Tr(n)){const{message:c}=he("MISSING_OR_INVALID",`pair() params: ${n}`);throw new Error(c)}if(!F_(n.uri)){const{message:c}=he("MISSING_OR_INVALID",`pair() uri: ${n.uri}`);throw new Error(c)}const a=np(n.uri);if(!((i=a?.relay)!=null&&i.protocol)){const{message:c}=he("MISSING_OR_INVALID","pair() uri#relay-protocol");throw new Error(c)}if(!(a!=null&&a.symKey)){const{message:c}=he("MISSING_OR_INVALID","pair() uri#symKey");throw new Error(c)}},this.isValidPing=async n=>{if(!Tr(n)){const{message:a}=he("MISSING_OR_INVALID",`ping() params: ${n}`);throw new Error(a)}const{topic:i}=n;await this.isValidPairingTopic(i)},this.isValidDisconnect=async n=>{if(!Tr(n)){const{message:a}=he("MISSING_OR_INVALID",`disconnect() params: ${n}`);throw new Error(a)}const{topic:i}=n;await this.isValidPairingTopic(i)},this.isValidPairingTopic=async n=>{if(!ir(n,!1)){const{message:i}=he("MISSING_OR_INVALID",`pairing topic should be a string: ${n}`);throw new Error(i)}if(!this.pairings.keys.includes(n)){const{message:i}=he("NO_MATCHING_KEY",`pairing topic doesn't exist: ${n}`);throw new Error(i)}if(ni(this.pairings.get(n).expiry)){await this.deletePairing(n);const{message:i}=he("EXPIRED",`pairing topic: ${n}`);throw new Error(i)}},this.core=e,this.logger=Xe.generateChildLogger(t,this.name),this.pairings=new Ga(this.core,this.logger,this.name,this.storagePrefix)}get context(){return Xe.getLoggerContext(this.logger)}isInitialized(){if(!this.initialized){const{message:e}=he("NOT_INITIALIZED",this.name);throw new Error(e)}}registerRelayerEvents(){this.core.relayer.on(pr.message,async e=>{const{topic:t,message:n}=e;if(!this.pairings.keys.includes(t)||this.ignoredPayloadTypes.includes(this.core.crypto.getPayloadType(n)))return;const i=await this.core.crypto.decode(t,n);try{Tu(i)?(this.core.history.set(t,i),this.onRelayEventRequest({topic:t,payload:i})):Ka(i)&&(await this.core.history.resolve(i),await this.onRelayEventResponse({topic:t,payload:i}),this.core.history.delete(t,i.id))}catch(a){this.logger.error(a)}})}registerExpirerEvents(){this.core.expirer.on(Xr.expired,async e=>{const{topic:t}=ep(e.target);t&&this.pairings.keys.includes(t)&&(await this.deletePairing(t,!0),this.events.emit(To.expire,{topic:t}))})}}class D8 extends B5{constructor(e,t){super(e,t),this.core=e,this.logger=t,this.records=new Map,this.events=new lr.exports.EventEmitter,this.name=Q4,this.version=X4,this.cached=[],this.initialized=!1,this.storagePrefix=ii,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,a)=>{if(this.isInitialized(),this.logger.debug("Setting JSON-RPC request history record"),this.logger.trace({type:"method",method:"set",topic:n,request:i,chainId:a}),this.records.has(i.id))return;const c={id:i.id,topic:n,request:{method:i.method,params:i.params||null},chainId:a,expiry:fn(we.THIRTY_DAYS)};this.records.set(c.id,c),this.events.emit(xn.created,c)},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=dn(n)?{error:n.error}:{result:n.result},this.records.set(i.id,i),this.events.emit(xn.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(a=>{if(a.topic===n){if(typeof i<"u"&&a.id!==i)return;this.records.delete(a.id),this.events.emit(xn.deleted,a)}})},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=Xe.generateChildLogger(t,this.name)}get context(){return Xe.getLoggerContext(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get size(){return this.records.size}get keys(){return Array.from(this.records.keys())}get values(){return Array.from(this.records.values())}get pending(){const e=[];return this.values.forEach(t=>{if(typeof t.response<"u")return;const n={topic:t.topic,request:Ss(t.request.method,t.request.params,t.id),chainId:t.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 t=this.records.get(e);if(!t){const{message:n}=he("NO_MATCHING_KEY",`${this.name}: ${e}`);throw new Error(n)}return t}async persist(){await this.setJsonRpcRecords(this.values),this.events.emit(xn.sync)}async restore(){try{const e=await this.getJsonRpcRecords();if(typeof e>"u"||!e.length)return;if(this.records.size){const{message:t}=he("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(t),new Error(t)}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(xn.created,e=>{const t=xn.created;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,record:e}),this.persist()}),this.events.on(xn.updated,e=>{const t=xn.updated;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,record:e}),this.persist()}),this.events.on(xn.deleted,e=>{const t=xn.deleted;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,record:e}),this.persist()}),this.core.heartbeat.on(Ds.HEARTBEAT_EVENTS.pulse,()=>{this.cleanup()})}cleanup(){try{this.records.forEach(e=>{we.toMiliseconds(e.expiry||0)-Date.now()<=0&&(this.logger.info(`Deleting expired history log: ${e.id}`),this.delete(e.topic,e.id))})}catch(e){this.logger.warn(e)}}isInitialized(){if(!this.initialized){const{message:e}=he("NOT_INITIALIZED",this.name);throw new Error(e)}}}class S8 extends K5{constructor(e,t){super(e,t),this.core=e,this.logger=t,this.expirations=new Map,this.events=new lr.exports.EventEmitter,this.name=e8,this.version=t8,this.cached=[],this.initialized=!1,this.storagePrefix=ii,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 a=this.formatTarget(n),c={target:a,expiry:i};this.expirations.set(a,c),this.checkExpiry(a,c),this.events.emit(Xr.created,{target:a,expiration:c})},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),a=this.getExpiration(i);this.expirations.delete(i),this.events.emit(Xr.deleted,{target:i,expiration:a})}},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=Xe.generateChildLogger(t,this.name)}get context(){return Xe.getLoggerContext(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get length(){return this.expirations.size}get keys(){return Array.from(this.expirations.keys())}get values(){return Array.from(this.expirations.values())}formatTarget(e){if(typeof e=="string")return w_(e);if(typeof e=="number")return y_(e);const{message:t}=he("UNKNOWN_TYPE",`Target type: ${typeof e}`);throw new Error(t)}async setExpirations(e){await this.core.storage.setItem(this.storageKey,e)}async getExpirations(){return await this.core.storage.getItem(this.storageKey)}async persist(){await this.setExpirations(this.values),this.events.emit(Xr.sync)}async restore(){try{const e=await this.getExpirations();if(typeof e>"u"||!e.length)return;if(this.expirations.size){const{message:t}=he("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(t),new Error(t)}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 t=this.expirations.get(e);if(!t){const{message:n}=he("NO_MATCHING_KEY",`${this.name}: ${e}`);throw this.logger.error(n),new Error(n)}return t}checkExpiry(e,t){const{expiry:n}=t;we.toMiliseconds(n)-Date.now()<=0&&this.expire(e,t)}expire(e,t){this.expirations.delete(e),this.events.emit(Xr.expired,{target:e,expiration:t})}checkExpirations(){this.core.relayer.connected&&this.expirations.forEach((e,t)=>this.checkExpiry(t,e))}registerEventListeners(){this.core.heartbeat.on(Ds.HEARTBEAT_EVENTS.pulse,()=>this.checkExpirations()),this.events.on(Xr.created,e=>{const t=Xr.created;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,data:e}),this.persist()}),this.events.on(Xr.expired,e=>{const t=Xr.expired;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,data:e}),this.persist()}),this.events.on(Xr.deleted,e=>{const t=Xr.deleted;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,data:e}),this.persist()})}isInitialized(){if(!this.initialized){const{message:e}=he("NOT_INITIALIZED",this.name);throw new Error(e)}}}class O8 extends V5{constructor(e,t){super(e,t),this.projectId=e,this.logger=t,this.name=ju,this.initialized=!1,this.queue=[],this.verifyDisabled=!1,this.init=async n=>{if(this.verifyDisabled||bs()||!_s())return;const i=this.getVerifyUrl(n?.verifyUrl);this.verifyUrl!==i&&this.removeIframe(),this.verifyUrl=i;try{await this.createIframe()}catch(a){this.logger.info(`Verify iframe failed to load: ${this.verifyUrl}`),this.logger.info(a)}if(!this.initialized){this.removeIframe(),this.verifyUrl=Fu;try{await this.createIframe()}catch(a){this.logger.info(`Verify iframe failed to load: ${this.verifyUrl}`),this.logger.info(a),this.verifyDisabled=!0}}},this.register=async n=>{this.initialized?this.sendPost(n.attestationId):(this.addToQueue(n.attestationId),await this.init())},this.resolve=async n=>{if(this.isDevEnv)return"";const i=this.getVerifyUrl(n?.verifyUrl);let a;try{a=await this.fetchAttestation(n.attestationId,i)}catch(c){this.logger.info(`failed to resolve attestation: ${n.attestationId} from url: ${i}`),this.logger.info(c),a=await this.fetchAttestation(n.attestationId,Fu)}return a},this.fetchAttestation=async(n,i)=>{this.logger.info(`resolving attestation: ${n} from url: ${i}`);const a=this.startAbortTimer(we.ONE_SECOND*2),c=await fetch(`${i}/attestation/${n}`,{signal:this.abortController.signal});return clearTimeout(a),c.status===200?await c.json():void 0},this.addToQueue=n=>{this.queue.push(n)},this.processQueue=()=>{this.queue.length!==0&&(this.queue.forEach(n=>this.sendPost(n)),this.queue=[])},this.sendPost=n=>{var i;try{if(!this.iframe)return;(i=this.iframe.contentWindow)==null||i.postMessage(n,"*"),this.logger.info(`postMessage sent: ${n} ${this.verifyUrl}`)}catch{}},this.createIframe=async()=>{let n;const i=a=>{a.data==="verify_ready"&&(this.initialized=!0,this.processQueue(),window.removeEventListener("message",i),n())};await Promise.race([new Promise(a=>{if(document.getElementById(ju))return a();window.addEventListener("message",i);const c=document.createElement("iframe");c.id=ju,c.src=`${this.verifyUrl}/${this.projectId}`,c.style.display="none",document.body.append(c),this.iframe=c,n=a}),new Promise((a,c)=>setTimeout(()=>{window.removeEventListener("message",i),c("verify iframe load timeout")},we.toMiliseconds(we.FIVE_SECONDS)))])},this.removeIframe=()=>{this.iframe&&(this.iframe.remove(),this.iframe=void 0,this.initialized=!1)},this.getVerifyUrl=n=>{let i=n||Os;return r8.includes(i)||(this.logger.info(`verify url: ${i}, not included in trusted list, assigning default: ${Os}`),i=Os),i},this.logger=Xe.generateChildLogger(t,this.name),this.verifyUrl=Os,this.abortController=new AbortController,this.isDevEnv=au()&&process.env.IS_VITEST}get context(){return Xe.getLoggerContext(this.logger)}startAbortTimer(e){return this.abortController=new AbortController,setTimeout(()=>this.abortController.abort(),we.toMiliseconds(e))}}class C8 extends G5{constructor(e,t){super(e,t),this.projectId=e,this.logger=t,this.context=n8,this.registerDeviceToken=async n=>{const{clientId:i,token:a,notificationType:c,enableEncrypted:u=!1}=n,d=`${i8}/${this.projectId}/clients`;await rE(d,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({client_id:i,type:c,token:a,always_raw:u})})},this.logger=Xe.generateChildLogger(t,this.context)}}var $8=Object.defineProperty,A1=Object.getOwnPropertySymbols,A8=Object.prototype.hasOwnProperty,P8=Object.prototype.propertyIsEnumerable,P1=(r,e,t)=>e in r?$8(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,T1=(r,e)=>{for(var t in e||(e={}))A8.call(e,t)&&P1(r,t,e[t]);if(A1)for(var t of A1(e))P8.call(e,t)&&P1(r,t,e[t]);return r};class ku extends F5{constructor(e){super(e),this.protocol=w1,this.version=C4,this.name=Uu,this.events=new lr.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||_1,this.customStoragePrefix=e!=null&&e.customStoragePrefix?`:${e.customStoragePrefix}`:"";const t=typeof e?.logger<"u"&&typeof e?.logger!="string"?e.logger:Xe.pino(Xe.getDefaultLoggerOptions({level:e?.logger||$4.logger}));this.logger=Xe.generateChildLogger(t,this.name),this.heartbeat=new Ds.HeartBeat,this.crypto=new o8(this,this.logger,e?.keychain),this.history=new D8(this,this.logger),this.expirer=new S8(this,this.logger),this.storage=e!=null&&e.storage?e.storage:new z3(T1(T1({},A4),e?.storageOptions)),this.relayer=new b8({core:this,logger:this.logger,relayUrl:this.relayUrl,projectId:this.projectId}),this.pairing=new I8(this,this.logger),this.verify=new O8(this.projectId||"",this.logger),this.echoClient=new C8(this.projectId||"",this.logger)}static async init(e){const t=new ku(e);await t.initialize();const n=await t.crypto.getClientId();return await t.storage.setItem(K4,n),t}get context(){return Xe.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 T8=ku,R1="wc",N1=2,L1="client",Hu=`${R1}@${N1}:${L1}:`,zu={name:L1,logger:"error",controller:!1,relayUrl:"wss://relay.walletconnect.com"},M1="WALLETCONNECT_DEEPLINK_CHOICE",R8="proposal",U1="Proposal expired",N8="session",Ya=we.SEVEN_DAYS,L8="engine",No={wc_sessionPropose:{req:{ttl:we.FIVE_MINUTES,prompt:!0,tag:1100},res:{ttl:we.FIVE_MINUTES,prompt:!1,tag:1101}},wc_sessionSettle:{req:{ttl:we.FIVE_MINUTES,prompt:!1,tag:1102},res:{ttl:we.FIVE_MINUTES,prompt:!1,tag:1103}},wc_sessionUpdate:{req:{ttl:we.ONE_DAY,prompt:!1,tag:1104},res:{ttl:we.ONE_DAY,prompt:!1,tag:1105}},wc_sessionExtend:{req:{ttl:we.ONE_DAY,prompt:!1,tag:1106},res:{ttl:we.ONE_DAY,prompt:!1,tag:1107}},wc_sessionRequest:{req:{ttl:we.FIVE_MINUTES,prompt:!0,tag:1108},res:{ttl:we.FIVE_MINUTES,prompt:!1,tag:1109}},wc_sessionEvent:{req:{ttl:we.FIVE_MINUTES,prompt:!0,tag:1110},res:{ttl:we.FIVE_MINUTES,prompt:!1,tag:1111}},wc_sessionDelete:{req:{ttl:we.ONE_DAY,prompt:!1,tag:1112},res:{ttl:we.ONE_DAY,prompt:!1,tag:1113}},wc_sessionPing:{req:{ttl:we.THIRTY_SECONDS,prompt:!1,tag:1114},res:{ttl:we.THIRTY_SECONDS,prompt:!1,tag:1115}}},qu={min:we.FIVE_MINUTES,max:we.SEVEN_DAYS},Fn={idle:"IDLE",active:"ACTIVE"},M8="request",U8=["wc_sessionPropose","wc_sessionRequest","wc_authRequest"];var j8=Object.defineProperty,F8=Object.defineProperties,B8=Object.getOwnPropertyDescriptors,j1=Object.getOwnPropertySymbols,k8=Object.prototype.hasOwnProperty,H8=Object.prototype.propertyIsEnumerable,F1=(r,e,t)=>e in r?j8(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,Nr=(r,e)=>{for(var t in e||(e={}))k8.call(e,t)&&F1(r,t,e[t]);if(j1)for(var t of j1(e))H8.call(e,t)&&F1(r,t,e[t]);return r},Lo=(r,e)=>F8(r,B8(e));class z8 extends J5{constructor(e){super(e),this.name=L8,this.events=new lr.exports,this.initialized=!1,this.ignoredPayloadTypes=[Ni],this.requestQueue={state:Fn.idle,queue:[]},this.sessionRequestQueue={state:Fn.idle,queue:[]},this.requestQueueDelay=we.ONE_SECOND,this.init=async()=>{this.initialized||(await this.cleanup(),this.registerRelayerEvents(),this.registerExpirerEvents(),this.registerPairingEvents(),this.client.core.pairing.register({methods:Object.keys(No)}),this.initialized=!0,setTimeout(()=>{this.sessionRequestQueue.queue=this.getPendingSessionRequests(),this.processSessionRequestQueue()},we.toMiliseconds(this.requestQueueDelay)))},this.connect=async t=>{await this.isInitialized();const n=Lo(Nr({},t),{requiredNamespaces:t.requiredNamespaces||{},optionalNamespaces:t.optionalNamespaces||{}});await this.isValidConnect(n);const{pairingTopic:i,requiredNamespaces:a,optionalNamespaces:c,sessionProperties:u,relays:d}=n;let h=i,m,y=!1;if(h&&(y=this.client.core.pairing.pairings.get(h).active),!h||!y){const{topic:P,uri:O}=await this.client.core.pairing.create();h=P,m=O}const w=await this.client.core.crypto.generateKeyPair(),E=Nr({requiredNamespaces:a,optionalNamespaces:c,relays:d??[{protocol:b1}],proposer:{publicKey:w,metadata:this.client.metadata}},u&&{sessionProperties:u}),{reject:I,resolve:T,done:U}=Es(we.FIVE_MINUTES,U1);if(this.events.once(Vt("session_connect"),async({error:P,session:O})=>{if(P)I(P);else if(O){O.self.publicKey=w;const A=Lo(Nr({},O),{requiredNamespaces:O.requiredNamespaces,optionalNamespaces:O.optionalNamespaces});await this.client.session.set(O.topic,A),await this.setExpiry(O.topic,O.expiry),h&&await this.client.core.pairing.updateMetadata({topic:h,metadata:O.peer.metadata}),T(A)}}),!h){const{message:P}=he("NO_MATCHING_KEY",`connect() pairing topic: ${h}`);throw new Error(P)}const F=await this.sendRequest({topic:h,method:"wc_sessionPropose",params:E}),$=fn(we.FIVE_MINUTES);return await this.setProposal(F,Nr({id:F,expiry:$},E)),{uri:m,approval:U}},this.pair=async t=>(await this.isInitialized(),await this.client.core.pairing.pair(t)),this.approve=async t=>{await this.isInitialized(),await this.isValidApprove(t);const{id:n,relayProtocol:i,namespaces:a,sessionProperties:c}=t,u=this.client.proposal.get(n);let{pairingTopic:d,proposer:h,requiredNamespaces:m,optionalNamespaces:y}=u;d=d||"",Is(m)||(m=N_(a,"approve()"));const w=await this.client.core.crypto.generateKeyPair(),E=h.publicKey,I=await this.client.core.crypto.generateSharedKey(w,E);d&&n&&(await this.client.core.pairing.updateMetadata({topic:d,metadata:h.metadata}),await this.sendResult({id:n,topic:d,result:{relay:{protocol:i??"irn"},responderPublicKey:w}}),await this.client.proposal.delete(n,Rt("USER_DISCONNECTED")),await this.client.core.pairing.activate({topic:d}));const T=Nr({relay:{protocol:i??"irn"},namespaces:a,requiredNamespaces:m,optionalNamespaces:y,pairingTopic:d,controller:{publicKey:w,metadata:this.client.metadata},expiry:fn(Ya)},c&&{sessionProperties:c});await this.client.core.relayer.subscribe(I),await this.sendRequest({topic:I,method:"wc_sessionSettle",params:T,throwOnFailedPublish:!0});const U=Lo(Nr({},T),{topic:I,pairingTopic:d,acknowledged:!1,self:T.controller,peer:{publicKey:h.publicKey,metadata:h.metadata},controller:w});return await this.client.session.set(I,U),await this.setExpiry(I,fn(Ya)),{topic:I,acknowledged:()=>new Promise(F=>setTimeout(()=>F(this.client.session.get(I)),500))}},this.reject=async t=>{await this.isInitialized(),await this.isValidReject(t);const{id:n,reason:i}=t,{pairingTopic:a}=this.client.proposal.get(n);a&&(await this.sendError(n,a,i),await this.client.proposal.delete(n,Rt("USER_DISCONNECTED")))},this.update=async t=>{await this.isInitialized(),await this.isValidUpdate(t);const{topic:n,namespaces:i}=t,a=await this.sendRequest({topic:n,method:"wc_sessionUpdate",params:{namespaces:i}}),{done:c,resolve:u,reject:d}=Es();return this.events.once(Vt("session_update",a),({error:h})=>{h?d(h):u()}),await this.client.session.update(n,{namespaces:i}),{acknowledged:c}},this.extend=async t=>{await this.isInitialized(),await this.isValidExtend(t);const{topic:n}=t,i=await this.sendRequest({topic:n,method:"wc_sessionExtend",params:{}}),{done:a,resolve:c,reject:u}=Es();return this.events.once(Vt("session_extend",i),({error:d})=>{d?u(d):c()}),await this.setExpiry(n,fn(Ya)),{acknowledged:a}},this.request=async t=>{await this.isInitialized(),await this.isValidRequest(t);const{chainId:n,request:i,topic:a,expiry:c}=t,u=Pu(),{done:d,resolve:h,reject:m}=Es(c,"Request expired. Please try again.");return this.events.once(Vt("session_request",u),({error:y,result:w})=>{y?m(y):h(w)}),await Promise.all([new Promise(async y=>{await this.sendRequest({clientRpcId:u,topic:a,method:"wc_sessionRequest",params:{request:i,chainId:n},expiry:c,throwOnFailedPublish:!0}).catch(w=>m(w)),this.client.events.emit("session_request_sent",{topic:a,request:i,chainId:n,id:u}),y()}),new Promise(async y=>{const w=await __(this.client.core.storage,M1);b_({id:u,topic:a,wcDeepLink:w}),y()}),d()]).then(y=>y[2])},this.respond=async t=>{await this.isInitialized(),await this.isValidRespond(t);const{topic:n,response:i}=t,{id:a}=i;Mn(i)?await this.sendResult({id:a,topic:n,result:i.result,throwOnFailedPublish:!0}):dn(i)&&await this.sendError(a,n,i.error),this.cleanupAfterResponse(t)},this.ping=async t=>{await this.isInitialized(),await this.isValidPing(t);const{topic:n}=t;if(this.client.session.keys.includes(n)){const i=await this.sendRequest({topic:n,method:"wc_sessionPing",params:{}}),{done:a,resolve:c,reject:u}=Es();this.events.once(Vt("session_ping",i),({error:d})=>{d?u(d):c()}),await a()}else this.client.core.pairing.pairings.keys.includes(n)&&await this.client.core.pairing.ping({topic:n})},this.emit=async t=>{await this.isInitialized(),await this.isValidEmit(t);const{topic:n,event:i,chainId:a}=t;await this.sendRequest({topic:n,method:"wc_sessionEvent",params:{event:i,chainId:a}})},this.disconnect=async t=>{await this.isInitialized(),await this.isValidDisconnect(t);const{topic:n}=t;this.client.session.keys.includes(n)?(await this.sendRequest({topic:n,method:"wc_sessionDelete",params:Rt("USER_DISCONNECTED"),throwOnFailedPublish:!0}),await this.deleteSession(n)):await this.client.core.pairing.disconnect({topic:n})},this.find=t=>(this.isInitialized(),this.client.session.getAll().filter(n=>U_(n,t))),this.getPendingSessionRequests=()=>(this.isInitialized(),this.client.pendingRequest.getAll()),this.cleanupDuplicatePairings=async t=>{if(t.pairingTopic)try{const n=this.client.core.pairing.pairings.get(t.pairingTopic),i=this.client.core.pairing.pairings.getAll().filter(a=>{var c,u;return((c=a.peerMetadata)==null?void 0:c.url)&&((u=a.peerMetadata)==null?void 0:u.url)===t.peer.metadata.url&&a.topic&&a.topic!==n.topic});if(i.length===0)return;this.client.logger.info(`Cleaning up ${i.length} duplicate pairing(s)`),await Promise.all(i.map(a=>this.client.core.pairing.disconnect({topic:a.topic}))),this.client.logger.info("Duplicate pairings clean up finished")}catch(n){this.client.logger.error(n)}},this.deleteSession=async(t,n)=>{const{self:i}=this.client.session.get(t);await this.client.core.relayer.unsubscribe(t),this.client.session.delete(t,Rt("USER_DISCONNECTED")),this.client.core.crypto.keychain.has(i.publicKey)&&await this.client.core.crypto.deleteKeyPair(i.publicKey),this.client.core.crypto.keychain.has(t)&&await this.client.core.crypto.deleteSymKey(t),n||this.client.core.expirer.del(t),this.client.core.storage.removeItem(M1).catch(a=>this.client.logger.warn(a)),this.getPendingSessionRequests().forEach(a=>{a.topic===t&&this.deletePendingSessionRequest(a.id,Rt("USER_DISCONNECTED"))})},this.deleteProposal=async(t,n)=>{await Promise.all([this.client.proposal.delete(t,Rt("USER_DISCONNECTED")),n?Promise.resolve():this.client.core.expirer.del(t)])},this.deletePendingSessionRequest=async(t,n,i=!1)=>{await Promise.all([this.client.pendingRequest.delete(t,n),i?Promise.resolve():this.client.core.expirer.del(t)]),this.sessionRequestQueue.queue=this.sessionRequestQueue.queue.filter(a=>a.id!==t),i&&(this.sessionRequestQueue.state=Fn.idle)},this.setExpiry=async(t,n)=>{this.client.session.keys.includes(t)&&await this.client.session.update(t,{expiry:n}),this.client.core.expirer.set(t,n)},this.setProposal=async(t,n)=>{await this.client.proposal.set(t,n),this.client.core.expirer.set(t,n.expiry)},this.setPendingSessionRequest=async t=>{const n=No.wc_sessionRequest.req.ttl,{id:i,topic:a,params:c,verifyContext:u}=t;await this.client.pendingRequest.set(i,{id:i,topic:a,params:c,verifyContext:u}),n&&this.client.core.expirer.set(i,fn(n))},this.sendRequest=async t=>{const{topic:n,method:i,params:a,expiry:c,relayRpcId:u,clientRpcId:d,throwOnFailedPublish:h}=t,m=Ss(i,a,d);if(_s()&&U8.includes(i)){const E=ys(JSON.stringify(m));this.client.core.verify.register({attestationId:E})}const y=await this.client.core.crypto.encode(n,m),w=No[i].req;return c&&(w.ttl=c),u&&(w.id=u),this.client.core.history.set(n,m),h?(w.internal=Lo(Nr({},w.internal),{throwOnFailedPublish:!0}),await this.client.core.relayer.publish(n,y,w)):this.client.core.relayer.publish(n,y,w).catch(E=>this.client.logger.error(E)),m.id},this.sendResult=async t=>{const{id:n,topic:i,result:a,throwOnFailedPublish:c}=t,u=qa(n,a),d=await this.client.core.crypto.encode(i,u),h=await this.client.core.history.get(i,n),m=No[h.request.method].res;c?(m.internal=Lo(Nr({},m.internal),{throwOnFailedPublish:!0}),await this.client.core.relayer.publish(i,d,m)):this.client.core.relayer.publish(i,d,m).catch(y=>this.client.logger.error(y)),await this.client.core.history.resolve(u)},this.sendError=async(t,n,i)=>{const a=Wa(t,i),c=await this.client.core.crypto.encode(n,a),u=await this.client.core.history.get(n,t),d=No[u.request.method].res;this.client.core.relayer.publish(n,c,d),await this.client.core.history.resolve(a)},this.cleanup=async()=>{const t=[],n=[];this.client.session.getAll().forEach(i=>{ni(i.expiry)&&t.push(i.topic)}),this.client.proposal.getAll().forEach(i=>{ni(i.expiry)&&n.push(i.id)}),await Promise.all([...t.map(i=>this.deleteSession(i)),...n.map(i=>this.deleteProposal(i))])},this.onRelayEventRequest=async t=>{this.requestQueue.queue.push(t),await this.processRequestsQueue()},this.processRequestsQueue=async()=>{if(this.requestQueue.state===Fn.active){this.client.logger.info("Request queue already active, skipping...");return}for(this.client.logger.info(`Request queue starting with ${this.requestQueue.queue.length} requests`);this.requestQueue.queue.length>0;){this.requestQueue.state=Fn.active;const t=this.requestQueue.queue.shift();if(t)try{this.processRequest(t),await new Promise(n=>setTimeout(n,300))}catch(n){this.client.logger.warn(n)}}this.requestQueue.state=Fn.idle},this.processRequest=t=>{const{topic:n,payload:i}=t,a=i.method;switch(a){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 ${a}`)}},this.onRelayEventResponse=async t=>{const{topic:n,payload:i}=t,a=(await this.client.core.history.get(n,i.id)).request.method;switch(a){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 ${a}`)}},this.onRelayEventUnknownPayload=t=>{const{topic:n}=t,{message:i}=he("MISSING_OR_INVALID",`Decoded payload on topic ${n} is not identifiable as a JSON-RPC request or a response.`);throw new Error(i)},this.onSessionProposeRequest=async(t,n)=>{const{params:i,id:a}=n;try{this.isValidConnect(Nr({},n.params));const c=fn(we.FIVE_MINUTES),u=Nr({id:a,pairingTopic:t,expiry:c},i);await this.setProposal(a,u);const d=ys(JSON.stringify(n)),h=await this.getVerifyContext(d,u.proposer.metadata);this.client.events.emit("session_proposal",{id:a,params:u,verifyContext:h})}catch(c){await this.sendError(a,t,c),this.client.logger.error(c)}},this.onSessionProposeResponse=async(t,n)=>{const{id:i}=n;if(Mn(n)){const{result:a}=n;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",result:a});const c=this.client.proposal.get(i);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",proposal:c});const u=c.proposer.publicKey;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",selfPublicKey:u});const d=a.responderPublicKey;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",peerPublicKey:d});const h=await this.client.core.crypto.generateSharedKey(u,d);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",sessionTopic:h});const m=await this.client.core.relayer.subscribe(h);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",subscriptionId:m}),await this.client.core.pairing.activate({topic:t})}else dn(n)&&(await this.client.proposal.delete(i,Rt("USER_DISCONNECTED")),this.events.emit(Vt("session_connect"),{error:n.error}))},this.onSessionSettleRequest=async(t,n)=>{const{id:i,params:a}=n;try{this.isValidSessionSettleRequest(a);const{relay:c,controller:u,expiry:d,namespaces:h,requiredNamespaces:m,optionalNamespaces:y,sessionProperties:w,pairingTopic:E}=n.params,I=Nr({topic:t,relay:c,expiry:d,namespaces:h,acknowledged:!0,pairingTopic:E,requiredNamespaces:m,optionalNamespaces:y,controller:u.publicKey,self:{publicKey:"",metadata:this.client.metadata},peer:{publicKey:u.publicKey,metadata:u.metadata}},w&&{sessionProperties:w});await this.sendResult({id:n.id,topic:t,result:!0}),this.events.emit(Vt("session_connect"),{session:I}),this.cleanupDuplicatePairings(I)}catch(c){await this.sendError(i,t,c),this.client.logger.error(c)}},this.onSessionSettleResponse=async(t,n)=>{const{id:i}=n;Mn(n)?(await this.client.session.update(t,{acknowledged:!0}),this.events.emit(Vt("session_approve",i),{})):dn(n)&&(await this.client.session.delete(t,Rt("USER_DISCONNECTED")),this.events.emit(Vt("session_approve",i),{error:n.error}))},this.onSessionUpdateRequest=async(t,n)=>{const{params:i,id:a}=n;try{const c=`${t}_session_update`,u=Ua.get(c);if(u&&this.isRequestOutOfSync(u,a)){this.client.logger.info(`Discarding out of sync request - ${a}`);return}this.isValidUpdate(Nr({topic:t},i)),await this.client.session.update(t,{namespaces:i.namespaces}),await this.sendResult({id:a,topic:t,result:!0}),this.client.events.emit("session_update",{id:a,topic:t,params:i}),Ua.set(c,a)}catch(c){await this.sendError(a,t,c),this.client.logger.error(c)}},this.isRequestOutOfSync=(t,n)=>parseInt(n.toString().slice(0,-3))<=parseInt(t.toString().slice(0,-3)),this.onSessionUpdateResponse=(t,n)=>{const{id:i}=n;Mn(n)?this.events.emit(Vt("session_update",i),{}):dn(n)&&this.events.emit(Vt("session_update",i),{error:n.error})},this.onSessionExtendRequest=async(t,n)=>{const{id:i}=n;try{this.isValidExtend({topic:t}),await this.setExpiry(t,fn(Ya)),await this.sendResult({id:i,topic:t,result:!0}),this.client.events.emit("session_extend",{id:i,topic:t})}catch(a){await this.sendError(i,t,a),this.client.logger.error(a)}},this.onSessionExtendResponse=(t,n)=>{const{id:i}=n;Mn(n)?this.events.emit(Vt("session_extend",i),{}):dn(n)&&this.events.emit(Vt("session_extend",i),{error:n.error})},this.onSessionPingRequest=async(t,n)=>{const{id:i}=n;try{this.isValidPing({topic:t}),await this.sendResult({id:i,topic:t,result:!0}),this.client.events.emit("session_ping",{id:i,topic:t})}catch(a){await this.sendError(i,t,a),this.client.logger.error(a)}},this.onSessionPingResponse=(t,n)=>{const{id:i}=n;setTimeout(()=>{Mn(n)?this.events.emit(Vt("session_ping",i),{}):dn(n)&&this.events.emit(Vt("session_ping",i),{error:n.error})},500)},this.onSessionDeleteRequest=async(t,n)=>{const{id:i}=n;try{this.isValidDisconnect({topic:t,reason:n.params}),await Promise.all([new Promise(a=>{this.client.core.relayer.once(pr.publish,async()=>{a(await this.deleteSession(t))})}),this.sendResult({id:i,topic:t,result:!0})]),this.client.events.emit("session_delete",{id:i,topic:t})}catch(a){this.client.logger.error(a)}},this.onSessionRequest=async(t,n)=>{const{id:i,params:a}=n;try{this.isValidRequest(Nr({topic:t},a));const c=ys(JSON.stringify(Ss("wc_sessionRequest",a,i))),u=this.client.session.get(t),d=await this.getVerifyContext(c,u.peer.metadata),h={id:i,topic:t,params:a,verifyContext:d};await this.setPendingSessionRequest(h),this.addSessionRequestToSessionRequestQueue(h),this.processSessionRequestQueue()}catch(c){await this.sendError(i,t,c),this.client.logger.error(c)}},this.onSessionRequestResponse=(t,n)=>{const{id:i}=n;Mn(n)?this.events.emit(Vt("session_request",i),{result:n.result}):dn(n)&&this.events.emit(Vt("session_request",i),{error:n.error})},this.onSessionEventRequest=async(t,n)=>{const{id:i,params:a}=n;try{const c=`${t}_session_event_${a.event.name}`,u=Ua.get(c);if(u&&this.isRequestOutOfSync(u,i)){this.client.logger.info(`Discarding out of sync request - ${i}`);return}this.isValidEmit(Nr({topic:t},a)),this.client.events.emit("session_event",{id:i,topic:t,params:a}),Ua.set(c,i)}catch(c){await this.sendError(i,t,c),this.client.logger.error(c)}},this.addSessionRequestToSessionRequestQueue=t=>{this.sessionRequestQueue.queue.push(t)},this.cleanupAfterResponse=t=>{this.deletePendingSessionRequest(t.response.id,{message:"fulfilled",code:0}),setTimeout(()=>{this.sessionRequestQueue.state=Fn.idle,this.processSessionRequestQueue()},we.toMiliseconds(this.requestQueueDelay))},this.processSessionRequestQueue=()=>{if(this.sessionRequestQueue.state===Fn.active){this.client.logger.info("session request queue is already active.");return}const t=this.sessionRequestQueue.queue[0];if(!t){this.client.logger.info("session request queue is empty.");return}try{this.sessionRequestQueue.state=Fn.active,this.client.events.emit("session_request",t)}catch(n){this.client.logger.error(n)}},this.onPairingCreated=t=>{if(t.active)return;const n=this.client.proposal.getAll().find(i=>i.pairingTopic===t.topic);n&&this.onSessionProposeRequest(t.topic,Ss("wc_sessionPropose",{requiredNamespaces:n.requiredNamespaces,optionalNamespaces:n.optionalNamespaces,relays:n.relays,proposer:n.proposer,sessionProperties:n.sessionProperties},n.id))},this.isValidConnect=async t=>{if(!Tr(t)){const{message:d}=he("MISSING_OR_INVALID",`connect() params: ${JSON.stringify(t)}`);throw new Error(d)}const{pairingTopic:n,requiredNamespaces:i,optionalNamespaces:a,sessionProperties:c,relays:u}=t;if(_r(n)||await this.isValidPairingTopic(n),!Y_(u,!0)){const{message:d}=he("MISSING_OR_INVALID",`connect() relays: ${u}`);throw new Error(d)}!_r(i)&&Is(i)!==0&&this.validateNamespaces(i,"requiredNamespaces"),!_r(a)&&Is(a)!==0&&this.validateNamespaces(a,"optionalNamespaces"),_r(c)||this.validateSessionProps(c,"sessionProperties")},this.validateNamespaces=(t,n)=>{const i=G_(t,"connect()",n);if(i)throw new Error(i.message)},this.isValidApprove=async t=>{if(!Tr(t))throw new Error(he("MISSING_OR_INVALID",`approve() params: ${t}`).message);const{id:n,namespaces:i,relayProtocol:a,sessionProperties:c}=t;await this.isValidProposalId(n);const u=this.client.proposal.get(n),d=Ma(i,"approve()");if(d)throw new Error(d.message);const h=cp(u.requiredNamespaces,i,"approve()");if(h)throw new Error(h.message);if(!ir(a,!0)){const{message:m}=he("MISSING_OR_INVALID",`approve() relayProtocol: ${a}`);throw new Error(m)}_r(c)||this.validateSessionProps(c,"sessionProperties")},this.isValidReject=async t=>{if(!Tr(t)){const{message:a}=he("MISSING_OR_INVALID",`reject() params: ${t}`);throw new Error(a)}const{id:n,reason:i}=t;if(await this.isValidProposalId(n),!Z_(i)){const{message:a}=he("MISSING_OR_INVALID",`reject() reason: ${JSON.stringify(i)}`);throw new Error(a)}},this.isValidSessionSettleRequest=t=>{if(!Tr(t)){const{message:h}=he("MISSING_OR_INVALID",`onSessionSettleRequest() params: ${t}`);throw new Error(h)}const{relay:n,controller:i,namespaces:a,expiry:c}=t;if(!op(n)){const{message:h}=he("MISSING_OR_INVALID","onSessionSettleRequest() relay protocol should be a string");throw new Error(h)}const u=H_(i,"onSessionSettleRequest()");if(u)throw new Error(u.message);const d=Ma(a,"onSessionSettleRequest()");if(d)throw new Error(d.message);if(ni(c)){const{message:h}=he("EXPIRED","onSessionSettleRequest()");throw new Error(h)}},this.isValidUpdate=async t=>{if(!Tr(t)){const{message:d}=he("MISSING_OR_INVALID",`update() params: ${t}`);throw new Error(d)}const{topic:n,namespaces:i}=t;await this.isValidSessionTopic(n);const a=this.client.session.get(n),c=Ma(i,"update()");if(c)throw new Error(c.message);const u=cp(a.requiredNamespaces,i,"update()");if(u)throw new Error(u.message)},this.isValidExtend=async t=>{if(!Tr(t)){const{message:i}=he("MISSING_OR_INVALID",`extend() params: ${t}`);throw new Error(i)}const{topic:n}=t;await this.isValidSessionTopic(n)},this.isValidRequest=async t=>{if(!Tr(t)){const{message:d}=he("MISSING_OR_INVALID",`request() params: ${t}`);throw new Error(d)}const{topic:n,request:i,chainId:a,expiry:c}=t;await this.isValidSessionTopic(n);const{namespaces:u}=this.client.session.get(n);if(!ap(u,a)){const{message:d}=he("MISSING_OR_INVALID",`request() chainId: ${a}`);throw new Error(d)}if(!Q_(i)){const{message:d}=he("MISSING_OR_INVALID",`request() ${JSON.stringify(i)}`);throw new Error(d)}if(!t3(u,a,i.method)){const{message:d}=he("MISSING_OR_INVALID",`request() method: ${i.method}`);throw new Error(d)}if(c&&!s3(c,qu)){const{message:d}=he("MISSING_OR_INVALID",`request() expiry: ${c}. Expiry must be a number (in seconds) between ${qu.min} and ${qu.max}`);throw new Error(d)}},this.isValidRespond=async t=>{var n;if(!Tr(t)){const{message:c}=he("MISSING_OR_INVALID",`respond() params: ${t}`);throw new Error(c)}const{topic:i,response:a}=t;try{await this.isValidSessionTopic(i)}catch(c){throw(n=t?.response)!=null&&n.id&&this.cleanupAfterResponse(t),c}if(!X_(a)){const{message:c}=he("MISSING_OR_INVALID",`respond() response: ${JSON.stringify(a)}`);throw new Error(c)}},this.isValidPing=async t=>{if(!Tr(t)){const{message:i}=he("MISSING_OR_INVALID",`ping() params: ${t}`);throw new Error(i)}const{topic:n}=t;await this.isValidSessionOrPairingTopic(n)},this.isValidEmit=async t=>{if(!Tr(t)){const{message:u}=he("MISSING_OR_INVALID",`emit() params: ${t}`);throw new Error(u)}const{topic:n,event:i,chainId:a}=t;await this.isValidSessionTopic(n);const{namespaces:c}=this.client.session.get(n);if(!ap(c,a)){const{message:u}=he("MISSING_OR_INVALID",`emit() chainId: ${a}`);throw new Error(u)}if(!e3(i)){const{message:u}=he("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(i)}`);throw new Error(u)}if(!r3(c,a,i.name)){const{message:u}=he("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(i)}`);throw new Error(u)}},this.isValidDisconnect=async t=>{if(!Tr(t)){const{message:i}=he("MISSING_OR_INVALID",`disconnect() params: ${t}`);throw new Error(i)}const{topic:n}=t;await this.isValidSessionOrPairingTopic(n)},this.getVerifyContext=async(t,n)=>{const i={verified:{verifyUrl:n.verifyUrl||Os,validation:"UNKNOWN",origin:n.url||""}};try{const a=await this.client.core.verify.resolve({attestationId:t,verifyUrl:n.verifyUrl});a&&(i.verified.origin=a.origin,i.verified.isScam=a.isScam,i.verified.validation=a.origin===new URL(n.url).origin?"VALID":"INVALID")}catch(a){this.client.logger.info(a)}return this.client.logger.info(`Verify context: ${JSON.stringify(i)}`),i},this.validateSessionProps=(t,n)=>{Object.values(t).forEach(i=>{if(!ir(i,!1)){const{message:a}=he("MISSING_OR_INVALID",`${n} must be in Record<string, string> format. Received: ${JSON.stringify(i)}`);throw new Error(a)}})}}async isInitialized(){if(!this.initialized){const{message:e}=he("NOT_INITIALIZED",this.name);throw new Error(e)}await this.client.core.relayer.confirmOnlineStateOrThrow()}registerRelayerEvents(){this.client.core.relayer.on(pr.message,async e=>{const{topic:t,message:n}=e;if(this.ignoredPayloadTypes.includes(this.client.core.crypto.getPayloadType(n)))return;const i=await this.client.core.crypto.decode(t,n);try{Tu(i)?(this.client.core.history.set(t,i),this.onRelayEventRequest({topic:t,payload:i})):Ka(i)?(await this.client.core.history.resolve(i),await this.onRelayEventResponse({topic:t,payload:i}),this.client.core.history.delete(t,i.id)):this.onRelayEventUnknownPayload({topic:t,payload:i})}catch(a){this.client.logger.error(a)}})}registerExpirerEvents(){this.client.core.expirer.on(Xr.expired,async e=>{const{topic:t,id:n}=ep(e.target);if(n&&this.client.pendingRequest.keys.includes(n))return await this.deletePendingSessionRequest(n,he("EXPIRED"),!0);t?this.client.session.keys.includes(t)&&(await this.deleteSession(t,!0),this.client.events.emit("session_expire",{topic:t})):n&&(await this.deleteProposal(n,!0),this.client.events.emit("proposal_expire",{id:n}))})}registerPairingEvents(){this.client.core.pairing.events.on(To.create,e=>this.onPairingCreated(e))}isValidPairingTopic(e){if(!ir(e,!1)){const{message:t}=he("MISSING_OR_INVALID",`pairing topic should be a string: ${e}`);throw new Error(t)}if(!this.client.core.pairing.pairings.keys.includes(e)){const{message:t}=he("NO_MATCHING_KEY",`pairing topic doesn't exist: ${e}`);throw new Error(t)}if(ni(this.client.core.pairing.pairings.get(e).expiry)){const{message:t}=he("EXPIRED",`pairing topic: ${e}`);throw new Error(t)}}async isValidSessionTopic(e){if(!ir(e,!1)){const{message:t}=he("MISSING_OR_INVALID",`session topic should be a string: ${e}`);throw new Error(t)}if(!this.client.session.keys.includes(e)){const{message:t}=he("NO_MATCHING_KEY",`session topic doesn't exist: ${e}`);throw new Error(t)}if(ni(this.client.session.get(e).expiry)){await this.deleteSession(e);const{message:t}=he("EXPIRED",`session topic: ${e}`);throw new Error(t)}}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(ir(e,!1)){const{message:t}=he("NO_MATCHING_KEY",`session or pairing topic doesn't exist: ${e}`);throw new Error(t)}else{const{message:t}=he("MISSING_OR_INVALID",`session or pairing topic should be a string: ${e}`);throw new Error(t)}}async isValidProposalId(e){if(!J_(e)){const{message:t}=he("MISSING_OR_INVALID",`proposal id should be a number: ${e}`);throw new Error(t)}if(!this.client.proposal.keys.includes(e)){const{message:t}=he("NO_MATCHING_KEY",`proposal id doesn't exist: ${e}`);throw new Error(t)}if(ni(this.client.proposal.get(e).expiry)){await this.deleteProposal(e);const{message:t}=he("EXPIRED",`proposal id: ${e}`);throw new Error(t)}}}class q8 extends Ga{constructor(e,t){super(e,t,R8,Hu),this.core=e,this.logger=t}}class W8 extends Ga{constructor(e,t){super(e,t,N8,Hu),this.core=e,this.logger=t}}class K8 extends Ga{constructor(e,t){super(e,t,M8,Hu,n=>n.id),this.core=e,this.logger=t}}class Wu extends Y5{constructor(e){super(e),this.protocol=R1,this.version=N1,this.name=zu.name,this.events=new lr.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||zu.name,this.metadata=e?.metadata||d_();const t=typeof e?.logger<"u"&&typeof e?.logger!="string"?e.logger:Xe.pino(Xe.getDefaultLoggerOptions({level:e?.logger||zu.logger}));this.core=e?.core||new T8(e),this.logger=Xe.generateChildLogger(t,this.name),this.session=new W8(this.core,this.logger),this.proposal=new q8(this.core,this.logger),this.pendingRequest=new K8(this.core,this.logger),this.engine=new z8(this)}static async init(e){const t=new Wu(e);return await t.initialize(),t}get context(){return Xe.getLoggerContext(this.logger)}get pairing(){return this.core.pairing.pairings}async initialize(){this.logger.trace("Initialized");try{await this.core.start(),await this.session.init(),await this.proposal.init(),await this.pendingRequest.init(),await this.engine.init(),this.core.verify.init({verifyUrl:this.metadata.verifyUrl}),this.logger.info("SignClient Initialization Success")}catch(e){throw this.logger.info("SignClient Initialization Failure"),this.logger.error(e.message),e}}}var Ku={exports:{}};(function(r,e){var t=typeof self<"u"?self:wr,n=function(){function a(){this.fetch=!1,this.DOMException=t.DOMException}return a.prototype=t,new a}();(function(a){(function(c){var u={searchParams:"URLSearchParams"in a,iterable:"Symbol"in a&&"iterator"in Symbol,blob:"FileReader"in a&&"Blob"in a&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in a,arrayBuffer:"ArrayBuffer"in a};function d(D){return D&&DataView.prototype.isPrototypeOf(D)}if(u.arrayBuffer)var h=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],m=ArrayBuffer.isView||function(D){return D&&h.indexOf(Object.prototype.toString.call(D))>-1};function y(D){if(typeof D!="string"&&(D=String(D)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(D))throw new TypeError("Invalid character in header field name");return D.toLowerCase()}function w(D){return typeof D!="string"&&(D=String(D)),D}function E(D){var N={next:function(){var X=D.shift();return{done:X===void 0,value:X}}};return u.iterable&&(N[Symbol.iterator]=function(){return N}),N}function I(D){this.map={},D instanceof I?D.forEach(function(N,X){this.append(X,N)},this):Array.isArray(D)?D.forEach(function(N){this.append(N[0],N[1])},this):D&&Object.getOwnPropertyNames(D).forEach(function(N){this.append(N,D[N])},this)}I.prototype.append=function(D,N){D=y(D),N=w(N);var X=this.map[D];this.map[D]=X?X+", "+N:N},I.prototype.delete=function(D){delete this.map[y(D)]},I.prototype.get=function(D){return D=y(D),this.has(D)?this.map[D]:null},I.prototype.has=function(D){return this.map.hasOwnProperty(y(D))},I.prototype.set=function(D,N){this.map[y(D)]=w(N)},I.prototype.forEach=function(D,N){for(var X in this.map)this.map.hasOwnProperty(X)&&D.call(N,this.map[X],X,this)},I.prototype.keys=function(){var D=[];return this.forEach(function(N,X){D.push(X)}),E(D)},I.prototype.values=function(){var D=[];return this.forEach(function(N){D.push(N)}),E(D)},I.prototype.entries=function(){var D=[];return this.forEach(function(N,X){D.push([X,N])}),E(D)},u.iterable&&(I.prototype[Symbol.iterator]=I.prototype.entries);function T(D){if(D.bodyUsed)return Promise.reject(new TypeError("Already read"));D.bodyUsed=!0}function U(D){return new Promise(function(N,X){D.onload=function(){N(D.result)},D.onerror=function(){X(D.error)}})}function F(D){var N=new FileReader,X=U(N);return N.readAsArrayBuffer(D),X}function $(D){var N=new FileReader,X=U(N);return N.readAsText(D),X}function P(D){for(var N=new Uint8Array(D),X=new Array(N.length),ee=0;ee<N.length;ee++)X[ee]=String.fromCharCode(N[ee]);return X.join("")}function O(D){if(D.slice)return D.slice(0);var N=new Uint8Array(D.byteLength);return N.set(new Uint8Array(D)),N.buffer}function A(){return this.bodyUsed=!1,this._initBody=function(D){this._bodyInit=D,D?typeof D=="string"?this._bodyText=D:u.blob&&Blob.prototype.isPrototypeOf(D)?this._bodyBlob=D:u.formData&&FormData.prototype.isPrototypeOf(D)?this._bodyFormData=D:u.searchParams&&URLSearchParams.prototype.isPrototypeOf(D)?this._bodyText=D.toString():u.arrayBuffer&&u.blob&&d(D)?(this._bodyArrayBuffer=O(D.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):u.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(D)||m(D))?this._bodyArrayBuffer=O(D):this._bodyText=D=Object.prototype.toString.call(D):this._bodyText="",this.headers.get("content-type")||(typeof D=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):u.searchParams&&URLSearchParams.prototype.isPrototypeOf(D)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},u.blob&&(this.blob=function(){var D=T(this);if(D)return D;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?T(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(F)}),this.text=function(){var D=T(this);if(D)return D;if(this._bodyBlob)return $(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(P(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},u.formData&&(this.formData=function(){return this.text().then(q)}),this.json=function(){return this.text().then(JSON.parse)},this}var x=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function f(D){var N=D.toUpperCase();return x.indexOf(N)>-1?N:D}function b(D,N){N=N||{};var X=N.body;if(D instanceof b){if(D.bodyUsed)throw new TypeError("Already read");this.url=D.url,this.credentials=D.credentials,N.headers||(this.headers=new I(D.headers)),this.method=D.method,this.mode=D.mode,this.signal=D.signal,!X&&D._bodyInit!=null&&(X=D._bodyInit,D.bodyUsed=!0)}else this.url=String(D);if(this.credentials=N.credentials||this.credentials||"same-origin",(N.headers||!this.headers)&&(this.headers=new I(N.headers)),this.method=f(N.method||this.method||"GET"),this.mode=N.mode||this.mode||null,this.signal=N.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&X)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(X)}b.prototype.clone=function(){return new b(this,{body:this._bodyInit})};function q(D){var N=new FormData;return D.trim().split("&").forEach(function(X){if(X){var ee=X.split("="),Y=ee.shift().replace(/\+/g," "),J=ee.join("=").replace(/\+/g," ");N.append(decodeURIComponent(Y),decodeURIComponent(J))}}),N}function j(D){var N=new I,X=D.replace(/\r?\n[\t ]+/g," ");return X.split(/\r?\n/).forEach(function(ee){var Y=ee.split(":"),J=Y.shift().trim();if(J){var Q=Y.join(":").trim();N.append(J,Q)}}),N}A.call(b.prototype);function V(D,N){N||(N={}),this.type="default",this.status=N.status===void 0?200:N.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in N?N.statusText:"OK",this.headers=new I(N.headers),this.url=N.url||"",this._initBody(D)}A.call(V.prototype),V.prototype.clone=function(){return new V(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new I(this.headers),url:this.url})},V.error=function(){var D=new V(null,{status:0,statusText:""});return D.type="error",D};var se=[301,302,303,307,308];V.redirect=function(D,N){if(se.indexOf(N)===-1)throw new RangeError("Invalid status code");return new V(null,{status:N,headers:{location:D}})},c.DOMException=a.DOMException;try{new c.DOMException}catch{c.DOMException=function(N,X){this.message=N,this.name=X;var ee=Error(N);this.stack=ee.stack},c.DOMException.prototype=Object.create(Error.prototype),c.DOMException.prototype.constructor=c.DOMException}function ce(D,N){return new Promise(function(X,ee){var Y=new b(D,N);if(Y.signal&&Y.signal.aborted)return ee(new c.DOMException("Aborted","AbortError"));var J=new XMLHttpRequest;function Q(){J.abort()}J.onload=function(){var ie={status:J.status,statusText:J.statusText,headers:j(J.getAllResponseHeaders()||"")};ie.url="responseURL"in J?J.responseURL:ie.headers.get("X-Request-URL");var Ee="response"in J?J.response:J.responseText;X(new V(Ee,ie))},J.onerror=function(){ee(new TypeError("Network request failed"))},J.ontimeout=function(){ee(new TypeError("Network request failed"))},J.onabort=function(){ee(new c.DOMException("Aborted","AbortError"))},J.open(Y.method,Y.url,!0),Y.credentials==="include"?J.withCredentials=!0:Y.credentials==="omit"&&(J.withCredentials=!1),"responseType"in J&&u.blob&&(J.responseType="blob"),Y.headers.forEach(function(ie,Ee){J.setRequestHeader(Ee,ie)}),Y.signal&&(Y.signal.addEventListener("abort",Q),J.onreadystatechange=function(){J.readyState===4&&Y.signal.removeEventListener("abort",Q)}),J.send(typeof Y._bodyInit>"u"?null:Y._bodyInit)})}return ce.polyfill=!0,a.fetch||(a.fetch=ce,a.Headers=I,a.Request=b,a.Response=V),c.Headers=I,c.Request=b,c.Response=V,c.fetch=ce,Object.defineProperty(c,"__esModule",{value:!0}),c})({})})(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,r.exports=e})(Ku,Ku.exports);var B1=Ow(Ku.exports);const k1={headers:{Accept:"application/json","Content-Type":"application/json"},method:"POST"},H1=10;class si{constructor(e,t=!1){if(this.url=e,this.disableProviderPing=t,this.events=new lr.exports.EventEmitter,this.isAvailable=!1,this.registering=!1,!Vp(e))throw new Error(`Provided URL is not compatible with HTTP connection: ${e}`);this.url=e,this.disableProviderPing=t}get connected(){return this.isAvailable}get connecting(){return this.registering}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}off(e,t){this.events.off(e,t)}removeListener(e,t){this.events.removeListener(e,t)}async open(e=this.url){await this.register(e)}async close(){if(!this.isAvailable)throw new Error("Connection already closed");this.onClose()}async send(e,t){this.isAvailable||await this.register();try{const n=Ui(e),a=await(await B1(this.url,Object.assign(Object.assign({},k1),{body:n}))).json();this.onPayload({data:a})}catch(n){this.onError(e.id,n)}}async register(e=this.url){if(!Vp(e))throw new Error(`Provided URL is not compatible with HTTP connection: ${e}`);if(this.registering){const t=this.events.getMaxListeners();return(this.events.listenerCount("register_error")>=t||this.events.listenerCount("open")>=t)&&this.events.setMaxListeners(t+1),new Promise((n,i)=>{this.events.once("register_error",a=>{this.resetMaxListeners(),i(a)}),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{if(!this.disableProviderPing){const t=Ui({id:1,jsonrpc:"2.0",method:"test",params:[]});await B1(e,Object.assign(Object.assign({},k1),{body:t}))}this.onOpen()}catch(t){const n=this.parseError(t);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 t=typeof e.data=="string"?xo(e.data):e.data;this.events.emit("payload",t)}onError(e,t){const n=this.parseError(t),i=n.message||n.toString(),a=Wa(e,i);this.events.emit("payload",a)}parseError(e,t=this.url){return Bp(e,t,"HTTP")}resetMaxListeners(){this.events.getMaxListeners()>H1&&this.events.setMaxListeners(H1)}}const z1="error",V8="wss://relay.walletconnect.com",G8="wc",Y8="universal_provider",q1=`${G8}@2:${Y8}:`,J8="https://rpc.walletconnect.com/v1/",Bn={DEFAULT_CHAIN_CHANGED:"default_chain_changed"};var Mo=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Vu={exports:{}};/**
59
+ ***************************************************************************** */var Ou=function(r,e){return Ou=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)n.hasOwnProperty(i)&&(t[i]=n[i])},Ou(r,e)};function _6(r,e){Ou(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var $u=function(){return $u=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++){t=arguments[n];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e},$u.apply(this,arguments)};function E6(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(t[n[i]]=r[n[i]]);return t}function x6(r,e,t,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(r,e,t,n);else for(var u=r.length-1;u>=0;u--)(c=r[u])&&(a=(i<3?c(a):i>3?c(e,t,a):c(e,t))||a);return i>3&&a&&Object.defineProperty(e,t,a),a}function I6(r,e){return function(t,n){e(t,n,r)}}function D6(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)}function S6(r,e,t,n){function i(a){return a instanceof t?a:new t(function(c){c(a)})}return new(t||(t=Promise))(function(a,c){function u(m){try{h(n.next(m))}catch(w){c(w)}}function f(m){try{h(n.throw(m))}catch(w){c(w)}}function h(m){m.done?a(m.value):i(m.value).then(u,f)}h((n=n.apply(r,e||[])).next())})}function C6(r,e){var t={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,i,a,c;return c={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function u(h){return function(m){return f([h,m])}}function f(h){if(n)throw new TypeError("Generator is already executing.");for(;t;)try{if(n=1,i&&(a=h[0]&2?i.return:h[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,h[1])).done)return a;switch(i=0,a&&(h=[h[0]&2,a.value]),h[0]){case 0:case 1:a=h;break;case 4:return t.label++,{value:h[1],done:!1};case 5:t.label++,i=h[1],h=[0];continue;case 7:h=t.ops.pop(),t.trys.pop();continue;default:if(a=t.trys,!(a=a.length>0&&a[a.length-1])&&(h[0]===6||h[0]===2)){t=0;continue}if(h[0]===3&&(!a||h[1]>a[0]&&h[1]<a[3])){t.label=h[1];break}if(h[0]===6&&t.label<a[1]){t.label=a[1],a=h;break}if(a&&t.label<a[2]){t.label=a[2],t.ops.push(h);break}a[2]&&t.ops.pop(),t.trys.pop();continue}h=e.call(r,t)}catch(m){h=[6,m],i=0}finally{n=a=0}if(h[0]&5)throw h[1];return{value:h[0]?h[1]:void 0,done:!0}}}function O6(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}function $6(r,e){for(var t in r)t!=="default"&&!e.hasOwnProperty(t)&&(e[t]=r[t])}function Au(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],n=0;if(t)return t.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function qp(r,e){var t=typeof Symbol=="function"&&r[Symbol.iterator];if(!t)return r;var n=t.call(r),i,a=[],c;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)a.push(i.value)}catch(u){c={error:u}}finally{try{i&&!i.done&&(t=n.return)&&t.call(n)}finally{if(c)throw c.error}}return a}function A6(){for(var r=[],e=0;e<arguments.length;e++)r=r.concat(qp(arguments[e]));return r}function P6(){for(var r=0,e=0,t=arguments.length;e<t;e++)r+=arguments[e].length;for(var n=Array(r),i=0,e=0;e<t;e++)for(var a=arguments[e],c=0,u=a.length;c<u;c++,i++)n[i]=a[c];return n}function Po(r){return this instanceof Po?(this.v=r,this):new Po(r)}function T6(r,e,t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=t.apply(r,e||[]),i,a=[];return i={},c("next"),c("throw"),c("return"),i[Symbol.asyncIterator]=function(){return this},i;function c(y){n[y]&&(i[y]=function(x){return new Promise(function(S,P){a.push([y,x,S,P])>1||u(y,x)})})}function u(y,x){try{f(n[y](x))}catch(S){w(a[0][3],S)}}function f(y){y.value instanceof Po?Promise.resolve(y.value.v).then(h,m):w(a[0][2],y)}function h(y){u("next",y)}function m(y){u("throw",y)}function w(y,x){y(x),a.shift(),a.length&&u(a[0][0],a[0][1])}}function R6(r){var e,t;return e={},n("next"),n("throw",function(i){throw i}),n("return"),e[Symbol.iterator]=function(){return this},e;function n(i,a){e[i]=r[i]?function(c){return(t=!t)?{value:Po(r[i](c)),done:i==="return"}:a?a(c):c}:a}}function N6(r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=r[Symbol.asyncIterator],t;return e?e.call(r):(r=typeof Au=="function"?Au(r):r[Symbol.iterator](),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(a){t[a]=r[a]&&function(c){return new Promise(function(u,f){c=r[a](c),i(u,f,c.done,c.value)})}}function i(a,c,u,f){Promise.resolve(f).then(function(h){a({value:h,done:u})},c)}}function L6(r,e){return Object.defineProperty?Object.defineProperty(r,"raw",{value:e}):r.raw=e,r}function M6(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)Object.hasOwnProperty.call(r,t)&&(e[t]=r[t]);return e.default=r,e}function U6(r){return r&&r.__esModule?r:{default:r}}function j6(r,e){if(!e.has(r))throw new TypeError("attempted to get private field on non-instance");return e.get(r)}function F6(r,e,t){if(!e.has(r))throw new TypeError("attempted to set private field on non-instance");return e.set(r,t),t}var B6=Object.freeze({__proto__:null,__extends:_6,get __assign(){return $u},__rest:E6,__decorate:x6,__param:I6,__metadata:D6,__awaiter:S6,__generator:C6,__createBinding:O6,__exportStar:$6,__values:Au,__read:qp,__spread:A6,__spreadArrays:P6,__await:Po,__asyncGenerator:T6,__asyncDelegator:R6,__asyncValues:N6,__makeTemplateObject:L6,__importStar:M6,__importDefault:U6,__classPrivateFieldGet:j6,__classPrivateFieldSet:F6}),k6=Pi(B6),Nn={},zp;function q6(){if(zp)return Nn;zp=1,Object.defineProperty(Nn,"__esModule",{value:!0}),Nn.isBrowserCryptoAvailable=Nn.getSubtleCrypto=Nn.getBrowerCrypto=void 0;function r(){return yr?.crypto||yr?.msCrypto||{}}Nn.getBrowerCrypto=r;function e(){const n=r();return n.subtle||n.webkitSubtle}Nn.getSubtleCrypto=e;function t(){return!!r()&&!!e()}return Nn.isBrowserCryptoAvailable=t,Nn}var Ln={},Hp;function z6(){if(Hp)return Ln;Hp=1,Object.defineProperty(Ln,"__esModule",{value:!0}),Ln.isBrowser=Ln.isNode=Ln.isReactNative=void 0;function r(){return typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"}Ln.isReactNative=r;function e(){return typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.node<"u"}Ln.isNode=e;function t(){return!r()&&!e()}return Ln.isBrowser=t,Ln}(function(r){Object.defineProperty(r,"__esModule",{value:!0});const e=k6;e.__exportStar(q6(),r),e.__exportStar(z6(),r)})(kp);function Pu(r=3){const e=Date.now()*Math.pow(10,r),t=Math.floor(Math.random()*Math.pow(10,r));return e+t}function Wp(r=6){return BigInt(Pu(r))}function Ss(r,e,t){return{id:t||Pu(),jsonrpc:"2.0",method:r,params:e}}function za(r,e){return{id:r,jsonrpc:"2.0",result:e}}function Ha(r,e,t){return{id:r,jsonrpc:"2.0",error:H6(e,t)}}function H6(r,e){return typeof r>"u"?Fp(Up):(typeof r=="string"&&(r=Object.assign(Object.assign({},Fp(Cu)),{message:r})),typeof e<"u"&&(r.data=e),w6(r.code)&&(r=b6(r.code)),r)}class W6{}class K6 extends W6{constructor(){super()}}class V6 extends K6{constructor(e){super()}}const G6="^https?:",Y6="^wss?:";function J6(r){const e=r.match(new RegExp(/^\w+:/,"gi"));if(!(!e||!e.length))return e[0]}function Kp(r,e){const t=J6(r);return typeof t>"u"?!1:new RegExp(e).test(t)}function Vp(r){return Kp(r,G6)}function Gp(r){return Kp(r,Y6)}function Z6(r){return new RegExp("wss?://localhost(:d{2,5})?").test(r)}function Yp(r){return typeof r=="object"&&"id"in r&&"jsonrpc"in r&&r.jsonrpc==="2.0"}function Tu(r){return Yp(r)&&"method"in r}function Wa(r){return Yp(r)&&(Mn(r)||dn(r))}function Mn(r){return"result"in r}function dn(r){return"error"in r}class Un extends V6{constructor(e){super(e),this.events=new lr.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,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}off(e,t){this.events.off(e,t)}removeListener(e,t){this.events.removeListener(e,t)}async request(e,t){return this.requestStrict(Ss(e.method,e.params||[],e.id||Wp().toString()),t)}async requestStrict(e,t){return new Promise(async(n,i)=>{if(!this.connection.connected)try{await this.open()}catch(a){i(a)}this.events.on(`${e.id}`,a=>{dn(a)?i(a.error):n(a.result)});try{await this.connection.send(e,t)}catch(a){i(a)}})}setConnection(e=this.connection){return e}onPayload(e){this.events.emit("payload",e),Wa(e)?this.events.emit(`${e.id}`,e):this.events.emit("message",{type:e.method,data:e.params})}onClose(e){e&&e.code===3e3&&this.events.emit("error",new Error(`WebSocket connection closed abnormally with code: ${e.code} ${e.reason?`(${e.reason})`:""}`)),this.events.emit("disconnect")}async open(e=this.connection){this.connection===e&&this.connection.connected||(this.connection.connected&&this.close(),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",e=>this.onClose(e)),this.connection.on("error",e=>this.events.emit("error",e)),this.connection.on("register_error",e=>this.onClose()),this.hasRegisteredEventListeners=!0)}}const Q6=()=>typeof WebSocket<"u"?WebSocket:typeof global<"u"&&typeof global.WebSocket<"u"?global.WebSocket:typeof window<"u"&&typeof window.WebSocket<"u"?window.WebSocket:typeof self<"u"&&typeof self.WebSocket<"u"?self.WebSocket:require("ws"),X6=()=>typeof WebSocket<"u"||typeof global<"u"&&typeof global.WebSocket<"u"||typeof window<"u"&&typeof window.WebSocket<"u"||typeof self<"u"&&typeof self.WebSocket<"u",Jp=r=>r.split("?")[0],Zp=10,eE=Q6();class tE{constructor(e){if(this.url=e,this.events=new lr.exports.EventEmitter,this.registering=!1,!Gp(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,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}off(e,t){this.events.off(e,t)}removeListener(e,t){this.events.removeListener(e,t)}async open(e=this.url){await this.register(e)}async close(){return new Promise((e,t)=>{if(typeof this.socket>"u"){t(new Error("Connection already closed"));return}this.socket.onclose=n=>{this.onClose(n),e()},this.socket.close()})}async send(e){typeof this.socket>"u"&&(this.socket=await this.register());try{this.socket.send(ji(e))}catch(t){this.onError(e.id,t)}}register(e=this.url){if(!Gp(e))throw new Error(`Provided URL is not compatible with WebSocket connection: ${e}`);if(this.registering){const t=this.events.getMaxListeners();return(this.events.listenerCount("register_error")>=t||this.events.listenerCount("open")>=t)&&this.events.setMaxListeners(t+1),new Promise((n,i)=>{this.events.once("register_error",a=>{this.resetMaxListeners(),i(a)}),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((t,n)=>{const i=new URLSearchParams(e).get("origin"),a=kp.isReactNative()?{headers:{origin:i}}:{rejectUnauthorized:!Z6(e)},c=new eE(e,[],a);X6()?c.onerror=u=>{const f=u;n(this.emitError(f.error))}:c.on("error",u=>{n(this.emitError(u))}),c.onopen=()=>{this.onOpen(c),t(c)}})}onOpen(e){e.onmessage=t=>this.onPayload(t),e.onclose=t=>this.onClose(t),this.socket=e,this.registering=!1,this.events.emit("open")}onClose(e){this.socket=void 0,this.registering=!1,this.events.emit("close",e)}onPayload(e){if(typeof e.data>"u")return;const t=typeof e.data=="string"?Do(e.data):e.data;this.events.emit("payload",t)}onError(e,t){const n=this.parseError(t),i=n.message||n.toString(),a=Ha(e,i);this.events.emit("payload",a)}parseError(e,t=this.url){return Bp(e,Jp(t),"WS")}resetMaxListeners(){this.events.getMaxListeners()>Zp&&this.events.setMaxListeners(Zp)}emitError(e){const t=this.parseError(new Error(e?.message||`WebSocket connection failed for host: ${Jp(this.url)}`));return this.events.emit("register_error",t),t}}var Ru={exports:{}};(function(r,e){var t=200,n="__lodash_hash_undefined__",i=1,a=2,c=9007199254740991,u="[object Arguments]",f="[object Array]",h="[object AsyncFunction]",m="[object Boolean]",w="[object Date]",y="[object Error]",x="[object Function]",S="[object GeneratorFunction]",P="[object Map]",U="[object Number]",j="[object Null]",A="[object Object]",T="[object Promise]",C="[object Proxy]",$="[object RegExp]",E="[object Set]",d="[object String]",b="[object Symbol]",H="[object Undefined]",F="[object WeakMap]",V="[object ArrayBuffer]",se="[object DataView]",ce="[object Float32Array]",I="[object Float64Array]",N="[object Int8Array]",X="[object Int16Array]",ee="[object Int32Array]",Y="[object Uint8Array]",J="[object Uint8ClampedArray]",Q="[object Uint16Array]",ie="[object Uint32Array]",Ee=/[\\^$.*+?()[\]{}|]/g,ae=/^\[object .+?Constructor\]$/,xe=/^(?:0|[1-9]\d*)$/,de={};de[ce]=de[I]=de[N]=de[X]=de[ee]=de[Y]=de[J]=de[Q]=de[ie]=!0,de[u]=de[f]=de[V]=de[m]=de[se]=de[w]=de[y]=de[x]=de[P]=de[U]=de[A]=de[$]=de[E]=de[d]=de[F]=!1;var be=typeof yr=="object"&&yr&&yr.Object===Object&&yr,K=typeof self=="object"&&self&&self.Object===Object&&self,W=be||K||Function("return this")(),B=e&&!e.nodeType&&e,g=B&&!0&&r&&!r.nodeType&&r,L=g&&g.exports===B,le=L&&be.process,pe=function(){try{return le&&le.binding&&le.binding("util")}catch{}}(),Ce=pe&&pe.isTypedArray;function Ke(O,k){for(var ne=-1,ge=O==null?0:O.length,vt=0,Ne=[];++ne<ge;){var Et=O[ne];k(Et,ne,O)&&(Ne[vt++]=Et)}return Ne}function Je(O,k){for(var ne=-1,ge=k.length,vt=O.length;++ne<ge;)O[vt+ne]=k[ne];return O}function ke(O,k){for(var ne=-1,ge=O==null?0:O.length;++ne<ge;)if(k(O[ne],ne,O))return!0;return!1}function St(O,k){for(var ne=-1,ge=Array(O);++ne<O;)ge[ne]=k(ne);return ge}function Ct(O){return function(k){return O(k)}}function ze(O,k){return O.has(k)}function Oe(O,k){return O?.[k]}function Ue(O){var k=-1,ne=Array(O.size);return O.forEach(function(ge,vt){ne[++k]=[vt,ge]}),ne}function je(O,k){return function(ne){return O(k(ne))}}function He(O){var k=-1,ne=Array(O.size);return O.forEach(function(ge){ne[++k]=ge}),ne}var Ae=Array.prototype,Fe=Function.prototype,Se=Object.prototype,Te=W["__core-js_shared__"],Ve=Fe.toString,$e=Se.hasOwnProperty,Ze=function(){var O=/[^.]+$/.exec(Te&&Te.keys&&Te.keys.IE_PROTO||"");return O?"Symbol(src)_1."+O:""}(),et=Se.toString,at=RegExp("^"+Ve.call($e).replace(Ee,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ct=L?W.Buffer:void 0,nt=W.Symbol,Sr=W.Uint8Array,Ur=Se.propertyIsEnumerable,On=Ae.splice,Cr=nt?nt.toStringTag:void 0,Wn=Object.getOwnPropertySymbols,bi=ct?ct.isBuffer:void 0,rs=je(Object.keys,Object),Lt=Gr(W,"DataView"),Ot=Gr(W,"Map"),Mt=Gr(W,"Promise"),Ut=Gr(W,"Set"),Tt=Gr(W,"WeakMap"),$t=Gr(Object,"create"),Gt=Vn(Lt),Yt=Vn(Ot),jt=Vn(Mt),Jt=Vn(Ut),Ft=Vn(Tt),Ht=nt?nt.prototype:void 0,Bt=Ht?Ht.valueOf:void 0;function _t(O){var k=-1,ne=O==null?0:O.length;for(this.clear();++k<ne;){var ge=O[k];this.set(ge[0],ge[1])}}function Zt(){this.__data__=$t?$t(null):{},this.size=0}function Qt(O){var k=this.has(O)&&delete this.__data__[O];return this.size-=k?1:0,k}function lf(O){var k=this.__data__;if($t){var ne=k[O];return ne===n?void 0:ne}return $e.call(k,O)?k[O]:void 0}function uf(O){var k=this.__data__;return $t?k[O]!==void 0:$e.call(k,O)}function hf(O,k){var ne=this.__data__;return this.size+=this.has(O)?0:1,ne[O]=$t&&k===void 0?n:k,this}_t.prototype.clear=Zt,_t.prototype.delete=Qt,_t.prototype.get=lf,_t.prototype.has=uf,_t.prototype.set=hf;function rn(O){var k=-1,ne=O==null?0:O.length;for(this.clear();++k<ne;){var ge=O[k];this.set(ge[0],ge[1])}}function ff(){this.__data__=[],this.size=0}function df(O){var k=this.__data__,ne=ns(k,O);if(ne<0)return!1;var ge=k.length-1;return ne==ge?k.pop():On.call(k,ne,1),--this.size,!0}function pf(O){var k=this.__data__,ne=ns(k,O);return ne<0?void 0:k[ne][1]}function gf(O){return ns(this.__data__,O)>-1}function mf(O,k){var ne=this.__data__,ge=ns(ne,O);return ge<0?(++this.size,ne.push([O,k])):ne[ge][1]=k,this}rn.prototype.clear=ff,rn.prototype.delete=df,rn.prototype.get=pf,rn.prototype.has=gf,rn.prototype.set=mf;function Kn(O){var k=-1,ne=O==null?0:O.length;for(this.clear();++k<ne;){var ge=O[k];this.set(ge[0],ge[1])}}function Ks(){this.size=0,this.__data__={hash:new _t,map:new(Ot||rn),string:new _t}}function vf(O){var k=_i(this,O).delete(O);return this.size-=k?1:0,k}function Vs(O){return _i(this,O).get(O)}function yf(O){return _i(this,O).has(O)}function wf(O,k){var ne=_i(this,O),ge=ne.size;return ne.set(O,k),this.size+=ne.size==ge?0:1,this}Kn.prototype.clear=Ks,Kn.prototype.delete=vf,Kn.prototype.get=Vs,Kn.prototype.has=yf,Kn.prototype.set=wf;function Gs(O){var k=-1,ne=O==null?0:O.length;for(this.__data__=new Kn;++k<ne;)this.add(O[k])}function Cc(O){return this.__data__.set(O,n),this}function Oc(O){return this.__data__.has(O)}Gs.prototype.add=Gs.prototype.push=Cc,Gs.prototype.has=Oc;function gn(O){var k=this.__data__=new rn(O);this.size=k.size}function bf(){this.__data__=new rn,this.size=0}function _f(O){var k=this.__data__,ne=k.delete(O);return this.size=k.size,ne}function Ef(O){return this.__data__.get(O)}function xf(O){return this.__data__.has(O)}function $c(O,k){var ne=this.__data__;if(ne instanceof rn){var ge=ne.__data__;if(!Ot||ge.length<t-1)return ge.push([O,k]),this.size=++ne.size,this;ne=this.__data__=new Kn(ge)}return ne.set(O,k),this.size=ne.size,this}gn.prototype.clear=bf,gn.prototype.delete=_f,gn.prototype.get=Ef,gn.prototype.has=xf,gn.prototype.set=$c;function Ac(O,k){var ne=Zs(O),ge=!ne&&qc(O),vt=!ne&&!ge&&sa(O),Ne=!ne&&!ge&&!vt&&Wc(O),Et=ne||ge||vt||Ne,Xt=Et?St(O.length,String):[],it=Xt.length;for(var yt in O)(k||$e.call(O,yt))&&!(Et&&(yt=="length"||vt&&(yt=="offset"||yt=="parent")||Ne&&(yt=="buffer"||yt=="byteLength"||yt=="byteOffset")||Uc(yt,it)))&&Xt.push(yt);return Xt}function ns(O,k){for(var ne=O.length;ne--;)if(kc(O[ne][0],k))return ne;return-1}function na(O,k,ne){var ge=k(O);return Zs(O)?ge:Je(ge,ne(O))}function is(O){return O==null?O===void 0?H:j:Cr&&Cr in Object(O)?Lc(O):Sf(O)}function ia(O){return os(O)&&is(O)==u}function ss(O,k,ne,ge,vt){return O===k?!0:O==null||k==null||!os(O)&&!os(k)?O!==O&&k!==k:Pc(O,k,ne,ge,ss,vt)}function Pc(O,k,ne,ge,vt,Ne){var Et=Zs(O),Xt=Zs(k),it=Et?f:$n(O),yt=Xt?f:$n(k);it=it==u?A:it,yt=yt==u?A:yt;var Wt=it==A,jr=yt==A,er=it==yt;if(er&&sa(O)){if(!sa(k))return!1;Et=!0,Wt=!1}if(er&&!Wt)return Ne||(Ne=new gn),Et||Wc(O)?Ys(O,k,ne,ge,vt,Ne):Df(O,k,it,ne,ge,vt,Ne);if(!(ne&i)){var xt=Wt&&$e.call(O,"__wrapped__"),Or=jr&&$e.call(k,"__wrapped__");if(xt||Or){var mn=xt?O.value():O,nn=Or?k.value():k;return Ne||(Ne=new gn),vt(mn,nn,ne,ge,Ne)}}return er?(Ne||(Ne=new gn),Nc(O,k,ne,ge,vt,Ne)):!1}function If(O){if(!Hc(O)||Fc(O))return!1;var k=Qs(O)?at:ae;return k.test(Vn(O))}function Tc(O){return os(O)&&zc(O.length)&&!!de[is(O)]}function Rc(O){if(!Bc(O))return rs(O);var k=[];for(var ne in Object(O))$e.call(O,ne)&&ne!="constructor"&&k.push(ne);return k}function Ys(O,k,ne,ge,vt,Ne){var Et=ne&i,Xt=O.length,it=k.length;if(Xt!=it&&!(Et&&it>Xt))return!1;var yt=Ne.get(O);if(yt&&Ne.get(k))return yt==k;var Wt=-1,jr=!0,er=ne&a?new Gs:void 0;for(Ne.set(O,k),Ne.set(k,O);++Wt<Xt;){var xt=O[Wt],Or=k[Wt];if(ge)var mn=Et?ge(Or,xt,Wt,k,O,Ne):ge(xt,Or,Wt,O,k,Ne);if(mn!==void 0){if(mn)continue;jr=!1;break}if(er){if(!ke(k,function(nn,An){if(!ze(er,An)&&(xt===nn||vt(xt,nn,ne,ge,Ne)))return er.push(An)})){jr=!1;break}}else if(!(xt===Or||vt(xt,Or,ne,ge,Ne))){jr=!1;break}}return Ne.delete(O),Ne.delete(k),jr}function Df(O,k,ne,ge,vt,Ne,Et){switch(ne){case se:if(O.byteLength!=k.byteLength||O.byteOffset!=k.byteOffset)return!1;O=O.buffer,k=k.buffer;case V:return!(O.byteLength!=k.byteLength||!Ne(new Sr(O),new Sr(k)));case m:case w:case U:return kc(+O,+k);case y:return O.name==k.name&&O.message==k.message;case $:case d:return O==k+"";case P:var Xt=Ue;case E:var it=ge&i;if(Xt||(Xt=He),O.size!=k.size&&!it)return!1;var yt=Et.get(O);if(yt)return yt==k;ge|=a,Et.set(O,k);var Wt=Ys(Xt(O),Xt(k),ge,vt,Ne,Et);return Et.delete(O),Wt;case b:if(Bt)return Bt.call(O)==Bt.call(k)}return!1}function Nc(O,k,ne,ge,vt,Ne){var Et=ne&i,Xt=Js(O),it=Xt.length,yt=Js(k),Wt=yt.length;if(it!=Wt&&!Et)return!1;for(var jr=it;jr--;){var er=Xt[jr];if(!(Et?er in k:$e.call(k,er)))return!1}var xt=Ne.get(O);if(xt&&Ne.get(k))return xt==k;var Or=!0;Ne.set(O,k),Ne.set(k,O);for(var mn=Et;++jr<it;){er=Xt[jr];var nn=O[er],An=k[er];if(ge)var oa=Et?ge(An,nn,er,k,O,Ne):ge(nn,An,er,O,k,Ne);if(!(oa===void 0?nn===An||vt(nn,An,ne,ge,Ne):oa)){Or=!1;break}mn||(mn=er=="constructor")}if(Or&&!mn){var as=O.constructor,ar=k.constructor;as!=ar&&"constructor"in O&&"constructor"in k&&!(typeof as=="function"&&as instanceof as&&typeof ar=="function"&&ar instanceof ar)&&(Or=!1)}return Ne.delete(O),Ne.delete(k),Or}function Js(O){return na(O,$f,Mc)}function _i(O,k){var ne=O.__data__;return jc(k)?ne[typeof k=="string"?"string":"hash"]:ne.map}function Gr(O,k){var ne=Oe(O,k);return If(ne)?ne:void 0}function Lc(O){var k=$e.call(O,Cr),ne=O[Cr];try{O[Cr]=void 0;var ge=!0}catch{}var vt=et.call(O);return ge&&(k?O[Cr]=ne:delete O[Cr]),vt}var Mc=Wn?function(O){return O==null?[]:(O=Object(O),Ke(Wn(O),function(k){return Ur.call(O,k)}))}:mt,$n=is;(Lt&&$n(new Lt(new ArrayBuffer(1)))!=se||Ot&&$n(new Ot)!=P||Mt&&$n(Mt.resolve())!=T||Ut&&$n(new Ut)!=E||Tt&&$n(new Tt)!=F)&&($n=function(O){var k=is(O),ne=k==A?O.constructor:void 0,ge=ne?Vn(ne):"";if(ge)switch(ge){case Gt:return se;case Yt:return P;case jt:return T;case Jt:return E;case Ft:return F}return k});function Uc(O,k){return k=k??c,!!k&&(typeof O=="number"||xe.test(O))&&O>-1&&O%1==0&&O<k}function jc(O){var k=typeof O;return k=="string"||k=="number"||k=="symbol"||k=="boolean"?O!=="__proto__":O===null}function Fc(O){return!!Ze&&Ze in O}function Bc(O){var k=O&&O.constructor,ne=typeof k=="function"&&k.prototype||Se;return O===ne}function Sf(O){return et.call(O)}function Vn(O){if(O!=null){try{return Ve.call(O)}catch{}try{return O+""}catch{}}return""}function kc(O,k){return O===k||O!==O&&k!==k}var qc=ia(function(){return arguments}())?ia:function(O){return os(O)&&$e.call(O,"callee")&&!Ur.call(O,"callee")},Zs=Array.isArray;function Cf(O){return O!=null&&zc(O.length)&&!Qs(O)}var sa=bi||gt;function Of(O,k){return ss(O,k)}function Qs(O){if(!Hc(O))return!1;var k=is(O);return k==x||k==S||k==h||k==C}function zc(O){return typeof O=="number"&&O>-1&&O%1==0&&O<=c}function Hc(O){var k=typeof O;return O!=null&&(k=="object"||k=="function")}function os(O){return O!=null&&typeof O=="object"}var Wc=Ce?Ct(Ce):Tc;function $f(O){return Cf(O)?Ac(O):Rc(O)}function mt(){return[]}function gt(){return!1}r.exports=Of})(Ru,Ru.exports);var rE=Ru.exports;function nE(r,e){return e=e||{},new Promise(function(t,n){var i=new XMLHttpRequest,a=[],c=[],u={},f=function(){return{ok:(i.status/100|0)==2,statusText:i.statusText,status:i.status,url:i.responseURL,text:function(){return Promise.resolve(i.responseText)},json:function(){return Promise.resolve(i.responseText).then(JSON.parse)},blob:function(){return Promise.resolve(new Blob([i.response]))},clone:f,headers:{keys:function(){return a},entries:function(){return c},get:function(m){return u[m.toLowerCase()]},has:function(m){return m.toLowerCase()in u}}}};for(var h in i.open(e.method||"get",r,!0),i.onload=function(){i.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,function(m,w,y){a.push(w=w.toLowerCase()),c.push([w,y]),u[w]=u[w]?u[w]+","+y:y}),t(f())},i.onerror=n,i.withCredentials=e.credentials=="include",e.headers)i.setRequestHeader(h,e.headers[h]);i.send(e.body||null)})}var iE=Object.freeze({__proto__:null,default:nE}),Qp=Pi(iE),sE=self.fetch||(self.fetch=Qp.default||Qp),oE=Object.defineProperty,Xp=Object.getOwnPropertySymbols,aE=Object.prototype.hasOwnProperty,cE=Object.prototype.propertyIsEnumerable,e1=(r,e,t)=>e in r?oE(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,xr=(r,e)=>{for(var t in e||(e={}))aE.call(e,t)&&e1(r,t,e[t]);if(Xp)for(var t of Xp(e))cE.call(e,t)&&e1(r,t,e[t]);return r};function lE(r,e){if(r.length>=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),n=0;n<t.length;n++)t[n]=255;for(var i=0;i<r.length;i++){var a=r.charAt(i),c=a.charCodeAt(0);if(t[c]!==255)throw new TypeError(a+" is ambiguous");t[c]=i}var u=r.length,f=r.charAt(0),h=Math.log(u)/Math.log(256),m=Math.log(256)/Math.log(u);function w(S){if(S instanceof Uint8Array||(ArrayBuffer.isView(S)?S=new Uint8Array(S.buffer,S.byteOffset,S.byteLength):Array.isArray(S)&&(S=Uint8Array.from(S))),!(S instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(S.length===0)return"";for(var P=0,U=0,j=0,A=S.length;j!==A&&S[j]===0;)j++,P++;for(var T=(A-j)*m+1>>>0,C=new Uint8Array(T);j!==A;){for(var $=S[j],E=0,d=T-1;($!==0||E<U)&&d!==-1;d--,E++)$+=256*C[d]>>>0,C[d]=$%u>>>0,$=$/u>>>0;if($!==0)throw new Error("Non-zero carry");U=E,j++}for(var b=T-U;b!==T&&C[b]===0;)b++;for(var H=f.repeat(P);b<T;++b)H+=r.charAt(C[b]);return H}function y(S){if(typeof S!="string")throw new TypeError("Expected String");if(S.length===0)return new Uint8Array;var P=0;if(S[P]!==" "){for(var U=0,j=0;S[P]===f;)U++,P++;for(var A=(S.length-P)*h+1>>>0,T=new Uint8Array(A);S[P];){var C=t[S.charCodeAt(P)];if(C===255)return;for(var $=0,E=A-1;(C!==0||$<j)&&E!==-1;E--,$++)C+=u*T[E]>>>0,T[E]=C%256>>>0,C=C/256>>>0;if(C!==0)throw new Error("Non-zero carry");j=$,P++}if(S[P]!==" "){for(var d=A-j;d!==A&&T[d]===0;)d++;for(var b=new Uint8Array(U+(A-d)),H=U;d!==A;)b[H++]=T[d++];return b}}}function x(S){var P=y(S);if(P)return P;throw new Error(`Non-${e} character`)}return{encode:w,decodeUnsafe:y,decode:x}}var uE=lE,hE=uE;const t1=r=>{if(r instanceof Uint8Array&&r.constructor.name==="Uint8Array")return r;if(r instanceof ArrayBuffer)return new Uint8Array(r);if(ArrayBuffer.isView(r))return new Uint8Array(r.buffer,r.byteOffset,r.byteLength);throw new Error("Unknown type, must be binary type")},fE=r=>new TextEncoder().encode(r),dE=r=>new TextDecoder().decode(r);class pE{constructor(e,t,n){this.name=e,this.prefix=t,this.baseEncode=n}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}}class gE{constructor(e,t,n){if(this.name=e,this.prefix=t,t.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=t.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 r1(this,e)}}class mE{constructor(e){this.decoders=e}or(e){return r1(this,e)}decode(e){const t=e[0],n=this.decoders[t];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 r1=(r,e)=>new mE(xr(xr({},r.decoders||{[r.prefix]:r}),e.decoders||{[e.prefix]:e}));class vE{constructor(e,t,n,i){this.name=e,this.prefix=t,this.baseEncode=n,this.baseDecode=i,this.encoder=new pE(e,t,n),this.decoder=new gE(e,t,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}const Ka=({name:r,prefix:e,encode:t,decode:n})=>new vE(r,e,t,n),To=({prefix:r,name:e,alphabet:t})=>{const{encode:n,decode:i}=hE(t,e);return Ka({prefix:r,name:e,encode:n,decode:a=>t1(i(a))})},yE=(r,e,t,n)=>{const i={};for(let m=0;m<e.length;++m)i[e[m]]=m;let a=r.length;for(;r[a-1]==="=";)--a;const c=new Uint8Array(a*t/8|0);let u=0,f=0,h=0;for(let m=0;m<a;++m){const w=i[r[m]];if(w===void 0)throw new SyntaxError(`Non-${n} character`);f=f<<t|w,u+=t,u>=8&&(u-=8,c[h++]=255&f>>u)}if(u>=t||255&f<<8-u)throw new SyntaxError("Unexpected end of data");return c},wE=(r,e,t)=>{const n=e[e.length-1]==="=",i=(1<<t)-1;let a="",c=0,u=0;for(let f=0;f<r.length;++f)for(u=u<<8|r[f],c+=8;c>t;)c-=t,a+=e[i&u>>c];if(c&&(a+=e[i&u<<t-c]),n)for(;a.length*t&7;)a+="=";return a},hr=({name:r,prefix:e,bitsPerChar:t,alphabet:n})=>Ka({prefix:e,name:r,encode(i){return wE(i,n,t)},decode(i){return yE(i,n,t,r)}}),bE=Ka({prefix:"\0",name:"identity",encode:r=>dE(r),decode:r=>fE(r)});var _E=Object.freeze({__proto__:null,identity:bE});const EE=hr({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var xE=Object.freeze({__proto__:null,base2:EE});const IE=hr({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var DE=Object.freeze({__proto__:null,base8:IE});const SE=To({prefix:"9",name:"base10",alphabet:"0123456789"});var CE=Object.freeze({__proto__:null,base10:SE});const OE=hr({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),$E=hr({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var AE=Object.freeze({__proto__:null,base16:OE,base16upper:$E});const PE=hr({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),TE=hr({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),RE=hr({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),NE=hr({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),LE=hr({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),ME=hr({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),UE=hr({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),jE=hr({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),FE=hr({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var BE=Object.freeze({__proto__:null,base32:PE,base32upper:TE,base32pad:RE,base32padupper:NE,base32hex:LE,base32hexupper:ME,base32hexpad:UE,base32hexpadupper:jE,base32z:FE});const kE=To({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),qE=To({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var zE=Object.freeze({__proto__:null,base36:kE,base36upper:qE});const HE=To({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),WE=To({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var KE=Object.freeze({__proto__:null,base58btc:HE,base58flickr:WE});const VE=hr({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),GE=hr({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),YE=hr({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),JE=hr({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var ZE=Object.freeze({__proto__:null,base64:VE,base64pad:GE,base64url:YE,base64urlpad:JE});const n1=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}"),QE=n1.reduce((r,e,t)=>(r[t]=e,r),[]),XE=n1.reduce((r,e,t)=>(r[e.codePointAt(0)]=t,r),[]);function e4(r){return r.reduce((e,t)=>(e+=QE[t],e),"")}function t4(r){const e=[];for(const t of r){const n=XE[t.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${t}`);e.push(n)}return new Uint8Array(e)}const r4=Ka({prefix:"\u{1F680}",name:"base256emoji",encode:e4,decode:t4});var n4=Object.freeze({__proto__:null,base256emoji:r4}),i4=s1,i1=128,s4=127,o4=~s4,a4=Math.pow(2,31);function s1(r,e,t){e=e||[],t=t||0;for(var n=t;r>=a4;)e[t++]=r&255|i1,r/=128;for(;r&o4;)e[t++]=r&255|i1,r>>>=7;return e[t]=r|0,s1.bytes=t-n+1,e}var c4=Nu,l4=128,o1=127;function Nu(r,n){var t=0,n=n||0,i=0,a=n,c,u=r.length;do{if(a>=u)throw Nu.bytes=0,new RangeError("Could not decode varint");c=r[a++],t+=i<28?(c&o1)<<i:(c&o1)*Math.pow(2,i),i+=7}while(c>=l4);return Nu.bytes=a-n,t}var u4=Math.pow(2,7),h4=Math.pow(2,14),f4=Math.pow(2,21),d4=Math.pow(2,28),p4=Math.pow(2,35),g4=Math.pow(2,42),m4=Math.pow(2,49),v4=Math.pow(2,56),y4=Math.pow(2,63),w4=function(r){return r<u4?1:r<h4?2:r<f4?3:r<d4?4:r<p4?5:r<g4?6:r<m4?7:r<v4?8:r<y4?9:10},b4={encode:i4,decode:c4,encodingLength:w4},a1=b4;const c1=(r,e,t=0)=>(a1.encode(r,e,t),e),l1=r=>a1.encodingLength(r),Lu=(r,e)=>{const t=e.byteLength,n=l1(r),i=n+l1(t),a=new Uint8Array(i+t);return c1(r,a,0),c1(t,a,n),a.set(e,i),new _4(r,t,e,a)};class _4{constructor(e,t,n,i){this.code=e,this.size=t,this.digest=n,this.bytes=i}}const u1=({name:r,code:e,encode:t})=>new E4(r,e,t);class E4{constructor(e,t,n){this.name=e,this.code=t,this.encode=n}digest(e){if(e instanceof Uint8Array){const t=this.encode(e);return t instanceof Uint8Array?Lu(this.code,t):t.then(n=>Lu(this.code,n))}else throw Error("Unknown type, must be binary type")}}const h1=r=>async e=>new Uint8Array(await crypto.subtle.digest(r,e)),x4=u1({name:"sha2-256",code:18,encode:h1("SHA-256")}),I4=u1({name:"sha2-512",code:19,encode:h1("SHA-512")});var D4=Object.freeze({__proto__:null,sha256:x4,sha512:I4});const f1=0,S4="identity",d1=t1;var C4=Object.freeze({__proto__:null,identity:{code:f1,name:S4,encode:d1,digest:r=>Lu(f1,d1(r))}});new TextEncoder,new TextDecoder;const p1=xr(xr(xr(xr(xr(xr(xr(xr(xr(xr({},_E),xE),DE),CE),AE),BE),zE),KE),ZE),n4);xr(xr({},D4),C4);function g1(r){return globalThis.Buffer!=null?new Uint8Array(r.buffer,r.byteOffset,r.byteLength):r}function O4(r=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?g1(globalThis.Buffer.allocUnsafe(r)):new Uint8Array(r)}function m1(r,e,t,n){return{name:r,prefix:e,encoder:{name:r,prefix:e,encode:t},decoder:{decode:n}}}const v1=m1("utf8","u",r=>"u"+new TextDecoder("utf8").decode(r),r=>new TextEncoder().encode(r.substring(1))),Mu=m1("ascii","a",r=>{let e="a";for(let t=0;t<r.length;t++)e+=String.fromCharCode(r[t]);return e},r=>{r=r.substring(1);const e=O4(r.length);for(let t=0;t<r.length;t++)e[t]=r.charCodeAt(t);return e}),$4=xr({utf8:v1,"utf-8":v1,hex:p1.base16,latin1:Mu,ascii:Mu,binary:Mu},p1);function A4(r,e="utf8"){const t=$4[e];if(!t)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?g1(globalThis.Buffer.from(r,"utf-8")):t.decoder.decode(`${t.prefix}${r}`)}const y1="wc",P4=2,Uu="core",si=`${y1}@2:${Uu}:`,T4={name:Uu,logger:"error"},R4={database:":memory:"},N4="crypto",w1="client_ed25519_seed",L4=ye.ONE_DAY,M4="keychain",U4="0.3",j4="messages",F4="0.3",B4=ye.SIX_HOURS,k4="publisher",b1="irn",q4="error",_1="wss://relay.walletconnect.com",E1="wss://relay.walletconnect.org",z4="relayer",pr={message:"relayer_message",message_ack:"relayer_message_ack",connect:"relayer_connect",disconnect:"relayer_disconnect",error:"relayer_error",connection_stalled:"relayer_connection_stalled",transport_closed:"relayer_transport_closed",publish:"relayer_publish"},H4="_subscription",jn={payload:"payload",connect:"connect",disconnect:"disconnect",error:"error"},W4=ye.ONE_SECOND,K4="2.11.1",V4=1e4,G4="0.3",Y4="WALLETCONNECT_CLIENT_ID",pn={created:"subscription_created",deleted:"subscription_deleted",expired:"subscription_expired",disabled:"subscription_disabled",sync:"subscription_sync",resubscribed:"subscription_resubscribed"},J4="subscription",Z4="0.3",Q4=ye.FIVE_SECONDS*1e3,X4="pairing",e8="0.3",Ro={wc_pairingDelete:{req:{ttl:ye.ONE_DAY,prompt:!1,tag:1e3},res:{ttl:ye.ONE_DAY,prompt:!1,tag:1001}},wc_pairingPing:{req:{ttl:ye.THIRTY_SECONDS,prompt:!1,tag:1002},res:{ttl:ye.THIRTY_SECONDS,prompt:!1,tag:1003}},unregistered_method:{req:{ttl:ye.ONE_DAY,prompt:!1,tag:0},res:{ttl:ye.ONE_DAY,prompt:!1,tag:0}}},No={create:"pairing_create",expire:"pairing_expire",delete:"pairing_delete",ping:"pairing_ping"},xn={created:"history_created",updated:"history_updated",deleted:"history_deleted",sync:"history_sync"},t8="history",r8="0.3",n8="expirer",en={created:"expirer_created",deleted:"expirer_deleted",expired:"expirer_expired",sync:"expirer_sync"},i8="0.3",ju="verify-api",Cs="https://verify.walletconnect.com",Fu="https://verify.walletconnect.org",s8=[Cs,Fu],o8="echo",a8="https://echo.walletconnect.com";class c8{constructor(e,t){this.core=e,this.logger=t,this.keychain=new Map,this.name=M4,this.version=U4,this.initialized=!1,this.storagePrefix=si,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:a}=ue("NO_MATCHING_KEY",`${this.name}: ${n}`);throw new Error(a)}return i},this.del=async n=>{this.isInitialized(),this.keychain.delete(n),await this.persist()},this.core=e,this.logger=Xe.generateChildLogger(t,this.name)}get context(){return Xe.getLoggerContext(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}async setKeyChain(e){await this.core.storage.setItem(this.storageKey,Z0(e))}async getKeyChain(){const e=await this.core.storage.getItem(this.storageKey);return typeof e<"u"?Q0(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 l8{constructor(e,t,n){this.core=e,this.logger=t,this.name=N4,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(),a=Mp(i);return Lp(a.publicKey)},this.generateKeyPair=()=>{this.isInitialized();const i=X2();return this.setPrivateKey(i.publicKey,i.privateKey)},this.signJWT=async i=>{this.isInitialized();const a=await this.getClientSeed(),c=Mp(a),u=su();return await d6(u,i,L4,c)},this.generateSharedKey=(i,a,c)=>{this.isInitialized();const u=this.getPrivateKey(i),f=e_(u,a);return this.setSymKey(f,c)},this.setSymKey=async(i,a)=>{this.isInitialized();const c=a||t_(i);return await this.keychain.set(c,i),c},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,a,c)=>{this.isInitialized();const u=K0(c),f=ji(a);if(V0(u)){const y=u.senderPublicKey,x=u.receiverPublicKey;i=await this.generateSharedKey(y,x)}const h=this.getSymKey(i),{type:m,senderPublicKey:w}=u;return n_({type:m,symKey:h,message:f,senderPublicKey:w})},this.decode=async(i,a,c)=>{this.isInitialized();const u=o_(a,c);if(V0(u)){const f=u.receiverPublicKey,h=u.senderPublicKey;i=await this.generateSharedKey(f,h)}try{const f=this.getSymKey(i),h=i_({symKey:f,encoded:a});return Do(h)}catch(f){this.logger.error(`Failed to decode message from topic: '${i}', clientId: '${await this.getClientId()}'`),this.logger.error(f)}},this.getPayloadType=i=>{const a=Ra(i);return wo(a.type)},this.getPayloadSenderPublicKey=i=>{const a=Ra(i);return a.senderPublicKey?wr(a.senderPublicKey,br):void 0},this.core=e,this.logger=Xe.generateChildLogger(t,this.name),this.keychain=n||new c8(this.core,this.logger)}get context(){return Xe.getLoggerContext(this.logger)}async setPrivateKey(e,t){return await this.keychain.set(e,t),e}getPrivateKey(e){return this.keychain.get(e)}async getClientSeed(){let e="";try{e=this.keychain.get(w1)}catch{e=su(),await this.keychain.set(w1,e)}return A4(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 u8 extends H5{constructor(e,t){super(e,t),this.logger=e,this.core=t,this.messages=new Map,this.name=j4,this.version=F4,this.initialized=!1,this.storagePrefix=si,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 a=bs(i);let c=this.messages.get(n);return typeof c>"u"&&(c={}),typeof c[a]<"u"||(c[a]=i,this.messages.set(n,c),await this.persist()),a},this.get=n=>{this.isInitialized();let i=this.messages.get(n);return typeof i>"u"&&(i={}),i},this.has=(n,i)=>{this.isInitialized();const a=this.get(n),c=bs(i);return typeof a[c]<"u"},this.del=async n=>{this.isInitialized(),this.messages.delete(n),await this.persist()},this.logger=Xe.generateChildLogger(e,this.name),this.core=t}get context(){return Xe.getLoggerContext(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}async setRelayerMessages(e){await this.core.storage.setItem(this.storageKey,Z0(e))}async getRelayerMessages(){const e=await this.core.storage.getItem(this.storageKey);return typeof e<"u"?Q0(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 h8 extends W5{constructor(e,t){super(e,t),this.relayer=e,this.logger=t,this.events=new lr.exports.EventEmitter,this.name=k4,this.queue=new Map,this.publishTimeout=ye.toMiliseconds(ye.TEN_SECONDS*2),this.needsTransportRestart=!1,this.publish=async(n,i,a)=>{var c;this.logger.debug("Publishing Payload"),this.logger.trace({type:"method",method:"publish",params:{topic:n,message:i,opts:a}});try{const u=a?.ttl||B4,f=cu(a),h=a?.prompt||!1,m=a?.tag||0,w=a?.id||Wp().toString(),y={topic:n,message:i,opts:{ttl:u,relay:f,prompt:h,tag:m,id:w}},x=setTimeout(()=>this.queue.set(w,y),this.publishTimeout);try{await await _o(this.rpcPublish(n,i,u,f,h,m,w),this.publishTimeout,`Failed to publish payload, please try again. id:${w} tag:${m}`),this.removeRequestFromQueue(w),this.relayer.events.emit(pr.publish,y)}catch(S){if(this.logger.debug("Publishing Payload stalled"),this.needsTransportRestart=!0,(c=a?.internal)!=null&&c.throwOnFailedPublish)throw this.removeRequestFromQueue(w),S;return}finally{clearTimeout(x)}this.logger.debug("Successfully Published Payload"),this.logger.trace({type:"method",method:"publish",params:{topic:n,message:i,opts:a}})}catch(u){throw this.logger.debug("Failed to Publish Payload"),this.logger.error(u),u}},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=Xe.generateChildLogger(t,this.name),this.registerEventListeners()}get context(){return Xe.getLoggerContext(this.logger)}rpcPublish(e,t,n,i,a,c,u){var f,h,m,w;const y={method:Na(i.protocol).publish,params:{topic:e,message:t,ttl:n,prompt:a,tag:c},id:u};return _r((f=y.params)==null?void 0:f.prompt)&&((h=y.params)==null||delete h.prompt),_r((m=y.params)==null?void 0:m.tag)&&((w=y.params)==null||delete w.tag),this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"message",direction:"outgoing",request:y}),this.relayer.request(y)}removeRequestFromQueue(e){this.queue.delete(e)}checkQueue(){this.queue.forEach(async e=>{const{topic:t,message:n,opts:i}=e;await this.publish(t,n,i)})}registerEventListeners(){this.relayer.core.heartbeat.on(Ds.HEARTBEAT_EVENTS.pulse,()=>{if(this.needsTransportRestart){this.needsTransportRestart=!1,this.relayer.events.emit(pr.connection_stalled);return}this.checkQueue()}),this.relayer.on(pr.message_ack,e=>{this.removeRequestFromQueue(e.id.toString())})}}class f8{constructor(){this.map=new Map,this.set=(e,t)=>{const n=this.get(e);this.exists(e,t)||this.map.set(e,[...n,t])},this.get=e=>this.map.get(e)||[],this.exists=(e,t)=>this.get(e).includes(t),this.delete=(e,t)=>{if(typeof t>"u"){this.map.delete(e);return}if(!this.map.has(e))return;const n=this.get(e);if(!this.exists(e,t))return;const i=n.filter(a=>a!==t);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 d8=Object.defineProperty,p8=Object.defineProperties,g8=Object.getOwnPropertyDescriptors,x1=Object.getOwnPropertySymbols,m8=Object.prototype.hasOwnProperty,v8=Object.prototype.propertyIsEnumerable,I1=(r,e,t)=>e in r?d8(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,Lo=(r,e)=>{for(var t in e||(e={}))m8.call(e,t)&&I1(r,t,e[t]);if(x1)for(var t of x1(e))v8.call(e,t)&&I1(r,t,e[t]);return r},Bu=(r,e)=>p8(r,g8(e));class y8 extends G5{constructor(e,t){super(e,t),this.relayer=e,this.logger=t,this.subscriptions=new Map,this.topicMap=new f8,this.events=new lr.exports.EventEmitter,this.name=J4,this.version=Z4,this.pending=new Map,this.cached=[],this.initialized=!1,this.pendingSubscriptionWatchLabel="pending_sub_watch_label",this.pollingInterval=20,this.storagePrefix=si,this.subscribeTimeout=1e4,this.restartInProgress=!1,this.batchSubscribeTopicsLimit=500,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),this.registerEventListeners(),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 a=cu(i),c={topic:n,relay:a};this.pending.set(n,c);const u=await this.rpcSubscribe(n,a);return this.onSubscribe(u,c),this.logger.debug("Successfully Subscribed Topic"),this.logger.trace({type:"method",method:"subscribe",params:{topic:n,opts:i}}),u}catch(a){throw this.logger.debug("Failed to Subscribe Topic"),this.logger.error(a),a}},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=>{if(this.topics.includes(n))return!0;const i=`${this.pendingSubscriptionWatchLabel}_${n}`;return await new Promise((a,c)=>{const u=new ye.Watch;u.start(i);const f=setInterval(()=>{!this.pending.has(n)&&this.topics.includes(n)&&(clearInterval(f),u.stop(i),a(!0)),u.elapsed(i)>=Q4&&(clearInterval(f),u.stop(i),c(new Error("Subscription resolution timeout")))},this.pollingInterval)}).catch(()=>!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.restart=async()=>{this.restartInProgress=!0,await this.restore(),await this.reset(),this.restartInProgress=!1},this.relayer=e,this.logger=Xe.generateChildLogger(t,this.name),this.clientId=""}get context(){return Xe.getLoggerContext(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.relayer.core.customStoragePrefix+"//"+this.name}get length(){return this.subscriptions.size}get ids(){return Array.from(this.subscriptions.keys())}get values(){return Array.from(this.subscriptions.values())}get topics(){return this.topicMap.topics}hasSubscription(e,t){let n=!1;try{n=this.getSubscription(e).topic===t}catch{}return n}onEnable(){this.cached=[],this.initialized=!0}onDisable(){this.cached=this.values,this.subscriptions.clear(),this.topicMap.clear()}async unsubscribeByTopic(e,t){const n=this.topicMap.get(e);await Promise.all(n.map(async i=>await this.unsubscribeById(e,i,t)))}async unsubscribeById(e,t,n){this.logger.debug("Unsubscribing Topic"),this.logger.trace({type:"method",method:"unsubscribe",params:{topic:e,id:t,opts:n}});try{const i=cu(n);await this.rpcUnsubscribe(e,t,i);const a=It("USER_DISCONNECTED",`${this.name}, ${e}`);await this.onUnsubscribe(e,t,a),this.logger.debug("Successfully Unsubscribed Topic"),this.logger.trace({type:"method",method:"unsubscribe",params:{topic:e,id:t,opts:n}})}catch(i){throw this.logger.debug("Failed to Unsubscribe Topic"),this.logger.error(i),i}}async rpcSubscribe(e,t){const n={method:Na(t.protocol).subscribe,params:{topic:e}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:n});try{await await _o(this.relayer.request(n),this.subscribeTimeout)}catch{this.logger.debug("Outgoing Relay Subscribe Payload stalled"),this.relayer.events.emit(pr.connection_stalled)}return bs(e+this.clientId)}async rpcBatchSubscribe(e){if(!e.length)return;const t=e[0].relay,n={method:Na(t.protocol).batchSubscribe,params:{topics:e.map(i=>i.topic)}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:n});try{return await await _o(this.relayer.request(n),this.subscribeTimeout)}catch{this.logger.debug("Outgoing Relay Payload stalled"),this.relayer.events.emit(pr.connection_stalled)}}rpcUnsubscribe(e,t,n){const i={method:Na(n.protocol).unsubscribe,params:{topic:e,id:t}};return this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:i}),this.relayer.request(i)}onSubscribe(e,t){this.setSubscription(e,Bu(Lo({},t),{id:e})),this.pending.delete(t.topic)}onBatchSubscribe(e){e.length&&e.forEach(t=>{this.setSubscription(t.id,Lo({},t)),this.pending.delete(t.topic)})}async onUnsubscribe(e,t,n){this.events.removeAllListeners(t),this.hasSubscription(t,e)&&this.deleteSubscription(t,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,t){this.subscriptions.has(e)||(this.logger.debug("Setting subscription"),this.logger.trace({type:"method",method:"setSubscription",id:e,subscription:t}),this.addSubscription(e,t))}addSubscription(e,t){this.subscriptions.set(e,Lo({},t)),this.topicMap.set(t.topic,e),this.events.emit(pn.created,t)}getSubscription(e){this.logger.debug("Getting subscription"),this.logger.trace({type:"method",method:"getSubscription",id:e});const t=this.subscriptions.get(e);if(!t){const{message:n}=ue("NO_MATCHING_KEY",`${this.name}: ${e}`);throw new Error(n)}return t}deleteSubscription(e,t){this.logger.debug("Deleting subscription"),this.logger.trace({type:"method",method:"deleteSubscription",id:e,reason:t});const n=this.getSubscription(e);this.subscriptions.delete(e),this.topicMap.delete(n.topic,e),this.events.emit(pn.deleted,Bu(Lo({},n),{reason:t}))}async persist(){await this.setRelayerSubscriptions(this.values),this.events.emit(pn.sync)}async reset(){if(this.cached.length){const e=Math.ceil(this.cached.length/this.batchSubscribeTopicsLimit);for(let t=0;t<e;t++){const n=this.cached.splice(0,this.batchSubscribeTopicsLimit);await this.batchSubscribe(n)}}this.events.emit(pn.resubscribed)}async restore(){try{const e=await this.getRelayerSubscriptions();if(typeof e>"u"||!e.length)return;if(this.subscriptions.size){const{message:t}=ue("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(t),this.logger.error(`${this.name}: ${JSON.stringify(this.values)}`),new Error(t)}this.cached=e,this.logger.debug(`Successfully Restored subscriptions for ${this.name}`),this.logger.trace({type:"method",method:"restore",subscriptions:this.values})}catch(e){this.logger.debug(`Failed to Restore subscriptions for ${this.name}`),this.logger.error(e)}}async batchSubscribe(e){if(!e.length)return;const t=await this.rpcBatchSubscribe(e);En(t)&&this.onBatchSubscribe(t.map((n,i)=>Bu(Lo({},e[i]),{id:n})))}async onConnect(){this.restartInProgress||(await this.restart(),this.onEnable())}onDisconnect(){this.onDisable()}async checkPending(){if(!this.initialized||this.relayer.transportExplicitlyClosed)return;const e=[];this.pending.forEach(t=>{e.push(t)}),await this.batchSubscribe(e)}registerEventListeners(){this.relayer.core.heartbeat.on(Ds.HEARTBEAT_EVENTS.pulse,async()=>{await this.checkPending()}),this.relayer.on(pr.connect,async()=>{await this.onConnect()}),this.relayer.on(pr.disconnect,()=>{this.onDisconnect()}),this.events.on(pn.created,async e=>{const t=pn.created;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,data:e}),await this.persist()}),this.events.on(pn.deleted,async e=>{const t=pn.deleted;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,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 t=setInterval(()=>{this.restartInProgress||(clearInterval(t),e())},this.pollingInterval)})}}var w8=Object.defineProperty,D1=Object.getOwnPropertySymbols,b8=Object.prototype.hasOwnProperty,_8=Object.prototype.propertyIsEnumerable,S1=(r,e,t)=>e in r?w8(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,E8=(r,e)=>{for(var t in e||(e={}))b8.call(e,t)&&S1(r,t,e[t]);if(D1)for(var t of D1(e))_8.call(e,t)&&S1(r,t,e[t]);return r};class x8 extends K5{constructor(e){super(e),this.protocol="wc",this.version=2,this.events=new lr.exports.EventEmitter,this.name=z4,this.transportExplicitlyClosed=!1,this.initialized=!1,this.connectionAttemptInProgress=!1,this.connectionStatusPollingInterval=20,this.staleConnectionErrors=["socket hang up","socket stalled"],this.hasExperiencedNetworkDisruption=!1,this.requestsInFlight=new Map,this.request=async t=>{this.logger.debug("Publishing Request Payload");const n=t.id,i=this.provider.request(t);this.requestsInFlight.set(n,{promise:i,request:t});try{return await this.toEstablishConnection(),await i}catch(a){throw this.logger.debug("Failed to Publish Request"),this.logger.error(a),a}finally{this.requestsInFlight.delete(n)}},this.onPayloadHandler=t=>{this.onProviderPayload(t)},this.onConnectHandler=()=>{this.events.emit(pr.connect)},this.onDisconnectHandler=()=>{this.onProviderDisconnect()},this.onProviderErrorHandler=t=>{this.logger.error(t),this.events.emit(pr.error,t),this.logger.info("Fatal socket error received, closing transport"),this.transportClose()},this.registerProviderListeners=()=>{this.provider.on(jn.payload,this.onPayloadHandler),this.provider.on(jn.connect,this.onConnectHandler),this.provider.on(jn.disconnect,this.onDisconnectHandler),this.provider.on(jn.error,this.onProviderErrorHandler)},this.core=e.core,this.logger=typeof e.logger<"u"&&typeof e.logger!="string"?Xe.generateChildLogger(e.logger,this.name):Xe.pino(Xe.getDefaultLoggerOptions({level:e.logger||q4})),this.messages=new u8(this.logger,e.core),this.subscriber=new y8(this,this.logger),this.publisher=new h8(this,this.logger),this.relayUrl=e?.relayUrl||_1,this.projectId=e.projectId,this.bundleId=f_(),this.provider={}}async init(){this.logger.trace("Initialized"),this.registerEventListeners(),await this.createProvider(),await Promise.all([this.messages.init(),this.subscriber.init()]);try{await this.transportOpen()}catch{this.logger.warn(`Connection via ${this.relayUrl} failed, attempting to connect via failover domain ${E1}...`),await this.restartTransport(E1)}this.initialized=!0,setTimeout(async()=>{this.subscriber.topics.length===0&&(this.logger.info("No topics subscribed to after init, closing transport"),await this.transportClose(),this.transportExplicitlyClosed=!1)},V4)}get context(){return Xe.getLoggerContext(this.logger)}get connected(){return this.provider.connection.connected}get connecting(){return this.provider.connection.connecting}async publish(e,t,n){this.isInitialized(),await this.publisher.publish(e,t,n),await this.recordMessageEvent({topic:e,message:t,publishedAt:Date.now()})}async subscribe(e,t){var n;this.isInitialized();let i=((n=this.subscriber.topicMap.get(e))==null?void 0:n[0])||"";if(i)return i;let a;const c=u=>{u.topic===e&&(this.subscriber.off(pn.created,c),a())};return await Promise.all([new Promise(u=>{a=u,this.subscriber.on(pn.created,c)}),new Promise(async u=>{i=await this.subscriber.subscribe(e,t),u()})]),i}async unsubscribe(e,t){this.isInitialized(),await this.subscriber.unsubscribe(e,t)}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}off(e,t){this.events.off(e,t)}removeListener(e,t){this.events.removeListener(e,t)}async transportClose(){this.requestsInFlight.size>0&&(this.logger.debug("Waiting for all in-flight requests to finish before closing transport..."),this.requestsInFlight.forEach(async e=>{await e.promise})),this.transportExplicitlyClosed=!0,this.hasExperiencedNetworkDisruption&&this.connected?await _o(this.provider.disconnect(),1e3,"provider.disconnect()").catch(()=>this.onProviderDisconnect()):this.connected&&await this.provider.disconnect()}async transportOpen(e){if(this.transportExplicitlyClosed=!1,await this.confirmOnlineStateOrThrow(),!this.connectionAttemptInProgress){e&&e!==this.relayUrl&&(this.relayUrl=e,await this.transportClose(),await this.createProvider()),this.connectionAttemptInProgress=!0;try{await Promise.all([new Promise(t=>{if(!this.initialized)return t();this.subscriber.once(pn.resubscribed,()=>{t()})}),new Promise(async(t,n)=>{try{await _o(this.provider.connect(),1e4,`Socket stalled when trying to connect to ${this.relayUrl}`)}catch(i){n(i);return}t()})])}catch(t){this.logger.error(t);const n=t;if(!this.isConnectionStalled(n.message))throw t;this.provider.events.emit(jn.disconnect)}finally{this.connectionAttemptInProgress=!1,this.hasExperiencedNetworkDisruption=!1}}}async restartTransport(e){await this.confirmOnlineStateOrThrow(),!this.connectionAttemptInProgress&&(this.relayUrl=e||this.relayUrl,await this.transportClose(),await this.createProvider(),await this.transportOpen())}async confirmOnlineStateOrThrow(){if(!await up())throw new Error("No internet connection detected. Please restart your network and try again.")}isConnectionStalled(e){return this.staleConnectionErrors.some(t=>e.includes(t))}async createProvider(){this.provider.connection&&this.unregisterProviderListeners();const e=await this.core.crypto.signJWT(this.relayUrl);this.provider=new Un(new tE(y_({sdkVersion:K4,protocol:this.protocol,version:this.version,relayUrl:this.relayUrl,projectId:this.projectId,auth:e,useOnCloseEvent:!0,bundleId:this.bundleId}))),this.registerProviderListeners()}async recordMessageEvent(e){const{topic:t,message:n}=e;await this.messages.set(t,n)}async shouldIgnoreMessageEvent(e){const{topic:t,message:n}=e;if(!n||n.length===0)return this.logger.debug(`Ignoring invalid/empty message: ${n}`),!0;if(!await this.subscriber.isSubscribed(t))return this.logger.debug(`Ignoring message for non-subscribed topic ${t}`),!0;const i=this.messages.has(t,n);return i&&this.logger.debug(`Ignoring duplicate message: ${n}`),i}async onProviderPayload(e){if(this.logger.debug("Incoming Relay Payload"),this.logger.trace({type:"payload",direction:"incoming",payload:e}),Tu(e)){if(!e.method.endsWith(H4))return;const t=e.params,{topic:n,message:i,publishedAt:a}=t.data,c={topic:n,message:i,publishedAt:a};this.logger.debug("Emitting Relayer Payload"),this.logger.trace(E8({type:"event",event:t.id},c)),this.events.emit(t.id,c),await this.acknowledgePayload(e),await this.onMessageEvent(c)}else Wa(e)&&this.events.emit(pr.message_ack,e)}async onMessageEvent(e){await this.shouldIgnoreMessageEvent(e)||(this.events.emit(pr.message,e),await this.recordMessageEvent(e))}async acknowledgePayload(e){const t=za(e.id,!0);await this.provider.connection.send(t)}unregisterProviderListeners(){this.provider.off(jn.payload,this.onPayloadHandler),this.provider.off(jn.connect,this.onConnectHandler),this.provider.off(jn.disconnect,this.onDisconnectHandler),this.provider.off(jn.error,this.onProviderErrorHandler)}async registerEventListeners(){this.events.on(pr.connection_stalled,()=>{this.restartTransport().catch(t=>this.logger.error(t))});let e=await up();f3(async t=>{this.initialized&&e!==t&&(e=t,t?await this.restartTransport().catch(n=>this.logger.error(n)):(this.hasExperiencedNetworkDisruption=!0,await this.transportClose().catch(n=>this.logger.error(n))))})}onProviderDisconnect(){this.events.emit(pr.disconnect),this.attemptToReconnect()}attemptToReconnect(){this.transportExplicitlyClosed||(this.logger.info("attemptToReconnect called. Connecting..."),setTimeout(async()=>{await this.restartTransport().catch(e=>this.logger.error(e))},ye.toMiliseconds(W4)))}isInitialized(){if(!this.initialized){const{message:e}=ue("NOT_INITIALIZED",this.name);throw new Error(e)}}async toEstablishConnection(){if(await this.confirmOnlineStateOrThrow(),!this.connected){if(this.connectionAttemptInProgress)return await new Promise(e=>{const t=setInterval(()=>{this.connected&&(clearInterval(t),e())},this.connectionStatusPollingInterval)});await this.restartTransport()}}}var I8=Object.defineProperty,C1=Object.getOwnPropertySymbols,D8=Object.prototype.hasOwnProperty,S8=Object.prototype.propertyIsEnumerable,O1=(r,e,t)=>e in r?I8(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,$1=(r,e)=>{for(var t in e||(e={}))D8.call(e,t)&&O1(r,t,e[t]);if(C1)for(var t of C1(e))S8.call(e,t)&&O1(r,t,e[t]);return r};class Va extends V5{constructor(e,t,n,i=si,a=void 0){super(e,t,n,i),this.core=e,this.logger=t,this.name=n,this.map=new Map,this.version=G4,this.cached=[],this.initialized=!1,this.storagePrefix=si,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(c=>{this.getKey&&c!==null&&!_r(c)?this.map.set(this.getKey(c),c):z_(c)?this.map.set(c.id,c):H_(c)&&this.map.set(c.topic,c)}),this.cached=[],this.initialized=!0)},this.set=async(c,u)=>{this.isInitialized(),this.map.has(c)?await this.update(c,u):(this.logger.debug("Setting value"),this.logger.trace({type:"method",method:"set",key:c,value:u}),this.map.set(c,u),await this.persist())},this.get=c=>(this.isInitialized(),this.logger.debug("Getting value"),this.logger.trace({type:"method",method:"get",key:c}),this.getData(c)),this.getAll=c=>(this.isInitialized(),c?this.values.filter(u=>Object.keys(c).every(f=>rE(u[f],c[f]))):this.values),this.update=async(c,u)=>{this.isInitialized(),this.logger.debug("Updating value"),this.logger.trace({type:"method",method:"update",key:c,update:u});const f=$1($1({},this.getData(c)),u);this.map.set(c,f),await this.persist()},this.delete=async(c,u)=>{this.isInitialized(),this.map.has(c)&&(this.logger.debug("Deleting value"),this.logger.trace({type:"method",method:"delete",key:c,reason:u}),this.map.delete(c),await this.persist())},this.logger=Xe.generateChildLogger(t,this.name),this.storagePrefix=i,this.getKey=a}get context(){return Xe.getLoggerContext(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get length(){return this.map.size}get keys(){return Array.from(this.map.keys())}get values(){return Array.from(this.map.values())}async setDataStore(e){await this.core.storage.setItem(this.storageKey,e)}async getDataStore(){return await this.core.storage.getItem(this.storageKey)}getData(e){const t=this.map.get(e);if(!t){const{message:n}=ue("NO_MATCHING_KEY",`${this.name}: ${e}`);throw this.logger.error(n),new Error(n)}return t}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:t}=ue("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(t),new Error(t)}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 C8{constructor(e,t){this.core=e,this.logger=t,this.name=X4,this.version=e8,this.events=new lr.exports,this.initialized=!1,this.storagePrefix=si,this.ignoredPayloadTypes=[Li],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=su(),i=await this.core.crypto.setSymKey(n),a=Wr(ye.FIVE_MINUTES),c={protocol:b1},u={topic:i,expiry:a,relay:c,active:!1},f=N_({protocol:this.core.protocol,version:this.core.version,topic:i,symKey:n,relay:c,expiryTimestamp:a});return await this.pairings.set(i,u),await this.core.relayer.subscribe(i),this.core.expirer.set(i,a),{topic:i,uri:f}},this.pair=async n=>{this.isInitialized(),this.isValidPair(n);const{topic:i,symKey:a,relay:c,expiryTimestamp:u}=np(n.uri);let f;if(this.pairings.keys.includes(i)&&(f=this.pairings.get(i),f.active))throw new Error(`Pairing already exists: ${i}. Please try again with a new connection URI.`);const h=u||Wr(ye.FIVE_MINUTES),m={topic:i,relay:c,expiry:h,active:!1};return await this.pairings.set(i,m),this.core.expirer.set(i,h),n.activatePairing&&await this.activate({topic:i}),this.events.emit(No.create,m),this.core.crypto.keychain.has(i)||(await this.core.crypto.setSymKey(a,i),await this.core.relayer.subscribe(i,{relay:c})),m},this.activate=async({topic:n})=>{this.isInitialized();const i=Wr(ye.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 a=await this.sendRequest(i,"wc_pairingPing",{}),{done:c,resolve:u,reject:f}=xs();this.events.once(qt("pairing_ping",a),({error:h})=>{h?f(h):u()}),await c()}},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",It("USER_DISCONNECTED")),await this.deletePairing(i))},this.sendRequest=async(n,i,a)=>{const c=Ss(i,a),u=await this.core.crypto.encode(n,c),f=Ro[i].req;return this.core.history.set(n,c),this.core.relayer.publish(n,u,f),c.id},this.sendResult=async(n,i,a)=>{const c=za(n,a),u=await this.core.crypto.encode(i,c),f=await this.core.history.get(i,n),h=Ro[f.request.method].res;await this.core.relayer.publish(i,u,h),await this.core.history.resolve(c)},this.sendError=async(n,i,a)=>{const c=Ha(n,a),u=await this.core.crypto.encode(i,c),f=await this.core.history.get(i,n),h=Ro[f.request.method]?Ro[f.request.method].res:Ro.unregistered_method.res;await this.core.relayer.publish(i,u,h),await this.core.history.resolve(c)},this.deletePairing=async(n,i)=>{await this.core.relayer.unsubscribe(n),await Promise.all([this.pairings.delete(n,It("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=>ii(i.expiry));await Promise.all(n.map(i=>this.deletePairing(i.topic)))},this.onRelayEventRequest=n=>{const{topic:i,payload:a}=n;switch(a.method){case"wc_pairingPing":return this.onPairingPingRequest(i,a);case"wc_pairingDelete":return this.onPairingDeleteRequest(i,a);default:return this.onUnknownRpcMethodRequest(i,a)}},this.onRelayEventResponse=async n=>{const{topic:i,payload:a}=n,c=(await this.core.history.get(i,a.id)).request.method;switch(c){case"wc_pairingPing":return this.onPairingPingResponse(i,a);default:return this.onUnknownRpcMethodResponse(c)}},this.onPairingPingRequest=async(n,i)=>{const{id:a}=i;try{this.isValidPing({topic:n}),await this.sendResult(a,n,!0),this.events.emit(No.ping,{id:a,topic:n})}catch(c){await this.sendError(a,n,c),this.logger.error(c)}},this.onPairingPingResponse=(n,i)=>{const{id:a}=i;setTimeout(()=>{Mn(i)?this.events.emit(qt("pairing_ping",a),{}):dn(i)&&this.events.emit(qt("pairing_ping",a),{error:i.error})},500)},this.onPairingDeleteRequest=async(n,i)=>{const{id:a}=i;try{this.isValidDisconnect({topic:n}),await this.deletePairing(n),this.events.emit(No.delete,{id:a,topic:n})}catch(c){await this.sendError(a,n,c),this.logger.error(c)}},this.onUnknownRpcMethodRequest=async(n,i)=>{const{id:a,method:c}=i;try{if(this.registeredMethods.includes(c))return;const u=It("WC_METHOD_UNSUPPORTED",c);await this.sendError(a,n,u),this.logger.error(u)}catch(u){await this.sendError(a,n,u),this.logger.error(u)}},this.onUnknownRpcMethodResponse=n=>{this.registeredMethods.includes(n)||this.logger.error(It("WC_METHOD_UNSUPPORTED",n))},this.isValidPair=n=>{var i;if(!Rr(n)){const{message:c}=ue("MISSING_OR_INVALID",`pair() params: ${n}`);throw new Error(c)}if(!q_(n.uri)){const{message:c}=ue("MISSING_OR_INVALID",`pair() uri: ${n.uri}`);throw new Error(c)}const a=np(n.uri);if(!((i=a?.relay)!=null&&i.protocol)){const{message:c}=ue("MISSING_OR_INVALID","pair() uri#relay-protocol");throw new Error(c)}if(!(a!=null&&a.symKey)){const{message:c}=ue("MISSING_OR_INVALID","pair() uri#symKey");throw new Error(c)}if(a!=null&&a.expiryTimestamp&&ye.toMiliseconds(a?.expiryTimestamp)<Date.now()){const{message:c}=ue("EXPIRED","pair() URI has expired. Please try again with a new connection URI.");throw new Error(c)}},this.isValidPing=async n=>{if(!Rr(n)){const{message:a}=ue("MISSING_OR_INVALID",`ping() params: ${n}`);throw new Error(a)}const{topic:i}=n;await this.isValidPairingTopic(i)},this.isValidDisconnect=async n=>{if(!Rr(n)){const{message:a}=ue("MISSING_OR_INVALID",`disconnect() params: ${n}`);throw new Error(a)}const{topic:i}=n;await this.isValidPairingTopic(i)},this.isValidPairingTopic=async n=>{if(!ir(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(ii(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=Xe.generateChildLogger(t,this.name),this.pairings=new Va(this.core,this.logger,this.name,this.storagePrefix)}get context(){return Xe.getLoggerContext(this.logger)}isInitialized(){if(!this.initialized){const{message:e}=ue("NOT_INITIALIZED",this.name);throw new Error(e)}}registerRelayerEvents(){this.core.relayer.on(pr.message,async e=>{const{topic:t,message:n}=e;if(!this.pairings.keys.includes(t)||this.ignoredPayloadTypes.includes(this.core.crypto.getPayloadType(n)))return;const i=await this.core.crypto.decode(t,n);try{Tu(i)?(this.core.history.set(t,i),this.onRelayEventRequest({topic:t,payload:i})):Wa(i)&&(await this.core.history.resolve(i),await this.onRelayEventResponse({topic:t,payload:i}),this.core.history.delete(t,i.id))}catch(a){this.logger.error(a)}})}registerExpirerEvents(){this.core.expirer.on(en.expired,async e=>{const{topic:t}=ep(e.target);t&&this.pairings.keys.includes(t)&&(await this.deletePairing(t,!0),this.events.emit(No.expire,{topic:t}))})}}class O8 extends z5{constructor(e,t){super(e,t),this.core=e,this.logger=t,this.records=new Map,this.events=new lr.exports.EventEmitter,this.name=t8,this.version=r8,this.cached=[],this.initialized=!1,this.storagePrefix=si,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,a)=>{if(this.isInitialized(),this.logger.debug("Setting JSON-RPC request history record"),this.logger.trace({type:"method",method:"set",topic:n,request:i,chainId:a}),this.records.has(i.id))return;const c={id:i.id,topic:n,request:{method:i.method,params:i.params||null},chainId:a,expiry:Wr(ye.THIRTY_DAYS)};this.records.set(c.id,c),this.events.emit(xn.created,c)},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=dn(n)?{error:n.error}:{result:n.result},this.records.set(i.id,i),this.events.emit(xn.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(a=>{if(a.topic===n){if(typeof i<"u"&&a.id!==i)return;this.records.delete(a.id),this.events.emit(xn.deleted,a)}})},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=Xe.generateChildLogger(t,this.name)}get context(){return Xe.getLoggerContext(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get size(){return this.records.size}get keys(){return Array.from(this.records.keys())}get values(){return Array.from(this.records.values())}get pending(){const e=[];return this.values.forEach(t=>{if(typeof t.response<"u")return;const n={topic:t.topic,request:Ss(t.request.method,t.request.params,t.id),chainId:t.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 t=this.records.get(e);if(!t){const{message:n}=ue("NO_MATCHING_KEY",`${this.name}: ${e}`);throw new Error(n)}return t}async persist(){await this.setJsonRpcRecords(this.values),this.events.emit(xn.sync)}async restore(){try{const e=await this.getJsonRpcRecords();if(typeof e>"u"||!e.length)return;if(this.records.size){const{message:t}=ue("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(t),new Error(t)}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(xn.created,e=>{const t=xn.created;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,record:e}),this.persist()}),this.events.on(xn.updated,e=>{const t=xn.updated;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,record:e}),this.persist()}),this.events.on(xn.deleted,e=>{const t=xn.deleted;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,record:e}),this.persist()}),this.core.heartbeat.on(Ds.HEARTBEAT_EVENTS.pulse,()=>{this.cleanup()})}cleanup(){try{this.records.forEach(e=>{ye.toMiliseconds(e.expiry||0)-Date.now()<=0&&(this.logger.info(`Deleting expired history log: ${e.id}`),this.delete(e.topic,e.id))})}catch(e){this.logger.warn(e)}}isInitialized(){if(!this.initialized){const{message:e}=ue("NOT_INITIALIZED",this.name);throw new Error(e)}}}class $8 extends Y5{constructor(e,t){super(e,t),this.core=e,this.logger=t,this.expirations=new Map,this.events=new lr.exports.EventEmitter,this.name=n8,this.version=i8,this.cached=[],this.initialized=!1,this.storagePrefix=si,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 a=this.formatTarget(n),c={target:a,expiry:i};this.expirations.set(a,c),this.checkExpiry(a,c),this.events.emit(en.created,{target:a,expiration:c})},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),a=this.getExpiration(i);this.expirations.delete(i),this.events.emit(en.deleted,{target:i,expiration:a})}},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=Xe.generateChildLogger(t,this.name)}get context(){return Xe.getLoggerContext(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get length(){return this.expirations.size}get keys(){return Array.from(this.expirations.keys())}get values(){return Array.from(this.expirations.values())}formatTarget(e){if(typeof e=="string")return w_(e);if(typeof e=="number")return b_(e);const{message:t}=ue("UNKNOWN_TYPE",`Target type: ${typeof e}`);throw new Error(t)}async setExpirations(e){await this.core.storage.setItem(this.storageKey,e)}async getExpirations(){return await this.core.storage.getItem(this.storageKey)}async persist(){await this.setExpirations(this.values),this.events.emit(en.sync)}async restore(){try{const e=await this.getExpirations();if(typeof e>"u"||!e.length)return;if(this.expirations.size){const{message:t}=ue("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(t),new Error(t)}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 t=this.expirations.get(e);if(!t){const{message:n}=ue("NO_MATCHING_KEY",`${this.name}: ${e}`);throw this.logger.error(n),new Error(n)}return t}checkExpiry(e,t){const{expiry:n}=t;ye.toMiliseconds(n)-Date.now()<=0&&this.expire(e,t)}expire(e,t){this.expirations.delete(e),this.events.emit(en.expired,{target:e,expiration:t})}checkExpirations(){this.core.relayer.connected&&this.expirations.forEach((e,t)=>this.checkExpiry(t,e))}registerEventListeners(){this.core.heartbeat.on(Ds.HEARTBEAT_EVENTS.pulse,()=>this.checkExpirations()),this.events.on(en.created,e=>{const t=en.created;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,data:e}),this.persist()}),this.events.on(en.expired,e=>{const t=en.expired;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,data:e}),this.persist()}),this.events.on(en.deleted,e=>{const t=en.deleted;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,data:e}),this.persist()})}isInitialized(){if(!this.initialized){const{message:e}=ue("NOT_INITIALIZED",this.name);throw new Error(e)}}}class A8 extends J5{constructor(e,t){super(e,t),this.projectId=e,this.logger=t,this.name=ju,this.initialized=!1,this.queue=[],this.verifyDisabled=!1,this.init=async n=>{if(this.verifyDisabled||_s()||!Es())return;const i=this.getVerifyUrl(n?.verifyUrl);this.verifyUrl!==i&&this.removeIframe(),this.verifyUrl=i;try{await this.createIframe()}catch(a){this.logger.info(`Verify iframe failed to load: ${this.verifyUrl}`),this.logger.info(a)}if(!this.initialized){this.removeIframe(),this.verifyUrl=Fu;try{await this.createIframe()}catch(a){this.logger.info(`Verify iframe failed to load: ${this.verifyUrl}`),this.logger.info(a),this.verifyDisabled=!0}}},this.register=async n=>{this.initialized?this.sendPost(n.attestationId):(this.addToQueue(n.attestationId),await this.init())},this.resolve=async n=>{if(this.isDevEnv)return"";const i=this.getVerifyUrl(n?.verifyUrl);let a;try{a=await this.fetchAttestation(n.attestationId,i)}catch(c){this.logger.info(`failed to resolve attestation: ${n.attestationId} from url: ${i}`),this.logger.info(c),a=await this.fetchAttestation(n.attestationId,Fu)}return a},this.fetchAttestation=async(n,i)=>{this.logger.info(`resolving attestation: ${n} from url: ${i}`);const a=this.startAbortTimer(ye.ONE_SECOND*2),c=await fetch(`${i}/attestation/${n}`,{signal:this.abortController.signal});return clearTimeout(a),c.status===200?await c.json():void 0},this.addToQueue=n=>{this.queue.push(n)},this.processQueue=()=>{this.queue.length!==0&&(this.queue.forEach(n=>this.sendPost(n)),this.queue=[])},this.sendPost=n=>{var i;try{if(!this.iframe)return;(i=this.iframe.contentWindow)==null||i.postMessage(n,"*"),this.logger.info(`postMessage sent: ${n} ${this.verifyUrl}`)}catch{}},this.createIframe=async()=>{let n;const i=a=>{a.data==="verify_ready"&&(this.initialized=!0,this.processQueue(),window.removeEventListener("message",i),n())};await Promise.race([new Promise(a=>{if(document.getElementById(ju))return a();window.addEventListener("message",i);const c=document.createElement("iframe");c.id=ju,c.src=`${this.verifyUrl}/${this.projectId}`,c.style.display="none",document.body.append(c),this.iframe=c,n=a}),new Promise((a,c)=>setTimeout(()=>{window.removeEventListener("message",i),c("verify iframe load timeout")},ye.toMiliseconds(ye.FIVE_SECONDS)))])},this.removeIframe=()=>{this.iframe&&(this.iframe.remove(),this.iframe=void 0,this.initialized=!1)},this.getVerifyUrl=n=>{let i=n||Cs;return s8.includes(i)||(this.logger.info(`verify url: ${i}, not included in trusted list, assigning default: ${Cs}`),i=Cs),i},this.logger=Xe.generateChildLogger(t,this.name),this.verifyUrl=Cs,this.abortController=new AbortController,this.isDevEnv=ou()&&process.env.IS_VITEST}get context(){return Xe.getLoggerContext(this.logger)}startAbortTimer(e){return this.abortController=new AbortController,setTimeout(()=>this.abortController.abort(),ye.toMiliseconds(e))}}class P8 extends Z5{constructor(e,t){super(e,t),this.projectId=e,this.logger=t,this.context=o8,this.registerDeviceToken=async n=>{const{clientId:i,token:a,notificationType:c,enableEncrypted:u=!1}=n,f=`${a8}/${this.projectId}/clients`;await sE(f,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({client_id:i,type:c,token:a,always_raw:u})})},this.logger=Xe.generateChildLogger(t,this.context)}}var T8=Object.defineProperty,A1=Object.getOwnPropertySymbols,R8=Object.prototype.hasOwnProperty,N8=Object.prototype.propertyIsEnumerable,P1=(r,e,t)=>e in r?T8(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,T1=(r,e)=>{for(var t in e||(e={}))R8.call(e,t)&&P1(r,t,e[t]);if(A1)for(var t of A1(e))N8.call(e,t)&&P1(r,t,e[t]);return r};class ku extends q5{constructor(e){super(e),this.protocol=y1,this.version=P4,this.name=Uu,this.events=new lr.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||_1,this.customStoragePrefix=e!=null&&e.customStoragePrefix?`:${e.customStoragePrefix}`:"";const t=typeof e?.logger<"u"&&typeof e?.logger!="string"?e.logger:Xe.pino(Xe.getDefaultLoggerOptions({level:e?.logger||T4.logger}));this.logger=Xe.generateChildLogger(t,this.name),this.heartbeat=new Ds.HeartBeat,this.crypto=new l8(this,this.logger,e?.keychain),this.history=new O8(this,this.logger),this.expirer=new $8(this,this.logger),this.storage=e!=null&&e.storage?e.storage:new K3(T1(T1({},R4),e?.storageOptions)),this.relayer=new x8({core:this,logger:this.logger,relayUrl:this.relayUrl,projectId:this.projectId}),this.pairing=new C8(this,this.logger),this.verify=new A8(this.projectId||"",this.logger),this.echoClient=new P8(this.projectId||"",this.logger)}static async init(e){const t=new ku(e);await t.initialize();const n=await t.crypto.getClientId();return await t.storage.setItem(Y4,n),t}get context(){return Xe.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 L8=ku,R1="wc",N1=2,L1="client",qu=`${R1}@${N1}:${L1}:`,zu={name:L1,logger:"error",controller:!1,relayUrl:"wss://relay.walletconnect.com"},M1="WALLETCONNECT_DEEPLINK_CHOICE",M8="proposal",U1="Proposal expired",U8="session",Ga=ye.SEVEN_DAYS,j8="engine",Fn={wc_sessionPropose:{req:{ttl:ye.FIVE_MINUTES,prompt:!0,tag:1100},res:{ttl:ye.FIVE_MINUTES,prompt:!1,tag:1101}},wc_sessionSettle:{req:{ttl:ye.FIVE_MINUTES,prompt:!1,tag:1102},res:{ttl:ye.FIVE_MINUTES,prompt:!1,tag:1103}},wc_sessionUpdate:{req:{ttl:ye.ONE_DAY,prompt:!1,tag:1104},res:{ttl:ye.ONE_DAY,prompt:!1,tag:1105}},wc_sessionExtend:{req:{ttl:ye.ONE_DAY,prompt:!1,tag:1106},res:{ttl:ye.ONE_DAY,prompt:!1,tag:1107}},wc_sessionRequest:{req:{ttl:ye.FIVE_MINUTES,prompt:!0,tag:1108},res:{ttl:ye.FIVE_MINUTES,prompt:!1,tag:1109}},wc_sessionEvent:{req:{ttl:ye.FIVE_MINUTES,prompt:!0,tag:1110},res:{ttl:ye.FIVE_MINUTES,prompt:!1,tag:1111}},wc_sessionDelete:{req:{ttl:ye.ONE_DAY,prompt:!1,tag:1112},res:{ttl:ye.ONE_DAY,prompt:!1,tag:1113}},wc_sessionPing:{req:{ttl:ye.THIRTY_SECONDS,prompt:!1,tag:1114},res:{ttl:ye.THIRTY_SECONDS,prompt:!1,tag:1115}}},Hu={min:ye.FIVE_MINUTES,max:ye.SEVEN_DAYS},Bn={idle:"IDLE",active:"ACTIVE"},F8="request",B8=["wc_sessionPropose","wc_sessionRequest","wc_authRequest"];var k8=Object.defineProperty,q8=Object.defineProperties,z8=Object.getOwnPropertyDescriptors,j1=Object.getOwnPropertySymbols,H8=Object.prototype.hasOwnProperty,W8=Object.prototype.propertyIsEnumerable,F1=(r,e,t)=>e in r?k8(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,Ir=(r,e)=>{for(var t in e||(e={}))H8.call(e,t)&&F1(r,t,e[t]);if(j1)for(var t of j1(e))W8.call(e,t)&&F1(r,t,e[t]);return r},Os=(r,e)=>q8(r,z8(e));class K8 extends X5{constructor(e){super(e),this.name=j8,this.events=new lr.exports,this.initialized=!1,this.ignoredPayloadTypes=[Li],this.requestQueue={state:Bn.idle,queue:[]},this.sessionRequestQueue={state:Bn.idle,queue:[]},this.requestQueueDelay=ye.ONE_SECOND,this.init=async()=>{this.initialized||(await this.cleanup(),this.registerRelayerEvents(),this.registerExpirerEvents(),this.registerPairingEvents(),this.client.core.pairing.register({methods:Object.keys(Fn)}),this.initialized=!0,setTimeout(()=>{this.sessionRequestQueue.queue=this.getPendingSessionRequests(),this.processSessionRequestQueue()},ye.toMiliseconds(this.requestQueueDelay)))},this.connect=async t=>{await this.isInitialized();const n=Os(Ir({},t),{requiredNamespaces:t.requiredNamespaces||{},optionalNamespaces:t.optionalNamespaces||{}});await this.isValidConnect(n);const{pairingTopic:i,requiredNamespaces:a,optionalNamespaces:c,sessionProperties:u,relays:f}=n;let h=i,m,w=!1;if(h&&(w=this.client.core.pairing.pairings.get(h).active),!h||!w){const{topic:C,uri:$}=await this.client.core.pairing.create();h=C,m=$}const y=await this.client.core.crypto.generateKeyPair(),x=Fn.wc_sessionPropose.req.ttl||ye.FIVE_MINUTES,S=Wr(x),P=Ir({requiredNamespaces:a,optionalNamespaces:c,relays:f??[{protocol:b1}],proposer:{publicKey:y,metadata:this.client.metadata},expiryTimestamp:S},u&&{sessionProperties:u}),{reject:U,resolve:j,done:A}=xs(x,U1);if(this.events.once(qt("session_connect"),async({error:C,session:$})=>{if(C)U(C);else if($){$.self.publicKey=y;const E=Os(Ir({},$),{requiredNamespaces:P.requiredNamespaces,optionalNamespaces:P.optionalNamespaces});await this.client.session.set($.topic,E),await this.setExpiry($.topic,$.expiry),h&&await this.client.core.pairing.updateMetadata({topic:h,metadata:$.peer.metadata}),j(E)}}),!h){const{message:C}=ue("NO_MATCHING_KEY",`connect() pairing topic: ${h}`);throw new Error(C)}const T=await this.sendRequest({topic:h,method:"wc_sessionPropose",params:P,throwOnFailedPublish:!0});return await this.setProposal(T,Ir({id:T},P)),{uri:m,approval:A}},this.pair=async t=>(await this.isInitialized(),await this.client.core.pairing.pair(t)),this.approve=async t=>{await this.isInitialized(),await this.isValidApprove(t);const{id:n,relayProtocol:i,namespaces:a,sessionProperties:c}=t,u=this.client.proposal.get(n);let{pairingTopic:f,proposer:h,requiredNamespaces:m,optionalNamespaces:w}=u;f=f||"";const y=await this.client.core.crypto.generateKeyPair(),x=h.publicKey,S=await this.client.core.crypto.generateSharedKey(y,x);f&&n&&(await this.client.core.pairing.updateMetadata({topic:f,metadata:h.metadata}),await this.sendResult({id:n,topic:f,result:{relay:{protocol:i??"irn"},responderPublicKey:y}}),await this.client.proposal.delete(n,It("USER_DISCONNECTED")),await this.client.core.pairing.activate({topic:f}));const P=Ir({relay:{protocol:i??"irn"},namespaces:a,pairingTopic:f,controller:{publicKey:y,metadata:this.client.metadata},expiry:Wr(Ga)},c&&{sessionProperties:c});await this.client.core.relayer.subscribe(S);const U=Os(Ir({},P),{topic:S,requiredNamespaces:m,optionalNamespaces:w,pairingTopic:f,acknowledged:!1,self:P.controller,peer:{publicKey:h.publicKey,metadata:h.metadata},controller:y});await this.client.session.set(S,U);try{await this.sendRequest({topic:S,method:"wc_sessionSettle",params:P,throwOnFailedPublish:!0})}catch(j){throw this.client.logger.error(j),this.client.session.delete(S,It("USER_DISCONNECTED")),await this.client.core.relayer.unsubscribe(S),j}return await this.setExpiry(S,Wr(Ga)),{topic:S,acknowledged:()=>new Promise(j=>setTimeout(()=>j(this.client.session.get(S)),500))}},this.reject=async t=>{await this.isInitialized(),await this.isValidReject(t);const{id:n,reason:i}=t,{pairingTopic:a}=this.client.proposal.get(n);a&&(await this.sendError(n,a,i),await this.client.proposal.delete(n,It("USER_DISCONNECTED")))},this.update=async t=>{await this.isInitialized(),await this.isValidUpdate(t);const{topic:n,namespaces:i}=t,a=await this.sendRequest({topic:n,method:"wc_sessionUpdate",params:{namespaces:i}}),{done:c,resolve:u,reject:f}=xs();return this.events.once(qt("session_update",a),({error:h})=>{h?f(h):u()}),await this.client.session.update(n,{namespaces:i}),{acknowledged:c}},this.extend=async t=>{await this.isInitialized(),await this.isValidExtend(t);const{topic:n}=t,i=await this.sendRequest({topic:n,method:"wc_sessionExtend",params:{}}),{done:a,resolve:c,reject:u}=xs();return this.events.once(qt("session_extend",i),({error:f})=>{f?u(f):c()}),await this.setExpiry(n,Wr(Ga)),{acknowledged:a}},this.request=async t=>{await this.isInitialized(),await this.isValidRequest(t);const{chainId:n,request:i,topic:a,expiry:c=Fn.wc_sessionRequest.req.ttl}=t,u=Pu(),{done:f,resolve:h,reject:m}=xs(c,"Request expired. Please try again.");return this.events.once(qt("session_request",u),({error:w,result:y})=>{w?m(w):h(y)}),await Promise.all([new Promise(async w=>{await this.sendRequest({clientRpcId:u,topic:a,method:"wc_sessionRequest",params:{request:Os(Ir({},i),{expiryTimestamp:Wr(c)}),chainId:n},expiry:c,throwOnFailedPublish:!0}).catch(y=>m(y)),this.client.events.emit("session_request_sent",{topic:a,request:i,chainId:n,id:u}),w()}),new Promise(async w=>{const y=await E_(this.client.core.storage,M1);__({id:u,topic:a,wcDeepLink:y}),w()}),f()]).then(w=>w[2])},this.respond=async t=>{await this.isInitialized(),await this.isValidRespond(t);const{topic:n,response:i}=t,{id:a}=i;Mn(i)?await this.sendResult({id:a,topic:n,result:i.result,throwOnFailedPublish:!0}):dn(i)&&await this.sendError(a,n,i.error),this.cleanupAfterResponse(t)},this.ping=async t=>{await this.isInitialized(),await this.isValidPing(t);const{topic:n}=t;if(this.client.session.keys.includes(n)){const i=await this.sendRequest({topic:n,method:"wc_sessionPing",params:{}}),{done:a,resolve:c,reject:u}=xs();this.events.once(qt("session_ping",i),({error:f})=>{f?u(f):c()}),await a()}else this.client.core.pairing.pairings.keys.includes(n)&&await this.client.core.pairing.ping({topic:n})},this.emit=async t=>{await this.isInitialized(),await this.isValidEmit(t);const{topic:n,event:i,chainId:a}=t;await this.sendRequest({topic:n,method:"wc_sessionEvent",params:{event:i,chainId:a}})},this.disconnect=async t=>{await this.isInitialized(),await this.isValidDisconnect(t);const{topic:n}=t;if(this.client.session.keys.includes(n))await this.sendRequest({topic:n,method:"wc_sessionDelete",params:It("USER_DISCONNECTED"),throwOnFailedPublish:!0}),await this.deleteSession({topic:n,emitEvent:!1});else if(this.client.core.pairing.pairings.keys.includes(n))await this.client.core.pairing.disconnect({topic:n});else{const{message:i}=ue("MISMATCHED_TOPIC",`Session or pairing topic not found: ${n}`);throw new Error(i)}},this.find=t=>(this.isInitialized(),this.client.session.getAll().filter(n=>B_(n,t))),this.getPendingSessionRequests=()=>this.client.pendingRequest.getAll(),this.cleanupDuplicatePairings=async t=>{if(t.pairingTopic)try{const n=this.client.core.pairing.pairings.get(t.pairingTopic),i=this.client.core.pairing.pairings.getAll().filter(a=>{var c,u;return((c=a.peerMetadata)==null?void 0:c.url)&&((u=a.peerMetadata)==null?void 0:u.url)===t.peer.metadata.url&&a.topic&&a.topic!==n.topic});if(i.length===0)return;this.client.logger.info(`Cleaning up ${i.length} duplicate pairing(s)`),await Promise.all(i.map(a=>this.client.core.pairing.disconnect({topic:a.topic}))),this.client.logger.info("Duplicate pairings clean up finished")}catch(n){this.client.logger.error(n)}},this.deleteSession=async t=>{const{topic:n,expirerHasDeleted:i=!1,emitEvent:a=!0,id:c=0}=t,{self:u}=this.client.session.get(n);await this.client.core.relayer.unsubscribe(n),await this.client.session.delete(n,It("USER_DISCONNECTED")),this.client.core.crypto.keychain.has(u.publicKey)&&await this.client.core.crypto.deleteKeyPair(u.publicKey),this.client.core.crypto.keychain.has(n)&&await this.client.core.crypto.deleteSymKey(n),i||this.client.core.expirer.del(n),this.client.core.storage.removeItem(M1).catch(f=>this.client.logger.warn(f)),this.getPendingSessionRequests().forEach(f=>{f.topic===n&&this.deletePendingSessionRequest(f.id,It("USER_DISCONNECTED"))}),a&&this.client.events.emit("session_delete",{id:c,topic:n})},this.deleteProposal=async(t,n)=>{await Promise.all([this.client.proposal.delete(t,It("USER_DISCONNECTED")),n?Promise.resolve():this.client.core.expirer.del(t)])},this.deletePendingSessionRequest=async(t,n,i=!1)=>{await Promise.all([this.client.pendingRequest.delete(t,n),i?Promise.resolve():this.client.core.expirer.del(t)]),this.sessionRequestQueue.queue=this.sessionRequestQueue.queue.filter(a=>a.id!==t),i&&(this.sessionRequestQueue.state=Bn.idle,this.client.events.emit("session_request_expire",{id:t}))},this.setExpiry=async(t,n)=>{this.client.session.keys.includes(t)&&await this.client.session.update(t,{expiry:n}),this.client.core.expirer.set(t,n)},this.setProposal=async(t,n)=>{await this.client.proposal.set(t,n),this.client.core.expirer.set(t,Wr(Fn.wc_sessionPropose.req.ttl))},this.setPendingSessionRequest=async t=>{const{id:n,topic:i,params:a,verifyContext:c}=t,u=a.request.expiryTimestamp||Wr(Fn.wc_sessionRequest.req.ttl);await this.client.pendingRequest.set(n,{id:n,topic:i,params:a,verifyContext:c}),u&&this.client.core.expirer.set(n,u)},this.sendRequest=async t=>{const{topic:n,method:i,params:a,expiry:c,relayRpcId:u,clientRpcId:f,throwOnFailedPublish:h}=t,m=Ss(i,a,f);if(Es()&&B8.includes(i)){const x=bs(JSON.stringify(m));this.client.core.verify.register({attestationId:x})}const w=await this.client.core.crypto.encode(n,m),y=Fn[i].req;return c&&(y.ttl=c),u&&(y.id=u),this.client.core.history.set(n,m),h?(y.internal=Os(Ir({},y.internal),{throwOnFailedPublish:!0}),await this.client.core.relayer.publish(n,w,y)):this.client.core.relayer.publish(n,w,y).catch(x=>this.client.logger.error(x)),m.id},this.sendResult=async t=>{const{id:n,topic:i,result:a,throwOnFailedPublish:c}=t,u=za(n,a),f=await this.client.core.crypto.encode(i,u),h=await this.client.core.history.get(i,n),m=Fn[h.request.method].res;c?(m.internal=Os(Ir({},m.internal),{throwOnFailedPublish:!0}),await this.client.core.relayer.publish(i,f,m)):this.client.core.relayer.publish(i,f,m).catch(w=>this.client.logger.error(w)),await this.client.core.history.resolve(u)},this.sendError=async(t,n,i)=>{const a=Ha(t,i),c=await this.client.core.crypto.encode(n,a),u=await this.client.core.history.get(n,t),f=Fn[u.request.method].res;this.client.core.relayer.publish(n,c,f),await this.client.core.history.resolve(a)},this.cleanup=async()=>{const t=[],n=[];this.client.session.getAll().forEach(i=>{let a=!1;ii(i.expiry)&&(a=!0),this.client.core.crypto.keychain.has(i.topic)||(a=!0),a&&t.push(i.topic)}),this.client.proposal.getAll().forEach(i=>{ii(i.expiryTimestamp)&&n.push(i.id)}),await Promise.all([...t.map(i=>this.deleteSession({topic:i})),...n.map(i=>this.deleteProposal(i))])},this.onRelayEventRequest=async t=>{this.requestQueue.queue.push(t),await this.processRequestsQueue()},this.processRequestsQueue=async()=>{if(this.requestQueue.state===Bn.active){this.client.logger.info("Request queue already active, skipping...");return}for(this.client.logger.info(`Request queue starting with ${this.requestQueue.queue.length} requests`);this.requestQueue.queue.length>0;){this.requestQueue.state=Bn.active;const t=this.requestQueue.queue.shift();if(t)try{this.processRequest(t),await new Promise(n=>setTimeout(n,300))}catch(n){this.client.logger.warn(n)}}this.requestQueue.state=Bn.idle},this.processRequest=t=>{const{topic:n,payload:i}=t,a=i.method;switch(a){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 ${a}`)}},this.onRelayEventResponse=async t=>{const{topic:n,payload:i}=t,a=(await this.client.core.history.get(n,i.id)).request.method;switch(a){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 ${a}`)}},this.onRelayEventUnknownPayload=t=>{const{topic:n}=t,{message:i}=ue("MISSING_OR_INVALID",`Decoded payload on topic ${n} is not identifiable as a JSON-RPC request or a response.`);throw new Error(i)},this.onSessionProposeRequest=async(t,n)=>{const{params:i,id:a}=n;try{this.isValidConnect(Ir({},n.params));const c=i.expiryTimestamp||Wr(Fn.wc_sessionPropose.req.ttl),u=Ir({id:a,pairingTopic:t,expiryTimestamp:c},i);await this.setProposal(a,u);const f=bs(JSON.stringify(n)),h=await this.getVerifyContext(f,u.proposer.metadata);this.client.events.emit("session_proposal",{id:a,params:u,verifyContext:h})}catch(c){await this.sendError(a,t,c),this.client.logger.error(c)}},this.onSessionProposeResponse=async(t,n)=>{const{id:i}=n;if(Mn(n)){const{result:a}=n;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",result:a});const c=this.client.proposal.get(i);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",proposal:c});const u=c.proposer.publicKey;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",selfPublicKey:u});const f=a.responderPublicKey;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",peerPublicKey:f});const h=await this.client.core.crypto.generateSharedKey(u,f);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",sessionTopic:h});const m=await this.client.core.relayer.subscribe(h);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",subscriptionId:m}),await this.client.core.pairing.activate({topic:t})}else dn(n)&&(await this.client.proposal.delete(i,It("USER_DISCONNECTED")),this.events.emit(qt("session_connect"),{error:n.error}))},this.onSessionSettleRequest=async(t,n)=>{const{id:i,params:a}=n;try{this.isValidSessionSettleRequest(a);const{relay:c,controller:u,expiry:f,namespaces:h,sessionProperties:m,pairingTopic:w}=n.params,y=Ir({topic:t,relay:c,expiry:f,namespaces:h,acknowledged:!0,pairingTopic:w,requiredNamespaces:{},optionalNamespaces:{},controller:u.publicKey,self:{publicKey:"",metadata:this.client.metadata},peer:{publicKey:u.publicKey,metadata:u.metadata}},m&&{sessionProperties:m});await this.sendResult({id:n.id,topic:t,result:!0}),this.events.emit(qt("session_connect"),{session:y}),this.cleanupDuplicatePairings(y)}catch(c){await this.sendError(i,t,c),this.client.logger.error(c)}},this.onSessionSettleResponse=async(t,n)=>{const{id:i}=n;Mn(n)?(await this.client.session.update(t,{acknowledged:!0}),this.events.emit(qt("session_approve",i),{})):dn(n)&&(await this.client.session.delete(t,It("USER_DISCONNECTED")),this.events.emit(qt("session_approve",i),{error:n.error}))},this.onSessionUpdateRequest=async(t,n)=>{const{params:i,id:a}=n;try{const c=`${t}_session_update`,u=Ma.get(c);if(u&&this.isRequestOutOfSync(u,a)){this.client.logger.info(`Discarding out of sync request - ${a}`);return}this.isValidUpdate(Ir({topic:t},i)),await this.client.session.update(t,{namespaces:i.namespaces}),await this.sendResult({id:a,topic:t,result:!0}),this.client.events.emit("session_update",{id:a,topic:t,params:i}),Ma.set(c,a)}catch(c){await this.sendError(a,t,c),this.client.logger.error(c)}},this.isRequestOutOfSync=(t,n)=>parseInt(n.toString().slice(0,-3))<=parseInt(t.toString().slice(0,-3)),this.onSessionUpdateResponse=(t,n)=>{const{id:i}=n;Mn(n)?this.events.emit(qt("session_update",i),{}):dn(n)&&this.events.emit(qt("session_update",i),{error:n.error})},this.onSessionExtendRequest=async(t,n)=>{const{id:i}=n;try{this.isValidExtend({topic:t}),await this.setExpiry(t,Wr(Ga)),await this.sendResult({id:i,topic:t,result:!0}),this.client.events.emit("session_extend",{id:i,topic:t})}catch(a){await this.sendError(i,t,a),this.client.logger.error(a)}},this.onSessionExtendResponse=(t,n)=>{const{id:i}=n;Mn(n)?this.events.emit(qt("session_extend",i),{}):dn(n)&&this.events.emit(qt("session_extend",i),{error:n.error})},this.onSessionPingRequest=async(t,n)=>{const{id:i}=n;try{this.isValidPing({topic:t}),await this.sendResult({id:i,topic:t,result:!0}),this.client.events.emit("session_ping",{id:i,topic:t})}catch(a){await this.sendError(i,t,a),this.client.logger.error(a)}},this.onSessionPingResponse=(t,n)=>{const{id:i}=n;setTimeout(()=>{Mn(n)?this.events.emit(qt("session_ping",i),{}):dn(n)&&this.events.emit(qt("session_ping",i),{error:n.error})},500)},this.onSessionDeleteRequest=async(t,n)=>{const{id:i}=n;try{this.isValidDisconnect({topic:t,reason:n.params}),await Promise.all([new Promise(a=>{this.client.core.relayer.once(pr.publish,async()=>{a(await this.deleteSession({topic:t,id:i}))})}),this.sendResult({id:i,topic:t,result:!0}),this.cleanupPendingSentRequestsForTopic({topic:t,error:It("USER_DISCONNECTED")})])}catch(a){this.client.logger.error(a)}},this.onSessionRequest=async(t,n)=>{const{id:i,params:a}=n;try{this.isValidRequest(Ir({topic:t},a));const c=bs(JSON.stringify(Ss("wc_sessionRequest",a,i))),u=this.client.session.get(t),f=await this.getVerifyContext(c,u.peer.metadata),h={id:i,topic:t,params:a,verifyContext:f};await this.setPendingSessionRequest(h),this.addSessionRequestToSessionRequestQueue(h),this.processSessionRequestQueue()}catch(c){await this.sendError(i,t,c),this.client.logger.error(c)}},this.onSessionRequestResponse=(t,n)=>{const{id:i}=n;Mn(n)?this.events.emit(qt("session_request",i),{result:n.result}):dn(n)&&this.events.emit(qt("session_request",i),{error:n.error})},this.onSessionEventRequest=async(t,n)=>{const{id:i,params:a}=n;try{const c=`${t}_session_event_${a.event.name}`,u=Ma.get(c);if(u&&this.isRequestOutOfSync(u,i)){this.client.logger.info(`Discarding out of sync request - ${i}`);return}this.isValidEmit(Ir({topic:t},a)),this.client.events.emit("session_event",{id:i,topic:t,params:a}),Ma.set(c,i)}catch(c){await this.sendError(i,t,c),this.client.logger.error(c)}},this.addSessionRequestToSessionRequestQueue=t=>{this.sessionRequestQueue.queue.push(t)},this.cleanupAfterResponse=t=>{this.deletePendingSessionRequest(t.response.id,{message:"fulfilled",code:0}),setTimeout(()=>{this.sessionRequestQueue.state=Bn.idle,this.processSessionRequestQueue()},ye.toMiliseconds(this.requestQueueDelay))},this.cleanupPendingSentRequestsForTopic=({topic:t,error:n})=>{const i=this.client.core.history.pending;i.length>0&&i.filter(a=>a.topic===t&&a.request.method==="wc_sessionRequest").forEach(a=>{this.events.emit(qt("session_request",a.request.id),{error:n})})},this.processSessionRequestQueue=()=>{if(this.sessionRequestQueue.state===Bn.active){this.client.logger.info("session request queue is already active.");return}const t=this.sessionRequestQueue.queue[0];if(!t){this.client.logger.info("session request queue is empty.");return}try{this.sessionRequestQueue.state=Bn.active,this.client.events.emit("session_request",t)}catch(n){this.client.logger.error(n)}},this.onPairingCreated=t=>{if(t.active)return;const n=this.client.proposal.getAll().find(i=>i.pairingTopic===t.topic);n&&this.onSessionProposeRequest(t.topic,Ss("wc_sessionPropose",{requiredNamespaces:n.requiredNamespaces,optionalNamespaces:n.optionalNamespaces,relays:n.relays,proposer:n.proposer,sessionProperties:n.sessionProperties},n.id))},this.isValidConnect=async t=>{if(!Rr(t)){const{message:f}=ue("MISSING_OR_INVALID",`connect() params: ${JSON.stringify(t)}`);throw new Error(f)}const{pairingTopic:n,requiredNamespaces:i,optionalNamespaces:a,sessionProperties:c,relays:u}=t;if(_r(n)||await this.isValidPairingTopic(n),!Q_(u,!0)){const{message:f}=ue("MISSING_OR_INVALID",`connect() relays: ${u}`);throw new Error(f)}!_r(i)&&xo(i)!==0&&this.validateNamespaces(i,"requiredNamespaces"),!_r(a)&&xo(a)!==0&&this.validateNamespaces(a,"optionalNamespaces"),_r(c)||this.validateSessionProps(c,"sessionProperties")},this.validateNamespaces=(t,n)=>{const i=Z_(t,"connect()",n);if(i)throw new Error(i.message)},this.isValidApprove=async t=>{if(!Rr(t))throw new Error(ue("MISSING_OR_INVALID",`approve() params: ${t}`).message);const{id:n,namespaces:i,relayProtocol:a,sessionProperties:c}=t;await this.isValidProposalId(n);const u=this.client.proposal.get(n),f=hu(i,"approve()");if(f)throw new Error(f.message);const h=cp(u.requiredNamespaces,i,"approve()");if(h)throw new Error(h.message);if(!ir(a,!0)){const{message:m}=ue("MISSING_OR_INVALID",`approve() relayProtocol: ${a}`);throw new Error(m)}_r(c)||this.validateSessionProps(c,"sessionProperties")},this.isValidReject=async t=>{if(!Rr(t)){const{message:a}=ue("MISSING_OR_INVALID",`reject() params: ${t}`);throw new Error(a)}const{id:n,reason:i}=t;if(await this.isValidProposalId(n),!e3(i)){const{message:a}=ue("MISSING_OR_INVALID",`reject() reason: ${JSON.stringify(i)}`);throw new Error(a)}},this.isValidSessionSettleRequest=t=>{if(!Rr(t)){const{message:h}=ue("MISSING_OR_INVALID",`onSessionSettleRequest() params: ${t}`);throw new Error(h)}const{relay:n,controller:i,namespaces:a,expiry:c}=t;if(!op(n)){const{message:h}=ue("MISSING_OR_INVALID","onSessionSettleRequest() relay protocol should be a string");throw new Error(h)}const u=W_(i,"onSessionSettleRequest()");if(u)throw new Error(u.message);const f=hu(a,"onSessionSettleRequest()");if(f)throw new Error(f.message);if(ii(c)){const{message:h}=ue("EXPIRED","onSessionSettleRequest()");throw new Error(h)}},this.isValidUpdate=async t=>{if(!Rr(t)){const{message:f}=ue("MISSING_OR_INVALID",`update() params: ${t}`);throw new Error(f)}const{topic:n,namespaces:i}=t;await this.isValidSessionTopic(n);const a=this.client.session.get(n),c=hu(i,"update()");if(c)throw new Error(c.message);const u=cp(a.requiredNamespaces,i,"update()");if(u)throw new Error(u.message)},this.isValidExtend=async t=>{if(!Rr(t)){const{message:i}=ue("MISSING_OR_INVALID",`extend() params: ${t}`);throw new Error(i)}const{topic:n}=t;await this.isValidSessionTopic(n)},this.isValidRequest=async t=>{if(!Rr(t)){const{message:f}=ue("MISSING_OR_INVALID",`request() params: ${t}`);throw new Error(f)}const{topic:n,request:i,chainId:a,expiry:c}=t;await this.isValidSessionTopic(n);const{namespaces:u}=this.client.session.get(n);if(!ap(u,a)){const{message:f}=ue("MISSING_OR_INVALID",`request() chainId: ${a}`);throw new Error(f)}if(!t3(i)){const{message:f}=ue("MISSING_OR_INVALID",`request() ${JSON.stringify(i)}`);throw new Error(f)}if(!i3(u,a,i.method)){const{message:f}=ue("MISSING_OR_INVALID",`request() method: ${i.method}`);throw new Error(f)}if(c&&!c3(c,Hu)){const{message:f}=ue("MISSING_OR_INVALID",`request() expiry: ${c}. Expiry must be a number (in seconds) between ${Hu.min} and ${Hu.max}`);throw new Error(f)}},this.isValidRespond=async t=>{var n;if(!Rr(t)){const{message:c}=ue("MISSING_OR_INVALID",`respond() params: ${t}`);throw new Error(c)}const{topic:i,response:a}=t;try{await this.isValidSessionTopic(i)}catch(c){throw(n=t?.response)!=null&&n.id&&this.cleanupAfterResponse(t),c}if(!r3(a)){const{message:c}=ue("MISSING_OR_INVALID",`respond() response: ${JSON.stringify(a)}`);throw new Error(c)}},this.isValidPing=async t=>{if(!Rr(t)){const{message:i}=ue("MISSING_OR_INVALID",`ping() params: ${t}`);throw new Error(i)}const{topic:n}=t;await this.isValidSessionOrPairingTopic(n)},this.isValidEmit=async t=>{if(!Rr(t)){const{message:u}=ue("MISSING_OR_INVALID",`emit() params: ${t}`);throw new Error(u)}const{topic:n,event:i,chainId:a}=t;await this.isValidSessionTopic(n);const{namespaces:c}=this.client.session.get(n);if(!ap(c,a)){const{message:u}=ue("MISSING_OR_INVALID",`emit() chainId: ${a}`);throw new Error(u)}if(!n3(i)){const{message:u}=ue("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(i)}`);throw new Error(u)}if(!s3(c,a,i.name)){const{message:u}=ue("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(i)}`);throw new Error(u)}},this.isValidDisconnect=async t=>{if(!Rr(t)){const{message:i}=ue("MISSING_OR_INVALID",`disconnect() params: ${t}`);throw new Error(i)}const{topic:n}=t;await this.isValidSessionOrPairingTopic(n)},this.getVerifyContext=async(t,n)=>{const i={verified:{verifyUrl:n.verifyUrl||Cs,validation:"UNKNOWN",origin:n.url||""}};try{const a=await this.client.core.verify.resolve({attestationId:t,verifyUrl:n.verifyUrl});a&&(i.verified.origin=a.origin,i.verified.isScam=a.isScam,i.verified.validation=a.origin===new URL(n.url).origin?"VALID":"INVALID")}catch(a){this.client.logger.info(a)}return this.client.logger.info(`Verify context: ${JSON.stringify(i)}`),i},this.validateSessionProps=(t,n)=>{Object.values(t).forEach(i=>{if(!ir(i,!1)){const{message:a}=ue("MISSING_OR_INVALID",`${n} must be in Record<string, string> format. Received: ${JSON.stringify(i)}`);throw new Error(a)}})}}async isInitialized(){if(!this.initialized){const{message:e}=ue("NOT_INITIALIZED",this.name);throw new Error(e)}await this.client.core.relayer.confirmOnlineStateOrThrow()}registerRelayerEvents(){this.client.core.relayer.on(pr.message,async e=>{const{topic:t,message:n}=e;if(this.ignoredPayloadTypes.includes(this.client.core.crypto.getPayloadType(n)))return;const i=await this.client.core.crypto.decode(t,n);try{Tu(i)?(this.client.core.history.set(t,i),this.onRelayEventRequest({topic:t,payload:i})):Wa(i)?(await this.client.core.history.resolve(i),await this.onRelayEventResponse({topic:t,payload:i}),this.client.core.history.delete(t,i.id)):this.onRelayEventUnknownPayload({topic:t,payload:i})}catch(a){this.client.logger.error(a)}})}registerExpirerEvents(){this.client.core.expirer.on(en.expired,async e=>{const{topic:t,id:n}=ep(e.target);if(n&&this.client.pendingRequest.keys.includes(n))return await this.deletePendingSessionRequest(n,ue("EXPIRED"),!0);t?this.client.session.keys.includes(t)&&(await this.deleteSession({topic:t,expirerHasDeleted:!0}),this.client.events.emit("session_expire",{topic:t})):n&&(await this.deleteProposal(n,!0),this.client.events.emit("proposal_expire",{id:n}))})}registerPairingEvents(){this.client.core.pairing.events.on(No.create,e=>this.onPairingCreated(e))}isValidPairingTopic(e){if(!ir(e,!1)){const{message:t}=ue("MISSING_OR_INVALID",`pairing topic should be a string: ${e}`);throw new Error(t)}if(!this.client.core.pairing.pairings.keys.includes(e)){const{message:t}=ue("NO_MATCHING_KEY",`pairing topic doesn't exist: ${e}`);throw new Error(t)}if(ii(this.client.core.pairing.pairings.get(e).expiry)){const{message:t}=ue("EXPIRED",`pairing topic: ${e}`);throw new Error(t)}}async isValidSessionTopic(e){if(!ir(e,!1)){const{message:t}=ue("MISSING_OR_INVALID",`session topic should be a string: ${e}`);throw new Error(t)}if(!this.client.session.keys.includes(e)){const{message:t}=ue("NO_MATCHING_KEY",`session topic doesn't exist: ${e}`);throw new Error(t)}if(ii(this.client.session.get(e).expiry)){await this.deleteSession({topic:e});const{message:t}=ue("EXPIRED",`session topic: ${e}`);throw new Error(t)}if(!this.client.core.crypto.keychain.has(e)){const{message:t}=ue("MISSING_OR_INVALID",`session topic does not exist in keychain: ${e}`);throw await this.deleteSession({topic:e}),new Error(t)}}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(ir(e,!1)){const{message:t}=ue("NO_MATCHING_KEY",`session or pairing topic doesn't exist: ${e}`);throw new Error(t)}else{const{message:t}=ue("MISSING_OR_INVALID",`session or pairing topic should be a string: ${e}`);throw new Error(t)}}async isValidProposalId(e){if(!X_(e)){const{message:t}=ue("MISSING_OR_INVALID",`proposal id should be a number: ${e}`);throw new Error(t)}if(!this.client.proposal.keys.includes(e)){const{message:t}=ue("NO_MATCHING_KEY",`proposal id doesn't exist: ${e}`);throw new Error(t)}if(ii(this.client.proposal.get(e).expiryTimestamp)){await this.deleteProposal(e);const{message:t}=ue("EXPIRED",`proposal id: ${e}`);throw new Error(t)}}}class V8 extends Va{constructor(e,t){super(e,t,M8,qu),this.core=e,this.logger=t}}class G8 extends Va{constructor(e,t){super(e,t,U8,qu),this.core=e,this.logger=t}}class Y8 extends Va{constructor(e,t){super(e,t,F8,qu,n=>n.id),this.core=e,this.logger=t}}class Wu extends Q5{constructor(e){super(e),this.protocol=R1,this.version=N1,this.name=zu.name,this.events=new lr.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||zu.name,this.metadata=e?.metadata||p_();const t=typeof e?.logger<"u"&&typeof e?.logger!="string"?e.logger:Xe.pino(Xe.getDefaultLoggerOptions({level:e?.logger||zu.logger}));this.core=e?.core||new L8(e),this.logger=Xe.generateChildLogger(t,this.name),this.session=new G8(this.core,this.logger),this.proposal=new V8(this.core,this.logger),this.pendingRequest=new Y8(this.core,this.logger),this.engine=new K8(this)}static async init(e){const t=new Wu(e);return await t.initialize(),t}get context(){return Xe.getLoggerContext(this.logger)}get pairing(){return this.core.pairing.pairings}async initialize(){this.logger.trace("Initialized");try{await this.core.start(),await this.session.init(),await this.proposal.init(),await this.pendingRequest.init(),await this.engine.init(),this.core.verify.init({verifyUrl:this.metadata.verifyUrl}),this.logger.info("SignClient Initialization Success")}catch(e){throw this.logger.info("SignClient Initialization Failure"),this.logger.error(e.message),e}}}var Ku={exports:{}};(function(r,e){var t=typeof self<"u"?self:yr,n=function(){function a(){this.fetch=!1,this.DOMException=t.DOMException}return a.prototype=t,new a}();(function(a){(function(c){var u={searchParams:"URLSearchParams"in a,iterable:"Symbol"in a&&"iterator"in Symbol,blob:"FileReader"in a&&"Blob"in a&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in a,arrayBuffer:"ArrayBuffer"in a};function f(I){return I&&DataView.prototype.isPrototypeOf(I)}if(u.arrayBuffer)var h=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],m=ArrayBuffer.isView||function(I){return I&&h.indexOf(Object.prototype.toString.call(I))>-1};function w(I){if(typeof I!="string"&&(I=String(I)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(I))throw new TypeError("Invalid character in header field name");return I.toLowerCase()}function y(I){return typeof I!="string"&&(I=String(I)),I}function x(I){var N={next:function(){var X=I.shift();return{done:X===void 0,value:X}}};return u.iterable&&(N[Symbol.iterator]=function(){return N}),N}function S(I){this.map={},I instanceof S?I.forEach(function(N,X){this.append(X,N)},this):Array.isArray(I)?I.forEach(function(N){this.append(N[0],N[1])},this):I&&Object.getOwnPropertyNames(I).forEach(function(N){this.append(N,I[N])},this)}S.prototype.append=function(I,N){I=w(I),N=y(N);var X=this.map[I];this.map[I]=X?X+", "+N:N},S.prototype.delete=function(I){delete this.map[w(I)]},S.prototype.get=function(I){return I=w(I),this.has(I)?this.map[I]:null},S.prototype.has=function(I){return this.map.hasOwnProperty(w(I))},S.prototype.set=function(I,N){this.map[w(I)]=y(N)},S.prototype.forEach=function(I,N){for(var X in this.map)this.map.hasOwnProperty(X)&&I.call(N,this.map[X],X,this)},S.prototype.keys=function(){var I=[];return this.forEach(function(N,X){I.push(X)}),x(I)},S.prototype.values=function(){var I=[];return this.forEach(function(N){I.push(N)}),x(I)},S.prototype.entries=function(){var I=[];return this.forEach(function(N,X){I.push([X,N])}),x(I)},u.iterable&&(S.prototype[Symbol.iterator]=S.prototype.entries);function P(I){if(I.bodyUsed)return Promise.reject(new TypeError("Already read"));I.bodyUsed=!0}function U(I){return new Promise(function(N,X){I.onload=function(){N(I.result)},I.onerror=function(){X(I.error)}})}function j(I){var N=new FileReader,X=U(N);return N.readAsArrayBuffer(I),X}function A(I){var N=new FileReader,X=U(N);return N.readAsText(I),X}function T(I){for(var N=new Uint8Array(I),X=new Array(N.length),ee=0;ee<N.length;ee++)X[ee]=String.fromCharCode(N[ee]);return X.join("")}function C(I){if(I.slice)return I.slice(0);var N=new Uint8Array(I.byteLength);return N.set(new Uint8Array(I)),N.buffer}function $(){return this.bodyUsed=!1,this._initBody=function(I){this._bodyInit=I,I?typeof I=="string"?this._bodyText=I:u.blob&&Blob.prototype.isPrototypeOf(I)?this._bodyBlob=I:u.formData&&FormData.prototype.isPrototypeOf(I)?this._bodyFormData=I:u.searchParams&&URLSearchParams.prototype.isPrototypeOf(I)?this._bodyText=I.toString():u.arrayBuffer&&u.blob&&f(I)?(this._bodyArrayBuffer=C(I.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):u.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(I)||m(I))?this._bodyArrayBuffer=C(I):this._bodyText=I=Object.prototype.toString.call(I):this._bodyText="",this.headers.get("content-type")||(typeof I=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):u.searchParams&&URLSearchParams.prototype.isPrototypeOf(I)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},u.blob&&(this.blob=function(){var I=P(this);if(I)return I;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?P(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(j)}),this.text=function(){var I=P(this);if(I)return I;if(this._bodyBlob)return A(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(T(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},u.formData&&(this.formData=function(){return this.text().then(H)}),this.json=function(){return this.text().then(JSON.parse)},this}var E=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function d(I){var N=I.toUpperCase();return E.indexOf(N)>-1?N:I}function b(I,N){N=N||{};var X=N.body;if(I instanceof b){if(I.bodyUsed)throw new TypeError("Already read");this.url=I.url,this.credentials=I.credentials,N.headers||(this.headers=new S(I.headers)),this.method=I.method,this.mode=I.mode,this.signal=I.signal,!X&&I._bodyInit!=null&&(X=I._bodyInit,I.bodyUsed=!0)}else this.url=String(I);if(this.credentials=N.credentials||this.credentials||"same-origin",(N.headers||!this.headers)&&(this.headers=new S(N.headers)),this.method=d(N.method||this.method||"GET"),this.mode=N.mode||this.mode||null,this.signal=N.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&X)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(X)}b.prototype.clone=function(){return new b(this,{body:this._bodyInit})};function H(I){var N=new FormData;return I.trim().split("&").forEach(function(X){if(X){var ee=X.split("="),Y=ee.shift().replace(/\+/g," "),J=ee.join("=").replace(/\+/g," ");N.append(decodeURIComponent(Y),decodeURIComponent(J))}}),N}function F(I){var N=new S,X=I.replace(/\r?\n[\t ]+/g," ");return X.split(/\r?\n/).forEach(function(ee){var Y=ee.split(":"),J=Y.shift().trim();if(J){var Q=Y.join(":").trim();N.append(J,Q)}}),N}$.call(b.prototype);function V(I,N){N||(N={}),this.type="default",this.status=N.status===void 0?200:N.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in N?N.statusText:"OK",this.headers=new S(N.headers),this.url=N.url||"",this._initBody(I)}$.call(V.prototype),V.prototype.clone=function(){return new V(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new S(this.headers),url:this.url})},V.error=function(){var I=new V(null,{status:0,statusText:""});return I.type="error",I};var se=[301,302,303,307,308];V.redirect=function(I,N){if(se.indexOf(N)===-1)throw new RangeError("Invalid status code");return new V(null,{status:N,headers:{location:I}})},c.DOMException=a.DOMException;try{new c.DOMException}catch{c.DOMException=function(N,X){this.message=N,this.name=X;var ee=Error(N);this.stack=ee.stack},c.DOMException.prototype=Object.create(Error.prototype),c.DOMException.prototype.constructor=c.DOMException}function ce(I,N){return new Promise(function(X,ee){var Y=new b(I,N);if(Y.signal&&Y.signal.aborted)return ee(new c.DOMException("Aborted","AbortError"));var J=new XMLHttpRequest;function Q(){J.abort()}J.onload=function(){var ie={status:J.status,statusText:J.statusText,headers:F(J.getAllResponseHeaders()||"")};ie.url="responseURL"in J?J.responseURL:ie.headers.get("X-Request-URL");var Ee="response"in J?J.response:J.responseText;X(new V(Ee,ie))},J.onerror=function(){ee(new TypeError("Network request failed"))},J.ontimeout=function(){ee(new TypeError("Network request failed"))},J.onabort=function(){ee(new c.DOMException("Aborted","AbortError"))},J.open(Y.method,Y.url,!0),Y.credentials==="include"?J.withCredentials=!0:Y.credentials==="omit"&&(J.withCredentials=!1),"responseType"in J&&u.blob&&(J.responseType="blob"),Y.headers.forEach(function(ie,Ee){J.setRequestHeader(Ee,ie)}),Y.signal&&(Y.signal.addEventListener("abort",Q),J.onreadystatechange=function(){J.readyState===4&&Y.signal.removeEventListener("abort",Q)}),J.send(typeof Y._bodyInit>"u"?null:Y._bodyInit)})}return ce.polyfill=!0,a.fetch||(a.fetch=ce,a.Headers=S,a.Request=b,a.Response=V),c.Headers=S,c.Request=b,c.Response=V,c.fetch=ce,Object.defineProperty(c,"__esModule",{value:!0}),c})({})})(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,r.exports=e})(Ku,Ku.exports);var B1=Oy(Ku.exports);const k1={headers:{Accept:"application/json","Content-Type":"application/json"},method:"POST"},q1=10;class oi{constructor(e,t=!1){if(this.url=e,this.disableProviderPing=t,this.events=new lr.exports.EventEmitter,this.isAvailable=!1,this.registering=!1,!Vp(e))throw new Error(`Provided URL is not compatible with HTTP connection: ${e}`);this.url=e,this.disableProviderPing=t}get connected(){return this.isAvailable}get connecting(){return this.registering}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}off(e,t){this.events.off(e,t)}removeListener(e,t){this.events.removeListener(e,t)}async open(e=this.url){await this.register(e)}async close(){if(!this.isAvailable)throw new Error("Connection already closed");this.onClose()}async send(e,t){this.isAvailable||await this.register();try{const n=ji(e),a=await(await B1(this.url,Object.assign(Object.assign({},k1),{body:n}))).json();this.onPayload({data:a})}catch(n){this.onError(e.id,n)}}async register(e=this.url){if(!Vp(e))throw new Error(`Provided URL is not compatible with HTTP connection: ${e}`);if(this.registering){const t=this.events.getMaxListeners();return(this.events.listenerCount("register_error")>=t||this.events.listenerCount("open")>=t)&&this.events.setMaxListeners(t+1),new Promise((n,i)=>{this.events.once("register_error",a=>{this.resetMaxListeners(),i(a)}),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{if(!this.disableProviderPing){const t=ji({id:1,jsonrpc:"2.0",method:"test",params:[]});await B1(e,Object.assign(Object.assign({},k1),{body:t}))}this.onOpen()}catch(t){const n=this.parseError(t);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 t=typeof e.data=="string"?Do(e.data):e.data;this.events.emit("payload",t)}onError(e,t){const n=this.parseError(t),i=n.message||n.toString(),a=Ha(e,i);this.events.emit("payload",a)}parseError(e,t=this.url){return Bp(e,t,"HTTP")}resetMaxListeners(){this.events.getMaxListeners()>q1&&this.events.setMaxListeners(q1)}}const z1="error",J8="wss://relay.walletconnect.com",Z8="wc",Q8="universal_provider",H1=`${Z8}@2:${Q8}:`,X8="https://rpc.walletconnect.com/v1/",kn={DEFAULT_CHAIN_CHANGED:"default_chain_changed"};var Mo=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Vu={exports:{}};/**
60
60
  * @license
61
61
  * Lodash <https://lodash.com/>
62
62
  * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
63
63
  * Released under MIT license <https://lodash.com/license>
64
64
  * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
65
65
  * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
66
- */(function(r,e){(function(){var t,n="4.17.21",i=200,a="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",c="Expected a function",u="Invalid `variable` option passed into `_.template`",d="__lodash_hash_undefined__",h=500,m="__lodash_placeholder__",y=1,w=2,E=4,I=1,T=2,U=1,F=2,$=4,P=8,O=16,A=32,x=64,f=128,b=256,q=512,j=30,V="...",se=800,ce=16,D=1,N=2,X=3,ee=1/0,Y=9007199254740991,J=17976931348623157e292,Q=0/0,ie=4294967295,Ee=ie-1,ae=ie>>>1,xe=[["ary",f],["bind",U],["bindKey",F],["curry",P],["curryRight",O],["flip",q],["partial",A],["partialRight",x],["rearg",b]],de="[object Arguments]",be="[object Array]",K="[object AsyncFunction]",W="[object Boolean]",B="[object Date]",g="[object DOMException]",L="[object Error]",le="[object Function]",pe="[object GeneratorFunction]",Oe="[object Map]",Ke="[object Number]",Je="[object Null]",ke="[object Object]",Dt="[object Promise]",St="[object Proxy]",ze="[object RegExp]",Ce="[object Set]",Ue="[object String]",je="[object Symbol]",qe="[object Undefined]",Ae="[object WeakMap]",Fe="[object WeakSet]",Se="[object ArrayBuffer]",Te="[object DataView]",Ve="[object Float32Array]",$e="[object Float64Array]",Ze="[object Int8Array]",et="[object Int16Array]",at="[object Int32Array]",ct="[object Uint8Array]",nt="[object Uint8ClampedArray]",Dr="[object Uint16Array]",Ur="[object Uint32Array]",Cn=/\b__p \+= '';/g,Sr=/\b(__p \+=) '' \+/g,qn=/(__e\(.*?\)|\b__t\)) \+\n'';/g,yi=/&(?:amp|lt|gt|quot|#39);/g,ts=/[&<>"']/g,Lt=RegExp(yi.source),Ot=RegExp(ts.source),Mt=/<%-([\s\S]+?)%>/g,Ut=/<%([\s\S]+?)%>/g,Pt=/<%=([\s\S]+?)%>/g,Ct=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Gt=/^\w*$/,Yt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,jt=/[\\^$.*+?()[\]{}|]/g,Jt=RegExp(jt.source),Ft=/^\s+/,zt=/\s/,Bt=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,_t=/\{\n\/\* \[wrapped with (.+)\] \*/,Zt=/,? & /,Qt=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,lf=/[()=,{}\[\]\/\s]/,uf=/\\(\\)?/g,hf=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,tn=/\w*$/,ff=/^[-+]0x[0-9a-f]+$/i,df=/^0b[01]+$/i,pf=/^\[object .+?Constructor\]$/,gf=/^0o[0-7]+$/i,mf=/^(?:0|[1-9]\d*)$/,Wn=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Ws=/($^)/,vf=/['\n\r\u2028\u2029\\]/g,Ks="\\ud800-\\udfff",wf="\\u0300-\\u036f",yf="\\ufe20-\\ufe2f",Vs="\\u20d0-\\u20ff",Cc=wf+yf+Vs,$c="\\u2700-\\u27bf",gn="a-z\\xdf-\\xf6\\xf8-\\xff",bf="\\xac\\xb1\\xd7\\xf7",_f="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Ef="\\u2000-\\u206f",xf=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Ac="A-Z\\xc0-\\xd6\\xd8-\\xde",Pc="\\ufe0e\\ufe0f",rs=bf+_f+Ef+xf,na="['\u2019]",ns="["+Ks+"]",ia="["+rs+"]",is="["+Cc+"]",Tc="\\d+",If="["+$c+"]",Rc="["+gn+"]",Nc="[^"+Ks+rs+Tc+$c+gn+Ac+"]",Gs="\\ud83c[\\udffb-\\udfff]",Df="(?:"+is+"|"+Gs+")",Lc="[^"+Ks+"]",Ys="(?:\\ud83c[\\udde6-\\uddff]){2}",bi="[\\ud800-\\udbff][\\udc00-\\udfff]",Vr="["+Ac+"]",Mc="\\u200d",Uc="(?:"+Rc+"|"+Nc+")",$n="(?:"+Vr+"|"+Nc+")",jc="(?:"+na+"(?:d|ll|m|re|s|t|ve))?",Fc="(?:"+na+"(?:D|LL|M|RE|S|T|VE))?",Bc=Df+"?",kc="["+Pc+"]?",Sf="(?:"+Mc+"(?:"+[Lc,Ys,bi].join("|")+")"+kc+Bc+")*",Kn="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Hc="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",zc=kc+Bc+Sf,Js="(?:"+[If,Ys,bi].join("|")+")"+zc,Of="(?:"+[Lc+is+"?",is,Ys,bi,ns].join("|")+")",sa=RegExp(na,"g"),Cf=RegExp(is,"g"),Zs=RegExp(Gs+"(?="+Gs+")|"+Of+zc,"g"),qc=RegExp([Vr+"?"+Rc+"+"+jc+"(?="+[ia,Vr,"$"].join("|")+")",$n+"+"+Fc+"(?="+[ia,Vr+Uc,"$"].join("|")+")",Vr+"?"+Uc+"+"+jc,Vr+"+"+Fc,Hc,Kn,Tc,Js].join("|"),"g"),Wc=RegExp("["+Mc+Ks+Cc+Pc+"]"),ss=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Kc=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],$f=-1,mt={};mt[Ve]=mt[$e]=mt[Ze]=mt[et]=mt[at]=mt[ct]=mt[nt]=mt[Dr]=mt[Ur]=!0,mt[de]=mt[be]=mt[Se]=mt[W]=mt[Te]=mt[B]=mt[L]=mt[le]=mt[Oe]=mt[Ke]=mt[ke]=mt[ze]=mt[Ce]=mt[Ue]=mt[Ae]=!1;var gt={};gt[de]=gt[be]=gt[Se]=gt[Te]=gt[W]=gt[B]=gt[Ve]=gt[$e]=gt[Ze]=gt[et]=gt[at]=gt[Oe]=gt[Ke]=gt[ke]=gt[ze]=gt[Ce]=gt[Ue]=gt[je]=gt[ct]=gt[nt]=gt[Dr]=gt[Ur]=!0,gt[L]=gt[le]=gt[Ae]=!1;var C={\u00C0:"A",\u00C1:"A",\u00C2:"A",\u00C3:"A",\u00C4:"A",\u00C5:"A",\u00E0:"a",\u00E1:"a",\u00E2:"a",\u00E3:"a",\u00E4:"a",\u00E5:"a",\u00C7:"C",\u00E7:"c",\u00D0:"D",\u00F0:"d",\u00C8:"E",\u00C9:"E",\u00CA:"E",\u00CB:"E",\u00E8:"e",\u00E9:"e",\u00EA:"e",\u00EB:"e",\u00CC:"I",\u00CD:"I",\u00CE:"I",\u00CF:"I",\u00EC:"i",\u00ED:"i",\u00EE:"i",\u00EF:"i",\u00D1:"N",\u00F1:"n",\u00D2:"O",\u00D3:"O",\u00D4:"O",\u00D5:"O",\u00D6:"O",\u00D8:"O",\u00F2:"o",\u00F3:"o",\u00F4:"o",\u00F5:"o",\u00F6:"o",\u00F8:"o",\u00D9:"U",\u00DA:"U",\u00DB:"U",\u00DC:"U",\u00F9:"u",\u00FA:"u",\u00FB:"u",\u00FC:"u",\u00DD:"Y",\u00FD:"y",\u00FF:"y",\u00C6:"Ae",\u00E6:"ae",\u00DE:"Th",\u00FE:"th",\u00DF:"ss",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010A:"C",\u010C:"C",\u0107:"c",\u0109:"c",\u010B:"c",\u010D:"c",\u010E:"D",\u0110:"D",\u010F:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011A:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011B:"e",\u011C:"G",\u011E:"G",\u0120:"G",\u0122:"G",\u011D:"g",\u011F:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\u0128:"I",\u012A:"I",\u012C:"I",\u012E:"I",\u0130:"I",\u0129:"i",\u012B:"i",\u012D:"i",\u012F:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013B:"L",\u013D:"L",\u013F:"L",\u0141:"L",\u013A:"l",\u013C:"l",\u013E:"l",\u0140:"l",\u0142:"l",\u0143:"N",\u0145:"N",\u0147:"N",\u014A:"N",\u0144:"n",\u0146:"n",\u0148:"n",\u014B:"n",\u014C:"O",\u014E:"O",\u0150:"O",\u014D:"o",\u014F:"o",\u0151:"o",\u0154:"R",\u0156:"R",\u0158:"R",\u0155:"r",\u0157:"r",\u0159:"r",\u015A:"S",\u015C:"S",\u015E:"S",\u0160:"S",\u015B:"s",\u015D:"s",\u015F:"s",\u0161:"s",\u0162:"T",\u0164:"T",\u0166:"T",\u0163:"t",\u0165:"t",\u0167:"t",\u0168:"U",\u016A:"U",\u016C:"U",\u016E:"U",\u0170:"U",\u0172:"U",\u0169:"u",\u016B:"u",\u016D:"u",\u016F:"u",\u0171:"u",\u0173:"u",\u0174:"W",\u0175:"w",\u0176:"Y",\u0177:"y",\u0178:"Y",\u0179:"Z",\u017B:"Z",\u017D:"Z",\u017A:"z",\u017C:"z",\u017E:"z",\u0132:"IJ",\u0133:"ij",\u0152:"Oe",\u0153:"oe",\u0149:"'n",\u017F:"s"},k={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},ne={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},ge={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},vt=parseFloat,Ne=parseInt,Et=typeof Mo=="object"&&Mo&&Mo.Object===Object&&Mo,Xt=typeof self=="object"&&self&&self.Object===Object&&self,it=Et||Xt||Function("return this")(),wt=e&&!e.nodeType&&e,qt=wt&&!0&&r&&!r.nodeType&&r,jr=qt&&qt.exports===wt,er=jr&&Et.process,xt=function(){try{var H=qt&&qt.require&&qt.require("util").types;return H||er&&er.binding&&er.binding("util")}catch{}}(),Or=xt&&xt.isArrayBuffer,mn=xt&&xt.isDate,rn=xt&&xt.isMap,An=xt&&xt.isRegExp,oa=xt&&xt.isSet,os=xt&&xt.isTypedArray;function ar(H,Z,G){switch(G.length){case 0:return H.call(Z);case 1:return H.call(Z,G[0]);case 2:return H.call(Z,G[0],G[1]);case 3:return H.call(Z,G[0],G[1],G[2])}return H.apply(Z,G)}function cC(H,Z,G,me){for(var Re=-1,ut=H==null?0:H.length;++Re<ut;){var rr=H[Re];Z(me,rr,G(rr),H)}return me}function nn(H,Z){for(var G=-1,me=H==null?0:H.length;++G<me&&Z(H[G],G,H)!==!1;);return H}function lC(H,Z){for(var G=H==null?0:H.length;G--&&Z(H[G],G,H)!==!1;);return H}function Cm(H,Z){for(var G=-1,me=H==null?0:H.length;++G<me;)if(!Z(H[G],G,H))return!1;return!0}function _i(H,Z){for(var G=-1,me=H==null?0:H.length,Re=0,ut=[];++G<me;){var rr=H[G];Z(rr,G,H)&&(ut[Re++]=rr)}return ut}function Vc(H,Z){var G=H==null?0:H.length;return!!G&&Qs(H,Z,0)>-1}function Af(H,Z,G){for(var me=-1,Re=H==null?0:H.length;++me<Re;)if(G(Z,H[me]))return!0;return!1}function $t(H,Z){for(var G=-1,me=H==null?0:H.length,Re=Array(me);++G<me;)Re[G]=Z(H[G],G,H);return Re}function Ei(H,Z){for(var G=-1,me=Z.length,Re=H.length;++G<me;)H[Re+G]=Z[G];return H}function Pf(H,Z,G,me){var Re=-1,ut=H==null?0:H.length;for(me&&ut&&(G=H[++Re]);++Re<ut;)G=Z(G,H[Re],Re,H);return G}function uC(H,Z,G,me){var Re=H==null?0:H.length;for(me&&Re&&(G=H[--Re]);Re--;)G=Z(G,H[Re],Re,H);return G}function Tf(H,Z){for(var G=-1,me=H==null?0:H.length;++G<me;)if(Z(H[G],G,H))return!0;return!1}var hC=Rf("length");function fC(H){return H.split("")}function dC(H){return H.match(Qt)||[]}function $m(H,Z,G){var me;return G(H,function(Re,ut,rr){if(Z(Re,ut,rr))return me=ut,!1}),me}function Gc(H,Z,G,me){for(var Re=H.length,ut=G+(me?1:-1);me?ut--:++ut<Re;)if(Z(H[ut],ut,H))return ut;return-1}function Qs(H,Z,G){return Z===Z?DC(H,Z,G):Gc(H,Am,G)}function pC(H,Z,G,me){for(var Re=G-1,ut=H.length;++Re<ut;)if(me(H[Re],Z))return Re;return-1}function Am(H){return H!==H}function Pm(H,Z){var G=H==null?0:H.length;return G?Lf(H,Z)/G:Q}function Rf(H){return function(Z){return Z==null?t:Z[H]}}function Nf(H){return function(Z){return H==null?t:H[Z]}}function Tm(H,Z,G,me,Re){return Re(H,function(ut,rr,yt){G=me?(me=!1,ut):Z(G,ut,rr,yt)}),G}function gC(H,Z){var G=H.length;for(H.sort(Z);G--;)H[G]=H[G].value;return H}function Lf(H,Z){for(var G,me=-1,Re=H.length;++me<Re;){var ut=Z(H[me]);ut!==t&&(G=G===t?ut:G+ut)}return G}function Mf(H,Z){for(var G=-1,me=Array(H);++G<H;)me[G]=Z(G);return me}function mC(H,Z){return $t(Z,function(G){return[G,H[G]]})}function Rm(H){return H&&H.slice(0,Um(H)+1).replace(Ft,"")}function Gr(H){return function(Z){return H(Z)}}function Uf(H,Z){return $t(Z,function(G){return H[G]})}function aa(H,Z){return H.has(Z)}function Nm(H,Z){for(var G=-1,me=H.length;++G<me&&Qs(Z,H[G],0)>-1;);return G}function Lm(H,Z){for(var G=H.length;G--&&Qs(Z,H[G],0)>-1;);return G}function vC(H,Z){for(var G=H.length,me=0;G--;)H[G]===Z&&++me;return me}var wC=Nf(C),yC=Nf(k);function bC(H){return"\\"+ge[H]}function _C(H,Z){return H==null?t:H[Z]}function Xs(H){return Wc.test(H)}function EC(H){return ss.test(H)}function xC(H){for(var Z,G=[];!(Z=H.next()).done;)G.push(Z.value);return G}function jf(H){var Z=-1,G=Array(H.size);return H.forEach(function(me,Re){G[++Z]=[Re,me]}),G}function Mm(H,Z){return function(G){return H(Z(G))}}function xi(H,Z){for(var G=-1,me=H.length,Re=0,ut=[];++G<me;){var rr=H[G];(rr===Z||rr===m)&&(H[G]=m,ut[Re++]=G)}return ut}function Yc(H){var Z=-1,G=Array(H.size);return H.forEach(function(me){G[++Z]=me}),G}function IC(H){var Z=-1,G=Array(H.size);return H.forEach(function(me){G[++Z]=[me,me]}),G}function DC(H,Z,G){for(var me=G-1,Re=H.length;++me<Re;)if(H[me]===Z)return me;return-1}function SC(H,Z,G){for(var me=G+1;me--;)if(H[me]===Z)return me;return me}function eo(H){return Xs(H)?CC(H):hC(H)}function vn(H){return Xs(H)?$C(H):fC(H)}function Um(H){for(var Z=H.length;Z--&&zt.test(H.charAt(Z)););return Z}var OC=Nf(ne);function CC(H){for(var Z=Zs.lastIndex=0;Zs.test(H);)++Z;return Z}function $C(H){return H.match(Zs)||[]}function AC(H){return H.match(qc)||[]}var PC=function H(Z){Z=Z==null?it:to.defaults(it.Object(),Z,to.pick(it,Kc));var G=Z.Array,me=Z.Date,Re=Z.Error,ut=Z.Function,rr=Z.Math,yt=Z.Object,Ff=Z.RegExp,TC=Z.String,sn=Z.TypeError,Jc=G.prototype,RC=ut.prototype,ro=yt.prototype,Zc=Z["__core-js_shared__"],Qc=RC.toString,dt=ro.hasOwnProperty,NC=0,jm=function(){var s=/[^.]+$/.exec(Zc&&Zc.keys&&Zc.keys.IE_PROTO||"");return s?"Symbol(src)_1."+s:""}(),Xc=ro.toString,LC=Qc.call(yt),MC=it._,UC=Ff("^"+Qc.call(dt).replace(jt,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),el=jr?Z.Buffer:t,Ii=Z.Symbol,tl=Z.Uint8Array,Fm=el?el.allocUnsafe:t,rl=Mm(yt.getPrototypeOf,yt),Bm=yt.create,km=ro.propertyIsEnumerable,nl=Jc.splice,Hm=Ii?Ii.isConcatSpreadable:t,ca=Ii?Ii.iterator:t,as=Ii?Ii.toStringTag:t,il=function(){try{var s=fs(yt,"defineProperty");return s({},"",{}),s}catch{}}(),jC=Z.clearTimeout!==it.clearTimeout&&Z.clearTimeout,FC=me&&me.now!==it.Date.now&&me.now,BC=Z.setTimeout!==it.setTimeout&&Z.setTimeout,sl=rr.ceil,ol=rr.floor,Bf=yt.getOwnPropertySymbols,kC=el?el.isBuffer:t,zm=Z.isFinite,HC=Jc.join,zC=Mm(yt.keys,yt),nr=rr.max,mr=rr.min,qC=me.now,WC=Z.parseInt,qm=rr.random,KC=Jc.reverse,kf=fs(Z,"DataView"),la=fs(Z,"Map"),Hf=fs(Z,"Promise"),no=fs(Z,"Set"),ua=fs(Z,"WeakMap"),ha=fs(yt,"create"),al=ua&&new ua,io={},VC=ds(kf),GC=ds(la),YC=ds(Hf),JC=ds(no),ZC=ds(ua),cl=Ii?Ii.prototype:t,fa=cl?cl.valueOf:t,Wm=cl?cl.toString:t;function _(s){if(kt(s)&&!Le(s)&&!(s instanceof tt)){if(s instanceof on)return s;if(dt.call(s,"__wrapped__"))return Kv(s)}return new on(s)}var so=function(){function s(){}return function(o){if(!Tt(o))return{};if(Bm)return Bm(o);s.prototype=o;var l=new s;return s.prototype=t,l}}();function ll(){}function on(s,o){this.__wrapped__=s,this.__actions__=[],this.__chain__=!!o,this.__index__=0,this.__values__=t}_.templateSettings={escape:Mt,evaluate:Ut,interpolate:Pt,variable:"",imports:{_}},_.prototype=ll.prototype,_.prototype.constructor=_,on.prototype=so(ll.prototype),on.prototype.constructor=on;function tt(s){this.__wrapped__=s,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=ie,this.__views__=[]}function QC(){var s=new tt(this.__wrapped__);return s.__actions__=Fr(this.__actions__),s.__dir__=this.__dir__,s.__filtered__=this.__filtered__,s.__iteratees__=Fr(this.__iteratees__),s.__takeCount__=this.__takeCount__,s.__views__=Fr(this.__views__),s}function XC(){if(this.__filtered__){var s=new tt(this);s.__dir__=-1,s.__filtered__=!0}else s=this.clone(),s.__dir__*=-1;return s}function e7(){var s=this.__wrapped__.value(),o=this.__dir__,l=Le(s),p=o<0,v=l?s.length:0,S=f$(0,v,this.__views__),R=S.start,M=S.end,z=M-R,te=p?M:R-1,re=this.__iteratees__,oe=re.length,fe=0,ve=mr(z,this.__takeCount__);if(!l||!p&&v==z&&ve==z)return gv(s,this.__actions__);var Ie=[];e:for(;z--&&fe<ve;){te+=o;for(var We=-1,De=s[te];++We<oe;){var Qe=re[We],st=Qe.iteratee,Zr=Qe.type,Ar=st(De);if(Zr==N)De=Ar;else if(!Ar){if(Zr==D)continue e;break e}}Ie[fe++]=De}return Ie}tt.prototype=so(ll.prototype),tt.prototype.constructor=tt;function cs(s){var o=-1,l=s==null?0:s.length;for(this.clear();++o<l;){var p=s[o];this.set(p[0],p[1])}}function t7(){this.__data__=ha?ha(null):{},this.size=0}function r7(s){var o=this.has(s)&&delete this.__data__[s];return this.size-=o?1:0,o}function n7(s){var o=this.__data__;if(ha){var l=o[s];return l===d?t:l}return dt.call(o,s)?o[s]:t}function i7(s){var o=this.__data__;return ha?o[s]!==t:dt.call(o,s)}function s7(s,o){var l=this.__data__;return this.size+=this.has(s)?0:1,l[s]=ha&&o===t?d:o,this}cs.prototype.clear=t7,cs.prototype.delete=r7,cs.prototype.get=n7,cs.prototype.has=i7,cs.prototype.set=s7;function Vn(s){var o=-1,l=s==null?0:s.length;for(this.clear();++o<l;){var p=s[o];this.set(p[0],p[1])}}function o7(){this.__data__=[],this.size=0}function a7(s){var o=this.__data__,l=ul(o,s);if(l<0)return!1;var p=o.length-1;return l==p?o.pop():nl.call(o,l,1),--this.size,!0}function c7(s){var o=this.__data__,l=ul(o,s);return l<0?t:o[l][1]}function l7(s){return ul(this.__data__,s)>-1}function u7(s,o){var l=this.__data__,p=ul(l,s);return p<0?(++this.size,l.push([s,o])):l[p][1]=o,this}Vn.prototype.clear=o7,Vn.prototype.delete=a7,Vn.prototype.get=c7,Vn.prototype.has=l7,Vn.prototype.set=u7;function Gn(s){var o=-1,l=s==null?0:s.length;for(this.clear();++o<l;){var p=s[o];this.set(p[0],p[1])}}function h7(){this.size=0,this.__data__={hash:new cs,map:new(la||Vn),string:new cs}}function f7(s){var o=El(this,s).delete(s);return this.size-=o?1:0,o}function d7(s){return El(this,s).get(s)}function p7(s){return El(this,s).has(s)}function g7(s,o){var l=El(this,s),p=l.size;return l.set(s,o),this.size+=l.size==p?0:1,this}Gn.prototype.clear=h7,Gn.prototype.delete=f7,Gn.prototype.get=d7,Gn.prototype.has=p7,Gn.prototype.set=g7;function ls(s){var o=-1,l=s==null?0:s.length;for(this.__data__=new Gn;++o<l;)this.add(s[o])}function m7(s){return this.__data__.set(s,d),this}function v7(s){return this.__data__.has(s)}ls.prototype.add=ls.prototype.push=m7,ls.prototype.has=v7;function wn(s){var o=this.__data__=new Vn(s);this.size=o.size}function w7(){this.__data__=new Vn,this.size=0}function y7(s){var o=this.__data__,l=o.delete(s);return this.size=o.size,l}function b7(s){return this.__data__.get(s)}function _7(s){return this.__data__.has(s)}function E7(s,o){var l=this.__data__;if(l instanceof Vn){var p=l.__data__;if(!la||p.length<i-1)return p.push([s,o]),this.size=++l.size,this;l=this.__data__=new Gn(p)}return l.set(s,o),this.size=l.size,this}wn.prototype.clear=w7,wn.prototype.delete=y7,wn.prototype.get=b7,wn.prototype.has=_7,wn.prototype.set=E7;function Km(s,o){var l=Le(s),p=!l&&ps(s),v=!l&&!p&&$i(s),S=!l&&!p&&!v&&lo(s),R=l||p||v||S,M=R?Mf(s.length,TC):[],z=M.length;for(var te in s)(o||dt.call(s,te))&&!(R&&(te=="length"||v&&(te=="offset"||te=="parent")||S&&(te=="buffer"||te=="byteLength"||te=="byteOffset")||Qn(te,z)))&&M.push(te);return M}function Vm(s){var o=s.length;return o?s[Xf(0,o-1)]:t}function x7(s,o){return xl(Fr(s),us(o,0,s.length))}function I7(s){return xl(Fr(s))}function zf(s,o,l){(l!==t&&!yn(s[o],l)||l===t&&!(o in s))&&Yn(s,o,l)}function da(s,o,l){var p=s[o];(!(dt.call(s,o)&&yn(p,l))||l===t&&!(o in s))&&Yn(s,o,l)}function ul(s,o){for(var l=s.length;l--;)if(yn(s[l][0],o))return l;return-1}function D7(s,o,l,p){return Di(s,function(v,S,R){o(p,v,l(v),R)}),p}function Gm(s,o){return s&&Tn(o,cr(o),s)}function S7(s,o){return s&&Tn(o,kr(o),s)}function Yn(s,o,l){o=="__proto__"&&il?il(s,o,{configurable:!0,enumerable:!0,value:l,writable:!0}):s[o]=l}function qf(s,o){for(var l=-1,p=o.length,v=G(p),S=s==null;++l<p;)v[l]=S?t:Id(s,o[l]);return v}function us(s,o,l){return s===s&&(l!==t&&(s=s<=l?s:l),o!==t&&(s=s>=o?s:o)),s}function an(s,o,l,p,v,S){var R,M=o&y,z=o&w,te=o&E;if(l&&(R=v?l(s,p,v,S):l(s)),R!==t)return R;if(!Tt(s))return s;var re=Le(s);if(re){if(R=p$(s),!M)return Fr(s,R)}else{var oe=vr(s),fe=oe==le||oe==pe;if($i(s))return wv(s,M);if(oe==ke||oe==de||fe&&!v){if(R=z||fe?{}:Uv(s),!M)return z?n$(s,S7(R,s)):r$(s,Gm(R,s))}else{if(!gt[oe])return v?s:{};R=g$(s,oe,M)}}S||(S=new wn);var ve=S.get(s);if(ve)return ve;S.set(s,R),fw(s)?s.forEach(function(De){R.add(an(De,o,l,De,s,S))}):uw(s)&&s.forEach(function(De,Qe){R.set(Qe,an(De,o,l,Qe,s,S))});var Ie=te?z?ud:ld:z?kr:cr,We=re?t:Ie(s);return nn(We||s,function(De,Qe){We&&(Qe=De,De=s[Qe]),da(R,Qe,an(De,o,l,Qe,s,S))}),R}function O7(s){var o=cr(s);return function(l){return Ym(l,s,o)}}function Ym(s,o,l){var p=l.length;if(s==null)return!p;for(s=yt(s);p--;){var v=l[p],S=o[v],R=s[v];if(R===t&&!(v in s)||!S(R))return!1}return!0}function Jm(s,o,l){if(typeof s!="function")throw new sn(c);return ba(function(){s.apply(t,l)},o)}function pa(s,o,l,p){var v=-1,S=Vc,R=!0,M=s.length,z=[],te=o.length;if(!M)return z;l&&(o=$t(o,Gr(l))),p?(S=Af,R=!1):o.length>=i&&(S=aa,R=!1,o=new ls(o));e:for(;++v<M;){var re=s[v],oe=l==null?re:l(re);if(re=p||re!==0?re:0,R&&oe===oe){for(var fe=te;fe--;)if(o[fe]===oe)continue e;z.push(re)}else S(o,oe,p)||z.push(re)}return z}var Di=xv(Pn),Zm=xv(Kf,!0);function C7(s,o){var l=!0;return Di(s,function(p,v,S){return l=!!o(p,v,S),l}),l}function hl(s,o,l){for(var p=-1,v=s.length;++p<v;){var S=s[p],R=o(S);if(R!=null&&(M===t?R===R&&!Jr(R):l(R,M)))var M=R,z=S}return z}function $7(s,o,l,p){var v=s.length;for(l=He(l),l<0&&(l=-l>v?0:v+l),p=p===t||p>v?v:He(p),p<0&&(p+=v),p=l>p?0:pw(p);l<p;)s[l++]=o;return s}function Qm(s,o){var l=[];return Di(s,function(p,v,S){o(p,v,S)&&l.push(p)}),l}function fr(s,o,l,p,v){var S=-1,R=s.length;for(l||(l=v$),v||(v=[]);++S<R;){var M=s[S];o>0&&l(M)?o>1?fr(M,o-1,l,p,v):Ei(v,M):p||(v[v.length]=M)}return v}var Wf=Iv(),Xm=Iv(!0);function Pn(s,o){return s&&Wf(s,o,cr)}function Kf(s,o){return s&&Xm(s,o,cr)}function fl(s,o){return _i(o,function(l){return Xn(s[l])})}function hs(s,o){o=Oi(o,s);for(var l=0,p=o.length;s!=null&&l<p;)s=s[Rn(o[l++])];return l&&l==p?s:t}function ev(s,o,l){var p=o(s);return Le(s)?p:Ei(p,l(s))}function Cr(s){return s==null?s===t?qe:Je:as&&as in yt(s)?h$(s):I$(s)}function Vf(s,o){return s>o}function A7(s,o){return s!=null&&dt.call(s,o)}function P7(s,o){return s!=null&&o in yt(s)}function T7(s,o,l){return s>=mr(o,l)&&s<nr(o,l)}function Gf(s,o,l){for(var p=l?Af:Vc,v=s[0].length,S=s.length,R=S,M=G(S),z=1/0,te=[];R--;){var re=s[R];R&&o&&(re=$t(re,Gr(o))),z=mr(re.length,z),M[R]=!l&&(o||v>=120&&re.length>=120)?new ls(R&&re):t}re=s[0];var oe=-1,fe=M[0];e:for(;++oe<v&&te.length<z;){var ve=re[oe],Ie=o?o(ve):ve;if(ve=l||ve!==0?ve:0,!(fe?aa(fe,Ie):p(te,Ie,l))){for(R=S;--R;){var We=M[R];if(!(We?aa(We,Ie):p(s[R],Ie,l)))continue e}fe&&fe.push(Ie),te.push(ve)}}return te}function R7(s,o,l,p){return Pn(s,function(v,S,R){o(p,l(v),S,R)}),p}function ga(s,o,l){o=Oi(o,s),s=kv(s,o);var p=s==null?s:s[Rn(ln(o))];return p==null?t:ar(p,s,l)}function tv(s){return kt(s)&&Cr(s)==de}function N7(s){return kt(s)&&Cr(s)==Se}function L7(s){return kt(s)&&Cr(s)==B}function ma(s,o,l,p,v){return s===o?!0:s==null||o==null||!kt(s)&&!kt(o)?s!==s&&o!==o:M7(s,o,l,p,ma,v)}function M7(s,o,l,p,v,S){var R=Le(s),M=Le(o),z=R?be:vr(s),te=M?be:vr(o);z=z==de?ke:z,te=te==de?ke:te;var re=z==ke,oe=te==ke,fe=z==te;if(fe&&$i(s)){if(!$i(o))return!1;R=!0,re=!1}if(fe&&!re)return S||(S=new wn),R||lo(s)?Nv(s,o,l,p,v,S):l$(s,o,z,l,p,v,S);if(!(l&I)){var ve=re&&dt.call(s,"__wrapped__"),Ie=oe&&dt.call(o,"__wrapped__");if(ve||Ie){var We=ve?s.value():s,De=Ie?o.value():o;return S||(S=new wn),v(We,De,l,p,S)}}return fe?(S||(S=new wn),u$(s,o,l,p,v,S)):!1}function U7(s){return kt(s)&&vr(s)==Oe}function Yf(s,o,l,p){var v=l.length,S=v,R=!p;if(s==null)return!S;for(s=yt(s);v--;){var M=l[v];if(R&&M[2]?M[1]!==s[M[0]]:!(M[0]in s))return!1}for(;++v<S;){M=l[v];var z=M[0],te=s[z],re=M[1];if(R&&M[2]){if(te===t&&!(z in s))return!1}else{var oe=new wn;if(p)var fe=p(te,re,z,s,o,oe);if(!(fe===t?ma(re,te,I|T,p,oe):fe))return!1}}return!0}function rv(s){if(!Tt(s)||y$(s))return!1;var o=Xn(s)?UC:pf;return o.test(ds(s))}function j7(s){return kt(s)&&Cr(s)==ze}function F7(s){return kt(s)&&vr(s)==Ce}function B7(s){return kt(s)&&$l(s.length)&&!!mt[Cr(s)]}function nv(s){return typeof s=="function"?s:s==null?Hr:typeof s=="object"?Le(s)?ov(s[0],s[1]):sv(s):Dw(s)}function Jf(s){if(!ya(s))return zC(s);var o=[];for(var l in yt(s))dt.call(s,l)&&l!="constructor"&&o.push(l);return o}function k7(s){if(!Tt(s))return x$(s);var o=ya(s),l=[];for(var p in s)p=="constructor"&&(o||!dt.call(s,p))||l.push(p);return l}function Zf(s,o){return s<o}function iv(s,o){var l=-1,p=Br(s)?G(s.length):[];return Di(s,function(v,S,R){p[++l]=o(v,S,R)}),p}function sv(s){var o=fd(s);return o.length==1&&o[0][2]?Fv(o[0][0],o[0][1]):function(l){return l===s||Yf(l,s,o)}}function ov(s,o){return pd(s)&&jv(o)?Fv(Rn(s),o):function(l){var p=Id(l,s);return p===t&&p===o?Dd(l,s):ma(o,p,I|T)}}function dl(s,o,l,p,v){s!==o&&Wf(o,function(S,R){if(v||(v=new wn),Tt(S))H7(s,o,R,l,dl,p,v);else{var M=p?p(md(s,R),S,R+"",s,o,v):t;M===t&&(M=S),zf(s,R,M)}},kr)}function H7(s,o,l,p,v,S,R){var M=md(s,l),z=md(o,l),te=R.get(z);if(te){zf(s,l,te);return}var re=S?S(M,z,l+"",s,o,R):t,oe=re===t;if(oe){var fe=Le(z),ve=!fe&&$i(z),Ie=!fe&&!ve&&lo(z);re=z,fe||ve||Ie?Le(M)?re=M:Wt(M)?re=Fr(M):ve?(oe=!1,re=wv(z,!0)):Ie?(oe=!1,re=yv(z,!0)):re=[]:_a(z)||ps(z)?(re=M,ps(M)?re=gw(M):(!Tt(M)||Xn(M))&&(re=Uv(z))):oe=!1}oe&&(R.set(z,re),v(re,z,p,S,R),R.delete(z)),zf(s,l,re)}function av(s,o){var l=s.length;if(l)return o+=o<0?l:0,Qn(o,l)?s[o]:t}function cv(s,o,l){o.length?o=$t(o,function(S){return Le(S)?function(R){return hs(R,S.length===1?S[0]:S)}:S}):o=[Hr];var p=-1;o=$t(o,Gr(_e()));var v=iv(s,function(S,R,M){var z=$t(o,function(te){return te(S)});return{criteria:z,index:++p,value:S}});return gC(v,function(S,R){return t$(S,R,l)})}function z7(s,o){return lv(s,o,function(l,p){return Dd(s,p)})}function lv(s,o,l){for(var p=-1,v=o.length,S={};++p<v;){var R=o[p],M=hs(s,R);l(M,R)&&va(S,Oi(R,s),M)}return S}function q7(s){return function(o){return hs(o,s)}}function Qf(s,o,l,p){var v=p?pC:Qs,S=-1,R=o.length,M=s;for(s===o&&(o=Fr(o)),l&&(M=$t(s,Gr(l)));++S<R;)for(var z=0,te=o[S],re=l?l(te):te;(z=v(M,re,z,p))>-1;)M!==s&&nl.call(M,z,1),nl.call(s,z,1);return s}function uv(s,o){for(var l=s?o.length:0,p=l-1;l--;){var v=o[l];if(l==p||v!==S){var S=v;Qn(v)?nl.call(s,v,1):rd(s,v)}}return s}function Xf(s,o){return s+ol(qm()*(o-s+1))}function W7(s,o,l,p){for(var v=-1,S=nr(sl((o-s)/(l||1)),0),R=G(S);S--;)R[p?S:++v]=s,s+=l;return R}function ed(s,o){var l="";if(!s||o<1||o>Y)return l;do o%2&&(l+=s),o=ol(o/2),o&&(s+=s);while(o);return l}function Ge(s,o){return vd(Bv(s,o,Hr),s+"")}function K7(s){return Vm(uo(s))}function V7(s,o){var l=uo(s);return xl(l,us(o,0,l.length))}function va(s,o,l,p){if(!Tt(s))return s;o=Oi(o,s);for(var v=-1,S=o.length,R=S-1,M=s;M!=null&&++v<S;){var z=Rn(o[v]),te=l;if(z==="__proto__"||z==="constructor"||z==="prototype")return s;if(v!=R){var re=M[z];te=p?p(re,z,M):t,te===t&&(te=Tt(re)?re:Qn(o[v+1])?[]:{})}da(M,z,te),M=M[z]}return s}var hv=al?function(s,o){return al.set(s,o),s}:Hr,G7=il?function(s,o){return il(s,"toString",{configurable:!0,enumerable:!1,value:Od(o),writable:!0})}:Hr;function Y7(s){return xl(uo(s))}function cn(s,o,l){var p=-1,v=s.length;o<0&&(o=-o>v?0:v+o),l=l>v?v:l,l<0&&(l+=v),v=o>l?0:l-o>>>0,o>>>=0;for(var S=G(v);++p<v;)S[p]=s[p+o];return S}function J7(s,o){var l;return Di(s,function(p,v,S){return l=o(p,v,S),!l}),!!l}function pl(s,o,l){var p=0,v=s==null?p:s.length;if(typeof o=="number"&&o===o&&v<=ae){for(;p<v;){var S=p+v>>>1,R=s[S];R!==null&&!Jr(R)&&(l?R<=o:R<o)?p=S+1:v=S}return v}return td(s,o,Hr,l)}function td(s,o,l,p){var v=0,S=s==null?0:s.length;if(S===0)return 0;o=l(o);for(var R=o!==o,M=o===null,z=Jr(o),te=o===t;v<S;){var re=ol((v+S)/2),oe=l(s[re]),fe=oe!==t,ve=oe===null,Ie=oe===oe,We=Jr(oe);if(R)var De=p||Ie;else te?De=Ie&&(p||fe):M?De=Ie&&fe&&(p||!ve):z?De=Ie&&fe&&!ve&&(p||!We):ve||We?De=!1:De=p?oe<=o:oe<o;De?v=re+1:S=re}return mr(S,Ee)}function fv(s,o){for(var l=-1,p=s.length,v=0,S=[];++l<p;){var R=s[l],M=o?o(R):R;if(!l||!yn(M,z)){var z=M;S[v++]=R===0?0:R}}return S}function dv(s){return typeof s=="number"?s:Jr(s)?Q:+s}function Yr(s){if(typeof s=="string")return s;if(Le(s))return $t(s,Yr)+"";if(Jr(s))return Wm?Wm.call(s):"";var o=s+"";return o=="0"&&1/s==-ee?"-0":o}function Si(s,o,l){var p=-1,v=Vc,S=s.length,R=!0,M=[],z=M;if(l)R=!1,v=Af;else if(S>=i){var te=o?null:a$(s);if(te)return Yc(te);R=!1,v=aa,z=new ls}else z=o?[]:M;e:for(;++p<S;){var re=s[p],oe=o?o(re):re;if(re=l||re!==0?re:0,R&&oe===oe){for(var fe=z.length;fe--;)if(z[fe]===oe)continue e;o&&z.push(oe),M.push(re)}else v(z,oe,l)||(z!==M&&z.push(oe),M.push(re))}return M}function rd(s,o){return o=Oi(o,s),s=kv(s,o),s==null||delete s[Rn(ln(o))]}function pv(s,o,l,p){return va(s,o,l(hs(s,o)),p)}function gl(s,o,l,p){for(var v=s.length,S=p?v:-1;(p?S--:++S<v)&&o(s[S],S,s););return l?cn(s,p?0:S,p?S+1:v):cn(s,p?S+1:0,p?v:S)}function gv(s,o){var l=s;return l instanceof tt&&(l=l.value()),Pf(o,function(p,v){return v.func.apply(v.thisArg,Ei([p],v.args))},l)}function nd(s,o,l){var p=s.length;if(p<2)return p?Si(s[0]):[];for(var v=-1,S=G(p);++v<p;)for(var R=s[v],M=-1;++M<p;)M!=v&&(S[v]=pa(S[v]||R,s[M],o,l));return Si(fr(S,1),o,l)}function mv(s,o,l){for(var p=-1,v=s.length,S=o.length,R={};++p<v;){var M=p<S?o[p]:t;l(R,s[p],M)}return R}function id(s){return Wt(s)?s:[]}function sd(s){return typeof s=="function"?s:Hr}function Oi(s,o){return Le(s)?s:pd(s,o)?[s]:Wv(ft(s))}var Z7=Ge;function Ci(s,o,l){var p=s.length;return l=l===t?p:l,!o&&l>=p?s:cn(s,o,l)}var vv=jC||function(s){return it.clearTimeout(s)};function wv(s,o){if(o)return s.slice();var l=s.length,p=Fm?Fm(l):new s.constructor(l);return s.copy(p),p}function od(s){var o=new s.constructor(s.byteLength);return new tl(o).set(new tl(s)),o}function Q7(s,o){var l=o?od(s.buffer):s.buffer;return new s.constructor(l,s.byteOffset,s.byteLength)}function X7(s){var o=new s.constructor(s.source,tn.exec(s));return o.lastIndex=s.lastIndex,o}function e$(s){return fa?yt(fa.call(s)):{}}function yv(s,o){var l=o?od(s.buffer):s.buffer;return new s.constructor(l,s.byteOffset,s.length)}function bv(s,o){if(s!==o){var l=s!==t,p=s===null,v=s===s,S=Jr(s),R=o!==t,M=o===null,z=o===o,te=Jr(o);if(!M&&!te&&!S&&s>o||S&&R&&z&&!M&&!te||p&&R&&z||!l&&z||!v)return 1;if(!p&&!S&&!te&&s<o||te&&l&&v&&!p&&!S||M&&l&&v||!R&&v||!z)return-1}return 0}function t$(s,o,l){for(var p=-1,v=s.criteria,S=o.criteria,R=v.length,M=l.length;++p<R;){var z=bv(v[p],S[p]);if(z){if(p>=M)return z;var te=l[p];return z*(te=="desc"?-1:1)}}return s.index-o.index}function _v(s,o,l,p){for(var v=-1,S=s.length,R=l.length,M=-1,z=o.length,te=nr(S-R,0),re=G(z+te),oe=!p;++M<z;)re[M]=o[M];for(;++v<R;)(oe||v<S)&&(re[l[v]]=s[v]);for(;te--;)re[M++]=s[v++];return re}function Ev(s,o,l,p){for(var v=-1,S=s.length,R=-1,M=l.length,z=-1,te=o.length,re=nr(S-M,0),oe=G(re+te),fe=!p;++v<re;)oe[v]=s[v];for(var ve=v;++z<te;)oe[ve+z]=o[z];for(;++R<M;)(fe||v<S)&&(oe[ve+l[R]]=s[v++]);return oe}function Fr(s,o){var l=-1,p=s.length;for(o||(o=G(p));++l<p;)o[l]=s[l];return o}function Tn(s,o,l,p){var v=!l;l||(l={});for(var S=-1,R=o.length;++S<R;){var M=o[S],z=p?p(l[M],s[M],M,l,s):t;z===t&&(z=s[M]),v?Yn(l,M,z):da(l,M,z)}return l}function r$(s,o){return Tn(s,dd(s),o)}function n$(s,o){return Tn(s,Lv(s),o)}function ml(s,o){return function(l,p){var v=Le(l)?cC:D7,S=o?o():{};return v(l,s,_e(p,2),S)}}function oo(s){return Ge(function(o,l){var p=-1,v=l.length,S=v>1?l[v-1]:t,R=v>2?l[2]:t;for(S=s.length>3&&typeof S=="function"?(v--,S):t,R&&$r(l[0],l[1],R)&&(S=v<3?t:S,v=1),o=yt(o);++p<v;){var M=l[p];M&&s(o,M,p,S)}return o})}function xv(s,o){return function(l,p){if(l==null)return l;if(!Br(l))return s(l,p);for(var v=l.length,S=o?v:-1,R=yt(l);(o?S--:++S<v)&&p(R[S],S,R)!==!1;);return l}}function Iv(s){return function(o,l,p){for(var v=-1,S=yt(o),R=p(o),M=R.length;M--;){var z=R[s?M:++v];if(l(S[z],z,S)===!1)break}return o}}function i$(s,o,l){var p=o&U,v=wa(s);function S(){var R=this&&this!==it&&this instanceof S?v:s;return R.apply(p?l:this,arguments)}return S}function Dv(s){return function(o){o=ft(o);var l=Xs(o)?vn(o):t,p=l?l[0]:o.charAt(0),v=l?Ci(l,1).join(""):o.slice(1);return p[s]()+v}}function ao(s){return function(o){return Pf(xw(Ew(o).replace(sa,"")),s,"")}}function wa(s){return function(){var o=arguments;switch(o.length){case 0:return new s;case 1:return new s(o[0]);case 2:return new s(o[0],o[1]);case 3:return new s(o[0],o[1],o[2]);case 4:return new s(o[0],o[1],o[2],o[3]);case 5:return new s(o[0],o[1],o[2],o[3],o[4]);case 6:return new s(o[0],o[1],o[2],o[3],o[4],o[5]);case 7:return new s(o[0],o[1],o[2],o[3],o[4],o[5],o[6])}var l=so(s.prototype),p=s.apply(l,o);return Tt(p)?p:l}}function s$(s,o,l){var p=wa(s);function v(){for(var S=arguments.length,R=G(S),M=S,z=co(v);M--;)R[M]=arguments[M];var te=S<3&&R[0]!==z&&R[S-1]!==z?[]:xi(R,z);if(S-=te.length,S<l)return Av(s,o,vl,v.placeholder,t,R,te,t,t,l-S);var re=this&&this!==it&&this instanceof v?p:s;return ar(re,this,R)}return v}function Sv(s){return function(o,l,p){var v=yt(o);if(!Br(o)){var S=_e(l,3);o=cr(o),l=function(M){return S(v[M],M,v)}}var R=s(o,l,p);return R>-1?v[S?o[R]:R]:t}}function Ov(s){return Zn(function(o){var l=o.length,p=l,v=on.prototype.thru;for(s&&o.reverse();p--;){var S=o[p];if(typeof S!="function")throw new sn(c);if(v&&!R&&_l(S)=="wrapper")var R=new on([],!0)}for(p=R?p:l;++p<l;){S=o[p];var M=_l(S),z=M=="wrapper"?hd(S):t;z&&gd(z[0])&&z[1]==(f|P|A|b)&&!z[4].length&&z[9]==1?R=R[_l(z[0])].apply(R,z[3]):R=S.length==1&&gd(S)?R[M]():R.thru(S)}return function(){var te=arguments,re=te[0];if(R&&te.length==1&&Le(re))return R.plant(re).value();for(var oe=0,fe=l?o[oe].apply(this,te):re;++oe<l;)fe=o[oe].call(this,fe);return fe}})}function vl(s,o,l,p,v,S,R,M,z,te){var re=o&f,oe=o&U,fe=o&F,ve=o&(P|O),Ie=o&q,We=fe?t:wa(s);function De(){for(var Qe=arguments.length,st=G(Qe),Zr=Qe;Zr--;)st[Zr]=arguments[Zr];if(ve)var Ar=co(De),Qr=vC(st,Ar);if(p&&(st=_v(st,p,v,ve)),S&&(st=Ev(st,S,R,ve)),Qe-=Qr,ve&&Qe<te){var Kt=xi(st,Ar);return Av(s,o,vl,De.placeholder,l,st,Kt,M,z,te-Qe)}var bn=oe?l:this,ti=fe?bn[s]:s;return Qe=st.length,M?st=D$(st,M):Ie&&Qe>1&&st.reverse(),re&&z<Qe&&(st.length=z),this&&this!==it&&this instanceof De&&(ti=We||wa(ti)),ti.apply(bn,st)}return De}function Cv(s,o){return function(l,p){return R7(l,s,o(p),{})}}function wl(s,o){return function(l,p){var v;if(l===t&&p===t)return o;if(l!==t&&(v=l),p!==t){if(v===t)return p;typeof l=="string"||typeof p=="string"?(l=Yr(l),p=Yr(p)):(l=dv(l),p=dv(p)),v=s(l,p)}return v}}function ad(s){return Zn(function(o){return o=$t(o,Gr(_e())),Ge(function(l){var p=this;return s(o,function(v){return ar(v,p,l)})})})}function yl(s,o){o=o===t?" ":Yr(o);var l=o.length;if(l<2)return l?ed(o,s):o;var p=ed(o,sl(s/eo(o)));return Xs(o)?Ci(vn(p),0,s).join(""):p.slice(0,s)}function o$(s,o,l,p){var v=o&U,S=wa(s);function R(){for(var M=-1,z=arguments.length,te=-1,re=p.length,oe=G(re+z),fe=this&&this!==it&&this instanceof R?S:s;++te<re;)oe[te]=p[te];for(;z--;)oe[te++]=arguments[++M];return ar(fe,v?l:this,oe)}return R}function $v(s){return function(o,l,p){return p&&typeof p!="number"&&$r(o,l,p)&&(l=p=t),o=ei(o),l===t?(l=o,o=0):l=ei(l),p=p===t?o<l?1:-1:ei(p),W7(o,l,p,s)}}function bl(s){return function(o,l){return typeof o=="string"&&typeof l=="string"||(o=un(o),l=un(l)),s(o,l)}}function Av(s,o,l,p,v,S,R,M,z,te){var re=o&P,oe=re?R:t,fe=re?t:R,ve=re?S:t,Ie=re?t:S;o|=re?A:x,o&=~(re?x:A),o&$||(o&=~(U|F));var We=[s,o,v,ve,oe,Ie,fe,M,z,te],De=l.apply(t,We);return gd(s)&&Hv(De,We),De.placeholder=p,zv(De,s,o)}function cd(s){var o=rr[s];return function(l,p){if(l=un(l),p=p==null?0:mr(He(p),292),p&&zm(l)){var v=(ft(l)+"e").split("e"),S=o(v[0]+"e"+(+v[1]+p));return v=(ft(S)+"e").split("e"),+(v[0]+"e"+(+v[1]-p))}return o(l)}}var a$=no&&1/Yc(new no([,-0]))[1]==ee?function(s){return new no(s)}:Ad;function Pv(s){return function(o){var l=vr(o);return l==Oe?jf(o):l==Ce?IC(o):mC(o,s(o))}}function Jn(s,o,l,p,v,S,R,M){var z=o&F;if(!z&&typeof s!="function")throw new sn(c);var te=p?p.length:0;if(te||(o&=~(A|x),p=v=t),R=R===t?R:nr(He(R),0),M=M===t?M:He(M),te-=v?v.length:0,o&x){var re=p,oe=v;p=v=t}var fe=z?t:hd(s),ve=[s,o,l,p,v,re,oe,S,R,M];if(fe&&E$(ve,fe),s=ve[0],o=ve[1],l=ve[2],p=ve[3],v=ve[4],M=ve[9]=ve[9]===t?z?0:s.length:nr(ve[9]-te,0),!M&&o&(P|O)&&(o&=~(P|O)),!o||o==U)var Ie=i$(s,o,l);else o==P||o==O?Ie=s$(s,o,M):(o==A||o==(U|A))&&!v.length?Ie=o$(s,o,l,p):Ie=vl.apply(t,ve);var We=fe?hv:Hv;return zv(We(Ie,ve),s,o)}function Tv(s,o,l,p){return s===t||yn(s,ro[l])&&!dt.call(p,l)?o:s}function Rv(s,o,l,p,v,S){return Tt(s)&&Tt(o)&&(S.set(o,s),dl(s,o,t,Rv,S),S.delete(o)),s}function c$(s){return _a(s)?t:s}function Nv(s,o,l,p,v,S){var R=l&I,M=s.length,z=o.length;if(M!=z&&!(R&&z>M))return!1;var te=S.get(s),re=S.get(o);if(te&&re)return te==o&&re==s;var oe=-1,fe=!0,ve=l&T?new ls:t;for(S.set(s,o),S.set(o,s);++oe<M;){var Ie=s[oe],We=o[oe];if(p)var De=R?p(We,Ie,oe,o,s,S):p(Ie,We,oe,s,o,S);if(De!==t){if(De)continue;fe=!1;break}if(ve){if(!Tf(o,function(Qe,st){if(!aa(ve,st)&&(Ie===Qe||v(Ie,Qe,l,p,S)))return ve.push(st)})){fe=!1;break}}else if(!(Ie===We||v(Ie,We,l,p,S))){fe=!1;break}}return S.delete(s),S.delete(o),fe}function l$(s,o,l,p,v,S,R){switch(l){case Te:if(s.byteLength!=o.byteLength||s.byteOffset!=o.byteOffset)return!1;s=s.buffer,o=o.buffer;case Se:return!(s.byteLength!=o.byteLength||!S(new tl(s),new tl(o)));case W:case B:case Ke:return yn(+s,+o);case L:return s.name==o.name&&s.message==o.message;case ze:case Ue:return s==o+"";case Oe:var M=jf;case Ce:var z=p&I;if(M||(M=Yc),s.size!=o.size&&!z)return!1;var te=R.get(s);if(te)return te==o;p|=T,R.set(s,o);var re=Nv(M(s),M(o),p,v,S,R);return R.delete(s),re;case je:if(fa)return fa.call(s)==fa.call(o)}return!1}function u$(s,o,l,p,v,S){var R=l&I,M=ld(s),z=M.length,te=ld(o),re=te.length;if(z!=re&&!R)return!1;for(var oe=z;oe--;){var fe=M[oe];if(!(R?fe in o:dt.call(o,fe)))return!1}var ve=S.get(s),Ie=S.get(o);if(ve&&Ie)return ve==o&&Ie==s;var We=!0;S.set(s,o),S.set(o,s);for(var De=R;++oe<z;){fe=M[oe];var Qe=s[fe],st=o[fe];if(p)var Zr=R?p(st,Qe,fe,o,s,S):p(Qe,st,fe,s,o,S);if(!(Zr===t?Qe===st||v(Qe,st,l,p,S):Zr)){We=!1;break}De||(De=fe=="constructor")}if(We&&!De){var Ar=s.constructor,Qr=o.constructor;Ar!=Qr&&"constructor"in s&&"constructor"in o&&!(typeof Ar=="function"&&Ar instanceof Ar&&typeof Qr=="function"&&Qr instanceof Qr)&&(We=!1)}return S.delete(s),S.delete(o),We}function Zn(s){return vd(Bv(s,t,Yv),s+"")}function ld(s){return ev(s,cr,dd)}function ud(s){return ev(s,kr,Lv)}var hd=al?function(s){return al.get(s)}:Ad;function _l(s){for(var o=s.name+"",l=io[o],p=dt.call(io,o)?l.length:0;p--;){var v=l[p],S=v.func;if(S==null||S==s)return v.name}return o}function co(s){var o=dt.call(_,"placeholder")?_:s;return o.placeholder}function _e(){var s=_.iteratee||Cd;return s=s===Cd?nv:s,arguments.length?s(arguments[0],arguments[1]):s}function El(s,o){var l=s.__data__;return w$(o)?l[typeof o=="string"?"string":"hash"]:l.map}function fd(s){for(var o=cr(s),l=o.length;l--;){var p=o[l],v=s[p];o[l]=[p,v,jv(v)]}return o}function fs(s,o){var l=_C(s,o);return rv(l)?l:t}function h$(s){var o=dt.call(s,as),l=s[as];try{s[as]=t;var p=!0}catch{}var v=Xc.call(s);return p&&(o?s[as]=l:delete s[as]),v}var dd=Bf?function(s){return s==null?[]:(s=yt(s),_i(Bf(s),function(o){return km.call(s,o)}))}:Pd,Lv=Bf?function(s){for(var o=[];s;)Ei(o,dd(s)),s=rl(s);return o}:Pd,vr=Cr;(kf&&vr(new kf(new ArrayBuffer(1)))!=Te||la&&vr(new la)!=Oe||Hf&&vr(Hf.resolve())!=Dt||no&&vr(new no)!=Ce||ua&&vr(new ua)!=Ae)&&(vr=function(s){var o=Cr(s),l=o==ke?s.constructor:t,p=l?ds(l):"";if(p)switch(p){case VC:return Te;case GC:return Oe;case YC:return Dt;case JC:return Ce;case ZC:return Ae}return o});function f$(s,o,l){for(var p=-1,v=l.length;++p<v;){var S=l[p],R=S.size;switch(S.type){case"drop":s+=R;break;case"dropRight":o-=R;break;case"take":o=mr(o,s+R);break;case"takeRight":s=nr(s,o-R);break}}return{start:s,end:o}}function d$(s){var o=s.match(_t);return o?o[1].split(Zt):[]}function Mv(s,o,l){o=Oi(o,s);for(var p=-1,v=o.length,S=!1;++p<v;){var R=Rn(o[p]);if(!(S=s!=null&&l(s,R)))break;s=s[R]}return S||++p!=v?S:(v=s==null?0:s.length,!!v&&$l(v)&&Qn(R,v)&&(Le(s)||ps(s)))}function p$(s){var o=s.length,l=new s.constructor(o);return o&&typeof s[0]=="string"&&dt.call(s,"index")&&(l.index=s.index,l.input=s.input),l}function Uv(s){return typeof s.constructor=="function"&&!ya(s)?so(rl(s)):{}}function g$(s,o,l){var p=s.constructor;switch(o){case Se:return od(s);case W:case B:return new p(+s);case Te:return Q7(s,l);case Ve:case $e:case Ze:case et:case at:case ct:case nt:case Dr:case Ur:return yv(s,l);case Oe:return new p;case Ke:case Ue:return new p(s);case ze:return X7(s);case Ce:return new p;case je:return e$(s)}}function m$(s,o){var l=o.length;if(!l)return s;var p=l-1;return o[p]=(l>1?"& ":"")+o[p],o=o.join(l>2?", ":" "),s.replace(Bt,`{
66
+ */(function(r,e){(function(){var t,n="4.17.21",i=200,a="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",c="Expected a function",u="Invalid `variable` option passed into `_.template`",f="__lodash_hash_undefined__",h=500,m="__lodash_placeholder__",w=1,y=2,x=4,S=1,P=2,U=1,j=2,A=4,T=8,C=16,$=32,E=64,d=128,b=256,H=512,F=30,V="...",se=800,ce=16,I=1,N=2,X=3,ee=1/0,Y=9007199254740991,J=17976931348623157e292,Q=0/0,ie=4294967295,Ee=ie-1,ae=ie>>>1,xe=[["ary",d],["bind",U],["bindKey",j],["curry",T],["curryRight",C],["flip",H],["partial",$],["partialRight",E],["rearg",b]],de="[object Arguments]",be="[object Array]",K="[object AsyncFunction]",W="[object Boolean]",B="[object Date]",g="[object DOMException]",L="[object Error]",le="[object Function]",pe="[object GeneratorFunction]",Ce="[object Map]",Ke="[object Number]",Je="[object Null]",ke="[object Object]",St="[object Promise]",Ct="[object Proxy]",ze="[object RegExp]",Oe="[object Set]",Ue="[object String]",je="[object Symbol]",He="[object Undefined]",Ae="[object WeakMap]",Fe="[object WeakSet]",Se="[object ArrayBuffer]",Te="[object DataView]",Ve="[object Float32Array]",$e="[object Float64Array]",Ze="[object Int8Array]",et="[object Int16Array]",at="[object Int32Array]",ct="[object Uint8Array]",nt="[object Uint8ClampedArray]",Sr="[object Uint16Array]",Ur="[object Uint32Array]",On=/\b__p \+= '';/g,Cr=/\b(__p \+=) '' \+/g,Wn=/(__e\(.*?\)|\b__t\)) \+\n'';/g,bi=/&(?:amp|lt|gt|quot|#39);/g,rs=/[&<>"']/g,Lt=RegExp(bi.source),Ot=RegExp(rs.source),Mt=/<%-([\s\S]+?)%>/g,Ut=/<%([\s\S]+?)%>/g,Tt=/<%=([\s\S]+?)%>/g,$t=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Gt=/^\w*$/,Yt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,jt=/[\\^$.*+?()[\]{}|]/g,Jt=RegExp(jt.source),Ft=/^\s+/,Ht=/\s/,Bt=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,_t=/\{\n\/\* \[wrapped with (.+)\] \*/,Zt=/,? & /,Qt=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,lf=/[()=,{}\[\]\/\s]/,uf=/\\(\\)?/g,hf=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,rn=/\w*$/,ff=/^[-+]0x[0-9a-f]+$/i,df=/^0b[01]+$/i,pf=/^\[object .+?Constructor\]$/,gf=/^0o[0-7]+$/i,mf=/^(?:0|[1-9]\d*)$/,Kn=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Ks=/($^)/,vf=/['\n\r\u2028\u2029\\]/g,Vs="\\ud800-\\udfff",yf="\\u0300-\\u036f",wf="\\ufe20-\\ufe2f",Gs="\\u20d0-\\u20ff",Cc=yf+wf+Gs,Oc="\\u2700-\\u27bf",gn="a-z\\xdf-\\xf6\\xf8-\\xff",bf="\\xac\\xb1\\xd7\\xf7",_f="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Ef="\\u2000-\\u206f",xf=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",$c="A-Z\\xc0-\\xd6\\xd8-\\xde",Ac="\\ufe0e\\ufe0f",ns=bf+_f+Ef+xf,na="['\u2019]",is="["+Vs+"]",ia="["+ns+"]",ss="["+Cc+"]",Pc="\\d+",If="["+Oc+"]",Tc="["+gn+"]",Rc="[^"+Vs+ns+Pc+Oc+gn+$c+"]",Ys="\\ud83c[\\udffb-\\udfff]",Df="(?:"+ss+"|"+Ys+")",Nc="[^"+Vs+"]",Js="(?:\\ud83c[\\udde6-\\uddff]){2}",_i="[\\ud800-\\udbff][\\udc00-\\udfff]",Gr="["+$c+"]",Lc="\\u200d",Mc="(?:"+Tc+"|"+Rc+")",$n="(?:"+Gr+"|"+Rc+")",Uc="(?:"+na+"(?:d|ll|m|re|s|t|ve))?",jc="(?:"+na+"(?:D|LL|M|RE|S|T|VE))?",Fc=Df+"?",Bc="["+Ac+"]?",Sf="(?:"+Lc+"(?:"+[Nc,Js,_i].join("|")+")"+Bc+Fc+")*",Vn="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",kc="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",qc=Bc+Fc+Sf,Zs="(?:"+[If,Js,_i].join("|")+")"+qc,Cf="(?:"+[Nc+ss+"?",ss,Js,_i,is].join("|")+")",sa=RegExp(na,"g"),Of=RegExp(ss,"g"),Qs=RegExp(Ys+"(?="+Ys+")|"+Cf+qc,"g"),zc=RegExp([Gr+"?"+Tc+"+"+Uc+"(?="+[ia,Gr,"$"].join("|")+")",$n+"+"+jc+"(?="+[ia,Gr+Mc,"$"].join("|")+")",Gr+"?"+Mc+"+"+Uc,Gr+"+"+jc,kc,Vn,Pc,Zs].join("|"),"g"),Hc=RegExp("["+Lc+Vs+Cc+Ac+"]"),os=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Wc=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],$f=-1,mt={};mt[Ve]=mt[$e]=mt[Ze]=mt[et]=mt[at]=mt[ct]=mt[nt]=mt[Sr]=mt[Ur]=!0,mt[de]=mt[be]=mt[Se]=mt[W]=mt[Te]=mt[B]=mt[L]=mt[le]=mt[Ce]=mt[Ke]=mt[ke]=mt[ze]=mt[Oe]=mt[Ue]=mt[Ae]=!1;var gt={};gt[de]=gt[be]=gt[Se]=gt[Te]=gt[W]=gt[B]=gt[Ve]=gt[$e]=gt[Ze]=gt[et]=gt[at]=gt[Ce]=gt[Ke]=gt[ke]=gt[ze]=gt[Oe]=gt[Ue]=gt[je]=gt[ct]=gt[nt]=gt[Sr]=gt[Ur]=!0,gt[L]=gt[le]=gt[Ae]=!1;var O={\u00C0:"A",\u00C1:"A",\u00C2:"A",\u00C3:"A",\u00C4:"A",\u00C5:"A",\u00E0:"a",\u00E1:"a",\u00E2:"a",\u00E3:"a",\u00E4:"a",\u00E5:"a",\u00C7:"C",\u00E7:"c",\u00D0:"D",\u00F0:"d",\u00C8:"E",\u00C9:"E",\u00CA:"E",\u00CB:"E",\u00E8:"e",\u00E9:"e",\u00EA:"e",\u00EB:"e",\u00CC:"I",\u00CD:"I",\u00CE:"I",\u00CF:"I",\u00EC:"i",\u00ED:"i",\u00EE:"i",\u00EF:"i",\u00D1:"N",\u00F1:"n",\u00D2:"O",\u00D3:"O",\u00D4:"O",\u00D5:"O",\u00D6:"O",\u00D8:"O",\u00F2:"o",\u00F3:"o",\u00F4:"o",\u00F5:"o",\u00F6:"o",\u00F8:"o",\u00D9:"U",\u00DA:"U",\u00DB:"U",\u00DC:"U",\u00F9:"u",\u00FA:"u",\u00FB:"u",\u00FC:"u",\u00DD:"Y",\u00FD:"y",\u00FF:"y",\u00C6:"Ae",\u00E6:"ae",\u00DE:"Th",\u00FE:"th",\u00DF:"ss",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010A:"C",\u010C:"C",\u0107:"c",\u0109:"c",\u010B:"c",\u010D:"c",\u010E:"D",\u0110:"D",\u010F:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011A:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011B:"e",\u011C:"G",\u011E:"G",\u0120:"G",\u0122:"G",\u011D:"g",\u011F:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\u0128:"I",\u012A:"I",\u012C:"I",\u012E:"I",\u0130:"I",\u0129:"i",\u012B:"i",\u012D:"i",\u012F:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013B:"L",\u013D:"L",\u013F:"L",\u0141:"L",\u013A:"l",\u013C:"l",\u013E:"l",\u0140:"l",\u0142:"l",\u0143:"N",\u0145:"N",\u0147:"N",\u014A:"N",\u0144:"n",\u0146:"n",\u0148:"n",\u014B:"n",\u014C:"O",\u014E:"O",\u0150:"O",\u014D:"o",\u014F:"o",\u0151:"o",\u0154:"R",\u0156:"R",\u0158:"R",\u0155:"r",\u0157:"r",\u0159:"r",\u015A:"S",\u015C:"S",\u015E:"S",\u0160:"S",\u015B:"s",\u015D:"s",\u015F:"s",\u0161:"s",\u0162:"T",\u0164:"T",\u0166:"T",\u0163:"t",\u0165:"t",\u0167:"t",\u0168:"U",\u016A:"U",\u016C:"U",\u016E:"U",\u0170:"U",\u0172:"U",\u0169:"u",\u016B:"u",\u016D:"u",\u016F:"u",\u0171:"u",\u0173:"u",\u0174:"W",\u0175:"w",\u0176:"Y",\u0177:"y",\u0178:"Y",\u0179:"Z",\u017B:"Z",\u017D:"Z",\u017A:"z",\u017C:"z",\u017E:"z",\u0132:"IJ",\u0133:"ij",\u0152:"Oe",\u0153:"oe",\u0149:"'n",\u017F:"s"},k={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},ne={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},ge={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},vt=parseFloat,Ne=parseInt,Et=typeof Mo=="object"&&Mo&&Mo.Object===Object&&Mo,Xt=typeof self=="object"&&self&&self.Object===Object&&self,it=Et||Xt||Function("return this")(),yt=e&&!e.nodeType&&e,Wt=yt&&!0&&r&&!r.nodeType&&r,jr=Wt&&Wt.exports===yt,er=jr&&Et.process,xt=function(){try{var q=Wt&&Wt.require&&Wt.require("util").types;return q||er&&er.binding&&er.binding("util")}catch{}}(),Or=xt&&xt.isArrayBuffer,mn=xt&&xt.isDate,nn=xt&&xt.isMap,An=xt&&xt.isRegExp,oa=xt&&xt.isSet,as=xt&&xt.isTypedArray;function ar(q,Z,G){switch(G.length){case 0:return q.call(Z);case 1:return q.call(Z,G[0]);case 2:return q.call(Z,G[0],G[1]);case 3:return q.call(Z,G[0],G[1],G[2])}return q.apply(Z,G)}function uO(q,Z,G,me){for(var Re=-1,ut=q==null?0:q.length;++Re<ut;){var rr=q[Re];Z(me,rr,G(rr),q)}return me}function sn(q,Z){for(var G=-1,me=q==null?0:q.length;++G<me&&Z(q[G],G,q)!==!1;);return q}function hO(q,Z){for(var G=q==null?0:q.length;G--&&Z(q[G],G,q)!==!1;);return q}function $m(q,Z){for(var G=-1,me=q==null?0:q.length;++G<me;)if(!Z(q[G],G,q))return!1;return!0}function Ei(q,Z){for(var G=-1,me=q==null?0:q.length,Re=0,ut=[];++G<me;){var rr=q[G];Z(rr,G,q)&&(ut[Re++]=rr)}return ut}function Kc(q,Z){var G=q==null?0:q.length;return!!G&&Xs(q,Z,0)>-1}function Af(q,Z,G){for(var me=-1,Re=q==null?0:q.length;++me<Re;)if(G(Z,q[me]))return!0;return!1}function At(q,Z){for(var G=-1,me=q==null?0:q.length,Re=Array(me);++G<me;)Re[G]=Z(q[G],G,q);return Re}function xi(q,Z){for(var G=-1,me=Z.length,Re=q.length;++G<me;)q[Re+G]=Z[G];return q}function Pf(q,Z,G,me){var Re=-1,ut=q==null?0:q.length;for(me&&ut&&(G=q[++Re]);++Re<ut;)G=Z(G,q[Re],Re,q);return G}function fO(q,Z,G,me){var Re=q==null?0:q.length;for(me&&Re&&(G=q[--Re]);Re--;)G=Z(G,q[Re],Re,q);return G}function Tf(q,Z){for(var G=-1,me=q==null?0:q.length;++G<me;)if(Z(q[G],G,q))return!0;return!1}var dO=Rf("length");function pO(q){return q.split("")}function gO(q){return q.match(Qt)||[]}function Am(q,Z,G){var me;return G(q,function(Re,ut,rr){if(Z(Re,ut,rr))return me=ut,!1}),me}function Vc(q,Z,G,me){for(var Re=q.length,ut=G+(me?1:-1);me?ut--:++ut<Re;)if(Z(q[ut],ut,q))return ut;return-1}function Xs(q,Z,G){return Z===Z?CO(q,Z,G):Vc(q,Pm,G)}function mO(q,Z,G,me){for(var Re=G-1,ut=q.length;++Re<ut;)if(me(q[Re],Z))return Re;return-1}function Pm(q){return q!==q}function Tm(q,Z){var G=q==null?0:q.length;return G?Lf(q,Z)/G:Q}function Rf(q){return function(Z){return Z==null?t:Z[q]}}function Nf(q){return function(Z){return q==null?t:q[Z]}}function Rm(q,Z,G,me,Re){return Re(q,function(ut,rr,wt){G=me?(me=!1,ut):Z(G,ut,rr,wt)}),G}function vO(q,Z){var G=q.length;for(q.sort(Z);G--;)q[G]=q[G].value;return q}function Lf(q,Z){for(var G,me=-1,Re=q.length;++me<Re;){var ut=Z(q[me]);ut!==t&&(G=G===t?ut:G+ut)}return G}function Mf(q,Z){for(var G=-1,me=Array(q);++G<q;)me[G]=Z(G);return me}function yO(q,Z){return At(Z,function(G){return[G,q[G]]})}function Nm(q){return q&&q.slice(0,jm(q)+1).replace(Ft,"")}function Yr(q){return function(Z){return q(Z)}}function Uf(q,Z){return At(Z,function(G){return q[G]})}function aa(q,Z){return q.has(Z)}function Lm(q,Z){for(var G=-1,me=q.length;++G<me&&Xs(Z,q[G],0)>-1;);return G}function Mm(q,Z){for(var G=q.length;G--&&Xs(Z,q[G],0)>-1;);return G}function wO(q,Z){for(var G=q.length,me=0;G--;)q[G]===Z&&++me;return me}var bO=Nf(O),_O=Nf(k);function EO(q){return"\\"+ge[q]}function xO(q,Z){return q==null?t:q[Z]}function eo(q){return Hc.test(q)}function IO(q){return os.test(q)}function DO(q){for(var Z,G=[];!(Z=q.next()).done;)G.push(Z.value);return G}function jf(q){var Z=-1,G=Array(q.size);return q.forEach(function(me,Re){G[++Z]=[Re,me]}),G}function Um(q,Z){return function(G){return q(Z(G))}}function Ii(q,Z){for(var G=-1,me=q.length,Re=0,ut=[];++G<me;){var rr=q[G];(rr===Z||rr===m)&&(q[G]=m,ut[Re++]=G)}return ut}function Gc(q){var Z=-1,G=Array(q.size);return q.forEach(function(me){G[++Z]=me}),G}function SO(q){var Z=-1,G=Array(q.size);return q.forEach(function(me){G[++Z]=[me,me]}),G}function CO(q,Z,G){for(var me=G-1,Re=q.length;++me<Re;)if(q[me]===Z)return me;return-1}function OO(q,Z,G){for(var me=G+1;me--;)if(q[me]===Z)return me;return me}function to(q){return eo(q)?AO(q):dO(q)}function vn(q){return eo(q)?PO(q):pO(q)}function jm(q){for(var Z=q.length;Z--&&Ht.test(q.charAt(Z)););return Z}var $O=Nf(ne);function AO(q){for(var Z=Qs.lastIndex=0;Qs.test(q);)++Z;return Z}function PO(q){return q.match(Qs)||[]}function TO(q){return q.match(zc)||[]}var RO=function q(Z){Z=Z==null?it:ro.defaults(it.Object(),Z,ro.pick(it,Wc));var G=Z.Array,me=Z.Date,Re=Z.Error,ut=Z.Function,rr=Z.Math,wt=Z.Object,Ff=Z.RegExp,NO=Z.String,on=Z.TypeError,Yc=G.prototype,LO=ut.prototype,no=wt.prototype,Jc=Z["__core-js_shared__"],Zc=LO.toString,dt=no.hasOwnProperty,MO=0,Fm=function(){var s=/[^.]+$/.exec(Jc&&Jc.keys&&Jc.keys.IE_PROTO||"");return s?"Symbol(src)_1."+s:""}(),Qc=no.toString,UO=Zc.call(wt),jO=it._,FO=Ff("^"+Zc.call(dt).replace(jt,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Xc=jr?Z.Buffer:t,Di=Z.Symbol,el=Z.Uint8Array,Bm=Xc?Xc.allocUnsafe:t,tl=Um(wt.getPrototypeOf,wt),km=wt.create,qm=no.propertyIsEnumerable,rl=Yc.splice,zm=Di?Di.isConcatSpreadable:t,ca=Di?Di.iterator:t,cs=Di?Di.toStringTag:t,nl=function(){try{var s=ds(wt,"defineProperty");return s({},"",{}),s}catch{}}(),BO=Z.clearTimeout!==it.clearTimeout&&Z.clearTimeout,kO=me&&me.now!==it.Date.now&&me.now,qO=Z.setTimeout!==it.setTimeout&&Z.setTimeout,il=rr.ceil,sl=rr.floor,Bf=wt.getOwnPropertySymbols,zO=Xc?Xc.isBuffer:t,Hm=Z.isFinite,HO=Yc.join,WO=Um(wt.keys,wt),nr=rr.max,mr=rr.min,KO=me.now,VO=Z.parseInt,Wm=rr.random,GO=Yc.reverse,kf=ds(Z,"DataView"),la=ds(Z,"Map"),qf=ds(Z,"Promise"),io=ds(Z,"Set"),ua=ds(Z,"WeakMap"),ha=ds(wt,"create"),ol=ua&&new ua,so={},YO=ps(kf),JO=ps(la),ZO=ps(qf),QO=ps(io),XO=ps(ua),al=Di?Di.prototype:t,fa=al?al.valueOf:t,Km=al?al.toString:t;function _(s){if(kt(s)&&!Le(s)&&!(s instanceof tt)){if(s instanceof an)return s;if(dt.call(s,"__wrapped__"))return Vv(s)}return new an(s)}var oo=function(){function s(){}return function(o){if(!Rt(o))return{};if(km)return km(o);s.prototype=o;var l=new s;return s.prototype=t,l}}();function cl(){}function an(s,o){this.__wrapped__=s,this.__actions__=[],this.__chain__=!!o,this.__index__=0,this.__values__=t}_.templateSettings={escape:Mt,evaluate:Ut,interpolate:Tt,variable:"",imports:{_}},_.prototype=cl.prototype,_.prototype.constructor=_,an.prototype=oo(cl.prototype),an.prototype.constructor=an;function tt(s){this.__wrapped__=s,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=ie,this.__views__=[]}function e7(){var s=new tt(this.__wrapped__);return s.__actions__=Fr(this.__actions__),s.__dir__=this.__dir__,s.__filtered__=this.__filtered__,s.__iteratees__=Fr(this.__iteratees__),s.__takeCount__=this.__takeCount__,s.__views__=Fr(this.__views__),s}function t7(){if(this.__filtered__){var s=new tt(this);s.__dir__=-1,s.__filtered__=!0}else s=this.clone(),s.__dir__*=-1;return s}function r7(){var s=this.__wrapped__.value(),o=this.__dir__,l=Le(s),p=o<0,v=l?s.length:0,D=p$(0,v,this.__views__),R=D.start,M=D.end,z=M-R,te=p?M:R-1,re=this.__iteratees__,oe=re.length,fe=0,ve=mr(z,this.__takeCount__);if(!l||!p&&v==z&&ve==z)return mv(s,this.__actions__);var Ie=[];e:for(;z--&&fe<ve;){te+=o;for(var We=-1,De=s[te];++We<oe;){var Qe=re[We],st=Qe.iteratee,Qr=Qe.type,Pr=st(De);if(Qr==N)De=Pr;else if(!Pr){if(Qr==I)continue e;break e}}Ie[fe++]=De}return Ie}tt.prototype=oo(cl.prototype),tt.prototype.constructor=tt;function ls(s){var o=-1,l=s==null?0:s.length;for(this.clear();++o<l;){var p=s[o];this.set(p[0],p[1])}}function n7(){this.__data__=ha?ha(null):{},this.size=0}function i7(s){var o=this.has(s)&&delete this.__data__[s];return this.size-=o?1:0,o}function s7(s){var o=this.__data__;if(ha){var l=o[s];return l===f?t:l}return dt.call(o,s)?o[s]:t}function o7(s){var o=this.__data__;return ha?o[s]!==t:dt.call(o,s)}function a7(s,o){var l=this.__data__;return this.size+=this.has(s)?0:1,l[s]=ha&&o===t?f:o,this}ls.prototype.clear=n7,ls.prototype.delete=i7,ls.prototype.get=s7,ls.prototype.has=o7,ls.prototype.set=a7;function Gn(s){var o=-1,l=s==null?0:s.length;for(this.clear();++o<l;){var p=s[o];this.set(p[0],p[1])}}function c7(){this.__data__=[],this.size=0}function l7(s){var o=this.__data__,l=ll(o,s);if(l<0)return!1;var p=o.length-1;return l==p?o.pop():rl.call(o,l,1),--this.size,!0}function u7(s){var o=this.__data__,l=ll(o,s);return l<0?t:o[l][1]}function h7(s){return ll(this.__data__,s)>-1}function f7(s,o){var l=this.__data__,p=ll(l,s);return p<0?(++this.size,l.push([s,o])):l[p][1]=o,this}Gn.prototype.clear=c7,Gn.prototype.delete=l7,Gn.prototype.get=u7,Gn.prototype.has=h7,Gn.prototype.set=f7;function Yn(s){var o=-1,l=s==null?0:s.length;for(this.clear();++o<l;){var p=s[o];this.set(p[0],p[1])}}function d7(){this.size=0,this.__data__={hash:new ls,map:new(la||Gn),string:new ls}}function p7(s){var o=_l(this,s).delete(s);return this.size-=o?1:0,o}function g7(s){return _l(this,s).get(s)}function m7(s){return _l(this,s).has(s)}function v7(s,o){var l=_l(this,s),p=l.size;return l.set(s,o),this.size+=l.size==p?0:1,this}Yn.prototype.clear=d7,Yn.prototype.delete=p7,Yn.prototype.get=g7,Yn.prototype.has=m7,Yn.prototype.set=v7;function us(s){var o=-1,l=s==null?0:s.length;for(this.__data__=new Yn;++o<l;)this.add(s[o])}function y7(s){return this.__data__.set(s,f),this}function w7(s){return this.__data__.has(s)}us.prototype.add=us.prototype.push=y7,us.prototype.has=w7;function yn(s){var o=this.__data__=new Gn(s);this.size=o.size}function b7(){this.__data__=new Gn,this.size=0}function _7(s){var o=this.__data__,l=o.delete(s);return this.size=o.size,l}function E7(s){return this.__data__.get(s)}function x7(s){return this.__data__.has(s)}function I7(s,o){var l=this.__data__;if(l instanceof Gn){var p=l.__data__;if(!la||p.length<i-1)return p.push([s,o]),this.size=++l.size,this;l=this.__data__=new Yn(p)}return l.set(s,o),this.size=l.size,this}yn.prototype.clear=b7,yn.prototype.delete=_7,yn.prototype.get=E7,yn.prototype.has=x7,yn.prototype.set=I7;function Vm(s,o){var l=Le(s),p=!l&&gs(s),v=!l&&!p&&Ai(s),D=!l&&!p&&!v&&uo(s),R=l||p||v||D,M=R?Mf(s.length,NO):[],z=M.length;for(var te in s)(o||dt.call(s,te))&&!(R&&(te=="length"||v&&(te=="offset"||te=="parent")||D&&(te=="buffer"||te=="byteLength"||te=="byteOffset")||Xn(te,z)))&&M.push(te);return M}function Gm(s){var o=s.length;return o?s[Xf(0,o-1)]:t}function D7(s,o){return El(Fr(s),hs(o,0,s.length))}function S7(s){return El(Fr(s))}function zf(s,o,l){(l!==t&&!wn(s[o],l)||l===t&&!(o in s))&&Jn(s,o,l)}function da(s,o,l){var p=s[o];(!(dt.call(s,o)&&wn(p,l))||l===t&&!(o in s))&&Jn(s,o,l)}function ll(s,o){for(var l=s.length;l--;)if(wn(s[l][0],o))return l;return-1}function C7(s,o,l,p){return Si(s,function(v,D,R){o(p,v,l(v),R)}),p}function Ym(s,o){return s&&Tn(o,cr(o),s)}function O7(s,o){return s&&Tn(o,kr(o),s)}function Jn(s,o,l){o=="__proto__"&&nl?nl(s,o,{configurable:!0,enumerable:!0,value:l,writable:!0}):s[o]=l}function Hf(s,o){for(var l=-1,p=o.length,v=G(p),D=s==null;++l<p;)v[l]=D?t:Id(s,o[l]);return v}function hs(s,o,l){return s===s&&(l!==t&&(s=s<=l?s:l),o!==t&&(s=s>=o?s:o)),s}function cn(s,o,l,p,v,D){var R,M=o&w,z=o&y,te=o&x;if(l&&(R=v?l(s,p,v,D):l(s)),R!==t)return R;if(!Rt(s))return s;var re=Le(s);if(re){if(R=m$(s),!M)return Fr(s,R)}else{var oe=vr(s),fe=oe==le||oe==pe;if(Ai(s))return wv(s,M);if(oe==ke||oe==de||fe&&!v){if(R=z||fe?{}:jv(s),!M)return z?s$(s,O7(R,s)):i$(s,Ym(R,s))}else{if(!gt[oe])return v?s:{};R=v$(s,oe,M)}}D||(D=new yn);var ve=D.get(s);if(ve)return ve;D.set(s,R),dy(s)?s.forEach(function(De){R.add(cn(De,o,l,De,s,D))}):hy(s)&&s.forEach(function(De,Qe){R.set(Qe,cn(De,o,l,Qe,s,D))});var Ie=te?z?ud:ld:z?kr:cr,We=re?t:Ie(s);return sn(We||s,function(De,Qe){We&&(Qe=De,De=s[Qe]),da(R,Qe,cn(De,o,l,Qe,s,D))}),R}function $7(s){var o=cr(s);return function(l){return Jm(l,s,o)}}function Jm(s,o,l){var p=l.length;if(s==null)return!p;for(s=wt(s);p--;){var v=l[p],D=o[v],R=s[v];if(R===t&&!(v in s)||!D(R))return!1}return!0}function Zm(s,o,l){if(typeof s!="function")throw new on(c);return ba(function(){s.apply(t,l)},o)}function pa(s,o,l,p){var v=-1,D=Kc,R=!0,M=s.length,z=[],te=o.length;if(!M)return z;l&&(o=At(o,Yr(l))),p?(D=Af,R=!1):o.length>=i&&(D=aa,R=!1,o=new us(o));e:for(;++v<M;){var re=s[v],oe=l==null?re:l(re);if(re=p||re!==0?re:0,R&&oe===oe){for(var fe=te;fe--;)if(o[fe]===oe)continue e;z.push(re)}else D(o,oe,p)||z.push(re)}return z}var Si=Iv(Pn),Qm=Iv(Kf,!0);function A7(s,o){var l=!0;return Si(s,function(p,v,D){return l=!!o(p,v,D),l}),l}function ul(s,o,l){for(var p=-1,v=s.length;++p<v;){var D=s[p],R=o(D);if(R!=null&&(M===t?R===R&&!Zr(R):l(R,M)))var M=R,z=D}return z}function P7(s,o,l,p){var v=s.length;for(l=qe(l),l<0&&(l=-l>v?0:v+l),p=p===t||p>v?v:qe(p),p<0&&(p+=v),p=l>p?0:gy(p);l<p;)s[l++]=o;return s}function Xm(s,o){var l=[];return Si(s,function(p,v,D){o(p,v,D)&&l.push(p)}),l}function fr(s,o,l,p,v){var D=-1,R=s.length;for(l||(l=w$),v||(v=[]);++D<R;){var M=s[D];o>0&&l(M)?o>1?fr(M,o-1,l,p,v):xi(v,M):p||(v[v.length]=M)}return v}var Wf=Dv(),ev=Dv(!0);function Pn(s,o){return s&&Wf(s,o,cr)}function Kf(s,o){return s&&ev(s,o,cr)}function hl(s,o){return Ei(o,function(l){return ei(s[l])})}function fs(s,o){o=Oi(o,s);for(var l=0,p=o.length;s!=null&&l<p;)s=s[Rn(o[l++])];return l&&l==p?s:t}function tv(s,o,l){var p=o(s);return Le(s)?p:xi(p,l(s))}function $r(s){return s==null?s===t?He:Je:cs&&cs in wt(s)?d$(s):S$(s)}function Vf(s,o){return s>o}function T7(s,o){return s!=null&&dt.call(s,o)}function R7(s,o){return s!=null&&o in wt(s)}function N7(s,o,l){return s>=mr(o,l)&&s<nr(o,l)}function Gf(s,o,l){for(var p=l?Af:Kc,v=s[0].length,D=s.length,R=D,M=G(D),z=1/0,te=[];R--;){var re=s[R];R&&o&&(re=At(re,Yr(o))),z=mr(re.length,z),M[R]=!l&&(o||v>=120&&re.length>=120)?new us(R&&re):t}re=s[0];var oe=-1,fe=M[0];e:for(;++oe<v&&te.length<z;){var ve=re[oe],Ie=o?o(ve):ve;if(ve=l||ve!==0?ve:0,!(fe?aa(fe,Ie):p(te,Ie,l))){for(R=D;--R;){var We=M[R];if(!(We?aa(We,Ie):p(s[R],Ie,l)))continue e}fe&&fe.push(Ie),te.push(ve)}}return te}function L7(s,o,l,p){return Pn(s,function(v,D,R){o(p,l(v),D,R)}),p}function ga(s,o,l){o=Oi(o,s),s=qv(s,o);var p=s==null?s:s[Rn(un(o))];return p==null?t:ar(p,s,l)}function rv(s){return kt(s)&&$r(s)==de}function M7(s){return kt(s)&&$r(s)==Se}function U7(s){return kt(s)&&$r(s)==B}function ma(s,o,l,p,v){return s===o?!0:s==null||o==null||!kt(s)&&!kt(o)?s!==s&&o!==o:j7(s,o,l,p,ma,v)}function j7(s,o,l,p,v,D){var R=Le(s),M=Le(o),z=R?be:vr(s),te=M?be:vr(o);z=z==de?ke:z,te=te==de?ke:te;var re=z==ke,oe=te==ke,fe=z==te;if(fe&&Ai(s)){if(!Ai(o))return!1;R=!0,re=!1}if(fe&&!re)return D||(D=new yn),R||uo(s)?Lv(s,o,l,p,v,D):h$(s,o,z,l,p,v,D);if(!(l&S)){var ve=re&&dt.call(s,"__wrapped__"),Ie=oe&&dt.call(o,"__wrapped__");if(ve||Ie){var We=ve?s.value():s,De=Ie?o.value():o;return D||(D=new yn),v(We,De,l,p,D)}}return fe?(D||(D=new yn),f$(s,o,l,p,v,D)):!1}function F7(s){return kt(s)&&vr(s)==Ce}function Yf(s,o,l,p){var v=l.length,D=v,R=!p;if(s==null)return!D;for(s=wt(s);v--;){var M=l[v];if(R&&M[2]?M[1]!==s[M[0]]:!(M[0]in s))return!1}for(;++v<D;){M=l[v];var z=M[0],te=s[z],re=M[1];if(R&&M[2]){if(te===t&&!(z in s))return!1}else{var oe=new yn;if(p)var fe=p(te,re,z,s,o,oe);if(!(fe===t?ma(re,te,S|P,p,oe):fe))return!1}}return!0}function nv(s){if(!Rt(s)||_$(s))return!1;var o=ei(s)?FO:pf;return o.test(ps(s))}function B7(s){return kt(s)&&$r(s)==ze}function k7(s){return kt(s)&&vr(s)==Oe}function q7(s){return kt(s)&&Ol(s.length)&&!!mt[$r(s)]}function iv(s){return typeof s=="function"?s:s==null?qr:typeof s=="object"?Le(s)?av(s[0],s[1]):ov(s):Sy(s)}function Jf(s){if(!wa(s))return WO(s);var o=[];for(var l in wt(s))dt.call(s,l)&&l!="constructor"&&o.push(l);return o}function z7(s){if(!Rt(s))return D$(s);var o=wa(s),l=[];for(var p in s)p=="constructor"&&(o||!dt.call(s,p))||l.push(p);return l}function Zf(s,o){return s<o}function sv(s,o){var l=-1,p=Br(s)?G(s.length):[];return Si(s,function(v,D,R){p[++l]=o(v,D,R)}),p}function ov(s){var o=fd(s);return o.length==1&&o[0][2]?Bv(o[0][0],o[0][1]):function(l){return l===s||Yf(l,s,o)}}function av(s,o){return pd(s)&&Fv(o)?Bv(Rn(s),o):function(l){var p=Id(l,s);return p===t&&p===o?Dd(l,s):ma(o,p,S|P)}}function fl(s,o,l,p,v){s!==o&&Wf(o,function(D,R){if(v||(v=new yn),Rt(D))H7(s,o,R,l,fl,p,v);else{var M=p?p(md(s,R),D,R+"",s,o,v):t;M===t&&(M=D),zf(s,R,M)}},kr)}function H7(s,o,l,p,v,D,R){var M=md(s,l),z=md(o,l),te=R.get(z);if(te){zf(s,l,te);return}var re=D?D(M,z,l+"",s,o,R):t,oe=re===t;if(oe){var fe=Le(z),ve=!fe&&Ai(z),Ie=!fe&&!ve&&uo(z);re=z,fe||ve||Ie?Le(M)?re=M:Kt(M)?re=Fr(M):ve?(oe=!1,re=wv(z,!0)):Ie?(oe=!1,re=bv(z,!0)):re=[]:_a(z)||gs(z)?(re=M,gs(M)?re=my(M):(!Rt(M)||ei(M))&&(re=jv(z))):oe=!1}oe&&(R.set(z,re),v(re,z,p,D,R),R.delete(z)),zf(s,l,re)}function cv(s,o){var l=s.length;if(l)return o+=o<0?l:0,Xn(o,l)?s[o]:t}function lv(s,o,l){o.length?o=At(o,function(D){return Le(D)?function(R){return fs(R,D.length===1?D[0]:D)}:D}):o=[qr];var p=-1;o=At(o,Yr(_e()));var v=sv(s,function(D,R,M){var z=At(o,function(te){return te(D)});return{criteria:z,index:++p,value:D}});return vO(v,function(D,R){return n$(D,R,l)})}function W7(s,o){return uv(s,o,function(l,p){return Dd(s,p)})}function uv(s,o,l){for(var p=-1,v=o.length,D={};++p<v;){var R=o[p],M=fs(s,R);l(M,R)&&va(D,Oi(R,s),M)}return D}function K7(s){return function(o){return fs(o,s)}}function Qf(s,o,l,p){var v=p?mO:Xs,D=-1,R=o.length,M=s;for(s===o&&(o=Fr(o)),l&&(M=At(s,Yr(l)));++D<R;)for(var z=0,te=o[D],re=l?l(te):te;(z=v(M,re,z,p))>-1;)M!==s&&rl.call(M,z,1),rl.call(s,z,1);return s}function hv(s,o){for(var l=s?o.length:0,p=l-1;l--;){var v=o[l];if(l==p||v!==D){var D=v;Xn(v)?rl.call(s,v,1):rd(s,v)}}return s}function Xf(s,o){return s+sl(Wm()*(o-s+1))}function V7(s,o,l,p){for(var v=-1,D=nr(il((o-s)/(l||1)),0),R=G(D);D--;)R[p?D:++v]=s,s+=l;return R}function ed(s,o){var l="";if(!s||o<1||o>Y)return l;do o%2&&(l+=s),o=sl(o/2),o&&(s+=s);while(o);return l}function Ge(s,o){return vd(kv(s,o,qr),s+"")}function G7(s){return Gm(ho(s))}function Y7(s,o){var l=ho(s);return El(l,hs(o,0,l.length))}function va(s,o,l,p){if(!Rt(s))return s;o=Oi(o,s);for(var v=-1,D=o.length,R=D-1,M=s;M!=null&&++v<D;){var z=Rn(o[v]),te=l;if(z==="__proto__"||z==="constructor"||z==="prototype")return s;if(v!=R){var re=M[z];te=p?p(re,z,M):t,te===t&&(te=Rt(re)?re:Xn(o[v+1])?[]:{})}da(M,z,te),M=M[z]}return s}var fv=ol?function(s,o){return ol.set(s,o),s}:qr,J7=nl?function(s,o){return nl(s,"toString",{configurable:!0,enumerable:!1,value:Cd(o),writable:!0})}:qr;function Z7(s){return El(ho(s))}function ln(s,o,l){var p=-1,v=s.length;o<0&&(o=-o>v?0:v+o),l=l>v?v:l,l<0&&(l+=v),v=o>l?0:l-o>>>0,o>>>=0;for(var D=G(v);++p<v;)D[p]=s[p+o];return D}function Q7(s,o){var l;return Si(s,function(p,v,D){return l=o(p,v,D),!l}),!!l}function dl(s,o,l){var p=0,v=s==null?p:s.length;if(typeof o=="number"&&o===o&&v<=ae){for(;p<v;){var D=p+v>>>1,R=s[D];R!==null&&!Zr(R)&&(l?R<=o:R<o)?p=D+1:v=D}return v}return td(s,o,qr,l)}function td(s,o,l,p){var v=0,D=s==null?0:s.length;if(D===0)return 0;o=l(o);for(var R=o!==o,M=o===null,z=Zr(o),te=o===t;v<D;){var re=sl((v+D)/2),oe=l(s[re]),fe=oe!==t,ve=oe===null,Ie=oe===oe,We=Zr(oe);if(R)var De=p||Ie;else te?De=Ie&&(p||fe):M?De=Ie&&fe&&(p||!ve):z?De=Ie&&fe&&!ve&&(p||!We):ve||We?De=!1:De=p?oe<=o:oe<o;De?v=re+1:D=re}return mr(D,Ee)}function dv(s,o){for(var l=-1,p=s.length,v=0,D=[];++l<p;){var R=s[l],M=o?o(R):R;if(!l||!wn(M,z)){var z=M;D[v++]=R===0?0:R}}return D}function pv(s){return typeof s=="number"?s:Zr(s)?Q:+s}function Jr(s){if(typeof s=="string")return s;if(Le(s))return At(s,Jr)+"";if(Zr(s))return Km?Km.call(s):"";var o=s+"";return o=="0"&&1/s==-ee?"-0":o}function Ci(s,o,l){var p=-1,v=Kc,D=s.length,R=!0,M=[],z=M;if(l)R=!1,v=Af;else if(D>=i){var te=o?null:l$(s);if(te)return Gc(te);R=!1,v=aa,z=new us}else z=o?[]:M;e:for(;++p<D;){var re=s[p],oe=o?o(re):re;if(re=l||re!==0?re:0,R&&oe===oe){for(var fe=z.length;fe--;)if(z[fe]===oe)continue e;o&&z.push(oe),M.push(re)}else v(z,oe,l)||(z!==M&&z.push(oe),M.push(re))}return M}function rd(s,o){return o=Oi(o,s),s=qv(s,o),s==null||delete s[Rn(un(o))]}function gv(s,o,l,p){return va(s,o,l(fs(s,o)),p)}function pl(s,o,l,p){for(var v=s.length,D=p?v:-1;(p?D--:++D<v)&&o(s[D],D,s););return l?ln(s,p?0:D,p?D+1:v):ln(s,p?D+1:0,p?v:D)}function mv(s,o){var l=s;return l instanceof tt&&(l=l.value()),Pf(o,function(p,v){return v.func.apply(v.thisArg,xi([p],v.args))},l)}function nd(s,o,l){var p=s.length;if(p<2)return p?Ci(s[0]):[];for(var v=-1,D=G(p);++v<p;)for(var R=s[v],M=-1;++M<p;)M!=v&&(D[v]=pa(D[v]||R,s[M],o,l));return Ci(fr(D,1),o,l)}function vv(s,o,l){for(var p=-1,v=s.length,D=o.length,R={};++p<v;){var M=p<D?o[p]:t;l(R,s[p],M)}return R}function id(s){return Kt(s)?s:[]}function sd(s){return typeof s=="function"?s:qr}function Oi(s,o){return Le(s)?s:pd(s,o)?[s]:Kv(ft(s))}var X7=Ge;function $i(s,o,l){var p=s.length;return l=l===t?p:l,!o&&l>=p?s:ln(s,o,l)}var yv=BO||function(s){return it.clearTimeout(s)};function wv(s,o){if(o)return s.slice();var l=s.length,p=Bm?Bm(l):new s.constructor(l);return s.copy(p),p}function od(s){var o=new s.constructor(s.byteLength);return new el(o).set(new el(s)),o}function e$(s,o){var l=o?od(s.buffer):s.buffer;return new s.constructor(l,s.byteOffset,s.byteLength)}function t$(s){var o=new s.constructor(s.source,rn.exec(s));return o.lastIndex=s.lastIndex,o}function r$(s){return fa?wt(fa.call(s)):{}}function bv(s,o){var l=o?od(s.buffer):s.buffer;return new s.constructor(l,s.byteOffset,s.length)}function _v(s,o){if(s!==o){var l=s!==t,p=s===null,v=s===s,D=Zr(s),R=o!==t,M=o===null,z=o===o,te=Zr(o);if(!M&&!te&&!D&&s>o||D&&R&&z&&!M&&!te||p&&R&&z||!l&&z||!v)return 1;if(!p&&!D&&!te&&s<o||te&&l&&v&&!p&&!D||M&&l&&v||!R&&v||!z)return-1}return 0}function n$(s,o,l){for(var p=-1,v=s.criteria,D=o.criteria,R=v.length,M=l.length;++p<R;){var z=_v(v[p],D[p]);if(z){if(p>=M)return z;var te=l[p];return z*(te=="desc"?-1:1)}}return s.index-o.index}function Ev(s,o,l,p){for(var v=-1,D=s.length,R=l.length,M=-1,z=o.length,te=nr(D-R,0),re=G(z+te),oe=!p;++M<z;)re[M]=o[M];for(;++v<R;)(oe||v<D)&&(re[l[v]]=s[v]);for(;te--;)re[M++]=s[v++];return re}function xv(s,o,l,p){for(var v=-1,D=s.length,R=-1,M=l.length,z=-1,te=o.length,re=nr(D-M,0),oe=G(re+te),fe=!p;++v<re;)oe[v]=s[v];for(var ve=v;++z<te;)oe[ve+z]=o[z];for(;++R<M;)(fe||v<D)&&(oe[ve+l[R]]=s[v++]);return oe}function Fr(s,o){var l=-1,p=s.length;for(o||(o=G(p));++l<p;)o[l]=s[l];return o}function Tn(s,o,l,p){var v=!l;l||(l={});for(var D=-1,R=o.length;++D<R;){var M=o[D],z=p?p(l[M],s[M],M,l,s):t;z===t&&(z=s[M]),v?Jn(l,M,z):da(l,M,z)}return l}function i$(s,o){return Tn(s,dd(s),o)}function s$(s,o){return Tn(s,Mv(s),o)}function gl(s,o){return function(l,p){var v=Le(l)?uO:C7,D=o?o():{};return v(l,s,_e(p,2),D)}}function ao(s){return Ge(function(o,l){var p=-1,v=l.length,D=v>1?l[v-1]:t,R=v>2?l[2]:t;for(D=s.length>3&&typeof D=="function"?(v--,D):t,R&&Ar(l[0],l[1],R)&&(D=v<3?t:D,v=1),o=wt(o);++p<v;){var M=l[p];M&&s(o,M,p,D)}return o})}function Iv(s,o){return function(l,p){if(l==null)return l;if(!Br(l))return s(l,p);for(var v=l.length,D=o?v:-1,R=wt(l);(o?D--:++D<v)&&p(R[D],D,R)!==!1;);return l}}function Dv(s){return function(o,l,p){for(var v=-1,D=wt(o),R=p(o),M=R.length;M--;){var z=R[s?M:++v];if(l(D[z],z,D)===!1)break}return o}}function o$(s,o,l){var p=o&U,v=ya(s);function D(){var R=this&&this!==it&&this instanceof D?v:s;return R.apply(p?l:this,arguments)}return D}function Sv(s){return function(o){o=ft(o);var l=eo(o)?vn(o):t,p=l?l[0]:o.charAt(0),v=l?$i(l,1).join(""):o.slice(1);return p[s]()+v}}function co(s){return function(o){return Pf(Iy(xy(o).replace(sa,"")),s,"")}}function ya(s){return function(){var o=arguments;switch(o.length){case 0:return new s;case 1:return new s(o[0]);case 2:return new s(o[0],o[1]);case 3:return new s(o[0],o[1],o[2]);case 4:return new s(o[0],o[1],o[2],o[3]);case 5:return new s(o[0],o[1],o[2],o[3],o[4]);case 6:return new s(o[0],o[1],o[2],o[3],o[4],o[5]);case 7:return new s(o[0],o[1],o[2],o[3],o[4],o[5],o[6])}var l=oo(s.prototype),p=s.apply(l,o);return Rt(p)?p:l}}function a$(s,o,l){var p=ya(s);function v(){for(var D=arguments.length,R=G(D),M=D,z=lo(v);M--;)R[M]=arguments[M];var te=D<3&&R[0]!==z&&R[D-1]!==z?[]:Ii(R,z);if(D-=te.length,D<l)return Pv(s,o,ml,v.placeholder,t,R,te,t,t,l-D);var re=this&&this!==it&&this instanceof v?p:s;return ar(re,this,R)}return v}function Cv(s){return function(o,l,p){var v=wt(o);if(!Br(o)){var D=_e(l,3);o=cr(o),l=function(M){return D(v[M],M,v)}}var R=s(o,l,p);return R>-1?v[D?o[R]:R]:t}}function Ov(s){return Qn(function(o){var l=o.length,p=l,v=an.prototype.thru;for(s&&o.reverse();p--;){var D=o[p];if(typeof D!="function")throw new on(c);if(v&&!R&&bl(D)=="wrapper")var R=new an([],!0)}for(p=R?p:l;++p<l;){D=o[p];var M=bl(D),z=M=="wrapper"?hd(D):t;z&&gd(z[0])&&z[1]==(d|T|$|b)&&!z[4].length&&z[9]==1?R=R[bl(z[0])].apply(R,z[3]):R=D.length==1&&gd(D)?R[M]():R.thru(D)}return function(){var te=arguments,re=te[0];if(R&&te.length==1&&Le(re))return R.plant(re).value();for(var oe=0,fe=l?o[oe].apply(this,te):re;++oe<l;)fe=o[oe].call(this,fe);return fe}})}function ml(s,o,l,p,v,D,R,M,z,te){var re=o&d,oe=o&U,fe=o&j,ve=o&(T|C),Ie=o&H,We=fe?t:ya(s);function De(){for(var Qe=arguments.length,st=G(Qe),Qr=Qe;Qr--;)st[Qr]=arguments[Qr];if(ve)var Pr=lo(De),Xr=wO(st,Pr);if(p&&(st=Ev(st,p,v,ve)),D&&(st=xv(st,D,R,ve)),Qe-=Xr,ve&&Qe<te){var Vt=Ii(st,Pr);return Pv(s,o,ml,De.placeholder,l,st,Vt,M,z,te-Qe)}var bn=oe?l:this,ri=fe?bn[s]:s;return Qe=st.length,M?st=C$(st,M):Ie&&Qe>1&&st.reverse(),re&&z<Qe&&(st.length=z),this&&this!==it&&this instanceof De&&(ri=We||ya(ri)),ri.apply(bn,st)}return De}function $v(s,o){return function(l,p){return L7(l,s,o(p),{})}}function vl(s,o){return function(l,p){var v;if(l===t&&p===t)return o;if(l!==t&&(v=l),p!==t){if(v===t)return p;typeof l=="string"||typeof p=="string"?(l=Jr(l),p=Jr(p)):(l=pv(l),p=pv(p)),v=s(l,p)}return v}}function ad(s){return Qn(function(o){return o=At(o,Yr(_e())),Ge(function(l){var p=this;return s(o,function(v){return ar(v,p,l)})})})}function yl(s,o){o=o===t?" ":Jr(o);var l=o.length;if(l<2)return l?ed(o,s):o;var p=ed(o,il(s/to(o)));return eo(o)?$i(vn(p),0,s).join(""):p.slice(0,s)}function c$(s,o,l,p){var v=o&U,D=ya(s);function R(){for(var M=-1,z=arguments.length,te=-1,re=p.length,oe=G(re+z),fe=this&&this!==it&&this instanceof R?D:s;++te<re;)oe[te]=p[te];for(;z--;)oe[te++]=arguments[++M];return ar(fe,v?l:this,oe)}return R}function Av(s){return function(o,l,p){return p&&typeof p!="number"&&Ar(o,l,p)&&(l=p=t),o=ti(o),l===t?(l=o,o=0):l=ti(l),p=p===t?o<l?1:-1:ti(p),V7(o,l,p,s)}}function wl(s){return function(o,l){return typeof o=="string"&&typeof l=="string"||(o=hn(o),l=hn(l)),s(o,l)}}function Pv(s,o,l,p,v,D,R,M,z,te){var re=o&T,oe=re?R:t,fe=re?t:R,ve=re?D:t,Ie=re?t:D;o|=re?$:E,o&=~(re?E:$),o&A||(o&=~(U|j));var We=[s,o,v,ve,oe,Ie,fe,M,z,te],De=l.apply(t,We);return gd(s)&&zv(De,We),De.placeholder=p,Hv(De,s,o)}function cd(s){var o=rr[s];return function(l,p){if(l=hn(l),p=p==null?0:mr(qe(p),292),p&&Hm(l)){var v=(ft(l)+"e").split("e"),D=o(v[0]+"e"+(+v[1]+p));return v=(ft(D)+"e").split("e"),+(v[0]+"e"+(+v[1]-p))}return o(l)}}var l$=io&&1/Gc(new io([,-0]))[1]==ee?function(s){return new io(s)}:Ad;function Tv(s){return function(o){var l=vr(o);return l==Ce?jf(o):l==Oe?SO(o):yO(o,s(o))}}function Zn(s,o,l,p,v,D,R,M){var z=o&j;if(!z&&typeof s!="function")throw new on(c);var te=p?p.length:0;if(te||(o&=~($|E),p=v=t),R=R===t?R:nr(qe(R),0),M=M===t?M:qe(M),te-=v?v.length:0,o&E){var re=p,oe=v;p=v=t}var fe=z?t:hd(s),ve=[s,o,l,p,v,re,oe,D,R,M];if(fe&&I$(ve,fe),s=ve[0],o=ve[1],l=ve[2],p=ve[3],v=ve[4],M=ve[9]=ve[9]===t?z?0:s.length:nr(ve[9]-te,0),!M&&o&(T|C)&&(o&=~(T|C)),!o||o==U)var Ie=o$(s,o,l);else o==T||o==C?Ie=a$(s,o,M):(o==$||o==(U|$))&&!v.length?Ie=c$(s,o,l,p):Ie=ml.apply(t,ve);var We=fe?fv:zv;return Hv(We(Ie,ve),s,o)}function Rv(s,o,l,p){return s===t||wn(s,no[l])&&!dt.call(p,l)?o:s}function Nv(s,o,l,p,v,D){return Rt(s)&&Rt(o)&&(D.set(o,s),fl(s,o,t,Nv,D),D.delete(o)),s}function u$(s){return _a(s)?t:s}function Lv(s,o,l,p,v,D){var R=l&S,M=s.length,z=o.length;if(M!=z&&!(R&&z>M))return!1;var te=D.get(s),re=D.get(o);if(te&&re)return te==o&&re==s;var oe=-1,fe=!0,ve=l&P?new us:t;for(D.set(s,o),D.set(o,s);++oe<M;){var Ie=s[oe],We=o[oe];if(p)var De=R?p(We,Ie,oe,o,s,D):p(Ie,We,oe,s,o,D);if(De!==t){if(De)continue;fe=!1;break}if(ve){if(!Tf(o,function(Qe,st){if(!aa(ve,st)&&(Ie===Qe||v(Ie,Qe,l,p,D)))return ve.push(st)})){fe=!1;break}}else if(!(Ie===We||v(Ie,We,l,p,D))){fe=!1;break}}return D.delete(s),D.delete(o),fe}function h$(s,o,l,p,v,D,R){switch(l){case Te:if(s.byteLength!=o.byteLength||s.byteOffset!=o.byteOffset)return!1;s=s.buffer,o=o.buffer;case Se:return!(s.byteLength!=o.byteLength||!D(new el(s),new el(o)));case W:case B:case Ke:return wn(+s,+o);case L:return s.name==o.name&&s.message==o.message;case ze:case Ue:return s==o+"";case Ce:var M=jf;case Oe:var z=p&S;if(M||(M=Gc),s.size!=o.size&&!z)return!1;var te=R.get(s);if(te)return te==o;p|=P,R.set(s,o);var re=Lv(M(s),M(o),p,v,D,R);return R.delete(s),re;case je:if(fa)return fa.call(s)==fa.call(o)}return!1}function f$(s,o,l,p,v,D){var R=l&S,M=ld(s),z=M.length,te=ld(o),re=te.length;if(z!=re&&!R)return!1;for(var oe=z;oe--;){var fe=M[oe];if(!(R?fe in o:dt.call(o,fe)))return!1}var ve=D.get(s),Ie=D.get(o);if(ve&&Ie)return ve==o&&Ie==s;var We=!0;D.set(s,o),D.set(o,s);for(var De=R;++oe<z;){fe=M[oe];var Qe=s[fe],st=o[fe];if(p)var Qr=R?p(st,Qe,fe,o,s,D):p(Qe,st,fe,s,o,D);if(!(Qr===t?Qe===st||v(Qe,st,l,p,D):Qr)){We=!1;break}De||(De=fe=="constructor")}if(We&&!De){var Pr=s.constructor,Xr=o.constructor;Pr!=Xr&&"constructor"in s&&"constructor"in o&&!(typeof Pr=="function"&&Pr instanceof Pr&&typeof Xr=="function"&&Xr instanceof Xr)&&(We=!1)}return D.delete(s),D.delete(o),We}function Qn(s){return vd(kv(s,t,Jv),s+"")}function ld(s){return tv(s,cr,dd)}function ud(s){return tv(s,kr,Mv)}var hd=ol?function(s){return ol.get(s)}:Ad;function bl(s){for(var o=s.name+"",l=so[o],p=dt.call(so,o)?l.length:0;p--;){var v=l[p],D=v.func;if(D==null||D==s)return v.name}return o}function lo(s){var o=dt.call(_,"placeholder")?_:s;return o.placeholder}function _e(){var s=_.iteratee||Od;return s=s===Od?iv:s,arguments.length?s(arguments[0],arguments[1]):s}function _l(s,o){var l=s.__data__;return b$(o)?l[typeof o=="string"?"string":"hash"]:l.map}function fd(s){for(var o=cr(s),l=o.length;l--;){var p=o[l],v=s[p];o[l]=[p,v,Fv(v)]}return o}function ds(s,o){var l=xO(s,o);return nv(l)?l:t}function d$(s){var o=dt.call(s,cs),l=s[cs];try{s[cs]=t;var p=!0}catch{}var v=Qc.call(s);return p&&(o?s[cs]=l:delete s[cs]),v}var dd=Bf?function(s){return s==null?[]:(s=wt(s),Ei(Bf(s),function(o){return qm.call(s,o)}))}:Pd,Mv=Bf?function(s){for(var o=[];s;)xi(o,dd(s)),s=tl(s);return o}:Pd,vr=$r;(kf&&vr(new kf(new ArrayBuffer(1)))!=Te||la&&vr(new la)!=Ce||qf&&vr(qf.resolve())!=St||io&&vr(new io)!=Oe||ua&&vr(new ua)!=Ae)&&(vr=function(s){var o=$r(s),l=o==ke?s.constructor:t,p=l?ps(l):"";if(p)switch(p){case YO:return Te;case JO:return Ce;case ZO:return St;case QO:return Oe;case XO:return Ae}return o});function p$(s,o,l){for(var p=-1,v=l.length;++p<v;){var D=l[p],R=D.size;switch(D.type){case"drop":s+=R;break;case"dropRight":o-=R;break;case"take":o=mr(o,s+R);break;case"takeRight":s=nr(s,o-R);break}}return{start:s,end:o}}function g$(s){var o=s.match(_t);return o?o[1].split(Zt):[]}function Uv(s,o,l){o=Oi(o,s);for(var p=-1,v=o.length,D=!1;++p<v;){var R=Rn(o[p]);if(!(D=s!=null&&l(s,R)))break;s=s[R]}return D||++p!=v?D:(v=s==null?0:s.length,!!v&&Ol(v)&&Xn(R,v)&&(Le(s)||gs(s)))}function m$(s){var o=s.length,l=new s.constructor(o);return o&&typeof s[0]=="string"&&dt.call(s,"index")&&(l.index=s.index,l.input=s.input),l}function jv(s){return typeof s.constructor=="function"&&!wa(s)?oo(tl(s)):{}}function v$(s,o,l){var p=s.constructor;switch(o){case Se:return od(s);case W:case B:return new p(+s);case Te:return e$(s,l);case Ve:case $e:case Ze:case et:case at:case ct:case nt:case Sr:case Ur:return bv(s,l);case Ce:return new p;case Ke:case Ue:return new p(s);case ze:return t$(s);case Oe:return new p;case je:return r$(s)}}function y$(s,o){var l=o.length;if(!l)return s;var p=l-1;return o[p]=(l>1?"& ":"")+o[p],o=o.join(l>2?", ":" "),s.replace(Bt,`{
67
67
  /* [wrapped with `+o+`] */
68
- `)}function v$(s){return Le(s)||ps(s)||!!(Hm&&s&&s[Hm])}function Qn(s,o){var l=typeof s;return o=o??Y,!!o&&(l=="number"||l!="symbol"&&mf.test(s))&&s>-1&&s%1==0&&s<o}function $r(s,o,l){if(!Tt(l))return!1;var p=typeof o;return(p=="number"?Br(l)&&Qn(o,l.length):p=="string"&&o in l)?yn(l[o],s):!1}function pd(s,o){if(Le(s))return!1;var l=typeof s;return l=="number"||l=="symbol"||l=="boolean"||s==null||Jr(s)?!0:Gt.test(s)||!Ct.test(s)||o!=null&&s in yt(o)}function w$(s){var o=typeof s;return o=="string"||o=="number"||o=="symbol"||o=="boolean"?s!=="__proto__":s===null}function gd(s){var o=_l(s),l=_[o];if(typeof l!="function"||!(o in tt.prototype))return!1;if(s===l)return!0;var p=hd(l);return!!p&&s===p[0]}function y$(s){return!!jm&&jm in s}var b$=Zc?Xn:Td;function ya(s){var o=s&&s.constructor,l=typeof o=="function"&&o.prototype||ro;return s===l}function jv(s){return s===s&&!Tt(s)}function Fv(s,o){return function(l){return l==null?!1:l[s]===o&&(o!==t||s in yt(l))}}function _$(s){var o=Ol(s,function(p){return l.size===h&&l.clear(),p}),l=o.cache;return o}function E$(s,o){var l=s[1],p=o[1],v=l|p,S=v<(U|F|f),R=p==f&&l==P||p==f&&l==b&&s[7].length<=o[8]||p==(f|b)&&o[7].length<=o[8]&&l==P;if(!(S||R))return s;p&U&&(s[2]=o[2],v|=l&U?0:$);var M=o[3];if(M){var z=s[3];s[3]=z?_v(z,M,o[4]):M,s[4]=z?xi(s[3],m):o[4]}return M=o[5],M&&(z=s[5],s[5]=z?Ev(z,M,o[6]):M,s[6]=z?xi(s[5],m):o[6]),M=o[7],M&&(s[7]=M),p&f&&(s[8]=s[8]==null?o[8]:mr(s[8],o[8])),s[9]==null&&(s[9]=o[9]),s[0]=o[0],s[1]=v,s}function x$(s){var o=[];if(s!=null)for(var l in yt(s))o.push(l);return o}function I$(s){return Xc.call(s)}function Bv(s,o,l){return o=nr(o===t?s.length-1:o,0),function(){for(var p=arguments,v=-1,S=nr(p.length-o,0),R=G(S);++v<S;)R[v]=p[o+v];v=-1;for(var M=G(o+1);++v<o;)M[v]=p[v];return M[o]=l(R),ar(s,this,M)}}function kv(s,o){return o.length<2?s:hs(s,cn(o,0,-1))}function D$(s,o){for(var l=s.length,p=mr(o.length,l),v=Fr(s);p--;){var S=o[p];s[p]=Qn(S,l)?v[S]:t}return s}function md(s,o){if(!(o==="constructor"&&typeof s[o]=="function")&&o!="__proto__")return s[o]}var Hv=qv(hv),ba=BC||function(s,o){return it.setTimeout(s,o)},vd=qv(G7);function zv(s,o,l){var p=o+"";return vd(s,m$(p,S$(d$(p),l)))}function qv(s){var o=0,l=0;return function(){var p=qC(),v=ce-(p-l);if(l=p,v>0){if(++o>=se)return arguments[0]}else o=0;return s.apply(t,arguments)}}function xl(s,o){var l=-1,p=s.length,v=p-1;for(o=o===t?p:o;++l<o;){var S=Xf(l,v),R=s[S];s[S]=s[l],s[l]=R}return s.length=o,s}var Wv=_$(function(s){var o=[];return s.charCodeAt(0)===46&&o.push(""),s.replace(Yt,function(l,p,v,S){o.push(v?S.replace(uf,"$1"):p||l)}),o});function Rn(s){if(typeof s=="string"||Jr(s))return s;var o=s+"";return o=="0"&&1/s==-ee?"-0":o}function ds(s){if(s!=null){try{return Qc.call(s)}catch{}try{return s+""}catch{}}return""}function S$(s,o){return nn(xe,function(l){var p="_."+l[0];o&l[1]&&!Vc(s,p)&&s.push(p)}),s.sort()}function Kv(s){if(s instanceof tt)return s.clone();var o=new on(s.__wrapped__,s.__chain__);return o.__actions__=Fr(s.__actions__),o.__index__=s.__index__,o.__values__=s.__values__,o}function O$(s,o,l){(l?$r(s,o,l):o===t)?o=1:o=nr(He(o),0);var p=s==null?0:s.length;if(!p||o<1)return[];for(var v=0,S=0,R=G(sl(p/o));v<p;)R[S++]=cn(s,v,v+=o);return R}function C$(s){for(var o=-1,l=s==null?0:s.length,p=0,v=[];++o<l;){var S=s[o];S&&(v[p++]=S)}return v}function $$(){var s=arguments.length;if(!s)return[];for(var o=G(s-1),l=arguments[0],p=s;p--;)o[p-1]=arguments[p];return Ei(Le(l)?Fr(l):[l],fr(o,1))}var A$=Ge(function(s,o){return Wt(s)?pa(s,fr(o,1,Wt,!0)):[]}),P$=Ge(function(s,o){var l=ln(o);return Wt(l)&&(l=t),Wt(s)?pa(s,fr(o,1,Wt,!0),_e(l,2)):[]}),T$=Ge(function(s,o){var l=ln(o);return Wt(l)&&(l=t),Wt(s)?pa(s,fr(o,1,Wt,!0),t,l):[]});function R$(s,o,l){var p=s==null?0:s.length;return p?(o=l||o===t?1:He(o),cn(s,o<0?0:o,p)):[]}function N$(s,o,l){var p=s==null?0:s.length;return p?(o=l||o===t?1:He(o),o=p-o,cn(s,0,o<0?0:o)):[]}function L$(s,o){return s&&s.length?gl(s,_e(o,3),!0,!0):[]}function M$(s,o){return s&&s.length?gl(s,_e(o,3),!0):[]}function U$(s,o,l,p){var v=s==null?0:s.length;return v?(l&&typeof l!="number"&&$r(s,o,l)&&(l=0,p=v),$7(s,o,l,p)):[]}function Vv(s,o,l){var p=s==null?0:s.length;if(!p)return-1;var v=l==null?0:He(l);return v<0&&(v=nr(p+v,0)),Gc(s,_e(o,3),v)}function Gv(s,o,l){var p=s==null?0:s.length;if(!p)return-1;var v=p-1;return l!==t&&(v=He(l),v=l<0?nr(p+v,0):mr(v,p-1)),Gc(s,_e(o,3),v,!0)}function Yv(s){var o=s==null?0:s.length;return o?fr(s,1):[]}function j$(s){var o=s==null?0:s.length;return o?fr(s,ee):[]}function F$(s,o){var l=s==null?0:s.length;return l?(o=o===t?1:He(o),fr(s,o)):[]}function B$(s){for(var o=-1,l=s==null?0:s.length,p={};++o<l;){var v=s[o];p[v[0]]=v[1]}return p}function Jv(s){return s&&s.length?s[0]:t}function k$(s,o,l){var p=s==null?0:s.length;if(!p)return-1;var v=l==null?0:He(l);return v<0&&(v=nr(p+v,0)),Qs(s,o,v)}function H$(s){var o=s==null?0:s.length;return o?cn(s,0,-1):[]}var z$=Ge(function(s){var o=$t(s,id);return o.length&&o[0]===s[0]?Gf(o):[]}),q$=Ge(function(s){var o=ln(s),l=$t(s,id);return o===ln(l)?o=t:l.pop(),l.length&&l[0]===s[0]?Gf(l,_e(o,2)):[]}),W$=Ge(function(s){var o=ln(s),l=$t(s,id);return o=typeof o=="function"?o:t,o&&l.pop(),l.length&&l[0]===s[0]?Gf(l,t,o):[]});function K$(s,o){return s==null?"":HC.call(s,o)}function ln(s){var o=s==null?0:s.length;return o?s[o-1]:t}function V$(s,o,l){var p=s==null?0:s.length;if(!p)return-1;var v=p;return l!==t&&(v=He(l),v=v<0?nr(p+v,0):mr(v,p-1)),o===o?SC(s,o,v):Gc(s,Am,v,!0)}function G$(s,o){return s&&s.length?av(s,He(o)):t}var Y$=Ge(Zv);function Zv(s,o){return s&&s.length&&o&&o.length?Qf(s,o):s}function J$(s,o,l){return s&&s.length&&o&&o.length?Qf(s,o,_e(l,2)):s}function Z$(s,o,l){return s&&s.length&&o&&o.length?Qf(s,o,t,l):s}var Q$=Zn(function(s,o){var l=s==null?0:s.length,p=qf(s,o);return uv(s,$t(o,function(v){return Qn(v,l)?+v:v}).sort(bv)),p});function X$(s,o){var l=[];if(!(s&&s.length))return l;var p=-1,v=[],S=s.length;for(o=_e(o,3);++p<S;){var R=s[p];o(R,p,s)&&(l.push(R),v.push(p))}return uv(s,v),l}function wd(s){return s==null?s:KC.call(s)}function eA(s,o,l){var p=s==null?0:s.length;return p?(l&&typeof l!="number"&&$r(s,o,l)?(o=0,l=p):(o=o==null?0:He(o),l=l===t?p:He(l)),cn(s,o,l)):[]}function tA(s,o){return pl(s,o)}function rA(s,o,l){return td(s,o,_e(l,2))}function nA(s,o){var l=s==null?0:s.length;if(l){var p=pl(s,o);if(p<l&&yn(s[p],o))return p}return-1}function iA(s,o){return pl(s,o,!0)}function sA(s,o,l){return td(s,o,_e(l,2),!0)}function oA(s,o){var l=s==null?0:s.length;if(l){var p=pl(s,o,!0)-1;if(yn(s[p],o))return p}return-1}function aA(s){return s&&s.length?fv(s):[]}function cA(s,o){return s&&s.length?fv(s,_e(o,2)):[]}function lA(s){var o=s==null?0:s.length;return o?cn(s,1,o):[]}function uA(s,o,l){return s&&s.length?(o=l||o===t?1:He(o),cn(s,0,o<0?0:o)):[]}function hA(s,o,l){var p=s==null?0:s.length;return p?(o=l||o===t?1:He(o),o=p-o,cn(s,o<0?0:o,p)):[]}function fA(s,o){return s&&s.length?gl(s,_e(o,3),!1,!0):[]}function dA(s,o){return s&&s.length?gl(s,_e(o,3)):[]}var pA=Ge(function(s){return Si(fr(s,1,Wt,!0))}),gA=Ge(function(s){var o=ln(s);return Wt(o)&&(o=t),Si(fr(s,1,Wt,!0),_e(o,2))}),mA=Ge(function(s){var o=ln(s);return o=typeof o=="function"?o:t,Si(fr(s,1,Wt,!0),t,o)});function vA(s){return s&&s.length?Si(s):[]}function wA(s,o){return s&&s.length?Si(s,_e(o,2)):[]}function yA(s,o){return o=typeof o=="function"?o:t,s&&s.length?Si(s,t,o):[]}function yd(s){if(!(s&&s.length))return[];var o=0;return s=_i(s,function(l){if(Wt(l))return o=nr(l.length,o),!0}),Mf(o,function(l){return $t(s,Rf(l))})}function Qv(s,o){if(!(s&&s.length))return[];var l=yd(s);return o==null?l:$t(l,function(p){return ar(o,t,p)})}var bA=Ge(function(s,o){return Wt(s)?pa(s,o):[]}),_A=Ge(function(s){return nd(_i(s,Wt))}),EA=Ge(function(s){var o=ln(s);return Wt(o)&&(o=t),nd(_i(s,Wt),_e(o,2))}),xA=Ge(function(s){var o=ln(s);return o=typeof o=="function"?o:t,nd(_i(s,Wt),t,o)}),IA=Ge(yd);function DA(s,o){return mv(s||[],o||[],da)}function SA(s,o){return mv(s||[],o||[],va)}var OA=Ge(function(s){var o=s.length,l=o>1?s[o-1]:t;return l=typeof l=="function"?(s.pop(),l):t,Qv(s,l)});function Xv(s){var o=_(s);return o.__chain__=!0,o}function CA(s,o){return o(s),s}function Il(s,o){return o(s)}var $A=Zn(function(s){var o=s.length,l=o?s[0]:0,p=this.__wrapped__,v=function(S){return qf(S,s)};return o>1||this.__actions__.length||!(p instanceof tt)||!Qn(l)?this.thru(v):(p=p.slice(l,+l+(o?1:0)),p.__actions__.push({func:Il,args:[v],thisArg:t}),new on(p,this.__chain__).thru(function(S){return o&&!S.length&&S.push(t),S}))});function AA(){return Xv(this)}function PA(){return new on(this.value(),this.__chain__)}function TA(){this.__values__===t&&(this.__values__=dw(this.value()));var s=this.__index__>=this.__values__.length,o=s?t:this.__values__[this.__index__++];return{done:s,value:o}}function RA(){return this}function NA(s){for(var o,l=this;l instanceof ll;){var p=Kv(l);p.__index__=0,p.__values__=t,o?v.__wrapped__=p:o=p;var v=p;l=l.__wrapped__}return v.__wrapped__=s,o}function LA(){var s=this.__wrapped__;if(s instanceof tt){var o=s;return this.__actions__.length&&(o=new tt(this)),o=o.reverse(),o.__actions__.push({func:Il,args:[wd],thisArg:t}),new on(o,this.__chain__)}return this.thru(wd)}function MA(){return gv(this.__wrapped__,this.__actions__)}var UA=ml(function(s,o,l){dt.call(s,l)?++s[l]:Yn(s,l,1)});function jA(s,o,l){var p=Le(s)?Cm:C7;return l&&$r(s,o,l)&&(o=t),p(s,_e(o,3))}function FA(s,o){var l=Le(s)?_i:Qm;return l(s,_e(o,3))}var BA=Sv(Vv),kA=Sv(Gv);function HA(s,o){return fr(Dl(s,o),1)}function zA(s,o){return fr(Dl(s,o),ee)}function qA(s,o,l){return l=l===t?1:He(l),fr(Dl(s,o),l)}function ew(s,o){var l=Le(s)?nn:Di;return l(s,_e(o,3))}function tw(s,o){var l=Le(s)?lC:Zm;return l(s,_e(o,3))}var WA=ml(function(s,o,l){dt.call(s,l)?s[l].push(o):Yn(s,l,[o])});function KA(s,o,l,p){s=Br(s)?s:uo(s),l=l&&!p?He(l):0;var v=s.length;return l<0&&(l=nr(v+l,0)),Al(s)?l<=v&&s.indexOf(o,l)>-1:!!v&&Qs(s,o,l)>-1}var VA=Ge(function(s,o,l){var p=-1,v=typeof o=="function",S=Br(s)?G(s.length):[];return Di(s,function(R){S[++p]=v?ar(o,R,l):ga(R,o,l)}),S}),GA=ml(function(s,o,l){Yn(s,l,o)});function Dl(s,o){var l=Le(s)?$t:iv;return l(s,_e(o,3))}function YA(s,o,l,p){return s==null?[]:(Le(o)||(o=o==null?[]:[o]),l=p?t:l,Le(l)||(l=l==null?[]:[l]),cv(s,o,l))}var JA=ml(function(s,o,l){s[l?0:1].push(o)},function(){return[[],[]]});function ZA(s,o,l){var p=Le(s)?Pf:Tm,v=arguments.length<3;return p(s,_e(o,4),l,v,Di)}function QA(s,o,l){var p=Le(s)?uC:Tm,v=arguments.length<3;return p(s,_e(o,4),l,v,Zm)}function XA(s,o){var l=Le(s)?_i:Qm;return l(s,Cl(_e(o,3)))}function eP(s){var o=Le(s)?Vm:K7;return o(s)}function tP(s,o,l){(l?$r(s,o,l):o===t)?o=1:o=He(o);var p=Le(s)?x7:V7;return p(s,o)}function rP(s){var o=Le(s)?I7:Y7;return o(s)}function nP(s){if(s==null)return 0;if(Br(s))return Al(s)?eo(s):s.length;var o=vr(s);return o==Oe||o==Ce?s.size:Jf(s).length}function iP(s,o,l){var p=Le(s)?Tf:J7;return l&&$r(s,o,l)&&(o=t),p(s,_e(o,3))}var sP=Ge(function(s,o){if(s==null)return[];var l=o.length;return l>1&&$r(s,o[0],o[1])?o=[]:l>2&&$r(o[0],o[1],o[2])&&(o=[o[0]]),cv(s,fr(o,1),[])}),Sl=FC||function(){return it.Date.now()};function oP(s,o){if(typeof o!="function")throw new sn(c);return s=He(s),function(){if(--s<1)return o.apply(this,arguments)}}function rw(s,o,l){return o=l?t:o,o=s&&o==null?s.length:o,Jn(s,f,t,t,t,t,o)}function nw(s,o){var l;if(typeof o!="function")throw new sn(c);return s=He(s),function(){return--s>0&&(l=o.apply(this,arguments)),s<=1&&(o=t),l}}var bd=Ge(function(s,o,l){var p=U;if(l.length){var v=xi(l,co(bd));p|=A}return Jn(s,p,o,l,v)}),iw=Ge(function(s,o,l){var p=U|F;if(l.length){var v=xi(l,co(iw));p|=A}return Jn(o,p,s,l,v)});function sw(s,o,l){o=l?t:o;var p=Jn(s,P,t,t,t,t,t,o);return p.placeholder=sw.placeholder,p}function ow(s,o,l){o=l?t:o;var p=Jn(s,O,t,t,t,t,t,o);return p.placeholder=ow.placeholder,p}function aw(s,o,l){var p,v,S,R,M,z,te=0,re=!1,oe=!1,fe=!0;if(typeof s!="function")throw new sn(c);o=un(o)||0,Tt(l)&&(re=!!l.leading,oe="maxWait"in l,S=oe?nr(un(l.maxWait)||0,o):S,fe="trailing"in l?!!l.trailing:fe);function ve(Kt){var bn=p,ti=v;return p=v=t,te=Kt,R=s.apply(ti,bn),R}function Ie(Kt){return te=Kt,M=ba(Qe,o),re?ve(Kt):R}function We(Kt){var bn=Kt-z,ti=Kt-te,Sw=o-bn;return oe?mr(Sw,S-ti):Sw}function De(Kt){var bn=Kt-z,ti=Kt-te;return z===t||bn>=o||bn<0||oe&&ti>=S}function Qe(){var Kt=Sl();if(De(Kt))return st(Kt);M=ba(Qe,We(Kt))}function st(Kt){return M=t,fe&&p?ve(Kt):(p=v=t,R)}function Zr(){M!==t&&vv(M),te=0,p=z=v=M=t}function Ar(){return M===t?R:st(Sl())}function Qr(){var Kt=Sl(),bn=De(Kt);if(p=arguments,v=this,z=Kt,bn){if(M===t)return Ie(z);if(oe)return vv(M),M=ba(Qe,o),ve(z)}return M===t&&(M=ba(Qe,o)),R}return Qr.cancel=Zr,Qr.flush=Ar,Qr}var aP=Ge(function(s,o){return Jm(s,1,o)}),cP=Ge(function(s,o,l){return Jm(s,un(o)||0,l)});function lP(s){return Jn(s,q)}function Ol(s,o){if(typeof s!="function"||o!=null&&typeof o!="function")throw new sn(c);var l=function(){var p=arguments,v=o?o.apply(this,p):p[0],S=l.cache;if(S.has(v))return S.get(v);var R=s.apply(this,p);return l.cache=S.set(v,R)||S,R};return l.cache=new(Ol.Cache||Gn),l}Ol.Cache=Gn;function Cl(s){if(typeof s!="function")throw new sn(c);return function(){var o=arguments;switch(o.length){case 0:return!s.call(this);case 1:return!s.call(this,o[0]);case 2:return!s.call(this,o[0],o[1]);case 3:return!s.call(this,o[0],o[1],o[2])}return!s.apply(this,o)}}function uP(s){return nw(2,s)}var hP=Z7(function(s,o){o=o.length==1&&Le(o[0])?$t(o[0],Gr(_e())):$t(fr(o,1),Gr(_e()));var l=o.length;return Ge(function(p){for(var v=-1,S=mr(p.length,l);++v<S;)p[v]=o[v].call(this,p[v]);return ar(s,this,p)})}),_d=Ge(function(s,o){var l=xi(o,co(_d));return Jn(s,A,t,o,l)}),cw=Ge(function(s,o){var l=xi(o,co(cw));return Jn(s,x,t,o,l)}),fP=Zn(function(s,o){return Jn(s,b,t,t,t,o)});function dP(s,o){if(typeof s!="function")throw new sn(c);return o=o===t?o:He(o),Ge(s,o)}function pP(s,o){if(typeof s!="function")throw new sn(c);return o=o==null?0:nr(He(o),0),Ge(function(l){var p=l[o],v=Ci(l,0,o);return p&&Ei(v,p),ar(s,this,v)})}function gP(s,o,l){var p=!0,v=!0;if(typeof s!="function")throw new sn(c);return Tt(l)&&(p="leading"in l?!!l.leading:p,v="trailing"in l?!!l.trailing:v),aw(s,o,{leading:p,maxWait:o,trailing:v})}function mP(s){return rw(s,1)}function vP(s,o){return _d(sd(o),s)}function wP(){if(!arguments.length)return[];var s=arguments[0];return Le(s)?s:[s]}function yP(s){return an(s,E)}function bP(s,o){return o=typeof o=="function"?o:t,an(s,E,o)}function _P(s){return an(s,y|E)}function EP(s,o){return o=typeof o=="function"?o:t,an(s,y|E,o)}function xP(s,o){return o==null||Ym(s,o,cr(o))}function yn(s,o){return s===o||s!==s&&o!==o}var IP=bl(Vf),DP=bl(function(s,o){return s>=o}),ps=tv(function(){return arguments}())?tv:function(s){return kt(s)&&dt.call(s,"callee")&&!km.call(s,"callee")},Le=G.isArray,SP=Or?Gr(Or):N7;function Br(s){return s!=null&&$l(s.length)&&!Xn(s)}function Wt(s){return kt(s)&&Br(s)}function OP(s){return s===!0||s===!1||kt(s)&&Cr(s)==W}var $i=kC||Td,CP=mn?Gr(mn):L7;function $P(s){return kt(s)&&s.nodeType===1&&!_a(s)}function AP(s){if(s==null)return!0;if(Br(s)&&(Le(s)||typeof s=="string"||typeof s.splice=="function"||$i(s)||lo(s)||ps(s)))return!s.length;var o=vr(s);if(o==Oe||o==Ce)return!s.size;if(ya(s))return!Jf(s).length;for(var l in s)if(dt.call(s,l))return!1;return!0}function PP(s,o){return ma(s,o)}function TP(s,o,l){l=typeof l=="function"?l:t;var p=l?l(s,o):t;return p===t?ma(s,o,t,l):!!p}function Ed(s){if(!kt(s))return!1;var o=Cr(s);return o==L||o==g||typeof s.message=="string"&&typeof s.name=="string"&&!_a(s)}function RP(s){return typeof s=="number"&&zm(s)}function Xn(s){if(!Tt(s))return!1;var o=Cr(s);return o==le||o==pe||o==K||o==St}function lw(s){return typeof s=="number"&&s==He(s)}function $l(s){return typeof s=="number"&&s>-1&&s%1==0&&s<=Y}function Tt(s){var o=typeof s;return s!=null&&(o=="object"||o=="function")}function kt(s){return s!=null&&typeof s=="object"}var uw=rn?Gr(rn):U7;function NP(s,o){return s===o||Yf(s,o,fd(o))}function LP(s,o,l){return l=typeof l=="function"?l:t,Yf(s,o,fd(o),l)}function MP(s){return hw(s)&&s!=+s}function UP(s){if(b$(s))throw new Re(a);return rv(s)}function jP(s){return s===null}function FP(s){return s==null}function hw(s){return typeof s=="number"||kt(s)&&Cr(s)==Ke}function _a(s){if(!kt(s)||Cr(s)!=ke)return!1;var o=rl(s);if(o===null)return!0;var l=dt.call(o,"constructor")&&o.constructor;return typeof l=="function"&&l instanceof l&&Qc.call(l)==LC}var xd=An?Gr(An):j7;function BP(s){return lw(s)&&s>=-Y&&s<=Y}var fw=oa?Gr(oa):F7;function Al(s){return typeof s=="string"||!Le(s)&&kt(s)&&Cr(s)==Ue}function Jr(s){return typeof s=="symbol"||kt(s)&&Cr(s)==je}var lo=os?Gr(os):B7;function kP(s){return s===t}function HP(s){return kt(s)&&vr(s)==Ae}function zP(s){return kt(s)&&Cr(s)==Fe}var qP=bl(Zf),WP=bl(function(s,o){return s<=o});function dw(s){if(!s)return[];if(Br(s))return Al(s)?vn(s):Fr(s);if(ca&&s[ca])return xC(s[ca]());var o=vr(s),l=o==Oe?jf:o==Ce?Yc:uo;return l(s)}function ei(s){if(!s)return s===0?s:0;if(s=un(s),s===ee||s===-ee){var o=s<0?-1:1;return o*J}return s===s?s:0}function He(s){var o=ei(s),l=o%1;return o===o?l?o-l:o:0}function pw(s){return s?us(He(s),0,ie):0}function un(s){if(typeof s=="number")return s;if(Jr(s))return Q;if(Tt(s)){var o=typeof s.valueOf=="function"?s.valueOf():s;s=Tt(o)?o+"":o}if(typeof s!="string")return s===0?s:+s;s=Rm(s);var l=df.test(s);return l||gf.test(s)?Ne(s.slice(2),l?2:8):ff.test(s)?Q:+s}function gw(s){return Tn(s,kr(s))}function KP(s){return s?us(He(s),-Y,Y):s===0?s:0}function ft(s){return s==null?"":Yr(s)}var VP=oo(function(s,o){if(ya(o)||Br(o)){Tn(o,cr(o),s);return}for(var l in o)dt.call(o,l)&&da(s,l,o[l])}),mw=oo(function(s,o){Tn(o,kr(o),s)}),Pl=oo(function(s,o,l,p){Tn(o,kr(o),s,p)}),GP=oo(function(s,o,l,p){Tn(o,cr(o),s,p)}),YP=Zn(qf);function JP(s,o){var l=so(s);return o==null?l:Gm(l,o)}var ZP=Ge(function(s,o){s=yt(s);var l=-1,p=o.length,v=p>2?o[2]:t;for(v&&$r(o[0],o[1],v)&&(p=1);++l<p;)for(var S=o[l],R=kr(S),M=-1,z=R.length;++M<z;){var te=R[M],re=s[te];(re===t||yn(re,ro[te])&&!dt.call(s,te))&&(s[te]=S[te])}return s}),QP=Ge(function(s){return s.push(t,Rv),ar(vw,t,s)});function XP(s,o){return $m(s,_e(o,3),Pn)}function e9(s,o){return $m(s,_e(o,3),Kf)}function t9(s,o){return s==null?s:Wf(s,_e(o,3),kr)}function r9(s,o){return s==null?s:Xm(s,_e(o,3),kr)}function n9(s,o){return s&&Pn(s,_e(o,3))}function i9(s,o){return s&&Kf(s,_e(o,3))}function s9(s){return s==null?[]:fl(s,cr(s))}function o9(s){return s==null?[]:fl(s,kr(s))}function Id(s,o,l){var p=s==null?t:hs(s,o);return p===t?l:p}function a9(s,o){return s!=null&&Mv(s,o,A7)}function Dd(s,o){return s!=null&&Mv(s,o,P7)}var c9=Cv(function(s,o,l){o!=null&&typeof o.toString!="function"&&(o=Xc.call(o)),s[o]=l},Od(Hr)),l9=Cv(function(s,o,l){o!=null&&typeof o.toString!="function"&&(o=Xc.call(o)),dt.call(s,o)?s[o].push(l):s[o]=[l]},_e),u9=Ge(ga);function cr(s){return Br(s)?Km(s):Jf(s)}function kr(s){return Br(s)?Km(s,!0):k7(s)}function h9(s,o){var l={};return o=_e(o,3),Pn(s,function(p,v,S){Yn(l,o(p,v,S),p)}),l}function f9(s,o){var l={};return o=_e(o,3),Pn(s,function(p,v,S){Yn(l,v,o(p,v,S))}),l}var d9=oo(function(s,o,l){dl(s,o,l)}),vw=oo(function(s,o,l,p){dl(s,o,l,p)}),p9=Zn(function(s,o){var l={};if(s==null)return l;var p=!1;o=$t(o,function(S){return S=Oi(S,s),p||(p=S.length>1),S}),Tn(s,ud(s),l),p&&(l=an(l,y|w|E,c$));for(var v=o.length;v--;)rd(l,o[v]);return l});function g9(s,o){return ww(s,Cl(_e(o)))}var m9=Zn(function(s,o){return s==null?{}:z7(s,o)});function ww(s,o){if(s==null)return{};var l=$t(ud(s),function(p){return[p]});return o=_e(o),lv(s,l,function(p,v){return o(p,v[0])})}function v9(s,o,l){o=Oi(o,s);var p=-1,v=o.length;for(v||(v=1,s=t);++p<v;){var S=s==null?t:s[Rn(o[p])];S===t&&(p=v,S=l),s=Xn(S)?S.call(s):S}return s}function w9(s,o,l){return s==null?s:va(s,o,l)}function y9(s,o,l,p){return p=typeof p=="function"?p:t,s==null?s:va(s,o,l,p)}var yw=Pv(cr),bw=Pv(kr);function b9(s,o,l){var p=Le(s),v=p||$i(s)||lo(s);if(o=_e(o,4),l==null){var S=s&&s.constructor;v?l=p?new S:[]:Tt(s)?l=Xn(S)?so(rl(s)):{}:l={}}return(v?nn:Pn)(s,function(R,M,z){return o(l,R,M,z)}),l}function _9(s,o){return s==null?!0:rd(s,o)}function E9(s,o,l){return s==null?s:pv(s,o,sd(l))}function x9(s,o,l,p){return p=typeof p=="function"?p:t,s==null?s:pv(s,o,sd(l),p)}function uo(s){return s==null?[]:Uf(s,cr(s))}function I9(s){return s==null?[]:Uf(s,kr(s))}function D9(s,o,l){return l===t&&(l=o,o=t),l!==t&&(l=un(l),l=l===l?l:0),o!==t&&(o=un(o),o=o===o?o:0),us(un(s),o,l)}function S9(s,o,l){return o=ei(o),l===t?(l=o,o=0):l=ei(l),s=un(s),T7(s,o,l)}function O9(s,o,l){if(l&&typeof l!="boolean"&&$r(s,o,l)&&(o=l=t),l===t&&(typeof o=="boolean"?(l=o,o=t):typeof s=="boolean"&&(l=s,s=t)),s===t&&o===t?(s=0,o=1):(s=ei(s),o===t?(o=s,s=0):o=ei(o)),s>o){var p=s;s=o,o=p}if(l||s%1||o%1){var v=qm();return mr(s+v*(o-s+vt("1e-"+((v+"").length-1))),o)}return Xf(s,o)}var C9=ao(function(s,o,l){return o=o.toLowerCase(),s+(l?_w(o):o)});function _w(s){return Sd(ft(s).toLowerCase())}function Ew(s){return s=ft(s),s&&s.replace(Wn,wC).replace(Cf,"")}function $9(s,o,l){s=ft(s),o=Yr(o);var p=s.length;l=l===t?p:us(He(l),0,p);var v=l;return l-=o.length,l>=0&&s.slice(l,v)==o}function A9(s){return s=ft(s),s&&Ot.test(s)?s.replace(ts,yC):s}function P9(s){return s=ft(s),s&&Jt.test(s)?s.replace(jt,"\\$&"):s}var T9=ao(function(s,o,l){return s+(l?"-":"")+o.toLowerCase()}),R9=ao(function(s,o,l){return s+(l?" ":"")+o.toLowerCase()}),N9=Dv("toLowerCase");function L9(s,o,l){s=ft(s),o=He(o);var p=o?eo(s):0;if(!o||p>=o)return s;var v=(o-p)/2;return yl(ol(v),l)+s+yl(sl(v),l)}function M9(s,o,l){s=ft(s),o=He(o);var p=o?eo(s):0;return o&&p<o?s+yl(o-p,l):s}function U9(s,o,l){s=ft(s),o=He(o);var p=o?eo(s):0;return o&&p<o?yl(o-p,l)+s:s}function j9(s,o,l){return l||o==null?o=0:o&&(o=+o),WC(ft(s).replace(Ft,""),o||0)}function F9(s,o,l){return(l?$r(s,o,l):o===t)?o=1:o=He(o),ed(ft(s),o)}function B9(){var s=arguments,o=ft(s[0]);return s.length<3?o:o.replace(s[1],s[2])}var k9=ao(function(s,o,l){return s+(l?"_":"")+o.toLowerCase()});function H9(s,o,l){return l&&typeof l!="number"&&$r(s,o,l)&&(o=l=t),l=l===t?ie:l>>>0,l?(s=ft(s),s&&(typeof o=="string"||o!=null&&!xd(o))&&(o=Yr(o),!o&&Xs(s))?Ci(vn(s),0,l):s.split(o,l)):[]}var z9=ao(function(s,o,l){return s+(l?" ":"")+Sd(o)});function q9(s,o,l){return s=ft(s),l=l==null?0:us(He(l),0,s.length),o=Yr(o),s.slice(l,l+o.length)==o}function W9(s,o,l){var p=_.templateSettings;l&&$r(s,o,l)&&(o=t),s=ft(s),o=Pl({},o,p,Tv);var v=Pl({},o.imports,p.imports,Tv),S=cr(v),R=Uf(v,S),M,z,te=0,re=o.interpolate||Ws,oe="__p += '",fe=Ff((o.escape||Ws).source+"|"+re.source+"|"+(re===Pt?hf:Ws).source+"|"+(o.evaluate||Ws).source+"|$","g"),ve="//# sourceURL="+(dt.call(o,"sourceURL")?(o.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++$f+"]")+`
69
- `;s.replace(fe,function(De,Qe,st,Zr,Ar,Qr){return st||(st=Zr),oe+=s.slice(te,Qr).replace(vf,bC),Qe&&(M=!0,oe+=`' +
68
+ `)}function w$(s){return Le(s)||gs(s)||!!(zm&&s&&s[zm])}function Xn(s,o){var l=typeof s;return o=o??Y,!!o&&(l=="number"||l!="symbol"&&mf.test(s))&&s>-1&&s%1==0&&s<o}function Ar(s,o,l){if(!Rt(l))return!1;var p=typeof o;return(p=="number"?Br(l)&&Xn(o,l.length):p=="string"&&o in l)?wn(l[o],s):!1}function pd(s,o){if(Le(s))return!1;var l=typeof s;return l=="number"||l=="symbol"||l=="boolean"||s==null||Zr(s)?!0:Gt.test(s)||!$t.test(s)||o!=null&&s in wt(o)}function b$(s){var o=typeof s;return o=="string"||o=="number"||o=="symbol"||o=="boolean"?s!=="__proto__":s===null}function gd(s){var o=bl(s),l=_[o];if(typeof l!="function"||!(o in tt.prototype))return!1;if(s===l)return!0;var p=hd(l);return!!p&&s===p[0]}function _$(s){return!!Fm&&Fm in s}var E$=Jc?ei:Td;function wa(s){var o=s&&s.constructor,l=typeof o=="function"&&o.prototype||no;return s===l}function Fv(s){return s===s&&!Rt(s)}function Bv(s,o){return function(l){return l==null?!1:l[s]===o&&(o!==t||s in wt(l))}}function x$(s){var o=Sl(s,function(p){return l.size===h&&l.clear(),p}),l=o.cache;return o}function I$(s,o){var l=s[1],p=o[1],v=l|p,D=v<(U|j|d),R=p==d&&l==T||p==d&&l==b&&s[7].length<=o[8]||p==(d|b)&&o[7].length<=o[8]&&l==T;if(!(D||R))return s;p&U&&(s[2]=o[2],v|=l&U?0:A);var M=o[3];if(M){var z=s[3];s[3]=z?Ev(z,M,o[4]):M,s[4]=z?Ii(s[3],m):o[4]}return M=o[5],M&&(z=s[5],s[5]=z?xv(z,M,o[6]):M,s[6]=z?Ii(s[5],m):o[6]),M=o[7],M&&(s[7]=M),p&d&&(s[8]=s[8]==null?o[8]:mr(s[8],o[8])),s[9]==null&&(s[9]=o[9]),s[0]=o[0],s[1]=v,s}function D$(s){var o=[];if(s!=null)for(var l in wt(s))o.push(l);return o}function S$(s){return Qc.call(s)}function kv(s,o,l){return o=nr(o===t?s.length-1:o,0),function(){for(var p=arguments,v=-1,D=nr(p.length-o,0),R=G(D);++v<D;)R[v]=p[o+v];v=-1;for(var M=G(o+1);++v<o;)M[v]=p[v];return M[o]=l(R),ar(s,this,M)}}function qv(s,o){return o.length<2?s:fs(s,ln(o,0,-1))}function C$(s,o){for(var l=s.length,p=mr(o.length,l),v=Fr(s);p--;){var D=o[p];s[p]=Xn(D,l)?v[D]:t}return s}function md(s,o){if(!(o==="constructor"&&typeof s[o]=="function")&&o!="__proto__")return s[o]}var zv=Wv(fv),ba=qO||function(s,o){return it.setTimeout(s,o)},vd=Wv(J7);function Hv(s,o,l){var p=o+"";return vd(s,y$(p,O$(g$(p),l)))}function Wv(s){var o=0,l=0;return function(){var p=KO(),v=ce-(p-l);if(l=p,v>0){if(++o>=se)return arguments[0]}else o=0;return s.apply(t,arguments)}}function El(s,o){var l=-1,p=s.length,v=p-1;for(o=o===t?p:o;++l<o;){var D=Xf(l,v),R=s[D];s[D]=s[l],s[l]=R}return s.length=o,s}var Kv=x$(function(s){var o=[];return s.charCodeAt(0)===46&&o.push(""),s.replace(Yt,function(l,p,v,D){o.push(v?D.replace(uf,"$1"):p||l)}),o});function Rn(s){if(typeof s=="string"||Zr(s))return s;var o=s+"";return o=="0"&&1/s==-ee?"-0":o}function ps(s){if(s!=null){try{return Zc.call(s)}catch{}try{return s+""}catch{}}return""}function O$(s,o){return sn(xe,function(l){var p="_."+l[0];o&l[1]&&!Kc(s,p)&&s.push(p)}),s.sort()}function Vv(s){if(s instanceof tt)return s.clone();var o=new an(s.__wrapped__,s.__chain__);return o.__actions__=Fr(s.__actions__),o.__index__=s.__index__,o.__values__=s.__values__,o}function $$(s,o,l){(l?Ar(s,o,l):o===t)?o=1:o=nr(qe(o),0);var p=s==null?0:s.length;if(!p||o<1)return[];for(var v=0,D=0,R=G(il(p/o));v<p;)R[D++]=ln(s,v,v+=o);return R}function A$(s){for(var o=-1,l=s==null?0:s.length,p=0,v=[];++o<l;){var D=s[o];D&&(v[p++]=D)}return v}function P$(){var s=arguments.length;if(!s)return[];for(var o=G(s-1),l=arguments[0],p=s;p--;)o[p-1]=arguments[p];return xi(Le(l)?Fr(l):[l],fr(o,1))}var T$=Ge(function(s,o){return Kt(s)?pa(s,fr(o,1,Kt,!0)):[]}),R$=Ge(function(s,o){var l=un(o);return Kt(l)&&(l=t),Kt(s)?pa(s,fr(o,1,Kt,!0),_e(l,2)):[]}),N$=Ge(function(s,o){var l=un(o);return Kt(l)&&(l=t),Kt(s)?pa(s,fr(o,1,Kt,!0),t,l):[]});function L$(s,o,l){var p=s==null?0:s.length;return p?(o=l||o===t?1:qe(o),ln(s,o<0?0:o,p)):[]}function M$(s,o,l){var p=s==null?0:s.length;return p?(o=l||o===t?1:qe(o),o=p-o,ln(s,0,o<0?0:o)):[]}function U$(s,o){return s&&s.length?pl(s,_e(o,3),!0,!0):[]}function j$(s,o){return s&&s.length?pl(s,_e(o,3),!0):[]}function F$(s,o,l,p){var v=s==null?0:s.length;return v?(l&&typeof l!="number"&&Ar(s,o,l)&&(l=0,p=v),P7(s,o,l,p)):[]}function Gv(s,o,l){var p=s==null?0:s.length;if(!p)return-1;var v=l==null?0:qe(l);return v<0&&(v=nr(p+v,0)),Vc(s,_e(o,3),v)}function Yv(s,o,l){var p=s==null?0:s.length;if(!p)return-1;var v=p-1;return l!==t&&(v=qe(l),v=l<0?nr(p+v,0):mr(v,p-1)),Vc(s,_e(o,3),v,!0)}function Jv(s){var o=s==null?0:s.length;return o?fr(s,1):[]}function B$(s){var o=s==null?0:s.length;return o?fr(s,ee):[]}function k$(s,o){var l=s==null?0:s.length;return l?(o=o===t?1:qe(o),fr(s,o)):[]}function q$(s){for(var o=-1,l=s==null?0:s.length,p={};++o<l;){var v=s[o];p[v[0]]=v[1]}return p}function Zv(s){return s&&s.length?s[0]:t}function z$(s,o,l){var p=s==null?0:s.length;if(!p)return-1;var v=l==null?0:qe(l);return v<0&&(v=nr(p+v,0)),Xs(s,o,v)}function H$(s){var o=s==null?0:s.length;return o?ln(s,0,-1):[]}var W$=Ge(function(s){var o=At(s,id);return o.length&&o[0]===s[0]?Gf(o):[]}),K$=Ge(function(s){var o=un(s),l=At(s,id);return o===un(l)?o=t:l.pop(),l.length&&l[0]===s[0]?Gf(l,_e(o,2)):[]}),V$=Ge(function(s){var o=un(s),l=At(s,id);return o=typeof o=="function"?o:t,o&&l.pop(),l.length&&l[0]===s[0]?Gf(l,t,o):[]});function G$(s,o){return s==null?"":HO.call(s,o)}function un(s){var o=s==null?0:s.length;return o?s[o-1]:t}function Y$(s,o,l){var p=s==null?0:s.length;if(!p)return-1;var v=p;return l!==t&&(v=qe(l),v=v<0?nr(p+v,0):mr(v,p-1)),o===o?OO(s,o,v):Vc(s,Pm,v,!0)}function J$(s,o){return s&&s.length?cv(s,qe(o)):t}var Z$=Ge(Qv);function Qv(s,o){return s&&s.length&&o&&o.length?Qf(s,o):s}function Q$(s,o,l){return s&&s.length&&o&&o.length?Qf(s,o,_e(l,2)):s}function X$(s,o,l){return s&&s.length&&o&&o.length?Qf(s,o,t,l):s}var eA=Qn(function(s,o){var l=s==null?0:s.length,p=Hf(s,o);return hv(s,At(o,function(v){return Xn(v,l)?+v:v}).sort(_v)),p});function tA(s,o){var l=[];if(!(s&&s.length))return l;var p=-1,v=[],D=s.length;for(o=_e(o,3);++p<D;){var R=s[p];o(R,p,s)&&(l.push(R),v.push(p))}return hv(s,v),l}function yd(s){return s==null?s:GO.call(s)}function rA(s,o,l){var p=s==null?0:s.length;return p?(l&&typeof l!="number"&&Ar(s,o,l)?(o=0,l=p):(o=o==null?0:qe(o),l=l===t?p:qe(l)),ln(s,o,l)):[]}function nA(s,o){return dl(s,o)}function iA(s,o,l){return td(s,o,_e(l,2))}function sA(s,o){var l=s==null?0:s.length;if(l){var p=dl(s,o);if(p<l&&wn(s[p],o))return p}return-1}function oA(s,o){return dl(s,o,!0)}function aA(s,o,l){return td(s,o,_e(l,2),!0)}function cA(s,o){var l=s==null?0:s.length;if(l){var p=dl(s,o,!0)-1;if(wn(s[p],o))return p}return-1}function lA(s){return s&&s.length?dv(s):[]}function uA(s,o){return s&&s.length?dv(s,_e(o,2)):[]}function hA(s){var o=s==null?0:s.length;return o?ln(s,1,o):[]}function fA(s,o,l){return s&&s.length?(o=l||o===t?1:qe(o),ln(s,0,o<0?0:o)):[]}function dA(s,o,l){var p=s==null?0:s.length;return p?(o=l||o===t?1:qe(o),o=p-o,ln(s,o<0?0:o,p)):[]}function pA(s,o){return s&&s.length?pl(s,_e(o,3),!1,!0):[]}function gA(s,o){return s&&s.length?pl(s,_e(o,3)):[]}var mA=Ge(function(s){return Ci(fr(s,1,Kt,!0))}),vA=Ge(function(s){var o=un(s);return Kt(o)&&(o=t),Ci(fr(s,1,Kt,!0),_e(o,2))}),yA=Ge(function(s){var o=un(s);return o=typeof o=="function"?o:t,Ci(fr(s,1,Kt,!0),t,o)});function wA(s){return s&&s.length?Ci(s):[]}function bA(s,o){return s&&s.length?Ci(s,_e(o,2)):[]}function _A(s,o){return o=typeof o=="function"?o:t,s&&s.length?Ci(s,t,o):[]}function wd(s){if(!(s&&s.length))return[];var o=0;return s=Ei(s,function(l){if(Kt(l))return o=nr(l.length,o),!0}),Mf(o,function(l){return At(s,Rf(l))})}function Xv(s,o){if(!(s&&s.length))return[];var l=wd(s);return o==null?l:At(l,function(p){return ar(o,t,p)})}var EA=Ge(function(s,o){return Kt(s)?pa(s,o):[]}),xA=Ge(function(s){return nd(Ei(s,Kt))}),IA=Ge(function(s){var o=un(s);return Kt(o)&&(o=t),nd(Ei(s,Kt),_e(o,2))}),DA=Ge(function(s){var o=un(s);return o=typeof o=="function"?o:t,nd(Ei(s,Kt),t,o)}),SA=Ge(wd);function CA(s,o){return vv(s||[],o||[],da)}function OA(s,o){return vv(s||[],o||[],va)}var $A=Ge(function(s){var o=s.length,l=o>1?s[o-1]:t;return l=typeof l=="function"?(s.pop(),l):t,Xv(s,l)});function ey(s){var o=_(s);return o.__chain__=!0,o}function AA(s,o){return o(s),s}function xl(s,o){return o(s)}var PA=Qn(function(s){var o=s.length,l=o?s[0]:0,p=this.__wrapped__,v=function(D){return Hf(D,s)};return o>1||this.__actions__.length||!(p instanceof tt)||!Xn(l)?this.thru(v):(p=p.slice(l,+l+(o?1:0)),p.__actions__.push({func:xl,args:[v],thisArg:t}),new an(p,this.__chain__).thru(function(D){return o&&!D.length&&D.push(t),D}))});function TA(){return ey(this)}function RA(){return new an(this.value(),this.__chain__)}function NA(){this.__values__===t&&(this.__values__=py(this.value()));var s=this.__index__>=this.__values__.length,o=s?t:this.__values__[this.__index__++];return{done:s,value:o}}function LA(){return this}function MA(s){for(var o,l=this;l instanceof cl;){var p=Vv(l);p.__index__=0,p.__values__=t,o?v.__wrapped__=p:o=p;var v=p;l=l.__wrapped__}return v.__wrapped__=s,o}function UA(){var s=this.__wrapped__;if(s instanceof tt){var o=s;return this.__actions__.length&&(o=new tt(this)),o=o.reverse(),o.__actions__.push({func:xl,args:[yd],thisArg:t}),new an(o,this.__chain__)}return this.thru(yd)}function jA(){return mv(this.__wrapped__,this.__actions__)}var FA=gl(function(s,o,l){dt.call(s,l)?++s[l]:Jn(s,l,1)});function BA(s,o,l){var p=Le(s)?$m:A7;return l&&Ar(s,o,l)&&(o=t),p(s,_e(o,3))}function kA(s,o){var l=Le(s)?Ei:Xm;return l(s,_e(o,3))}var qA=Cv(Gv),zA=Cv(Yv);function HA(s,o){return fr(Il(s,o),1)}function WA(s,o){return fr(Il(s,o),ee)}function KA(s,o,l){return l=l===t?1:qe(l),fr(Il(s,o),l)}function ty(s,o){var l=Le(s)?sn:Si;return l(s,_e(o,3))}function ry(s,o){var l=Le(s)?hO:Qm;return l(s,_e(o,3))}var VA=gl(function(s,o,l){dt.call(s,l)?s[l].push(o):Jn(s,l,[o])});function GA(s,o,l,p){s=Br(s)?s:ho(s),l=l&&!p?qe(l):0;var v=s.length;return l<0&&(l=nr(v+l,0)),$l(s)?l<=v&&s.indexOf(o,l)>-1:!!v&&Xs(s,o,l)>-1}var YA=Ge(function(s,o,l){var p=-1,v=typeof o=="function",D=Br(s)?G(s.length):[];return Si(s,function(R){D[++p]=v?ar(o,R,l):ga(R,o,l)}),D}),JA=gl(function(s,o,l){Jn(s,l,o)});function Il(s,o){var l=Le(s)?At:sv;return l(s,_e(o,3))}function ZA(s,o,l,p){return s==null?[]:(Le(o)||(o=o==null?[]:[o]),l=p?t:l,Le(l)||(l=l==null?[]:[l]),lv(s,o,l))}var QA=gl(function(s,o,l){s[l?0:1].push(o)},function(){return[[],[]]});function XA(s,o,l){var p=Le(s)?Pf:Rm,v=arguments.length<3;return p(s,_e(o,4),l,v,Si)}function eP(s,o,l){var p=Le(s)?fO:Rm,v=arguments.length<3;return p(s,_e(o,4),l,v,Qm)}function tP(s,o){var l=Le(s)?Ei:Xm;return l(s,Cl(_e(o,3)))}function rP(s){var o=Le(s)?Gm:G7;return o(s)}function nP(s,o,l){(l?Ar(s,o,l):o===t)?o=1:o=qe(o);var p=Le(s)?D7:Y7;return p(s,o)}function iP(s){var o=Le(s)?S7:Z7;return o(s)}function sP(s){if(s==null)return 0;if(Br(s))return $l(s)?to(s):s.length;var o=vr(s);return o==Ce||o==Oe?s.size:Jf(s).length}function oP(s,o,l){var p=Le(s)?Tf:Q7;return l&&Ar(s,o,l)&&(o=t),p(s,_e(o,3))}var aP=Ge(function(s,o){if(s==null)return[];var l=o.length;return l>1&&Ar(s,o[0],o[1])?o=[]:l>2&&Ar(o[0],o[1],o[2])&&(o=[o[0]]),lv(s,fr(o,1),[])}),Dl=kO||function(){return it.Date.now()};function cP(s,o){if(typeof o!="function")throw new on(c);return s=qe(s),function(){if(--s<1)return o.apply(this,arguments)}}function ny(s,o,l){return o=l?t:o,o=s&&o==null?s.length:o,Zn(s,d,t,t,t,t,o)}function iy(s,o){var l;if(typeof o!="function")throw new on(c);return s=qe(s),function(){return--s>0&&(l=o.apply(this,arguments)),s<=1&&(o=t),l}}var bd=Ge(function(s,o,l){var p=U;if(l.length){var v=Ii(l,lo(bd));p|=$}return Zn(s,p,o,l,v)}),sy=Ge(function(s,o,l){var p=U|j;if(l.length){var v=Ii(l,lo(sy));p|=$}return Zn(o,p,s,l,v)});function oy(s,o,l){o=l?t:o;var p=Zn(s,T,t,t,t,t,t,o);return p.placeholder=oy.placeholder,p}function ay(s,o,l){o=l?t:o;var p=Zn(s,C,t,t,t,t,t,o);return p.placeholder=ay.placeholder,p}function cy(s,o,l){var p,v,D,R,M,z,te=0,re=!1,oe=!1,fe=!0;if(typeof s!="function")throw new on(c);o=hn(o)||0,Rt(l)&&(re=!!l.leading,oe="maxWait"in l,D=oe?nr(hn(l.maxWait)||0,o):D,fe="trailing"in l?!!l.trailing:fe);function ve(Vt){var bn=p,ri=v;return p=v=t,te=Vt,R=s.apply(ri,bn),R}function Ie(Vt){return te=Vt,M=ba(Qe,o),re?ve(Vt):R}function We(Vt){var bn=Vt-z,ri=Vt-te,Cy=o-bn;return oe?mr(Cy,D-ri):Cy}function De(Vt){var bn=Vt-z,ri=Vt-te;return z===t||bn>=o||bn<0||oe&&ri>=D}function Qe(){var Vt=Dl();if(De(Vt))return st(Vt);M=ba(Qe,We(Vt))}function st(Vt){return M=t,fe&&p?ve(Vt):(p=v=t,R)}function Qr(){M!==t&&yv(M),te=0,p=z=v=M=t}function Pr(){return M===t?R:st(Dl())}function Xr(){var Vt=Dl(),bn=De(Vt);if(p=arguments,v=this,z=Vt,bn){if(M===t)return Ie(z);if(oe)return yv(M),M=ba(Qe,o),ve(z)}return M===t&&(M=ba(Qe,o)),R}return Xr.cancel=Qr,Xr.flush=Pr,Xr}var lP=Ge(function(s,o){return Zm(s,1,o)}),uP=Ge(function(s,o,l){return Zm(s,hn(o)||0,l)});function hP(s){return Zn(s,H)}function Sl(s,o){if(typeof s!="function"||o!=null&&typeof o!="function")throw new on(c);var l=function(){var p=arguments,v=o?o.apply(this,p):p[0],D=l.cache;if(D.has(v))return D.get(v);var R=s.apply(this,p);return l.cache=D.set(v,R)||D,R};return l.cache=new(Sl.Cache||Yn),l}Sl.Cache=Yn;function Cl(s){if(typeof s!="function")throw new on(c);return function(){var o=arguments;switch(o.length){case 0:return!s.call(this);case 1:return!s.call(this,o[0]);case 2:return!s.call(this,o[0],o[1]);case 3:return!s.call(this,o[0],o[1],o[2])}return!s.apply(this,o)}}function fP(s){return iy(2,s)}var dP=X7(function(s,o){o=o.length==1&&Le(o[0])?At(o[0],Yr(_e())):At(fr(o,1),Yr(_e()));var l=o.length;return Ge(function(p){for(var v=-1,D=mr(p.length,l);++v<D;)p[v]=o[v].call(this,p[v]);return ar(s,this,p)})}),_d=Ge(function(s,o){var l=Ii(o,lo(_d));return Zn(s,$,t,o,l)}),ly=Ge(function(s,o){var l=Ii(o,lo(ly));return Zn(s,E,t,o,l)}),pP=Qn(function(s,o){return Zn(s,b,t,t,t,o)});function gP(s,o){if(typeof s!="function")throw new on(c);return o=o===t?o:qe(o),Ge(s,o)}function mP(s,o){if(typeof s!="function")throw new on(c);return o=o==null?0:nr(qe(o),0),Ge(function(l){var p=l[o],v=$i(l,0,o);return p&&xi(v,p),ar(s,this,v)})}function vP(s,o,l){var p=!0,v=!0;if(typeof s!="function")throw new on(c);return Rt(l)&&(p="leading"in l?!!l.leading:p,v="trailing"in l?!!l.trailing:v),cy(s,o,{leading:p,maxWait:o,trailing:v})}function yP(s){return ny(s,1)}function wP(s,o){return _d(sd(o),s)}function bP(){if(!arguments.length)return[];var s=arguments[0];return Le(s)?s:[s]}function _P(s){return cn(s,x)}function EP(s,o){return o=typeof o=="function"?o:t,cn(s,x,o)}function xP(s){return cn(s,w|x)}function IP(s,o){return o=typeof o=="function"?o:t,cn(s,w|x,o)}function DP(s,o){return o==null||Jm(s,o,cr(o))}function wn(s,o){return s===o||s!==s&&o!==o}var SP=wl(Vf),CP=wl(function(s,o){return s>=o}),gs=rv(function(){return arguments}())?rv:function(s){return kt(s)&&dt.call(s,"callee")&&!qm.call(s,"callee")},Le=G.isArray,OP=Or?Yr(Or):M7;function Br(s){return s!=null&&Ol(s.length)&&!ei(s)}function Kt(s){return kt(s)&&Br(s)}function $P(s){return s===!0||s===!1||kt(s)&&$r(s)==W}var Ai=zO||Td,AP=mn?Yr(mn):U7;function PP(s){return kt(s)&&s.nodeType===1&&!_a(s)}function TP(s){if(s==null)return!0;if(Br(s)&&(Le(s)||typeof s=="string"||typeof s.splice=="function"||Ai(s)||uo(s)||gs(s)))return!s.length;var o=vr(s);if(o==Ce||o==Oe)return!s.size;if(wa(s))return!Jf(s).length;for(var l in s)if(dt.call(s,l))return!1;return!0}function RP(s,o){return ma(s,o)}function NP(s,o,l){l=typeof l=="function"?l:t;var p=l?l(s,o):t;return p===t?ma(s,o,t,l):!!p}function Ed(s){if(!kt(s))return!1;var o=$r(s);return o==L||o==g||typeof s.message=="string"&&typeof s.name=="string"&&!_a(s)}function LP(s){return typeof s=="number"&&Hm(s)}function ei(s){if(!Rt(s))return!1;var o=$r(s);return o==le||o==pe||o==K||o==Ct}function uy(s){return typeof s=="number"&&s==qe(s)}function Ol(s){return typeof s=="number"&&s>-1&&s%1==0&&s<=Y}function Rt(s){var o=typeof s;return s!=null&&(o=="object"||o=="function")}function kt(s){return s!=null&&typeof s=="object"}var hy=nn?Yr(nn):F7;function MP(s,o){return s===o||Yf(s,o,fd(o))}function UP(s,o,l){return l=typeof l=="function"?l:t,Yf(s,o,fd(o),l)}function jP(s){return fy(s)&&s!=+s}function FP(s){if(E$(s))throw new Re(a);return nv(s)}function BP(s){return s===null}function kP(s){return s==null}function fy(s){return typeof s=="number"||kt(s)&&$r(s)==Ke}function _a(s){if(!kt(s)||$r(s)!=ke)return!1;var o=tl(s);if(o===null)return!0;var l=dt.call(o,"constructor")&&o.constructor;return typeof l=="function"&&l instanceof l&&Zc.call(l)==UO}var xd=An?Yr(An):B7;function qP(s){return uy(s)&&s>=-Y&&s<=Y}var dy=oa?Yr(oa):k7;function $l(s){return typeof s=="string"||!Le(s)&&kt(s)&&$r(s)==Ue}function Zr(s){return typeof s=="symbol"||kt(s)&&$r(s)==je}var uo=as?Yr(as):q7;function zP(s){return s===t}function HP(s){return kt(s)&&vr(s)==Ae}function WP(s){return kt(s)&&$r(s)==Fe}var KP=wl(Zf),VP=wl(function(s,o){return s<=o});function py(s){if(!s)return[];if(Br(s))return $l(s)?vn(s):Fr(s);if(ca&&s[ca])return DO(s[ca]());var o=vr(s),l=o==Ce?jf:o==Oe?Gc:ho;return l(s)}function ti(s){if(!s)return s===0?s:0;if(s=hn(s),s===ee||s===-ee){var o=s<0?-1:1;return o*J}return s===s?s:0}function qe(s){var o=ti(s),l=o%1;return o===o?l?o-l:o:0}function gy(s){return s?hs(qe(s),0,ie):0}function hn(s){if(typeof s=="number")return s;if(Zr(s))return Q;if(Rt(s)){var o=typeof s.valueOf=="function"?s.valueOf():s;s=Rt(o)?o+"":o}if(typeof s!="string")return s===0?s:+s;s=Nm(s);var l=df.test(s);return l||gf.test(s)?Ne(s.slice(2),l?2:8):ff.test(s)?Q:+s}function my(s){return Tn(s,kr(s))}function GP(s){return s?hs(qe(s),-Y,Y):s===0?s:0}function ft(s){return s==null?"":Jr(s)}var YP=ao(function(s,o){if(wa(o)||Br(o)){Tn(o,cr(o),s);return}for(var l in o)dt.call(o,l)&&da(s,l,o[l])}),vy=ao(function(s,o){Tn(o,kr(o),s)}),Al=ao(function(s,o,l,p){Tn(o,kr(o),s,p)}),JP=ao(function(s,o,l,p){Tn(o,cr(o),s,p)}),ZP=Qn(Hf);function QP(s,o){var l=oo(s);return o==null?l:Ym(l,o)}var XP=Ge(function(s,o){s=wt(s);var l=-1,p=o.length,v=p>2?o[2]:t;for(v&&Ar(o[0],o[1],v)&&(p=1);++l<p;)for(var D=o[l],R=kr(D),M=-1,z=R.length;++M<z;){var te=R[M],re=s[te];(re===t||wn(re,no[te])&&!dt.call(s,te))&&(s[te]=D[te])}return s}),e9=Ge(function(s){return s.push(t,Nv),ar(yy,t,s)});function t9(s,o){return Am(s,_e(o,3),Pn)}function r9(s,o){return Am(s,_e(o,3),Kf)}function n9(s,o){return s==null?s:Wf(s,_e(o,3),kr)}function i9(s,o){return s==null?s:ev(s,_e(o,3),kr)}function s9(s,o){return s&&Pn(s,_e(o,3))}function o9(s,o){return s&&Kf(s,_e(o,3))}function a9(s){return s==null?[]:hl(s,cr(s))}function c9(s){return s==null?[]:hl(s,kr(s))}function Id(s,o,l){var p=s==null?t:fs(s,o);return p===t?l:p}function l9(s,o){return s!=null&&Uv(s,o,T7)}function Dd(s,o){return s!=null&&Uv(s,o,R7)}var u9=$v(function(s,o,l){o!=null&&typeof o.toString!="function"&&(o=Qc.call(o)),s[o]=l},Cd(qr)),h9=$v(function(s,o,l){o!=null&&typeof o.toString!="function"&&(o=Qc.call(o)),dt.call(s,o)?s[o].push(l):s[o]=[l]},_e),f9=Ge(ga);function cr(s){return Br(s)?Vm(s):Jf(s)}function kr(s){return Br(s)?Vm(s,!0):z7(s)}function d9(s,o){var l={};return o=_e(o,3),Pn(s,function(p,v,D){Jn(l,o(p,v,D),p)}),l}function p9(s,o){var l={};return o=_e(o,3),Pn(s,function(p,v,D){Jn(l,v,o(p,v,D))}),l}var g9=ao(function(s,o,l){fl(s,o,l)}),yy=ao(function(s,o,l,p){fl(s,o,l,p)}),m9=Qn(function(s,o){var l={};if(s==null)return l;var p=!1;o=At(o,function(D){return D=Oi(D,s),p||(p=D.length>1),D}),Tn(s,ud(s),l),p&&(l=cn(l,w|y|x,u$));for(var v=o.length;v--;)rd(l,o[v]);return l});function v9(s,o){return wy(s,Cl(_e(o)))}var y9=Qn(function(s,o){return s==null?{}:W7(s,o)});function wy(s,o){if(s==null)return{};var l=At(ud(s),function(p){return[p]});return o=_e(o),uv(s,l,function(p,v){return o(p,v[0])})}function w9(s,o,l){o=Oi(o,s);var p=-1,v=o.length;for(v||(v=1,s=t);++p<v;){var D=s==null?t:s[Rn(o[p])];D===t&&(p=v,D=l),s=ei(D)?D.call(s):D}return s}function b9(s,o,l){return s==null?s:va(s,o,l)}function _9(s,o,l,p){return p=typeof p=="function"?p:t,s==null?s:va(s,o,l,p)}var by=Tv(cr),_y=Tv(kr);function E9(s,o,l){var p=Le(s),v=p||Ai(s)||uo(s);if(o=_e(o,4),l==null){var D=s&&s.constructor;v?l=p?new D:[]:Rt(s)?l=ei(D)?oo(tl(s)):{}:l={}}return(v?sn:Pn)(s,function(R,M,z){return o(l,R,M,z)}),l}function x9(s,o){return s==null?!0:rd(s,o)}function I9(s,o,l){return s==null?s:gv(s,o,sd(l))}function D9(s,o,l,p){return p=typeof p=="function"?p:t,s==null?s:gv(s,o,sd(l),p)}function ho(s){return s==null?[]:Uf(s,cr(s))}function S9(s){return s==null?[]:Uf(s,kr(s))}function C9(s,o,l){return l===t&&(l=o,o=t),l!==t&&(l=hn(l),l=l===l?l:0),o!==t&&(o=hn(o),o=o===o?o:0),hs(hn(s),o,l)}function O9(s,o,l){return o=ti(o),l===t?(l=o,o=0):l=ti(l),s=hn(s),N7(s,o,l)}function $9(s,o,l){if(l&&typeof l!="boolean"&&Ar(s,o,l)&&(o=l=t),l===t&&(typeof o=="boolean"?(l=o,o=t):typeof s=="boolean"&&(l=s,s=t)),s===t&&o===t?(s=0,o=1):(s=ti(s),o===t?(o=s,s=0):o=ti(o)),s>o){var p=s;s=o,o=p}if(l||s%1||o%1){var v=Wm();return mr(s+v*(o-s+vt("1e-"+((v+"").length-1))),o)}return Xf(s,o)}var A9=co(function(s,o,l){return o=o.toLowerCase(),s+(l?Ey(o):o)});function Ey(s){return Sd(ft(s).toLowerCase())}function xy(s){return s=ft(s),s&&s.replace(Kn,bO).replace(Of,"")}function P9(s,o,l){s=ft(s),o=Jr(o);var p=s.length;l=l===t?p:hs(qe(l),0,p);var v=l;return l-=o.length,l>=0&&s.slice(l,v)==o}function T9(s){return s=ft(s),s&&Ot.test(s)?s.replace(rs,_O):s}function R9(s){return s=ft(s),s&&Jt.test(s)?s.replace(jt,"\\$&"):s}var N9=co(function(s,o,l){return s+(l?"-":"")+o.toLowerCase()}),L9=co(function(s,o,l){return s+(l?" ":"")+o.toLowerCase()}),M9=Sv("toLowerCase");function U9(s,o,l){s=ft(s),o=qe(o);var p=o?to(s):0;if(!o||p>=o)return s;var v=(o-p)/2;return yl(sl(v),l)+s+yl(il(v),l)}function j9(s,o,l){s=ft(s),o=qe(o);var p=o?to(s):0;return o&&p<o?s+yl(o-p,l):s}function F9(s,o,l){s=ft(s),o=qe(o);var p=o?to(s):0;return o&&p<o?yl(o-p,l)+s:s}function B9(s,o,l){return l||o==null?o=0:o&&(o=+o),VO(ft(s).replace(Ft,""),o||0)}function k9(s,o,l){return(l?Ar(s,o,l):o===t)?o=1:o=qe(o),ed(ft(s),o)}function q9(){var s=arguments,o=ft(s[0]);return s.length<3?o:o.replace(s[1],s[2])}var z9=co(function(s,o,l){return s+(l?"_":"")+o.toLowerCase()});function H9(s,o,l){return l&&typeof l!="number"&&Ar(s,o,l)&&(o=l=t),l=l===t?ie:l>>>0,l?(s=ft(s),s&&(typeof o=="string"||o!=null&&!xd(o))&&(o=Jr(o),!o&&eo(s))?$i(vn(s),0,l):s.split(o,l)):[]}var W9=co(function(s,o,l){return s+(l?" ":"")+Sd(o)});function K9(s,o,l){return s=ft(s),l=l==null?0:hs(qe(l),0,s.length),o=Jr(o),s.slice(l,l+o.length)==o}function V9(s,o,l){var p=_.templateSettings;l&&Ar(s,o,l)&&(o=t),s=ft(s),o=Al({},o,p,Rv);var v=Al({},o.imports,p.imports,Rv),D=cr(v),R=Uf(v,D),M,z,te=0,re=o.interpolate||Ks,oe="__p += '",fe=Ff((o.escape||Ks).source+"|"+re.source+"|"+(re===Tt?hf:Ks).source+"|"+(o.evaluate||Ks).source+"|$","g"),ve="//# sourceURL="+(dt.call(o,"sourceURL")?(o.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++$f+"]")+`
69
+ `;s.replace(fe,function(De,Qe,st,Qr,Pr,Xr){return st||(st=Qr),oe+=s.slice(te,Xr).replace(vf,EO),Qe&&(M=!0,oe+=`' +
70
70
  __e(`+Qe+`) +
71
- '`),Ar&&(z=!0,oe+=`';
72
- `+Ar+`;
71
+ '`),Pr&&(z=!0,oe+=`';
72
+ `+Pr+`;
73
73
  __p += '`),st&&(oe+=`' +
74
74
  ((__t = (`+st+`)) == null ? '' : __t) +
75
- '`),te=Qr+De.length,De}),oe+=`';
75
+ '`),te=Xr+De.length,De}),oe+=`';
76
76
  `;var Ie=dt.call(o,"variable")&&o.variable;if(!Ie)oe=`with (obj) {
77
77
  `+oe+`
78
78
  }
79
- `;else if(lf.test(Ie))throw new Re(u);oe=(z?oe.replace(Cn,""):oe).replace(Sr,"$1").replace(qn,"$1;"),oe="function("+(Ie||"obj")+`) {
79
+ `;else if(lf.test(Ie))throw new Re(u);oe=(z?oe.replace(On,""):oe).replace(Cr,"$1").replace(Wn,"$1;"),oe="function("+(Ie||"obj")+`) {
80
80
  `+(Ie?"":`obj || (obj = {});
81
81
  `)+"var __t, __p = ''"+(M?", __e = _.escape":"")+(z?`, __j = Array.prototype.join;
82
82
  function print() { __p += __j.call(arguments, '') }
83
83
  `:`;
84
84
  `)+oe+`return __p
85
- }`;var We=Iw(function(){return ut(S,ve+"return "+oe).apply(t,R)});if(We.source=oe,Ed(We))throw We;return We}function K9(s){return ft(s).toLowerCase()}function V9(s){return ft(s).toUpperCase()}function G9(s,o,l){if(s=ft(s),s&&(l||o===t))return Rm(s);if(!s||!(o=Yr(o)))return s;var p=vn(s),v=vn(o),S=Nm(p,v),R=Lm(p,v)+1;return Ci(p,S,R).join("")}function Y9(s,o,l){if(s=ft(s),s&&(l||o===t))return s.slice(0,Um(s)+1);if(!s||!(o=Yr(o)))return s;var p=vn(s),v=Lm(p,vn(o))+1;return Ci(p,0,v).join("")}function J9(s,o,l){if(s=ft(s),s&&(l||o===t))return s.replace(Ft,"");if(!s||!(o=Yr(o)))return s;var p=vn(s),v=Nm(p,vn(o));return Ci(p,v).join("")}function Z9(s,o){var l=j,p=V;if(Tt(o)){var v="separator"in o?o.separator:v;l="length"in o?He(o.length):l,p="omission"in o?Yr(o.omission):p}s=ft(s);var S=s.length;if(Xs(s)){var R=vn(s);S=R.length}if(l>=S)return s;var M=l-eo(p);if(M<1)return p;var z=R?Ci(R,0,M).join(""):s.slice(0,M);if(v===t)return z+p;if(R&&(M+=z.length-M),xd(v)){if(s.slice(M).search(v)){var te,re=z;for(v.global||(v=Ff(v.source,ft(tn.exec(v))+"g")),v.lastIndex=0;te=v.exec(re);)var oe=te.index;z=z.slice(0,oe===t?M:oe)}}else if(s.indexOf(Yr(v),M)!=M){var fe=z.lastIndexOf(v);fe>-1&&(z=z.slice(0,fe))}return z+p}function Q9(s){return s=ft(s),s&&Lt.test(s)?s.replace(yi,OC):s}var X9=ao(function(s,o,l){return s+(l?" ":"")+o.toUpperCase()}),Sd=Dv("toUpperCase");function xw(s,o,l){return s=ft(s),o=l?t:o,o===t?EC(s)?AC(s):dC(s):s.match(o)||[]}var Iw=Ge(function(s,o){try{return ar(s,t,o)}catch(l){return Ed(l)?l:new Re(l)}}),eT=Zn(function(s,o){return nn(o,function(l){l=Rn(l),Yn(s,l,bd(s[l],s))}),s});function tT(s){var o=s==null?0:s.length,l=_e();return s=o?$t(s,function(p){if(typeof p[1]!="function")throw new sn(c);return[l(p[0]),p[1]]}):[],Ge(function(p){for(var v=-1;++v<o;){var S=s[v];if(ar(S[0],this,p))return ar(S[1],this,p)}})}function rT(s){return O7(an(s,y))}function Od(s){return function(){return s}}function nT(s,o){return s==null||s!==s?o:s}var iT=Ov(),sT=Ov(!0);function Hr(s){return s}function Cd(s){return nv(typeof s=="function"?s:an(s,y))}function oT(s){return sv(an(s,y))}function aT(s,o){return ov(s,an(o,y))}var cT=Ge(function(s,o){return function(l){return ga(l,s,o)}}),lT=Ge(function(s,o){return function(l){return ga(s,l,o)}});function $d(s,o,l){var p=cr(o),v=fl(o,p);l==null&&!(Tt(o)&&(v.length||!p.length))&&(l=o,o=s,s=this,v=fl(o,cr(o)));var S=!(Tt(l)&&"chain"in l)||!!l.chain,R=Xn(s);return nn(v,function(M){var z=o[M];s[M]=z,R&&(s.prototype[M]=function(){var te=this.__chain__;if(S||te){var re=s(this.__wrapped__),oe=re.__actions__=Fr(this.__actions__);return oe.push({func:z,args:arguments,thisArg:s}),re.__chain__=te,re}return z.apply(s,Ei([this.value()],arguments))})}),s}function uT(){return it._===this&&(it._=MC),this}function Ad(){}function hT(s){return s=He(s),Ge(function(o){return av(o,s)})}var fT=ad($t),dT=ad(Cm),pT=ad(Tf);function Dw(s){return pd(s)?Rf(Rn(s)):q7(s)}function gT(s){return function(o){return s==null?t:hs(s,o)}}var mT=$v(),vT=$v(!0);function Pd(){return[]}function Td(){return!1}function wT(){return{}}function yT(){return""}function bT(){return!0}function _T(s,o){if(s=He(s),s<1||s>Y)return[];var l=ie,p=mr(s,ie);o=_e(o),s-=ie;for(var v=Mf(p,o);++l<s;)o(l);return v}function ET(s){return Le(s)?$t(s,Rn):Jr(s)?[s]:Fr(Wv(ft(s)))}function xT(s){var o=++NC;return ft(s)+o}var IT=wl(function(s,o){return s+o},0),DT=cd("ceil"),ST=wl(function(s,o){return s/o},1),OT=cd("floor");function CT(s){return s&&s.length?hl(s,Hr,Vf):t}function $T(s,o){return s&&s.length?hl(s,_e(o,2),Vf):t}function AT(s){return Pm(s,Hr)}function PT(s,o){return Pm(s,_e(o,2))}function TT(s){return s&&s.length?hl(s,Hr,Zf):t}function RT(s,o){return s&&s.length?hl(s,_e(o,2),Zf):t}var NT=wl(function(s,o){return s*o},1),LT=cd("round"),MT=wl(function(s,o){return s-o},0);function UT(s){return s&&s.length?Lf(s,Hr):0}function jT(s,o){return s&&s.length?Lf(s,_e(o,2)):0}return _.after=oP,_.ary=rw,_.assign=VP,_.assignIn=mw,_.assignInWith=Pl,_.assignWith=GP,_.at=YP,_.before=nw,_.bind=bd,_.bindAll=eT,_.bindKey=iw,_.castArray=wP,_.chain=Xv,_.chunk=O$,_.compact=C$,_.concat=$$,_.cond=tT,_.conforms=rT,_.constant=Od,_.countBy=UA,_.create=JP,_.curry=sw,_.curryRight=ow,_.debounce=aw,_.defaults=ZP,_.defaultsDeep=QP,_.defer=aP,_.delay=cP,_.difference=A$,_.differenceBy=P$,_.differenceWith=T$,_.drop=R$,_.dropRight=N$,_.dropRightWhile=L$,_.dropWhile=M$,_.fill=U$,_.filter=FA,_.flatMap=HA,_.flatMapDeep=zA,_.flatMapDepth=qA,_.flatten=Yv,_.flattenDeep=j$,_.flattenDepth=F$,_.flip=lP,_.flow=iT,_.flowRight=sT,_.fromPairs=B$,_.functions=s9,_.functionsIn=o9,_.groupBy=WA,_.initial=H$,_.intersection=z$,_.intersectionBy=q$,_.intersectionWith=W$,_.invert=c9,_.invertBy=l9,_.invokeMap=VA,_.iteratee=Cd,_.keyBy=GA,_.keys=cr,_.keysIn=kr,_.map=Dl,_.mapKeys=h9,_.mapValues=f9,_.matches=oT,_.matchesProperty=aT,_.memoize=Ol,_.merge=d9,_.mergeWith=vw,_.method=cT,_.methodOf=lT,_.mixin=$d,_.negate=Cl,_.nthArg=hT,_.omit=p9,_.omitBy=g9,_.once=uP,_.orderBy=YA,_.over=fT,_.overArgs=hP,_.overEvery=dT,_.overSome=pT,_.partial=_d,_.partialRight=cw,_.partition=JA,_.pick=m9,_.pickBy=ww,_.property=Dw,_.propertyOf=gT,_.pull=Y$,_.pullAll=Zv,_.pullAllBy=J$,_.pullAllWith=Z$,_.pullAt=Q$,_.range=mT,_.rangeRight=vT,_.rearg=fP,_.reject=XA,_.remove=X$,_.rest=dP,_.reverse=wd,_.sampleSize=tP,_.set=w9,_.setWith=y9,_.shuffle=rP,_.slice=eA,_.sortBy=sP,_.sortedUniq=aA,_.sortedUniqBy=cA,_.split=H9,_.spread=pP,_.tail=lA,_.take=uA,_.takeRight=hA,_.takeRightWhile=fA,_.takeWhile=dA,_.tap=CA,_.throttle=gP,_.thru=Il,_.toArray=dw,_.toPairs=yw,_.toPairsIn=bw,_.toPath=ET,_.toPlainObject=gw,_.transform=b9,_.unary=mP,_.union=pA,_.unionBy=gA,_.unionWith=mA,_.uniq=vA,_.uniqBy=wA,_.uniqWith=yA,_.unset=_9,_.unzip=yd,_.unzipWith=Qv,_.update=E9,_.updateWith=x9,_.values=uo,_.valuesIn=I9,_.without=bA,_.words=xw,_.wrap=vP,_.xor=_A,_.xorBy=EA,_.xorWith=xA,_.zip=IA,_.zipObject=DA,_.zipObjectDeep=SA,_.zipWith=OA,_.entries=yw,_.entriesIn=bw,_.extend=mw,_.extendWith=Pl,$d(_,_),_.add=IT,_.attempt=Iw,_.camelCase=C9,_.capitalize=_w,_.ceil=DT,_.clamp=D9,_.clone=yP,_.cloneDeep=_P,_.cloneDeepWith=EP,_.cloneWith=bP,_.conformsTo=xP,_.deburr=Ew,_.defaultTo=nT,_.divide=ST,_.endsWith=$9,_.eq=yn,_.escape=A9,_.escapeRegExp=P9,_.every=jA,_.find=BA,_.findIndex=Vv,_.findKey=XP,_.findLast=kA,_.findLastIndex=Gv,_.findLastKey=e9,_.floor=OT,_.forEach=ew,_.forEachRight=tw,_.forIn=t9,_.forInRight=r9,_.forOwn=n9,_.forOwnRight=i9,_.get=Id,_.gt=IP,_.gte=DP,_.has=a9,_.hasIn=Dd,_.head=Jv,_.identity=Hr,_.includes=KA,_.indexOf=k$,_.inRange=S9,_.invoke=u9,_.isArguments=ps,_.isArray=Le,_.isArrayBuffer=SP,_.isArrayLike=Br,_.isArrayLikeObject=Wt,_.isBoolean=OP,_.isBuffer=$i,_.isDate=CP,_.isElement=$P,_.isEmpty=AP,_.isEqual=PP,_.isEqualWith=TP,_.isError=Ed,_.isFinite=RP,_.isFunction=Xn,_.isInteger=lw,_.isLength=$l,_.isMap=uw,_.isMatch=NP,_.isMatchWith=LP,_.isNaN=MP,_.isNative=UP,_.isNil=FP,_.isNull=jP,_.isNumber=hw,_.isObject=Tt,_.isObjectLike=kt,_.isPlainObject=_a,_.isRegExp=xd,_.isSafeInteger=BP,_.isSet=fw,_.isString=Al,_.isSymbol=Jr,_.isTypedArray=lo,_.isUndefined=kP,_.isWeakMap=HP,_.isWeakSet=zP,_.join=K$,_.kebabCase=T9,_.last=ln,_.lastIndexOf=V$,_.lowerCase=R9,_.lowerFirst=N9,_.lt=qP,_.lte=WP,_.max=CT,_.maxBy=$T,_.mean=AT,_.meanBy=PT,_.min=TT,_.minBy=RT,_.stubArray=Pd,_.stubFalse=Td,_.stubObject=wT,_.stubString=yT,_.stubTrue=bT,_.multiply=NT,_.nth=G$,_.noConflict=uT,_.noop=Ad,_.now=Sl,_.pad=L9,_.padEnd=M9,_.padStart=U9,_.parseInt=j9,_.random=O9,_.reduce=ZA,_.reduceRight=QA,_.repeat=F9,_.replace=B9,_.result=v9,_.round=LT,_.runInContext=H,_.sample=eP,_.size=nP,_.snakeCase=k9,_.some=iP,_.sortedIndex=tA,_.sortedIndexBy=rA,_.sortedIndexOf=nA,_.sortedLastIndex=iA,_.sortedLastIndexBy=sA,_.sortedLastIndexOf=oA,_.startCase=z9,_.startsWith=q9,_.subtract=MT,_.sum=UT,_.sumBy=jT,_.template=W9,_.times=_T,_.toFinite=ei,_.toInteger=He,_.toLength=pw,_.toLower=K9,_.toNumber=un,_.toSafeInteger=KP,_.toString=ft,_.toUpper=V9,_.trim=G9,_.trimEnd=Y9,_.trimStart=J9,_.truncate=Z9,_.unescape=Q9,_.uniqueId=xT,_.upperCase=X9,_.upperFirst=Sd,_.each=ew,_.eachRight=tw,_.first=Jv,$d(_,function(){var s={};return Pn(_,function(o,l){dt.call(_.prototype,l)||(s[l]=o)}),s}(),{chain:!1}),_.VERSION=n,nn(["bind","bindKey","curry","curryRight","partial","partialRight"],function(s){_[s].placeholder=_}),nn(["drop","take"],function(s,o){tt.prototype[s]=function(l){l=l===t?1:nr(He(l),0);var p=this.__filtered__&&!o?new tt(this):this.clone();return p.__filtered__?p.__takeCount__=mr(l,p.__takeCount__):p.__views__.push({size:mr(l,ie),type:s+(p.__dir__<0?"Right":"")}),p},tt.prototype[s+"Right"]=function(l){return this.reverse()[s](l).reverse()}}),nn(["filter","map","takeWhile"],function(s,o){var l=o+1,p=l==D||l==X;tt.prototype[s]=function(v){var S=this.clone();return S.__iteratees__.push({iteratee:_e(v,3),type:l}),S.__filtered__=S.__filtered__||p,S}}),nn(["head","last"],function(s,o){var l="take"+(o?"Right":"");tt.prototype[s]=function(){return this[l](1).value()[0]}}),nn(["initial","tail"],function(s,o){var l="drop"+(o?"":"Right");tt.prototype[s]=function(){return this.__filtered__?new tt(this):this[l](1)}}),tt.prototype.compact=function(){return this.filter(Hr)},tt.prototype.find=function(s){return this.filter(s).head()},tt.prototype.findLast=function(s){return this.reverse().find(s)},tt.prototype.invokeMap=Ge(function(s,o){return typeof s=="function"?new tt(this):this.map(function(l){return ga(l,s,o)})}),tt.prototype.reject=function(s){return this.filter(Cl(_e(s)))},tt.prototype.slice=function(s,o){s=He(s);var l=this;return l.__filtered__&&(s>0||o<0)?new tt(l):(s<0?l=l.takeRight(-s):s&&(l=l.drop(s)),o!==t&&(o=He(o),l=o<0?l.dropRight(-o):l.take(o-s)),l)},tt.prototype.takeRightWhile=function(s){return this.reverse().takeWhile(s).reverse()},tt.prototype.toArray=function(){return this.take(ie)},Pn(tt.prototype,function(s,o){var l=/^(?:filter|find|map|reject)|While$/.test(o),p=/^(?:head|last)$/.test(o),v=_[p?"take"+(o=="last"?"Right":""):o],S=p||/^find/.test(o);v&&(_.prototype[o]=function(){var R=this.__wrapped__,M=p?[1]:arguments,z=R instanceof tt,te=M[0],re=z||Le(R),oe=function(Qe){var st=v.apply(_,Ei([Qe],M));return p&&fe?st[0]:st};re&&l&&typeof te=="function"&&te.length!=1&&(z=re=!1);var fe=this.__chain__,ve=!!this.__actions__.length,Ie=S&&!fe,We=z&&!ve;if(!S&&re){R=We?R:new tt(this);var De=s.apply(R,M);return De.__actions__.push({func:Il,args:[oe],thisArg:t}),new on(De,fe)}return Ie&&We?s.apply(this,M):(De=this.thru(oe),Ie?p?De.value()[0]:De.value():De)})}),nn(["pop","push","shift","sort","splice","unshift"],function(s){var o=Jc[s],l=/^(?:push|sort|unshift)$/.test(s)?"tap":"thru",p=/^(?:pop|shift)$/.test(s);_.prototype[s]=function(){var v=arguments;if(p&&!this.__chain__){var S=this.value();return o.apply(Le(S)?S:[],v)}return this[l](function(R){return o.apply(Le(R)?R:[],v)})}}),Pn(tt.prototype,function(s,o){var l=_[o];if(l){var p=l.name+"";dt.call(io,p)||(io[p]=[]),io[p].push({name:o,func:l})}}),io[vl(t,F).name]=[{name:"wrapper",func:t}],tt.prototype.clone=QC,tt.prototype.reverse=XC,tt.prototype.value=e7,_.prototype.at=$A,_.prototype.chain=AA,_.prototype.commit=PA,_.prototype.next=TA,_.prototype.plant=NA,_.prototype.reverse=LA,_.prototype.toJSON=_.prototype.valueOf=_.prototype.value=MA,_.prototype.first=_.prototype.head,ca&&(_.prototype[ca]=RA),_},to=PC();qt?((qt.exports=to)._=to,wt._=to):it._=to}).call(Mo)})(Vu,Vu.exports);var Z8=Object.defineProperty,Q8=Object.defineProperties,X8=Object.getOwnPropertyDescriptors,W1=Object.getOwnPropertySymbols,ex=Object.prototype.hasOwnProperty,tx=Object.prototype.propertyIsEnumerable,K1=(r,e,t)=>e in r?Z8(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,Ja=(r,e)=>{for(var t in e||(e={}))ex.call(e,t)&&K1(r,t,e[t]);if(W1)for(var t of W1(e))tx.call(e,t)&&K1(r,t,e[t]);return r},rx=(r,e)=>Q8(r,X8(e));function oi(r,e,t){var n;const i=Y2(r);return((n=e.rpcMap)==null?void 0:n[i.reference])||`${J8}?chainId=${i.namespace}:${i.reference}&projectId=${t}`}function ki(r){return r.includes(":")?r.split(":")[1]:r}function V1(r){return r.map(e=>`${e.split(":")[0]}:${e.split(":")[1]}`)}function nx(r,e){const t=Object.keys(e.namespaces).filter(i=>i.includes(r));if(!t.length)return[];const n=[];return t.forEach(i=>{const a=e.namespaces[i].accounts;n.push(...a)}),n}function ix(r={},e={}){const t=G1(r),n=G1(e);return Vu.exports.merge(t,n)}function G1(r){var e,t,n,i;const a={};if(!Is(r))return a;for(const[c,u]of Object.entries(r)){const d=uu(c)?[c]:u.chains,h=u.methods||[],m=u.events||[],y=u.rpcMap||{},w=_o(c);a[w]=rx(Ja(Ja({},a[w]),u),{chains:cu(d,(e=a[w])==null?void 0:e.chains),methods:cu(h,(t=a[w])==null?void 0:t.methods),events:cu(m,(n=a[w])==null?void 0:n.events),rpcMap:Ja(Ja({},y),(i=a[w])==null?void 0:i.rpcMap)})}return a}function sx(r){return r.includes(":")?r.split(":")[2]:r}function ox(r){const e={};for(const[t,n]of Object.entries(r)){const i=n.methods||[],a=n.events||[],c=n.accounts||[],u=uu(t)?[t]:n.chains?n.chains:V1(n.accounts);e[t]={chains:u,methods:i,events:a,accounts:c}}return e}function Gu(r){return typeof r=="number"?r:r.includes("0x")?parseInt(r,16):r.includes(":")?Number(r.split(":")[1]):Number(r)}const Y1={},It=r=>Y1[r],Yu=(r,e)=>{Y1[r]=e};class ax{constructor(e){this.name="polkadot",this.namespace=e.namespace,this.events=It("events"),this.client=It("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;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.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(Bn.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getAccounts(){const e=this.namespace.accounts;return e?e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2])||[]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{var n;const i=ki(t);e[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[t])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const n=this.createHttpProvider(e,t);n&&(this.httpProviders[e]=n)}createHttpProvider(e,t){const n=t||oi(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new Un(new si(n,It("disableProviderPing")))}}class cx{constructor(e){this.name="eip155",this.namespace=e.namespace,this.events=It("events"),this.client=It("client"),this.httpProviders=this.createHttpProviders(),this.chainId=parseInt(this.getDefaultChain())}async request(e){switch(e.request.method){case"eth_requestAccounts":return this.getAccounts();case"eth_accounts":return this.getAccounts();case"wallet_switchEthereumChain":return await this.handleSwitchChain(e);case"eth_chainId":return parseInt(this.getDefaultChain())}return this.namespace.methods.includes(e.request.method)?await this.client.request(e):this.getHttpProvider().request(e.request)}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(parseInt(e),t),this.chainId=parseInt(e),this.events.emit(Bn.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId.toString();if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}createHttpProvider(e,t){const n=t||oi(`${this.name}:${e}`,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new Un(new si(n,It("disableProviderPing")))}setHttpProvider(e,t){const n=this.createHttpProvider(e,t);n&&(this.httpProviders[e]=n)}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{var n;const i=parseInt(ki(t));e[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[t])}),e}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2]))]:[]}getHttpProvider(){const e=this.chainId,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}async handleSwitchChain(e){var t,n;let i=e.request.params?(t=e.request.params[0])==null?void 0:t.chainId:"0x0";i=i.startsWith("0x")?i:`0x${i}`;const a=parseInt(i,16);if(this.isChainApproved(a))this.setDefaultChain(`${a}`);else if(this.namespace.methods.includes("wallet_switchEthereumChain"))await this.client.request({topic:e.topic,request:{method:e.request.method,params:[{chainId:i}]},chainId:(n=this.namespace.chains)==null?void 0:n[0]}),this.setDefaultChain(`${a}`);else throw new Error(`Failed to switch to chain 'eip155:${a}'. The chain is not approved or the wallet does not support 'wallet_switchEthereumChain' method.`);return null}isChainApproved(e){return this.namespace.chains.includes(`${this.name}:${e}`)}}class lx{constructor(e){this.name="solana",this.namespace=e.namespace,this.events=It("events"),this.client=It("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(Bn.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{var n;const i=ki(t);e[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[t])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const n=this.createHttpProvider(e,t);n&&(this.httpProviders[e]=n)}createHttpProvider(e,t){const n=t||oi(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new Un(new si(n,It("disableProviderPing")))}}class ux{constructor(e){this.name="cosmos",this.namespace=e.namespace,this.events=It("events"),this.client=It("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;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.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(Bn.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{var n;const i=ki(t);e[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[t])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const n=this.createHttpProvider(e,t);n&&(this.httpProviders[e]=n)}createHttpProvider(e,t){const n=t||oi(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new Un(new si(n,It("disableProviderPing")))}}class hx{constructor(e){this.name="cip34",this.namespace=e.namespace,this.events=It("events"),this.client=It("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;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.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(Bn.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{const n=this.getCardanoRPCUrl(t),i=ki(t);e[i]=this.createHttpProvider(i,n)}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}getCardanoRPCUrl(e){const t=this.namespace.rpcMap;if(t)return t[e]}setHttpProvider(e,t){const n=this.createHttpProvider(e,t);n&&(this.httpProviders[e]=n)}createHttpProvider(e,t){const n=t||this.getCardanoRPCUrl(e);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new Un(new si(n,It("disableProviderPing")))}}class fx{constructor(e){this.name="elrond",this.namespace=e.namespace,this.events=It("events"),this.client=It("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(Bn.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{var n;const i=ki(t);e[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[t])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const n=this.createHttpProvider(e,t);n&&(this.httpProviders[e]=n)}createHttpProvider(e,t){const n=t||oi(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new Un(new si(n,It("disableProviderPing")))}}class dx{constructor(e){this.name="multiversx",this.namespace=e.namespace,this.events=It("events"),this.client=It("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(Bn.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{var n;const i=ki(t);e[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[t])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const n=this.createHttpProvider(e,t);n&&(this.httpProviders[e]=n)}createHttpProvider(e,t){const n=t||oi(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new Un(new si(n,It("disableProviderPing")))}}class px{constructor(e){this.name="near",this.namespace=e.namespace,this.events=It("events"),this.client=It("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;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.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){if(this.chainId=e,!this.httpProviders[e]){const n=t||oi(`${this.name}:${e}`,this.namespace);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,n)}this.events.emit(Bn.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e?e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2])||[]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{var n;e[t]=this.createHttpProvider(t,(n=this.namespace.rpcMap)==null?void 0:n[t])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const n=this.createHttpProvider(e,t);n&&(this.httpProviders[e]=n)}createHttpProvider(e,t){const n=t||oi(e,this.namespace);return typeof n>"u"?void 0:new Un(new si(n,It("disableProviderPing")))}}var gx=Object.defineProperty,mx=Object.defineProperties,vx=Object.getOwnPropertyDescriptors,J1=Object.getOwnPropertySymbols,wx=Object.prototype.hasOwnProperty,yx=Object.prototype.propertyIsEnumerable,Z1=(r,e,t)=>e in r?gx(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,Za=(r,e)=>{for(var t in e||(e={}))wx.call(e,t)&&Z1(r,t,e[t]);if(J1)for(var t of J1(e))yx.call(e,t)&&Z1(r,t,e[t]);return r},Ju=(r,e)=>mx(r,vx(e));class Zu{constructor(e){this.events=new lr.exports,this.rpcProviders={},this.shouldAbortPairingAttempt=!1,this.maxPairingAttempts=10,this.disableProviderPing=!1,this.providerOpts=e,this.logger=typeof e?.logger<"u"&&typeof e?.logger!="string"?e.logger:Xe.pino(Xe.getDefaultLoggerOptions({level:e?.logger||z1})),this.disableProviderPing=e?.disableProviderPing||!1}static async init(e){const t=new Zu(e);return await t.initialize(),t}async request(e,t){const[n,i]=this.validateChain(t);if(!this.session)throw new Error("Please call connect() before request()");return await this.getProvider(n).request({request:Za({},e),chainId:`${n}:${i}`,topic:this.session.topic})}sendAsync(e,t,n){const i=new Date().getTime();this.request(e,n).then(a=>t(null,qa(i,a))).catch(a=>t(a,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:Rt("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(),!e.skipPairing)return await this.pair(e.pairingTopic)}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}removeListener(e,t){this.events.removeListener(e,t)}off(e,t){this.events.off(e,t)}get isWalletConnect(){return!0}async pair(e){this.shouldAbortPairingAttempt=!1;let t=0;do{if(this.shouldAbortPairingAttempt)throw new Error("Pairing aborted");if(t>=this.maxPairingAttempts)throw new Error("Max auto pairing attempts reached");const{uri:n,approval:i}=await this.client.connect({pairingTopic:e,requiredNamespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties});n&&(this.uri=n,this.events.emit("display_uri",n)),await i().then(a=>{this.session=a,this.namespaces||(this.namespaces=ox(a.namespaces),this.persist("namespaces",this.namespaces))}).catch(a=>{if(a.message!==U1)throw a;t++})}while(!this.session);return this.onConnect(),this.session}setDefaultChain(e,t){try{if(!this.session)return;const[n,i]=this.validateChain(e);this.getProvider(n).setDefaultChain(i,t)}catch(n){if(!/Please call connect/.test(n.message))throw n}}async cleanupPendingPairings(e={}){this.logger.info("Cleaning up inactive pairings...");const t=this.client.pairing.getAll();if(En(t)){for(const n of t)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: ${t.length}`)}}abortPairingAttempt(){this.shouldAbortPairingAttempt=!0}async checkStorage(){if(this.namespaces=await this.getFromStore("namespaces"),this.optionalNamespaces=await this.getFromStore("optionalNamespaces")||{},this.client.session.length){const e=this.client.session.keys.length-1;this.session=this.client.session.get(this.client.session.keys[e]),this.createProviders()}}async initialize(){this.logger.trace("Initialized"),await this.createClient(),await this.checkStorage(),this.registerEventListeners()}async createClient(){this.client=this.providerOpts.client||await Wu.init({logger:this.providerOpts.logger||z1,relayUrl:this.providerOpts.relayUrl||V8,projectId:this.providerOpts.projectId,metadata:this.providerOpts.metadata,storageOptions:this.providerOpts.storageOptions,storage:this.providerOpts.storage,name:this.providerOpts.name}),this.logger.trace("SignClient Initialized")}createProviders(){if(!this.client)throw new Error("Sign Client not initialized");if(!this.session)throw new Error("Session not initialized. Please call connect() before enable()");const e=[...new Set(Object.keys(this.session.namespaces).map(t=>_o(t)))];Yu("client",this.client),Yu("events",this.events),Yu("disableProviderPing",this.disableProviderPing),e.forEach(t=>{if(!this.session)return;const n=nx(t,this.session),i=V1(n),a=ix(this.namespaces,this.optionalNamespaces),c=Ju(Za({},a[t]),{accounts:n,chains:i});switch(t){case"eip155":this.rpcProviders[t]=new cx({namespace:c});break;case"solana":this.rpcProviders[t]=new lx({namespace:c});break;case"cosmos":this.rpcProviders[t]=new ux({namespace:c});break;case"polkadot":this.rpcProviders[t]=new ax({namespace:c});break;case"cip34":this.rpcProviders[t]=new hx({namespace:c});break;case"elrond":this.rpcProviders[t]=new fx({namespace:c});break;case"multiversx":this.rpcProviders[t]=new dx({namespace:c});break;case"near":this.rpcProviders[t]=new px({namespace:c});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:t}=e,{event:n}=t;if(n.name==="accountsChanged"){const i=n.data;i&&En(i)&&this.events.emit("accountsChanged",i.map(sx))}else if(n.name==="chainChanged"){const i=t.chainId,a=t.event.data,c=_o(i),u=Gu(i)!==Gu(a)?`${c}:${Gu(a)}`:i;this.onChainChanged(u)}else this.events.emit(n.name,n.data);this.events.emit("session_event",e)}),this.client.on("session_update",({topic:e,params:t})=>{var n;const{namespaces:i}=t,a=(n=this.client)==null?void 0:n.session.get(e);this.session=Ju(Za({},a),{namespaces:i}),this.onSessionUpdate(),this.events.emit("session_update",{topic:e,params:t})}),this.client.on("session_delete",async e=>{await this.cleanup(),this.events.emit("session_delete",e),this.events.emit("disconnect",Ju(Za({},Rt("USER_DISCONNECTED")),{data:e.topic}))}),this.on(Bn.DEFAULT_CHAIN_CHANGED,e=>{this.onChainChanged(e,!0)})}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 t;this.getProvider(e).updateNamespace((t=this.session)==null?void 0:t.namespaces[e])})}setNamespaces(e){const{namespaces:t,optionalNamespaces:n,sessionProperties:i}=e;t&&Object.keys(t).length&&(this.namespaces=t),n&&Object.keys(n).length&&(this.optionalNamespaces=n),this.sessionProperties=i,this.persist("namespaces",t),this.persist("optionalNamespaces",n)}validateChain(e){const[t,n]=e?.split(":")||["",""];if(!this.namespaces||!Object.keys(this.namespaces).length)return[t,n];if(t&&!Object.keys(this.namespaces||{}).map(c=>_o(c)).includes(t))throw new Error(`Namespace '${t}' is not configured. Please call connect() first with namespace config.`);if(t&&n)return[t,n];const i=_o(Object.keys(this.namespaces)[0]),a=this.rpcProviders[i].getDefaultChain();return[i,a]}async requestAccounts(){const[e]=this.validateChain();return await this.getProvider(e).requestAccounts()}onChainChanged(e,t=!1){var n;if(!this.namespaces)return;const[i,a]=this.validateChain(e);t||this.getProvider(i).setDefaultChain(a),((n=this.namespaces[i])!=null?n:this.namespaces[`${i}:${a}`]).defaultChain=a,this.persist("namespaces",this.namespaces),this.events.emit("chainChanged",a)}onConnect(){this.createProviders(),this.events.emit("connect",{session:this.session})}async cleanup(){this.session=void 0,this.namespaces=void 0,this.optionalNamespaces=void 0,this.sessionProperties=void 0,this.persist("namespaces",void 0),this.persist("optionalNamespaces",void 0),this.persist("sessionProperties",void 0),await this.cleanupPendingPairings({deletePairings:!0})}persist(e,t){this.client.core.storage.setItem(`${q1}/${e}`,t)}async getFromStore(e){return await this.client.core.storage.getItem(`${q1}/${e}`)}}const bx=Zu,_x="wc",Ex="ethereum_provider",xx=`${_x}@2:${Ex}:`,Ix="https://rpc.walletconnect.com/v1/",Qa=["eth_sendTransaction","personal_sign"],Q1=["eth_accounts","eth_requestAccounts","eth_sendRawTransaction","eth_sign","eth_signTransaction","eth_signTypedData","eth_signTypedData_v3","eth_signTypedData_v4","eth_sendTransaction","personal_sign","wallet_switchEthereumChain","wallet_addEthereumChain","wallet_getPermissions","wallet_requestPermissions","wallet_registerOnboarding","wallet_watchAsset","wallet_scanQRCode"],Xa=["chainChanged","accountsChanged"],X1=["chainChanged","accountsChanged","message","disconnect","connect"];var Dx=Object.defineProperty,Sx=Object.defineProperties,Ox=Object.getOwnPropertyDescriptors,eg=Object.getOwnPropertySymbols,Cx=Object.prototype.hasOwnProperty,$x=Object.prototype.propertyIsEnumerable,tg=(r,e,t)=>e in r?Dx(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,Uo=(r,e)=>{for(var t in e||(e={}))Cx.call(e,t)&&tg(r,t,e[t]);if(eg)for(var t of eg(e))$x.call(e,t)&&tg(r,t,e[t]);return r},rg=(r,e)=>Sx(r,Ox(e));function ec(r){return Number(r[0].split(":")[1])}function Qu(r){return`0x${r.toString(16)}`}function Ax(r){const{chains:e,optionalChains:t,methods:n,optionalMethods:i,events:a,optionalEvents:c,rpcMap:u}=r;if(!En(e))throw new Error("Invalid chains");const d={chains:e,methods:n||Qa,events:a||Xa,rpcMap:Uo({},e.length?{[ec(e)]:u[ec(e)]}:{})},h=a?.filter(E=>!Xa.includes(E)),m=n?.filter(E=>!Qa.includes(E));if(!t&&!c&&!i&&!(h!=null&&h.length)&&!(m!=null&&m.length))return{required:e.length?d:void 0};const y=h?.length&&m?.length||!t,w={chains:[...new Set(y?d.chains.concat(t||[]):t)],methods:[...new Set(d.methods.concat(i!=null&&i.length?i:Q1))],events:[...new Set(d.events.concat(c!=null&&c.length?c:X1))],rpcMap:u};return{required:e.length?d:void 0,optional:t.length?w:void 0}}class tc{constructor(){this.events=new lr.exports.EventEmitter,this.namespace="eip155",this.accounts=[],this.chainId=1,this.STORAGE_KEY=xx,this.on=(e,t)=>(this.events.on(e,t),this),this.once=(e,t)=>(this.events.once(e,t),this),this.removeListener=(e,t)=>(this.events.removeListener(e,t),this),this.off=(e,t)=>(this.events.off(e,t),this),this.parseAccount=e=>this.isCompatibleChainId(e)?this.parseAccountId(e).address:e,this.signer={},this.rpc={}}static async init(e){const t=new tc;return await t.initialize(e),t}async request(e){return await this.signer.request(e,this.formatChainId(this.chainId))}sendAsync(e,t){this.signer.sendAsync(e,t,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:t,optional:n}=Ax(this.rpc);try{const i=await new Promise(async(c,u)=>{var d;this.rpc.showQrModal&&((d=this.modal)==null||d.subscribeModal(h=>{!h.open&&!this.signer.session&&(this.signer.abortPairingAttempt(),u(new Error("Connection request reset. Please try again.")))})),await this.signer.connect(rg(Uo({namespaces:Uo({},t&&{[this.namespace]:t})},n&&{optionalNamespaces:{[this.namespace]:n}}),{pairingTopic:e?.pairingTopic})).then(h=>{c(h)}).catch(h=>{u(new Error(h.message))})});if(!i)return;const a=J2(i.namespaces,[this.namespace]);this.setChainIds(this.rpc.chains.length?this.rpc.chains:a),this.setAccounts(a),this.events.emit("connect",{chainId:Qu(this.chainId)})}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()}get isWalletConnect(){return!0}get session(){return this.signer.session}registerEventListeners(){this.signer.on("session_event",e=>{const{params:t}=e,{event:n}=t;n.name==="accountsChanged"?(this.accounts=this.parseAccounts(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=>{const t=parseInt(e);this.chainId=t,this.events.emit("chainChanged",Qu(this.chainId)),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.events.emit("disconnect",rg(Uo({},Rt("USER_DISCONNECTED")),{data:e.topic,name:"USER_DISCONNECTED"}))}),this.signer.on("display_uri",e=>{var t,n;this.rpc.showQrModal&&((t=this.modal)==null||t.closeModal(),(n=this.modal)==null||n.openModal({uri:e})),this.events.emit("display_uri",e)})}switchEthereumChain(e){this.request({method:"wallet_switchEthereumChain",params:[{chainId:e.toString(16)}]})}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 t=e.filter(n=>this.isCompatibleChainId(n)).map(n=>this.parseChainId(n));t.length&&(this.chainId=t[0],this.events.emit("chainChanged",Qu(this.chainId)),this.persist())}setChainId(e){if(this.isCompatibleChainId(e)){const t=this.parseChainId(e);this.chainId=t,this.switchEthereumChain(t)}}parseAccountId(e){const[t,n,i]=e.split(":");return{chainId:`${t}:${n}`,address:i}}setAccounts(e){this.accounts=e.filter(t=>this.parseChainId(this.parseAccountId(t).chainId)===this.chainId).map(t=>this.parseAccountId(t).address),this.events.emit("accountsChanged",this.accounts)}getRpcConfig(e){var t,n;const i=(t=e?.chains)!=null?t:[],a=(n=e?.optionalChains)!=null?n:[],c=i.concat(a);if(!c.length)throw new Error("No chains specified in either `chains` or `optionalChains`");const u=i.length?e?.methods||Qa:[],d=i.length?e?.events||Xa:[],h=e?.optionalMethods||[],m=e?.optionalEvents||[],y=e?.rpcMap||this.buildRpcMap(c,e.projectId),w=e?.qrModalOptions||void 0;return{chains:i?.map(E=>this.formatChainId(E)),optionalChains:a.map(E=>this.formatChainId(E)),methods:u,events:d,optionalMethods:h,optionalEvents:m,rpcMap:y,showQrModal:!!(e!=null&&e.showQrModal),qrModalOptions:w,projectId:e.projectId,metadata:e.metadata}}buildRpcMap(e,t){const n={};return e.forEach(i=>{n[i]=this.getRpcUrl(i,t)}),n}async initialize(e){if(this.rpc=this.getRpcConfig(e),this.chainId=this.rpc.chains.length?ec(this.rpc.chains):ec(this.rpc.optionalChains),this.signer=await bx.init({projectId:this.rpc.projectId,metadata:this.rpc.metadata,disableProviderPing:e.disableProviderPing,relayUrl:e.relayUrl,storageOptions:e.storageOptions}),this.registerEventListeners(),await this.loadPersistedSession(),this.rpc.showQrModal){let t;try{const{WalletConnectModal:n}=await Promise.resolve().then(function(){return Xx});t=n}catch{throw new Error("To use QR modal, please install @walletconnect/modal package")}if(t)try{this.modal=new t(Uo({projectId:this.rpc.projectId},this.rpc.qrModalOptions))}catch(n){throw this.signer.logger.error(n),new Error("Could not generate WalletConnectModal Instance")}}}loadConnectOpts(e){if(!e)return;const{chains:t,optionalChains:n,rpcMap:i}=e;t&&En(t)&&(this.rpc.chains=t.map(a=>this.formatChainId(a)),t.forEach(a=>{this.rpc.rpcMap[a]=i?.[a]||this.getRpcUrl(a)})),n&&En(n)&&(this.rpc.optionalChains=[],this.rpc.optionalChains=n?.map(a=>this.formatChainId(a)),n.forEach(a=>{this.rpc.rpcMap[a]=i?.[a]||this.getRpcUrl(a)}))}getRpcUrl(e,t){var n;return((n=this.rpc.rpcMap)==null?void 0:n[e])||`${Ix}?chainId=eip155:${e}&projectId=${t||this.rpc.projectId}`}async loadPersistedSession(){if(!this.session)return;const e=await this.signer.client.core.storage.getItem(`${this.STORAGE_KEY}/chainId`),t=this.session.namespaces[`${this.namespace}:${e}`]?this.session.namespaces[`${this.namespace}:${e}`]:this.session.namespaces[this.namespace];this.setChainIds(e?[this.formatChainId(e)]:t?.accounts),this.setAccounts(t?.accounts)}reset(){this.chainId=1,this.accounts=[]}persist(){this.session&&this.signer.client.core.storage.setItem(`${this.STORAGE_KEY}/chainId`,this.chainId)}parseAccounts(e){return typeof e=="string"||e instanceof String?[this.parseAccount(e)]:e.map(t=>this.parseAccount(t))}}const Px=tc,Tx=Symbol(),ng=Object.getPrototypeOf,Xu=new WeakMap,Rx=r=>r&&(Xu.has(r)?Xu.get(r):ng(r)===Object.prototype||ng(r)===Array.prototype),Nx=r=>Rx(r)&&r[Tx]||null,ig=(r,e=!0)=>{Xu.set(r,e)},eh=r=>typeof r=="object"&&r!==null,ai=new WeakMap,rc=new WeakSet,Lx=(r=Object.is,e=(h,m)=>new Proxy(h,m),t=h=>eh(h)&&!rc.has(h)&&(Array.isArray(h)||!(Symbol.iterator in h))&&!(h instanceof WeakMap)&&!(h instanceof WeakSet)&&!(h instanceof Error)&&!(h instanceof Number)&&!(h instanceof Date)&&!(h instanceof String)&&!(h instanceof RegExp)&&!(h instanceof ArrayBuffer),n=h=>{switch(h.status){case"fulfilled":return h.value;case"rejected":throw h.reason;default:throw h}},i=new WeakMap,a=(h,m,y=n)=>{const w=i.get(h);if(w?.[0]===m)return w[1];const E=Array.isArray(h)?[]:Object.create(Object.getPrototypeOf(h));return ig(E,!0),i.set(h,[m,E]),Reflect.ownKeys(h).forEach(I=>{if(Object.getOwnPropertyDescriptor(E,I))return;const T=Reflect.get(h,I),U={value:T,enumerable:!0,configurable:!0};if(rc.has(T))ig(T,!1);else if(T instanceof Promise)delete U.value,U.get=()=>y(T);else if(ai.has(T)){const[F,$]=ai.get(T);U.value=a(F,$(),y)}Object.defineProperty(E,I,U)}),Object.preventExtensions(E)},c=new WeakMap,u=[1,1],d=h=>{if(!eh(h))throw new Error("object required");const m=c.get(h);if(m)return m;let y=u[0];const w=new Set,E=(q,j=++u[0])=>{y!==j&&(y=j,w.forEach(V=>V(q,j)))};let I=u[1];const T=(q=++u[1])=>(I!==q&&!w.size&&(I=q,F.forEach(([j])=>{const V=j[1](q);V>y&&(y=V)})),y),U=q=>(j,V)=>{const se=[...j];se[1]=[q,...se[1]],E(se,V)},F=new Map,$=(q,j)=>{if(F.has(q))throw new Error("prop listener already exists");if(w.size){const V=j[3](U(q));F.set(q,[j,V])}else F.set(q,[j])},P=q=>{var j;const V=F.get(q);V&&(F.delete(q),(j=V[1])==null||j.call(V))},O=q=>(w.add(q),w.size===1&&F.forEach(([V,se],ce)=>{if(se)throw new Error("remove already exists");const D=V[3](U(ce));F.set(ce,[V,D])}),()=>{w.delete(q),w.size===0&&F.forEach(([V,se],ce)=>{se&&(se(),F.set(ce,[V]))})}),A=Array.isArray(h)?[]:Object.create(Object.getPrototypeOf(h)),f=e(A,{deleteProperty(q,j){const V=Reflect.get(q,j);P(j);const se=Reflect.deleteProperty(q,j);return se&&E(["delete",[j],V]),se},set(q,j,V,se){const ce=Reflect.has(q,j),D=Reflect.get(q,j,se);if(ce&&(r(D,V)||c.has(V)&&r(D,c.get(V))))return!0;P(j),eh(V)&&(V=Nx(V)||V);let N=V;if(V instanceof Promise)V.then(X=>{V.status="fulfilled",V.value=X,E(["resolve",[j],X])}).catch(X=>{V.status="rejected",V.reason=X,E(["reject",[j],X])});else{!ai.has(V)&&t(V)&&(N=d(V));const X=!rc.has(N)&&ai.get(N);X&&$(j,X)}return Reflect.set(q,j,N,se),E(["set",[j],V,D]),!0}});c.set(h,f);const b=[A,T,a,O];return ai.set(f,b),Reflect.ownKeys(h).forEach(q=>{const j=Object.getOwnPropertyDescriptor(h,q);"value"in j&&(f[q]=h[q],delete j.value,delete j.writable),Object.defineProperty(A,q,j)}),f})=>[d,ai,rc,r,e,t,n,i,a,c,u],[Mx]=Lx();function ci(r={}){return Mx(r)}function Hi(r,e,t){const n=ai.get(r);n||console.warn("Please use proxy object");let i;const a=[],c=n[3];let u=!1;const h=c(m=>{if(a.push(m),t){e(a.splice(0));return}i||(i=Promise.resolve().then(()=>{i=void 0,u&&e(a.splice(0))}))});return u=!0,()=>{u=!1,h()}}function Ux(r,e){const t=ai.get(r);t||console.warn("Please use proxy object");const[n,i,a]=t;return a(n,i(),e)}const or=ci({history:["ConnectWallet"],view:"ConnectWallet",data:void 0}),At={state:or,subscribe(r){return Hi(or,()=>r(or))},push(r,e){r!==or.view&&(or.view=r,e&&(or.data=e),or.history.push(r))},reset(r){or.view=r,or.history=[r]},replace(r){or.history.length>1&&(or.history[or.history.length-1]=r,or.view=r)},goBack(){if(or.history.length>1){or.history.pop();const[r]=or.history.slice(-1);or.view=r}},setData(r){or.data=r}},ye={WALLETCONNECT_DEEPLINK_CHOICE:"WALLETCONNECT_DEEPLINK_CHOICE",WCM_VERSION:"WCM_VERSION",RECOMMENDED_WALLET_AMOUNT:9,isMobile(){return typeof window<"u"?!!(window.matchMedia("(pointer:coarse)").matches||/Android|webOS|iPhone|iPad|iPod|BlackBerry|Opera Mini/u.test(navigator.userAgent)):!1},isAndroid(){return ye.isMobile()&&navigator.userAgent.toLowerCase().includes("android")},isIos(){const r=navigator.userAgent.toLowerCase();return ye.isMobile()&&(r.includes("iphone")||r.includes("ipad"))},isHttpUrl(r){return r.startsWith("http://")||r.startsWith("https://")},isArray(r){return Array.isArray(r)&&r.length>0},formatNativeUrl(r,e,t){if(ye.isHttpUrl(r))return this.formatUniversalUrl(r,e,t);let n=r;n.includes("://")||(n=r.replaceAll("/","").replaceAll(":",""),n=`${n}://`),n.endsWith("/")||(n=`${n}/`),this.setWalletConnectDeepLink(n,t);const i=encodeURIComponent(e);return`${n}wc?uri=${i}`},formatUniversalUrl(r,e,t){if(!ye.isHttpUrl(r))return this.formatNativeUrl(r,e,t);let n=r;n.endsWith("/")||(n=`${n}/`),this.setWalletConnectDeepLink(n,t);const i=encodeURIComponent(e);return`${n}wc?uri=${i}`},async wait(r){return new Promise(e=>{setTimeout(e,r)})},openHref(r,e){window.open(r,e,"noreferrer noopener")},setWalletConnectDeepLink(r,e){try{localStorage.setItem(ye.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:r,name:e}))}catch{console.info("Unable to set WalletConnect deep link")}},setWalletConnectAndroidDeepLink(r){try{const[e]=r.split("?");localStorage.setItem(ye.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:e,name:"Android"}))}catch{console.info("Unable to set WalletConnect android deep link")}},removeWalletConnectDeepLink(){try{localStorage.removeItem(ye.WALLETCONNECT_DEEPLINK_CHOICE)}catch{console.info("Unable to remove WalletConnect deep link")}},setModalVersionInStorage(){try{typeof localStorage<"u"&&localStorage.setItem(ye.WCM_VERSION,"2.6.2")}catch{console.info("Unable to set Web3Modal version in storage")}},getWalletRouterData(){var r;const e=(r=At.state.data)==null?void 0:r.Wallet;if(!e)throw new Error('Missing "Wallet" view data');return e}},jx=typeof location<"u"&&(location.hostname.includes("localhost")||location.protocol.includes("https")),gr=ci({enabled:jx,userSessionId:"",events:[],connectedWalletId:void 0}),sg={state:gr,subscribe(r){return Hi(gr.events,()=>r(Ux(gr.events[gr.events.length-1])))},initialize(){gr.enabled&&typeof(crypto==null?void 0:crypto.randomUUID)<"u"&&(gr.userSessionId=crypto.randomUUID())},setConnectedWalletId(r){gr.connectedWalletId=r},click(r){if(gr.enabled){const e={type:"CLICK",name:r.name,userSessionId:gr.userSessionId,timestamp:Date.now(),data:r};gr.events.push(e)}},track(r){if(gr.enabled){const e={type:"TRACK",name:r.name,userSessionId:gr.userSessionId,timestamp:Date.now(),data:r};gr.events.push(e)}},view(r){if(gr.enabled){const e={type:"VIEW",name:r.name,userSessionId:gr.userSessionId,timestamp:Date.now(),data:r};gr.events.push(e)}}},In=ci({chains:void 0,walletConnectUri:void 0,isAuth:!1,isCustomDesktop:!1,isCustomMobile:!1,isDataLoaded:!1,isUiLoaded:!1}),Ht={state:In,subscribe(r){return Hi(In,()=>r(In))},setChains(r){In.chains=r},setWalletConnectUri(r){In.walletConnectUri=r},setIsCustomDesktop(r){In.isCustomDesktop=r},setIsCustomMobile(r){In.isCustomMobile=r},setIsDataLoaded(r){In.isDataLoaded=r},setIsUiLoaded(r){In.isUiLoaded=r},setIsAuth(r){In.isAuth=r}},nc=ci({projectId:"",mobileWallets:void 0,desktopWallets:void 0,walletImages:void 0,chains:void 0,enableAuthMode:!1,enableExplorer:!0,explorerExcludedWalletIds:void 0,explorerRecommendedWalletIds:void 0,termsOfServiceUrl:void 0,privacyPolicyUrl:void 0}),Wr={state:nc,subscribe(r){return Hi(nc,()=>r(nc))},setConfig(r){var e,t;sg.initialize(),Ht.setChains(r.chains),Ht.setIsAuth(!!r.enableAuthMode),Ht.setIsCustomMobile(!!((e=r.mobileWallets)!=null&&e.length)),Ht.setIsCustomDesktop(!!((t=r.desktopWallets)!=null&&t.length)),ye.setModalVersionInStorage(),Object.assign(nc,r)}};var Fx=Object.defineProperty,og=Object.getOwnPropertySymbols,Bx=Object.prototype.hasOwnProperty,kx=Object.prototype.propertyIsEnumerable,ag=(r,e,t)=>e in r?Fx(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,Hx=(r,e)=>{for(var t in e||(e={}))Bx.call(e,t)&&ag(r,t,e[t]);if(og)for(var t of og(e))kx.call(e,t)&&ag(r,t,e[t]);return r};const th="https://explorer-api.walletconnect.com",rh="wcm",nh="js-2.6.2";async function ic(r,e){const t=Hx({sdkType:rh,sdkVersion:nh},e),n=new URL(r,th);return n.searchParams.append("projectId",Wr.state.projectId),Object.entries(t).forEach(([i,a])=>{a&&n.searchParams.append(i,String(a))}),(await fetch(n)).json()}const zi={async getDesktopListings(r){return ic("/w3m/v1/getDesktopListings",r)},async getMobileListings(r){return ic("/w3m/v1/getMobileListings",r)},async getInjectedListings(r){return ic("/w3m/v1/getInjectedListings",r)},async getAllListings(r){return ic("/w3m/v1/getAllListings",r)},getWalletImageUrl(r){return`${th}/w3m/v1/getWalletImage/${r}?projectId=${Wr.state.projectId}&sdkType=${rh}&sdkVersion=${nh}`},getAssetImageUrl(r){return`${th}/w3m/v1/getAssetImage/${r}?projectId=${Wr.state.projectId}&sdkType=${rh}&sdkVersion=${nh}`}};var zx=Object.defineProperty,cg=Object.getOwnPropertySymbols,qx=Object.prototype.hasOwnProperty,Wx=Object.prototype.propertyIsEnumerable,lg=(r,e,t)=>e in r?zx(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,Kx=(r,e)=>{for(var t in e||(e={}))qx.call(e,t)&&lg(r,t,e[t]);if(cg)for(var t of cg(e))Wx.call(e,t)&&lg(r,t,e[t]);return r};const ug=ye.isMobile(),Dn=ci({wallets:{listings:[],total:0,page:1},search:{listings:[],total:0,page:1},recomendedWallets:[]}),Lr={state:Dn,async getRecomendedWallets(){const{explorerRecommendedWalletIds:r,explorerExcludedWalletIds:e}=Wr.state;if(r==="NONE"||e==="ALL"&&!r)return Dn.recomendedWallets;if(ye.isArray(r)){const t={recommendedIds:r.join(",")},{listings:n}=await zi.getAllListings(t),i=Object.values(n);i.sort((a,c)=>{const u=r.indexOf(a.id),d=r.indexOf(c.id);return u-d}),Dn.recomendedWallets=i}else{const{chains:t,isAuth:n}=Ht.state,i=t?.join(","),a=ye.isArray(e),c={page:1,sdks:n?"auth_v1":void 0,entries:ye.RECOMMENDED_WALLET_AMOUNT,chains:i,version:2,excludedIds:a?e.join(","):void 0},{listings:u}=ug?await zi.getMobileListings(c):await zi.getDesktopListings(c);Dn.recomendedWallets=Object.values(u)}return Dn.recomendedWallets},async getWallets(r){const e=Kx({},r),{explorerRecommendedWalletIds:t,explorerExcludedWalletIds:n}=Wr.state,{recomendedWallets:i}=Dn;if(n==="ALL")return Dn.wallets;i.length?e.excludedIds=i.map(y=>y.id).join(","):ye.isArray(t)&&(e.excludedIds=t.join(",")),ye.isArray(n)&&(e.excludedIds=[e.excludedIds,n].filter(Boolean).join(",")),Ht.state.isAuth&&(e.sdks="auth_v1");const{page:a,search:c}=r,{listings:u,total:d}=ug?await zi.getMobileListings(e):await zi.getDesktopListings(e),h=Object.values(u),m=c?"search":"wallets";return Dn[m]={listings:[...Dn[m].listings,...h],total:d,page:a??1},{listings:h,total:d}},getWalletImageUrl(r){return zi.getWalletImageUrl(r)},getAssetImageUrl(r){return zi.getAssetImageUrl(r)},resetSearch(){Dn.search={listings:[],total:0,page:1}}},Cs=ci({open:!1}),qi={state:Cs,subscribe(r){return Hi(Cs,()=>r(Cs))},async open(r){return new Promise(e=>{const{isUiLoaded:t,isDataLoaded:n}=Ht.state;if(ye.removeWalletConnectDeepLink(),Ht.setWalletConnectUri(r?.uri),Ht.setChains(r?.chains),At.reset("ConnectWallet"),t&&n)Cs.open=!0,e();else{const i=setInterval(()=>{const a=Ht.state;a.isUiLoaded&&a.isDataLoaded&&(clearInterval(i),Cs.open=!0,e())},200)}})},close(){Cs.open=!1}};var Vx=Object.defineProperty,hg=Object.getOwnPropertySymbols,Gx=Object.prototype.hasOwnProperty,Yx=Object.prototype.propertyIsEnumerable,fg=(r,e,t)=>e in r?Vx(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,Jx=(r,e)=>{for(var t in e||(e={}))Gx.call(e,t)&&fg(r,t,e[t]);if(hg)for(var t of hg(e))Yx.call(e,t)&&fg(r,t,e[t]);return r};function Zx(){return typeof matchMedia<"u"&&matchMedia("(prefers-color-scheme: dark)").matches}const jo=ci({themeMode:Zx()?"dark":"light"}),li={state:jo,subscribe(r){return Hi(jo,()=>r(jo))},setThemeConfig(r){const{themeMode:e,themeVariables:t}=r;e&&(jo.themeMode=e),t&&(jo.themeVariables=Jx({},t))}},Wi=ci({open:!1,message:"",variant:"success"}),ui={state:Wi,subscribe(r){return Hi(Wi,()=>r(Wi))},openToast(r,e){Wi.open=!0,Wi.message=r,Wi.variant=e},closeToast(){Wi.open=!1}};class Qx{constructor(e){this.openModal=qi.open,this.closeModal=qi.close,this.subscribeModal=qi.subscribe,this.setTheme=li.setThemeConfig,li.setThemeConfig(e),Wr.setConfig(e),this.initUi()}async initUi(){if(typeof window<"u"){await Promise.resolve().then(function(){return aC});const e=document.createElement("wcm-modal");document.body.insertAdjacentElement("beforeend",e),Ht.setIsUiLoaded(!0)}}}var Xx=Object.freeze({__proto__:null,WalletConnectModal:Qx});/**
85
+ }`;var We=Dy(function(){return ut(D,ve+"return "+oe).apply(t,R)});if(We.source=oe,Ed(We))throw We;return We}function G9(s){return ft(s).toLowerCase()}function Y9(s){return ft(s).toUpperCase()}function J9(s,o,l){if(s=ft(s),s&&(l||o===t))return Nm(s);if(!s||!(o=Jr(o)))return s;var p=vn(s),v=vn(o),D=Lm(p,v),R=Mm(p,v)+1;return $i(p,D,R).join("")}function Z9(s,o,l){if(s=ft(s),s&&(l||o===t))return s.slice(0,jm(s)+1);if(!s||!(o=Jr(o)))return s;var p=vn(s),v=Mm(p,vn(o))+1;return $i(p,0,v).join("")}function Q9(s,o,l){if(s=ft(s),s&&(l||o===t))return s.replace(Ft,"");if(!s||!(o=Jr(o)))return s;var p=vn(s),v=Lm(p,vn(o));return $i(p,v).join("")}function X9(s,o){var l=F,p=V;if(Rt(o)){var v="separator"in o?o.separator:v;l="length"in o?qe(o.length):l,p="omission"in o?Jr(o.omission):p}s=ft(s);var D=s.length;if(eo(s)){var R=vn(s);D=R.length}if(l>=D)return s;var M=l-to(p);if(M<1)return p;var z=R?$i(R,0,M).join(""):s.slice(0,M);if(v===t)return z+p;if(R&&(M+=z.length-M),xd(v)){if(s.slice(M).search(v)){var te,re=z;for(v.global||(v=Ff(v.source,ft(rn.exec(v))+"g")),v.lastIndex=0;te=v.exec(re);)var oe=te.index;z=z.slice(0,oe===t?M:oe)}}else if(s.indexOf(Jr(v),M)!=M){var fe=z.lastIndexOf(v);fe>-1&&(z=z.slice(0,fe))}return z+p}function eT(s){return s=ft(s),s&&Lt.test(s)?s.replace(bi,$O):s}var tT=co(function(s,o,l){return s+(l?" ":"")+o.toUpperCase()}),Sd=Sv("toUpperCase");function Iy(s,o,l){return s=ft(s),o=l?t:o,o===t?IO(s)?TO(s):gO(s):s.match(o)||[]}var Dy=Ge(function(s,o){try{return ar(s,t,o)}catch(l){return Ed(l)?l:new Re(l)}}),rT=Qn(function(s,o){return sn(o,function(l){l=Rn(l),Jn(s,l,bd(s[l],s))}),s});function nT(s){var o=s==null?0:s.length,l=_e();return s=o?At(s,function(p){if(typeof p[1]!="function")throw new on(c);return[l(p[0]),p[1]]}):[],Ge(function(p){for(var v=-1;++v<o;){var D=s[v];if(ar(D[0],this,p))return ar(D[1],this,p)}})}function iT(s){return $7(cn(s,w))}function Cd(s){return function(){return s}}function sT(s,o){return s==null||s!==s?o:s}var oT=Ov(),aT=Ov(!0);function qr(s){return s}function Od(s){return iv(typeof s=="function"?s:cn(s,w))}function cT(s){return ov(cn(s,w))}function lT(s,o){return av(s,cn(o,w))}var uT=Ge(function(s,o){return function(l){return ga(l,s,o)}}),hT=Ge(function(s,o){return function(l){return ga(s,l,o)}});function $d(s,o,l){var p=cr(o),v=hl(o,p);l==null&&!(Rt(o)&&(v.length||!p.length))&&(l=o,o=s,s=this,v=hl(o,cr(o)));var D=!(Rt(l)&&"chain"in l)||!!l.chain,R=ei(s);return sn(v,function(M){var z=o[M];s[M]=z,R&&(s.prototype[M]=function(){var te=this.__chain__;if(D||te){var re=s(this.__wrapped__),oe=re.__actions__=Fr(this.__actions__);return oe.push({func:z,args:arguments,thisArg:s}),re.__chain__=te,re}return z.apply(s,xi([this.value()],arguments))})}),s}function fT(){return it._===this&&(it._=jO),this}function Ad(){}function dT(s){return s=qe(s),Ge(function(o){return cv(o,s)})}var pT=ad(At),gT=ad($m),mT=ad(Tf);function Sy(s){return pd(s)?Rf(Rn(s)):K7(s)}function vT(s){return function(o){return s==null?t:fs(s,o)}}var yT=Av(),wT=Av(!0);function Pd(){return[]}function Td(){return!1}function bT(){return{}}function _T(){return""}function ET(){return!0}function xT(s,o){if(s=qe(s),s<1||s>Y)return[];var l=ie,p=mr(s,ie);o=_e(o),s-=ie;for(var v=Mf(p,o);++l<s;)o(l);return v}function IT(s){return Le(s)?At(s,Rn):Zr(s)?[s]:Fr(Kv(ft(s)))}function DT(s){var o=++MO;return ft(s)+o}var ST=vl(function(s,o){return s+o},0),CT=cd("ceil"),OT=vl(function(s,o){return s/o},1),$T=cd("floor");function AT(s){return s&&s.length?ul(s,qr,Vf):t}function PT(s,o){return s&&s.length?ul(s,_e(o,2),Vf):t}function TT(s){return Tm(s,qr)}function RT(s,o){return Tm(s,_e(o,2))}function NT(s){return s&&s.length?ul(s,qr,Zf):t}function LT(s,o){return s&&s.length?ul(s,_e(o,2),Zf):t}var MT=vl(function(s,o){return s*o},1),UT=cd("round"),jT=vl(function(s,o){return s-o},0);function FT(s){return s&&s.length?Lf(s,qr):0}function BT(s,o){return s&&s.length?Lf(s,_e(o,2)):0}return _.after=cP,_.ary=ny,_.assign=YP,_.assignIn=vy,_.assignInWith=Al,_.assignWith=JP,_.at=ZP,_.before=iy,_.bind=bd,_.bindAll=rT,_.bindKey=sy,_.castArray=bP,_.chain=ey,_.chunk=$$,_.compact=A$,_.concat=P$,_.cond=nT,_.conforms=iT,_.constant=Cd,_.countBy=FA,_.create=QP,_.curry=oy,_.curryRight=ay,_.debounce=cy,_.defaults=XP,_.defaultsDeep=e9,_.defer=lP,_.delay=uP,_.difference=T$,_.differenceBy=R$,_.differenceWith=N$,_.drop=L$,_.dropRight=M$,_.dropRightWhile=U$,_.dropWhile=j$,_.fill=F$,_.filter=kA,_.flatMap=HA,_.flatMapDeep=WA,_.flatMapDepth=KA,_.flatten=Jv,_.flattenDeep=B$,_.flattenDepth=k$,_.flip=hP,_.flow=oT,_.flowRight=aT,_.fromPairs=q$,_.functions=a9,_.functionsIn=c9,_.groupBy=VA,_.initial=H$,_.intersection=W$,_.intersectionBy=K$,_.intersectionWith=V$,_.invert=u9,_.invertBy=h9,_.invokeMap=YA,_.iteratee=Od,_.keyBy=JA,_.keys=cr,_.keysIn=kr,_.map=Il,_.mapKeys=d9,_.mapValues=p9,_.matches=cT,_.matchesProperty=lT,_.memoize=Sl,_.merge=g9,_.mergeWith=yy,_.method=uT,_.methodOf=hT,_.mixin=$d,_.negate=Cl,_.nthArg=dT,_.omit=m9,_.omitBy=v9,_.once=fP,_.orderBy=ZA,_.over=pT,_.overArgs=dP,_.overEvery=gT,_.overSome=mT,_.partial=_d,_.partialRight=ly,_.partition=QA,_.pick=y9,_.pickBy=wy,_.property=Sy,_.propertyOf=vT,_.pull=Z$,_.pullAll=Qv,_.pullAllBy=Q$,_.pullAllWith=X$,_.pullAt=eA,_.range=yT,_.rangeRight=wT,_.rearg=pP,_.reject=tP,_.remove=tA,_.rest=gP,_.reverse=yd,_.sampleSize=nP,_.set=b9,_.setWith=_9,_.shuffle=iP,_.slice=rA,_.sortBy=aP,_.sortedUniq=lA,_.sortedUniqBy=uA,_.split=H9,_.spread=mP,_.tail=hA,_.take=fA,_.takeRight=dA,_.takeRightWhile=pA,_.takeWhile=gA,_.tap=AA,_.throttle=vP,_.thru=xl,_.toArray=py,_.toPairs=by,_.toPairsIn=_y,_.toPath=IT,_.toPlainObject=my,_.transform=E9,_.unary=yP,_.union=mA,_.unionBy=vA,_.unionWith=yA,_.uniq=wA,_.uniqBy=bA,_.uniqWith=_A,_.unset=x9,_.unzip=wd,_.unzipWith=Xv,_.update=I9,_.updateWith=D9,_.values=ho,_.valuesIn=S9,_.without=EA,_.words=Iy,_.wrap=wP,_.xor=xA,_.xorBy=IA,_.xorWith=DA,_.zip=SA,_.zipObject=CA,_.zipObjectDeep=OA,_.zipWith=$A,_.entries=by,_.entriesIn=_y,_.extend=vy,_.extendWith=Al,$d(_,_),_.add=ST,_.attempt=Dy,_.camelCase=A9,_.capitalize=Ey,_.ceil=CT,_.clamp=C9,_.clone=_P,_.cloneDeep=xP,_.cloneDeepWith=IP,_.cloneWith=EP,_.conformsTo=DP,_.deburr=xy,_.defaultTo=sT,_.divide=OT,_.endsWith=P9,_.eq=wn,_.escape=T9,_.escapeRegExp=R9,_.every=BA,_.find=qA,_.findIndex=Gv,_.findKey=t9,_.findLast=zA,_.findLastIndex=Yv,_.findLastKey=r9,_.floor=$T,_.forEach=ty,_.forEachRight=ry,_.forIn=n9,_.forInRight=i9,_.forOwn=s9,_.forOwnRight=o9,_.get=Id,_.gt=SP,_.gte=CP,_.has=l9,_.hasIn=Dd,_.head=Zv,_.identity=qr,_.includes=GA,_.indexOf=z$,_.inRange=O9,_.invoke=f9,_.isArguments=gs,_.isArray=Le,_.isArrayBuffer=OP,_.isArrayLike=Br,_.isArrayLikeObject=Kt,_.isBoolean=$P,_.isBuffer=Ai,_.isDate=AP,_.isElement=PP,_.isEmpty=TP,_.isEqual=RP,_.isEqualWith=NP,_.isError=Ed,_.isFinite=LP,_.isFunction=ei,_.isInteger=uy,_.isLength=Ol,_.isMap=hy,_.isMatch=MP,_.isMatchWith=UP,_.isNaN=jP,_.isNative=FP,_.isNil=kP,_.isNull=BP,_.isNumber=fy,_.isObject=Rt,_.isObjectLike=kt,_.isPlainObject=_a,_.isRegExp=xd,_.isSafeInteger=qP,_.isSet=dy,_.isString=$l,_.isSymbol=Zr,_.isTypedArray=uo,_.isUndefined=zP,_.isWeakMap=HP,_.isWeakSet=WP,_.join=G$,_.kebabCase=N9,_.last=un,_.lastIndexOf=Y$,_.lowerCase=L9,_.lowerFirst=M9,_.lt=KP,_.lte=VP,_.max=AT,_.maxBy=PT,_.mean=TT,_.meanBy=RT,_.min=NT,_.minBy=LT,_.stubArray=Pd,_.stubFalse=Td,_.stubObject=bT,_.stubString=_T,_.stubTrue=ET,_.multiply=MT,_.nth=J$,_.noConflict=fT,_.noop=Ad,_.now=Dl,_.pad=U9,_.padEnd=j9,_.padStart=F9,_.parseInt=B9,_.random=$9,_.reduce=XA,_.reduceRight=eP,_.repeat=k9,_.replace=q9,_.result=w9,_.round=UT,_.runInContext=q,_.sample=rP,_.size=sP,_.snakeCase=z9,_.some=oP,_.sortedIndex=nA,_.sortedIndexBy=iA,_.sortedIndexOf=sA,_.sortedLastIndex=oA,_.sortedLastIndexBy=aA,_.sortedLastIndexOf=cA,_.startCase=W9,_.startsWith=K9,_.subtract=jT,_.sum=FT,_.sumBy=BT,_.template=V9,_.times=xT,_.toFinite=ti,_.toInteger=qe,_.toLength=gy,_.toLower=G9,_.toNumber=hn,_.toSafeInteger=GP,_.toString=ft,_.toUpper=Y9,_.trim=J9,_.trimEnd=Z9,_.trimStart=Q9,_.truncate=X9,_.unescape=eT,_.uniqueId=DT,_.upperCase=tT,_.upperFirst=Sd,_.each=ty,_.eachRight=ry,_.first=Zv,$d(_,function(){var s={};return Pn(_,function(o,l){dt.call(_.prototype,l)||(s[l]=o)}),s}(),{chain:!1}),_.VERSION=n,sn(["bind","bindKey","curry","curryRight","partial","partialRight"],function(s){_[s].placeholder=_}),sn(["drop","take"],function(s,o){tt.prototype[s]=function(l){l=l===t?1:nr(qe(l),0);var p=this.__filtered__&&!o?new tt(this):this.clone();return p.__filtered__?p.__takeCount__=mr(l,p.__takeCount__):p.__views__.push({size:mr(l,ie),type:s+(p.__dir__<0?"Right":"")}),p},tt.prototype[s+"Right"]=function(l){return this.reverse()[s](l).reverse()}}),sn(["filter","map","takeWhile"],function(s,o){var l=o+1,p=l==I||l==X;tt.prototype[s]=function(v){var D=this.clone();return D.__iteratees__.push({iteratee:_e(v,3),type:l}),D.__filtered__=D.__filtered__||p,D}}),sn(["head","last"],function(s,o){var l="take"+(o?"Right":"");tt.prototype[s]=function(){return this[l](1).value()[0]}}),sn(["initial","tail"],function(s,o){var l="drop"+(o?"":"Right");tt.prototype[s]=function(){return this.__filtered__?new tt(this):this[l](1)}}),tt.prototype.compact=function(){return this.filter(qr)},tt.prototype.find=function(s){return this.filter(s).head()},tt.prototype.findLast=function(s){return this.reverse().find(s)},tt.prototype.invokeMap=Ge(function(s,o){return typeof s=="function"?new tt(this):this.map(function(l){return ga(l,s,o)})}),tt.prototype.reject=function(s){return this.filter(Cl(_e(s)))},tt.prototype.slice=function(s,o){s=qe(s);var l=this;return l.__filtered__&&(s>0||o<0)?new tt(l):(s<0?l=l.takeRight(-s):s&&(l=l.drop(s)),o!==t&&(o=qe(o),l=o<0?l.dropRight(-o):l.take(o-s)),l)},tt.prototype.takeRightWhile=function(s){return this.reverse().takeWhile(s).reverse()},tt.prototype.toArray=function(){return this.take(ie)},Pn(tt.prototype,function(s,o){var l=/^(?:filter|find|map|reject)|While$/.test(o),p=/^(?:head|last)$/.test(o),v=_[p?"take"+(o=="last"?"Right":""):o],D=p||/^find/.test(o);v&&(_.prototype[o]=function(){var R=this.__wrapped__,M=p?[1]:arguments,z=R instanceof tt,te=M[0],re=z||Le(R),oe=function(Qe){var st=v.apply(_,xi([Qe],M));return p&&fe?st[0]:st};re&&l&&typeof te=="function"&&te.length!=1&&(z=re=!1);var fe=this.__chain__,ve=!!this.__actions__.length,Ie=D&&!fe,We=z&&!ve;if(!D&&re){R=We?R:new tt(this);var De=s.apply(R,M);return De.__actions__.push({func:xl,args:[oe],thisArg:t}),new an(De,fe)}return Ie&&We?s.apply(this,M):(De=this.thru(oe),Ie?p?De.value()[0]:De.value():De)})}),sn(["pop","push","shift","sort","splice","unshift"],function(s){var o=Yc[s],l=/^(?:push|sort|unshift)$/.test(s)?"tap":"thru",p=/^(?:pop|shift)$/.test(s);_.prototype[s]=function(){var v=arguments;if(p&&!this.__chain__){var D=this.value();return o.apply(Le(D)?D:[],v)}return this[l](function(R){return o.apply(Le(R)?R:[],v)})}}),Pn(tt.prototype,function(s,o){var l=_[o];if(l){var p=l.name+"";dt.call(so,p)||(so[p]=[]),so[p].push({name:o,func:l})}}),so[ml(t,j).name]=[{name:"wrapper",func:t}],tt.prototype.clone=e7,tt.prototype.reverse=t7,tt.prototype.value=r7,_.prototype.at=PA,_.prototype.chain=TA,_.prototype.commit=RA,_.prototype.next=NA,_.prototype.plant=MA,_.prototype.reverse=UA,_.prototype.toJSON=_.prototype.valueOf=_.prototype.value=jA,_.prototype.first=_.prototype.head,ca&&(_.prototype[ca]=LA),_},ro=RO();Wt?((Wt.exports=ro)._=ro,yt._=ro):it._=ro}).call(Mo)})(Vu,Vu.exports);var ex=Object.defineProperty,tx=Object.defineProperties,rx=Object.getOwnPropertyDescriptors,W1=Object.getOwnPropertySymbols,nx=Object.prototype.hasOwnProperty,ix=Object.prototype.propertyIsEnumerable,K1=(r,e,t)=>e in r?ex(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,Ya=(r,e)=>{for(var t in e||(e={}))nx.call(e,t)&&K1(r,t,e[t]);if(W1)for(var t of W1(e))ix.call(e,t)&&K1(r,t,e[t]);return r},sx=(r,e)=>tx(r,rx(e));function ai(r,e,t){var n;const i=J2(r);return((n=e.rpcMap)==null?void 0:n[i.reference])||`${X8}?chainId=${i.namespace}:${i.reference}&projectId=${t}`}function qi(r){return r.includes(":")?r.split(":")[1]:r}function V1(r){return r.map(e=>`${e.split(":")[0]}:${e.split(":")[1]}`)}function ox(r,e){const t=Object.keys(e.namespaces).filter(i=>i.includes(r));if(!t.length)return[];const n=[];return t.forEach(i=>{const a=e.namespaces[i].accounts;n.push(...a)}),n}function G1(r={},e={}){const t=Y1(r),n=Y1(e);return Vu.exports.merge(t,n)}function Y1(r){var e,t,n,i;const a={};if(!xo(r))return a;for(const[c,u]of Object.entries(r)){const f=lu(c)?[c]:u.chains,h=u.methods||[],m=u.events||[],w=u.rpcMap||{},y=Eo(c);a[y]=sx(Ya(Ya({},a[y]),u),{chains:au(f,(e=a[y])==null?void 0:e.chains),methods:au(h,(t=a[y])==null?void 0:t.methods),events:au(m,(n=a[y])==null?void 0:n.events),rpcMap:Ya(Ya({},w),(i=a[y])==null?void 0:i.rpcMap)})}return a}function ax(r){return r.includes(":")?r.split(":")[2]:r}function cx(r){const e={};for(const[t,n]of Object.entries(r)){const i=n.methods||[],a=n.events||[],c=n.accounts||[],u=lu(t)?[t]:n.chains?n.chains:V1(n.accounts);e[t]={chains:u,methods:i,events:a,accounts:c}}return e}function Gu(r){return typeof r=="number"?r:r.includes("0x")?parseInt(r,16):(r=r.includes(":")?r.split(":")[1]:r,isNaN(Number(r))?r:Number(r))}const J1={},Dt=r=>J1[r],Yu=(r,e)=>{J1[r]=e};class lx{constructor(e){this.name="polkadot",this.namespace=e.namespace,this.events=Dt("events"),this.client=Dt("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;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.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(kn.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getAccounts(){const e=this.namespace.accounts;return e?e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2])||[]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{var n;const i=qi(t);e[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[t])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const n=this.createHttpProvider(e,t);n&&(this.httpProviders[e]=n)}createHttpProvider(e,t){const n=t||ai(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new Un(new oi(n,Dt("disableProviderPing")))}}class ux{constructor(e){this.name="eip155",this.namespace=e.namespace,this.events=Dt("events"),this.client=Dt("client"),this.httpProviders=this.createHttpProviders(),this.chainId=parseInt(this.getDefaultChain())}async request(e){switch(e.request.method){case"eth_requestAccounts":return this.getAccounts();case"eth_accounts":return this.getAccounts();case"wallet_switchEthereumChain":return await this.handleSwitchChain(e);case"eth_chainId":return parseInt(this.getDefaultChain())}return this.namespace.methods.includes(e.request.method)?await this.client.request(e):this.getHttpProvider().request(e.request)}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(parseInt(e),t),this.chainId=parseInt(e),this.events.emit(kn.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId.toString();if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}createHttpProvider(e,t){const n=t||ai(`${this.name}:${e}`,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new Un(new oi(n,Dt("disableProviderPing")))}setHttpProvider(e,t){const n=this.createHttpProvider(e,t);n&&(this.httpProviders[e]=n)}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{var n;const i=parseInt(qi(t));e[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[t])}),e}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2]))]:[]}getHttpProvider(){const e=this.chainId,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}async handleSwitchChain(e){var t,n;let i=e.request.params?(t=e.request.params[0])==null?void 0:t.chainId:"0x0";i=i.startsWith("0x")?i:`0x${i}`;const a=parseInt(i,16);if(this.isChainApproved(a))this.setDefaultChain(`${a}`);else if(this.namespace.methods.includes("wallet_switchEthereumChain"))await this.client.request({topic:e.topic,request:{method:e.request.method,params:[{chainId:i}]},chainId:(n=this.namespace.chains)==null?void 0:n[0]}),this.setDefaultChain(`${a}`);else throw new Error(`Failed to switch to chain 'eip155:${a}'. The chain is not approved or the wallet does not support 'wallet_switchEthereumChain' method.`);return null}isChainApproved(e){return this.namespace.chains.includes(`${this.name}:${e}`)}}class hx{constructor(e){this.name="solana",this.namespace=e.namespace,this.events=Dt("events"),this.client=Dt("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(kn.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{var n;const i=qi(t);e[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[t])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const n=this.createHttpProvider(e,t);n&&(this.httpProviders[e]=n)}createHttpProvider(e,t){const n=t||ai(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new Un(new oi(n,Dt("disableProviderPing")))}}class fx{constructor(e){this.name="cosmos",this.namespace=e.namespace,this.events=Dt("events"),this.client=Dt("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;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.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(kn.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{var n;const i=qi(t);e[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[t])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const n=this.createHttpProvider(e,t);n&&(this.httpProviders[e]=n)}createHttpProvider(e,t){const n=t||ai(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new Un(new oi(n,Dt("disableProviderPing")))}}class dx{constructor(e){this.name="cip34",this.namespace=e.namespace,this.events=Dt("events"),this.client=Dt("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;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.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(kn.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{const n=this.getCardanoRPCUrl(t),i=qi(t);e[i]=this.createHttpProvider(i,n)}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}getCardanoRPCUrl(e){const t=this.namespace.rpcMap;if(t)return t[e]}setHttpProvider(e,t){const n=this.createHttpProvider(e,t);n&&(this.httpProviders[e]=n)}createHttpProvider(e,t){const n=t||this.getCardanoRPCUrl(e);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new Un(new oi(n,Dt("disableProviderPing")))}}class px{constructor(e){this.name="elrond",this.namespace=e.namespace,this.events=Dt("events"),this.client=Dt("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(kn.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{var n;const i=qi(t);e[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[t])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const n=this.createHttpProvider(e,t);n&&(this.httpProviders[e]=n)}createHttpProvider(e,t){const n=t||ai(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new Un(new oi(n,Dt("disableProviderPing")))}}class gx{constructor(e){this.name="multiversx",this.namespace=e.namespace,this.events=Dt("events"),this.client=Dt("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(kn.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{var n;const i=qi(t);e[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[t])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const n=this.createHttpProvider(e,t);n&&(this.httpProviders[e]=n)}createHttpProvider(e,t){const n=t||ai(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new Un(new oi(n,Dt("disableProviderPing")))}}class mx{constructor(e){this.name="near",this.namespace=e.namespace,this.events=Dt("events"),this.client=Dt("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;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.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){if(this.chainId=e,!this.httpProviders[e]){const n=t||ai(`${this.name}:${e}`,this.namespace);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,n)}this.events.emit(kn.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e?e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2])||[]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{var n;e[t]=this.createHttpProvider(t,(n=this.namespace.rpcMap)==null?void 0:n[t])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const n=this.createHttpProvider(e,t);n&&(this.httpProviders[e]=n)}createHttpProvider(e,t){const n=t||ai(e,this.namespace);return typeof n>"u"?void 0:new Un(new oi(n,Dt("disableProviderPing")))}}var vx=Object.defineProperty,yx=Object.defineProperties,wx=Object.getOwnPropertyDescriptors,Z1=Object.getOwnPropertySymbols,bx=Object.prototype.hasOwnProperty,_x=Object.prototype.propertyIsEnumerable,Q1=(r,e,t)=>e in r?vx(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,Ja=(r,e)=>{for(var t in e||(e={}))bx.call(e,t)&&Q1(r,t,e[t]);if(Z1)for(var t of Z1(e))_x.call(e,t)&&Q1(r,t,e[t]);return r},Ju=(r,e)=>yx(r,wx(e));class Zu{constructor(e){this.events=new lr.exports,this.rpcProviders={},this.shouldAbortPairingAttempt=!1,this.maxPairingAttempts=10,this.disableProviderPing=!1,this.providerOpts=e,this.logger=typeof e?.logger<"u"&&typeof e?.logger!="string"?e.logger:Xe.pino(Xe.getDefaultLoggerOptions({level:e?.logger||z1})),this.disableProviderPing=e?.disableProviderPing||!1}static async init(e){const t=new Zu(e);return await t.initialize(),t}async request(e,t,n){const[i,a]=this.validateChain(t);if(!this.session)throw new Error("Please call connect() before request()");return await this.getProvider(i).request({request:Ja({},e),chainId:`${i}:${a}`,topic:this.session.topic,expiry:n})}sendAsync(e,t,n,i){const a=new Date().getTime();this.request(e,n,i).then(c=>t(null,za(a,c))).catch(c=>t(c,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:It("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(),!e.skipPairing)return await this.pair(e.pairingTopic)}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}removeListener(e,t){this.events.removeListener(e,t)}off(e,t){this.events.off(e,t)}get isWalletConnect(){return!0}async pair(e){this.shouldAbortPairingAttempt=!1;let t=0;do{if(this.shouldAbortPairingAttempt)throw new Error("Pairing aborted");if(t>=this.maxPairingAttempts)throw new Error("Max auto pairing attempts reached");const{uri:n,approval:i}=await this.client.connect({pairingTopic:e,requiredNamespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties});n&&(this.uri=n,this.events.emit("display_uri",n)),await i().then(a=>{this.session=a;const c=cx(a.namespaces);this.namespaces=G1(this.namespaces,c),this.persist("namespaces",this.namespaces)}).catch(a=>{if(a.message!==U1)throw a;t++})}while(!this.session);return this.onConnect(),this.session}setDefaultChain(e,t){try{if(!this.session)return;const[n,i]=this.validateChain(e);this.getProvider(n).setDefaultChain(i,t)}catch(n){if(!/Please call connect/.test(n.message))throw n}}async cleanupPendingPairings(e={}){this.logger.info("Cleaning up inactive pairings...");const t=this.client.pairing.getAll();if(En(t)){for(const n of t)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: ${t.length}`)}}abortPairingAttempt(){this.shouldAbortPairingAttempt=!0}async checkStorage(){if(this.namespaces=await this.getFromStore("namespaces"),this.optionalNamespaces=await this.getFromStore("optionalNamespaces")||{},this.client.session.length){const e=this.client.session.keys.length-1;this.session=this.client.session.get(this.client.session.keys[e]),this.createProviders()}}async initialize(){this.logger.trace("Initialized"),await this.createClient(),await this.checkStorage(),this.registerEventListeners()}async createClient(){this.client=this.providerOpts.client||await Wu.init({logger:this.providerOpts.logger||z1,relayUrl:this.providerOpts.relayUrl||J8,projectId:this.providerOpts.projectId,metadata:this.providerOpts.metadata,storageOptions:this.providerOpts.storageOptions,storage:this.providerOpts.storage,name:this.providerOpts.name}),this.logger.trace("SignClient Initialized")}createProviders(){if(!this.client)throw new Error("Sign Client not initialized");if(!this.session)throw new Error("Session not initialized. Please call connect() before enable()");const e=[...new Set(Object.keys(this.session.namespaces).map(t=>Eo(t)))];Yu("client",this.client),Yu("events",this.events),Yu("disableProviderPing",this.disableProviderPing),e.forEach(t=>{if(!this.session)return;const n=ox(t,this.session),i=V1(n),a=G1(this.namespaces,this.optionalNamespaces),c=Ju(Ja({},a[t]),{accounts:n,chains:i});switch(t){case"eip155":this.rpcProviders[t]=new ux({namespace:c});break;case"solana":this.rpcProviders[t]=new hx({namespace:c});break;case"cosmos":this.rpcProviders[t]=new fx({namespace:c});break;case"polkadot":this.rpcProviders[t]=new lx({namespace:c});break;case"cip34":this.rpcProviders[t]=new dx({namespace:c});break;case"elrond":this.rpcProviders[t]=new px({namespace:c});break;case"multiversx":this.rpcProviders[t]=new gx({namespace:c});break;case"near":this.rpcProviders[t]=new mx({namespace:c});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:t}=e,{event:n}=t;if(n.name==="accountsChanged"){const i=n.data;i&&En(i)&&this.events.emit("accountsChanged",i.map(ax))}else if(n.name==="chainChanged"){const i=t.chainId,a=t.event.data,c=Eo(i),u=Gu(i)!==Gu(a)?`${c}:${Gu(a)}`:i;this.onChainChanged(u)}else this.events.emit(n.name,n.data);this.events.emit("session_event",e)}),this.client.on("session_update",({topic:e,params:t})=>{var n;const{namespaces:i}=t,a=(n=this.client)==null?void 0:n.session.get(e);this.session=Ju(Ja({},a),{namespaces:i}),this.onSessionUpdate(),this.events.emit("session_update",{topic:e,params:t})}),this.client.on("session_delete",async e=>{await this.cleanup(),this.events.emit("session_delete",e),this.events.emit("disconnect",Ju(Ja({},It("USER_DISCONNECTED")),{data:e.topic}))}),this.on(kn.DEFAULT_CHAIN_CHANGED,e=>{this.onChainChanged(e,!0)})}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 t;this.getProvider(e).updateNamespace((t=this.session)==null?void 0:t.namespaces[e])})}setNamespaces(e){const{namespaces:t,optionalNamespaces:n,sessionProperties:i}=e;t&&Object.keys(t).length&&(this.namespaces=t),n&&Object.keys(n).length&&(this.optionalNamespaces=n),this.sessionProperties=i,this.persist("namespaces",t),this.persist("optionalNamespaces",n)}validateChain(e){const[t,n]=e?.split(":")||["",""];if(!this.namespaces||!Object.keys(this.namespaces).length)return[t,n];if(t&&!Object.keys(this.namespaces||{}).map(c=>Eo(c)).includes(t))throw new Error(`Namespace '${t}' is not configured. Please call connect() first with namespace config.`);if(t&&n)return[t,n];const i=Eo(Object.keys(this.namespaces)[0]),a=this.rpcProviders[i].getDefaultChain();return[i,a]}async requestAccounts(){const[e]=this.validateChain();return await this.getProvider(e).requestAccounts()}onChainChanged(e,t=!1){if(!this.namespaces)return;const[n,i]=this.validateChain(e);i&&(t||this.getProvider(n).setDefaultChain(i),this.namespaces[n]?this.namespaces[n].defaultChain=i:this.namespaces[`${n}:${i}`]?this.namespaces[`${n}:${i}`].defaultChain=i:this.namespaces[`${n}:${i}`]={defaultChain:i},this.persist("namespaces",this.namespaces),this.events.emit("chainChanged",i))}onConnect(){this.createProviders(),this.events.emit("connect",{session:this.session})}async cleanup(){this.session=void 0,this.namespaces=void 0,this.optionalNamespaces=void 0,this.sessionProperties=void 0,this.persist("namespaces",void 0),this.persist("optionalNamespaces",void 0),this.persist("sessionProperties",void 0),await this.cleanupPendingPairings({deletePairings:!0})}persist(e,t){this.client.core.storage.setItem(`${H1}/${e}`,t)}async getFromStore(e){return await this.client.core.storage.getItem(`${H1}/${e}`)}}const Ex=Zu,xx="wc",Ix="ethereum_provider",Dx=`${xx}@2:${Ix}:`,Sx="https://rpc.walletconnect.com/v1/",Za=["eth_sendTransaction","personal_sign"],X1=["eth_accounts","eth_requestAccounts","eth_sendRawTransaction","eth_sign","eth_signTransaction","eth_signTypedData","eth_signTypedData_v3","eth_signTypedData_v4","eth_sendTransaction","personal_sign","wallet_switchEthereumChain","wallet_addEthereumChain","wallet_getPermissions","wallet_requestPermissions","wallet_registerOnboarding","wallet_watchAsset","wallet_scanQRCode"],Qa=["chainChanged","accountsChanged"],eg=["chainChanged","accountsChanged","message","disconnect","connect"];var Cx=Object.defineProperty,Ox=Object.defineProperties,$x=Object.getOwnPropertyDescriptors,tg=Object.getOwnPropertySymbols,Ax=Object.prototype.hasOwnProperty,Px=Object.prototype.propertyIsEnumerable,rg=(r,e,t)=>e in r?Cx(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,Uo=(r,e)=>{for(var t in e||(e={}))Ax.call(e,t)&&rg(r,t,e[t]);if(tg)for(var t of tg(e))Px.call(e,t)&&rg(r,t,e[t]);return r},ng=(r,e)=>Ox(r,$x(e));function Xa(r){return Number(r[0].split(":")[1])}function Qu(r){return`0x${r.toString(16)}`}function Tx(r){const{chains:e,optionalChains:t,methods:n,optionalMethods:i,events:a,optionalEvents:c,rpcMap:u}=r;if(!En(e))throw new Error("Invalid chains");const f={chains:e,methods:n||Za,events:a||Qa,rpcMap:Uo({},e.length?{[Xa(e)]:u[Xa(e)]}:{})},h=a?.filter(x=>!Qa.includes(x)),m=n?.filter(x=>!Za.includes(x));if(!t&&!c&&!i&&!(h!=null&&h.length)&&!(m!=null&&m.length))return{required:e.length?f:void 0};const w=h?.length&&m?.length||!t,y={chains:[...new Set(w?f.chains.concat(t||[]):t)],methods:[...new Set(f.methods.concat(i!=null&&i.length?i:X1))],events:[...new Set(f.events.concat(c!=null&&c.length?c:eg))],rpcMap:u};return{required:e.length?f:void 0,optional:t.length?y:void 0}}class ec{constructor(){this.events=new lr.exports.EventEmitter,this.namespace="eip155",this.accounts=[],this.chainId=1,this.STORAGE_KEY=Dx,this.on=(e,t)=>(this.events.on(e,t),this),this.once=(e,t)=>(this.events.once(e,t),this),this.removeListener=(e,t)=>(this.events.removeListener(e,t),this),this.off=(e,t)=>(this.events.off(e,t),this),this.parseAccount=e=>this.isCompatibleChainId(e)?this.parseAccountId(e).address:e,this.signer={},this.rpc={}}static async init(e){const t=new ec;return await t.initialize(e),t}async request(e,t){return await this.signer.request(e,this.formatChainId(this.chainId),t)}sendAsync(e,t,n){this.signer.sendAsync(e,t,this.formatChainId(this.chainId),n)}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:t,optional:n}=Tx(this.rpc);try{const i=await new Promise(async(c,u)=>{var f;this.rpc.showQrModal&&((f=this.modal)==null||f.subscribeModal(h=>{!h.open&&!this.signer.session&&(this.signer.abortPairingAttempt(),u(new Error("Connection request reset. Please try again.")))})),await this.signer.connect(ng(Uo({namespaces:Uo({},t&&{[this.namespace]:t})},n&&{optionalNamespaces:{[this.namespace]:n}}),{pairingTopic:e?.pairingTopic})).then(h=>{c(h)}).catch(h=>{u(new Error(h.message))})});if(!i)return;const a=Z2(i.namespaces,[this.namespace]);this.setChainIds(this.rpc.chains.length?this.rpc.chains:a),this.setAccounts(a),this.events.emit("connect",{chainId:Qu(this.chainId)})}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()}get isWalletConnect(){return!0}get session(){return this.signer.session}registerEventListeners(){this.signer.on("session_event",e=>{const{params:t}=e,{event:n}=t;n.name==="accountsChanged"?(this.accounts=this.parseAccounts(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=>{const t=parseInt(e);this.chainId=t,this.events.emit("chainChanged",Qu(this.chainId)),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.events.emit("disconnect",ng(Uo({},It("USER_DISCONNECTED")),{data:e.topic,name:"USER_DISCONNECTED"}))}),this.signer.on("display_uri",e=>{var t,n;this.rpc.showQrModal&&((t=this.modal)==null||t.closeModal(),(n=this.modal)==null||n.openModal({uri:e})),this.events.emit("display_uri",e)})}switchEthereumChain(e){this.request({method:"wallet_switchEthereumChain",params:[{chainId:e.toString(16)}]})}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 t=e.filter(n=>this.isCompatibleChainId(n)).map(n=>this.parseChainId(n));t.length&&(this.chainId=t[0],this.events.emit("chainChanged",Qu(this.chainId)),this.persist())}setChainId(e){if(this.isCompatibleChainId(e)){const t=this.parseChainId(e);this.chainId=t,this.switchEthereumChain(t)}}parseAccountId(e){const[t,n,i]=e.split(":");return{chainId:`${t}:${n}`,address:i}}setAccounts(e){this.accounts=e.filter(t=>this.parseChainId(this.parseAccountId(t).chainId)===this.chainId).map(t=>this.parseAccountId(t).address),this.events.emit("accountsChanged",this.accounts)}getRpcConfig(e){var t,n;const i=(t=e?.chains)!=null?t:[],a=(n=e?.optionalChains)!=null?n:[],c=i.concat(a);if(!c.length)throw new Error("No chains specified in either `chains` or `optionalChains`");const u=i.length?e?.methods||Za:[],f=i.length?e?.events||Qa:[],h=e?.optionalMethods||[],m=e?.optionalEvents||[],w=e?.rpcMap||this.buildRpcMap(c,e.projectId),y=e?.qrModalOptions||void 0;return{chains:i?.map(x=>this.formatChainId(x)),optionalChains:a.map(x=>this.formatChainId(x)),methods:u,events:f,optionalMethods:h,optionalEvents:m,rpcMap:w,showQrModal:!!(e!=null&&e.showQrModal),qrModalOptions:y,projectId:e.projectId,metadata:e.metadata}}buildRpcMap(e,t){const n={};return e.forEach(i=>{n[i]=this.getRpcUrl(i,t)}),n}async initialize(e){if(this.rpc=this.getRpcConfig(e),this.chainId=this.rpc.chains.length?Xa(this.rpc.chains):Xa(this.rpc.optionalChains),this.signer=await Ex.init({projectId:this.rpc.projectId,metadata:this.rpc.metadata,disableProviderPing:e.disableProviderPing,relayUrl:e.relayUrl,storageOptions:e.storageOptions}),this.registerEventListeners(),await this.loadPersistedSession(),this.rpc.showQrModal){let t;try{const{WalletConnectModal:n}=await Promise.resolve().then(function(){return tI});t=n}catch{throw new Error("To use QR modal, please install @walletconnect/modal package")}if(t)try{this.modal=new t(Uo({projectId:this.rpc.projectId},this.rpc.qrModalOptions))}catch(n){throw this.signer.logger.error(n),new Error("Could not generate WalletConnectModal Instance")}}}loadConnectOpts(e){if(!e)return;const{chains:t,optionalChains:n,rpcMap:i}=e;t&&En(t)&&(this.rpc.chains=t.map(a=>this.formatChainId(a)),t.forEach(a=>{this.rpc.rpcMap[a]=i?.[a]||this.getRpcUrl(a)})),n&&En(n)&&(this.rpc.optionalChains=[],this.rpc.optionalChains=n?.map(a=>this.formatChainId(a)),n.forEach(a=>{this.rpc.rpcMap[a]=i?.[a]||this.getRpcUrl(a)}))}getRpcUrl(e,t){var n;return((n=this.rpc.rpcMap)==null?void 0:n[e])||`${Sx}?chainId=eip155:${e}&projectId=${t||this.rpc.projectId}`}async loadPersistedSession(){if(!this.session)return;const e=await this.signer.client.core.storage.getItem(`${this.STORAGE_KEY}/chainId`),t=this.session.namespaces[`${this.namespace}:${e}`]?this.session.namespaces[`${this.namespace}:${e}`]:this.session.namespaces[this.namespace];this.setChainIds(e?[this.formatChainId(e)]:t?.accounts),this.setAccounts(t?.accounts)}reset(){this.chainId=1,this.accounts=[]}persist(){this.session&&this.signer.client.core.storage.setItem(`${this.STORAGE_KEY}/chainId`,this.chainId)}parseAccounts(e){return typeof e=="string"||e instanceof String?[this.parseAccount(e)]:e.map(t=>this.parseAccount(t))}}const Rx=ec,Nx=Symbol(),ig=Object.getPrototypeOf,Xu=new WeakMap,Lx=r=>r&&(Xu.has(r)?Xu.get(r):ig(r)===Object.prototype||ig(r)===Array.prototype),Mx=r=>Lx(r)&&r[Nx]||null,sg=(r,e=!0)=>{Xu.set(r,e)},eh=r=>typeof r=="object"&&r!==null,ci=new WeakMap,tc=new WeakSet,Ux=(r=Object.is,e=(h,m)=>new Proxy(h,m),t=h=>eh(h)&&!tc.has(h)&&(Array.isArray(h)||!(Symbol.iterator in h))&&!(h instanceof WeakMap)&&!(h instanceof WeakSet)&&!(h instanceof Error)&&!(h instanceof Number)&&!(h instanceof Date)&&!(h instanceof String)&&!(h instanceof RegExp)&&!(h instanceof ArrayBuffer),n=h=>{switch(h.status){case"fulfilled":return h.value;case"rejected":throw h.reason;default:throw h}},i=new WeakMap,a=(h,m,w=n)=>{const y=i.get(h);if(y?.[0]===m)return y[1];const x=Array.isArray(h)?[]:Object.create(Object.getPrototypeOf(h));return sg(x,!0),i.set(h,[m,x]),Reflect.ownKeys(h).forEach(S=>{if(Object.getOwnPropertyDescriptor(x,S))return;const P=Reflect.get(h,S),U={value:P,enumerable:!0,configurable:!0};if(tc.has(P))sg(P,!1);else if(P instanceof Promise)delete U.value,U.get=()=>w(P);else if(ci.has(P)){const[j,A]=ci.get(P);U.value=a(j,A(),w)}Object.defineProperty(x,S,U)}),Object.preventExtensions(x)},c=new WeakMap,u=[1,1],f=h=>{if(!eh(h))throw new Error("object required");const m=c.get(h);if(m)return m;let w=u[0];const y=new Set,x=(H,F=++u[0])=>{w!==F&&(w=F,y.forEach(V=>V(H,F)))};let S=u[1];const P=(H=++u[1])=>(S!==H&&!y.size&&(S=H,j.forEach(([F])=>{const V=F[1](H);V>w&&(w=V)})),w),U=H=>(F,V)=>{const se=[...F];se[1]=[H,...se[1]],x(se,V)},j=new Map,A=(H,F)=>{if(j.has(H))throw new Error("prop listener already exists");if(y.size){const V=F[3](U(H));j.set(H,[F,V])}else j.set(H,[F])},T=H=>{var F;const V=j.get(H);V&&(j.delete(H),(F=V[1])==null||F.call(V))},C=H=>(y.add(H),y.size===1&&j.forEach(([V,se],ce)=>{if(se)throw new Error("remove already exists");const I=V[3](U(ce));j.set(ce,[V,I])}),()=>{y.delete(H),y.size===0&&j.forEach(([V,se],ce)=>{se&&(se(),j.set(ce,[V]))})}),$=Array.isArray(h)?[]:Object.create(Object.getPrototypeOf(h)),d=e($,{deleteProperty(H,F){const V=Reflect.get(H,F);T(F);const se=Reflect.deleteProperty(H,F);return se&&x(["delete",[F],V]),se},set(H,F,V,se){const ce=Reflect.has(H,F),I=Reflect.get(H,F,se);if(ce&&(r(I,V)||c.has(V)&&r(I,c.get(V))))return!0;T(F),eh(V)&&(V=Mx(V)||V);let N=V;if(V instanceof Promise)V.then(X=>{V.status="fulfilled",V.value=X,x(["resolve",[F],X])}).catch(X=>{V.status="rejected",V.reason=X,x(["reject",[F],X])});else{!ci.has(V)&&t(V)&&(N=f(V));const X=!tc.has(N)&&ci.get(N);X&&A(F,X)}return Reflect.set(H,F,N,se),x(["set",[F],V,I]),!0}});c.set(h,d);const b=[$,P,a,C];return ci.set(d,b),Reflect.ownKeys(h).forEach(H=>{const F=Object.getOwnPropertyDescriptor(h,H);"value"in F&&(d[H]=h[H],delete F.value,delete F.writable),Object.defineProperty($,H,F)}),d})=>[f,ci,tc,r,e,t,n,i,a,c,u],[jx]=Ux();function li(r={}){return jx(r)}function zi(r,e,t){const n=ci.get(r);n||console.warn("Please use proxy object");let i;const a=[],c=n[3];let u=!1;const h=c(m=>{if(a.push(m),t){e(a.splice(0));return}i||(i=Promise.resolve().then(()=>{i=void 0,u&&e(a.splice(0))}))});return u=!0,()=>{u=!1,h()}}function Fx(r,e){const t=ci.get(r);t||console.warn("Please use proxy object");const[n,i,a]=t;return a(n,i(),e)}const or=li({history:["ConnectWallet"],view:"ConnectWallet",data:void 0}),Pt={state:or,subscribe(r){return zi(or,()=>r(or))},push(r,e){r!==or.view&&(or.view=r,e&&(or.data=e),or.history.push(r))},reset(r){or.view=r,or.history=[r]},replace(r){or.history.length>1&&(or.history[or.history.length-1]=r,or.view=r)},goBack(){if(or.history.length>1){or.history.pop();const[r]=or.history.slice(-1);or.view=r}},setData(r){or.data=r}},we={WALLETCONNECT_DEEPLINK_CHOICE:"WALLETCONNECT_DEEPLINK_CHOICE",WCM_VERSION:"WCM_VERSION",RECOMMENDED_WALLET_AMOUNT:9,isMobile(){return typeof window<"u"?!!(window.matchMedia("(pointer:coarse)").matches||/Android|webOS|iPhone|iPad|iPod|BlackBerry|Opera Mini/u.test(navigator.userAgent)):!1},isAndroid(){return we.isMobile()&&navigator.userAgent.toLowerCase().includes("android")},isIos(){const r=navigator.userAgent.toLowerCase();return we.isMobile()&&(r.includes("iphone")||r.includes("ipad"))},isHttpUrl(r){return r.startsWith("http://")||r.startsWith("https://")},isArray(r){return Array.isArray(r)&&r.length>0},formatNativeUrl(r,e,t){if(we.isHttpUrl(r))return this.formatUniversalUrl(r,e,t);let n=r;n.includes("://")||(n=r.replaceAll("/","").replaceAll(":",""),n=`${n}://`),n.endsWith("/")||(n=`${n}/`),this.setWalletConnectDeepLink(n,t);const i=encodeURIComponent(e);return`${n}wc?uri=${i}`},formatUniversalUrl(r,e,t){if(!we.isHttpUrl(r))return this.formatNativeUrl(r,e,t);let n=r;n.endsWith("/")||(n=`${n}/`),this.setWalletConnectDeepLink(n,t);const i=encodeURIComponent(e);return`${n}wc?uri=${i}`},async wait(r){return new Promise(e=>{setTimeout(e,r)})},openHref(r,e){window.open(r,e,"noreferrer noopener")},setWalletConnectDeepLink(r,e){try{localStorage.setItem(we.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:r,name:e}))}catch{console.info("Unable to set WalletConnect deep link")}},setWalletConnectAndroidDeepLink(r){try{const[e]=r.split("?");localStorage.setItem(we.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:e,name:"Android"}))}catch{console.info("Unable to set WalletConnect android deep link")}},removeWalletConnectDeepLink(){try{localStorage.removeItem(we.WALLETCONNECT_DEEPLINK_CHOICE)}catch{console.info("Unable to remove WalletConnect deep link")}},setModalVersionInStorage(){try{typeof localStorage<"u"&&localStorage.setItem(we.WCM_VERSION,"2.6.2")}catch{console.info("Unable to set Web3Modal version in storage")}},getWalletRouterData(){var r;const e=(r=Pt.state.data)==null?void 0:r.Wallet;if(!e)throw new Error('Missing "Wallet" view data');return e}},Bx=typeof location<"u"&&(location.hostname.includes("localhost")||location.protocol.includes("https")),gr=li({enabled:Bx,userSessionId:"",events:[],connectedWalletId:void 0}),og={state:gr,subscribe(r){return zi(gr.events,()=>r(Fx(gr.events[gr.events.length-1])))},initialize(){gr.enabled&&typeof(crypto==null?void 0:crypto.randomUUID)<"u"&&(gr.userSessionId=crypto.randomUUID())},setConnectedWalletId(r){gr.connectedWalletId=r},click(r){if(gr.enabled){const e={type:"CLICK",name:r.name,userSessionId:gr.userSessionId,timestamp:Date.now(),data:r};gr.events.push(e)}},track(r){if(gr.enabled){const e={type:"TRACK",name:r.name,userSessionId:gr.userSessionId,timestamp:Date.now(),data:r};gr.events.push(e)}},view(r){if(gr.enabled){const e={type:"VIEW",name:r.name,userSessionId:gr.userSessionId,timestamp:Date.now(),data:r};gr.events.push(e)}}},In=li({chains:void 0,walletConnectUri:void 0,isAuth:!1,isCustomDesktop:!1,isCustomMobile:!1,isDataLoaded:!1,isUiLoaded:!1}),zt={state:In,subscribe(r){return zi(In,()=>r(In))},setChains(r){In.chains=r},setWalletConnectUri(r){In.walletConnectUri=r},setIsCustomDesktop(r){In.isCustomDesktop=r},setIsCustomMobile(r){In.isCustomMobile=r},setIsDataLoaded(r){In.isDataLoaded=r},setIsUiLoaded(r){In.isUiLoaded=r},setIsAuth(r){In.isAuth=r}},rc=li({projectId:"",mobileWallets:void 0,desktopWallets:void 0,walletImages:void 0,chains:void 0,enableAuthMode:!1,enableExplorer:!0,explorerExcludedWalletIds:void 0,explorerRecommendedWalletIds:void 0,termsOfServiceUrl:void 0,privacyPolicyUrl:void 0}),Kr={state:rc,subscribe(r){return zi(rc,()=>r(rc))},setConfig(r){var e,t;og.initialize(),zt.setChains(r.chains),zt.setIsAuth(!!r.enableAuthMode),zt.setIsCustomMobile(!!((e=r.mobileWallets)!=null&&e.length)),zt.setIsCustomDesktop(!!((t=r.desktopWallets)!=null&&t.length)),we.setModalVersionInStorage(),Object.assign(rc,r)}};var kx=Object.defineProperty,ag=Object.getOwnPropertySymbols,qx=Object.prototype.hasOwnProperty,zx=Object.prototype.propertyIsEnumerable,cg=(r,e,t)=>e in r?kx(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,Hx=(r,e)=>{for(var t in e||(e={}))qx.call(e,t)&&cg(r,t,e[t]);if(ag)for(var t of ag(e))zx.call(e,t)&&cg(r,t,e[t]);return r};const th="https://explorer-api.walletconnect.com",rh="wcm",nh="js-2.6.2";async function nc(r,e){const t=Hx({sdkType:rh,sdkVersion:nh},e),n=new URL(r,th);return n.searchParams.append("projectId",Kr.state.projectId),Object.entries(t).forEach(([i,a])=>{a&&n.searchParams.append(i,String(a))}),(await fetch(n)).json()}const Hi={async getDesktopListings(r){return nc("/w3m/v1/getDesktopListings",r)},async getMobileListings(r){return nc("/w3m/v1/getMobileListings",r)},async getInjectedListings(r){return nc("/w3m/v1/getInjectedListings",r)},async getAllListings(r){return nc("/w3m/v1/getAllListings",r)},getWalletImageUrl(r){return`${th}/w3m/v1/getWalletImage/${r}?projectId=${Kr.state.projectId}&sdkType=${rh}&sdkVersion=${nh}`},getAssetImageUrl(r){return`${th}/w3m/v1/getAssetImage/${r}?projectId=${Kr.state.projectId}&sdkType=${rh}&sdkVersion=${nh}`}};var Wx=Object.defineProperty,lg=Object.getOwnPropertySymbols,Kx=Object.prototype.hasOwnProperty,Vx=Object.prototype.propertyIsEnumerable,ug=(r,e,t)=>e in r?Wx(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,Gx=(r,e)=>{for(var t in e||(e={}))Kx.call(e,t)&&ug(r,t,e[t]);if(lg)for(var t of lg(e))Vx.call(e,t)&&ug(r,t,e[t]);return r};const hg=we.isMobile(),Dn=li({wallets:{listings:[],total:0,page:1},search:{listings:[],total:0,page:1},recomendedWallets:[]}),Lr={state:Dn,async getRecomendedWallets(){const{explorerRecommendedWalletIds:r,explorerExcludedWalletIds:e}=Kr.state;if(r==="NONE"||e==="ALL"&&!r)return Dn.recomendedWallets;if(we.isArray(r)){const t={recommendedIds:r.join(",")},{listings:n}=await Hi.getAllListings(t),i=Object.values(n);i.sort((a,c)=>{const u=r.indexOf(a.id),f=r.indexOf(c.id);return u-f}),Dn.recomendedWallets=i}else{const{chains:t,isAuth:n}=zt.state,i=t?.join(","),a=we.isArray(e),c={page:1,sdks:n?"auth_v1":void 0,entries:we.RECOMMENDED_WALLET_AMOUNT,chains:i,version:2,excludedIds:a?e.join(","):void 0},{listings:u}=hg?await Hi.getMobileListings(c):await Hi.getDesktopListings(c);Dn.recomendedWallets=Object.values(u)}return Dn.recomendedWallets},async getWallets(r){const e=Gx({},r),{explorerRecommendedWalletIds:t,explorerExcludedWalletIds:n}=Kr.state,{recomendedWallets:i}=Dn;if(n==="ALL")return Dn.wallets;i.length?e.excludedIds=i.map(w=>w.id).join(","):we.isArray(t)&&(e.excludedIds=t.join(",")),we.isArray(n)&&(e.excludedIds=[e.excludedIds,n].filter(Boolean).join(",")),zt.state.isAuth&&(e.sdks="auth_v1");const{page:a,search:c}=r,{listings:u,total:f}=hg?await Hi.getMobileListings(e):await Hi.getDesktopListings(e),h=Object.values(u),m=c?"search":"wallets";return Dn[m]={listings:[...Dn[m].listings,...h],total:f,page:a??1},{listings:h,total:f}},getWalletImageUrl(r){return Hi.getWalletImageUrl(r)},getAssetImageUrl(r){return Hi.getAssetImageUrl(r)},resetSearch(){Dn.search={listings:[],total:0,page:1}}},$s=li({open:!1}),Wi={state:$s,subscribe(r){return zi($s,()=>r($s))},async open(r){return new Promise(e=>{const{isUiLoaded:t,isDataLoaded:n}=zt.state;if(we.removeWalletConnectDeepLink(),zt.setWalletConnectUri(r?.uri),zt.setChains(r?.chains),Pt.reset("ConnectWallet"),t&&n)$s.open=!0,e();else{const i=setInterval(()=>{const a=zt.state;a.isUiLoaded&&a.isDataLoaded&&(clearInterval(i),$s.open=!0,e())},200)}})},close(){$s.open=!1}};var Yx=Object.defineProperty,fg=Object.getOwnPropertySymbols,Jx=Object.prototype.hasOwnProperty,Zx=Object.prototype.propertyIsEnumerable,dg=(r,e,t)=>e in r?Yx(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,Qx=(r,e)=>{for(var t in e||(e={}))Jx.call(e,t)&&dg(r,t,e[t]);if(fg)for(var t of fg(e))Zx.call(e,t)&&dg(r,t,e[t]);return r};function Xx(){return typeof matchMedia<"u"&&matchMedia("(prefers-color-scheme: dark)").matches}const jo=li({themeMode:Xx()?"dark":"light"}),ui={state:jo,subscribe(r){return zi(jo,()=>r(jo))},setThemeConfig(r){const{themeMode:e,themeVariables:t}=r;e&&(jo.themeMode=e),t&&(jo.themeVariables=Qx({},t))}},Ki=li({open:!1,message:"",variant:"success"}),hi={state:Ki,subscribe(r){return zi(Ki,()=>r(Ki))},openToast(r,e){Ki.open=!0,Ki.message=r,Ki.variant=e},closeToast(){Ki.open=!1}};class eI{constructor(e){this.openModal=Wi.open,this.closeModal=Wi.close,this.subscribeModal=Wi.subscribe,this.setTheme=ui.setThemeConfig,ui.setThemeConfig(e),Kr.setConfig(e),this.initUi()}async initUi(){if(typeof window<"u"){await Promise.resolve().then(function(){return lO});const e=document.createElement("wcm-modal");document.body.insertAdjacentElement("beforeend",e),zt.setIsUiLoaded(!0)}}}var tI=Object.freeze({__proto__:null,WalletConnectModal:eI});/**
86
86
  * @license
87
87
  * Copyright 2019 Google LLC
88
88
  * SPDX-License-Identifier: BSD-3-Clause
89
- */const sc=window,ih=sc.ShadowRoot&&(sc.ShadyCSS===void 0||sc.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,sh=Symbol(),dg=new WeakMap;class pg{constructor(e,t,n){if(this._$cssResult$=!0,n!==sh)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o;const t=this.t;if(ih&&e===void 0){const n=t!==void 0&&t.length===1;n&&(e=dg.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&dg.set(t,e))}return e}toString(){return this.cssText}}const eI=r=>new pg(typeof r=="string"?r:r+"",void 0,sh),lt=(r,...e)=>{const t=r.length===1?r[0]:e.reduce((n,i,a)=>n+(c=>{if(c._$cssResult$===!0)return c.cssText;if(typeof c=="number")return c;throw Error("Value passed to 'css' function must be a 'css' function result: "+c+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+r[a+1],r[0]);return new pg(t,r,sh)},tI=(r,e)=>{ih?r.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet):e.forEach(t=>{const n=document.createElement("style"),i=sc.litNonce;i!==void 0&&n.setAttribute("nonce",i),n.textContent=t.cssText,r.appendChild(n)})},gg=ih?r=>r:r=>r instanceof CSSStyleSheet?(e=>{let t="";for(const n of e.cssRules)t+=n.cssText;return eI(t)})(r):r;/**
89
+ */const ic=window,ih=ic.ShadowRoot&&(ic.ShadyCSS===void 0||ic.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,sh=Symbol(),pg=new WeakMap;class gg{constructor(e,t,n){if(this._$cssResult$=!0,n!==sh)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o;const t=this.t;if(ih&&e===void 0){const n=t!==void 0&&t.length===1;n&&(e=pg.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&pg.set(t,e))}return e}toString(){return this.cssText}}const rI=r=>new gg(typeof r=="string"?r:r+"",void 0,sh),lt=(r,...e)=>{const t=r.length===1?r[0]:e.reduce((n,i,a)=>n+(c=>{if(c._$cssResult$===!0)return c.cssText;if(typeof c=="number")return c;throw Error("Value passed to 'css' function must be a 'css' function result: "+c+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+r[a+1],r[0]);return new gg(t,r,sh)},nI=(r,e)=>{ih?r.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet):e.forEach(t=>{const n=document.createElement("style"),i=ic.litNonce;i!==void 0&&n.setAttribute("nonce",i),n.textContent=t.cssText,r.appendChild(n)})},mg=ih?r=>r:r=>r instanceof CSSStyleSheet?(e=>{let t="";for(const n of e.cssRules)t+=n.cssText;return rI(t)})(r):r;/**
90
90
  * @license
91
91
  * Copyright 2017 Google LLC
92
92
  * SPDX-License-Identifier: BSD-3-Clause
93
- */var oh;const oc=window,mg=oc.trustedTypes,rI=mg?mg.emptyScript:"",vg=oc.reactiveElementPolyfillSupport,ah={toAttribute(r,e){switch(e){case Boolean:r=r?rI:null;break;case Object:case Array:r=r==null?r:JSON.stringify(r)}return r},fromAttribute(r,e){let t=r;switch(e){case Boolean:t=r!==null;break;case Number:t=r===null?null:Number(r);break;case Object:case Array:try{t=JSON.parse(r)}catch{t=null}}return t}},wg=(r,e)=>e!==r&&(e==e||r==r),ch={attribute:!0,type:String,converter:ah,reflect:!1,hasChanged:wg},lh="finalized";class $s extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this._$Eu()}static addInitializer(e){var t;this.finalize(),((t=this.h)!==null&&t!==void 0?t:this.h=[]).push(e)}static get observedAttributes(){this.finalize();const e=[];return this.elementProperties.forEach((t,n)=>{const i=this._$Ep(n,t);i!==void 0&&(this._$Ev.set(i,n),e.push(i))}),e}static createProperty(e,t=ch){if(t.state&&(t.attribute=!1),this.finalize(),this.elementProperties.set(e,t),!t.noAccessor&&!this.prototype.hasOwnProperty(e)){const n=typeof e=="symbol"?Symbol():"__"+e,i=this.getPropertyDescriptor(e,n,t);i!==void 0&&Object.defineProperty(this.prototype,e,i)}}static getPropertyDescriptor(e,t,n){return{get(){return this[t]},set(i){const a=this[e];this[t]=i,this.requestUpdate(e,a,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)||ch}static finalize(){if(this.hasOwnProperty(lh))return!1;this[lh]=!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 t=this.properties,n=[...Object.getOwnPropertyNames(t),...Object.getOwnPropertySymbols(t)];for(const i of n)this.createProperty(i,t[i])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const n=new Set(e.flat(1/0).reverse());for(const i of n)t.unshift(gg(i))}else e!==void 0&&t.push(gg(e));return t}static _$Ep(e,t){const n=t.attribute;return n===!1?void 0:typeof n=="string"?n:typeof e=="string"?e.toLowerCase():void 0}_$Eu(){var e;this._$E_=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$Eg(),this.requestUpdate(),(e=this.constructor.h)===null||e===void 0||e.forEach(t=>t(this))}addController(e){var t,n;((t=this._$ES)!==null&&t!==void 0?t:this._$ES=[]).push(e),this.renderRoot!==void 0&&this.isConnected&&((n=e.hostConnected)===null||n===void 0||n.call(e))}removeController(e){var t;(t=this._$ES)===null||t===void 0||t.splice(this._$ES.indexOf(e)>>>0,1)}_$Eg(){this.constructor.elementProperties.forEach((e,t)=>{this.hasOwnProperty(t)&&(this._$Ei.set(t,this[t]),delete this[t])})}createRenderRoot(){var e;const t=(e=this.shadowRoot)!==null&&e!==void 0?e:this.attachShadow(this.constructor.shadowRootOptions);return tI(t,this.constructor.elementStyles),t}connectedCallback(){var e;this.renderRoot===void 0&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(e=this._$ES)===null||e===void 0||e.forEach(t=>{var n;return(n=t.hostConnected)===null||n===void 0?void 0:n.call(t)})}enableUpdating(e){}disconnectedCallback(){var e;(e=this._$ES)===null||e===void 0||e.forEach(t=>{var n;return(n=t.hostDisconnected)===null||n===void 0?void 0:n.call(t)})}attributeChangedCallback(e,t,n){this._$AK(e,n)}_$EO(e,t,n=ch){var i;const a=this.constructor._$Ep(e,n);if(a!==void 0&&n.reflect===!0){const c=(((i=n.converter)===null||i===void 0?void 0:i.toAttribute)!==void 0?n.converter:ah).toAttribute(t,n.type);this._$El=e,c==null?this.removeAttribute(a):this.setAttribute(a,c),this._$El=null}}_$AK(e,t){var n;const i=this.constructor,a=i._$Ev.get(e);if(a!==void 0&&this._$El!==a){const c=i.getPropertyOptions(a),u=typeof c.converter=="function"?{fromAttribute:c.converter}:((n=c.converter)===null||n===void 0?void 0:n.fromAttribute)!==void 0?c.converter:ah;this._$El=a,this[a]=u.fromAttribute(t,c.type),this._$El=null}}requestUpdate(e,t,n){let i=!0;e!==void 0&&(((n=n||this.constructor.getPropertyOptions(e)).hasChanged||wg)(this[e],t)?(this._$AL.has(e)||this._$AL.set(e,t),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(t){Promise.reject(t)}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,a)=>this[a]=i),this._$Ei=void 0);let t=!1;const n=this._$AL;try{t=this.shouldUpdate(n),t?(this.willUpdate(n),(e=this._$ES)===null||e===void 0||e.forEach(i=>{var a;return(a=i.hostUpdate)===null||a===void 0?void 0:a.call(i)}),this.update(n)):this._$Ek()}catch(i){throw t=!1,this._$Ek(),i}t&&this._$AE(n)}willUpdate(e){}_$AE(e){var t;(t=this._$ES)===null||t===void 0||t.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((t,n)=>this._$EO(n,this[n],t)),this._$EC=void 0),this._$Ek()}updated(e){}firstUpdated(e){}}$s[lh]=!0,$s.elementProperties=new Map,$s.elementStyles=[],$s.shadowRootOptions={mode:"open"},vg?.({ReactiveElement:$s}),((oh=oc.reactiveElementVersions)!==null&&oh!==void 0?oh:oc.reactiveElementVersions=[]).push("1.6.3");/**
93
+ */var oh;const sc=window,vg=sc.trustedTypes,iI=vg?vg.emptyScript:"",yg=sc.reactiveElementPolyfillSupport,ah={toAttribute(r,e){switch(e){case Boolean:r=r?iI:null;break;case Object:case Array:r=r==null?r:JSON.stringify(r)}return r},fromAttribute(r,e){let t=r;switch(e){case Boolean:t=r!==null;break;case Number:t=r===null?null:Number(r);break;case Object:case Array:try{t=JSON.parse(r)}catch{t=null}}return t}},wg=(r,e)=>e!==r&&(e==e||r==r),ch={attribute:!0,type:String,converter:ah,reflect:!1,hasChanged:wg},lh="finalized";class As extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this._$Eu()}static addInitializer(e){var t;this.finalize(),((t=this.h)!==null&&t!==void 0?t:this.h=[]).push(e)}static get observedAttributes(){this.finalize();const e=[];return this.elementProperties.forEach((t,n)=>{const i=this._$Ep(n,t);i!==void 0&&(this._$Ev.set(i,n),e.push(i))}),e}static createProperty(e,t=ch){if(t.state&&(t.attribute=!1),this.finalize(),this.elementProperties.set(e,t),!t.noAccessor&&!this.prototype.hasOwnProperty(e)){const n=typeof e=="symbol"?Symbol():"__"+e,i=this.getPropertyDescriptor(e,n,t);i!==void 0&&Object.defineProperty(this.prototype,e,i)}}static getPropertyDescriptor(e,t,n){return{get(){return this[t]},set(i){const a=this[e];this[t]=i,this.requestUpdate(e,a,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)||ch}static finalize(){if(this.hasOwnProperty(lh))return!1;this[lh]=!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 t=this.properties,n=[...Object.getOwnPropertyNames(t),...Object.getOwnPropertySymbols(t)];for(const i of n)this.createProperty(i,t[i])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const n=new Set(e.flat(1/0).reverse());for(const i of n)t.unshift(mg(i))}else e!==void 0&&t.push(mg(e));return t}static _$Ep(e,t){const n=t.attribute;return n===!1?void 0:typeof n=="string"?n:typeof e=="string"?e.toLowerCase():void 0}_$Eu(){var e;this._$E_=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$Eg(),this.requestUpdate(),(e=this.constructor.h)===null||e===void 0||e.forEach(t=>t(this))}addController(e){var t,n;((t=this._$ES)!==null&&t!==void 0?t:this._$ES=[]).push(e),this.renderRoot!==void 0&&this.isConnected&&((n=e.hostConnected)===null||n===void 0||n.call(e))}removeController(e){var t;(t=this._$ES)===null||t===void 0||t.splice(this._$ES.indexOf(e)>>>0,1)}_$Eg(){this.constructor.elementProperties.forEach((e,t)=>{this.hasOwnProperty(t)&&(this._$Ei.set(t,this[t]),delete this[t])})}createRenderRoot(){var e;const t=(e=this.shadowRoot)!==null&&e!==void 0?e:this.attachShadow(this.constructor.shadowRootOptions);return nI(t,this.constructor.elementStyles),t}connectedCallback(){var e;this.renderRoot===void 0&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(e=this._$ES)===null||e===void 0||e.forEach(t=>{var n;return(n=t.hostConnected)===null||n===void 0?void 0:n.call(t)})}enableUpdating(e){}disconnectedCallback(){var e;(e=this._$ES)===null||e===void 0||e.forEach(t=>{var n;return(n=t.hostDisconnected)===null||n===void 0?void 0:n.call(t)})}attributeChangedCallback(e,t,n){this._$AK(e,n)}_$EO(e,t,n=ch){var i;const a=this.constructor._$Ep(e,n);if(a!==void 0&&n.reflect===!0){const c=(((i=n.converter)===null||i===void 0?void 0:i.toAttribute)!==void 0?n.converter:ah).toAttribute(t,n.type);this._$El=e,c==null?this.removeAttribute(a):this.setAttribute(a,c),this._$El=null}}_$AK(e,t){var n;const i=this.constructor,a=i._$Ev.get(e);if(a!==void 0&&this._$El!==a){const c=i.getPropertyOptions(a),u=typeof c.converter=="function"?{fromAttribute:c.converter}:((n=c.converter)===null||n===void 0?void 0:n.fromAttribute)!==void 0?c.converter:ah;this._$El=a,this[a]=u.fromAttribute(t,c.type),this._$El=null}}requestUpdate(e,t,n){let i=!0;e!==void 0&&(((n=n||this.constructor.getPropertyOptions(e)).hasChanged||wg)(this[e],t)?(this._$AL.has(e)||this._$AL.set(e,t),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(t){Promise.reject(t)}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,a)=>this[a]=i),this._$Ei=void 0);let t=!1;const n=this._$AL;try{t=this.shouldUpdate(n),t?(this.willUpdate(n),(e=this._$ES)===null||e===void 0||e.forEach(i=>{var a;return(a=i.hostUpdate)===null||a===void 0?void 0:a.call(i)}),this.update(n)):this._$Ek()}catch(i){throw t=!1,this._$Ek(),i}t&&this._$AE(n)}willUpdate(e){}_$AE(e){var t;(t=this._$ES)===null||t===void 0||t.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((t,n)=>this._$EO(n,this[n],t)),this._$EC=void 0),this._$Ek()}updated(e){}firstUpdated(e){}}As[lh]=!0,As.elementProperties=new Map,As.elementStyles=[],As.shadowRootOptions={mode:"open"},yg?.({ReactiveElement:As}),((oh=sc.reactiveElementVersions)!==null&&oh!==void 0?oh:sc.reactiveElementVersions=[]).push("1.6.3");/**
94
94
  * @license
95
95
  * Copyright 2017 Google LLC
96
96
  * SPDX-License-Identifier: BSD-3-Clause
97
- */var uh;const ac=window,As=ac.trustedTypes,yg=As?As.createPolicy("lit-html",{createHTML:r=>r}):void 0,hh="$lit$",hi=`lit$${(Math.random()+"").slice(9)}$`,bg="?"+hi,nI=`<${bg}>`,Ki=document,Fo=()=>Ki.createComment(""),Bo=r=>r===null||typeof r!="object"&&typeof r!="function",_g=Array.isArray,iI=r=>_g(r)||typeof r?.[Symbol.iterator]=="function",fh=`[
98
- \f\r]`,ko=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Eg=/-->/g,xg=/>/g,Vi=RegExp(`>|${fh}(?:([^\\s"'>=/]+)(${fh}*=${fh}*(?:[^
99
- \f\r"'\`<>=]|("|')|))|$)`,"g"),Ig=/'/g,Dg=/"/g,Sg=/^(?:script|style|textarea|title)$/i,Og=r=>(e,...t)=>({_$litType$:r,strings:e,values:t}),ue=Og(1),Nt=Og(2),Gi=Symbol.for("lit-noChange"),tr=Symbol.for("lit-nothing"),Cg=new WeakMap,Yi=Ki.createTreeWalker(Ki,129,null,!1);function $g(r,e){if(!Array.isArray(r)||!r.hasOwnProperty("raw"))throw Error("invalid template strings array");return yg!==void 0?yg.createHTML(e):e}const sI=(r,e)=>{const t=r.length-1,n=[];let i,a=e===2?"<svg>":"",c=ko;for(let u=0;u<t;u++){const d=r[u];let h,m,y=-1,w=0;for(;w<d.length&&(c.lastIndex=w,m=c.exec(d),m!==null);)w=c.lastIndex,c===ko?m[1]==="!--"?c=Eg:m[1]!==void 0?c=xg:m[2]!==void 0?(Sg.test(m[2])&&(i=RegExp("</"+m[2],"g")),c=Vi):m[3]!==void 0&&(c=Vi):c===Vi?m[0]===">"?(c=i??ko,y=-1):m[1]===void 0?y=-2:(y=c.lastIndex-m[2].length,h=m[1],c=m[3]===void 0?Vi:m[3]==='"'?Dg:Ig):c===Dg||c===Ig?c=Vi:c===Eg||c===xg?c=ko:(c=Vi,i=void 0);const E=c===Vi&&r[u+1].startsWith("/>")?" ":"";a+=c===ko?d+nI:y>=0?(n.push(h),d.slice(0,y)+hh+d.slice(y)+hi+E):d+hi+(y===-2?(n.push(void 0),u):E)}return[$g(r,a+(r[t]||"<?>")+(e===2?"</svg>":"")),n]};class Ho{constructor({strings:e,_$litType$:t},n){let i;this.parts=[];let a=0,c=0;const u=e.length-1,d=this.parts,[h,m]=sI(e,t);if(this.el=Ho.createElement(h,n),Yi.currentNode=this.el.content,t===2){const y=this.el.content,w=y.firstChild;w.remove(),y.append(...w.childNodes)}for(;(i=Yi.nextNode())!==null&&d.length<u;){if(i.nodeType===1){if(i.hasAttributes()){const y=[];for(const w of i.getAttributeNames())if(w.endsWith(hh)||w.startsWith(hi)){const E=m[c++];if(y.push(w),E!==void 0){const I=i.getAttribute(E.toLowerCase()+hh).split(hi),T=/([.?@])?(.*)/.exec(E);d.push({type:1,index:a,name:T[2],strings:I,ctor:T[1]==="."?aI:T[1]==="?"?lI:T[1]==="@"?uI:cc})}else d.push({type:6,index:a})}for(const w of y)i.removeAttribute(w)}if(Sg.test(i.tagName)){const y=i.textContent.split(hi),w=y.length-1;if(w>0){i.textContent=As?As.emptyScript:"";for(let E=0;E<w;E++)i.append(y[E],Fo()),Yi.nextNode(),d.push({type:2,index:++a});i.append(y[w],Fo())}}}else if(i.nodeType===8)if(i.data===bg)d.push({type:2,index:a});else{let y=-1;for(;(y=i.data.indexOf(hi,y+1))!==-1;)d.push({type:7,index:a}),y+=hi.length-1}a++}}static createElement(e,t){const n=Ki.createElement("template");return n.innerHTML=e,n}}function Ps(r,e,t=r,n){var i,a,c,u;if(e===Gi)return e;let d=n!==void 0?(i=t._$Co)===null||i===void 0?void 0:i[n]:t._$Cl;const h=Bo(e)?void 0:e._$litDirective$;return d?.constructor!==h&&((a=d?._$AO)===null||a===void 0||a.call(d,!1),h===void 0?d=void 0:(d=new h(r),d._$AT(r,t,n)),n!==void 0?((c=(u=t)._$Co)!==null&&c!==void 0?c:u._$Co=[])[n]=d:t._$Cl=d),d!==void 0&&(e=Ps(r,d._$AS(r,e.values),d,n)),e}class oI{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){var t;const{el:{content:n},parts:i}=this._$AD,a=((t=e?.creationScope)!==null&&t!==void 0?t:Ki).importNode(n,!0);Yi.currentNode=a;let c=Yi.nextNode(),u=0,d=0,h=i[0];for(;h!==void 0;){if(u===h.index){let m;h.type===2?m=new zo(c,c.nextSibling,this,e):h.type===1?m=new h.ctor(c,h.name,h.strings,this,e):h.type===6&&(m=new hI(c,this,e)),this._$AV.push(m),h=i[++d]}u!==h?.index&&(c=Yi.nextNode(),u++)}return Yi.currentNode=Ki,a}v(e){let t=0;for(const n of this._$AV)n!==void 0&&(n.strings!==void 0?(n._$AI(e,n,t),t+=n.strings.length-2):n._$AI(e[t])),t++}}class zo{constructor(e,t,n,i){var a;this.type=2,this._$AH=tr,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=n,this.options=i,this._$Cp=(a=i?.isConnected)===null||a===void 0||a}get _$AU(){var e,t;return(t=(e=this._$AM)===null||e===void 0?void 0:e._$AU)!==null&&t!==void 0?t:this._$Cp}get parentNode(){let e=this._$AA.parentNode;const t=this._$AM;return t!==void 0&&e?.nodeType===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=Ps(this,e,t),Bo(e)?e===tr||e==null||e===""?(this._$AH!==tr&&this._$AR(),this._$AH=tr):e!==this._$AH&&e!==Gi&&this._(e):e._$litType$!==void 0?this.g(e):e.nodeType!==void 0?this.$(e):iI(e)?this.T(e):this._(e)}k(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}$(e){this._$AH!==e&&(this._$AR(),this._$AH=this.k(e))}_(e){this._$AH!==tr&&Bo(this._$AH)?this._$AA.nextSibling.data=e:this.$(Ki.createTextNode(e)),this._$AH=e}g(e){var t;const{values:n,_$litType$:i}=e,a=typeof i=="number"?this._$AC(e):(i.el===void 0&&(i.el=Ho.createElement($g(i.h,i.h[0]),this.options)),i);if(((t=this._$AH)===null||t===void 0?void 0:t._$AD)===a)this._$AH.v(n);else{const c=new oI(a,this),u=c.u(this.options);c.v(n),this.$(u),this._$AH=c}}_$AC(e){let t=Cg.get(e.strings);return t===void 0&&Cg.set(e.strings,t=new Ho(e)),t}T(e){_g(this._$AH)||(this._$AH=[],this._$AR());const t=this._$AH;let n,i=0;for(const a of e)i===t.length?t.push(n=new zo(this.k(Fo()),this.k(Fo()),this,this.options)):n=t[i],n._$AI(a),i++;i<t.length&&(this._$AR(n&&n._$AB.nextSibling,i),t.length=i)}_$AR(e=this._$AA.nextSibling,t){var n;for((n=this._$AP)===null||n===void 0||n.call(this,!1,!0,t);e&&e!==this._$AB;){const i=e.nextSibling;e.remove(),e=i}}setConnected(e){var t;this._$AM===void 0&&(this._$Cp=e,(t=this._$AP)===null||t===void 0||t.call(this,e))}}class cc{constructor(e,t,n,i,a){this.type=1,this._$AH=tr,this._$AN=void 0,this.element=e,this.name=t,this._$AM=i,this.options=a,n.length>2||n[0]!==""||n[1]!==""?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=tr}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(e,t=this,n,i){const a=this.strings;let c=!1;if(a===void 0)e=Ps(this,e,t,0),c=!Bo(e)||e!==this._$AH&&e!==Gi,c&&(this._$AH=e);else{const u=e;let d,h;for(e=a[0],d=0;d<a.length-1;d++)h=Ps(this,u[n+d],t,d),h===Gi&&(h=this._$AH[d]),c||(c=!Bo(h)||h!==this._$AH[d]),h===tr?e=tr:e!==tr&&(e+=(h??"")+a[d+1]),this._$AH[d]=h}c&&!i&&this.j(e)}j(e){e===tr?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}}class aI extends cc{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===tr?void 0:e}}const cI=As?As.emptyScript:"";class lI extends cc{constructor(){super(...arguments),this.type=4}j(e){e&&e!==tr?this.element.setAttribute(this.name,cI):this.element.removeAttribute(this.name)}}class uI extends cc{constructor(e,t,n,i,a){super(e,t,n,i,a),this.type=5}_$AI(e,t=this){var n;if((e=(n=Ps(this,e,t,0))!==null&&n!==void 0?n:tr)===Gi)return;const i=this._$AH,a=e===tr&&i!==tr||e.capture!==i.capture||e.once!==i.once||e.passive!==i.passive,c=e!==tr&&(i===tr||a);a&&this.element.removeEventListener(this.name,this,i),c&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){var t,n;typeof this._$AH=="function"?this._$AH.call((n=(t=this.options)===null||t===void 0?void 0:t.host)!==null&&n!==void 0?n:this.element,e):this._$AH.handleEvent(e)}}class hI{constructor(e,t,n){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=n}get _$AU(){return this._$AM._$AU}_$AI(e){Ps(this,e)}}const Ag=ac.litHtmlPolyfillSupport;Ag?.(Ho,zo),((uh=ac.litHtmlVersions)!==null&&uh!==void 0?uh:ac.litHtmlVersions=[]).push("2.8.0");const fI=(r,e,t)=>{var n,i;const a=(n=t?.renderBefore)!==null&&n!==void 0?n:e;let c=a._$litPart$;if(c===void 0){const u=(i=t?.renderBefore)!==null&&i!==void 0?i:null;a._$litPart$=c=new zo(e.insertBefore(Fo(),u),u,void 0,t??{})}return c._$AI(r),c};/**
97
+ */var uh;const oc=window,Ps=oc.trustedTypes,bg=Ps?Ps.createPolicy("lit-html",{createHTML:r=>r}):void 0,hh="$lit$",fi=`lit$${(Math.random()+"").slice(9)}$`,_g="?"+fi,sI=`<${_g}>`,Vi=document,Fo=()=>Vi.createComment(""),Bo=r=>r===null||typeof r!="object"&&typeof r!="function",Eg=Array.isArray,oI=r=>Eg(r)||typeof r?.[Symbol.iterator]=="function",fh=`[
98
+ \f\r]`,ko=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,xg=/-->/g,Ig=/>/g,Gi=RegExp(`>|${fh}(?:([^\\s"'>=/]+)(${fh}*=${fh}*(?:[^
99
+ \f\r"'\`<>=]|("|')|))|$)`,"g"),Dg=/'/g,Sg=/"/g,Cg=/^(?:script|style|textarea|title)$/i,Og=r=>(e,...t)=>({_$litType$:r,strings:e,values:t}),he=Og(1),Nt=Og(2),Yi=Symbol.for("lit-noChange"),tr=Symbol.for("lit-nothing"),$g=new WeakMap,Ji=Vi.createTreeWalker(Vi,129,null,!1);function Ag(r,e){if(!Array.isArray(r)||!r.hasOwnProperty("raw"))throw Error("invalid template strings array");return bg!==void 0?bg.createHTML(e):e}const aI=(r,e)=>{const t=r.length-1,n=[];let i,a=e===2?"<svg>":"",c=ko;for(let u=0;u<t;u++){const f=r[u];let h,m,w=-1,y=0;for(;y<f.length&&(c.lastIndex=y,m=c.exec(f),m!==null);)y=c.lastIndex,c===ko?m[1]==="!--"?c=xg:m[1]!==void 0?c=Ig:m[2]!==void 0?(Cg.test(m[2])&&(i=RegExp("</"+m[2],"g")),c=Gi):m[3]!==void 0&&(c=Gi):c===Gi?m[0]===">"?(c=i??ko,w=-1):m[1]===void 0?w=-2:(w=c.lastIndex-m[2].length,h=m[1],c=m[3]===void 0?Gi:m[3]==='"'?Sg:Dg):c===Sg||c===Dg?c=Gi:c===xg||c===Ig?c=ko:(c=Gi,i=void 0);const x=c===Gi&&r[u+1].startsWith("/>")?" ":"";a+=c===ko?f+sI:w>=0?(n.push(h),f.slice(0,w)+hh+f.slice(w)+fi+x):f+fi+(w===-2?(n.push(void 0),u):x)}return[Ag(r,a+(r[t]||"<?>")+(e===2?"</svg>":"")),n]};class qo{constructor({strings:e,_$litType$:t},n){let i;this.parts=[];let a=0,c=0;const u=e.length-1,f=this.parts,[h,m]=aI(e,t);if(this.el=qo.createElement(h,n),Ji.currentNode=this.el.content,t===2){const w=this.el.content,y=w.firstChild;y.remove(),w.append(...y.childNodes)}for(;(i=Ji.nextNode())!==null&&f.length<u;){if(i.nodeType===1){if(i.hasAttributes()){const w=[];for(const y of i.getAttributeNames())if(y.endsWith(hh)||y.startsWith(fi)){const x=m[c++];if(w.push(y),x!==void 0){const S=i.getAttribute(x.toLowerCase()+hh).split(fi),P=/([.?@])?(.*)/.exec(x);f.push({type:1,index:a,name:P[2],strings:S,ctor:P[1]==="."?lI:P[1]==="?"?hI:P[1]==="@"?fI:ac})}else f.push({type:6,index:a})}for(const y of w)i.removeAttribute(y)}if(Cg.test(i.tagName)){const w=i.textContent.split(fi),y=w.length-1;if(y>0){i.textContent=Ps?Ps.emptyScript:"";for(let x=0;x<y;x++)i.append(w[x],Fo()),Ji.nextNode(),f.push({type:2,index:++a});i.append(w[y],Fo())}}}else if(i.nodeType===8)if(i.data===_g)f.push({type:2,index:a});else{let w=-1;for(;(w=i.data.indexOf(fi,w+1))!==-1;)f.push({type:7,index:a}),w+=fi.length-1}a++}}static createElement(e,t){const n=Vi.createElement("template");return n.innerHTML=e,n}}function Ts(r,e,t=r,n){var i,a,c,u;if(e===Yi)return e;let f=n!==void 0?(i=t._$Co)===null||i===void 0?void 0:i[n]:t._$Cl;const h=Bo(e)?void 0:e._$litDirective$;return f?.constructor!==h&&((a=f?._$AO)===null||a===void 0||a.call(f,!1),h===void 0?f=void 0:(f=new h(r),f._$AT(r,t,n)),n!==void 0?((c=(u=t)._$Co)!==null&&c!==void 0?c:u._$Co=[])[n]=f:t._$Cl=f),f!==void 0&&(e=Ts(r,f._$AS(r,e.values),f,n)),e}class cI{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){var t;const{el:{content:n},parts:i}=this._$AD,a=((t=e?.creationScope)!==null&&t!==void 0?t:Vi).importNode(n,!0);Ji.currentNode=a;let c=Ji.nextNode(),u=0,f=0,h=i[0];for(;h!==void 0;){if(u===h.index){let m;h.type===2?m=new zo(c,c.nextSibling,this,e):h.type===1?m=new h.ctor(c,h.name,h.strings,this,e):h.type===6&&(m=new dI(c,this,e)),this._$AV.push(m),h=i[++f]}u!==h?.index&&(c=Ji.nextNode(),u++)}return Ji.currentNode=Vi,a}v(e){let t=0;for(const n of this._$AV)n!==void 0&&(n.strings!==void 0?(n._$AI(e,n,t),t+=n.strings.length-2):n._$AI(e[t])),t++}}class zo{constructor(e,t,n,i){var a;this.type=2,this._$AH=tr,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=n,this.options=i,this._$Cp=(a=i?.isConnected)===null||a===void 0||a}get _$AU(){var e,t;return(t=(e=this._$AM)===null||e===void 0?void 0:e._$AU)!==null&&t!==void 0?t:this._$Cp}get parentNode(){let e=this._$AA.parentNode;const t=this._$AM;return t!==void 0&&e?.nodeType===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=Ts(this,e,t),Bo(e)?e===tr||e==null||e===""?(this._$AH!==tr&&this._$AR(),this._$AH=tr):e!==this._$AH&&e!==Yi&&this._(e):e._$litType$!==void 0?this.g(e):e.nodeType!==void 0?this.$(e):oI(e)?this.T(e):this._(e)}k(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}$(e){this._$AH!==e&&(this._$AR(),this._$AH=this.k(e))}_(e){this._$AH!==tr&&Bo(this._$AH)?this._$AA.nextSibling.data=e:this.$(Vi.createTextNode(e)),this._$AH=e}g(e){var t;const{values:n,_$litType$:i}=e,a=typeof i=="number"?this._$AC(e):(i.el===void 0&&(i.el=qo.createElement(Ag(i.h,i.h[0]),this.options)),i);if(((t=this._$AH)===null||t===void 0?void 0:t._$AD)===a)this._$AH.v(n);else{const c=new cI(a,this),u=c.u(this.options);c.v(n),this.$(u),this._$AH=c}}_$AC(e){let t=$g.get(e.strings);return t===void 0&&$g.set(e.strings,t=new qo(e)),t}T(e){Eg(this._$AH)||(this._$AH=[],this._$AR());const t=this._$AH;let n,i=0;for(const a of e)i===t.length?t.push(n=new zo(this.k(Fo()),this.k(Fo()),this,this.options)):n=t[i],n._$AI(a),i++;i<t.length&&(this._$AR(n&&n._$AB.nextSibling,i),t.length=i)}_$AR(e=this._$AA.nextSibling,t){var n;for((n=this._$AP)===null||n===void 0||n.call(this,!1,!0,t);e&&e!==this._$AB;){const i=e.nextSibling;e.remove(),e=i}}setConnected(e){var t;this._$AM===void 0&&(this._$Cp=e,(t=this._$AP)===null||t===void 0||t.call(this,e))}}class ac{constructor(e,t,n,i,a){this.type=1,this._$AH=tr,this._$AN=void 0,this.element=e,this.name=t,this._$AM=i,this.options=a,n.length>2||n[0]!==""||n[1]!==""?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=tr}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(e,t=this,n,i){const a=this.strings;let c=!1;if(a===void 0)e=Ts(this,e,t,0),c=!Bo(e)||e!==this._$AH&&e!==Yi,c&&(this._$AH=e);else{const u=e;let f,h;for(e=a[0],f=0;f<a.length-1;f++)h=Ts(this,u[n+f],t,f),h===Yi&&(h=this._$AH[f]),c||(c=!Bo(h)||h!==this._$AH[f]),h===tr?e=tr:e!==tr&&(e+=(h??"")+a[f+1]),this._$AH[f]=h}c&&!i&&this.j(e)}j(e){e===tr?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}}class lI extends ac{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===tr?void 0:e}}const uI=Ps?Ps.emptyScript:"";class hI extends ac{constructor(){super(...arguments),this.type=4}j(e){e&&e!==tr?this.element.setAttribute(this.name,uI):this.element.removeAttribute(this.name)}}class fI extends ac{constructor(e,t,n,i,a){super(e,t,n,i,a),this.type=5}_$AI(e,t=this){var n;if((e=(n=Ts(this,e,t,0))!==null&&n!==void 0?n:tr)===Yi)return;const i=this._$AH,a=e===tr&&i!==tr||e.capture!==i.capture||e.once!==i.once||e.passive!==i.passive,c=e!==tr&&(i===tr||a);a&&this.element.removeEventListener(this.name,this,i),c&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){var t,n;typeof this._$AH=="function"?this._$AH.call((n=(t=this.options)===null||t===void 0?void 0:t.host)!==null&&n!==void 0?n:this.element,e):this._$AH.handleEvent(e)}}class dI{constructor(e,t,n){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=n}get _$AU(){return this._$AM._$AU}_$AI(e){Ts(this,e)}}const Pg=oc.litHtmlPolyfillSupport;Pg?.(qo,zo),((uh=oc.litHtmlVersions)!==null&&uh!==void 0?uh:oc.litHtmlVersions=[]).push("2.8.0");const pI=(r,e,t)=>{var n,i;const a=(n=t?.renderBefore)!==null&&n!==void 0?n:e;let c=a._$litPart$;if(c===void 0){const u=(i=t?.renderBefore)!==null&&i!==void 0?i:null;a._$litPart$=c=new zo(e.insertBefore(Fo(),u),u,void 0,t??{})}return c._$AI(r),c};/**
100
100
  * @license
101
101
  * Copyright 2017 Google LLC
102
102
  * SPDX-License-Identifier: BSD-3-Clause
103
- */var dh,ph;class Ye extends $s{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var e,t;const n=super.createRenderRoot();return(e=(t=this.renderOptions).renderBefore)!==null&&e!==void 0||(t.renderBefore=n.firstChild),n}update(e){const t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=fI(t,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 Gi}}Ye.finalized=!0,Ye._$litElement$=!0,(dh=globalThis.litElementHydrateSupport)===null||dh===void 0||dh.call(globalThis,{LitElement:Ye});const Pg=globalThis.litElementPolyfillSupport;Pg?.({LitElement:Ye}),((ph=globalThis.litElementVersions)!==null&&ph!==void 0?ph:globalThis.litElementVersions=[]).push("3.3.3");/**
103
+ */var dh,ph;class Ye extends As{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var e,t;const n=super.createRenderRoot();return(e=(t=this.renderOptions).renderBefore)!==null&&e!==void 0||(t.renderBefore=n.firstChild),n}update(e){const t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=pI(t,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 Yi}}Ye.finalized=!0,Ye._$litElement$=!0,(dh=globalThis.litElementHydrateSupport)===null||dh===void 0||dh.call(globalThis,{LitElement:Ye});const Tg=globalThis.litElementPolyfillSupport;Tg?.({LitElement:Ye}),((ph=globalThis.litElementVersions)!==null&&ph!==void 0?ph:globalThis.litElementVersions=[]).push("3.3.3");/**
104
104
  * @license
105
105
  * Copyright 2017 Google LLC
106
106
  * SPDX-License-Identifier: BSD-3-Clause
@@ -108,7 +108,7 @@ function print() { __p += __j.call(arguments, '') }
108
108
  * @license
109
109
  * Copyright 2017 Google LLC
110
110
  * SPDX-License-Identifier: BSD-3-Clause
111
- */const dI=(r,e)=>e.kind==="method"&&e.descriptor&&!("value"in e.descriptor)?{...e,finisher(t){t.createProperty(e.key,r)}}:{kind:"field",key:Symbol(),placement:"own",descriptor:{},originalKey:e.key,initializer(){typeof e.initializer=="function"&&(this[e.key]=e.initializer.call(this))},finisher(t){t.createProperty(e.key,r)}},pI=(r,e,t)=>{e.constructor.createProperty(t,r)};function Be(r){return(e,t)=>t!==void 0?pI(r,e,t):dI(r,e)}/**
111
+ */const gI=(r,e)=>e.kind==="method"&&e.descriptor&&!("value"in e.descriptor)?{...e,finisher(t){t.createProperty(e.key,r)}}:{kind:"field",key:Symbol(),placement:"own",descriptor:{},originalKey:e.key,initializer(){typeof e.initializer=="function"&&(this[e.key]=e.initializer.call(this))},finisher(t){t.createProperty(e.key,r)}},mI=(r,e,t)=>{e.constructor.createProperty(t,r)};function Be(r){return(e,t)=>t!==void 0?mI(r,e,t):gI(r,e)}/**
112
112
  * @license
113
113
  * Copyright 2017 Google LLC
114
114
  * SPDX-License-Identifier: BSD-3-Clause
@@ -120,20 +120,20 @@ function print() { __p += __j.call(arguments, '') }
120
120
  * @license
121
121
  * Copyright 2017 Google LLC
122
122
  * SPDX-License-Identifier: BSD-3-Clause
123
- */const gI={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},mI=r=>(...e)=>({_$litDirective$:r,values:e});class vI{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,t,n){this._$Ct=e,this._$AM=t,this._$Ci=n}_$AS(e,t){return this.update(e,t)}update(e,t){return this.render(...t)}}/**
123
+ */const vI={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},yI=r=>(...e)=>({_$litDirective$:r,values:e});class wI{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,t,n){this._$Ct=e,this._$AM=t,this._$Ci=n}_$AS(e,t){return this.update(e,t)}update(e,t){return this.render(...t)}}/**
124
124
  * @license
125
125
  * Copyright 2018 Google LLC
126
126
  * SPDX-License-Identifier: BSD-3-Clause
127
- */const kn=mI(class extends vI{constructor(r){var e;if(super(r),r.type!==gI.ATTRIBUTE||r.name!=="class"||((e=r.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(r){return" "+Object.keys(r).filter(e=>r[e]).join(" ")+" "}update(r,[e]){var t,n;if(this.it===void 0){this.it=new Set,r.strings!==void 0&&(this.nt=new Set(r.strings.join(" ").split(/\s/).filter(a=>a!=="")));for(const a in e)e[a]&&!(!((t=this.nt)===null||t===void 0)&&t.has(a))&&this.it.add(a);return this.render(e)}const i=r.element.classList;this.it.forEach(a=>{a in e||(i.remove(a),this.it.delete(a))});for(const a in e){const c=!!e[a];c===this.it.has(a)||!((n=this.nt)===null||n===void 0)&&n.has(a)||(c?(i.add(a),this.it.add(a)):(i.remove(a),this.it.delete(a)))}return Gi}});function wI(r,e){r.indexOf(e)===-1&&r.push(e)}const Tg=(r,e,t)=>Math.min(Math.max(t,r),e),en={duration:.3,delay:0,endDelay:0,repeat:0,easing:"ease"},lc=r=>typeof r=="number",Ts=r=>Array.isArray(r)&&!lc(r[0]),yI=(r,e,t)=>{const n=e-r;return((t-r)%n+n)%n+r};function bI(r,e){return Ts(r)?r[yI(0,r.length,e)]:r}const Rg=(r,e,t)=>-t*r+t*e+r,Ng=()=>{},fi=r=>r,mh=(r,e,t)=>e-r===0?1:(t-r)/(e-r);function Lg(r,e){const t=r[r.length-1];for(let n=1;n<=e;n++){const i=mh(0,e,n);r.push(Rg(t,1,i))}}function _I(r){const e=[0];return Lg(e,r-1),e}function EI(r,e=_I(r.length),t=fi){const n=r.length,i=n-e.length;return i>0&&Lg(e,i),a=>{let c=0;for(;c<n-2&&!(a<e[c+1]);c++);let u=Tg(0,1,mh(e[c],e[c+1],a));return u=bI(t,c)(u),Rg(r[c],r[c+1],u)}}const Mg=r=>Array.isArray(r)&&lc(r[0]),vh=r=>typeof r=="object"&&!!r.createAnimation,Ji=r=>typeof r=="function",xI=r=>typeof r=="string",qo={ms:r=>r*1e3,s:r=>r/1e3},Ug=(r,e,t)=>(((1-3*t+3*e)*r+(3*t-6*e))*r+3*e)*r,II=1e-7,DI=12;function SI(r,e,t,n,i){let a,c,u=0;do c=e+(t-e)/2,a=Ug(c,n,i)-r,a>0?t=c:e=c;while(Math.abs(a)>II&&++u<DI);return c}function Wo(r,e,t,n){if(r===e&&t===n)return fi;const i=a=>SI(a,0,1,r,t);return a=>a===0||a===1?a:Ug(i(a),e,n)}const OI=(r,e="end")=>t=>{t=e==="end"?Math.min(t,.999):Math.max(t,.001);const n=t*r,i=e==="end"?Math.floor(n):Math.ceil(n);return Tg(0,1,i/r)},jg={ease:Wo(.25,.1,.25,1),"ease-in":Wo(.42,0,1,1),"ease-in-out":Wo(.42,0,.58,1),"ease-out":Wo(0,0,.58,1)},CI=/\((.*?)\)/;function Fg(r){if(Ji(r))return r;if(Mg(r))return Wo(...r);if(jg[r])return jg[r];if(r.startsWith("steps")){const e=CI.exec(r);if(e){const t=e[1].split(",");return OI(parseFloat(t[0]),t[1].trim())}}return fi}class Bg{constructor(e,t=[0,1],{easing:n,duration:i=en.duration,delay:a=en.delay,endDelay:c=en.endDelay,repeat:u=en.repeat,offset:d,direction:h="normal"}={}){if(this.startTime=null,this.rate=1,this.t=0,this.cancelTimestamp=null,this.easing=fi,this.duration=0,this.totalDuration=0,this.repeat=0,this.playState="idle",this.finished=new Promise((y,w)=>{this.resolve=y,this.reject=w}),n=n||en.easing,vh(n)){const y=n.createAnimation(t);n=y.easing,t=y.keyframes||t,i=y.duration||i}this.repeat=u,this.easing=Ts(n)?fi:Fg(n),this.updateDuration(i);const m=EI(t,d,Ts(n)?n.map(Fg):fi);this.tick=y=>{var w;a=a;let E=0;this.pauseTime!==void 0?E=this.pauseTime:E=(y-this.startTime)*this.rate,this.t=E,E/=1e3,E=Math.max(E-a,0),this.playState==="finished"&&this.pauseTime===void 0&&(E=this.totalDuration);const I=E/this.duration;let T=Math.floor(I),U=I%1;!U&&I>=1&&(U=1),U===1&&T--;const F=T%2;(h==="reverse"||h==="alternate"&&F||h==="alternate-reverse"&&!F)&&(U=1-U);const $=E>=this.totalDuration?1:Math.min(U,1),P=m(this.easing($));e(P),this.pauseTime===void 0&&(this.playState==="finished"||E>=this.totalDuration+c)?(this.playState="finished",(w=this.resolve)===null||w===void 0||w.call(this,P)):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 wh=function(){};process.env.NODE_ENV!=="production"&&(wh=function(r,e){if(!r)throw new Error(e)});class $I{setAnimation(e){this.animation=e,e?.finished.then(()=>this.clearAnimation()).catch(()=>{})}clearAnimation(){this.animation=this.generator=void 0}}const yh=new WeakMap;function kg(r){return yh.has(r)||yh.set(r,{transforms:[],values:new Map}),yh.get(r)}function AI(r,e){return r.has(e)||r.set(e,new $I),r.get(e)}const PI=["","X","Y","Z"],TI=["translate","scale","rotate","skew"],uc={x:"translateX",y:"translateY",z:"translateZ"},Hg={syntax:"<angle>",initialValue:"0deg",toDefaultUnit:r=>r+"deg"},RI={translate:{syntax:"<length-percentage>",initialValue:"0px",toDefaultUnit:r=>r+"px"},rotate:Hg,scale:{syntax:"<number>",initialValue:1,toDefaultUnit:fi},skew:Hg},Ko=new Map,bh=r=>`--motion-${r}`,hc=["x","y","z"];TI.forEach(r=>{PI.forEach(e=>{hc.push(r+e),Ko.set(bh(r+e),RI[r])})});const NI=(r,e)=>hc.indexOf(r)-hc.indexOf(e),LI=new Set(hc),zg=r=>LI.has(r),MI=(r,e)=>{uc[e]&&(e=uc[e]);const{transforms:t}=kg(r);wI(t,e),r.style.transform=UI(t)},UI=r=>r.sort(NI).reduce(jI,"").trim(),jI=(r,e)=>`${r} ${e}(var(${bh(e)}))`,_h=r=>r.startsWith("--"),qg=new Set;function FI(r){if(!qg.has(r)){qg.add(r);try{const{syntax:e,initialValue:t}=Ko.has(r)?Ko.get(r):{};CSS.registerProperty({name:r,inherits:!1,syntax:e,initialValue:t})}catch{}}}const Eh=(r,e)=>document.createElement("div").animate(r,e),Wg={cssRegisterProperty:()=>typeof CSS<"u"&&Object.hasOwnProperty.call(CSS,"registerProperty"),waapi:()=>Object.hasOwnProperty.call(Element.prototype,"animate"),partialKeyframes:()=>{try{Eh({opacity:[1]})}catch{return!1}return!0},finished:()=>!!Eh({opacity:[0,1]},{duration:.001}).finished,linearEasing:()=>{try{Eh({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0}},xh={},Rs={};for(const r in Wg)Rs[r]=()=>(xh[r]===void 0&&(xh[r]=Wg[r]()),xh[r]);const BI=.015,kI=(r,e)=>{let t="";const n=Math.round(e/BI);for(let i=0;i<n;i++)t+=r(mh(0,n-1,i))+", ";return t.substring(0,t.length-2)},Kg=(r,e)=>Ji(r)?Rs.linearEasing()?`linear(${kI(r,e)})`:en.easing:Mg(r)?HI(r):r,HI=([r,e,t,n])=>`cubic-bezier(${r}, ${e}, ${t}, ${n})`;function zI(r,e){for(let t=0;t<r.length;t++)r[t]===null&&(r[t]=t?r[t-1]:e());return r}const qI=r=>Array.isArray(r)?r:[r];function Ih(r){return uc[r]&&(r=uc[r]),zg(r)?bh(r):r}const fc={get:(r,e)=>{e=Ih(e);let t=_h(e)?r.style.getPropertyValue(e):getComputedStyle(r)[e];if(!t&&t!==0){const n=Ko.get(e);n&&(t=n.initialValue)}return t},set:(r,e,t)=>{e=Ih(e),_h(e)?r.style.setProperty(e,t):r.style[e]=t}};function Vg(r,e=!0){if(!(!r||r.playState==="finished"))try{r.stop?r.stop():(e&&r.commitStyles(),r.cancel())}catch{}}function WI(r,e){var t;let n=e?.toDefaultUnit||fi;const i=r[r.length-1];if(xI(i)){const a=((t=i.match(/(-?[\d.]+)([a-z%]*)/))===null||t===void 0?void 0:t[2])||"";a&&(n=c=>c+a)}return n}function KI(){return window.__MOTION_DEV_TOOLS_RECORD}function VI(r,e,t,n={},i){const a=KI(),c=n.record!==!1&&a;let u,{duration:d=en.duration,delay:h=en.delay,endDelay:m=en.endDelay,repeat:y=en.repeat,easing:w=en.easing,persist:E=!1,direction:I,offset:T,allowWebkitAcceleration:U=!1}=n;const F=kg(r),$=zg(e);let P=Rs.waapi();$&&MI(r,e);const O=Ih(e),A=AI(F.values,O),x=Ko.get(O);return Vg(A.animation,!(vh(w)&&A.generator)&&n.record!==!1),()=>{const f=()=>{var j,V;return(V=(j=fc.get(r,O))!==null&&j!==void 0?j:x?.initialValue)!==null&&V!==void 0?V:0};let b=zI(qI(t),f);const q=WI(b,x);if(vh(w)){const j=w.createAnimation(b,e!=="opacity",f,O,A);w=j.easing,b=j.keyframes||b,d=j.duration||d}if(_h(O)&&(Rs.cssRegisterProperty()?FI(O):P=!1),$&&!Rs.linearEasing()&&(Ji(w)||Ts(w)&&w.some(Ji))&&(P=!1),P){x&&(b=b.map(se=>lc(se)?x.toDefaultUnit(se):se)),b.length===1&&(!Rs.partialKeyframes()||c)&&b.unshift(f());const j={delay:qo.ms(h),duration:qo.ms(d),endDelay:qo.ms(m),easing:Ts(w)?void 0:Kg(w,d),direction:I,iterations:y+1,fill:"both"};u=r.animate({[O]:b,offset:T,easing:Ts(w)?w.map(se=>Kg(se,d)):void 0},j),u.finished||(u.finished=new Promise((se,ce)=>{u.onfinish=se,u.oncancel=ce}));const V=b[b.length-1];u.finished.then(()=>{E||(fc.set(r,O,V),u.cancel())}).catch(Ng),U||(u.playbackRate=1.000001)}else if(i&&$)b=b.map(j=>typeof j=="string"?parseFloat(j):j),b.length===1&&b.unshift(parseFloat(f())),u=new i(j=>{fc.set(r,O,q?q(j):j)},b,Object.assign(Object.assign({},n),{duration:d,easing:w}));else{const j=b[b.length-1];fc.set(r,O,x&&lc(j)?x.toDefaultUnit(j):j)}return c&&a(r,e,b,{duration:d,delay:h,easing:w,repeat:y,offset:T},"motion-one"),A.setAnimation(u),u}}const GI=(r,e)=>r[e]?Object.assign(Object.assign({},r),r[e]):Object.assign({},r);function Gg(r,e){var t;return typeof r=="string"?e?((t=e[r])!==null&&t!==void 0||(e[r]=document.querySelectorAll(r)),r=e[r]):r=document.querySelectorAll(r):r instanceof Element&&(r=[r]),Array.from(r||[])}const YI=r=>r(),Yg=(r,e,t=en.duration)=>new Proxy({animations:r.map(YI).filter(Boolean),duration:t,options:e},ZI),JI=r=>r.animations[0],ZI={get:(r,e)=>{const t=JI(r);switch(e){case"duration":return r.duration;case"currentTime":return qo.s(t?.[e]||0);case"playbackRate":case"playState":return t?.[e];case"finished":return r.finished||(r.finished=Promise.all(r.animations.map(QI)).catch(Ng)),r.finished;case"stop":return()=>{r.animations.forEach(n=>Vg(n))};case"forEachNative":return n=>{r.animations.forEach(i=>n(i,r))};default:return typeof t?.[e]>"u"?void 0:()=>r.animations.forEach(n=>n[e]())}},set:(r,e,t)=>{switch(e){case"currentTime":t=qo.ms(t);case"playbackRate":for(let n=0;n<r.animations.length;n++)r.animations[n][e]=t;return!0}return!1}},QI=r=>r.finished;function XI(r,e,t){return Ji(r)?r(e,t):r}function eD(r){return function(t,n,i={}){t=Gg(t);const a=t.length;wh(!!a,"No valid element provided."),wh(!!n,"No keyframes defined.");const c=[];for(let u=0;u<a;u++){const d=t[u];for(const h in n){const m=GI(i,h);m.delay=XI(m.delay,u,a);const y=VI(d,h,n[h],m,r);c.push(y)}}return Yg(c,i,i.duration)}}const tD=eD(Bg);function rD(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(t[n[i]]=r[n[i]]);return t}typeof SuppressedError=="function"&&SuppressedError;const nD={any:0,all:1};function iD(r,e,{root:t,margin:n,amount:i="any"}={}){if(typeof IntersectionObserver>"u")return()=>{};const a=Gg(r),c=new WeakMap,u=h=>{h.forEach(m=>{const y=c.get(m.target);if(m.isIntersecting!==!!y)if(m.isIntersecting){const w=e(m);Ji(w)?c.set(m.target,w):d.unobserve(m.target)}else y&&(y(m),c.delete(m.target))})},d=new IntersectionObserver(u,{root:t,rootMargin:n,threshold:typeof i=="number"?i:nD[i]});return a.forEach(h=>d.observe(h)),()=>d.disconnect()}function Dh(r,e,t){r.dispatchEvent(new CustomEvent(e,{detail:{originalEvent:t}}))}function Jg(r,e,t){r.dispatchEvent(new CustomEvent(e,{detail:{originalEntry:t}}))}const sD={isActive:r=>!!r.inView,subscribe:(r,{enable:e,disable:t},{inViewOptions:n={}})=>{const{once:i}=n,a=rD(n,["once"]);return iD(r,c=>{if(e(),Jg(r,"viewenter",c),!i)return u=>{t(),Jg(r,"viewleave",u)}},a)}},Zg=(r,e,t)=>n=>{n.pointerType&&n.pointerType!=="mouse"||(t(),Dh(r,e,n))};[...Object.keys({inView:sD,hover:{isActive:r=>!!r.hover,subscribe:(r,{enable:e,disable:t})=>{const n=Zg(r,"hoverstart",e),i=Zg(r,"hoverend",t);return r.addEventListener("pointerenter",n),r.addEventListener("pointerleave",i),()=>{r.removeEventListener("pointerenter",n),r.removeEventListener("pointerleave",i)}}},press:{isActive:r=>!!r.press,subscribe:(r,{enable:e,disable:t})=>{const n=a=>{t(),Dh(r,"pressend",a),window.removeEventListener("pointerup",n)},i=a=>{e(),Dh(r,"pressstart",a),window.addEventListener("pointerup",n)};return r.addEventListener("pointerdown",i),()=>{r.removeEventListener("pointerdown",i),window.removeEventListener("pointerup",n)}}}})];function oD(r,e={}){return Yg([()=>{const t=new Bg(r,[0,1],e);return t.finished.catch(()=>{}),t}],e,e.duration)}function Zi(r,e,t){return(Ji(r)?oD:tD)(r,e,t)}/**
127
+ */const qn=yI(class extends wI{constructor(r){var e;if(super(r),r.type!==vI.ATTRIBUTE||r.name!=="class"||((e=r.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(r){return" "+Object.keys(r).filter(e=>r[e]).join(" ")+" "}update(r,[e]){var t,n;if(this.it===void 0){this.it=new Set,r.strings!==void 0&&(this.nt=new Set(r.strings.join(" ").split(/\s/).filter(a=>a!=="")));for(const a in e)e[a]&&!(!((t=this.nt)===null||t===void 0)&&t.has(a))&&this.it.add(a);return this.render(e)}const i=r.element.classList;this.it.forEach(a=>{a in e||(i.remove(a),this.it.delete(a))});for(const a in e){const c=!!e[a];c===this.it.has(a)||!((n=this.nt)===null||n===void 0)&&n.has(a)||(c?(i.add(a),this.it.add(a)):(i.remove(a),this.it.delete(a)))}return Yi}});function bI(r,e){r.indexOf(e)===-1&&r.push(e)}const Rg=(r,e,t)=>Math.min(Math.max(t,r),e),tn={duration:.3,delay:0,endDelay:0,repeat:0,easing:"ease"},cc=r=>typeof r=="number",Rs=r=>Array.isArray(r)&&!cc(r[0]),_I=(r,e,t)=>{const n=e-r;return((t-r)%n+n)%n+r};function EI(r,e){return Rs(r)?r[_I(0,r.length,e)]:r}const Ng=(r,e,t)=>-t*r+t*e+r,Lg=()=>{},di=r=>r,mh=(r,e,t)=>e-r===0?1:(t-r)/(e-r);function Mg(r,e){const t=r[r.length-1];for(let n=1;n<=e;n++){const i=mh(0,e,n);r.push(Ng(t,1,i))}}function xI(r){const e=[0];return Mg(e,r-1),e}function II(r,e=xI(r.length),t=di){const n=r.length,i=n-e.length;return i>0&&Mg(e,i),a=>{let c=0;for(;c<n-2&&!(a<e[c+1]);c++);let u=Rg(0,1,mh(e[c],e[c+1],a));return u=EI(t,c)(u),Ng(r[c],r[c+1],u)}}const Ug=r=>Array.isArray(r)&&cc(r[0]),vh=r=>typeof r=="object"&&!!r.createAnimation,Zi=r=>typeof r=="function",DI=r=>typeof r=="string",Ho={ms:r=>r*1e3,s:r=>r/1e3},jg=(r,e,t)=>(((1-3*t+3*e)*r+(3*t-6*e))*r+3*e)*r,SI=1e-7,CI=12;function OI(r,e,t,n,i){let a,c,u=0;do c=e+(t-e)/2,a=jg(c,n,i)-r,a>0?t=c:e=c;while(Math.abs(a)>SI&&++u<CI);return c}function Wo(r,e,t,n){if(r===e&&t===n)return di;const i=a=>OI(a,0,1,r,t);return a=>a===0||a===1?a:jg(i(a),e,n)}const $I=(r,e="end")=>t=>{t=e==="end"?Math.min(t,.999):Math.max(t,.001);const n=t*r,i=e==="end"?Math.floor(n):Math.ceil(n);return Rg(0,1,i/r)},Fg={ease:Wo(.25,.1,.25,1),"ease-in":Wo(.42,0,1,1),"ease-in-out":Wo(.42,0,.58,1),"ease-out":Wo(0,0,.58,1)},AI=/\((.*?)\)/;function Bg(r){if(Zi(r))return r;if(Ug(r))return Wo(...r);if(Fg[r])return Fg[r];if(r.startsWith("steps")){const e=AI.exec(r);if(e){const t=e[1].split(",");return $I(parseFloat(t[0]),t[1].trim())}}return di}class kg{constructor(e,t=[0,1],{easing:n,duration:i=tn.duration,delay:a=tn.delay,endDelay:c=tn.endDelay,repeat:u=tn.repeat,offset:f,direction:h="normal"}={}){if(this.startTime=null,this.rate=1,this.t=0,this.cancelTimestamp=null,this.easing=di,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||tn.easing,vh(n)){const w=n.createAnimation(t);n=w.easing,t=w.keyframes||t,i=w.duration||i}this.repeat=u,this.easing=Rs(n)?di:Bg(n),this.updateDuration(i);const m=II(t,f,Rs(n)?n.map(Bg):di);this.tick=w=>{var y;a=a;let x=0;this.pauseTime!==void 0?x=this.pauseTime:x=(w-this.startTime)*this.rate,this.t=x,x/=1e3,x=Math.max(x-a,0),this.playState==="finished"&&this.pauseTime===void 0&&(x=this.totalDuration);const S=x/this.duration;let P=Math.floor(S),U=S%1;!U&&S>=1&&(U=1),U===1&&P--;const j=P%2;(h==="reverse"||h==="alternate"&&j||h==="alternate-reverse"&&!j)&&(U=1-U);const A=x>=this.totalDuration?1:Math.min(U,1),T=m(this.easing(A));e(T),this.pauseTime===void 0&&(this.playState==="finished"||x>=this.totalDuration+c)?(this.playState="finished",(y=this.resolve)===null||y===void 0||y.call(this,T)):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 yh=function(){};process.env.NODE_ENV!=="production"&&(yh=function(r,e){if(!r)throw new Error(e)});class PI{setAnimation(e){this.animation=e,e?.finished.then(()=>this.clearAnimation()).catch(()=>{})}clearAnimation(){this.animation=this.generator=void 0}}const wh=new WeakMap;function qg(r){return wh.has(r)||wh.set(r,{transforms:[],values:new Map}),wh.get(r)}function TI(r,e){return r.has(e)||r.set(e,new PI),r.get(e)}const RI=["","X","Y","Z"],NI=["translate","scale","rotate","skew"],lc={x:"translateX",y:"translateY",z:"translateZ"},zg={syntax:"<angle>",initialValue:"0deg",toDefaultUnit:r=>r+"deg"},LI={translate:{syntax:"<length-percentage>",initialValue:"0px",toDefaultUnit:r=>r+"px"},rotate:zg,scale:{syntax:"<number>",initialValue:1,toDefaultUnit:di},skew:zg},Ko=new Map,bh=r=>`--motion-${r}`,uc=["x","y","z"];NI.forEach(r=>{RI.forEach(e=>{uc.push(r+e),Ko.set(bh(r+e),LI[r])})});const MI=(r,e)=>uc.indexOf(r)-uc.indexOf(e),UI=new Set(uc),Hg=r=>UI.has(r),jI=(r,e)=>{lc[e]&&(e=lc[e]);const{transforms:t}=qg(r);bI(t,e),r.style.transform=FI(t)},FI=r=>r.sort(MI).reduce(BI,"").trim(),BI=(r,e)=>`${r} ${e}(var(${bh(e)}))`,_h=r=>r.startsWith("--"),Wg=new Set;function kI(r){if(!Wg.has(r)){Wg.add(r);try{const{syntax:e,initialValue:t}=Ko.has(r)?Ko.get(r):{};CSS.registerProperty({name:r,inherits:!1,syntax:e,initialValue:t})}catch{}}}const Eh=(r,e)=>document.createElement("div").animate(r,e),Kg={cssRegisterProperty:()=>typeof CSS<"u"&&Object.hasOwnProperty.call(CSS,"registerProperty"),waapi:()=>Object.hasOwnProperty.call(Element.prototype,"animate"),partialKeyframes:()=>{try{Eh({opacity:[1]})}catch{return!1}return!0},finished:()=>!!Eh({opacity:[0,1]},{duration:.001}).finished,linearEasing:()=>{try{Eh({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0}},xh={},Ns={};for(const r in Kg)Ns[r]=()=>(xh[r]===void 0&&(xh[r]=Kg[r]()),xh[r]);const qI=.015,zI=(r,e)=>{let t="";const n=Math.round(e/qI);for(let i=0;i<n;i++)t+=r(mh(0,n-1,i))+", ";return t.substring(0,t.length-2)},Vg=(r,e)=>Zi(r)?Ns.linearEasing()?`linear(${zI(r,e)})`:tn.easing:Ug(r)?HI(r):r,HI=([r,e,t,n])=>`cubic-bezier(${r}, ${e}, ${t}, ${n})`;function WI(r,e){for(let t=0;t<r.length;t++)r[t]===null&&(r[t]=t?r[t-1]:e());return r}const KI=r=>Array.isArray(r)?r:[r];function Ih(r){return lc[r]&&(r=lc[r]),Hg(r)?bh(r):r}const hc={get:(r,e)=>{e=Ih(e);let t=_h(e)?r.style.getPropertyValue(e):getComputedStyle(r)[e];if(!t&&t!==0){const n=Ko.get(e);n&&(t=n.initialValue)}return t},set:(r,e,t)=>{e=Ih(e),_h(e)?r.style.setProperty(e,t):r.style[e]=t}};function Gg(r,e=!0){if(!(!r||r.playState==="finished"))try{r.stop?r.stop():(e&&r.commitStyles(),r.cancel())}catch{}}function VI(r,e){var t;let n=e?.toDefaultUnit||di;const i=r[r.length-1];if(DI(i)){const a=((t=i.match(/(-?[\d.]+)([a-z%]*)/))===null||t===void 0?void 0:t[2])||"";a&&(n=c=>c+a)}return n}function GI(){return window.__MOTION_DEV_TOOLS_RECORD}function YI(r,e,t,n={},i){const a=GI(),c=n.record!==!1&&a;let u,{duration:f=tn.duration,delay:h=tn.delay,endDelay:m=tn.endDelay,repeat:w=tn.repeat,easing:y=tn.easing,persist:x=!1,direction:S,offset:P,allowWebkitAcceleration:U=!1}=n;const j=qg(r),A=Hg(e);let T=Ns.waapi();A&&jI(r,e);const C=Ih(e),$=TI(j.values,C),E=Ko.get(C);return Gg($.animation,!(vh(y)&&$.generator)&&n.record!==!1),()=>{const d=()=>{var F,V;return(V=(F=hc.get(r,C))!==null&&F!==void 0?F:E?.initialValue)!==null&&V!==void 0?V:0};let b=WI(KI(t),d);const H=VI(b,E);if(vh(y)){const F=y.createAnimation(b,e!=="opacity",d,C,$);y=F.easing,b=F.keyframes||b,f=F.duration||f}if(_h(C)&&(Ns.cssRegisterProperty()?kI(C):T=!1),A&&!Ns.linearEasing()&&(Zi(y)||Rs(y)&&y.some(Zi))&&(T=!1),T){E&&(b=b.map(se=>cc(se)?E.toDefaultUnit(se):se)),b.length===1&&(!Ns.partialKeyframes()||c)&&b.unshift(d());const F={delay:Ho.ms(h),duration:Ho.ms(f),endDelay:Ho.ms(m),easing:Rs(y)?void 0:Vg(y,f),direction:S,iterations:w+1,fill:"both"};u=r.animate({[C]:b,offset:P,easing:Rs(y)?y.map(se=>Vg(se,f)):void 0},F),u.finished||(u.finished=new Promise((se,ce)=>{u.onfinish=se,u.oncancel=ce}));const V=b[b.length-1];u.finished.then(()=>{x||(hc.set(r,C,V),u.cancel())}).catch(Lg),U||(u.playbackRate=1.000001)}else if(i&&A)b=b.map(F=>typeof F=="string"?parseFloat(F):F),b.length===1&&b.unshift(parseFloat(d())),u=new i(F=>{hc.set(r,C,H?H(F):F)},b,Object.assign(Object.assign({},n),{duration:f,easing:y}));else{const F=b[b.length-1];hc.set(r,C,E&&cc(F)?E.toDefaultUnit(F):F)}return c&&a(r,e,b,{duration:f,delay:h,easing:y,repeat:w,offset:P},"motion-one"),$.setAnimation(u),u}}const JI=(r,e)=>r[e]?Object.assign(Object.assign({},r),r[e]):Object.assign({},r);function Yg(r,e){var t;return typeof r=="string"?e?((t=e[r])!==null&&t!==void 0||(e[r]=document.querySelectorAll(r)),r=e[r]):r=document.querySelectorAll(r):r instanceof Element&&(r=[r]),Array.from(r||[])}const ZI=r=>r(),Jg=(r,e,t=tn.duration)=>new Proxy({animations:r.map(ZI).filter(Boolean),duration:t,options:e},XI),QI=r=>r.animations[0],XI={get:(r,e)=>{const t=QI(r);switch(e){case"duration":return r.duration;case"currentTime":return Ho.s(t?.[e]||0);case"playbackRate":case"playState":return t?.[e];case"finished":return r.finished||(r.finished=Promise.all(r.animations.map(eD)).catch(Lg)),r.finished;case"stop":return()=>{r.animations.forEach(n=>Gg(n))};case"forEachNative":return n=>{r.animations.forEach(i=>n(i,r))};default:return typeof t?.[e]>"u"?void 0:()=>r.animations.forEach(n=>n[e]())}},set:(r,e,t)=>{switch(e){case"currentTime":t=Ho.ms(t);case"playbackRate":for(let n=0;n<r.animations.length;n++)r.animations[n][e]=t;return!0}return!1}},eD=r=>r.finished;function tD(r,e,t){return Zi(r)?r(e,t):r}function rD(r){return function(t,n,i={}){t=Yg(t);const a=t.length;yh(!!a,"No valid element provided."),yh(!!n,"No keyframes defined.");const c=[];for(let u=0;u<a;u++){const f=t[u];for(const h in n){const m=JI(i,h);m.delay=tD(m.delay,u,a);const w=YI(f,h,n[h],m,r);c.push(w)}}return Jg(c,i,i.duration)}}const nD=rD(kg);function iD(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(t[n[i]]=r[n[i]]);return t}typeof SuppressedError=="function"&&SuppressedError;const sD={any:0,all:1};function oD(r,e,{root:t,margin:n,amount:i="any"}={}){if(typeof IntersectionObserver>"u")return()=>{};const a=Yg(r),c=new WeakMap,u=h=>{h.forEach(m=>{const w=c.get(m.target);if(m.isIntersecting!==!!w)if(m.isIntersecting){const y=e(m);Zi(y)?c.set(m.target,y):f.unobserve(m.target)}else w&&(w(m),c.delete(m.target))})},f=new IntersectionObserver(u,{root:t,rootMargin:n,threshold:typeof i=="number"?i:sD[i]});return a.forEach(h=>f.observe(h)),()=>f.disconnect()}function Dh(r,e,t){r.dispatchEvent(new CustomEvent(e,{detail:{originalEvent:t}}))}function Zg(r,e,t){r.dispatchEvent(new CustomEvent(e,{detail:{originalEntry:t}}))}const aD={isActive:r=>!!r.inView,subscribe:(r,{enable:e,disable:t},{inViewOptions:n={}})=>{const{once:i}=n,a=iD(n,["once"]);return oD(r,c=>{if(e(),Zg(r,"viewenter",c),!i)return u=>{t(),Zg(r,"viewleave",u)}},a)}},Qg=(r,e,t)=>n=>{n.pointerType&&n.pointerType!=="mouse"||(t(),Dh(r,e,n))};[...Object.keys({inView:aD,hover:{isActive:r=>!!r.hover,subscribe:(r,{enable:e,disable:t})=>{const n=Qg(r,"hoverstart",e),i=Qg(r,"hoverend",t);return r.addEventListener("pointerenter",n),r.addEventListener("pointerleave",i),()=>{r.removeEventListener("pointerenter",n),r.removeEventListener("pointerleave",i)}}},press:{isActive:r=>!!r.press,subscribe:(r,{enable:e,disable:t})=>{const n=a=>{t(),Dh(r,"pressend",a),window.removeEventListener("pointerup",n)},i=a=>{e(),Dh(r,"pressstart",a),window.addEventListener("pointerup",n)};return r.addEventListener("pointerdown",i),()=>{r.removeEventListener("pointerdown",i),window.removeEventListener("pointerup",n)}}}})];function cD(r,e={}){return Jg([()=>{const t=new kg(r,[0,1],e);return t.finished.catch(()=>{}),t}],e,e.duration)}function Qi(r,e,t){return(Zi(r)?cD:nD)(r,e,t)}/**
128
128
  * @license
129
129
  * Copyright 2018 Google LLC
130
130
  * SPDX-License-Identifier: BSD-3-Clause
131
- */const Ir=r=>r??tr;var Vo={},aD=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then},Qg={},Kr={};let Sh;const cD=[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];Kr.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},Kr.getSymbolTotalCodewords=function(e){return cD[e]},Kr.getBCHDigit=function(r){let e=0;for(;r!==0;)e++,r>>>=1;return e},Kr.setToSJISFunction=function(e){if(typeof e!="function")throw new Error('"toSJISFunc" is not a valid function.');Sh=e},Kr.isKanjiModeEnabled=function(){return typeof Sh<"u"},Kr.toSJIS=function(e){return Sh(e)};var dc={};(function(r){r.L={bit:1},r.M={bit:0},r.Q={bit:3},r.H={bit:2};function e(t){if(typeof t!="string")throw new Error("Param is not a string");switch(t.toLowerCase()){case"l":case"low":return r.L;case"m":case"medium":return r.M;case"q":case"quartile":return r.Q;case"h":case"high":return r.H;default:throw new Error("Unknown EC Level: "+t)}}r.isValid=function(n){return n&&typeof n.bit<"u"&&n.bit>=0&&n.bit<4},r.from=function(n,i){if(r.isValid(n))return n;try{return e(n)}catch{return i}}})(dc);function Xg(){this.buffer=[],this.length=0}Xg.prototype={get:function(r){const e=Math.floor(r/8);return(this.buffer[e]>>>7-r%8&1)===1},put:function(r,e){for(let t=0;t<e;t++)this.putBit((r>>>e-t-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(r){const e=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),r&&(this.buffer[e]|=128>>>this.length%8),this.length++}};var lD=Xg;function Go(r){if(!r||r<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=r,this.data=new Uint8Array(r*r),this.reservedBit=new Uint8Array(r*r)}Go.prototype.set=function(r,e,t,n){const i=r*this.size+e;this.data[i]=t,n&&(this.reservedBit[i]=!0)},Go.prototype.get=function(r,e){return this.data[r*this.size+e]},Go.prototype.xor=function(r,e,t){this.data[r*this.size+e]^=t},Go.prototype.isReserved=function(r,e){return this.reservedBit[r*this.size+e]};var uD=Go,em={};(function(r){const e=Kr.getSymbolSize;r.getRowColCoords=function(n){if(n===1)return[];const i=Math.floor(n/7)+2,a=e(n),c=a===145?26:Math.ceil((a-13)/(2*i-2))*2,u=[a-7];for(let d=1;d<i-1;d++)u[d]=u[d-1]-c;return u.push(6),u.reverse()},r.getPositions=function(n){const i=[],a=r.getRowColCoords(n),c=a.length;for(let u=0;u<c;u++)for(let d=0;d<c;d++)u===0&&d===0||u===0&&d===c-1||u===c-1&&d===0||i.push([a[u],a[d]]);return i}})(em);var tm={};const hD=Kr.getSymbolSize,rm=7;tm.getPositions=function(e){const t=hD(e);return[[0,0],[t-rm,0],[0,t-rm]]};var nm={};(function(r){r.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};r.isValid=function(i){return i!=null&&i!==""&&!isNaN(i)&&i>=0&&i<=7},r.from=function(i){return r.isValid(i)?parseInt(i,10):void 0},r.getPenaltyN1=function(i){const a=i.size;let c=0,u=0,d=0,h=null,m=null;for(let y=0;y<a;y++){u=d=0,h=m=null;for(let w=0;w<a;w++){let E=i.get(y,w);E===h?u++:(u>=5&&(c+=e.N1+(u-5)),h=E,u=1),E=i.get(w,y),E===m?d++:(d>=5&&(c+=e.N1+(d-5)),m=E,d=1)}u>=5&&(c+=e.N1+(u-5)),d>=5&&(c+=e.N1+(d-5))}return c},r.getPenaltyN2=function(i){const a=i.size;let c=0;for(let u=0;u<a-1;u++)for(let d=0;d<a-1;d++){const h=i.get(u,d)+i.get(u,d+1)+i.get(u+1,d)+i.get(u+1,d+1);(h===4||h===0)&&c++}return c*e.N2},r.getPenaltyN3=function(i){const a=i.size;let c=0,u=0,d=0;for(let h=0;h<a;h++){u=d=0;for(let m=0;m<a;m++)u=u<<1&2047|i.get(h,m),m>=10&&(u===1488||u===93)&&c++,d=d<<1&2047|i.get(m,h),m>=10&&(d===1488||d===93)&&c++}return c*e.N3},r.getPenaltyN4=function(i){let a=0;const c=i.data.length;for(let d=0;d<c;d++)a+=i.data[d];return Math.abs(Math.ceil(a*100/c/5)-10)*e.N4};function t(n,i,a){switch(n){case r.Patterns.PATTERN000:return(i+a)%2===0;case r.Patterns.PATTERN001:return i%2===0;case r.Patterns.PATTERN010:return a%3===0;case r.Patterns.PATTERN011:return(i+a)%3===0;case r.Patterns.PATTERN100:return(Math.floor(i/2)+Math.floor(a/3))%2===0;case r.Patterns.PATTERN101:return i*a%2+i*a%3===0;case r.Patterns.PATTERN110:return(i*a%2+i*a%3)%2===0;case r.Patterns.PATTERN111:return(i*a%3+(i+a)%2)%2===0;default:throw new Error("bad maskPattern:"+n)}}r.applyMask=function(i,a){const c=a.size;for(let u=0;u<c;u++)for(let d=0;d<c;d++)a.isReserved(d,u)||a.xor(d,u,t(i,d,u))},r.getBestMask=function(i,a){const c=Object.keys(r.Patterns).length;let u=0,d=1/0;for(let h=0;h<c;h++){a(h),r.applyMask(h,i);const m=r.getPenaltyN1(i)+r.getPenaltyN2(i)+r.getPenaltyN3(i)+r.getPenaltyN4(i);r.applyMask(h,i),m<d&&(d=m,u=h)}return u}})(nm);var pc={};const di=dc,gc=[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],mc=[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];pc.getBlocksCount=function(e,t){switch(t){case di.L:return gc[(e-1)*4+0];case di.M:return gc[(e-1)*4+1];case di.Q:return gc[(e-1)*4+2];case di.H:return gc[(e-1)*4+3];default:return}},pc.getTotalCodewordsCount=function(e,t){switch(t){case di.L:return mc[(e-1)*4+0];case di.M:return mc[(e-1)*4+1];case di.Q:return mc[(e-1)*4+2];case di.H:return mc[(e-1)*4+3];default:return}};var im={},vc={};const Yo=new Uint8Array(512),wc=new Uint8Array(256);(function(){let e=1;for(let t=0;t<255;t++)Yo[t]=e,wc[e]=t,e<<=1,e&256&&(e^=285);for(let t=255;t<512;t++)Yo[t]=Yo[t-255]})(),vc.log=function(e){if(e<1)throw new Error("log("+e+")");return wc[e]},vc.exp=function(e){return Yo[e]},vc.mul=function(e,t){return e===0||t===0?0:Yo[wc[e]+wc[t]]},function(r){const e=vc;r.mul=function(n,i){const a=new Uint8Array(n.length+i.length-1);for(let c=0;c<n.length;c++)for(let u=0;u<i.length;u++)a[c+u]^=e.mul(n[c],i[u]);return a},r.mod=function(n,i){let a=new Uint8Array(n);for(;a.length-i.length>=0;){const c=a[0];for(let d=0;d<i.length;d++)a[d]^=e.mul(i[d],c);let u=0;for(;u<a.length&&a[u]===0;)u++;a=a.slice(u)}return a},r.generateECPolynomial=function(n){let i=new Uint8Array([1]);for(let a=0;a<n;a++)i=r.mul(i,new Uint8Array([1,e.exp(a)]));return i}}(im);const sm=im;function Oh(r){this.genPoly=void 0,this.degree=r,this.degree&&this.initialize(this.degree)}Oh.prototype.initialize=function(e){this.degree=e,this.genPoly=sm.generateECPolynomial(this.degree)},Oh.prototype.encode=function(e){if(!this.genPoly)throw new Error("Encoder not initialized");const t=new Uint8Array(e.length+this.degree);t.set(e);const n=sm.mod(t,this.genPoly),i=this.degree-n.length;if(i>0){const a=new Uint8Array(this.degree);return a.set(n,i),a}return n};var fD=Oh,om={},pi={},Ch={};Ch.isValid=function(e){return!isNaN(e)&&e>=1&&e<=40};var Sn={};const am="[0-9]+",dD="[A-Z $%*+\\-./:]+";let Jo="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";Jo=Jo.replace(/u/g,"\\u");const pD="(?:(?![A-Z0-9 $%*+\\-./:]|"+Jo+`)(?:.|[\r
132
- ]))+`;Sn.KANJI=new RegExp(Jo,"g"),Sn.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),Sn.BYTE=new RegExp(pD,"g"),Sn.NUMERIC=new RegExp(am,"g"),Sn.ALPHANUMERIC=new RegExp(dD,"g");const gD=new RegExp("^"+Jo+"$"),mD=new RegExp("^"+am+"$"),vD=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");Sn.testKanji=function(e){return gD.test(e)},Sn.testNumeric=function(e){return mD.test(e)},Sn.testAlphanumeric=function(e){return vD.test(e)},function(r){const e=Ch,t=Sn;r.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},r.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},r.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},r.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},r.MIXED={bit:-1},r.getCharCountIndicator=function(a,c){if(!a.ccBits)throw new Error("Invalid mode: "+a);if(!e.isValid(c))throw new Error("Invalid version: "+c);return c>=1&&c<10?a.ccBits[0]:c<27?a.ccBits[1]:a.ccBits[2]},r.getBestModeForData=function(a){return t.testNumeric(a)?r.NUMERIC:t.testAlphanumeric(a)?r.ALPHANUMERIC:t.testKanji(a)?r.KANJI:r.BYTE},r.toString=function(a){if(a&&a.id)return a.id;throw new Error("Invalid mode")},r.isValid=function(a){return a&&a.bit&&a.ccBits};function n(i){if(typeof i!="string")throw new Error("Param is not a string");switch(i.toLowerCase()){case"numeric":return r.NUMERIC;case"alphanumeric":return r.ALPHANUMERIC;case"kanji":return r.KANJI;case"byte":return r.BYTE;default:throw new Error("Unknown mode: "+i)}}r.from=function(a,c){if(r.isValid(a))return a;try{return n(a)}catch{return c}}}(pi),function(r){const e=Kr,t=pc,n=dc,i=pi,a=Ch,c=7973,u=e.getBCHDigit(c);function d(w,E,I){for(let T=1;T<=40;T++)if(E<=r.getCapacity(T,I,w))return T}function h(w,E){return i.getCharCountIndicator(w,E)+4}function m(w,E){let I=0;return w.forEach(function(T){const U=h(T.mode,E);I+=U+T.getBitsLength()}),I}function y(w,E){for(let I=1;I<=40;I++)if(m(w,I)<=r.getCapacity(I,E,i.MIXED))return I}r.from=function(E,I){return a.isValid(E)?parseInt(E,10):I},r.getCapacity=function(E,I,T){if(!a.isValid(E))throw new Error("Invalid QR Code version");typeof T>"u"&&(T=i.BYTE);const U=e.getSymbolTotalCodewords(E),F=t.getTotalCodewordsCount(E,I),$=(U-F)*8;if(T===i.MIXED)return $;const P=$-h(T,E);switch(T){case i.NUMERIC:return Math.floor(P/10*3);case i.ALPHANUMERIC:return Math.floor(P/11*2);case i.KANJI:return Math.floor(P/13);case i.BYTE:default:return Math.floor(P/8)}},r.getBestVersionForData=function(E,I){let T;const U=n.from(I,n.M);if(Array.isArray(E)){if(E.length>1)return y(E,U);if(E.length===0)return 1;T=E[0]}else T=E;return d(T.mode,T.getLength(),U)},r.getEncodedBits=function(E){if(!a.isValid(E)||E<7)throw new Error("Invalid QR Code version");let I=E<<12;for(;e.getBCHDigit(I)-u>=0;)I^=c<<e.getBCHDigit(I)-u;return E<<12|I}}(om);var cm={};const $h=Kr,lm=1335,wD=21522,um=$h.getBCHDigit(lm);cm.getEncodedBits=function(e,t){const n=e.bit<<3|t;let i=n<<10;for(;$h.getBCHDigit(i)-um>=0;)i^=lm<<$h.getBCHDigit(i)-um;return(n<<10|i)^wD};var hm={};const yD=pi;function Ns(r){this.mode=yD.NUMERIC,this.data=r.toString()}Ns.getBitsLength=function(e){return 10*Math.floor(e/3)+(e%3?e%3*3+1:0)},Ns.prototype.getLength=function(){return this.data.length},Ns.prototype.getBitsLength=function(){return Ns.getBitsLength(this.data.length)},Ns.prototype.write=function(e){let t,n,i;for(t=0;t+3<=this.data.length;t+=3)n=this.data.substr(t,3),i=parseInt(n,10),e.put(i,10);const a=this.data.length-t;a>0&&(n=this.data.substr(t),i=parseInt(n,10),e.put(i,a*3+1))};var bD=Ns;const _D=pi,Ah=["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 Ls(r){this.mode=_D.ALPHANUMERIC,this.data=r}Ls.getBitsLength=function(e){return 11*Math.floor(e/2)+6*(e%2)},Ls.prototype.getLength=function(){return this.data.length},Ls.prototype.getBitsLength=function(){return Ls.getBitsLength(this.data.length)},Ls.prototype.write=function(e){let t;for(t=0;t+2<=this.data.length;t+=2){let n=Ah.indexOf(this.data[t])*45;n+=Ah.indexOf(this.data[t+1]),e.put(n,11)}this.data.length%2&&e.put(Ah.indexOf(this.data[t]),6)};var ED=Ls,xD=function(e){for(var t=[],n=e.length,i=0;i<n;i++){var a=e.charCodeAt(i);if(a>=55296&&a<=56319&&n>i+1){var c=e.charCodeAt(i+1);c>=56320&&c<=57343&&(a=(a-55296)*1024+c-56320+65536,i+=1)}if(a<128){t.push(a);continue}if(a<2048){t.push(a>>6|192),t.push(a&63|128);continue}if(a<55296||a>=57344&&a<65536){t.push(a>>12|224),t.push(a>>6&63|128),t.push(a&63|128);continue}if(a>=65536&&a<=1114111){t.push(a>>18|240),t.push(a>>12&63|128),t.push(a>>6&63|128),t.push(a&63|128);continue}t.push(239,191,189)}return new Uint8Array(t).buffer};const ID=xD,DD=pi;function Ms(r){this.mode=DD.BYTE,typeof r=="string"&&(r=ID(r)),this.data=new Uint8Array(r)}Ms.getBitsLength=function(e){return e*8},Ms.prototype.getLength=function(){return this.data.length},Ms.prototype.getBitsLength=function(){return Ms.getBitsLength(this.data.length)},Ms.prototype.write=function(r){for(let e=0,t=this.data.length;e<t;e++)r.put(this.data[e],8)};var SD=Ms;const OD=pi,CD=Kr;function Us(r){this.mode=OD.KANJI,this.data=r}Us.getBitsLength=function(e){return e*13},Us.prototype.getLength=function(){return this.data.length},Us.prototype.getBitsLength=function(){return Us.getBitsLength(this.data.length)},Us.prototype.write=function(r){let e;for(e=0;e<this.data.length;e++){let t=CD.toSJIS(this.data[e]);if(t>=33088&&t<=40956)t-=33088;else if(t>=57408&&t<=60351)t-=49472;else throw new Error("Invalid SJIS character: "+this.data[e]+`
133
- Make sure your charset is UTF-8`);t=(t>>>8&255)*192+(t&255),r.put(t,13)}};var $D=Us,fm={exports:{}};(function(r){var e={single_source_shortest_paths:function(t,n,i){var a={},c={};c[n]=0;var u=e.PriorityQueue.make();u.push(n,0);for(var d,h,m,y,w,E,I,T,U;!u.empty();){d=u.pop(),h=d.value,y=d.cost,w=t[h]||{};for(m in w)w.hasOwnProperty(m)&&(E=w[m],I=y+E,T=c[m],U=typeof c[m]>"u",(U||T>I)&&(c[m]=I,u.push(m,I),a[m]=h))}if(typeof i<"u"&&typeof c[i]>"u"){var F=["Could not find a path from ",n," to ",i,"."].join("");throw new Error(F)}return a},extract_shortest_path_from_predecessor_list:function(t,n){for(var i=[],a=n;a;)i.push(a),t[a],a=t[a];return i.reverse(),i},find_path:function(t,n,i){var a=e.single_source_shortest_paths(t,n,i);return e.extract_shortest_path_from_predecessor_list(a,i)},PriorityQueue:{make:function(t){var n=e.PriorityQueue,i={},a;t=t||{};for(a in n)n.hasOwnProperty(a)&&(i[a]=n[a]);return i.queue=[],i.sorter=t.sorter||n.default_sorter,i},default_sorter:function(t,n){return t.cost-n.cost},push:function(t,n){var i={value:t,cost:n};this.queue.push(i),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};r.exports=e})(fm),function(r){const e=pi,t=bD,n=ED,i=SD,a=$D,c=Sn,u=Kr,d=fm.exports;function h(F){return unescape(encodeURIComponent(F)).length}function m(F,$,P){const O=[];let A;for(;(A=F.exec(P))!==null;)O.push({data:A[0],index:A.index,mode:$,length:A[0].length});return O}function y(F){const $=m(c.NUMERIC,e.NUMERIC,F),P=m(c.ALPHANUMERIC,e.ALPHANUMERIC,F);let O,A;return u.isKanjiModeEnabled()?(O=m(c.BYTE,e.BYTE,F),A=m(c.KANJI,e.KANJI,F)):(O=m(c.BYTE_KANJI,e.BYTE,F),A=[]),$.concat(P,O,A).sort(function(f,b){return f.index-b.index}).map(function(f){return{data:f.data,mode:f.mode,length:f.length}})}function w(F,$){switch($){case e.NUMERIC:return t.getBitsLength(F);case e.ALPHANUMERIC:return n.getBitsLength(F);case e.KANJI:return a.getBitsLength(F);case e.BYTE:return i.getBitsLength(F)}}function E(F){return F.reduce(function($,P){const O=$.length-1>=0?$[$.length-1]:null;return O&&O.mode===P.mode?($[$.length-1].data+=P.data,$):($.push(P),$)},[])}function I(F){const $=[];for(let P=0;P<F.length;P++){const O=F[P];switch(O.mode){case e.NUMERIC:$.push([O,{data:O.data,mode:e.ALPHANUMERIC,length:O.length},{data:O.data,mode:e.BYTE,length:O.length}]);break;case e.ALPHANUMERIC:$.push([O,{data:O.data,mode:e.BYTE,length:O.length}]);break;case e.KANJI:$.push([O,{data:O.data,mode:e.BYTE,length:h(O.data)}]);break;case e.BYTE:$.push([{data:O.data,mode:e.BYTE,length:h(O.data)}])}}return $}function T(F,$){const P={},O={start:{}};let A=["start"];for(let x=0;x<F.length;x++){const f=F[x],b=[];for(let q=0;q<f.length;q++){const j=f[q],V=""+x+q;b.push(V),P[V]={node:j,lastCount:0},O[V]={};for(let se=0;se<A.length;se++){const ce=A[se];P[ce]&&P[ce].node.mode===j.mode?(O[ce][V]=w(P[ce].lastCount+j.length,j.mode)-w(P[ce].lastCount,j.mode),P[ce].lastCount+=j.length):(P[ce]&&(P[ce].lastCount=j.length),O[ce][V]=w(j.length,j.mode)+4+e.getCharCountIndicator(j.mode,$))}}A=b}for(let x=0;x<A.length;x++)O[A[x]].end=0;return{map:O,table:P}}function U(F,$){let P;const O=e.getBestModeForData(F);if(P=e.from($,O),P!==e.BYTE&&P.bit<O.bit)throw new Error('"'+F+'" cannot be encoded with mode '+e.toString(P)+`.
134
- Suggested mode is: `+e.toString(O));switch(P===e.KANJI&&!u.isKanjiModeEnabled()&&(P=e.BYTE),P){case e.NUMERIC:return new t(F);case e.ALPHANUMERIC:return new n(F);case e.KANJI:return new a(F);case e.BYTE:return new i(F)}}r.fromArray=function($){return $.reduce(function(P,O){return typeof O=="string"?P.push(U(O,null)):O.data&&P.push(U(O.data,O.mode)),P},[])},r.fromString=function($,P){const O=y($,u.isKanjiModeEnabled()),A=I(O),x=T(A,P),f=d.find_path(x.map,"start","end"),b=[];for(let q=1;q<f.length-1;q++)b.push(x.table[f[q]].node);return r.fromArray(E(b))},r.rawSplit=function($){return r.fromArray(y($,u.isKanjiModeEnabled()))}}(hm);const yc=Kr,Ph=dc,AD=lD,PD=uD,TD=em,RD=tm,Th=nm,Rh=pc,ND=fD,bc=om,LD=cm,MD=pi,Nh=hm;function UD(r,e){const t=r.size,n=RD.getPositions(e);for(let i=0;i<n.length;i++){const a=n[i][0],c=n[i][1];for(let u=-1;u<=7;u++)if(!(a+u<=-1||t<=a+u))for(let d=-1;d<=7;d++)c+d<=-1||t<=c+d||(u>=0&&u<=6&&(d===0||d===6)||d>=0&&d<=6&&(u===0||u===6)||u>=2&&u<=4&&d>=2&&d<=4?r.set(a+u,c+d,!0,!0):r.set(a+u,c+d,!1,!0))}}function jD(r){const e=r.size;for(let t=8;t<e-8;t++){const n=t%2===0;r.set(t,6,n,!0),r.set(6,t,n,!0)}}function FD(r,e){const t=TD.getPositions(e);for(let n=0;n<t.length;n++){const i=t[n][0],a=t[n][1];for(let c=-2;c<=2;c++)for(let u=-2;u<=2;u++)c===-2||c===2||u===-2||u===2||c===0&&u===0?r.set(i+c,a+u,!0,!0):r.set(i+c,a+u,!1,!0)}}function BD(r,e){const t=r.size,n=bc.getEncodedBits(e);let i,a,c;for(let u=0;u<18;u++)i=Math.floor(u/3),a=u%3+t-8-3,c=(n>>u&1)===1,r.set(i,a,c,!0),r.set(a,i,c,!0)}function Lh(r,e,t){const n=r.size,i=LD.getEncodedBits(e,t);let a,c;for(a=0;a<15;a++)c=(i>>a&1)===1,a<6?r.set(a,8,c,!0):a<8?r.set(a+1,8,c,!0):r.set(n-15+a,8,c,!0),a<8?r.set(8,n-a-1,c,!0):a<9?r.set(8,15-a-1+1,c,!0):r.set(8,15-a-1,c,!0);r.set(n-8,8,1,!0)}function kD(r,e){const t=r.size;let n=-1,i=t-1,a=7,c=0;for(let u=t-1;u>0;u-=2)for(u===6&&u--;;){for(let d=0;d<2;d++)if(!r.isReserved(i,u-d)){let h=!1;c<e.length&&(h=(e[c]>>>a&1)===1),r.set(i,u-d,h),a--,a===-1&&(c++,a=7)}if(i+=n,i<0||t<=i){i-=n,n=-n;break}}}function HD(r,e,t){const n=new AD;t.forEach(function(d){n.put(d.mode.bit,4),n.put(d.getLength(),MD.getCharCountIndicator(d.mode,r)),d.write(n)});const i=yc.getSymbolTotalCodewords(r),a=Rh.getTotalCodewordsCount(r,e),c=(i-a)*8;for(n.getLengthInBits()+4<=c&&n.put(0,4);n.getLengthInBits()%8!==0;)n.putBit(0);const u=(c-n.getLengthInBits())/8;for(let d=0;d<u;d++)n.put(d%2?17:236,8);return zD(n,r,e)}function zD(r,e,t){const n=yc.getSymbolTotalCodewords(e),i=Rh.getTotalCodewordsCount(e,t),a=n-i,c=Rh.getBlocksCount(e,t),u=n%c,d=c-u,h=Math.floor(n/c),m=Math.floor(a/c),y=m+1,w=h-m,E=new ND(w);let I=0;const T=new Array(c),U=new Array(c);let F=0;const $=new Uint8Array(r.buffer);for(let f=0;f<c;f++){const b=f<d?m:y;T[f]=$.slice(I,I+b),U[f]=E.encode(T[f]),I+=b,F=Math.max(F,b)}const P=new Uint8Array(n);let O=0,A,x;for(A=0;A<F;A++)for(x=0;x<c;x++)A<T[x].length&&(P[O++]=T[x][A]);for(A=0;A<w;A++)for(x=0;x<c;x++)P[O++]=U[x][A];return P}function qD(r,e,t,n){let i;if(Array.isArray(r))i=Nh.fromArray(r);else if(typeof r=="string"){let h=e;if(!h){const m=Nh.rawSplit(r);h=bc.getBestVersionForData(m,t)}i=Nh.fromString(r,h||40)}else throw new Error("Invalid data");const a=bc.getBestVersionForData(i,t);if(!a)throw new Error("The amount of data is too big to be stored in a QR Code");if(!e)e=a;else if(e<a)throw new Error(`
131
+ */const Dr=r=>r??tr;var Vo={},lD=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then},Xg={},Vr={};let Sh;const uD=[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];Vr.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},Vr.getSymbolTotalCodewords=function(e){return uD[e]},Vr.getBCHDigit=function(r){let e=0;for(;r!==0;)e++,r>>>=1;return e},Vr.setToSJISFunction=function(e){if(typeof e!="function")throw new Error('"toSJISFunc" is not a valid function.');Sh=e},Vr.isKanjiModeEnabled=function(){return typeof Sh<"u"},Vr.toSJIS=function(e){return Sh(e)};var fc={};(function(r){r.L={bit:1},r.M={bit:0},r.Q={bit:3},r.H={bit:2};function e(t){if(typeof t!="string")throw new Error("Param is not a string");switch(t.toLowerCase()){case"l":case"low":return r.L;case"m":case"medium":return r.M;case"q":case"quartile":return r.Q;case"h":case"high":return r.H;default:throw new Error("Unknown EC Level: "+t)}}r.isValid=function(n){return n&&typeof n.bit<"u"&&n.bit>=0&&n.bit<4},r.from=function(n,i){if(r.isValid(n))return n;try{return e(n)}catch{return i}}})(fc);function em(){this.buffer=[],this.length=0}em.prototype={get:function(r){const e=Math.floor(r/8);return(this.buffer[e]>>>7-r%8&1)===1},put:function(r,e){for(let t=0;t<e;t++)this.putBit((r>>>e-t-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(r){const e=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),r&&(this.buffer[e]|=128>>>this.length%8),this.length++}};var hD=em;function Go(r){if(!r||r<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=r,this.data=new Uint8Array(r*r),this.reservedBit=new Uint8Array(r*r)}Go.prototype.set=function(r,e,t,n){const i=r*this.size+e;this.data[i]=t,n&&(this.reservedBit[i]=!0)},Go.prototype.get=function(r,e){return this.data[r*this.size+e]},Go.prototype.xor=function(r,e,t){this.data[r*this.size+e]^=t},Go.prototype.isReserved=function(r,e){return this.reservedBit[r*this.size+e]};var fD=Go,tm={};(function(r){const e=Vr.getSymbolSize;r.getRowColCoords=function(n){if(n===1)return[];const i=Math.floor(n/7)+2,a=e(n),c=a===145?26:Math.ceil((a-13)/(2*i-2))*2,u=[a-7];for(let f=1;f<i-1;f++)u[f]=u[f-1]-c;return u.push(6),u.reverse()},r.getPositions=function(n){const i=[],a=r.getRowColCoords(n),c=a.length;for(let u=0;u<c;u++)for(let f=0;f<c;f++)u===0&&f===0||u===0&&f===c-1||u===c-1&&f===0||i.push([a[u],a[f]]);return i}})(tm);var rm={};const dD=Vr.getSymbolSize,nm=7;rm.getPositions=function(e){const t=dD(e);return[[0,0],[t-nm,0],[0,t-nm]]};var im={};(function(r){r.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};r.isValid=function(i){return i!=null&&i!==""&&!isNaN(i)&&i>=0&&i<=7},r.from=function(i){return r.isValid(i)?parseInt(i,10):void 0},r.getPenaltyN1=function(i){const a=i.size;let c=0,u=0,f=0,h=null,m=null;for(let w=0;w<a;w++){u=f=0,h=m=null;for(let y=0;y<a;y++){let x=i.get(w,y);x===h?u++:(u>=5&&(c+=e.N1+(u-5)),h=x,u=1),x=i.get(y,w),x===m?f++:(f>=5&&(c+=e.N1+(f-5)),m=x,f=1)}u>=5&&(c+=e.N1+(u-5)),f>=5&&(c+=e.N1+(f-5))}return c},r.getPenaltyN2=function(i){const a=i.size;let c=0;for(let u=0;u<a-1;u++)for(let f=0;f<a-1;f++){const h=i.get(u,f)+i.get(u,f+1)+i.get(u+1,f)+i.get(u+1,f+1);(h===4||h===0)&&c++}return c*e.N2},r.getPenaltyN3=function(i){const a=i.size;let c=0,u=0,f=0;for(let h=0;h<a;h++){u=f=0;for(let m=0;m<a;m++)u=u<<1&2047|i.get(h,m),m>=10&&(u===1488||u===93)&&c++,f=f<<1&2047|i.get(m,h),m>=10&&(f===1488||f===93)&&c++}return c*e.N3},r.getPenaltyN4=function(i){let a=0;const c=i.data.length;for(let f=0;f<c;f++)a+=i.data[f];return Math.abs(Math.ceil(a*100/c/5)-10)*e.N4};function t(n,i,a){switch(n){case r.Patterns.PATTERN000:return(i+a)%2===0;case r.Patterns.PATTERN001:return i%2===0;case r.Patterns.PATTERN010:return a%3===0;case r.Patterns.PATTERN011:return(i+a)%3===0;case r.Patterns.PATTERN100:return(Math.floor(i/2)+Math.floor(a/3))%2===0;case r.Patterns.PATTERN101:return i*a%2+i*a%3===0;case r.Patterns.PATTERN110:return(i*a%2+i*a%3)%2===0;case r.Patterns.PATTERN111:return(i*a%3+(i+a)%2)%2===0;default:throw new Error("bad maskPattern:"+n)}}r.applyMask=function(i,a){const c=a.size;for(let u=0;u<c;u++)for(let f=0;f<c;f++)a.isReserved(f,u)||a.xor(f,u,t(i,f,u))},r.getBestMask=function(i,a){const c=Object.keys(r.Patterns).length;let u=0,f=1/0;for(let h=0;h<c;h++){a(h),r.applyMask(h,i);const m=r.getPenaltyN1(i)+r.getPenaltyN2(i)+r.getPenaltyN3(i)+r.getPenaltyN4(i);r.applyMask(h,i),m<f&&(f=m,u=h)}return u}})(im);var dc={};const pi=fc,pc=[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],gc=[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];dc.getBlocksCount=function(e,t){switch(t){case pi.L:return pc[(e-1)*4+0];case pi.M:return pc[(e-1)*4+1];case pi.Q:return pc[(e-1)*4+2];case pi.H:return pc[(e-1)*4+3];default:return}},dc.getTotalCodewordsCount=function(e,t){switch(t){case pi.L:return gc[(e-1)*4+0];case pi.M:return gc[(e-1)*4+1];case pi.Q:return gc[(e-1)*4+2];case pi.H:return gc[(e-1)*4+3];default:return}};var sm={},mc={};const Yo=new Uint8Array(512),vc=new Uint8Array(256);(function(){let e=1;for(let t=0;t<255;t++)Yo[t]=e,vc[e]=t,e<<=1,e&256&&(e^=285);for(let t=255;t<512;t++)Yo[t]=Yo[t-255]})(),mc.log=function(e){if(e<1)throw new Error("log("+e+")");return vc[e]},mc.exp=function(e){return Yo[e]},mc.mul=function(e,t){return e===0||t===0?0:Yo[vc[e]+vc[t]]},function(r){const e=mc;r.mul=function(n,i){const a=new Uint8Array(n.length+i.length-1);for(let c=0;c<n.length;c++)for(let u=0;u<i.length;u++)a[c+u]^=e.mul(n[c],i[u]);return a},r.mod=function(n,i){let a=new Uint8Array(n);for(;a.length-i.length>=0;){const c=a[0];for(let f=0;f<i.length;f++)a[f]^=e.mul(i[f],c);let u=0;for(;u<a.length&&a[u]===0;)u++;a=a.slice(u)}return a},r.generateECPolynomial=function(n){let i=new Uint8Array([1]);for(let a=0;a<n;a++)i=r.mul(i,new Uint8Array([1,e.exp(a)]));return i}}(sm);const om=sm;function Ch(r){this.genPoly=void 0,this.degree=r,this.degree&&this.initialize(this.degree)}Ch.prototype.initialize=function(e){this.degree=e,this.genPoly=om.generateECPolynomial(this.degree)},Ch.prototype.encode=function(e){if(!this.genPoly)throw new Error("Encoder not initialized");const t=new Uint8Array(e.length+this.degree);t.set(e);const n=om.mod(t,this.genPoly),i=this.degree-n.length;if(i>0){const a=new Uint8Array(this.degree);return a.set(n,i),a}return n};var pD=Ch,am={},gi={},Oh={};Oh.isValid=function(e){return!isNaN(e)&&e>=1&&e<=40};var Sn={};const cm="[0-9]+",gD="[A-Z $%*+\\-./:]+";let Jo="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";Jo=Jo.replace(/u/g,"\\u");const mD="(?:(?![A-Z0-9 $%*+\\-./:]|"+Jo+`)(?:.|[\r
132
+ ]))+`;Sn.KANJI=new RegExp(Jo,"g"),Sn.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),Sn.BYTE=new RegExp(mD,"g"),Sn.NUMERIC=new RegExp(cm,"g"),Sn.ALPHANUMERIC=new RegExp(gD,"g");const vD=new RegExp("^"+Jo+"$"),yD=new RegExp("^"+cm+"$"),wD=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");Sn.testKanji=function(e){return vD.test(e)},Sn.testNumeric=function(e){return yD.test(e)},Sn.testAlphanumeric=function(e){return wD.test(e)},function(r){const e=Oh,t=Sn;r.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},r.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},r.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},r.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},r.MIXED={bit:-1},r.getCharCountIndicator=function(a,c){if(!a.ccBits)throw new Error("Invalid mode: "+a);if(!e.isValid(c))throw new Error("Invalid version: "+c);return c>=1&&c<10?a.ccBits[0]:c<27?a.ccBits[1]:a.ccBits[2]},r.getBestModeForData=function(a){return t.testNumeric(a)?r.NUMERIC:t.testAlphanumeric(a)?r.ALPHANUMERIC:t.testKanji(a)?r.KANJI:r.BYTE},r.toString=function(a){if(a&&a.id)return a.id;throw new Error("Invalid mode")},r.isValid=function(a){return a&&a.bit&&a.ccBits};function n(i){if(typeof i!="string")throw new Error("Param is not a string");switch(i.toLowerCase()){case"numeric":return r.NUMERIC;case"alphanumeric":return r.ALPHANUMERIC;case"kanji":return r.KANJI;case"byte":return r.BYTE;default:throw new Error("Unknown mode: "+i)}}r.from=function(a,c){if(r.isValid(a))return a;try{return n(a)}catch{return c}}}(gi),function(r){const e=Vr,t=dc,n=fc,i=gi,a=Oh,c=7973,u=e.getBCHDigit(c);function f(y,x,S){for(let P=1;P<=40;P++)if(x<=r.getCapacity(P,S,y))return P}function h(y,x){return i.getCharCountIndicator(y,x)+4}function m(y,x){let S=0;return y.forEach(function(P){const U=h(P.mode,x);S+=U+P.getBitsLength()}),S}function w(y,x){for(let S=1;S<=40;S++)if(m(y,S)<=r.getCapacity(S,x,i.MIXED))return S}r.from=function(x,S){return a.isValid(x)?parseInt(x,10):S},r.getCapacity=function(x,S,P){if(!a.isValid(x))throw new Error("Invalid QR Code version");typeof P>"u"&&(P=i.BYTE);const U=e.getSymbolTotalCodewords(x),j=t.getTotalCodewordsCount(x,S),A=(U-j)*8;if(P===i.MIXED)return A;const T=A-h(P,x);switch(P){case i.NUMERIC:return Math.floor(T/10*3);case i.ALPHANUMERIC:return Math.floor(T/11*2);case i.KANJI:return Math.floor(T/13);case i.BYTE:default:return Math.floor(T/8)}},r.getBestVersionForData=function(x,S){let P;const U=n.from(S,n.M);if(Array.isArray(x)){if(x.length>1)return w(x,U);if(x.length===0)return 1;P=x[0]}else P=x;return f(P.mode,P.getLength(),U)},r.getEncodedBits=function(x){if(!a.isValid(x)||x<7)throw new Error("Invalid QR Code version");let S=x<<12;for(;e.getBCHDigit(S)-u>=0;)S^=c<<e.getBCHDigit(S)-u;return x<<12|S}}(am);var lm={};const $h=Vr,um=1335,bD=21522,hm=$h.getBCHDigit(um);lm.getEncodedBits=function(e,t){const n=e.bit<<3|t;let i=n<<10;for(;$h.getBCHDigit(i)-hm>=0;)i^=um<<$h.getBCHDigit(i)-hm;return(n<<10|i)^bD};var fm={};const _D=gi;function Ls(r){this.mode=_D.NUMERIC,this.data=r.toString()}Ls.getBitsLength=function(e){return 10*Math.floor(e/3)+(e%3?e%3*3+1:0)},Ls.prototype.getLength=function(){return this.data.length},Ls.prototype.getBitsLength=function(){return Ls.getBitsLength(this.data.length)},Ls.prototype.write=function(e){let t,n,i;for(t=0;t+3<=this.data.length;t+=3)n=this.data.substr(t,3),i=parseInt(n,10),e.put(i,10);const a=this.data.length-t;a>0&&(n=this.data.substr(t),i=parseInt(n,10),e.put(i,a*3+1))};var ED=Ls;const xD=gi,Ah=["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 Ms(r){this.mode=xD.ALPHANUMERIC,this.data=r}Ms.getBitsLength=function(e){return 11*Math.floor(e/2)+6*(e%2)},Ms.prototype.getLength=function(){return this.data.length},Ms.prototype.getBitsLength=function(){return Ms.getBitsLength(this.data.length)},Ms.prototype.write=function(e){let t;for(t=0;t+2<=this.data.length;t+=2){let n=Ah.indexOf(this.data[t])*45;n+=Ah.indexOf(this.data[t+1]),e.put(n,11)}this.data.length%2&&e.put(Ah.indexOf(this.data[t]),6)};var ID=Ms,DD=function(e){for(var t=[],n=e.length,i=0;i<n;i++){var a=e.charCodeAt(i);if(a>=55296&&a<=56319&&n>i+1){var c=e.charCodeAt(i+1);c>=56320&&c<=57343&&(a=(a-55296)*1024+c-56320+65536,i+=1)}if(a<128){t.push(a);continue}if(a<2048){t.push(a>>6|192),t.push(a&63|128);continue}if(a<55296||a>=57344&&a<65536){t.push(a>>12|224),t.push(a>>6&63|128),t.push(a&63|128);continue}if(a>=65536&&a<=1114111){t.push(a>>18|240),t.push(a>>12&63|128),t.push(a>>6&63|128),t.push(a&63|128);continue}t.push(239,191,189)}return new Uint8Array(t).buffer};const SD=DD,CD=gi;function Us(r){this.mode=CD.BYTE,typeof r=="string"&&(r=SD(r)),this.data=new Uint8Array(r)}Us.getBitsLength=function(e){return e*8},Us.prototype.getLength=function(){return this.data.length},Us.prototype.getBitsLength=function(){return Us.getBitsLength(this.data.length)},Us.prototype.write=function(r){for(let e=0,t=this.data.length;e<t;e++)r.put(this.data[e],8)};var OD=Us;const $D=gi,AD=Vr;function js(r){this.mode=$D.KANJI,this.data=r}js.getBitsLength=function(e){return e*13},js.prototype.getLength=function(){return this.data.length},js.prototype.getBitsLength=function(){return js.getBitsLength(this.data.length)},js.prototype.write=function(r){let e;for(e=0;e<this.data.length;e++){let t=AD.toSJIS(this.data[e]);if(t>=33088&&t<=40956)t-=33088;else if(t>=57408&&t<=60351)t-=49472;else throw new Error("Invalid SJIS character: "+this.data[e]+`
133
+ Make sure your charset is UTF-8`);t=(t>>>8&255)*192+(t&255),r.put(t,13)}};var PD=js,dm={exports:{}};(function(r){var e={single_source_shortest_paths:function(t,n,i){var a={},c={};c[n]=0;var u=e.PriorityQueue.make();u.push(n,0);for(var f,h,m,w,y,x,S,P,U;!u.empty();){f=u.pop(),h=f.value,w=f.cost,y=t[h]||{};for(m in y)y.hasOwnProperty(m)&&(x=y[m],S=w+x,P=c[m],U=typeof c[m]>"u",(U||P>S)&&(c[m]=S,u.push(m,S),a[m]=h))}if(typeof i<"u"&&typeof c[i]>"u"){var j=["Could not find a path from ",n," to ",i,"."].join("");throw new Error(j)}return a},extract_shortest_path_from_predecessor_list:function(t,n){for(var i=[],a=n;a;)i.push(a),t[a],a=t[a];return i.reverse(),i},find_path:function(t,n,i){var a=e.single_source_shortest_paths(t,n,i);return e.extract_shortest_path_from_predecessor_list(a,i)},PriorityQueue:{make:function(t){var n=e.PriorityQueue,i={},a;t=t||{};for(a in n)n.hasOwnProperty(a)&&(i[a]=n[a]);return i.queue=[],i.sorter=t.sorter||n.default_sorter,i},default_sorter:function(t,n){return t.cost-n.cost},push:function(t,n){var i={value:t,cost:n};this.queue.push(i),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};r.exports=e})(dm),function(r){const e=gi,t=ED,n=ID,i=OD,a=PD,c=Sn,u=Vr,f=dm.exports;function h(j){return unescape(encodeURIComponent(j)).length}function m(j,A,T){const C=[];let $;for(;($=j.exec(T))!==null;)C.push({data:$[0],index:$.index,mode:A,length:$[0].length});return C}function w(j){const A=m(c.NUMERIC,e.NUMERIC,j),T=m(c.ALPHANUMERIC,e.ALPHANUMERIC,j);let C,$;return u.isKanjiModeEnabled()?(C=m(c.BYTE,e.BYTE,j),$=m(c.KANJI,e.KANJI,j)):(C=m(c.BYTE_KANJI,e.BYTE,j),$=[]),A.concat(T,C,$).sort(function(d,b){return d.index-b.index}).map(function(d){return{data:d.data,mode:d.mode,length:d.length}})}function y(j,A){switch(A){case e.NUMERIC:return t.getBitsLength(j);case e.ALPHANUMERIC:return n.getBitsLength(j);case e.KANJI:return a.getBitsLength(j);case e.BYTE:return i.getBitsLength(j)}}function x(j){return j.reduce(function(A,T){const C=A.length-1>=0?A[A.length-1]:null;return C&&C.mode===T.mode?(A[A.length-1].data+=T.data,A):(A.push(T),A)},[])}function S(j){const A=[];for(let T=0;T<j.length;T++){const C=j[T];switch(C.mode){case e.NUMERIC:A.push([C,{data:C.data,mode:e.ALPHANUMERIC,length:C.length},{data:C.data,mode:e.BYTE,length:C.length}]);break;case e.ALPHANUMERIC:A.push([C,{data:C.data,mode:e.BYTE,length:C.length}]);break;case e.KANJI:A.push([C,{data:C.data,mode:e.BYTE,length:h(C.data)}]);break;case e.BYTE:A.push([{data:C.data,mode:e.BYTE,length:h(C.data)}])}}return A}function P(j,A){const T={},C={start:{}};let $=["start"];for(let E=0;E<j.length;E++){const d=j[E],b=[];for(let H=0;H<d.length;H++){const F=d[H],V=""+E+H;b.push(V),T[V]={node:F,lastCount:0},C[V]={};for(let se=0;se<$.length;se++){const ce=$[se];T[ce]&&T[ce].node.mode===F.mode?(C[ce][V]=y(T[ce].lastCount+F.length,F.mode)-y(T[ce].lastCount,F.mode),T[ce].lastCount+=F.length):(T[ce]&&(T[ce].lastCount=F.length),C[ce][V]=y(F.length,F.mode)+4+e.getCharCountIndicator(F.mode,A))}}$=b}for(let E=0;E<$.length;E++)C[$[E]].end=0;return{map:C,table:T}}function U(j,A){let T;const C=e.getBestModeForData(j);if(T=e.from(A,C),T!==e.BYTE&&T.bit<C.bit)throw new Error('"'+j+'" cannot be encoded with mode '+e.toString(T)+`.
134
+ Suggested mode is: `+e.toString(C));switch(T===e.KANJI&&!u.isKanjiModeEnabled()&&(T=e.BYTE),T){case e.NUMERIC:return new t(j);case e.ALPHANUMERIC:return new n(j);case e.KANJI:return new a(j);case e.BYTE:return new i(j)}}r.fromArray=function(A){return A.reduce(function(T,C){return typeof C=="string"?T.push(U(C,null)):C.data&&T.push(U(C.data,C.mode)),T},[])},r.fromString=function(A,T){const C=w(A,u.isKanjiModeEnabled()),$=S(C),E=P($,T),d=f.find_path(E.map,"start","end"),b=[];for(let H=1;H<d.length-1;H++)b.push(E.table[d[H]].node);return r.fromArray(x(b))},r.rawSplit=function(A){return r.fromArray(w(A,u.isKanjiModeEnabled()))}}(fm);const yc=Vr,Ph=fc,TD=hD,RD=fD,ND=tm,LD=rm,Th=im,Rh=dc,MD=pD,wc=am,UD=lm,jD=gi,Nh=fm;function FD(r,e){const t=r.size,n=LD.getPositions(e);for(let i=0;i<n.length;i++){const a=n[i][0],c=n[i][1];for(let u=-1;u<=7;u++)if(!(a+u<=-1||t<=a+u))for(let f=-1;f<=7;f++)c+f<=-1||t<=c+f||(u>=0&&u<=6&&(f===0||f===6)||f>=0&&f<=6&&(u===0||u===6)||u>=2&&u<=4&&f>=2&&f<=4?r.set(a+u,c+f,!0,!0):r.set(a+u,c+f,!1,!0))}}function BD(r){const e=r.size;for(let t=8;t<e-8;t++){const n=t%2===0;r.set(t,6,n,!0),r.set(6,t,n,!0)}}function kD(r,e){const t=ND.getPositions(e);for(let n=0;n<t.length;n++){const i=t[n][0],a=t[n][1];for(let c=-2;c<=2;c++)for(let u=-2;u<=2;u++)c===-2||c===2||u===-2||u===2||c===0&&u===0?r.set(i+c,a+u,!0,!0):r.set(i+c,a+u,!1,!0)}}function qD(r,e){const t=r.size,n=wc.getEncodedBits(e);let i,a,c;for(let u=0;u<18;u++)i=Math.floor(u/3),a=u%3+t-8-3,c=(n>>u&1)===1,r.set(i,a,c,!0),r.set(a,i,c,!0)}function Lh(r,e,t){const n=r.size,i=UD.getEncodedBits(e,t);let a,c;for(a=0;a<15;a++)c=(i>>a&1)===1,a<6?r.set(a,8,c,!0):a<8?r.set(a+1,8,c,!0):r.set(n-15+a,8,c,!0),a<8?r.set(8,n-a-1,c,!0):a<9?r.set(8,15-a-1+1,c,!0):r.set(8,15-a-1,c,!0);r.set(n-8,8,1,!0)}function zD(r,e){const t=r.size;let n=-1,i=t-1,a=7,c=0;for(let u=t-1;u>0;u-=2)for(u===6&&u--;;){for(let f=0;f<2;f++)if(!r.isReserved(i,u-f)){let h=!1;c<e.length&&(h=(e[c]>>>a&1)===1),r.set(i,u-f,h),a--,a===-1&&(c++,a=7)}if(i+=n,i<0||t<=i){i-=n,n=-n;break}}}function HD(r,e,t){const n=new TD;t.forEach(function(f){n.put(f.mode.bit,4),n.put(f.getLength(),jD.getCharCountIndicator(f.mode,r)),f.write(n)});const i=yc.getSymbolTotalCodewords(r),a=Rh.getTotalCodewordsCount(r,e),c=(i-a)*8;for(n.getLengthInBits()+4<=c&&n.put(0,4);n.getLengthInBits()%8!==0;)n.putBit(0);const u=(c-n.getLengthInBits())/8;for(let f=0;f<u;f++)n.put(f%2?17:236,8);return WD(n,r,e)}function WD(r,e,t){const n=yc.getSymbolTotalCodewords(e),i=Rh.getTotalCodewordsCount(e,t),a=n-i,c=Rh.getBlocksCount(e,t),u=n%c,f=c-u,h=Math.floor(n/c),m=Math.floor(a/c),w=m+1,y=h-m,x=new MD(y);let S=0;const P=new Array(c),U=new Array(c);let j=0;const A=new Uint8Array(r.buffer);for(let d=0;d<c;d++){const b=d<f?m:w;P[d]=A.slice(S,S+b),U[d]=x.encode(P[d]),S+=b,j=Math.max(j,b)}const T=new Uint8Array(n);let C=0,$,E;for($=0;$<j;$++)for(E=0;E<c;E++)$<P[E].length&&(T[C++]=P[E][$]);for($=0;$<y;$++)for(E=0;E<c;E++)T[C++]=U[E][$];return T}function KD(r,e,t,n){let i;if(Array.isArray(r))i=Nh.fromArray(r);else if(typeof r=="string"){let h=e;if(!h){const m=Nh.rawSplit(r);h=wc.getBestVersionForData(m,t)}i=Nh.fromString(r,h||40)}else throw new Error("Invalid data");const a=wc.getBestVersionForData(i,t);if(!a)throw new Error("The amount of data is too big to be stored in a QR Code");if(!e)e=a;else if(e<a)throw new Error(`
135
135
  The chosen QR Code version cannot contain this amount of data.
136
136
  Minimum version required to store current data is: `+a+`.
137
- `);const c=HD(e,t,i),u=yc.getSymbolSize(e),d=new PD(u);return UD(d,e),jD(d),FD(d,e),Lh(d,t,0),e>=7&&BD(d,e),kD(d,c),isNaN(n)&&(n=Th.getBestMask(d,Lh.bind(null,d,t))),Th.applyMask(n,d),Lh(d,t,n),{modules:d,version:e,errorCorrectionLevel:t,maskPattern:n,segments:i}}Qg.create=function(e,t){if(typeof e>"u"||e==="")throw new Error("No input text");let n=Ph.M,i,a;return typeof t<"u"&&(n=Ph.from(t.errorCorrectionLevel,Ph.M),i=bc.from(t.version),a=Th.from(t.maskPattern),t.toSJISFunc&&yc.setToSJISFunction(t.toSJISFunc)),qD(e,i,n,a)};var dm={},Mh={};(function(r){function e(t){if(typeof t=="number"&&(t=t.toString()),typeof t!="string")throw new Error("Color should be defined as hex string");let n=t.slice().replace("#","").split("");if(n.length<3||n.length===5||n.length>8)throw new Error("Invalid hex color: "+t);(n.length===3||n.length===4)&&(n=Array.prototype.concat.apply([],n.map(function(a){return[a,a]}))),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("")}}r.getOptions=function(n){n||(n={}),n.color||(n.color={});const i=typeof n.margin>"u"||n.margin===null||n.margin<0?4:n.margin,a=n.width&&n.width>=21?n.width:void 0,c=n.scale||4;return{width:a,scale:a?4:c,margin:i,color:{dark:e(n.color.dark||"#000000ff"),light:e(n.color.light||"#ffffffff")},type:n.type,rendererOpts:n.rendererOpts||{}}},r.getScale=function(n,i){return i.width&&i.width>=n+i.margin*2?i.width/(n+i.margin*2):i.scale},r.getImageWidth=function(n,i){const a=r.getScale(n,i);return Math.floor((n+i.margin*2)*a)},r.qrToImageData=function(n,i,a){const c=i.modules.size,u=i.modules.data,d=r.getScale(c,a),h=Math.floor((c+a.margin*2)*d),m=a.margin*d,y=[a.color.light,a.color.dark];for(let w=0;w<h;w++)for(let E=0;E<h;E++){let I=(w*h+E)*4,T=a.color.light;if(w>=m&&E>=m&&w<h-m&&E<h-m){const U=Math.floor((w-m)/d),F=Math.floor((E-m)/d);T=y[u[U*c+F]?1:0]}n[I++]=T.r,n[I++]=T.g,n[I++]=T.b,n[I]=T.a}}})(Mh),function(r){const e=Mh;function t(i,a,c){i.clearRect(0,0,a.width,a.height),a.style||(a.style={}),a.height=c,a.width=c,a.style.height=c+"px",a.style.width=c+"px"}function n(){try{return document.createElement("canvas")}catch{throw new Error("You need to specify a canvas element")}}r.render=function(a,c,u){let d=u,h=c;typeof d>"u"&&(!c||!c.getContext)&&(d=c,c=void 0),c||(h=n()),d=e.getOptions(d);const m=e.getImageWidth(a.modules.size,d),y=h.getContext("2d"),w=y.createImageData(m,m);return e.qrToImageData(w.data,a,d),t(y,h,m),y.putImageData(w,0,0),h},r.renderToDataURL=function(a,c,u){let d=u;typeof d>"u"&&(!c||!c.getContext)&&(d=c,c=void 0),d||(d={});const h=r.render(a,c,d),m=d.type||"image/png",y=d.rendererOpts||{};return h.toDataURL(m,y.quality)}}(dm);var pm={};const WD=Mh;function gm(r,e){const t=r.a/255,n=e+'="'+r.hex+'"';return t<1?n+" "+e+'-opacity="'+t.toFixed(2).slice(1)+'"':n}function Uh(r,e,t){let n=r+e;return typeof t<"u"&&(n+=" "+t),n}function KD(r,e,t){let n="",i=0,a=!1,c=0;for(let u=0;u<r.length;u++){const d=Math.floor(u%e),h=Math.floor(u/e);!d&&!a&&(a=!0),r[u]?(c++,u>0&&d>0&&r[u-1]||(n+=a?Uh("M",d+t,.5+h+t):Uh("m",i,0),i=0,a=!1),d+1<e&&r[u+1]||(n+=Uh("h",c),c=0)):i++}return n}pm.render=function(e,t,n){const i=WD.getOptions(t),a=e.modules.size,c=e.modules.data,u=a+i.margin*2,d=i.color.light.a?"<path "+gm(i.color.light,"fill")+' d="M0 0h'+u+"v"+u+'H0z"/>':"",h="<path "+gm(i.color.dark,"stroke")+' d="'+KD(c,a,i.margin)+'"/>',m='viewBox="0 0 '+u+" "+u+'"',w='<svg xmlns="http://www.w3.org/2000/svg" '+(i.width?'width="'+i.width+'" height="'+i.width+'" ':"")+m+' shape-rendering="crispEdges">'+d+h+`</svg>
138
- `;return typeof n=="function"&&n(null,w),w};const VD=aD,jh=Qg,mm=dm,GD=pm;function Fh(r,e,t,n,i){const a=[].slice.call(arguments,1),c=a.length,u=typeof a[c-1]=="function";if(!u&&!VD())throw new Error("Callback required as last argument");if(u){if(c<2)throw new Error("Too few arguments provided");c===2?(i=t,t=e,e=n=void 0):c===3&&(e.getContext&&typeof i>"u"?(i=n,n=void 0):(i=n,n=t,t=e,e=void 0))}else{if(c<1)throw new Error("Too few arguments provided");return c===1?(t=e,e=n=void 0):c===2&&!e.getContext&&(n=t,t=e,e=void 0),new Promise(function(d,h){try{const m=jh.create(t,n);d(r(m,e,n))}catch(m){h(m)}})}try{const d=jh.create(t,n);i(null,r(d,e,n))}catch(d){i(d)}}Vo.create=jh.create,Vo.toCanvas=Fh.bind(null,mm.render),Vo.toDataURL=Fh.bind(null,mm.renderToDataURL),Vo.toString=Fh.bind(null,function(r,e,t){return GD.render(r,t)});var YD=Object.defineProperty,vm=Object.getOwnPropertySymbols,JD=Object.prototype.hasOwnProperty,ZD=Object.prototype.propertyIsEnumerable,wm=(r,e,t)=>e in r?YD(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,Bh=(r,e)=>{for(var t in e||(e={}))JD.call(e,t)&&wm(r,t,e[t]);if(vm)for(var t of vm(e))ZD.call(e,t)&&wm(r,t,e[t]);return r};function QD(){var r;const e=(r=li.state.themeMode)!=null?r:"dark",t={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)"}}[e];return{"--wcm-color-fg-1":t.foreground[1],"--wcm-color-fg-2":t.foreground[2],"--wcm-color-fg-3":t.foreground[3],"--wcm-color-bg-1":t.background[1],"--wcm-color-bg-2":t.background[2],"--wcm-color-bg-3":t.background[3],"--wcm-color-overlay":t.overlay}}function ym(){return{"--wcm-accent-color":"#3396FF","--wcm-accent-fill-color":"#FFFFFF","--wcm-z-index":"89","--wcm-background-color":"#3396FF","--wcm-background-border-radius":"8px","--wcm-container-border-radius":"30px","--wcm-wallet-icon-border-radius":"15px","--wcm-wallet-icon-large-border-radius":"30px","--wcm-wallet-icon-small-border-radius":"7px","--wcm-input-border-radius":"28px","--wcm-button-border-radius":"10px","--wcm-notification-border-radius":"36px","--wcm-secondary-button-border-radius":"28px","--wcm-icon-button-border-radius":"50%","--wcm-button-hover-highlight-border-radius":"10px","--wcm-text-big-bold-size":"20px","--wcm-text-big-bold-weight":"600","--wcm-text-big-bold-line-height":"24px","--wcm-text-big-bold-letter-spacing":"-0.03em","--wcm-text-big-bold-text-transform":"none","--wcm-text-xsmall-bold-size":"10px","--wcm-text-xsmall-bold-weight":"700","--wcm-text-xsmall-bold-line-height":"12px","--wcm-text-xsmall-bold-letter-spacing":"0.02em","--wcm-text-xsmall-bold-text-transform":"uppercase","--wcm-text-xsmall-regular-size":"12px","--wcm-text-xsmall-regular-weight":"600","--wcm-text-xsmall-regular-line-height":"14px","--wcm-text-xsmall-regular-letter-spacing":"-0.03em","--wcm-text-xsmall-regular-text-transform":"none","--wcm-text-small-thin-size":"14px","--wcm-text-small-thin-weight":"500","--wcm-text-small-thin-line-height":"16px","--wcm-text-small-thin-letter-spacing":"-0.03em","--wcm-text-small-thin-text-transform":"none","--wcm-text-small-regular-size":"14px","--wcm-text-small-regular-weight":"600","--wcm-text-small-regular-line-height":"16px","--wcm-text-small-regular-letter-spacing":"-0.03em","--wcm-text-small-regular-text-transform":"none","--wcm-text-medium-regular-size":"16px","--wcm-text-medium-regular-weight":"600","--wcm-text-medium-regular-line-height":"20px","--wcm-text-medium-regular-letter-spacing":"-0.03em","--wcm-text-medium-regular-text-transform":"none","--wcm-font-family":"-apple-system, system-ui, BlinkMacSystemFont, 'Segoe UI', Roboto, Ubuntu, 'Helvetica Neue', sans-serif","--wcm-font-feature-settings":"'tnum' on, 'lnum' on, 'case' on","--wcm-success-color":"rgb(38,181,98)","--wcm-error-color":"rgb(242, 90, 103)","--wcm-overlay-background-color":"rgba(0, 0, 0, 0.3)","--wcm-overlay-backdrop-filter":"none"}}const rt={getPreset(r){return ym()[r]},setTheme(){const r=document.querySelector(":root"),{themeVariables:e}=li.state;if(r){const t=Bh(Bh(Bh({},QD()),ym()),e);Object.entries(t).forEach(([n,i])=>r.style.setProperty(n,i))}},globalCss:lt`*,::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;transition:all .2s ease}@media (hover:hover) and (pointer:fine){button:active{transition:all .1s ease;transform:scale(.93)}}button::after{content:'';position:absolute;top:0;bottom:0;left:0;right:0;transition:background-color,.2s ease}button:disabled{cursor:not-allowed}button svg,button wcm-text{position:relative;z-index:1}input{border:none;outline:0;appearance:none}img{display:block}::selection{color:var(--wcm-accent-fill-color);background:var(--wcm-accent-color)}`},XD=lt`button{border-radius:var(--wcm-secondary-button-border-radius);height:28px;padding:0 10px;background-color:var(--wcm-accent-color)}button path{fill:var(--wcm-accent-fill-color)}button::after{border-radius:inherit;border:1px solid var(--wcm-color-overlay)}button:disabled::after{background-color:transparent}.wcm-icon-left svg{margin-right:5px}.wcm-icon-right svg{margin-left:5px}button:active::after{background-color:var(--wcm-color-overlay)}.wcm-ghost,.wcm-ghost:active::after,.wcm-outline{background-color:transparent}.wcm-ghost:active{opacity:.5}@media(hover:hover){button:hover::after{background-color:var(--wcm-color-overlay)}.wcm-ghost:hover::after{background-color:transparent}.wcm-ghost:hover{opacity:.5}}button:disabled{background-color:var(--wcm-color-bg-3);pointer-events:none}.wcm-ghost::after{border-color:transparent}.wcm-ghost path{fill:var(--wcm-color-fg-2)}.wcm-outline path{fill:var(--wcm-accent-color)}.wcm-outline:disabled{background-color:transparent;opacity:.5}`;var eS=Object.defineProperty,tS=Object.getOwnPropertyDescriptor,js=(r,e,t,n)=>{for(var i=n>1?void 0:n?tS(e,t):e,a=r.length-1,c;a>=0;a--)(c=r[a])&&(i=(n?c(e,t,i):c(i))||i);return n&&i&&eS(e,t,i),i};let gi=class extends Ye{constructor(){super(...arguments),this.disabled=!1,this.iconLeft=void 0,this.iconRight=void 0,this.onClick=()=>null,this.variant="default"}render(){const r={"wcm-icon-left":this.iconLeft!==void 0,"wcm-icon-right":this.iconRight!==void 0,"wcm-ghost":this.variant==="ghost","wcm-outline":this.variant==="outline"};let e="inverse";return this.variant==="ghost"&&(e="secondary"),this.variant==="outline"&&(e="accent"),ue`<button class="${kn(r)}" ?disabled="${this.disabled}" @click="${this.onClick}">${this.iconLeft}<wcm-text variant="small-regular" color="${e}"><slot></slot></wcm-text>${this.iconRight}</button>`}};gi.styles=[rt.globalCss,XD],js([Be({type:Boolean})],gi.prototype,"disabled",2),js([Be()],gi.prototype,"iconLeft",2),js([Be()],gi.prototype,"iconRight",2),js([Be()],gi.prototype,"onClick",2),js([Be()],gi.prototype,"variant",2),gi=js([ot("wcm-button")],gi);const rS=lt`:host{display:inline-block}button{padding:0 15px 1px;height:40px;border-radius:var(--wcm-button-border-radius);color:var(--wcm-accent-fill-color);background-color:var(--wcm-accent-color)}button::after{content:'';top:0;bottom:0;left:0;right:0;position:absolute;background-color:transparent;border-radius:inherit;transition:background-color .2s ease;border:1px solid var(--wcm-color-overlay)}button:active::after{background-color:var(--wcm-color-overlay)}button:disabled{padding-bottom:0;background-color:var(--wcm-color-bg-3);color:var(--wcm-color-fg-3)}.wcm-secondary{color:var(--wcm-accent-color);background-color:transparent}.wcm-secondary::after{display:none}@media(hover:hover){button:hover::after{background-color:var(--wcm-color-overlay)}}`;var nS=Object.defineProperty,iS=Object.getOwnPropertyDescriptor,kh=(r,e,t,n)=>{for(var i=n>1?void 0:n?iS(e,t):e,a=r.length-1,c;a>=0;a--)(c=r[a])&&(i=(n?c(e,t,i):c(i))||i);return n&&i&&nS(e,t,i),i};let Zo=class extends Ye{constructor(){super(...arguments),this.disabled=!1,this.variant="primary"}render(){const r={"wcm-secondary":this.variant==="secondary"};return ue`<button ?disabled="${this.disabled}" class="${kn(r)}"><slot></slot></button>`}};Zo.styles=[rt.globalCss,rS],kh([Be({type:Boolean})],Zo.prototype,"disabled",2),kh([Be()],Zo.prototype,"variant",2),Zo=kh([ot("wcm-button-big")],Zo);const sS=lt`:host{background-color:var(--wcm-color-bg-2);border-top:1px solid var(--wcm-color-bg-3)}div{padding:10px 20px;display:inherit;flex-direction:inherit;align-items:inherit;width:inherit;justify-content:inherit}`;var oS=Object.defineProperty,aS=Object.getOwnPropertyDescriptor,cS=(r,e,t,n)=>{for(var i=n>1?void 0:n?aS(e,t):e,a=r.length-1,c;a>=0;a--)(c=r[a])&&(i=(n?c(e,t,i):c(i))||i);return n&&i&&oS(e,t,i),i};let Hh=class extends Ye{render(){return ue`<div><slot></slot></div>`}};Hh.styles=[rt.globalCss,sS],Hh=cS([ot("wcm-info-footer")],Hh);const ht={CROSS_ICON:Nt`<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>`,WALLET_CONNECT_LOGO:Nt`<svg width="178" height="29" viewBox="0 0 178 29" id="wcm-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:Nt`<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:Nt`<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:Nt`<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:Nt`<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:Nt`<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:Nt`<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:Nt`<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:Nt`<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:Nt`<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:Nt`<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:Nt`<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:Nt`<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:Nt`<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>`,SEARCH_ICON:Nt`<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>`,WALLET_PLACEHOLDER:Nt`<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>`,GLOBE_ICON:Nt`<svg width="16" height="16" fill="none" viewBox="0 0 16 16"><path fill="#fff" fill-rule="evenodd" d="M15.5 8a7.5 7.5 0 1 1-15 0 7.5 7.5 0 0 1 15 0Zm-2.113.75c.301 0 .535.264.47.558a6.01 6.01 0 0 1-2.867 3.896c-.203.116-.42-.103-.334-.32.409-1.018.691-2.274.797-3.657a.512.512 0 0 1 .507-.477h1.427Zm.47-2.058c.065.294-.169.558-.47.558H11.96a.512.512 0 0 1-.507-.477c-.106-1.383-.389-2.638-.797-3.656-.087-.217.13-.437.333-.32a6.01 6.01 0 0 1 2.868 3.895Zm-4.402.558c.286 0 .515-.24.49-.525-.121-1.361-.429-2.534-.83-3.393-.279-.6-.549-.93-.753-1.112a.535.535 0 0 0-.724 0c-.204.182-.474.513-.754 1.112-.4.859-.708 2.032-.828 3.393a.486.486 0 0 0 .49.525h2.909Zm-5.415 0c.267 0 .486-.21.507-.477.106-1.383.389-2.638.797-3.656.087-.217-.13-.437-.333-.32a6.01 6.01 0 0 0-2.868 3.895c-.065.294.169.558.47.558H4.04ZM2.143 9.308c-.065-.294.169-.558.47-.558H4.04c.267 0 .486.21.507.477.106 1.383.389 2.639.797 3.657.087.217-.13.436-.333.32a6.01 6.01 0 0 1-2.868-3.896Zm3.913-.033a.486.486 0 0 1 .49-.525h2.909c.286 0 .515.24.49.525-.121 1.361-.428 2.535-.83 3.394-.279.6-.549.93-.753 1.112a.535.535 0 0 1-.724 0c-.204-.182-.474-.513-.754-1.112-.4-.859-.708-2.033-.828-3.394Z" clip-rule="evenodd"/></svg>`},lS=lt`.wcm-toolbar-placeholder{top:0;bottom:0;left:0;right:0;width:100%;position:absolute;display:block;pointer-events:none;height:100px;border-radius:calc(var(--wcm-background-border-radius) * .9);background-color:var(--wcm-background-color);background-position:center;background-size:cover}.wcm-toolbar{height:38px;display:flex;position:relative;margin:5px 15px 5px 5px;justify-content:space-between;align-items:center}.wcm-toolbar img,.wcm-toolbar svg{height:28px;object-position:left center;object-fit:contain}#wcm-wc-logo path{fill:var(--wcm-accent-fill-color)}button{width:28px;height:28px;border-radius:var(--wcm-icon-button-border-radius);border:0;display:flex;justify-content:center;align-items:center;cursor:pointer;background-color:var(--wcm-color-bg-1);box-shadow:0 0 0 1px var(--wcm-color-overlay)}button:active{background-color:var(--wcm-color-bg-2)}button svg{display:block;object-position:center}button path{fill:var(--wcm-color-fg-1)}.wcm-toolbar div{display:flex}@media(hover:hover){button:hover{background-color:var(--wcm-color-bg-2)}}`;var uS=Object.defineProperty,hS=Object.getOwnPropertyDescriptor,fS=(r,e,t,n)=>{for(var i=n>1?void 0:n?hS(e,t):e,a=r.length-1,c;a>=0;a--)(c=r[a])&&(i=(n?c(e,t,i):c(i))||i);return n&&i&&uS(e,t,i),i};let zh=class extends Ye{render(){return ue`<div class="wcm-toolbar-placeholder"></div><div class="wcm-toolbar">${ht.WALLET_CONNECT_LOGO} <button @click="${qi.close}">${ht.CROSS_ICON}</button></div>`}};zh.styles=[rt.globalCss,lS],zh=fS([ot("wcm-modal-backcard")],zh);const dS=lt`main{padding:20px;padding-top:0;width:100%}`;var pS=Object.defineProperty,gS=Object.getOwnPropertyDescriptor,mS=(r,e,t,n)=>{for(var i=n>1?void 0:n?gS(e,t):e,a=r.length-1,c;a>=0;a--)(c=r[a])&&(i=(n?c(e,t,i):c(i))||i);return n&&i&&pS(e,t,i),i};let qh=class extends Ye{render(){return ue`<main><slot></slot></main>`}};qh.styles=[rt.globalCss,dS],qh=mS([ot("wcm-modal-content")],qh);const vS=lt`footer{padding:10px;display:flex;flex-direction:column;align-items:inherit;justify-content:inherit;border-top:1px solid var(--wcm-color-bg-2)}`;var wS=Object.defineProperty,yS=Object.getOwnPropertyDescriptor,bS=(r,e,t,n)=>{for(var i=n>1?void 0:n?yS(e,t):e,a=r.length-1,c;a>=0;a--)(c=r[a])&&(i=(n?c(e,t,i):c(i))||i);return n&&i&&wS(e,t,i),i};let Wh=class extends Ye{render(){return ue`<footer><slot></slot></footer>`}};Wh.styles=[rt.globalCss,vS],Wh=bS([ot("wcm-modal-footer")],Wh);const _S=lt`header{display:flex;justify-content:center;align-items:center;padding:20px;position:relative}.wcm-border{border-bottom:1px solid var(--wcm-color-bg-2);margin-bottom:20px}header button{padding:15px 20px}header button:active{opacity:.5}@media(hover:hover){header button:hover{opacity:.5}}.wcm-back-btn{position:absolute;left:0}.wcm-action-btn{position:absolute;right:0}path{fill:var(--wcm-accent-color)}`;var ES=Object.defineProperty,xS=Object.getOwnPropertyDescriptor,Qo=(r,e,t,n)=>{for(var i=n>1?void 0:n?xS(e,t):e,a=r.length-1,c;a>=0;a--)(c=r[a])&&(i=(n?c(e,t,i):c(i))||i);return n&&i&&ES(e,t,i),i};let Qi=class extends Ye{constructor(){super(...arguments),this.title="",this.onAction=void 0,this.actionIcon=void 0,this.border=!1}backBtnTemplate(){return ue`<button class="wcm-back-btn" @click="${At.goBack}">${ht.BACK_ICON}</button>`}actionBtnTemplate(){return ue`<button class="wcm-action-btn" @click="${this.onAction}">${this.actionIcon}</button>`}render(){const r={"wcm-border":this.border},e=At.state.history.length>1,t=this.title?ue`<wcm-text variant="big-bold">${this.title}</wcm-text>`:ue`<slot></slot>`;return ue`<header class="${kn(r)}">${e?this.backBtnTemplate():null} ${t} ${this.onAction?this.actionBtnTemplate():null}</header>`}};Qi.styles=[rt.globalCss,_S],Qo([Be()],Qi.prototype,"title",2),Qo([Be()],Qi.prototype,"onAction",2),Qo([Be()],Qi.prototype,"actionIcon",2),Qo([Be({type:Boolean})],Qi.prototype,"border",2),Qi=Qo([ot("wcm-modal-header")],Qi);const Pe={MOBILE_BREAKPOINT:600,WCM_RECENT_WALLET_DATA:"WCM_RECENT_WALLET_DATA",EXPLORER_WALLET_URL:"https://explorer.walletconnect.com/?type=wallet",getShadowRootElement(r,e){const t=r.renderRoot.querySelector(e);if(!t)throw new Error(`${e} not found`);return t},getWalletIcon({id:r,image_id:e}){const{walletImages:t}=Wr.state;return t!=null&&t[r]?t[r]:e?Lr.getWalletImageUrl(e):""},getWalletName(r,e=!1){return e&&r.length>8?`${r.substring(0,8)}..`:r},isMobileAnimation(){return window.innerWidth<=Pe.MOBILE_BREAKPOINT},async preloadImage(r){const e=new Promise((t,n)=>{const i=new Image;i.onload=t,i.onerror=n,i.crossOrigin="anonymous",i.src=r});return Promise.race([e,ye.wait(3e3)])},getErrorMessage(r){return r instanceof Error?r.message:"Unknown Error"},debounce(r,e=500){let t;return(...n)=>{function i(){r(...n)}t&&clearTimeout(t),t=setTimeout(i,e)}},handleMobileLinking(r){const{walletConnectUri:e}=Ht.state,{mobile:t,name:n}=r,i=t?.native,a=t?.universal;Pe.setRecentWallet(r);function c(u){let d="";i?d=ye.formatUniversalUrl(i,u,n):a&&(d=ye.formatNativeUrl(a,u,n)),ye.openHref(d,"_self")}e&&c(e)},handleAndroidLinking(){const{walletConnectUri:r}=Ht.state;r&&(ye.setWalletConnectAndroidDeepLink(r),ye.openHref(r,"_self"))},async handleUriCopy(){const{walletConnectUri:r}=Ht.state;if(r)try{await navigator.clipboard.writeText(r),ui.openToast("Link copied","success")}catch{ui.openToast("Failed to copy","error")}},getCustomImageUrls(){const{walletImages:r}=Wr.state,e=Object.values(r??{});return Object.values(e)},truncate(r,e=8){return r.length<=e?r:`${r.substring(0,4)}...${r.substring(r.length-4)}`},setRecentWallet(r){try{localStorage.setItem(Pe.WCM_RECENT_WALLET_DATA,JSON.stringify(r))}catch{console.info("Unable to set recent wallet")}},getRecentWallet(){try{const r=localStorage.getItem(Pe.WCM_RECENT_WALLET_DATA);return r?JSON.parse(r):void 0}catch{console.info("Unable to get recent wallet")}},caseSafeIncludes(r,e){return r.toUpperCase().includes(e.toUpperCase())},openWalletExplorerUrl(){ye.openHref(Pe.EXPLORER_WALLET_URL,"_blank")},getCachedRouterWalletPlatforms(){const{desktop:r,mobile:e}=ye.getWalletRouterData(),t=!!r?.native,n=!!r?.universal,i=!!e?.native||!!e?.universal;return{isDesktop:t,isMobile:i,isWeb:n}},goToConnectingView(r){At.setData({Wallet:r});const e=ye.isMobile(),{isDesktop:t,isWeb:n,isMobile:i}=Pe.getCachedRouterWalletPlatforms();e?i?At.push("MobileConnecting"):n?At.push("WebConnecting"):At.push("InstallWallet"):t?At.push("DesktopConnecting"):n?At.push("WebConnecting"):i?At.push("MobileQrcodeConnecting"):At.push("InstallWallet")}},IS=lt`.wcm-router{overflow:hidden;will-change:transform}.wcm-content{display:flex;flex-direction:column}`;var DS=Object.defineProperty,SS=Object.getOwnPropertyDescriptor,Kh=(r,e,t,n)=>{for(var i=n>1?void 0:n?SS(e,t):e,a=r.length-1,c;a>=0;a--)(c=r[a])&&(i=(n?c(e,t,i):c(i))||i);return n&&i&&DS(e,t,i),i};let Xo=class extends Ye{constructor(){super(),this.view=At.state.view,this.prevView=At.state.view,this.unsubscribe=void 0,this.oldHeight="0px",this.resizeObserver=void 0,this.unsubscribe=At.subscribe(r=>{this.view!==r.view&&this.onChangeRoute()})}firstUpdated(){this.resizeObserver=new ResizeObserver(([r])=>{const e=`${r.contentRect.height}px`;this.oldHeight!=="0px"&&Zi(this.routerEl,{height:[this.oldHeight,e]},{duration:.2}),this.oldHeight=e}),this.resizeObserver.observe(this.contentEl)}disconnectedCallback(){var r,e;(r=this.unsubscribe)==null||r.call(this),(e=this.resizeObserver)==null||e.disconnect()}get routerEl(){return Pe.getShadowRootElement(this,".wcm-router")}get contentEl(){return Pe.getShadowRootElement(this,".wcm-content")}viewTemplate(){switch(this.view){case"ConnectWallet":return ue`<wcm-connect-wallet-view></wcm-connect-wallet-view>`;case"DesktopConnecting":return ue`<wcm-desktop-connecting-view></wcm-desktop-connecting-view>`;case"MobileConnecting":return ue`<wcm-mobile-connecting-view></wcm-mobile-connecting-view>`;case"WebConnecting":return ue`<wcm-web-connecting-view></wcm-web-connecting-view>`;case"MobileQrcodeConnecting":return ue`<wcm-mobile-qr-connecting-view></wcm-mobile-qr-connecting-view>`;case"WalletExplorer":return ue`<wcm-wallet-explorer-view></wcm-wallet-explorer-view>`;case"Qrcode":return ue`<wcm-qrcode-view></wcm-qrcode-view>`;case"InstallWallet":return ue`<wcm-install-wallet-view></wcm-install-wallet-view>`;default:return ue`<div>Not Found</div>`}}async onChangeRoute(){await Zi(this.routerEl,{opacity:[1,0],scale:[1,1.02]},{duration:.15,delay:.1}).finished,this.view=At.state.view,Zi(this.routerEl,{opacity:[0,1],scale:[.99,1]},{duration:.37,delay:.05})}render(){return ue`<div class="wcm-router"><div class="wcm-content">${this.viewTemplate()}</div></div>`}};Xo.styles=[rt.globalCss,IS],Kh([Mr()],Xo.prototype,"view",2),Kh([Mr()],Xo.prototype,"prevView",2),Xo=Kh([ot("wcm-modal-router")],Xo);const OS=lt`div{height:36px;width:max-content;display:flex;justify-content:center;align-items:center;padding:9px 15px 11px;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:var(--wcm-notification-border-radius);border:1px solid var(--wcm-color-overlay);background-color:var(--wcm-color-overlay)}svg{margin-right:5px}@-moz-document url-prefix(){div{background-color:var(--wcm-color-bg-3)}}.wcm-success path{fill:var(--wcm-accent-color)}.wcm-error path{fill:var(--wcm-error-color)}`;var CS=Object.defineProperty,$S=Object.getOwnPropertyDescriptor,bm=(r,e,t,n)=>{for(var i=n>1?void 0:n?$S(e,t):e,a=r.length-1,c;a>=0;a--)(c=r[a])&&(i=(n?c(e,t,i):c(i))||i);return n&&i&&CS(e,t,i),i};let _c=class extends Ye{constructor(){super(),this.open=!1,this.unsubscribe=void 0,this.timeout=void 0,this.unsubscribe=ui.subscribe(r=>{r.open?(this.open=!0,this.timeout=setTimeout(()=>ui.closeToast(),2200)):(this.open=!1,clearTimeout(this.timeout))})}disconnectedCallback(){var r;(r=this.unsubscribe)==null||r.call(this),clearTimeout(this.timeout),ui.closeToast()}render(){const{message:r,variant:e}=ui.state,t={"wcm-success":e==="success","wcm-error":e==="error"};return this.open?ue`<div class="${kn(t)}">${e==="success"?ht.CHECKMARK_ICON:null} ${e==="error"?ht.CROSS_ICON:null}<wcm-text variant="small-regular">${r}</wcm-text></div>`:null}};_c.styles=[rt.globalCss,OS],bm([Mr()],_c.prototype,"open",2),_c=bm([ot("wcm-modal-toast")],_c);const AS=.1,_m=2.5,Hn=7;function Vh(r,e,t){return r===e?!1:(r-e<0?e-r:r-e)<=t+AS}function PS(r,e){const t=Array.prototype.slice.call(Vo.create(r,{errorCorrectionLevel:e}).modules.data,0),n=Math.sqrt(t.length);return t.reduce((i,a,c)=>(c%n===0?i.push([a]):i[i.length-1].push(a))&&i,[])}const TS={generate(r,e,t){const n="#141414",i="#ffffff",a=[],c=PS(r,"Q"),u=e/c.length,d=[{x:0,y:0},{x:1,y:0},{x:0,y:1}];d.forEach(({x:I,y:T})=>{const U=(c.length-Hn)*u*I,F=(c.length-Hn)*u*T,$=.45;for(let P=0;P<d.length;P+=1){const O=u*(Hn-P*2);a.push(Nt`<rect fill="${P%2===0?n:i}" height="${O}" rx="${O*$}" ry="${O*$}" width="${O}" x="${U+u*P}" y="${F+u*P}">`)}});const h=Math.floor((t+25)/u),m=c.length/2-h/2,y=c.length/2+h/2-1,w=[];c.forEach((I,T)=>{I.forEach((U,F)=>{if(c[T][F]&&!(T<Hn&&F<Hn||T>c.length-(Hn+1)&&F<Hn||T<Hn&&F>c.length-(Hn+1))&&!(T>m&&T<y&&F>m&&F<y)){const $=T*u+u/2,P=F*u+u/2;w.push([$,P])}})});const E={};return w.forEach(([I,T])=>{E[I]?E[I].push(T):E[I]=[T]}),Object.entries(E).map(([I,T])=>{const U=T.filter(F=>T.every($=>!Vh(F,$,u)));return[Number(I),U]}).forEach(([I,T])=>{T.forEach(U=>{a.push(Nt`<circle cx="${I}" cy="${U}" fill="${n}" r="${u/_m}">`)})}),Object.entries(E).filter(([I,T])=>T.length>1).map(([I,T])=>{const U=T.filter(F=>T.some($=>Vh(F,$,u)));return[Number(I),U]}).map(([I,T])=>{T.sort((F,$)=>F<$?-1:1);const U=[];for(const F of T){const $=U.find(P=>P.some(O=>Vh(F,O,u)));$?$.push(F):U.push([F])}return[I,U.map(F=>[F[0],F[F.length-1]])]}).forEach(([I,T])=>{T.forEach(([U,F])=>{a.push(Nt`<line x1="${I}" x2="${I}" y1="${U}" y2="${F}" stroke="${n}" stroke-width="${u/(_m/2)}" stroke-linecap="round">`)})}),a}},RS=lt`@keyframes fadeIn{0%{opacity:0}100%{opacity:1}}div{position:relative;user-select:none;display:block;overflow:hidden;aspect-ratio:1/1;animation:fadeIn ease .2s}.wcm-dark{background-color:#fff;border-radius:var(--wcm-container-border-radius);padding:18px;box-shadow:0 2px 5px #000}svg:first-child,wcm-wallet-image{position:absolute;top:50%;left:50%;transform:translateY(-50%) translateX(-50%)}wcm-wallet-image{transform:translateY(-50%) translateX(-50%)}wcm-wallet-image{width:25%;height:25%;border-radius:var(--wcm-wallet-icon-border-radius)}svg:first-child{transform:translateY(-50%) translateX(-50%) scale(.9)}svg:first-child path:first-child{fill:var(--wcm-accent-color)}svg:first-child path:last-child{stroke:var(--wcm-color-overlay)}`;var NS=Object.defineProperty,LS=Object.getOwnPropertyDescriptor,Fs=(r,e,t,n)=>{for(var i=n>1?void 0:n?LS(e,t):e,a=r.length-1,c;a>=0;a--)(c=r[a])&&(i=(n?c(e,t,i):c(i))||i);return n&&i&&NS(e,t,i),i};let zn=class extends Ye{constructor(){super(...arguments),this.uri="",this.size=0,this.imageId=void 0,this.walletId=void 0,this.imageUrl=void 0}svgTemplate(){const r=li.state.themeMode==="light"?this.size:this.size-36;return Nt`<svg height="${r}" width="${r}">${TS.generate(this.uri,r,r/4)}</svg>`}render(){const r={"wcm-dark":li.state.themeMode==="dark"};return ue`<div style="${`width: ${this.size}px`}" class="${kn(r)}">${this.walletId||this.imageUrl?ue`<wcm-wallet-image walletId="${Ir(this.walletId)}" imageId="${Ir(this.imageId)}" imageUrl="${Ir(this.imageUrl)}"></wcm-wallet-image>`:ht.WALLET_CONNECT_ICON_COLORED} ${this.svgTemplate()}</div>`}};zn.styles=[rt.globalCss,RS],Fs([Be()],zn.prototype,"uri",2),Fs([Be({type:Number})],zn.prototype,"size",2),Fs([Be()],zn.prototype,"imageId",2),Fs([Be()],zn.prototype,"walletId",2),Fs([Be()],zn.prototype,"imageUrl",2),zn=Fs([ot("wcm-qrcode")],zn);const MS=lt`:host{position:relative;height:28px;width:80%}input{width:100%;height:100%;line-height:28px!important;border-radius:var(--wcm-input-border-radius);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:var(--wcm-color-fg-1);background-color:var(--wcm-color-bg-3);box-shadow:inset 0 0 0 1px var(--wcm-color-overlay);caret-color:var(--wcm-accent-color)}input::placeholder{color:var(--wcm-color-fg-2)}svg{left:10px;top:4px;pointer-events:none;position:absolute;width:20px;height:20px}input:focus-within{box-shadow:inset 0 0 0 1px var(--wcm-accent-color)}path{fill:var(--wcm-color-fg-2)}`;var US=Object.defineProperty,jS=Object.getOwnPropertyDescriptor,Em=(r,e,t,n)=>{for(var i=n>1?void 0:n?jS(e,t):e,a=r.length-1,c;a>=0;a--)(c=r[a])&&(i=(n?c(e,t,i):c(i))||i);return n&&i&&US(e,t,i),i};let Ec=class extends Ye{constructor(){super(...arguments),this.onChange=()=>null}render(){return ue`<input type="text" @input="${this.onChange}" placeholder="Search wallets"> ${ht.SEARCH_ICON}`}};Ec.styles=[rt.globalCss,MS],Em([Be()],Ec.prototype,"onChange",2),Ec=Em([ot("wcm-search-input")],Ec);const FS=lt`@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(--wcm-accent-color)}`;var BS=Object.defineProperty,kS=Object.getOwnPropertyDescriptor,HS=(r,e,t,n)=>{for(var i=n>1?void 0:n?kS(e,t):e,a=r.length-1,c;a>=0;a--)(c=r[a])&&(i=(n?c(e,t,i):c(i))||i);return n&&i&&BS(e,t,i),i};let Gh=class extends Ye{render(){return ue`<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>`}};Gh.styles=[rt.globalCss,FS],Gh=HS([ot("wcm-spinner")],Gh);const zS=lt`span{font-style:normal;font-family:var(--wcm-font-family);font-feature-settings:var(--wcm-font-feature-settings)}.wcm-xsmall-bold{font-family:var(--wcm-text-xsmall-bold-font-family);font-weight:var(--wcm-text-xsmall-bold-weight);font-size:var(--wcm-text-xsmall-bold-size);line-height:var(--wcm-text-xsmall-bold-line-height);letter-spacing:var(--wcm-text-xsmall-bold-letter-spacing);text-transform:var(--wcm-text-xsmall-bold-text-transform)}.wcm-xsmall-regular{font-family:var(--wcm-text-xsmall-regular-font-family);font-weight:var(--wcm-text-xsmall-regular-weight);font-size:var(--wcm-text-xsmall-regular-size);line-height:var(--wcm-text-xsmall-regular-line-height);letter-spacing:var(--wcm-text-xsmall-regular-letter-spacing);text-transform:var(--wcm-text-xsmall-regular-text-transform)}.wcm-small-thin{font-family:var(--wcm-text-small-thin-font-family);font-weight:var(--wcm-text-small-thin-weight);font-size:var(--wcm-text-small-thin-size);line-height:var(--wcm-text-small-thin-line-height);letter-spacing:var(--wcm-text-small-thin-letter-spacing);text-transform:var(--wcm-text-small-thin-text-transform)}.wcm-small-regular{font-family:var(--wcm-text-small-regular-font-family);font-weight:var(--wcm-text-small-regular-weight);font-size:var(--wcm-text-small-regular-size);line-height:var(--wcm-text-small-regular-line-height);letter-spacing:var(--wcm-text-small-regular-letter-spacing);text-transform:var(--wcm-text-small-regular-text-transform)}.wcm-medium-regular{font-family:var(--wcm-text-medium-regular-font-family);font-weight:var(--wcm-text-medium-regular-weight);font-size:var(--wcm-text-medium-regular-size);line-height:var(--wcm-text-medium-regular-line-height);letter-spacing:var(--wcm-text-medium-regular-letter-spacing);text-transform:var(--wcm-text-medium-regular-text-transform)}.wcm-big-bold{font-family:var(--wcm-text-big-bold-font-family);font-weight:var(--wcm-text-big-bold-weight);font-size:var(--wcm-text-big-bold-size);line-height:var(--wcm-text-big-bold-line-height);letter-spacing:var(--wcm-text-big-bold-letter-spacing);text-transform:var(--wcm-text-big-bold-text-transform)}:host(*){color:var(--wcm-color-fg-1)}.wcm-color-primary{color:var(--wcm-color-fg-1)}.wcm-color-secondary{color:var(--wcm-color-fg-2)}.wcm-color-tertiary{color:var(--wcm-color-fg-3)}.wcm-color-inverse{color:var(--wcm-accent-fill-color)}.wcm-color-accnt{color:var(--wcm-accent-color)}.wcm-color-error{color:var(--wcm-error-color)}`;var qS=Object.defineProperty,WS=Object.getOwnPropertyDescriptor,Yh=(r,e,t,n)=>{for(var i=n>1?void 0:n?WS(e,t):e,a=r.length-1,c;a>=0;a--)(c=r[a])&&(i=(n?c(e,t,i):c(i))||i);return n&&i&&qS(e,t,i),i};let ea=class extends Ye{constructor(){super(...arguments),this.variant="medium-regular",this.color="primary"}render(){const r={"wcm-big-bold":this.variant==="big-bold","wcm-medium-regular":this.variant==="medium-regular","wcm-small-regular":this.variant==="small-regular","wcm-small-thin":this.variant==="small-thin","wcm-xsmall-regular":this.variant==="xsmall-regular","wcm-xsmall-bold":this.variant==="xsmall-bold","wcm-color-primary":this.color==="primary","wcm-color-secondary":this.color==="secondary","wcm-color-tertiary":this.color==="tertiary","wcm-color-inverse":this.color==="inverse","wcm-color-accnt":this.color==="accent","wcm-color-error":this.color==="error"};return ue`<span><slot class="${kn(r)}"></slot></span>`}};ea.styles=[rt.globalCss,zS],Yh([Be()],ea.prototype,"variant",2),Yh([Be()],ea.prototype,"color",2),ea=Yh([ot("wcm-text")],ea);const KS=lt`button{width:100%;height:100%;border-radius:var(--wcm-button-hover-highlight-border-radius);display:flex;align-items:flex-start}button:active{background-color:var(--wcm-color-overlay)}@media(hover:hover){button:hover{background-color:var(--wcm-color-overlay)}}button>div{width:80px;padding:5px 0;display:flex;flex-direction:column;align-items:center}wcm-text{width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-align:center}wcm-wallet-image{height:60px;width:60px;transition:all .2s ease;border-radius:var(--wcm-wallet-icon-border-radius);margin-bottom:5px}.wcm-sublabel{margin-top:2px}`;var VS=Object.defineProperty,GS=Object.getOwnPropertyDescriptor,mi=(r,e,t,n)=>{for(var i=n>1?void 0:n?GS(e,t):e,a=r.length-1,c;a>=0;a--)(c=r[a])&&(i=(n?c(e,t,i):c(i))||i);return n&&i&&VS(e,t,i),i};let On=class extends Ye{constructor(){super(...arguments),this.onClick=()=>null,this.name="",this.walletId="",this.label=void 0,this.imageId=void 0,this.installed=!1,this.recent=!1}sublabelTemplate(){return this.recent?ue`<wcm-text class="wcm-sublabel" variant="xsmall-bold" color="tertiary">RECENT</wcm-text>`:this.installed?ue`<wcm-text class="wcm-sublabel" variant="xsmall-bold" color="tertiary">INSTALLED</wcm-text>`:null}handleClick(){sg.click({name:"WALLET_BUTTON",walletId:this.walletId}),this.onClick()}render(){var r;return ue`<button @click="${this.handleClick.bind(this)}"><div><wcm-wallet-image walletId="${this.walletId}" imageId="${Ir(this.imageId)}"></wcm-wallet-image><wcm-text variant="xsmall-regular">${(r=this.label)!=null?r:Pe.getWalletName(this.name,!0)}</wcm-text>${this.sublabelTemplate()}</div></button>`}};On.styles=[rt.globalCss,KS],mi([Be()],On.prototype,"onClick",2),mi([Be()],On.prototype,"name",2),mi([Be()],On.prototype,"walletId",2),mi([Be()],On.prototype,"label",2),mi([Be()],On.prototype,"imageId",2),mi([Be({type:Boolean})],On.prototype,"installed",2),mi([Be({type:Boolean})],On.prototype,"recent",2),On=mi([ot("wcm-wallet-button")],On);const YS=lt`:host{display:block}div{overflow:hidden;position:relative;border-radius:inherit;width:100%;height:100%;background-color:var(--wcm-color-overlay)}svg{position:relative;width:100%;height:100%}div::after{content:'';position:absolute;top:0;bottom:0;left:0;right:0;border-radius:inherit;border:1px solid var(--wcm-color-overlay)}div img{width:100%;height:100%;object-fit:cover;object-position:center}#wallet-placeholder-fill{fill:var(--wcm-color-bg-3)}#wallet-placeholder-dash{stroke:var(--wcm-color-overlay)}`;var JS=Object.defineProperty,ZS=Object.getOwnPropertyDescriptor,xc=(r,e,t,n)=>{for(var i=n>1?void 0:n?ZS(e,t):e,a=r.length-1,c;a>=0;a--)(c=r[a])&&(i=(n?c(e,t,i):c(i))||i);return n&&i&&JS(e,t,i),i};let Bs=class extends Ye{constructor(){super(...arguments),this.walletId="",this.imageId=void 0,this.imageUrl=void 0}render(){var r;const e=(r=this.imageUrl)!=null&&r.length?this.imageUrl:Pe.getWalletIcon({id:this.walletId,image_id:this.imageId});return ue`${e.length?ue`<div><img crossorigin="anonymous" src="${e}" alt="${this.id}"></div>`:ht.WALLET_PLACEHOLDER}`}};Bs.styles=[rt.globalCss,YS],xc([Be()],Bs.prototype,"walletId",2),xc([Be()],Bs.prototype,"imageId",2),xc([Be()],Bs.prototype,"imageUrl",2),Bs=xc([ot("wcm-wallet-image")],Bs);var QS=Object.defineProperty,XS=Object.getOwnPropertyDescriptor,xm=(r,e,t,n)=>{for(var i=n>1?void 0:n?XS(e,t):e,a=r.length-1,c;a>=0;a--)(c=r[a])&&(i=(n?c(e,t,i):c(i))||i);return n&&i&&QS(e,t,i),i};let Jh=class extends Ye{constructor(){super(),this.preload=!0,this.preloadData()}async loadImages(r){try{r!=null&&r.length&&await Promise.all(r.map(async e=>Pe.preloadImage(e)))}catch{console.info("Unsuccessful attempt at preloading some images",r)}}async preloadListings(){if(Wr.state.enableExplorer){await Lr.getRecomendedWallets(),Ht.setIsDataLoaded(!0);const{recomendedWallets:r}=Lr.state,e=r.map(t=>Pe.getWalletIcon(t));await this.loadImages(e)}else Ht.setIsDataLoaded(!0)}async preloadCustomImages(){const r=Pe.getCustomImageUrls();await this.loadImages(r)}async preloadData(){try{this.preload&&(this.preload=!1,await Promise.all([this.preloadListings(),this.preloadCustomImages()]))}catch(r){console.error(r),ui.openToast("Failed preloading","error")}}};xm([Mr()],Jh.prototype,"preload",2),Jh=xm([ot("wcm-explorer-context")],Jh);var eO=Object.defineProperty,tO=Object.getOwnPropertyDescriptor,rO=(r,e,t,n)=>{for(var i=n>1?void 0:n?tO(e,t):e,a=r.length-1,c;a>=0;a--)(c=r[a])&&(i=(n?c(e,t,i):c(i))||i);return n&&i&&eO(e,t,i),i};let Im=class extends Ye{constructor(){super(),this.unsubscribeTheme=void 0,rt.setTheme(),this.unsubscribeTheme=li.subscribe(rt.setTheme)}disconnectedCallback(){var r;(r=this.unsubscribeTheme)==null||r.call(this)}};Im=rO([ot("wcm-theme-context")],Im);const nO=lt`@keyframes scroll{0%{transform:translate3d(0,0,0)}100%{transform:translate3d(calc(-70px * 9),0,0)}}.wcm-slider{position:relative;overflow-x:hidden;padding:10px 0;margin:0 -20px;width:calc(100% + 40px)}.wcm-track{display:flex;width:calc(70px * 18);animation:scroll 20s linear infinite;opacity:.7}.wcm-track svg{margin:0 5px}wcm-wallet-image{width:60px;height:60px;margin:0 5px;border-radius:var(--wcm-wallet-icon-border-radius)}.wcm-grid{display:grid;grid-template-columns:repeat(4,80px);justify-content:space-between}.wcm-title{display:flex;align-items:center;margin-bottom:10px}.wcm-title svg{margin-right:6px}.wcm-title path{fill:var(--wcm-accent-color)}wcm-modal-footer .wcm-title{padding:0 10px}wcm-button-big{position:absolute;top:50%;left:50%;transform:translateY(-50%) translateX(-50%);filter:drop-shadow(0 0 17px var(--wcm-color-bg-1))}wcm-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}wcm-info-footer wcm-text{text-align:center;margin-bottom:15px}#wallet-placeholder-fill{fill:var(--wcm-color-bg-3)}#wallet-placeholder-dash{stroke:var(--wcm-color-overlay)}`;var iO=Object.defineProperty,sO=Object.getOwnPropertyDescriptor,oO=(r,e,t,n)=>{for(var i=n>1?void 0:n?sO(e,t):e,a=r.length-1,c;a>=0;a--)(c=r[a])&&(i=(n?c(e,t,i):c(i))||i);return n&&i&&iO(e,t,i),i};let Zh=class extends Ye{onGoToQrcode(){At.push("Qrcode")}render(){const{recomendedWallets:r}=Lr.state,e=[...r,...r],t=ye.RECOMMENDED_WALLET_AMOUNT*2;return ue`<wcm-modal-header title="Connect your wallet" .onAction="${this.onGoToQrcode}" .actionIcon="${ht.QRCODE_ICON}"></wcm-modal-header><wcm-modal-content><div class="wcm-title">${ht.MOBILE_ICON}<wcm-text variant="small-regular" color="accent">WalletConnect</wcm-text></div><div class="wcm-slider"><div class="wcm-track">${[...Array(t)].map((n,i)=>{const a=e[i%e.length];return a?ue`<wcm-wallet-image walletId="${a.id}" imageId="${a.image_id}"></wcm-wallet-image>`:ht.WALLET_PLACEHOLDER})}</div><wcm-button-big @click="${Pe.handleAndroidLinking}"><wcm-text variant="medium-regular" color="inverse">Select Wallet</wcm-text></wcm-button-big></div></wcm-modal-content><wcm-info-footer><wcm-text color="secondary" variant="small-thin">Choose WalletConnect to see supported apps on your device</wcm-text></wcm-info-footer>`}};Zh.styles=[rt.globalCss,nO],Zh=oO([ot("wcm-android-wallet-selection")],Zh);const aO=lt`@keyframes loading{to{stroke-dashoffset:0}}@keyframes shake{10%,90%{transform:translate3d(-1px,0,0)}20%,80%{transform:translate3d(1px,0,0)}30%,50%,70%{transform:translate3d(-2px,0,0)}40%,60%{transform:translate3d(2px,0,0)}}:host{display:flex;flex-direction:column;align-items:center}div{position:relative;width:110px;height:110px;display:flex;justify-content:center;align-items:center;margin:40px 0 20px 0;transform:translate3d(0,0,0)}svg{position:absolute;width:110px;height:110px;fill:none;stroke:transparent;stroke-linecap:round;stroke-width:2px;top:0;left:0}use{stroke:var(--wcm-accent-color);animation:loading 1s linear infinite}wcm-wallet-image{border-radius:var(--wcm-wallet-icon-large-border-radius);width:90px;height:90px}wcm-text{margin-bottom:40px}.wcm-error svg{stroke:var(--wcm-error-color)}.wcm-error use{display:none}.wcm-error{animation:shake .4s cubic-bezier(.36,.07,.19,.97) both}.wcm-stale svg,.wcm-stale use{display:none}`;var cO=Object.defineProperty,lO=Object.getOwnPropertyDescriptor,ks=(r,e,t,n)=>{for(var i=n>1?void 0:n?lO(e,t):e,a=r.length-1,c;a>=0;a--)(c=r[a])&&(i=(n?c(e,t,i):c(i))||i);return n&&i&&cO(e,t,i),i};let vi=class extends Ye{constructor(){super(...arguments),this.walletId=void 0,this.imageId=void 0,this.isError=!1,this.isStale=!1,this.label=""}svgLoaderTemplate(){var r,e;const t=(e=(r=li.state.themeVariables)==null?void 0:r["--wcm-wallet-icon-large-border-radius"])!=null?e:rt.getPreset("--wcm-wallet-icon-large-border-radius");let n=0;t.includes("%")?n=88/100*parseInt(t,10):n=parseInt(t,10),n*=1.17;const i=317-n*1.57,a=425-n*1.8;return ue`<svg viewBox="0 0 110 110" width="110" height="110"><rect id="wcm-loader" x="2" y="2" width="106" height="106" rx="${n}"/><use xlink:href="#wcm-loader" stroke-dasharray="106 ${i}" stroke-dashoffset="${a}"></use></svg>`}render(){const r={"wcm-error":this.isError,"wcm-stale":this.isStale};return ue`<div class="${kn(r)}">${this.svgLoaderTemplate()}<wcm-wallet-image walletId="${Ir(this.walletId)}" imageId="${Ir(this.imageId)}"></wcm-wallet-image></div><wcm-text variant="medium-regular" color="${this.isError?"error":"primary"}">${this.isError?"Connection declined":this.label}</wcm-text>`}};vi.styles=[rt.globalCss,aO],ks([Be()],vi.prototype,"walletId",2),ks([Be()],vi.prototype,"imageId",2),ks([Be({type:Boolean})],vi.prototype,"isError",2),ks([Be({type:Boolean})],vi.prototype,"isStale",2),ks([Be()],vi.prototype,"label",2),vi=ks([ot("wcm-connector-waiting")],vi);const Hs={manualWallets(){var r,e;const{mobileWallets:t,desktopWallets:n}=Wr.state,i=(r=Hs.recentWallet())==null?void 0:r.id,a=ye.isMobile()?t:n,c=a?.filter(u=>i!==u.id);return(e=ye.isMobile()?c?.map(({id:u,name:d,links:h})=>({id:u,name:d,mobile:h,links:h})):c?.map(({id:u,name:d,links:h})=>({id:u,name:d,desktop:h,links:h})))!=null?e:[]},recentWallet(){return Pe.getRecentWallet()},recomendedWallets(r=!1){var e;const t=r||(e=Hs.recentWallet())==null?void 0:e.id,{recomendedWallets:n}=Lr.state;return n.filter(i=>t!==i.id)}},wi={onConnecting(r){Pe.goToConnectingView(r)},manualWalletsTemplate(){return Hs.manualWallets().map(r=>ue`<wcm-wallet-button walletId="${r.id}" name="${r.name}" .onClick="${()=>this.onConnecting(r)}"></wcm-wallet-button>`)},recomendedWalletsTemplate(r=!1){return Hs.recomendedWallets(r).map(e=>ue`<wcm-wallet-button name="${e.name}" walletId="${e.id}" imageId="${e.image_id}" .onClick="${()=>this.onConnecting(e)}"></wcm-wallet-button>`)},recentWalletTemplate(){const r=Hs.recentWallet();if(r)return ue`<wcm-wallet-button name="${r.name}" walletId="${r.id}" imageId="${Ir(r.image_id)}" .recent="${!0}" .onClick="${()=>this.onConnecting(r)}"></wcm-wallet-button>`}},uO=lt`.wcm-grid{display:grid;grid-template-columns:repeat(4,80px);justify-content:space-between}.wcm-desktop-title,.wcm-mobile-title{display:flex;align-items:center}.wcm-mobile-title{justify-content:space-between;margin-bottom:20px;margin-top:-10px}.wcm-desktop-title{margin-bottom:10px;padding:0 10px}.wcm-subtitle{display:flex;align-items:center}.wcm-subtitle:last-child path{fill:var(--wcm-color-fg-3)}.wcm-desktop-title svg,.wcm-mobile-title svg{margin-right:6px}.wcm-desktop-title path,.wcm-mobile-title path{fill:var(--wcm-accent-color)}`;var hO=Object.defineProperty,fO=Object.getOwnPropertyDescriptor,dO=(r,e,t,n)=>{for(var i=n>1?void 0:n?fO(e,t):e,a=r.length-1,c;a>=0;a--)(c=r[a])&&(i=(n?c(e,t,i):c(i))||i);return n&&i&&hO(e,t,i),i};let Qh=class extends Ye{render(){const{explorerExcludedWalletIds:r,enableExplorer:e}=Wr.state,t=r!=="ALL"&&e,n=wi.manualWalletsTemplate(),i=wi.recomendedWalletsTemplate();let a=[wi.recentWalletTemplate(),...n,...i];a=a.filter(Boolean);const c=a.length>4||t;let u=[];c?u=a.slice(0,3):u=a;const d=!!u.length;return ue`<wcm-modal-header .border="${!0}" title="Connect your wallet" .onAction="${Pe.handleUriCopy}" .actionIcon="${ht.COPY_ICON}"></wcm-modal-header><wcm-modal-content><div class="wcm-mobile-title"><div class="wcm-subtitle">${ht.MOBILE_ICON}<wcm-text variant="small-regular" color="accent">Mobile</wcm-text></div><div class="wcm-subtitle">${ht.SCAN_ICON}<wcm-text variant="small-regular" color="secondary">Scan with your wallet</wcm-text></div></div><wcm-walletconnect-qr></wcm-walletconnect-qr></wcm-modal-content>${d?ue`<wcm-modal-footer><div class="wcm-desktop-title">${ht.DESKTOP_ICON}<wcm-text variant="small-regular" color="accent">Desktop</wcm-text></div><div class="wcm-grid">${u} ${c?ue`<wcm-view-all-wallets-button></wcm-view-all-wallets-button>`:null}</div></wcm-modal-footer>`:null}`}};Qh.styles=[rt.globalCss,uO],Qh=dO([ot("wcm-desktop-wallet-selection")],Qh);const pO=lt`div{background-color:var(--wcm-color-bg-2);padding:10px 20px 15px 20px;border-top:1px solid var(--wcm-color-bg-3);text-align:center}a{color:var(--wcm-accent-color);text-decoration:none;transition:opacity .2s ease-in-out;display:inline}a:active{opacity:.8}@media(hover:hover){a:hover{opacity:.8}}`;var gO=Object.defineProperty,mO=Object.getOwnPropertyDescriptor,vO=(r,e,t,n)=>{for(var i=n>1?void 0:n?mO(e,t):e,a=r.length-1,c;a>=0;a--)(c=r[a])&&(i=(n?c(e,t,i):c(i))||i);return n&&i&&gO(e,t,i),i};let Xh=class extends Ye{render(){const{termsOfServiceUrl:r,privacyPolicyUrl:e}=Wr.state;return r??e?ue`<div><wcm-text variant="small-regular" color="secondary">By connecting your wallet to this app, you agree to the app's ${r?ue`<a href="${r}" target="_blank" rel="noopener noreferrer">Terms of Service</a>`:null} ${r&&e?"and":null} ${e?ue`<a href="${e}" target="_blank" rel="noopener noreferrer">Privacy Policy</a>`:null}</wcm-text></div>`:null}};Xh.styles=[rt.globalCss,pO],Xh=vO([ot("wcm-legal-notice")],Xh);const wO=lt`div{display:grid;grid-template-columns:repeat(4,80px);margin:0 -10px;justify-content:space-between;row-gap:10px}`;var yO=Object.defineProperty,bO=Object.getOwnPropertyDescriptor,_O=(r,e,t,n)=>{for(var i=n>1?void 0:n?bO(e,t):e,a=r.length-1,c;a>=0;a--)(c=r[a])&&(i=(n?c(e,t,i):c(i))||i);return n&&i&&yO(e,t,i),i};let ef=class extends Ye{onQrcode(){At.push("Qrcode")}render(){const{explorerExcludedWalletIds:r,enableExplorer:e}=Wr.state,t=r!=="ALL"&&e,n=wi.manualWalletsTemplate(),i=wi.recomendedWalletsTemplate();let a=[wi.recentWalletTemplate(),...n,...i];a=a.filter(Boolean);const c=a.length>8||t;let u=[];c?u=a.slice(0,7):u=a;const d=!!u.length;return ue`<wcm-modal-header title="Connect your wallet" .onAction="${this.onQrcode}" .actionIcon="${ht.QRCODE_ICON}"></wcm-modal-header>${d?ue`<wcm-modal-content><div>${u} ${c?ue`<wcm-view-all-wallets-button></wcm-view-all-wallets-button>`:null}</div></wcm-modal-content>`:null}`}};ef.styles=[rt.globalCss,wO],ef=_O([ot("wcm-mobile-wallet-selection")],ef);const EO=lt`:host{all:initial}.wcm-overlay{top:0;bottom:0;left:0;right:0;position:fixed;z-index:var(--wcm-z-index);overflow:hidden;display:flex;justify-content:center;align-items:center;opacity:0;pointer-events:none;background-color:var(--wcm-overlay-background-color);backdrop-filter:var(--wcm-overlay-backdrop-filter)}@media(max-height:720px) and (orientation:landscape){.wcm-overlay{overflow:scroll;align-items:flex-start;padding:20px 0}}.wcm-active{pointer-events:auto}.wcm-container{position:relative;max-width:360px;width:100%;outline:0;border-radius:var(--wcm-background-border-radius) var(--wcm-background-border-radius) var(--wcm-container-border-radius) var(--wcm-container-border-radius);border:1px solid var(--wcm-color-overlay);overflow:hidden}.wcm-card{width:100%;position:relative;border-radius:var(--wcm-container-border-radius);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(--wcm-color-overlay);background-color:var(--wcm-color-bg-1);color:var(--wcm-color-fg-1)}@media(max-width:600px){.wcm-container{max-width:440px;border-radius:var(--wcm-background-border-radius) var(--wcm-background-border-radius) 0 0}.wcm-card{border-radius:var(--wcm-container-border-radius) var(--wcm-container-border-radius) 0 0}.wcm-overlay{align-items:flex-end}}@media(max-width:440px){.wcm-container{border:0}}`;var xO=Object.defineProperty,IO=Object.getOwnPropertyDescriptor,tf=(r,e,t,n)=>{for(var i=n>1?void 0:n?IO(e,t):e,a=r.length-1,c;a>=0;a--)(c=r[a])&&(i=(n?c(e,t,i):c(i))||i);return n&&i&&xO(e,t,i),i};let zs=class extends Ye{constructor(){super(),this.open=!1,this.active=!1,this.unsubscribeModal=void 0,this.abortController=void 0,this.unsubscribeModal=qi.subscribe(r=>{r.open?this.onOpenModalEvent():this.onCloseModalEvent()})}disconnectedCallback(){var r;(r=this.unsubscribeModal)==null||r.call(this)}get overlayEl(){return Pe.getShadowRootElement(this,".wcm-overlay")}get containerEl(){return Pe.getShadowRootElement(this,".wcm-container")}toggleBodyScroll(r){document.querySelector("body")&&(r?document.getElementById("wcm-styles")?.remove():document.head.insertAdjacentHTML("beforeend",'<style id="wcm-styles">html,body{touch-action:none;overflow:hidden;overscroll-behavior:contain;}</style>'))}onCloseModal(r){r.target===r.currentTarget&&qi.close()}onOpenModalEvent(){this.toggleBodyScroll(!1),this.addKeyboardEvents(),this.open=!0,setTimeout(async()=>{const r=Pe.isMobileAnimation()?{y:["50vh","0vh"]}:{scale:[.98,1]},e=.1,t=.2;await Promise.all([Zi(this.overlayEl,{opacity:[0,1]},{delay:e,duration:t}).finished,Zi(this.containerEl,r,{delay:e,duration:t}).finished]),this.active=!0},0)}async onCloseModalEvent(){this.toggleBodyScroll(!0),this.removeKeyboardEvents();const r=Pe.isMobileAnimation()?{y:["0vh","50vh"]}:{scale:[1,.98]},e=.2;await Promise.all([Zi(this.overlayEl,{opacity:[1,0]},{duration:e}).finished,Zi(this.containerEl,r,{duration:e}).finished]),this.containerEl.removeAttribute("style"),this.active=!1,this.open=!1}addKeyboardEvents(){this.abortController=new AbortController,window.addEventListener("keydown",r=>{var e;r.key==="Escape"?qi.close():r.key==="Tab"&&((e=r.target)!=null&&e.tagName.includes("wcm-")||this.containerEl.focus())},this.abortController),this.containerEl.focus()}removeKeyboardEvents(){var r;(r=this.abortController)==null||r.abort(),this.abortController=void 0}render(){const r={"wcm-overlay":!0,"wcm-active":this.active};return ue`<wcm-explorer-context></wcm-explorer-context><wcm-theme-context></wcm-theme-context><div id="wcm-modal" class="${kn(r)}" @click="${this.onCloseModal}" role="alertdialog" aria-modal="true"><div class="wcm-container" tabindex="0">${this.open?ue`<wcm-modal-backcard></wcm-modal-backcard><div class="wcm-card"><wcm-modal-router></wcm-modal-router><wcm-modal-toast></wcm-modal-toast></div>`:null}</div></div>`}};zs.styles=[rt.globalCss,EO],tf([Mr()],zs.prototype,"open",2),tf([Mr()],zs.prototype,"active",2),zs=tf([ot("wcm-modal")],zs);const DO=lt`div{display:flex;margin-top:15px}slot{display:inline-block;margin:0 5px}wcm-button{margin:0 5px}`;var SO=Object.defineProperty,OO=Object.getOwnPropertyDescriptor,ta=(r,e,t,n)=>{for(var i=n>1?void 0:n?OO(e,t):e,a=r.length-1,c;a>=0;a--)(c=r[a])&&(i=(n?c(e,t,i):c(i))||i);return n&&i&&SO(e,t,i),i};let Xi=class extends Ye{constructor(){super(...arguments),this.isMobile=!1,this.isDesktop=!1,this.isWeb=!1,this.isRetry=!1}onMobile(){ye.isMobile()?At.replace("MobileConnecting"):At.replace("MobileQrcodeConnecting")}onDesktop(){At.replace("DesktopConnecting")}onWeb(){At.replace("WebConnecting")}render(){return ue`<div>${this.isRetry?ue`<slot></slot>`:null} ${this.isMobile?ue`<wcm-button .onClick="${this.onMobile}" .iconLeft="${ht.MOBILE_ICON}" variant="outline">Mobile</wcm-button>`:null} ${this.isDesktop?ue`<wcm-button .onClick="${this.onDesktop}" .iconLeft="${ht.DESKTOP_ICON}" variant="outline">Desktop</wcm-button>`:null} ${this.isWeb?ue`<wcm-button .onClick="${this.onWeb}" .iconLeft="${ht.GLOBE_ICON}" variant="outline">Web</wcm-button>`:null}</div>`}};Xi.styles=[rt.globalCss,DO],ta([Be({type:Boolean})],Xi.prototype,"isMobile",2),ta([Be({type:Boolean})],Xi.prototype,"isDesktop",2),ta([Be({type:Boolean})],Xi.prototype,"isWeb",2),ta([Be({type:Boolean})],Xi.prototype,"isRetry",2),Xi=ta([ot("wcm-platform-selection")],Xi);const CO=lt`button{display:flex;flex-direction:column;padding:5px 10px;border-radius:var(--wcm-button-hover-highlight-border-radius);height:100%;justify-content:flex-start}.wcm-icons{width:60px;height:60px;display:flex;flex-wrap:wrap;padding:7px;border-radius:var(--wcm-wallet-icon-border-radius);justify-content:space-between;align-items:center;margin-bottom:5px;background-color:var(--wcm-color-bg-2);box-shadow:inset 0 0 0 1px var(--wcm-color-overlay)}button:active{background-color:var(--wcm-color-overlay)}@media(hover:hover){button:hover{background-color:var(--wcm-color-overlay)}}.wcm-icons img{width:21px;height:21px;object-fit:cover;object-position:center;border-radius:calc(var(--wcm-wallet-icon-border-radius)/ 2);border:1px solid var(--wcm-color-overlay)}.wcm-icons svg{width:21px;height:21px}.wcm-icons img:nth-child(1),.wcm-icons img:nth-child(2),.wcm-icons svg:nth-child(1),.wcm-icons svg:nth-child(2){margin-bottom:4px}wcm-text{width:100%;text-align:center}#wallet-placeholder-fill{fill:var(--wcm-color-bg-3)}#wallet-placeholder-dash{stroke:var(--wcm-color-overlay)}`;var $O=Object.defineProperty,AO=Object.getOwnPropertyDescriptor,PO=(r,e,t,n)=>{for(var i=n>1?void 0:n?AO(e,t):e,a=r.length-1,c;a>=0;a--)(c=r[a])&&(i=(n?c(e,t,i):c(i))||i);return n&&i&&$O(e,t,i),i};let rf=class extends Ye{onClick(){At.push("WalletExplorer")}render(){const{recomendedWallets:r}=Lr.state,e=Hs.manualWallets(),t=[...r,...e].reverse().slice(0,4);return ue`<button @click="${this.onClick}"><div class="wcm-icons">${t.map(n=>{const i=Pe.getWalletIcon(n);if(i)return ue`<img crossorigin="anonymous" src="${i}">`;const a=Pe.getWalletIcon({id:n.id});return a?ue`<img crossorigin="anonymous" src="${a}">`:ht.WALLET_PLACEHOLDER})} ${[...Array(4-t.length)].map(()=>ht.WALLET_PLACEHOLDER)}</div><wcm-text variant="xsmall-regular">View All</wcm-text></button>`}};rf.styles=[rt.globalCss,CO],rf=PO([ot("wcm-view-all-wallets-button")],rf);const TO=lt`.wcm-qr-container{width:100%;display:flex;justify-content:center;align-items:center;aspect-ratio:1/1}`;var RO=Object.defineProperty,NO=Object.getOwnPropertyDescriptor,Ic=(r,e,t,n)=>{for(var i=n>1?void 0:n?NO(e,t):e,a=r.length-1,c;a>=0;a--)(c=r[a])&&(i=(n?c(e,t,i):c(i))||i);return n&&i&&RO(e,t,i),i};let qs=class extends Ye{constructor(){super(),this.walletId="",this.imageId="",this.uri="",setTimeout(()=>{const{walletConnectUri:r}=Ht.state;this.uri=r},0)}get overlayEl(){return Pe.getShadowRootElement(this,".wcm-qr-container")}render(){return ue`<div class="wcm-qr-container">${this.uri?ue`<wcm-qrcode size="${this.overlayEl.offsetWidth}" uri="${this.uri}" walletId="${Ir(this.walletId)}" imageId="${Ir(this.imageId)}"></wcm-qrcode>`:ue`<wcm-spinner></wcm-spinner>`}</div>`}};qs.styles=[rt.globalCss,TO],Ic([Be()],qs.prototype,"walletId",2),Ic([Be()],qs.prototype,"imageId",2),Ic([Mr()],qs.prototype,"uri",2),qs=Ic([ot("wcm-walletconnect-qr")],qs);var LO=Object.defineProperty,MO=Object.getOwnPropertyDescriptor,UO=(r,e,t,n)=>{for(var i=n>1?void 0:n?MO(e,t):e,a=r.length-1,c;a>=0;a--)(c=r[a])&&(i=(n?c(e,t,i):c(i))||i);return n&&i&&LO(e,t,i),i};let nf=class extends Ye{viewTemplate(){return ye.isAndroid()?ue`<wcm-android-wallet-selection></wcm-android-wallet-selection>`:ye.isMobile()?ue`<wcm-mobile-wallet-selection></wcm-mobile-wallet-selection>`:ue`<wcm-desktop-wallet-selection></wcm-desktop-wallet-selection>`}render(){return ue`${this.viewTemplate()}<wcm-legal-notice></wcm-legal-notice>`}};nf.styles=[rt.globalCss],nf=UO([ot("wcm-connect-wallet-view")],nf);const jO=lt`wcm-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}wcm-text{text-align:center}`;var FO=Object.defineProperty,BO=Object.getOwnPropertyDescriptor,Dm=(r,e,t,n)=>{for(var i=n>1?void 0:n?BO(e,t):e,a=r.length-1,c;a>=0;a--)(c=r[a])&&(i=(n?c(e,t,i):c(i))||i);return n&&i&&FO(e,t,i),i};let Dc=class extends Ye{constructor(){super(),this.isError=!1,this.openDesktopApp()}onFormatAndRedirect(r){const{desktop:e,name:t}=ye.getWalletRouterData(),n=e?.native;if(n){const i=ye.formatNativeUrl(n,r,t);ye.openHref(i,"_self")}}openDesktopApp(){const{walletConnectUri:r}=Ht.state,e=ye.getWalletRouterData();Pe.setRecentWallet(e),r&&this.onFormatAndRedirect(r)}render(){const{name:r,id:e,image_id:t}=ye.getWalletRouterData(),{isMobile:n,isWeb:i}=Pe.getCachedRouterWalletPlatforms();return ue`<wcm-modal-header title="${r}" .onAction="${Pe.handleUriCopy}" .actionIcon="${ht.COPY_ICON}"></wcm-modal-header><wcm-modal-content><wcm-connector-waiting walletId="${e}" imageId="${Ir(t)}" label="${`Continue in ${r}...`}" .isError="${this.isError}"></wcm-connector-waiting></wcm-modal-content><wcm-info-footer><wcm-text color="secondary" variant="small-thin">${`Connection can continue loading if ${r} is not installed on your device`}</wcm-text><wcm-platform-selection .isMobile="${n}" .isWeb="${i}" .isRetry="${!0}"><wcm-button .onClick="${this.openDesktopApp.bind(this)}" .iconRight="${ht.RETRY_ICON}">Retry</wcm-button></wcm-platform-selection></wcm-info-footer>`}};Dc.styles=[rt.globalCss,jO],Dm([Mr()],Dc.prototype,"isError",2),Dc=Dm([ot("wcm-desktop-connecting-view")],Dc);const kO=lt`wcm-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}wcm-text{text-align:center}wcm-button{margin-top:15px}`;var HO=Object.defineProperty,zO=Object.getOwnPropertyDescriptor,qO=(r,e,t,n)=>{for(var i=n>1?void 0:n?zO(e,t):e,a=r.length-1,c;a>=0;a--)(c=r[a])&&(i=(n?c(e,t,i):c(i))||i);return n&&i&&HO(e,t,i),i};let sf=class extends Ye{onInstall(r){r&&ye.openHref(r,"_blank")}render(){const{name:r,id:e,image_id:t,homepage:n}=ye.getWalletRouterData();return ue`<wcm-modal-header title="${r}"></wcm-modal-header><wcm-modal-content><wcm-connector-waiting walletId="${e}" imageId="${Ir(t)}" label="Not Detected" .isStale="${!0}"></wcm-connector-waiting></wcm-modal-content><wcm-info-footer><wcm-text color="secondary" variant="small-thin">${`Download ${r} to continue. If multiple browser extensions are installed, disable non ${r} ones and try again`}</wcm-text><wcm-button .onClick="${()=>this.onInstall(n)}" .iconLeft="${ht.ARROW_DOWN_ICON}">Download</wcm-button></wcm-info-footer>`}};sf.styles=[rt.globalCss,kO],sf=qO([ot("wcm-install-wallet-view")],sf);const WO=lt`wcm-wallet-image{border-radius:var(--wcm-wallet-icon-large-border-radius);width:96px;height:96px;margin-bottom:20px}wcm-info-footer{display:flex;width:100%}.wcm-app-store{justify-content:space-between}.wcm-app-store wcm-wallet-image{margin-right:10px;margin-bottom:0;width:28px;height:28px;border-radius:var(--wcm-wallet-icon-small-border-radius)}.wcm-app-store div{display:flex;align-items:center}.wcm-app-store wcm-button{margin-right:-10px}.wcm-note{flex-direction:column;align-items:center;padding:5px 0}.wcm-note wcm-text{text-align:center}wcm-platform-selection{margin-top:-15px}.wcm-note wcm-text{margin-top:15px}.wcm-note wcm-text span{color:var(--wcm-accent-color)}`;var KO=Object.defineProperty,VO=Object.getOwnPropertyDescriptor,Sm=(r,e,t,n)=>{for(var i=n>1?void 0:n?VO(e,t):e,a=r.length-1,c;a>=0;a--)(c=r[a])&&(i=(n?c(e,t,i):c(i))||i);return n&&i&&KO(e,t,i),i};let Sc=class extends Ye{constructor(){super(),this.isError=!1,this.openMobileApp()}onFormatAndRedirect(r,e=!1){const{mobile:t,name:n}=ye.getWalletRouterData(),i=t?.native,a=t?.universal;if(i&&!e){const c=ye.formatNativeUrl(i,r,n);ye.openHref(c,"_self")}else if(a){const c=ye.formatUniversalUrl(a,r,n);ye.openHref(c,"_self")}}openMobileApp(r=!1){const{walletConnectUri:e}=Ht.state,t=ye.getWalletRouterData();Pe.setRecentWallet(t),e&&this.onFormatAndRedirect(e,r)}onGoToAppStore(r){r&&ye.openHref(r,"_blank")}render(){const{name:r,id:e,image_id:t,app:n,mobile:i}=ye.getWalletRouterData(),{isWeb:a}=Pe.getCachedRouterWalletPlatforms(),c=n?.ios,u=i?.universal;return ue`<wcm-modal-header title="${r}"></wcm-modal-header><wcm-modal-content><wcm-connector-waiting walletId="${e}" imageId="${Ir(t)}" label="Tap 'Open' to continue…" .isError="${this.isError}"></wcm-connector-waiting></wcm-modal-content><wcm-info-footer class="wcm-note"><wcm-platform-selection .isWeb="${a}" .isRetry="${!0}"><wcm-button .onClick="${()=>this.openMobileApp(!1)}" .iconRight="${ht.RETRY_ICON}">Retry</wcm-button></wcm-platform-selection>${u?ue`<wcm-text color="secondary" variant="small-thin">Still doesn't work? <span tabindex="0" @click="${()=>this.openMobileApp(!0)}">Try this alternate link</span></wcm-text>`:null}</wcm-info-footer><wcm-info-footer class="wcm-app-store"><div><wcm-wallet-image walletId="${e}" imageId="${Ir(t)}"></wcm-wallet-image><wcm-text>${`Get ${r}`}</wcm-text></div><wcm-button .iconRight="${ht.ARROW_RIGHT_ICON}" .onClick="${()=>this.onGoToAppStore(c)}" variant="ghost">App Store</wcm-button></wcm-info-footer>`}};Sc.styles=[rt.globalCss,WO],Sm([Mr()],Sc.prototype,"isError",2),Sc=Sm([ot("wcm-mobile-connecting-view")],Sc);const GO=lt`wcm-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}wcm-text{text-align:center}`;var YO=Object.defineProperty,JO=Object.getOwnPropertyDescriptor,ZO=(r,e,t,n)=>{for(var i=n>1?void 0:n?JO(e,t):e,a=r.length-1,c;a>=0;a--)(c=r[a])&&(i=(n?c(e,t,i):c(i))||i);return n&&i&&YO(e,t,i),i};let of=class extends Ye{render(){const{name:r,id:e,image_id:t}=ye.getWalletRouterData(),{isDesktop:n,isWeb:i}=Pe.getCachedRouterWalletPlatforms();return ue`<wcm-modal-header title="${r}" .onAction="${Pe.handleUriCopy}" .actionIcon="${ht.COPY_ICON}"></wcm-modal-header><wcm-modal-content><wcm-walletconnect-qr walletId="${e}" imageId="${Ir(t)}"></wcm-walletconnect-qr></wcm-modal-content><wcm-info-footer><wcm-text color="secondary" variant="small-thin">${`Scan this QR Code with your phone's camera or inside ${r} app`}</wcm-text><wcm-platform-selection .isDesktop="${n}" .isWeb="${i}"></wcm-platform-selection></wcm-info-footer>`}};of.styles=[rt.globalCss,GO],of=ZO([ot("wcm-mobile-qr-connecting-view")],of);var QO=Object.defineProperty,XO=Object.getOwnPropertyDescriptor,eC=(r,e,t,n)=>{for(var i=n>1?void 0:n?XO(e,t):e,a=r.length-1,c;a>=0;a--)(c=r[a])&&(i=(n?c(e,t,i):c(i))||i);return n&&i&&QO(e,t,i),i};let af=class extends Ye{render(){return ue`<wcm-modal-header title="Scan the code" .onAction="${Pe.handleUriCopy}" .actionIcon="${ht.COPY_ICON}"></wcm-modal-header><wcm-modal-content><wcm-walletconnect-qr></wcm-walletconnect-qr></wcm-modal-content>`}};af.styles=[rt.globalCss],af=eC([ot("wcm-qrcode-view")],af);const tC=lt`wcm-modal-content{height:clamp(200px,60vh,600px);display:block;overflow:scroll;scrollbar-width:none;position:relative;margin-top:1px}.wcm-grid{display:grid;grid-template-columns:repeat(4,80px);justify-content:space-between;margin:-15px -10px;padding-top:20px}wcm-modal-content::after,wcm-modal-content::before{content:'';position:fixed;pointer-events:none;z-index:1;width:100%;height:20px;opacity:1}wcm-modal-content::before{box-shadow:0 -1px 0 0 var(--wcm-color-bg-1);background:linear-gradient(var(--wcm-color-bg-1),rgba(255,255,255,0))}wcm-modal-content::after{box-shadow:0 1px 0 0 var(--wcm-color-bg-1);background:linear-gradient(rgba(255,255,255,0),var(--wcm-color-bg-1));top:calc(100% - 20px)}wcm-modal-content::-webkit-scrollbar{display:none}.wcm-placeholder-block{display:flex;justify-content:center;align-items:center;height:100px;overflow:hidden}.wcm-empty,.wcm-loading{display:flex}.wcm-loading .wcm-placeholder-block{height:100%}.wcm-end-reached .wcm-placeholder-block{height:0;opacity:0}.wcm-empty .wcm-placeholder-block{opacity:1;height:100%}wcm-wallet-button{margin:calc((100% - 60px)/ 3) 0}`;var rC=Object.defineProperty,nC=Object.getOwnPropertyDescriptor,ra=(r,e,t,n)=>{for(var i=n>1?void 0:n?nC(e,t):e,a=r.length-1,c;a>=0;a--)(c=r[a])&&(i=(n?c(e,t,i):c(i))||i);return n&&i&&rC(e,t,i),i};const cf=40;let es=class extends Ye{constructor(){super(...arguments),this.loading=!Lr.state.wallets.listings.length,this.firstFetch=!Lr.state.wallets.listings.length,this.search="",this.endReached=!1,this.intersectionObserver=void 0,this.searchDebounce=Pe.debounce(r=>{r.length>=1?(this.firstFetch=!0,this.endReached=!1,this.search=r,Lr.resetSearch(),this.fetchWallets()):this.search&&(this.search="",this.endReached=this.isLastPage(),Lr.resetSearch())})}firstUpdated(){this.createPaginationObserver()}disconnectedCallback(){var r;(r=this.intersectionObserver)==null||r.disconnect()}get placeholderEl(){return Pe.getShadowRootElement(this,".wcm-placeholder-block")}createPaginationObserver(){this.intersectionObserver=new IntersectionObserver(([r])=>{r.isIntersecting&&!(this.search&&this.firstFetch)&&this.fetchWallets()}),this.intersectionObserver.observe(this.placeholderEl)}isLastPage(){const{wallets:r,search:e}=Lr.state,{listings:t,total:n}=this.search?e:r;return n<=cf||t.length>=n}async fetchWallets(){var r;const{wallets:e,search:t}=Lr.state,{listings:n,total:i,page:a}=this.search?t:e;if(!this.endReached&&(this.firstFetch||i>cf&&n.length<i))try{this.loading=!0;const c=(r=Ht.state.chains)==null?void 0:r.join(","),{listings:u}=await Lr.getWallets({page:this.firstFetch?1:a+1,entries:cf,search:this.search,version:2,chains:c}),d=u.map(h=>Pe.getWalletIcon(h));await Promise.all([...d.map(async h=>Pe.preloadImage(h)),ye.wait(300)]),this.endReached=this.isLastPage()}catch(c){console.error(c),ui.openToast(Pe.getErrorMessage(c),"error")}finally{this.loading=!1,this.firstFetch=!1}}onConnect(r){ye.isAndroid()?Pe.handleMobileLinking(r):Pe.goToConnectingView(r)}onSearchChange(r){const{value:e}=r.target;this.searchDebounce(e)}render(){const{wallets:r,search:e}=Lr.state,{listings:t}=this.search?e:r,n=this.loading&&!t.length,i=this.search.length>=3;let a=wi.manualWalletsTemplate(),c=wi.recomendedWalletsTemplate(!0);i&&(a=a.filter(({values:h})=>Pe.caseSafeIncludes(h[0],this.search)),c=c.filter(({values:h})=>Pe.caseSafeIncludes(h[0],this.search)));const u=!this.loading&&!t.length&&!c.length,d={"wcm-loading":n,"wcm-end-reached":this.endReached||!this.loading,"wcm-empty":u};return ue`<wcm-modal-header><wcm-search-input .onChange="${this.onSearchChange.bind(this)}"></wcm-search-input></wcm-modal-header><wcm-modal-content class="${kn(d)}"><div class="wcm-grid">${n?null:a} ${n?null:c} ${n?null:t.map(h=>ue`${h?ue`<wcm-wallet-button imageId="${h.image_id}" name="${h.name}" walletId="${h.id}" .onClick="${()=>this.onConnect(h)}"></wcm-wallet-button>`:null}`)}</div><div class="wcm-placeholder-block">${u?ue`<wcm-text variant="big-bold" color="secondary">No results found</wcm-text>`:null} ${!u&&this.loading?ue`<wcm-spinner></wcm-spinner>`:null}</div></wcm-modal-content>`}};es.styles=[rt.globalCss,tC],ra([Mr()],es.prototype,"loading",2),ra([Mr()],es.prototype,"firstFetch",2),ra([Mr()],es.prototype,"search",2),ra([Mr()],es.prototype,"endReached",2),es=ra([ot("wcm-wallet-explorer-view")],es);const iC=lt`wcm-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}wcm-text{text-align:center}`;var sC=Object.defineProperty,oC=Object.getOwnPropertyDescriptor,Om=(r,e,t,n)=>{for(var i=n>1?void 0:n?oC(e,t):e,a=r.length-1,c;a>=0;a--)(c=r[a])&&(i=(n?c(e,t,i):c(i))||i);return n&&i&&sC(e,t,i),i};let Oc=class extends Ye{constructor(){super(),this.isError=!1,this.openWebWallet()}onFormatAndRedirect(r){const{desktop:e,name:t}=ye.getWalletRouterData(),n=e?.universal;if(n){const i=ye.formatUniversalUrl(n,r,t);ye.openHref(i,"_blank")}}openWebWallet(){const{walletConnectUri:r}=Ht.state,e=ye.getWalletRouterData();Pe.setRecentWallet(e),r&&this.onFormatAndRedirect(r)}render(){const{name:r,id:e,image_id:t}=ye.getWalletRouterData(),{isMobile:n,isDesktop:i}=Pe.getCachedRouterWalletPlatforms(),a=ye.isMobile();return ue`<wcm-modal-header title="${r}" .onAction="${Pe.handleUriCopy}" .actionIcon="${ht.COPY_ICON}"></wcm-modal-header><wcm-modal-content><wcm-connector-waiting walletId="${e}" imageId="${Ir(t)}" label="${`Continue in ${r}...`}" .isError="${this.isError}"></wcm-connector-waiting></wcm-modal-content><wcm-info-footer><wcm-text color="secondary" variant="small-thin">${`${r} web app has opened in a new tab. Go there, accept the connection, and come back`}</wcm-text><wcm-platform-selection .isMobile="${n}" .isDesktop="${a?!1:i}" .isRetry="${!0}"><wcm-button .onClick="${this.openWebWallet.bind(this)}" .iconRight="${ht.RETRY_ICON}">Retry</wcm-button></wcm-platform-selection></wcm-info-footer>`}};Oc.styles=[rt.globalCss,iC],Om([Mr()],Oc.prototype,"isError",2),Oc=Om([ot("wcm-web-connecting-view")],Oc);var aC=Object.freeze({__proto__:null,get WcmModal(){return zs},get WcmQrCode(){return zn}});hn.EthereumProvider=Px,hn.OPTIONAL_EVENTS=X1,hn.OPTIONAL_METHODS=Q1,hn.REQUIRED_EVENTS=Xa,hn.REQUIRED_METHODS=Qa,hn.default=tc,Object.defineProperty(hn,"__esModule",{value:!0})});
137
+ `);const c=HD(e,t,i),u=yc.getSymbolSize(e),f=new RD(u);return FD(f,e),BD(f),kD(f,e),Lh(f,t,0),e>=7&&qD(f,e),zD(f,c),isNaN(n)&&(n=Th.getBestMask(f,Lh.bind(null,f,t))),Th.applyMask(n,f),Lh(f,t,n),{modules:f,version:e,errorCorrectionLevel:t,maskPattern:n,segments:i}}Xg.create=function(e,t){if(typeof e>"u"||e==="")throw new Error("No input text");let n=Ph.M,i,a;return typeof t<"u"&&(n=Ph.from(t.errorCorrectionLevel,Ph.M),i=wc.from(t.version),a=Th.from(t.maskPattern),t.toSJISFunc&&yc.setToSJISFunction(t.toSJISFunc)),KD(e,i,n,a)};var pm={},Mh={};(function(r){function e(t){if(typeof t=="number"&&(t=t.toString()),typeof t!="string")throw new Error("Color should be defined as hex string");let n=t.slice().replace("#","").split("");if(n.length<3||n.length===5||n.length>8)throw new Error("Invalid hex color: "+t);(n.length===3||n.length===4)&&(n=Array.prototype.concat.apply([],n.map(function(a){return[a,a]}))),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("")}}r.getOptions=function(n){n||(n={}),n.color||(n.color={});const i=typeof n.margin>"u"||n.margin===null||n.margin<0?4:n.margin,a=n.width&&n.width>=21?n.width:void 0,c=n.scale||4;return{width:a,scale:a?4:c,margin:i,color:{dark:e(n.color.dark||"#000000ff"),light:e(n.color.light||"#ffffffff")},type:n.type,rendererOpts:n.rendererOpts||{}}},r.getScale=function(n,i){return i.width&&i.width>=n+i.margin*2?i.width/(n+i.margin*2):i.scale},r.getImageWidth=function(n,i){const a=r.getScale(n,i);return Math.floor((n+i.margin*2)*a)},r.qrToImageData=function(n,i,a){const c=i.modules.size,u=i.modules.data,f=r.getScale(c,a),h=Math.floor((c+a.margin*2)*f),m=a.margin*f,w=[a.color.light,a.color.dark];for(let y=0;y<h;y++)for(let x=0;x<h;x++){let S=(y*h+x)*4,P=a.color.light;if(y>=m&&x>=m&&y<h-m&&x<h-m){const U=Math.floor((y-m)/f),j=Math.floor((x-m)/f);P=w[u[U*c+j]?1:0]}n[S++]=P.r,n[S++]=P.g,n[S++]=P.b,n[S]=P.a}}})(Mh),function(r){const e=Mh;function t(i,a,c){i.clearRect(0,0,a.width,a.height),a.style||(a.style={}),a.height=c,a.width=c,a.style.height=c+"px",a.style.width=c+"px"}function n(){try{return document.createElement("canvas")}catch{throw new Error("You need to specify a canvas element")}}r.render=function(a,c,u){let f=u,h=c;typeof f>"u"&&(!c||!c.getContext)&&(f=c,c=void 0),c||(h=n()),f=e.getOptions(f);const m=e.getImageWidth(a.modules.size,f),w=h.getContext("2d"),y=w.createImageData(m,m);return e.qrToImageData(y.data,a,f),t(w,h,m),w.putImageData(y,0,0),h},r.renderToDataURL=function(a,c,u){let f=u;typeof f>"u"&&(!c||!c.getContext)&&(f=c,c=void 0),f||(f={});const h=r.render(a,c,f),m=f.type||"image/png",w=f.rendererOpts||{};return h.toDataURL(m,w.quality)}}(pm);var gm={};const VD=Mh;function mm(r,e){const t=r.a/255,n=e+'="'+r.hex+'"';return t<1?n+" "+e+'-opacity="'+t.toFixed(2).slice(1)+'"':n}function Uh(r,e,t){let n=r+e;return typeof t<"u"&&(n+=" "+t),n}function GD(r,e,t){let n="",i=0,a=!1,c=0;for(let u=0;u<r.length;u++){const f=Math.floor(u%e),h=Math.floor(u/e);!f&&!a&&(a=!0),r[u]?(c++,u>0&&f>0&&r[u-1]||(n+=a?Uh("M",f+t,.5+h+t):Uh("m",i,0),i=0,a=!1),f+1<e&&r[u+1]||(n+=Uh("h",c),c=0)):i++}return n}gm.render=function(e,t,n){const i=VD.getOptions(t),a=e.modules.size,c=e.modules.data,u=a+i.margin*2,f=i.color.light.a?"<path "+mm(i.color.light,"fill")+' d="M0 0h'+u+"v"+u+'H0z"/>':"",h="<path "+mm(i.color.dark,"stroke")+' d="'+GD(c,a,i.margin)+'"/>',m='viewBox="0 0 '+u+" "+u+'"',y='<svg xmlns="http://www.w3.org/2000/svg" '+(i.width?'width="'+i.width+'" height="'+i.width+'" ':"")+m+' shape-rendering="crispEdges">'+f+h+`</svg>
138
+ `;return typeof n=="function"&&n(null,y),y};const YD=lD,jh=Xg,vm=pm,JD=gm;function Fh(r,e,t,n,i){const a=[].slice.call(arguments,1),c=a.length,u=typeof a[c-1]=="function";if(!u&&!YD())throw new Error("Callback required as last argument");if(u){if(c<2)throw new Error("Too few arguments provided");c===2?(i=t,t=e,e=n=void 0):c===3&&(e.getContext&&typeof i>"u"?(i=n,n=void 0):(i=n,n=t,t=e,e=void 0))}else{if(c<1)throw new Error("Too few arguments provided");return c===1?(t=e,e=n=void 0):c===2&&!e.getContext&&(n=t,t=e,e=void 0),new Promise(function(f,h){try{const m=jh.create(t,n);f(r(m,e,n))}catch(m){h(m)}})}try{const f=jh.create(t,n);i(null,r(f,e,n))}catch(f){i(f)}}Vo.create=jh.create,Vo.toCanvas=Fh.bind(null,vm.render),Vo.toDataURL=Fh.bind(null,vm.renderToDataURL),Vo.toString=Fh.bind(null,function(r,e,t){return JD.render(r,t)});var ZD=Object.defineProperty,ym=Object.getOwnPropertySymbols,QD=Object.prototype.hasOwnProperty,XD=Object.prototype.propertyIsEnumerable,wm=(r,e,t)=>e in r?ZD(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,Bh=(r,e)=>{for(var t in e||(e={}))QD.call(e,t)&&wm(r,t,e[t]);if(ym)for(var t of ym(e))XD.call(e,t)&&wm(r,t,e[t]);return r};function eS(){var r;const e=(r=ui.state.themeMode)!=null?r:"dark",t={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)"}}[e];return{"--wcm-color-fg-1":t.foreground[1],"--wcm-color-fg-2":t.foreground[2],"--wcm-color-fg-3":t.foreground[3],"--wcm-color-bg-1":t.background[1],"--wcm-color-bg-2":t.background[2],"--wcm-color-bg-3":t.background[3],"--wcm-color-overlay":t.overlay}}function bm(){return{"--wcm-accent-color":"#3396FF","--wcm-accent-fill-color":"#FFFFFF","--wcm-z-index":"89","--wcm-background-color":"#3396FF","--wcm-background-border-radius":"8px","--wcm-container-border-radius":"30px","--wcm-wallet-icon-border-radius":"15px","--wcm-wallet-icon-large-border-radius":"30px","--wcm-wallet-icon-small-border-radius":"7px","--wcm-input-border-radius":"28px","--wcm-button-border-radius":"10px","--wcm-notification-border-radius":"36px","--wcm-secondary-button-border-radius":"28px","--wcm-icon-button-border-radius":"50%","--wcm-button-hover-highlight-border-radius":"10px","--wcm-text-big-bold-size":"20px","--wcm-text-big-bold-weight":"600","--wcm-text-big-bold-line-height":"24px","--wcm-text-big-bold-letter-spacing":"-0.03em","--wcm-text-big-bold-text-transform":"none","--wcm-text-xsmall-bold-size":"10px","--wcm-text-xsmall-bold-weight":"700","--wcm-text-xsmall-bold-line-height":"12px","--wcm-text-xsmall-bold-letter-spacing":"0.02em","--wcm-text-xsmall-bold-text-transform":"uppercase","--wcm-text-xsmall-regular-size":"12px","--wcm-text-xsmall-regular-weight":"600","--wcm-text-xsmall-regular-line-height":"14px","--wcm-text-xsmall-regular-letter-spacing":"-0.03em","--wcm-text-xsmall-regular-text-transform":"none","--wcm-text-small-thin-size":"14px","--wcm-text-small-thin-weight":"500","--wcm-text-small-thin-line-height":"16px","--wcm-text-small-thin-letter-spacing":"-0.03em","--wcm-text-small-thin-text-transform":"none","--wcm-text-small-regular-size":"14px","--wcm-text-small-regular-weight":"600","--wcm-text-small-regular-line-height":"16px","--wcm-text-small-regular-letter-spacing":"-0.03em","--wcm-text-small-regular-text-transform":"none","--wcm-text-medium-regular-size":"16px","--wcm-text-medium-regular-weight":"600","--wcm-text-medium-regular-line-height":"20px","--wcm-text-medium-regular-letter-spacing":"-0.03em","--wcm-text-medium-regular-text-transform":"none","--wcm-font-family":"-apple-system, system-ui, BlinkMacSystemFont, 'Segoe UI', Roboto, Ubuntu, 'Helvetica Neue', sans-serif","--wcm-font-feature-settings":"'tnum' on, 'lnum' on, 'case' on","--wcm-success-color":"rgb(38,181,98)","--wcm-error-color":"rgb(242, 90, 103)","--wcm-overlay-background-color":"rgba(0, 0, 0, 0.3)","--wcm-overlay-backdrop-filter":"none"}}const rt={getPreset(r){return bm()[r]},setTheme(){const r=document.querySelector(":root"),{themeVariables:e}=ui.state;if(r){const t=Bh(Bh(Bh({},eS()),bm()),e);Object.entries(t).forEach(([n,i])=>r.style.setProperty(n,i))}},globalCss:lt`*,::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;transition:all .2s ease}@media (hover:hover) and (pointer:fine){button:active{transition:all .1s ease;transform:scale(.93)}}button::after{content:'';position:absolute;top:0;bottom:0;left:0;right:0;transition:background-color,.2s ease}button:disabled{cursor:not-allowed}button svg,button wcm-text{position:relative;z-index:1}input{border:none;outline:0;appearance:none}img{display:block}::selection{color:var(--wcm-accent-fill-color);background:var(--wcm-accent-color)}`},tS=lt`button{border-radius:var(--wcm-secondary-button-border-radius);height:28px;padding:0 10px;background-color:var(--wcm-accent-color)}button path{fill:var(--wcm-accent-fill-color)}button::after{border-radius:inherit;border:1px solid var(--wcm-color-overlay)}button:disabled::after{background-color:transparent}.wcm-icon-left svg{margin-right:5px}.wcm-icon-right svg{margin-left:5px}button:active::after{background-color:var(--wcm-color-overlay)}.wcm-ghost,.wcm-ghost:active::after,.wcm-outline{background-color:transparent}.wcm-ghost:active{opacity:.5}@media(hover:hover){button:hover::after{background-color:var(--wcm-color-overlay)}.wcm-ghost:hover::after{background-color:transparent}.wcm-ghost:hover{opacity:.5}}button:disabled{background-color:var(--wcm-color-bg-3);pointer-events:none}.wcm-ghost::after{border-color:transparent}.wcm-ghost path{fill:var(--wcm-color-fg-2)}.wcm-outline path{fill:var(--wcm-accent-color)}.wcm-outline:disabled{background-color:transparent;opacity:.5}`;var rS=Object.defineProperty,nS=Object.getOwnPropertyDescriptor,Fs=(r,e,t,n)=>{for(var i=n>1?void 0:n?nS(e,t):e,a=r.length-1,c;a>=0;a--)(c=r[a])&&(i=(n?c(e,t,i):c(i))||i);return n&&i&&rS(e,t,i),i};let mi=class extends Ye{constructor(){super(...arguments),this.disabled=!1,this.iconLeft=void 0,this.iconRight=void 0,this.onClick=()=>null,this.variant="default"}render(){const r={"wcm-icon-left":this.iconLeft!==void 0,"wcm-icon-right":this.iconRight!==void 0,"wcm-ghost":this.variant==="ghost","wcm-outline":this.variant==="outline"};let e="inverse";return this.variant==="ghost"&&(e="secondary"),this.variant==="outline"&&(e="accent"),he`<button class="${qn(r)}" ?disabled="${this.disabled}" @click="${this.onClick}">${this.iconLeft}<wcm-text variant="small-regular" color="${e}"><slot></slot></wcm-text>${this.iconRight}</button>`}};mi.styles=[rt.globalCss,tS],Fs([Be({type:Boolean})],mi.prototype,"disabled",2),Fs([Be()],mi.prototype,"iconLeft",2),Fs([Be()],mi.prototype,"iconRight",2),Fs([Be()],mi.prototype,"onClick",2),Fs([Be()],mi.prototype,"variant",2),mi=Fs([ot("wcm-button")],mi);const iS=lt`:host{display:inline-block}button{padding:0 15px 1px;height:40px;border-radius:var(--wcm-button-border-radius);color:var(--wcm-accent-fill-color);background-color:var(--wcm-accent-color)}button::after{content:'';top:0;bottom:0;left:0;right:0;position:absolute;background-color:transparent;border-radius:inherit;transition:background-color .2s ease;border:1px solid var(--wcm-color-overlay)}button:active::after{background-color:var(--wcm-color-overlay)}button:disabled{padding-bottom:0;background-color:var(--wcm-color-bg-3);color:var(--wcm-color-fg-3)}.wcm-secondary{color:var(--wcm-accent-color);background-color:transparent}.wcm-secondary::after{display:none}@media(hover:hover){button:hover::after{background-color:var(--wcm-color-overlay)}}`;var sS=Object.defineProperty,oS=Object.getOwnPropertyDescriptor,kh=(r,e,t,n)=>{for(var i=n>1?void 0:n?oS(e,t):e,a=r.length-1,c;a>=0;a--)(c=r[a])&&(i=(n?c(e,t,i):c(i))||i);return n&&i&&sS(e,t,i),i};let Zo=class extends Ye{constructor(){super(...arguments),this.disabled=!1,this.variant="primary"}render(){const r={"wcm-secondary":this.variant==="secondary"};return he`<button ?disabled="${this.disabled}" class="${qn(r)}"><slot></slot></button>`}};Zo.styles=[rt.globalCss,iS],kh([Be({type:Boolean})],Zo.prototype,"disabled",2),kh([Be()],Zo.prototype,"variant",2),Zo=kh([ot("wcm-button-big")],Zo);const aS=lt`:host{background-color:var(--wcm-color-bg-2);border-top:1px solid var(--wcm-color-bg-3)}div{padding:10px 20px;display:inherit;flex-direction:inherit;align-items:inherit;width:inherit;justify-content:inherit}`;var cS=Object.defineProperty,lS=Object.getOwnPropertyDescriptor,uS=(r,e,t,n)=>{for(var i=n>1?void 0:n?lS(e,t):e,a=r.length-1,c;a>=0;a--)(c=r[a])&&(i=(n?c(e,t,i):c(i))||i);return n&&i&&cS(e,t,i),i};let qh=class extends Ye{render(){return he`<div><slot></slot></div>`}};qh.styles=[rt.globalCss,aS],qh=uS([ot("wcm-info-footer")],qh);const ht={CROSS_ICON:Nt`<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>`,WALLET_CONNECT_LOGO:Nt`<svg width="178" height="29" viewBox="0 0 178 29" id="wcm-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:Nt`<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:Nt`<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:Nt`<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:Nt`<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:Nt`<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:Nt`<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:Nt`<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:Nt`<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:Nt`<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:Nt`<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:Nt`<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:Nt`<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:Nt`<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>`,SEARCH_ICON:Nt`<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>`,WALLET_PLACEHOLDER:Nt`<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>`,GLOBE_ICON:Nt`<svg width="16" height="16" fill="none" viewBox="0 0 16 16"><path fill="#fff" fill-rule="evenodd" d="M15.5 8a7.5 7.5 0 1 1-15 0 7.5 7.5 0 0 1 15 0Zm-2.113.75c.301 0 .535.264.47.558a6.01 6.01 0 0 1-2.867 3.896c-.203.116-.42-.103-.334-.32.409-1.018.691-2.274.797-3.657a.512.512 0 0 1 .507-.477h1.427Zm.47-2.058c.065.294-.169.558-.47.558H11.96a.512.512 0 0 1-.507-.477c-.106-1.383-.389-2.638-.797-3.656-.087-.217.13-.437.333-.32a6.01 6.01 0 0 1 2.868 3.895Zm-4.402.558c.286 0 .515-.24.49-.525-.121-1.361-.429-2.534-.83-3.393-.279-.6-.549-.93-.753-1.112a.535.535 0 0 0-.724 0c-.204.182-.474.513-.754 1.112-.4.859-.708 2.032-.828 3.393a.486.486 0 0 0 .49.525h2.909Zm-5.415 0c.267 0 .486-.21.507-.477.106-1.383.389-2.638.797-3.656.087-.217-.13-.437-.333-.32a6.01 6.01 0 0 0-2.868 3.895c-.065.294.169.558.47.558H4.04ZM2.143 9.308c-.065-.294.169-.558.47-.558H4.04c.267 0 .486.21.507.477.106 1.383.389 2.639.797 3.657.087.217-.13.436-.333.32a6.01 6.01 0 0 1-2.868-3.896Zm3.913-.033a.486.486 0 0 1 .49-.525h2.909c.286 0 .515.24.49.525-.121 1.361-.428 2.535-.83 3.394-.279.6-.549.93-.753 1.112a.535.535 0 0 1-.724 0c-.204-.182-.474-.513-.754-1.112-.4-.859-.708-2.033-.828-3.394Z" clip-rule="evenodd"/></svg>`},hS=lt`.wcm-toolbar-placeholder{top:0;bottom:0;left:0;right:0;width:100%;position:absolute;display:block;pointer-events:none;height:100px;border-radius:calc(var(--wcm-background-border-radius) * .9);background-color:var(--wcm-background-color);background-position:center;background-size:cover}.wcm-toolbar{height:38px;display:flex;position:relative;margin:5px 15px 5px 5px;justify-content:space-between;align-items:center}.wcm-toolbar img,.wcm-toolbar svg{height:28px;object-position:left center;object-fit:contain}#wcm-wc-logo path{fill:var(--wcm-accent-fill-color)}button{width:28px;height:28px;border-radius:var(--wcm-icon-button-border-radius);border:0;display:flex;justify-content:center;align-items:center;cursor:pointer;background-color:var(--wcm-color-bg-1);box-shadow:0 0 0 1px var(--wcm-color-overlay)}button:active{background-color:var(--wcm-color-bg-2)}button svg{display:block;object-position:center}button path{fill:var(--wcm-color-fg-1)}.wcm-toolbar div{display:flex}@media(hover:hover){button:hover{background-color:var(--wcm-color-bg-2)}}`;var fS=Object.defineProperty,dS=Object.getOwnPropertyDescriptor,pS=(r,e,t,n)=>{for(var i=n>1?void 0:n?dS(e,t):e,a=r.length-1,c;a>=0;a--)(c=r[a])&&(i=(n?c(e,t,i):c(i))||i);return n&&i&&fS(e,t,i),i};let zh=class extends Ye{render(){return he`<div class="wcm-toolbar-placeholder"></div><div class="wcm-toolbar">${ht.WALLET_CONNECT_LOGO} <button @click="${Wi.close}">${ht.CROSS_ICON}</button></div>`}};zh.styles=[rt.globalCss,hS],zh=pS([ot("wcm-modal-backcard")],zh);const gS=lt`main{padding:20px;padding-top:0;width:100%}`;var mS=Object.defineProperty,vS=Object.getOwnPropertyDescriptor,yS=(r,e,t,n)=>{for(var i=n>1?void 0:n?vS(e,t):e,a=r.length-1,c;a>=0;a--)(c=r[a])&&(i=(n?c(e,t,i):c(i))||i);return n&&i&&mS(e,t,i),i};let Hh=class extends Ye{render(){return he`<main><slot></slot></main>`}};Hh.styles=[rt.globalCss,gS],Hh=yS([ot("wcm-modal-content")],Hh);const wS=lt`footer{padding:10px;display:flex;flex-direction:column;align-items:inherit;justify-content:inherit;border-top:1px solid var(--wcm-color-bg-2)}`;var bS=Object.defineProperty,_S=Object.getOwnPropertyDescriptor,ES=(r,e,t,n)=>{for(var i=n>1?void 0:n?_S(e,t):e,a=r.length-1,c;a>=0;a--)(c=r[a])&&(i=(n?c(e,t,i):c(i))||i);return n&&i&&bS(e,t,i),i};let Wh=class extends Ye{render(){return he`<footer><slot></slot></footer>`}};Wh.styles=[rt.globalCss,wS],Wh=ES([ot("wcm-modal-footer")],Wh);const xS=lt`header{display:flex;justify-content:center;align-items:center;padding:20px;position:relative}.wcm-border{border-bottom:1px solid var(--wcm-color-bg-2);margin-bottom:20px}header button{padding:15px 20px}header button:active{opacity:.5}@media(hover:hover){header button:hover{opacity:.5}}.wcm-back-btn{position:absolute;left:0}.wcm-action-btn{position:absolute;right:0}path{fill:var(--wcm-accent-color)}`;var IS=Object.defineProperty,DS=Object.getOwnPropertyDescriptor,Qo=(r,e,t,n)=>{for(var i=n>1?void 0:n?DS(e,t):e,a=r.length-1,c;a>=0;a--)(c=r[a])&&(i=(n?c(e,t,i):c(i))||i);return n&&i&&IS(e,t,i),i};let Xi=class extends Ye{constructor(){super(...arguments),this.title="",this.onAction=void 0,this.actionIcon=void 0,this.border=!1}backBtnTemplate(){return he`<button class="wcm-back-btn" @click="${Pt.goBack}">${ht.BACK_ICON}</button>`}actionBtnTemplate(){return he`<button class="wcm-action-btn" @click="${this.onAction}">${this.actionIcon}</button>`}render(){const r={"wcm-border":this.border},e=Pt.state.history.length>1,t=this.title?he`<wcm-text variant="big-bold">${this.title}</wcm-text>`:he`<slot></slot>`;return he`<header class="${qn(r)}">${e?this.backBtnTemplate():null} ${t} ${this.onAction?this.actionBtnTemplate():null}</header>`}};Xi.styles=[rt.globalCss,xS],Qo([Be()],Xi.prototype,"title",2),Qo([Be()],Xi.prototype,"onAction",2),Qo([Be()],Xi.prototype,"actionIcon",2),Qo([Be({type:Boolean})],Xi.prototype,"border",2),Xi=Qo([ot("wcm-modal-header")],Xi);const Pe={MOBILE_BREAKPOINT:600,WCM_RECENT_WALLET_DATA:"WCM_RECENT_WALLET_DATA",EXPLORER_WALLET_URL:"https://explorer.walletconnect.com/?type=wallet",getShadowRootElement(r,e){const t=r.renderRoot.querySelector(e);if(!t)throw new Error(`${e} not found`);return t},getWalletIcon({id:r,image_id:e}){const{walletImages:t}=Kr.state;return t!=null&&t[r]?t[r]:e?Lr.getWalletImageUrl(e):""},getWalletName(r,e=!1){return e&&r.length>8?`${r.substring(0,8)}..`:r},isMobileAnimation(){return window.innerWidth<=Pe.MOBILE_BREAKPOINT},async preloadImage(r){const e=new Promise((t,n)=>{const i=new Image;i.onload=t,i.onerror=n,i.crossOrigin="anonymous",i.src=r});return Promise.race([e,we.wait(3e3)])},getErrorMessage(r){return r instanceof Error?r.message:"Unknown Error"},debounce(r,e=500){let t;return(...n)=>{function i(){r(...n)}t&&clearTimeout(t),t=setTimeout(i,e)}},handleMobileLinking(r){const{walletConnectUri:e}=zt.state,{mobile:t,name:n}=r,i=t?.native,a=t?.universal;Pe.setRecentWallet(r);function c(u){let f="";i?f=we.formatUniversalUrl(i,u,n):a&&(f=we.formatNativeUrl(a,u,n)),we.openHref(f,"_self")}e&&c(e)},handleAndroidLinking(){const{walletConnectUri:r}=zt.state;r&&(we.setWalletConnectAndroidDeepLink(r),we.openHref(r,"_self"))},async handleUriCopy(){const{walletConnectUri:r}=zt.state;if(r)try{await navigator.clipboard.writeText(r),hi.openToast("Link copied","success")}catch{hi.openToast("Failed to copy","error")}},getCustomImageUrls(){const{walletImages:r}=Kr.state,e=Object.values(r??{});return Object.values(e)},truncate(r,e=8){return r.length<=e?r:`${r.substring(0,4)}...${r.substring(r.length-4)}`},setRecentWallet(r){try{localStorage.setItem(Pe.WCM_RECENT_WALLET_DATA,JSON.stringify(r))}catch{console.info("Unable to set recent wallet")}},getRecentWallet(){try{const r=localStorage.getItem(Pe.WCM_RECENT_WALLET_DATA);return r?JSON.parse(r):void 0}catch{console.info("Unable to get recent wallet")}},caseSafeIncludes(r,e){return r.toUpperCase().includes(e.toUpperCase())},openWalletExplorerUrl(){we.openHref(Pe.EXPLORER_WALLET_URL,"_blank")},getCachedRouterWalletPlatforms(){const{desktop:r,mobile:e}=we.getWalletRouterData(),t=!!r?.native,n=!!r?.universal,i=!!e?.native||!!e?.universal;return{isDesktop:t,isMobile:i,isWeb:n}},goToConnectingView(r){Pt.setData({Wallet:r});const e=we.isMobile(),{isDesktop:t,isWeb:n,isMobile:i}=Pe.getCachedRouterWalletPlatforms();e?i?Pt.push("MobileConnecting"):n?Pt.push("WebConnecting"):Pt.push("InstallWallet"):t?Pt.push("DesktopConnecting"):n?Pt.push("WebConnecting"):i?Pt.push("MobileQrcodeConnecting"):Pt.push("InstallWallet")}},SS=lt`.wcm-router{overflow:hidden;will-change:transform}.wcm-content{display:flex;flex-direction:column}`;var CS=Object.defineProperty,OS=Object.getOwnPropertyDescriptor,Kh=(r,e,t,n)=>{for(var i=n>1?void 0:n?OS(e,t):e,a=r.length-1,c;a>=0;a--)(c=r[a])&&(i=(n?c(e,t,i):c(i))||i);return n&&i&&CS(e,t,i),i};let Xo=class extends Ye{constructor(){super(),this.view=Pt.state.view,this.prevView=Pt.state.view,this.unsubscribe=void 0,this.oldHeight="0px",this.resizeObserver=void 0,this.unsubscribe=Pt.subscribe(r=>{this.view!==r.view&&this.onChangeRoute()})}firstUpdated(){this.resizeObserver=new ResizeObserver(([r])=>{const e=`${r.contentRect.height}px`;this.oldHeight!=="0px"&&Qi(this.routerEl,{height:[this.oldHeight,e]},{duration:.2}),this.oldHeight=e}),this.resizeObserver.observe(this.contentEl)}disconnectedCallback(){var r,e;(r=this.unsubscribe)==null||r.call(this),(e=this.resizeObserver)==null||e.disconnect()}get routerEl(){return Pe.getShadowRootElement(this,".wcm-router")}get contentEl(){return Pe.getShadowRootElement(this,".wcm-content")}viewTemplate(){switch(this.view){case"ConnectWallet":return he`<wcm-connect-wallet-view></wcm-connect-wallet-view>`;case"DesktopConnecting":return he`<wcm-desktop-connecting-view></wcm-desktop-connecting-view>`;case"MobileConnecting":return he`<wcm-mobile-connecting-view></wcm-mobile-connecting-view>`;case"WebConnecting":return he`<wcm-web-connecting-view></wcm-web-connecting-view>`;case"MobileQrcodeConnecting":return he`<wcm-mobile-qr-connecting-view></wcm-mobile-qr-connecting-view>`;case"WalletExplorer":return he`<wcm-wallet-explorer-view></wcm-wallet-explorer-view>`;case"Qrcode":return he`<wcm-qrcode-view></wcm-qrcode-view>`;case"InstallWallet":return he`<wcm-install-wallet-view></wcm-install-wallet-view>`;default:return he`<div>Not Found</div>`}}async onChangeRoute(){await Qi(this.routerEl,{opacity:[1,0],scale:[1,1.02]},{duration:.15,delay:.1}).finished,this.view=Pt.state.view,Qi(this.routerEl,{opacity:[0,1],scale:[.99,1]},{duration:.37,delay:.05})}render(){return he`<div class="wcm-router"><div class="wcm-content">${this.viewTemplate()}</div></div>`}};Xo.styles=[rt.globalCss,SS],Kh([Mr()],Xo.prototype,"view",2),Kh([Mr()],Xo.prototype,"prevView",2),Xo=Kh([ot("wcm-modal-router")],Xo);const $S=lt`div{height:36px;width:max-content;display:flex;justify-content:center;align-items:center;padding:9px 15px 11px;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:var(--wcm-notification-border-radius);border:1px solid var(--wcm-color-overlay);background-color:var(--wcm-color-overlay)}svg{margin-right:5px}@-moz-document url-prefix(){div{background-color:var(--wcm-color-bg-3)}}.wcm-success path{fill:var(--wcm-accent-color)}.wcm-error path{fill:var(--wcm-error-color)}`;var AS=Object.defineProperty,PS=Object.getOwnPropertyDescriptor,_m=(r,e,t,n)=>{for(var i=n>1?void 0:n?PS(e,t):e,a=r.length-1,c;a>=0;a--)(c=r[a])&&(i=(n?c(e,t,i):c(i))||i);return n&&i&&AS(e,t,i),i};let bc=class extends Ye{constructor(){super(),this.open=!1,this.unsubscribe=void 0,this.timeout=void 0,this.unsubscribe=hi.subscribe(r=>{r.open?(this.open=!0,this.timeout=setTimeout(()=>hi.closeToast(),2200)):(this.open=!1,clearTimeout(this.timeout))})}disconnectedCallback(){var r;(r=this.unsubscribe)==null||r.call(this),clearTimeout(this.timeout),hi.closeToast()}render(){const{message:r,variant:e}=hi.state,t={"wcm-success":e==="success","wcm-error":e==="error"};return this.open?he`<div class="${qn(t)}">${e==="success"?ht.CHECKMARK_ICON:null} ${e==="error"?ht.CROSS_ICON:null}<wcm-text variant="small-regular">${r}</wcm-text></div>`:null}};bc.styles=[rt.globalCss,$S],_m([Mr()],bc.prototype,"open",2),bc=_m([ot("wcm-modal-toast")],bc);const TS=.1,Em=2.5,zn=7;function Vh(r,e,t){return r===e?!1:(r-e<0?e-r:r-e)<=t+TS}function RS(r,e){const t=Array.prototype.slice.call(Vo.create(r,{errorCorrectionLevel:e}).modules.data,0),n=Math.sqrt(t.length);return t.reduce((i,a,c)=>(c%n===0?i.push([a]):i[i.length-1].push(a))&&i,[])}const NS={generate(r,e,t){const n="#141414",i="#ffffff",a=[],c=RS(r,"Q"),u=e/c.length,f=[{x:0,y:0},{x:1,y:0},{x:0,y:1}];f.forEach(({x:S,y:P})=>{const U=(c.length-zn)*u*S,j=(c.length-zn)*u*P,A=.45;for(let T=0;T<f.length;T+=1){const C=u*(zn-T*2);a.push(Nt`<rect fill="${T%2===0?n:i}" height="${C}" rx="${C*A}" ry="${C*A}" width="${C}" x="${U+u*T}" y="${j+u*T}">`)}});const h=Math.floor((t+25)/u),m=c.length/2-h/2,w=c.length/2+h/2-1,y=[];c.forEach((S,P)=>{S.forEach((U,j)=>{if(c[P][j]&&!(P<zn&&j<zn||P>c.length-(zn+1)&&j<zn||P<zn&&j>c.length-(zn+1))&&!(P>m&&P<w&&j>m&&j<w)){const A=P*u+u/2,T=j*u+u/2;y.push([A,T])}})});const x={};return y.forEach(([S,P])=>{x[S]?x[S].push(P):x[S]=[P]}),Object.entries(x).map(([S,P])=>{const U=P.filter(j=>P.every(A=>!Vh(j,A,u)));return[Number(S),U]}).forEach(([S,P])=>{P.forEach(U=>{a.push(Nt`<circle cx="${S}" cy="${U}" fill="${n}" r="${u/Em}">`)})}),Object.entries(x).filter(([S,P])=>P.length>1).map(([S,P])=>{const U=P.filter(j=>P.some(A=>Vh(j,A,u)));return[Number(S),U]}).map(([S,P])=>{P.sort((j,A)=>j<A?-1:1);const U=[];for(const j of P){const A=U.find(T=>T.some(C=>Vh(j,C,u)));A?A.push(j):U.push([j])}return[S,U.map(j=>[j[0],j[j.length-1]])]}).forEach(([S,P])=>{P.forEach(([U,j])=>{a.push(Nt`<line x1="${S}" x2="${S}" y1="${U}" y2="${j}" stroke="${n}" stroke-width="${u/(Em/2)}" stroke-linecap="round">`)})}),a}},LS=lt`@keyframes fadeIn{0%{opacity:0}100%{opacity:1}}div{position:relative;user-select:none;display:block;overflow:hidden;aspect-ratio:1/1;animation:fadeIn ease .2s}.wcm-dark{background-color:#fff;border-radius:var(--wcm-container-border-radius);padding:18px;box-shadow:0 2px 5px #000}svg:first-child,wcm-wallet-image{position:absolute;top:50%;left:50%;transform:translateY(-50%) translateX(-50%)}wcm-wallet-image{transform:translateY(-50%) translateX(-50%)}wcm-wallet-image{width:25%;height:25%;border-radius:var(--wcm-wallet-icon-border-radius)}svg:first-child{transform:translateY(-50%) translateX(-50%) scale(.9)}svg:first-child path:first-child{fill:var(--wcm-accent-color)}svg:first-child path:last-child{stroke:var(--wcm-color-overlay)}`;var MS=Object.defineProperty,US=Object.getOwnPropertyDescriptor,Bs=(r,e,t,n)=>{for(var i=n>1?void 0:n?US(e,t):e,a=r.length-1,c;a>=0;a--)(c=r[a])&&(i=(n?c(e,t,i):c(i))||i);return n&&i&&MS(e,t,i),i};let Hn=class extends Ye{constructor(){super(...arguments),this.uri="",this.size=0,this.imageId=void 0,this.walletId=void 0,this.imageUrl=void 0}svgTemplate(){const r=ui.state.themeMode==="light"?this.size:this.size-36;return Nt`<svg height="${r}" width="${r}">${NS.generate(this.uri,r,r/4)}</svg>`}render(){const r={"wcm-dark":ui.state.themeMode==="dark"};return he`<div style="${`width: ${this.size}px`}" class="${qn(r)}">${this.walletId||this.imageUrl?he`<wcm-wallet-image walletId="${Dr(this.walletId)}" imageId="${Dr(this.imageId)}" imageUrl="${Dr(this.imageUrl)}"></wcm-wallet-image>`:ht.WALLET_CONNECT_ICON_COLORED} ${this.svgTemplate()}</div>`}};Hn.styles=[rt.globalCss,LS],Bs([Be()],Hn.prototype,"uri",2),Bs([Be({type:Number})],Hn.prototype,"size",2),Bs([Be()],Hn.prototype,"imageId",2),Bs([Be()],Hn.prototype,"walletId",2),Bs([Be()],Hn.prototype,"imageUrl",2),Hn=Bs([ot("wcm-qrcode")],Hn);const jS=lt`:host{position:relative;height:28px;width:80%}input{width:100%;height:100%;line-height:28px!important;border-radius:var(--wcm-input-border-radius);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:var(--wcm-color-fg-1);background-color:var(--wcm-color-bg-3);box-shadow:inset 0 0 0 1px var(--wcm-color-overlay);caret-color:var(--wcm-accent-color)}input::placeholder{color:var(--wcm-color-fg-2)}svg{left:10px;top:4px;pointer-events:none;position:absolute;width:20px;height:20px}input:focus-within{box-shadow:inset 0 0 0 1px var(--wcm-accent-color)}path{fill:var(--wcm-color-fg-2)}`;var FS=Object.defineProperty,BS=Object.getOwnPropertyDescriptor,xm=(r,e,t,n)=>{for(var i=n>1?void 0:n?BS(e,t):e,a=r.length-1,c;a>=0;a--)(c=r[a])&&(i=(n?c(e,t,i):c(i))||i);return n&&i&&FS(e,t,i),i};let _c=class extends Ye{constructor(){super(...arguments),this.onChange=()=>null}render(){return he`<input type="text" @input="${this.onChange}" placeholder="Search wallets"> ${ht.SEARCH_ICON}`}};_c.styles=[rt.globalCss,jS],xm([Be()],_c.prototype,"onChange",2),_c=xm([ot("wcm-search-input")],_c);const kS=lt`@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(--wcm-accent-color)}`;var qS=Object.defineProperty,zS=Object.getOwnPropertyDescriptor,HS=(r,e,t,n)=>{for(var i=n>1?void 0:n?zS(e,t):e,a=r.length-1,c;a>=0;a--)(c=r[a])&&(i=(n?c(e,t,i):c(i))||i);return n&&i&&qS(e,t,i),i};let Gh=class extends Ye{render(){return he`<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>`}};Gh.styles=[rt.globalCss,kS],Gh=HS([ot("wcm-spinner")],Gh);const WS=lt`span{font-style:normal;font-family:var(--wcm-font-family);font-feature-settings:var(--wcm-font-feature-settings)}.wcm-xsmall-bold{font-family:var(--wcm-text-xsmall-bold-font-family);font-weight:var(--wcm-text-xsmall-bold-weight);font-size:var(--wcm-text-xsmall-bold-size);line-height:var(--wcm-text-xsmall-bold-line-height);letter-spacing:var(--wcm-text-xsmall-bold-letter-spacing);text-transform:var(--wcm-text-xsmall-bold-text-transform)}.wcm-xsmall-regular{font-family:var(--wcm-text-xsmall-regular-font-family);font-weight:var(--wcm-text-xsmall-regular-weight);font-size:var(--wcm-text-xsmall-regular-size);line-height:var(--wcm-text-xsmall-regular-line-height);letter-spacing:var(--wcm-text-xsmall-regular-letter-spacing);text-transform:var(--wcm-text-xsmall-regular-text-transform)}.wcm-small-thin{font-family:var(--wcm-text-small-thin-font-family);font-weight:var(--wcm-text-small-thin-weight);font-size:var(--wcm-text-small-thin-size);line-height:var(--wcm-text-small-thin-line-height);letter-spacing:var(--wcm-text-small-thin-letter-spacing);text-transform:var(--wcm-text-small-thin-text-transform)}.wcm-small-regular{font-family:var(--wcm-text-small-regular-font-family);font-weight:var(--wcm-text-small-regular-weight);font-size:var(--wcm-text-small-regular-size);line-height:var(--wcm-text-small-regular-line-height);letter-spacing:var(--wcm-text-small-regular-letter-spacing);text-transform:var(--wcm-text-small-regular-text-transform)}.wcm-medium-regular{font-family:var(--wcm-text-medium-regular-font-family);font-weight:var(--wcm-text-medium-regular-weight);font-size:var(--wcm-text-medium-regular-size);line-height:var(--wcm-text-medium-regular-line-height);letter-spacing:var(--wcm-text-medium-regular-letter-spacing);text-transform:var(--wcm-text-medium-regular-text-transform)}.wcm-big-bold{font-family:var(--wcm-text-big-bold-font-family);font-weight:var(--wcm-text-big-bold-weight);font-size:var(--wcm-text-big-bold-size);line-height:var(--wcm-text-big-bold-line-height);letter-spacing:var(--wcm-text-big-bold-letter-spacing);text-transform:var(--wcm-text-big-bold-text-transform)}:host(*){color:var(--wcm-color-fg-1)}.wcm-color-primary{color:var(--wcm-color-fg-1)}.wcm-color-secondary{color:var(--wcm-color-fg-2)}.wcm-color-tertiary{color:var(--wcm-color-fg-3)}.wcm-color-inverse{color:var(--wcm-accent-fill-color)}.wcm-color-accnt{color:var(--wcm-accent-color)}.wcm-color-error{color:var(--wcm-error-color)}`;var KS=Object.defineProperty,VS=Object.getOwnPropertyDescriptor,Yh=(r,e,t,n)=>{for(var i=n>1?void 0:n?VS(e,t):e,a=r.length-1,c;a>=0;a--)(c=r[a])&&(i=(n?c(e,t,i):c(i))||i);return n&&i&&KS(e,t,i),i};let ea=class extends Ye{constructor(){super(...arguments),this.variant="medium-regular",this.color="primary"}render(){const r={"wcm-big-bold":this.variant==="big-bold","wcm-medium-regular":this.variant==="medium-regular","wcm-small-regular":this.variant==="small-regular","wcm-small-thin":this.variant==="small-thin","wcm-xsmall-regular":this.variant==="xsmall-regular","wcm-xsmall-bold":this.variant==="xsmall-bold","wcm-color-primary":this.color==="primary","wcm-color-secondary":this.color==="secondary","wcm-color-tertiary":this.color==="tertiary","wcm-color-inverse":this.color==="inverse","wcm-color-accnt":this.color==="accent","wcm-color-error":this.color==="error"};return he`<span><slot class="${qn(r)}"></slot></span>`}};ea.styles=[rt.globalCss,WS],Yh([Be()],ea.prototype,"variant",2),Yh([Be()],ea.prototype,"color",2),ea=Yh([ot("wcm-text")],ea);const GS=lt`button{width:100%;height:100%;border-radius:var(--wcm-button-hover-highlight-border-radius);display:flex;align-items:flex-start}button:active{background-color:var(--wcm-color-overlay)}@media(hover:hover){button:hover{background-color:var(--wcm-color-overlay)}}button>div{width:80px;padding:5px 0;display:flex;flex-direction:column;align-items:center}wcm-text{width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-align:center}wcm-wallet-image{height:60px;width:60px;transition:all .2s ease;border-radius:var(--wcm-wallet-icon-border-radius);margin-bottom:5px}.wcm-sublabel{margin-top:2px}`;var YS=Object.defineProperty,JS=Object.getOwnPropertyDescriptor,vi=(r,e,t,n)=>{for(var i=n>1?void 0:n?JS(e,t):e,a=r.length-1,c;a>=0;a--)(c=r[a])&&(i=(n?c(e,t,i):c(i))||i);return n&&i&&YS(e,t,i),i};let Cn=class extends Ye{constructor(){super(...arguments),this.onClick=()=>null,this.name="",this.walletId="",this.label=void 0,this.imageId=void 0,this.installed=!1,this.recent=!1}sublabelTemplate(){return this.recent?he`<wcm-text class="wcm-sublabel" variant="xsmall-bold" color="tertiary">RECENT</wcm-text>`:this.installed?he`<wcm-text class="wcm-sublabel" variant="xsmall-bold" color="tertiary">INSTALLED</wcm-text>`:null}handleClick(){og.click({name:"WALLET_BUTTON",walletId:this.walletId}),this.onClick()}render(){var r;return he`<button @click="${this.handleClick.bind(this)}"><div><wcm-wallet-image walletId="${this.walletId}" imageId="${Dr(this.imageId)}"></wcm-wallet-image><wcm-text variant="xsmall-regular">${(r=this.label)!=null?r:Pe.getWalletName(this.name,!0)}</wcm-text>${this.sublabelTemplate()}</div></button>`}};Cn.styles=[rt.globalCss,GS],vi([Be()],Cn.prototype,"onClick",2),vi([Be()],Cn.prototype,"name",2),vi([Be()],Cn.prototype,"walletId",2),vi([Be()],Cn.prototype,"label",2),vi([Be()],Cn.prototype,"imageId",2),vi([Be({type:Boolean})],Cn.prototype,"installed",2),vi([Be({type:Boolean})],Cn.prototype,"recent",2),Cn=vi([ot("wcm-wallet-button")],Cn);const ZS=lt`:host{display:block}div{overflow:hidden;position:relative;border-radius:inherit;width:100%;height:100%;background-color:var(--wcm-color-overlay)}svg{position:relative;width:100%;height:100%}div::after{content:'';position:absolute;top:0;bottom:0;left:0;right:0;border-radius:inherit;border:1px solid var(--wcm-color-overlay)}div img{width:100%;height:100%;object-fit:cover;object-position:center}#wallet-placeholder-fill{fill:var(--wcm-color-bg-3)}#wallet-placeholder-dash{stroke:var(--wcm-color-overlay)}`;var QS=Object.defineProperty,XS=Object.getOwnPropertyDescriptor,Ec=(r,e,t,n)=>{for(var i=n>1?void 0:n?XS(e,t):e,a=r.length-1,c;a>=0;a--)(c=r[a])&&(i=(n?c(e,t,i):c(i))||i);return n&&i&&QS(e,t,i),i};let ks=class extends Ye{constructor(){super(...arguments),this.walletId="",this.imageId=void 0,this.imageUrl=void 0}render(){var r;const e=(r=this.imageUrl)!=null&&r.length?this.imageUrl:Pe.getWalletIcon({id:this.walletId,image_id:this.imageId});return he`${e.length?he`<div><img crossorigin="anonymous" src="${e}" alt="${this.id}"></div>`:ht.WALLET_PLACEHOLDER}`}};ks.styles=[rt.globalCss,ZS],Ec([Be()],ks.prototype,"walletId",2),Ec([Be()],ks.prototype,"imageId",2),Ec([Be()],ks.prototype,"imageUrl",2),ks=Ec([ot("wcm-wallet-image")],ks);var eC=Object.defineProperty,tC=Object.getOwnPropertyDescriptor,Im=(r,e,t,n)=>{for(var i=n>1?void 0:n?tC(e,t):e,a=r.length-1,c;a>=0;a--)(c=r[a])&&(i=(n?c(e,t,i):c(i))||i);return n&&i&&eC(e,t,i),i};let Jh=class extends Ye{constructor(){super(),this.preload=!0,this.preloadData()}async loadImages(r){try{r!=null&&r.length&&await Promise.all(r.map(async e=>Pe.preloadImage(e)))}catch{console.info("Unsuccessful attempt at preloading some images",r)}}async preloadListings(){if(Kr.state.enableExplorer){await Lr.getRecomendedWallets(),zt.setIsDataLoaded(!0);const{recomendedWallets:r}=Lr.state,e=r.map(t=>Pe.getWalletIcon(t));await this.loadImages(e)}else zt.setIsDataLoaded(!0)}async preloadCustomImages(){const r=Pe.getCustomImageUrls();await this.loadImages(r)}async preloadData(){try{this.preload&&(this.preload=!1,await Promise.all([this.preloadListings(),this.preloadCustomImages()]))}catch(r){console.error(r),hi.openToast("Failed preloading","error")}}};Im([Mr()],Jh.prototype,"preload",2),Jh=Im([ot("wcm-explorer-context")],Jh);var rC=Object.defineProperty,nC=Object.getOwnPropertyDescriptor,iC=(r,e,t,n)=>{for(var i=n>1?void 0:n?nC(e,t):e,a=r.length-1,c;a>=0;a--)(c=r[a])&&(i=(n?c(e,t,i):c(i))||i);return n&&i&&rC(e,t,i),i};let Dm=class extends Ye{constructor(){super(),this.unsubscribeTheme=void 0,rt.setTheme(),this.unsubscribeTheme=ui.subscribe(rt.setTheme)}disconnectedCallback(){var r;(r=this.unsubscribeTheme)==null||r.call(this)}};Dm=iC([ot("wcm-theme-context")],Dm);const sC=lt`@keyframes scroll{0%{transform:translate3d(0,0,0)}100%{transform:translate3d(calc(-70px * 9),0,0)}}.wcm-slider{position:relative;overflow-x:hidden;padding:10px 0;margin:0 -20px;width:calc(100% + 40px)}.wcm-track{display:flex;width:calc(70px * 18);animation:scroll 20s linear infinite;opacity:.7}.wcm-track svg{margin:0 5px}wcm-wallet-image{width:60px;height:60px;margin:0 5px;border-radius:var(--wcm-wallet-icon-border-radius)}.wcm-grid{display:grid;grid-template-columns:repeat(4,80px);justify-content:space-between}.wcm-title{display:flex;align-items:center;margin-bottom:10px}.wcm-title svg{margin-right:6px}.wcm-title path{fill:var(--wcm-accent-color)}wcm-modal-footer .wcm-title{padding:0 10px}wcm-button-big{position:absolute;top:50%;left:50%;transform:translateY(-50%) translateX(-50%);filter:drop-shadow(0 0 17px var(--wcm-color-bg-1))}wcm-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}wcm-info-footer wcm-text{text-align:center;margin-bottom:15px}#wallet-placeholder-fill{fill:var(--wcm-color-bg-3)}#wallet-placeholder-dash{stroke:var(--wcm-color-overlay)}`;var oC=Object.defineProperty,aC=Object.getOwnPropertyDescriptor,cC=(r,e,t,n)=>{for(var i=n>1?void 0:n?aC(e,t):e,a=r.length-1,c;a>=0;a--)(c=r[a])&&(i=(n?c(e,t,i):c(i))||i);return n&&i&&oC(e,t,i),i};let Zh=class extends Ye{onGoToQrcode(){Pt.push("Qrcode")}render(){const{recomendedWallets:r}=Lr.state,e=[...r,...r],t=we.RECOMMENDED_WALLET_AMOUNT*2;return he`<wcm-modal-header title="Connect your wallet" .onAction="${this.onGoToQrcode}" .actionIcon="${ht.QRCODE_ICON}"></wcm-modal-header><wcm-modal-content><div class="wcm-title">${ht.MOBILE_ICON}<wcm-text variant="small-regular" color="accent">WalletConnect</wcm-text></div><div class="wcm-slider"><div class="wcm-track">${[...Array(t)].map((n,i)=>{const a=e[i%e.length];return a?he`<wcm-wallet-image walletId="${a.id}" imageId="${a.image_id}"></wcm-wallet-image>`:ht.WALLET_PLACEHOLDER})}</div><wcm-button-big @click="${Pe.handleAndroidLinking}"><wcm-text variant="medium-regular" color="inverse">Select Wallet</wcm-text></wcm-button-big></div></wcm-modal-content><wcm-info-footer><wcm-text color="secondary" variant="small-thin">Choose WalletConnect to see supported apps on your device</wcm-text></wcm-info-footer>`}};Zh.styles=[rt.globalCss,sC],Zh=cC([ot("wcm-android-wallet-selection")],Zh);const lC=lt`@keyframes loading{to{stroke-dashoffset:0}}@keyframes shake{10%,90%{transform:translate3d(-1px,0,0)}20%,80%{transform:translate3d(1px,0,0)}30%,50%,70%{transform:translate3d(-2px,0,0)}40%,60%{transform:translate3d(2px,0,0)}}:host{display:flex;flex-direction:column;align-items:center}div{position:relative;width:110px;height:110px;display:flex;justify-content:center;align-items:center;margin:40px 0 20px 0;transform:translate3d(0,0,0)}svg{position:absolute;width:110px;height:110px;fill:none;stroke:transparent;stroke-linecap:round;stroke-width:2px;top:0;left:0}use{stroke:var(--wcm-accent-color);animation:loading 1s linear infinite}wcm-wallet-image{border-radius:var(--wcm-wallet-icon-large-border-radius);width:90px;height:90px}wcm-text{margin-bottom:40px}.wcm-error svg{stroke:var(--wcm-error-color)}.wcm-error use{display:none}.wcm-error{animation:shake .4s cubic-bezier(.36,.07,.19,.97) both}.wcm-stale svg,.wcm-stale use{display:none}`;var uC=Object.defineProperty,hC=Object.getOwnPropertyDescriptor,qs=(r,e,t,n)=>{for(var i=n>1?void 0:n?hC(e,t):e,a=r.length-1,c;a>=0;a--)(c=r[a])&&(i=(n?c(e,t,i):c(i))||i);return n&&i&&uC(e,t,i),i};let yi=class extends Ye{constructor(){super(...arguments),this.walletId=void 0,this.imageId=void 0,this.isError=!1,this.isStale=!1,this.label=""}svgLoaderTemplate(){var r,e;const t=(e=(r=ui.state.themeVariables)==null?void 0:r["--wcm-wallet-icon-large-border-radius"])!=null?e:rt.getPreset("--wcm-wallet-icon-large-border-radius");let n=0;t.includes("%")?n=88/100*parseInt(t,10):n=parseInt(t,10),n*=1.17;const i=317-n*1.57,a=425-n*1.8;return he`<svg viewBox="0 0 110 110" width="110" height="110"><rect id="wcm-loader" x="2" y="2" width="106" height="106" rx="${n}"/><use xlink:href="#wcm-loader" stroke-dasharray="106 ${i}" stroke-dashoffset="${a}"></use></svg>`}render(){const r={"wcm-error":this.isError,"wcm-stale":this.isStale};return he`<div class="${qn(r)}">${this.svgLoaderTemplate()}<wcm-wallet-image walletId="${Dr(this.walletId)}" imageId="${Dr(this.imageId)}"></wcm-wallet-image></div><wcm-text variant="medium-regular" color="${this.isError?"error":"primary"}">${this.isError?"Connection declined":this.label}</wcm-text>`}};yi.styles=[rt.globalCss,lC],qs([Be()],yi.prototype,"walletId",2),qs([Be()],yi.prototype,"imageId",2),qs([Be({type:Boolean})],yi.prototype,"isError",2),qs([Be({type:Boolean})],yi.prototype,"isStale",2),qs([Be()],yi.prototype,"label",2),yi=qs([ot("wcm-connector-waiting")],yi);const zs={manualWallets(){var r,e;const{mobileWallets:t,desktopWallets:n}=Kr.state,i=(r=zs.recentWallet())==null?void 0:r.id,a=we.isMobile()?t:n,c=a?.filter(u=>i!==u.id);return(e=we.isMobile()?c?.map(({id:u,name:f,links:h})=>({id:u,name:f,mobile:h,links:h})):c?.map(({id:u,name:f,links:h})=>({id:u,name:f,desktop:h,links:h})))!=null?e:[]},recentWallet(){return Pe.getRecentWallet()},recomendedWallets(r=!1){var e;const t=r||(e=zs.recentWallet())==null?void 0:e.id,{recomendedWallets:n}=Lr.state;return n.filter(i=>t!==i.id)}},wi={onConnecting(r){Pe.goToConnectingView(r)},manualWalletsTemplate(){return zs.manualWallets().map(r=>he`<wcm-wallet-button walletId="${r.id}" name="${r.name}" .onClick="${()=>this.onConnecting(r)}"></wcm-wallet-button>`)},recomendedWalletsTemplate(r=!1){return zs.recomendedWallets(r).map(e=>he`<wcm-wallet-button name="${e.name}" walletId="${e.id}" imageId="${e.image_id}" .onClick="${()=>this.onConnecting(e)}"></wcm-wallet-button>`)},recentWalletTemplate(){const r=zs.recentWallet();if(r)return he`<wcm-wallet-button name="${r.name}" walletId="${r.id}" imageId="${Dr(r.image_id)}" .recent="${!0}" .onClick="${()=>this.onConnecting(r)}"></wcm-wallet-button>`}},fC=lt`.wcm-grid{display:grid;grid-template-columns:repeat(4,80px);justify-content:space-between}.wcm-desktop-title,.wcm-mobile-title{display:flex;align-items:center}.wcm-mobile-title{justify-content:space-between;margin-bottom:20px;margin-top:-10px}.wcm-desktop-title{margin-bottom:10px;padding:0 10px}.wcm-subtitle{display:flex;align-items:center}.wcm-subtitle:last-child path{fill:var(--wcm-color-fg-3)}.wcm-desktop-title svg,.wcm-mobile-title svg{margin-right:6px}.wcm-desktop-title path,.wcm-mobile-title path{fill:var(--wcm-accent-color)}`;var dC=Object.defineProperty,pC=Object.getOwnPropertyDescriptor,gC=(r,e,t,n)=>{for(var i=n>1?void 0:n?pC(e,t):e,a=r.length-1,c;a>=0;a--)(c=r[a])&&(i=(n?c(e,t,i):c(i))||i);return n&&i&&dC(e,t,i),i};let Qh=class extends Ye{render(){const{explorerExcludedWalletIds:r,enableExplorer:e}=Kr.state,t=r!=="ALL"&&e,n=wi.manualWalletsTemplate(),i=wi.recomendedWalletsTemplate();let a=[wi.recentWalletTemplate(),...n,...i];a=a.filter(Boolean);const c=a.length>4||t;let u=[];c?u=a.slice(0,3):u=a;const f=!!u.length;return he`<wcm-modal-header .border="${!0}" title="Connect your wallet" .onAction="${Pe.handleUriCopy}" .actionIcon="${ht.COPY_ICON}"></wcm-modal-header><wcm-modal-content><div class="wcm-mobile-title"><div class="wcm-subtitle">${ht.MOBILE_ICON}<wcm-text variant="small-regular" color="accent">Mobile</wcm-text></div><div class="wcm-subtitle">${ht.SCAN_ICON}<wcm-text variant="small-regular" color="secondary">Scan with your wallet</wcm-text></div></div><wcm-walletconnect-qr></wcm-walletconnect-qr></wcm-modal-content>${f?he`<wcm-modal-footer><div class="wcm-desktop-title">${ht.DESKTOP_ICON}<wcm-text variant="small-regular" color="accent">Desktop</wcm-text></div><div class="wcm-grid">${u} ${c?he`<wcm-view-all-wallets-button></wcm-view-all-wallets-button>`:null}</div></wcm-modal-footer>`:null}`}};Qh.styles=[rt.globalCss,fC],Qh=gC([ot("wcm-desktop-wallet-selection")],Qh);const mC=lt`div{background-color:var(--wcm-color-bg-2);padding:10px 20px 15px 20px;border-top:1px solid var(--wcm-color-bg-3);text-align:center}a{color:var(--wcm-accent-color);text-decoration:none;transition:opacity .2s ease-in-out;display:inline}a:active{opacity:.8}@media(hover:hover){a:hover{opacity:.8}}`;var vC=Object.defineProperty,yC=Object.getOwnPropertyDescriptor,wC=(r,e,t,n)=>{for(var i=n>1?void 0:n?yC(e,t):e,a=r.length-1,c;a>=0;a--)(c=r[a])&&(i=(n?c(e,t,i):c(i))||i);return n&&i&&vC(e,t,i),i};let Xh=class extends Ye{render(){const{termsOfServiceUrl:r,privacyPolicyUrl:e}=Kr.state;return r??e?he`<div><wcm-text variant="small-regular" color="secondary">By connecting your wallet to this app, you agree to the app's ${r?he`<a href="${r}" target="_blank" rel="noopener noreferrer">Terms of Service</a>`:null} ${r&&e?"and":null} ${e?he`<a href="${e}" target="_blank" rel="noopener noreferrer">Privacy Policy</a>`:null}</wcm-text></div>`:null}};Xh.styles=[rt.globalCss,mC],Xh=wC([ot("wcm-legal-notice")],Xh);const bC=lt`div{display:grid;grid-template-columns:repeat(4,80px);margin:0 -10px;justify-content:space-between;row-gap:10px}`;var _C=Object.defineProperty,EC=Object.getOwnPropertyDescriptor,xC=(r,e,t,n)=>{for(var i=n>1?void 0:n?EC(e,t):e,a=r.length-1,c;a>=0;a--)(c=r[a])&&(i=(n?c(e,t,i):c(i))||i);return n&&i&&_C(e,t,i),i};let ef=class extends Ye{onQrcode(){Pt.push("Qrcode")}render(){const{explorerExcludedWalletIds:r,enableExplorer:e}=Kr.state,t=r!=="ALL"&&e,n=wi.manualWalletsTemplate(),i=wi.recomendedWalletsTemplate();let a=[wi.recentWalletTemplate(),...n,...i];a=a.filter(Boolean);const c=a.length>8||t;let u=[];c?u=a.slice(0,7):u=a;const f=!!u.length;return he`<wcm-modal-header title="Connect your wallet" .onAction="${this.onQrcode}" .actionIcon="${ht.QRCODE_ICON}"></wcm-modal-header>${f?he`<wcm-modal-content><div>${u} ${c?he`<wcm-view-all-wallets-button></wcm-view-all-wallets-button>`:null}</div></wcm-modal-content>`:null}`}};ef.styles=[rt.globalCss,bC],ef=xC([ot("wcm-mobile-wallet-selection")],ef);const IC=lt`:host{all:initial}.wcm-overlay{top:0;bottom:0;left:0;right:0;position:fixed;z-index:var(--wcm-z-index);overflow:hidden;display:flex;justify-content:center;align-items:center;opacity:0;pointer-events:none;background-color:var(--wcm-overlay-background-color);backdrop-filter:var(--wcm-overlay-backdrop-filter)}@media(max-height:720px) and (orientation:landscape){.wcm-overlay{overflow:scroll;align-items:flex-start;padding:20px 0}}.wcm-active{pointer-events:auto}.wcm-container{position:relative;max-width:360px;width:100%;outline:0;border-radius:var(--wcm-background-border-radius) var(--wcm-background-border-radius) var(--wcm-container-border-radius) var(--wcm-container-border-radius);border:1px solid var(--wcm-color-overlay);overflow:hidden}.wcm-card{width:100%;position:relative;border-radius:var(--wcm-container-border-radius);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(--wcm-color-overlay);background-color:var(--wcm-color-bg-1);color:var(--wcm-color-fg-1)}@media(max-width:600px){.wcm-container{max-width:440px;border-radius:var(--wcm-background-border-radius) var(--wcm-background-border-radius) 0 0}.wcm-card{border-radius:var(--wcm-container-border-radius) var(--wcm-container-border-radius) 0 0}.wcm-overlay{align-items:flex-end}}@media(max-width:440px){.wcm-container{border:0}}`;var DC=Object.defineProperty,SC=Object.getOwnPropertyDescriptor,tf=(r,e,t,n)=>{for(var i=n>1?void 0:n?SC(e,t):e,a=r.length-1,c;a>=0;a--)(c=r[a])&&(i=(n?c(e,t,i):c(i))||i);return n&&i&&DC(e,t,i),i};let Hs=class extends Ye{constructor(){super(),this.open=!1,this.active=!1,this.unsubscribeModal=void 0,this.abortController=void 0,this.unsubscribeModal=Wi.subscribe(r=>{r.open?this.onOpenModalEvent():this.onCloseModalEvent()})}disconnectedCallback(){var r;(r=this.unsubscribeModal)==null||r.call(this)}get overlayEl(){return Pe.getShadowRootElement(this,".wcm-overlay")}get containerEl(){return Pe.getShadowRootElement(this,".wcm-container")}toggleBodyScroll(r){document.querySelector("body")&&(r?document.getElementById("wcm-styles")?.remove():document.head.insertAdjacentHTML("beforeend",'<style id="wcm-styles">html,body{touch-action:none;overflow:hidden;overscroll-behavior:contain;}</style>'))}onCloseModal(r){r.target===r.currentTarget&&Wi.close()}onOpenModalEvent(){this.toggleBodyScroll(!1),this.addKeyboardEvents(),this.open=!0,setTimeout(async()=>{const r=Pe.isMobileAnimation()?{y:["50vh","0vh"]}:{scale:[.98,1]},e=.1,t=.2;await Promise.all([Qi(this.overlayEl,{opacity:[0,1]},{delay:e,duration:t}).finished,Qi(this.containerEl,r,{delay:e,duration:t}).finished]),this.active=!0},0)}async onCloseModalEvent(){this.toggleBodyScroll(!0),this.removeKeyboardEvents();const r=Pe.isMobileAnimation()?{y:["0vh","50vh"]}:{scale:[1,.98]},e=.2;await Promise.all([Qi(this.overlayEl,{opacity:[1,0]},{duration:e}).finished,Qi(this.containerEl,r,{duration:e}).finished]),this.containerEl.removeAttribute("style"),this.active=!1,this.open=!1}addKeyboardEvents(){this.abortController=new AbortController,window.addEventListener("keydown",r=>{var e;r.key==="Escape"?Wi.close():r.key==="Tab"&&((e=r.target)!=null&&e.tagName.includes("wcm-")||this.containerEl.focus())},this.abortController),this.containerEl.focus()}removeKeyboardEvents(){var r;(r=this.abortController)==null||r.abort(),this.abortController=void 0}render(){const r={"wcm-overlay":!0,"wcm-active":this.active};return he`<wcm-explorer-context></wcm-explorer-context><wcm-theme-context></wcm-theme-context><div id="wcm-modal" class="${qn(r)}" @click="${this.onCloseModal}" role="alertdialog" aria-modal="true"><div class="wcm-container" tabindex="0">${this.open?he`<wcm-modal-backcard></wcm-modal-backcard><div class="wcm-card"><wcm-modal-router></wcm-modal-router><wcm-modal-toast></wcm-modal-toast></div>`:null}</div></div>`}};Hs.styles=[rt.globalCss,IC],tf([Mr()],Hs.prototype,"open",2),tf([Mr()],Hs.prototype,"active",2),Hs=tf([ot("wcm-modal")],Hs);const CC=lt`div{display:flex;margin-top:15px}slot{display:inline-block;margin:0 5px}wcm-button{margin:0 5px}`;var OC=Object.defineProperty,$C=Object.getOwnPropertyDescriptor,ta=(r,e,t,n)=>{for(var i=n>1?void 0:n?$C(e,t):e,a=r.length-1,c;a>=0;a--)(c=r[a])&&(i=(n?c(e,t,i):c(i))||i);return n&&i&&OC(e,t,i),i};let es=class extends Ye{constructor(){super(...arguments),this.isMobile=!1,this.isDesktop=!1,this.isWeb=!1,this.isRetry=!1}onMobile(){we.isMobile()?Pt.replace("MobileConnecting"):Pt.replace("MobileQrcodeConnecting")}onDesktop(){Pt.replace("DesktopConnecting")}onWeb(){Pt.replace("WebConnecting")}render(){return he`<div>${this.isRetry?he`<slot></slot>`:null} ${this.isMobile?he`<wcm-button .onClick="${this.onMobile}" .iconLeft="${ht.MOBILE_ICON}" variant="outline">Mobile</wcm-button>`:null} ${this.isDesktop?he`<wcm-button .onClick="${this.onDesktop}" .iconLeft="${ht.DESKTOP_ICON}" variant="outline">Desktop</wcm-button>`:null} ${this.isWeb?he`<wcm-button .onClick="${this.onWeb}" .iconLeft="${ht.GLOBE_ICON}" variant="outline">Web</wcm-button>`:null}</div>`}};es.styles=[rt.globalCss,CC],ta([Be({type:Boolean})],es.prototype,"isMobile",2),ta([Be({type:Boolean})],es.prototype,"isDesktop",2),ta([Be({type:Boolean})],es.prototype,"isWeb",2),ta([Be({type:Boolean})],es.prototype,"isRetry",2),es=ta([ot("wcm-platform-selection")],es);const AC=lt`button{display:flex;flex-direction:column;padding:5px 10px;border-radius:var(--wcm-button-hover-highlight-border-radius);height:100%;justify-content:flex-start}.wcm-icons{width:60px;height:60px;display:flex;flex-wrap:wrap;padding:7px;border-radius:var(--wcm-wallet-icon-border-radius);justify-content:space-between;align-items:center;margin-bottom:5px;background-color:var(--wcm-color-bg-2);box-shadow:inset 0 0 0 1px var(--wcm-color-overlay)}button:active{background-color:var(--wcm-color-overlay)}@media(hover:hover){button:hover{background-color:var(--wcm-color-overlay)}}.wcm-icons img{width:21px;height:21px;object-fit:cover;object-position:center;border-radius:calc(var(--wcm-wallet-icon-border-radius)/ 2);border:1px solid var(--wcm-color-overlay)}.wcm-icons svg{width:21px;height:21px}.wcm-icons img:nth-child(1),.wcm-icons img:nth-child(2),.wcm-icons svg:nth-child(1),.wcm-icons svg:nth-child(2){margin-bottom:4px}wcm-text{width:100%;text-align:center}#wallet-placeholder-fill{fill:var(--wcm-color-bg-3)}#wallet-placeholder-dash{stroke:var(--wcm-color-overlay)}`;var PC=Object.defineProperty,TC=Object.getOwnPropertyDescriptor,RC=(r,e,t,n)=>{for(var i=n>1?void 0:n?TC(e,t):e,a=r.length-1,c;a>=0;a--)(c=r[a])&&(i=(n?c(e,t,i):c(i))||i);return n&&i&&PC(e,t,i),i};let rf=class extends Ye{onClick(){Pt.push("WalletExplorer")}render(){const{recomendedWallets:r}=Lr.state,e=zs.manualWallets(),t=[...r,...e].reverse().slice(0,4);return he`<button @click="${this.onClick}"><div class="wcm-icons">${t.map(n=>{const i=Pe.getWalletIcon(n);if(i)return he`<img crossorigin="anonymous" src="${i}">`;const a=Pe.getWalletIcon({id:n.id});return a?he`<img crossorigin="anonymous" src="${a}">`:ht.WALLET_PLACEHOLDER})} ${[...Array(4-t.length)].map(()=>ht.WALLET_PLACEHOLDER)}</div><wcm-text variant="xsmall-regular">View All</wcm-text></button>`}};rf.styles=[rt.globalCss,AC],rf=RC([ot("wcm-view-all-wallets-button")],rf);const NC=lt`.wcm-qr-container{width:100%;display:flex;justify-content:center;align-items:center;aspect-ratio:1/1}`;var LC=Object.defineProperty,MC=Object.getOwnPropertyDescriptor,xc=(r,e,t,n)=>{for(var i=n>1?void 0:n?MC(e,t):e,a=r.length-1,c;a>=0;a--)(c=r[a])&&(i=(n?c(e,t,i):c(i))||i);return n&&i&&LC(e,t,i),i};let Ws=class extends Ye{constructor(){super(),this.walletId="",this.imageId="",this.uri="",setTimeout(()=>{const{walletConnectUri:r}=zt.state;this.uri=r},0)}get overlayEl(){return Pe.getShadowRootElement(this,".wcm-qr-container")}render(){return he`<div class="wcm-qr-container">${this.uri?he`<wcm-qrcode size="${this.overlayEl.offsetWidth}" uri="${this.uri}" walletId="${Dr(this.walletId)}" imageId="${Dr(this.imageId)}"></wcm-qrcode>`:he`<wcm-spinner></wcm-spinner>`}</div>`}};Ws.styles=[rt.globalCss,NC],xc([Be()],Ws.prototype,"walletId",2),xc([Be()],Ws.prototype,"imageId",2),xc([Mr()],Ws.prototype,"uri",2),Ws=xc([ot("wcm-walletconnect-qr")],Ws);var UC=Object.defineProperty,jC=Object.getOwnPropertyDescriptor,FC=(r,e,t,n)=>{for(var i=n>1?void 0:n?jC(e,t):e,a=r.length-1,c;a>=0;a--)(c=r[a])&&(i=(n?c(e,t,i):c(i))||i);return n&&i&&UC(e,t,i),i};let nf=class extends Ye{viewTemplate(){return we.isAndroid()?he`<wcm-android-wallet-selection></wcm-android-wallet-selection>`:we.isMobile()?he`<wcm-mobile-wallet-selection></wcm-mobile-wallet-selection>`:he`<wcm-desktop-wallet-selection></wcm-desktop-wallet-selection>`}render(){return he`${this.viewTemplate()}<wcm-legal-notice></wcm-legal-notice>`}};nf.styles=[rt.globalCss],nf=FC([ot("wcm-connect-wallet-view")],nf);const BC=lt`wcm-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}wcm-text{text-align:center}`;var kC=Object.defineProperty,qC=Object.getOwnPropertyDescriptor,Sm=(r,e,t,n)=>{for(var i=n>1?void 0:n?qC(e,t):e,a=r.length-1,c;a>=0;a--)(c=r[a])&&(i=(n?c(e,t,i):c(i))||i);return n&&i&&kC(e,t,i),i};let Ic=class extends Ye{constructor(){super(),this.isError=!1,this.openDesktopApp()}onFormatAndRedirect(r){const{desktop:e,name:t}=we.getWalletRouterData(),n=e?.native;if(n){const i=we.formatNativeUrl(n,r,t);we.openHref(i,"_self")}}openDesktopApp(){const{walletConnectUri:r}=zt.state,e=we.getWalletRouterData();Pe.setRecentWallet(e),r&&this.onFormatAndRedirect(r)}render(){const{name:r,id:e,image_id:t}=we.getWalletRouterData(),{isMobile:n,isWeb:i}=Pe.getCachedRouterWalletPlatforms();return he`<wcm-modal-header title="${r}" .onAction="${Pe.handleUriCopy}" .actionIcon="${ht.COPY_ICON}"></wcm-modal-header><wcm-modal-content><wcm-connector-waiting walletId="${e}" imageId="${Dr(t)}" label="${`Continue in ${r}...`}" .isError="${this.isError}"></wcm-connector-waiting></wcm-modal-content><wcm-info-footer><wcm-text color="secondary" variant="small-thin">${`Connection can continue loading if ${r} is not installed on your device`}</wcm-text><wcm-platform-selection .isMobile="${n}" .isWeb="${i}" .isRetry="${!0}"><wcm-button .onClick="${this.openDesktopApp.bind(this)}" .iconRight="${ht.RETRY_ICON}">Retry</wcm-button></wcm-platform-selection></wcm-info-footer>`}};Ic.styles=[rt.globalCss,BC],Sm([Mr()],Ic.prototype,"isError",2),Ic=Sm([ot("wcm-desktop-connecting-view")],Ic);const zC=lt`wcm-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}wcm-text{text-align:center}wcm-button{margin-top:15px}`;var HC=Object.defineProperty,WC=Object.getOwnPropertyDescriptor,KC=(r,e,t,n)=>{for(var i=n>1?void 0:n?WC(e,t):e,a=r.length-1,c;a>=0;a--)(c=r[a])&&(i=(n?c(e,t,i):c(i))||i);return n&&i&&HC(e,t,i),i};let sf=class extends Ye{onInstall(r){r&&we.openHref(r,"_blank")}render(){const{name:r,id:e,image_id:t,homepage:n}=we.getWalletRouterData();return he`<wcm-modal-header title="${r}"></wcm-modal-header><wcm-modal-content><wcm-connector-waiting walletId="${e}" imageId="${Dr(t)}" label="Not Detected" .isStale="${!0}"></wcm-connector-waiting></wcm-modal-content><wcm-info-footer><wcm-text color="secondary" variant="small-thin">${`Download ${r} to continue. If multiple browser extensions are installed, disable non ${r} ones and try again`}</wcm-text><wcm-button .onClick="${()=>this.onInstall(n)}" .iconLeft="${ht.ARROW_DOWN_ICON}">Download</wcm-button></wcm-info-footer>`}};sf.styles=[rt.globalCss,zC],sf=KC([ot("wcm-install-wallet-view")],sf);const VC=lt`wcm-wallet-image{border-radius:var(--wcm-wallet-icon-large-border-radius);width:96px;height:96px;margin-bottom:20px}wcm-info-footer{display:flex;width:100%}.wcm-app-store{justify-content:space-between}.wcm-app-store wcm-wallet-image{margin-right:10px;margin-bottom:0;width:28px;height:28px;border-radius:var(--wcm-wallet-icon-small-border-radius)}.wcm-app-store div{display:flex;align-items:center}.wcm-app-store wcm-button{margin-right:-10px}.wcm-note{flex-direction:column;align-items:center;padding:5px 0}.wcm-note wcm-text{text-align:center}wcm-platform-selection{margin-top:-15px}.wcm-note wcm-text{margin-top:15px}.wcm-note wcm-text span{color:var(--wcm-accent-color)}`;var GC=Object.defineProperty,YC=Object.getOwnPropertyDescriptor,Cm=(r,e,t,n)=>{for(var i=n>1?void 0:n?YC(e,t):e,a=r.length-1,c;a>=0;a--)(c=r[a])&&(i=(n?c(e,t,i):c(i))||i);return n&&i&&GC(e,t,i),i};let Dc=class extends Ye{constructor(){super(),this.isError=!1,this.openMobileApp()}onFormatAndRedirect(r,e=!1){const{mobile:t,name:n}=we.getWalletRouterData(),i=t?.native,a=t?.universal;if(i&&!e){const c=we.formatNativeUrl(i,r,n);we.openHref(c,"_self")}else if(a){const c=we.formatUniversalUrl(a,r,n);we.openHref(c,"_self")}}openMobileApp(r=!1){const{walletConnectUri:e}=zt.state,t=we.getWalletRouterData();Pe.setRecentWallet(t),e&&this.onFormatAndRedirect(e,r)}onGoToAppStore(r){r&&we.openHref(r,"_blank")}render(){const{name:r,id:e,image_id:t,app:n,mobile:i}=we.getWalletRouterData(),{isWeb:a}=Pe.getCachedRouterWalletPlatforms(),c=n?.ios,u=i?.universal;return he`<wcm-modal-header title="${r}"></wcm-modal-header><wcm-modal-content><wcm-connector-waiting walletId="${e}" imageId="${Dr(t)}" label="Tap 'Open' to continue…" .isError="${this.isError}"></wcm-connector-waiting></wcm-modal-content><wcm-info-footer class="wcm-note"><wcm-platform-selection .isWeb="${a}" .isRetry="${!0}"><wcm-button .onClick="${()=>this.openMobileApp(!1)}" .iconRight="${ht.RETRY_ICON}">Retry</wcm-button></wcm-platform-selection>${u?he`<wcm-text color="secondary" variant="small-thin">Still doesn't work? <span tabindex="0" @click="${()=>this.openMobileApp(!0)}">Try this alternate link</span></wcm-text>`:null}</wcm-info-footer><wcm-info-footer class="wcm-app-store"><div><wcm-wallet-image walletId="${e}" imageId="${Dr(t)}"></wcm-wallet-image><wcm-text>${`Get ${r}`}</wcm-text></div><wcm-button .iconRight="${ht.ARROW_RIGHT_ICON}" .onClick="${()=>this.onGoToAppStore(c)}" variant="ghost">App Store</wcm-button></wcm-info-footer>`}};Dc.styles=[rt.globalCss,VC],Cm([Mr()],Dc.prototype,"isError",2),Dc=Cm([ot("wcm-mobile-connecting-view")],Dc);const JC=lt`wcm-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}wcm-text{text-align:center}`;var ZC=Object.defineProperty,QC=Object.getOwnPropertyDescriptor,XC=(r,e,t,n)=>{for(var i=n>1?void 0:n?QC(e,t):e,a=r.length-1,c;a>=0;a--)(c=r[a])&&(i=(n?c(e,t,i):c(i))||i);return n&&i&&ZC(e,t,i),i};let of=class extends Ye{render(){const{name:r,id:e,image_id:t}=we.getWalletRouterData(),{isDesktop:n,isWeb:i}=Pe.getCachedRouterWalletPlatforms();return he`<wcm-modal-header title="${r}" .onAction="${Pe.handleUriCopy}" .actionIcon="${ht.COPY_ICON}"></wcm-modal-header><wcm-modal-content><wcm-walletconnect-qr walletId="${e}" imageId="${Dr(t)}"></wcm-walletconnect-qr></wcm-modal-content><wcm-info-footer><wcm-text color="secondary" variant="small-thin">${`Scan this QR Code with your phone's camera or inside ${r} app`}</wcm-text><wcm-platform-selection .isDesktop="${n}" .isWeb="${i}"></wcm-platform-selection></wcm-info-footer>`}};of.styles=[rt.globalCss,JC],of=XC([ot("wcm-mobile-qr-connecting-view")],of);var eO=Object.defineProperty,tO=Object.getOwnPropertyDescriptor,rO=(r,e,t,n)=>{for(var i=n>1?void 0:n?tO(e,t):e,a=r.length-1,c;a>=0;a--)(c=r[a])&&(i=(n?c(e,t,i):c(i))||i);return n&&i&&eO(e,t,i),i};let af=class extends Ye{render(){return he`<wcm-modal-header title="Scan the code" .onAction="${Pe.handleUriCopy}" .actionIcon="${ht.COPY_ICON}"></wcm-modal-header><wcm-modal-content><wcm-walletconnect-qr></wcm-walletconnect-qr></wcm-modal-content>`}};af.styles=[rt.globalCss],af=rO([ot("wcm-qrcode-view")],af);const nO=lt`wcm-modal-content{height:clamp(200px,60vh,600px);display:block;overflow:scroll;scrollbar-width:none;position:relative;margin-top:1px}.wcm-grid{display:grid;grid-template-columns:repeat(4,80px);justify-content:space-between;margin:-15px -10px;padding-top:20px}wcm-modal-content::after,wcm-modal-content::before{content:'';position:fixed;pointer-events:none;z-index:1;width:100%;height:20px;opacity:1}wcm-modal-content::before{box-shadow:0 -1px 0 0 var(--wcm-color-bg-1);background:linear-gradient(var(--wcm-color-bg-1),rgba(255,255,255,0))}wcm-modal-content::after{box-shadow:0 1px 0 0 var(--wcm-color-bg-1);background:linear-gradient(rgba(255,255,255,0),var(--wcm-color-bg-1));top:calc(100% - 20px)}wcm-modal-content::-webkit-scrollbar{display:none}.wcm-placeholder-block{display:flex;justify-content:center;align-items:center;height:100px;overflow:hidden}.wcm-empty,.wcm-loading{display:flex}.wcm-loading .wcm-placeholder-block{height:100%}.wcm-end-reached .wcm-placeholder-block{height:0;opacity:0}.wcm-empty .wcm-placeholder-block{opacity:1;height:100%}wcm-wallet-button{margin:calc((100% - 60px)/ 3) 0}`;var iO=Object.defineProperty,sO=Object.getOwnPropertyDescriptor,ra=(r,e,t,n)=>{for(var i=n>1?void 0:n?sO(e,t):e,a=r.length-1,c;a>=0;a--)(c=r[a])&&(i=(n?c(e,t,i):c(i))||i);return n&&i&&iO(e,t,i),i};const cf=40;let ts=class extends Ye{constructor(){super(...arguments),this.loading=!Lr.state.wallets.listings.length,this.firstFetch=!Lr.state.wallets.listings.length,this.search="",this.endReached=!1,this.intersectionObserver=void 0,this.searchDebounce=Pe.debounce(r=>{r.length>=1?(this.firstFetch=!0,this.endReached=!1,this.search=r,Lr.resetSearch(),this.fetchWallets()):this.search&&(this.search="",this.endReached=this.isLastPage(),Lr.resetSearch())})}firstUpdated(){this.createPaginationObserver()}disconnectedCallback(){var r;(r=this.intersectionObserver)==null||r.disconnect()}get placeholderEl(){return Pe.getShadowRootElement(this,".wcm-placeholder-block")}createPaginationObserver(){this.intersectionObserver=new IntersectionObserver(([r])=>{r.isIntersecting&&!(this.search&&this.firstFetch)&&this.fetchWallets()}),this.intersectionObserver.observe(this.placeholderEl)}isLastPage(){const{wallets:r,search:e}=Lr.state,{listings:t,total:n}=this.search?e:r;return n<=cf||t.length>=n}async fetchWallets(){var r;const{wallets:e,search:t}=Lr.state,{listings:n,total:i,page:a}=this.search?t:e;if(!this.endReached&&(this.firstFetch||i>cf&&n.length<i))try{this.loading=!0;const c=(r=zt.state.chains)==null?void 0:r.join(","),{listings:u}=await Lr.getWallets({page:this.firstFetch?1:a+1,entries:cf,search:this.search,version:2,chains:c}),f=u.map(h=>Pe.getWalletIcon(h));await Promise.all([...f.map(async h=>Pe.preloadImage(h)),we.wait(300)]),this.endReached=this.isLastPage()}catch(c){console.error(c),hi.openToast(Pe.getErrorMessage(c),"error")}finally{this.loading=!1,this.firstFetch=!1}}onConnect(r){we.isAndroid()?Pe.handleMobileLinking(r):Pe.goToConnectingView(r)}onSearchChange(r){const{value:e}=r.target;this.searchDebounce(e)}render(){const{wallets:r,search:e}=Lr.state,{listings:t}=this.search?e:r,n=this.loading&&!t.length,i=this.search.length>=3;let a=wi.manualWalletsTemplate(),c=wi.recomendedWalletsTemplate(!0);i&&(a=a.filter(({values:h})=>Pe.caseSafeIncludes(h[0],this.search)),c=c.filter(({values:h})=>Pe.caseSafeIncludes(h[0],this.search)));const u=!this.loading&&!t.length&&!c.length,f={"wcm-loading":n,"wcm-end-reached":this.endReached||!this.loading,"wcm-empty":u};return he`<wcm-modal-header><wcm-search-input .onChange="${this.onSearchChange.bind(this)}"></wcm-search-input></wcm-modal-header><wcm-modal-content class="${qn(f)}"><div class="wcm-grid">${n?null:a} ${n?null:c} ${n?null:t.map(h=>he`${h?he`<wcm-wallet-button imageId="${h.image_id}" name="${h.name}" walletId="${h.id}" .onClick="${()=>this.onConnect(h)}"></wcm-wallet-button>`:null}`)}</div><div class="wcm-placeholder-block">${u?he`<wcm-text variant="big-bold" color="secondary">No results found</wcm-text>`:null} ${!u&&this.loading?he`<wcm-spinner></wcm-spinner>`:null}</div></wcm-modal-content>`}};ts.styles=[rt.globalCss,nO],ra([Mr()],ts.prototype,"loading",2),ra([Mr()],ts.prototype,"firstFetch",2),ra([Mr()],ts.prototype,"search",2),ra([Mr()],ts.prototype,"endReached",2),ts=ra([ot("wcm-wallet-explorer-view")],ts);const oO=lt`wcm-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}wcm-text{text-align:center}`;var aO=Object.defineProperty,cO=Object.getOwnPropertyDescriptor,Om=(r,e,t,n)=>{for(var i=n>1?void 0:n?cO(e,t):e,a=r.length-1,c;a>=0;a--)(c=r[a])&&(i=(n?c(e,t,i):c(i))||i);return n&&i&&aO(e,t,i),i};let Sc=class extends Ye{constructor(){super(),this.isError=!1,this.openWebWallet()}onFormatAndRedirect(r){const{desktop:e,name:t}=we.getWalletRouterData(),n=e?.universal;if(n){const i=we.formatUniversalUrl(n,r,t);we.openHref(i,"_blank")}}openWebWallet(){const{walletConnectUri:r}=zt.state,e=we.getWalletRouterData();Pe.setRecentWallet(e),r&&this.onFormatAndRedirect(r)}render(){const{name:r,id:e,image_id:t}=we.getWalletRouterData(),{isMobile:n,isDesktop:i}=Pe.getCachedRouterWalletPlatforms(),a=we.isMobile();return he`<wcm-modal-header title="${r}" .onAction="${Pe.handleUriCopy}" .actionIcon="${ht.COPY_ICON}"></wcm-modal-header><wcm-modal-content><wcm-connector-waiting walletId="${e}" imageId="${Dr(t)}" label="${`Continue in ${r}...`}" .isError="${this.isError}"></wcm-connector-waiting></wcm-modal-content><wcm-info-footer><wcm-text color="secondary" variant="small-thin">${`${r} web app has opened in a new tab. Go there, accept the connection, and come back`}</wcm-text><wcm-platform-selection .isMobile="${n}" .isDesktop="${a?!1:i}" .isRetry="${!0}"><wcm-button .onClick="${this.openWebWallet.bind(this)}" .iconRight="${ht.RETRY_ICON}">Retry</wcm-button></wcm-platform-selection></wcm-info-footer>`}};Sc.styles=[rt.globalCss,oO],Om([Mr()],Sc.prototype,"isError",2),Sc=Om([ot("wcm-web-connecting-view")],Sc);var lO=Object.freeze({__proto__:null,get WcmModal(){return Hs},get WcmQrCode(){return Hn}});fn.EthereumProvider=Rx,fn.OPTIONAL_EVENTS=eg,fn.OPTIONAL_METHODS=X1,fn.REQUIRED_EVENTS=Qa,fn.REQUIRED_METHODS=Za,fn.default=ec,Object.defineProperty(fn,"__esModule",{value:!0})});
139
139
  //# sourceMappingURL=index.umd.js.map