@walletconnect/ethereum-provider 2.9.0-e9ace057 → 2.9.1-5f93de27

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(_n,pr){typeof exports=="object"&&typeof module<"u"?pr(exports):typeof define=="function"&&define.amd?define(["exports"],pr):(_n=typeof globalThis<"u"?globalThis:_n||self,pr(_n["@walletconnect/ethereum-provider"]={}))})(this,function(_n){"use strict";var pr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function yw(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function Ui(t){var e=t.default;if(typeof e=="function"){var r=function(){return e.apply(this,arguments)};r.prototype=e.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(t).forEach(function(n){var i=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(r,n,i.get?i:{enumerable:!0,get:function(){return t[n]}})}),r}var br={exports:{}},Es=typeof Reflect=="object"?Reflect:null,hd=Es&&typeof Es.apply=="function"?Es.apply:function(e,r,n){return Function.prototype.apply.call(e,r,n)},Ma;Es&&typeof Es.ownKeys=="function"?Ma=Es.ownKeys:Object.getOwnPropertySymbols?Ma=function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Ma=function(e){return Object.getOwnPropertyNames(e)};function bw(t){console&&console.warn&&console.warn(t)}var fd=Number.isNaN||function(e){return e!==e};function _t(){_t.init.call(this)}br.exports=_t,br.exports.once=Cw,_t.EventEmitter=_t,_t.prototype._events=void 0,_t.prototype._eventsCount=0,_t.prototype._maxListeners=void 0;var dd=10;function Ua(t){if(typeof t!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}Object.defineProperty(_t,"defaultMaxListeners",{enumerable:!0,get:function(){return dd},set:function(t){if(typeof t!="number"||t<0||fd(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");dd=t}}),_t.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},_t.prototype.setMaxListeners=function(e){if(typeof e!="number"||e<0||fd(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 pd(t){return t._maxListeners===void 0?_t.defaultMaxListeners:t._maxListeners}_t.prototype.getMaxListeners=function(){return pd(this)},_t.prototype.emit=function(e){for(var r=[],n=1;n<arguments.length;n++)r.push(arguments[n]);var i=e==="error",o=this._events;if(o!==void 0)i=i&&o.error===void 0;else if(!i)return!1;if(i){var c;if(r.length>0&&(c=r[0]),c instanceof Error)throw c;var l=new Error("Unhandled error."+(c?" ("+c.message+")":""));throw l.context=c,l}var h=o[e];if(h===void 0)return!1;if(typeof h=="function")hd(h,this,r);else for(var f=h.length,v=yd(h,f),n=0;n<f;++n)hd(v[n],this,r);return!0};function gd(t,e,r,n){var i,o,c;if(Ua(r),o=t._events,o===void 0?(o=t._events=Object.create(null),t._eventsCount=0):(o.newListener!==void 0&&(t.emit("newListener",e,r.listener?r.listener:r),o=t._events),c=o[e]),c===void 0)c=o[e]=r,++t._eventsCount;else if(typeof c=="function"?c=o[e]=n?[r,c]:[c,r]:n?c.unshift(r):c.push(r),i=pd(t),i>0&&c.length>i&&!c.warned){c.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+c.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=t,l.type=e,l.count=c.length,bw(l)}return t}_t.prototype.addListener=function(e,r){return gd(this,e,r,!1)},_t.prototype.on=_t.prototype.addListener,_t.prototype.prependListener=function(e,r){return gd(this,e,r,!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 md(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},i=_w.bind(n);return i.listener=r,n.wrapFn=i,i}_t.prototype.once=function(e,r){return Ua(r),this.on(e,md(this,e,r)),this},_t.prototype.prependOnceListener=function(e,r){return Ua(r),this.prependListener(e,md(this,e,r)),this},_t.prototype.removeListener=function(e,r){var n,i,o,c,l;if(Ua(r),i=this._events,i===void 0)return this;if(n=i[e],n===void 0)return this;if(n===r||n.listener===r)--this._eventsCount===0?this._events=Object.create(null):(delete i[e],i.removeListener&&this.emit("removeListener",e,n.listener||r));else if(typeof n!="function"){for(o=-1,c=n.length-1;c>=0;c--)if(n[c]===r||n[c].listener===r){l=n[c].listener,o=c;break}if(o<0)return this;o===0?n.shift():Ew(n,o),n.length===1&&(i[e]=n[0]),i.removeListener!==void 0&&this.emit("removeListener",e,l||r)}return this},_t.prototype.off=_t.prototype.removeListener,_t.prototype.removeAllListeners=function(e){var r,n,i;if(n=this._events,n===void 0)return this;if(n.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):n[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete n[e]),this;if(arguments.length===0){var o=Object.keys(n),c;for(i=0;i<o.length;++i)c=o[i],c!=="removeListener"&&this.removeAllListeners(c);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(r=n[e],typeof r=="function")this.removeListener(e,r);else if(r!==void 0)for(i=r.length-1;i>=0;i--)this.removeListener(e,r[i]);return this};function wd(t,e,r){var n=t._events;if(n===void 0)return[];var i=n[e];return i===void 0?[]:typeof i=="function"?r?[i.listener||i]:[i]:r?xw(i):yd(i,i.length)}_t.prototype.listeners=function(e){return wd(this,e,!0)},_t.prototype.rawListeners=function(e){return wd(this,e,!1)},_t.listenerCount=function(t,e){return typeof t.listenerCount=="function"?t.listenerCount(e):vd.call(t,e)},_t.prototype.listenerCount=vd;function vd(t){var e=this._events;if(e!==void 0){var r=e[t];if(typeof r=="function")return 1;if(r!==void 0)return r.length}return 0}_t.prototype.eventNames=function(){return this._eventsCount>0?Ma(this._events):[]};function yd(t,e){for(var r=new Array(e),n=0;n<e;++n)r[n]=t[n];return r}function Ew(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}function xw(t){for(var e=new Array(t.length),r=0;r<e.length;++r)e[r]=t[r].listener||t[r];return e}function Cw(t,e){return new Promise(function(r,n){function i(c){t.removeListener(e,o),n(c)}function o(){typeof t.removeListener=="function"&&t.removeListener("error",i),r([].slice.call(arguments))}bd(t,e,o,{once:!0}),e!=="error"&&Iw(t,i,{once:!0})})}function Iw(t,e,r){typeof t.on=="function"&&bd(t,"error",e,r)}function bd(t,e,r,n){if(typeof t.on=="function")n.once?t.once(e,r):t.on(e,r);else if(typeof t.addEventListener=="function")t.addEventListener(e,function i(o){n.once&&t.removeEventListener(e,i),r(o)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof t)}var tu={},ja={},et={},_d={};(function(t){Object.defineProperty(t,"__esModule",{value:!0});function e(l,h){var f=l>>>16&65535,v=l&65535,E=h>>>16&65535,_=h&65535;return v*_+(f*_+v*E<<16>>>0)|0}t.mul=Math.imul||e;function r(l,h){return l+h|0}t.add=r;function n(l,h){return l-h|0}t.sub=n;function i(l,h){return l<<h|l>>>32-h}t.rotl=i;function o(l,h){return l<<32-h|l>>>h}t.rotr=o;function c(l){return typeof l=="number"&&isFinite(l)&&Math.floor(l)===l}t.isInteger=Number.isInteger||c,t.MAX_SAFE_INTEGER=9007199254740991,t.isSafeInteger=function(l){return t.isInteger(l)&&l>=-t.MAX_SAFE_INTEGER&&l<=t.MAX_SAFE_INTEGER}})(_d),Object.defineProperty(et,"__esModule",{value:!0});var Ed=_d;function Sw(t,e){return e===void 0&&(e=0),(t[e+0]<<8|t[e+1])<<16>>16}et.readInt16BE=Sw;function Aw(t,e){return e===void 0&&(e=0),(t[e+0]<<8|t[e+1])>>>0}et.readUint16BE=Aw;function Ow(t,e){return e===void 0&&(e=0),(t[e+1]<<8|t[e])<<16>>16}et.readInt16LE=Ow;function Dw(t,e){return e===void 0&&(e=0),(t[e+1]<<8|t[e])>>>0}et.readUint16LE=Dw;function xd(t,e,r){return e===void 0&&(e=new Uint8Array(2)),r===void 0&&(r=0),e[r+0]=t>>>8,e[r+1]=t>>>0,e}et.writeUint16BE=xd,et.writeInt16BE=xd;function Cd(t,e,r){return e===void 0&&(e=new Uint8Array(2)),r===void 0&&(r=0),e[r+0]=t>>>0,e[r+1]=t>>>8,e}et.writeUint16LE=Cd,et.writeInt16LE=Cd;function ru(t,e){return e===void 0&&(e=0),t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3]}et.readInt32BE=ru;function nu(t,e){return e===void 0&&(e=0),(t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3])>>>0}et.readUint32BE=nu;function iu(t,e){return e===void 0&&(e=0),t[e+3]<<24|t[e+2]<<16|t[e+1]<<8|t[e]}et.readInt32LE=iu;function su(t,e){return e===void 0&&(e=0),(t[e+3]<<24|t[e+2]<<16|t[e+1]<<8|t[e])>>>0}et.readUint32LE=su;function Fa(t,e,r){return e===void 0&&(e=new Uint8Array(4)),r===void 0&&(r=0),e[r+0]=t>>>24,e[r+1]=t>>>16,e[r+2]=t>>>8,e[r+3]=t>>>0,e}et.writeUint32BE=Fa,et.writeInt32BE=Fa;function Ba(t,e,r){return e===void 0&&(e=new Uint8Array(4)),r===void 0&&(r=0),e[r+0]=t>>>0,e[r+1]=t>>>8,e[r+2]=t>>>16,e[r+3]=t>>>24,e}et.writeUint32LE=Ba,et.writeInt32LE=Ba;function $w(t,e){e===void 0&&(e=0);var r=ru(t,e),n=ru(t,e+4);return r*4294967296+n-(n>>31)*4294967296}et.readInt64BE=$w;function Pw(t,e){e===void 0&&(e=0);var r=nu(t,e),n=nu(t,e+4);return r*4294967296+n}et.readUint64BE=Pw;function Tw(t,e){e===void 0&&(e=0);var r=iu(t,e),n=iu(t,e+4);return n*4294967296+r-(r>>31)*4294967296}et.readInt64LE=Tw;function Nw(t,e){e===void 0&&(e=0);var r=su(t,e),n=su(t,e+4);return n*4294967296+r}et.readUint64LE=Nw;function Id(t,e,r){return e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0),Fa(t/4294967296>>>0,e,r),Fa(t>>>0,e,r+4),e}et.writeUint64BE=Id,et.writeInt64BE=Id;function Sd(t,e,r){return e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0),Ba(t>>>0,e,r),Ba(t/4294967296>>>0,e,r+4),e}et.writeUint64LE=Sd,et.writeInt64LE=Sd;function Rw(t,e,r){if(r===void 0&&(r=0),t%8!==0)throw new Error("readUintBE supports only bitLengths divisible by 8");if(t/8>e.length-r)throw new Error("readUintBE: array is too short for the given bitLength");for(var n=0,i=1,o=t/8+r-1;o>=r;o--)n+=e[o]*i,i*=256;return n}et.readUintBE=Rw;function Lw(t,e,r){if(r===void 0&&(r=0),t%8!==0)throw new Error("readUintLE supports only bitLengths divisible by 8");if(t/8>e.length-r)throw new Error("readUintLE: array is too short for the given bitLength");for(var n=0,i=1,o=r;o<r+t/8;o++)n+=e[o]*i,i*=256;return n}et.readUintLE=Lw;function Mw(t,e,r,n){if(r===void 0&&(r=new Uint8Array(t/8)),n===void 0&&(n=0),t%8!==0)throw new Error("writeUintBE supports only bitLengths divisible by 8");if(!Ed.isSafeInteger(e))throw new Error("writeUintBE value must be an integer");for(var i=1,o=t/8+n-1;o>=n;o--)r[o]=e/i&255,i*=256;return r}et.writeUintBE=Mw;function Uw(t,e,r,n){if(r===void 0&&(r=new Uint8Array(t/8)),n===void 0&&(n=0),t%8!==0)throw new Error("writeUintLE supports only bitLengths divisible by 8");if(!Ed.isSafeInteger(e))throw new Error("writeUintLE value must be an integer");for(var i=1,o=n;o<n+t/8;o++)r[o]=e/i&255,i*=256;return r}et.writeUintLE=Uw;function jw(t,e){e===void 0&&(e=0);var r=new DataView(t.buffer,t.byteOffset,t.byteLength);return r.getFloat32(e)}et.readFloat32BE=jw;function Fw(t,e){e===void 0&&(e=0);var r=new DataView(t.buffer,t.byteOffset,t.byteLength);return r.getFloat32(e,!0)}et.readFloat32LE=Fw;function Bw(t,e){e===void 0&&(e=0);var r=new DataView(t.buffer,t.byteOffset,t.byteLength);return r.getFloat64(e)}et.readFloat64BE=Bw;function kw(t,e){e===void 0&&(e=0);var r=new DataView(t.buffer,t.byteOffset,t.byteLength);return r.getFloat64(e,!0)}et.readFloat64LE=kw;function Hw(t,e,r){e===void 0&&(e=new Uint8Array(4)),r===void 0&&(r=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.setFloat32(r,t),e}et.writeFloat32BE=Hw;function zw(t,e,r){e===void 0&&(e=new Uint8Array(4)),r===void 0&&(r=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.setFloat32(r,t,!0),e}et.writeFloat32LE=zw;function Ww(t,e,r){e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.setFloat64(r,t),e}et.writeFloat64BE=Ww;function qw(t,e,r){e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.setFloat64(r,t,!0),e}et.writeFloat64LE=qw;var Yr={};Object.defineProperty(Yr,"__esModule",{value:!0});function Vw(t){for(var e=0;e<t.length;e++)t[e]=0;return t}Yr.wipe=Vw,Object.defineProperty(ja,"__esModule",{value:!0});var Ir=et,ou=Yr,Kw=20;function Gw(t,e,r){for(var n=1634760805,i=857760878,o=2036477234,c=1797285236,l=r[3]<<24|r[2]<<16|r[1]<<8|r[0],h=r[7]<<24|r[6]<<16|r[5]<<8|r[4],f=r[11]<<24|r[10]<<16|r[9]<<8|r[8],v=r[15]<<24|r[14]<<16|r[13]<<8|r[12],E=r[19]<<24|r[18]<<16|r[17]<<8|r[16],_=r[23]<<24|r[22]<<16|r[21]<<8|r[20],S=r[27]<<24|r[26]<<16|r[25]<<8|r[24],P=r[31]<<24|r[30]<<16|r[29]<<8|r[28],j=e[3]<<24|e[2]<<16|e[1]<<8|e[0],H=e[7]<<24|e[6]<<16|e[5]<<8|e[4],Z=e[11]<<24|e[10]<<16|e[9]<<8|e[8],R=e[15]<<24|e[14]<<16|e[13]<<8|e[12],L=n,$=i,T=o,I=c,d=l,x=h,J=f,z=v,ee=E,de=_,me=S,A=P,U=j,ce=H,le=Z,re=R,ne=0;ne<Kw;ne+=2)L=L+d|0,U^=L,U=U>>>32-16|U<<16,ee=ee+U|0,d^=ee,d=d>>>32-12|d<<12,$=$+x|0,ce^=$,ce=ce>>>32-16|ce<<16,de=de+ce|0,x^=de,x=x>>>32-12|x<<12,T=T+J|0,le^=T,le=le>>>32-16|le<<16,me=me+le|0,J^=me,J=J>>>32-12|J<<12,I=I+z|0,re^=I,re=re>>>32-16|re<<16,A=A+re|0,z^=A,z=z>>>32-12|z<<12,T=T+J|0,le^=T,le=le>>>32-8|le<<8,me=me+le|0,J^=me,J=J>>>32-7|J<<7,I=I+z|0,re^=I,re=re>>>32-8|re<<8,A=A+re|0,z^=A,z=z>>>32-7|z<<7,$=$+x|0,ce^=$,ce=ce>>>32-8|ce<<8,de=de+ce|0,x^=de,x=x>>>32-7|x<<7,L=L+d|0,U^=L,U=U>>>32-8|U<<8,ee=ee+U|0,d^=ee,d=d>>>32-7|d<<7,L=L+x|0,re^=L,re=re>>>32-16|re<<16,me=me+re|0,x^=me,x=x>>>32-12|x<<12,$=$+J|0,U^=$,U=U>>>32-16|U<<16,A=A+U|0,J^=A,J=J>>>32-12|J<<12,T=T+z|0,ce^=T,ce=ce>>>32-16|ce<<16,ee=ee+ce|0,z^=ee,z=z>>>32-12|z<<12,I=I+d|0,le^=I,le=le>>>32-16|le<<16,de=de+le|0,d^=de,d=d>>>32-12|d<<12,T=T+z|0,ce^=T,ce=ce>>>32-8|ce<<8,ee=ee+ce|0,z^=ee,z=z>>>32-7|z<<7,I=I+d|0,le^=I,le=le>>>32-8|le<<8,de=de+le|0,d^=de,d=d>>>32-7|d<<7,$=$+J|0,U^=$,U=U>>>32-8|U<<8,A=A+U|0,J^=A,J=J>>>32-7|J<<7,L=L+x|0,re^=L,re=re>>>32-8|re<<8,me=me+re|0,x^=me,x=x>>>32-7|x<<7;Ir.writeUint32LE(L+n|0,t,0),Ir.writeUint32LE($+i|0,t,4),Ir.writeUint32LE(T+o|0,t,8),Ir.writeUint32LE(I+c|0,t,12),Ir.writeUint32LE(d+l|0,t,16),Ir.writeUint32LE(x+h|0,t,20),Ir.writeUint32LE(J+f|0,t,24),Ir.writeUint32LE(z+v|0,t,28),Ir.writeUint32LE(ee+E|0,t,32),Ir.writeUint32LE(de+_|0,t,36),Ir.writeUint32LE(me+S|0,t,40),Ir.writeUint32LE(A+P|0,t,44),Ir.writeUint32LE(U+j|0,t,48),Ir.writeUint32LE(ce+H|0,t,52),Ir.writeUint32LE(le+Z|0,t,56),Ir.writeUint32LE(re+R|0,t,60)}function Ad(t,e,r,n,i){if(i===void 0&&(i=0),t.length!==32)throw new Error("ChaCha: key size must be 32 bytes");if(n.length<r.length)throw new Error("ChaCha: destination is shorter than source");var o,c;if(i===0){if(e.length!==8&&e.length!==12)throw new Error("ChaCha nonce must be 8 or 12 bytes");o=new Uint8Array(16),c=o.length-e.length,o.set(e,c)}else{if(e.length!==16)throw new Error("ChaCha nonce with counter must be 16 bytes");o=e,c=i}for(var l=new Uint8Array(64),h=0;h<r.length;h+=64){Gw(l,o,t);for(var f=h;f<h+64&&f<r.length;f++)n[f]=r[f]^l[f-h];Yw(o,0,c)}return ou.wipe(l),i===0&&ou.wipe(o),n}ja.streamXOR=Ad;function Zw(t,e,r,n){return n===void 0&&(n=0),ou.wipe(r),Ad(t,e,r,r,n)}ja.stream=Zw;function Yw(t,e,r){for(var n=1;r--;)n=n+(t[e]&255)|0,t[e]=n&255,n>>>=8,e++;if(n>0)throw new Error("ChaCha: counter overflow")}var Od={},li={};Object.defineProperty(li,"__esModule",{value:!0});function Jw(t,e,r){return~(t-1)&e|t-1&r}li.select=Jw;function Xw(t,e){return(t|0)-(e|0)-1>>>31&1}li.lessOrEqual=Xw;function Dd(t,e){if(t.length!==e.length)return 0;for(var r=0,n=0;n<t.length;n++)r|=t[n]^e[n];return 1&r-1>>>8}li.compare=Dd;function Qw(t,e){return t.length===0||e.length===0?!1:Dd(t,e)!==0}li.equal=Qw,function(t){Object.defineProperty(t,"__esModule",{value:!0});var e=li,r=Yr;t.DIGEST_LENGTH=16;var n=function(){function c(l){this.digestLength=t.DIGEST_LENGTH,this._buffer=new Uint8Array(16),this._r=new Uint16Array(10),this._h=new Uint16Array(10),this._pad=new Uint16Array(8),this._leftover=0,this._fin=0,this._finished=!1;var h=l[0]|l[1]<<8;this._r[0]=h&8191;var f=l[2]|l[3]<<8;this._r[1]=(h>>>13|f<<3)&8191;var v=l[4]|l[5]<<8;this._r[2]=(f>>>10|v<<6)&7939;var E=l[6]|l[7]<<8;this._r[3]=(v>>>7|E<<9)&8191;var _=l[8]|l[9]<<8;this._r[4]=(E>>>4|_<<12)&255,this._r[5]=_>>>1&8190;var S=l[10]|l[11]<<8;this._r[6]=(_>>>14|S<<2)&8191;var P=l[12]|l[13]<<8;this._r[7]=(S>>>11|P<<5)&8065;var j=l[14]|l[15]<<8;this._r[8]=(P>>>8|j<<8)&8191,this._r[9]=j>>>5&127,this._pad[0]=l[16]|l[17]<<8,this._pad[1]=l[18]|l[19]<<8,this._pad[2]=l[20]|l[21]<<8,this._pad[3]=l[22]|l[23]<<8,this._pad[4]=l[24]|l[25]<<8,this._pad[5]=l[26]|l[27]<<8,this._pad[6]=l[28]|l[29]<<8,this._pad[7]=l[30]|l[31]<<8}return c.prototype._blocks=function(l,h,f){for(var v=this._fin?0:2048,E=this._h[0],_=this._h[1],S=this._h[2],P=this._h[3],j=this._h[4],H=this._h[5],Z=this._h[6],R=this._h[7],L=this._h[8],$=this._h[9],T=this._r[0],I=this._r[1],d=this._r[2],x=this._r[3],J=this._r[4],z=this._r[5],ee=this._r[6],de=this._r[7],me=this._r[8],A=this._r[9];f>=16;){var U=l[h+0]|l[h+1]<<8;E+=U&8191;var ce=l[h+2]|l[h+3]<<8;_+=(U>>>13|ce<<3)&8191;var le=l[h+4]|l[h+5]<<8;S+=(ce>>>10|le<<6)&8191;var re=l[h+6]|l[h+7]<<8;P+=(le>>>7|re<<9)&8191;var ne=l[h+8]|l[h+9]<<8;j+=(re>>>4|ne<<12)&8191,H+=ne>>>1&8191;var ae=l[h+10]|l[h+11]<<8;Z+=(ne>>>14|ae<<2)&8191;var ie=l[h+12]|l[h+13]<<8;R+=(ae>>>11|ie<<5)&8191;var Oe=l[h+14]|l[h+15]<<8;L+=(ie>>>8|Oe<<8)&8191,$+=Oe>>>5|v;var ge=0,Be=ge;Be+=E*T,Be+=_*(5*A),Be+=S*(5*me),Be+=P*(5*de),Be+=j*(5*ee),ge=Be>>>13,Be&=8191,Be+=H*(5*z),Be+=Z*(5*J),Be+=R*(5*x),Be+=L*(5*d),Be+=$*(5*I),ge+=Be>>>13,Be&=8191;var ye=ge;ye+=E*I,ye+=_*T,ye+=S*(5*A),ye+=P*(5*me),ye+=j*(5*de),ge=ye>>>13,ye&=8191,ye+=H*(5*ee),ye+=Z*(5*z),ye+=R*(5*J),ye+=L*(5*x),ye+=$*(5*d),ge+=ye>>>13,ye&=8191;var Me=ge;Me+=E*d,Me+=_*I,Me+=S*T,Me+=P*(5*A),Me+=j*(5*me),ge=Me>>>13,Me&=8191,Me+=H*(5*de),Me+=Z*(5*ee),Me+=R*(5*z),Me+=L*(5*J),Me+=$*(5*x),ge+=Me>>>13,Me&=8191;var X=ge;X+=E*x,X+=_*d,X+=S*I,X+=P*T,X+=j*(5*A),ge=X>>>13,X&=8191,X+=H*(5*me),X+=Z*(5*de),X+=R*(5*ee),X+=L*(5*z),X+=$*(5*J),ge+=X>>>13,X&=8191;var Y=ge;Y+=E*J,Y+=_*x,Y+=S*d,Y+=P*I,Y+=j*T,ge=Y>>>13,Y&=8191,Y+=H*(5*A),Y+=Z*(5*me),Y+=R*(5*de),Y+=L*(5*ee),Y+=$*(5*z),ge+=Y>>>13,Y&=8191;var W=ge;W+=E*z,W+=_*J,W+=S*x,W+=P*d,W+=j*I,ge=W>>>13,W&=8191,W+=H*T,W+=Z*(5*A),W+=R*(5*me),W+=L*(5*de),W+=$*(5*ee),ge+=W>>>13,W&=8191;var w=ge;w+=E*ee,w+=_*z,w+=S*J,w+=P*x,w+=j*d,ge=w>>>13,w&=8191,w+=H*I,w+=Z*T,w+=R*(5*A),w+=L*(5*me),w+=$*(5*de),ge+=w>>>13,w&=8191;var F=ge;F+=E*de,F+=_*ee,F+=S*z,F+=P*J,F+=j*x,ge=F>>>13,F&=8191,F+=H*d,F+=Z*I,F+=R*T,F+=L*(5*A),F+=$*(5*me),ge+=F>>>13,F&=8191;var we=ge;we+=E*me,we+=_*de,we+=S*ee,we+=P*z,we+=j*J,ge=we>>>13,we&=8191,we+=H*x,we+=Z*d,we+=R*I,we+=L*T,we+=$*(5*A),ge+=we>>>13,we&=8191;var ve=ge;ve+=E*A,ve+=_*me,ve+=S*de,ve+=P*ee,ve+=j*z,ge=ve>>>13,ve&=8191,ve+=H*J,ve+=Z*x,ve+=R*d,ve+=L*I,ve+=$*T,ge+=ve>>>13,ve&=8191,ge=(ge<<2)+ge|0,ge=ge+Be|0,Be=ge&8191,ge=ge>>>13,ye+=ge,E=Be,_=ye,S=Me,P=X,j=Y,H=W,Z=w,R=F,L=we,$=ve,h+=16,f-=16}this._h[0]=E,this._h[1]=_,this._h[2]=S,this._h[3]=P,this._h[4]=j,this._h[5]=H,this._h[6]=Z,this._h[7]=R,this._h[8]=L,this._h[9]=$},c.prototype.finish=function(l,h){h===void 0&&(h=0);var f=new Uint16Array(10),v,E,_,S;if(this._leftover){for(S=this._leftover,this._buffer[S++]=1;S<16;S++)this._buffer[S]=0;this._fin=1,this._blocks(this._buffer,0,16)}for(v=this._h[1]>>>13,this._h[1]&=8191,S=2;S<10;S++)this._h[S]+=v,v=this._h[S]>>>13,this._h[S]&=8191;for(this._h[0]+=v*5,v=this._h[0]>>>13,this._h[0]&=8191,this._h[1]+=v,v=this._h[1]>>>13,this._h[1]&=8191,this._h[2]+=v,f[0]=this._h[0]+5,v=f[0]>>>13,f[0]&=8191,S=1;S<10;S++)f[S]=this._h[S]+v,v=f[S]>>>13,f[S]&=8191;for(f[9]-=8192,E=(v^1)-1,S=0;S<10;S++)f[S]&=E;for(E=~E,S=0;S<10;S++)this._h[S]=this._h[S]&E|f[S];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,_=this._h[0]+this._pad[0],this._h[0]=_&65535,S=1;S<8;S++)_=(this._h[S]+this._pad[S]|0)+(_>>>16)|0,this._h[S]=_&65535;return l[h+0]=this._h[0]>>>0,l[h+1]=this._h[0]>>>8,l[h+2]=this._h[1]>>>0,l[h+3]=this._h[1]>>>8,l[h+4]=this._h[2]>>>0,l[h+5]=this._h[2]>>>8,l[h+6]=this._h[3]>>>0,l[h+7]=this._h[3]>>>8,l[h+8]=this._h[4]>>>0,l[h+9]=this._h[4]>>>8,l[h+10]=this._h[5]>>>0,l[h+11]=this._h[5]>>>8,l[h+12]=this._h[6]>>>0,l[h+13]=this._h[6]>>>8,l[h+14]=this._h[7]>>>0,l[h+15]=this._h[7]>>>8,this._finished=!0,this},c.prototype.update=function(l){var h=0,f=l.length,v;if(this._leftover){v=16-this._leftover,v>f&&(v=f);for(var E=0;E<v;E++)this._buffer[this._leftover+E]=l[h+E];if(f-=v,h+=v,this._leftover+=v,this._leftover<16)return this;this._blocks(this._buffer,0,16),this._leftover=0}if(f>=16&&(v=f-f%16,this._blocks(l,h,v),h+=v,f-=v),f){for(var E=0;E<f;E++)this._buffer[this._leftover+E]=l[h+E];this._leftover+=f}return this},c.prototype.digest=function(){if(this._finished)throw new Error("Poly1305 was finished");var l=new Uint8Array(16);return this.finish(l),l},c.prototype.clean=function(){return r.wipe(this._buffer),r.wipe(this._r),r.wipe(this._h),r.wipe(this._pad),this._leftover=0,this._fin=0,this._finished=!0,this},c}();t.Poly1305=n;function i(c,l){var h=new n(c);h.update(l);var f=h.digest();return h.clean(),f}t.oneTimeAuth=i;function o(c,l){return c.length!==t.DIGEST_LENGTH||l.length!==t.DIGEST_LENGTH?!1:e.equal(c,l)}t.equal=o}(Od),function(t){Object.defineProperty(t,"__esModule",{value:!0});var e=ja,r=Od,n=Yr,i=et,o=li;t.KEY_LENGTH=32,t.NONCE_LENGTH=12,t.TAG_LENGTH=16;var c=new Uint8Array(16),l=function(){function h(f){if(this.nonceLength=t.NONCE_LENGTH,this.tagLength=t.TAG_LENGTH,f.length!==t.KEY_LENGTH)throw new Error("ChaCha20Poly1305 needs 32-byte key");this._key=new Uint8Array(f)}return h.prototype.seal=function(f,v,E,_){if(f.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");var S=new Uint8Array(16);S.set(f,S.length-f.length);var P=new Uint8Array(32);e.stream(this._key,S,P,4);var j=v.length+this.tagLength,H;if(_){if(_.length!==j)throw new Error("ChaCha20Poly1305: incorrect destination length");H=_}else H=new Uint8Array(j);return e.streamXOR(this._key,S,v,H,4),this._authenticate(H.subarray(H.length-this.tagLength,H.length),P,H.subarray(0,H.length-this.tagLength),E),n.wipe(S),H},h.prototype.open=function(f,v,E,_){if(f.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");if(v.length<this.tagLength)return null;var S=new Uint8Array(16);S.set(f,S.length-f.length);var P=new Uint8Array(32);e.stream(this._key,S,P,4);var j=new Uint8Array(this.tagLength);if(this._authenticate(j,P,v.subarray(0,v.length-this.tagLength),E),!o.equal(j,v.subarray(v.length-this.tagLength,v.length)))return null;var H=v.length-this.tagLength,Z;if(_){if(_.length!==H)throw new Error("ChaCha20Poly1305: incorrect destination length");Z=_}else Z=new Uint8Array(H);return e.streamXOR(this._key,S,v.subarray(0,v.length-this.tagLength),Z,4),n.wipe(S),Z},h.prototype.clean=function(){return n.wipe(this._key),this},h.prototype._authenticate=function(f,v,E,_){var S=new r.Poly1305(v);_&&(S.update(_),_.length%16>0&&S.update(c.subarray(_.length%16))),S.update(E),E.length%16>0&&S.update(c.subarray(E.length%16));var P=new Uint8Array(8);_&&i.writeUint64LE(_.length,P),S.update(P),i.writeUint64LE(E.length,P),S.update(P);for(var j=S.digest(),H=0;H<j.length;H++)f[H]=j[H];S.clean(),n.wipe(j),n.wipe(P)},h}();t.ChaCha20Poly1305=l}(tu);var $d={},bo={},au={};Object.defineProperty(au,"__esModule",{value:!0});function ev(t){return typeof t.saveState<"u"&&typeof t.restoreState<"u"&&typeof t.cleanSavedState<"u"}au.isSerializableHash=ev,Object.defineProperty(bo,"__esModule",{value:!0});var $n=au,tv=li,rv=Yr,Pd=function(){function t(e,r){this._finished=!1,this._inner=new e,this._outer=new e,this.blockSize=this._outer.blockSize,this.digestLength=this._outer.digestLength;var n=new Uint8Array(this.blockSize);r.length>this.blockSize?this._inner.update(r).finish(n).clean():n.set(r);for(var i=0;i<n.length;i++)n[i]^=54;this._inner.update(n);for(var i=0;i<n.length;i++)n[i]^=106;this._outer.update(n),$n.isSerializableHash(this._inner)&&$n.isSerializableHash(this._outer)&&(this._innerKeyedState=this._inner.saveState(),this._outerKeyedState=this._outer.saveState()),rv.wipe(n)}return t.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},t.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()},t.prototype.update=function(e){return this._inner.update(e),this},t.prototype.finish=function(e){return this._finished?(this._outer.finish(e),this):(this._inner.finish(e),this._outer.update(e.subarray(0,this.digestLength)).finish(e),this._finished=!0,this)},t.prototype.digest=function(){var e=new Uint8Array(this.digestLength);return this.finish(e),e},t.prototype.saveState=function(){if(!$n.isSerializableHash(this._inner))throw new Error("hmac: can't saveState() because hash doesn't implement it");return this._inner.saveState()},t.prototype.restoreState=function(e){if(!$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},t.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)},t}();bo.HMAC=Pd;function nv(t,e,r){var n=new Pd(t,e);n.update(r);var i=n.digest();return n.clean(),i}bo.hmac=nv,bo.equal=tv.equal,Object.defineProperty($d,"__esModule",{value:!0});var Td=bo,Nd=Yr,iv=function(){function t(e,r,n,i){n===void 0&&(n=new Uint8Array(0)),this._counter=new Uint8Array(1),this._hash=e,this._info=i;var o=Td.hmac(this._hash,n,r);this._hmac=new Td.HMAC(e,o),this._buffer=new Uint8Array(this._hmac.digestLength),this._bufpos=this._buffer.length}return t.prototype._fillBuffer=function(){this._counter[0]++;var e=this._counter[0];if(e===0)throw new Error("hkdf: cannot expand more");this._hmac.reset(),e>1&&this._hmac.update(this._buffer),this._info&&this._hmac.update(this._info),this._hmac.update(this._counter),this._hmac.finish(this._buffer),this._bufpos=0},t.prototype.expand=function(e){for(var r=new Uint8Array(e),n=0;n<r.length;n++)this._bufpos===this._buffer.length&&this._fillBuffer(),r[n]=this._buffer[this._bufpos++];return r},t.prototype.clean=function(){this._hmac.clean(),Nd.wipe(this._buffer),Nd.wipe(this._counter),this._bufpos=0},t}(),sv=$d.HKDF=iv,xs={},ka={},Ha={};Object.defineProperty(Ha,"__esModule",{value:!0}),Ha.BrowserRandomSource=void 0;const Rd=65536;class ov{constructor(){this.isAvailable=!1,this.isInstantiated=!1;const e=typeof self<"u"?self.crypto||self.msCrypto:null;e&&e.getRandomValues!==void 0&&(this._crypto=e,this.isAvailable=!0,this.isInstantiated=!0)}randomBytes(e){if(!this.isAvailable||!this._crypto)throw new Error("Browser random byte generator is not available.");const r=new Uint8Array(e);for(let n=0;n<r.length;n+=Rd)this._crypto.getRandomValues(r.subarray(n,n+Math.min(r.length-n,Rd)));return r}}Ha.BrowserRandomSource=ov;function av(t){throw new Error('Could not dynamically require "'+t+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var za={},cv={},lv=Object.freeze({__proto__:null,default:cv}),uv=Ui(lv);Object.defineProperty(za,"__esModule",{value:!0}),za.NodeRandomSource=void 0;const hv=Yr;class fv{constructor(){if(this.isAvailable=!1,this.isInstantiated=!1,typeof av<"u"){const e=uv;e&&e.randomBytes&&(this._crypto=e,this.isAvailable=!0,this.isInstantiated=!0)}}randomBytes(e){if(!this.isAvailable||!this._crypto)throw new Error("Node.js random byte generator is not available.");let r=this._crypto.randomBytes(e);if(r.length!==e)throw new Error("NodeRandomSource: got fewer bytes than requested");const n=new Uint8Array(e);for(let i=0;i<n.length;i++)n[i]=r[i];return(0,hv.wipe)(r),n}}za.NodeRandomSource=fv,Object.defineProperty(ka,"__esModule",{value:!0}),ka.SystemRandomSource=void 0;const dv=Ha,pv=za;class gv{constructor(){if(this.isAvailable=!1,this.name="",this._source=new dv.BrowserRandomSource,this._source.isAvailable){this.isAvailable=!0,this.name="Browser";return}if(this._source=new pv.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)}}ka.SystemRandomSource=gv,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.randomStringForEntropy=t.randomString=t.randomUint32=t.randomBytes=t.defaultRandomSource=void 0;const e=ka,r=et,n=Yr;t.defaultRandomSource=new e.SystemRandomSource;function i(f,v=t.defaultRandomSource){return v.randomBytes(f)}t.randomBytes=i;function o(f=t.defaultRandomSource){const v=i(4,f),E=(0,r.readUint32LE)(v);return(0,n.wipe)(v),E}t.randomUint32=o;const c="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";function l(f,v=c,E=t.defaultRandomSource){if(v.length<2)throw new Error("randomString charset is too short");if(v.length>256)throw new Error("randomString charset is too long");let _="";const S=v.length,P=256-256%S;for(;f>0;){const j=i(Math.ceil(f*256/P),E);for(let H=0;H<j.length&&f>0;H++){const Z=j[H];Z<P&&(_+=v.charAt(Z%S),f--)}(0,n.wipe)(j)}return _}t.randomString=l;function h(f,v=c,E=t.defaultRandomSource){const _=Math.ceil(f/(Math.log(v.length)/Math.LN2));return l(_,v,E)}t.randomStringForEntropy=h}(xs);var Wa={};(function(t){Object.defineProperty(t,"__esModule",{value:!0});var e=et,r=Yr;t.DIGEST_LENGTH=32,t.BLOCK_SIZE=64;var n=function(){function l(){this.digestLength=t.DIGEST_LENGTH,this.blockSize=t.BLOCK_SIZE,this._state=new Int32Array(8),this._temp=new Int32Array(64),this._buffer=new Uint8Array(128),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this.reset()}return l.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},l.prototype.reset=function(){return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this},l.prototype.clean=function(){r.wipe(this._buffer),r.wipe(this._temp),this.reset()},l.prototype.update=function(h,f){if(f===void 0&&(f=h.length),this._finished)throw new Error("SHA256: can't update because hash was finished.");var v=0;if(this._bytesHashed+=f,this._bufferLength>0){for(;this._bufferLength<this.blockSize&&f>0;)this._buffer[this._bufferLength++]=h[v++],f--;this._bufferLength===this.blockSize&&(o(this._temp,this._state,this._buffer,0,this.blockSize),this._bufferLength=0)}for(f>=this.blockSize&&(v=o(this._temp,this._state,h,v,f),f%=this.blockSize);f>0;)this._buffer[this._bufferLength++]=h[v++],f--;return this},l.prototype.finish=function(h){if(!this._finished){var f=this._bytesHashed,v=this._bufferLength,E=f/536870912|0,_=f<<3,S=f%64<56?64:128;this._buffer[v]=128;for(var P=v+1;P<S-8;P++)this._buffer[P]=0;e.writeUint32BE(E,this._buffer,S-8),e.writeUint32BE(_,this._buffer,S-4),o(this._temp,this._state,this._buffer,0,S),this._finished=!0}for(var P=0;P<this.digestLength/4;P++)e.writeUint32BE(this._state[P],h,P*4);return this},l.prototype.digest=function(){var h=new Uint8Array(this.digestLength);return this.finish(h),h},l.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}},l.prototype.restoreState=function(h){return this._state.set(h.state),this._bufferLength=h.bufferLength,h.buffer&&this._buffer.set(h.buffer),this._bytesHashed=h.bytesHashed,this._finished=!1,this},l.prototype.cleanSavedState=function(h){r.wipe(h.state),h.buffer&&r.wipe(h.buffer),h.bufferLength=0,h.bytesHashed=0},l}();t.SHA256=n;var i=new Int32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]);function o(l,h,f,v,E){for(;E>=64;){for(var _=h[0],S=h[1],P=h[2],j=h[3],H=h[4],Z=h[5],R=h[6],L=h[7],$=0;$<16;$++){var T=v+$*4;l[$]=e.readUint32BE(f,T)}for(var $=16;$<64;$++){var I=l[$-2],d=(I>>>17|I<<32-17)^(I>>>19|I<<32-19)^I>>>10;I=l[$-15];var x=(I>>>7|I<<32-7)^(I>>>18|I<<32-18)^I>>>3;l[$]=(d+l[$-7]|0)+(x+l[$-16]|0)}for(var $=0;$<64;$++){var d=(((H>>>6|H<<26)^(H>>>11|H<<21)^(H>>>25|H<<7))+(H&Z^~H&R)|0)+(L+(i[$]+l[$]|0)|0)|0,x=((_>>>2|_<<32-2)^(_>>>13|_<<32-13)^(_>>>22|_<<32-22))+(_&S^_&P^S&P)|0;L=R,R=Z,Z=H,H=j+d|0,j=P,P=S,S=_,_=d+x|0}h[0]+=_,h[1]+=S,h[2]+=P,h[3]+=j,h[4]+=H,h[5]+=Z,h[6]+=R,h[7]+=L,v+=64,E-=64}return v}function c(l){var h=new n;h.update(l);var f=h.digest();return h.clean(),f}t.hash=c})(Wa);var cu={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.sharedKey=t.generateKeyPair=t.generateKeyPairFromSeed=t.scalarMultBase=t.scalarMult=t.SHARED_KEY_LENGTH=t.SECRET_KEY_LENGTH=t.PUBLIC_KEY_LENGTH=void 0;const e=xs,r=Yr;t.PUBLIC_KEY_LENGTH=32,t.SECRET_KEY_LENGTH=32,t.SHARED_KEY_LENGTH=32;function n($){const T=new Float64Array(16);if($)for(let I=0;I<$.length;I++)T[I]=$[I];return T}const i=new Uint8Array(32);i[0]=9;const o=n([56129,1]);function c($){let T=1;for(let I=0;I<16;I++){let d=$[I]+T+65535;T=Math.floor(d/65536),$[I]=d-T*65536}$[0]+=T-1+37*(T-1)}function l($,T,I){const d=~(I-1);for(let x=0;x<16;x++){const J=d&($[x]^T[x]);$[x]^=J,T[x]^=J}}function h($,T){const I=n(),d=n();for(let x=0;x<16;x++)d[x]=T[x];c(d),c(d),c(d);for(let x=0;x<2;x++){I[0]=d[0]-65517;for(let z=1;z<15;z++)I[z]=d[z]-65535-(I[z-1]>>16&1),I[z-1]&=65535;I[15]=d[15]-32767-(I[14]>>16&1);const J=I[15]>>16&1;I[14]&=65535,l(d,I,1-J)}for(let x=0;x<16;x++)$[2*x]=d[x]&255,$[2*x+1]=d[x]>>8}function f($,T){for(let I=0;I<16;I++)$[I]=T[2*I]+(T[2*I+1]<<8);$[15]&=32767}function v($,T,I){for(let d=0;d<16;d++)$[d]=T[d]+I[d]}function E($,T,I){for(let d=0;d<16;d++)$[d]=T[d]-I[d]}function _($,T,I){let d,x,J=0,z=0,ee=0,de=0,me=0,A=0,U=0,ce=0,le=0,re=0,ne=0,ae=0,ie=0,Oe=0,ge=0,Be=0,ye=0,Me=0,X=0,Y=0,W=0,w=0,F=0,we=0,ve=0,Ue=0,nt=0,at=0,Ge=0,Dt=0,$t=0,Je=I[0],He=I[1],ke=I[2],Ke=I[3],rt=I[4],je=I[5],Ze=I[6],b=I[7],p=I[8],m=I[9],D=I[10],B=I[11],K=I[12],Q=I[13],Ee=I[14],Ne=I[15];d=T[0],J+=d*Je,z+=d*He,ee+=d*ke,de+=d*Ke,me+=d*rt,A+=d*je,U+=d*Ze,ce+=d*b,le+=d*p,re+=d*m,ne+=d*D,ae+=d*B,ie+=d*K,Oe+=d*Q,ge+=d*Ee,Be+=d*Ne,d=T[1],z+=d*Je,ee+=d*He,de+=d*ke,me+=d*Ke,A+=d*rt,U+=d*je,ce+=d*Ze,le+=d*b,re+=d*p,ne+=d*m,ae+=d*D,ie+=d*B,Oe+=d*K,ge+=d*Q,Be+=d*Ee,ye+=d*Ne,d=T[2],ee+=d*Je,de+=d*He,me+=d*ke,A+=d*Ke,U+=d*rt,ce+=d*je,le+=d*Ze,re+=d*b,ne+=d*p,ae+=d*m,ie+=d*D,Oe+=d*B,ge+=d*K,Be+=d*Q,ye+=d*Ee,Me+=d*Ne,d=T[3],de+=d*Je,me+=d*He,A+=d*ke,U+=d*Ke,ce+=d*rt,le+=d*je,re+=d*Ze,ne+=d*b,ae+=d*p,ie+=d*m,Oe+=d*D,ge+=d*B,Be+=d*K,ye+=d*Q,Me+=d*Ee,X+=d*Ne,d=T[4],me+=d*Je,A+=d*He,U+=d*ke,ce+=d*Ke,le+=d*rt,re+=d*je,ne+=d*Ze,ae+=d*b,ie+=d*p,Oe+=d*m,ge+=d*D,Be+=d*B,ye+=d*K,Me+=d*Q,X+=d*Ee,Y+=d*Ne,d=T[5],A+=d*Je,U+=d*He,ce+=d*ke,le+=d*Ke,re+=d*rt,ne+=d*je,ae+=d*Ze,ie+=d*b,Oe+=d*p,ge+=d*m,Be+=d*D,ye+=d*B,Me+=d*K,X+=d*Q,Y+=d*Ee,W+=d*Ne,d=T[6],U+=d*Je,ce+=d*He,le+=d*ke,re+=d*Ke,ne+=d*rt,ae+=d*je,ie+=d*Ze,Oe+=d*b,ge+=d*p,Be+=d*m,ye+=d*D,Me+=d*B,X+=d*K,Y+=d*Q,W+=d*Ee,w+=d*Ne,d=T[7],ce+=d*Je,le+=d*He,re+=d*ke,ne+=d*Ke,ae+=d*rt,ie+=d*je,Oe+=d*Ze,ge+=d*b,Be+=d*p,ye+=d*m,Me+=d*D,X+=d*B,Y+=d*K,W+=d*Q,w+=d*Ee,F+=d*Ne,d=T[8],le+=d*Je,re+=d*He,ne+=d*ke,ae+=d*Ke,ie+=d*rt,Oe+=d*je,ge+=d*Ze,Be+=d*b,ye+=d*p,Me+=d*m,X+=d*D,Y+=d*B,W+=d*K,w+=d*Q,F+=d*Ee,we+=d*Ne,d=T[9],re+=d*Je,ne+=d*He,ae+=d*ke,ie+=d*Ke,Oe+=d*rt,ge+=d*je,Be+=d*Ze,ye+=d*b,Me+=d*p,X+=d*m,Y+=d*D,W+=d*B,w+=d*K,F+=d*Q,we+=d*Ee,ve+=d*Ne,d=T[10],ne+=d*Je,ae+=d*He,ie+=d*ke,Oe+=d*Ke,ge+=d*rt,Be+=d*je,ye+=d*Ze,Me+=d*b,X+=d*p,Y+=d*m,W+=d*D,w+=d*B,F+=d*K,we+=d*Q,ve+=d*Ee,Ue+=d*Ne,d=T[11],ae+=d*Je,ie+=d*He,Oe+=d*ke,ge+=d*Ke,Be+=d*rt,ye+=d*je,Me+=d*Ze,X+=d*b,Y+=d*p,W+=d*m,w+=d*D,F+=d*B,we+=d*K,ve+=d*Q,Ue+=d*Ee,nt+=d*Ne,d=T[12],ie+=d*Je,Oe+=d*He,ge+=d*ke,Be+=d*Ke,ye+=d*rt,Me+=d*je,X+=d*Ze,Y+=d*b,W+=d*p,w+=d*m,F+=d*D,we+=d*B,ve+=d*K,Ue+=d*Q,nt+=d*Ee,at+=d*Ne,d=T[13],Oe+=d*Je,ge+=d*He,Be+=d*ke,ye+=d*Ke,Me+=d*rt,X+=d*je,Y+=d*Ze,W+=d*b,w+=d*p,F+=d*m,we+=d*D,ve+=d*B,Ue+=d*K,nt+=d*Q,at+=d*Ee,Ge+=d*Ne,d=T[14],ge+=d*Je,Be+=d*He,ye+=d*ke,Me+=d*Ke,X+=d*rt,Y+=d*je,W+=d*Ze,w+=d*b,F+=d*p,we+=d*m,ve+=d*D,Ue+=d*B,nt+=d*K,at+=d*Q,Ge+=d*Ee,Dt+=d*Ne,d=T[15],Be+=d*Je,ye+=d*He,Me+=d*ke,X+=d*Ke,Y+=d*rt,W+=d*je,w+=d*Ze,F+=d*b,we+=d*p,ve+=d*m,Ue+=d*D,nt+=d*B,at+=d*K,Ge+=d*Q,Dt+=d*Ee,$t+=d*Ne,J+=38*ye,z+=38*Me,ee+=38*X,de+=38*Y,me+=38*W,A+=38*w,U+=38*F,ce+=38*we,le+=38*ve,re+=38*Ue,ne+=38*nt,ae+=38*at,ie+=38*Ge,Oe+=38*Dt,ge+=38*$t,x=1,d=J+x+65535,x=Math.floor(d/65536),J=d-x*65536,d=z+x+65535,x=Math.floor(d/65536),z=d-x*65536,d=ee+x+65535,x=Math.floor(d/65536),ee=d-x*65536,d=de+x+65535,x=Math.floor(d/65536),de=d-x*65536,d=me+x+65535,x=Math.floor(d/65536),me=d-x*65536,d=A+x+65535,x=Math.floor(d/65536),A=d-x*65536,d=U+x+65535,x=Math.floor(d/65536),U=d-x*65536,d=ce+x+65535,x=Math.floor(d/65536),ce=d-x*65536,d=le+x+65535,x=Math.floor(d/65536),le=d-x*65536,d=re+x+65535,x=Math.floor(d/65536),re=d-x*65536,d=ne+x+65535,x=Math.floor(d/65536),ne=d-x*65536,d=ae+x+65535,x=Math.floor(d/65536),ae=d-x*65536,d=ie+x+65535,x=Math.floor(d/65536),ie=d-x*65536,d=Oe+x+65535,x=Math.floor(d/65536),Oe=d-x*65536,d=ge+x+65535,x=Math.floor(d/65536),ge=d-x*65536,d=Be+x+65535,x=Math.floor(d/65536),Be=d-x*65536,J+=x-1+37*(x-1),x=1,d=J+x+65535,x=Math.floor(d/65536),J=d-x*65536,d=z+x+65535,x=Math.floor(d/65536),z=d-x*65536,d=ee+x+65535,x=Math.floor(d/65536),ee=d-x*65536,d=de+x+65535,x=Math.floor(d/65536),de=d-x*65536,d=me+x+65535,x=Math.floor(d/65536),me=d-x*65536,d=A+x+65535,x=Math.floor(d/65536),A=d-x*65536,d=U+x+65535,x=Math.floor(d/65536),U=d-x*65536,d=ce+x+65535,x=Math.floor(d/65536),ce=d-x*65536,d=le+x+65535,x=Math.floor(d/65536),le=d-x*65536,d=re+x+65535,x=Math.floor(d/65536),re=d-x*65536,d=ne+x+65535,x=Math.floor(d/65536),ne=d-x*65536,d=ae+x+65535,x=Math.floor(d/65536),ae=d-x*65536,d=ie+x+65535,x=Math.floor(d/65536),ie=d-x*65536,d=Oe+x+65535,x=Math.floor(d/65536),Oe=d-x*65536,d=ge+x+65535,x=Math.floor(d/65536),ge=d-x*65536,d=Be+x+65535,x=Math.floor(d/65536),Be=d-x*65536,J+=x-1+37*(x-1),$[0]=J,$[1]=z,$[2]=ee,$[3]=de,$[4]=me,$[5]=A,$[6]=U,$[7]=ce,$[8]=le,$[9]=re,$[10]=ne,$[11]=ae,$[12]=ie,$[13]=Oe,$[14]=ge,$[15]=Be}function S($,T){_($,T,T)}function P($,T){const I=n();for(let d=0;d<16;d++)I[d]=T[d];for(let d=253;d>=0;d--)S(I,I),d!==2&&d!==4&&_(I,I,T);for(let d=0;d<16;d++)$[d]=I[d]}function j($,T){const I=new Uint8Array(32),d=new Float64Array(80),x=n(),J=n(),z=n(),ee=n(),de=n(),me=n();for(let le=0;le<31;le++)I[le]=$[le];I[31]=$[31]&127|64,I[0]&=248,f(d,T);for(let le=0;le<16;le++)J[le]=d[le];x[0]=ee[0]=1;for(let le=254;le>=0;--le){const re=I[le>>>3]>>>(le&7)&1;l(x,J,re),l(z,ee,re),v(de,x,z),E(x,x,z),v(z,J,ee),E(J,J,ee),S(ee,de),S(me,x),_(x,z,x),_(z,J,de),v(de,x,z),E(x,x,z),S(J,x),E(z,ee,me),_(x,z,o),v(x,x,ee),_(z,z,x),_(x,ee,me),_(ee,J,d),S(J,de),l(x,J,re),l(z,ee,re)}for(let le=0;le<16;le++)d[le+16]=x[le],d[le+32]=z[le],d[le+48]=J[le],d[le+64]=ee[le];const A=d.subarray(32),U=d.subarray(16);P(A,A),_(U,U,A);const ce=new Uint8Array(32);return h(ce,U),ce}t.scalarMult=j;function H($){return j($,i)}t.scalarMultBase=H;function Z($){if($.length!==t.SECRET_KEY_LENGTH)throw new Error(`x25519: seed must be ${t.SECRET_KEY_LENGTH} bytes`);const T=new Uint8Array($);return{publicKey:H(T),secretKey:T}}t.generateKeyPairFromSeed=Z;function R($){const T=(0,e.randomBytes)(32,$),I=Z(T);return(0,r.wipe)(T),I}t.generateKeyPair=R;function L($,T,I=!1){if($.length!==t.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect secret key length");if(T.length!==t.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect public key length");const d=j($,T);if(I){let x=0;for(let J=0;J<d.length;J++)x|=d[J];if(x===0)throw new Error("X25519: invalid shared key")}return d}t.sharedKey=L})(cu);function lu(t){return globalThis.Buffer!=null?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):t}function Ld(t=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?lu(globalThis.Buffer.allocUnsafe(t)):new Uint8Array(t)}function uu(t,e){e||(e=t.reduce((i,o)=>i+o.length,0));const r=Ld(e);let n=0;for(const i of t)r.set(i,n),n+=i.length;return lu(r)}function mv(t,e){if(t.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),n=0;n<r.length;n++)r[n]=255;for(var i=0;i<t.length;i++){var o=t.charAt(i),c=o.charCodeAt(0);if(r[c]!==255)throw new TypeError(o+" is ambiguous");r[c]=i}var l=t.length,h=t.charAt(0),f=Math.log(l)/Math.log(256),v=Math.log(256)/Math.log(l);function E(P){if(P instanceof Uint8Array||(ArrayBuffer.isView(P)?P=new Uint8Array(P.buffer,P.byteOffset,P.byteLength):Array.isArray(P)&&(P=Uint8Array.from(P))),!(P instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(P.length===0)return"";for(var j=0,H=0,Z=0,R=P.length;Z!==R&&P[Z]===0;)Z++,j++;for(var L=(R-Z)*v+1>>>0,$=new Uint8Array(L);Z!==R;){for(var T=P[Z],I=0,d=L-1;(T!==0||I<H)&&d!==-1;d--,I++)T+=256*$[d]>>>0,$[d]=T%l>>>0,T=T/l>>>0;if(T!==0)throw new Error("Non-zero carry");H=I,Z++}for(var x=L-H;x!==L&&$[x]===0;)x++;for(var J=h.repeat(j);x<L;++x)J+=t.charAt($[x]);return J}function _(P){if(typeof P!="string")throw new TypeError("Expected String");if(P.length===0)return new Uint8Array;var j=0;if(P[j]!==" "){for(var H=0,Z=0;P[j]===h;)H++,j++;for(var R=(P.length-j)*f+1>>>0,L=new Uint8Array(R);P[j];){var $=r[P.charCodeAt(j)];if($===255)return;for(var T=0,I=R-1;($!==0||T<Z)&&I!==-1;I--,T++)$+=l*L[I]>>>0,L[I]=$%256>>>0,$=$/256>>>0;if($!==0)throw new Error("Non-zero carry");Z=T,j++}if(P[j]!==" "){for(var d=R-Z;d!==R&&L[d]===0;)d++;for(var x=new Uint8Array(H+(R-d)),J=H;d!==R;)x[J++]=L[d++];return x}}}function S(P){var j=_(P);if(j)return j;throw new Error(`Non-${e} character`)}return{encode:E,decodeUnsafe:_,decode:S}}var wv=mv,vv=wv;const Md=t=>{if(t instanceof Uint8Array&&t.constructor.name==="Uint8Array")return t;if(t instanceof ArrayBuffer)return new Uint8Array(t);if(ArrayBuffer.isView(t))return new Uint8Array(t.buffer,t.byteOffset,t.byteLength);throw new Error("Unknown type, must be binary type")},yv=t=>new TextEncoder().encode(t),bv=t=>new TextDecoder().decode(t);class _v{constructor(e,r,n){this.name=e,this.prefix=r,this.baseEncode=n}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}}class Ev{constructor(e,r,n){if(this.name=e,this.prefix=r,r.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=r.codePointAt(0),this.baseDecode=n}decode(e){if(typeof e=="string"){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(e){return Ud(this,e)}}class xv{constructor(e){this.decoders=e}or(e){return Ud(this,e)}decode(e){const r=e[0],n=this.decoders[r];if(n)return n.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const Ud=(t,e)=>new xv({...t.decoders||{[t.prefix]:t},...e.decoders||{[e.prefix]:e}});class Cv{constructor(e,r,n,i){this.name=e,this.prefix=r,this.baseEncode=n,this.baseDecode=i,this.encoder=new _v(e,r,n),this.decoder=new Ev(e,r,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}const qa=({name:t,prefix:e,encode:r,decode:n})=>new Cv(t,e,r,n),_o=({prefix:t,name:e,alphabet:r})=>{const{encode:n,decode:i}=vv(r,e);return qa({prefix:t,name:e,encode:n,decode:o=>Md(i(o))})},Iv=(t,e,r,n)=>{const i={};for(let v=0;v<e.length;++v)i[e[v]]=v;let o=t.length;for(;t[o-1]==="=";)--o;const c=new Uint8Array(o*r/8|0);let l=0,h=0,f=0;for(let v=0;v<o;++v){const E=i[t[v]];if(E===void 0)throw new SyntaxError(`Non-${n} character`);h=h<<r|E,l+=r,l>=8&&(l-=8,c[f++]=255&h>>l)}if(l>=r||255&h<<8-l)throw new SyntaxError("Unexpected end of data");return c},Sv=(t,e,r)=>{const n=e[e.length-1]==="=",i=(1<<r)-1;let o="",c=0,l=0;for(let h=0;h<t.length;++h)for(l=l<<8|t[h],c+=8;c>r;)c-=r,o+=e[i&l>>c];if(c&&(o+=e[i&l<<r-c]),n)for(;o.length*r&7;)o+="=";return o},_r=({name:t,prefix:e,bitsPerChar:r,alphabet:n})=>qa({prefix:e,name:t,encode(i){return Sv(i,n,r)},decode(i){return Iv(i,n,r,t)}}),Av=qa({prefix:"\0",name:"identity",encode:t=>bv(t),decode:t=>yv(t)});var Ov=Object.freeze({__proto__:null,identity:Av});const Dv=_r({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var $v=Object.freeze({__proto__:null,base2:Dv});const Pv=_r({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var Tv=Object.freeze({__proto__:null,base8:Pv});const Nv=_o({prefix:"9",name:"base10",alphabet:"0123456789"});var Rv=Object.freeze({__proto__:null,base10:Nv});const Lv=_r({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),Mv=_r({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var Uv=Object.freeze({__proto__:null,base16:Lv,base16upper:Mv});const jv=_r({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),Fv=_r({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),Bv=_r({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),kv=_r({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),Hv=_r({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),zv=_r({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),Wv=_r({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),qv=_r({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),Vv=_r({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var Kv=Object.freeze({__proto__:null,base32:jv,base32upper:Fv,base32pad:Bv,base32padupper:kv,base32hex:Hv,base32hexupper:zv,base32hexpad:Wv,base32hexpadupper:qv,base32z:Vv});const Gv=_o({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),Zv=_o({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var Yv=Object.freeze({__proto__:null,base36:Gv,base36upper:Zv});const Jv=_o({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),Xv=_o({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var Qv=Object.freeze({__proto__:null,base58btc:Jv,base58flickr:Xv});const ey=_r({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),ty=_r({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),ry=_r({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),ny=_r({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var iy=Object.freeze({__proto__:null,base64:ey,base64pad:ty,base64url:ry,base64urlpad:ny});const jd=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}"),sy=jd.reduce((t,e,r)=>(t[r]=e,t),[]),oy=jd.reduce((t,e,r)=>(t[e.codePointAt(0)]=r,t),[]);function ay(t){return t.reduce((e,r)=>(e+=sy[r],e),"")}function cy(t){const e=[];for(const r of t){const n=oy[r.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${r}`);e.push(n)}return new Uint8Array(e)}const ly=qa({prefix:"\u{1F680}",name:"base256emoji",encode:ay,decode:cy});var uy=Object.freeze({__proto__:null,base256emoji:ly}),hy=Bd,Fd=128,fy=127,dy=~fy,py=Math.pow(2,31);function Bd(t,e,r){e=e||[],r=r||0;for(var n=r;t>=py;)e[r++]=t&255|Fd,t/=128;for(;t&dy;)e[r++]=t&255|Fd,t>>>=7;return e[r]=t|0,Bd.bytes=r-n+1,e}var gy=hu,my=128,kd=127;function hu(t,n){var r=0,n=n||0,i=0,o=n,c,l=t.length;do{if(o>=l)throw hu.bytes=0,new RangeError("Could not decode varint");c=t[o++],r+=i<28?(c&kd)<<i:(c&kd)*Math.pow(2,i),i+=7}while(c>=my);return hu.bytes=o-n,r}var wy=Math.pow(2,7),vy=Math.pow(2,14),yy=Math.pow(2,21),by=Math.pow(2,28),_y=Math.pow(2,35),Ey=Math.pow(2,42),xy=Math.pow(2,49),Cy=Math.pow(2,56),Iy=Math.pow(2,63),Sy=function(t){return t<wy?1:t<vy?2:t<yy?3:t<by?4:t<_y?5:t<Ey?6:t<xy?7:t<Cy?8:t<Iy?9:10},Ay={encode:hy,decode:gy,encodingLength:Sy},Hd=Ay;const zd=(t,e,r=0)=>(Hd.encode(t,e,r),e),Wd=t=>Hd.encodingLength(t),fu=(t,e)=>{const r=e.byteLength,n=Wd(t),i=n+Wd(r),o=new Uint8Array(i+r);return zd(t,o,0),zd(r,o,n),o.set(e,i),new Oy(t,r,e,o)};class Oy{constructor(e,r,n,i){this.code=e,this.size=r,this.digest=n,this.bytes=i}}const qd=({name:t,code:e,encode:r})=>new Dy(t,e,r);class Dy{constructor(e,r,n){this.name=e,this.code=r,this.encode=n}digest(e){if(e instanceof Uint8Array){const r=this.encode(e);return r instanceof Uint8Array?fu(this.code,r):r.then(n=>fu(this.code,n))}else throw Error("Unknown type, must be binary type")}}const Vd=t=>async e=>new Uint8Array(await crypto.subtle.digest(t,e)),$y=qd({name:"sha2-256",code:18,encode:Vd("SHA-256")}),Py=qd({name:"sha2-512",code:19,encode:Vd("SHA-512")});var Ty=Object.freeze({__proto__:null,sha256:$y,sha512:Py});const Kd=0,Ny="identity",Gd=Md;var Ry=Object.freeze({__proto__:null,identity:{code:Kd,name:Ny,encode:Gd,digest:t=>fu(Kd,Gd(t))}});new TextEncoder,new TextDecoder;const Zd={...Ov,...$v,...Tv,...Rv,...Uv,...Kv,...Yv,...Qv,...iy,...uy};({...Ty,...Ry});function Yd(t,e,r,n){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:r},decoder:{decode:n}}}const Jd=Yd("utf8","u",t=>"u"+new TextDecoder("utf8").decode(t),t=>new TextEncoder().encode(t.substring(1))),du=Yd("ascii","a",t=>{let e="a";for(let r=0;r<t.length;r++)e+=String.fromCharCode(t[r]);return e},t=>{t=t.substring(1);const e=Ld(t.length);for(let r=0;r<t.length;r++)e[r]=t.charCodeAt(r);return e}),Xd={utf8:Jd,"utf-8":Jd,hex:Zd.base16,latin1:du,ascii:du,binary:du,...Zd};function Hr(t,e="utf8"){const r=Xd[e];if(!r)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?lu(globalThis.Buffer.from(t,"utf-8")):r.decoder.decode(`${r.prefix}${t}`)}function Dr(t,e="utf8"){const r=Xd[e];if(!r)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(t.buffer,t.byteOffset,t.byteLength).toString("utf8"):r.encoder.encode(t).substring(1)}var Qd=function(t,e,r){if(r||arguments.length===2)for(var n=0,i=e.length,o;n<i;n++)(o||!(n in e))&&(o||(o=Array.prototype.slice.call(e,0,n)),o[n]=e[n]);return t.concat(o||Array.prototype.slice.call(e))},Ly=function(){function t(e,r,n){this.name=e,this.version=r,this.os=n,this.type="browser"}return t}(),My=function(){function t(e){this.version=e,this.type="node",this.name="node",this.os=process.platform}return t}(),Uy=function(){function t(e,r,n,i){this.name=e,this.version=r,this.os=n,this.bot=i,this.type="bot-device"}return t}(),jy=function(){function t(){this.type="bot",this.bot=!0,this.name="bot",this.version=null,this.os=null}return t}(),Fy=function(){function t(){this.type="react-native",this.name="react-native",this.version=null,this.os=null}return t}(),By=/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/,ky=/(nuhk|curl|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/,e1=3,Hy=[["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",By]],t1=[["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 zy(t){return t?r1(t):typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"?new Fy:typeof navigator<"u"?r1(navigator.userAgent):Vy()}function Wy(t){return t!==""&&Hy.reduce(function(e,r){var n=r[0],i=r[1];if(e)return e;var o=i.exec(t);return!!o&&[n,o]},!1)}function r1(t){var e=Wy(t);if(!e)return null;var r=e[0],n=e[1];if(r==="searchbot")return new jy;var i=n[1]&&n[1].split(".").join("_").split("_").slice(0,3);i?i.length<e1&&(i=Qd(Qd([],i,!0),Ky(e1-i.length),!0)):i=[];var o=i.join("."),c=qy(t),l=ky.exec(t);return l&&l[1]?new Uy(r,o,c,l[1]):new Ly(r,o,c)}function qy(t){for(var e=0,r=t1.length;e<r;e++){var n=t1[e],i=n[0],o=n[1],c=o.exec(t);if(c)return i}return null}function Vy(){var t=typeof process<"u"&&process.version;return t?new My(process.version.slice(1)):null}function Ky(t){for(var e=[],r=0;r<t;r++)e.push("0");return e}var Te={};/*! *****************************************************************************
1
+ (function(xn,gr){typeof exports=="object"&&typeof module<"u"?gr(exports):typeof define=="function"&&define.amd?define(["exports"],gr):(xn=typeof globalThis<"u"?globalThis:xn||self,gr(xn["@walletconnect/ethereum-provider"]={}))})(this,function(xn){"use strict";var gr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function lv(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function Ui(t){var e=t.default;if(typeof e=="function"){var r=function(){return e.apply(this,arguments)};r.prototype=e.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(t).forEach(function(n){var i=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(r,n,i.get?i:{enumerable:!0,get:function(){return t[n]}})}),r}var _r={exports:{}},Cs=typeof Reflect=="object"?Reflect:null,Id=Cs&&typeof Cs.apply=="function"?Cs.apply:function(e,r,n){return Function.prototype.apply.call(e,r,n)},za;Cs&&typeof Cs.ownKeys=="function"?za=Cs.ownKeys:Object.getOwnPropertySymbols?za=function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:za=function(e){return Object.getOwnPropertyNames(e)};function uv(t){console&&console.warn&&console.warn(t)}var Ad=Number.isNaN||function(e){return e!==e};function _t(){_t.init.call(this)}_r.exports=_t,_r.exports.once=pv,_t.EventEmitter=_t,_t.prototype._events=void 0,_t.prototype._eventsCount=0,_t.prototype._maxListeners=void 0;var $d=10;function Wa(t){if(typeof t!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}Object.defineProperty(_t,"defaultMaxListeners",{enumerable:!0,get:function(){return $d},set:function(t){if(typeof t!="number"||t<0||Ad(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");$d=t}}),_t.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},_t.prototype.setMaxListeners=function(e){if(typeof e!="number"||e<0||Ad(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 Od(t){return t._maxListeners===void 0?_t.defaultMaxListeners:t._maxListeners}_t.prototype.getMaxListeners=function(){return Od(this)},_t.prototype.emit=function(e){for(var r=[],n=1;n<arguments.length;n++)r.push(arguments[n]);var i=e==="error",o=this._events;if(o!==void 0)i=i&&o.error===void 0;else if(!i)return!1;if(i){var c;if(r.length>0&&(c=r[0]),c instanceof Error)throw c;var l=new Error("Unhandled error."+(c?" ("+c.message+")":""));throw l.context=c,l}var h=o[e];if(h===void 0)return!1;if(typeof h=="function")Id(h,this,r);else for(var d=h.length,v=Rd(h,d),n=0;n<d;++n)Id(v[n],this,r);return!0};function Sd(t,e,r,n){var i,o,c;if(Wa(r),o=t._events,o===void 0?(o=t._events=Object.create(null),t._eventsCount=0):(o.newListener!==void 0&&(t.emit("newListener",e,r.listener?r.listener:r),o=t._events),c=o[e]),c===void 0)c=o[e]=r,++t._eventsCount;else if(typeof c=="function"?c=o[e]=n?[r,c]:[c,r]:n?c.unshift(r):c.push(r),i=Od(t),i>0&&c.length>i&&!c.warned){c.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+c.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=t,l.type=e,l.count=c.length,uv(l)}return t}_t.prototype.addListener=function(e,r){return Sd(this,e,r,!1)},_t.prototype.on=_t.prototype.addListener,_t.prototype.prependListener=function(e,r){return Sd(this,e,r,!0)};function hv(){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 Dd(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},i=hv.bind(n);return i.listener=r,n.wrapFn=i,i}_t.prototype.once=function(e,r){return Wa(r),this.on(e,Dd(this,e,r)),this},_t.prototype.prependOnceListener=function(e,r){return Wa(r),this.prependListener(e,Dd(this,e,r)),this},_t.prototype.removeListener=function(e,r){var n,i,o,c,l;if(Wa(r),i=this._events,i===void 0)return this;if(n=i[e],n===void 0)return this;if(n===r||n.listener===r)--this._eventsCount===0?this._events=Object.create(null):(delete i[e],i.removeListener&&this.emit("removeListener",e,n.listener||r));else if(typeof n!="function"){for(o=-1,c=n.length-1;c>=0;c--)if(n[c]===r||n[c].listener===r){l=n[c].listener,o=c;break}if(o<0)return this;o===0?n.shift():fv(n,o),n.length===1&&(i[e]=n[0]),i.removeListener!==void 0&&this.emit("removeListener",e,l||r)}return this},_t.prototype.off=_t.prototype.removeListener,_t.prototype.removeAllListeners=function(e){var r,n,i;if(n=this._events,n===void 0)return this;if(n.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):n[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete n[e]),this;if(arguments.length===0){var o=Object.keys(n),c;for(i=0;i<o.length;++i)c=o[i],c!=="removeListener"&&this.removeAllListeners(c);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(r=n[e],typeof r=="function")this.removeListener(e,r);else if(r!==void 0)for(i=r.length-1;i>=0;i--)this.removeListener(e,r[i]);return this};function Pd(t,e,r){var n=t._events;if(n===void 0)return[];var i=n[e];return i===void 0?[]:typeof i=="function"?r?[i.listener||i]:[i]:r?dv(i):Rd(i,i.length)}_t.prototype.listeners=function(e){return Pd(this,e,!0)},_t.prototype.rawListeners=function(e){return Pd(this,e,!1)},_t.listenerCount=function(t,e){return typeof t.listenerCount=="function"?t.listenerCount(e):Td.call(t,e)},_t.prototype.listenerCount=Td;function Td(t){var e=this._events;if(e!==void 0){var r=e[t];if(typeof r=="function")return 1;if(r!==void 0)return r.length}return 0}_t.prototype.eventNames=function(){return this._eventsCount>0?za(this._events):[]};function Rd(t,e){for(var r=new Array(e),n=0;n<e;++n)r[n]=t[n];return r}function fv(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}function dv(t){for(var e=new Array(t.length),r=0;r<e.length;++r)e[r]=t[r].listener||t[r];return e}function pv(t,e){return new Promise(function(r,n){function i(c){t.removeListener(e,o),n(c)}function o(){typeof t.removeListener=="function"&&t.removeListener("error",i),r([].slice.call(arguments))}Nd(t,e,o,{once:!0}),e!=="error"&&gv(t,i,{once:!0})})}function gv(t,e,r){typeof t.on=="function"&&Nd(t,"error",e,r)}function Nd(t,e,r,n){if(typeof t.on=="function")n.once?t.once(e,r):t.on(e,r);else if(typeof t.addEventListener=="function")t.addEventListener(e,function i(o){n.once&&t.removeEventListener(e,i),r(o)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof t)}var uu={},qa={},et={},Fd={};(function(t){Object.defineProperty(t,"__esModule",{value:!0});function e(l,h){var d=l>>>16&65535,v=l&65535,x=h>>>16&65535,_=h&65535;return v*_+(d*_+v*x<<16>>>0)|0}t.mul=Math.imul||e;function r(l,h){return l+h|0}t.add=r;function n(l,h){return l-h|0}t.sub=n;function i(l,h){return l<<h|l>>>32-h}t.rotl=i;function o(l,h){return l<<32-h|l>>>h}t.rotr=o;function c(l){return typeof l=="number"&&isFinite(l)&&Math.floor(l)===l}t.isInteger=Number.isInteger||c,t.MAX_SAFE_INTEGER=9007199254740991,t.isSafeInteger=function(l){return t.isInteger(l)&&l>=-t.MAX_SAFE_INTEGER&&l<=t.MAX_SAFE_INTEGER}})(Fd),Object.defineProperty(et,"__esModule",{value:!0});var Ld=Fd;function mv(t,e){return e===void 0&&(e=0),(t[e+0]<<8|t[e+1])<<16>>16}et.readInt16BE=mv;function wv(t,e){return e===void 0&&(e=0),(t[e+0]<<8|t[e+1])>>>0}et.readUint16BE=wv;function vv(t,e){return e===void 0&&(e=0),(t[e+1]<<8|t[e])<<16>>16}et.readInt16LE=vv;function yv(t,e){return e===void 0&&(e=0),(t[e+1]<<8|t[e])>>>0}et.readUint16LE=yv;function Md(t,e,r){return e===void 0&&(e=new Uint8Array(2)),r===void 0&&(r=0),e[r+0]=t>>>8,e[r+1]=t>>>0,e}et.writeUint16BE=Md,et.writeInt16BE=Md;function Ud(t,e,r){return e===void 0&&(e=new Uint8Array(2)),r===void 0&&(r=0),e[r+0]=t>>>0,e[r+1]=t>>>8,e}et.writeUint16LE=Ud,et.writeInt16LE=Ud;function hu(t,e){return e===void 0&&(e=0),t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3]}et.readInt32BE=hu;function fu(t,e){return e===void 0&&(e=0),(t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3])>>>0}et.readUint32BE=fu;function du(t,e){return e===void 0&&(e=0),t[e+3]<<24|t[e+2]<<16|t[e+1]<<8|t[e]}et.readInt32LE=du;function pu(t,e){return e===void 0&&(e=0),(t[e+3]<<24|t[e+2]<<16|t[e+1]<<8|t[e])>>>0}et.readUint32LE=pu;function Va(t,e,r){return e===void 0&&(e=new Uint8Array(4)),r===void 0&&(r=0),e[r+0]=t>>>24,e[r+1]=t>>>16,e[r+2]=t>>>8,e[r+3]=t>>>0,e}et.writeUint32BE=Va,et.writeInt32BE=Va;function Ka(t,e,r){return e===void 0&&(e=new Uint8Array(4)),r===void 0&&(r=0),e[r+0]=t>>>0,e[r+1]=t>>>8,e[r+2]=t>>>16,e[r+3]=t>>>24,e}et.writeUint32LE=Ka,et.writeInt32LE=Ka;function bv(t,e){e===void 0&&(e=0);var r=hu(t,e),n=hu(t,e+4);return r*4294967296+n-(n>>31)*4294967296}et.readInt64BE=bv;function _v(t,e){e===void 0&&(e=0);var r=fu(t,e),n=fu(t,e+4);return r*4294967296+n}et.readUint64BE=_v;function Ev(t,e){e===void 0&&(e=0);var r=du(t,e),n=du(t,e+4);return n*4294967296+r-(r>>31)*4294967296}et.readInt64LE=Ev;function xv(t,e){e===void 0&&(e=0);var r=pu(t,e),n=pu(t,e+4);return n*4294967296+r}et.readUint64LE=xv;function jd(t,e,r){return e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0),Va(t/4294967296>>>0,e,r),Va(t>>>0,e,r+4),e}et.writeUint64BE=jd,et.writeInt64BE=jd;function Bd(t,e,r){return e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0),Ka(t>>>0,e,r),Ka(t/4294967296>>>0,e,r+4),e}et.writeUint64LE=Bd,et.writeInt64LE=Bd;function Cv(t,e,r){if(r===void 0&&(r=0),t%8!==0)throw new Error("readUintBE supports only bitLengths divisible by 8");if(t/8>e.length-r)throw new Error("readUintBE: array is too short for the given bitLength");for(var n=0,i=1,o=t/8+r-1;o>=r;o--)n+=e[o]*i,i*=256;return n}et.readUintBE=Cv;function Iv(t,e,r){if(r===void 0&&(r=0),t%8!==0)throw new Error("readUintLE supports only bitLengths divisible by 8");if(t/8>e.length-r)throw new Error("readUintLE: array is too short for the given bitLength");for(var n=0,i=1,o=r;o<r+t/8;o++)n+=e[o]*i,i*=256;return n}et.readUintLE=Iv;function Av(t,e,r,n){if(r===void 0&&(r=new Uint8Array(t/8)),n===void 0&&(n=0),t%8!==0)throw new Error("writeUintBE supports only bitLengths divisible by 8");if(!Ld.isSafeInteger(e))throw new Error("writeUintBE value must be an integer");for(var i=1,o=t/8+n-1;o>=n;o--)r[o]=e/i&255,i*=256;return r}et.writeUintBE=Av;function $v(t,e,r,n){if(r===void 0&&(r=new Uint8Array(t/8)),n===void 0&&(n=0),t%8!==0)throw new Error("writeUintLE supports only bitLengths divisible by 8");if(!Ld.isSafeInteger(e))throw new Error("writeUintLE value must be an integer");for(var i=1,o=n;o<n+t/8;o++)r[o]=e/i&255,i*=256;return r}et.writeUintLE=$v;function Ov(t,e){e===void 0&&(e=0);var r=new DataView(t.buffer,t.byteOffset,t.byteLength);return r.getFloat32(e)}et.readFloat32BE=Ov;function Sv(t,e){e===void 0&&(e=0);var r=new DataView(t.buffer,t.byteOffset,t.byteLength);return r.getFloat32(e,!0)}et.readFloat32LE=Sv;function Dv(t,e){e===void 0&&(e=0);var r=new DataView(t.buffer,t.byteOffset,t.byteLength);return r.getFloat64(e)}et.readFloat64BE=Dv;function Pv(t,e){e===void 0&&(e=0);var r=new DataView(t.buffer,t.byteOffset,t.byteLength);return r.getFloat64(e,!0)}et.readFloat64LE=Pv;function Tv(t,e,r){e===void 0&&(e=new Uint8Array(4)),r===void 0&&(r=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.setFloat32(r,t),e}et.writeFloat32BE=Tv;function Rv(t,e,r){e===void 0&&(e=new Uint8Array(4)),r===void 0&&(r=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.setFloat32(r,t,!0),e}et.writeFloat32LE=Rv;function Nv(t,e,r){e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.setFloat64(r,t),e}et.writeFloat64BE=Nv;function Fv(t,e,r){e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.setFloat64(r,t,!0),e}et.writeFloat64LE=Fv;var Yr={};Object.defineProperty(Yr,"__esModule",{value:!0});function Lv(t){for(var e=0;e<t.length;e++)t[e]=0;return t}Yr.wipe=Lv,Object.defineProperty(qa,"__esModule",{value:!0});var $r=et,gu=Yr,Mv=20;function Uv(t,e,r){for(var n=1634760805,i=857760878,o=2036477234,c=1797285236,l=r[3]<<24|r[2]<<16|r[1]<<8|r[0],h=r[7]<<24|r[6]<<16|r[5]<<8|r[4],d=r[11]<<24|r[10]<<16|r[9]<<8|r[8],v=r[15]<<24|r[14]<<16|r[13]<<8|r[12],x=r[19]<<24|r[18]<<16|r[17]<<8|r[16],_=r[23]<<24|r[22]<<16|r[21]<<8|r[20],A=r[27]<<24|r[26]<<16|r[25]<<8|r[24],P=r[31]<<24|r[30]<<16|r[29]<<8|r[28],L=e[3]<<24|e[2]<<16|e[1]<<8|e[0],k=e[7]<<24|e[6]<<16|e[5]<<8|e[4],q=e[11]<<24|e[10]<<16|e[9]<<8|e[8],R=e[15]<<24|e[14]<<16|e[13]<<8|e[12],F=n,$=i,T=o,C=c,f=l,E=h,Z=d,z=v,ee=x,de=_,me=A,O=P,U=L,ce=k,le=q,re=R,ne=0;ne<Mv;ne+=2)F=F+f|0,U^=F,U=U>>>32-16|U<<16,ee=ee+U|0,f^=ee,f=f>>>32-12|f<<12,$=$+E|0,ce^=$,ce=ce>>>32-16|ce<<16,de=de+ce|0,E^=de,E=E>>>32-12|E<<12,T=T+Z|0,le^=T,le=le>>>32-16|le<<16,me=me+le|0,Z^=me,Z=Z>>>32-12|Z<<12,C=C+z|0,re^=C,re=re>>>32-16|re<<16,O=O+re|0,z^=O,z=z>>>32-12|z<<12,T=T+Z|0,le^=T,le=le>>>32-8|le<<8,me=me+le|0,Z^=me,Z=Z>>>32-7|Z<<7,C=C+z|0,re^=C,re=re>>>32-8|re<<8,O=O+re|0,z^=O,z=z>>>32-7|z<<7,$=$+E|0,ce^=$,ce=ce>>>32-8|ce<<8,de=de+ce|0,E^=de,E=E>>>32-7|E<<7,F=F+f|0,U^=F,U=U>>>32-8|U<<8,ee=ee+U|0,f^=ee,f=f>>>32-7|f<<7,F=F+E|0,re^=F,re=re>>>32-16|re<<16,me=me+re|0,E^=me,E=E>>>32-12|E<<12,$=$+Z|0,U^=$,U=U>>>32-16|U<<16,O=O+U|0,Z^=O,Z=Z>>>32-12|Z<<12,T=T+z|0,ce^=T,ce=ce>>>32-16|ce<<16,ee=ee+ce|0,z^=ee,z=z>>>32-12|z<<12,C=C+f|0,le^=C,le=le>>>32-16|le<<16,de=de+le|0,f^=de,f=f>>>32-12|f<<12,T=T+z|0,ce^=T,ce=ce>>>32-8|ce<<8,ee=ee+ce|0,z^=ee,z=z>>>32-7|z<<7,C=C+f|0,le^=C,le=le>>>32-8|le<<8,de=de+le|0,f^=de,f=f>>>32-7|f<<7,$=$+Z|0,U^=$,U=U>>>32-8|U<<8,O=O+U|0,Z^=O,Z=Z>>>32-7|Z<<7,F=F+E|0,re^=F,re=re>>>32-8|re<<8,me=me+re|0,E^=me,E=E>>>32-7|E<<7;$r.writeUint32LE(F+n|0,t,0),$r.writeUint32LE($+i|0,t,4),$r.writeUint32LE(T+o|0,t,8),$r.writeUint32LE(C+c|0,t,12),$r.writeUint32LE(f+l|0,t,16),$r.writeUint32LE(E+h|0,t,20),$r.writeUint32LE(Z+d|0,t,24),$r.writeUint32LE(z+v|0,t,28),$r.writeUint32LE(ee+x|0,t,32),$r.writeUint32LE(de+_|0,t,36),$r.writeUint32LE(me+A|0,t,40),$r.writeUint32LE(O+P|0,t,44),$r.writeUint32LE(U+L|0,t,48),$r.writeUint32LE(ce+k|0,t,52),$r.writeUint32LE(le+q|0,t,56),$r.writeUint32LE(re+R|0,t,60)}function kd(t,e,r,n,i){if(i===void 0&&(i=0),t.length!==32)throw new Error("ChaCha: key size must be 32 bytes");if(n.length<r.length)throw new Error("ChaCha: destination is shorter than source");var o,c;if(i===0){if(e.length!==8&&e.length!==12)throw new Error("ChaCha nonce must be 8 or 12 bytes");o=new Uint8Array(16),c=o.length-e.length,o.set(e,c)}else{if(e.length!==16)throw new Error("ChaCha nonce with counter must be 16 bytes");o=e,c=i}for(var l=new Uint8Array(64),h=0;h<r.length;h+=64){Uv(l,o,t);for(var d=h;d<h+64&&d<r.length;d++)n[d]=r[d]^l[d-h];Bv(o,0,c)}return gu.wipe(l),i===0&&gu.wipe(o),n}qa.streamXOR=kd;function jv(t,e,r,n){return n===void 0&&(n=0),gu.wipe(r),kd(t,e,r,r,n)}qa.stream=jv;function Bv(t,e,r){for(var n=1;r--;)n=n+(t[e]&255)|0,t[e]=n&255,n>>>=8,e++;if(n>0)throw new Error("ChaCha: counter overflow")}var Hd={},hi={};Object.defineProperty(hi,"__esModule",{value:!0});function kv(t,e,r){return~(t-1)&e|t-1&r}hi.select=kv;function Hv(t,e){return(t|0)-(e|0)-1>>>31&1}hi.lessOrEqual=Hv;function zd(t,e){if(t.length!==e.length)return 0;for(var r=0,n=0;n<t.length;n++)r|=t[n]^e[n];return 1&r-1>>>8}hi.compare=zd;function zv(t,e){return t.length===0||e.length===0?!1:zd(t,e)!==0}hi.equal=zv,function(t){Object.defineProperty(t,"__esModule",{value:!0});var e=hi,r=Yr;t.DIGEST_LENGTH=16;var n=function(){function c(l){this.digestLength=t.DIGEST_LENGTH,this._buffer=new Uint8Array(16),this._r=new Uint16Array(10),this._h=new Uint16Array(10),this._pad=new Uint16Array(8),this._leftover=0,this._fin=0,this._finished=!1;var h=l[0]|l[1]<<8;this._r[0]=h&8191;var d=l[2]|l[3]<<8;this._r[1]=(h>>>13|d<<3)&8191;var v=l[4]|l[5]<<8;this._r[2]=(d>>>10|v<<6)&7939;var x=l[6]|l[7]<<8;this._r[3]=(v>>>7|x<<9)&8191;var _=l[8]|l[9]<<8;this._r[4]=(x>>>4|_<<12)&255,this._r[5]=_>>>1&8190;var A=l[10]|l[11]<<8;this._r[6]=(_>>>14|A<<2)&8191;var P=l[12]|l[13]<<8;this._r[7]=(A>>>11|P<<5)&8065;var L=l[14]|l[15]<<8;this._r[8]=(P>>>8|L<<8)&8191,this._r[9]=L>>>5&127,this._pad[0]=l[16]|l[17]<<8,this._pad[1]=l[18]|l[19]<<8,this._pad[2]=l[20]|l[21]<<8,this._pad[3]=l[22]|l[23]<<8,this._pad[4]=l[24]|l[25]<<8,this._pad[5]=l[26]|l[27]<<8,this._pad[6]=l[28]|l[29]<<8,this._pad[7]=l[30]|l[31]<<8}return c.prototype._blocks=function(l,h,d){for(var v=this._fin?0:2048,x=this._h[0],_=this._h[1],A=this._h[2],P=this._h[3],L=this._h[4],k=this._h[5],q=this._h[6],R=this._h[7],F=this._h[8],$=this._h[9],T=this._r[0],C=this._r[1],f=this._r[2],E=this._r[3],Z=this._r[4],z=this._r[5],ee=this._r[6],de=this._r[7],me=this._r[8],O=this._r[9];d>=16;){var U=l[h+0]|l[h+1]<<8;x+=U&8191;var ce=l[h+2]|l[h+3]<<8;_+=(U>>>13|ce<<3)&8191;var le=l[h+4]|l[h+5]<<8;A+=(ce>>>10|le<<6)&8191;var re=l[h+6]|l[h+7]<<8;P+=(le>>>7|re<<9)&8191;var ne=l[h+8]|l[h+9]<<8;L+=(re>>>4|ne<<12)&8191,k+=ne>>>1&8191;var ae=l[h+10]|l[h+11]<<8;q+=(ne>>>14|ae<<2)&8191;var ie=l[h+12]|l[h+13]<<8;R+=(ae>>>11|ie<<5)&8191;var Oe=l[h+14]|l[h+15]<<8;F+=(ie>>>8|Oe<<8)&8191,$+=Oe>>>5|v;var ge=0,Be=ge;Be+=x*T,Be+=_*(5*O),Be+=A*(5*me),Be+=P*(5*de),Be+=L*(5*ee),ge=Be>>>13,Be&=8191,Be+=k*(5*z),Be+=q*(5*Z),Be+=R*(5*E),Be+=F*(5*f),Be+=$*(5*C),ge+=Be>>>13,Be&=8191;var ye=ge;ye+=x*C,ye+=_*T,ye+=A*(5*O),ye+=P*(5*me),ye+=L*(5*de),ge=ye>>>13,ye&=8191,ye+=k*(5*ee),ye+=q*(5*z),ye+=R*(5*Z),ye+=F*(5*E),ye+=$*(5*f),ge+=ye>>>13,ye&=8191;var Le=ge;Le+=x*f,Le+=_*C,Le+=A*T,Le+=P*(5*O),Le+=L*(5*me),ge=Le>>>13,Le&=8191,Le+=k*(5*de),Le+=q*(5*ee),Le+=R*(5*z),Le+=F*(5*Z),Le+=$*(5*E),ge+=Le>>>13,Le&=8191;var X=ge;X+=x*E,X+=_*f,X+=A*C,X+=P*T,X+=L*(5*O),ge=X>>>13,X&=8191,X+=k*(5*me),X+=q*(5*de),X+=R*(5*ee),X+=F*(5*z),X+=$*(5*Z),ge+=X>>>13,X&=8191;var J=ge;J+=x*Z,J+=_*E,J+=A*f,J+=P*C,J+=L*T,ge=J>>>13,J&=8191,J+=k*(5*O),J+=q*(5*me),J+=R*(5*de),J+=F*(5*ee),J+=$*(5*z),ge+=J>>>13,J&=8191;var W=ge;W+=x*z,W+=_*Z,W+=A*E,W+=P*f,W+=L*C,ge=W>>>13,W&=8191,W+=k*T,W+=q*(5*O),W+=R*(5*me),W+=F*(5*de),W+=$*(5*ee),ge+=W>>>13,W&=8191;var w=ge;w+=x*ee,w+=_*z,w+=A*Z,w+=P*E,w+=L*f,ge=w>>>13,w&=8191,w+=k*C,w+=q*T,w+=R*(5*O),w+=F*(5*me),w+=$*(5*de),ge+=w>>>13,w&=8191;var j=ge;j+=x*de,j+=_*ee,j+=A*z,j+=P*Z,j+=L*E,ge=j>>>13,j&=8191,j+=k*f,j+=q*C,j+=R*T,j+=F*(5*O),j+=$*(5*me),ge+=j>>>13,j&=8191;var we=ge;we+=x*me,we+=_*de,we+=A*ee,we+=P*z,we+=L*Z,ge=we>>>13,we&=8191,we+=k*E,we+=q*f,we+=R*C,we+=F*T,we+=$*(5*O),ge+=we>>>13,we&=8191;var ve=ge;ve+=x*O,ve+=_*me,ve+=A*de,ve+=P*ee,ve+=L*z,ge=ve>>>13,ve&=8191,ve+=k*Z,ve+=q*E,ve+=R*f,ve+=F*C,ve+=$*T,ge+=ve>>>13,ve&=8191,ge=(ge<<2)+ge|0,ge=ge+Be|0,Be=ge&8191,ge=ge>>>13,ye+=ge,x=Be,_=ye,A=Le,P=X,L=J,k=W,q=w,R=j,F=we,$=ve,h+=16,d-=16}this._h[0]=x,this._h[1]=_,this._h[2]=A,this._h[3]=P,this._h[4]=L,this._h[5]=k,this._h[6]=q,this._h[7]=R,this._h[8]=F,this._h[9]=$},c.prototype.finish=function(l,h){h===void 0&&(h=0);var d=new Uint16Array(10),v,x,_,A;if(this._leftover){for(A=this._leftover,this._buffer[A++]=1;A<16;A++)this._buffer[A]=0;this._fin=1,this._blocks(this._buffer,0,16)}for(v=this._h[1]>>>13,this._h[1]&=8191,A=2;A<10;A++)this._h[A]+=v,v=this._h[A]>>>13,this._h[A]&=8191;for(this._h[0]+=v*5,v=this._h[0]>>>13,this._h[0]&=8191,this._h[1]+=v,v=this._h[1]>>>13,this._h[1]&=8191,this._h[2]+=v,d[0]=this._h[0]+5,v=d[0]>>>13,d[0]&=8191,A=1;A<10;A++)d[A]=this._h[A]+v,v=d[A]>>>13,d[A]&=8191;for(d[9]-=8192,x=(v^1)-1,A=0;A<10;A++)d[A]&=x;for(x=~x,A=0;A<10;A++)this._h[A]=this._h[A]&x|d[A];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,_=this._h[0]+this._pad[0],this._h[0]=_&65535,A=1;A<8;A++)_=(this._h[A]+this._pad[A]|0)+(_>>>16)|0,this._h[A]=_&65535;return l[h+0]=this._h[0]>>>0,l[h+1]=this._h[0]>>>8,l[h+2]=this._h[1]>>>0,l[h+3]=this._h[1]>>>8,l[h+4]=this._h[2]>>>0,l[h+5]=this._h[2]>>>8,l[h+6]=this._h[3]>>>0,l[h+7]=this._h[3]>>>8,l[h+8]=this._h[4]>>>0,l[h+9]=this._h[4]>>>8,l[h+10]=this._h[5]>>>0,l[h+11]=this._h[5]>>>8,l[h+12]=this._h[6]>>>0,l[h+13]=this._h[6]>>>8,l[h+14]=this._h[7]>>>0,l[h+15]=this._h[7]>>>8,this._finished=!0,this},c.prototype.update=function(l){var h=0,d=l.length,v;if(this._leftover){v=16-this._leftover,v>d&&(v=d);for(var x=0;x<v;x++)this._buffer[this._leftover+x]=l[h+x];if(d-=v,h+=v,this._leftover+=v,this._leftover<16)return this;this._blocks(this._buffer,0,16),this._leftover=0}if(d>=16&&(v=d-d%16,this._blocks(l,h,v),h+=v,d-=v),d){for(var x=0;x<d;x++)this._buffer[this._leftover+x]=l[h+x];this._leftover+=d}return this},c.prototype.digest=function(){if(this._finished)throw new Error("Poly1305 was finished");var l=new Uint8Array(16);return this.finish(l),l},c.prototype.clean=function(){return r.wipe(this._buffer),r.wipe(this._r),r.wipe(this._h),r.wipe(this._pad),this._leftover=0,this._fin=0,this._finished=!0,this},c}();t.Poly1305=n;function i(c,l){var h=new n(c);h.update(l);var d=h.digest();return h.clean(),d}t.oneTimeAuth=i;function o(c,l){return c.length!==t.DIGEST_LENGTH||l.length!==t.DIGEST_LENGTH?!1:e.equal(c,l)}t.equal=o}(Hd),function(t){Object.defineProperty(t,"__esModule",{value:!0});var e=qa,r=Hd,n=Yr,i=et,o=hi;t.KEY_LENGTH=32,t.NONCE_LENGTH=12,t.TAG_LENGTH=16;var c=new Uint8Array(16),l=function(){function h(d){if(this.nonceLength=t.NONCE_LENGTH,this.tagLength=t.TAG_LENGTH,d.length!==t.KEY_LENGTH)throw new Error("ChaCha20Poly1305 needs 32-byte key");this._key=new Uint8Array(d)}return h.prototype.seal=function(d,v,x,_){if(d.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");var A=new Uint8Array(16);A.set(d,A.length-d.length);var P=new Uint8Array(32);e.stream(this._key,A,P,4);var L=v.length+this.tagLength,k;if(_){if(_.length!==L)throw new Error("ChaCha20Poly1305: incorrect destination length");k=_}else k=new Uint8Array(L);return e.streamXOR(this._key,A,v,k,4),this._authenticate(k.subarray(k.length-this.tagLength,k.length),P,k.subarray(0,k.length-this.tagLength),x),n.wipe(A),k},h.prototype.open=function(d,v,x,_){if(d.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");if(v.length<this.tagLength)return null;var A=new Uint8Array(16);A.set(d,A.length-d.length);var P=new Uint8Array(32);e.stream(this._key,A,P,4);var L=new Uint8Array(this.tagLength);if(this._authenticate(L,P,v.subarray(0,v.length-this.tagLength),x),!o.equal(L,v.subarray(v.length-this.tagLength,v.length)))return null;var k=v.length-this.tagLength,q;if(_){if(_.length!==k)throw new Error("ChaCha20Poly1305: incorrect destination length");q=_}else q=new Uint8Array(k);return e.streamXOR(this._key,A,v.subarray(0,v.length-this.tagLength),q,4),n.wipe(A),q},h.prototype.clean=function(){return n.wipe(this._key),this},h.prototype._authenticate=function(d,v,x,_){var A=new r.Poly1305(v);_&&(A.update(_),_.length%16>0&&A.update(c.subarray(_.length%16))),A.update(x),x.length%16>0&&A.update(c.subarray(x.length%16));var P=new Uint8Array(8);_&&i.writeUint64LE(_.length,P),A.update(P),i.writeUint64LE(x.length,P),A.update(P);for(var L=A.digest(),k=0;k<L.length;k++)d[k]=L[k];A.clean(),n.wipe(L),n.wipe(P)},h}();t.ChaCha20Poly1305=l}(uu);var Wd={},xo={},mu={};Object.defineProperty(mu,"__esModule",{value:!0});function Wv(t){return typeof t.saveState<"u"&&typeof t.restoreState<"u"&&typeof t.cleanSavedState<"u"}mu.isSerializableHash=Wv,Object.defineProperty(xo,"__esModule",{value:!0});var Tn=mu,qv=hi,Vv=Yr,qd=function(){function t(e,r){this._finished=!1,this._inner=new e,this._outer=new e,this.blockSize=this._outer.blockSize,this.digestLength=this._outer.digestLength;var n=new Uint8Array(this.blockSize);r.length>this.blockSize?this._inner.update(r).finish(n).clean():n.set(r);for(var i=0;i<n.length;i++)n[i]^=54;this._inner.update(n);for(var i=0;i<n.length;i++)n[i]^=106;this._outer.update(n),Tn.isSerializableHash(this._inner)&&Tn.isSerializableHash(this._outer)&&(this._innerKeyedState=this._inner.saveState(),this._outerKeyedState=this._outer.saveState()),Vv.wipe(n)}return t.prototype.reset=function(){if(!Tn.isSerializableHash(this._inner)||!Tn.isSerializableHash(this._outer))throw new Error("hmac: can't reset() because hash doesn't implement restoreState()");return this._inner.restoreState(this._innerKeyedState),this._outer.restoreState(this._outerKeyedState),this._finished=!1,this},t.prototype.clean=function(){Tn.isSerializableHash(this._inner)&&this._inner.cleanSavedState(this._innerKeyedState),Tn.isSerializableHash(this._outer)&&this._outer.cleanSavedState(this._outerKeyedState),this._inner.clean(),this._outer.clean()},t.prototype.update=function(e){return this._inner.update(e),this},t.prototype.finish=function(e){return this._finished?(this._outer.finish(e),this):(this._inner.finish(e),this._outer.update(e.subarray(0,this.digestLength)).finish(e),this._finished=!0,this)},t.prototype.digest=function(){var e=new Uint8Array(this.digestLength);return this.finish(e),e},t.prototype.saveState=function(){if(!Tn.isSerializableHash(this._inner))throw new Error("hmac: can't saveState() because hash doesn't implement it");return this._inner.saveState()},t.prototype.restoreState=function(e){if(!Tn.isSerializableHash(this._inner)||!Tn.isSerializableHash(this._outer))throw new Error("hmac: can't restoreState() because hash doesn't implement it");return this._inner.restoreState(e),this._outer.restoreState(this._outerKeyedState),this._finished=!1,this},t.prototype.cleanSavedState=function(e){if(!Tn.isSerializableHash(this._inner))throw new Error("hmac: can't cleanSavedState() because hash doesn't implement it");this._inner.cleanSavedState(e)},t}();xo.HMAC=qd;function Kv(t,e,r){var n=new qd(t,e);n.update(r);var i=n.digest();return n.clean(),i}xo.hmac=Kv,xo.equal=qv.equal,Object.defineProperty(Wd,"__esModule",{value:!0});var Vd=xo,Kd=Yr,Gv=function(){function t(e,r,n,i){n===void 0&&(n=new Uint8Array(0)),this._counter=new Uint8Array(1),this._hash=e,this._info=i;var o=Vd.hmac(this._hash,n,r);this._hmac=new Vd.HMAC(e,o),this._buffer=new Uint8Array(this._hmac.digestLength),this._bufpos=this._buffer.length}return t.prototype._fillBuffer=function(){this._counter[0]++;var e=this._counter[0];if(e===0)throw new Error("hkdf: cannot expand more");this._hmac.reset(),e>1&&this._hmac.update(this._buffer),this._info&&this._hmac.update(this._info),this._hmac.update(this._counter),this._hmac.finish(this._buffer),this._bufpos=0},t.prototype.expand=function(e){for(var r=new Uint8Array(e),n=0;n<r.length;n++)this._bufpos===this._buffer.length&&this._fillBuffer(),r[n]=this._buffer[this._bufpos++];return r},t.prototype.clean=function(){this._hmac.clean(),Kd.wipe(this._buffer),Kd.wipe(this._counter),this._bufpos=0},t}(),Zv=Wd.HKDF=Gv,Is={},Ga={},Za={};Object.defineProperty(Za,"__esModule",{value:!0}),Za.BrowserRandomSource=void 0;const Gd=65536;class Yv{constructor(){this.isAvailable=!1,this.isInstantiated=!1;const e=typeof self<"u"?self.crypto||self.msCrypto:null;e&&e.getRandomValues!==void 0&&(this._crypto=e,this.isAvailable=!0,this.isInstantiated=!0)}randomBytes(e){if(!this.isAvailable||!this._crypto)throw new Error("Browser random byte generator is not available.");const r=new Uint8Array(e);for(let n=0;n<r.length;n+=Gd)this._crypto.getRandomValues(r.subarray(n,n+Math.min(r.length-n,Gd)));return r}}Za.BrowserRandomSource=Yv;function Jv(t){throw new Error('Could not dynamically require "'+t+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Ya={},Xv={},Qv=Object.freeze({__proto__:null,default:Xv}),ey=Ui(Qv);Object.defineProperty(Ya,"__esModule",{value:!0}),Ya.NodeRandomSource=void 0;const ty=Yr;class ry{constructor(){if(this.isAvailable=!1,this.isInstantiated=!1,typeof Jv<"u"){const e=ey;e&&e.randomBytes&&(this._crypto=e,this.isAvailable=!0,this.isInstantiated=!0)}}randomBytes(e){if(!this.isAvailable||!this._crypto)throw new Error("Node.js random byte generator is not available.");let r=this._crypto.randomBytes(e);if(r.length!==e)throw new Error("NodeRandomSource: got fewer bytes than requested");const n=new Uint8Array(e);for(let i=0;i<n.length;i++)n[i]=r[i];return(0,ty.wipe)(r),n}}Ya.NodeRandomSource=ry,Object.defineProperty(Ga,"__esModule",{value:!0}),Ga.SystemRandomSource=void 0;const ny=Za,iy=Ya;class sy{constructor(){if(this.isAvailable=!1,this.name="",this._source=new ny.BrowserRandomSource,this._source.isAvailable){this.isAvailable=!0,this.name="Browser";return}if(this._source=new iy.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)}}Ga.SystemRandomSource=sy,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.randomStringForEntropy=t.randomString=t.randomUint32=t.randomBytes=t.defaultRandomSource=void 0;const e=Ga,r=et,n=Yr;t.defaultRandomSource=new e.SystemRandomSource;function i(d,v=t.defaultRandomSource){return v.randomBytes(d)}t.randomBytes=i;function o(d=t.defaultRandomSource){const v=i(4,d),x=(0,r.readUint32LE)(v);return(0,n.wipe)(v),x}t.randomUint32=o;const c="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";function l(d,v=c,x=t.defaultRandomSource){if(v.length<2)throw new Error("randomString charset is too short");if(v.length>256)throw new Error("randomString charset is too long");let _="";const A=v.length,P=256-256%A;for(;d>0;){const L=i(Math.ceil(d*256/P),x);for(let k=0;k<L.length&&d>0;k++){const q=L[k];q<P&&(_+=v.charAt(q%A),d--)}(0,n.wipe)(L)}return _}t.randomString=l;function h(d,v=c,x=t.defaultRandomSource){const _=Math.ceil(d/(Math.log(v.length)/Math.LN2));return l(_,v,x)}t.randomStringForEntropy=h}(Is);var Ja={};(function(t){Object.defineProperty(t,"__esModule",{value:!0});var e=et,r=Yr;t.DIGEST_LENGTH=32,t.BLOCK_SIZE=64;var n=function(){function l(){this.digestLength=t.DIGEST_LENGTH,this.blockSize=t.BLOCK_SIZE,this._state=new Int32Array(8),this._temp=new Int32Array(64),this._buffer=new Uint8Array(128),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this.reset()}return l.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},l.prototype.reset=function(){return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this},l.prototype.clean=function(){r.wipe(this._buffer),r.wipe(this._temp),this.reset()},l.prototype.update=function(h,d){if(d===void 0&&(d=h.length),this._finished)throw new Error("SHA256: can't update because hash was finished.");var v=0;if(this._bytesHashed+=d,this._bufferLength>0){for(;this._bufferLength<this.blockSize&&d>0;)this._buffer[this._bufferLength++]=h[v++],d--;this._bufferLength===this.blockSize&&(o(this._temp,this._state,this._buffer,0,this.blockSize),this._bufferLength=0)}for(d>=this.blockSize&&(v=o(this._temp,this._state,h,v,d),d%=this.blockSize);d>0;)this._buffer[this._bufferLength++]=h[v++],d--;return this},l.prototype.finish=function(h){if(!this._finished){var d=this._bytesHashed,v=this._bufferLength,x=d/536870912|0,_=d<<3,A=d%64<56?64:128;this._buffer[v]=128;for(var P=v+1;P<A-8;P++)this._buffer[P]=0;e.writeUint32BE(x,this._buffer,A-8),e.writeUint32BE(_,this._buffer,A-4),o(this._temp,this._state,this._buffer,0,A),this._finished=!0}for(var P=0;P<this.digestLength/4;P++)e.writeUint32BE(this._state[P],h,P*4);return this},l.prototype.digest=function(){var h=new Uint8Array(this.digestLength);return this.finish(h),h},l.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}},l.prototype.restoreState=function(h){return this._state.set(h.state),this._bufferLength=h.bufferLength,h.buffer&&this._buffer.set(h.buffer),this._bytesHashed=h.bytesHashed,this._finished=!1,this},l.prototype.cleanSavedState=function(h){r.wipe(h.state),h.buffer&&r.wipe(h.buffer),h.bufferLength=0,h.bytesHashed=0},l}();t.SHA256=n;var i=new Int32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]);function o(l,h,d,v,x){for(;x>=64;){for(var _=h[0],A=h[1],P=h[2],L=h[3],k=h[4],q=h[5],R=h[6],F=h[7],$=0;$<16;$++){var T=v+$*4;l[$]=e.readUint32BE(d,T)}for(var $=16;$<64;$++){var C=l[$-2],f=(C>>>17|C<<32-17)^(C>>>19|C<<32-19)^C>>>10;C=l[$-15];var E=(C>>>7|C<<32-7)^(C>>>18|C<<32-18)^C>>>3;l[$]=(f+l[$-7]|0)+(E+l[$-16]|0)}for(var $=0;$<64;$++){var f=(((k>>>6|k<<26)^(k>>>11|k<<21)^(k>>>25|k<<7))+(k&q^~k&R)|0)+(F+(i[$]+l[$]|0)|0)|0,E=((_>>>2|_<<32-2)^(_>>>13|_<<32-13)^(_>>>22|_<<32-22))+(_&A^_&P^A&P)|0;F=R,R=q,q=k,k=L+f|0,L=P,P=A,A=_,_=f+E|0}h[0]+=_,h[1]+=A,h[2]+=P,h[3]+=L,h[4]+=k,h[5]+=q,h[6]+=R,h[7]+=F,v+=64,x-=64}return v}function c(l){var h=new n;h.update(l);var d=h.digest();return h.clean(),d}t.hash=c})(Ja);var wu={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.sharedKey=t.generateKeyPair=t.generateKeyPairFromSeed=t.scalarMultBase=t.scalarMult=t.SHARED_KEY_LENGTH=t.SECRET_KEY_LENGTH=t.PUBLIC_KEY_LENGTH=void 0;const e=Is,r=Yr;t.PUBLIC_KEY_LENGTH=32,t.SECRET_KEY_LENGTH=32,t.SHARED_KEY_LENGTH=32;function n($){const T=new Float64Array(16);if($)for(let C=0;C<$.length;C++)T[C]=$[C];return T}const i=new Uint8Array(32);i[0]=9;const o=n([56129,1]);function c($){let T=1;for(let C=0;C<16;C++){let f=$[C]+T+65535;T=Math.floor(f/65536),$[C]=f-T*65536}$[0]+=T-1+37*(T-1)}function l($,T,C){const f=~(C-1);for(let E=0;E<16;E++){const Z=f&($[E]^T[E]);$[E]^=Z,T[E]^=Z}}function h($,T){const C=n(),f=n();for(let E=0;E<16;E++)f[E]=T[E];c(f),c(f),c(f);for(let E=0;E<2;E++){C[0]=f[0]-65517;for(let z=1;z<15;z++)C[z]=f[z]-65535-(C[z-1]>>16&1),C[z-1]&=65535;C[15]=f[15]-32767-(C[14]>>16&1);const Z=C[15]>>16&1;C[14]&=65535,l(f,C,1-Z)}for(let E=0;E<16;E++)$[2*E]=f[E]&255,$[2*E+1]=f[E]>>8}function d($,T){for(let C=0;C<16;C++)$[C]=T[2*C]+(T[2*C+1]<<8);$[15]&=32767}function v($,T,C){for(let f=0;f<16;f++)$[f]=T[f]+C[f]}function x($,T,C){for(let f=0;f<16;f++)$[f]=T[f]-C[f]}function _($,T,C){let f,E,Z=0,z=0,ee=0,de=0,me=0,O=0,U=0,ce=0,le=0,re=0,ne=0,ae=0,ie=0,Oe=0,ge=0,Be=0,ye=0,Le=0,X=0,J=0,W=0,w=0,j=0,we=0,ve=0,Me=0,nt=0,at=0,Ge=0,Dt=0,Pt=0,Je=C[0],He=C[1],ke=C[2],Ke=C[3],rt=C[4],Ue=C[5],Ze=C[6],b=C[7],p=C[8],m=C[9],D=C[10],B=C[11],G=C[12],Q=C[13],Ee=C[14],Re=C[15];f=T[0],Z+=f*Je,z+=f*He,ee+=f*ke,de+=f*Ke,me+=f*rt,O+=f*Ue,U+=f*Ze,ce+=f*b,le+=f*p,re+=f*m,ne+=f*D,ae+=f*B,ie+=f*G,Oe+=f*Q,ge+=f*Ee,Be+=f*Re,f=T[1],z+=f*Je,ee+=f*He,de+=f*ke,me+=f*Ke,O+=f*rt,U+=f*Ue,ce+=f*Ze,le+=f*b,re+=f*p,ne+=f*m,ae+=f*D,ie+=f*B,Oe+=f*G,ge+=f*Q,Be+=f*Ee,ye+=f*Re,f=T[2],ee+=f*Je,de+=f*He,me+=f*ke,O+=f*Ke,U+=f*rt,ce+=f*Ue,le+=f*Ze,re+=f*b,ne+=f*p,ae+=f*m,ie+=f*D,Oe+=f*B,ge+=f*G,Be+=f*Q,ye+=f*Ee,Le+=f*Re,f=T[3],de+=f*Je,me+=f*He,O+=f*ke,U+=f*Ke,ce+=f*rt,le+=f*Ue,re+=f*Ze,ne+=f*b,ae+=f*p,ie+=f*m,Oe+=f*D,ge+=f*B,Be+=f*G,ye+=f*Q,Le+=f*Ee,X+=f*Re,f=T[4],me+=f*Je,O+=f*He,U+=f*ke,ce+=f*Ke,le+=f*rt,re+=f*Ue,ne+=f*Ze,ae+=f*b,ie+=f*p,Oe+=f*m,ge+=f*D,Be+=f*B,ye+=f*G,Le+=f*Q,X+=f*Ee,J+=f*Re,f=T[5],O+=f*Je,U+=f*He,ce+=f*ke,le+=f*Ke,re+=f*rt,ne+=f*Ue,ae+=f*Ze,ie+=f*b,Oe+=f*p,ge+=f*m,Be+=f*D,ye+=f*B,Le+=f*G,X+=f*Q,J+=f*Ee,W+=f*Re,f=T[6],U+=f*Je,ce+=f*He,le+=f*ke,re+=f*Ke,ne+=f*rt,ae+=f*Ue,ie+=f*Ze,Oe+=f*b,ge+=f*p,Be+=f*m,ye+=f*D,Le+=f*B,X+=f*G,J+=f*Q,W+=f*Ee,w+=f*Re,f=T[7],ce+=f*Je,le+=f*He,re+=f*ke,ne+=f*Ke,ae+=f*rt,ie+=f*Ue,Oe+=f*Ze,ge+=f*b,Be+=f*p,ye+=f*m,Le+=f*D,X+=f*B,J+=f*G,W+=f*Q,w+=f*Ee,j+=f*Re,f=T[8],le+=f*Je,re+=f*He,ne+=f*ke,ae+=f*Ke,ie+=f*rt,Oe+=f*Ue,ge+=f*Ze,Be+=f*b,ye+=f*p,Le+=f*m,X+=f*D,J+=f*B,W+=f*G,w+=f*Q,j+=f*Ee,we+=f*Re,f=T[9],re+=f*Je,ne+=f*He,ae+=f*ke,ie+=f*Ke,Oe+=f*rt,ge+=f*Ue,Be+=f*Ze,ye+=f*b,Le+=f*p,X+=f*m,J+=f*D,W+=f*B,w+=f*G,j+=f*Q,we+=f*Ee,ve+=f*Re,f=T[10],ne+=f*Je,ae+=f*He,ie+=f*ke,Oe+=f*Ke,ge+=f*rt,Be+=f*Ue,ye+=f*Ze,Le+=f*b,X+=f*p,J+=f*m,W+=f*D,w+=f*B,j+=f*G,we+=f*Q,ve+=f*Ee,Me+=f*Re,f=T[11],ae+=f*Je,ie+=f*He,Oe+=f*ke,ge+=f*Ke,Be+=f*rt,ye+=f*Ue,Le+=f*Ze,X+=f*b,J+=f*p,W+=f*m,w+=f*D,j+=f*B,we+=f*G,ve+=f*Q,Me+=f*Ee,nt+=f*Re,f=T[12],ie+=f*Je,Oe+=f*He,ge+=f*ke,Be+=f*Ke,ye+=f*rt,Le+=f*Ue,X+=f*Ze,J+=f*b,W+=f*p,w+=f*m,j+=f*D,we+=f*B,ve+=f*G,Me+=f*Q,nt+=f*Ee,at+=f*Re,f=T[13],Oe+=f*Je,ge+=f*He,Be+=f*ke,ye+=f*Ke,Le+=f*rt,X+=f*Ue,J+=f*Ze,W+=f*b,w+=f*p,j+=f*m,we+=f*D,ve+=f*B,Me+=f*G,nt+=f*Q,at+=f*Ee,Ge+=f*Re,f=T[14],ge+=f*Je,Be+=f*He,ye+=f*ke,Le+=f*Ke,X+=f*rt,J+=f*Ue,W+=f*Ze,w+=f*b,j+=f*p,we+=f*m,ve+=f*D,Me+=f*B,nt+=f*G,at+=f*Q,Ge+=f*Ee,Dt+=f*Re,f=T[15],Be+=f*Je,ye+=f*He,Le+=f*ke,X+=f*Ke,J+=f*rt,W+=f*Ue,w+=f*Ze,j+=f*b,we+=f*p,ve+=f*m,Me+=f*D,nt+=f*B,at+=f*G,Ge+=f*Q,Dt+=f*Ee,Pt+=f*Re,Z+=38*ye,z+=38*Le,ee+=38*X,de+=38*J,me+=38*W,O+=38*w,U+=38*j,ce+=38*we,le+=38*ve,re+=38*Me,ne+=38*nt,ae+=38*at,ie+=38*Ge,Oe+=38*Dt,ge+=38*Pt,E=1,f=Z+E+65535,E=Math.floor(f/65536),Z=f-E*65536,f=z+E+65535,E=Math.floor(f/65536),z=f-E*65536,f=ee+E+65535,E=Math.floor(f/65536),ee=f-E*65536,f=de+E+65535,E=Math.floor(f/65536),de=f-E*65536,f=me+E+65535,E=Math.floor(f/65536),me=f-E*65536,f=O+E+65535,E=Math.floor(f/65536),O=f-E*65536,f=U+E+65535,E=Math.floor(f/65536),U=f-E*65536,f=ce+E+65535,E=Math.floor(f/65536),ce=f-E*65536,f=le+E+65535,E=Math.floor(f/65536),le=f-E*65536,f=re+E+65535,E=Math.floor(f/65536),re=f-E*65536,f=ne+E+65535,E=Math.floor(f/65536),ne=f-E*65536,f=ae+E+65535,E=Math.floor(f/65536),ae=f-E*65536,f=ie+E+65535,E=Math.floor(f/65536),ie=f-E*65536,f=Oe+E+65535,E=Math.floor(f/65536),Oe=f-E*65536,f=ge+E+65535,E=Math.floor(f/65536),ge=f-E*65536,f=Be+E+65535,E=Math.floor(f/65536),Be=f-E*65536,Z+=E-1+37*(E-1),E=1,f=Z+E+65535,E=Math.floor(f/65536),Z=f-E*65536,f=z+E+65535,E=Math.floor(f/65536),z=f-E*65536,f=ee+E+65535,E=Math.floor(f/65536),ee=f-E*65536,f=de+E+65535,E=Math.floor(f/65536),de=f-E*65536,f=me+E+65535,E=Math.floor(f/65536),me=f-E*65536,f=O+E+65535,E=Math.floor(f/65536),O=f-E*65536,f=U+E+65535,E=Math.floor(f/65536),U=f-E*65536,f=ce+E+65535,E=Math.floor(f/65536),ce=f-E*65536,f=le+E+65535,E=Math.floor(f/65536),le=f-E*65536,f=re+E+65535,E=Math.floor(f/65536),re=f-E*65536,f=ne+E+65535,E=Math.floor(f/65536),ne=f-E*65536,f=ae+E+65535,E=Math.floor(f/65536),ae=f-E*65536,f=ie+E+65535,E=Math.floor(f/65536),ie=f-E*65536,f=Oe+E+65535,E=Math.floor(f/65536),Oe=f-E*65536,f=ge+E+65535,E=Math.floor(f/65536),ge=f-E*65536,f=Be+E+65535,E=Math.floor(f/65536),Be=f-E*65536,Z+=E-1+37*(E-1),$[0]=Z,$[1]=z,$[2]=ee,$[3]=de,$[4]=me,$[5]=O,$[6]=U,$[7]=ce,$[8]=le,$[9]=re,$[10]=ne,$[11]=ae,$[12]=ie,$[13]=Oe,$[14]=ge,$[15]=Be}function A($,T){_($,T,T)}function P($,T){const C=n();for(let f=0;f<16;f++)C[f]=T[f];for(let f=253;f>=0;f--)A(C,C),f!==2&&f!==4&&_(C,C,T);for(let f=0;f<16;f++)$[f]=C[f]}function L($,T){const C=new Uint8Array(32),f=new Float64Array(80),E=n(),Z=n(),z=n(),ee=n(),de=n(),me=n();for(let le=0;le<31;le++)C[le]=$[le];C[31]=$[31]&127|64,C[0]&=248,d(f,T);for(let le=0;le<16;le++)Z[le]=f[le];E[0]=ee[0]=1;for(let le=254;le>=0;--le){const re=C[le>>>3]>>>(le&7)&1;l(E,Z,re),l(z,ee,re),v(de,E,z),x(E,E,z),v(z,Z,ee),x(Z,Z,ee),A(ee,de),A(me,E),_(E,z,E),_(z,Z,de),v(de,E,z),x(E,E,z),A(Z,E),x(z,ee,me),_(E,z,o),v(E,E,ee),_(z,z,E),_(E,ee,me),_(ee,Z,f),A(Z,de),l(E,Z,re),l(z,ee,re)}for(let le=0;le<16;le++)f[le+16]=E[le],f[le+32]=z[le],f[le+48]=Z[le],f[le+64]=ee[le];const O=f.subarray(32),U=f.subarray(16);P(O,O),_(U,U,O);const ce=new Uint8Array(32);return h(ce,U),ce}t.scalarMult=L;function k($){return L($,i)}t.scalarMultBase=k;function q($){if($.length!==t.SECRET_KEY_LENGTH)throw new Error(`x25519: seed must be ${t.SECRET_KEY_LENGTH} bytes`);const T=new Uint8Array($);return{publicKey:k(T),secretKey:T}}t.generateKeyPairFromSeed=q;function R($){const T=(0,e.randomBytes)(32,$),C=q(T);return(0,r.wipe)(T),C}t.generateKeyPair=R;function F($,T,C=!1){if($.length!==t.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect secret key length");if(T.length!==t.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect public key length");const f=L($,T);if(C){let E=0;for(let Z=0;Z<f.length;Z++)E|=f[Z];if(E===0)throw new Error("X25519: invalid shared key")}return f}t.sharedKey=F})(wu);function vu(t){return globalThis.Buffer!=null?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):t}function Zd(t=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?vu(globalThis.Buffer.allocUnsafe(t)):new Uint8Array(t)}function Yd(t,e){e||(e=t.reduce((i,o)=>i+o.length,0));const r=Zd(e);let n=0;for(const i of t)r.set(i,n),n+=i.length;return vu(r)}function oy(t,e){if(t.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),n=0;n<r.length;n++)r[n]=255;for(var i=0;i<t.length;i++){var o=t.charAt(i),c=o.charCodeAt(0);if(r[c]!==255)throw new TypeError(o+" is ambiguous");r[c]=i}var l=t.length,h=t.charAt(0),d=Math.log(l)/Math.log(256),v=Math.log(256)/Math.log(l);function x(P){if(P instanceof Uint8Array||(ArrayBuffer.isView(P)?P=new Uint8Array(P.buffer,P.byteOffset,P.byteLength):Array.isArray(P)&&(P=Uint8Array.from(P))),!(P instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(P.length===0)return"";for(var L=0,k=0,q=0,R=P.length;q!==R&&P[q]===0;)q++,L++;for(var F=(R-q)*v+1>>>0,$=new Uint8Array(F);q!==R;){for(var T=P[q],C=0,f=F-1;(T!==0||C<k)&&f!==-1;f--,C++)T+=256*$[f]>>>0,$[f]=T%l>>>0,T=T/l>>>0;if(T!==0)throw new Error("Non-zero carry");k=C,q++}for(var E=F-k;E!==F&&$[E]===0;)E++;for(var Z=h.repeat(L);E<F;++E)Z+=t.charAt($[E]);return Z}function _(P){if(typeof P!="string")throw new TypeError("Expected String");if(P.length===0)return new Uint8Array;var L=0;if(P[L]!==" "){for(var k=0,q=0;P[L]===h;)k++,L++;for(var R=(P.length-L)*d+1>>>0,F=new Uint8Array(R);P[L];){var $=r[P.charCodeAt(L)];if($===255)return;for(var T=0,C=R-1;($!==0||T<q)&&C!==-1;C--,T++)$+=l*F[C]>>>0,F[C]=$%256>>>0,$=$/256>>>0;if($!==0)throw new Error("Non-zero carry");q=T,L++}if(P[L]!==" "){for(var f=R-q;f!==R&&F[f]===0;)f++;for(var E=new Uint8Array(k+(R-f)),Z=k;f!==R;)E[Z++]=F[f++];return E}}}function A(P){var L=_(P);if(L)return L;throw new Error(`Non-${e} character`)}return{encode:x,decodeUnsafe:_,decode:A}}var ay=oy,cy=ay;const Jd=t=>{if(t instanceof Uint8Array&&t.constructor.name==="Uint8Array")return t;if(t instanceof ArrayBuffer)return new Uint8Array(t);if(ArrayBuffer.isView(t))return new Uint8Array(t.buffer,t.byteOffset,t.byteLength);throw new Error("Unknown type, must be binary type")},ly=t=>new TextEncoder().encode(t),uy=t=>new TextDecoder().decode(t);class hy{constructor(e,r,n){this.name=e,this.prefix=r,this.baseEncode=n}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}}class fy{constructor(e,r,n){if(this.name=e,this.prefix=r,r.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=r.codePointAt(0),this.baseDecode=n}decode(e){if(typeof e=="string"){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(e){return Xd(this,e)}}class dy{constructor(e){this.decoders=e}or(e){return Xd(this,e)}decode(e){const r=e[0],n=this.decoders[r];if(n)return n.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const Xd=(t,e)=>new dy({...t.decoders||{[t.prefix]:t},...e.decoders||{[e.prefix]:e}});class py{constructor(e,r,n,i){this.name=e,this.prefix=r,this.baseEncode=n,this.baseDecode=i,this.encoder=new hy(e,r,n),this.decoder=new fy(e,r,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}const Xa=({name:t,prefix:e,encode:r,decode:n})=>new py(t,e,r,n),Co=({prefix:t,name:e,alphabet:r})=>{const{encode:n,decode:i}=cy(r,e);return Xa({prefix:t,name:e,encode:n,decode:o=>Jd(i(o))})},gy=(t,e,r,n)=>{const i={};for(let v=0;v<e.length;++v)i[e[v]]=v;let o=t.length;for(;t[o-1]==="=";)--o;const c=new Uint8Array(o*r/8|0);let l=0,h=0,d=0;for(let v=0;v<o;++v){const x=i[t[v]];if(x===void 0)throw new SyntaxError(`Non-${n} character`);h=h<<r|x,l+=r,l>=8&&(l-=8,c[d++]=255&h>>l)}if(l>=r||255&h<<8-l)throw new SyntaxError("Unexpected end of data");return c},my=(t,e,r)=>{const n=e[e.length-1]==="=",i=(1<<r)-1;let o="",c=0,l=0;for(let h=0;h<t.length;++h)for(l=l<<8|t[h],c+=8;c>r;)c-=r,o+=e[i&l>>c];if(c&&(o+=e[i&l<<r-c]),n)for(;o.length*r&7;)o+="=";return o},Er=({name:t,prefix:e,bitsPerChar:r,alphabet:n})=>Xa({prefix:e,name:t,encode(i){return my(i,n,r)},decode(i){return gy(i,n,r,t)}}),wy=Xa({prefix:"\0",name:"identity",encode:t=>uy(t),decode:t=>ly(t)});var vy=Object.freeze({__proto__:null,identity:wy});const yy=Er({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var by=Object.freeze({__proto__:null,base2:yy});const _y=Er({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var Ey=Object.freeze({__proto__:null,base8:_y});const xy=Co({prefix:"9",name:"base10",alphabet:"0123456789"});var Cy=Object.freeze({__proto__:null,base10:xy});const Iy=Er({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),Ay=Er({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var $y=Object.freeze({__proto__:null,base16:Iy,base16upper:Ay});const Oy=Er({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),Sy=Er({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),Dy=Er({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),Py=Er({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),Ty=Er({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),Ry=Er({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),Ny=Er({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),Fy=Er({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),Ly=Er({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var My=Object.freeze({__proto__:null,base32:Oy,base32upper:Sy,base32pad:Dy,base32padupper:Py,base32hex:Ty,base32hexupper:Ry,base32hexpad:Ny,base32hexpadupper:Fy,base32z:Ly});const Uy=Co({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),jy=Co({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var By=Object.freeze({__proto__:null,base36:Uy,base36upper:jy});const ky=Co({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),Hy=Co({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var zy=Object.freeze({__proto__:null,base58btc:ky,base58flickr:Hy});const Wy=Er({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),qy=Er({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),Vy=Er({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),Ky=Er({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var Gy=Object.freeze({__proto__:null,base64:Wy,base64pad:qy,base64url:Vy,base64urlpad:Ky});const Qd=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}"),Zy=Qd.reduce((t,e,r)=>(t[r]=e,t),[]),Yy=Qd.reduce((t,e,r)=>(t[e.codePointAt(0)]=r,t),[]);function Jy(t){return t.reduce((e,r)=>(e+=Zy[r],e),"")}function Xy(t){const e=[];for(const r of t){const n=Yy[r.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${r}`);e.push(n)}return new Uint8Array(e)}const Qy=Xa({prefix:"\u{1F680}",name:"base256emoji",encode:Jy,decode:Xy});var e5=Object.freeze({__proto__:null,base256emoji:Qy}),t5=t1,e1=128,r5=127,n5=~r5,i5=Math.pow(2,31);function t1(t,e,r){e=e||[],r=r||0;for(var n=r;t>=i5;)e[r++]=t&255|e1,t/=128;for(;t&n5;)e[r++]=t&255|e1,t>>>=7;return e[r]=t|0,t1.bytes=r-n+1,e}var s5=yu,o5=128,r1=127;function yu(t,n){var r=0,n=n||0,i=0,o=n,c,l=t.length;do{if(o>=l)throw yu.bytes=0,new RangeError("Could not decode varint");c=t[o++],r+=i<28?(c&r1)<<i:(c&r1)*Math.pow(2,i),i+=7}while(c>=o5);return yu.bytes=o-n,r}var a5=Math.pow(2,7),c5=Math.pow(2,14),l5=Math.pow(2,21),u5=Math.pow(2,28),h5=Math.pow(2,35),f5=Math.pow(2,42),d5=Math.pow(2,49),p5=Math.pow(2,56),g5=Math.pow(2,63),m5=function(t){return t<a5?1:t<c5?2:t<l5?3:t<u5?4:t<h5?5:t<f5?6:t<d5?7:t<p5?8:t<g5?9:10},w5={encode:t5,decode:s5,encodingLength:m5},n1=w5;const i1=(t,e,r=0)=>(n1.encode(t,e,r),e),s1=t=>n1.encodingLength(t),bu=(t,e)=>{const r=e.byteLength,n=s1(t),i=n+s1(r),o=new Uint8Array(i+r);return i1(t,o,0),i1(r,o,n),o.set(e,i),new v5(t,r,e,o)};class v5{constructor(e,r,n,i){this.code=e,this.size=r,this.digest=n,this.bytes=i}}const o1=({name:t,code:e,encode:r})=>new y5(t,e,r);class y5{constructor(e,r,n){this.name=e,this.code=r,this.encode=n}digest(e){if(e instanceof Uint8Array){const r=this.encode(e);return r instanceof Uint8Array?bu(this.code,r):r.then(n=>bu(this.code,n))}else throw Error("Unknown type, must be binary type")}}const a1=t=>async e=>new Uint8Array(await crypto.subtle.digest(t,e)),b5=o1({name:"sha2-256",code:18,encode:a1("SHA-256")}),_5=o1({name:"sha2-512",code:19,encode:a1("SHA-512")});var E5=Object.freeze({__proto__:null,sha256:b5,sha512:_5});const c1=0,x5="identity",l1=Jd;var C5=Object.freeze({__proto__:null,identity:{code:c1,name:x5,encode:l1,digest:t=>bu(c1,l1(t))}});new TextEncoder,new TextDecoder;const u1={...vy,...by,...Ey,...Cy,...$y,...My,...By,...zy,...Gy,...e5};({...E5,...C5});function h1(t,e,r,n){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:r},decoder:{decode:n}}}const f1=h1("utf8","u",t=>"u"+new TextDecoder("utf8").decode(t),t=>new TextEncoder().encode(t.substring(1))),_u=h1("ascii","a",t=>{let e="a";for(let r=0;r<t.length;r++)e+=String.fromCharCode(t[r]);return e},t=>{t=t.substring(1);const e=Zd(t.length);for(let r=0;r<t.length;r++)e[r]=t.charCodeAt(r);return e}),d1={utf8:f1,"utf-8":f1,hex:u1.base16,latin1:_u,ascii:_u,binary:_u,...u1};function Cn(t,e="utf8"){const r=d1[e];if(!r)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?vu(globalThis.Buffer.from(t,"utf-8")):r.decoder.decode(`${r.prefix}${t}`)}function on(t,e="utf8"){const r=d1[e];if(!r)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(t.buffer,t.byteOffset,t.byteLength).toString("utf8"):r.encoder.encode(t).substring(1)}var p1=function(t,e,r){if(r||arguments.length===2)for(var n=0,i=e.length,o;n<i;n++)(o||!(n in e))&&(o||(o=Array.prototype.slice.call(e,0,n)),o[n]=e[n]);return t.concat(o||Array.prototype.slice.call(e))},I5=function(){function t(e,r,n){this.name=e,this.version=r,this.os=n,this.type="browser"}return t}(),A5=function(){function t(e){this.version=e,this.type="node",this.name="node",this.os=process.platform}return t}(),$5=function(){function t(e,r,n,i){this.name=e,this.version=r,this.os=n,this.bot=i,this.type="bot-device"}return t}(),O5=function(){function t(){this.type="bot",this.bot=!0,this.name="bot",this.version=null,this.os=null}return t}(),S5=function(){function t(){this.type="react-native",this.name="react-native",this.version=null,this.os=null}return t}(),D5=/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/,P5=/(nuhk|curl|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/,g1=3,T5=[["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",D5]],m1=[["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 R5(t){return t?w1(t):typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"?new S5:typeof navigator<"u"?w1(navigator.userAgent):L5()}function N5(t){return t!==""&&T5.reduce(function(e,r){var n=r[0],i=r[1];if(e)return e;var o=i.exec(t);return!!o&&[n,o]},!1)}function w1(t){var e=N5(t);if(!e)return null;var r=e[0],n=e[1];if(r==="searchbot")return new O5;var i=n[1]&&n[1].split(".").join("_").split("_").slice(0,3);i?i.length<g1&&(i=p1(p1([],i,!0),M5(g1-i.length),!0)):i=[];var o=i.join("."),c=F5(t),l=P5.exec(t);return l&&l[1]?new $5(r,o,c,l[1]):new I5(r,o,c)}function F5(t){for(var e=0,r=m1.length;e<r;e++){var n=m1[e],i=n[0],o=n[1],c=o.exec(t);if(c)return i}return null}function L5(){var t=typeof process<"u"&&process.version;return t?new A5(process.version.slice(1)):null}function M5(t){for(var e=[],r=0;r<t;r++)e.push("0");return e}var Se={};/*! *****************************************************************************
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 pu=function(t,e){return pu=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)n.hasOwnProperty(i)&&(r[i]=n[i])},pu(t,e)};function Gy(t,e){pu(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var gu=function(){return gu=Object.assign||function(e){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e},gu.apply(this,arguments)};function Zy(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r}function Yy(t,e,r,n){var i=arguments.length,o=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(o=(i<3?c(o):i>3?c(e,r,o):c(e,r))||o);return i>3&&o&&Object.defineProperty(e,r,o),o}function Jy(t,e){return function(r,n){e(r,n,t)}}function Xy(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function Qy(t,e,r,n){function i(o){return o instanceof r?o:new r(function(c){c(o)})}return new(r||(r=Promise))(function(o,c){function l(v){try{f(n.next(v))}catch(E){c(E)}}function h(v){try{f(n.throw(v))}catch(E){c(E)}}function f(v){v.done?o(v.value):i(v.value).then(l,h)}f((n=n.apply(t,e||[])).next())})}function e5(t,e){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,c;return c={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function l(f){return function(v){return h([f,v])}}function h(f){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(o=f[0]&2?i.return:f[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,f[1])).done)return o;switch(i=0,o&&(f=[f[0]&2,o.value]),f[0]){case 0:case 1:o=f;break;case 4:return r.label++,{value:f[1],done:!1};case 5:r.label++,i=f[1],f=[0];continue;case 7:f=r.ops.pop(),r.trys.pop();continue;default:if(o=r.trys,!(o=o.length>0&&o[o.length-1])&&(f[0]===6||f[0]===2)){r=0;continue}if(f[0]===3&&(!o||f[1]>o[0]&&f[1]<o[3])){r.label=f[1];break}if(f[0]===6&&r.label<o[1]){r.label=o[1],o=f;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(f);break}o[2]&&r.ops.pop(),r.trys.pop();continue}f=e.call(t,r)}catch(v){f=[6,v],i=0}finally{n=o=0}if(f[0]&5)throw f[1];return{value:f[0]?f[1]:void 0,done:!0}}}function t5(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}function r5(t,e){for(var r in t)r!=="default"&&!e.hasOwnProperty(r)&&(e[r]=t[r])}function mu(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function n1(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,o=[],c;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(l){c={error:l}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(c)throw c.error}}return o}function n5(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(n1(arguments[e]));return t}function i5(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;for(var n=Array(t),i=0,e=0;e<r;e++)for(var o=arguments[e],c=0,l=o.length;c<l;c++,i++)n[i]=o[c];return n}function Eo(t){return this instanceof Eo?(this.v=t,this):new Eo(t)}function s5(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(t,e||[]),i,o=[];return i={},c("next"),c("throw"),c("return"),i[Symbol.asyncIterator]=function(){return this},i;function c(_){n[_]&&(i[_]=function(S){return new Promise(function(P,j){o.push([_,S,P,j])>1||l(_,S)})})}function l(_,S){try{h(n[_](S))}catch(P){E(o[0][3],P)}}function h(_){_.value instanceof Eo?Promise.resolve(_.value.v).then(f,v):E(o[0][2],_)}function f(_){l("next",_)}function v(_){l("throw",_)}function E(_,S){_(S),o.shift(),o.length&&l(o[0][0],o[0][1])}}function o5(t){var e,r;return e={},n("next"),n("throw",function(i){throw i}),n("return"),e[Symbol.iterator]=function(){return this},e;function n(i,o){e[i]=t[i]?function(c){return(r=!r)?{value:Eo(t[i](c)),done:i==="return"}:o?o(c):c}:o}}function a5(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof mu=="function"?mu(t):t[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(o){r[o]=t[o]&&function(c){return new Promise(function(l,h){c=t[o](c),i(l,h,c.done,c.value)})}}function i(o,c,l,h){Promise.resolve(h).then(function(f){o({value:f,done:l})},c)}}function c5(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function l5(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}function u5(t){return t&&t.__esModule?t:{default:t}}function h5(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}function f5(t,e,r){if(!e.has(t))throw new TypeError("attempted to set private field on non-instance");return e.set(t,r),r}var d5=Object.freeze({__proto__:null,__extends:Gy,get __assign(){return gu},__rest:Zy,__decorate:Yy,__param:Jy,__metadata:Xy,__awaiter:Qy,__generator:e5,__createBinding:t5,__exportStar:r5,__values:mu,__read:n1,__spread:n5,__spreadArrays:i5,__await:Eo,__asyncGenerator:s5,__asyncDelegator:o5,__asyncValues:a5,__makeTemplateObject:c5,__importStar:l5,__importDefault:u5,__classPrivateFieldGet:h5,__classPrivateFieldSet:f5}),Va=Ui(d5),wu={},xo={},i1;function p5(){if(i1)return xo;i1=1,Object.defineProperty(xo,"__esModule",{value:!0}),xo.delay=void 0;function t(e){return new Promise(r=>{setTimeout(()=>{r(!0)},e)})}return xo.delay=t,xo}var ji={},vu={},Fi={},s1;function g5(){return s1||(s1=1,Object.defineProperty(Fi,"__esModule",{value:!0}),Fi.ONE_THOUSAND=Fi.ONE_HUNDRED=void 0,Fi.ONE_HUNDRED=100,Fi.ONE_THOUSAND=1e3),Fi}var yu={},o1;function m5(){return o1||(o1=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ONE_YEAR=t.FOUR_WEEKS=t.THREE_WEEKS=t.TWO_WEEKS=t.ONE_WEEK=t.THIRTY_DAYS=t.SEVEN_DAYS=t.FIVE_DAYS=t.THREE_DAYS=t.ONE_DAY=t.TWENTY_FOUR_HOURS=t.TWELVE_HOURS=t.SIX_HOURS=t.THREE_HOURS=t.ONE_HOUR=t.SIXTY_MINUTES=t.THIRTY_MINUTES=t.TEN_MINUTES=t.FIVE_MINUTES=t.ONE_MINUTE=t.SIXTY_SECONDS=t.THIRTY_SECONDS=t.TEN_SECONDS=t.FIVE_SECONDS=t.ONE_SECOND=void 0,t.ONE_SECOND=1,t.FIVE_SECONDS=5,t.TEN_SECONDS=10,t.THIRTY_SECONDS=30,t.SIXTY_SECONDS=60,t.ONE_MINUTE=t.SIXTY_SECONDS,t.FIVE_MINUTES=t.ONE_MINUTE*5,t.TEN_MINUTES=t.ONE_MINUTE*10,t.THIRTY_MINUTES=t.ONE_MINUTE*30,t.SIXTY_MINUTES=t.ONE_MINUTE*60,t.ONE_HOUR=t.SIXTY_MINUTES,t.THREE_HOURS=t.ONE_HOUR*3,t.SIX_HOURS=t.ONE_HOUR*6,t.TWELVE_HOURS=t.ONE_HOUR*12,t.TWENTY_FOUR_HOURS=t.ONE_HOUR*24,t.ONE_DAY=t.TWENTY_FOUR_HOURS,t.THREE_DAYS=t.ONE_DAY*3,t.FIVE_DAYS=t.ONE_DAY*5,t.SEVEN_DAYS=t.ONE_DAY*7,t.THIRTY_DAYS=t.ONE_DAY*30,t.ONE_WEEK=t.SEVEN_DAYS,t.TWO_WEEKS=t.ONE_WEEK*2,t.THREE_WEEKS=t.ONE_WEEK*3,t.FOUR_WEEKS=t.ONE_WEEK*4,t.ONE_YEAR=t.ONE_DAY*365}(yu)),yu}var a1;function c1(){return a1||(a1=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=Va;e.__exportStar(g5(),t),e.__exportStar(m5(),t)}(vu)),vu}var l1;function w5(){if(l1)return ji;l1=1,Object.defineProperty(ji,"__esModule",{value:!0}),ji.fromMiliseconds=ji.toMiliseconds=void 0;const t=c1();function e(n){return n*t.ONE_THOUSAND}ji.toMiliseconds=e;function r(n){return Math.floor(n/t.ONE_THOUSAND)}return ji.fromMiliseconds=r,ji}var u1;function v5(){return u1||(u1=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=Va;e.__exportStar(p5(),t),e.__exportStar(w5(),t)}(wu)),wu}var Cs={},h1;function y5(){if(h1)return Cs;h1=1,Object.defineProperty(Cs,"__esModule",{value:!0}),Cs.Watch=void 0;class t{constructor(){this.timestamps=new Map}start(r){if(this.timestamps.has(r))throw new Error(`Watch already started for label: ${r}`);this.timestamps.set(r,{started:Date.now()})}stop(r){const n=this.get(r);if(typeof n.elapsed<"u")throw new Error(`Watch already stopped for label: ${r}`);const i=Date.now()-n.started;this.timestamps.set(r,{started:n.started,elapsed:i})}get(r){const n=this.timestamps.get(r);if(typeof n>"u")throw new Error(`No timestamp found for label: ${r}`);return n}elapsed(r){const n=this.get(r);return n.elapsed||Date.now()-n.started}}return Cs.Watch=t,Cs.default=t,Cs}var bu={},Co={},f1;function b5(){if(f1)return Co;f1=1,Object.defineProperty(Co,"__esModule",{value:!0}),Co.IWatch=void 0;class t{}return Co.IWatch=t,Co}var d1;function _5(){return d1||(d1=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),Va.__exportStar(b5(),t)}(bu)),bu}(function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=Va;e.__exportStar(v5(),t),e.__exportStar(y5(),t),e.__exportStar(_5(),t),e.__exportStar(c1(),t)})(Te);var Ot={};Object.defineProperty(Ot,"__esModule",{value:!0}),Ot.getLocalStorage=Ot.getLocalStorageOrThrow=Ot.getCrypto=Ot.getCryptoOrThrow=g1=Ot.getLocation=Ot.getLocationOrThrow=_u=Ot.getNavigator=Ot.getNavigatorOrThrow=p1=Ot.getDocument=Ot.getDocumentOrThrow=Ot.getFromWindowOrThrow=Ot.getFromWindow=void 0;function Bi(t){let e;return typeof window<"u"&&typeof window[t]<"u"&&(e=window[t]),e}Ot.getFromWindow=Bi;function Is(t){const e=Bi(t);if(!e)throw new Error(`${t} is not defined in Window`);return e}Ot.getFromWindowOrThrow=Is;function E5(){return Is("document")}Ot.getDocumentOrThrow=E5;function x5(){return Bi("document")}var p1=Ot.getDocument=x5;function C5(){return Is("navigator")}Ot.getNavigatorOrThrow=C5;function I5(){return Bi("navigator")}var _u=Ot.getNavigator=I5;function S5(){return Is("location")}Ot.getLocationOrThrow=S5;function A5(){return Bi("location")}var g1=Ot.getLocation=A5;function O5(){return Is("crypto")}Ot.getCryptoOrThrow=O5;function D5(){return Bi("crypto")}Ot.getCrypto=D5;function $5(){return Is("localStorage")}Ot.getLocalStorageOrThrow=$5;function P5(){return Bi("localStorage")}Ot.getLocalStorage=P5;var Eu={};Object.defineProperty(Eu,"__esModule",{value:!0});var m1=Eu.getWindowMetadata=void 0;const w1=Ot;function T5(){let t,e;try{t=w1.getDocumentOrThrow(),e=w1.getLocationOrThrow()}catch{return null}function r(){const E=t.getElementsByTagName("link"),_=[];for(let S=0;S<E.length;S++){const P=E[S],j=P.getAttribute("rel");if(j&&j.toLowerCase().indexOf("icon")>-1){const H=P.getAttribute("href");if(H)if(H.toLowerCase().indexOf("https:")===-1&&H.toLowerCase().indexOf("http:")===-1&&H.indexOf("//")!==0){let Z=e.protocol+"//"+e.host;if(H.indexOf("/")===0)Z+=H;else{const R=e.pathname.split("/");R.pop();const L=R.join("/");Z+=L+"/"+H}_.push(Z)}else if(H.indexOf("//")===0){const Z=e.protocol+H;_.push(Z)}else _.push(H)}}return _}function n(...E){const _=t.getElementsByTagName("meta");for(let S=0;S<_.length;S++){const P=_[S],j=["itemprop","property","name"].map(H=>P.getAttribute(H)).filter(H=>H?E.includes(H):!1);if(j.length&&j){const H=P.getAttribute("content");if(H)return H}}return""}function i(){let E=n("name","og:site_name","og:title","twitter:title");return E||(E=t.title),E}function o(){return n("description","og:description","twitter:description","keywords")}const c=i(),l=o(),h=e.origin,f=r();return{description:l,url:h,icons:f,name:c}}m1=Eu.getWindowMetadata=T5;var Io={},N5=t=>encodeURIComponent(t).replace(/[!'()*]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`),v1="%[a-f0-9]{2}",y1=new RegExp("("+v1+")|([^%]+?)","gi"),b1=new RegExp("("+v1+")+","gi");function xu(t,e){try{return[decodeURIComponent(t.join(""))]}catch{}if(t.length===1)return t;e=e||1;var r=t.slice(0,e),n=t.slice(e);return Array.prototype.concat.call([],xu(r),xu(n))}function R5(t){try{return decodeURIComponent(t)}catch{for(var e=t.match(y1)||[],r=1;r<e.length;r++)t=xu(e,r).join(""),e=t.match(y1)||[];return t}}function L5(t){for(var e={"%FE%FF":"\uFFFD\uFFFD","%FF%FE":"\uFFFD\uFFFD"},r=b1.exec(t);r;){try{e[r[0]]=decodeURIComponent(r[0])}catch{var n=R5(r[0]);n!==r[0]&&(e[r[0]]=n)}r=b1.exec(t)}e["%C2"]="\uFFFD";for(var i=Object.keys(e),o=0;o<i.length;o++){var c=i[o];t=t.replace(new RegExp(c,"g"),e[c])}return t}var M5=function(t){if(typeof t!="string")throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof t+"`");try{return t=t.replace(/\+/g," "),decodeURIComponent(t)}catch{return L5(t)}},U5=(t,e)=>{if(!(typeof t=="string"&&typeof e=="string"))throw new TypeError("Expected the arguments to be of type `string`");if(e==="")return[t];const r=t.indexOf(e);return r===-1?[t]:[t.slice(0,r),t.slice(r+e.length)]},j5=function(t,e){for(var r={},n=Object.keys(t),i=Array.isArray(e),o=0;o<n.length;o++){var c=n[o],l=t[c];(i?e.indexOf(c)!==-1:e(c,l,t))&&(r[c]=l)}return r};(function(t){const e=N5,r=M5,n=U5,i=j5,o=R=>R==null,c=Symbol("encodeFragmentIdentifier");function l(R){switch(R.arrayFormat){case"index":return L=>($,T)=>{const I=$.length;return T===void 0||R.skipNull&&T===null||R.skipEmptyString&&T===""?$:T===null?[...$,[v(L,R),"[",I,"]"].join("")]:[...$,[v(L,R),"[",v(I,R),"]=",v(T,R)].join("")]};case"bracket":return L=>($,T)=>T===void 0||R.skipNull&&T===null||R.skipEmptyString&&T===""?$:T===null?[...$,[v(L,R),"[]"].join("")]:[...$,[v(L,R),"[]=",v(T,R)].join("")];case"colon-list-separator":return L=>($,T)=>T===void 0||R.skipNull&&T===null||R.skipEmptyString&&T===""?$:T===null?[...$,[v(L,R),":list="].join("")]:[...$,[v(L,R),":list=",v(T,R)].join("")];case"comma":case"separator":case"bracket-separator":{const L=R.arrayFormat==="bracket-separator"?"[]=":"=";return $=>(T,I)=>I===void 0||R.skipNull&&I===null||R.skipEmptyString&&I===""?T:(I=I===null?"":I,T.length===0?[[v($,R),L,v(I,R)].join("")]:[[T,v(I,R)].join(R.arrayFormatSeparator)])}default:return L=>($,T)=>T===void 0||R.skipNull&&T===null||R.skipEmptyString&&T===""?$:T===null?[...$,v(L,R)]:[...$,[v(L,R),"=",v(T,R)].join("")]}}function h(R){let L;switch(R.arrayFormat){case"index":return($,T,I)=>{if(L=/\[(\d*)\]$/.exec($),$=$.replace(/\[\d*\]$/,""),!L){I[$]=T;return}I[$]===void 0&&(I[$]={}),I[$][L[1]]=T};case"bracket":return($,T,I)=>{if(L=/(\[\])$/.exec($),$=$.replace(/\[\]$/,""),!L){I[$]=T;return}if(I[$]===void 0){I[$]=[T];return}I[$]=[].concat(I[$],T)};case"colon-list-separator":return($,T,I)=>{if(L=/(:list)$/.exec($),$=$.replace(/:list$/,""),!L){I[$]=T;return}if(I[$]===void 0){I[$]=[T];return}I[$]=[].concat(I[$],T)};case"comma":case"separator":return($,T,I)=>{const d=typeof T=="string"&&T.includes(R.arrayFormatSeparator),x=typeof T=="string"&&!d&&E(T,R).includes(R.arrayFormatSeparator);T=x?E(T,R):T;const J=d||x?T.split(R.arrayFormatSeparator).map(z=>E(z,R)):T===null?T:E(T,R);I[$]=J};case"bracket-separator":return($,T,I)=>{const d=/(\[\])$/.test($);if($=$.replace(/\[\]$/,""),!d){I[$]=T&&E(T,R);return}const x=T===null?[]:T.split(R.arrayFormatSeparator).map(J=>E(J,R));if(I[$]===void 0){I[$]=x;return}I[$]=[].concat(I[$],x)};default:return($,T,I)=>{if(I[$]===void 0){I[$]=T;return}I[$]=[].concat(I[$],T)}}}function f(R){if(typeof R!="string"||R.length!==1)throw new TypeError("arrayFormatSeparator must be single character string")}function v(R,L){return L.encode?L.strict?e(R):encodeURIComponent(R):R}function E(R,L){return L.decode?r(R):R}function _(R){return Array.isArray(R)?R.sort():typeof R=="object"?_(Object.keys(R)).sort((L,$)=>Number(L)-Number($)).map(L=>R[L]):R}function S(R){const L=R.indexOf("#");return L!==-1&&(R=R.slice(0,L)),R}function P(R){let L="";const $=R.indexOf("#");return $!==-1&&(L=R.slice($)),L}function j(R){R=S(R);const L=R.indexOf("?");return L===-1?"":R.slice(L+1)}function H(R,L){return L.parseNumbers&&!Number.isNaN(Number(R))&&typeof R=="string"&&R.trim()!==""?R=Number(R):L.parseBooleans&&R!==null&&(R.toLowerCase()==="true"||R.toLowerCase()==="false")&&(R=R.toLowerCase()==="true"),R}function Z(R,L){L=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},L),f(L.arrayFormatSeparator);const $=h(L),T=Object.create(null);if(typeof R!="string"||(R=R.trim().replace(/^[?#&]/,""),!R))return T;for(const I of R.split("&")){if(I==="")continue;let[d,x]=n(L.decode?I.replace(/\+/g," "):I,"=");x=x===void 0?null:["comma","separator","bracket-separator"].includes(L.arrayFormat)?x:E(x,L),$(E(d,L),x,T)}for(const I of Object.keys(T)){const d=T[I];if(typeof d=="object"&&d!==null)for(const x of Object.keys(d))d[x]=H(d[x],L);else T[I]=H(d,L)}return L.sort===!1?T:(L.sort===!0?Object.keys(T).sort():Object.keys(T).sort(L.sort)).reduce((I,d)=>{const x=T[d];return x&&typeof x=="object"&&!Array.isArray(x)?I[d]=_(x):I[d]=x,I},Object.create(null))}t.extract=j,t.parse=Z,t.stringify=(R,L)=>{if(!R)return"";L=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},L),f(L.arrayFormatSeparator);const $=x=>L.skipNull&&o(R[x])||L.skipEmptyString&&R[x]==="",T=l(L),I={};for(const x of Object.keys(R))$(x)||(I[x]=R[x]);const d=Object.keys(I);return L.sort!==!1&&d.sort(L.sort),d.map(x=>{const J=R[x];return J===void 0?"":J===null?v(x,L):Array.isArray(J)?J.length===0&&L.arrayFormat==="bracket-separator"?v(x,L)+"[]":J.reduce(T(x),[]).join("&"):v(x,L)+"="+v(J,L)}).filter(x=>x.length>0).join("&")},t.parseUrl=(R,L)=>{L=Object.assign({decode:!0},L);const[$,T]=n(R,"#");return Object.assign({url:$.split("?")[0]||"",query:Z(j(R),L)},L&&L.parseFragmentIdentifier&&T?{fragmentIdentifier:E(T,L)}:{})},t.stringifyUrl=(R,L)=>{L=Object.assign({encode:!0,strict:!0,[c]:!0},L);const $=S(R.url).split("?")[0]||"",T=t.extract(R.url),I=t.parse(T,{sort:!1}),d=Object.assign(I,R.query);let x=t.stringify(d,L);x&&(x=`?${x}`);let J=P(R.url);return R.fragmentIdentifier&&(J=`#${L[c]?v(R.fragmentIdentifier,L):R.fragmentIdentifier}`),`${$}${x}${J}`},t.pick=(R,L,$)=>{$=Object.assign({parseFragmentIdentifier:!0,[c]:!1},$);const{url:T,query:I,fragmentIdentifier:d}=t.parseUrl(R,$);return t.stringifyUrl({url:T,query:i(I,L),fragmentIdentifier:d},$)},t.exclude=(R,L,$)=>{const T=Array.isArray(L)?I=>!L.includes(I):(I,d)=>!L(I,d);return t.pick(R,T,$)}})(Io);const F5={waku:{publish:"waku_publish",batchPublish:"waku_batchPublish",subscribe:"waku_subscribe",batchSubscribe:"waku_batchSubscribe",subscription:"waku_subscription",unsubscribe:"waku_unsubscribe",batchUnsubscribe:"waku_batchUnsubscribe"},irn:{publish:"irn_publish",batchPublish:"irn_batchPublish",subscribe:"irn_subscribe",batchSubscribe:"irn_batchSubscribe",subscription:"irn_subscription",unsubscribe:"irn_unsubscribe",batchUnsubscribe:"irn_batchUnsubscribe"},iridium:{publish:"iridium_publish",batchPublish:"iridium_batchPublish",subscribe:"iridium_subscribe",batchSubscribe:"iridium_batchSubscribe",subscription:"iridium_subscription",unsubscribe:"iridium_unsubscribe",batchUnsubscribe:"iridium_batchUnsubscribe"}};function B5(t,e=[]){const r=[];return Object.keys(t).forEach(n=>{if(e.length&&!e.includes(n))return;const i=t[n];r.push(...i.accounts)}),r}function _1(t,e){return t.includes(":")?[t]:e.chains||[]}const E1="base10",$r="base16",Cu="base64pad",Iu="utf8",x1=0,ki=1,k5=0,C1=1,Su=12,Au=32;function H5(){const t=cu.generateKeyPair();return{privateKey:Dr(t.secretKey,$r),publicKey:Dr(t.publicKey,$r)}}function Ou(){const t=xs.randomBytes(Au);return Dr(t,$r)}function z5(t,e){const r=cu.sharedKey(Hr(t,$r),Hr(e,$r)),n=new sv(Wa.SHA256,r).expand(Au);return Dr(n,$r)}function W5(t){const e=Wa.hash(Hr(t,$r));return Dr(e,$r)}function Ss(t){const e=Wa.hash(Hr(t,Iu));return Dr(e,$r)}function q5(t){return Hr(`${t}`,E1)}function So(t){return Number(Dr(t,E1))}function V5(t){const e=q5(typeof t.type<"u"?t.type:x1);if(So(e)===ki&&typeof t.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");const r=typeof t.senderPublicKey<"u"?Hr(t.senderPublicKey,$r):void 0,n=typeof t.iv<"u"?Hr(t.iv,$r):xs.randomBytes(Su),i=new tu.ChaCha20Poly1305(Hr(t.symKey,$r)).seal(n,Hr(t.message,Iu));return G5({type:e,sealed:i,iv:n,senderPublicKey:r})}function K5(t){const e=new tu.ChaCha20Poly1305(Hr(t.symKey,$r)),{sealed:r,iv:n}=Ka(t.encoded),i=e.open(n,r);if(i===null)throw new Error("Failed to decrypt");return Dr(i,Iu)}function G5(t){if(So(t.type)===ki){if(typeof t.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");return Dr(uu([t.type,t.senderPublicKey,t.iv,t.sealed]),Cu)}return Dr(uu([t.type,t.iv,t.sealed]),Cu)}function Ka(t){const e=Hr(t,Cu),r=e.slice(k5,C1),n=C1;if(So(r)===ki){const l=n+Au,h=l+Su,f=e.slice(n,l),v=e.slice(l,h),E=e.slice(h);return{type:r,sealed:E,iv:v,senderPublicKey:f}}const i=n+Su,o=e.slice(n,i),c=e.slice(i);return{type:r,sealed:c,iv:o}}function Z5(t,e){const r=Ka(t);return I1({type:So(r.type),senderPublicKey:typeof r.senderPublicKey<"u"?Dr(r.senderPublicKey,$r):void 0,receiverPublicKey:e?.receiverPublicKey})}function I1(t){const e=t?.type||x1;if(e===ki){if(typeof t?.senderPublicKey>"u")throw new Error("missing sender public key");if(typeof t?.receiverPublicKey>"u")throw new Error("missing receiver public key")}return{type:e,senderPublicKey:t?.senderPublicKey,receiverPublicKey:t?.receiverPublicKey}}function S1(t){return t.type===ki&&typeof t.senderPublicKey=="string"&&typeof t.receiverPublicKey=="string"}var Y5=Object.defineProperty,A1=Object.getOwnPropertySymbols,J5=Object.prototype.hasOwnProperty,X5=Object.prototype.propertyIsEnumerable,O1=(t,e,r)=>e in t?Y5(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,D1=(t,e)=>{for(var r in e||(e={}))J5.call(e,r)&&O1(t,r,e[r]);if(A1)for(var r of A1(e))X5.call(e,r)&&O1(t,r,e[r]);return t};const Q5="ReactNative",ui={reactNative:"react-native",node:"node",browser:"browser",unknown:"unknown"},eb="js";function Du(){return typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.node<"u"}function $1(){return!p1()&&!!_u()&&navigator.product===Q5}function $u(){return!Du()&&!!_u()}function Pu(){return $1()?ui.reactNative:Du()?ui.node:$u()?ui.browser:ui.unknown}function tb(t,e){let r=Io.parse(t);return r=D1(D1({},r),e),t=Io.stringify(r),t}function rb(){return m1()||{name:"",description:"",url:"",icons:[""]}}function nb(){if(Pu()===ui.reactNative&&typeof global<"u"&&typeof(global==null?void 0:global.Platform)<"u"){const{OS:r,Version:n}=global.Platform;return[r,n].join("-")}const t=zy();if(t===null)return"unknown";const e=t.os?t.os.replace(" ","").toLowerCase():"unknown";return t.type==="browser"?[e,t.name,t.version].join("-"):[e,t.version].join("-")}function ib(){var t;const e=Pu();return e===ui.browser?[e,((t=g1())==null?void 0:t.host)||"unknown"].join(":"):e}function sb(t,e,r){const n=nb(),i=ib();return[[t,e].join("-"),[eb,r].join("-"),n,i].join("/")}function ob({protocol:t,version:e,relayUrl:r,sdkVersion:n,auth:i,projectId:o,useOnCloseEvent:c}){const l=r.split("?"),h=sb(t,e,n),f={auth:i,ua:h,projectId:o,useOnCloseEvent:c||void 0},v=tb(l[1]||"",f);return l[0]+"?"+v}function Hi(t,e){return t.filter(r=>e.includes(r)).length===t.length}function P1(t){return Object.fromEntries(t.entries())}function T1(t){return new Map(Object.entries(t))}function As(t=Te.FIVE_MINUTES,e){const r=Te.toMiliseconds(t||Te.FIVE_MINUTES);let n,i,o;return{resolve:c=>{o&&n&&(clearTimeout(o),n(c))},reject:c=>{o&&i&&(clearTimeout(o),i(c))},done:()=>new Promise((c,l)=>{o=setTimeout(()=>{l(new Error(e))},r),n=c,i=l})}}function Ga(t,e,r){return new Promise(async(n,i)=>{const o=setTimeout(()=>i(new Error(r)),e);try{const c=await t;n(c)}catch(c){i(c)}clearTimeout(o)})}function N1(t,e){if(typeof e=="string"&&e.startsWith(`${t}:`))return e;if(t.toLowerCase()==="topic"){if(typeof e!="string")throw new Error('Value must be "string" for expirer target type: topic');return`topic:${e}`}else if(t.toLowerCase()==="id"){if(typeof e!="number")throw new Error('Value must be "number" for expirer target type: id');return`id:${e}`}throw new Error(`Unknown expirer target type: ${t}`)}function ab(t){return N1("topic",t)}function cb(t){return N1("id",t)}function R1(t){const[e,r]=t.split(":"),n={id:void 0,topic:void 0};if(e==="topic"&&typeof r=="string")n.topic=r;else if(e==="id"&&Number.isInteger(Number(r)))n.id=Number(r);else throw new Error(`Invalid target, expected id:number or topic:string, got ${e}:${r}`);return n}function En(t,e){return Te.fromMiliseconds((e||Date.now())+Te.toMiliseconds(t))}function hi(t){return Date.now()>=Te.toMiliseconds(t)}function rr(t,e){return`${t}${e?`:${e}`:""}`}function Tu(t=[],e=[]){return[...new Set([...t,...e])]}async function lb({id:t,topic:e,wcDeepLink:r}){try{if(!r)return;const n=typeof r=="string"?JSON.parse(r):r;let i=n?.href;if(typeof i!="string")return;i.endsWith("/")&&(i=i.slice(0,-1));const o=`${i}/wc?requestId=${t}&sessionTopic=${e}`,c=Pu();c===ui.browser?o.startsWith("https://")?window.open(o,"_blank","noreferrer noopener"):window.open(o,"_self","noreferrer noopener"):c===ui.reactNative&&typeof(global==null?void 0:global.Linking)<"u"&&await global.Linking.openURL(o)}catch(n){console.error(n)}}const ub="irn";function Nu(t){return t?.relay||{protocol:ub}}function Za(t){const e=F5[t];if(typeof e>"u")throw new Error(`Relay Protocol not supported: ${t}`);return e}var hb=Object.defineProperty,L1=Object.getOwnPropertySymbols,fb=Object.prototype.hasOwnProperty,db=Object.prototype.propertyIsEnumerable,M1=(t,e,r)=>e in t?hb(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,pb=(t,e)=>{for(var r in e||(e={}))fb.call(e,r)&&M1(t,r,e[r]);if(L1)for(var r of L1(e))db.call(e,r)&&M1(t,r,e[r]);return t};function gb(t,e="-"){const r={},n="relay"+e;return Object.keys(t).forEach(i=>{if(i.startsWith(n)){const o=i.replace(n,""),c=t[i];r[o]=c}}),r}function mb(t){const e=t.indexOf(":"),r=t.indexOf("?")!==-1?t.indexOf("?"):void 0,n=t.substring(0,e),i=t.substring(e+1,r).split("@"),o=typeof r<"u"?t.substring(r):"",c=Io.parse(o);return{protocol:n,topic:wb(i[0]),version:parseInt(i[1],10),symKey:c.symKey,relay:gb(c)}}function wb(t){return t.startsWith("//")?t.substring(2):t}function vb(t,e="-"){const r="relay",n={};return Object.keys(t).forEach(i=>{const o=r+e+i;t[i]&&(n[o]=t[i])}),n}function yb(t){return`${t.protocol}:${t.topic}@${t.version}?`+Io.stringify(pb({symKey:t.symKey},vb(t.relay)))}function Os(t){const e=[];return t.forEach(r=>{const[n,i]=r.split(":");e.push(`${n}:${i}`)}),e}function bb(t){const e=[];return Object.values(t).forEach(r=>{e.push(...Os(r.accounts))}),e}function _b(t,e){const r=[];return Object.values(t).forEach(n=>{Os(n.accounts).includes(e)&&r.push(...n.methods)}),r}function Eb(t,e){const r=[];return Object.values(t).forEach(n=>{Os(n.accounts).includes(e)&&r.push(...n.events)}),r}function xb(t,e){const r=Xa(t,e);if(r)throw new Error(r.message);const n={};for(const[i,o]of Object.entries(t))n[i]={methods:o.methods,events:o.events,chains:o.accounts.map(c=>`${c.split(":")[0]}:${c.split(":")[1]}`)};return n}function Ru(t){return t.includes(":")}function Ya(t){return Ru(t)?t.split(":")[0]:t}const Cb={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}},Ib={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 _e(t,e){const{message:r,code:n}=Ib[t];return{message:e?`${r} ${e}`:r,code:n}}function Yt(t,e){const{message:r,code:n}=Cb[t];return{message:e?`${r} ${e}`:r,code:n}}function Pn(t,e){return Array.isArray(t)?typeof e<"u"&&t.length?t.every(e):!0:!1}function Ds(t){return Object.getPrototypeOf(t)===Object.prototype&&Object.keys(t).length}function Pr(t){return typeof t>"u"}function gr(t,e){return e&&Pr(t)?!0:typeof t=="string"&&!!t.trim().length}function Lu(t,e){return e&&Pr(t)?!0:typeof t=="number"&&!isNaN(t)}function Sb(t,e){const{requiredNamespaces:r}=e,n=Object.keys(t.namespaces),i=Object.keys(r);let o=!0;return Hi(i,n)?(n.forEach(c=>{const{accounts:l,methods:h,events:f}=t.namespaces[c],v=Os(l),E=r[c];(!Hi(_1(c,E),v)||!Hi(E.methods,h)||!Hi(E.events,f))&&(o=!1)}),o):!1}function Ja(t){return gr(t,!1)&&t.includes(":")?t.split(":").length===2:!1}function Ab(t){if(gr(t,!1)&&t.includes(":")){const e=t.split(":");if(e.length===3){const r=e[0]+":"+e[1];return!!e[2]&&Ja(r)}}return!1}function Ob(t){if(gr(t,!1))try{return typeof new URL(t)<"u"}catch{return!1}return!1}function Db(t){var e;return(e=t?.proposer)==null?void 0:e.publicKey}function $b(t){return t?.topic}function Pb(t,e){let r=null;return gr(t?.publicKey,!1)||(r=_e("MISSING_OR_INVALID",`${e} controller public key should be a string`)),r}function U1(t){let e=!0;return Pn(t)?t.length&&(e=t.every(r=>gr(r,!1))):e=!1,e}function Tb(t,e,r){let n=null;return Pn(e)&&e.length?e.forEach(i=>{n||Ja(i)||(n=Yt("UNSUPPORTED_CHAINS",`${r}, chain ${i} should be a string and conform to "namespace:chainId" format`))}):Ja(t)||(n=Yt("UNSUPPORTED_CHAINS",`${r}, chains must be defined as "namespace:chainId" e.g. "eip155:1": {...} in the namespace key OR as an array of CAIP-2 chainIds e.g. eip155: { chains: ["eip155:1", "eip155:5"] }`)),n}function Nb(t,e,r){let n=null;return Object.entries(t).forEach(([i,o])=>{if(n)return;const c=Tb(i,_1(i,o),`${e} ${r}`);c&&(n=c)}),n}function Rb(t,e){let r=null;return Pn(t)?t.forEach(n=>{r||Ab(n)||(r=Yt("UNSUPPORTED_ACCOUNTS",`${e}, account ${n} should be a string and conform to "namespace:chainId:address" format`))}):r=Yt("UNSUPPORTED_ACCOUNTS",`${e}, accounts should be an array of strings conforming to "namespace:chainId:address" format`),r}function Lb(t,e){let r=null;return Object.values(t).forEach(n=>{if(r)return;const i=Rb(n?.accounts,`${e} namespace`);i&&(r=i)}),r}function Mb(t,e){let r=null;return U1(t?.methods)?U1(t?.events)||(r=Yt("UNSUPPORTED_EVENTS",`${e}, events should be an array of strings or empty array for no events`)):r=Yt("UNSUPPORTED_METHODS",`${e}, methods should be an array of strings or empty array for no methods`),r}function j1(t,e){let r=null;return Object.values(t).forEach(n=>{if(r)return;const i=Mb(n,`${e}, namespace`);i&&(r=i)}),r}function Ub(t,e,r){let n=null;if(t&&Ds(t)){const i=j1(t,e);i&&(n=i);const o=Nb(t,e,r);o&&(n=o)}else n=_e("MISSING_OR_INVALID",`${e}, ${r} should be an object with data`);return n}function Xa(t,e){let r=null;if(t&&Ds(t)){const n=j1(t,e);n&&(r=n);const i=Lb(t,e);i&&(r=i)}else r=_e("MISSING_OR_INVALID",`${e}, namespaces should be an object with data`);return r}function F1(t){return gr(t.protocol,!0)}function jb(t,e){let r=!1;return e&&!t?r=!0:t&&Pn(t)&&t.length&&t.forEach(n=>{r=F1(n)}),r}function Fb(t){return typeof t=="number"}function zr(t){return typeof t<"u"&&typeof t!==null}function Bb(t){return!(!t||typeof t!="object"||!t.code||!Lu(t.code,!1)||!t.message||!gr(t.message,!1))}function kb(t){return!(Pr(t)||!gr(t.method,!1))}function Hb(t){return!(Pr(t)||Pr(t.result)&&Pr(t.error)||!Lu(t.id,!1)||!gr(t.jsonrpc,!1))}function zb(t){return!(Pr(t)||!gr(t.name,!1))}function B1(t,e){return!(!Ja(e)||!bb(t).includes(e))}function Wb(t,e,r){return gr(r,!1)?_b(t,e).includes(r):!1}function qb(t,e,r){return gr(r,!1)?Eb(t,e).includes(r):!1}function k1(t,e,r){let n=null;const i=Vb(t),o=Kb(e),c=Object.keys(i),l=Object.keys(o),h=H1(Object.keys(t)),f=H1(Object.keys(e)),v=h.filter(E=>!f.includes(E));return v.length&&(n=_e("NON_CONFORMING_NAMESPACES",`${r} namespaces keys don't satisfy requiredNamespaces.
14
+ ***************************************************************************** */var Eu=function(t,e){return Eu=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)n.hasOwnProperty(i)&&(r[i]=n[i])},Eu(t,e)};function U5(t,e){Eu(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var xu=function(){return xu=Object.assign||function(e){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e},xu.apply(this,arguments)};function j5(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r}function B5(t,e,r,n){var i=arguments.length,o=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(o=(i<3?c(o):i>3?c(e,r,o):c(e,r))||o);return i>3&&o&&Object.defineProperty(e,r,o),o}function k5(t,e){return function(r,n){e(r,n,t)}}function H5(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function z5(t,e,r,n){function i(o){return o instanceof r?o:new r(function(c){c(o)})}return new(r||(r=Promise))(function(o,c){function l(v){try{d(n.next(v))}catch(x){c(x)}}function h(v){try{d(n.throw(v))}catch(x){c(x)}}function d(v){v.done?o(v.value):i(v.value).then(l,h)}d((n=n.apply(t,e||[])).next())})}function W5(t,e){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,c;return c={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function l(d){return function(v){return h([d,v])}}function h(d){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(o=d[0]&2?i.return:d[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,d[1])).done)return o;switch(i=0,o&&(d=[d[0]&2,o.value]),d[0]){case 0:case 1:o=d;break;case 4:return r.label++,{value:d[1],done:!1};case 5:r.label++,i=d[1],d=[0];continue;case 7:d=r.ops.pop(),r.trys.pop();continue;default:if(o=r.trys,!(o=o.length>0&&o[o.length-1])&&(d[0]===6||d[0]===2)){r=0;continue}if(d[0]===3&&(!o||d[1]>o[0]&&d[1]<o[3])){r.label=d[1];break}if(d[0]===6&&r.label<o[1]){r.label=o[1],o=d;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(d);break}o[2]&&r.ops.pop(),r.trys.pop();continue}d=e.call(t,r)}catch(v){d=[6,v],i=0}finally{n=o=0}if(d[0]&5)throw d[1];return{value:d[0]?d[1]:void 0,done:!0}}}function q5(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}function V5(t,e){for(var r in t)r!=="default"&&!e.hasOwnProperty(r)&&(e[r]=t[r])}function Cu(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function v1(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,o=[],c;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(l){c={error:l}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(c)throw c.error}}return o}function K5(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(v1(arguments[e]));return t}function G5(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;for(var n=Array(t),i=0,e=0;e<r;e++)for(var o=arguments[e],c=0,l=o.length;c<l;c++,i++)n[i]=o[c];return n}function Io(t){return this instanceof Io?(this.v=t,this):new Io(t)}function Z5(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(t,e||[]),i,o=[];return i={},c("next"),c("throw"),c("return"),i[Symbol.asyncIterator]=function(){return this},i;function c(_){n[_]&&(i[_]=function(A){return new Promise(function(P,L){o.push([_,A,P,L])>1||l(_,A)})})}function l(_,A){try{h(n[_](A))}catch(P){x(o[0][3],P)}}function h(_){_.value instanceof Io?Promise.resolve(_.value.v).then(d,v):x(o[0][2],_)}function d(_){l("next",_)}function v(_){l("throw",_)}function x(_,A){_(A),o.shift(),o.length&&l(o[0][0],o[0][1])}}function Y5(t){var e,r;return e={},n("next"),n("throw",function(i){throw i}),n("return"),e[Symbol.iterator]=function(){return this},e;function n(i,o){e[i]=t[i]?function(c){return(r=!r)?{value:Io(t[i](c)),done:i==="return"}:o?o(c):c}:o}}function J5(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof Cu=="function"?Cu(t):t[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(o){r[o]=t[o]&&function(c){return new Promise(function(l,h){c=t[o](c),i(l,h,c.done,c.value)})}}function i(o,c,l,h){Promise.resolve(h).then(function(d){o({value:d,done:l})},c)}}function X5(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function Q5(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}function eb(t){return t&&t.__esModule?t:{default:t}}function tb(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}function rb(t,e,r){if(!e.has(t))throw new TypeError("attempted to set private field on non-instance");return e.set(t,r),r}var nb=Object.freeze({__proto__:null,__extends:U5,get __assign(){return xu},__rest:j5,__decorate:B5,__param:k5,__metadata:H5,__awaiter:z5,__generator:W5,__createBinding:q5,__exportStar:V5,__values:Cu,__read:v1,__spread:K5,__spreadArrays:G5,__await:Io,__asyncGenerator:Z5,__asyncDelegator:Y5,__asyncValues:J5,__makeTemplateObject:X5,__importStar:Q5,__importDefault:eb,__classPrivateFieldGet:tb,__classPrivateFieldSet:rb}),Qa=Ui(nb),Iu={},Ao={},y1;function ib(){if(y1)return Ao;y1=1,Object.defineProperty(Ao,"__esModule",{value:!0}),Ao.delay=void 0;function t(e){return new Promise(r=>{setTimeout(()=>{r(!0)},e)})}return Ao.delay=t,Ao}var ji={},Au={},Bi={},b1;function sb(){return b1||(b1=1,Object.defineProperty(Bi,"__esModule",{value:!0}),Bi.ONE_THOUSAND=Bi.ONE_HUNDRED=void 0,Bi.ONE_HUNDRED=100,Bi.ONE_THOUSAND=1e3),Bi}var $u={},_1;function ob(){return _1||(_1=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ONE_YEAR=t.FOUR_WEEKS=t.THREE_WEEKS=t.TWO_WEEKS=t.ONE_WEEK=t.THIRTY_DAYS=t.SEVEN_DAYS=t.FIVE_DAYS=t.THREE_DAYS=t.ONE_DAY=t.TWENTY_FOUR_HOURS=t.TWELVE_HOURS=t.SIX_HOURS=t.THREE_HOURS=t.ONE_HOUR=t.SIXTY_MINUTES=t.THIRTY_MINUTES=t.TEN_MINUTES=t.FIVE_MINUTES=t.ONE_MINUTE=t.SIXTY_SECONDS=t.THIRTY_SECONDS=t.TEN_SECONDS=t.FIVE_SECONDS=t.ONE_SECOND=void 0,t.ONE_SECOND=1,t.FIVE_SECONDS=5,t.TEN_SECONDS=10,t.THIRTY_SECONDS=30,t.SIXTY_SECONDS=60,t.ONE_MINUTE=t.SIXTY_SECONDS,t.FIVE_MINUTES=t.ONE_MINUTE*5,t.TEN_MINUTES=t.ONE_MINUTE*10,t.THIRTY_MINUTES=t.ONE_MINUTE*30,t.SIXTY_MINUTES=t.ONE_MINUTE*60,t.ONE_HOUR=t.SIXTY_MINUTES,t.THREE_HOURS=t.ONE_HOUR*3,t.SIX_HOURS=t.ONE_HOUR*6,t.TWELVE_HOURS=t.ONE_HOUR*12,t.TWENTY_FOUR_HOURS=t.ONE_HOUR*24,t.ONE_DAY=t.TWENTY_FOUR_HOURS,t.THREE_DAYS=t.ONE_DAY*3,t.FIVE_DAYS=t.ONE_DAY*5,t.SEVEN_DAYS=t.ONE_DAY*7,t.THIRTY_DAYS=t.ONE_DAY*30,t.ONE_WEEK=t.SEVEN_DAYS,t.TWO_WEEKS=t.ONE_WEEK*2,t.THREE_WEEKS=t.ONE_WEEK*3,t.FOUR_WEEKS=t.ONE_WEEK*4,t.ONE_YEAR=t.ONE_DAY*365}($u)),$u}var E1;function x1(){return E1||(E1=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=Qa;e.__exportStar(sb(),t),e.__exportStar(ob(),t)}(Au)),Au}var C1;function ab(){if(C1)return ji;C1=1,Object.defineProperty(ji,"__esModule",{value:!0}),ji.fromMiliseconds=ji.toMiliseconds=void 0;const t=x1();function e(n){return n*t.ONE_THOUSAND}ji.toMiliseconds=e;function r(n){return Math.floor(n/t.ONE_THOUSAND)}return ji.fromMiliseconds=r,ji}var I1;function cb(){return I1||(I1=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=Qa;e.__exportStar(ib(),t),e.__exportStar(ab(),t)}(Iu)),Iu}var As={},A1;function lb(){if(A1)return As;A1=1,Object.defineProperty(As,"__esModule",{value:!0}),As.Watch=void 0;class t{constructor(){this.timestamps=new Map}start(r){if(this.timestamps.has(r))throw new Error(`Watch already started for label: ${r}`);this.timestamps.set(r,{started:Date.now()})}stop(r){const n=this.get(r);if(typeof n.elapsed<"u")throw new Error(`Watch already stopped for label: ${r}`);const i=Date.now()-n.started;this.timestamps.set(r,{started:n.started,elapsed:i})}get(r){const n=this.timestamps.get(r);if(typeof n>"u")throw new Error(`No timestamp found for label: ${r}`);return n}elapsed(r){const n=this.get(r);return n.elapsed||Date.now()-n.started}}return As.Watch=t,As.default=t,As}var Ou={},$o={},$1;function ub(){if($1)return $o;$1=1,Object.defineProperty($o,"__esModule",{value:!0}),$o.IWatch=void 0;class t{}return $o.IWatch=t,$o}var O1;function hb(){return O1||(O1=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),Qa.__exportStar(ub(),t)}(Ou)),Ou}(function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=Qa;e.__exportStar(cb(),t),e.__exportStar(lb(),t),e.__exportStar(hb(),t),e.__exportStar(x1(),t)})(Se);var St={};Object.defineProperty(St,"__esModule",{value:!0}),St.getLocalStorage=St.getLocalStorageOrThrow=St.getCrypto=St.getCryptoOrThrow=D1=St.getLocation=St.getLocationOrThrow=Su=St.getNavigator=St.getNavigatorOrThrow=S1=St.getDocument=St.getDocumentOrThrow=St.getFromWindowOrThrow=St.getFromWindow=void 0;function ki(t){let e;return typeof window<"u"&&typeof window[t]<"u"&&(e=window[t]),e}St.getFromWindow=ki;function $s(t){const e=ki(t);if(!e)throw new Error(`${t} is not defined in Window`);return e}St.getFromWindowOrThrow=$s;function fb(){return $s("document")}St.getDocumentOrThrow=fb;function db(){return ki("document")}var S1=St.getDocument=db;function pb(){return $s("navigator")}St.getNavigatorOrThrow=pb;function gb(){return ki("navigator")}var Su=St.getNavigator=gb;function mb(){return $s("location")}St.getLocationOrThrow=mb;function wb(){return ki("location")}var D1=St.getLocation=wb;function vb(){return $s("crypto")}St.getCryptoOrThrow=vb;function yb(){return ki("crypto")}St.getCrypto=yb;function bb(){return $s("localStorage")}St.getLocalStorageOrThrow=bb;function _b(){return ki("localStorage")}St.getLocalStorage=_b;var Du={};Object.defineProperty(Du,"__esModule",{value:!0});var P1=Du.getWindowMetadata=void 0;const T1=St;function Eb(){let t,e;try{t=T1.getDocumentOrThrow(),e=T1.getLocationOrThrow()}catch{return null}function r(){const x=t.getElementsByTagName("link"),_=[];for(let A=0;A<x.length;A++){const P=x[A],L=P.getAttribute("rel");if(L&&L.toLowerCase().indexOf("icon")>-1){const k=P.getAttribute("href");if(k)if(k.toLowerCase().indexOf("https:")===-1&&k.toLowerCase().indexOf("http:")===-1&&k.indexOf("//")!==0){let q=e.protocol+"//"+e.host;if(k.indexOf("/")===0)q+=k;else{const R=e.pathname.split("/");R.pop();const F=R.join("/");q+=F+"/"+k}_.push(q)}else if(k.indexOf("//")===0){const q=e.protocol+k;_.push(q)}else _.push(k)}}return _}function n(...x){const _=t.getElementsByTagName("meta");for(let A=0;A<_.length;A++){const P=_[A],L=["itemprop","property","name"].map(k=>P.getAttribute(k)).filter(k=>k?x.includes(k):!1);if(L.length&&L){const k=P.getAttribute("content");if(k)return k}}return""}function i(){let x=n("name","og:site_name","og:title","twitter:title");return x||(x=t.title),x}function o(){return n("description","og:description","twitter:description","keywords")}const c=i(),l=o(),h=e.origin,d=r();return{description:l,url:h,icons:d,name:c}}P1=Du.getWindowMetadata=Eb;var Oo={},xb=t=>encodeURIComponent(t).replace(/[!'()*]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`),R1="%[a-f0-9]{2}",N1=new RegExp("("+R1+")|([^%]+?)","gi"),F1=new RegExp("("+R1+")+","gi");function Pu(t,e){try{return[decodeURIComponent(t.join(""))]}catch{}if(t.length===1)return t;e=e||1;var r=t.slice(0,e),n=t.slice(e);return Array.prototype.concat.call([],Pu(r),Pu(n))}function Cb(t){try{return decodeURIComponent(t)}catch{for(var e=t.match(N1)||[],r=1;r<e.length;r++)t=Pu(e,r).join(""),e=t.match(N1)||[];return t}}function Ib(t){for(var e={"%FE%FF":"\uFFFD\uFFFD","%FF%FE":"\uFFFD\uFFFD"},r=F1.exec(t);r;){try{e[r[0]]=decodeURIComponent(r[0])}catch{var n=Cb(r[0]);n!==r[0]&&(e[r[0]]=n)}r=F1.exec(t)}e["%C2"]="\uFFFD";for(var i=Object.keys(e),o=0;o<i.length;o++){var c=i[o];t=t.replace(new RegExp(c,"g"),e[c])}return t}var Ab=function(t){if(typeof t!="string")throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof t+"`");try{return t=t.replace(/\+/g," "),decodeURIComponent(t)}catch{return Ib(t)}},$b=(t,e)=>{if(!(typeof t=="string"&&typeof e=="string"))throw new TypeError("Expected the arguments to be of type `string`");if(e==="")return[t];const r=t.indexOf(e);return r===-1?[t]:[t.slice(0,r),t.slice(r+e.length)]},Ob=function(t,e){for(var r={},n=Object.keys(t),i=Array.isArray(e),o=0;o<n.length;o++){var c=n[o],l=t[c];(i?e.indexOf(c)!==-1:e(c,l,t))&&(r[c]=l)}return r};(function(t){const e=xb,r=Ab,n=$b,i=Ob,o=R=>R==null,c=Symbol("encodeFragmentIdentifier");function l(R){switch(R.arrayFormat){case"index":return F=>($,T)=>{const C=$.length;return T===void 0||R.skipNull&&T===null||R.skipEmptyString&&T===""?$:T===null?[...$,[v(F,R),"[",C,"]"].join("")]:[...$,[v(F,R),"[",v(C,R),"]=",v(T,R)].join("")]};case"bracket":return F=>($,T)=>T===void 0||R.skipNull&&T===null||R.skipEmptyString&&T===""?$:T===null?[...$,[v(F,R),"[]"].join("")]:[...$,[v(F,R),"[]=",v(T,R)].join("")];case"colon-list-separator":return F=>($,T)=>T===void 0||R.skipNull&&T===null||R.skipEmptyString&&T===""?$:T===null?[...$,[v(F,R),":list="].join("")]:[...$,[v(F,R),":list=",v(T,R)].join("")];case"comma":case"separator":case"bracket-separator":{const F=R.arrayFormat==="bracket-separator"?"[]=":"=";return $=>(T,C)=>C===void 0||R.skipNull&&C===null||R.skipEmptyString&&C===""?T:(C=C===null?"":C,T.length===0?[[v($,R),F,v(C,R)].join("")]:[[T,v(C,R)].join(R.arrayFormatSeparator)])}default:return F=>($,T)=>T===void 0||R.skipNull&&T===null||R.skipEmptyString&&T===""?$:T===null?[...$,v(F,R)]:[...$,[v(F,R),"=",v(T,R)].join("")]}}function h(R){let F;switch(R.arrayFormat){case"index":return($,T,C)=>{if(F=/\[(\d*)\]$/.exec($),$=$.replace(/\[\d*\]$/,""),!F){C[$]=T;return}C[$]===void 0&&(C[$]={}),C[$][F[1]]=T};case"bracket":return($,T,C)=>{if(F=/(\[\])$/.exec($),$=$.replace(/\[\]$/,""),!F){C[$]=T;return}if(C[$]===void 0){C[$]=[T];return}C[$]=[].concat(C[$],T)};case"colon-list-separator":return($,T,C)=>{if(F=/(:list)$/.exec($),$=$.replace(/:list$/,""),!F){C[$]=T;return}if(C[$]===void 0){C[$]=[T];return}C[$]=[].concat(C[$],T)};case"comma":case"separator":return($,T,C)=>{const f=typeof T=="string"&&T.includes(R.arrayFormatSeparator),E=typeof T=="string"&&!f&&x(T,R).includes(R.arrayFormatSeparator);T=E?x(T,R):T;const Z=f||E?T.split(R.arrayFormatSeparator).map(z=>x(z,R)):T===null?T:x(T,R);C[$]=Z};case"bracket-separator":return($,T,C)=>{const f=/(\[\])$/.test($);if($=$.replace(/\[\]$/,""),!f){C[$]=T&&x(T,R);return}const E=T===null?[]:T.split(R.arrayFormatSeparator).map(Z=>x(Z,R));if(C[$]===void 0){C[$]=E;return}C[$]=[].concat(C[$],E)};default:return($,T,C)=>{if(C[$]===void 0){C[$]=T;return}C[$]=[].concat(C[$],T)}}}function d(R){if(typeof R!="string"||R.length!==1)throw new TypeError("arrayFormatSeparator must be single character string")}function v(R,F){return F.encode?F.strict?e(R):encodeURIComponent(R):R}function x(R,F){return F.decode?r(R):R}function _(R){return Array.isArray(R)?R.sort():typeof R=="object"?_(Object.keys(R)).sort((F,$)=>Number(F)-Number($)).map(F=>R[F]):R}function A(R){const F=R.indexOf("#");return F!==-1&&(R=R.slice(0,F)),R}function P(R){let F="";const $=R.indexOf("#");return $!==-1&&(F=R.slice($)),F}function L(R){R=A(R);const F=R.indexOf("?");return F===-1?"":R.slice(F+1)}function k(R,F){return F.parseNumbers&&!Number.isNaN(Number(R))&&typeof R=="string"&&R.trim()!==""?R=Number(R):F.parseBooleans&&R!==null&&(R.toLowerCase()==="true"||R.toLowerCase()==="false")&&(R=R.toLowerCase()==="true"),R}function q(R,F){F=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},F),d(F.arrayFormatSeparator);const $=h(F),T=Object.create(null);if(typeof R!="string"||(R=R.trim().replace(/^[?#&]/,""),!R))return T;for(const C of R.split("&")){if(C==="")continue;let[f,E]=n(F.decode?C.replace(/\+/g," "):C,"=");E=E===void 0?null:["comma","separator","bracket-separator"].includes(F.arrayFormat)?E:x(E,F),$(x(f,F),E,T)}for(const C of Object.keys(T)){const f=T[C];if(typeof f=="object"&&f!==null)for(const E of Object.keys(f))f[E]=k(f[E],F);else T[C]=k(f,F)}return F.sort===!1?T:(F.sort===!0?Object.keys(T).sort():Object.keys(T).sort(F.sort)).reduce((C,f)=>{const E=T[f];return E&&typeof E=="object"&&!Array.isArray(E)?C[f]=_(E):C[f]=E,C},Object.create(null))}t.extract=L,t.parse=q,t.stringify=(R,F)=>{if(!R)return"";F=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},F),d(F.arrayFormatSeparator);const $=E=>F.skipNull&&o(R[E])||F.skipEmptyString&&R[E]==="",T=l(F),C={};for(const E of Object.keys(R))$(E)||(C[E]=R[E]);const f=Object.keys(C);return F.sort!==!1&&f.sort(F.sort),f.map(E=>{const Z=R[E];return Z===void 0?"":Z===null?v(E,F):Array.isArray(Z)?Z.length===0&&F.arrayFormat==="bracket-separator"?v(E,F)+"[]":Z.reduce(T(E),[]).join("&"):v(E,F)+"="+v(Z,F)}).filter(E=>E.length>0).join("&")},t.parseUrl=(R,F)=>{F=Object.assign({decode:!0},F);const[$,T]=n(R,"#");return Object.assign({url:$.split("?")[0]||"",query:q(L(R),F)},F&&F.parseFragmentIdentifier&&T?{fragmentIdentifier:x(T,F)}:{})},t.stringifyUrl=(R,F)=>{F=Object.assign({encode:!0,strict:!0,[c]:!0},F);const $=A(R.url).split("?")[0]||"",T=t.extract(R.url),C=t.parse(T,{sort:!1}),f=Object.assign(C,R.query);let E=t.stringify(f,F);E&&(E=`?${E}`);let Z=P(R.url);return R.fragmentIdentifier&&(Z=`#${F[c]?v(R.fragmentIdentifier,F):R.fragmentIdentifier}`),`${$}${E}${Z}`},t.pick=(R,F,$)=>{$=Object.assign({parseFragmentIdentifier:!0,[c]:!1},$);const{url:T,query:C,fragmentIdentifier:f}=t.parseUrl(R,$);return t.stringifyUrl({url:T,query:i(C,F),fragmentIdentifier:f},$)},t.exclude=(R,F,$)=>{const T=Array.isArray(F)?C=>!F.includes(C):(C,f)=>!F(C,f);return t.pick(R,T,$)}})(Oo);const Sb={waku:{publish:"waku_publish",batchPublish:"waku_batchPublish",subscribe:"waku_subscribe",batchSubscribe:"waku_batchSubscribe",subscription:"waku_subscription",unsubscribe:"waku_unsubscribe",batchUnsubscribe:"waku_batchUnsubscribe"},irn:{publish:"irn_publish",batchPublish:"irn_batchPublish",subscribe:"irn_subscribe",batchSubscribe:"irn_batchSubscribe",subscription:"irn_subscription",unsubscribe:"irn_unsubscribe",batchUnsubscribe:"irn_batchUnsubscribe"},iridium:{publish:"iridium_publish",batchPublish:"iridium_batchPublish",subscribe:"iridium_subscribe",batchSubscribe:"iridium_batchSubscribe",subscription:"iridium_subscription",unsubscribe:"iridium_unsubscribe",batchUnsubscribe:"iridium_batchUnsubscribe"}};function Db(t,e=[]){const r=[];return Object.keys(t).forEach(n=>{if(e.length&&!e.includes(n))return;const i=t[n];r.push(...i.accounts)}),r}function L1(t,e){return t.includes(":")?[t]:e.chains||[]}const M1="base10",Pr="base16",Tu="base64pad",Ru="utf8",U1=0,Hi=1,Pb=0,j1=1,Nu=12,Fu=32;function Tb(){const t=wu.generateKeyPair();return{privateKey:on(t.secretKey,Pr),publicKey:on(t.publicKey,Pr)}}function Lu(){const t=Is.randomBytes(Fu);return on(t,Pr)}function Rb(t,e){const r=wu.sharedKey(Cn(t,Pr),Cn(e,Pr)),n=new Zv(Ja.SHA256,r).expand(Fu);return on(n,Pr)}function Nb(t){const e=Ja.hash(Cn(t,Pr));return on(e,Pr)}function Os(t){const e=Ja.hash(Cn(t,Ru));return on(e,Pr)}function Fb(t){return Cn(`${t}`,M1)}function So(t){return Number(on(t,M1))}function Lb(t){const e=Fb(typeof t.type<"u"?t.type:U1);if(So(e)===Hi&&typeof t.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");const r=typeof t.senderPublicKey<"u"?Cn(t.senderPublicKey,Pr):void 0,n=typeof t.iv<"u"?Cn(t.iv,Pr):Is.randomBytes(Nu),i=new uu.ChaCha20Poly1305(Cn(t.symKey,Pr)).seal(n,Cn(t.message,Ru));return Ub({type:e,sealed:i,iv:n,senderPublicKey:r})}function Mb(t){const e=new uu.ChaCha20Poly1305(Cn(t.symKey,Pr)),{sealed:r,iv:n}=ec(t.encoded),i=e.open(n,r);if(i===null)throw new Error("Failed to decrypt");return on(i,Ru)}function Ub(t){if(So(t.type)===Hi){if(typeof t.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");return on(Yd([t.type,t.senderPublicKey,t.iv,t.sealed]),Tu)}return on(Yd([t.type,t.iv,t.sealed]),Tu)}function ec(t){const e=Cn(t,Tu),r=e.slice(Pb,j1),n=j1;if(So(r)===Hi){const l=n+Fu,h=l+Nu,d=e.slice(n,l),v=e.slice(l,h),x=e.slice(h);return{type:r,sealed:x,iv:v,senderPublicKey:d}}const i=n+Nu,o=e.slice(n,i),c=e.slice(i);return{type:r,sealed:c,iv:o}}function jb(t,e){const r=ec(t);return B1({type:So(r.type),senderPublicKey:typeof r.senderPublicKey<"u"?on(r.senderPublicKey,Pr):void 0,receiverPublicKey:e?.receiverPublicKey})}function B1(t){const e=t?.type||U1;if(e===Hi){if(typeof t?.senderPublicKey>"u")throw new Error("missing sender public key");if(typeof t?.receiverPublicKey>"u")throw new Error("missing receiver public key")}return{type:e,senderPublicKey:t?.senderPublicKey,receiverPublicKey:t?.receiverPublicKey}}function k1(t){return t.type===Hi&&typeof t.senderPublicKey=="string"&&typeof t.receiverPublicKey=="string"}var Bb=Object.defineProperty,H1=Object.getOwnPropertySymbols,kb=Object.prototype.hasOwnProperty,Hb=Object.prototype.propertyIsEnumerable,z1=(t,e,r)=>e in t?Bb(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,W1=(t,e)=>{for(var r in e||(e={}))kb.call(e,r)&&z1(t,r,e[r]);if(H1)for(var r of H1(e))Hb.call(e,r)&&z1(t,r,e[r]);return t};const zb="ReactNative",fi={reactNative:"react-native",node:"node",browser:"browser",unknown:"unknown"},Wb="js";function Mu(){return typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.node<"u"}function q1(){return!S1()&&!!Su()&&navigator.product===zb}function Uu(){return!Mu()&&!!Su()}function ju(){return q1()?fi.reactNative:Mu()?fi.node:Uu()?fi.browser:fi.unknown}function qb(t,e){let r=Oo.parse(t);return r=W1(W1({},r),e),t=Oo.stringify(r),t}function Vb(){return P1()||{name:"",description:"",url:"",icons:[""]}}function Kb(){if(ju()===fi.reactNative&&typeof global<"u"&&typeof(global==null?void 0:global.Platform)<"u"){const{OS:r,Version:n}=global.Platform;return[r,n].join("-")}const t=R5();if(t===null)return"unknown";const e=t.os?t.os.replace(" ","").toLowerCase():"unknown";return t.type==="browser"?[e,t.name,t.version].join("-"):[e,t.version].join("-")}function Gb(){var t;const e=ju();return e===fi.browser?[e,((t=D1())==null?void 0:t.host)||"unknown"].join(":"):e}function Zb(t,e,r){const n=Kb(),i=Gb();return[[t,e].join("-"),[Wb,r].join("-"),n,i].join("/")}function Yb({protocol:t,version:e,relayUrl:r,sdkVersion:n,auth:i,projectId:o,useOnCloseEvent:c}){const l=r.split("?"),h=Zb(t,e,n),d={auth:i,ua:h,projectId:o,useOnCloseEvent:c||void 0},v=qb(l[1]||"",d);return l[0]+"?"+v}function zi(t,e){return t.filter(r=>e.includes(r)).length===t.length}function V1(t){return Object.fromEntries(t.entries())}function K1(t){return new Map(Object.entries(t))}function Ss(t=Se.FIVE_MINUTES,e){const r=Se.toMiliseconds(t||Se.FIVE_MINUTES);let n,i,o;return{resolve:c=>{o&&n&&(clearTimeout(o),n(c))},reject:c=>{o&&i&&(clearTimeout(o),i(c))},done:()=>new Promise((c,l)=>{o=setTimeout(()=>{l(new Error(e))},r),n=c,i=l})}}function tc(t,e,r){return new Promise(async(n,i)=>{const o=setTimeout(()=>i(new Error(r)),e);try{const c=await t;n(c)}catch(c){i(c)}clearTimeout(o)})}function G1(t,e){if(typeof e=="string"&&e.startsWith(`${t}:`))return e;if(t.toLowerCase()==="topic"){if(typeof e!="string")throw new Error('Value must be "string" for expirer target type: topic');return`topic:${e}`}else if(t.toLowerCase()==="id"){if(typeof e!="number")throw new Error('Value must be "number" for expirer target type: id');return`id:${e}`}throw new Error(`Unknown expirer target type: ${t}`)}function Jb(t){return G1("topic",t)}function Xb(t){return G1("id",t)}function Z1(t){const[e,r]=t.split(":"),n={id:void 0,topic:void 0};if(e==="topic"&&typeof r=="string")n.topic=r;else if(e==="id"&&Number.isInteger(Number(r)))n.id=Number(r);else throw new Error(`Invalid target, expected id:number or topic:string, got ${e}:${r}`);return n}function In(t,e){return Se.fromMiliseconds((e||Date.now())+Se.toMiliseconds(t))}function di(t){return Date.now()>=Se.toMiliseconds(t)}function nr(t,e){return`${t}${e?`:${e}`:""}`}function Bu(t=[],e=[]){return[...new Set([...t,...e])]}async function Qb({id:t,topic:e,wcDeepLink:r}){try{if(!r)return;const n=typeof r=="string"?JSON.parse(r):r;let i=n?.href;if(typeof i!="string")return;i.endsWith("/")&&(i=i.slice(0,-1));const o=`${i}/wc?requestId=${t}&sessionTopic=${e}`,c=ju();c===fi.browser?o.startsWith("https://")?window.open(o,"_blank","noreferrer noopener"):window.open(o,"_self","noreferrer noopener"):c===fi.reactNative&&typeof(global==null?void 0:global.Linking)<"u"&&await global.Linking.openURL(o)}catch(n){console.error(n)}}const e6="irn";function ku(t){return t?.relay||{protocol:e6}}function rc(t){const e=Sb[t];if(typeof e>"u")throw new Error(`Relay Protocol not supported: ${t}`);return e}var t6=Object.defineProperty,Y1=Object.getOwnPropertySymbols,r6=Object.prototype.hasOwnProperty,n6=Object.prototype.propertyIsEnumerable,J1=(t,e,r)=>e in t?t6(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,i6=(t,e)=>{for(var r in e||(e={}))r6.call(e,r)&&J1(t,r,e[r]);if(Y1)for(var r of Y1(e))n6.call(e,r)&&J1(t,r,e[r]);return t};function s6(t,e="-"){const r={},n="relay"+e;return Object.keys(t).forEach(i=>{if(i.startsWith(n)){const o=i.replace(n,""),c=t[i];r[o]=c}}),r}function o6(t){const e=t.indexOf(":"),r=t.indexOf("?")!==-1?t.indexOf("?"):void 0,n=t.substring(0,e),i=t.substring(e+1,r).split("@"),o=typeof r<"u"?t.substring(r):"",c=Oo.parse(o);return{protocol:n,topic:a6(i[0]),version:parseInt(i[1],10),symKey:c.symKey,relay:s6(c)}}function a6(t){return t.startsWith("//")?t.substring(2):t}function c6(t,e="-"){const r="relay",n={};return Object.keys(t).forEach(i=>{const o=r+e+i;t[i]&&(n[o]=t[i])}),n}function l6(t){return`${t.protocol}:${t.topic}@${t.version}?`+Oo.stringify(i6({symKey:t.symKey},c6(t.relay)))}function Ds(t){const e=[];return t.forEach(r=>{const[n,i]=r.split(":");e.push(`${n}:${i}`)}),e}function u6(t){const e=[];return Object.values(t).forEach(r=>{e.push(...Ds(r.accounts))}),e}function h6(t,e){const r=[];return Object.values(t).forEach(n=>{Ds(n.accounts).includes(e)&&r.push(...n.methods)}),r}function f6(t,e){const r=[];return Object.values(t).forEach(n=>{Ds(n.accounts).includes(e)&&r.push(...n.events)}),r}function d6(t,e){const r=sc(t,e);if(r)throw new Error(r.message);const n={};for(const[i,o]of Object.entries(t))n[i]={methods:o.methods,events:o.events,chains:o.accounts.map(c=>`${c.split(":")[0]}:${c.split(":")[1]}`)};return n}function Hu(t){return t.includes(":")}function nc(t){return Hu(t)?t.split(":")[0]:t}const p6={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}},g6={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 _e(t,e){const{message:r,code:n}=g6[t];return{message:e?`${r} ${e}`:r,code:n}}function Jt(t,e){const{message:r,code:n}=p6[t];return{message:e?`${r} ${e}`:r,code:n}}function Rn(t,e){return Array.isArray(t)?typeof e<"u"&&t.length?t.every(e):!0:!1}function Ps(t){return Object.getPrototypeOf(t)===Object.prototype&&Object.keys(t).length}function Tr(t){return typeof t>"u"}function mr(t,e){return e&&Tr(t)?!0:typeof t=="string"&&!!t.trim().length}function zu(t,e){return e&&Tr(t)?!0:typeof t=="number"&&!isNaN(t)}function m6(t,e){const{requiredNamespaces:r}=e,n=Object.keys(t.namespaces),i=Object.keys(r);let o=!0;return zi(i,n)?(n.forEach(c=>{const{accounts:l,methods:h,events:d}=t.namespaces[c],v=Ds(l),x=r[c];(!zi(L1(c,x),v)||!zi(x.methods,h)||!zi(x.events,d))&&(o=!1)}),o):!1}function ic(t){return mr(t,!1)&&t.includes(":")?t.split(":").length===2:!1}function w6(t){if(mr(t,!1)&&t.includes(":")){const e=t.split(":");if(e.length===3){const r=e[0]+":"+e[1];return!!e[2]&&ic(r)}}return!1}function v6(t){if(mr(t,!1))try{return typeof new URL(t)<"u"}catch{return!1}return!1}function y6(t){var e;return(e=t?.proposer)==null?void 0:e.publicKey}function b6(t){return t?.topic}function _6(t,e){let r=null;return mr(t?.publicKey,!1)||(r=_e("MISSING_OR_INVALID",`${e} controller public key should be a string`)),r}function X1(t){let e=!0;return Rn(t)?t.length&&(e=t.every(r=>mr(r,!1))):e=!1,e}function E6(t,e,r){let n=null;return Rn(e)&&e.length?e.forEach(i=>{n||ic(i)||(n=Jt("UNSUPPORTED_CHAINS",`${r}, chain ${i} should be a string and conform to "namespace:chainId" format`))}):ic(t)||(n=Jt("UNSUPPORTED_CHAINS",`${r}, chains must be defined as "namespace:chainId" e.g. "eip155:1": {...} in the namespace key OR as an array of CAIP-2 chainIds e.g. eip155: { chains: ["eip155:1", "eip155:5"] }`)),n}function x6(t,e,r){let n=null;return Object.entries(t).forEach(([i,o])=>{if(n)return;const c=E6(i,L1(i,o),`${e} ${r}`);c&&(n=c)}),n}function C6(t,e){let r=null;return Rn(t)?t.forEach(n=>{r||w6(n)||(r=Jt("UNSUPPORTED_ACCOUNTS",`${e}, account ${n} should be a string and conform to "namespace:chainId:address" format`))}):r=Jt("UNSUPPORTED_ACCOUNTS",`${e}, accounts should be an array of strings conforming to "namespace:chainId:address" format`),r}function I6(t,e){let r=null;return Object.values(t).forEach(n=>{if(r)return;const i=C6(n?.accounts,`${e} namespace`);i&&(r=i)}),r}function A6(t,e){let r=null;return X1(t?.methods)?X1(t?.events)||(r=Jt("UNSUPPORTED_EVENTS",`${e}, events should be an array of strings or empty array for no events`)):r=Jt("UNSUPPORTED_METHODS",`${e}, methods should be an array of strings or empty array for no methods`),r}function Q1(t,e){let r=null;return Object.values(t).forEach(n=>{if(r)return;const i=A6(n,`${e}, namespace`);i&&(r=i)}),r}function $6(t,e,r){let n=null;if(t&&Ps(t)){const i=Q1(t,e);i&&(n=i);const o=x6(t,e,r);o&&(n=o)}else n=_e("MISSING_OR_INVALID",`${e}, ${r} should be an object with data`);return n}function sc(t,e){let r=null;if(t&&Ps(t)){const n=Q1(t,e);n&&(r=n);const i=I6(t,e);i&&(r=i)}else r=_e("MISSING_OR_INVALID",`${e}, namespaces should be an object with data`);return r}function ep(t){return mr(t.protocol,!0)}function O6(t,e){let r=!1;return e&&!t?r=!0:t&&Rn(t)&&t.length&&t.forEach(n=>{r=ep(n)}),r}function S6(t){return typeof t=="number"}function zr(t){return typeof t<"u"&&typeof t!==null}function D6(t){return!(!t||typeof t!="object"||!t.code||!zu(t.code,!1)||!t.message||!mr(t.message,!1))}function P6(t){return!(Tr(t)||!mr(t.method,!1))}function T6(t){return!(Tr(t)||Tr(t.result)&&Tr(t.error)||!zu(t.id,!1)||!mr(t.jsonrpc,!1))}function R6(t){return!(Tr(t)||!mr(t.name,!1))}function tp(t,e){return!(!ic(e)||!u6(t).includes(e))}function N6(t,e,r){return mr(r,!1)?h6(t,e).includes(r):!1}function F6(t,e,r){return mr(r,!1)?f6(t,e).includes(r):!1}function rp(t,e,r){let n=null;const i=L6(t),o=M6(e),c=Object.keys(i),l=Object.keys(o),h=np(Object.keys(t)),d=np(Object.keys(e)),v=h.filter(x=>!d.includes(x));return v.length&&(n=_e("NON_CONFORMING_NAMESPACES",`${r} namespaces keys don't satisfy requiredNamespaces.
15
15
  Required: ${v.toString()}
16
- Received: ${Object.keys(e).toString()}`)),Hi(c,l)||(n=_e("NON_CONFORMING_NAMESPACES",`${r} namespaces chains don't satisfy required namespaces.
16
+ Received: ${Object.keys(e).toString()}`)),zi(c,l)||(n=_e("NON_CONFORMING_NAMESPACES",`${r} namespaces chains don't satisfy required namespaces.
17
17
  Required: ${c.toString()}
18
- Approved: ${l.toString()}`)),Object.keys(e).forEach(E=>{if(!E.includes(":")||n)return;const _=Os(e[E].accounts);_.includes(E)||(n=_e("NON_CONFORMING_NAMESPACES",`${r} namespaces accounts don't satisfy namespace accounts for ${E}
19
- Required: ${E}
20
- Approved: ${_.toString()}`))}),c.forEach(E=>{n||(Hi(i[E].methods,o[E].methods)?Hi(i[E].events,o[E].events)||(n=_e("NON_CONFORMING_NAMESPACES",`${r} namespaces events don't satisfy namespace events for ${E}`)):n=_e("NON_CONFORMING_NAMESPACES",`${r} namespaces methods don't satisfy namespace methods for ${E}`))}),n}function Vb(t){const e={};return Object.keys(t).forEach(r=>{var n;r.includes(":")?e[r]=t[r]:(n=t[r].chains)==null||n.forEach(i=>{e[i]={methods:t[r].methods,events:t[r].events}})}),e}function H1(t){return[...new Set(t.map(e=>e.includes(":")?e.split(":")[0]:e))]}function Kb(t){const e={};return Object.keys(t).forEach(r=>{if(r.includes(":"))e[r]=t[r];else{const n=Os(t[r].accounts);n?.forEach(i=>{e[i]={accounts:t[r].accounts.filter(o=>o.includes(`${i}:`)),methods:t[r].methods,events:t[r].events}})}}),e}function Gb(t,e){return Lu(t,!1)&&t<=e.max&&t>=e.min}var Qa={};/*! *****************************************************************************
18
+ Approved: ${l.toString()}`)),Object.keys(e).forEach(x=>{if(!x.includes(":")||n)return;const _=Ds(e[x].accounts);_.includes(x)||(n=_e("NON_CONFORMING_NAMESPACES",`${r} namespaces accounts don't satisfy namespace accounts for ${x}
19
+ Required: ${x}
20
+ Approved: ${_.toString()}`))}),c.forEach(x=>{n||(zi(i[x].methods,o[x].methods)?zi(i[x].events,o[x].events)||(n=_e("NON_CONFORMING_NAMESPACES",`${r} namespaces events don't satisfy namespace events for ${x}`)):n=_e("NON_CONFORMING_NAMESPACES",`${r} namespaces methods don't satisfy namespace methods for ${x}`))}),n}function L6(t){const e={};return Object.keys(t).forEach(r=>{var n;r.includes(":")?e[r]=t[r]:(n=t[r].chains)==null||n.forEach(i=>{e[i]={methods:t[r].methods,events:t[r].events}})}),e}function np(t){return[...new Set(t.map(e=>e.includes(":")?e.split(":")[0]:e))]}function M6(t){const e={};return Object.keys(t).forEach(r=>{if(r.includes(":"))e[r]=t[r];else{const n=Ds(t[r].accounts);n?.forEach(i=>{e[i]={accounts:t[r].accounts.filter(o=>o.includes(`${i}:`)),methods:t[r].methods,events:t[r].events}})}}),e}function U6(t,e){return zu(t,!1)&&t<=e.max&&t>=e.min}var oc={};/*! *****************************************************************************
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(t,e){return Mu=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)n.hasOwnProperty(i)&&(r[i]=n[i])},Mu(t,e)};function Zb(t,e){Mu(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var Uu=function(){return Uu=Object.assign||function(e){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e},Uu.apply(this,arguments)};function Yb(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r}function Jb(t,e,r,n){var i=arguments.length,o=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(o=(i<3?c(o):i>3?c(e,r,o):c(e,r))||o);return i>3&&o&&Object.defineProperty(e,r,o),o}function Xb(t,e){return function(r,n){e(r,n,t)}}function Qb(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function e6(t,e,r,n){function i(o){return o instanceof r?o:new r(function(c){c(o)})}return new(r||(r=Promise))(function(o,c){function l(v){try{f(n.next(v))}catch(E){c(E)}}function h(v){try{f(n.throw(v))}catch(E){c(E)}}function f(v){v.done?o(v.value):i(v.value).then(l,h)}f((n=n.apply(t,e||[])).next())})}function t6(t,e){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,c;return c={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function l(f){return function(v){return h([f,v])}}function h(f){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(o=f[0]&2?i.return:f[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,f[1])).done)return o;switch(i=0,o&&(f=[f[0]&2,o.value]),f[0]){case 0:case 1:o=f;break;case 4:return r.label++,{value:f[1],done:!1};case 5:r.label++,i=f[1],f=[0];continue;case 7:f=r.ops.pop(),r.trys.pop();continue;default:if(o=r.trys,!(o=o.length>0&&o[o.length-1])&&(f[0]===6||f[0]===2)){r=0;continue}if(f[0]===3&&(!o||f[1]>o[0]&&f[1]<o[3])){r.label=f[1];break}if(f[0]===6&&r.label<o[1]){r.label=o[1],o=f;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(f);break}o[2]&&r.ops.pop(),r.trys.pop();continue}f=e.call(t,r)}catch(v){f=[6,v],i=0}finally{n=o=0}if(f[0]&5)throw f[1];return{value:f[0]?f[1]:void 0,done:!0}}}function r6(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}function n6(t,e){for(var r in t)r!=="default"&&!e.hasOwnProperty(r)&&(e[r]=t[r])}function ju(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function z1(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,o=[],c;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(l){c={error:l}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(c)throw c.error}}return o}function i6(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(z1(arguments[e]));return t}function s6(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;for(var n=Array(t),i=0,e=0;e<r;e++)for(var o=arguments[e],c=0,l=o.length;c<l;c++,i++)n[i]=o[c];return n}function Ao(t){return this instanceof Ao?(this.v=t,this):new Ao(t)}function o6(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(t,e||[]),i,o=[];return i={},c("next"),c("throw"),c("return"),i[Symbol.asyncIterator]=function(){return this},i;function c(_){n[_]&&(i[_]=function(S){return new Promise(function(P,j){o.push([_,S,P,j])>1||l(_,S)})})}function l(_,S){try{h(n[_](S))}catch(P){E(o[0][3],P)}}function h(_){_.value instanceof Ao?Promise.resolve(_.value.v).then(f,v):E(o[0][2],_)}function f(_){l("next",_)}function v(_){l("throw",_)}function E(_,S){_(S),o.shift(),o.length&&l(o[0][0],o[0][1])}}function a6(t){var e,r;return e={},n("next"),n("throw",function(i){throw i}),n("return"),e[Symbol.iterator]=function(){return this},e;function n(i,o){e[i]=t[i]?function(c){return(r=!r)?{value:Ao(t[i](c)),done:i==="return"}:o?o(c):c}:o}}function c6(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof ju=="function"?ju(t):t[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(o){r[o]=t[o]&&function(c){return new Promise(function(l,h){c=t[o](c),i(l,h,c.done,c.value)})}}function i(o,c,l,h){Promise.resolve(h).then(function(f){o({value:f,done:l})},c)}}function l6(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function u6(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}function h6(t){return t&&t.__esModule?t:{default:t}}function f6(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}function d6(t,e,r){if(!e.has(t))throw new TypeError("attempted to set private field on non-instance");return e.set(t,r),r}var p6=Object.freeze({__proto__:null,__extends:Zb,get __assign(){return Uu},__rest:Yb,__decorate:Jb,__param:Xb,__metadata:Qb,__awaiter:e6,__generator:t6,__createBinding:r6,__exportStar:n6,__values:ju,__read:z1,__spread:i6,__spreadArrays:s6,__await:Ao,__asyncGenerator:o6,__asyncDelegator:a6,__asyncValues:c6,__makeTemplateObject:l6,__importStar:u6,__importDefault:h6,__classPrivateFieldGet:f6,__classPrivateFieldSet:d6}),W1=Ui(p6),Oo={};Object.defineProperty(Oo,"__esModule",{value:!0});function g6(t){if(typeof t!="string")throw new Error(`Cannot safe json parse value of type ${typeof t}`);try{return JSON.parse(t)}catch{return t}}Oo.safeJsonParse=g6;function m6(t){return typeof t=="string"?t:JSON.stringify(t,(e,r)=>typeof r>"u"?null:r)}Oo.safeJsonStringify=m6;var Do={exports:{}},q1;function w6(){return q1||(q1=1,function(){let t;function e(){}t=e,t.prototype.getItem=function(r){return this.hasOwnProperty(r)?String(this[r]):null},t.prototype.setItem=function(r,n){this[r]=String(n)},t.prototype.removeItem=function(r){delete this[r]},t.prototype.clear=function(){const r=this;Object.keys(r).forEach(function(n){r[n]=void 0,delete r[n]})},t.prototype.key=function(r){return r=r||0,Object.keys(this)[r]},t.prototype.__defineGetter__("length",function(){return Object.keys(this).length}),typeof pr<"u"&&pr.localStorage?Do.exports=pr.localStorage:typeof window<"u"&&window.localStorage?Do.exports=window.localStorage:Do.exports=new e}()),Do.exports}var Fu={},$o={},V1;function v6(){if(V1)return $o;V1=1,Object.defineProperty($o,"__esModule",{value:!0}),$o.IKeyValueStorage=void 0;class t{}return $o.IKeyValueStorage=t,$o}var Po={},K1;function y6(){if(K1)return Po;K1=1,Object.defineProperty(Po,"__esModule",{value:!0}),Po.parseEntry=void 0;const t=Oo;function e(r){var n;return[r[0],t.safeJsonParse((n=r[1])!==null&&n!==void 0?n:"")]}return Po.parseEntry=e,Po}var G1;function b6(){return G1||(G1=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=W1;e.__exportStar(v6(),t),e.__exportStar(y6(),t)}(Fu)),Fu}Object.defineProperty(Qa,"__esModule",{value:!0}),Qa.KeyValueStorage=void 0;const $s=W1,Z1=Oo,_6=$s.__importDefault(w6()),E6=b6();class Y1{constructor(){this.localStorage=_6.default}getKeys(){return $s.__awaiter(this,void 0,void 0,function*(){return Object.keys(this.localStorage)})}getEntries(){return $s.__awaiter(this,void 0,void 0,function*(){return Object.entries(this.localStorage).map(E6.parseEntry)})}getItem(e){return $s.__awaiter(this,void 0,void 0,function*(){const r=this.localStorage.getItem(e);if(r!==null)return Z1.safeJsonParse(r)})}setItem(e,r){return $s.__awaiter(this,void 0,void 0,function*(){this.localStorage.setItem(e,Z1.safeJsonStringify(r))})}removeItem(e){return $s.__awaiter(this,void 0,void 0,function*(){this.localStorage.removeItem(e)})}}Qa.KeyValueStorage=Y1;var x6=Qa.default=Y1,Ps={};/*! *****************************************************************************
33
+ ***************************************************************************** */var Wu=function(t,e){return Wu=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)n.hasOwnProperty(i)&&(r[i]=n[i])},Wu(t,e)};function j6(t,e){Wu(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var qu=function(){return qu=Object.assign||function(e){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e},qu.apply(this,arguments)};function B6(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r}function k6(t,e,r,n){var i=arguments.length,o=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(o=(i<3?c(o):i>3?c(e,r,o):c(e,r))||o);return i>3&&o&&Object.defineProperty(e,r,o),o}function H6(t,e){return function(r,n){e(r,n,t)}}function z6(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function W6(t,e,r,n){function i(o){return o instanceof r?o:new r(function(c){c(o)})}return new(r||(r=Promise))(function(o,c){function l(v){try{d(n.next(v))}catch(x){c(x)}}function h(v){try{d(n.throw(v))}catch(x){c(x)}}function d(v){v.done?o(v.value):i(v.value).then(l,h)}d((n=n.apply(t,e||[])).next())})}function q6(t,e){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,c;return c={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function l(d){return function(v){return h([d,v])}}function h(d){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(o=d[0]&2?i.return:d[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,d[1])).done)return o;switch(i=0,o&&(d=[d[0]&2,o.value]),d[0]){case 0:case 1:o=d;break;case 4:return r.label++,{value:d[1],done:!1};case 5:r.label++,i=d[1],d=[0];continue;case 7:d=r.ops.pop(),r.trys.pop();continue;default:if(o=r.trys,!(o=o.length>0&&o[o.length-1])&&(d[0]===6||d[0]===2)){r=0;continue}if(d[0]===3&&(!o||d[1]>o[0]&&d[1]<o[3])){r.label=d[1];break}if(d[0]===6&&r.label<o[1]){r.label=o[1],o=d;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(d);break}o[2]&&r.ops.pop(),r.trys.pop();continue}d=e.call(t,r)}catch(v){d=[6,v],i=0}finally{n=o=0}if(d[0]&5)throw d[1];return{value:d[0]?d[1]:void 0,done:!0}}}function V6(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}function K6(t,e){for(var r in t)r!=="default"&&!e.hasOwnProperty(r)&&(e[r]=t[r])}function Vu(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function ip(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,o=[],c;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(l){c={error:l}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(c)throw c.error}}return o}function G6(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(ip(arguments[e]));return t}function Z6(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;for(var n=Array(t),i=0,e=0;e<r;e++)for(var o=arguments[e],c=0,l=o.length;c<l;c++,i++)n[i]=o[c];return n}function Do(t){return this instanceof Do?(this.v=t,this):new Do(t)}function Y6(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(t,e||[]),i,o=[];return i={},c("next"),c("throw"),c("return"),i[Symbol.asyncIterator]=function(){return this},i;function c(_){n[_]&&(i[_]=function(A){return new Promise(function(P,L){o.push([_,A,P,L])>1||l(_,A)})})}function l(_,A){try{h(n[_](A))}catch(P){x(o[0][3],P)}}function h(_){_.value instanceof Do?Promise.resolve(_.value.v).then(d,v):x(o[0][2],_)}function d(_){l("next",_)}function v(_){l("throw",_)}function x(_,A){_(A),o.shift(),o.length&&l(o[0][0],o[0][1])}}function J6(t){var e,r;return e={},n("next"),n("throw",function(i){throw i}),n("return"),e[Symbol.iterator]=function(){return this},e;function n(i,o){e[i]=t[i]?function(c){return(r=!r)?{value:Do(t[i](c)),done:i==="return"}:o?o(c):c}:o}}function X6(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof Vu=="function"?Vu(t):t[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(o){r[o]=t[o]&&function(c){return new Promise(function(l,h){c=t[o](c),i(l,h,c.done,c.value)})}}function i(o,c,l,h){Promise.resolve(h).then(function(d){o({value:d,done:l})},c)}}function Q6(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function e4(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}function t4(t){return t&&t.__esModule?t:{default:t}}function r4(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}function n4(t,e,r){if(!e.has(t))throw new TypeError("attempted to set private field on non-instance");return e.set(t,r),r}var i4=Object.freeze({__proto__:null,__extends:j6,get __assign(){return qu},__rest:B6,__decorate:k6,__param:H6,__metadata:z6,__awaiter:W6,__generator:q6,__createBinding:V6,__exportStar:K6,__values:Vu,__read:ip,__spread:G6,__spreadArrays:Z6,__await:Do,__asyncGenerator:Y6,__asyncDelegator:J6,__asyncValues:X6,__makeTemplateObject:Q6,__importStar:e4,__importDefault:t4,__classPrivateFieldGet:r4,__classPrivateFieldSet:n4}),sp=Ui(i4),Po={};Object.defineProperty(Po,"__esModule",{value:!0});function s4(t){if(typeof t!="string")throw new Error(`Cannot safe json parse value of type ${typeof t}`);try{return JSON.parse(t)}catch{return t}}Po.safeJsonParse=s4;function o4(t){return typeof t=="string"?t:JSON.stringify(t,(e,r)=>typeof r>"u"?null:r)}Po.safeJsonStringify=o4;var To={exports:{}},op;function a4(){return op||(op=1,function(){let t;function e(){}t=e,t.prototype.getItem=function(r){return this.hasOwnProperty(r)?String(this[r]):null},t.prototype.setItem=function(r,n){this[r]=String(n)},t.prototype.removeItem=function(r){delete this[r]},t.prototype.clear=function(){const r=this;Object.keys(r).forEach(function(n){r[n]=void 0,delete r[n]})},t.prototype.key=function(r){return r=r||0,Object.keys(this)[r]},t.prototype.__defineGetter__("length",function(){return Object.keys(this).length}),typeof gr<"u"&&gr.localStorage?To.exports=gr.localStorage:typeof window<"u"&&window.localStorage?To.exports=window.localStorage:To.exports=new e}()),To.exports}var Ku={},Ro={},ap;function c4(){if(ap)return Ro;ap=1,Object.defineProperty(Ro,"__esModule",{value:!0}),Ro.IKeyValueStorage=void 0;class t{}return Ro.IKeyValueStorage=t,Ro}var No={},cp;function l4(){if(cp)return No;cp=1,Object.defineProperty(No,"__esModule",{value:!0}),No.parseEntry=void 0;const t=Po;function e(r){var n;return[r[0],t.safeJsonParse((n=r[1])!==null&&n!==void 0?n:"")]}return No.parseEntry=e,No}var lp;function u4(){return lp||(lp=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=sp;e.__exportStar(c4(),t),e.__exportStar(l4(),t)}(Ku)),Ku}Object.defineProperty(oc,"__esModule",{value:!0}),oc.KeyValueStorage=void 0;const Ts=sp,up=Po,h4=Ts.__importDefault(a4()),f4=u4();class hp{constructor(){this.localStorage=h4.default}getKeys(){return Ts.__awaiter(this,void 0,void 0,function*(){return Object.keys(this.localStorage)})}getEntries(){return Ts.__awaiter(this,void 0,void 0,function*(){return Object.entries(this.localStorage).map(f4.parseEntry)})}getItem(e){return Ts.__awaiter(this,void 0,void 0,function*(){const r=this.localStorage.getItem(e);if(r!==null)return up.safeJsonParse(r)})}setItem(e,r){return Ts.__awaiter(this,void 0,void 0,function*(){this.localStorage.setItem(e,up.safeJsonStringify(r))})}removeItem(e){return Ts.__awaiter(this,void 0,void 0,function*(){this.localStorage.removeItem(e)})}}oc.KeyValueStorage=hp;var d4=oc.default=hp,Rs={};/*! *****************************************************************************
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 Bu=function(t,e){return Bu=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)n.hasOwnProperty(i)&&(r[i]=n[i])},Bu(t,e)};function C6(t,e){Bu(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var ku=function(){return ku=Object.assign||function(e){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e},ku.apply(this,arguments)};function I6(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r}function S6(t,e,r,n){var i=arguments.length,o=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(o=(i<3?c(o):i>3?c(e,r,o):c(e,r))||o);return i>3&&o&&Object.defineProperty(e,r,o),o}function A6(t,e){return function(r,n){e(r,n,t)}}function O6(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function D6(t,e,r,n){function i(o){return o instanceof r?o:new r(function(c){c(o)})}return new(r||(r=Promise))(function(o,c){function l(v){try{f(n.next(v))}catch(E){c(E)}}function h(v){try{f(n.throw(v))}catch(E){c(E)}}function f(v){v.done?o(v.value):i(v.value).then(l,h)}f((n=n.apply(t,e||[])).next())})}function $6(t,e){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,c;return c={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function l(f){return function(v){return h([f,v])}}function h(f){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(o=f[0]&2?i.return:f[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,f[1])).done)return o;switch(i=0,o&&(f=[f[0]&2,o.value]),f[0]){case 0:case 1:o=f;break;case 4:return r.label++,{value:f[1],done:!1};case 5:r.label++,i=f[1],f=[0];continue;case 7:f=r.ops.pop(),r.trys.pop();continue;default:if(o=r.trys,!(o=o.length>0&&o[o.length-1])&&(f[0]===6||f[0]===2)){r=0;continue}if(f[0]===3&&(!o||f[1]>o[0]&&f[1]<o[3])){r.label=f[1];break}if(f[0]===6&&r.label<o[1]){r.label=o[1],o=f;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(f);break}o[2]&&r.ops.pop(),r.trys.pop();continue}f=e.call(t,r)}catch(v){f=[6,v],i=0}finally{n=o=0}if(f[0]&5)throw f[1];return{value:f[0]?f[1]:void 0,done:!0}}}function P6(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}function T6(t,e){for(var r in t)r!=="default"&&!e.hasOwnProperty(r)&&(e[r]=t[r])}function Hu(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function J1(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,o=[],c;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(l){c={error:l}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(c)throw c.error}}return o}function N6(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(J1(arguments[e]));return t}function R6(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;for(var n=Array(t),i=0,e=0;e<r;e++)for(var o=arguments[e],c=0,l=o.length;c<l;c++,i++)n[i]=o[c];return n}function To(t){return this instanceof To?(this.v=t,this):new To(t)}function L6(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(t,e||[]),i,o=[];return i={},c("next"),c("throw"),c("return"),i[Symbol.asyncIterator]=function(){return this},i;function c(_){n[_]&&(i[_]=function(S){return new Promise(function(P,j){o.push([_,S,P,j])>1||l(_,S)})})}function l(_,S){try{h(n[_](S))}catch(P){E(o[0][3],P)}}function h(_){_.value instanceof To?Promise.resolve(_.value.v).then(f,v):E(o[0][2],_)}function f(_){l("next",_)}function v(_){l("throw",_)}function E(_,S){_(S),o.shift(),o.length&&l(o[0][0],o[0][1])}}function M6(t){var e,r;return e={},n("next"),n("throw",function(i){throw i}),n("return"),e[Symbol.iterator]=function(){return this},e;function n(i,o){e[i]=t[i]?function(c){return(r=!r)?{value:To(t[i](c)),done:i==="return"}:o?o(c):c}:o}}function U6(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof Hu=="function"?Hu(t):t[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(o){r[o]=t[o]&&function(c){return new Promise(function(l,h){c=t[o](c),i(l,h,c.done,c.value)})}}function i(o,c,l,h){Promise.resolve(h).then(function(f){o({value:f,done:l})},c)}}function j6(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function F6(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}function B6(t){return t&&t.__esModule?t:{default:t}}function k6(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}function H6(t,e,r){if(!e.has(t))throw new TypeError("attempted to set private field on non-instance");return e.set(t,r),r}var z6=Object.freeze({__proto__:null,__extends:C6,get __assign(){return ku},__rest:I6,__decorate:S6,__param:A6,__metadata:O6,__awaiter:D6,__generator:$6,__createBinding:P6,__exportStar:T6,__values:Hu,__read:J1,__spread:N6,__spreadArrays:R6,__await:To,__asyncGenerator:L6,__asyncDelegator:M6,__asyncValues:U6,__makeTemplateObject:j6,__importStar:F6,__importDefault:B6,__classPrivateFieldGet:k6,__classPrivateFieldSet:H6}),ec=Ui(z6),No={},zu={},Ro={};class zi{}var W6=Object.freeze({__proto__:null,IEvents:zi}),q6=Ui(W6),X1;function V6(){if(X1)return Ro;X1=1,Object.defineProperty(Ro,"__esModule",{value:!0}),Ro.IHeartBeat=void 0;const t=q6;class e extends t.IEvents{constructor(n){super()}}return Ro.IHeartBeat=e,Ro}var Q1;function ep(){return Q1||(Q1=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),ec.__exportStar(V6(),t)}(zu)),zu}var Wu={},Wi={},tp;function K6(){if(tp)return Wi;tp=1,Object.defineProperty(Wi,"__esModule",{value:!0}),Wi.HEARTBEAT_EVENTS=Wi.HEARTBEAT_INTERVAL=void 0;const t=Te;return Wi.HEARTBEAT_INTERVAL=t.FIVE_SECONDS,Wi.HEARTBEAT_EVENTS={pulse:"heartbeat_pulse"},Wi}var rp;function np(){return rp||(rp=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),ec.__exportStar(K6(),t)}(Wu)),Wu}var ip;function G6(){if(ip)return No;ip=1,Object.defineProperty(No,"__esModule",{value:!0}),No.HeartBeat=void 0;const t=ec,e=br.exports,r=Te,n=ep(),i=np();class o extends n.IHeartBeat{constructor(l){super(l),this.events=new e.EventEmitter,this.interval=i.HEARTBEAT_INTERVAL,this.interval=l?.interval||i.HEARTBEAT_INTERVAL}static init(l){return t.__awaiter(this,void 0,void 0,function*(){const h=new o(l);return yield h.init(),h})}init(){return t.__awaiter(this,void 0,void 0,function*(){yield this.initialize()})}stop(){clearInterval(this.intervalRef)}on(l,h){this.events.on(l,h)}once(l,h){this.events.once(l,h)}off(l,h){this.events.off(l,h)}removeListener(l,h){this.events.removeListener(l,h)}initialize(){return t.__awaiter(this,void 0,void 0,function*(){this.intervalRef=setInterval(()=>this.pulse(),r.toMiliseconds(this.interval))})}pulse(){this.events.emit(i.HEARTBEAT_EVENTS.pulse)}}return No.HeartBeat=o,No}(function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=ec;e.__exportStar(G6(),t),e.__exportStar(ep(),t),e.__exportStar(np(),t)})(Ps);var pt={};/*! *****************************************************************************
46
+ ***************************************************************************** */var Gu=function(t,e){return Gu=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)n.hasOwnProperty(i)&&(r[i]=n[i])},Gu(t,e)};function p4(t,e){Gu(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var Zu=function(){return Zu=Object.assign||function(e){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e},Zu.apply(this,arguments)};function g4(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r}function m4(t,e,r,n){var i=arguments.length,o=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(o=(i<3?c(o):i>3?c(e,r,o):c(e,r))||o);return i>3&&o&&Object.defineProperty(e,r,o),o}function w4(t,e){return function(r,n){e(r,n,t)}}function v4(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function y4(t,e,r,n){function i(o){return o instanceof r?o:new r(function(c){c(o)})}return new(r||(r=Promise))(function(o,c){function l(v){try{d(n.next(v))}catch(x){c(x)}}function h(v){try{d(n.throw(v))}catch(x){c(x)}}function d(v){v.done?o(v.value):i(v.value).then(l,h)}d((n=n.apply(t,e||[])).next())})}function b4(t,e){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,c;return c={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function l(d){return function(v){return h([d,v])}}function h(d){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(o=d[0]&2?i.return:d[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,d[1])).done)return o;switch(i=0,o&&(d=[d[0]&2,o.value]),d[0]){case 0:case 1:o=d;break;case 4:return r.label++,{value:d[1],done:!1};case 5:r.label++,i=d[1],d=[0];continue;case 7:d=r.ops.pop(),r.trys.pop();continue;default:if(o=r.trys,!(o=o.length>0&&o[o.length-1])&&(d[0]===6||d[0]===2)){r=0;continue}if(d[0]===3&&(!o||d[1]>o[0]&&d[1]<o[3])){r.label=d[1];break}if(d[0]===6&&r.label<o[1]){r.label=o[1],o=d;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(d);break}o[2]&&r.ops.pop(),r.trys.pop();continue}d=e.call(t,r)}catch(v){d=[6,v],i=0}finally{n=o=0}if(d[0]&5)throw d[1];return{value:d[0]?d[1]:void 0,done:!0}}}function _4(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}function E4(t,e){for(var r in t)r!=="default"&&!e.hasOwnProperty(r)&&(e[r]=t[r])}function Yu(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function fp(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,o=[],c;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(l){c={error:l}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(c)throw c.error}}return o}function x4(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(fp(arguments[e]));return t}function C4(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;for(var n=Array(t),i=0,e=0;e<r;e++)for(var o=arguments[e],c=0,l=o.length;c<l;c++,i++)n[i]=o[c];return n}function Fo(t){return this instanceof Fo?(this.v=t,this):new Fo(t)}function I4(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(t,e||[]),i,o=[];return i={},c("next"),c("throw"),c("return"),i[Symbol.asyncIterator]=function(){return this},i;function c(_){n[_]&&(i[_]=function(A){return new Promise(function(P,L){o.push([_,A,P,L])>1||l(_,A)})})}function l(_,A){try{h(n[_](A))}catch(P){x(o[0][3],P)}}function h(_){_.value instanceof Fo?Promise.resolve(_.value.v).then(d,v):x(o[0][2],_)}function d(_){l("next",_)}function v(_){l("throw",_)}function x(_,A){_(A),o.shift(),o.length&&l(o[0][0],o[0][1])}}function A4(t){var e,r;return e={},n("next"),n("throw",function(i){throw i}),n("return"),e[Symbol.iterator]=function(){return this},e;function n(i,o){e[i]=t[i]?function(c){return(r=!r)?{value:Fo(t[i](c)),done:i==="return"}:o?o(c):c}:o}}function $4(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof Yu=="function"?Yu(t):t[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(o){r[o]=t[o]&&function(c){return new Promise(function(l,h){c=t[o](c),i(l,h,c.done,c.value)})}}function i(o,c,l,h){Promise.resolve(h).then(function(d){o({value:d,done:l})},c)}}function O4(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function S4(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}function D4(t){return t&&t.__esModule?t:{default:t}}function P4(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}function T4(t,e,r){if(!e.has(t))throw new TypeError("attempted to set private field on non-instance");return e.set(t,r),r}var R4=Object.freeze({__proto__:null,__extends:p4,get __assign(){return Zu},__rest:g4,__decorate:m4,__param:w4,__metadata:v4,__awaiter:y4,__generator:b4,__createBinding:_4,__exportStar:E4,__values:Yu,__read:fp,__spread:x4,__spreadArrays:C4,__await:Fo,__asyncGenerator:I4,__asyncDelegator:A4,__asyncValues:$4,__makeTemplateObject:O4,__importStar:S4,__importDefault:D4,__classPrivateFieldGet:P4,__classPrivateFieldSet:T4}),ac=Ui(R4),Lo={},Ju={},Mo={};class Wi{}var N4=Object.freeze({__proto__:null,IEvents:Wi}),F4=Ui(N4),dp;function L4(){if(dp)return Mo;dp=1,Object.defineProperty(Mo,"__esModule",{value:!0}),Mo.IHeartBeat=void 0;const t=F4;class e extends t.IEvents{constructor(n){super()}}return Mo.IHeartBeat=e,Mo}var pp;function gp(){return pp||(pp=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),ac.__exportStar(L4(),t)}(Ju)),Ju}var Xu={},qi={},mp;function M4(){if(mp)return qi;mp=1,Object.defineProperty(qi,"__esModule",{value:!0}),qi.HEARTBEAT_EVENTS=qi.HEARTBEAT_INTERVAL=void 0;const t=Se;return qi.HEARTBEAT_INTERVAL=t.FIVE_SECONDS,qi.HEARTBEAT_EVENTS={pulse:"heartbeat_pulse"},qi}var wp;function vp(){return wp||(wp=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),ac.__exportStar(M4(),t)}(Xu)),Xu}var yp;function U4(){if(yp)return Lo;yp=1,Object.defineProperty(Lo,"__esModule",{value:!0}),Lo.HeartBeat=void 0;const t=ac,e=_r.exports,r=Se,n=gp(),i=vp();class o extends n.IHeartBeat{constructor(l){super(l),this.events=new e.EventEmitter,this.interval=i.HEARTBEAT_INTERVAL,this.interval=l?.interval||i.HEARTBEAT_INTERVAL}static init(l){return t.__awaiter(this,void 0,void 0,function*(){const h=new o(l);return yield h.init(),h})}init(){return t.__awaiter(this,void 0,void 0,function*(){yield this.initialize()})}stop(){clearInterval(this.intervalRef)}on(l,h){this.events.on(l,h)}once(l,h){this.events.once(l,h)}off(l,h){this.events.off(l,h)}removeListener(l,h){this.events.removeListener(l,h)}initialize(){return t.__awaiter(this,void 0,void 0,function*(){this.intervalRef=setInterval(()=>this.pulse(),r.toMiliseconds(this.interval))})}pulse(){this.events.emit(i.HEARTBEAT_EVENTS.pulse)}}return Lo.HeartBeat=o,Lo}(function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=ac;e.__exportStar(U4(),t),e.__exportStar(gp(),t),e.__exportStar(vp(),t)})(Rs);var pt={};/*! *****************************************************************************
47
47
  Copyright (c) Microsoft Corporation.
48
48
 
49
49
  Permission to use, copy, modify, and/or distribute this software for any
@@ -56,7 +56,7 @@
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 qu=function(t,e){return qu=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)n.hasOwnProperty(i)&&(r[i]=n[i])},qu(t,e)};function Z6(t,e){qu(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var Vu=function(){return Vu=Object.assign||function(e){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e},Vu.apply(this,arguments)};function Y6(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r}function J6(t,e,r,n){var i=arguments.length,o=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(o=(i<3?c(o):i>3?c(e,r,o):c(e,r))||o);return i>3&&o&&Object.defineProperty(e,r,o),o}function X6(t,e){return function(r,n){e(r,n,t)}}function Q6(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function e4(t,e,r,n){function i(o){return o instanceof r?o:new r(function(c){c(o)})}return new(r||(r=Promise))(function(o,c){function l(v){try{f(n.next(v))}catch(E){c(E)}}function h(v){try{f(n.throw(v))}catch(E){c(E)}}function f(v){v.done?o(v.value):i(v.value).then(l,h)}f((n=n.apply(t,e||[])).next())})}function t4(t,e){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,c;return c={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function l(f){return function(v){return h([f,v])}}function h(f){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(o=f[0]&2?i.return:f[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,f[1])).done)return o;switch(i=0,o&&(f=[f[0]&2,o.value]),f[0]){case 0:case 1:o=f;break;case 4:return r.label++,{value:f[1],done:!1};case 5:r.label++,i=f[1],f=[0];continue;case 7:f=r.ops.pop(),r.trys.pop();continue;default:if(o=r.trys,!(o=o.length>0&&o[o.length-1])&&(f[0]===6||f[0]===2)){r=0;continue}if(f[0]===3&&(!o||f[1]>o[0]&&f[1]<o[3])){r.label=f[1];break}if(f[0]===6&&r.label<o[1]){r.label=o[1],o=f;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(f);break}o[2]&&r.ops.pop(),r.trys.pop();continue}f=e.call(t,r)}catch(v){f=[6,v],i=0}finally{n=o=0}if(f[0]&5)throw f[1];return{value:f[0]?f[1]:void 0,done:!0}}}function r4(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}function n4(t,e){for(var r in t)r!=="default"&&!e.hasOwnProperty(r)&&(e[r]=t[r])}function Ku(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function sp(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,o=[],c;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(l){c={error:l}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(c)throw c.error}}return o}function i4(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(sp(arguments[e]));return t}function s4(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;for(var n=Array(t),i=0,e=0;e<r;e++)for(var o=arguments[e],c=0,l=o.length;c<l;c++,i++)n[i]=o[c];return n}function Lo(t){return this instanceof Lo?(this.v=t,this):new Lo(t)}function o4(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(t,e||[]),i,o=[];return i={},c("next"),c("throw"),c("return"),i[Symbol.asyncIterator]=function(){return this},i;function c(_){n[_]&&(i[_]=function(S){return new Promise(function(P,j){o.push([_,S,P,j])>1||l(_,S)})})}function l(_,S){try{h(n[_](S))}catch(P){E(o[0][3],P)}}function h(_){_.value instanceof Lo?Promise.resolve(_.value.v).then(f,v):E(o[0][2],_)}function f(_){l("next",_)}function v(_){l("throw",_)}function E(_,S){_(S),o.shift(),o.length&&l(o[0][0],o[0][1])}}function a4(t){var e,r;return e={},n("next"),n("throw",function(i){throw i}),n("return"),e[Symbol.iterator]=function(){return this},e;function n(i,o){e[i]=t[i]?function(c){return(r=!r)?{value:Lo(t[i](c)),done:i==="return"}:o?o(c):c}:o}}function c4(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof Ku=="function"?Ku(t):t[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(o){r[o]=t[o]&&function(c){return new Promise(function(l,h){c=t[o](c),i(l,h,c.done,c.value)})}}function i(o,c,l,h){Promise.resolve(h).then(function(f){o({value:f,done:l})},c)}}function l4(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function u4(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}function h4(t){return t&&t.__esModule?t:{default:t}}function f4(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}function d4(t,e,r){if(!e.has(t))throw new TypeError("attempted to set private field on non-instance");return e.set(t,r),r}var p4=Object.freeze({__proto__:null,__extends:Z6,get __assign(){return Vu},__rest:Y6,__decorate:J6,__param:X6,__metadata:Q6,__awaiter:e4,__generator:t4,__createBinding:r4,__exportStar:n4,__values:Ku,__read:sp,__spread:i4,__spreadArrays:s4,__await:Lo,__asyncGenerator:o4,__asyncDelegator:a4,__asyncValues:c4,__makeTemplateObject:l4,__importStar:u4,__importDefault:h4,__classPrivateFieldGet:f4,__classPrivateFieldSet:d4}),g4=Ui(p4),Gu,op;function m4(){if(op)return Gu;op=1;function t(r){try{return JSON.stringify(r)}catch{return'"[Circular]"'}}Gu=e;function e(r,n,i){var o=i&&i.stringify||t,c=1;if(typeof r=="object"&&r!==null){var l=n.length+c;if(l===1)return r;var h=new Array(l);h[0]=o(r);for(var f=1;f<l;f++)h[f]=o(n[f]);return h.join(" ")}if(typeof r!="string")return r;var v=n.length;if(v===0)return r;for(var E="",_=1-c,S=-1,P=r&&r.length||0,j=0;j<P;){if(r.charCodeAt(j)===37&&j+1<P){switch(S=S>-1?S:0,r.charCodeAt(j+1)){case 100:case 102:if(_>=v||n[_]==null)break;S<j&&(E+=r.slice(S,j)),E+=Number(n[_]),S=j+2,j++;break;case 105:if(_>=v||n[_]==null)break;S<j&&(E+=r.slice(S,j)),E+=Math.floor(Number(n[_])),S=j+2,j++;break;case 79:case 111:case 106:if(_>=v||n[_]===void 0)break;S<j&&(E+=r.slice(S,j));var H=typeof n[_];if(H==="string"){E+="'"+n[_]+"'",S=j+2,j++;break}if(H==="function"){E+=n[_].name||"<anonymous>",S=j+2,j++;break}E+=o(n[_]),S=j+2,j++;break;case 115:if(_>=v)break;S<j&&(E+=r.slice(S,j)),E+=String(n[_]),S=j+2,j++;break;case 37:S<j&&(E+=r.slice(S,j)),E+="%",S=j+2,j++,_--;break}++_}++j}return S===-1?r:(S<P&&(E+=r.slice(S)),E)}return Gu}var Zu,ap;function w4(){if(ap)return Zu;ap=1;const t=m4();Zu=i;const e=T().console||{},r={mapHttpRequest:P,mapHttpResponse:P,wrapRequestSerializer:j,wrapResponseSerializer:j,wrapErrorSerializer:j,req:P,res:P,err:_};function n(I,d){return Array.isArray(I)?I.filter(function(J){return J!=="!stdSerializers.err"}):I===!0?Object.keys(d):!1}function i(I){I=I||{},I.browser=I.browser||{};const d=I.browser.transmit;if(d&&typeof d.send!="function")throw Error("pino: transmit option must have a send function");const x=I.browser.write||e;I.browser.write&&(I.browser.asObject=!0);const J=I.serializers||{},z=n(I.browser.serialize,J);let ee=I.browser.serialize;Array.isArray(I.browser.serialize)&&I.browser.serialize.indexOf("!stdSerializers.err")>-1&&(ee=!1);const de=["error","fatal","warn","info","debug","trace"];typeof x=="function"&&(x.error=x.fatal=x.warn=x.info=x.debug=x.trace=x),I.enabled===!1&&(I.level="silent");const me=I.level||"info",A=Object.create(x);A.log||(A.log=H),Object.defineProperty(A,"levelVal",{get:ce}),Object.defineProperty(A,"level",{get:le,set:re});const U={transmit:d,serialize:z,asObject:I.browser.asObject,levels:de,timestamp:S(I)};A.levels=i.levels,A.level=me,A.setMaxListeners=A.getMaxListeners=A.emit=A.addListener=A.on=A.prependListener=A.once=A.prependOnceListener=A.removeListener=A.removeAllListeners=A.listeners=A.listenerCount=A.eventNames=A.write=A.flush=H,A.serializers=J,A._serialize=z,A._stdErrSerialize=ee,A.child=ne,d&&(A._logEvent=E());function ce(){return this.level==="silent"?1/0:this.levels.values[this.level]}function le(){return this._level}function re(ae){if(ae!=="silent"&&!this.levels.values[ae])throw Error("unknown level "+ae);this._level=ae,o(U,A,"error","log"),o(U,A,"fatal","error"),o(U,A,"warn","error"),o(U,A,"info","log"),o(U,A,"debug","log"),o(U,A,"trace","log")}function ne(ae,ie){if(!ae)throw new Error("missing bindings for child Pino");ie=ie||{},z&&ae.serializers&&(ie.serializers=ae.serializers);const Oe=ie.serializers;if(z&&Oe){var ge=Object.assign({},J,Oe),Be=I.browser.serialize===!0?Object.keys(ge):z;delete ae.serializers,h([ae],Be,ge,this._stdErrSerialize)}function ye(Me){this._childLevel=(Me._childLevel|0)+1,this.error=f(Me,ae,"error"),this.fatal=f(Me,ae,"fatal"),this.warn=f(Me,ae,"warn"),this.info=f(Me,ae,"info"),this.debug=f(Me,ae,"debug"),this.trace=f(Me,ae,"trace"),ge&&(this.serializers=ge,this._serialize=Be),d&&(this._logEvent=E([].concat(Me._logEvent.bindings,ae)))}return ye.prototype=this,new ye(this)}return A}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=r,i.stdTimeFunctions=Object.assign({},{nullTime:Z,epochTime:R,unixTime:L,isoTime:$});function o(I,d,x,J){const z=Object.getPrototypeOf(d);d[x]=d.levelVal>d.levels.values[x]?H:z[x]?z[x]:e[x]||e[J]||H,c(I,d,x)}function c(I,d,x){!I.transmit&&d[x]===H||(d[x]=function(J){return function(){const ee=I.timestamp(),de=new Array(arguments.length),me=Object.getPrototypeOf&&Object.getPrototypeOf(this)===e?e:this;for(var A=0;A<de.length;A++)de[A]=arguments[A];if(I.serialize&&!I.asObject&&h(de,this._serialize,this.serializers,this._stdErrSerialize),I.asObject?J.call(me,l(this,x,de,ee)):J.apply(me,de),I.transmit){const U=I.transmit.level||d.level,ce=i.levels.values[U],le=i.levels.values[x];if(le<ce)return;v(this,{ts:ee,methodLevel:x,methodValue:le,transmitLevel:U,transmitValue:i.levels.values[I.transmit.level||d.level],send:I.transmit.send,val:d.levelVal},de)}}}(d[x]))}function l(I,d,x,J){I._serialize&&h(x,I._serialize,I.serializers,I._stdErrSerialize);const z=x.slice();let ee=z[0];const de={};J&&(de.time=J),de.level=i.levels.values[d];let me=(I._childLevel|0)+1;if(me<1&&(me=1),ee!==null&&typeof ee=="object"){for(;me--&&typeof z[0]=="object";)Object.assign(de,z.shift());ee=z.length?t(z.shift(),z):void 0}else typeof ee=="string"&&(ee=t(z.shift(),z));return ee!==void 0&&(de.msg=ee),de}function h(I,d,x,J){for(const z in I)if(J&&I[z]instanceof Error)I[z]=i.stdSerializers.err(I[z]);else if(typeof I[z]=="object"&&!Array.isArray(I[z]))for(const ee in I[z])d&&d.indexOf(ee)>-1&&ee in x&&(I[z][ee]=x[ee](I[z][ee]))}function f(I,d,x){return function(){const J=new Array(1+arguments.length);J[0]=d;for(var z=1;z<J.length;z++)J[z]=arguments[z-1];return I[x].apply(this,J)}}function v(I,d,x){const J=d.send,z=d.ts,ee=d.methodLevel,de=d.methodValue,me=d.val,A=I._logEvent.bindings;h(x,I._serialize||Object.keys(I.serializers),I.serializers,I._stdErrSerialize===void 0?!0:I._stdErrSerialize),I._logEvent.ts=z,I._logEvent.messages=x.filter(function(U){return A.indexOf(U)===-1}),I._logEvent.level.label=ee,I._logEvent.level.value=de,J(ee,I._logEvent,me),I._logEvent=E(A)}function E(I){return{ts:0,messages:[],bindings:I||[],level:{label:"",value:0}}}function _(I){const d={type:I.constructor.name,msg:I.message,stack:I.stack};for(const x in I)d[x]===void 0&&(d[x]=I[x]);return d}function S(I){return typeof I.timestamp=="function"?I.timestamp:I.timestamp===!1?Z:R}function P(){return{}}function j(I){return I}function H(){}function Z(){return!1}function R(){return Date.now()}function L(){return Math.round(Date.now()/1e3)}function $(){return new Date(Date.now()).toISOString()}function T(){function I(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 I(self)||I(window)||I(this)||{}}}return Zu}var qi={},cp;function lp(){return cp||(cp=1,Object.defineProperty(qi,"__esModule",{value:!0}),qi.PINO_CUSTOM_CONTEXT_KEY=qi.PINO_LOGGER_DEFAULTS=void 0,qi.PINO_LOGGER_DEFAULTS={level:"info"},qi.PINO_CUSTOM_CONTEXT_KEY="custom_context"),qi}var Tr={},up;function v4(){if(up)return Tr;up=1,Object.defineProperty(Tr,"__esModule",{value:!0}),Tr.generateChildLogger=Tr.formatChildLoggerContext=Tr.getLoggerContext=Tr.setBrowserLoggerContext=Tr.getBrowserLoggerContext=Tr.getDefaultLoggerOptions=void 0;const t=lp();function e(l){return Object.assign(Object.assign({},l),{level:l?.level||t.PINO_LOGGER_DEFAULTS.level})}Tr.getDefaultLoggerOptions=e;function r(l,h=t.PINO_CUSTOM_CONTEXT_KEY){return l[h]||""}Tr.getBrowserLoggerContext=r;function n(l,h,f=t.PINO_CUSTOM_CONTEXT_KEY){return l[f]=h,l}Tr.setBrowserLoggerContext=n;function i(l,h=t.PINO_CUSTOM_CONTEXT_KEY){let f="";return typeof l.bindings>"u"?f=r(l,h):f=l.bindings().context||"",f}Tr.getLoggerContext=i;function o(l,h,f=t.PINO_CUSTOM_CONTEXT_KEY){const v=i(l,f);return v.trim()?`${v}/${h}`:h}Tr.formatChildLoggerContext=o;function c(l,h,f=t.PINO_CUSTOM_CONTEXT_KEY){const v=o(l,h,f),E=l.child({context:v});return n(E,v,f)}return Tr.generateChildLogger=c,Tr}(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.pino=void 0;const e=g4,r=e.__importDefault(w4());Object.defineProperty(t,"pino",{enumerable:!0,get:function(){return r.default}}),e.__exportStar(lp(),t),e.__exportStar(v4(),t)})(pt);class y4 extends zi{constructor(e){super(),this.opts=e,this.protocol="wc",this.version=2}}class b4 extends zi{constructor(e,r){super(),this.core=e,this.logger=r,this.records=new Map}}class _4{constructor(e,r){this.logger=e,this.core=r}}class E4 extends zi{constructor(e,r){super(),this.relayer=e,this.logger=r}}class x4 extends zi{constructor(e){super()}}class C4{constructor(e,r,n,i){this.core=e,this.logger=r,this.name=n}}class I4 extends zi{constructor(e,r){super(),this.relayer=e,this.logger=r}}class S4 extends zi{constructor(e,r){super(),this.core=e,this.logger=r}}class A4{constructor(e,r){this.projectId=e,this.logger=r}}class O4{constructor(e){this.opts=e,this.protocol="wc",this.version=2}}class D4{constructor(e){this.client=e}}const $4=t=>JSON.stringify(t,(e,r)=>typeof r=="bigint"?r.toString()+"n":r),P4=t=>{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,r=t.replace(e,'$1"$2n"$3');return JSON.parse(r,(n,i)=>typeof i=="string"&&i.match(/^\d+n$/)?BigInt(i.substring(0,i.length-1)):i)};function Yu(t){if(typeof t!="string")throw new Error(`Cannot safe json parse value of type ${typeof t}`);try{return P4(t)}catch{return t}}function Mo(t){return typeof t=="string"?t:$4(t)||""}var Ju={},hp={};(function(t){Object.defineProperty(t,"__esModule",{value:!0});var e=et,r=Yr;t.DIGEST_LENGTH=64,t.BLOCK_SIZE=128;var n=function(){function l(){this.digestLength=t.DIGEST_LENGTH,this.blockSize=t.BLOCK_SIZE,this._stateHi=new Int32Array(8),this._stateLo=new Int32Array(8),this._tempHi=new Int32Array(16),this._tempLo=new Int32Array(16),this._buffer=new Uint8Array(256),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this.reset()}return l.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},l.prototype.reset=function(){return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this},l.prototype.clean=function(){r.wipe(this._buffer),r.wipe(this._tempHi),r.wipe(this._tempLo),this.reset()},l.prototype.update=function(h,f){if(f===void 0&&(f=h.length),this._finished)throw new Error("SHA512: can't update because hash was finished.");var v=0;if(this._bytesHashed+=f,this._bufferLength>0){for(;this._bufferLength<t.BLOCK_SIZE&&f>0;)this._buffer[this._bufferLength++]=h[v++],f--;this._bufferLength===this.blockSize&&(o(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,this.blockSize),this._bufferLength=0)}for(f>=this.blockSize&&(v=o(this._tempHi,this._tempLo,this._stateHi,this._stateLo,h,v,f),f%=this.blockSize);f>0;)this._buffer[this._bufferLength++]=h[v++],f--;return this},l.prototype.finish=function(h){if(!this._finished){var f=this._bytesHashed,v=this._bufferLength,E=f/536870912|0,_=f<<3,S=f%128<112?128:256;this._buffer[v]=128;for(var P=v+1;P<S-8;P++)this._buffer[P]=0;e.writeUint32BE(E,this._buffer,S-8),e.writeUint32BE(_,this._buffer,S-4),o(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,S),this._finished=!0}for(var P=0;P<this.digestLength/8;P++)e.writeUint32BE(this._stateHi[P],h,P*8),e.writeUint32BE(this._stateLo[P],h,P*8+4);return this},l.prototype.digest=function(){var h=new Uint8Array(this.digestLength);return this.finish(h),h},l.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}},l.prototype.restoreState=function(h){return this._stateHi.set(h.stateHi),this._stateLo.set(h.stateLo),this._bufferLength=h.bufferLength,h.buffer&&this._buffer.set(h.buffer),this._bytesHashed=h.bytesHashed,this._finished=!1,this},l.prototype.cleanSavedState=function(h){r.wipe(h.stateHi),r.wipe(h.stateLo),h.buffer&&r.wipe(h.buffer),h.bufferLength=0,h.bytesHashed=0},l}();t.SHA512=n;var i=new Int32Array([1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591]);function o(l,h,f,v,E,_,S){for(var P=f[0],j=f[1],H=f[2],Z=f[3],R=f[4],L=f[5],$=f[6],T=f[7],I=v[0],d=v[1],x=v[2],J=v[3],z=v[4],ee=v[5],de=v[6],me=v[7],A,U,ce,le,re,ne,ae,ie;S>=128;){for(var Oe=0;Oe<16;Oe++){var ge=8*Oe+_;l[Oe]=e.readUint32BE(E,ge),h[Oe]=e.readUint32BE(E,ge+4)}for(var Oe=0;Oe<80;Oe++){var Be=P,ye=j,Me=H,X=Z,Y=R,W=L,w=$,F=T,we=I,ve=d,Ue=x,nt=J,at=z,Ge=ee,Dt=de,$t=me;if(A=T,U=me,re=U&65535,ne=U>>>16,ae=A&65535,ie=A>>>16,A=(R>>>14|z<<32-14)^(R>>>18|z<<32-18)^(z>>>41-32|R<<32-(41-32)),U=(z>>>14|R<<32-14)^(z>>>18|R<<32-18)^(R>>>41-32|z<<32-(41-32)),re+=U&65535,ne+=U>>>16,ae+=A&65535,ie+=A>>>16,A=R&L^~R&$,U=z&ee^~z&de,re+=U&65535,ne+=U>>>16,ae+=A&65535,ie+=A>>>16,A=i[Oe*2],U=i[Oe*2+1],re+=U&65535,ne+=U>>>16,ae+=A&65535,ie+=A>>>16,A=l[Oe%16],U=h[Oe%16],re+=U&65535,ne+=U>>>16,ae+=A&65535,ie+=A>>>16,ne+=re>>>16,ae+=ne>>>16,ie+=ae>>>16,ce=ae&65535|ie<<16,le=re&65535|ne<<16,A=ce,U=le,re=U&65535,ne=U>>>16,ae=A&65535,ie=A>>>16,A=(P>>>28|I<<32-28)^(I>>>34-32|P<<32-(34-32))^(I>>>39-32|P<<32-(39-32)),U=(I>>>28|P<<32-28)^(P>>>34-32|I<<32-(34-32))^(P>>>39-32|I<<32-(39-32)),re+=U&65535,ne+=U>>>16,ae+=A&65535,ie+=A>>>16,A=P&j^P&H^j&H,U=I&d^I&x^d&x,re+=U&65535,ne+=U>>>16,ae+=A&65535,ie+=A>>>16,ne+=re>>>16,ae+=ne>>>16,ie+=ae>>>16,F=ae&65535|ie<<16,$t=re&65535|ne<<16,A=X,U=nt,re=U&65535,ne=U>>>16,ae=A&65535,ie=A>>>16,A=ce,U=le,re+=U&65535,ne+=U>>>16,ae+=A&65535,ie+=A>>>16,ne+=re>>>16,ae+=ne>>>16,ie+=ae>>>16,X=ae&65535|ie<<16,nt=re&65535|ne<<16,j=Be,H=ye,Z=Me,R=X,L=Y,$=W,T=w,P=F,d=we,x=ve,J=Ue,z=nt,ee=at,de=Ge,me=Dt,I=$t,Oe%16===15)for(var ge=0;ge<16;ge++)A=l[ge],U=h[ge],re=U&65535,ne=U>>>16,ae=A&65535,ie=A>>>16,A=l[(ge+9)%16],U=h[(ge+9)%16],re+=U&65535,ne+=U>>>16,ae+=A&65535,ie+=A>>>16,ce=l[(ge+1)%16],le=h[(ge+1)%16],A=(ce>>>1|le<<32-1)^(ce>>>8|le<<32-8)^ce>>>7,U=(le>>>1|ce<<32-1)^(le>>>8|ce<<32-8)^(le>>>7|ce<<32-7),re+=U&65535,ne+=U>>>16,ae+=A&65535,ie+=A>>>16,ce=l[(ge+14)%16],le=h[(ge+14)%16],A=(ce>>>19|le<<32-19)^(le>>>61-32|ce<<32-(61-32))^ce>>>6,U=(le>>>19|ce<<32-19)^(ce>>>61-32|le<<32-(61-32))^(le>>>6|ce<<32-6),re+=U&65535,ne+=U>>>16,ae+=A&65535,ie+=A>>>16,ne+=re>>>16,ae+=ne>>>16,ie+=ae>>>16,l[ge]=ae&65535|ie<<16,h[ge]=re&65535|ne<<16}A=P,U=I,re=U&65535,ne=U>>>16,ae=A&65535,ie=A>>>16,A=f[0],U=v[0],re+=U&65535,ne+=U>>>16,ae+=A&65535,ie+=A>>>16,ne+=re>>>16,ae+=ne>>>16,ie+=ae>>>16,f[0]=P=ae&65535|ie<<16,v[0]=I=re&65535|ne<<16,A=j,U=d,re=U&65535,ne=U>>>16,ae=A&65535,ie=A>>>16,A=f[1],U=v[1],re+=U&65535,ne+=U>>>16,ae+=A&65535,ie+=A>>>16,ne+=re>>>16,ae+=ne>>>16,ie+=ae>>>16,f[1]=j=ae&65535|ie<<16,v[1]=d=re&65535|ne<<16,A=H,U=x,re=U&65535,ne=U>>>16,ae=A&65535,ie=A>>>16,A=f[2],U=v[2],re+=U&65535,ne+=U>>>16,ae+=A&65535,ie+=A>>>16,ne+=re>>>16,ae+=ne>>>16,ie+=ae>>>16,f[2]=H=ae&65535|ie<<16,v[2]=x=re&65535|ne<<16,A=Z,U=J,re=U&65535,ne=U>>>16,ae=A&65535,ie=A>>>16,A=f[3],U=v[3],re+=U&65535,ne+=U>>>16,ae+=A&65535,ie+=A>>>16,ne+=re>>>16,ae+=ne>>>16,ie+=ae>>>16,f[3]=Z=ae&65535|ie<<16,v[3]=J=re&65535|ne<<16,A=R,U=z,re=U&65535,ne=U>>>16,ae=A&65535,ie=A>>>16,A=f[4],U=v[4],re+=U&65535,ne+=U>>>16,ae+=A&65535,ie+=A>>>16,ne+=re>>>16,ae+=ne>>>16,ie+=ae>>>16,f[4]=R=ae&65535|ie<<16,v[4]=z=re&65535|ne<<16,A=L,U=ee,re=U&65535,ne=U>>>16,ae=A&65535,ie=A>>>16,A=f[5],U=v[5],re+=U&65535,ne+=U>>>16,ae+=A&65535,ie+=A>>>16,ne+=re>>>16,ae+=ne>>>16,ie+=ae>>>16,f[5]=L=ae&65535|ie<<16,v[5]=ee=re&65535|ne<<16,A=$,U=de,re=U&65535,ne=U>>>16,ae=A&65535,ie=A>>>16,A=f[6],U=v[6],re+=U&65535,ne+=U>>>16,ae+=A&65535,ie+=A>>>16,ne+=re>>>16,ae+=ne>>>16,ie+=ae>>>16,f[6]=$=ae&65535|ie<<16,v[6]=de=re&65535|ne<<16,A=T,U=me,re=U&65535,ne=U>>>16,ae=A&65535,ie=A>>>16,A=f[7],U=v[7],re+=U&65535,ne+=U>>>16,ae+=A&65535,ie+=A>>>16,ne+=re>>>16,ae+=ne>>>16,ie+=ae>>>16,f[7]=T=ae&65535|ie<<16,v[7]=me=re&65535|ne<<16,_+=128,S-=128}return _}function c(l){var h=new n;h.update(l);var f=h.digest();return h.clean(),f}t.hash=c})(hp),function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.convertSecretKeyToX25519=t.convertPublicKeyToX25519=t.verify=t.sign=t.extractPublicKeyFromSecretKey=t.generateKeyPair=t.generateKeyPairFromSeed=t.SEED_LENGTH=t.SECRET_KEY_LENGTH=t.PUBLIC_KEY_LENGTH=t.SIGNATURE_LENGTH=void 0;const e=xs,r=hp,n=Yr;t.SIGNATURE_LENGTH=64,t.PUBLIC_KEY_LENGTH=32,t.SECRET_KEY_LENGTH=64,t.SEED_LENGTH=32;function i(X){const Y=new Float64Array(16);if(X)for(let W=0;W<X.length;W++)Y[W]=X[W];return Y}const o=new Uint8Array(32);o[0]=9;const c=i(),l=i([1]),h=i([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),f=i([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),v=i([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),E=i([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),_=i([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function S(X,Y){for(let W=0;W<16;W++)X[W]=Y[W]|0}function P(X){let Y=1;for(let W=0;W<16;W++){let w=X[W]+Y+65535;Y=Math.floor(w/65536),X[W]=w-Y*65536}X[0]+=Y-1+37*(Y-1)}function j(X,Y,W){const w=~(W-1);for(let F=0;F<16;F++){const we=w&(X[F]^Y[F]);X[F]^=we,Y[F]^=we}}function H(X,Y){const W=i(),w=i();for(let F=0;F<16;F++)w[F]=Y[F];P(w),P(w),P(w);for(let F=0;F<2;F++){W[0]=w[0]-65517;for(let ve=1;ve<15;ve++)W[ve]=w[ve]-65535-(W[ve-1]>>16&1),W[ve-1]&=65535;W[15]=w[15]-32767-(W[14]>>16&1);const we=W[15]>>16&1;W[14]&=65535,j(w,W,1-we)}for(let F=0;F<16;F++)X[2*F]=w[F]&255,X[2*F+1]=w[F]>>8}function Z(X,Y){let W=0;for(let w=0;w<32;w++)W|=X[w]^Y[w];return(1&W-1>>>8)-1}function R(X,Y){const W=new Uint8Array(32),w=new Uint8Array(32);return H(W,X),H(w,Y),Z(W,w)}function L(X){const Y=new Uint8Array(32);return H(Y,X),Y[0]&1}function $(X,Y){for(let W=0;W<16;W++)X[W]=Y[2*W]+(Y[2*W+1]<<8);X[15]&=32767}function T(X,Y,W){for(let w=0;w<16;w++)X[w]=Y[w]+W[w]}function I(X,Y,W){for(let w=0;w<16;w++)X[w]=Y[w]-W[w]}function d(X,Y,W){let w,F,we=0,ve=0,Ue=0,nt=0,at=0,Ge=0,Dt=0,$t=0,Je=0,He=0,ke=0,Ke=0,rt=0,je=0,Ze=0,b=0,p=0,m=0,D=0,B=0,K=0,Q=0,Ee=0,Ne=0,st=0,ht=0,lt=0,Ur=0,Jn=0,Si=0,cs=0,zt=W[0],Lt=W[1],Wt=W[2],qt=W[3],Ft=W[4],Mt=W[5],ir=W[6],sr=W[7],Vt=W[8],or=W[9],Kt=W[10],Xt=W[11],Gt=W[12],Pt=W[13],ar=W[14],cr=W[15];w=Y[0],we+=w*zt,ve+=w*Lt,Ue+=w*Wt,nt+=w*qt,at+=w*Ft,Ge+=w*Mt,Dt+=w*ir,$t+=w*sr,Je+=w*Vt,He+=w*or,ke+=w*Kt,Ke+=w*Xt,rt+=w*Gt,je+=w*Pt,Ze+=w*ar,b+=w*cr,w=Y[1],ve+=w*zt,Ue+=w*Lt,nt+=w*Wt,at+=w*qt,Ge+=w*Ft,Dt+=w*Mt,$t+=w*ir,Je+=w*sr,He+=w*Vt,ke+=w*or,Ke+=w*Kt,rt+=w*Xt,je+=w*Gt,Ze+=w*Pt,b+=w*ar,p+=w*cr,w=Y[2],Ue+=w*zt,nt+=w*Lt,at+=w*Wt,Ge+=w*qt,Dt+=w*Ft,$t+=w*Mt,Je+=w*ir,He+=w*sr,ke+=w*Vt,Ke+=w*or,rt+=w*Kt,je+=w*Xt,Ze+=w*Gt,b+=w*Pt,p+=w*ar,m+=w*cr,w=Y[3],nt+=w*zt,at+=w*Lt,Ge+=w*Wt,Dt+=w*qt,$t+=w*Ft,Je+=w*Mt,He+=w*ir,ke+=w*sr,Ke+=w*Vt,rt+=w*or,je+=w*Kt,Ze+=w*Xt,b+=w*Gt,p+=w*Pt,m+=w*ar,D+=w*cr,w=Y[4],at+=w*zt,Ge+=w*Lt,Dt+=w*Wt,$t+=w*qt,Je+=w*Ft,He+=w*Mt,ke+=w*ir,Ke+=w*sr,rt+=w*Vt,je+=w*or,Ze+=w*Kt,b+=w*Xt,p+=w*Gt,m+=w*Pt,D+=w*ar,B+=w*cr,w=Y[5],Ge+=w*zt,Dt+=w*Lt,$t+=w*Wt,Je+=w*qt,He+=w*Ft,ke+=w*Mt,Ke+=w*ir,rt+=w*sr,je+=w*Vt,Ze+=w*or,b+=w*Kt,p+=w*Xt,m+=w*Gt,D+=w*Pt,B+=w*ar,K+=w*cr,w=Y[6],Dt+=w*zt,$t+=w*Lt,Je+=w*Wt,He+=w*qt,ke+=w*Ft,Ke+=w*Mt,rt+=w*ir,je+=w*sr,Ze+=w*Vt,b+=w*or,p+=w*Kt,m+=w*Xt,D+=w*Gt,B+=w*Pt,K+=w*ar,Q+=w*cr,w=Y[7],$t+=w*zt,Je+=w*Lt,He+=w*Wt,ke+=w*qt,Ke+=w*Ft,rt+=w*Mt,je+=w*ir,Ze+=w*sr,b+=w*Vt,p+=w*or,m+=w*Kt,D+=w*Xt,B+=w*Gt,K+=w*Pt,Q+=w*ar,Ee+=w*cr,w=Y[8],Je+=w*zt,He+=w*Lt,ke+=w*Wt,Ke+=w*qt,rt+=w*Ft,je+=w*Mt,Ze+=w*ir,b+=w*sr,p+=w*Vt,m+=w*or,D+=w*Kt,B+=w*Xt,K+=w*Gt,Q+=w*Pt,Ee+=w*ar,Ne+=w*cr,w=Y[9],He+=w*zt,ke+=w*Lt,Ke+=w*Wt,rt+=w*qt,je+=w*Ft,Ze+=w*Mt,b+=w*ir,p+=w*sr,m+=w*Vt,D+=w*or,B+=w*Kt,K+=w*Xt,Q+=w*Gt,Ee+=w*Pt,Ne+=w*ar,st+=w*cr,w=Y[10],ke+=w*zt,Ke+=w*Lt,rt+=w*Wt,je+=w*qt,Ze+=w*Ft,b+=w*Mt,p+=w*ir,m+=w*sr,D+=w*Vt,B+=w*or,K+=w*Kt,Q+=w*Xt,Ee+=w*Gt,Ne+=w*Pt,st+=w*ar,ht+=w*cr,w=Y[11],Ke+=w*zt,rt+=w*Lt,je+=w*Wt,Ze+=w*qt,b+=w*Ft,p+=w*Mt,m+=w*ir,D+=w*sr,B+=w*Vt,K+=w*or,Q+=w*Kt,Ee+=w*Xt,Ne+=w*Gt,st+=w*Pt,ht+=w*ar,lt+=w*cr,w=Y[12],rt+=w*zt,je+=w*Lt,Ze+=w*Wt,b+=w*qt,p+=w*Ft,m+=w*Mt,D+=w*ir,B+=w*sr,K+=w*Vt,Q+=w*or,Ee+=w*Kt,Ne+=w*Xt,st+=w*Gt,ht+=w*Pt,lt+=w*ar,Ur+=w*cr,w=Y[13],je+=w*zt,Ze+=w*Lt,b+=w*Wt,p+=w*qt,m+=w*Ft,D+=w*Mt,B+=w*ir,K+=w*sr,Q+=w*Vt,Ee+=w*or,Ne+=w*Kt,st+=w*Xt,ht+=w*Gt,lt+=w*Pt,Ur+=w*ar,Jn+=w*cr,w=Y[14],Ze+=w*zt,b+=w*Lt,p+=w*Wt,m+=w*qt,D+=w*Ft,B+=w*Mt,K+=w*ir,Q+=w*sr,Ee+=w*Vt,Ne+=w*or,st+=w*Kt,ht+=w*Xt,lt+=w*Gt,Ur+=w*Pt,Jn+=w*ar,Si+=w*cr,w=Y[15],b+=w*zt,p+=w*Lt,m+=w*Wt,D+=w*qt,B+=w*Ft,K+=w*Mt,Q+=w*ir,Ee+=w*sr,Ne+=w*Vt,st+=w*or,ht+=w*Kt,lt+=w*Xt,Ur+=w*Gt,Jn+=w*Pt,Si+=w*ar,cs+=w*cr,we+=38*p,ve+=38*m,Ue+=38*D,nt+=38*B,at+=38*K,Ge+=38*Q,Dt+=38*Ee,$t+=38*Ne,Je+=38*st,He+=38*ht,ke+=38*lt,Ke+=38*Ur,rt+=38*Jn,je+=38*Si,Ze+=38*cs,F=1,w=we+F+65535,F=Math.floor(w/65536),we=w-F*65536,w=ve+F+65535,F=Math.floor(w/65536),ve=w-F*65536,w=Ue+F+65535,F=Math.floor(w/65536),Ue=w-F*65536,w=nt+F+65535,F=Math.floor(w/65536),nt=w-F*65536,w=at+F+65535,F=Math.floor(w/65536),at=w-F*65536,w=Ge+F+65535,F=Math.floor(w/65536),Ge=w-F*65536,w=Dt+F+65535,F=Math.floor(w/65536),Dt=w-F*65536,w=$t+F+65535,F=Math.floor(w/65536),$t=w-F*65536,w=Je+F+65535,F=Math.floor(w/65536),Je=w-F*65536,w=He+F+65535,F=Math.floor(w/65536),He=w-F*65536,w=ke+F+65535,F=Math.floor(w/65536),ke=w-F*65536,w=Ke+F+65535,F=Math.floor(w/65536),Ke=w-F*65536,w=rt+F+65535,F=Math.floor(w/65536),rt=w-F*65536,w=je+F+65535,F=Math.floor(w/65536),je=w-F*65536,w=Ze+F+65535,F=Math.floor(w/65536),Ze=w-F*65536,w=b+F+65535,F=Math.floor(w/65536),b=w-F*65536,we+=F-1+37*(F-1),F=1,w=we+F+65535,F=Math.floor(w/65536),we=w-F*65536,w=ve+F+65535,F=Math.floor(w/65536),ve=w-F*65536,w=Ue+F+65535,F=Math.floor(w/65536),Ue=w-F*65536,w=nt+F+65535,F=Math.floor(w/65536),nt=w-F*65536,w=at+F+65535,F=Math.floor(w/65536),at=w-F*65536,w=Ge+F+65535,F=Math.floor(w/65536),Ge=w-F*65536,w=Dt+F+65535,F=Math.floor(w/65536),Dt=w-F*65536,w=$t+F+65535,F=Math.floor(w/65536),$t=w-F*65536,w=Je+F+65535,F=Math.floor(w/65536),Je=w-F*65536,w=He+F+65535,F=Math.floor(w/65536),He=w-F*65536,w=ke+F+65535,F=Math.floor(w/65536),ke=w-F*65536,w=Ke+F+65535,F=Math.floor(w/65536),Ke=w-F*65536,w=rt+F+65535,F=Math.floor(w/65536),rt=w-F*65536,w=je+F+65535,F=Math.floor(w/65536),je=w-F*65536,w=Ze+F+65535,F=Math.floor(w/65536),Ze=w-F*65536,w=b+F+65535,F=Math.floor(w/65536),b=w-F*65536,we+=F-1+37*(F-1),X[0]=we,X[1]=ve,X[2]=Ue,X[3]=nt,X[4]=at,X[5]=Ge,X[6]=Dt,X[7]=$t,X[8]=Je,X[9]=He,X[10]=ke,X[11]=Ke,X[12]=rt,X[13]=je,X[14]=Ze,X[15]=b}function x(X,Y){d(X,Y,Y)}function J(X,Y){const W=i();let w;for(w=0;w<16;w++)W[w]=Y[w];for(w=253;w>=0;w--)x(W,W),w!==2&&w!==4&&d(W,W,Y);for(w=0;w<16;w++)X[w]=W[w]}function z(X,Y){const W=i();let w;for(w=0;w<16;w++)W[w]=Y[w];for(w=250;w>=0;w--)x(W,W),w!==1&&d(W,W,Y);for(w=0;w<16;w++)X[w]=W[w]}function ee(X,Y){const W=i(),w=i(),F=i(),we=i(),ve=i(),Ue=i(),nt=i(),at=i(),Ge=i();I(W,X[1],X[0]),I(Ge,Y[1],Y[0]),d(W,W,Ge),T(w,X[0],X[1]),T(Ge,Y[0],Y[1]),d(w,w,Ge),d(F,X[3],Y[3]),d(F,F,f),d(we,X[2],Y[2]),T(we,we,we),I(ve,w,W),I(Ue,we,F),T(nt,we,F),T(at,w,W),d(X[0],ve,Ue),d(X[1],at,nt),d(X[2],nt,Ue),d(X[3],ve,at)}function de(X,Y,W){for(let w=0;w<4;w++)j(X[w],Y[w],W)}function me(X,Y){const W=i(),w=i(),F=i();J(F,Y[2]),d(W,Y[0],F),d(w,Y[1],F),H(X,w),X[31]^=L(W)<<7}function A(X,Y,W){S(X[0],c),S(X[1],l),S(X[2],l),S(X[3],c);for(let w=255;w>=0;--w){const F=W[w/8|0]>>(w&7)&1;de(X,Y,F),ee(Y,X),ee(X,X),de(X,Y,F)}}function U(X,Y){const W=[i(),i(),i(),i()];S(W[0],v),S(W[1],E),S(W[2],l),d(W[3],v,E),A(X,W,Y)}function ce(X){if(X.length!==t.SEED_LENGTH)throw new Error(`ed25519: seed must be ${t.SEED_LENGTH} bytes`);const Y=(0,r.hash)(X);Y[0]&=248,Y[31]&=127,Y[31]|=64;const W=new Uint8Array(32),w=[i(),i(),i(),i()];U(w,Y),me(W,w);const F=new Uint8Array(64);return F.set(X),F.set(W,32),{publicKey:W,secretKey:F}}t.generateKeyPairFromSeed=ce;function le(X){const Y=(0,e.randomBytes)(32,X),W=ce(Y);return(0,n.wipe)(Y),W}t.generateKeyPair=le;function re(X){if(X.length!==t.SECRET_KEY_LENGTH)throw new Error(`ed25519: secret key must be ${t.SECRET_KEY_LENGTH} bytes`);return new Uint8Array(X.subarray(32))}t.extractPublicKeyFromSecretKey=re;const ne=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 ae(X,Y){let W,w,F,we;for(w=63;w>=32;--w){for(W=0,F=w-32,we=w-12;F<we;++F)Y[F]+=W-16*Y[w]*ne[F-(w-32)],W=Math.floor((Y[F]+128)/256),Y[F]-=W*256;Y[F]+=W,Y[w]=0}for(W=0,F=0;F<32;F++)Y[F]+=W-(Y[31]>>4)*ne[F],W=Y[F]>>8,Y[F]&=255;for(F=0;F<32;F++)Y[F]-=W*ne[F];for(w=0;w<32;w++)Y[w+1]+=Y[w]>>8,X[w]=Y[w]&255}function ie(X){const Y=new Float64Array(64);for(let W=0;W<64;W++)Y[W]=X[W];for(let W=0;W<64;W++)X[W]=0;ae(X,Y)}function Oe(X,Y){const W=new Float64Array(64),w=[i(),i(),i(),i()],F=(0,r.hash)(X.subarray(0,32));F[0]&=248,F[31]&=127,F[31]|=64;const we=new Uint8Array(64);we.set(F.subarray(32),32);const ve=new r.SHA512;ve.update(we.subarray(32)),ve.update(Y);const Ue=ve.digest();ve.clean(),ie(Ue),U(w,Ue),me(we,w),ve.reset(),ve.update(we.subarray(0,32)),ve.update(X.subarray(32)),ve.update(Y);const nt=ve.digest();ie(nt);for(let at=0;at<32;at++)W[at]=Ue[at];for(let at=0;at<32;at++)for(let Ge=0;Ge<32;Ge++)W[at+Ge]+=nt[at]*F[Ge];return ae(we.subarray(32),W),we}t.sign=Oe;function ge(X,Y){const W=i(),w=i(),F=i(),we=i(),ve=i(),Ue=i(),nt=i();return S(X[2],l),$(X[1],Y),x(F,X[1]),d(we,F,h),I(F,F,X[2]),T(we,X[2],we),x(ve,we),x(Ue,ve),d(nt,Ue,ve),d(W,nt,F),d(W,W,we),z(W,W),d(W,W,F),d(W,W,we),d(W,W,we),d(X[0],W,we),x(w,X[0]),d(w,w,we),R(w,F)&&d(X[0],X[0],_),x(w,X[0]),d(w,w,we),R(w,F)?-1:(L(X[0])===Y[31]>>7&&I(X[0],c,X[0]),d(X[3],X[0],X[1]),0)}function Be(X,Y,W){const w=new Uint8Array(32),F=[i(),i(),i(),i()],we=[i(),i(),i(),i()];if(W.length!==t.SIGNATURE_LENGTH)throw new Error(`ed25519: signature must be ${t.SIGNATURE_LENGTH} bytes`);if(ge(we,X))return!1;const ve=new r.SHA512;ve.update(W.subarray(0,32)),ve.update(X),ve.update(Y);const Ue=ve.digest();return ie(Ue),A(F,we,Ue),U(we,W.subarray(32)),ee(F,we),me(w,F),!Z(W,w)}t.verify=Be;function ye(X){let Y=[i(),i(),i(),i()];if(ge(Y,X))throw new Error("Ed25519: invalid public key");let W=i(),w=i(),F=Y[1];T(W,l,F),I(w,l,F),J(w,w),d(W,W,w);let we=new Uint8Array(32);return H(we,W),we}t.convertPublicKeyToX25519=ye;function Me(X){const Y=(0,r.hash)(X.subarray(0,32));Y[0]&=248,Y[31]&=127,Y[31]|=64;const W=new Uint8Array(Y.subarray(0,32));return(0,n.wipe)(Y),W}t.convertSecretKeyToX25519=Me}(Ju);const T4="EdDSA",N4="JWT",fp=".",dp="base64url",R4="utf8",L4="utf8",M4=":",U4="did",j4="key",pp="base58btc",F4="z",B4="K36",k4=32;function tc(t){return Dr(Hr(Mo(t),R4),dp)}function gp(t){const e=Hr(B4,pp),r=F4+Dr(uu([e,t]),pp);return[U4,j4,r].join(M4)}function H4(t){return Dr(t,dp)}function z4(t){return Hr([tc(t.header),tc(t.payload)].join(fp),L4)}function W4(t){return[tc(t.header),tc(t.payload),H4(t.signature)].join(fp)}function mp(t=xs.randomBytes(k4)){return Ju.generateKeyPairFromSeed(t)}async function q4(t,e,r,n,i=Te.fromMiliseconds(Date.now())){const o={alg:T4,typ:N4},c=gp(n.publicKey),l=i+r,h={iss:c,sub:t,aud:e,iat:i,exp:l},f=z4({header:o,payload:h}),v=Ju.sign(n.secretKey,f);return W4({header:o,payload:h,signature:v})}const V4="PARSE_ERROR",K4="INVALID_REQUEST",G4="METHOD_NOT_FOUND",Z4="INVALID_PARAMS",wp="INTERNAL_ERROR",Xu="SERVER_ERROR",Y4=[-32700,-32600,-32601,-32602,-32603],Uo={[V4]:{code:-32700,message:"Parse error"},[K4]:{code:-32600,message:"Invalid Request"},[G4]:{code:-32601,message:"Method not found"},[Z4]:{code:-32602,message:"Invalid params"},[wp]:{code:-32603,message:"Internal error"},[Xu]:{code:-32e3,message:"Server error"}},vp=Xu;function J4(t){return Y4.includes(t)}function yp(t){return Object.keys(Uo).includes(t)?Uo[t]:Uo[vp]}function X4(t){const e=Object.values(Uo).find(r=>r.code===t);return e||Uo[vp]}function bp(t,e,r){return t.message.includes("getaddrinfo ENOTFOUND")||t.message.includes("connect ECONNREFUSED")?new Error(`Unavailable ${r} RPC url at ${e}`):t}var _p={};/*! *****************************************************************************
59
+ ***************************************************************************** */var Qu=function(t,e){return Qu=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)n.hasOwnProperty(i)&&(r[i]=n[i])},Qu(t,e)};function j4(t,e){Qu(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var eh=function(){return eh=Object.assign||function(e){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e},eh.apply(this,arguments)};function B4(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r}function k4(t,e,r,n){var i=arguments.length,o=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(o=(i<3?c(o):i>3?c(e,r,o):c(e,r))||o);return i>3&&o&&Object.defineProperty(e,r,o),o}function H4(t,e){return function(r,n){e(r,n,t)}}function z4(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function W4(t,e,r,n){function i(o){return o instanceof r?o:new r(function(c){c(o)})}return new(r||(r=Promise))(function(o,c){function l(v){try{d(n.next(v))}catch(x){c(x)}}function h(v){try{d(n.throw(v))}catch(x){c(x)}}function d(v){v.done?o(v.value):i(v.value).then(l,h)}d((n=n.apply(t,e||[])).next())})}function q4(t,e){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,c;return c={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function l(d){return function(v){return h([d,v])}}function h(d){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(o=d[0]&2?i.return:d[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,d[1])).done)return o;switch(i=0,o&&(d=[d[0]&2,o.value]),d[0]){case 0:case 1:o=d;break;case 4:return r.label++,{value:d[1],done:!1};case 5:r.label++,i=d[1],d=[0];continue;case 7:d=r.ops.pop(),r.trys.pop();continue;default:if(o=r.trys,!(o=o.length>0&&o[o.length-1])&&(d[0]===6||d[0]===2)){r=0;continue}if(d[0]===3&&(!o||d[1]>o[0]&&d[1]<o[3])){r.label=d[1];break}if(d[0]===6&&r.label<o[1]){r.label=o[1],o=d;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(d);break}o[2]&&r.ops.pop(),r.trys.pop();continue}d=e.call(t,r)}catch(v){d=[6,v],i=0}finally{n=o=0}if(d[0]&5)throw d[1];return{value:d[0]?d[1]:void 0,done:!0}}}function V4(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}function K4(t,e){for(var r in t)r!=="default"&&!e.hasOwnProperty(r)&&(e[r]=t[r])}function th(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function bp(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,o=[],c;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(l){c={error:l}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(c)throw c.error}}return o}function G4(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(bp(arguments[e]));return t}function Z4(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;for(var n=Array(t),i=0,e=0;e<r;e++)for(var o=arguments[e],c=0,l=o.length;c<l;c++,i++)n[i]=o[c];return n}function Uo(t){return this instanceof Uo?(this.v=t,this):new Uo(t)}function Y4(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(t,e||[]),i,o=[];return i={},c("next"),c("throw"),c("return"),i[Symbol.asyncIterator]=function(){return this},i;function c(_){n[_]&&(i[_]=function(A){return new Promise(function(P,L){o.push([_,A,P,L])>1||l(_,A)})})}function l(_,A){try{h(n[_](A))}catch(P){x(o[0][3],P)}}function h(_){_.value instanceof Uo?Promise.resolve(_.value.v).then(d,v):x(o[0][2],_)}function d(_){l("next",_)}function v(_){l("throw",_)}function x(_,A){_(A),o.shift(),o.length&&l(o[0][0],o[0][1])}}function J4(t){var e,r;return e={},n("next"),n("throw",function(i){throw i}),n("return"),e[Symbol.iterator]=function(){return this},e;function n(i,o){e[i]=t[i]?function(c){return(r=!r)?{value:Uo(t[i](c)),done:i==="return"}:o?o(c):c}:o}}function X4(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof th=="function"?th(t):t[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(o){r[o]=t[o]&&function(c){return new Promise(function(l,h){c=t[o](c),i(l,h,c.done,c.value)})}}function i(o,c,l,h){Promise.resolve(h).then(function(d){o({value:d,done:l})},c)}}function Q4(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function e_(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}function t_(t){return t&&t.__esModule?t:{default:t}}function r_(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}function n_(t,e,r){if(!e.has(t))throw new TypeError("attempted to set private field on non-instance");return e.set(t,r),r}var i_=Object.freeze({__proto__:null,__extends:j4,get __assign(){return eh},__rest:B4,__decorate:k4,__param:H4,__metadata:z4,__awaiter:W4,__generator:q4,__createBinding:V4,__exportStar:K4,__values:th,__read:bp,__spread:G4,__spreadArrays:Z4,__await:Uo,__asyncGenerator:Y4,__asyncDelegator:J4,__asyncValues:X4,__makeTemplateObject:Q4,__importStar:e_,__importDefault:t_,__classPrivateFieldGet:r_,__classPrivateFieldSet:n_}),s_=Ui(i_),rh,_p;function o_(){if(_p)return rh;_p=1;function t(r){try{return JSON.stringify(r)}catch{return'"[Circular]"'}}rh=e;function e(r,n,i){var o=i&&i.stringify||t,c=1;if(typeof r=="object"&&r!==null){var l=n.length+c;if(l===1)return r;var h=new Array(l);h[0]=o(r);for(var d=1;d<l;d++)h[d]=o(n[d]);return h.join(" ")}if(typeof r!="string")return r;var v=n.length;if(v===0)return r;for(var x="",_=1-c,A=-1,P=r&&r.length||0,L=0;L<P;){if(r.charCodeAt(L)===37&&L+1<P){switch(A=A>-1?A:0,r.charCodeAt(L+1)){case 100:case 102:if(_>=v||n[_]==null)break;A<L&&(x+=r.slice(A,L)),x+=Number(n[_]),A=L+2,L++;break;case 105:if(_>=v||n[_]==null)break;A<L&&(x+=r.slice(A,L)),x+=Math.floor(Number(n[_])),A=L+2,L++;break;case 79:case 111:case 106:if(_>=v||n[_]===void 0)break;A<L&&(x+=r.slice(A,L));var k=typeof n[_];if(k==="string"){x+="'"+n[_]+"'",A=L+2,L++;break}if(k==="function"){x+=n[_].name||"<anonymous>",A=L+2,L++;break}x+=o(n[_]),A=L+2,L++;break;case 115:if(_>=v)break;A<L&&(x+=r.slice(A,L)),x+=String(n[_]),A=L+2,L++;break;case 37:A<L&&(x+=r.slice(A,L)),x+="%",A=L+2,L++,_--;break}++_}++L}return A===-1?r:(A<P&&(x+=r.slice(A)),x)}return rh}var nh,Ep;function a_(){if(Ep)return nh;Ep=1;const t=o_();nh=i;const e=T().console||{},r={mapHttpRequest:P,mapHttpResponse:P,wrapRequestSerializer:L,wrapResponseSerializer:L,wrapErrorSerializer:L,req:P,res:P,err:_};function n(C,f){return Array.isArray(C)?C.filter(function(Z){return Z!=="!stdSerializers.err"}):C===!0?Object.keys(f):!1}function i(C){C=C||{},C.browser=C.browser||{};const f=C.browser.transmit;if(f&&typeof f.send!="function")throw Error("pino: transmit option must have a send function");const E=C.browser.write||e;C.browser.write&&(C.browser.asObject=!0);const Z=C.serializers||{},z=n(C.browser.serialize,Z);let ee=C.browser.serialize;Array.isArray(C.browser.serialize)&&C.browser.serialize.indexOf("!stdSerializers.err")>-1&&(ee=!1);const de=["error","fatal","warn","info","debug","trace"];typeof E=="function"&&(E.error=E.fatal=E.warn=E.info=E.debug=E.trace=E),C.enabled===!1&&(C.level="silent");const me=C.level||"info",O=Object.create(E);O.log||(O.log=k),Object.defineProperty(O,"levelVal",{get:ce}),Object.defineProperty(O,"level",{get:le,set:re});const U={transmit:f,serialize:z,asObject:C.browser.asObject,levels:de,timestamp:A(C)};O.levels=i.levels,O.level=me,O.setMaxListeners=O.getMaxListeners=O.emit=O.addListener=O.on=O.prependListener=O.once=O.prependOnceListener=O.removeListener=O.removeAllListeners=O.listeners=O.listenerCount=O.eventNames=O.write=O.flush=k,O.serializers=Z,O._serialize=z,O._stdErrSerialize=ee,O.child=ne,f&&(O._logEvent=x());function ce(){return this.level==="silent"?1/0:this.levels.values[this.level]}function le(){return this._level}function re(ae){if(ae!=="silent"&&!this.levels.values[ae])throw Error("unknown level "+ae);this._level=ae,o(U,O,"error","log"),o(U,O,"fatal","error"),o(U,O,"warn","error"),o(U,O,"info","log"),o(U,O,"debug","log"),o(U,O,"trace","log")}function ne(ae,ie){if(!ae)throw new Error("missing bindings for child Pino");ie=ie||{},z&&ae.serializers&&(ie.serializers=ae.serializers);const Oe=ie.serializers;if(z&&Oe){var ge=Object.assign({},Z,Oe),Be=C.browser.serialize===!0?Object.keys(ge):z;delete ae.serializers,h([ae],Be,ge,this._stdErrSerialize)}function ye(Le){this._childLevel=(Le._childLevel|0)+1,this.error=d(Le,ae,"error"),this.fatal=d(Le,ae,"fatal"),this.warn=d(Le,ae,"warn"),this.info=d(Le,ae,"info"),this.debug=d(Le,ae,"debug"),this.trace=d(Le,ae,"trace"),ge&&(this.serializers=ge,this._serialize=Be),f&&(this._logEvent=x([].concat(Le._logEvent.bindings,ae)))}return ye.prototype=this,new ye(this)}return O}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=r,i.stdTimeFunctions=Object.assign({},{nullTime:q,epochTime:R,unixTime:F,isoTime:$});function o(C,f,E,Z){const z=Object.getPrototypeOf(f);f[E]=f.levelVal>f.levels.values[E]?k:z[E]?z[E]:e[E]||e[Z]||k,c(C,f,E)}function c(C,f,E){!C.transmit&&f[E]===k||(f[E]=function(Z){return function(){const ee=C.timestamp(),de=new Array(arguments.length),me=Object.getPrototypeOf&&Object.getPrototypeOf(this)===e?e:this;for(var O=0;O<de.length;O++)de[O]=arguments[O];if(C.serialize&&!C.asObject&&h(de,this._serialize,this.serializers,this._stdErrSerialize),C.asObject?Z.call(me,l(this,E,de,ee)):Z.apply(me,de),C.transmit){const U=C.transmit.level||f.level,ce=i.levels.values[U],le=i.levels.values[E];if(le<ce)return;v(this,{ts:ee,methodLevel:E,methodValue:le,transmitLevel:U,transmitValue:i.levels.values[C.transmit.level||f.level],send:C.transmit.send,val:f.levelVal},de)}}}(f[E]))}function l(C,f,E,Z){C._serialize&&h(E,C._serialize,C.serializers,C._stdErrSerialize);const z=E.slice();let ee=z[0];const de={};Z&&(de.time=Z),de.level=i.levels.values[f];let me=(C._childLevel|0)+1;if(me<1&&(me=1),ee!==null&&typeof ee=="object"){for(;me--&&typeof z[0]=="object";)Object.assign(de,z.shift());ee=z.length?t(z.shift(),z):void 0}else typeof ee=="string"&&(ee=t(z.shift(),z));return ee!==void 0&&(de.msg=ee),de}function h(C,f,E,Z){for(const z in C)if(Z&&C[z]instanceof Error)C[z]=i.stdSerializers.err(C[z]);else if(typeof C[z]=="object"&&!Array.isArray(C[z]))for(const ee in C[z])f&&f.indexOf(ee)>-1&&ee in E&&(C[z][ee]=E[ee](C[z][ee]))}function d(C,f,E){return function(){const Z=new Array(1+arguments.length);Z[0]=f;for(var z=1;z<Z.length;z++)Z[z]=arguments[z-1];return C[E].apply(this,Z)}}function v(C,f,E){const Z=f.send,z=f.ts,ee=f.methodLevel,de=f.methodValue,me=f.val,O=C._logEvent.bindings;h(E,C._serialize||Object.keys(C.serializers),C.serializers,C._stdErrSerialize===void 0?!0:C._stdErrSerialize),C._logEvent.ts=z,C._logEvent.messages=E.filter(function(U){return O.indexOf(U)===-1}),C._logEvent.level.label=ee,C._logEvent.level.value=de,Z(ee,C._logEvent,me),C._logEvent=x(O)}function x(C){return{ts:0,messages:[],bindings:C||[],level:{label:"",value:0}}}function _(C){const f={type:C.constructor.name,msg:C.message,stack:C.stack};for(const E in C)f[E]===void 0&&(f[E]=C[E]);return f}function A(C){return typeof C.timestamp=="function"?C.timestamp:C.timestamp===!1?q:R}function P(){return{}}function L(C){return C}function k(){}function q(){return!1}function R(){return Date.now()}function F(){return Math.round(Date.now()/1e3)}function $(){return new Date(Date.now()).toISOString()}function T(){function C(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 C(self)||C(window)||C(this)||{}}}return nh}var Vi={},xp;function Cp(){return xp||(xp=1,Object.defineProperty(Vi,"__esModule",{value:!0}),Vi.PINO_CUSTOM_CONTEXT_KEY=Vi.PINO_LOGGER_DEFAULTS=void 0,Vi.PINO_LOGGER_DEFAULTS={level:"info"},Vi.PINO_CUSTOM_CONTEXT_KEY="custom_context"),Vi}var Rr={},Ip;function c_(){if(Ip)return Rr;Ip=1,Object.defineProperty(Rr,"__esModule",{value:!0}),Rr.generateChildLogger=Rr.formatChildLoggerContext=Rr.getLoggerContext=Rr.setBrowserLoggerContext=Rr.getBrowserLoggerContext=Rr.getDefaultLoggerOptions=void 0;const t=Cp();function e(l){return Object.assign(Object.assign({},l),{level:l?.level||t.PINO_LOGGER_DEFAULTS.level})}Rr.getDefaultLoggerOptions=e;function r(l,h=t.PINO_CUSTOM_CONTEXT_KEY){return l[h]||""}Rr.getBrowserLoggerContext=r;function n(l,h,d=t.PINO_CUSTOM_CONTEXT_KEY){return l[d]=h,l}Rr.setBrowserLoggerContext=n;function i(l,h=t.PINO_CUSTOM_CONTEXT_KEY){let d="";return typeof l.bindings>"u"?d=r(l,h):d=l.bindings().context||"",d}Rr.getLoggerContext=i;function o(l,h,d=t.PINO_CUSTOM_CONTEXT_KEY){const v=i(l,d);return v.trim()?`${v}/${h}`:h}Rr.formatChildLoggerContext=o;function c(l,h,d=t.PINO_CUSTOM_CONTEXT_KEY){const v=o(l,h,d),x=l.child({context:v});return n(x,v,d)}return Rr.generateChildLogger=c,Rr}(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.pino=void 0;const e=s_,r=e.__importDefault(a_());Object.defineProperty(t,"pino",{enumerable:!0,get:function(){return r.default}}),e.__exportStar(Cp(),t),e.__exportStar(c_(),t)})(pt);class l_ extends Wi{constructor(e){super(),this.opts=e,this.protocol="wc",this.version=2}}class u_ extends Wi{constructor(e,r){super(),this.core=e,this.logger=r,this.records=new Map}}class h_{constructor(e,r){this.logger=e,this.core=r}}class f_ extends Wi{constructor(e,r){super(),this.relayer=e,this.logger=r}}class d_ extends Wi{constructor(e){super()}}class p_{constructor(e,r,n,i){this.core=e,this.logger=r,this.name=n}}class g_ extends Wi{constructor(e,r){super(),this.relayer=e,this.logger=r}}class m_ extends Wi{constructor(e,r){super(),this.core=e,this.logger=r}}class w_{constructor(e,r){this.projectId=e,this.logger=r}}class v_{constructor(e){this.opts=e,this.protocol="wc",this.version=2}}class y_{constructor(e){this.client=e}}const b_=t=>JSON.stringify(t,(e,r)=>typeof r=="bigint"?r.toString()+"n":r),__=t=>{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,r=t.replace(e,'$1"$2n"$3');return JSON.parse(r,(n,i)=>typeof i=="string"&&i.match(/^\d+n$/)?BigInt(i.substring(0,i.length-1)):i)};function ih(t){if(typeof t!="string")throw new Error(`Cannot safe json parse value of type ${typeof t}`);try{return __(t)}catch{return t}}function jo(t){return typeof t=="string"?t:b_(t)||""}var sh={},Ap={};(function(t){Object.defineProperty(t,"__esModule",{value:!0});var e=et,r=Yr;t.DIGEST_LENGTH=64,t.BLOCK_SIZE=128;var n=function(){function l(){this.digestLength=t.DIGEST_LENGTH,this.blockSize=t.BLOCK_SIZE,this._stateHi=new Int32Array(8),this._stateLo=new Int32Array(8),this._tempHi=new Int32Array(16),this._tempLo=new Int32Array(16),this._buffer=new Uint8Array(256),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this.reset()}return l.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},l.prototype.reset=function(){return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this},l.prototype.clean=function(){r.wipe(this._buffer),r.wipe(this._tempHi),r.wipe(this._tempLo),this.reset()},l.prototype.update=function(h,d){if(d===void 0&&(d=h.length),this._finished)throw new Error("SHA512: can't update because hash was finished.");var v=0;if(this._bytesHashed+=d,this._bufferLength>0){for(;this._bufferLength<t.BLOCK_SIZE&&d>0;)this._buffer[this._bufferLength++]=h[v++],d--;this._bufferLength===this.blockSize&&(o(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,this.blockSize),this._bufferLength=0)}for(d>=this.blockSize&&(v=o(this._tempHi,this._tempLo,this._stateHi,this._stateLo,h,v,d),d%=this.blockSize);d>0;)this._buffer[this._bufferLength++]=h[v++],d--;return this},l.prototype.finish=function(h){if(!this._finished){var d=this._bytesHashed,v=this._bufferLength,x=d/536870912|0,_=d<<3,A=d%128<112?128:256;this._buffer[v]=128;for(var P=v+1;P<A-8;P++)this._buffer[P]=0;e.writeUint32BE(x,this._buffer,A-8),e.writeUint32BE(_,this._buffer,A-4),o(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,A),this._finished=!0}for(var P=0;P<this.digestLength/8;P++)e.writeUint32BE(this._stateHi[P],h,P*8),e.writeUint32BE(this._stateLo[P],h,P*8+4);return this},l.prototype.digest=function(){var h=new Uint8Array(this.digestLength);return this.finish(h),h},l.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}},l.prototype.restoreState=function(h){return this._stateHi.set(h.stateHi),this._stateLo.set(h.stateLo),this._bufferLength=h.bufferLength,h.buffer&&this._buffer.set(h.buffer),this._bytesHashed=h.bytesHashed,this._finished=!1,this},l.prototype.cleanSavedState=function(h){r.wipe(h.stateHi),r.wipe(h.stateLo),h.buffer&&r.wipe(h.buffer),h.bufferLength=0,h.bytesHashed=0},l}();t.SHA512=n;var i=new Int32Array([1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591]);function o(l,h,d,v,x,_,A){for(var P=d[0],L=d[1],k=d[2],q=d[3],R=d[4],F=d[5],$=d[6],T=d[7],C=v[0],f=v[1],E=v[2],Z=v[3],z=v[4],ee=v[5],de=v[6],me=v[7],O,U,ce,le,re,ne,ae,ie;A>=128;){for(var Oe=0;Oe<16;Oe++){var ge=8*Oe+_;l[Oe]=e.readUint32BE(x,ge),h[Oe]=e.readUint32BE(x,ge+4)}for(var Oe=0;Oe<80;Oe++){var Be=P,ye=L,Le=k,X=q,J=R,W=F,w=$,j=T,we=C,ve=f,Me=E,nt=Z,at=z,Ge=ee,Dt=de,Pt=me;if(O=T,U=me,re=U&65535,ne=U>>>16,ae=O&65535,ie=O>>>16,O=(R>>>14|z<<32-14)^(R>>>18|z<<32-18)^(z>>>41-32|R<<32-(41-32)),U=(z>>>14|R<<32-14)^(z>>>18|R<<32-18)^(R>>>41-32|z<<32-(41-32)),re+=U&65535,ne+=U>>>16,ae+=O&65535,ie+=O>>>16,O=R&F^~R&$,U=z&ee^~z&de,re+=U&65535,ne+=U>>>16,ae+=O&65535,ie+=O>>>16,O=i[Oe*2],U=i[Oe*2+1],re+=U&65535,ne+=U>>>16,ae+=O&65535,ie+=O>>>16,O=l[Oe%16],U=h[Oe%16],re+=U&65535,ne+=U>>>16,ae+=O&65535,ie+=O>>>16,ne+=re>>>16,ae+=ne>>>16,ie+=ae>>>16,ce=ae&65535|ie<<16,le=re&65535|ne<<16,O=ce,U=le,re=U&65535,ne=U>>>16,ae=O&65535,ie=O>>>16,O=(P>>>28|C<<32-28)^(C>>>34-32|P<<32-(34-32))^(C>>>39-32|P<<32-(39-32)),U=(C>>>28|P<<32-28)^(P>>>34-32|C<<32-(34-32))^(P>>>39-32|C<<32-(39-32)),re+=U&65535,ne+=U>>>16,ae+=O&65535,ie+=O>>>16,O=P&L^P&k^L&k,U=C&f^C&E^f&E,re+=U&65535,ne+=U>>>16,ae+=O&65535,ie+=O>>>16,ne+=re>>>16,ae+=ne>>>16,ie+=ae>>>16,j=ae&65535|ie<<16,Pt=re&65535|ne<<16,O=X,U=nt,re=U&65535,ne=U>>>16,ae=O&65535,ie=O>>>16,O=ce,U=le,re+=U&65535,ne+=U>>>16,ae+=O&65535,ie+=O>>>16,ne+=re>>>16,ae+=ne>>>16,ie+=ae>>>16,X=ae&65535|ie<<16,nt=re&65535|ne<<16,L=Be,k=ye,q=Le,R=X,F=J,$=W,T=w,P=j,f=we,E=ve,Z=Me,z=nt,ee=at,de=Ge,me=Dt,C=Pt,Oe%16===15)for(var ge=0;ge<16;ge++)O=l[ge],U=h[ge],re=U&65535,ne=U>>>16,ae=O&65535,ie=O>>>16,O=l[(ge+9)%16],U=h[(ge+9)%16],re+=U&65535,ne+=U>>>16,ae+=O&65535,ie+=O>>>16,ce=l[(ge+1)%16],le=h[(ge+1)%16],O=(ce>>>1|le<<32-1)^(ce>>>8|le<<32-8)^ce>>>7,U=(le>>>1|ce<<32-1)^(le>>>8|ce<<32-8)^(le>>>7|ce<<32-7),re+=U&65535,ne+=U>>>16,ae+=O&65535,ie+=O>>>16,ce=l[(ge+14)%16],le=h[(ge+14)%16],O=(ce>>>19|le<<32-19)^(le>>>61-32|ce<<32-(61-32))^ce>>>6,U=(le>>>19|ce<<32-19)^(ce>>>61-32|le<<32-(61-32))^(le>>>6|ce<<32-6),re+=U&65535,ne+=U>>>16,ae+=O&65535,ie+=O>>>16,ne+=re>>>16,ae+=ne>>>16,ie+=ae>>>16,l[ge]=ae&65535|ie<<16,h[ge]=re&65535|ne<<16}O=P,U=C,re=U&65535,ne=U>>>16,ae=O&65535,ie=O>>>16,O=d[0],U=v[0],re+=U&65535,ne+=U>>>16,ae+=O&65535,ie+=O>>>16,ne+=re>>>16,ae+=ne>>>16,ie+=ae>>>16,d[0]=P=ae&65535|ie<<16,v[0]=C=re&65535|ne<<16,O=L,U=f,re=U&65535,ne=U>>>16,ae=O&65535,ie=O>>>16,O=d[1],U=v[1],re+=U&65535,ne+=U>>>16,ae+=O&65535,ie+=O>>>16,ne+=re>>>16,ae+=ne>>>16,ie+=ae>>>16,d[1]=L=ae&65535|ie<<16,v[1]=f=re&65535|ne<<16,O=k,U=E,re=U&65535,ne=U>>>16,ae=O&65535,ie=O>>>16,O=d[2],U=v[2],re+=U&65535,ne+=U>>>16,ae+=O&65535,ie+=O>>>16,ne+=re>>>16,ae+=ne>>>16,ie+=ae>>>16,d[2]=k=ae&65535|ie<<16,v[2]=E=re&65535|ne<<16,O=q,U=Z,re=U&65535,ne=U>>>16,ae=O&65535,ie=O>>>16,O=d[3],U=v[3],re+=U&65535,ne+=U>>>16,ae+=O&65535,ie+=O>>>16,ne+=re>>>16,ae+=ne>>>16,ie+=ae>>>16,d[3]=q=ae&65535|ie<<16,v[3]=Z=re&65535|ne<<16,O=R,U=z,re=U&65535,ne=U>>>16,ae=O&65535,ie=O>>>16,O=d[4],U=v[4],re+=U&65535,ne+=U>>>16,ae+=O&65535,ie+=O>>>16,ne+=re>>>16,ae+=ne>>>16,ie+=ae>>>16,d[4]=R=ae&65535|ie<<16,v[4]=z=re&65535|ne<<16,O=F,U=ee,re=U&65535,ne=U>>>16,ae=O&65535,ie=O>>>16,O=d[5],U=v[5],re+=U&65535,ne+=U>>>16,ae+=O&65535,ie+=O>>>16,ne+=re>>>16,ae+=ne>>>16,ie+=ae>>>16,d[5]=F=ae&65535|ie<<16,v[5]=ee=re&65535|ne<<16,O=$,U=de,re=U&65535,ne=U>>>16,ae=O&65535,ie=O>>>16,O=d[6],U=v[6],re+=U&65535,ne+=U>>>16,ae+=O&65535,ie+=O>>>16,ne+=re>>>16,ae+=ne>>>16,ie+=ae>>>16,d[6]=$=ae&65535|ie<<16,v[6]=de=re&65535|ne<<16,O=T,U=me,re=U&65535,ne=U>>>16,ae=O&65535,ie=O>>>16,O=d[7],U=v[7],re+=U&65535,ne+=U>>>16,ae+=O&65535,ie+=O>>>16,ne+=re>>>16,ae+=ne>>>16,ie+=ae>>>16,d[7]=T=ae&65535|ie<<16,v[7]=me=re&65535|ne<<16,_+=128,A-=128}return _}function c(l){var h=new n;h.update(l);var d=h.digest();return h.clean(),d}t.hash=c})(Ap),function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.convertSecretKeyToX25519=t.convertPublicKeyToX25519=t.verify=t.sign=t.extractPublicKeyFromSecretKey=t.generateKeyPair=t.generateKeyPairFromSeed=t.SEED_LENGTH=t.SECRET_KEY_LENGTH=t.PUBLIC_KEY_LENGTH=t.SIGNATURE_LENGTH=void 0;const e=Is,r=Ap,n=Yr;t.SIGNATURE_LENGTH=64,t.PUBLIC_KEY_LENGTH=32,t.SECRET_KEY_LENGTH=64,t.SEED_LENGTH=32;function i(X){const J=new Float64Array(16);if(X)for(let W=0;W<X.length;W++)J[W]=X[W];return J}const o=new Uint8Array(32);o[0]=9;const c=i(),l=i([1]),h=i([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),d=i([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),v=i([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),x=i([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),_=i([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function A(X,J){for(let W=0;W<16;W++)X[W]=J[W]|0}function P(X){let J=1;for(let W=0;W<16;W++){let w=X[W]+J+65535;J=Math.floor(w/65536),X[W]=w-J*65536}X[0]+=J-1+37*(J-1)}function L(X,J,W){const w=~(W-1);for(let j=0;j<16;j++){const we=w&(X[j]^J[j]);X[j]^=we,J[j]^=we}}function k(X,J){const W=i(),w=i();for(let j=0;j<16;j++)w[j]=J[j];P(w),P(w),P(w);for(let j=0;j<2;j++){W[0]=w[0]-65517;for(let ve=1;ve<15;ve++)W[ve]=w[ve]-65535-(W[ve-1]>>16&1),W[ve-1]&=65535;W[15]=w[15]-32767-(W[14]>>16&1);const we=W[15]>>16&1;W[14]&=65535,L(w,W,1-we)}for(let j=0;j<16;j++)X[2*j]=w[j]&255,X[2*j+1]=w[j]>>8}function q(X,J){let W=0;for(let w=0;w<32;w++)W|=X[w]^J[w];return(1&W-1>>>8)-1}function R(X,J){const W=new Uint8Array(32),w=new Uint8Array(32);return k(W,X),k(w,J),q(W,w)}function F(X){const J=new Uint8Array(32);return k(J,X),J[0]&1}function $(X,J){for(let W=0;W<16;W++)X[W]=J[2*W]+(J[2*W+1]<<8);X[15]&=32767}function T(X,J,W){for(let w=0;w<16;w++)X[w]=J[w]+W[w]}function C(X,J,W){for(let w=0;w<16;w++)X[w]=J[w]-W[w]}function f(X,J,W){let w,j,we=0,ve=0,Me=0,nt=0,at=0,Ge=0,Dt=0,Pt=0,Je=0,He=0,ke=0,Ke=0,rt=0,Ue=0,Ze=0,b=0,p=0,m=0,D=0,B=0,G=0,Q=0,Ee=0,Re=0,st=0,ht=0,lt=0,Ur=0,Qn=0,$i=0,us=0,Wt=W[0],Lt=W[1],qt=W[2],Vt=W[3],Bt=W[4],Mt=W[5],sr=W[6],or=W[7],Kt=W[8],ar=W[9],Gt=W[10],Qt=W[11],Zt=W[12],Tt=W[13],cr=W[14],lr=W[15];w=J[0],we+=w*Wt,ve+=w*Lt,Me+=w*qt,nt+=w*Vt,at+=w*Bt,Ge+=w*Mt,Dt+=w*sr,Pt+=w*or,Je+=w*Kt,He+=w*ar,ke+=w*Gt,Ke+=w*Qt,rt+=w*Zt,Ue+=w*Tt,Ze+=w*cr,b+=w*lr,w=J[1],ve+=w*Wt,Me+=w*Lt,nt+=w*qt,at+=w*Vt,Ge+=w*Bt,Dt+=w*Mt,Pt+=w*sr,Je+=w*or,He+=w*Kt,ke+=w*ar,Ke+=w*Gt,rt+=w*Qt,Ue+=w*Zt,Ze+=w*Tt,b+=w*cr,p+=w*lr,w=J[2],Me+=w*Wt,nt+=w*Lt,at+=w*qt,Ge+=w*Vt,Dt+=w*Bt,Pt+=w*Mt,Je+=w*sr,He+=w*or,ke+=w*Kt,Ke+=w*ar,rt+=w*Gt,Ue+=w*Qt,Ze+=w*Zt,b+=w*Tt,p+=w*cr,m+=w*lr,w=J[3],nt+=w*Wt,at+=w*Lt,Ge+=w*qt,Dt+=w*Vt,Pt+=w*Bt,Je+=w*Mt,He+=w*sr,ke+=w*or,Ke+=w*Kt,rt+=w*ar,Ue+=w*Gt,Ze+=w*Qt,b+=w*Zt,p+=w*Tt,m+=w*cr,D+=w*lr,w=J[4],at+=w*Wt,Ge+=w*Lt,Dt+=w*qt,Pt+=w*Vt,Je+=w*Bt,He+=w*Mt,ke+=w*sr,Ke+=w*or,rt+=w*Kt,Ue+=w*ar,Ze+=w*Gt,b+=w*Qt,p+=w*Zt,m+=w*Tt,D+=w*cr,B+=w*lr,w=J[5],Ge+=w*Wt,Dt+=w*Lt,Pt+=w*qt,Je+=w*Vt,He+=w*Bt,ke+=w*Mt,Ke+=w*sr,rt+=w*or,Ue+=w*Kt,Ze+=w*ar,b+=w*Gt,p+=w*Qt,m+=w*Zt,D+=w*Tt,B+=w*cr,G+=w*lr,w=J[6],Dt+=w*Wt,Pt+=w*Lt,Je+=w*qt,He+=w*Vt,ke+=w*Bt,Ke+=w*Mt,rt+=w*sr,Ue+=w*or,Ze+=w*Kt,b+=w*ar,p+=w*Gt,m+=w*Qt,D+=w*Zt,B+=w*Tt,G+=w*cr,Q+=w*lr,w=J[7],Pt+=w*Wt,Je+=w*Lt,He+=w*qt,ke+=w*Vt,Ke+=w*Bt,rt+=w*Mt,Ue+=w*sr,Ze+=w*or,b+=w*Kt,p+=w*ar,m+=w*Gt,D+=w*Qt,B+=w*Zt,G+=w*Tt,Q+=w*cr,Ee+=w*lr,w=J[8],Je+=w*Wt,He+=w*Lt,ke+=w*qt,Ke+=w*Vt,rt+=w*Bt,Ue+=w*Mt,Ze+=w*sr,b+=w*or,p+=w*Kt,m+=w*ar,D+=w*Gt,B+=w*Qt,G+=w*Zt,Q+=w*Tt,Ee+=w*cr,Re+=w*lr,w=J[9],He+=w*Wt,ke+=w*Lt,Ke+=w*qt,rt+=w*Vt,Ue+=w*Bt,Ze+=w*Mt,b+=w*sr,p+=w*or,m+=w*Kt,D+=w*ar,B+=w*Gt,G+=w*Qt,Q+=w*Zt,Ee+=w*Tt,Re+=w*cr,st+=w*lr,w=J[10],ke+=w*Wt,Ke+=w*Lt,rt+=w*qt,Ue+=w*Vt,Ze+=w*Bt,b+=w*Mt,p+=w*sr,m+=w*or,D+=w*Kt,B+=w*ar,G+=w*Gt,Q+=w*Qt,Ee+=w*Zt,Re+=w*Tt,st+=w*cr,ht+=w*lr,w=J[11],Ke+=w*Wt,rt+=w*Lt,Ue+=w*qt,Ze+=w*Vt,b+=w*Bt,p+=w*Mt,m+=w*sr,D+=w*or,B+=w*Kt,G+=w*ar,Q+=w*Gt,Ee+=w*Qt,Re+=w*Zt,st+=w*Tt,ht+=w*cr,lt+=w*lr,w=J[12],rt+=w*Wt,Ue+=w*Lt,Ze+=w*qt,b+=w*Vt,p+=w*Bt,m+=w*Mt,D+=w*sr,B+=w*or,G+=w*Kt,Q+=w*ar,Ee+=w*Gt,Re+=w*Qt,st+=w*Zt,ht+=w*Tt,lt+=w*cr,Ur+=w*lr,w=J[13],Ue+=w*Wt,Ze+=w*Lt,b+=w*qt,p+=w*Vt,m+=w*Bt,D+=w*Mt,B+=w*sr,G+=w*or,Q+=w*Kt,Ee+=w*ar,Re+=w*Gt,st+=w*Qt,ht+=w*Zt,lt+=w*Tt,Ur+=w*cr,Qn+=w*lr,w=J[14],Ze+=w*Wt,b+=w*Lt,p+=w*qt,m+=w*Vt,D+=w*Bt,B+=w*Mt,G+=w*sr,Q+=w*or,Ee+=w*Kt,Re+=w*ar,st+=w*Gt,ht+=w*Qt,lt+=w*Zt,Ur+=w*Tt,Qn+=w*cr,$i+=w*lr,w=J[15],b+=w*Wt,p+=w*Lt,m+=w*qt,D+=w*Vt,B+=w*Bt,G+=w*Mt,Q+=w*sr,Ee+=w*or,Re+=w*Kt,st+=w*ar,ht+=w*Gt,lt+=w*Qt,Ur+=w*Zt,Qn+=w*Tt,$i+=w*cr,us+=w*lr,we+=38*p,ve+=38*m,Me+=38*D,nt+=38*B,at+=38*G,Ge+=38*Q,Dt+=38*Ee,Pt+=38*Re,Je+=38*st,He+=38*ht,ke+=38*lt,Ke+=38*Ur,rt+=38*Qn,Ue+=38*$i,Ze+=38*us,j=1,w=we+j+65535,j=Math.floor(w/65536),we=w-j*65536,w=ve+j+65535,j=Math.floor(w/65536),ve=w-j*65536,w=Me+j+65535,j=Math.floor(w/65536),Me=w-j*65536,w=nt+j+65535,j=Math.floor(w/65536),nt=w-j*65536,w=at+j+65535,j=Math.floor(w/65536),at=w-j*65536,w=Ge+j+65535,j=Math.floor(w/65536),Ge=w-j*65536,w=Dt+j+65535,j=Math.floor(w/65536),Dt=w-j*65536,w=Pt+j+65535,j=Math.floor(w/65536),Pt=w-j*65536,w=Je+j+65535,j=Math.floor(w/65536),Je=w-j*65536,w=He+j+65535,j=Math.floor(w/65536),He=w-j*65536,w=ke+j+65535,j=Math.floor(w/65536),ke=w-j*65536,w=Ke+j+65535,j=Math.floor(w/65536),Ke=w-j*65536,w=rt+j+65535,j=Math.floor(w/65536),rt=w-j*65536,w=Ue+j+65535,j=Math.floor(w/65536),Ue=w-j*65536,w=Ze+j+65535,j=Math.floor(w/65536),Ze=w-j*65536,w=b+j+65535,j=Math.floor(w/65536),b=w-j*65536,we+=j-1+37*(j-1),j=1,w=we+j+65535,j=Math.floor(w/65536),we=w-j*65536,w=ve+j+65535,j=Math.floor(w/65536),ve=w-j*65536,w=Me+j+65535,j=Math.floor(w/65536),Me=w-j*65536,w=nt+j+65535,j=Math.floor(w/65536),nt=w-j*65536,w=at+j+65535,j=Math.floor(w/65536),at=w-j*65536,w=Ge+j+65535,j=Math.floor(w/65536),Ge=w-j*65536,w=Dt+j+65535,j=Math.floor(w/65536),Dt=w-j*65536,w=Pt+j+65535,j=Math.floor(w/65536),Pt=w-j*65536,w=Je+j+65535,j=Math.floor(w/65536),Je=w-j*65536,w=He+j+65535,j=Math.floor(w/65536),He=w-j*65536,w=ke+j+65535,j=Math.floor(w/65536),ke=w-j*65536,w=Ke+j+65535,j=Math.floor(w/65536),Ke=w-j*65536,w=rt+j+65535,j=Math.floor(w/65536),rt=w-j*65536,w=Ue+j+65535,j=Math.floor(w/65536),Ue=w-j*65536,w=Ze+j+65535,j=Math.floor(w/65536),Ze=w-j*65536,w=b+j+65535,j=Math.floor(w/65536),b=w-j*65536,we+=j-1+37*(j-1),X[0]=we,X[1]=ve,X[2]=Me,X[3]=nt,X[4]=at,X[5]=Ge,X[6]=Dt,X[7]=Pt,X[8]=Je,X[9]=He,X[10]=ke,X[11]=Ke,X[12]=rt,X[13]=Ue,X[14]=Ze,X[15]=b}function E(X,J){f(X,J,J)}function Z(X,J){const W=i();let w;for(w=0;w<16;w++)W[w]=J[w];for(w=253;w>=0;w--)E(W,W),w!==2&&w!==4&&f(W,W,J);for(w=0;w<16;w++)X[w]=W[w]}function z(X,J){const W=i();let w;for(w=0;w<16;w++)W[w]=J[w];for(w=250;w>=0;w--)E(W,W),w!==1&&f(W,W,J);for(w=0;w<16;w++)X[w]=W[w]}function ee(X,J){const W=i(),w=i(),j=i(),we=i(),ve=i(),Me=i(),nt=i(),at=i(),Ge=i();C(W,X[1],X[0]),C(Ge,J[1],J[0]),f(W,W,Ge),T(w,X[0],X[1]),T(Ge,J[0],J[1]),f(w,w,Ge),f(j,X[3],J[3]),f(j,j,d),f(we,X[2],J[2]),T(we,we,we),C(ve,w,W),C(Me,we,j),T(nt,we,j),T(at,w,W),f(X[0],ve,Me),f(X[1],at,nt),f(X[2],nt,Me),f(X[3],ve,at)}function de(X,J,W){for(let w=0;w<4;w++)L(X[w],J[w],W)}function me(X,J){const W=i(),w=i(),j=i();Z(j,J[2]),f(W,J[0],j),f(w,J[1],j),k(X,w),X[31]^=F(W)<<7}function O(X,J,W){A(X[0],c),A(X[1],l),A(X[2],l),A(X[3],c);for(let w=255;w>=0;--w){const j=W[w/8|0]>>(w&7)&1;de(X,J,j),ee(J,X),ee(X,X),de(X,J,j)}}function U(X,J){const W=[i(),i(),i(),i()];A(W[0],v),A(W[1],x),A(W[2],l),f(W[3],v,x),O(X,W,J)}function ce(X){if(X.length!==t.SEED_LENGTH)throw new Error(`ed25519: seed must be ${t.SEED_LENGTH} bytes`);const J=(0,r.hash)(X);J[0]&=248,J[31]&=127,J[31]|=64;const W=new Uint8Array(32),w=[i(),i(),i(),i()];U(w,J),me(W,w);const j=new Uint8Array(64);return j.set(X),j.set(W,32),{publicKey:W,secretKey:j}}t.generateKeyPairFromSeed=ce;function le(X){const J=(0,e.randomBytes)(32,X),W=ce(J);return(0,n.wipe)(J),W}t.generateKeyPair=le;function re(X){if(X.length!==t.SECRET_KEY_LENGTH)throw new Error(`ed25519: secret key must be ${t.SECRET_KEY_LENGTH} bytes`);return new Uint8Array(X.subarray(32))}t.extractPublicKeyFromSecretKey=re;const ne=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 ae(X,J){let W,w,j,we;for(w=63;w>=32;--w){for(W=0,j=w-32,we=w-12;j<we;++j)J[j]+=W-16*J[w]*ne[j-(w-32)],W=Math.floor((J[j]+128)/256),J[j]-=W*256;J[j]+=W,J[w]=0}for(W=0,j=0;j<32;j++)J[j]+=W-(J[31]>>4)*ne[j],W=J[j]>>8,J[j]&=255;for(j=0;j<32;j++)J[j]-=W*ne[j];for(w=0;w<32;w++)J[w+1]+=J[w]>>8,X[w]=J[w]&255}function ie(X){const J=new Float64Array(64);for(let W=0;W<64;W++)J[W]=X[W];for(let W=0;W<64;W++)X[W]=0;ae(X,J)}function Oe(X,J){const W=new Float64Array(64),w=[i(),i(),i(),i()],j=(0,r.hash)(X.subarray(0,32));j[0]&=248,j[31]&=127,j[31]|=64;const we=new Uint8Array(64);we.set(j.subarray(32),32);const ve=new r.SHA512;ve.update(we.subarray(32)),ve.update(J);const Me=ve.digest();ve.clean(),ie(Me),U(w,Me),me(we,w),ve.reset(),ve.update(we.subarray(0,32)),ve.update(X.subarray(32)),ve.update(J);const nt=ve.digest();ie(nt);for(let at=0;at<32;at++)W[at]=Me[at];for(let at=0;at<32;at++)for(let Ge=0;Ge<32;Ge++)W[at+Ge]+=nt[at]*j[Ge];return ae(we.subarray(32),W),we}t.sign=Oe;function ge(X,J){const W=i(),w=i(),j=i(),we=i(),ve=i(),Me=i(),nt=i();return A(X[2],l),$(X[1],J),E(j,X[1]),f(we,j,h),C(j,j,X[2]),T(we,X[2],we),E(ve,we),E(Me,ve),f(nt,Me,ve),f(W,nt,j),f(W,W,we),z(W,W),f(W,W,j),f(W,W,we),f(W,W,we),f(X[0],W,we),E(w,X[0]),f(w,w,we),R(w,j)&&f(X[0],X[0],_),E(w,X[0]),f(w,w,we),R(w,j)?-1:(F(X[0])===J[31]>>7&&C(X[0],c,X[0]),f(X[3],X[0],X[1]),0)}function Be(X,J,W){const w=new Uint8Array(32),j=[i(),i(),i(),i()],we=[i(),i(),i(),i()];if(W.length!==t.SIGNATURE_LENGTH)throw new Error(`ed25519: signature must be ${t.SIGNATURE_LENGTH} bytes`);if(ge(we,X))return!1;const ve=new r.SHA512;ve.update(W.subarray(0,32)),ve.update(X),ve.update(J);const Me=ve.digest();return ie(Me),O(j,we,Me),U(we,W.subarray(32)),ee(j,we),me(w,j),!q(W,w)}t.verify=Be;function ye(X){let J=[i(),i(),i(),i()];if(ge(J,X))throw new Error("Ed25519: invalid public key");let W=i(),w=i(),j=J[1];T(W,l,j),C(w,l,j),Z(w,w),f(W,W,w);let we=new Uint8Array(32);return k(we,W),we}t.convertPublicKeyToX25519=ye;function Le(X){const J=(0,r.hash)(X.subarray(0,32));J[0]&=248,J[31]&=127,J[31]|=64;const W=new Uint8Array(J.subarray(0,32));return(0,n.wipe)(J),W}t.convertSecretKeyToX25519=Le}(sh);const E_="EdDSA",x_="JWT",$p=".",Op="base64url",C_="utf8",I_="utf8",A_=":",$_="did",O_="key",Sp="base58btc",S_="z",D_="K36",P_=32;function oh(t){return globalThis.Buffer!=null?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):t}function Dp(t=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?oh(globalThis.Buffer.allocUnsafe(t)):new Uint8Array(t)}function T_(t,e){e||(e=t.reduce((i,o)=>i+o.length,0));const r=Dp(e);let n=0;for(const i of t)r.set(i,n),n+=i.length;return oh(r)}function R_(t,e){if(t.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),n=0;n<r.length;n++)r[n]=255;for(var i=0;i<t.length;i++){var o=t.charAt(i),c=o.charCodeAt(0);if(r[c]!==255)throw new TypeError(o+" is ambiguous");r[c]=i}var l=t.length,h=t.charAt(0),d=Math.log(l)/Math.log(256),v=Math.log(256)/Math.log(l);function x(P){if(P instanceof Uint8Array||(ArrayBuffer.isView(P)?P=new Uint8Array(P.buffer,P.byteOffset,P.byteLength):Array.isArray(P)&&(P=Uint8Array.from(P))),!(P instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(P.length===0)return"";for(var L=0,k=0,q=0,R=P.length;q!==R&&P[q]===0;)q++,L++;for(var F=(R-q)*v+1>>>0,$=new Uint8Array(F);q!==R;){for(var T=P[q],C=0,f=F-1;(T!==0||C<k)&&f!==-1;f--,C++)T+=256*$[f]>>>0,$[f]=T%l>>>0,T=T/l>>>0;if(T!==0)throw new Error("Non-zero carry");k=C,q++}for(var E=F-k;E!==F&&$[E]===0;)E++;for(var Z=h.repeat(L);E<F;++E)Z+=t.charAt($[E]);return Z}function _(P){if(typeof P!="string")throw new TypeError("Expected String");if(P.length===0)return new Uint8Array;var L=0;if(P[L]!==" "){for(var k=0,q=0;P[L]===h;)k++,L++;for(var R=(P.length-L)*d+1>>>0,F=new Uint8Array(R);P[L];){var $=r[P.charCodeAt(L)];if($===255)return;for(var T=0,C=R-1;($!==0||T<q)&&C!==-1;C--,T++)$+=l*F[C]>>>0,F[C]=$%256>>>0,$=$/256>>>0;if($!==0)throw new Error("Non-zero carry");q=T,L++}if(P[L]!==" "){for(var f=R-q;f!==R&&F[f]===0;)f++;for(var E=new Uint8Array(k+(R-f)),Z=k;f!==R;)E[Z++]=F[f++];return E}}}function A(P){var L=_(P);if(L)return L;throw new Error(`Non-${e} character`)}return{encode:x,decodeUnsafe:_,decode:A}}var N_=R_,F_=N_;const Pp=t=>{if(t instanceof Uint8Array&&t.constructor.name==="Uint8Array")return t;if(t instanceof ArrayBuffer)return new Uint8Array(t);if(ArrayBuffer.isView(t))return new Uint8Array(t.buffer,t.byteOffset,t.byteLength);throw new Error("Unknown type, must be binary type")},L_=t=>new TextEncoder().encode(t),M_=t=>new TextDecoder().decode(t);class U_{constructor(e,r,n){this.name=e,this.prefix=r,this.baseEncode=n}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}}class j_{constructor(e,r,n){if(this.name=e,this.prefix=r,r.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=r.codePointAt(0),this.baseDecode=n}decode(e){if(typeof e=="string"){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(e){return Tp(this,e)}}class B_{constructor(e){this.decoders=e}or(e){return Tp(this,e)}decode(e){const r=e[0],n=this.decoders[r];if(n)return n.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const Tp=(t,e)=>new B_({...t.decoders||{[t.prefix]:t},...e.decoders||{[e.prefix]:e}});class k_{constructor(e,r,n,i){this.name=e,this.prefix=r,this.baseEncode=n,this.baseDecode=i,this.encoder=new U_(e,r,n),this.decoder=new j_(e,r,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}const cc=({name:t,prefix:e,encode:r,decode:n})=>new k_(t,e,r,n),Bo=({prefix:t,name:e,alphabet:r})=>{const{encode:n,decode:i}=F_(r,e);return cc({prefix:t,name:e,encode:n,decode:o=>Pp(i(o))})},H_=(t,e,r,n)=>{const i={};for(let v=0;v<e.length;++v)i[e[v]]=v;let o=t.length;for(;t[o-1]==="=";)--o;const c=new Uint8Array(o*r/8|0);let l=0,h=0,d=0;for(let v=0;v<o;++v){const x=i[t[v]];if(x===void 0)throw new SyntaxError(`Non-${n} character`);h=h<<r|x,l+=r,l>=8&&(l-=8,c[d++]=255&h>>l)}if(l>=r||255&h<<8-l)throw new SyntaxError("Unexpected end of data");return c},z_=(t,e,r)=>{const n=e[e.length-1]==="=",i=(1<<r)-1;let o="",c=0,l=0;for(let h=0;h<t.length;++h)for(l=l<<8|t[h],c+=8;c>r;)c-=r,o+=e[i&l>>c];if(c&&(o+=e[i&l<<r-c]),n)for(;o.length*r&7;)o+="=";return o},xr=({name:t,prefix:e,bitsPerChar:r,alphabet:n})=>cc({prefix:e,name:t,encode(i){return z_(i,n,r)},decode(i){return H_(i,n,r,t)}}),W_=cc({prefix:"\0",name:"identity",encode:t=>M_(t),decode:t=>L_(t)});var q_=Object.freeze({__proto__:null,identity:W_});const V_=xr({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var K_=Object.freeze({__proto__:null,base2:V_});const G_=xr({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var Z_=Object.freeze({__proto__:null,base8:G_});const Y_=Bo({prefix:"9",name:"base10",alphabet:"0123456789"});var J_=Object.freeze({__proto__:null,base10:Y_});const X_=xr({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),Q_=xr({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var e8=Object.freeze({__proto__:null,base16:X_,base16upper:Q_});const t8=xr({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),r8=xr({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),n8=xr({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),i8=xr({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),s8=xr({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),o8=xr({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),a8=xr({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),c8=xr({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),l8=xr({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var u8=Object.freeze({__proto__:null,base32:t8,base32upper:r8,base32pad:n8,base32padupper:i8,base32hex:s8,base32hexupper:o8,base32hexpad:a8,base32hexpadupper:c8,base32z:l8});const h8=Bo({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),f8=Bo({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var d8=Object.freeze({__proto__:null,base36:h8,base36upper:f8});const p8=Bo({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),g8=Bo({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var m8=Object.freeze({__proto__:null,base58btc:p8,base58flickr:g8});const w8=xr({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),v8=xr({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),y8=xr({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),b8=xr({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var _8=Object.freeze({__proto__:null,base64:w8,base64pad:v8,base64url:y8,base64urlpad:b8});const Rp=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}"),E8=Rp.reduce((t,e,r)=>(t[r]=e,t),[]),x8=Rp.reduce((t,e,r)=>(t[e.codePointAt(0)]=r,t),[]);function C8(t){return t.reduce((e,r)=>(e+=E8[r],e),"")}function I8(t){const e=[];for(const r of t){const n=x8[r.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${r}`);e.push(n)}return new Uint8Array(e)}const A8=cc({prefix:"\u{1F680}",name:"base256emoji",encode:C8,decode:I8});var $8=Object.freeze({__proto__:null,base256emoji:A8}),O8=Fp,Np=128,S8=127,D8=~S8,P8=Math.pow(2,31);function Fp(t,e,r){e=e||[],r=r||0;for(var n=r;t>=P8;)e[r++]=t&255|Np,t/=128;for(;t&D8;)e[r++]=t&255|Np,t>>>=7;return e[r]=t|0,Fp.bytes=r-n+1,e}var T8=ah,R8=128,Lp=127;function ah(t,n){var r=0,n=n||0,i=0,o=n,c,l=t.length;do{if(o>=l)throw ah.bytes=0,new RangeError("Could not decode varint");c=t[o++],r+=i<28?(c&Lp)<<i:(c&Lp)*Math.pow(2,i),i+=7}while(c>=R8);return ah.bytes=o-n,r}var N8=Math.pow(2,7),F8=Math.pow(2,14),L8=Math.pow(2,21),M8=Math.pow(2,28),U8=Math.pow(2,35),j8=Math.pow(2,42),B8=Math.pow(2,49),k8=Math.pow(2,56),H8=Math.pow(2,63),z8=function(t){return t<N8?1:t<F8?2:t<L8?3:t<M8?4:t<U8?5:t<j8?6:t<B8?7:t<k8?8:t<H8?9:10},W8={encode:O8,decode:T8,encodingLength:z8},Mp=W8;const Up=(t,e,r=0)=>(Mp.encode(t,e,r),e),jp=t=>Mp.encodingLength(t),ch=(t,e)=>{const r=e.byteLength,n=jp(t),i=n+jp(r),o=new Uint8Array(i+r);return Up(t,o,0),Up(r,o,n),o.set(e,i),new q8(t,r,e,o)};class q8{constructor(e,r,n,i){this.code=e,this.size=r,this.digest=n,this.bytes=i}}const Bp=({name:t,code:e,encode:r})=>new V8(t,e,r);class V8{constructor(e,r,n){this.name=e,this.code=r,this.encode=n}digest(e){if(e instanceof Uint8Array){const r=this.encode(e);return r instanceof Uint8Array?ch(this.code,r):r.then(n=>ch(this.code,n))}else throw Error("Unknown type, must be binary type")}}const kp=t=>async e=>new Uint8Array(await crypto.subtle.digest(t,e)),K8=Bp({name:"sha2-256",code:18,encode:kp("SHA-256")}),G8=Bp({name:"sha2-512",code:19,encode:kp("SHA-512")});var Z8=Object.freeze({__proto__:null,sha256:K8,sha512:G8});const Hp=0,Y8="identity",zp=Pp;var J8=Object.freeze({__proto__:null,identity:{code:Hp,name:Y8,encode:zp,digest:t=>ch(Hp,zp(t))}});new TextEncoder,new TextDecoder;const Wp={...q_,...K_,...Z_,...J_,...e8,...u8,...d8,...m8,..._8,...$8};({...Z8,...J8});function qp(t,e,r,n){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:r},decoder:{decode:n}}}const Vp=qp("utf8","u",t=>"u"+new TextDecoder("utf8").decode(t),t=>new TextEncoder().encode(t.substring(1))),lh=qp("ascii","a",t=>{let e="a";for(let r=0;r<t.length;r++)e+=String.fromCharCode(t[r]);return e},t=>{t=t.substring(1);const e=Dp(t.length);for(let r=0;r<t.length;r++)e[r]=t.charCodeAt(r);return e}),Kp={utf8:Vp,"utf-8":Vp,hex:Wp.base16,latin1:lh,ascii:lh,binary:lh,...Wp};function uh(t,e="utf8"){const r=Kp[e];if(!r)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(t.buffer,t.byteOffset,t.byteLength).toString("utf8"):r.encoder.encode(t).substring(1)}function hh(t,e="utf8"){const r=Kp[e];if(!r)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?oh(globalThis.Buffer.from(t,"utf-8")):r.decoder.decode(`${r.prefix}${t}`)}function lc(t){return uh(hh(jo(t),C_),Op)}function Gp(t){const e=hh(D_,Sp),r=S_+uh(T_([e,t]),Sp);return[$_,O_,r].join(A_)}function X8(t){return uh(t,Op)}function Q8(t){return hh([lc(t.header),lc(t.payload)].join($p),I_)}function eE(t){return[lc(t.header),lc(t.payload),X8(t.signature)].join($p)}function Zp(t=Is.randomBytes(P_)){return sh.generateKeyPairFromSeed(t)}async function tE(t,e,r,n,i=Se.fromMiliseconds(Date.now())){const o={alg:E_,typ:x_},c=Gp(n.publicKey),l=i+r,h={iss:c,sub:t,aud:e,iat:i,exp:l},d=Q8({header:o,payload:h}),v=sh.sign(n.secretKey,d);return eE({header:o,payload:h,signature:v})}const rE="PARSE_ERROR",nE="INVALID_REQUEST",iE="METHOD_NOT_FOUND",sE="INVALID_PARAMS",Yp="INTERNAL_ERROR",fh="SERVER_ERROR",oE=[-32700,-32600,-32601,-32602,-32603],ko={[rE]:{code:-32700,message:"Parse error"},[nE]:{code:-32600,message:"Invalid Request"},[iE]:{code:-32601,message:"Method not found"},[sE]:{code:-32602,message:"Invalid params"},[Yp]:{code:-32603,message:"Internal error"},[fh]:{code:-32e3,message:"Server error"}},Jp=fh;function aE(t){return oE.includes(t)}function Xp(t){return Object.keys(ko).includes(t)?ko[t]:ko[Jp]}function cE(t){const e=Object.values(ko).find(r=>r.code===t);return e||ko[Jp]}function Qp(t,e,r){return t.message.includes("getaddrinfo ENOTFOUND")||t.message.includes("connect ECONNREFUSED")?new Error(`Unavailable ${r} RPC url at ${e}`):t}var eg={};/*! *****************************************************************************
60
60
  Copyright (c) Microsoft Corporation.
61
61
 
62
62
  Permission to use, copy, modify, and/or distribute this software for any
@@ -69,85 +69,85 @@
69
69
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
70
70
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
71
71
  PERFORMANCE OF THIS SOFTWARE.
72
- ***************************************************************************** */var Qu=function(t,e){return Qu=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)n.hasOwnProperty(i)&&(r[i]=n[i])},Qu(t,e)};function Q4(t,e){Qu(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var eh=function(){return eh=Object.assign||function(e){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e},eh.apply(this,arguments)};function e_(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r}function t_(t,e,r,n){var i=arguments.length,o=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(o=(i<3?c(o):i>3?c(e,r,o):c(e,r))||o);return i>3&&o&&Object.defineProperty(e,r,o),o}function r_(t,e){return function(r,n){e(r,n,t)}}function n_(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function i_(t,e,r,n){function i(o){return o instanceof r?o:new r(function(c){c(o)})}return new(r||(r=Promise))(function(o,c){function l(v){try{f(n.next(v))}catch(E){c(E)}}function h(v){try{f(n.throw(v))}catch(E){c(E)}}function f(v){v.done?o(v.value):i(v.value).then(l,h)}f((n=n.apply(t,e||[])).next())})}function s_(t,e){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,c;return c={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function l(f){return function(v){return h([f,v])}}function h(f){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(o=f[0]&2?i.return:f[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,f[1])).done)return o;switch(i=0,o&&(f=[f[0]&2,o.value]),f[0]){case 0:case 1:o=f;break;case 4:return r.label++,{value:f[1],done:!1};case 5:r.label++,i=f[1],f=[0];continue;case 7:f=r.ops.pop(),r.trys.pop();continue;default:if(o=r.trys,!(o=o.length>0&&o[o.length-1])&&(f[0]===6||f[0]===2)){r=0;continue}if(f[0]===3&&(!o||f[1]>o[0]&&f[1]<o[3])){r.label=f[1];break}if(f[0]===6&&r.label<o[1]){r.label=o[1],o=f;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(f);break}o[2]&&r.ops.pop(),r.trys.pop();continue}f=e.call(t,r)}catch(v){f=[6,v],i=0}finally{n=o=0}if(f[0]&5)throw f[1];return{value:f[0]?f[1]:void 0,done:!0}}}function o_(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}function a_(t,e){for(var r in t)r!=="default"&&!e.hasOwnProperty(r)&&(e[r]=t[r])}function th(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function Ep(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,o=[],c;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(l){c={error:l}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(c)throw c.error}}return o}function c_(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(Ep(arguments[e]));return t}function l_(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;for(var n=Array(t),i=0,e=0;e<r;e++)for(var o=arguments[e],c=0,l=o.length;c<l;c++,i++)n[i]=o[c];return n}function jo(t){return this instanceof jo?(this.v=t,this):new jo(t)}function u_(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(t,e||[]),i,o=[];return i={},c("next"),c("throw"),c("return"),i[Symbol.asyncIterator]=function(){return this},i;function c(_){n[_]&&(i[_]=function(S){return new Promise(function(P,j){o.push([_,S,P,j])>1||l(_,S)})})}function l(_,S){try{h(n[_](S))}catch(P){E(o[0][3],P)}}function h(_){_.value instanceof jo?Promise.resolve(_.value.v).then(f,v):E(o[0][2],_)}function f(_){l("next",_)}function v(_){l("throw",_)}function E(_,S){_(S),o.shift(),o.length&&l(o[0][0],o[0][1])}}function h_(t){var e,r;return e={},n("next"),n("throw",function(i){throw i}),n("return"),e[Symbol.iterator]=function(){return this},e;function n(i,o){e[i]=t[i]?function(c){return(r=!r)?{value:jo(t[i](c)),done:i==="return"}:o?o(c):c}:o}}function f_(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof th=="function"?th(t):t[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(o){r[o]=t[o]&&function(c){return new Promise(function(l,h){c=t[o](c),i(l,h,c.done,c.value)})}}function i(o,c,l,h){Promise.resolve(h).then(function(f){o({value:f,done:l})},c)}}function d_(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function p_(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}function g_(t){return t&&t.__esModule?t:{default:t}}function m_(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}function w_(t,e,r){if(!e.has(t))throw new TypeError("attempted to set private field on non-instance");return e.set(t,r),r}var v_=Object.freeze({__proto__:null,__extends:Q4,get __assign(){return eh},__rest:e_,__decorate:t_,__param:r_,__metadata:n_,__awaiter:i_,__generator:s_,__createBinding:o_,__exportStar:a_,__values:th,__read:Ep,__spread:c_,__spreadArrays:l_,__await:jo,__asyncGenerator:u_,__asyncDelegator:h_,__asyncValues:f_,__makeTemplateObject:d_,__importStar:p_,__importDefault:g_,__classPrivateFieldGet:m_,__classPrivateFieldSet:w_}),y_=Ui(v_),Wn={},xp;function b_(){if(xp)return Wn;xp=1,Object.defineProperty(Wn,"__esModule",{value:!0}),Wn.isBrowserCryptoAvailable=Wn.getSubtleCrypto=Wn.getBrowerCrypto=void 0;function t(){return pr?.crypto||pr?.msCrypto||{}}Wn.getBrowerCrypto=t;function e(){const n=t();return n.subtle||n.webkitSubtle}Wn.getSubtleCrypto=e;function r(){return!!t()&&!!e()}return Wn.isBrowserCryptoAvailable=r,Wn}var qn={},Cp;function __(){if(Cp)return qn;Cp=1,Object.defineProperty(qn,"__esModule",{value:!0}),qn.isBrowser=qn.isNode=qn.isReactNative=void 0;function t(){return typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"}qn.isReactNative=t;function e(){return typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.node<"u"}qn.isNode=e;function r(){return!t()&&!e()}return qn.isBrowser=r,qn}(function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=y_;e.__exportStar(b_(),t),e.__exportStar(__(),t)})(_p);function Ip(t=3){const e=Date.now()*Math.pow(10,t),r=Math.floor(Math.random()*Math.pow(10,t));return e+r}function rh(t=6){return BigInt(Ip(t))}function rc(t,e,r){return{id:r||Ip(),jsonrpc:"2.0",method:t,params:e}}function nh(t,e){return{id:t,jsonrpc:"2.0",result:e}}function nc(t,e,r){return{id:t,jsonrpc:"2.0",error:E_(e,r)}}function E_(t,e){return typeof t>"u"?yp(wp):(typeof t=="string"&&(t=Object.assign(Object.assign({},yp(Xu)),{message:t})),typeof e<"u"&&(t.data=e),J4(t.code)&&(t=X4(t.code)),t)}class x_{}class C_ extends x_{constructor(){super()}}class I_ extends C_{constructor(e){super()}}const S_="^https?:",A_="^wss?:";function O_(t){const e=t.match(new RegExp(/^\w+:/,"gi"));if(!(!e||!e.length))return e[0]}function Sp(t,e){const r=O_(t);return typeof r>"u"?!1:new RegExp(e).test(r)}function Ap(t){return Sp(t,S_)}function Op(t){return Sp(t,A_)}function D_(t){return new RegExp("wss?://localhost(:d{2,5})?").test(t)}function Dp(t){return typeof t=="object"&&"id"in t&&"jsonrpc"in t&&t.jsonrpc==="2.0"}function ih(t){return Dp(t)&&"method"in t}function ic(t){return Dp(t)&&(Vn(t)||xn(t))}function Vn(t){return"result"in t}function xn(t){return"error"in t}class fi extends I_{constructor(e){super(e),this.events=new br.exports.EventEmitter,this.hasRegisteredEventListeners=!1,this.connection=this.setConnection(e),this.connection.connected&&this.registerEventListeners()}async connect(e=this.connection){await this.open(e)}async disconnect(){await this.close()}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}off(e,r){this.events.off(e,r)}removeListener(e,r){this.events.removeListener(e,r)}async request(e,r){return this.requestStrict(rc(e.method,e.params||[],e.id||rh().toString()),r)}async requestStrict(e,r){return new Promise(async(n,i)=>{if(!this.connection.connected)try{await this.open()}catch(o){i(o)}this.events.on(`${e.id}`,o=>{xn(o)?i(o.error):n(o.result)});try{await this.connection.send(e,r)}catch(o){i(o)}})}setConnection(e=this.connection){return e}onPayload(e){this.events.emit("payload",e),ic(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 $_=()=>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"),$p=()=>typeof WebSocket<"u"||typeof global<"u"&&typeof global.WebSocket<"u"||typeof window<"u"&&typeof window.WebSocket<"u"||typeof self<"u"&&typeof self.WebSocket<"u",Pp=t=>t.split("?")[0],Tp=10,P_=$_();class T_{constructor(e){if(this.url=e,this.events=new br.exports.EventEmitter,this.registering=!1,!Op(e))throw new Error(`Provided URL is not compatible with WebSocket connection: ${e}`);this.url=e}get connected(){return typeof this.socket<"u"}get connecting(){return this.registering}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}off(e,r){this.events.off(e,r)}removeListener(e,r){this.events.removeListener(e,r)}async open(e=this.url){await this.register(e)}async close(){return new Promise((e,r)=>{if(typeof this.socket>"u"){r(new Error("Connection already closed"));return}this.socket.onclose=n=>{this.onClose(n),e()},this.socket.close()})}async send(e,r){typeof this.socket>"u"&&(this.socket=await this.register());try{this.socket.send(Mo(e))}catch(n){this.onError(e.id,n)}}register(e=this.url){if(!Op(e))throw new Error(`Provided URL is not compatible with WebSocket connection: ${e}`);if(this.registering){const r=this.events.getMaxListeners();return(this.events.listenerCount("register_error")>=r||this.events.listenerCount("open")>=r)&&this.events.setMaxListeners(r+1),new Promise((n,i)=>{this.events.once("register_error",o=>{this.resetMaxListeners(),i(o)}),this.events.once("open",()=>{if(this.resetMaxListeners(),typeof this.socket>"u")return i(new Error("WebSocket connection is missing or invalid"));n(this.socket)})})}return this.url=e,this.registering=!0,new Promise((r,n)=>{const i=_p.isReactNative()?void 0:{rejectUnauthorized:!D_(e)},o=new P_(e,[],i);console.log("hasBuiltInWebSocket:",$p()),$p()?o.onerror=c=>{const l=c;n(this.emitError(l.error))}:o.on("error",c=>{n(this.emitError(c))}),o.onopen=()=>{this.onOpen(o),r(o)}})}onOpen(e){e.onmessage=r=>this.onPayload(r),e.onclose=r=>this.onClose(r),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 r=typeof e.data=="string"?Yu(e.data):e.data;this.events.emit("payload",r)}onError(e,r){const n=this.parseError(r),i=n.message||n.toString(),o=nc(e,i);this.events.emit("payload",o)}parseError(e,r=this.url){return bp(e,Pp(r),"WS")}resetMaxListeners(){this.events.getMaxListeners()>Tp&&this.events.setMaxListeners(Tp)}emitError(e){const r=this.parseError(new Error(e?.message||`WebSocket connection failed for host: ${Pp(this.url)}`));return this.events.emit("register_error",r),r}}var sh={exports:{}};(function(t,e){var r=200,n="__lodash_hash_undefined__",i=1,o=2,c=9007199254740991,l="[object Arguments]",h="[object Array]",f="[object AsyncFunction]",v="[object Boolean]",E="[object Date]",_="[object Error]",S="[object Function]",P="[object GeneratorFunction]",j="[object Map]",H="[object Number]",Z="[object Null]",R="[object Object]",L="[object Promise]",$="[object Proxy]",T="[object RegExp]",I="[object Set]",d="[object String]",x="[object Symbol]",J="[object Undefined]",z="[object WeakMap]",ee="[object ArrayBuffer]",de="[object DataView]",me="[object Float32Array]",A="[object Float64Array]",U="[object Int8Array]",ce="[object Int16Array]",le="[object Int32Array]",re="[object Uint8Array]",ne="[object Uint8ClampedArray]",ae="[object Uint16Array]",ie="[object Uint32Array]",Oe=/[\\^$.*+?()[\]{}|]/g,ge=/^\[object .+?Constructor\]$/,Be=/^(?:0|[1-9]\d*)$/,ye={};ye[me]=ye[A]=ye[U]=ye[ce]=ye[le]=ye[re]=ye[ne]=ye[ae]=ye[ie]=!0,ye[l]=ye[h]=ye[ee]=ye[v]=ye[de]=ye[E]=ye[_]=ye[S]=ye[j]=ye[H]=ye[R]=ye[T]=ye[I]=ye[d]=ye[z]=!1;var Me=typeof pr=="object"&&pr&&pr.Object===Object&&pr,X=typeof self=="object"&&self&&self.Object===Object&&self,Y=Me||X||Function("return this")(),W=e&&!e.nodeType&&e,w=W&&!0&&t&&!t.nodeType&&t,F=w&&w.exports===W,we=F&&Me.process,ve=function(){try{return we&&we.binding&&we.binding("util")}catch{}}(),Ue=ve&&ve.isTypedArray;function nt(N,q){for(var fe=-1,Ce=N==null?0:N.length,It=0,Xe=[];++fe<Ce;){var Tt=N[fe];q(Tt,fe,N)&&(Xe[It++]=Tt)}return Xe}function at(N,q){for(var fe=-1,Ce=q.length,It=N.length;++fe<Ce;)N[It+fe]=q[fe];return N}function Ge(N,q){for(var fe=-1,Ce=N==null?0:N.length;++fe<Ce;)if(q(N[fe],fe,N))return!0;return!1}function Dt(N,q){for(var fe=-1,Ce=Array(N);++fe<N;)Ce[fe]=q(fe);return Ce}function $t(N){return function(q){return N(q)}}function Je(N,q){return N.has(q)}function He(N,q){return N?.[q]}function ke(N){var q=-1,fe=Array(N.size);return N.forEach(function(Ce,It){fe[++q]=[It,Ce]}),fe}function Ke(N,q){return function(fe){return N(q(fe))}}function rt(N){var q=-1,fe=Array(N.size);return N.forEach(function(Ce){fe[++q]=Ce}),fe}var je=Array.prototype,Ze=Function.prototype,b=Object.prototype,p=Y["__core-js_shared__"],m=Ze.toString,D=b.hasOwnProperty,B=function(){var N=/[^.]+$/.exec(p&&p.keys&&p.keys.IE_PROTO||"");return N?"Symbol(src)_1."+N:""}(),K=b.toString,Q=RegExp("^"+m.call(D).replace(Oe,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ee=F?Y.Buffer:void 0,Ne=Y.Symbol,st=Y.Uint8Array,ht=b.propertyIsEnumerable,lt=je.splice,Ur=Ne?Ne.toStringTag:void 0,Jn=Object.getOwnPropertySymbols,Si=Ee?Ee.isBuffer:void 0,cs=Ke(Object.keys,Object),zt=Qr(Y,"DataView"),Lt=Qr(Y,"Map"),Wt=Qr(Y,"Promise"),qt=Qr(Y,"Set"),Ft=Qr(Y,"WeakMap"),Mt=Qr(Object,"create"),ir=Qn(zt),sr=Qn(Lt),Vt=Qn(Wt),or=Qn(qt),Kt=Qn(Ft),Xt=Ne?Ne.prototype:void 0,Gt=Xt?Xt.valueOf:void 0;function Pt(N){var q=-1,fe=N==null?0:N.length;for(this.clear();++q<fe;){var Ce=N[q];this.set(Ce[0],Ce[1])}}function ar(){this.__data__=Mt?Mt(null):{},this.size=0}function cr(N){var q=this.has(N)&&delete this.__data__[N];return this.size-=q?1:0,q}function kf(N){var q=this.__data__;if(Mt){var fe=q[N];return fe===n?void 0:fe}return D.call(q,N)?q[N]:void 0}function Hf(N){var q=this.__data__;return Mt?q[N]!==void 0:D.call(q,N)}function zf(N,q){var fe=this.__data__;return this.size+=this.has(N)?0:1,fe[N]=Mt&&q===void 0?n:q,this}Pt.prototype.clear=ar,Pt.prototype.delete=cr,Pt.prototype.get=kf,Pt.prototype.has=Hf,Pt.prototype.set=zf;function fn(N){var q=-1,fe=N==null?0:N.length;for(this.clear();++q<fe;){var Ce=N[q];this.set(Ce[0],Ce[1])}}function Wf(){this.__data__=[],this.size=0}function qf(N){var q=this.__data__,fe=ls(q,N);if(fe<0)return!1;var Ce=q.length-1;return fe==Ce?q.pop():lt.call(q,fe,1),--this.size,!0}function Vf(N){var q=this.__data__,fe=ls(q,N);return fe<0?void 0:q[fe][1]}function Kf(N){return ls(this.__data__,N)>-1}function Gf(N,q){var fe=this.__data__,Ce=ls(fe,N);return Ce<0?(++this.size,fe.push([N,q])):fe[Ce][1]=q,this}fn.prototype.clear=Wf,fn.prototype.delete=qf,fn.prototype.get=Vf,fn.prototype.has=Kf,fn.prototype.set=Gf;function Xn(N){var q=-1,fe=N==null?0:N.length;for(this.clear();++q<fe;){var Ce=N[q];this.set(Ce[0],Ce[1])}}function Qs(){this.size=0,this.__data__={hash:new Pt,map:new(Lt||fn),string:new Pt}}function Zf(N){var q=Ai(this,N).delete(N);return this.size-=q?1:0,q}function eo(N){return Ai(this,N).get(N)}function Yf(N){return Ai(this,N).has(N)}function Jf(N,q){var fe=Ai(this,N),Ce=fe.size;return fe.set(N,q),this.size+=fe.size==Ce?0:1,this}Xn.prototype.clear=Qs,Xn.prototype.delete=Zf,Xn.prototype.get=eo,Xn.prototype.has=Yf,Xn.prototype.set=Jf;function to(N){var q=-1,fe=N==null?0:N.length;for(this.__data__=new Xn;++q<fe;)this.add(N[q])}function Jc(N){return this.__data__.set(N,n),this}function Xc(N){return this.__data__.has(N)}to.prototype.add=to.prototype.push=Jc,to.prototype.has=Xc;function Cn(N){var q=this.__data__=new fn(N);this.size=q.size}function Xf(){this.__data__=new fn,this.size=0}function Qf(N){var q=this.__data__,fe=q.delete(N);return this.size=q.size,fe}function e0(N){return this.__data__.get(N)}function t0(N){return this.__data__.has(N)}function Qc(N,q){var fe=this.__data__;if(fe instanceof fn){var Ce=fe.__data__;if(!Lt||Ce.length<r-1)return Ce.push([N,q]),this.size=++fe.size,this;fe=this.__data__=new Xn(Ce)}return fe.set(N,q),this.size=fe.size,this}Cn.prototype.clear=Xf,Cn.prototype.delete=Qf,Cn.prototype.get=e0,Cn.prototype.has=t0,Cn.prototype.set=Qc;function el(N,q){var fe=io(N),Ce=!fe&&fl(N),It=!fe&&!Ce&&ya(N),Xe=!fe&&!Ce&&!It&&gl(N),Tt=fe||Ce||It||Xe,lr=Tt?Dt(N.length,String):[],mt=lr.length;for(var St in N)(q||D.call(N,St))&&!(Tt&&(St=="length"||It&&(St=="offset"||St=="parent")||Xe&&(St=="buffer"||St=="byteLength"||St=="byteOffset")||al(St,mt)))&&lr.push(St);return lr}function ls(N,q){for(var fe=N.length;fe--;)if(hl(N[fe][0],q))return fe;return-1}function wa(N,q,fe){var Ce=q(N);return io(N)?Ce:at(Ce,fe(N))}function us(N){return N==null?N===void 0?J:Z:Ur&&Ur in Object(N)?sl(N):i0(N)}function va(N){return fs(N)&&us(N)==l}function hs(N,q,fe,Ce,It){return N===q?!0:N==null||q==null||!fs(N)&&!fs(q)?N!==N&&q!==q:tl(N,q,fe,Ce,hs,It)}function tl(N,q,fe,Ce,It,Xe){var Tt=io(N),lr=io(q),mt=Tt?h:Fn(N),St=lr?h:Fn(q);mt=mt==l?R:mt,St=St==l?R:St;var Qt=mt==R,qr=St==R,ur=mt==St;if(ur&&ya(N)){if(!ya(q))return!1;Tt=!0,Qt=!1}if(ur&&!Qt)return Xe||(Xe=new Cn),Tt||gl(N)?ro(N,q,fe,Ce,It,Xe):n0(N,q,mt,fe,Ce,It,Xe);if(!(fe&i)){var Nt=Qt&&D.call(N,"__wrapped__"),jr=qr&&D.call(q,"__wrapped__");if(Nt||jr){var In=Nt?N.value():N,dn=jr?q.value():q;return Xe||(Xe=new Cn),It(In,dn,fe,Ce,Xe)}}return ur?(Xe||(Xe=new Cn),il(N,q,fe,Ce,It,Xe)):!1}function r0(N){if(!pl(N)||ll(N))return!1;var q=so(N)?Q:ge;return q.test(Qn(N))}function rl(N){return fs(N)&&dl(N.length)&&!!ye[us(N)]}function nl(N){if(!ul(N))return cs(N);var q=[];for(var fe in Object(N))D.call(N,fe)&&fe!="constructor"&&q.push(fe);return q}function ro(N,q,fe,Ce,It,Xe){var Tt=fe&i,lr=N.length,mt=q.length;if(lr!=mt&&!(Tt&&mt>lr))return!1;var St=Xe.get(N);if(St&&Xe.get(q))return St==q;var Qt=-1,qr=!0,ur=fe&o?new to:void 0;for(Xe.set(N,q),Xe.set(q,N);++Qt<lr;){var Nt=N[Qt],jr=q[Qt];if(Ce)var In=Tt?Ce(jr,Nt,Qt,q,N,Xe):Ce(Nt,jr,Qt,N,q,Xe);if(In!==void 0){if(In)continue;qr=!1;break}if(ur){if(!Ge(q,function(dn,Bn){if(!Je(ur,Bn)&&(Nt===dn||It(Nt,dn,fe,Ce,Xe)))return ur.push(Bn)})){qr=!1;break}}else if(!(Nt===jr||It(Nt,jr,fe,Ce,Xe))){qr=!1;break}}return Xe.delete(N),Xe.delete(q),qr}function n0(N,q,fe,Ce,It,Xe,Tt){switch(fe){case de:if(N.byteLength!=q.byteLength||N.byteOffset!=q.byteOffset)return!1;N=N.buffer,q=q.buffer;case ee:return!(N.byteLength!=q.byteLength||!Xe(new st(N),new st(q)));case v:case E:case H:return hl(+N,+q);case _:return N.name==q.name&&N.message==q.message;case T:case d:return N==q+"";case j:var lr=ke;case I:var mt=Ce&i;if(lr||(lr=rt),N.size!=q.size&&!mt)return!1;var St=Tt.get(N);if(St)return St==q;Ce|=o,Tt.set(N,q);var Qt=ro(lr(N),lr(q),Ce,It,Xe,Tt);return Tt.delete(N),Qt;case x:if(Gt)return Gt.call(N)==Gt.call(q)}return!1}function il(N,q,fe,Ce,It,Xe){var Tt=fe&i,lr=no(N),mt=lr.length,St=no(q),Qt=St.length;if(mt!=Qt&&!Tt)return!1;for(var qr=mt;qr--;){var ur=lr[qr];if(!(Tt?ur in q:D.call(q,ur)))return!1}var Nt=Xe.get(N);if(Nt&&Xe.get(q))return Nt==q;var jr=!0;Xe.set(N,q),Xe.set(q,N);for(var In=Tt;++qr<mt;){ur=lr[qr];var dn=N[ur],Bn=q[ur];if(Ce)var ba=Tt?Ce(Bn,dn,ur,q,N,Xe):Ce(dn,Bn,ur,N,q,Xe);if(!(ba===void 0?dn===Bn||It(dn,Bn,fe,Ce,Xe):ba)){jr=!1;break}In||(In=ur=="constructor")}if(jr&&!In){var ds=N.constructor,vr=q.constructor;ds!=vr&&"constructor"in N&&"constructor"in q&&!(typeof ds=="function"&&ds instanceof ds&&typeof vr=="function"&&vr instanceof vr)&&(jr=!1)}return Xe.delete(N),Xe.delete(q),jr}function no(N){return wa(N,a0,ol)}function Ai(N,q){var fe=N.__data__;return cl(q)?fe[typeof q=="string"?"string":"hash"]:fe.map}function Qr(N,q){var fe=He(N,q);return r0(fe)?fe:void 0}function sl(N){var q=D.call(N,Ur),fe=N[Ur];try{N[Ur]=void 0;var Ce=!0}catch{}var It=K.call(N);return Ce&&(q?N[Ur]=fe:delete N[Ur]),It}var ol=Jn?function(N){return N==null?[]:(N=Object(N),nt(Jn(N),function(q){return ht.call(N,q)}))}:Ct,Fn=us;(zt&&Fn(new zt(new ArrayBuffer(1)))!=de||Lt&&Fn(new Lt)!=j||Wt&&Fn(Wt.resolve())!=L||qt&&Fn(new qt)!=I||Ft&&Fn(new Ft)!=z)&&(Fn=function(N){var q=us(N),fe=q==R?N.constructor:void 0,Ce=fe?Qn(fe):"";if(Ce)switch(Ce){case ir:return de;case sr:return j;case Vt:return L;case or:return I;case Kt:return z}return q});function al(N,q){return q=q??c,!!q&&(typeof N=="number"||Be.test(N))&&N>-1&&N%1==0&&N<q}function cl(N){var q=typeof N;return q=="string"||q=="number"||q=="symbol"||q=="boolean"?N!=="__proto__":N===null}function ll(N){return!!B&&B in N}function ul(N){var q=N&&N.constructor,fe=typeof q=="function"&&q.prototype||b;return N===fe}function i0(N){return K.call(N)}function Qn(N){if(N!=null){try{return m.call(N)}catch{}try{return N+""}catch{}}return""}function hl(N,q){return N===q||N!==N&&q!==q}var fl=va(function(){return arguments}())?va:function(N){return fs(N)&&D.call(N,"callee")&&!ht.call(N,"callee")},io=Array.isArray;function s0(N){return N!=null&&dl(N.length)&&!so(N)}var ya=Si||xt;function o0(N,q){return hs(N,q)}function so(N){if(!pl(N))return!1;var q=us(N);return q==S||q==P||q==f||q==$}function dl(N){return typeof N=="number"&&N>-1&&N%1==0&&N<=c}function pl(N){var q=typeof N;return N!=null&&(q=="object"||q=="function")}function fs(N){return N!=null&&typeof N=="object"}var gl=Ue?$t(Ue):rl;function a0(N){return s0(N)?el(N):nl(N)}function Ct(){return[]}function xt(){return!1}t.exports=o0})(sh,sh.exports);var N_=sh.exports,R_=Object.defineProperty,Np=Object.getOwnPropertySymbols,L_=Object.prototype.hasOwnProperty,M_=Object.prototype.propertyIsEnumerable,Rp=(t,e,r)=>e in t?R_(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Nr=(t,e)=>{for(var r in e||(e={}))L_.call(e,r)&&Rp(t,r,e[r]);if(Np)for(var r of Np(e))M_.call(e,r)&&Rp(t,r,e[r]);return t};function U_(t,e){if(t.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),n=0;n<r.length;n++)r[n]=255;for(var i=0;i<t.length;i++){var o=t.charAt(i),c=o.charCodeAt(0);if(r[c]!==255)throw new TypeError(o+" is ambiguous");r[c]=i}var l=t.length,h=t.charAt(0),f=Math.log(l)/Math.log(256),v=Math.log(256)/Math.log(l);function E(P){if(P instanceof Uint8Array||(ArrayBuffer.isView(P)?P=new Uint8Array(P.buffer,P.byteOffset,P.byteLength):Array.isArray(P)&&(P=Uint8Array.from(P))),!(P instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(P.length===0)return"";for(var j=0,H=0,Z=0,R=P.length;Z!==R&&P[Z]===0;)Z++,j++;for(var L=(R-Z)*v+1>>>0,$=new Uint8Array(L);Z!==R;){for(var T=P[Z],I=0,d=L-1;(T!==0||I<H)&&d!==-1;d--,I++)T+=256*$[d]>>>0,$[d]=T%l>>>0,T=T/l>>>0;if(T!==0)throw new Error("Non-zero carry");H=I,Z++}for(var x=L-H;x!==L&&$[x]===0;)x++;for(var J=h.repeat(j);x<L;++x)J+=t.charAt($[x]);return J}function _(P){if(typeof P!="string")throw new TypeError("Expected String");if(P.length===0)return new Uint8Array;var j=0;if(P[j]!==" "){for(var H=0,Z=0;P[j]===h;)H++,j++;for(var R=(P.length-j)*f+1>>>0,L=new Uint8Array(R);P[j];){var $=r[P.charCodeAt(j)];if($===255)return;for(var T=0,I=R-1;($!==0||T<Z)&&I!==-1;I--,T++)$+=l*L[I]>>>0,L[I]=$%256>>>0,$=$/256>>>0;if($!==0)throw new Error("Non-zero carry");Z=T,j++}if(P[j]!==" "){for(var d=R-Z;d!==R&&L[d]===0;)d++;for(var x=new Uint8Array(H+(R-d)),J=H;d!==R;)x[J++]=L[d++];return x}}}function S(P){var j=_(P);if(j)return j;throw new Error(`Non-${e} character`)}return{encode:E,decodeUnsafe:_,decode:S}}var j_=U_,F_=j_;const Lp=t=>{if(t instanceof Uint8Array&&t.constructor.name==="Uint8Array")return t;if(t instanceof ArrayBuffer)return new Uint8Array(t);if(ArrayBuffer.isView(t))return new Uint8Array(t.buffer,t.byteOffset,t.byteLength);throw new Error("Unknown type, must be binary type")},B_=t=>new TextEncoder().encode(t),k_=t=>new TextDecoder().decode(t);class H_{constructor(e,r,n){this.name=e,this.prefix=r,this.baseEncode=n}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}}class z_{constructor(e,r,n){if(this.name=e,this.prefix=r,r.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=r.codePointAt(0),this.baseDecode=n}decode(e){if(typeof e=="string"){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(e){return Mp(this,e)}}class W_{constructor(e){this.decoders=e}or(e){return Mp(this,e)}decode(e){const r=e[0],n=this.decoders[r];if(n)return n.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const Mp=(t,e)=>new W_(Nr(Nr({},t.decoders||{[t.prefix]:t}),e.decoders||{[e.prefix]:e}));class q_{constructor(e,r,n,i){this.name=e,this.prefix=r,this.baseEncode=n,this.baseDecode=i,this.encoder=new H_(e,r,n),this.decoder=new z_(e,r,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}const sc=({name:t,prefix:e,encode:r,decode:n})=>new q_(t,e,r,n),Fo=({prefix:t,name:e,alphabet:r})=>{const{encode:n,decode:i}=F_(r,e);return sc({prefix:t,name:e,encode:n,decode:o=>Lp(i(o))})},V_=(t,e,r,n)=>{const i={};for(let v=0;v<e.length;++v)i[e[v]]=v;let o=t.length;for(;t[o-1]==="=";)--o;const c=new Uint8Array(o*r/8|0);let l=0,h=0,f=0;for(let v=0;v<o;++v){const E=i[t[v]];if(E===void 0)throw new SyntaxError(`Non-${n} character`);h=h<<r|E,l+=r,l>=8&&(l-=8,c[f++]=255&h>>l)}if(l>=r||255&h<<8-l)throw new SyntaxError("Unexpected end of data");return c},K_=(t,e,r)=>{const n=e[e.length-1]==="=",i=(1<<r)-1;let o="",c=0,l=0;for(let h=0;h<t.length;++h)for(l=l<<8|t[h],c+=8;c>r;)c-=r,o+=e[i&l>>c];if(c&&(o+=e[i&l<<r-c]),n)for(;o.length*r&7;)o+="=";return o},Er=({name:t,prefix:e,bitsPerChar:r,alphabet:n})=>sc({prefix:e,name:t,encode(i){return K_(i,n,r)},decode(i){return V_(i,n,r,t)}}),G_=sc({prefix:"\0",name:"identity",encode:t=>k_(t),decode:t=>B_(t)});var Z_=Object.freeze({__proto__:null,identity:G_});const Y_=Er({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var J_=Object.freeze({__proto__:null,base2:Y_});const X_=Er({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var Q_=Object.freeze({__proto__:null,base8:X_});const e8=Fo({prefix:"9",name:"base10",alphabet:"0123456789"});var t8=Object.freeze({__proto__:null,base10:e8});const r8=Er({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),n8=Er({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var i8=Object.freeze({__proto__:null,base16:r8,base16upper:n8});const s8=Er({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),o8=Er({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),a8=Er({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),c8=Er({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),l8=Er({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),u8=Er({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),h8=Er({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),f8=Er({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),d8=Er({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var p8=Object.freeze({__proto__:null,base32:s8,base32upper:o8,base32pad:a8,base32padupper:c8,base32hex:l8,base32hexupper:u8,base32hexpad:h8,base32hexpadupper:f8,base32z:d8});const g8=Fo({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),m8=Fo({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var w8=Object.freeze({__proto__:null,base36:g8,base36upper:m8});const v8=Fo({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),y8=Fo({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var b8=Object.freeze({__proto__:null,base58btc:v8,base58flickr:y8});const _8=Er({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),E8=Er({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),x8=Er({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),C8=Er({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var I8=Object.freeze({__proto__:null,base64:_8,base64pad:E8,base64url:x8,base64urlpad:C8});const Up=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}"),S8=Up.reduce((t,e,r)=>(t[r]=e,t),[]),A8=Up.reduce((t,e,r)=>(t[e.codePointAt(0)]=r,t),[]);function O8(t){return t.reduce((e,r)=>(e+=S8[r],e),"")}function D8(t){const e=[];for(const r of t){const n=A8[r.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${r}`);e.push(n)}return new Uint8Array(e)}const $8=sc({prefix:"\u{1F680}",name:"base256emoji",encode:O8,decode:D8});var P8=Object.freeze({__proto__:null,base256emoji:$8}),T8=Fp,jp=128,N8=127,R8=~N8,L8=Math.pow(2,31);function Fp(t,e,r){e=e||[],r=r||0;for(var n=r;t>=L8;)e[r++]=t&255|jp,t/=128;for(;t&R8;)e[r++]=t&255|jp,t>>>=7;return e[r]=t|0,Fp.bytes=r-n+1,e}var M8=oh,U8=128,Bp=127;function oh(t,n){var r=0,n=n||0,i=0,o=n,c,l=t.length;do{if(o>=l)throw oh.bytes=0,new RangeError("Could not decode varint");c=t[o++],r+=i<28?(c&Bp)<<i:(c&Bp)*Math.pow(2,i),i+=7}while(c>=U8);return oh.bytes=o-n,r}var j8=Math.pow(2,7),F8=Math.pow(2,14),B8=Math.pow(2,21),k8=Math.pow(2,28),H8=Math.pow(2,35),z8=Math.pow(2,42),W8=Math.pow(2,49),q8=Math.pow(2,56),V8=Math.pow(2,63),K8=function(t){return t<j8?1:t<F8?2:t<B8?3:t<k8?4:t<H8?5:t<z8?6:t<W8?7:t<q8?8:t<V8?9:10},G8={encode:T8,decode:M8,encodingLength:K8},kp=G8;const Hp=(t,e,r=0)=>(kp.encode(t,e,r),e),zp=t=>kp.encodingLength(t),ah=(t,e)=>{const r=e.byteLength,n=zp(t),i=n+zp(r),o=new Uint8Array(i+r);return Hp(t,o,0),Hp(r,o,n),o.set(e,i),new Z8(t,r,e,o)};class Z8{constructor(e,r,n,i){this.code=e,this.size=r,this.digest=n,this.bytes=i}}const Wp=({name:t,code:e,encode:r})=>new Y8(t,e,r);class Y8{constructor(e,r,n){this.name=e,this.code=r,this.encode=n}digest(e){if(e instanceof Uint8Array){const r=this.encode(e);return r instanceof Uint8Array?ah(this.code,r):r.then(n=>ah(this.code,n))}else throw Error("Unknown type, must be binary type")}}const qp=t=>async e=>new Uint8Array(await crypto.subtle.digest(t,e)),J8=Wp({name:"sha2-256",code:18,encode:qp("SHA-256")}),X8=Wp({name:"sha2-512",code:19,encode:qp("SHA-512")});var Q8=Object.freeze({__proto__:null,sha256:J8,sha512:X8});const Vp=0,eE="identity",Kp=Lp;var tE=Object.freeze({__proto__:null,identity:{code:Vp,name:eE,encode:Kp,digest:t=>ah(Vp,Kp(t))}});new TextEncoder,new TextDecoder;const Gp=Nr(Nr(Nr(Nr(Nr(Nr(Nr(Nr(Nr(Nr({},Z_),J_),Q_),t8),i8),p8),w8),b8),I8),P8);Nr(Nr({},Q8),tE);function Zp(t){return globalThis.Buffer!=null?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):t}function rE(t=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?Zp(globalThis.Buffer.allocUnsafe(t)):new Uint8Array(t)}function Yp(t,e,r,n){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:r},decoder:{decode:n}}}const Jp=Yp("utf8","u",t=>"u"+new TextDecoder("utf8").decode(t),t=>new TextEncoder().encode(t.substring(1))),ch=Yp("ascii","a",t=>{let e="a";for(let r=0;r<t.length;r++)e+=String.fromCharCode(t[r]);return e},t=>{t=t.substring(1);const e=rE(t.length);for(let r=0;r<t.length;r++)e[r]=t.charCodeAt(r);return e}),nE=Nr({utf8:Jp,"utf-8":Jp,hex:Gp.base16,latin1:ch,ascii:ch,binary:ch},Gp);function iE(t,e="utf8"){const r=nE[e];if(!r)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?Zp(globalThis.Buffer.from(t,"utf-8")):r.decoder.decode(`${r.prefix}${t}`)}const Xp="wc",sE=2,lh="core",di=`${Xp}@2:${lh}:`,oE={name:lh,logger:"error"},aE={database:":memory:"},cE="crypto",Qp="client_ed25519_seed",lE=Te.ONE_DAY,uE="keychain",hE="0.3",fE="messages",dE="0.3",pE=Te.SIX_HOURS,gE="publisher",eg="irn",mE="error",tg="wss://relay.walletconnect.com",rg="wss://relay.walletconnect.org",wE="relayer",kt={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"},vE="_subscription",Bo={payload:"payload",connect:"connect",disconnect:"disconnect",error:"error"},yE=Te.ONE_SECOND/2,bE="2.9.0-e9ace057",_E=1e4,EE="0.3",xE="WALLETCONNECT_CLIENT_ID",Tn={created:"subscription_created",deleted:"subscription_deleted",expired:"subscription_expired",disabled:"subscription_disabled",sync:"subscription_sync",resubscribed:"subscription_resubscribed"},CE="subscription",IE="0.3",SE=Te.FIVE_SECONDS*1e3,AE="pairing",OE="0.3",ko={wc_pairingDelete:{req:{ttl:Te.ONE_DAY,prompt:!1,tag:1e3},res:{ttl:Te.ONE_DAY,prompt:!1,tag:1001}},wc_pairingPing:{req:{ttl:Te.THIRTY_SECONDS,prompt:!1,tag:1002},res:{ttl:Te.THIRTY_SECONDS,prompt:!1,tag:1003}},unregistered_method:{req:{ttl:Te.ONE_DAY,prompt:!1,tag:0},res:{ttl:Te.ONE_DAY,prompt:!1,tag:0}}},Nn={created:"history_created",updated:"history_updated",deleted:"history_deleted",sync:"history_sync"},DE="history",$E="0.3",PE="expirer",on={created:"expirer_created",deleted:"expirer_deleted",expired:"expirer_expired",sync:"expirer_sync"},TE="0.3",uh="verify-api",ng="https://verify.walletconnect.com";class NE{constructor(e,r){this.core=e,this.logger=r,this.keychain=new Map,this.name=uE,this.version=hE,this.initialized=!1,this.storagePrefix=di,this.init=async()=>{if(!this.initialized){const n=await this.getKeyChain();typeof n<"u"&&(this.keychain=n),this.initialized=!0}},this.has=n=>(this.isInitialized(),this.keychain.has(n)),this.set=async(n,i)=>{this.isInitialized(),this.keychain.set(n,i),await this.persist()},this.get=n=>{this.isInitialized();const i=this.keychain.get(n);if(typeof i>"u"){const{message:o}=_e("NO_MATCHING_KEY",`${this.name}: ${n}`);throw new Error(o)}return i},this.del=async n=>{this.isInitialized(),this.keychain.delete(n),await this.persist()},this.core=e,this.logger=pt.generateChildLogger(r,this.name)}get context(){return pt.getLoggerContext(this.logger)}get storageKey(){return this.storagePrefix+this.version+"//"+this.name}async setKeyChain(e){await this.core.storage.setItem(this.storageKey,P1(e))}async getKeyChain(){const e=await this.core.storage.getItem(this.storageKey);return typeof e<"u"?T1(e):void 0}async persist(){await this.setKeyChain(this.keychain)}isInitialized(){if(!this.initialized){const{message:e}=_e("NOT_INITIALIZED",this.name);throw new Error(e)}}}class RE{constructor(e,r,n){this.core=e,this.logger=r,this.name=cE,this.initialized=!1,this.init=async()=>{this.initialized||(await this.keychain.init(),this.initialized=!0)},this.hasKeys=i=>(this.isInitialized(),this.keychain.has(i)),this.getClientId=async()=>{this.isInitialized();const i=await this.getClientSeed(),o=mp(i);return gp(o.publicKey)},this.generateKeyPair=()=>{this.isInitialized();const i=H5();return this.setPrivateKey(i.publicKey,i.privateKey)},this.signJWT=async i=>{this.isInitialized();const o=await this.getClientSeed(),c=mp(o),l=Ou();return await q4(l,i,lE,c)},this.generateSharedKey=(i,o,c)=>{this.isInitialized();const l=this.getPrivateKey(i),h=z5(l,o);return this.setSymKey(h,c)},this.setSymKey=async(i,o)=>{this.isInitialized();const c=o||W5(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,o,c)=>{this.isInitialized();const l=I1(c),h=Mo(o);if(S1(l)){const _=l.senderPublicKey,S=l.receiverPublicKey;i=await this.generateSharedKey(_,S)}const f=this.getSymKey(i),{type:v,senderPublicKey:E}=l;return V5({type:v,symKey:f,message:h,senderPublicKey:E})},this.decode=async(i,o,c)=>{this.isInitialized();const l=Z5(o,c);if(S1(l)){const v=l.receiverPublicKey,E=l.senderPublicKey;i=await this.generateSharedKey(v,E)}const h=this.getSymKey(i),f=K5({symKey:h,encoded:o});return Yu(f)},this.getPayloadType=i=>{const o=Ka(i);return So(o.type)},this.getPayloadSenderPublicKey=i=>{const o=Ka(i);return o.senderPublicKey?Dr(o.senderPublicKey,$r):void 0},this.core=e,this.logger=pt.generateChildLogger(r,this.name),this.keychain=n||new NE(this.core,this.logger)}get context(){return pt.getLoggerContext(this.logger)}async setPrivateKey(e,r){return await this.keychain.set(e,r),e}getPrivateKey(e){return this.keychain.get(e)}async getClientSeed(){let e="";try{e=this.keychain.get(Qp)}catch{e=Ou(),await this.keychain.set(Qp,e)}return iE(e,"base16")}getSymKey(e){return this.keychain.get(e)}isInitialized(){if(!this.initialized){const{message:e}=_e("NOT_INITIALIZED",this.name);throw new Error(e)}}}class LE extends _4{constructor(e,r){super(e,r),this.logger=e,this.core=r,this.messages=new Map,this.name=fE,this.version=dE,this.initialized=!1,this.storagePrefix=di,this.init=async()=>{if(!this.initialized){this.logger.trace("Initialized");try{const n=await this.getRelayerMessages();typeof n<"u"&&(this.messages=n),this.logger.debug(`Successfully Restored records for ${this.name}`),this.logger.trace({type:"method",method:"restore",size:this.messages.size})}catch(n){this.logger.debug(`Failed to Restore records for ${this.name}`),this.logger.error(n)}finally{this.initialized=!0}}},this.set=async(n,i)=>{this.isInitialized();const o=Ss(i);let c=this.messages.get(n);return typeof c>"u"&&(c={}),typeof c[o]<"u"||(c[o]=i,this.messages.set(n,c),await this.persist()),o},this.get=n=>{this.isInitialized();let i=this.messages.get(n);return typeof i>"u"&&(i={}),i},this.has=(n,i)=>{this.isInitialized();const o=this.get(n),c=Ss(i);return typeof o[c]<"u"},this.del=async n=>{this.isInitialized(),this.messages.delete(n),await this.persist()},this.logger=pt.generateChildLogger(e,this.name),this.core=r}get context(){return pt.getLoggerContext(this.logger)}get storageKey(){return this.storagePrefix+this.version+"//"+this.name}async setRelayerMessages(e){await this.core.storage.setItem(this.storageKey,P1(e))}async getRelayerMessages(){const e=await this.core.storage.getItem(this.storageKey);return typeof e<"u"?T1(e):void 0}async persist(){await this.setRelayerMessages(this.messages)}isInitialized(){if(!this.initialized){const{message:e}=_e("NOT_INITIALIZED",this.name);throw new Error(e)}}}class ME extends E4{constructor(e,r){super(e,r),this.relayer=e,this.logger=r,this.events=new br.exports.EventEmitter,this.name=gE,this.queue=new Map,this.publishTimeout=Te.toMiliseconds(Te.TEN_SECONDS),this.queueTimeout=Te.toMiliseconds(Te.FIVE_SECONDS),this.needsTransportRestart=!1,this.publish=async(n,i,o)=>{this.logger.debug("Publishing Payload"),this.logger.trace({type:"method",method:"publish",params:{topic:n,message:i,opts:o}});try{const c=o?.ttl||pE,l=Nu(o),h=o?.prompt||!1,f=o?.tag||0,v=o?.id||rh().toString(),E={topic:n,message:i,opts:{ttl:c,relay:l,prompt:h,tag:f,id:v}},_=setTimeout(()=>this.queue.set(v,E),this.queueTimeout);try{await await Ga(this.rpcPublish(n,i,c,l,h,f,v),this.publishTimeout),clearTimeout(_),this.relayer.events.emit(kt.publish,E)}catch{this.logger.debug("Publishing Payload stalled"),this.needsTransportRestart=!0;return}this.logger.debug("Successfully Published Payload"),this.logger.trace({type:"method",method:"publish",params:{topic:n,message:i,opts:o}})}catch(c){throw this.logger.debug("Failed to Publish Payload"),this.logger.error(c),c}},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=pt.generateChildLogger(r,this.name),this.registerEventListeners()}get context(){return pt.getLoggerContext(this.logger)}rpcPublish(e,r,n,i,o,c,l){var h,f,v,E;const _={method:Za(i.protocol).publish,params:{topic:e,message:r,ttl:n,prompt:o,tag:c},id:l};return Pr((h=_.params)==null?void 0:h.prompt)&&((f=_.params)==null||delete f.prompt),Pr((v=_.params)==null?void 0:v.tag)&&((E=_.params)==null||delete E.tag),this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"message",direction:"outgoing",request:_}),this.relayer.request(_)}onPublish(e){this.queue.delete(e)}checkQueue(){this.queue.forEach(async e=>{const{topic:r,message:n,opts:i}=e;await this.publish(r,n,i)})}registerEventListeners(){this.relayer.core.heartbeat.on(Ps.HEARTBEAT_EVENTS.pulse,()=>{if(this.needsTransportRestart){this.needsTransportRestart=!1,this.relayer.events.emit(kt.connection_stalled);return}this.checkQueue()}),this.relayer.on(kt.message_ack,e=>{this.onPublish(e.id.toString())})}}class UE{constructor(){this.map=new Map,this.set=(e,r)=>{const n=this.get(e);this.exists(e,r)||this.map.set(e,[...n,r])},this.get=e=>this.map.get(e)||[],this.exists=(e,r)=>this.get(e).includes(r),this.delete=(e,r)=>{if(typeof r>"u"){this.map.delete(e);return}if(!this.map.has(e))return;const n=this.get(e);if(!this.exists(e,r))return;const i=n.filter(o=>o!==r);if(!i.length){this.map.delete(e);return}this.map.set(e,i)},this.clear=()=>{this.map.clear()}}get topics(){return Array.from(this.map.keys())}}var jE=Object.defineProperty,FE=Object.defineProperties,BE=Object.getOwnPropertyDescriptors,ig=Object.getOwnPropertySymbols,kE=Object.prototype.hasOwnProperty,HE=Object.prototype.propertyIsEnumerable,sg=(t,e,r)=>e in t?jE(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Ho=(t,e)=>{for(var r in e||(e={}))kE.call(e,r)&&sg(t,r,e[r]);if(ig)for(var r of ig(e))HE.call(e,r)&&sg(t,r,e[r]);return t},hh=(t,e)=>FE(t,BE(e));class zE extends I4{constructor(e,r){super(e,r),this.relayer=e,this.logger=r,this.subscriptions=new Map,this.topicMap=new UE,this.events=new br.exports.EventEmitter,this.name=CE,this.version=IE,this.pending=new Map,this.cached=[],this.initialized=!1,this.pendingSubscriptionWatchLabel="pending_sub_watch_label",this.pollingInterval=20,this.storagePrefix=di,this.subscribeTimeout=1e4,this.restartInProgress=!1,this.batchSubscribeTopicsLimit=500,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restart(),this.registerEventListeners(),this.onEnable(),this.clientId=await this.relayer.core.crypto.getClientId())},this.subscribe=async(n,i)=>{await this.restartToComplete(),this.isInitialized(),this.logger.debug("Subscribing Topic"),this.logger.trace({type:"method",method:"subscribe",params:{topic:n,opts:i}});try{const o=Nu(i),c={topic:n,relay:o};this.pending.set(n,c);const l=await this.rpcSubscribe(n,o);return this.onSubscribe(l,c),this.logger.debug("Successfully Subscribed Topic"),this.logger.trace({type:"method",method:"subscribe",params:{topic:n,opts:i}}),l}catch(o){throw this.logger.debug("Failed to Subscribe Topic"),this.logger.error(o),o}},this.unsubscribe=async(n,i)=>{await this.restartToComplete(),this.isInitialized(),typeof i?.id<"u"?await this.unsubscribeById(n,i.id,i):await this.unsubscribeByTopic(n,i)},this.isSubscribed=async n=>this.topics.includes(n)?!0:await new Promise((i,o)=>{const c=new Te.Watch;c.start(this.pendingSubscriptionWatchLabel);const l=setInterval(()=>{!this.pending.has(n)&&this.topics.includes(n)&&(clearInterval(l),c.stop(this.pendingSubscriptionWatchLabel),i(!0)),c.elapsed(this.pendingSubscriptionWatchLabel)>=SE&&(clearInterval(l),c.stop(this.pendingSubscriptionWatchLabel),o(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=pt.generateChildLogger(r,this.name),this.clientId=""}get context(){return pt.getLoggerContext(this.logger)}get storageKey(){return this.storagePrefix+this.version+"//"+this.name}get length(){return this.subscriptions.size}get ids(){return Array.from(this.subscriptions.keys())}get values(){return Array.from(this.subscriptions.values())}get topics(){return this.topicMap.topics}hasSubscription(e,r){let n=!1;try{n=this.getSubscription(e).topic===r}catch{}return n}onEnable(){this.cached=[],this.initialized=!0}onDisable(){this.cached=this.values,this.subscriptions.clear(),this.topicMap.clear()}async unsubscribeByTopic(e,r){const n=this.topicMap.get(e);await Promise.all(n.map(async i=>await this.unsubscribeById(e,i,r)))}async unsubscribeById(e,r,n){this.logger.debug("Unsubscribing Topic"),this.logger.trace({type:"method",method:"unsubscribe",params:{topic:e,id:r,opts:n}});try{const i=Nu(n);await this.rpcUnsubscribe(e,r,i);const o=Yt("USER_DISCONNECTED",`${this.name}, ${e}`);await this.onUnsubscribe(e,r,o),this.logger.debug("Successfully Unsubscribed Topic"),this.logger.trace({type:"method",method:"unsubscribe",params:{topic:e,id:r,opts:n}})}catch(i){throw this.logger.debug("Failed to Unsubscribe Topic"),this.logger.error(i),i}}async rpcSubscribe(e,r){const n={method:Za(r.protocol).subscribe,params:{topic:e}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:n});try{await await Ga(this.relayer.request(n),this.subscribeTimeout)}catch{this.logger.debug("Outgoing Relay Subscribe Payload stalled"),this.relayer.events.emit(kt.connection_stalled)}return Ss(e+this.clientId)}async rpcBatchSubscribe(e){if(!e.length)return;const r=e[0].relay,n={method:Za(r.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 Ga(this.relayer.request(n),this.subscribeTimeout)}catch{this.logger.debug("Outgoing Relay Payload stalled"),this.relayer.events.emit(kt.connection_stalled)}}rpcUnsubscribe(e,r,n){const i={method:Za(n.protocol).unsubscribe,params:{topic:e,id:r}};return this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:i}),this.relayer.request(i)}onSubscribe(e,r){this.setSubscription(e,hh(Ho({},r),{id:e})),this.pending.delete(r.topic)}onBatchSubscribe(e){e.length&&e.forEach(r=>{this.setSubscription(r.id,Ho({},r)),this.pending.delete(r.topic)})}async onUnsubscribe(e,r,n){this.events.removeAllListeners(r),this.hasSubscription(r,e)&&this.deleteSubscription(r,n),await this.relayer.messages.del(e)}async setRelayerSubscriptions(e){await this.relayer.core.storage.setItem(this.storageKey,e)}async getRelayerSubscriptions(){return await this.relayer.core.storage.getItem(this.storageKey)}setSubscription(e,r){this.subscriptions.has(e)||(this.logger.debug("Setting subscription"),this.logger.trace({type:"method",method:"setSubscription",id:e,subscription:r}),this.addSubscription(e,r))}addSubscription(e,r){this.subscriptions.set(e,Ho({},r)),this.topicMap.set(r.topic,e),this.events.emit(Tn.created,r)}getSubscription(e){this.logger.debug("Getting subscription"),this.logger.trace({type:"method",method:"getSubscription",id:e});const r=this.subscriptions.get(e);if(!r){const{message:n}=_e("NO_MATCHING_KEY",`${this.name}: ${e}`);throw new Error(n)}return r}deleteSubscription(e,r){this.logger.debug("Deleting subscription"),this.logger.trace({type:"method",method:"deleteSubscription",id:e,reason:r});const n=this.getSubscription(e);this.subscriptions.delete(e),this.topicMap.delete(n.topic,e),this.events.emit(Tn.deleted,hh(Ho({},n),{reason:r}))}async persist(){await this.setRelayerSubscriptions(this.values),this.events.emit(Tn.sync)}async reset(){if(this.cached.length){const e=Math.ceil(this.cached.length/this.batchSubscribeTopicsLimit);for(let r=0;r<e;r++){const n=this.cached.splice(0,this.batchSubscribeTopicsLimit);await this.batchSubscribe(n)}}this.events.emit(Tn.resubscribed)}async restore(){try{const e=await this.getRelayerSubscriptions();if(typeof e>"u"||!e.length)return;if(this.subscriptions.size){const{message:r}=_e("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(r),this.logger.error(`${this.name}: ${JSON.stringify(this.values)}`),new Error(r)}this.cached=e,this.logger.debug(`Successfully Restored subscriptions for ${this.name}`),this.logger.trace({type:"method",method:"restore",subscriptions:this.values})}catch(e){this.logger.debug(`Failed to Restore subscriptions for ${this.name}`),this.logger.error(e)}}async batchSubscribe(e){if(!e.length)return;const r=await this.rpcBatchSubscribe(e);Pn(r)&&this.onBatchSubscribe(r.map((n,i)=>hh(Ho({},e[i]),{id:n})))}async onConnect(){this.restartInProgress||(await this.restart(),this.onEnable())}onDisconnect(){this.onDisable()}async checkPending(){if(this.relayer.transportExplicitlyClosed)return;const e=[];this.pending.forEach(r=>{e.push(r)}),await this.batchSubscribe(e)}registerEventListeners(){this.relayer.core.heartbeat.on(Ps.HEARTBEAT_EVENTS.pulse,async()=>{await this.checkPending()}),this.relayer.on(kt.connect,async()=>{await this.onConnect()}),this.relayer.on(kt.disconnect,()=>{this.onDisconnect()}),this.events.on(Tn.created,async e=>{const r=Tn.created;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),await this.persist()}),this.events.on(Tn.deleted,async e=>{const r=Tn.deleted;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),await this.persist()})}isInitialized(){if(!this.initialized){const{message:e}=_e("NOT_INITIALIZED",this.name);throw new Error(e)}}async restartToComplete(){this.restartInProgress&&await new Promise(e=>{const r=setInterval(()=>{this.restartInProgress||(clearInterval(r),e())},this.pollingInterval)})}}var WE=Object.defineProperty,og=Object.getOwnPropertySymbols,qE=Object.prototype.hasOwnProperty,VE=Object.prototype.propertyIsEnumerable,ag=(t,e,r)=>e in t?WE(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,KE=(t,e)=>{for(var r in e||(e={}))qE.call(e,r)&&ag(t,r,e[r]);if(og)for(var r of og(e))VE.call(e,r)&&ag(t,r,e[r]);return t};class GE extends x4{constructor(e){super(e),this.protocol="wc",this.version=2,this.events=new br.exports.EventEmitter,this.name=wE,this.transportExplicitlyClosed=!1,this.initialized=!1,this.reconnecting=!1,this.connectionStatusPollingInterval=20,this.staleConnectionErrors=["socket hang up","socket stalled"],this.request=async r=>{this.logger.debug("Publishing Request Payload");try{return await this.toEstablishConnection(),await this.provider.request(r)}catch(n){throw this.logger.debug("Failed to Publish Request"),this.logger.error(n),n}},this.core=e.core,this.logger=typeof e.logger<"u"&&typeof e.logger!="string"?pt.generateChildLogger(e.logger,this.name):pt.pino(pt.getDefaultLoggerOptions({level:e.logger||mE})),this.messages=new LE(this.logger,e.core),this.subscriber=new zE(this,this.logger),this.publisher=new ME(this,this.logger),this.relayUrl=e?.relayUrl||tg,this.projectId=e.projectId,this.provider={}}async init(){this.logger.trace("Initialized"),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 ${rg}...`),await this.restartTransport(rg)}this.registerEventListeners(),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)},_E)}get context(){return pt.getLoggerContext(this.logger)}get connected(){return this.provider.connection.connected}get connecting(){return this.provider.connection.connecting}async publish(e,r,n){this.isInitialized(),await this.publisher.publish(e,r,n),await this.recordMessageEvent({topic:e,message:r,publishedAt:Date.now()})}async subscribe(e,r){var n;this.isInitialized();let i=((n=this.subscriber.topicMap.get(e))==null?void 0:n[0])||"";return i||(await Promise.all([new Promise(o=>{this.subscriber.once(Tn.created,c=>{c.topic===e&&o()})}),new Promise(async o=>{i=await this.subscriber.subscribe(e,r),o()})]),i)}async unsubscribe(e,r){this.isInitialized(),await this.subscriber.unsubscribe(e,r)}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}off(e,r){this.events.off(e,r)}removeListener(e,r){this.events.removeListener(e,r)}async transportClose(){this.transportExplicitlyClosed=!0,this.connected&&(await this.provider.disconnect(),this.events.emit(kt.transport_closed))}async transportOpen(e){if(this.transportExplicitlyClosed=!1,!this.reconnecting){this.relayUrl=e||this.relayUrl,this.reconnecting=!0;try{await Promise.all([new Promise(r=>{this.initialized||r(),this.subscriber.once(Tn.resubscribed,()=>{r()})}),await Promise.race([new Promise(async(r,n)=>{await Ga(this.provider.connect(),5e3,`Socket stalled when trying to connect to ${this.relayUrl}`).catch(i=>n(i)).then(()=>r()).finally(()=>this.removeListener(kt.transport_closed,this.rejectTransportOpen))}),new Promise(r=>this.once(kt.transport_closed,this.rejectTransportOpen))])])}catch(r){this.logger.error(r);const n=r;if(!this.isConnectionStalled(n.message))throw r;this.events.emit(kt.transport_closed)}finally{this.reconnecting=!1}}}async restartTransport(e){this.transportExplicitlyClosed||this.reconnecting||(this.relayUrl=e||this.relayUrl,this.connected&&await Promise.all([new Promise(r=>{this.provider.once(Bo.disconnect,()=>{r()})}),this.transportClose()]),await this.createProvider(),await this.transportOpen())}isConnectionStalled(e){return this.staleConnectionErrors.some(r=>e.includes(r))}rejectTransportOpen(){throw new Error("Attempt to connect to relay via `transportOpen` has stalled. Retrying...")}async createProvider(){const e=await this.core.crypto.signJWT(this.relayUrl);this.provider=new fi(new T_(ob({sdkVersion:bE,protocol:this.protocol,version:this.version,relayUrl:this.relayUrl,projectId:this.projectId,auth:e,useOnCloseEvent:!0}))),this.registerProviderListeners()}async recordMessageEvent(e){const{topic:r,message:n}=e;await this.messages.set(r,n)}async shouldIgnoreMessageEvent(e){const{topic:r,message:n}=e;return await this.subscriber.isSubscribed(r)?this.messages.has(r,n):!0}async onProviderPayload(e){if(this.logger.debug("Incoming Relay Payload"),this.logger.trace({type:"payload",direction:"incoming",payload:e}),ih(e)){if(!e.method.endsWith(vE))return;const r=e.params,{topic:n,message:i,publishedAt:o}=r.data,c={topic:n,message:i,publishedAt:o};this.logger.debug("Emitting Relayer Payload"),this.logger.trace(KE({type:"event",event:r.id},c)),this.events.emit(r.id,c),await this.acknowledgePayload(e),await this.onMessageEvent(c)}else ic(e)&&this.events.emit(kt.message_ack,e)}async onMessageEvent(e){await this.shouldIgnoreMessageEvent(e)||(this.events.emit(kt.message,e),await this.recordMessageEvent(e))}async acknowledgePayload(e){const r=nh(e.id,!0);await this.provider.connection.send(r)}registerProviderListeners(){this.provider.on(Bo.payload,e=>this.onProviderPayload(e)),this.provider.on(Bo.connect,()=>{this.events.emit(kt.connect)}),this.provider.on(Bo.disconnect,()=>{this.onProviderDisconnect()}),this.provider.on(Bo.error,e=>{this.logger.error(e),this.events.emit(kt.error,e)})}registerEventListeners(){this.events.on(kt.connection_stalled,async()=>{await this.restartTransport()})}onProviderDisconnect(){this.events.emit(kt.disconnect),this.attemptToReconnect()}attemptToReconnect(){this.transportExplicitlyClosed||setTimeout(async()=>{await this.restartTransport()},Te.toMiliseconds(yE))}isInitialized(){if(!this.initialized){const{message:e}=_e("NOT_INITIALIZED",this.name);throw new Error(e)}}async toEstablishConnection(){if(!this.connected){if(this.connecting)return await new Promise(e=>{const r=setInterval(()=>{this.connected&&(clearInterval(r),e())},this.connectionStatusPollingInterval)});await this.restartTransport()}}}var ZE=Object.defineProperty,cg=Object.getOwnPropertySymbols,YE=Object.prototype.hasOwnProperty,JE=Object.prototype.propertyIsEnumerable,lg=(t,e,r)=>e in t?ZE(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,ug=(t,e)=>{for(var r in e||(e={}))YE.call(e,r)&&lg(t,r,e[r]);if(cg)for(var r of cg(e))JE.call(e,r)&&lg(t,r,e[r]);return t};class oc extends C4{constructor(e,r,n,i=di,o=void 0){super(e,r,n,i),this.core=e,this.logger=r,this.name=n,this.map=new Map,this.version=EE,this.cached=[],this.initialized=!1,this.storagePrefix=di,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(c=>{this.getKey&&c!==null&&!Pr(c)?this.map.set(this.getKey(c),c):Db(c)?this.map.set(c.id,c):$b(c)&&this.map.set(c.topic,c)}),this.cached=[],this.initialized=!0)},this.set=async(c,l)=>{this.isInitialized(),this.map.has(c)?await this.update(c,l):(this.logger.debug("Setting value"),this.logger.trace({type:"method",method:"set",key:c,value:l}),this.map.set(c,l),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(l=>Object.keys(c).every(h=>N_(l[h],c[h]))):this.values),this.update=async(c,l)=>{this.isInitialized(),this.logger.debug("Updating value"),this.logger.trace({type:"method",method:"update",key:c,update:l});const h=ug(ug({},this.getData(c)),l);this.map.set(c,h),await this.persist()},this.delete=async(c,l)=>{this.isInitialized(),this.map.has(c)&&(this.logger.debug("Deleting value"),this.logger.trace({type:"method",method:"delete",key:c,reason:l}),this.map.delete(c),await this.persist())},this.logger=pt.generateChildLogger(r,this.name),this.storagePrefix=i,this.getKey=o}get context(){return pt.getLoggerContext(this.logger)}get storageKey(){return this.storagePrefix+this.version+"//"+this.name}get length(){return this.map.size}get keys(){return Array.from(this.map.keys())}get values(){return Array.from(this.map.values())}async setDataStore(e){await this.core.storage.setItem(this.storageKey,e)}async getDataStore(){return await this.core.storage.getItem(this.storageKey)}getData(e){const r=this.map.get(e);if(!r){const{message:n}=_e("NO_MATCHING_KEY",`${this.name}: ${e}`);throw this.logger.error(n),new Error(n)}return r}async persist(){await this.setDataStore(this.values)}async restore(){try{const e=await this.getDataStore();if(typeof e>"u"||!e.length)return;if(this.map.size){const{message:r}=_e("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(r),new Error(r)}this.cached=e,this.logger.debug(`Successfully Restored value for ${this.name}`),this.logger.trace({type:"method",method:"restore",value:this.values})}catch(e){this.logger.debug(`Failed to Restore value for ${this.name}`),this.logger.error(e)}}isInitialized(){if(!this.initialized){const{message:e}=_e("NOT_INITIALIZED",this.name);throw new Error(e)}}}class XE{constructor(e,r){this.core=e,this.logger=r,this.name=AE,this.version=OE,this.events=new br.exports,this.initialized=!1,this.storagePrefix=di,this.ignoredPayloadTypes=[ki],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),o=En(Te.FIVE_MINUTES),c={protocol:eg},l={topic:i,expiry:o,relay:c,active:!1},h=yb({protocol:this.core.protocol,version:this.core.version,topic:i,symKey:n,relay:c});return await this.pairings.set(i,l),await this.core.relayer.subscribe(i),this.core.expirer.set(i,o),{topic:i,uri:h}},this.pair=async n=>{this.isInitialized(),this.isValidPair(n);const{topic:i,symKey:o,relay:c}=mb(n.uri);if(this.pairings.keys.includes(i))throw new Error(`Pairing already exists: ${i}`);if(this.core.crypto.hasKeys(i))throw new Error(`Keychain already exists: ${i}`);const l=En(Te.FIVE_MINUTES),h={topic:i,relay:c,expiry:l,active:!1};return await this.pairings.set(i,h),await this.core.crypto.setSymKey(o,i),await this.core.relayer.subscribe(i,{relay:c}),this.core.expirer.set(i,l),n.activatePairing&&await this.activate({topic:i}),h},this.activate=async({topic:n})=>{this.isInitialized();const i=En(Te.THIRTY_DAYS);await this.pairings.update(n,{active:!0,expiry:i}),this.core.expirer.set(n,i)},this.ping=async n=>{this.isInitialized(),await this.isValidPing(n);const{topic:i}=n;if(this.pairings.keys.includes(i)){const o=await this.sendRequest(i,"wc_pairingPing",{}),{done:c,resolve:l,reject:h}=As();this.events.once(rr("pairing_ping",o),({error:f})=>{f?h(f):l()}),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",Yt("USER_DISCONNECTED")),await this.deletePairing(i))},this.sendRequest=async(n,i,o)=>{const c=rc(i,o),l=await this.core.crypto.encode(n,c),h=ko[i].req;return this.core.history.set(n,c),this.core.relayer.publish(n,l,h),c.id},this.sendResult=async(n,i,o)=>{const c=nh(n,o),l=await this.core.crypto.encode(i,c),h=await this.core.history.get(i,n),f=ko[h.request.method].res;await this.core.relayer.publish(i,l,f),await this.core.history.resolve(c)},this.sendError=async(n,i,o)=>{const c=nc(n,o),l=await this.core.crypto.encode(i,c),h=await this.core.history.get(i,n),f=ko[h.request.method]?ko[h.request.method].res:ko.unregistered_method.res;await this.core.relayer.publish(i,l,f),await this.core.history.resolve(c)},this.deletePairing=async(n,i)=>{await this.core.relayer.unsubscribe(n),await Promise.all([this.pairings.delete(n,Yt("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=>hi(i.expiry));await Promise.all(n.map(i=>this.deletePairing(i.topic)))},this.onRelayEventRequest=n=>{const{topic:i,payload:o}=n,c=o.method;if(this.pairings.keys.includes(i))switch(c){case"wc_pairingPing":return this.onPairingPingRequest(i,o);case"wc_pairingDelete":return this.onPairingDeleteRequest(i,o);default:return this.onUnknownRpcMethodRequest(i,o)}},this.onRelayEventResponse=async n=>{const{topic:i,payload:o}=n,c=(await this.core.history.get(i,o.id)).request.method;if(this.pairings.keys.includes(i))switch(c){case"wc_pairingPing":return this.onPairingPingResponse(i,o);default:return this.onUnknownRpcMethodResponse(c)}},this.onPairingPingRequest=async(n,i)=>{const{id:o}=i;try{this.isValidPing({topic:n}),await this.sendResult(o,n,!0),this.events.emit("pairing_ping",{id:o,topic:n})}catch(c){await this.sendError(o,n,c),this.logger.error(c)}},this.onPairingPingResponse=(n,i)=>{const{id:o}=i;setTimeout(()=>{Vn(i)?this.events.emit(rr("pairing_ping",o),{}):xn(i)&&this.events.emit(rr("pairing_ping",o),{error:i.error})},500)},this.onPairingDeleteRequest=async(n,i)=>{const{id:o}=i;try{this.isValidDisconnect({topic:n}),await this.deletePairing(n),this.events.emit("pairing_delete",{id:o,topic:n})}catch(c){await this.sendError(o,n,c),this.logger.error(c)}},this.onUnknownRpcMethodRequest=async(n,i)=>{const{id:o,method:c}=i;try{if(this.registeredMethods.includes(c))return;const l=Yt("WC_METHOD_UNSUPPORTED",c);await this.sendError(o,n,l),this.logger.error(l)}catch(l){await this.sendError(o,n,l),this.logger.error(l)}},this.onUnknownRpcMethodResponse=n=>{this.registeredMethods.includes(n)||this.logger.error(Yt("WC_METHOD_UNSUPPORTED",n))},this.isValidPair=n=>{if(!zr(n)){const{message:i}=_e("MISSING_OR_INVALID",`pair() params: ${n}`);throw new Error(i)}if(!Ob(n.uri)){const{message:i}=_e("MISSING_OR_INVALID",`pair() uri: ${n.uri}`);throw new Error(i)}},this.isValidPing=async n=>{if(!zr(n)){const{message:o}=_e("MISSING_OR_INVALID",`ping() params: ${n}`);throw new Error(o)}const{topic:i}=n;await this.isValidPairingTopic(i)},this.isValidDisconnect=async n=>{if(!zr(n)){const{message:o}=_e("MISSING_OR_INVALID",`disconnect() params: ${n}`);throw new Error(o)}const{topic:i}=n;await this.isValidPairingTopic(i)},this.isValidPairingTopic=async n=>{if(!gr(n,!1)){const{message:i}=_e("MISSING_OR_INVALID",`pairing topic should be a string: ${n}`);throw new Error(i)}if(!this.pairings.keys.includes(n)){const{message:i}=_e("NO_MATCHING_KEY",`pairing topic doesn't exist: ${n}`);throw new Error(i)}if(hi(this.pairings.get(n).expiry)){await this.deletePairing(n);const{message:i}=_e("EXPIRED",`pairing topic: ${n}`);throw new Error(i)}},this.core=e,this.logger=pt.generateChildLogger(r,this.name),this.pairings=new oc(this.core,this.logger,this.name,this.storagePrefix)}get context(){return pt.getLoggerContext(this.logger)}isInitialized(){if(!this.initialized){const{message:e}=_e("NOT_INITIALIZED",this.name);throw new Error(e)}}registerRelayerEvents(){this.core.relayer.on(kt.message,async e=>{const{topic:r,message:n}=e;if(this.ignoredPayloadTypes.includes(this.core.crypto.getPayloadType(n)))return;const i=await this.core.crypto.decode(r,n);ih(i)?(this.core.history.set(r,i),this.onRelayEventRequest({topic:r,payload:i})):ic(i)&&(await this.core.history.resolve(i),await this.onRelayEventResponse({topic:r,payload:i}),this.core.history.delete(r,i.id))})}registerExpirerEvents(){this.core.expirer.on(on.expired,async e=>{const{topic:r}=R1(e.target);r&&this.pairings.keys.includes(r)&&(await this.deletePairing(r,!0),this.events.emit("pairing_expire",{topic:r}))})}}class QE extends b4{constructor(e,r){super(e,r),this.core=e,this.logger=r,this.records=new Map,this.events=new br.exports.EventEmitter,this.name=DE,this.version=$E,this.cached=[],this.initialized=!1,this.storagePrefix=di,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(n=>this.records.set(n.id,n)),this.cached=[],this.registerEventListeners(),this.initialized=!0)},this.set=(n,i,o)=>{if(this.isInitialized(),this.logger.debug("Setting JSON-RPC request history record"),this.logger.trace({type:"method",method:"set",topic:n,request:i,chainId:o}),this.records.has(i.id))return;const c={id:i.id,topic:n,request:{method:i.method,params:i.params||null},chainId:o,expiry:En(Te.THIRTY_DAYS)};this.records.set(c.id,c),this.events.emit(Nn.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=xn(n)?{error:n.error}:{result:n.result},this.records.set(i.id,i),this.events.emit(Nn.updated,i))},this.get=async(n,i)=>(this.isInitialized(),this.logger.debug("Getting record"),this.logger.trace({type:"method",method:"get",topic:n,id:i}),await this.getRecord(i)),this.delete=(n,i)=>{this.isInitialized(),this.logger.debug("Deleting record"),this.logger.trace({type:"method",method:"delete",id:i}),this.values.forEach(o=>{if(o.topic===n){if(typeof i<"u"&&o.id!==i)return;this.records.delete(o.id),this.events.emit(Nn.deleted,o)}})},this.exists=async(n,i)=>(this.isInitialized(),this.records.has(i)?(await this.getRecord(i)).topic===n:!1),this.on=(n,i)=>{this.events.on(n,i)},this.once=(n,i)=>{this.events.once(n,i)},this.off=(n,i)=>{this.events.off(n,i)},this.removeListener=(n,i)=>{this.events.removeListener(n,i)},this.logger=pt.generateChildLogger(r,this.name)}get context(){return pt.getLoggerContext(this.logger)}get storageKey(){return this.storagePrefix+this.version+"//"+this.name}get size(){return this.records.size}get keys(){return Array.from(this.records.keys())}get values(){return Array.from(this.records.values())}get pending(){const e=[];return this.values.forEach(r=>{if(typeof r.response<"u")return;const n={topic:r.topic,request:rc(r.request.method,r.request.params,r.id),chainId:r.chainId};return e.push(n)}),e}async setJsonRpcRecords(e){await this.core.storage.setItem(this.storageKey,e)}async getJsonRpcRecords(){return await this.core.storage.getItem(this.storageKey)}getRecord(e){this.isInitialized();const r=this.records.get(e);if(!r){const{message:n}=_e("NO_MATCHING_KEY",`${this.name}: ${e}`);throw new Error(n)}return r}async persist(){await this.setJsonRpcRecords(this.values),this.events.emit(Nn.sync)}async restore(){try{const e=await this.getJsonRpcRecords();if(typeof e>"u"||!e.length)return;if(this.records.size){const{message:r}=_e("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(r),new Error(r)}this.cached=e,this.logger.debug(`Successfully Restored records for ${this.name}`),this.logger.trace({type:"method",method:"restore",records:this.values})}catch(e){this.logger.debug(`Failed to Restore records for ${this.name}`),this.logger.error(e)}}registerEventListeners(){this.events.on(Nn.created,e=>{const r=Nn.created;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,record:e}),this.persist()}),this.events.on(Nn.updated,e=>{const r=Nn.updated;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,record:e}),this.persist()}),this.events.on(Nn.deleted,e=>{const r=Nn.deleted;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,record:e}),this.persist()}),this.core.heartbeat.on(Ps.HEARTBEAT_EVENTS.pulse,()=>{this.cleanup()})}cleanup(){try{this.records.forEach(e=>{Te.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}=_e("NOT_INITIALIZED",this.name);throw new Error(e)}}}class e7 extends S4{constructor(e,r){super(e,r),this.core=e,this.logger=r,this.expirations=new Map,this.events=new br.exports.EventEmitter,this.name=PE,this.version=TE,this.cached=[],this.initialized=!1,this.storagePrefix=di,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(n=>this.expirations.set(n.target,n)),this.cached=[],this.registerEventListeners(),this.initialized=!0)},this.has=n=>{try{const i=this.formatTarget(n);return typeof this.getExpiration(i)<"u"}catch{return!1}},this.set=(n,i)=>{this.isInitialized();const o=this.formatTarget(n),c={target:o,expiry:i};this.expirations.set(o,c),this.checkExpiry(o,c),this.events.emit(on.created,{target:o,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),o=this.getExpiration(i);this.expirations.delete(i),this.events.emit(on.deleted,{target:i,expiration:o})}},this.on=(n,i)=>{this.events.on(n,i)},this.once=(n,i)=>{this.events.once(n,i)},this.off=(n,i)=>{this.events.off(n,i)},this.removeListener=(n,i)=>{this.events.removeListener(n,i)},this.logger=pt.generateChildLogger(r,this.name)}get context(){return pt.getLoggerContext(this.logger)}get storageKey(){return this.storagePrefix+this.version+"//"+this.name}get length(){return this.expirations.size}get keys(){return Array.from(this.expirations.keys())}get values(){return Array.from(this.expirations.values())}formatTarget(e){if(typeof e=="string")return ab(e);if(typeof e=="number")return cb(e);const{message:r}=_e("UNKNOWN_TYPE",`Target type: ${typeof e}`);throw new Error(r)}async setExpirations(e){await this.core.storage.setItem(this.storageKey,e)}async getExpirations(){return await this.core.storage.getItem(this.storageKey)}async persist(){await this.setExpirations(this.values),this.events.emit(on.sync)}async restore(){try{const e=await this.getExpirations();if(typeof e>"u"||!e.length)return;if(this.expirations.size){const{message:r}=_e("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(r),new Error(r)}this.cached=e,this.logger.debug(`Successfully Restored expirations for ${this.name}`),this.logger.trace({type:"method",method:"restore",expirations:this.values})}catch(e){this.logger.debug(`Failed to Restore expirations for ${this.name}`),this.logger.error(e)}}getExpiration(e){const r=this.expirations.get(e);if(!r){const{message:n}=_e("NO_MATCHING_KEY",`${this.name}: ${e}`);throw this.logger.error(n),new Error(n)}return r}checkExpiry(e,r){const{expiry:n}=r;Te.toMiliseconds(n)-Date.now()<=0&&this.expire(e,r)}expire(e,r){this.expirations.delete(e),this.events.emit(on.expired,{target:e,expiration:r})}checkExpirations(){this.core.relayer.connected&&this.expirations.forEach((e,r)=>this.checkExpiry(r,e))}registerEventListeners(){this.core.heartbeat.on(Ps.HEARTBEAT_EVENTS.pulse,()=>this.checkExpirations()),this.events.on(on.created,e=>{const r=on.created;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),this.persist()}),this.events.on(on.expired,e=>{const r=on.expired;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),this.persist()}),this.events.on(on.deleted,e=>{const r=on.deleted;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),this.persist()})}isInitialized(){if(!this.initialized){const{message:e}=_e("NOT_INITIALIZED",this.name);throw new Error(e)}}}class t7 extends A4{constructor(e,r){super(e,r),this.projectId=e,this.logger=r,this.name=uh,this.initialized=!1,this.init=async n=>{$1()||!$u()||(this.verifyUrl=n?.verifyUrl||ng,await this.createIframe())},this.register=async n=>{var i;if(this.initialized||await this.init(),!!this.iframe)try{(i=this.iframe.contentWindow)==null||i.postMessage(n.attestationId,this.verifyUrl),this.logger.info(`postMessage sent: ${n.attestationId} ${this.verifyUrl}`)}catch{}},this.resolve=async n=>{var i;if(this.isDevEnv)return"";this.logger.info(`resolving attestation: ${n.attestationId}`);const o=this.startAbortTimer(Te.FIVE_SECONDS),c=await fetch(`${this.verifyUrl}/attestation/${n.attestationId}`,{signal:this.abortController.signal});return clearTimeout(o),c.status===200?(i=await c.json())==null?void 0:i.origin:""},this.createIframe=async()=>{try{await Promise.race([new Promise((n,i)=>{if(document.getElementById(uh))return n();const o=document.createElement("iframe");o.setAttribute("id",uh),o.setAttribute("src",`${this.verifyUrl}/${this.projectId}`),o.style.display="none",o.addEventListener("load",()=>{this.initialized=!0,n()}),o.addEventListener("error",c=>{i(c)}),document.body.append(o),this.iframe=o}),new Promise(n=>{setTimeout(()=>n("iframe load timeout"),Te.toMiliseconds(Te.ONE_SECOND/2))})])}catch(n){this.logger.error(`Verify iframe failed to load: ${this.verifyUrl}`),this.logger.error(n)}},this.logger=pt.generateChildLogger(r,this.name),this.verifyUrl=ng,this.abortController=new AbortController,this.isDevEnv=Du()&&process.env.IS_VITEST}get context(){return pt.getLoggerContext(this.logger)}startAbortTimer(e){return setTimeout(()=>this.abortController.abort(),Te.toMiliseconds(e))}}var r7=Object.defineProperty,hg=Object.getOwnPropertySymbols,n7=Object.prototype.hasOwnProperty,i7=Object.prototype.propertyIsEnumerable,fg=(t,e,r)=>e in t?r7(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,dg=(t,e)=>{for(var r in e||(e={}))n7.call(e,r)&&fg(t,r,e[r]);if(hg)for(var r of hg(e))i7.call(e,r)&&fg(t,r,e[r]);return t};class fh extends y4{constructor(e){super(e),this.protocol=Xp,this.version=sE,this.name=lh,this.events=new br.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||tg;const r=typeof e?.logger<"u"&&typeof e?.logger!="string"?e.logger:pt.pino(pt.getDefaultLoggerOptions({level:e?.logger||oE.logger}));this.logger=pt.generateChildLogger(r,this.name),this.heartbeat=new Ps.HeartBeat,this.crypto=new RE(this,this.logger,e?.keychain),this.history=new QE(this,this.logger),this.expirer=new e7(this,this.logger),this.storage=e!=null&&e.storage?e.storage:new x6(dg(dg({},aE),e?.storageOptions)),this.relayer=new GE({core:this,logger:this.logger,relayUrl:this.relayUrl,projectId:this.projectId}),this.pairing=new XE(this,this.logger),this.verify=new t7(this.projectId||"",this.logger)}static async init(e){const r=new fh(e);await r.initialize();const n=await r.crypto.getClientId();return await r.storage.setItem(xE,n),r}get context(){return pt.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 s7=fh,pg="wc",gg=2,mg="client",dh=`${pg}@${gg}:${mg}:`,ph={name:mg,logger:"error",controller:!1,relayUrl:"wss://relay.walletconnect.com"},o7="WALLETCONNECT_DEEPLINK_CHOICE",a7="proposal",wg="Proposal expired",c7="session",ac=Te.SEVEN_DAYS,l7="engine",zo={wc_sessionPropose:{req:{ttl:Te.FIVE_MINUTES,prompt:!0,tag:1100},res:{ttl:Te.FIVE_MINUTES,prompt:!1,tag:1101}},wc_sessionSettle:{req:{ttl:Te.FIVE_MINUTES,prompt:!1,tag:1102},res:{ttl:Te.FIVE_MINUTES,prompt:!1,tag:1103}},wc_sessionUpdate:{req:{ttl:Te.ONE_DAY,prompt:!1,tag:1104},res:{ttl:Te.ONE_DAY,prompt:!1,tag:1105}},wc_sessionExtend:{req:{ttl:Te.ONE_DAY,prompt:!1,tag:1106},res:{ttl:Te.ONE_DAY,prompt:!1,tag:1107}},wc_sessionRequest:{req:{ttl:Te.FIVE_MINUTES,prompt:!0,tag:1108},res:{ttl:Te.FIVE_MINUTES,prompt:!1,tag:1109}},wc_sessionEvent:{req:{ttl:Te.FIVE_MINUTES,prompt:!0,tag:1110},res:{ttl:Te.FIVE_MINUTES,prompt:!1,tag:1111}},wc_sessionDelete:{req:{ttl:Te.ONE_DAY,prompt:!1,tag:1112},res:{ttl:Te.ONE_DAY,prompt:!1,tag:1113}},wc_sessionPing:{req:{ttl:Te.THIRTY_SECONDS,prompt:!1,tag:1114},res:{ttl:Te.THIRTY_SECONDS,prompt:!1,tag:1115}}},gh={min:Te.FIVE_MINUTES,max:Te.SEVEN_DAYS},u7="request",h7=["wc_sessionPropose","wc_sessionRequest","wc_authRequest"];var f7=Object.defineProperty,d7=Object.defineProperties,p7=Object.getOwnPropertyDescriptors,vg=Object.getOwnPropertySymbols,g7=Object.prototype.hasOwnProperty,m7=Object.prototype.propertyIsEnumerable,yg=(t,e,r)=>e in t?f7(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,an=(t,e)=>{for(var r in e||(e={}))g7.call(e,r)&&yg(t,r,e[r]);if(vg)for(var r of vg(e))m7.call(e,r)&&yg(t,r,e[r]);return t},mh=(t,e)=>d7(t,p7(e));class w7 extends D4{constructor(e){super(e),this.name=l7,this.events=new br.exports,this.initialized=!1,this.ignoredPayloadTypes=[ki],this.init=async()=>{this.initialized||(await this.cleanup(),this.registerRelayerEvents(),this.registerExpirerEvents(),this.client.core.pairing.register({methods:Object.keys(zo)}),this.initialized=!0)},this.connect=async r=>{this.isInitialized();const n=mh(an({},r),{requiredNamespaces:r.requiredNamespaces||{},optionalNamespaces:r.optionalNamespaces||{}});await this.isValidConnect(n);const{pairingTopic:i,requiredNamespaces:o,optionalNamespaces:c,sessionProperties:l,relays:h}=n;let f=i,v,E=!1;if(f&&(E=this.client.core.pairing.pairings.get(f).active),!f||!E){const{topic:L,uri:$}=await this.client.core.pairing.create();f=L,v=$}const _=await this.client.core.crypto.generateKeyPair(),S=an({requiredNamespaces:o,optionalNamespaces:c,relays:h??[{protocol:eg}],proposer:{publicKey:_,metadata:this.client.metadata}},l&&{sessionProperties:l}),{reject:P,resolve:j,done:H}=As(Te.FIVE_MINUTES,wg);if(this.events.once(rr("session_connect"),async({error:L,session:$})=>{if(L)P(L);else if($){$.self.publicKey=_;const T=mh(an({},$),{requiredNamespaces:$.requiredNamespaces,optionalNamespaces:$.optionalNamespaces});await this.client.session.set($.topic,T),await this.setExpiry($.topic,$.expiry),f&&await this.client.core.pairing.updateMetadata({topic:f,metadata:$.peer.metadata}),j(T)}}),!f){const{message:L}=_e("NO_MATCHING_KEY",`connect() pairing topic: ${f}`);throw new Error(L)}const Z=await this.sendRequest(f,"wc_sessionPropose",S),R=En(Te.FIVE_MINUTES);return await this.setProposal(Z,an({id:Z,expiry:R},S)),{uri:v,approval:H}},this.pair=async r=>(this.isInitialized(),await this.client.core.pairing.pair(r)),this.approve=async r=>{this.isInitialized(),await this.isValidApprove(r);const{id:n,relayProtocol:i,namespaces:o,sessionProperties:c}=r,l=this.client.proposal.get(n);let{pairingTopic:h,proposer:f,requiredNamespaces:v,optionalNamespaces:E}=l;h=h||"",Ds(v)||(v=xb(o,"approve()"));const _=await this.client.core.crypto.generateKeyPair(),S=f.publicKey,P=await this.client.core.crypto.generateSharedKey(_,S);h&&n&&(await this.client.core.pairing.updateMetadata({topic:h,metadata:f.metadata}),await this.sendResult(n,h,{relay:{protocol:i??"irn"},responderPublicKey:_}),await this.client.proposal.delete(n,Yt("USER_DISCONNECTED")),await this.client.core.pairing.activate({topic:h}));const j=an({relay:{protocol:i??"irn"},namespaces:o,requiredNamespaces:v,optionalNamespaces:E,pairingTopic:h,controller:{publicKey:_,metadata:this.client.metadata},expiry:En(ac)},c&&{sessionProperties:c});await this.client.core.relayer.subscribe(P),await this.sendRequest(P,"wc_sessionSettle",j);const H=mh(an({},j),{topic:P,pairingTopic:h,acknowledged:!1,self:j.controller,peer:{publicKey:f.publicKey,metadata:f.metadata},controller:_});return await this.client.session.set(P,H),await this.setExpiry(P,En(ac)),{topic:P,acknowledged:()=>new Promise(Z=>setTimeout(()=>Z(this.client.session.get(P)),500))}},this.reject=async r=>{this.isInitialized(),await this.isValidReject(r);const{id:n,reason:i}=r,{pairingTopic:o}=this.client.proposal.get(n);o&&(await this.sendError(n,o,i),await this.client.proposal.delete(n,Yt("USER_DISCONNECTED")))},this.update=async r=>{this.isInitialized(),await this.isValidUpdate(r);const{topic:n,namespaces:i}=r,o=await this.sendRequest(n,"wc_sessionUpdate",{namespaces:i}),{done:c,resolve:l,reject:h}=As();return this.events.once(rr("session_update",o),({error:f})=>{f?h(f):l()}),await this.client.session.update(n,{namespaces:i}),{acknowledged:c}},this.extend=async r=>{this.isInitialized(),await this.isValidExtend(r);const{topic:n}=r,i=await this.sendRequest(n,"wc_sessionExtend",{}),{done:o,resolve:c,reject:l}=As();return this.events.once(rr("session_extend",i),({error:h})=>{h?l(h):c()}),await this.setExpiry(n,En(ac)),{acknowledged:o}},this.request=async r=>{this.isInitialized(),await this.isValidRequest(r);const{chainId:n,request:i,topic:o,expiry:c}=r,l=await this.sendRequest(o,"wc_sessionRequest",{request:i,chainId:n},c),{done:h,resolve:f,reject:v}=As(c);this.events.once(rr("session_request",l),({error:_,result:S})=>{_?v(_):f(S)}),this.client.events.emit("session_request_sent",{topic:o,request:i,chainId:n,id:l});const E=await this.client.core.storage.getItem(o7);return lb({id:l,topic:o,wcDeepLink:E}),await h()},this.respond=async r=>{this.isInitialized(),await this.isValidRespond(r);const{topic:n,response:i}=r,{id:o}=i;Vn(i)?await this.sendResult(o,n,i.result):xn(i)&&await this.sendError(o,n,i.error),this.deletePendingSessionRequest(r.response.id,{message:"fulfilled",code:0})},this.ping=async r=>{this.isInitialized(),await this.isValidPing(r);const{topic:n}=r;if(this.client.session.keys.includes(n)){const i=await this.sendRequest(n,"wc_sessionPing",{}),{done:o,resolve:c,reject:l}=As();this.events.once(rr("session_ping",i),({error:h})=>{h?l(h):c()}),await o()}else this.client.core.pairing.pairings.keys.includes(n)&&await this.client.core.pairing.ping({topic:n})},this.emit=async r=>{this.isInitialized(),await this.isValidEmit(r);const{topic:n,event:i,chainId:o}=r;await this.sendRequest(n,"wc_sessionEvent",{event:i,chainId:o})},this.disconnect=async r=>{this.isInitialized(),await this.isValidDisconnect(r);const{topic:n}=r;if(this.client.session.keys.includes(n)){const i=rh().toString();let o;const c=l=>{l?.id.toString()===i&&(this.client.core.relayer.events.removeListener(kt.message_ack,c),o())};await Promise.all([new Promise(l=>{o=l,this.client.core.relayer.on(kt.message_ack,c)}),this.sendRequest(n,"wc_sessionDelete",Yt("USER_DISCONNECTED"),void 0,i)]),await this.deleteSession(n)}else await this.client.core.pairing.disconnect({topic:n})},this.find=r=>(this.isInitialized(),this.client.session.getAll().filter(n=>Sb(n,r))),this.getPendingSessionRequests=()=>(this.isInitialized(),this.client.pendingRequest.getAll()),this.cleanupDuplicatePairings=async r=>{if(r.pairingTopic)try{const n=this.client.core.pairing.pairings.get(r.pairingTopic),i=this.client.core.pairing.pairings.getAll().filter(o=>{var c,l;return((c=o.peerMetadata)==null?void 0:c.url)&&((l=o.peerMetadata)==null?void 0:l.url)===r.peer.metadata.url&&o.topic&&o.topic!==n.topic});if(i.length===0)return;this.client.logger.info(`Cleaning up ${i.length} duplicate pairing(s)`),await Promise.all(i.map(o=>this.client.core.pairing.disconnect({topic:o.topic}))),this.client.logger.info("Duplicate pairings clean up finished")}catch(n){this.client.logger.error(n)}},this.deleteSession=async(r,n)=>{const{self:i}=this.client.session.get(r);await this.client.core.relayer.unsubscribe(r),this.client.session.delete(r,Yt("USER_DISCONNECTED")),this.client.core.crypto.keychain.has(i.publicKey)&&await this.client.core.crypto.deleteKeyPair(i.publicKey),this.client.core.crypto.keychain.has(r)&&await this.client.core.crypto.deleteSymKey(r),n||this.client.core.expirer.del(r)},this.deleteProposal=async(r,n)=>{await Promise.all([this.client.proposal.delete(r,Yt("USER_DISCONNECTED")),n?Promise.resolve():this.client.core.expirer.del(r)])},this.deletePendingSessionRequest=async(r,n,i=!1)=>{await Promise.all([this.client.pendingRequest.delete(r,n),i?Promise.resolve():this.client.core.expirer.del(r)])},this.setExpiry=async(r,n)=>{this.client.session.keys.includes(r)&&await this.client.session.update(r,{expiry:n}),this.client.core.expirer.set(r,n)},this.setProposal=async(r,n)=>{await this.client.proposal.set(r,n),this.client.core.expirer.set(r,n.expiry)},this.setPendingSessionRequest=async r=>{const n=zo.wc_sessionRequest.req.ttl,{id:i,topic:o,params:c}=r;await this.client.pendingRequest.set(i,{id:i,topic:o,params:c}),n&&this.client.core.expirer.set(i,En(n))},this.sendRequest=async(r,n,i,o,c)=>{const l=rc(n,i);if($u()&&h7.includes(n)){const v=Ss(JSON.stringify(l));await this.client.core.verify.register({attestationId:v})}const h=await this.client.core.crypto.encode(r,l),f=zo[n].req;return o&&(f.ttl=o),c&&(f.id=c),this.client.core.history.set(r,l),this.client.core.relayer.publish(r,h,f),l.id},this.sendResult=async(r,n,i)=>{const o=nh(r,i),c=await this.client.core.crypto.encode(n,o),l=await this.client.core.history.get(n,r),h=zo[l.request.method].res;this.client.core.relayer.publish(n,c,h),await this.client.core.history.resolve(o)},this.sendError=async(r,n,i)=>{const o=nc(r,i),c=await this.client.core.crypto.encode(n,o),l=await this.client.core.history.get(n,r),h=zo[l.request.method].res;this.client.core.relayer.publish(n,c,h),await this.client.core.history.resolve(o)},this.cleanup=async()=>{const r=[],n=[];this.client.session.getAll().forEach(i=>{hi(i.expiry)&&r.push(i.topic)}),this.client.proposal.getAll().forEach(i=>{hi(i.expiry)&&n.push(i.id)}),await Promise.all([...r.map(i=>this.deleteSession(i)),...n.map(i=>this.deleteProposal(i))])},this.onRelayEventRequest=r=>{const{topic:n,payload:i}=r,o=i.method;switch(o){case"wc_sessionPropose":return this.onSessionProposeRequest(n,i);case"wc_sessionSettle":return this.onSessionSettleRequest(n,i);case"wc_sessionUpdate":return this.onSessionUpdateRequest(n,i);case"wc_sessionExtend":return this.onSessionExtendRequest(n,i);case"wc_sessionPing":return this.onSessionPingRequest(n,i);case"wc_sessionDelete":return this.onSessionDeleteRequest(n,i);case"wc_sessionRequest":return this.onSessionRequest(n,i);case"wc_sessionEvent":return this.onSessionEventRequest(n,i);default:return this.client.logger.info(`Unsupported request method ${o}`)}},this.onRelayEventResponse=async r=>{const{topic:n,payload:i}=r,o=(await this.client.core.history.get(n,i.id)).request.method;switch(o){case"wc_sessionPropose":return this.onSessionProposeResponse(n,i);case"wc_sessionSettle":return this.onSessionSettleResponse(n,i);case"wc_sessionUpdate":return this.onSessionUpdateResponse(n,i);case"wc_sessionExtend":return this.onSessionExtendResponse(n,i);case"wc_sessionPing":return this.onSessionPingResponse(n,i);case"wc_sessionRequest":return this.onSessionRequestResponse(n,i);default:return this.client.logger.info(`Unsupported response method ${o}`)}},this.onRelayEventUnknownPayload=r=>{const{topic:n}=r,{message:i}=_e("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(r,n)=>{const{params:i,id:o}=n;try{this.isValidConnect(an({},n.params));const c=En(Te.FIVE_MINUTES),l=an({id:o,pairingTopic:r,expiry:c},i);await this.setProposal(o,l);const h=Ss(JSON.stringify(n)),f=await this.getVerifyContext(h,l.proposer.metadata);this.client.events.emit("session_proposal",{id:o,params:l,verifyContext:f})}catch(c){await this.sendError(o,r,c),this.client.logger.error(c)}},this.onSessionProposeResponse=async(r,n)=>{const{id:i}=n;if(Vn(n)){const{result:o}=n;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",result:o});const c=this.client.proposal.get(i);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",proposal:c});const l=c.proposer.publicKey;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",selfPublicKey:l});const h=o.responderPublicKey;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",peerPublicKey:h});const f=await this.client.core.crypto.generateSharedKey(l,h);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",sessionTopic:f});const v=await this.client.core.relayer.subscribe(f);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",subscriptionId:v}),await this.client.core.pairing.activate({topic:r})}else xn(n)&&(await this.client.proposal.delete(i,Yt("USER_DISCONNECTED")),this.events.emit(rr("session_connect"),{error:n.error}))},this.onSessionSettleRequest=async(r,n)=>{const{id:i,params:o}=n;try{this.isValidSessionSettleRequest(o);const{relay:c,controller:l,expiry:h,namespaces:f,requiredNamespaces:v,optionalNamespaces:E,sessionProperties:_,pairingTopic:S}=n.params,P=an({topic:r,relay:c,expiry:h,namespaces:f,acknowledged:!0,pairingTopic:S,requiredNamespaces:v,optionalNamespaces:E,controller:l.publicKey,self:{publicKey:"",metadata:this.client.metadata},peer:{publicKey:l.publicKey,metadata:l.metadata}},_&&{sessionProperties:_});await this.sendResult(n.id,r,!0),this.events.emit(rr("session_connect"),{session:P}),this.cleanupDuplicatePairings(P)}catch(c){await this.sendError(i,r,c),this.client.logger.error(c)}},this.onSessionSettleResponse=async(r,n)=>{const{id:i}=n;Vn(n)?(await this.client.session.update(r,{acknowledged:!0}),this.events.emit(rr("session_approve",i),{})):xn(n)&&(await this.client.session.delete(r,Yt("USER_DISCONNECTED")),this.events.emit(rr("session_approve",i),{error:n.error}))},this.onSessionUpdateRequest=async(r,n)=>{const{params:i,id:o}=n;try{this.isValidUpdate(an({topic:r},i)),await this.client.session.update(r,{namespaces:i.namespaces}),await this.sendResult(o,r,!0),this.client.events.emit("session_update",{id:o,topic:r,params:i})}catch(c){await this.sendError(o,r,c),this.client.logger.error(c)}},this.onSessionUpdateResponse=(r,n)=>{const{id:i}=n;Vn(n)?this.events.emit(rr("session_update",i),{}):xn(n)&&this.events.emit(rr("session_update",i),{error:n.error})},this.onSessionExtendRequest=async(r,n)=>{const{id:i}=n;try{this.isValidExtend({topic:r}),await this.setExpiry(r,En(ac)),await this.sendResult(i,r,!0),this.client.events.emit("session_extend",{id:i,topic:r})}catch(o){await this.sendError(i,r,o),this.client.logger.error(o)}},this.onSessionExtendResponse=(r,n)=>{const{id:i}=n;Vn(n)?this.events.emit(rr("session_extend",i),{}):xn(n)&&this.events.emit(rr("session_extend",i),{error:n.error})},this.onSessionPingRequest=async(r,n)=>{const{id:i}=n;try{this.isValidPing({topic:r}),await this.sendResult(i,r,!0),this.client.events.emit("session_ping",{id:i,topic:r})}catch(o){await this.sendError(i,r,o),this.client.logger.error(o)}},this.onSessionPingResponse=(r,n)=>{const{id:i}=n;setTimeout(()=>{Vn(n)?this.events.emit(rr("session_ping",i),{}):xn(n)&&this.events.emit(rr("session_ping",i),{error:n.error})},500)},this.onSessionDeleteRequest=async(r,n)=>{const{id:i}=n;try{this.isValidDisconnect({topic:r,reason:n.params}),await Promise.all([new Promise(o=>{this.client.core.relayer.once(kt.publish,async()=>{o(await this.deleteSession(r))})}),this.sendResult(i,r,!0)]),this.client.events.emit("session_delete",{id:i,topic:r})}catch(o){this.client.logger.error(o)}},this.onSessionRequest=async(r,n)=>{const{id:i,params:o}=n;try{this.isValidRequest(an({topic:r},o)),await this.setPendingSessionRequest({id:i,topic:r,params:o});const c=Ss(JSON.stringify(n)),l=this.client.session.get(r),h=await this.getVerifyContext(c,l.peer.metadata);this.client.events.emit("session_request",{id:i,topic:r,params:o,verifyContext:h})}catch(c){await this.sendError(i,r,c),this.client.logger.error(c)}},this.onSessionRequestResponse=(r,n)=>{const{id:i}=n;Vn(n)?this.events.emit(rr("session_request",i),{result:n.result}):xn(n)&&this.events.emit(rr("session_request",i),{error:n.error})},this.onSessionEventRequest=async(r,n)=>{const{id:i,params:o}=n;try{this.isValidEmit(an({topic:r},o)),this.client.events.emit("session_event",{id:i,topic:r,params:o})}catch(c){await this.sendError(i,r,c),this.client.logger.error(c)}},this.isValidConnect=async r=>{if(!zr(r)){const{message:h}=_e("MISSING_OR_INVALID",`connect() params: ${JSON.stringify(r)}`);throw new Error(h)}const{pairingTopic:n,requiredNamespaces:i,optionalNamespaces:o,sessionProperties:c,relays:l}=r;if(Pr(n)||await this.isValidPairingTopic(n),!jb(l,!0)){const{message:h}=_e("MISSING_OR_INVALID",`connect() relays: ${l}`);throw new Error(h)}!Pr(i)&&Ds(i)!==0&&this.validateNamespaces(i,"requiredNamespaces"),!Pr(o)&&Ds(o)!==0&&this.validateNamespaces(o,"optionalNamespaces"),Pr(c)||this.validateSessionProps(c,"sessionProperties")},this.validateNamespaces=(r,n)=>{const i=Ub(r,"connect()",n);if(i)throw new Error(i.message)},this.isValidApprove=async r=>{if(!zr(r))throw new Error(_e("MISSING_OR_INVALID",`approve() params: ${r}`).message);const{id:n,namespaces:i,relayProtocol:o,sessionProperties:c}=r;await this.isValidProposalId(n);const l=this.client.proposal.get(n),h=Xa(i,"approve()");if(h)throw new Error(h.message);const f=k1(l.requiredNamespaces,i,"approve()");if(f)throw new Error(f.message);if(!gr(o,!0)){const{message:v}=_e("MISSING_OR_INVALID",`approve() relayProtocol: ${o}`);throw new Error(v)}Pr(c)||this.validateSessionProps(c,"sessionProperties")},this.isValidReject=async r=>{if(!zr(r)){const{message:o}=_e("MISSING_OR_INVALID",`reject() params: ${r}`);throw new Error(o)}const{id:n,reason:i}=r;if(await this.isValidProposalId(n),!Bb(i)){const{message:o}=_e("MISSING_OR_INVALID",`reject() reason: ${JSON.stringify(i)}`);throw new Error(o)}},this.isValidSessionSettleRequest=r=>{if(!zr(r)){const{message:f}=_e("MISSING_OR_INVALID",`onSessionSettleRequest() params: ${r}`);throw new Error(f)}const{relay:n,controller:i,namespaces:o,expiry:c}=r;if(!F1(n)){const{message:f}=_e("MISSING_OR_INVALID","onSessionSettleRequest() relay protocol should be a string");throw new Error(f)}const l=Pb(i,"onSessionSettleRequest()");if(l)throw new Error(l.message);const h=Xa(o,"onSessionSettleRequest()");if(h)throw new Error(h.message);if(hi(c)){const{message:f}=_e("EXPIRED","onSessionSettleRequest()");throw new Error(f)}},this.isValidUpdate=async r=>{if(!zr(r)){const{message:h}=_e("MISSING_OR_INVALID",`update() params: ${r}`);throw new Error(h)}const{topic:n,namespaces:i}=r;await this.isValidSessionTopic(n);const o=this.client.session.get(n),c=Xa(i,"update()");if(c)throw new Error(c.message);const l=k1(o.requiredNamespaces,i,"update()");if(l)throw new Error(l.message)},this.isValidExtend=async r=>{if(!zr(r)){const{message:i}=_e("MISSING_OR_INVALID",`extend() params: ${r}`);throw new Error(i)}const{topic:n}=r;await this.isValidSessionTopic(n)},this.isValidRequest=async r=>{if(!zr(r)){const{message:h}=_e("MISSING_OR_INVALID",`request() params: ${r}`);throw new Error(h)}const{topic:n,request:i,chainId:o,expiry:c}=r;await this.isValidSessionTopic(n);const{namespaces:l}=this.client.session.get(n);if(!B1(l,o)){const{message:h}=_e("MISSING_OR_INVALID",`request() chainId: ${o}`);throw new Error(h)}if(!kb(i)){const{message:h}=_e("MISSING_OR_INVALID",`request() ${JSON.stringify(i)}`);throw new Error(h)}if(!Wb(l,o,i.method)){const{message:h}=_e("MISSING_OR_INVALID",`request() method: ${i.method}`);throw new Error(h)}if(c&&!Gb(c,gh)){const{message:h}=_e("MISSING_OR_INVALID",`request() expiry: ${c}. Expiry must be a number (in seconds) between ${gh.min} and ${gh.max}`);throw new Error(h)}},this.isValidRespond=async r=>{if(!zr(r)){const{message:o}=_e("MISSING_OR_INVALID",`respond() params: ${r}`);throw new Error(o)}const{topic:n,response:i}=r;if(await this.isValidSessionTopic(n),!Hb(i)){const{message:o}=_e("MISSING_OR_INVALID",`respond() response: ${JSON.stringify(i)}`);throw new Error(o)}},this.isValidPing=async r=>{if(!zr(r)){const{message:i}=_e("MISSING_OR_INVALID",`ping() params: ${r}`);throw new Error(i)}const{topic:n}=r;await this.isValidSessionOrPairingTopic(n)},this.isValidEmit=async r=>{if(!zr(r)){const{message:l}=_e("MISSING_OR_INVALID",`emit() params: ${r}`);throw new Error(l)}const{topic:n,event:i,chainId:o}=r;await this.isValidSessionTopic(n);const{namespaces:c}=this.client.session.get(n);if(!B1(c,o)){const{message:l}=_e("MISSING_OR_INVALID",`emit() chainId: ${o}`);throw new Error(l)}if(!zb(i)){const{message:l}=_e("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(i)}`);throw new Error(l)}if(!qb(c,o,i.name)){const{message:l}=_e("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(i)}`);throw new Error(l)}},this.isValidDisconnect=async r=>{if(!zr(r)){const{message:i}=_e("MISSING_OR_INVALID",`disconnect() params: ${r}`);throw new Error(i)}const{topic:n}=r;await this.isValidSessionOrPairingTopic(n)},this.getVerifyContext=async(r,n)=>{const i={verified:{verifyUrl:n.verifyUrl||"",validation:"UNKNOWN",origin:n.url||""}};try{const o=await this.client.core.verify.resolve({attestationId:r,verifyUrl:n.verifyUrl});o&&(i.verified.origin=o,i.verified.validation=o===n.url?"VALID":"INVALID")}catch(o){this.client.logger.error(o)}return this.client.logger.info(`Verify context: ${JSON.stringify(i)}`),i},this.validateSessionProps=(r,n)=>{Object.values(r).forEach(i=>{if(!gr(i,!1)){const{message:o}=_e("MISSING_OR_INVALID",`${n} must be in Record<string, string> format. Received: ${JSON.stringify(i)}`);throw new Error(o)}})}}isInitialized(){if(!this.initialized){const{message:e}=_e("NOT_INITIALIZED",this.name);throw new Error(e)}}registerRelayerEvents(){this.client.core.relayer.on(kt.message,async e=>{const{topic:r,message:n}=e;if(this.ignoredPayloadTypes.includes(this.client.core.crypto.getPayloadType(n)))return;const i=await this.client.core.crypto.decode(r,n);ih(i)?(this.client.core.history.set(r,i),this.onRelayEventRequest({topic:r,payload:i})):ic(i)?(await this.client.core.history.resolve(i),await this.onRelayEventResponse({topic:r,payload:i}),this.client.core.history.delete(r,i.id)):this.onRelayEventUnknownPayload({topic:r,payload:i})})}registerExpirerEvents(){this.client.core.expirer.on(on.expired,async e=>{const{topic:r,id:n}=R1(e.target);if(n&&this.client.pendingRequest.keys.includes(n))return await this.deletePendingSessionRequest(n,_e("EXPIRED"),!0);r?this.client.session.keys.includes(r)&&(await this.deleteSession(r,!0),this.client.events.emit("session_expire",{topic:r})):n&&(await this.deleteProposal(n,!0),this.client.events.emit("proposal_expire",{id:n}))})}isValidPairingTopic(e){if(!gr(e,!1)){const{message:r}=_e("MISSING_OR_INVALID",`pairing topic should be a string: ${e}`);throw new Error(r)}if(!this.client.core.pairing.pairings.keys.includes(e)){const{message:r}=_e("NO_MATCHING_KEY",`pairing topic doesn't exist: ${e}`);throw new Error(r)}if(hi(this.client.core.pairing.pairings.get(e).expiry)){const{message:r}=_e("EXPIRED",`pairing topic: ${e}`);throw new Error(r)}}async isValidSessionTopic(e){if(!gr(e,!1)){const{message:r}=_e("MISSING_OR_INVALID",`session topic should be a string: ${e}`);throw new Error(r)}if(!this.client.session.keys.includes(e)){const{message:r}=_e("NO_MATCHING_KEY",`session topic doesn't exist: ${e}`);throw new Error(r)}if(hi(this.client.session.get(e).expiry)){await this.deleteSession(e);const{message:r}=_e("EXPIRED",`session topic: ${e}`);throw new Error(r)}}async isValidSessionOrPairingTopic(e){if(this.client.session.keys.includes(e))await this.isValidSessionTopic(e);else if(this.client.core.pairing.pairings.keys.includes(e))this.isValidPairingTopic(e);else if(gr(e,!1)){const{message:r}=_e("NO_MATCHING_KEY",`session or pairing topic doesn't exist: ${e}`);throw new Error(r)}else{const{message:r}=_e("MISSING_OR_INVALID",`session or pairing topic should be a string: ${e}`);throw new Error(r)}}async isValidProposalId(e){if(!Fb(e)){const{message:r}=_e("MISSING_OR_INVALID",`proposal id should be a number: ${e}`);throw new Error(r)}if(!this.client.proposal.keys.includes(e)){const{message:r}=_e("NO_MATCHING_KEY",`proposal id doesn't exist: ${e}`);throw new Error(r)}if(hi(this.client.proposal.get(e).expiry)){await this.deleteProposal(e);const{message:r}=_e("EXPIRED",`proposal id: ${e}`);throw new Error(r)}}}class v7 extends oc{constructor(e,r){super(e,r,a7,dh),this.core=e,this.logger=r}}class y7 extends oc{constructor(e,r){super(e,r,c7,dh),this.core=e,this.logger=r}}class b7 extends oc{constructor(e,r){super(e,r,u7,dh,n=>n.id),this.core=e,this.logger=r}}class wh extends O4{constructor(e){super(e),this.protocol=pg,this.version=gg,this.name=ph.name,this.events=new br.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||ph.name,this.metadata=e?.metadata||rb();const r=typeof e?.logger<"u"&&typeof e?.logger!="string"?e.logger:pt.pino(pt.getDefaultLoggerOptions({level:e?.logger||ph.logger}));this.core=e?.core||new s7(e),this.logger=pt.generateChildLogger(r,this.name),this.session=new y7(this.core,this.logger),this.proposal=new v7(this.core,this.logger),this.pendingRequest=new b7(this.core,this.logger),this.engine=new w7(this)}static async init(e){const r=new wh(e);return await r.initialize(),r}get context(){return pt.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 vh={exports:{}};(function(t,e){var r=typeof self<"u"?self:pr,n=function(){function o(){this.fetch=!1,this.DOMException=r.DOMException}return o.prototype=r,new o}();(function(o){(function(c){var l={searchParams:"URLSearchParams"in o,iterable:"Symbol"in o&&"iterator"in Symbol,blob:"FileReader"in o&&"Blob"in o&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in o,arrayBuffer:"ArrayBuffer"in o};function h(A){return A&&DataView.prototype.isPrototypeOf(A)}if(l.arrayBuffer)var f=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],v=ArrayBuffer.isView||function(A){return A&&f.indexOf(Object.prototype.toString.call(A))>-1};function E(A){if(typeof A!="string"&&(A=String(A)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(A))throw new TypeError("Invalid character in header field name");return A.toLowerCase()}function _(A){return typeof A!="string"&&(A=String(A)),A}function S(A){var U={next:function(){var ce=A.shift();return{done:ce===void 0,value:ce}}};return l.iterable&&(U[Symbol.iterator]=function(){return U}),U}function P(A){this.map={},A instanceof P?A.forEach(function(U,ce){this.append(ce,U)},this):Array.isArray(A)?A.forEach(function(U){this.append(U[0],U[1])},this):A&&Object.getOwnPropertyNames(A).forEach(function(U){this.append(U,A[U])},this)}P.prototype.append=function(A,U){A=E(A),U=_(U);var ce=this.map[A];this.map[A]=ce?ce+", "+U:U},P.prototype.delete=function(A){delete this.map[E(A)]},P.prototype.get=function(A){return A=E(A),this.has(A)?this.map[A]:null},P.prototype.has=function(A){return this.map.hasOwnProperty(E(A))},P.prototype.set=function(A,U){this.map[E(A)]=_(U)},P.prototype.forEach=function(A,U){for(var ce in this.map)this.map.hasOwnProperty(ce)&&A.call(U,this.map[ce],ce,this)},P.prototype.keys=function(){var A=[];return this.forEach(function(U,ce){A.push(ce)}),S(A)},P.prototype.values=function(){var A=[];return this.forEach(function(U){A.push(U)}),S(A)},P.prototype.entries=function(){var A=[];return this.forEach(function(U,ce){A.push([ce,U])}),S(A)},l.iterable&&(P.prototype[Symbol.iterator]=P.prototype.entries);function j(A){if(A.bodyUsed)return Promise.reject(new TypeError("Already read"));A.bodyUsed=!0}function H(A){return new Promise(function(U,ce){A.onload=function(){U(A.result)},A.onerror=function(){ce(A.error)}})}function Z(A){var U=new FileReader,ce=H(U);return U.readAsArrayBuffer(A),ce}function R(A){var U=new FileReader,ce=H(U);return U.readAsText(A),ce}function L(A){for(var U=new Uint8Array(A),ce=new Array(U.length),le=0;le<U.length;le++)ce[le]=String.fromCharCode(U[le]);return ce.join("")}function $(A){if(A.slice)return A.slice(0);var U=new Uint8Array(A.byteLength);return U.set(new Uint8Array(A)),U.buffer}function T(){return this.bodyUsed=!1,this._initBody=function(A){this._bodyInit=A,A?typeof A=="string"?this._bodyText=A:l.blob&&Blob.prototype.isPrototypeOf(A)?this._bodyBlob=A:l.formData&&FormData.prototype.isPrototypeOf(A)?this._bodyFormData=A:l.searchParams&&URLSearchParams.prototype.isPrototypeOf(A)?this._bodyText=A.toString():l.arrayBuffer&&l.blob&&h(A)?(this._bodyArrayBuffer=$(A.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):l.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(A)||v(A))?this._bodyArrayBuffer=$(A):this._bodyText=A=Object.prototype.toString.call(A):this._bodyText="",this.headers.get("content-type")||(typeof A=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):l.searchParams&&URLSearchParams.prototype.isPrototypeOf(A)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},l.blob&&(this.blob=function(){var A=j(this);if(A)return A;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?j(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(Z)}),this.text=function(){var A=j(this);if(A)return A;if(this._bodyBlob)return R(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(L(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},l.formData&&(this.formData=function(){return this.text().then(J)}),this.json=function(){return this.text().then(JSON.parse)},this}var I=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function d(A){var U=A.toUpperCase();return I.indexOf(U)>-1?U:A}function x(A,U){U=U||{};var ce=U.body;if(A instanceof x){if(A.bodyUsed)throw new TypeError("Already read");this.url=A.url,this.credentials=A.credentials,U.headers||(this.headers=new P(A.headers)),this.method=A.method,this.mode=A.mode,this.signal=A.signal,!ce&&A._bodyInit!=null&&(ce=A._bodyInit,A.bodyUsed=!0)}else this.url=String(A);if(this.credentials=U.credentials||this.credentials||"same-origin",(U.headers||!this.headers)&&(this.headers=new P(U.headers)),this.method=d(U.method||this.method||"GET"),this.mode=U.mode||this.mode||null,this.signal=U.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&ce)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(ce)}x.prototype.clone=function(){return new x(this,{body:this._bodyInit})};function J(A){var U=new FormData;return A.trim().split("&").forEach(function(ce){if(ce){var le=ce.split("="),re=le.shift().replace(/\+/g," "),ne=le.join("=").replace(/\+/g," ");U.append(decodeURIComponent(re),decodeURIComponent(ne))}}),U}function z(A){var U=new P,ce=A.replace(/\r?\n[\t ]+/g," ");return ce.split(/\r?\n/).forEach(function(le){var re=le.split(":"),ne=re.shift().trim();if(ne){var ae=re.join(":").trim();U.append(ne,ae)}}),U}T.call(x.prototype);function ee(A,U){U||(U={}),this.type="default",this.status=U.status===void 0?200:U.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in U?U.statusText:"OK",this.headers=new P(U.headers),this.url=U.url||"",this._initBody(A)}T.call(ee.prototype),ee.prototype.clone=function(){return new ee(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new P(this.headers),url:this.url})},ee.error=function(){var A=new ee(null,{status:0,statusText:""});return A.type="error",A};var de=[301,302,303,307,308];ee.redirect=function(A,U){if(de.indexOf(U)===-1)throw new RangeError("Invalid status code");return new ee(null,{status:U,headers:{location:A}})},c.DOMException=o.DOMException;try{new c.DOMException}catch{c.DOMException=function(U,ce){this.message=U,this.name=ce;var le=Error(U);this.stack=le.stack},c.DOMException.prototype=Object.create(Error.prototype),c.DOMException.prototype.constructor=c.DOMException}function me(A,U){return new Promise(function(ce,le){var re=new x(A,U);if(re.signal&&re.signal.aborted)return le(new c.DOMException("Aborted","AbortError"));var ne=new XMLHttpRequest;function ae(){ne.abort()}ne.onload=function(){var ie={status:ne.status,statusText:ne.statusText,headers:z(ne.getAllResponseHeaders()||"")};ie.url="responseURL"in ne?ne.responseURL:ie.headers.get("X-Request-URL");var Oe="response"in ne?ne.response:ne.responseText;ce(new ee(Oe,ie))},ne.onerror=function(){le(new TypeError("Network request failed"))},ne.ontimeout=function(){le(new TypeError("Network request failed"))},ne.onabort=function(){le(new c.DOMException("Aborted","AbortError"))},ne.open(re.method,re.url,!0),re.credentials==="include"?ne.withCredentials=!0:re.credentials==="omit"&&(ne.withCredentials=!1),"responseType"in ne&&l.blob&&(ne.responseType="blob"),re.headers.forEach(function(ie,Oe){ne.setRequestHeader(Oe,ie)}),re.signal&&(re.signal.addEventListener("abort",ae),ne.onreadystatechange=function(){ne.readyState===4&&re.signal.removeEventListener("abort",ae)}),ne.send(typeof re._bodyInit>"u"?null:re._bodyInit)})}return me.polyfill=!0,o.fetch||(o.fetch=me,o.Headers=P,o.Request=x,o.Response=ee),c.Headers=P,c.Request=x,c.Response=ee,c.fetch=me,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,t.exports=e})(vh,vh.exports);var bg=yw(vh.exports);const _g={headers:{Accept:"application/json","Content-Type":"application/json"},method:"POST"},Eg=10;class Vi{constructor(e,r=!1){if(this.url=e,this.disableProviderPing=r,this.events=new br.exports.EventEmitter,this.isAvailable=!1,this.registering=!1,!Ap(e))throw new Error(`Provided URL is not compatible with HTTP connection: ${e}`);this.url=e,this.disableProviderPing=r}get connected(){return this.isAvailable}get connecting(){return this.registering}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}off(e,r){this.events.off(e,r)}removeListener(e,r){this.events.removeListener(e,r)}async open(e=this.url){await this.register(e)}async close(){if(!this.isAvailable)throw new Error("Connection already closed");this.onClose()}async send(e,r){this.isAvailable||await this.register();try{const n=Mo(e),o=await(await bg(this.url,Object.assign(Object.assign({},_g),{body:n}))).json();this.onPayload({data:o})}catch(n){this.onError(e.id,n)}}async register(e=this.url){if(!Ap(e))throw new Error(`Provided URL is not compatible with HTTP connection: ${e}`);if(this.registering){const r=this.events.getMaxListeners();return(this.events.listenerCount("register_error")>=r||this.events.listenerCount("open")>=r)&&this.events.setMaxListeners(r+1),new Promise((n,i)=>{this.events.once("register_error",o=>{this.resetMaxListeners(),i(o)}),this.events.once("open",()=>{if(this.resetMaxListeners(),typeof this.isAvailable>"u")return i(new Error("HTTP connection is missing or invalid"));n()})})}this.url=e,this.registering=!0;try{if(!this.disableProviderPing){const r=Mo({id:1,jsonrpc:"2.0",method:"test",params:[]});await bg(e,Object.assign(Object.assign({},_g),{body:r}))}this.onOpen()}catch(r){const n=this.parseError(r);throw this.events.emit("register_error",n),this.onClose(),n}}onOpen(){this.isAvailable=!0,this.registering=!1,this.events.emit("open")}onClose(){this.isAvailable=!1,this.registering=!1,this.events.emit("close")}onPayload(e){if(typeof e.data>"u")return;const r=typeof e.data=="string"?Yu(e.data):e.data;this.events.emit("payload",r)}onError(e,r){const n=this.parseError(r),i=n.message||n.toString(),o=nc(e,i);this.events.emit("payload",o)}parseError(e,r=this.url){return bp(e,r,"HTTP")}resetMaxListeners(){this.events.getMaxListeners()>Eg&&this.events.setMaxListeners(Eg)}}const xg="error",_7="wss://relay.walletconnect.com",E7="wc",x7="universal_provider",Cg=`${E7}@2:${x7}:`,C7="https://rpc.walletconnect.com/v1",pi={DEFAULT_CHAIN_CHANGED:"default_chain_changed"};var Wo=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},yh={exports:{}};/**
72
+ ***************************************************************************** */var dh=function(t,e){return dh=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)n.hasOwnProperty(i)&&(r[i]=n[i])},dh(t,e)};function lE(t,e){dh(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var ph=function(){return ph=Object.assign||function(e){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e},ph.apply(this,arguments)};function uE(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r}function hE(t,e,r,n){var i=arguments.length,o=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(o=(i<3?c(o):i>3?c(e,r,o):c(e,r))||o);return i>3&&o&&Object.defineProperty(e,r,o),o}function fE(t,e){return function(r,n){e(r,n,t)}}function dE(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function pE(t,e,r,n){function i(o){return o instanceof r?o:new r(function(c){c(o)})}return new(r||(r=Promise))(function(o,c){function l(v){try{d(n.next(v))}catch(x){c(x)}}function h(v){try{d(n.throw(v))}catch(x){c(x)}}function d(v){v.done?o(v.value):i(v.value).then(l,h)}d((n=n.apply(t,e||[])).next())})}function gE(t,e){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,c;return c={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function l(d){return function(v){return h([d,v])}}function h(d){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(o=d[0]&2?i.return:d[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,d[1])).done)return o;switch(i=0,o&&(d=[d[0]&2,o.value]),d[0]){case 0:case 1:o=d;break;case 4:return r.label++,{value:d[1],done:!1};case 5:r.label++,i=d[1],d=[0];continue;case 7:d=r.ops.pop(),r.trys.pop();continue;default:if(o=r.trys,!(o=o.length>0&&o[o.length-1])&&(d[0]===6||d[0]===2)){r=0;continue}if(d[0]===3&&(!o||d[1]>o[0]&&d[1]<o[3])){r.label=d[1];break}if(d[0]===6&&r.label<o[1]){r.label=o[1],o=d;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(d);break}o[2]&&r.ops.pop(),r.trys.pop();continue}d=e.call(t,r)}catch(v){d=[6,v],i=0}finally{n=o=0}if(d[0]&5)throw d[1];return{value:d[0]?d[1]:void 0,done:!0}}}function mE(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}function wE(t,e){for(var r in t)r!=="default"&&!e.hasOwnProperty(r)&&(e[r]=t[r])}function gh(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function tg(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,o=[],c;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(l){c={error:l}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(c)throw c.error}}return o}function vE(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(tg(arguments[e]));return t}function yE(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;for(var n=Array(t),i=0,e=0;e<r;e++)for(var o=arguments[e],c=0,l=o.length;c<l;c++,i++)n[i]=o[c];return n}function Ho(t){return this instanceof Ho?(this.v=t,this):new Ho(t)}function bE(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(t,e||[]),i,o=[];return i={},c("next"),c("throw"),c("return"),i[Symbol.asyncIterator]=function(){return this},i;function c(_){n[_]&&(i[_]=function(A){return new Promise(function(P,L){o.push([_,A,P,L])>1||l(_,A)})})}function l(_,A){try{h(n[_](A))}catch(P){x(o[0][3],P)}}function h(_){_.value instanceof Ho?Promise.resolve(_.value.v).then(d,v):x(o[0][2],_)}function d(_){l("next",_)}function v(_){l("throw",_)}function x(_,A){_(A),o.shift(),o.length&&l(o[0][0],o[0][1])}}function _E(t){var e,r;return e={},n("next"),n("throw",function(i){throw i}),n("return"),e[Symbol.iterator]=function(){return this},e;function n(i,o){e[i]=t[i]?function(c){return(r=!r)?{value:Ho(t[i](c)),done:i==="return"}:o?o(c):c}:o}}function EE(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof gh=="function"?gh(t):t[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(o){r[o]=t[o]&&function(c){return new Promise(function(l,h){c=t[o](c),i(l,h,c.done,c.value)})}}function i(o,c,l,h){Promise.resolve(h).then(function(d){o({value:d,done:l})},c)}}function xE(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function CE(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}function IE(t){return t&&t.__esModule?t:{default:t}}function AE(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}function $E(t,e,r){if(!e.has(t))throw new TypeError("attempted to set private field on non-instance");return e.set(t,r),r}var OE=Object.freeze({__proto__:null,__extends:lE,get __assign(){return ph},__rest:uE,__decorate:hE,__param:fE,__metadata:dE,__awaiter:pE,__generator:gE,__createBinding:mE,__exportStar:wE,__values:gh,__read:tg,__spread:vE,__spreadArrays:yE,__await:Ho,__asyncGenerator:bE,__asyncDelegator:_E,__asyncValues:EE,__makeTemplateObject:xE,__importStar:CE,__importDefault:IE,__classPrivateFieldGet:AE,__classPrivateFieldSet:$E}),SE=Ui(OE),Vn={},rg;function DE(){if(rg)return Vn;rg=1,Object.defineProperty(Vn,"__esModule",{value:!0}),Vn.isBrowserCryptoAvailable=Vn.getSubtleCrypto=Vn.getBrowerCrypto=void 0;function t(){return gr?.crypto||gr?.msCrypto||{}}Vn.getBrowerCrypto=t;function e(){const n=t();return n.subtle||n.webkitSubtle}Vn.getSubtleCrypto=e;function r(){return!!t()&&!!e()}return Vn.isBrowserCryptoAvailable=r,Vn}var Kn={},ng;function PE(){if(ng)return Kn;ng=1,Object.defineProperty(Kn,"__esModule",{value:!0}),Kn.isBrowser=Kn.isNode=Kn.isReactNative=void 0;function t(){return typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"}Kn.isReactNative=t;function e(){return typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.node<"u"}Kn.isNode=e;function r(){return!t()&&!e()}return Kn.isBrowser=r,Kn}(function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=SE;e.__exportStar(DE(),t),e.__exportStar(PE(),t)})(eg);function ig(t=3){const e=Date.now()*Math.pow(10,t),r=Math.floor(Math.random()*Math.pow(10,t));return e+r}function uc(t=6){return BigInt(ig(t))}function zo(t,e,r){return{id:r||ig(),jsonrpc:"2.0",method:t,params:e}}function mh(t,e){return{id:t,jsonrpc:"2.0",result:e}}function hc(t,e,r){return{id:t,jsonrpc:"2.0",error:TE(e,r)}}function TE(t,e){return typeof t>"u"?Xp(Yp):(typeof t=="string"&&(t=Object.assign(Object.assign({},Xp(fh)),{message:t})),typeof e<"u"&&(t.data=e),aE(t.code)&&(t=cE(t.code)),t)}class RE{}class NE extends RE{constructor(){super()}}class sg extends NE{constructor(e){super()}}const FE="^https?:",LE="^wss?:";function ME(t){const e=t.match(new RegExp(/^\w+:/,"gi"));if(!(!e||!e.length))return e[0]}function og(t,e){const r=ME(t);return typeof r>"u"?!1:new RegExp(e).test(r)}function ag(t){return og(t,FE)}function cg(t){return og(t,LE)}function UE(t){return new RegExp("wss?://localhost(:d{2,5})?").test(t)}function lg(t){return typeof t=="object"&&"id"in t&&"jsonrpc"in t&&t.jsonrpc==="2.0"}function wh(t){return lg(t)&&"method"in t}function Wo(t){return lg(t)&&(Gn(t)||an(t))}function Gn(t){return"result"in t}function an(t){return"error"in t}var vh={exports:{}},Ns=typeof Reflect=="object"?Reflect:null,ug=Ns&&typeof Ns.apply=="function"?Ns.apply:function(t,e,r){return Function.prototype.apply.call(t,e,r)},fc;Ns&&typeof Ns.ownKeys=="function"?fc=Ns.ownKeys:Object.getOwnPropertySymbols?fc=function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:fc=function(t){return Object.getOwnPropertyNames(t)};function jE(t){console&&console.warn&&console.warn(t)}var hg=Number.isNaN||function(t){return t!==t};function Et(){Et.init.call(this)}vh.exports=Et,vh.exports.once=zE,Et.EventEmitter=Et,Et.prototype._events=void 0,Et.prototype._eventsCount=0,Et.prototype._maxListeners=void 0;var fg=10;function dc(t){if(typeof t!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}Object.defineProperty(Et,"defaultMaxListeners",{enumerable:!0,get:function(){return fg},set:function(t){if(typeof t!="number"||t<0||hg(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");fg=t}}),Et.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},Et.prototype.setMaxListeners=function(t){if(typeof t!="number"||t<0||hg(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this};function dg(t){return t._maxListeners===void 0?Et.defaultMaxListeners:t._maxListeners}Et.prototype.getMaxListeners=function(){return dg(this)},Et.prototype.emit=function(t){for(var e=[],r=1;r<arguments.length;r++)e.push(arguments[r]);var n=t==="error",i=this._events;if(i!==void 0)n=n&&i.error===void 0;else if(!n)return!1;if(n){var o;if(e.length>0&&(o=e[0]),o instanceof Error)throw o;var c=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw c.context=o,c}var l=i[t];if(l===void 0)return!1;if(typeof l=="function")ug(l,this,e);else for(var h=l.length,d=vg(l,h),r=0;r<h;++r)ug(d[r],this,e);return!0};function pg(t,e,r,n){var i,o,c;if(dc(r),o=t._events,o===void 0?(o=t._events=Object.create(null),t._eventsCount=0):(o.newListener!==void 0&&(t.emit("newListener",e,r.listener?r.listener:r),o=t._events),c=o[e]),c===void 0)c=o[e]=r,++t._eventsCount;else if(typeof c=="function"?c=o[e]=n?[r,c]:[c,r]:n?c.unshift(r):c.push(r),i=dg(t),i>0&&c.length>i&&!c.warned){c.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+c.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=t,l.type=e,l.count=c.length,jE(l)}return t}Et.prototype.addListener=function(t,e){return pg(this,t,e,!1)},Et.prototype.on=Et.prototype.addListener,Et.prototype.prependListener=function(t,e){return pg(this,t,e,!0)};function BE(){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 gg(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},i=BE.bind(n);return i.listener=r,n.wrapFn=i,i}Et.prototype.once=function(t,e){return dc(e),this.on(t,gg(this,t,e)),this},Et.prototype.prependOnceListener=function(t,e){return dc(e),this.prependListener(t,gg(this,t,e)),this},Et.prototype.removeListener=function(t,e){var r,n,i,o,c;if(dc(e),n=this._events,n===void 0)return this;if(r=n[t],r===void 0)return this;if(r===e||r.listener===e)--this._eventsCount===0?this._events=Object.create(null):(delete n[t],n.removeListener&&this.emit("removeListener",t,r.listener||e));else if(typeof r!="function"){for(i=-1,o=r.length-1;o>=0;o--)if(r[o]===e||r[o].listener===e){c=r[o].listener,i=o;break}if(i<0)return this;i===0?r.shift():kE(r,i),r.length===1&&(n[t]=r[0]),n.removeListener!==void 0&&this.emit("removeListener",t,c||e)}return this},Et.prototype.off=Et.prototype.removeListener,Et.prototype.removeAllListeners=function(t){var e,r,n;if(r=this._events,r===void 0)return this;if(r.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):r[t]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete r[t]),this;if(arguments.length===0){var i=Object.keys(r),o;for(n=0;n<i.length;++n)o=i[n],o!=="removeListener"&&this.removeAllListeners(o);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(e=r[t],typeof e=="function")this.removeListener(t,e);else if(e!==void 0)for(n=e.length-1;n>=0;n--)this.removeListener(t,e[n]);return this};function mg(t,e,r){var n=t._events;if(n===void 0)return[];var i=n[e];return i===void 0?[]:typeof i=="function"?r?[i.listener||i]:[i]:r?HE(i):vg(i,i.length)}Et.prototype.listeners=function(t){return mg(this,t,!0)},Et.prototype.rawListeners=function(t){return mg(this,t,!1)},Et.listenerCount=function(t,e){return typeof t.listenerCount=="function"?t.listenerCount(e):wg.call(t,e)},Et.prototype.listenerCount=wg;function wg(t){var e=this._events;if(e!==void 0){var r=e[t];if(typeof r=="function")return 1;if(r!==void 0)return r.length}return 0}Et.prototype.eventNames=function(){return this._eventsCount>0?fc(this._events):[]};function vg(t,e){for(var r=new Array(e),n=0;n<e;++n)r[n]=t[n];return r}function kE(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}function HE(t){for(var e=new Array(t.length),r=0;r<e.length;++r)e[r]=t[r].listener||t[r];return e}function zE(t,e){return new Promise(function(r,n){function i(c){t.removeListener(e,o),n(c)}function o(){typeof t.removeListener=="function"&&t.removeListener("error",i),r([].slice.call(arguments))}yg(t,e,o,{once:!0}),e!=="error"&&WE(t,i,{once:!0})})}function WE(t,e,r){typeof t.on=="function"&&yg(t,"error",e,r)}function yg(t,e,r,n){if(typeof t.on=="function")n.once?t.once(e,r):t.on(e,r);else if(typeof t.addEventListener=="function")t.addEventListener(e,function i(o){n.once&&t.removeEventListener(e,i),r(o)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof t)}class qE extends sg{constructor(e){super(e),this.events=new vh.exports.EventEmitter,this.hasRegisteredEventListeners=!1,this.connection=this.setConnection(e),this.connection.connected&&this.registerEventListeners()}async connect(e=this.connection){await this.open(e)}async disconnect(){await this.close()}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}off(e,r){this.events.off(e,r)}removeListener(e,r){this.events.removeListener(e,r)}async request(e,r){return this.requestStrict(zo(e.method,e.params||[],e.id||uc().toString()),r)}async requestStrict(e,r){return new Promise(async(n,i)=>{if(!this.connection.connected)try{await this.open()}catch(o){i(o)}this.events.on(`${e.id}`,o=>{an(o)?i(o.error):n(o.result)});try{await this.connection.send(e,r)}catch(o){i(o)}})}setConnection(e=this.connection){return e}onPayload(e){this.events.emit("payload",e),Wo(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 VE=()=>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"),KE=()=>typeof WebSocket<"u"||typeof global<"u"&&typeof global.WebSocket<"u"||typeof window<"u"&&typeof window.WebSocket<"u"||typeof self<"u"&&typeof self.WebSocket<"u",bg=t=>t.split("?")[0],_g=10,GE=VE();class ZE{constructor(e){if(this.url=e,this.events=new _r.exports.EventEmitter,this.registering=!1,!cg(e))throw new Error(`Provided URL is not compatible with WebSocket connection: ${e}`);this.url=e}get connected(){return typeof this.socket<"u"}get connecting(){return this.registering}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}off(e,r){this.events.off(e,r)}removeListener(e,r){this.events.removeListener(e,r)}async open(e=this.url){await this.register(e)}async close(){return new Promise((e,r)=>{if(typeof this.socket>"u"){r(new Error("Connection already closed"));return}this.socket.onclose=n=>{this.onClose(n),e()},this.socket.close()})}async send(e,r){typeof this.socket>"u"&&(this.socket=await this.register());try{this.socket.send(jo(e))}catch(n){this.onError(e.id,n)}}register(e=this.url){if(!cg(e))throw new Error(`Provided URL is not compatible with WebSocket connection: ${e}`);if(this.registering){const r=this.events.getMaxListeners();return(this.events.listenerCount("register_error")>=r||this.events.listenerCount("open")>=r)&&this.events.setMaxListeners(r+1),new Promise((n,i)=>{this.events.once("register_error",o=>{this.resetMaxListeners(),i(o)}),this.events.once("open",()=>{if(this.resetMaxListeners(),typeof this.socket>"u")return i(new Error("WebSocket connection is missing or invalid"));n(this.socket)})})}return this.url=e,this.registering=!0,new Promise((r,n)=>{const i=eg.isReactNative()?void 0:{rejectUnauthorized:!UE(e)},o=new GE(e,[],i);KE()?o.onerror=c=>{const l=c;n(this.emitError(l.error))}:o.on("error",c=>{n(this.emitError(c))}),o.onopen=()=>{this.onOpen(o),r(o)}})}onOpen(e){e.onmessage=r=>this.onPayload(r),e.onclose=r=>this.onClose(r),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 r=typeof e.data=="string"?ih(e.data):e.data;this.events.emit("payload",r)}onError(e,r){const n=this.parseError(r),i=n.message||n.toString(),o=hc(e,i);this.events.emit("payload",o)}parseError(e,r=this.url){return Qp(e,bg(r),"WS")}resetMaxListeners(){this.events.getMaxListeners()>_g&&this.events.setMaxListeners(_g)}emitError(e){const r=this.parseError(new Error(e?.message||`WebSocket connection failed for host: ${bg(this.url)}`));return this.events.emit("register_error",r),r}}var yh={exports:{}};(function(t,e){var r=200,n="__lodash_hash_undefined__",i=1,o=2,c=9007199254740991,l="[object Arguments]",h="[object Array]",d="[object AsyncFunction]",v="[object Boolean]",x="[object Date]",_="[object Error]",A="[object Function]",P="[object GeneratorFunction]",L="[object Map]",k="[object Number]",q="[object Null]",R="[object Object]",F="[object Promise]",$="[object Proxy]",T="[object RegExp]",C="[object Set]",f="[object String]",E="[object Symbol]",Z="[object Undefined]",z="[object WeakMap]",ee="[object ArrayBuffer]",de="[object DataView]",me="[object Float32Array]",O="[object Float64Array]",U="[object Int8Array]",ce="[object Int16Array]",le="[object Int32Array]",re="[object Uint8Array]",ne="[object Uint8ClampedArray]",ae="[object Uint16Array]",ie="[object Uint32Array]",Oe=/[\\^$.*+?()[\]{}|]/g,ge=/^\[object .+?Constructor\]$/,Be=/^(?:0|[1-9]\d*)$/,ye={};ye[me]=ye[O]=ye[U]=ye[ce]=ye[le]=ye[re]=ye[ne]=ye[ae]=ye[ie]=!0,ye[l]=ye[h]=ye[ee]=ye[v]=ye[de]=ye[x]=ye[_]=ye[A]=ye[L]=ye[k]=ye[R]=ye[T]=ye[C]=ye[f]=ye[z]=!1;var Le=typeof gr=="object"&&gr&&gr.Object===Object&&gr,X=typeof self=="object"&&self&&self.Object===Object&&self,J=Le||X||Function("return this")(),W=e&&!e.nodeType&&e,w=W&&!0&&t&&!t.nodeType&&t,j=w&&w.exports===W,we=j&&Le.process,ve=function(){try{return we&&we.binding&&we.binding("util")}catch{}}(),Me=ve&&ve.isTypedArray;function nt(N,V){for(var fe=-1,Ce=N==null?0:N.length,At=0,Xe=[];++fe<Ce;){var Rt=N[fe];V(Rt,fe,N)&&(Xe[At++]=Rt)}return Xe}function at(N,V){for(var fe=-1,Ce=V.length,At=N.length;++fe<Ce;)N[At+fe]=V[fe];return N}function Ge(N,V){for(var fe=-1,Ce=N==null?0:N.length;++fe<Ce;)if(V(N[fe],fe,N))return!0;return!1}function Dt(N,V){for(var fe=-1,Ce=Array(N);++fe<N;)Ce[fe]=V(fe);return Ce}function Pt(N){return function(V){return N(V)}}function Je(N,V){return N.has(V)}function He(N,V){return N?.[V]}function ke(N){var V=-1,fe=Array(N.size);return N.forEach(function(Ce,At){fe[++V]=[At,Ce]}),fe}function Ke(N,V){return function(fe){return N(V(fe))}}function rt(N){var V=-1,fe=Array(N.size);return N.forEach(function(Ce){fe[++V]=Ce}),fe}var Ue=Array.prototype,Ze=Function.prototype,b=Object.prototype,p=J["__core-js_shared__"],m=Ze.toString,D=b.hasOwnProperty,B=function(){var N=/[^.]+$/.exec(p&&p.keys&&p.keys.IE_PROTO||"");return N?"Symbol(src)_1."+N:""}(),G=b.toString,Q=RegExp("^"+m.call(D).replace(Oe,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ee=j?J.Buffer:void 0,Re=J.Symbol,st=J.Uint8Array,ht=b.propertyIsEnumerable,lt=Ue.splice,Ur=Re?Re.toStringTag:void 0,Qn=Object.getOwnPropertySymbols,$i=Ee?Ee.isBuffer:void 0,us=Ke(Object.keys,Object),Wt=Qr(J,"DataView"),Lt=Qr(J,"Map"),qt=Qr(J,"Promise"),Vt=Qr(J,"Set"),Bt=Qr(J,"WeakMap"),Mt=Qr(Object,"create"),sr=ti(Wt),or=ti(Lt),Kt=ti(qt),ar=ti(Vt),Gt=ti(Bt),Qt=Re?Re.prototype:void 0,Zt=Qt?Qt.valueOf:void 0;function Tt(N){var V=-1,fe=N==null?0:N.length;for(this.clear();++V<fe;){var Ce=N[V];this.set(Ce[0],Ce[1])}}function cr(){this.__data__=Mt?Mt(null):{},this.size=0}function lr(N){var V=this.has(N)&&delete this.__data__[N];return this.size-=V?1:0,V}function t0(N){var V=this.__data__;if(Mt){var fe=V[N];return fe===n?void 0:fe}return D.call(V,N)?V[N]:void 0}function r0(N){var V=this.__data__;return Mt?V[N]!==void 0:D.call(V,N)}function n0(N,V){var fe=this.__data__;return this.size+=this.has(N)?0:1,fe[N]=Mt&&V===void 0?n:V,this}Tt.prototype.clear=cr,Tt.prototype.delete=lr,Tt.prototype.get=t0,Tt.prototype.has=r0,Tt.prototype.set=n0;function pn(N){var V=-1,fe=N==null?0:N.length;for(this.clear();++V<fe;){var Ce=N[V];this.set(Ce[0],Ce[1])}}function i0(){this.__data__=[],this.size=0}function s0(N){var V=this.__data__,fe=hs(V,N);if(fe<0)return!1;var Ce=V.length-1;return fe==Ce?V.pop():lt.call(V,fe,1),--this.size,!0}function o0(N){var V=this.__data__,fe=hs(V,N);return fe<0?void 0:V[fe][1]}function a0(N){return hs(this.__data__,N)>-1}function c0(N,V){var fe=this.__data__,Ce=hs(fe,N);return Ce<0?(++this.size,fe.push([N,V])):fe[Ce][1]=V,this}pn.prototype.clear=i0,pn.prototype.delete=s0,pn.prototype.get=o0,pn.prototype.has=a0,pn.prototype.set=c0;function ei(N){var V=-1,fe=N==null?0:N.length;for(this.clear();++V<fe;){var Ce=N[V];this.set(Ce[0],Ce[1])}}function ro(){this.size=0,this.__data__={hash:new Tt,map:new(Lt||pn),string:new Tt}}function l0(N){var V=Oi(this,N).delete(N);return this.size-=V?1:0,V}function no(N){return Oi(this,N).get(N)}function u0(N){return Oi(this,N).has(N)}function h0(N,V){var fe=Oi(this,N),Ce=fe.size;return fe.set(N,V),this.size+=fe.size==Ce?0:1,this}ei.prototype.clear=ro,ei.prototype.delete=l0,ei.prototype.get=no,ei.prototype.has=u0,ei.prototype.set=h0;function io(N){var V=-1,fe=N==null?0:N.length;for(this.__data__=new ei;++V<fe;)this.add(N[V])}function ol(N){return this.__data__.set(N,n),this}function al(N){return this.__data__.has(N)}io.prototype.add=io.prototype.push=ol,io.prototype.has=al;function An(N){var V=this.__data__=new pn(N);this.size=V.size}function f0(){this.__data__=new pn,this.size=0}function d0(N){var V=this.__data__,fe=V.delete(N);return this.size=V.size,fe}function p0(N){return this.__data__.get(N)}function g0(N){return this.__data__.has(N)}function cl(N,V){var fe=this.__data__;if(fe instanceof pn){var Ce=fe.__data__;if(!Lt||Ce.length<r-1)return Ce.push([N,V]),this.size=++fe.size,this;fe=this.__data__=new ei(Ce)}return fe.set(N,V),this.size=fe.size,this}An.prototype.clear=f0,An.prototype.delete=d0,An.prototype.get=p0,An.prototype.has=g0,An.prototype.set=cl;function ll(N,V){var fe=ao(N),Ce=!fe&&_l(N),At=!fe&&!Ce&&Aa(N),Xe=!fe&&!Ce&&!At&&Cl(N),Rt=fe||Ce||At||Xe,ur=Rt?Dt(N.length,String):[],mt=ur.length;for(var $t in N)(V||D.call(N,$t))&&!(Rt&&($t=="length"||At&&($t=="offset"||$t=="parent")||Xe&&($t=="buffer"||$t=="byteLength"||$t=="byteOffset")||ml($t,mt)))&&ur.push($t);return ur}function hs(N,V){for(var fe=N.length;fe--;)if(bl(N[fe][0],V))return fe;return-1}function Ca(N,V,fe){var Ce=V(N);return ao(N)?Ce:at(Ce,fe(N))}function fs(N){return N==null?N===void 0?Z:q:Ur&&Ur in Object(N)?pl(N):v0(N)}function Ia(N){return ps(N)&&fs(N)==l}function ds(N,V,fe,Ce,At){return N===V?!0:N==null||V==null||!ps(N)&&!ps(V)?N!==N&&V!==V:ul(N,V,fe,Ce,ds,At)}function ul(N,V,fe,Ce,At,Xe){var Rt=ao(N),ur=ao(V),mt=Rt?h:kn(N),$t=ur?h:kn(V);mt=mt==l?R:mt,$t=$t==l?R:$t;var er=mt==R,qr=$t==R,hr=mt==$t;if(hr&&Aa(N)){if(!Aa(V))return!1;Rt=!0,er=!1}if(hr&&!er)return Xe||(Xe=new An),Rt||Cl(N)?so(N,V,fe,Ce,At,Xe):w0(N,V,mt,fe,Ce,At,Xe);if(!(fe&i)){var Nt=er&&D.call(N,"__wrapped__"),jr=qr&&D.call(V,"__wrapped__");if(Nt||jr){var $n=Nt?N.value():N,gn=jr?V.value():V;return Xe||(Xe=new An),At($n,gn,fe,Ce,Xe)}}return hr?(Xe||(Xe=new An),dl(N,V,fe,Ce,At,Xe)):!1}function m0(N){if(!xl(N)||vl(N))return!1;var V=co(N)?Q:ge;return V.test(ti(N))}function hl(N){return ps(N)&&El(N.length)&&!!ye[fs(N)]}function fl(N){if(!yl(N))return us(N);var V=[];for(var fe in Object(N))D.call(N,fe)&&fe!="constructor"&&V.push(fe);return V}function so(N,V,fe,Ce,At,Xe){var Rt=fe&i,ur=N.length,mt=V.length;if(ur!=mt&&!(Rt&&mt>ur))return!1;var $t=Xe.get(N);if($t&&Xe.get(V))return $t==V;var er=-1,qr=!0,hr=fe&o?new io:void 0;for(Xe.set(N,V),Xe.set(V,N);++er<ur;){var Nt=N[er],jr=V[er];if(Ce)var $n=Rt?Ce(jr,Nt,er,V,N,Xe):Ce(Nt,jr,er,N,V,Xe);if($n!==void 0){if($n)continue;qr=!1;break}if(hr){if(!Ge(V,function(gn,Hn){if(!Je(hr,Hn)&&(Nt===gn||At(Nt,gn,fe,Ce,Xe)))return hr.push(Hn)})){qr=!1;break}}else if(!(Nt===jr||At(Nt,jr,fe,Ce,Xe))){qr=!1;break}}return Xe.delete(N),Xe.delete(V),qr}function w0(N,V,fe,Ce,At,Xe,Rt){switch(fe){case de:if(N.byteLength!=V.byteLength||N.byteOffset!=V.byteOffset)return!1;N=N.buffer,V=V.buffer;case ee:return!(N.byteLength!=V.byteLength||!Xe(new st(N),new st(V)));case v:case x:case k:return bl(+N,+V);case _:return N.name==V.name&&N.message==V.message;case T:case f:return N==V+"";case L:var ur=ke;case C:var mt=Ce&i;if(ur||(ur=rt),N.size!=V.size&&!mt)return!1;var $t=Rt.get(N);if($t)return $t==V;Ce|=o,Rt.set(N,V);var er=so(ur(N),ur(V),Ce,At,Xe,Rt);return Rt.delete(N),er;case E:if(Zt)return Zt.call(N)==Zt.call(V)}return!1}function dl(N,V,fe,Ce,At,Xe){var Rt=fe&i,ur=oo(N),mt=ur.length,$t=oo(V),er=$t.length;if(mt!=er&&!Rt)return!1;for(var qr=mt;qr--;){var hr=ur[qr];if(!(Rt?hr in V:D.call(V,hr)))return!1}var Nt=Xe.get(N);if(Nt&&Xe.get(V))return Nt==V;var jr=!0;Xe.set(N,V),Xe.set(V,N);for(var $n=Rt;++qr<mt;){hr=ur[qr];var gn=N[hr],Hn=V[hr];if(Ce)var $a=Rt?Ce(Hn,gn,hr,V,N,Xe):Ce(gn,Hn,hr,N,V,Xe);if(!($a===void 0?gn===Hn||At(gn,Hn,fe,Ce,Xe):$a)){jr=!1;break}$n||($n=hr=="constructor")}if(jr&&!$n){var gs=N.constructor,yr=V.constructor;gs!=yr&&"constructor"in N&&"constructor"in V&&!(typeof gs=="function"&&gs instanceof gs&&typeof yr=="function"&&yr instanceof yr)&&(jr=!1)}return Xe.delete(N),Xe.delete(V),jr}function oo(N){return Ca(N,_0,gl)}function Oi(N,V){var fe=N.__data__;return wl(V)?fe[typeof V=="string"?"string":"hash"]:fe.map}function Qr(N,V){var fe=He(N,V);return m0(fe)?fe:void 0}function pl(N){var V=D.call(N,Ur),fe=N[Ur];try{N[Ur]=void 0;var Ce=!0}catch{}var At=G.call(N);return Ce&&(V?N[Ur]=fe:delete N[Ur]),At}var gl=Qn?function(N){return N==null?[]:(N=Object(N),nt(Qn(N),function(V){return ht.call(N,V)}))}:It,kn=fs;(Wt&&kn(new Wt(new ArrayBuffer(1)))!=de||Lt&&kn(new Lt)!=L||qt&&kn(qt.resolve())!=F||Vt&&kn(new Vt)!=C||Bt&&kn(new Bt)!=z)&&(kn=function(N){var V=fs(N),fe=V==R?N.constructor:void 0,Ce=fe?ti(fe):"";if(Ce)switch(Ce){case sr:return de;case or:return L;case Kt:return F;case ar:return C;case Gt:return z}return V});function ml(N,V){return V=V??c,!!V&&(typeof N=="number"||Be.test(N))&&N>-1&&N%1==0&&N<V}function wl(N){var V=typeof N;return V=="string"||V=="number"||V=="symbol"||V=="boolean"?N!=="__proto__":N===null}function vl(N){return!!B&&B in N}function yl(N){var V=N&&N.constructor,fe=typeof V=="function"&&V.prototype||b;return N===fe}function v0(N){return G.call(N)}function ti(N){if(N!=null){try{return m.call(N)}catch{}try{return N+""}catch{}}return""}function bl(N,V){return N===V||N!==N&&V!==V}var _l=Ia(function(){return arguments}())?Ia:function(N){return ps(N)&&D.call(N,"callee")&&!ht.call(N,"callee")},ao=Array.isArray;function y0(N){return N!=null&&El(N.length)&&!co(N)}var Aa=$i||Ct;function b0(N,V){return ds(N,V)}function co(N){if(!xl(N))return!1;var V=fs(N);return V==A||V==P||V==d||V==$}function El(N){return typeof N=="number"&&N>-1&&N%1==0&&N<=c}function xl(N){var V=typeof N;return N!=null&&(V=="object"||V=="function")}function ps(N){return N!=null&&typeof N=="object"}var Cl=Me?Pt(Me):hl;function _0(N){return y0(N)?ll(N):fl(N)}function It(){return[]}function Ct(){return!1}t.exports=b0})(yh,yh.exports);var YE=yh.exports,JE=Object.defineProperty,Eg=Object.getOwnPropertySymbols,XE=Object.prototype.hasOwnProperty,QE=Object.prototype.propertyIsEnumerable,xg=(t,e,r)=>e in t?JE(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Nr=(t,e)=>{for(var r in e||(e={}))XE.call(e,r)&&xg(t,r,e[r]);if(Eg)for(var r of Eg(e))QE.call(e,r)&&xg(t,r,e[r]);return t};function e7(t,e){if(t.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),n=0;n<r.length;n++)r[n]=255;for(var i=0;i<t.length;i++){var o=t.charAt(i),c=o.charCodeAt(0);if(r[c]!==255)throw new TypeError(o+" is ambiguous");r[c]=i}var l=t.length,h=t.charAt(0),d=Math.log(l)/Math.log(256),v=Math.log(256)/Math.log(l);function x(P){if(P instanceof Uint8Array||(ArrayBuffer.isView(P)?P=new Uint8Array(P.buffer,P.byteOffset,P.byteLength):Array.isArray(P)&&(P=Uint8Array.from(P))),!(P instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(P.length===0)return"";for(var L=0,k=0,q=0,R=P.length;q!==R&&P[q]===0;)q++,L++;for(var F=(R-q)*v+1>>>0,$=new Uint8Array(F);q!==R;){for(var T=P[q],C=0,f=F-1;(T!==0||C<k)&&f!==-1;f--,C++)T+=256*$[f]>>>0,$[f]=T%l>>>0,T=T/l>>>0;if(T!==0)throw new Error("Non-zero carry");k=C,q++}for(var E=F-k;E!==F&&$[E]===0;)E++;for(var Z=h.repeat(L);E<F;++E)Z+=t.charAt($[E]);return Z}function _(P){if(typeof P!="string")throw new TypeError("Expected String");if(P.length===0)return new Uint8Array;var L=0;if(P[L]!==" "){for(var k=0,q=0;P[L]===h;)k++,L++;for(var R=(P.length-L)*d+1>>>0,F=new Uint8Array(R);P[L];){var $=r[P.charCodeAt(L)];if($===255)return;for(var T=0,C=R-1;($!==0||T<q)&&C!==-1;C--,T++)$+=l*F[C]>>>0,F[C]=$%256>>>0,$=$/256>>>0;if($!==0)throw new Error("Non-zero carry");q=T,L++}if(P[L]!==" "){for(var f=R-q;f!==R&&F[f]===0;)f++;for(var E=new Uint8Array(k+(R-f)),Z=k;f!==R;)E[Z++]=F[f++];return E}}}function A(P){var L=_(P);if(L)return L;throw new Error(`Non-${e} character`)}return{encode:x,decodeUnsafe:_,decode:A}}var t7=e7,r7=t7;const Cg=t=>{if(t instanceof Uint8Array&&t.constructor.name==="Uint8Array")return t;if(t instanceof ArrayBuffer)return new Uint8Array(t);if(ArrayBuffer.isView(t))return new Uint8Array(t.buffer,t.byteOffset,t.byteLength);throw new Error("Unknown type, must be binary type")},n7=t=>new TextEncoder().encode(t),i7=t=>new TextDecoder().decode(t);class s7{constructor(e,r,n){this.name=e,this.prefix=r,this.baseEncode=n}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}}class o7{constructor(e,r,n){if(this.name=e,this.prefix=r,r.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=r.codePointAt(0),this.baseDecode=n}decode(e){if(typeof e=="string"){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(e){return Ig(this,e)}}class a7{constructor(e){this.decoders=e}or(e){return Ig(this,e)}decode(e){const r=e[0],n=this.decoders[r];if(n)return n.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const Ig=(t,e)=>new a7(Nr(Nr({},t.decoders||{[t.prefix]:t}),e.decoders||{[e.prefix]:e}));class c7{constructor(e,r,n,i){this.name=e,this.prefix=r,this.baseEncode=n,this.baseDecode=i,this.encoder=new s7(e,r,n),this.decoder=new o7(e,r,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}const pc=({name:t,prefix:e,encode:r,decode:n})=>new c7(t,e,r,n),qo=({prefix:t,name:e,alphabet:r})=>{const{encode:n,decode:i}=r7(r,e);return pc({prefix:t,name:e,encode:n,decode:o=>Cg(i(o))})},l7=(t,e,r,n)=>{const i={};for(let v=0;v<e.length;++v)i[e[v]]=v;let o=t.length;for(;t[o-1]==="=";)--o;const c=new Uint8Array(o*r/8|0);let l=0,h=0,d=0;for(let v=0;v<o;++v){const x=i[t[v]];if(x===void 0)throw new SyntaxError(`Non-${n} character`);h=h<<r|x,l+=r,l>=8&&(l-=8,c[d++]=255&h>>l)}if(l>=r||255&h<<8-l)throw new SyntaxError("Unexpected end of data");return c},u7=(t,e,r)=>{const n=e[e.length-1]==="=",i=(1<<r)-1;let o="",c=0,l=0;for(let h=0;h<t.length;++h)for(l=l<<8|t[h],c+=8;c>r;)c-=r,o+=e[i&l>>c];if(c&&(o+=e[i&l<<r-c]),n)for(;o.length*r&7;)o+="=";return o},Cr=({name:t,prefix:e,bitsPerChar:r,alphabet:n})=>pc({prefix:e,name:t,encode(i){return u7(i,n,r)},decode(i){return l7(i,n,r,t)}}),h7=pc({prefix:"\0",name:"identity",encode:t=>i7(t),decode:t=>n7(t)});var f7=Object.freeze({__proto__:null,identity:h7});const d7=Cr({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var p7=Object.freeze({__proto__:null,base2:d7});const g7=Cr({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var m7=Object.freeze({__proto__:null,base8:g7});const w7=qo({prefix:"9",name:"base10",alphabet:"0123456789"});var v7=Object.freeze({__proto__:null,base10:w7});const y7=Cr({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),b7=Cr({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var _7=Object.freeze({__proto__:null,base16:y7,base16upper:b7});const E7=Cr({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),x7=Cr({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),C7=Cr({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),I7=Cr({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),A7=Cr({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),$7=Cr({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),O7=Cr({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),S7=Cr({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),D7=Cr({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var P7=Object.freeze({__proto__:null,base32:E7,base32upper:x7,base32pad:C7,base32padupper:I7,base32hex:A7,base32hexupper:$7,base32hexpad:O7,base32hexpadupper:S7,base32z:D7});const T7=qo({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),R7=qo({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var N7=Object.freeze({__proto__:null,base36:T7,base36upper:R7});const F7=qo({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),L7=qo({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var M7=Object.freeze({__proto__:null,base58btc:F7,base58flickr:L7});const U7=Cr({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),j7=Cr({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),B7=Cr({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),k7=Cr({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var H7=Object.freeze({__proto__:null,base64:U7,base64pad:j7,base64url:B7,base64urlpad:k7});const Ag=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}"),z7=Ag.reduce((t,e,r)=>(t[r]=e,t),[]),W7=Ag.reduce((t,e,r)=>(t[e.codePointAt(0)]=r,t),[]);function q7(t){return t.reduce((e,r)=>(e+=z7[r],e),"")}function V7(t){const e=[];for(const r of t){const n=W7[r.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${r}`);e.push(n)}return new Uint8Array(e)}const K7=pc({prefix:"\u{1F680}",name:"base256emoji",encode:q7,decode:V7});var G7=Object.freeze({__proto__:null,base256emoji:K7}),Z7=Og,$g=128,Y7=127,J7=~Y7,X7=Math.pow(2,31);function Og(t,e,r){e=e||[],r=r||0;for(var n=r;t>=X7;)e[r++]=t&255|$g,t/=128;for(;t&J7;)e[r++]=t&255|$g,t>>>=7;return e[r]=t|0,Og.bytes=r-n+1,e}var Q7=bh,ex=128,Sg=127;function bh(t,n){var r=0,n=n||0,i=0,o=n,c,l=t.length;do{if(o>=l)throw bh.bytes=0,new RangeError("Could not decode varint");c=t[o++],r+=i<28?(c&Sg)<<i:(c&Sg)*Math.pow(2,i),i+=7}while(c>=ex);return bh.bytes=o-n,r}var tx=Math.pow(2,7),rx=Math.pow(2,14),nx=Math.pow(2,21),ix=Math.pow(2,28),sx=Math.pow(2,35),ox=Math.pow(2,42),ax=Math.pow(2,49),cx=Math.pow(2,56),lx=Math.pow(2,63),ux=function(t){return t<tx?1:t<rx?2:t<nx?3:t<ix?4:t<sx?5:t<ox?6:t<ax?7:t<cx?8:t<lx?9:10},hx={encode:Z7,decode:Q7,encodingLength:ux},Dg=hx;const Pg=(t,e,r=0)=>(Dg.encode(t,e,r),e),Tg=t=>Dg.encodingLength(t),_h=(t,e)=>{const r=e.byteLength,n=Tg(t),i=n+Tg(r),o=new Uint8Array(i+r);return Pg(t,o,0),Pg(r,o,n),o.set(e,i),new fx(t,r,e,o)};class fx{constructor(e,r,n,i){this.code=e,this.size=r,this.digest=n,this.bytes=i}}const Rg=({name:t,code:e,encode:r})=>new dx(t,e,r);class dx{constructor(e,r,n){this.name=e,this.code=r,this.encode=n}digest(e){if(e instanceof Uint8Array){const r=this.encode(e);return r instanceof Uint8Array?_h(this.code,r):r.then(n=>_h(this.code,n))}else throw Error("Unknown type, must be binary type")}}const Ng=t=>async e=>new Uint8Array(await crypto.subtle.digest(t,e)),px=Rg({name:"sha2-256",code:18,encode:Ng("SHA-256")}),gx=Rg({name:"sha2-512",code:19,encode:Ng("SHA-512")});var mx=Object.freeze({__proto__:null,sha256:px,sha512:gx});const Fg=0,wx="identity",Lg=Cg;var vx=Object.freeze({__proto__:null,identity:{code:Fg,name:wx,encode:Lg,digest:t=>_h(Fg,Lg(t))}});new TextEncoder,new TextDecoder;const Mg=Nr(Nr(Nr(Nr(Nr(Nr(Nr(Nr(Nr(Nr({},f7),p7),m7),v7),_7),P7),N7),M7),H7),G7);Nr(Nr({},mx),vx);function Ug(t){return globalThis.Buffer!=null?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):t}function yx(t=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?Ug(globalThis.Buffer.allocUnsafe(t)):new Uint8Array(t)}function jg(t,e,r,n){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:r},decoder:{decode:n}}}const Bg=jg("utf8","u",t=>"u"+new TextDecoder("utf8").decode(t),t=>new TextEncoder().encode(t.substring(1))),Eh=jg("ascii","a",t=>{let e="a";for(let r=0;r<t.length;r++)e+=String.fromCharCode(t[r]);return e},t=>{t=t.substring(1);const e=yx(t.length);for(let r=0;r<t.length;r++)e[r]=t.charCodeAt(r);return e}),bx=Nr({utf8:Bg,"utf-8":Bg,hex:Mg.base16,latin1:Eh,ascii:Eh,binary:Eh},Mg);function _x(t,e="utf8"){const r=bx[e];if(!r)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?Ug(globalThis.Buffer.from(t,"utf-8")):r.decoder.decode(`${r.prefix}${t}`)}const kg="wc",Ex=2,xh="core",pi=`${kg}@2:${xh}:`,xx={name:xh,logger:"error"},Cx={database:":memory:"},Ix="crypto",Hg="client_ed25519_seed",Ax=Se.ONE_DAY,$x="keychain",Ox="0.3",Sx="messages",Dx="0.3",Px=Se.SIX_HOURS,Tx="publisher",zg="irn",Rx="error",Wg="wss://relay.walletconnect.com",qg="wss://relay.walletconnect.org",Nx="relayer",Ht={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"},Fx="_subscription",Vo={payload:"payload",connect:"connect",disconnect:"disconnect",error:"error"},Lx=Se.ONE_SECOND/2,Mx="2.9.1-5f93de27",Ux=1e4,jx="0.3",Bx="WALLETCONNECT_CLIENT_ID",Nn={created:"subscription_created",deleted:"subscription_deleted",expired:"subscription_expired",disabled:"subscription_disabled",sync:"subscription_sync",resubscribed:"subscription_resubscribed"},kx="subscription",Hx="0.3",zx=Se.FIVE_SECONDS*1e3,Wx="pairing",qx="0.3",Ko={wc_pairingDelete:{req:{ttl:Se.ONE_DAY,prompt:!1,tag:1e3},res:{ttl:Se.ONE_DAY,prompt:!1,tag:1001}},wc_pairingPing:{req:{ttl:Se.THIRTY_SECONDS,prompt:!1,tag:1002},res:{ttl:Se.THIRTY_SECONDS,prompt:!1,tag:1003}},unregistered_method:{req:{ttl:Se.ONE_DAY,prompt:!1,tag:0},res:{ttl:Se.ONE_DAY,prompt:!1,tag:0}}},Fn={created:"history_created",updated:"history_updated",deleted:"history_deleted",sync:"history_sync"},Vx="history",Kx="0.3",Gx="expirer",cn={created:"expirer_created",deleted:"expirer_deleted",expired:"expirer_expired",sync:"expirer_sync"},Zx="0.3",Ch="verify-api",Vg="https://verify.walletconnect.com";class Yx{constructor(e,r){this.core=e,this.logger=r,this.keychain=new Map,this.name=$x,this.version=Ox,this.initialized=!1,this.storagePrefix=pi,this.init=async()=>{if(!this.initialized){const n=await this.getKeyChain();typeof n<"u"&&(this.keychain=n),this.initialized=!0}},this.has=n=>(this.isInitialized(),this.keychain.has(n)),this.set=async(n,i)=>{this.isInitialized(),this.keychain.set(n,i),await this.persist()},this.get=n=>{this.isInitialized();const i=this.keychain.get(n);if(typeof i>"u"){const{message:o}=_e("NO_MATCHING_KEY",`${this.name}: ${n}`);throw new Error(o)}return i},this.del=async n=>{this.isInitialized(),this.keychain.delete(n),await this.persist()},this.core=e,this.logger=pt.generateChildLogger(r,this.name)}get context(){return pt.getLoggerContext(this.logger)}get storageKey(){return this.storagePrefix+this.version+"//"+this.name}async setKeyChain(e){await this.core.storage.setItem(this.storageKey,V1(e))}async getKeyChain(){const e=await this.core.storage.getItem(this.storageKey);return typeof e<"u"?K1(e):void 0}async persist(){await this.setKeyChain(this.keychain)}isInitialized(){if(!this.initialized){const{message:e}=_e("NOT_INITIALIZED",this.name);throw new Error(e)}}}class Jx{constructor(e,r,n){this.core=e,this.logger=r,this.name=Ix,this.initialized=!1,this.init=async()=>{this.initialized||(await this.keychain.init(),this.initialized=!0)},this.hasKeys=i=>(this.isInitialized(),this.keychain.has(i)),this.getClientId=async()=>{this.isInitialized();const i=await this.getClientSeed(),o=Zp(i);return Gp(o.publicKey)},this.generateKeyPair=()=>{this.isInitialized();const i=Tb();return this.setPrivateKey(i.publicKey,i.privateKey)},this.signJWT=async i=>{this.isInitialized();const o=await this.getClientSeed(),c=Zp(o),l=Lu();return await tE(l,i,Ax,c)},this.generateSharedKey=(i,o,c)=>{this.isInitialized();const l=this.getPrivateKey(i),h=Rb(l,o);return this.setSymKey(h,c)},this.setSymKey=async(i,o)=>{this.isInitialized();const c=o||Nb(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,o,c)=>{this.isInitialized();const l=B1(c),h=jo(o);if(k1(l)){const _=l.senderPublicKey,A=l.receiverPublicKey;i=await this.generateSharedKey(_,A)}const d=this.getSymKey(i),{type:v,senderPublicKey:x}=l;return Lb({type:v,symKey:d,message:h,senderPublicKey:x})},this.decode=async(i,o,c)=>{this.isInitialized();const l=jb(o,c);if(k1(l)){const h=l.receiverPublicKey,d=l.senderPublicKey;i=await this.generateSharedKey(h,d)}try{const h=this.getSymKey(i),d=Mb({symKey:h,encoded:o});return ih(d)}catch(h){this.logger.error(`Failed to decode message from topic: '${i}', clientId: '${await this.getClientId()}'`),this.logger.error(h)}},this.getPayloadType=i=>{const o=ec(i);return So(o.type)},this.getPayloadSenderPublicKey=i=>{const o=ec(i);return o.senderPublicKey?on(o.senderPublicKey,Pr):void 0},this.core=e,this.logger=pt.generateChildLogger(r,this.name),this.keychain=n||new Yx(this.core,this.logger)}get context(){return pt.getLoggerContext(this.logger)}async setPrivateKey(e,r){return await this.keychain.set(e,r),e}getPrivateKey(e){return this.keychain.get(e)}async getClientSeed(){let e="";try{e=this.keychain.get(Hg)}catch{e=Lu(),await this.keychain.set(Hg,e)}return _x(e,"base16")}getSymKey(e){return this.keychain.get(e)}isInitialized(){if(!this.initialized){const{message:e}=_e("NOT_INITIALIZED",this.name);throw new Error(e)}}}class Xx extends h_{constructor(e,r){super(e,r),this.logger=e,this.core=r,this.messages=new Map,this.name=Sx,this.version=Dx,this.initialized=!1,this.storagePrefix=pi,this.init=async()=>{if(!this.initialized){this.logger.trace("Initialized");try{const n=await this.getRelayerMessages();typeof n<"u"&&(this.messages=n),this.logger.debug(`Successfully Restored records for ${this.name}`),this.logger.trace({type:"method",method:"restore",size:this.messages.size})}catch(n){this.logger.debug(`Failed to Restore records for ${this.name}`),this.logger.error(n)}finally{this.initialized=!0}}},this.set=async(n,i)=>{this.isInitialized();const o=Os(i);let c=this.messages.get(n);return typeof c>"u"&&(c={}),typeof c[o]<"u"||(c[o]=i,this.messages.set(n,c),await this.persist()),o},this.get=n=>{this.isInitialized();let i=this.messages.get(n);return typeof i>"u"&&(i={}),i},this.has=(n,i)=>{this.isInitialized();const o=this.get(n),c=Os(i);return typeof o[c]<"u"},this.del=async n=>{this.isInitialized(),this.messages.delete(n),await this.persist()},this.logger=pt.generateChildLogger(e,this.name),this.core=r}get context(){return pt.getLoggerContext(this.logger)}get storageKey(){return this.storagePrefix+this.version+"//"+this.name}async setRelayerMessages(e){await this.core.storage.setItem(this.storageKey,V1(e))}async getRelayerMessages(){const e=await this.core.storage.getItem(this.storageKey);return typeof e<"u"?K1(e):void 0}async persist(){await this.setRelayerMessages(this.messages)}isInitialized(){if(!this.initialized){const{message:e}=_e("NOT_INITIALIZED",this.name);throw new Error(e)}}}class Qx extends f_{constructor(e,r){super(e,r),this.relayer=e,this.logger=r,this.events=new _r.exports.EventEmitter,this.name=Tx,this.queue=new Map,this.publishTimeout=Se.toMiliseconds(Se.TEN_SECONDS),this.queueTimeout=Se.toMiliseconds(Se.FIVE_SECONDS),this.needsTransportRestart=!1,this.publish=async(n,i,o)=>{this.logger.debug("Publishing Payload"),this.logger.trace({type:"method",method:"publish",params:{topic:n,message:i,opts:o}});try{const c=o?.ttl||Px,l=ku(o),h=o?.prompt||!1,d=o?.tag||0,v=o?.id||uc().toString(),x={topic:n,message:i,opts:{ttl:c,relay:l,prompt:h,tag:d,id:v}},_=setTimeout(()=>this.queue.set(v,x),this.queueTimeout);try{await await tc(this.rpcPublish(n,i,c,l,h,d,v),this.publishTimeout),clearTimeout(_),this.relayer.events.emit(Ht.publish,x)}catch{this.logger.debug("Publishing Payload stalled"),this.needsTransportRestart=!0;return}this.logger.debug("Successfully Published Payload"),this.logger.trace({type:"method",method:"publish",params:{topic:n,message:i,opts:o}})}catch(c){throw this.logger.debug("Failed to Publish Payload"),this.logger.error(c),c}},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=pt.generateChildLogger(r,this.name),this.registerEventListeners()}get context(){return pt.getLoggerContext(this.logger)}rpcPublish(e,r,n,i,o,c,l){var h,d,v,x;const _={method:rc(i.protocol).publish,params:{topic:e,message:r,ttl:n,prompt:o,tag:c},id:l};return Tr((h=_.params)==null?void 0:h.prompt)&&((d=_.params)==null||delete d.prompt),Tr((v=_.params)==null?void 0:v.tag)&&((x=_.params)==null||delete x.tag),this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"message",direction:"outgoing",request:_}),this.relayer.request(_)}onPublish(e){this.queue.delete(e)}checkQueue(){this.queue.forEach(async e=>{const{topic:r,message:n,opts:i}=e;await this.publish(r,n,i)})}registerEventListeners(){this.relayer.core.heartbeat.on(Rs.HEARTBEAT_EVENTS.pulse,()=>{if(this.needsTransportRestart){this.needsTransportRestart=!1,this.relayer.events.emit(Ht.connection_stalled);return}this.checkQueue()}),this.relayer.on(Ht.message_ack,e=>{this.onPublish(e.id.toString())})}}class e9{constructor(){this.map=new Map,this.set=(e,r)=>{const n=this.get(e);this.exists(e,r)||this.map.set(e,[...n,r])},this.get=e=>this.map.get(e)||[],this.exists=(e,r)=>this.get(e).includes(r),this.delete=(e,r)=>{if(typeof r>"u"){this.map.delete(e);return}if(!this.map.has(e))return;const n=this.get(e);if(!this.exists(e,r))return;const i=n.filter(o=>o!==r);if(!i.length){this.map.delete(e);return}this.map.set(e,i)},this.clear=()=>{this.map.clear()}}get topics(){return Array.from(this.map.keys())}}var t9=Object.defineProperty,r9=Object.defineProperties,n9=Object.getOwnPropertyDescriptors,Kg=Object.getOwnPropertySymbols,i9=Object.prototype.hasOwnProperty,s9=Object.prototype.propertyIsEnumerable,Gg=(t,e,r)=>e in t?t9(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Go=(t,e)=>{for(var r in e||(e={}))i9.call(e,r)&&Gg(t,r,e[r]);if(Kg)for(var r of Kg(e))s9.call(e,r)&&Gg(t,r,e[r]);return t},Ih=(t,e)=>r9(t,n9(e));class o9 extends g_{constructor(e,r){super(e,r),this.relayer=e,this.logger=r,this.subscriptions=new Map,this.topicMap=new e9,this.events=new _r.exports.EventEmitter,this.name=kx,this.version=Hx,this.pending=new Map,this.cached=[],this.initialized=!1,this.pendingSubscriptionWatchLabel="pending_sub_watch_label",this.pollingInterval=20,this.storagePrefix=pi,this.subscribeTimeout=1e4,this.restartInProgress=!1,this.batchSubscribeTopicsLimit=500,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restart(),this.registerEventListeners(),this.onEnable(),this.clientId=await this.relayer.core.crypto.getClientId())},this.subscribe=async(n,i)=>{await this.restartToComplete(),this.isInitialized(),this.logger.debug("Subscribing Topic"),this.logger.trace({type:"method",method:"subscribe",params:{topic:n,opts:i}});try{const o=ku(i),c={topic:n,relay:o};this.pending.set(n,c);const l=await this.rpcSubscribe(n,o);return this.onSubscribe(l,c),this.logger.debug("Successfully Subscribed Topic"),this.logger.trace({type:"method",method:"subscribe",params:{topic:n,opts:i}}),l}catch(o){throw this.logger.debug("Failed to Subscribe Topic"),this.logger.error(o),o}},this.unsubscribe=async(n,i)=>{await this.restartToComplete(),this.isInitialized(),typeof i?.id<"u"?await this.unsubscribeById(n,i.id,i):await this.unsubscribeByTopic(n,i)},this.isSubscribed=async n=>this.topics.includes(n)?!0:await new Promise((i,o)=>{const c=new Se.Watch;c.start(this.pendingSubscriptionWatchLabel);const l=setInterval(()=>{!this.pending.has(n)&&this.topics.includes(n)&&(clearInterval(l),c.stop(this.pendingSubscriptionWatchLabel),i(!0)),c.elapsed(this.pendingSubscriptionWatchLabel)>=zx&&(clearInterval(l),c.stop(this.pendingSubscriptionWatchLabel),o(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=pt.generateChildLogger(r,this.name),this.clientId=""}get context(){return pt.getLoggerContext(this.logger)}get storageKey(){return this.storagePrefix+this.version+"//"+this.name}get length(){return this.subscriptions.size}get ids(){return Array.from(this.subscriptions.keys())}get values(){return Array.from(this.subscriptions.values())}get topics(){return this.topicMap.topics}hasSubscription(e,r){let n=!1;try{n=this.getSubscription(e).topic===r}catch{}return n}onEnable(){this.cached=[],this.initialized=!0}onDisable(){this.cached=this.values,this.subscriptions.clear(),this.topicMap.clear()}async unsubscribeByTopic(e,r){const n=this.topicMap.get(e);await Promise.all(n.map(async i=>await this.unsubscribeById(e,i,r)))}async unsubscribeById(e,r,n){this.logger.debug("Unsubscribing Topic"),this.logger.trace({type:"method",method:"unsubscribe",params:{topic:e,id:r,opts:n}});try{const i=ku(n);await this.rpcUnsubscribe(e,r,i);const o=Jt("USER_DISCONNECTED",`${this.name}, ${e}`);await this.onUnsubscribe(e,r,o),this.logger.debug("Successfully Unsubscribed Topic"),this.logger.trace({type:"method",method:"unsubscribe",params:{topic:e,id:r,opts:n}})}catch(i){throw this.logger.debug("Failed to Unsubscribe Topic"),this.logger.error(i),i}}async rpcSubscribe(e,r){const n={method:rc(r.protocol).subscribe,params:{topic:e}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:n});try{await await tc(this.relayer.request(n),this.subscribeTimeout)}catch{this.logger.debug("Outgoing Relay Subscribe Payload stalled"),this.relayer.events.emit(Ht.connection_stalled)}return Os(e+this.clientId)}async rpcBatchSubscribe(e){if(!e.length)return;const r=e[0].relay,n={method:rc(r.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 tc(this.relayer.request(n),this.subscribeTimeout)}catch{this.logger.debug("Outgoing Relay Payload stalled"),this.relayer.events.emit(Ht.connection_stalled)}}rpcUnsubscribe(e,r,n){const i={method:rc(n.protocol).unsubscribe,params:{topic:e,id:r}};return this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:i}),this.relayer.request(i)}onSubscribe(e,r){this.setSubscription(e,Ih(Go({},r),{id:e})),this.pending.delete(r.topic)}onBatchSubscribe(e){e.length&&e.forEach(r=>{this.setSubscription(r.id,Go({},r)),this.pending.delete(r.topic)})}async onUnsubscribe(e,r,n){this.events.removeAllListeners(r),this.hasSubscription(r,e)&&this.deleteSubscription(r,n),await this.relayer.messages.del(e)}async setRelayerSubscriptions(e){await this.relayer.core.storage.setItem(this.storageKey,e)}async getRelayerSubscriptions(){return await this.relayer.core.storage.getItem(this.storageKey)}setSubscription(e,r){this.subscriptions.has(e)||(this.logger.debug("Setting subscription"),this.logger.trace({type:"method",method:"setSubscription",id:e,subscription:r}),this.addSubscription(e,r))}addSubscription(e,r){this.subscriptions.set(e,Go({},r)),this.topicMap.set(r.topic,e),this.events.emit(Nn.created,r)}getSubscription(e){this.logger.debug("Getting subscription"),this.logger.trace({type:"method",method:"getSubscription",id:e});const r=this.subscriptions.get(e);if(!r){const{message:n}=_e("NO_MATCHING_KEY",`${this.name}: ${e}`);throw new Error(n)}return r}deleteSubscription(e,r){this.logger.debug("Deleting subscription"),this.logger.trace({type:"method",method:"deleteSubscription",id:e,reason:r});const n=this.getSubscription(e);this.subscriptions.delete(e),this.topicMap.delete(n.topic,e),this.events.emit(Nn.deleted,Ih(Go({},n),{reason:r}))}async persist(){await this.setRelayerSubscriptions(this.values),this.events.emit(Nn.sync)}async reset(){if(this.cached.length){const e=Math.ceil(this.cached.length/this.batchSubscribeTopicsLimit);for(let r=0;r<e;r++){const n=this.cached.splice(0,this.batchSubscribeTopicsLimit);await this.batchSubscribe(n)}}this.events.emit(Nn.resubscribed)}async restore(){try{const e=await this.getRelayerSubscriptions();if(typeof e>"u"||!e.length)return;if(this.subscriptions.size){const{message:r}=_e("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(r),this.logger.error(`${this.name}: ${JSON.stringify(this.values)}`),new Error(r)}this.cached=e,this.logger.debug(`Successfully Restored subscriptions for ${this.name}`),this.logger.trace({type:"method",method:"restore",subscriptions:this.values})}catch(e){this.logger.debug(`Failed to Restore subscriptions for ${this.name}`),this.logger.error(e)}}async batchSubscribe(e){if(!e.length)return;const r=await this.rpcBatchSubscribe(e);Rn(r)&&this.onBatchSubscribe(r.map((n,i)=>Ih(Go({},e[i]),{id:n})))}async onConnect(){this.restartInProgress||(await this.restart(),this.onEnable())}onDisconnect(){this.onDisable()}async checkPending(){if(this.relayer.transportExplicitlyClosed)return;const e=[];this.pending.forEach(r=>{e.push(r)}),await this.batchSubscribe(e)}registerEventListeners(){this.relayer.core.heartbeat.on(Rs.HEARTBEAT_EVENTS.pulse,async()=>{await this.checkPending()}),this.relayer.on(Ht.connect,async()=>{await this.onConnect()}),this.relayer.on(Ht.disconnect,()=>{this.onDisconnect()}),this.events.on(Nn.created,async e=>{const r=Nn.created;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),await this.persist()}),this.events.on(Nn.deleted,async e=>{const r=Nn.deleted;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),await this.persist()})}isInitialized(){if(!this.initialized){const{message:e}=_e("NOT_INITIALIZED",this.name);throw new Error(e)}}async restartToComplete(){this.restartInProgress&&await new Promise(e=>{const r=setInterval(()=>{this.restartInProgress||(clearInterval(r),e())},this.pollingInterval)})}}var a9=Object.defineProperty,Zg=Object.getOwnPropertySymbols,c9=Object.prototype.hasOwnProperty,l9=Object.prototype.propertyIsEnumerable,Yg=(t,e,r)=>e in t?a9(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,u9=(t,e)=>{for(var r in e||(e={}))c9.call(e,r)&&Yg(t,r,e[r]);if(Zg)for(var r of Zg(e))l9.call(e,r)&&Yg(t,r,e[r]);return t};class h9 extends d_{constructor(e){super(e),this.protocol="wc",this.version=2,this.events=new _r.exports.EventEmitter,this.name=Nx,this.transportExplicitlyClosed=!1,this.initialized=!1,this.reconnecting=!1,this.connectionStatusPollingInterval=20,this.staleConnectionErrors=["socket hang up","socket stalled"],this.request=async r=>{this.logger.debug("Publishing Request Payload");try{return await this.toEstablishConnection(),await this.provider.request(r)}catch(n){throw this.logger.debug("Failed to Publish Request"),this.logger.error(n),n}},this.core=e.core,this.logger=typeof e.logger<"u"&&typeof e.logger!="string"?pt.generateChildLogger(e.logger,this.name):pt.pino(pt.getDefaultLoggerOptions({level:e.logger||Rx})),this.messages=new Xx(this.logger,e.core),this.subscriber=new o9(this,this.logger),this.publisher=new Qx(this,this.logger),this.relayUrl=e?.relayUrl||Wg,this.projectId=e.projectId,this.provider={}}async init(){this.logger.trace("Initialized"),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 ${qg}...`),await this.restartTransport(qg)}this.registerEventListeners(),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)},Ux)}get context(){return pt.getLoggerContext(this.logger)}get connected(){return this.provider.connection.connected}get connecting(){return this.provider.connection.connecting}async publish(e,r,n){this.isInitialized(),await this.publisher.publish(e,r,n),await this.recordMessageEvent({topic:e,message:r,publishedAt:Date.now()})}async subscribe(e,r){var n;this.isInitialized();let i=((n=this.subscriber.topicMap.get(e))==null?void 0:n[0])||"";return i||(await Promise.all([new Promise(o=>{this.subscriber.once(Nn.created,c=>{c.topic===e&&o()})}),new Promise(async o=>{i=await this.subscriber.subscribe(e,r),o()})]),i)}async unsubscribe(e,r){this.isInitialized(),await this.subscriber.unsubscribe(e,r)}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}off(e,r){this.events.off(e,r)}removeListener(e,r){this.events.removeListener(e,r)}async transportClose(){this.transportExplicitlyClosed=!0,this.connected&&(await this.provider.disconnect(),this.events.emit(Ht.transport_closed))}async transportOpen(e){if(this.transportExplicitlyClosed=!1,!this.reconnecting){this.relayUrl=e||this.relayUrl,this.reconnecting=!0;try{await Promise.all([new Promise(r=>{this.initialized||r(),this.subscriber.once(Nn.resubscribed,()=>{r()})}),await Promise.race([new Promise(async(r,n)=>{await tc(this.provider.connect(),1e4,`Socket stalled when trying to connect to ${this.relayUrl}`).catch(i=>n(i)).then(()=>r()).finally(()=>this.removeListener(Ht.transport_closed,this.rejectTransportOpen))}),new Promise(r=>this.once(Ht.transport_closed,this.rejectTransportOpen))])])}catch(r){this.logger.error(r);const n=r;if(!this.isConnectionStalled(n.message))throw r;this.events.emit(Ht.transport_closed)}finally{this.reconnecting=!1}}}async restartTransport(e){this.transportExplicitlyClosed||this.reconnecting||(this.relayUrl=e||this.relayUrl,this.connected&&await Promise.all([new Promise(r=>{this.provider.once(Vo.disconnect,()=>{r()})}),this.transportClose()]),await this.createProvider(),await this.transportOpen())}isConnectionStalled(e){return this.staleConnectionErrors.some(r=>e.includes(r))}rejectTransportOpen(){throw new Error("Attempt to connect to relay via `transportOpen` has stalled. Retrying...")}async createProvider(){const e=await this.core.crypto.signJWT(this.relayUrl);this.provider=new qE(new ZE(Yb({sdkVersion:Mx,protocol:this.protocol,version:this.version,relayUrl:this.relayUrl,projectId:this.projectId,auth:e,useOnCloseEvent:!0}))),this.registerProviderListeners()}async recordMessageEvent(e){const{topic:r,message:n}=e;await this.messages.set(r,n)}async shouldIgnoreMessageEvent(e){const{topic:r,message:n}=e;if(!n||n.length===0)return this.logger.debug(`Ignoring invalid/empty message: ${n}`),!0;if(!await this.subscriber.isSubscribed(r))return this.logger.debug(`Ignoring message for non-subscribed topic ${r}`),!0;const i=this.messages.has(r,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}),wh(e)){if(!e.method.endsWith(Fx))return;const r=e.params,{topic:n,message:i,publishedAt:o}=r.data,c={topic:n,message:i,publishedAt:o};this.logger.debug("Emitting Relayer Payload"),this.logger.trace(u9({type:"event",event:r.id},c)),this.events.emit(r.id,c),await this.acknowledgePayload(e),await this.onMessageEvent(c)}else Wo(e)&&this.events.emit(Ht.message_ack,e)}async onMessageEvent(e){await this.shouldIgnoreMessageEvent(e)||(this.events.emit(Ht.message,e),await this.recordMessageEvent(e))}async acknowledgePayload(e){const r=mh(e.id,!0);await this.provider.connection.send(r)}registerProviderListeners(){this.provider.on(Vo.payload,e=>this.onProviderPayload(e)),this.provider.on(Vo.connect,()=>{this.events.emit(Ht.connect)}),this.provider.on(Vo.disconnect,()=>{this.onProviderDisconnect()}),this.provider.on(Vo.error,e=>{this.logger.error(e),this.events.emit(Ht.error,e)})}registerEventListeners(){this.events.on(Ht.connection_stalled,async()=>{await this.restartTransport()})}onProviderDisconnect(){this.events.emit(Ht.disconnect),this.attemptToReconnect()}attemptToReconnect(){this.transportExplicitlyClosed||setTimeout(async()=>{await this.restartTransport()},Se.toMiliseconds(Lx))}isInitialized(){if(!this.initialized){const{message:e}=_e("NOT_INITIALIZED",this.name);throw new Error(e)}}async toEstablishConnection(){if(!this.connected){if(this.connecting)return await new Promise(e=>{const r=setInterval(()=>{this.connected&&(clearInterval(r),e())},this.connectionStatusPollingInterval)});await this.restartTransport()}}}var f9=Object.defineProperty,Jg=Object.getOwnPropertySymbols,d9=Object.prototype.hasOwnProperty,p9=Object.prototype.propertyIsEnumerable,Xg=(t,e,r)=>e in t?f9(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Qg=(t,e)=>{for(var r in e||(e={}))d9.call(e,r)&&Xg(t,r,e[r]);if(Jg)for(var r of Jg(e))p9.call(e,r)&&Xg(t,r,e[r]);return t};class gc extends p_{constructor(e,r,n,i=pi,o=void 0){super(e,r,n,i),this.core=e,this.logger=r,this.name=n,this.map=new Map,this.version=jx,this.cached=[],this.initialized=!1,this.storagePrefix=pi,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(c=>{this.getKey&&c!==null&&!Tr(c)?this.map.set(this.getKey(c),c):y6(c)?this.map.set(c.id,c):b6(c)&&this.map.set(c.topic,c)}),this.cached=[],this.initialized=!0)},this.set=async(c,l)=>{this.isInitialized(),this.map.has(c)?await this.update(c,l):(this.logger.debug("Setting value"),this.logger.trace({type:"method",method:"set",key:c,value:l}),this.map.set(c,l),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(l=>Object.keys(c).every(h=>YE(l[h],c[h]))):this.values),this.update=async(c,l)=>{this.isInitialized(),this.logger.debug("Updating value"),this.logger.trace({type:"method",method:"update",key:c,update:l});const h=Qg(Qg({},this.getData(c)),l);this.map.set(c,h),await this.persist()},this.delete=async(c,l)=>{this.isInitialized(),this.map.has(c)&&(this.logger.debug("Deleting value"),this.logger.trace({type:"method",method:"delete",key:c,reason:l}),this.map.delete(c),await this.persist())},this.logger=pt.generateChildLogger(r,this.name),this.storagePrefix=i,this.getKey=o}get context(){return pt.getLoggerContext(this.logger)}get storageKey(){return this.storagePrefix+this.version+"//"+this.name}get length(){return this.map.size}get keys(){return Array.from(this.map.keys())}get values(){return Array.from(this.map.values())}async setDataStore(e){await this.core.storage.setItem(this.storageKey,e)}async getDataStore(){return await this.core.storage.getItem(this.storageKey)}getData(e){const r=this.map.get(e);if(!r){const{message:n}=_e("NO_MATCHING_KEY",`${this.name}: ${e}`);throw this.logger.error(n),new Error(n)}return r}async persist(){await this.setDataStore(this.values)}async restore(){try{const e=await this.getDataStore();if(typeof e>"u"||!e.length)return;if(this.map.size){const{message:r}=_e("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(r),new Error(r)}this.cached=e,this.logger.debug(`Successfully Restored value for ${this.name}`),this.logger.trace({type:"method",method:"restore",value:this.values})}catch(e){this.logger.debug(`Failed to Restore value for ${this.name}`),this.logger.error(e)}}isInitialized(){if(!this.initialized){const{message:e}=_e("NOT_INITIALIZED",this.name);throw new Error(e)}}}class g9{constructor(e,r){this.core=e,this.logger=r,this.name=Wx,this.version=qx,this.events=new _r.exports,this.initialized=!1,this.storagePrefix=pi,this.ignoredPayloadTypes=[Hi],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=Lu(),i=await this.core.crypto.setSymKey(n),o=In(Se.FIVE_MINUTES),c={protocol:zg},l={topic:i,expiry:o,relay:c,active:!1},h=l6({protocol:this.core.protocol,version:this.core.version,topic:i,symKey:n,relay:c});return await this.pairings.set(i,l),await this.core.relayer.subscribe(i),this.core.expirer.set(i,o),{topic:i,uri:h}},this.pair=async n=>{this.isInitialized(),this.isValidPair(n);const{topic:i,symKey:o,relay:c}=o6(n.uri);if(this.pairings.keys.includes(i))throw new Error(`Pairing already exists: ${i}`);if(this.core.crypto.hasKeys(i))throw new Error(`Keychain already exists: ${i}`);const l=In(Se.FIVE_MINUTES),h={topic:i,relay:c,expiry:l,active:!1};return await this.pairings.set(i,h),await this.core.crypto.setSymKey(o,i),await this.core.relayer.subscribe(i,{relay:c}),this.core.expirer.set(i,l),n.activatePairing&&await this.activate({topic:i}),h},this.activate=async({topic:n})=>{this.isInitialized();const i=In(Se.THIRTY_DAYS);await this.pairings.update(n,{active:!0,expiry:i}),this.core.expirer.set(n,i)},this.ping=async n=>{this.isInitialized(),await this.isValidPing(n);const{topic:i}=n;if(this.pairings.keys.includes(i)){const o=await this.sendRequest(i,"wc_pairingPing",{}),{done:c,resolve:l,reject:h}=Ss();this.events.once(nr("pairing_ping",o),({error:d})=>{d?h(d):l()}),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",Jt("USER_DISCONNECTED")),await this.deletePairing(i))},this.sendRequest=async(n,i,o)=>{const c=zo(i,o),l=await this.core.crypto.encode(n,c),h=Ko[i].req;return this.core.history.set(n,c),this.core.relayer.publish(n,l,h),c.id},this.sendResult=async(n,i,o)=>{const c=mh(n,o),l=await this.core.crypto.encode(i,c),h=await this.core.history.get(i,n),d=Ko[h.request.method].res;await this.core.relayer.publish(i,l,d),await this.core.history.resolve(c)},this.sendError=async(n,i,o)=>{const c=hc(n,o),l=await this.core.crypto.encode(i,c),h=await this.core.history.get(i,n),d=Ko[h.request.method]?Ko[h.request.method].res:Ko.unregistered_method.res;await this.core.relayer.publish(i,l,d),await this.core.history.resolve(c)},this.deletePairing=async(n,i)=>{await this.core.relayer.unsubscribe(n),await Promise.all([this.pairings.delete(n,Jt("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=>di(i.expiry));await Promise.all(n.map(i=>this.deletePairing(i.topic)))},this.onRelayEventRequest=n=>{const{topic:i,payload:o}=n;switch(o.method){case"wc_pairingPing":return this.onPairingPingRequest(i,o);case"wc_pairingDelete":return this.onPairingDeleteRequest(i,o);default:return this.onUnknownRpcMethodRequest(i,o)}},this.onRelayEventResponse=async n=>{const{topic:i,payload:o}=n,c=(await this.core.history.get(i,o.id)).request.method;switch(c){case"wc_pairingPing":return this.onPairingPingResponse(i,o);default:return this.onUnknownRpcMethodResponse(c)}},this.onPairingPingRequest=async(n,i)=>{const{id:o}=i;try{this.isValidPing({topic:n}),await this.sendResult(o,n,!0),this.events.emit("pairing_ping",{id:o,topic:n})}catch(c){await this.sendError(o,n,c),this.logger.error(c)}},this.onPairingPingResponse=(n,i)=>{const{id:o}=i;setTimeout(()=>{Gn(i)?this.events.emit(nr("pairing_ping",o),{}):an(i)&&this.events.emit(nr("pairing_ping",o),{error:i.error})},500)},this.onPairingDeleteRequest=async(n,i)=>{const{id:o}=i;try{this.isValidDisconnect({topic:n}),await this.deletePairing(n),this.events.emit("pairing_delete",{id:o,topic:n})}catch(c){await this.sendError(o,n,c),this.logger.error(c)}},this.onUnknownRpcMethodRequest=async(n,i)=>{const{id:o,method:c}=i;try{if(this.registeredMethods.includes(c))return;const l=Jt("WC_METHOD_UNSUPPORTED",c);await this.sendError(o,n,l),this.logger.error(l)}catch(l){await this.sendError(o,n,l),this.logger.error(l)}},this.onUnknownRpcMethodResponse=n=>{this.registeredMethods.includes(n)||this.logger.error(Jt("WC_METHOD_UNSUPPORTED",n))},this.isValidPair=n=>{if(!zr(n)){const{message:i}=_e("MISSING_OR_INVALID",`pair() params: ${n}`);throw new Error(i)}if(!v6(n.uri)){const{message:i}=_e("MISSING_OR_INVALID",`pair() uri: ${n.uri}`);throw new Error(i)}},this.isValidPing=async n=>{if(!zr(n)){const{message:o}=_e("MISSING_OR_INVALID",`ping() params: ${n}`);throw new Error(o)}const{topic:i}=n;await this.isValidPairingTopic(i)},this.isValidDisconnect=async n=>{if(!zr(n)){const{message:o}=_e("MISSING_OR_INVALID",`disconnect() params: ${n}`);throw new Error(o)}const{topic:i}=n;await this.isValidPairingTopic(i)},this.isValidPairingTopic=async n=>{if(!mr(n,!1)){const{message:i}=_e("MISSING_OR_INVALID",`pairing topic should be a string: ${n}`);throw new Error(i)}if(!this.pairings.keys.includes(n)){const{message:i}=_e("NO_MATCHING_KEY",`pairing topic doesn't exist: ${n}`);throw new Error(i)}if(di(this.pairings.get(n).expiry)){await this.deletePairing(n);const{message:i}=_e("EXPIRED",`pairing topic: ${n}`);throw new Error(i)}},this.core=e,this.logger=pt.generateChildLogger(r,this.name),this.pairings=new gc(this.core,this.logger,this.name,this.storagePrefix)}get context(){return pt.getLoggerContext(this.logger)}isInitialized(){if(!this.initialized){const{message:e}=_e("NOT_INITIALIZED",this.name);throw new Error(e)}}registerRelayerEvents(){this.core.relayer.on(Ht.message,async e=>{const{topic:r,message:n}=e;if(!this.pairings.keys.includes(r)||this.ignoredPayloadTypes.includes(this.core.crypto.getPayloadType(n)))return;const i=await this.core.crypto.decode(r,n);try{wh(i)?(this.core.history.set(r,i),this.onRelayEventRequest({topic:r,payload:i})):Wo(i)&&(await this.core.history.resolve(i),await this.onRelayEventResponse({topic:r,payload:i}),this.core.history.delete(r,i.id))}catch(o){this.logger.error(o)}})}registerExpirerEvents(){this.core.expirer.on(cn.expired,async e=>{const{topic:r}=Z1(e.target);r&&this.pairings.keys.includes(r)&&(await this.deletePairing(r,!0),this.events.emit("pairing_expire",{topic:r}))})}}class m9 extends u_{constructor(e,r){super(e,r),this.core=e,this.logger=r,this.records=new Map,this.events=new _r.exports.EventEmitter,this.name=Vx,this.version=Kx,this.cached=[],this.initialized=!1,this.storagePrefix=pi,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(n=>this.records.set(n.id,n)),this.cached=[],this.registerEventListeners(),this.initialized=!0)},this.set=(n,i,o)=>{if(this.isInitialized(),this.logger.debug("Setting JSON-RPC request history record"),this.logger.trace({type:"method",method:"set",topic:n,request:i,chainId:o}),this.records.has(i.id))return;const c={id:i.id,topic:n,request:{method:i.method,params:i.params||null},chainId:o,expiry:In(Se.THIRTY_DAYS)};this.records.set(c.id,c),this.events.emit(Fn.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=an(n)?{error:n.error}:{result:n.result},this.records.set(i.id,i),this.events.emit(Fn.updated,i))},this.get=async(n,i)=>(this.isInitialized(),this.logger.debug("Getting record"),this.logger.trace({type:"method",method:"get",topic:n,id:i}),await this.getRecord(i)),this.delete=(n,i)=>{this.isInitialized(),this.logger.debug("Deleting record"),this.logger.trace({type:"method",method:"delete",id:i}),this.values.forEach(o=>{if(o.topic===n){if(typeof i<"u"&&o.id!==i)return;this.records.delete(o.id),this.events.emit(Fn.deleted,o)}})},this.exists=async(n,i)=>(this.isInitialized(),this.records.has(i)?(await this.getRecord(i)).topic===n:!1),this.on=(n,i)=>{this.events.on(n,i)},this.once=(n,i)=>{this.events.once(n,i)},this.off=(n,i)=>{this.events.off(n,i)},this.removeListener=(n,i)=>{this.events.removeListener(n,i)},this.logger=pt.generateChildLogger(r,this.name)}get context(){return pt.getLoggerContext(this.logger)}get storageKey(){return this.storagePrefix+this.version+"//"+this.name}get size(){return this.records.size}get keys(){return Array.from(this.records.keys())}get values(){return Array.from(this.records.values())}get pending(){const e=[];return this.values.forEach(r=>{if(typeof r.response<"u")return;const n={topic:r.topic,request:zo(r.request.method,r.request.params,r.id),chainId:r.chainId};return e.push(n)}),e}async setJsonRpcRecords(e){await this.core.storage.setItem(this.storageKey,e)}async getJsonRpcRecords(){return await this.core.storage.getItem(this.storageKey)}getRecord(e){this.isInitialized();const r=this.records.get(e);if(!r){const{message:n}=_e("NO_MATCHING_KEY",`${this.name}: ${e}`);throw new Error(n)}return r}async persist(){await this.setJsonRpcRecords(this.values),this.events.emit(Fn.sync)}async restore(){try{const e=await this.getJsonRpcRecords();if(typeof e>"u"||!e.length)return;if(this.records.size){const{message:r}=_e("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(r),new Error(r)}this.cached=e,this.logger.debug(`Successfully Restored records for ${this.name}`),this.logger.trace({type:"method",method:"restore",records:this.values})}catch(e){this.logger.debug(`Failed to Restore records for ${this.name}`),this.logger.error(e)}}registerEventListeners(){this.events.on(Fn.created,e=>{const r=Fn.created;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,record:e}),this.persist()}),this.events.on(Fn.updated,e=>{const r=Fn.updated;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,record:e}),this.persist()}),this.events.on(Fn.deleted,e=>{const r=Fn.deleted;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,record:e}),this.persist()}),this.core.heartbeat.on(Rs.HEARTBEAT_EVENTS.pulse,()=>{this.cleanup()})}cleanup(){try{this.records.forEach(e=>{Se.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}=_e("NOT_INITIALIZED",this.name);throw new Error(e)}}}class w9 extends m_{constructor(e,r){super(e,r),this.core=e,this.logger=r,this.expirations=new Map,this.events=new _r.exports.EventEmitter,this.name=Gx,this.version=Zx,this.cached=[],this.initialized=!1,this.storagePrefix=pi,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(n=>this.expirations.set(n.target,n)),this.cached=[],this.registerEventListeners(),this.initialized=!0)},this.has=n=>{try{const i=this.formatTarget(n);return typeof this.getExpiration(i)<"u"}catch{return!1}},this.set=(n,i)=>{this.isInitialized();const o=this.formatTarget(n),c={target:o,expiry:i};this.expirations.set(o,c),this.checkExpiry(o,c),this.events.emit(cn.created,{target:o,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),o=this.getExpiration(i);this.expirations.delete(i),this.events.emit(cn.deleted,{target:i,expiration:o})}},this.on=(n,i)=>{this.events.on(n,i)},this.once=(n,i)=>{this.events.once(n,i)},this.off=(n,i)=>{this.events.off(n,i)},this.removeListener=(n,i)=>{this.events.removeListener(n,i)},this.logger=pt.generateChildLogger(r,this.name)}get context(){return pt.getLoggerContext(this.logger)}get storageKey(){return this.storagePrefix+this.version+"//"+this.name}get length(){return this.expirations.size}get keys(){return Array.from(this.expirations.keys())}get values(){return Array.from(this.expirations.values())}formatTarget(e){if(typeof e=="string")return Jb(e);if(typeof e=="number")return Xb(e);const{message:r}=_e("UNKNOWN_TYPE",`Target type: ${typeof e}`);throw new Error(r)}async setExpirations(e){await this.core.storage.setItem(this.storageKey,e)}async getExpirations(){return await this.core.storage.getItem(this.storageKey)}async persist(){await this.setExpirations(this.values),this.events.emit(cn.sync)}async restore(){try{const e=await this.getExpirations();if(typeof e>"u"||!e.length)return;if(this.expirations.size){const{message:r}=_e("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(r),new Error(r)}this.cached=e,this.logger.debug(`Successfully Restored expirations for ${this.name}`),this.logger.trace({type:"method",method:"restore",expirations:this.values})}catch(e){this.logger.debug(`Failed to Restore expirations for ${this.name}`),this.logger.error(e)}}getExpiration(e){const r=this.expirations.get(e);if(!r){const{message:n}=_e("NO_MATCHING_KEY",`${this.name}: ${e}`);throw this.logger.error(n),new Error(n)}return r}checkExpiry(e,r){const{expiry:n}=r;Se.toMiliseconds(n)-Date.now()<=0&&this.expire(e,r)}expire(e,r){this.expirations.delete(e),this.events.emit(cn.expired,{target:e,expiration:r})}checkExpirations(){this.core.relayer.connected&&this.expirations.forEach((e,r)=>this.checkExpiry(r,e))}registerEventListeners(){this.core.heartbeat.on(Rs.HEARTBEAT_EVENTS.pulse,()=>this.checkExpirations()),this.events.on(cn.created,e=>{const r=cn.created;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),this.persist()}),this.events.on(cn.expired,e=>{const r=cn.expired;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),this.persist()}),this.events.on(cn.deleted,e=>{const r=cn.deleted;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),this.persist()})}isInitialized(){if(!this.initialized){const{message:e}=_e("NOT_INITIALIZED",this.name);throw new Error(e)}}}class v9 extends w_{constructor(e,r){super(e,r),this.projectId=e,this.logger=r,this.name=Ch,this.initialized=!1,this.init=async n=>{q1()||!Uu()||(this.verifyUrl=n?.verifyUrl||Vg,await this.createIframe())},this.register=async n=>{var i;if(this.initialized||await this.init(),!!this.iframe)try{(i=this.iframe.contentWindow)==null||i.postMessage(n.attestationId,this.verifyUrl),this.logger.info(`postMessage sent: ${n.attestationId} ${this.verifyUrl}`)}catch{}},this.resolve=async n=>{var i;if(this.isDevEnv)return"";this.logger.info(`resolving attestation: ${n.attestationId}`);const o=this.startAbortTimer(Se.FIVE_SECONDS),c=await fetch(`${this.verifyUrl}/attestation/${n.attestationId}`,{signal:this.abortController.signal});return clearTimeout(o),c.status===200?(i=await c.json())==null?void 0:i.origin:""},this.createIframe=async()=>{try{await Promise.race([new Promise((n,i)=>{if(document.getElementById(Ch))return n();const o=document.createElement("iframe");o.setAttribute("id",Ch),o.setAttribute("src",`${this.verifyUrl}/${this.projectId}`),o.style.display="none",o.addEventListener("load",()=>{this.initialized=!0,n()}),o.addEventListener("error",c=>{i(c)}),document.body.append(o),this.iframe=o}),new Promise(n=>{setTimeout(()=>n("iframe load timeout"),Se.toMiliseconds(Se.ONE_SECOND/2))})])}catch(n){this.logger.error(`Verify iframe failed to load: ${this.verifyUrl}`),this.logger.error(n)}},this.logger=pt.generateChildLogger(r,this.name),this.verifyUrl=Vg,this.abortController=new AbortController,this.isDevEnv=Mu()&&process.env.IS_VITEST}get context(){return pt.getLoggerContext(this.logger)}startAbortTimer(e){return setTimeout(()=>this.abortController.abort(),Se.toMiliseconds(e))}}var y9=Object.defineProperty,e3=Object.getOwnPropertySymbols,b9=Object.prototype.hasOwnProperty,_9=Object.prototype.propertyIsEnumerable,t3=(t,e,r)=>e in t?y9(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,r3=(t,e)=>{for(var r in e||(e={}))b9.call(e,r)&&t3(t,r,e[r]);if(e3)for(var r of e3(e))_9.call(e,r)&&t3(t,r,e[r]);return t};class Ah extends l_{constructor(e){super(e),this.protocol=kg,this.version=Ex,this.name=xh,this.events=new _r.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||Wg;const r=typeof e?.logger<"u"&&typeof e?.logger!="string"?e.logger:pt.pino(pt.getDefaultLoggerOptions({level:e?.logger||xx.logger}));this.logger=pt.generateChildLogger(r,this.name),this.heartbeat=new Rs.HeartBeat,this.crypto=new Jx(this,this.logger,e?.keychain),this.history=new m9(this,this.logger),this.expirer=new w9(this,this.logger),this.storage=e!=null&&e.storage?e.storage:new d4(r3(r3({},Cx),e?.storageOptions)),this.relayer=new h9({core:this,logger:this.logger,relayUrl:this.relayUrl,projectId:this.projectId}),this.pairing=new g9(this,this.logger),this.verify=new v9(this.projectId||"",this.logger)}static async init(e){const r=new Ah(e);await r.initialize();const n=await r.crypto.getClientId();return await r.storage.setItem(Bx,n),r}get context(){return pt.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 E9=Ah,n3="wc",i3=2,s3="client",$h=`${n3}@${i3}:${s3}:`,Oh={name:s3,logger:"error",controller:!1,relayUrl:"wss://relay.walletconnect.com"},o3="WALLETCONNECT_DEEPLINK_CHOICE",x9="proposal",a3="Proposal expired",C9="session",mc=Se.SEVEN_DAYS,I9="engine",Zo={wc_sessionPropose:{req:{ttl:Se.FIVE_MINUTES,prompt:!0,tag:1100},res:{ttl:Se.FIVE_MINUTES,prompt:!1,tag:1101}},wc_sessionSettle:{req:{ttl:Se.FIVE_MINUTES,prompt:!1,tag:1102},res:{ttl:Se.FIVE_MINUTES,prompt:!1,tag:1103}},wc_sessionUpdate:{req:{ttl:Se.ONE_DAY,prompt:!1,tag:1104},res:{ttl:Se.ONE_DAY,prompt:!1,tag:1105}},wc_sessionExtend:{req:{ttl:Se.ONE_DAY,prompt:!1,tag:1106},res:{ttl:Se.ONE_DAY,prompt:!1,tag:1107}},wc_sessionRequest:{req:{ttl:Se.FIVE_MINUTES,prompt:!0,tag:1108},res:{ttl:Se.FIVE_MINUTES,prompt:!1,tag:1109}},wc_sessionEvent:{req:{ttl:Se.FIVE_MINUTES,prompt:!0,tag:1110},res:{ttl:Se.FIVE_MINUTES,prompt:!1,tag:1111}},wc_sessionDelete:{req:{ttl:Se.ONE_DAY,prompt:!1,tag:1112},res:{ttl:Se.ONE_DAY,prompt:!1,tag:1113}},wc_sessionPing:{req:{ttl:Se.THIRTY_SECONDS,prompt:!1,tag:1114},res:{ttl:Se.THIRTY_SECONDS,prompt:!1,tag:1115}}},Sh={min:Se.FIVE_MINUTES,max:Se.SEVEN_DAYS},Yo={idle:"idle",active:"active"},A9="request",$9=["wc_sessionPropose","wc_sessionRequest","wc_authRequest"];var O9=Object.defineProperty,S9=Object.defineProperties,D9=Object.getOwnPropertyDescriptors,c3=Object.getOwnPropertySymbols,P9=Object.prototype.hasOwnProperty,T9=Object.prototype.propertyIsEnumerable,l3=(t,e,r)=>e in t?O9(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,ln=(t,e)=>{for(var r in e||(e={}))P9.call(e,r)&&l3(t,r,e[r]);if(c3)for(var r of c3(e))T9.call(e,r)&&l3(t,r,e[r]);return t},Dh=(t,e)=>S9(t,D9(e));class R9 extends y_{constructor(e){super(e),this.name=I9,this.events=new _r.exports,this.initialized=!1,this.ignoredPayloadTypes=[Hi],this.requestQueue={state:Yo.idle,requests:[]},this.requestQueueDelay=Se.ONE_SECOND,this.init=async()=>{this.initialized||(await this.cleanup(),this.registerRelayerEvents(),this.registerExpirerEvents(),this.client.core.pairing.register({methods:Object.keys(Zo)}),this.initialized=!0,setTimeout(()=>{this.requestQueue.requests=this.getPendingSessionRequests(),this.processRequestQueue()},Se.toMiliseconds(this.requestQueueDelay)))},this.connect=async r=>{this.isInitialized();const n=Dh(ln({},r),{requiredNamespaces:r.requiredNamespaces||{},optionalNamespaces:r.optionalNamespaces||{}});await this.isValidConnect(n);const{pairingTopic:i,requiredNamespaces:o,optionalNamespaces:c,sessionProperties:l,relays:h}=n;let d=i,v,x=!1;if(d&&(x=this.client.core.pairing.pairings.get(d).active),!d||!x){const{topic:F,uri:$}=await this.client.core.pairing.create();d=F,v=$}const _=await this.client.core.crypto.generateKeyPair(),A=ln({requiredNamespaces:o,optionalNamespaces:c,relays:h??[{protocol:zg}],proposer:{publicKey:_,metadata:this.client.metadata}},l&&{sessionProperties:l}),{reject:P,resolve:L,done:k}=Ss(Se.FIVE_MINUTES,a3);if(this.events.once(nr("session_connect"),async({error:F,session:$})=>{if(F)P(F);else if($){$.self.publicKey=_;const T=Dh(ln({},$),{requiredNamespaces:$.requiredNamespaces,optionalNamespaces:$.optionalNamespaces});await this.client.session.set($.topic,T),await this.setExpiry($.topic,$.expiry),d&&await this.client.core.pairing.updateMetadata({topic:d,metadata:$.peer.metadata}),L(T)}}),!d){const{message:F}=_e("NO_MATCHING_KEY",`connect() pairing topic: ${d}`);throw new Error(F)}const q=await this.sendRequest(d,"wc_sessionPropose",A),R=In(Se.FIVE_MINUTES);return await this.setProposal(q,ln({id:q,expiry:R},A)),{uri:v,approval:k}},this.pair=async r=>(this.isInitialized(),await this.client.core.pairing.pair(r)),this.approve=async r=>{this.isInitialized(),await this.isValidApprove(r);const{id:n,relayProtocol:i,namespaces:o,sessionProperties:c}=r,l=this.client.proposal.get(n);let{pairingTopic:h,proposer:d,requiredNamespaces:v,optionalNamespaces:x}=l;h=h||"",Ps(v)||(v=d6(o,"approve()"));const _=await this.client.core.crypto.generateKeyPair(),A=d.publicKey,P=await this.client.core.crypto.generateSharedKey(_,A);h&&n&&(await this.client.core.pairing.updateMetadata({topic:h,metadata:d.metadata}),await this.sendResult(n,h,{relay:{protocol:i??"irn"},responderPublicKey:_}),await this.client.proposal.delete(n,Jt("USER_DISCONNECTED")),await this.client.core.pairing.activate({topic:h}));const L=ln({relay:{protocol:i??"irn"},namespaces:o,requiredNamespaces:v,optionalNamespaces:x,pairingTopic:h,controller:{publicKey:_,metadata:this.client.metadata},expiry:In(mc)},c&&{sessionProperties:c});await this.client.core.relayer.subscribe(P),await this.sendRequest(P,"wc_sessionSettle",L);const k=Dh(ln({},L),{topic:P,pairingTopic:h,acknowledged:!1,self:L.controller,peer:{publicKey:d.publicKey,metadata:d.metadata},controller:_});return await this.client.session.set(P,k),await this.setExpiry(P,In(mc)),{topic:P,acknowledged:()=>new Promise(q=>setTimeout(()=>q(this.client.session.get(P)),500))}},this.reject=async r=>{this.isInitialized(),await this.isValidReject(r);const{id:n,reason:i}=r,{pairingTopic:o}=this.client.proposal.get(n);o&&(await this.sendError(n,o,i),await this.client.proposal.delete(n,Jt("USER_DISCONNECTED")))},this.update=async r=>{this.isInitialized(),await this.isValidUpdate(r);const{topic:n,namespaces:i}=r,o=await this.sendRequest(n,"wc_sessionUpdate",{namespaces:i}),{done:c,resolve:l,reject:h}=Ss();return this.events.once(nr("session_update",o),({error:d})=>{d?h(d):l()}),await this.client.session.update(n,{namespaces:i}),{acknowledged:c}},this.extend=async r=>{this.isInitialized(),await this.isValidExtend(r);const{topic:n}=r,i=await this.sendRequest(n,"wc_sessionExtend",{}),{done:o,resolve:c,reject:l}=Ss();return this.events.once(nr("session_extend",i),({error:h})=>{h?l(h):c()}),await this.setExpiry(n,In(mc)),{acknowledged:o}},this.request=async r=>{this.isInitialized(),await this.isValidRequest(r);const{chainId:n,request:i,topic:o,expiry:c}=r,l=await this.sendRequest(o,"wc_sessionRequest",{request:i,chainId:n},c),{done:h,resolve:d,reject:v}=Ss(c);this.events.once(nr("session_request",l),({error:_,result:A})=>{_?v(_):d(A)}),this.client.events.emit("session_request_sent",{topic:o,request:i,chainId:n,id:l});const x=await this.client.core.storage.getItem(o3);return Qb({id:l,topic:o,wcDeepLink:x}),await h()},this.respond=async r=>{this.isInitialized(),await this.isValidRespond(r);const{topic:n,response:i}=r,{id:o}=i;Gn(i)?await this.sendResult(o,n,i.result):an(i)&&await this.sendError(o,n,i.error),this.cleanupAfterResponse(r)},this.ping=async r=>{this.isInitialized(),await this.isValidPing(r);const{topic:n}=r;if(this.client.session.keys.includes(n)){const i=await this.sendRequest(n,"wc_sessionPing",{}),{done:o,resolve:c,reject:l}=Ss();this.events.once(nr("session_ping",i),({error:h})=>{h?l(h):c()}),await o()}else this.client.core.pairing.pairings.keys.includes(n)&&await this.client.core.pairing.ping({topic:n})},this.emit=async r=>{this.isInitialized(),await this.isValidEmit(r);const{topic:n,event:i,chainId:o}=r;await this.sendRequest(n,"wc_sessionEvent",{event:i,chainId:o})},this.disconnect=async r=>{this.isInitialized(),await this.isValidDisconnect(r);const{topic:n}=r;if(this.client.session.keys.includes(n)){const i=uc().toString();let o;const c=l=>{l?.id.toString()===i&&(this.client.core.relayer.events.removeListener(Ht.message_ack,c),o())};await Promise.all([new Promise(l=>{o=l,this.client.core.relayer.on(Ht.message_ack,c)}),this.sendRequest(n,"wc_sessionDelete",Jt("USER_DISCONNECTED"),void 0,i)]),await this.deleteSession(n)}else await this.client.core.pairing.disconnect({topic:n})},this.find=r=>(this.isInitialized(),this.client.session.getAll().filter(n=>m6(n,r))),this.getPendingSessionRequests=()=>(this.isInitialized(),this.client.pendingRequest.getAll()),this.cleanupDuplicatePairings=async r=>{if(r.pairingTopic)try{const n=this.client.core.pairing.pairings.get(r.pairingTopic),i=this.client.core.pairing.pairings.getAll().filter(o=>{var c,l;return((c=o.peerMetadata)==null?void 0:c.url)&&((l=o.peerMetadata)==null?void 0:l.url)===r.peer.metadata.url&&o.topic&&o.topic!==n.topic});if(i.length===0)return;this.client.logger.info(`Cleaning up ${i.length} duplicate pairing(s)`),await Promise.all(i.map(o=>this.client.core.pairing.disconnect({topic:o.topic}))),this.client.logger.info("Duplicate pairings clean up finished")}catch(n){this.client.logger.error(n)}},this.deleteSession=async(r,n)=>{const{self:i}=this.client.session.get(r);await this.client.core.relayer.unsubscribe(r),this.client.session.delete(r,Jt("USER_DISCONNECTED")),this.client.core.crypto.keychain.has(i.publicKey)&&await this.client.core.crypto.deleteKeyPair(i.publicKey),this.client.core.crypto.keychain.has(r)&&await this.client.core.crypto.deleteSymKey(r),n||this.client.core.expirer.del(r),this.client.core.storage.removeItem(o3).catch(o=>this.client.logger.warn(o))},this.deleteProposal=async(r,n)=>{await Promise.all([this.client.proposal.delete(r,Jt("USER_DISCONNECTED")),n?Promise.resolve():this.client.core.expirer.del(r)])},this.deletePendingSessionRequest=async(r,n,i=!1)=>{await Promise.all([this.client.pendingRequest.delete(r,n),i?Promise.resolve():this.client.core.expirer.del(r)]),this.requestQueue.requests=this.requestQueue.requests.filter(o=>o.id!==r),i&&(this.requestQueue.state=Yo.idle)},this.setExpiry=async(r,n)=>{this.client.session.keys.includes(r)&&await this.client.session.update(r,{expiry:n}),this.client.core.expirer.set(r,n)},this.setProposal=async(r,n)=>{await this.client.proposal.set(r,n),this.client.core.expirer.set(r,n.expiry)},this.setPendingSessionRequest=async r=>{const n=Zo.wc_sessionRequest.req.ttl,{id:i,topic:o,params:c}=r;await this.client.pendingRequest.set(i,{id:i,topic:o,params:c}),n&&this.client.core.expirer.set(i,In(n))},this.sendRequest=async(r,n,i,o,c)=>{const l=zo(n,i);if(Uu()&&$9.includes(n)){const v=Os(JSON.stringify(l));await this.client.core.verify.register({attestationId:v})}const h=await this.client.core.crypto.encode(r,l),d=Zo[n].req;return o&&(d.ttl=o),c&&(d.id=c),this.client.core.history.set(r,l),this.client.core.relayer.publish(r,h,d),l.id},this.sendResult=async(r,n,i)=>{const o=mh(r,i),c=await this.client.core.crypto.encode(n,o),l=await this.client.core.history.get(n,r),h=Zo[l.request.method].res;this.client.core.relayer.publish(n,c,h),await this.client.core.history.resolve(o)},this.sendError=async(r,n,i)=>{const o=hc(r,i),c=await this.client.core.crypto.encode(n,o),l=await this.client.core.history.get(n,r),h=Zo[l.request.method].res;this.client.core.relayer.publish(n,c,h),await this.client.core.history.resolve(o)},this.cleanup=async()=>{const r=[],n=[];this.client.session.getAll().forEach(i=>{di(i.expiry)&&r.push(i.topic)}),this.client.proposal.getAll().forEach(i=>{di(i.expiry)&&n.push(i.id)}),await Promise.all([...r.map(i=>this.deleteSession(i)),...n.map(i=>this.deleteProposal(i))])},this.onRelayEventRequest=r=>{const{topic:n,payload:i}=r,o=i.method;switch(o){case"wc_sessionPropose":return this.onSessionProposeRequest(n,i);case"wc_sessionSettle":return this.onSessionSettleRequest(n,i);case"wc_sessionUpdate":return this.onSessionUpdateRequest(n,i);case"wc_sessionExtend":return this.onSessionExtendRequest(n,i);case"wc_sessionPing":return this.onSessionPingRequest(n,i);case"wc_sessionDelete":return this.onSessionDeleteRequest(n,i);case"wc_sessionRequest":return this.onSessionRequest(n,i);case"wc_sessionEvent":return this.onSessionEventRequest(n,i);default:return this.client.logger.info(`Unsupported request method ${o}`)}},this.onRelayEventResponse=async r=>{const{topic:n,payload:i}=r,o=(await this.client.core.history.get(n,i.id)).request.method;switch(o){case"wc_sessionPropose":return this.onSessionProposeResponse(n,i);case"wc_sessionSettle":return this.onSessionSettleResponse(n,i);case"wc_sessionUpdate":return this.onSessionUpdateResponse(n,i);case"wc_sessionExtend":return this.onSessionExtendResponse(n,i);case"wc_sessionPing":return this.onSessionPingResponse(n,i);case"wc_sessionRequest":return this.onSessionRequestResponse(n,i);default:return this.client.logger.info(`Unsupported response method ${o}`)}},this.onRelayEventUnknownPayload=r=>{const{topic:n}=r,{message:i}=_e("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(r,n)=>{const{params:i,id:o}=n;try{this.isValidConnect(ln({},n.params));const c=In(Se.FIVE_MINUTES),l=ln({id:o,pairingTopic:r,expiry:c},i);await this.setProposal(o,l);const h=Os(JSON.stringify(n)),d=await this.getVerifyContext(h,l.proposer.metadata);this.client.events.emit("session_proposal",{id:o,params:l,verifyContext:d})}catch(c){await this.sendError(o,r,c),this.client.logger.error(c)}},this.onSessionProposeResponse=async(r,n)=>{const{id:i}=n;if(Gn(n)){const{result:o}=n;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",result:o});const c=this.client.proposal.get(i);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",proposal:c});const l=c.proposer.publicKey;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",selfPublicKey:l});const h=o.responderPublicKey;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",peerPublicKey:h});const d=await this.client.core.crypto.generateSharedKey(l,h);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",sessionTopic:d});const v=await this.client.core.relayer.subscribe(d);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",subscriptionId:v}),await this.client.core.pairing.activate({topic:r})}else an(n)&&(await this.client.proposal.delete(i,Jt("USER_DISCONNECTED")),this.events.emit(nr("session_connect"),{error:n.error}))},this.onSessionSettleRequest=async(r,n)=>{const{id:i,params:o}=n;try{this.isValidSessionSettleRequest(o);const{relay:c,controller:l,expiry:h,namespaces:d,requiredNamespaces:v,optionalNamespaces:x,sessionProperties:_,pairingTopic:A}=n.params,P=ln({topic:r,relay:c,expiry:h,namespaces:d,acknowledged:!0,pairingTopic:A,requiredNamespaces:v,optionalNamespaces:x,controller:l.publicKey,self:{publicKey:"",metadata:this.client.metadata},peer:{publicKey:l.publicKey,metadata:l.metadata}},_&&{sessionProperties:_});await this.sendResult(n.id,r,!0),this.events.emit(nr("session_connect"),{session:P}),this.cleanupDuplicatePairings(P)}catch(c){await this.sendError(i,r,c),this.client.logger.error(c)}},this.onSessionSettleResponse=async(r,n)=>{const{id:i}=n;Gn(n)?(await this.client.session.update(r,{acknowledged:!0}),this.events.emit(nr("session_approve",i),{})):an(n)&&(await this.client.session.delete(r,Jt("USER_DISCONNECTED")),this.events.emit(nr("session_approve",i),{error:n.error}))},this.onSessionUpdateRequest=async(r,n)=>{const{params:i,id:o}=n;try{this.isValidUpdate(ln({topic:r},i)),await this.client.session.update(r,{namespaces:i.namespaces}),await this.sendResult(o,r,!0),this.client.events.emit("session_update",{id:o,topic:r,params:i})}catch(c){await this.sendError(o,r,c),this.client.logger.error(c)}},this.onSessionUpdateResponse=(r,n)=>{const{id:i}=n;Gn(n)?this.events.emit(nr("session_update",i),{}):an(n)&&this.events.emit(nr("session_update",i),{error:n.error})},this.onSessionExtendRequest=async(r,n)=>{const{id:i}=n;try{this.isValidExtend({topic:r}),await this.setExpiry(r,In(mc)),await this.sendResult(i,r,!0),this.client.events.emit("session_extend",{id:i,topic:r})}catch(o){await this.sendError(i,r,o),this.client.logger.error(o)}},this.onSessionExtendResponse=(r,n)=>{const{id:i}=n;Gn(n)?this.events.emit(nr("session_extend",i),{}):an(n)&&this.events.emit(nr("session_extend",i),{error:n.error})},this.onSessionPingRequest=async(r,n)=>{const{id:i}=n;try{this.isValidPing({topic:r}),await this.sendResult(i,r,!0),this.client.events.emit("session_ping",{id:i,topic:r})}catch(o){await this.sendError(i,r,o),this.client.logger.error(o)}},this.onSessionPingResponse=(r,n)=>{const{id:i}=n;setTimeout(()=>{Gn(n)?this.events.emit(nr("session_ping",i),{}):an(n)&&this.events.emit(nr("session_ping",i),{error:n.error})},500)},this.onSessionDeleteRequest=async(r,n)=>{const{id:i}=n;try{this.isValidDisconnect({topic:r,reason:n.params}),await Promise.all([new Promise(o=>{this.client.core.relayer.once(Ht.publish,async()=>{o(await this.deleteSession(r))})}),this.sendResult(i,r,!0)]),this.client.events.emit("session_delete",{id:i,topic:r})}catch(o){this.client.logger.error(o)}},this.onSessionRequest=async(r,n)=>{const{id:i,params:o}=n;try{this.isValidRequest(ln({topic:r},o)),await this.setPendingSessionRequest({id:i,topic:r,params:o}),this.addRequestToQueue({id:i,topic:r,params:o}),await this.processRequestQueue()}catch(c){await this.sendError(i,r,c),this.client.logger.error(c)}},this.onSessionRequestResponse=(r,n)=>{const{id:i}=n;Gn(n)?this.events.emit(nr("session_request",i),{result:n.result}):an(n)&&this.events.emit(nr("session_request",i),{error:n.error})},this.onSessionEventRequest=async(r,n)=>{const{id:i,params:o}=n;try{this.isValidEmit(ln({topic:r},o)),this.client.events.emit("session_event",{id:i,topic:r,params:o})}catch(c){await this.sendError(i,r,c),this.client.logger.error(c)}},this.addRequestToQueue=r=>{this.requestQueue.requests.push(r)},this.cleanupAfterResponse=r=>{this.deletePendingSessionRequest(r.response.id,{message:"fulfilled",code:0}),setTimeout(()=>{this.requestQueue.state=Yo.idle,this.processRequestQueue()},Se.toMiliseconds(this.requestQueueDelay))},this.processRequestQueue=async()=>{if(this.requestQueue.state===Yo.active){this.client.logger.info("session request queue is already active.");return}const r=this.requestQueue.requests[0];if(!r){this.client.logger.info("session request queue is empty.");return}try{const{id:n,topic:i,params:o}=r,c=Os(JSON.stringify({id:n,params:o})),l=this.client.session.get(i),h=await this.getVerifyContext(c,l.peer.metadata);this.requestQueue.state=Yo.active,this.client.events.emit("session_request",{id:n,topic:i,params:o,verifyContext:h})}catch(n){this.client.logger.error(n)}},this.isValidConnect=async r=>{if(!zr(r)){const{message:h}=_e("MISSING_OR_INVALID",`connect() params: ${JSON.stringify(r)}`);throw new Error(h)}const{pairingTopic:n,requiredNamespaces:i,optionalNamespaces:o,sessionProperties:c,relays:l}=r;if(Tr(n)||await this.isValidPairingTopic(n),!O6(l,!0)){const{message:h}=_e("MISSING_OR_INVALID",`connect() relays: ${l}`);throw new Error(h)}!Tr(i)&&Ps(i)!==0&&this.validateNamespaces(i,"requiredNamespaces"),!Tr(o)&&Ps(o)!==0&&this.validateNamespaces(o,"optionalNamespaces"),Tr(c)||this.validateSessionProps(c,"sessionProperties")},this.validateNamespaces=(r,n)=>{const i=$6(r,"connect()",n);if(i)throw new Error(i.message)},this.isValidApprove=async r=>{if(!zr(r))throw new Error(_e("MISSING_OR_INVALID",`approve() params: ${r}`).message);const{id:n,namespaces:i,relayProtocol:o,sessionProperties:c}=r;await this.isValidProposalId(n);const l=this.client.proposal.get(n),h=sc(i,"approve()");if(h)throw new Error(h.message);const d=rp(l.requiredNamespaces,i,"approve()");if(d)throw new Error(d.message);if(!mr(o,!0)){const{message:v}=_e("MISSING_OR_INVALID",`approve() relayProtocol: ${o}`);throw new Error(v)}Tr(c)||this.validateSessionProps(c,"sessionProperties")},this.isValidReject=async r=>{if(!zr(r)){const{message:o}=_e("MISSING_OR_INVALID",`reject() params: ${r}`);throw new Error(o)}const{id:n,reason:i}=r;if(await this.isValidProposalId(n),!D6(i)){const{message:o}=_e("MISSING_OR_INVALID",`reject() reason: ${JSON.stringify(i)}`);throw new Error(o)}},this.isValidSessionSettleRequest=r=>{if(!zr(r)){const{message:d}=_e("MISSING_OR_INVALID",`onSessionSettleRequest() params: ${r}`);throw new Error(d)}const{relay:n,controller:i,namespaces:o,expiry:c}=r;if(!ep(n)){const{message:d}=_e("MISSING_OR_INVALID","onSessionSettleRequest() relay protocol should be a string");throw new Error(d)}const l=_6(i,"onSessionSettleRequest()");if(l)throw new Error(l.message);const h=sc(o,"onSessionSettleRequest()");if(h)throw new Error(h.message);if(di(c)){const{message:d}=_e("EXPIRED","onSessionSettleRequest()");throw new Error(d)}},this.isValidUpdate=async r=>{if(!zr(r)){const{message:h}=_e("MISSING_OR_INVALID",`update() params: ${r}`);throw new Error(h)}const{topic:n,namespaces:i}=r;await this.isValidSessionTopic(n);const o=this.client.session.get(n),c=sc(i,"update()");if(c)throw new Error(c.message);const l=rp(o.requiredNamespaces,i,"update()");if(l)throw new Error(l.message)},this.isValidExtend=async r=>{if(!zr(r)){const{message:i}=_e("MISSING_OR_INVALID",`extend() params: ${r}`);throw new Error(i)}const{topic:n}=r;await this.isValidSessionTopic(n)},this.isValidRequest=async r=>{if(!zr(r)){const{message:h}=_e("MISSING_OR_INVALID",`request() params: ${r}`);throw new Error(h)}const{topic:n,request:i,chainId:o,expiry:c}=r;await this.isValidSessionTopic(n);const{namespaces:l}=this.client.session.get(n);if(!tp(l,o)){const{message:h}=_e("MISSING_OR_INVALID",`request() chainId: ${o}`);throw new Error(h)}if(!P6(i)){const{message:h}=_e("MISSING_OR_INVALID",`request() ${JSON.stringify(i)}`);throw new Error(h)}if(!N6(l,o,i.method)){const{message:h}=_e("MISSING_OR_INVALID",`request() method: ${i.method}`);throw new Error(h)}if(c&&!U6(c,Sh)){const{message:h}=_e("MISSING_OR_INVALID",`request() expiry: ${c}. Expiry must be a number (in seconds) between ${Sh.min} and ${Sh.max}`);throw new Error(h)}},this.isValidRespond=async r=>{if(!zr(r)){const{message:o}=_e("MISSING_OR_INVALID",`respond() params: ${r}`);throw new Error(o)}const{topic:n,response:i}=r;if(await this.isValidSessionTopic(n),!T6(i)){const{message:o}=_e("MISSING_OR_INVALID",`respond() response: ${JSON.stringify(i)}`);throw new Error(o)}},this.isValidPing=async r=>{if(!zr(r)){const{message:i}=_e("MISSING_OR_INVALID",`ping() params: ${r}`);throw new Error(i)}const{topic:n}=r;await this.isValidSessionOrPairingTopic(n)},this.isValidEmit=async r=>{if(!zr(r)){const{message:l}=_e("MISSING_OR_INVALID",`emit() params: ${r}`);throw new Error(l)}const{topic:n,event:i,chainId:o}=r;await this.isValidSessionTopic(n);const{namespaces:c}=this.client.session.get(n);if(!tp(c,o)){const{message:l}=_e("MISSING_OR_INVALID",`emit() chainId: ${o}`);throw new Error(l)}if(!R6(i)){const{message:l}=_e("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(i)}`);throw new Error(l)}if(!F6(c,o,i.name)){const{message:l}=_e("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(i)}`);throw new Error(l)}},this.isValidDisconnect=async r=>{if(!zr(r)){const{message:i}=_e("MISSING_OR_INVALID",`disconnect() params: ${r}`);throw new Error(i)}const{topic:n}=r;await this.isValidSessionOrPairingTopic(n)},this.getVerifyContext=async(r,n)=>{const i={verified:{verifyUrl:n.verifyUrl||"",validation:"UNKNOWN",origin:n.url||""}};try{const o=await this.client.core.verify.resolve({attestationId:r,verifyUrl:n.verifyUrl});o&&(i.verified.origin=o,i.verified.validation=o===n.url?"VALID":"INVALID")}catch(o){this.client.logger.error(o)}return this.client.logger.info(`Verify context: ${JSON.stringify(i)}`),i},this.validateSessionProps=(r,n)=>{Object.values(r).forEach(i=>{if(!mr(i,!1)){const{message:o}=_e("MISSING_OR_INVALID",`${n} must be in Record<string, string> format. Received: ${JSON.stringify(i)}`);throw new Error(o)}})}}isInitialized(){if(!this.initialized){const{message:e}=_e("NOT_INITIALIZED",this.name);throw new Error(e)}}registerRelayerEvents(){this.client.core.relayer.on(Ht.message,async e=>{const{topic:r,message:n}=e;if(this.ignoredPayloadTypes.includes(this.client.core.crypto.getPayloadType(n)))return;const i=await this.client.core.crypto.decode(r,n);try{wh(i)?(this.client.core.history.set(r,i),this.onRelayEventRequest({topic:r,payload:i})):Wo(i)?(await this.client.core.history.resolve(i),await this.onRelayEventResponse({topic:r,payload:i}),this.client.core.history.delete(r,i.id)):this.onRelayEventUnknownPayload({topic:r,payload:i})}catch(o){this.client.logger.error(o)}})}registerExpirerEvents(){this.client.core.expirer.on(cn.expired,async e=>{const{topic:r,id:n}=Z1(e.target);if(n&&this.client.pendingRequest.keys.includes(n))return await this.deletePendingSessionRequest(n,_e("EXPIRED"),!0);r?this.client.session.keys.includes(r)&&(await this.deleteSession(r,!0),this.client.events.emit("session_expire",{topic:r})):n&&(await this.deleteProposal(n,!0),this.client.events.emit("proposal_expire",{id:n}))})}isValidPairingTopic(e){if(!mr(e,!1)){const{message:r}=_e("MISSING_OR_INVALID",`pairing topic should be a string: ${e}`);throw new Error(r)}if(!this.client.core.pairing.pairings.keys.includes(e)){const{message:r}=_e("NO_MATCHING_KEY",`pairing topic doesn't exist: ${e}`);throw new Error(r)}if(di(this.client.core.pairing.pairings.get(e).expiry)){const{message:r}=_e("EXPIRED",`pairing topic: ${e}`);throw new Error(r)}}async isValidSessionTopic(e){if(!mr(e,!1)){const{message:r}=_e("MISSING_OR_INVALID",`session topic should be a string: ${e}`);throw new Error(r)}if(!this.client.session.keys.includes(e)){const{message:r}=_e("NO_MATCHING_KEY",`session topic doesn't exist: ${e}`);throw new Error(r)}if(di(this.client.session.get(e).expiry)){await this.deleteSession(e);const{message:r}=_e("EXPIRED",`session topic: ${e}`);throw new Error(r)}}async isValidSessionOrPairingTopic(e){if(this.client.session.keys.includes(e))await this.isValidSessionTopic(e);else if(this.client.core.pairing.pairings.keys.includes(e))this.isValidPairingTopic(e);else if(mr(e,!1)){const{message:r}=_e("NO_MATCHING_KEY",`session or pairing topic doesn't exist: ${e}`);throw new Error(r)}else{const{message:r}=_e("MISSING_OR_INVALID",`session or pairing topic should be a string: ${e}`);throw new Error(r)}}async isValidProposalId(e){if(!S6(e)){const{message:r}=_e("MISSING_OR_INVALID",`proposal id should be a number: ${e}`);throw new Error(r)}if(!this.client.proposal.keys.includes(e)){const{message:r}=_e("NO_MATCHING_KEY",`proposal id doesn't exist: ${e}`);throw new Error(r)}if(di(this.client.proposal.get(e).expiry)){await this.deleteProposal(e);const{message:r}=_e("EXPIRED",`proposal id: ${e}`);throw new Error(r)}}}class N9 extends gc{constructor(e,r){super(e,r,x9,$h),this.core=e,this.logger=r}}class F9 extends gc{constructor(e,r){super(e,r,C9,$h),this.core=e,this.logger=r}}class L9 extends gc{constructor(e,r){super(e,r,A9,$h,n=>n.id),this.core=e,this.logger=r}}class Ph extends v_{constructor(e){super(e),this.protocol=n3,this.version=i3,this.name=Oh.name,this.events=new _r.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||Oh.name,this.metadata=e?.metadata||Vb();const r=typeof e?.logger<"u"&&typeof e?.logger!="string"?e.logger:pt.pino(pt.getDefaultLoggerOptions({level:e?.logger||Oh.logger}));this.core=e?.core||new E9(e),this.logger=pt.generateChildLogger(r,this.name),this.session=new F9(this.core,this.logger),this.proposal=new N9(this.core,this.logger),this.pendingRequest=new L9(this.core,this.logger),this.engine=new R9(this)}static async init(e){const r=new Ph(e);return await r.initialize(),r}get context(){return pt.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 Th={exports:{}};(function(t,e){var r=typeof self<"u"?self:gr,n=function(){function o(){this.fetch=!1,this.DOMException=r.DOMException}return o.prototype=r,new o}();(function(o){(function(c){var l={searchParams:"URLSearchParams"in o,iterable:"Symbol"in o&&"iterator"in Symbol,blob:"FileReader"in o&&"Blob"in o&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in o,arrayBuffer:"ArrayBuffer"in o};function h(O){return O&&DataView.prototype.isPrototypeOf(O)}if(l.arrayBuffer)var d=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],v=ArrayBuffer.isView||function(O){return O&&d.indexOf(Object.prototype.toString.call(O))>-1};function x(O){if(typeof O!="string"&&(O=String(O)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(O))throw new TypeError("Invalid character in header field name");return O.toLowerCase()}function _(O){return typeof O!="string"&&(O=String(O)),O}function A(O){var U={next:function(){var ce=O.shift();return{done:ce===void 0,value:ce}}};return l.iterable&&(U[Symbol.iterator]=function(){return U}),U}function P(O){this.map={},O instanceof P?O.forEach(function(U,ce){this.append(ce,U)},this):Array.isArray(O)?O.forEach(function(U){this.append(U[0],U[1])},this):O&&Object.getOwnPropertyNames(O).forEach(function(U){this.append(U,O[U])},this)}P.prototype.append=function(O,U){O=x(O),U=_(U);var ce=this.map[O];this.map[O]=ce?ce+", "+U:U},P.prototype.delete=function(O){delete this.map[x(O)]},P.prototype.get=function(O){return O=x(O),this.has(O)?this.map[O]:null},P.prototype.has=function(O){return this.map.hasOwnProperty(x(O))},P.prototype.set=function(O,U){this.map[x(O)]=_(U)},P.prototype.forEach=function(O,U){for(var ce in this.map)this.map.hasOwnProperty(ce)&&O.call(U,this.map[ce],ce,this)},P.prototype.keys=function(){var O=[];return this.forEach(function(U,ce){O.push(ce)}),A(O)},P.prototype.values=function(){var O=[];return this.forEach(function(U){O.push(U)}),A(O)},P.prototype.entries=function(){var O=[];return this.forEach(function(U,ce){O.push([ce,U])}),A(O)},l.iterable&&(P.prototype[Symbol.iterator]=P.prototype.entries);function L(O){if(O.bodyUsed)return Promise.reject(new TypeError("Already read"));O.bodyUsed=!0}function k(O){return new Promise(function(U,ce){O.onload=function(){U(O.result)},O.onerror=function(){ce(O.error)}})}function q(O){var U=new FileReader,ce=k(U);return U.readAsArrayBuffer(O),ce}function R(O){var U=new FileReader,ce=k(U);return U.readAsText(O),ce}function F(O){for(var U=new Uint8Array(O),ce=new Array(U.length),le=0;le<U.length;le++)ce[le]=String.fromCharCode(U[le]);return ce.join("")}function $(O){if(O.slice)return O.slice(0);var U=new Uint8Array(O.byteLength);return U.set(new Uint8Array(O)),U.buffer}function T(){return this.bodyUsed=!1,this._initBody=function(O){this._bodyInit=O,O?typeof O=="string"?this._bodyText=O:l.blob&&Blob.prototype.isPrototypeOf(O)?this._bodyBlob=O:l.formData&&FormData.prototype.isPrototypeOf(O)?this._bodyFormData=O:l.searchParams&&URLSearchParams.prototype.isPrototypeOf(O)?this._bodyText=O.toString():l.arrayBuffer&&l.blob&&h(O)?(this._bodyArrayBuffer=$(O.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):l.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(O)||v(O))?this._bodyArrayBuffer=$(O):this._bodyText=O=Object.prototype.toString.call(O):this._bodyText="",this.headers.get("content-type")||(typeof O=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):l.searchParams&&URLSearchParams.prototype.isPrototypeOf(O)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},l.blob&&(this.blob=function(){var O=L(this);if(O)return O;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?L(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(q)}),this.text=function(){var O=L(this);if(O)return O;if(this._bodyBlob)return R(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(F(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},l.formData&&(this.formData=function(){return this.text().then(Z)}),this.json=function(){return this.text().then(JSON.parse)},this}var C=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function f(O){var U=O.toUpperCase();return C.indexOf(U)>-1?U:O}function E(O,U){U=U||{};var ce=U.body;if(O instanceof E){if(O.bodyUsed)throw new TypeError("Already read");this.url=O.url,this.credentials=O.credentials,U.headers||(this.headers=new P(O.headers)),this.method=O.method,this.mode=O.mode,this.signal=O.signal,!ce&&O._bodyInit!=null&&(ce=O._bodyInit,O.bodyUsed=!0)}else this.url=String(O);if(this.credentials=U.credentials||this.credentials||"same-origin",(U.headers||!this.headers)&&(this.headers=new P(U.headers)),this.method=f(U.method||this.method||"GET"),this.mode=U.mode||this.mode||null,this.signal=U.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&ce)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(ce)}E.prototype.clone=function(){return new E(this,{body:this._bodyInit})};function Z(O){var U=new FormData;return O.trim().split("&").forEach(function(ce){if(ce){var le=ce.split("="),re=le.shift().replace(/\+/g," "),ne=le.join("=").replace(/\+/g," ");U.append(decodeURIComponent(re),decodeURIComponent(ne))}}),U}function z(O){var U=new P,ce=O.replace(/\r?\n[\t ]+/g," ");return ce.split(/\r?\n/).forEach(function(le){var re=le.split(":"),ne=re.shift().trim();if(ne){var ae=re.join(":").trim();U.append(ne,ae)}}),U}T.call(E.prototype);function ee(O,U){U||(U={}),this.type="default",this.status=U.status===void 0?200:U.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in U?U.statusText:"OK",this.headers=new P(U.headers),this.url=U.url||"",this._initBody(O)}T.call(ee.prototype),ee.prototype.clone=function(){return new ee(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new P(this.headers),url:this.url})},ee.error=function(){var O=new ee(null,{status:0,statusText:""});return O.type="error",O};var de=[301,302,303,307,308];ee.redirect=function(O,U){if(de.indexOf(U)===-1)throw new RangeError("Invalid status code");return new ee(null,{status:U,headers:{location:O}})},c.DOMException=o.DOMException;try{new c.DOMException}catch{c.DOMException=function(U,ce){this.message=U,this.name=ce;var le=Error(U);this.stack=le.stack},c.DOMException.prototype=Object.create(Error.prototype),c.DOMException.prototype.constructor=c.DOMException}function me(O,U){return new Promise(function(ce,le){var re=new E(O,U);if(re.signal&&re.signal.aborted)return le(new c.DOMException("Aborted","AbortError"));var ne=new XMLHttpRequest;function ae(){ne.abort()}ne.onload=function(){var ie={status:ne.status,statusText:ne.statusText,headers:z(ne.getAllResponseHeaders()||"")};ie.url="responseURL"in ne?ne.responseURL:ie.headers.get("X-Request-URL");var Oe="response"in ne?ne.response:ne.responseText;ce(new ee(Oe,ie))},ne.onerror=function(){le(new TypeError("Network request failed"))},ne.ontimeout=function(){le(new TypeError("Network request failed"))},ne.onabort=function(){le(new c.DOMException("Aborted","AbortError"))},ne.open(re.method,re.url,!0),re.credentials==="include"?ne.withCredentials=!0:re.credentials==="omit"&&(ne.withCredentials=!1),"responseType"in ne&&l.blob&&(ne.responseType="blob"),re.headers.forEach(function(ie,Oe){ne.setRequestHeader(Oe,ie)}),re.signal&&(re.signal.addEventListener("abort",ae),ne.onreadystatechange=function(){ne.readyState===4&&re.signal.removeEventListener("abort",ae)}),ne.send(typeof re._bodyInit>"u"?null:re._bodyInit)})}return me.polyfill=!0,o.fetch||(o.fetch=me,o.Headers=P,o.Request=E,o.Response=ee),c.Headers=P,c.Request=E,c.Response=ee,c.fetch=me,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,t.exports=e})(Th,Th.exports);var u3=lv(Th.exports);const h3={headers:{Accept:"application/json","Content-Type":"application/json"},method:"POST"},f3=10;class Ki{constructor(e,r=!1){if(this.url=e,this.disableProviderPing=r,this.events=new _r.exports.EventEmitter,this.isAvailable=!1,this.registering=!1,!ag(e))throw new Error(`Provided URL is not compatible with HTTP connection: ${e}`);this.url=e,this.disableProviderPing=r}get connected(){return this.isAvailable}get connecting(){return this.registering}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}off(e,r){this.events.off(e,r)}removeListener(e,r){this.events.removeListener(e,r)}async open(e=this.url){await this.register(e)}async close(){if(!this.isAvailable)throw new Error("Connection already closed");this.onClose()}async send(e,r){this.isAvailable||await this.register();try{const n=jo(e),o=await(await u3(this.url,Object.assign(Object.assign({},h3),{body:n}))).json();this.onPayload({data:o})}catch(n){this.onError(e.id,n)}}async register(e=this.url){if(!ag(e))throw new Error(`Provided URL is not compatible with HTTP connection: ${e}`);if(this.registering){const r=this.events.getMaxListeners();return(this.events.listenerCount("register_error")>=r||this.events.listenerCount("open")>=r)&&this.events.setMaxListeners(r+1),new Promise((n,i)=>{this.events.once("register_error",o=>{this.resetMaxListeners(),i(o)}),this.events.once("open",()=>{if(this.resetMaxListeners(),typeof this.isAvailable>"u")return i(new Error("HTTP connection is missing or invalid"));n()})})}this.url=e,this.registering=!0;try{if(!this.disableProviderPing){const r=jo({id:1,jsonrpc:"2.0",method:"test",params:[]});await u3(e,Object.assign(Object.assign({},h3),{body:r}))}this.onOpen()}catch(r){const n=this.parseError(r);throw this.events.emit("register_error",n),this.onClose(),n}}onOpen(){this.isAvailable=!0,this.registering=!1,this.events.emit("open")}onClose(){this.isAvailable=!1,this.registering=!1,this.events.emit("close")}onPayload(e){if(typeof e.data>"u")return;const r=typeof e.data=="string"?ih(e.data):e.data;this.events.emit("payload",r)}onError(e,r){const n=this.parseError(r),i=n.message||n.toString(),o=hc(e,i);this.events.emit("payload",o)}parseError(e,r=this.url){return Qp(e,r,"HTTP")}resetMaxListeners(){this.events.getMaxListeners()>f3&&this.events.setMaxListeners(f3)}}class Gi extends sg{constructor(e){super(e),this.events=new _r.exports.EventEmitter,this.hasRegisteredEventListeners=!1,this.connection=this.setConnection(e),this.connection.connected&&this.registerEventListeners()}async connect(e=this.connection){await this.open(e)}async disconnect(){await this.close()}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}off(e,r){this.events.off(e,r)}removeListener(e,r){this.events.removeListener(e,r)}async request(e,r){return this.requestStrict(zo(e.method,e.params||[],e.id||uc().toString()),r)}async requestStrict(e,r){return new Promise(async(n,i)=>{if(!this.connection.connected)try{await this.open()}catch(o){i(o)}this.events.on(`${e.id}`,o=>{an(o)?i(o.error):n(o.result)});try{await this.connection.send(e,r)}catch(o){i(o)}})}setConnection(e=this.connection){return e}onPayload(e){this.events.emit("payload",e),Wo(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 d3="error",M9="wss://relay.walletconnect.com",U9="wc",j9="universal_provider",p3=`${U9}@2:${j9}:`,B9="https://rpc.walletconnect.com/v1",gi={DEFAULT_CHAIN_CHANGED:"default_chain_changed"};var Jo=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Rh={exports:{}};/**
73
73
  * @license
74
74
  * Lodash <https://lodash.com/>
75
75
  * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
76
76
  * Released under MIT license <https://lodash.com/license>
77
77
  * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
78
78
  * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
79
- */(function(t,e){(function(){var r,n="4.17.21",i=200,o="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",c="Expected a function",l="Invalid `variable` option passed into `_.template`",h="__lodash_hash_undefined__",f=500,v="__lodash_placeholder__",E=1,_=2,S=4,P=1,j=2,H=1,Z=2,R=4,L=8,$=16,T=32,I=64,d=128,x=256,J=512,z=30,ee="...",de=800,me=16,A=1,U=2,ce=3,le=1/0,re=9007199254740991,ne=17976931348623157e292,ae=0/0,ie=4294967295,Oe=ie-1,ge=ie>>>1,Be=[["ary",d],["bind",H],["bindKey",Z],["curry",L],["curryRight",$],["flip",J],["partial",T],["partialRight",I],["rearg",x]],ye="[object Arguments]",Me="[object Array]",X="[object AsyncFunction]",Y="[object Boolean]",W="[object Date]",w="[object DOMException]",F="[object Error]",we="[object Function]",ve="[object GeneratorFunction]",Ue="[object Map]",nt="[object Number]",at="[object Null]",Ge="[object Object]",Dt="[object Promise]",$t="[object Proxy]",Je="[object RegExp]",He="[object Set]",ke="[object String]",Ke="[object Symbol]",rt="[object Undefined]",je="[object WeakMap]",Ze="[object WeakSet]",b="[object ArrayBuffer]",p="[object DataView]",m="[object Float32Array]",D="[object Float64Array]",B="[object Int8Array]",K="[object Int16Array]",Q="[object Int32Array]",Ee="[object Uint8Array]",Ne="[object Uint8ClampedArray]",st="[object Uint16Array]",ht="[object Uint32Array]",lt=/\b__p \+= '';/g,Ur=/\b(__p \+=) '' \+/g,Jn=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Si=/&(?:amp|lt|gt|quot|#39);/g,cs=/[&<>"']/g,zt=RegExp(Si.source),Lt=RegExp(cs.source),Wt=/<%-([\s\S]+?)%>/g,qt=/<%([\s\S]+?)%>/g,Ft=/<%=([\s\S]+?)%>/g,Mt=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ir=/^\w*$/,sr=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Vt=/[\\^$.*+?()[\]{}|]/g,or=RegExp(Vt.source),Kt=/^\s+/,Xt=/\s/,Gt=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Pt=/\{\n\/\* \[wrapped with (.+)\] \*/,ar=/,? & /,cr=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,kf=/[()=,{}\[\]\/\s]/,Hf=/\\(\\)?/g,zf=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,fn=/\w*$/,Wf=/^[-+]0x[0-9a-f]+$/i,qf=/^0b[01]+$/i,Vf=/^\[object .+?Constructor\]$/,Kf=/^0o[0-7]+$/i,Gf=/^(?:0|[1-9]\d*)$/,Xn=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Qs=/($^)/,Zf=/['\n\r\u2028\u2029\\]/g,eo="\\ud800-\\udfff",Yf="\\u0300-\\u036f",Jf="\\ufe20-\\ufe2f",to="\\u20d0-\\u20ff",Jc=Yf+Jf+to,Xc="\\u2700-\\u27bf",Cn="a-z\\xdf-\\xf6\\xf8-\\xff",Xf="\\xac\\xb1\\xd7\\xf7",Qf="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",e0="\\u2000-\\u206f",t0=" \\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",Qc="A-Z\\xc0-\\xd6\\xd8-\\xde",el="\\ufe0e\\ufe0f",ls=Xf+Qf+e0+t0,wa="['\u2019]",us="["+eo+"]",va="["+ls+"]",hs="["+Jc+"]",tl="\\d+",r0="["+Xc+"]",rl="["+Cn+"]",nl="[^"+eo+ls+tl+Xc+Cn+Qc+"]",ro="\\ud83c[\\udffb-\\udfff]",n0="(?:"+hs+"|"+ro+")",il="[^"+eo+"]",no="(?:\\ud83c[\\udde6-\\uddff]){2}",Ai="[\\ud800-\\udbff][\\udc00-\\udfff]",Qr="["+Qc+"]",sl="\\u200d",ol="(?:"+rl+"|"+nl+")",Fn="(?:"+Qr+"|"+nl+")",al="(?:"+wa+"(?:d|ll|m|re|s|t|ve))?",cl="(?:"+wa+"(?:D|LL|M|RE|S|T|VE))?",ll=n0+"?",ul="["+el+"]?",i0="(?:"+sl+"(?:"+[il,no,Ai].join("|")+")"+ul+ll+")*",Qn="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",hl="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",fl=ul+ll+i0,io="(?:"+[r0,no,Ai].join("|")+")"+fl,s0="(?:"+[il+hs+"?",hs,no,Ai,us].join("|")+")",ya=RegExp(wa,"g"),o0=RegExp(hs,"g"),so=RegExp(ro+"(?="+ro+")|"+s0+fl,"g"),dl=RegExp([Qr+"?"+rl+"+"+al+"(?="+[va,Qr,"$"].join("|")+")",Fn+"+"+cl+"(?="+[va,Qr+ol,"$"].join("|")+")",Qr+"?"+ol+"+"+al,Qr+"+"+cl,hl,Qn,tl,io].join("|"),"g"),pl=RegExp("["+sl+eo+Jc+el+"]"),fs=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,gl=["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"],a0=-1,Ct={};Ct[m]=Ct[D]=Ct[B]=Ct[K]=Ct[Q]=Ct[Ee]=Ct[Ne]=Ct[st]=Ct[ht]=!0,Ct[ye]=Ct[Me]=Ct[b]=Ct[Y]=Ct[p]=Ct[W]=Ct[F]=Ct[we]=Ct[Ue]=Ct[nt]=Ct[Ge]=Ct[Je]=Ct[He]=Ct[ke]=Ct[je]=!1;var xt={};xt[ye]=xt[Me]=xt[b]=xt[p]=xt[Y]=xt[W]=xt[m]=xt[D]=xt[B]=xt[K]=xt[Q]=xt[Ue]=xt[nt]=xt[Ge]=xt[Je]=xt[He]=xt[ke]=xt[Ke]=xt[Ee]=xt[Ne]=xt[st]=xt[ht]=!0,xt[F]=xt[we]=xt[je]=!1;var N={\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"},q={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},fe={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},Ce={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},It=parseFloat,Xe=parseInt,Tt=typeof Wo=="object"&&Wo&&Wo.Object===Object&&Wo,lr=typeof self=="object"&&self&&self.Object===Object&&self,mt=Tt||lr||Function("return this")(),St=e&&!e.nodeType&&e,Qt=St&&!0&&t&&!t.nodeType&&t,qr=Qt&&Qt.exports===St,ur=qr&&Tt.process,Nt=function(){try{var V=Qt&&Qt.require&&Qt.require("util").types;return V||ur&&ur.binding&&ur.binding("util")}catch{}}(),jr=Nt&&Nt.isArrayBuffer,In=Nt&&Nt.isDate,dn=Nt&&Nt.isMap,Bn=Nt&&Nt.isRegExp,ba=Nt&&Nt.isSet,ds=Nt&&Nt.isTypedArray;function vr(V,se,te){switch(te.length){case 0:return V.call(se);case 1:return V.call(se,te[0]);case 2:return V.call(se,te[0],te[1]);case 3:return V.call(se,te[0],te[1],te[2])}return V.apply(se,te)}function uO(V,se,te,Ie){for(var Ye=-1,vt=V==null?0:V.length;++Ye<vt;){var fr=V[Ye];se(Ie,fr,te(fr),V)}return Ie}function pn(V,se){for(var te=-1,Ie=V==null?0:V.length;++te<Ie&&se(V[te],te,V)!==!1;);return V}function hO(V,se){for(var te=V==null?0:V.length;te--&&se(V[te],te,V)!==!1;);return V}function bm(V,se){for(var te=-1,Ie=V==null?0:V.length;++te<Ie;)if(!se(V[te],te,V))return!1;return!0}function Oi(V,se){for(var te=-1,Ie=V==null?0:V.length,Ye=0,vt=[];++te<Ie;){var fr=V[te];se(fr,te,V)&&(vt[Ye++]=fr)}return vt}function ml(V,se){var te=V==null?0:V.length;return!!te&&oo(V,se,0)>-1}function c0(V,se,te){for(var Ie=-1,Ye=V==null?0:V.length;++Ie<Ye;)if(te(se,V[Ie]))return!0;return!1}function Ut(V,se){for(var te=-1,Ie=V==null?0:V.length,Ye=Array(Ie);++te<Ie;)Ye[te]=se(V[te],te,V);return Ye}function Di(V,se){for(var te=-1,Ie=se.length,Ye=V.length;++te<Ie;)V[Ye+te]=se[te];return V}function l0(V,se,te,Ie){var Ye=-1,vt=V==null?0:V.length;for(Ie&&vt&&(te=V[++Ye]);++Ye<vt;)te=se(te,V[Ye],Ye,V);return te}function fO(V,se,te,Ie){var Ye=V==null?0:V.length;for(Ie&&Ye&&(te=V[--Ye]);Ye--;)te=se(te,V[Ye],Ye,V);return te}function u0(V,se){for(var te=-1,Ie=V==null?0:V.length;++te<Ie;)if(se(V[te],te,V))return!0;return!1}var dO=h0("length");function pO(V){return V.split("")}function gO(V){return V.match(cr)||[]}function _m(V,se,te){var Ie;return te(V,function(Ye,vt,fr){if(se(Ye,vt,fr))return Ie=vt,!1}),Ie}function wl(V,se,te,Ie){for(var Ye=V.length,vt=te+(Ie?1:-1);Ie?vt--:++vt<Ye;)if(se(V[vt],vt,V))return vt;return-1}function oo(V,se,te){return se===se?AO(V,se,te):wl(V,Em,te)}function mO(V,se,te,Ie){for(var Ye=te-1,vt=V.length;++Ye<vt;)if(Ie(V[Ye],se))return Ye;return-1}function Em(V){return V!==V}function xm(V,se){var te=V==null?0:V.length;return te?d0(V,se)/te:ae}function h0(V){return function(se){return se==null?r:se[V]}}function f0(V){return function(se){return V==null?r:V[se]}}function Cm(V,se,te,Ie,Ye){return Ye(V,function(vt,fr,At){te=Ie?(Ie=!1,vt):se(te,vt,fr,At)}),te}function wO(V,se){var te=V.length;for(V.sort(se);te--;)V[te]=V[te].value;return V}function d0(V,se){for(var te,Ie=-1,Ye=V.length;++Ie<Ye;){var vt=se(V[Ie]);vt!==r&&(te=te===r?vt:te+vt)}return te}function p0(V,se){for(var te=-1,Ie=Array(V);++te<V;)Ie[te]=se(te);return Ie}function vO(V,se){return Ut(se,function(te){return[te,V[te]]})}function Im(V){return V&&V.slice(0,Dm(V)+1).replace(Kt,"")}function en(V){return function(se){return V(se)}}function g0(V,se){return Ut(se,function(te){return V[te]})}function _a(V,se){return V.has(se)}function Sm(V,se){for(var te=-1,Ie=V.length;++te<Ie&&oo(se,V[te],0)>-1;);return te}function Am(V,se){for(var te=V.length;te--&&oo(se,V[te],0)>-1;);return te}function yO(V,se){for(var te=V.length,Ie=0;te--;)V[te]===se&&++Ie;return Ie}var bO=f0(N),_O=f0(q);function EO(V){return"\\"+Ce[V]}function xO(V,se){return V==null?r:V[se]}function ao(V){return pl.test(V)}function CO(V){return fs.test(V)}function IO(V){for(var se,te=[];!(se=V.next()).done;)te.push(se.value);return te}function m0(V){var se=-1,te=Array(V.size);return V.forEach(function(Ie,Ye){te[++se]=[Ye,Ie]}),te}function Om(V,se){return function(te){return V(se(te))}}function $i(V,se){for(var te=-1,Ie=V.length,Ye=0,vt=[];++te<Ie;){var fr=V[te];(fr===se||fr===v)&&(V[te]=v,vt[Ye++]=te)}return vt}function vl(V){var se=-1,te=Array(V.size);return V.forEach(function(Ie){te[++se]=Ie}),te}function SO(V){var se=-1,te=Array(V.size);return V.forEach(function(Ie){te[++se]=[Ie,Ie]}),te}function AO(V,se,te){for(var Ie=te-1,Ye=V.length;++Ie<Ye;)if(V[Ie]===se)return Ie;return-1}function OO(V,se,te){for(var Ie=te+1;Ie--;)if(V[Ie]===se)return Ie;return Ie}function co(V){return ao(V)?$O(V):dO(V)}function Sn(V){return ao(V)?PO(V):pO(V)}function Dm(V){for(var se=V.length;se--&&Xt.test(V.charAt(se)););return se}var DO=f0(fe);function $O(V){for(var se=so.lastIndex=0;so.test(V);)++se;return se}function PO(V){return V.match(so)||[]}function TO(V){return V.match(dl)||[]}var NO=function V(se){se=se==null?mt:lo.defaults(mt.Object(),se,lo.pick(mt,gl));var te=se.Array,Ie=se.Date,Ye=se.Error,vt=se.Function,fr=se.Math,At=se.Object,w0=se.RegExp,RO=se.String,gn=se.TypeError,yl=te.prototype,LO=vt.prototype,uo=At.prototype,bl=se["__core-js_shared__"],_l=LO.toString,bt=uo.hasOwnProperty,MO=0,$m=function(){var s=/[^.]+$/.exec(bl&&bl.keys&&bl.keys.IE_PROTO||"");return s?"Symbol(src)_1."+s:""}(),El=uo.toString,UO=_l.call(At),jO=mt._,FO=w0("^"+_l.call(bt).replace(Vt,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),xl=qr?se.Buffer:r,Pi=se.Symbol,Cl=se.Uint8Array,Pm=xl?xl.allocUnsafe:r,Il=Om(At.getPrototypeOf,At),Tm=At.create,Nm=uo.propertyIsEnumerable,Sl=yl.splice,Rm=Pi?Pi.isConcatSpreadable:r,Ea=Pi?Pi.iterator:r,ps=Pi?Pi.toStringTag:r,Al=function(){try{var s=ys(At,"defineProperty");return s({},"",{}),s}catch{}}(),BO=se.clearTimeout!==mt.clearTimeout&&se.clearTimeout,kO=Ie&&Ie.now!==mt.Date.now&&Ie.now,HO=se.setTimeout!==mt.setTimeout&&se.setTimeout,Ol=fr.ceil,Dl=fr.floor,v0=At.getOwnPropertySymbols,zO=xl?xl.isBuffer:r,Lm=se.isFinite,WO=yl.join,qO=Om(At.keys,At),dr=fr.max,Ar=fr.min,VO=Ie.now,KO=se.parseInt,Mm=fr.random,GO=yl.reverse,y0=ys(se,"DataView"),xa=ys(se,"Map"),b0=ys(se,"Promise"),ho=ys(se,"Set"),Ca=ys(se,"WeakMap"),Ia=ys(At,"create"),$l=Ca&&new Ca,fo={},ZO=bs(y0),YO=bs(xa),JO=bs(b0),XO=bs(ho),QO=bs(Ca),Pl=Pi?Pi.prototype:r,Sa=Pl?Pl.valueOf:r,Um=Pl?Pl.toString:r;function C(s){if(Zt(s)&&!Qe(s)&&!(s instanceof dt)){if(s instanceof mn)return s;if(bt.call(s,"__wrapped__"))return j2(s)}return new mn(s)}var po=function(){function s(){}return function(a){if(!Bt(a))return{};if(Tm)return Tm(a);s.prototype=a;var u=new s;return s.prototype=r,u}}();function Tl(){}function mn(s,a){this.__wrapped__=s,this.__actions__=[],this.__chain__=!!a,this.__index__=0,this.__values__=r}C.templateSettings={escape:Wt,evaluate:qt,interpolate:Ft,variable:"",imports:{_:C}},C.prototype=Tl.prototype,C.prototype.constructor=C,mn.prototype=po(Tl.prototype),mn.prototype.constructor=mn;function dt(s){this.__wrapped__=s,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=ie,this.__views__=[]}function eD(){var s=new dt(this.__wrapped__);return s.__actions__=Vr(this.__actions__),s.__dir__=this.__dir__,s.__filtered__=this.__filtered__,s.__iteratees__=Vr(this.__iteratees__),s.__takeCount__=this.__takeCount__,s.__views__=Vr(this.__views__),s}function tD(){if(this.__filtered__){var s=new dt(this);s.__dir__=-1,s.__filtered__=!0}else s=this.clone(),s.__dir__*=-1;return s}function rD(){var s=this.__wrapped__.value(),a=this.__dir__,u=Qe(s),g=a<0,y=u?s.length:0,O=p$(0,y,this.__views__),M=O.start,k=O.end,G=k-M,ue=g?k:M-1,he=this.__iteratees__,pe=he.length,be=0,Pe=Ar(G,this.__takeCount__);if(!u||!g&&y==G&&Pe==G)return a2(s,this.__actions__);var We=[];e:for(;G--&&be<Pe;){ue+=a;for(var ot=-1,qe=s[ue];++ot<pe;){var ft=he[ot],wt=ft.iteratee,nn=ft.type,kr=wt(qe);if(nn==U)qe=kr;else if(!kr){if(nn==A)continue e;break e}}We[be++]=qe}return We}dt.prototype=po(Tl.prototype),dt.prototype.constructor=dt;function gs(s){var a=-1,u=s==null?0:s.length;for(this.clear();++a<u;){var g=s[a];this.set(g[0],g[1])}}function nD(){this.__data__=Ia?Ia(null):{},this.size=0}function iD(s){var a=this.has(s)&&delete this.__data__[s];return this.size-=a?1:0,a}function sD(s){var a=this.__data__;if(Ia){var u=a[s];return u===h?r:u}return bt.call(a,s)?a[s]:r}function oD(s){var a=this.__data__;return Ia?a[s]!==r:bt.call(a,s)}function aD(s,a){var u=this.__data__;return this.size+=this.has(s)?0:1,u[s]=Ia&&a===r?h:a,this}gs.prototype.clear=nD,gs.prototype.delete=iD,gs.prototype.get=sD,gs.prototype.has=oD,gs.prototype.set=aD;function ei(s){var a=-1,u=s==null?0:s.length;for(this.clear();++a<u;){var g=s[a];this.set(g[0],g[1])}}function cD(){this.__data__=[],this.size=0}function lD(s){var a=this.__data__,u=Nl(a,s);if(u<0)return!1;var g=a.length-1;return u==g?a.pop():Sl.call(a,u,1),--this.size,!0}function uD(s){var a=this.__data__,u=Nl(a,s);return u<0?r:a[u][1]}function hD(s){return Nl(this.__data__,s)>-1}function fD(s,a){var u=this.__data__,g=Nl(u,s);return g<0?(++this.size,u.push([s,a])):u[g][1]=a,this}ei.prototype.clear=cD,ei.prototype.delete=lD,ei.prototype.get=uD,ei.prototype.has=hD,ei.prototype.set=fD;function ti(s){var a=-1,u=s==null?0:s.length;for(this.clear();++a<u;){var g=s[a];this.set(g[0],g[1])}}function dD(){this.size=0,this.__data__={hash:new gs,map:new(xa||ei),string:new gs}}function pD(s){var a=ql(this,s).delete(s);return this.size-=a?1:0,a}function gD(s){return ql(this,s).get(s)}function mD(s){return ql(this,s).has(s)}function wD(s,a){var u=ql(this,s),g=u.size;return u.set(s,a),this.size+=u.size==g?0:1,this}ti.prototype.clear=dD,ti.prototype.delete=pD,ti.prototype.get=gD,ti.prototype.has=mD,ti.prototype.set=wD;function ms(s){var a=-1,u=s==null?0:s.length;for(this.__data__=new ti;++a<u;)this.add(s[a])}function vD(s){return this.__data__.set(s,h),this}function yD(s){return this.__data__.has(s)}ms.prototype.add=ms.prototype.push=vD,ms.prototype.has=yD;function An(s){var a=this.__data__=new ei(s);this.size=a.size}function bD(){this.__data__=new ei,this.size=0}function _D(s){var a=this.__data__,u=a.delete(s);return this.size=a.size,u}function ED(s){return this.__data__.get(s)}function xD(s){return this.__data__.has(s)}function CD(s,a){var u=this.__data__;if(u instanceof ei){var g=u.__data__;if(!xa||g.length<i-1)return g.push([s,a]),this.size=++u.size,this;u=this.__data__=new ti(g)}return u.set(s,a),this.size=u.size,this}An.prototype.clear=bD,An.prototype.delete=_D,An.prototype.get=ED,An.prototype.has=xD,An.prototype.set=CD;function jm(s,a){var u=Qe(s),g=!u&&_s(s),y=!u&&!g&&Mi(s),O=!u&&!g&&!y&&vo(s),M=u||g||y||O,k=M?p0(s.length,RO):[],G=k.length;for(var ue in s)(a||bt.call(s,ue))&&!(M&&(ue=="length"||y&&(ue=="offset"||ue=="parent")||O&&(ue=="buffer"||ue=="byteLength"||ue=="byteOffset")||si(ue,G)))&&k.push(ue);return k}function Fm(s){var a=s.length;return a?s[P0(0,a-1)]:r}function ID(s,a){return Vl(Vr(s),ws(a,0,s.length))}function SD(s){return Vl(Vr(s))}function _0(s,a,u){(u!==r&&!On(s[a],u)||u===r&&!(a in s))&&ri(s,a,u)}function Aa(s,a,u){var g=s[a];(!(bt.call(s,a)&&On(g,u))||u===r&&!(a in s))&&ri(s,a,u)}function Nl(s,a){for(var u=s.length;u--;)if(On(s[u][0],a))return u;return-1}function AD(s,a,u,g){return Ti(s,function(y,O,M){a(g,y,u(y),M)}),g}function Bm(s,a){return s&&Hn(a,yr(a),s)}function OD(s,a){return s&&Hn(a,Gr(a),s)}function ri(s,a,u){a=="__proto__"&&Al?Al(s,a,{configurable:!0,enumerable:!0,value:u,writable:!0}):s[a]=u}function E0(s,a){for(var u=-1,g=a.length,y=te(g),O=s==null;++u<g;)y[u]=O?r:rd(s,a[u]);return y}function ws(s,a,u){return s===s&&(u!==r&&(s=s<=u?s:u),a!==r&&(s=s>=a?s:a)),s}function wn(s,a,u,g,y,O){var M,k=a&E,G=a&_,ue=a&S;if(u&&(M=y?u(s,g,y,O):u(s)),M!==r)return M;if(!Bt(s))return s;var he=Qe(s);if(he){if(M=m$(s),!k)return Vr(s,M)}else{var pe=Or(s),be=pe==we||pe==ve;if(Mi(s))return u2(s,k);if(pe==Ge||pe==ye||be&&!y){if(M=G||be?{}:D2(s),!k)return G?s$(s,OD(M,s)):i$(s,Bm(M,s))}else{if(!xt[pe])return y?s:{};M=w$(s,pe,k)}}O||(O=new An);var Pe=O.get(s);if(Pe)return Pe;O.set(s,M),iw(s)?s.forEach(function(qe){M.add(wn(qe,a,u,qe,s,O))}):rw(s)&&s.forEach(function(qe,ft){M.set(ft,wn(qe,a,u,ft,s,O))});var We=ue?G?H0:k0:G?Gr:yr,ot=he?r:We(s);return pn(ot||s,function(qe,ft){ot&&(ft=qe,qe=s[ft]),Aa(M,ft,wn(qe,a,u,ft,s,O))}),M}function DD(s){var a=yr(s);return function(u){return km(u,s,a)}}function km(s,a,u){var g=u.length;if(s==null)return!g;for(s=At(s);g--;){var y=u[g],O=a[y],M=s[y];if(M===r&&!(y in s)||!O(M))return!1}return!0}function Hm(s,a,u){if(typeof s!="function")throw new gn(c);return Ra(function(){s.apply(r,u)},a)}function Oa(s,a,u,g){var y=-1,O=ml,M=!0,k=s.length,G=[],ue=a.length;if(!k)return G;u&&(a=Ut(a,en(u))),g?(O=c0,M=!1):a.length>=i&&(O=_a,M=!1,a=new ms(a));e:for(;++y<k;){var he=s[y],pe=u==null?he:u(he);if(he=g||he!==0?he:0,M&&pe===pe){for(var be=ue;be--;)if(a[be]===pe)continue e;G.push(he)}else O(a,pe,g)||G.push(he)}return G}var Ti=g2(kn),zm=g2(C0,!0);function $D(s,a){var u=!0;return Ti(s,function(g,y,O){return u=!!a(g,y,O),u}),u}function Rl(s,a,u){for(var g=-1,y=s.length;++g<y;){var O=s[g],M=a(O);if(M!=null&&(k===r?M===M&&!rn(M):u(M,k)))var k=M,G=O}return G}function PD(s,a,u,g){var y=s.length;for(u=it(u),u<0&&(u=-u>y?0:y+u),g=g===r||g>y?y:it(g),g<0&&(g+=y),g=u>g?0:ow(g);u<g;)s[u++]=a;return s}function Wm(s,a){var u=[];return Ti(s,function(g,y,O){a(g,y,O)&&u.push(g)}),u}function Cr(s,a,u,g,y){var O=-1,M=s.length;for(u||(u=y$),y||(y=[]);++O<M;){var k=s[O];a>0&&u(k)?a>1?Cr(k,a-1,u,g,y):Di(y,k):g||(y[y.length]=k)}return y}var x0=m2(),qm=m2(!0);function kn(s,a){return s&&x0(s,a,yr)}function C0(s,a){return s&&qm(s,a,yr)}function Ll(s,a){return Oi(a,function(u){return oi(s[u])})}function vs(s,a){a=Ri(a,s);for(var u=0,g=a.length;s!=null&&u<g;)s=s[zn(a[u++])];return u&&u==g?s:r}function Vm(s,a,u){var g=a(s);return Qe(s)?g:Di(g,u(s))}function Fr(s){return s==null?s===r?rt:at:ps&&ps in At(s)?d$(s):S$(s)}function I0(s,a){return s>a}function TD(s,a){return s!=null&&bt.call(s,a)}function ND(s,a){return s!=null&&a in At(s)}function RD(s,a,u){return s>=Ar(a,u)&&s<dr(a,u)}function S0(s,a,u){for(var g=u?c0:ml,y=s[0].length,O=s.length,M=O,k=te(O),G=1/0,ue=[];M--;){var he=s[M];M&&a&&(he=Ut(he,en(a))),G=Ar(he.length,G),k[M]=!u&&(a||y>=120&&he.length>=120)?new ms(M&&he):r}he=s[0];var pe=-1,be=k[0];e:for(;++pe<y&&ue.length<G;){var Pe=he[pe],We=a?a(Pe):Pe;if(Pe=u||Pe!==0?Pe:0,!(be?_a(be,We):g(ue,We,u))){for(M=O;--M;){var ot=k[M];if(!(ot?_a(ot,We):g(s[M],We,u)))continue e}be&&be.push(We),ue.push(Pe)}}return ue}function LD(s,a,u,g){return kn(s,function(y,O,M){a(g,u(y),O,M)}),g}function Da(s,a,u){a=Ri(a,s),s=N2(s,a);var g=s==null?s:s[zn(yn(a))];return g==null?r:vr(g,s,u)}function Km(s){return Zt(s)&&Fr(s)==ye}function MD(s){return Zt(s)&&Fr(s)==b}function UD(s){return Zt(s)&&Fr(s)==W}function $a(s,a,u,g,y){return s===a?!0:s==null||a==null||!Zt(s)&&!Zt(a)?s!==s&&a!==a:jD(s,a,u,g,$a,y)}function jD(s,a,u,g,y,O){var M=Qe(s),k=Qe(a),G=M?Me:Or(s),ue=k?Me:Or(a);G=G==ye?Ge:G,ue=ue==ye?Ge:ue;var he=G==Ge,pe=ue==Ge,be=G==ue;if(be&&Mi(s)){if(!Mi(a))return!1;M=!0,he=!1}if(be&&!he)return O||(O=new An),M||vo(s)?S2(s,a,u,g,y,O):h$(s,a,G,u,g,y,O);if(!(u&P)){var Pe=he&&bt.call(s,"__wrapped__"),We=pe&&bt.call(a,"__wrapped__");if(Pe||We){var ot=Pe?s.value():s,qe=We?a.value():a;return O||(O=new An),y(ot,qe,u,g,O)}}return be?(O||(O=new An),f$(s,a,u,g,y,O)):!1}function FD(s){return Zt(s)&&Or(s)==Ue}function A0(s,a,u,g){var y=u.length,O=y,M=!g;if(s==null)return!O;for(s=At(s);y--;){var k=u[y];if(M&&k[2]?k[1]!==s[k[0]]:!(k[0]in s))return!1}for(;++y<O;){k=u[y];var G=k[0],ue=s[G],he=k[1];if(M&&k[2]){if(ue===r&&!(G in s))return!1}else{var pe=new An;if(g)var be=g(ue,he,G,s,a,pe);if(!(be===r?$a(he,ue,P|j,g,pe):be))return!1}}return!0}function Gm(s){if(!Bt(s)||_$(s))return!1;var a=oi(s)?FO:Vf;return a.test(bs(s))}function BD(s){return Zt(s)&&Fr(s)==Je}function kD(s){return Zt(s)&&Or(s)==He}function HD(s){return Zt(s)&&Xl(s.length)&&!!Ct[Fr(s)]}function Zm(s){return typeof s=="function"?s:s==null?Zr:typeof s=="object"?Qe(s)?Xm(s[0],s[1]):Jm(s):ww(s)}function O0(s){if(!Na(s))return qO(s);var a=[];for(var u in At(s))bt.call(s,u)&&u!="constructor"&&a.push(u);return a}function zD(s){if(!Bt(s))return I$(s);var a=Na(s),u=[];for(var g in s)g=="constructor"&&(a||!bt.call(s,g))||u.push(g);return u}function D0(s,a){return s<a}function Ym(s,a){var u=-1,g=Kr(s)?te(s.length):[];return Ti(s,function(y,O,M){g[++u]=a(y,O,M)}),g}function Jm(s){var a=W0(s);return a.length==1&&a[0][2]?P2(a[0][0],a[0][1]):function(u){return u===s||A0(u,s,a)}}function Xm(s,a){return V0(s)&&$2(a)?P2(zn(s),a):function(u){var g=rd(u,s);return g===r&&g===a?nd(u,s):$a(a,g,P|j)}}function Ml(s,a,u,g,y){s!==a&&x0(a,function(O,M){if(y||(y=new An),Bt(O))WD(s,a,M,u,Ml,g,y);else{var k=g?g(G0(s,M),O,M+"",s,a,y):r;k===r&&(k=O),_0(s,M,k)}},Gr)}function WD(s,a,u,g,y,O,M){var k=G0(s,u),G=G0(a,u),ue=M.get(G);if(ue){_0(s,u,ue);return}var he=O?O(k,G,u+"",s,a,M):r,pe=he===r;if(pe){var be=Qe(G),Pe=!be&&Mi(G),We=!be&&!Pe&&vo(G);he=G,be||Pe||We?Qe(k)?he=k:er(k)?he=Vr(k):Pe?(pe=!1,he=u2(G,!0)):We?(pe=!1,he=h2(G,!0)):he=[]:La(G)||_s(G)?(he=k,_s(k)?he=aw(k):(!Bt(k)||oi(k))&&(he=D2(G))):pe=!1}pe&&(M.set(G,he),y(he,G,g,O,M),M.delete(G)),_0(s,u,he)}function Qm(s,a){var u=s.length;if(u)return a+=a<0?u:0,si(a,u)?s[a]:r}function e2(s,a,u){a.length?a=Ut(a,function(O){return Qe(O)?function(M){return vs(M,O.length===1?O[0]:O)}:O}):a=[Zr];var g=-1;a=Ut(a,en(ze()));var y=Ym(s,function(O,M,k){var G=Ut(a,function(ue){return ue(O)});return{criteria:G,index:++g,value:O}});return wO(y,function(O,M){return n$(O,M,u)})}function qD(s,a){return t2(s,a,function(u,g){return nd(s,g)})}function t2(s,a,u){for(var g=-1,y=a.length,O={};++g<y;){var M=a[g],k=vs(s,M);u(k,M)&&Pa(O,Ri(M,s),k)}return O}function VD(s){return function(a){return vs(a,s)}}function $0(s,a,u,g){var y=g?mO:oo,O=-1,M=a.length,k=s;for(s===a&&(a=Vr(a)),u&&(k=Ut(s,en(u)));++O<M;)for(var G=0,ue=a[O],he=u?u(ue):ue;(G=y(k,he,G,g))>-1;)k!==s&&Sl.call(k,G,1),Sl.call(s,G,1);return s}function r2(s,a){for(var u=s?a.length:0,g=u-1;u--;){var y=a[u];if(u==g||y!==O){var O=y;si(y)?Sl.call(s,y,1):R0(s,y)}}return s}function P0(s,a){return s+Dl(Mm()*(a-s+1))}function KD(s,a,u,g){for(var y=-1,O=dr(Ol((a-s)/(u||1)),0),M=te(O);O--;)M[g?O:++y]=s,s+=u;return M}function T0(s,a){var u="";if(!s||a<1||a>re)return u;do a%2&&(u+=s),a=Dl(a/2),a&&(s+=s);while(a);return u}function ct(s,a){return Z0(T2(s,a,Zr),s+"")}function GD(s){return Fm(yo(s))}function ZD(s,a){var u=yo(s);return Vl(u,ws(a,0,u.length))}function Pa(s,a,u,g){if(!Bt(s))return s;a=Ri(a,s);for(var y=-1,O=a.length,M=O-1,k=s;k!=null&&++y<O;){var G=zn(a[y]),ue=u;if(G==="__proto__"||G==="constructor"||G==="prototype")return s;if(y!=M){var he=k[G];ue=g?g(he,G,k):r,ue===r&&(ue=Bt(he)?he:si(a[y+1])?[]:{})}Aa(k,G,ue),k=k[G]}return s}var n2=$l?function(s,a){return $l.set(s,a),s}:Zr,YD=Al?function(s,a){return Al(s,"toString",{configurable:!0,enumerable:!1,value:sd(a),writable:!0})}:Zr;function JD(s){return Vl(yo(s))}function vn(s,a,u){var g=-1,y=s.length;a<0&&(a=-a>y?0:y+a),u=u>y?y:u,u<0&&(u+=y),y=a>u?0:u-a>>>0,a>>>=0;for(var O=te(y);++g<y;)O[g]=s[g+a];return O}function XD(s,a){var u;return Ti(s,function(g,y,O){return u=a(g,y,O),!u}),!!u}function Ul(s,a,u){var g=0,y=s==null?g:s.length;if(typeof a=="number"&&a===a&&y<=ge){for(;g<y;){var O=g+y>>>1,M=s[O];M!==null&&!rn(M)&&(u?M<=a:M<a)?g=O+1:y=O}return y}return N0(s,a,Zr,u)}function N0(s,a,u,g){var y=0,O=s==null?0:s.length;if(O===0)return 0;a=u(a);for(var M=a!==a,k=a===null,G=rn(a),ue=a===r;y<O;){var he=Dl((y+O)/2),pe=u(s[he]),be=pe!==r,Pe=pe===null,We=pe===pe,ot=rn(pe);if(M)var qe=g||We;else ue?qe=We&&(g||be):k?qe=We&&be&&(g||!Pe):G?qe=We&&be&&!Pe&&(g||!ot):Pe||ot?qe=!1:qe=g?pe<=a:pe<a;qe?y=he+1:O=he}return Ar(O,Oe)}function i2(s,a){for(var u=-1,g=s.length,y=0,O=[];++u<g;){var M=s[u],k=a?a(M):M;if(!u||!On(k,G)){var G=k;O[y++]=M===0?0:M}}return O}function s2(s){return typeof s=="number"?s:rn(s)?ae:+s}function tn(s){if(typeof s=="string")return s;if(Qe(s))return Ut(s,tn)+"";if(rn(s))return Um?Um.call(s):"";var a=s+"";return a=="0"&&1/s==-le?"-0":a}function Ni(s,a,u){var g=-1,y=ml,O=s.length,M=!0,k=[],G=k;if(u)M=!1,y=c0;else if(O>=i){var ue=a?null:l$(s);if(ue)return vl(ue);M=!1,y=_a,G=new ms}else G=a?[]:k;e:for(;++g<O;){var he=s[g],pe=a?a(he):he;if(he=u||he!==0?he:0,M&&pe===pe){for(var be=G.length;be--;)if(G[be]===pe)continue e;a&&G.push(pe),k.push(he)}else y(G,pe,u)||(G!==k&&G.push(pe),k.push(he))}return k}function R0(s,a){return a=Ri(a,s),s=N2(s,a),s==null||delete s[zn(yn(a))]}function o2(s,a,u,g){return Pa(s,a,u(vs(s,a)),g)}function jl(s,a,u,g){for(var y=s.length,O=g?y:-1;(g?O--:++O<y)&&a(s[O],O,s););return u?vn(s,g?0:O,g?O+1:y):vn(s,g?O+1:0,g?y:O)}function a2(s,a){var u=s;return u instanceof dt&&(u=u.value()),l0(a,function(g,y){return y.func.apply(y.thisArg,Di([g],y.args))},u)}function L0(s,a,u){var g=s.length;if(g<2)return g?Ni(s[0]):[];for(var y=-1,O=te(g);++y<g;)for(var M=s[y],k=-1;++k<g;)k!=y&&(O[y]=Oa(O[y]||M,s[k],a,u));return Ni(Cr(O,1),a,u)}function c2(s,a,u){for(var g=-1,y=s.length,O=a.length,M={};++g<y;){var k=g<O?a[g]:r;u(M,s[g],k)}return M}function M0(s){return er(s)?s:[]}function U0(s){return typeof s=="function"?s:Zr}function Ri(s,a){return Qe(s)?s:V0(s,a)?[s]:U2(yt(s))}var QD=ct;function Li(s,a,u){var g=s.length;return u=u===r?g:u,!a&&u>=g?s:vn(s,a,u)}var l2=BO||function(s){return mt.clearTimeout(s)};function u2(s,a){if(a)return s.slice();var u=s.length,g=Pm?Pm(u):new s.constructor(u);return s.copy(g),g}function j0(s){var a=new s.constructor(s.byteLength);return new Cl(a).set(new Cl(s)),a}function e$(s,a){var u=a?j0(s.buffer):s.buffer;return new s.constructor(u,s.byteOffset,s.byteLength)}function t$(s){var a=new s.constructor(s.source,fn.exec(s));return a.lastIndex=s.lastIndex,a}function r$(s){return Sa?At(Sa.call(s)):{}}function h2(s,a){var u=a?j0(s.buffer):s.buffer;return new s.constructor(u,s.byteOffset,s.length)}function f2(s,a){if(s!==a){var u=s!==r,g=s===null,y=s===s,O=rn(s),M=a!==r,k=a===null,G=a===a,ue=rn(a);if(!k&&!ue&&!O&&s>a||O&&M&&G&&!k&&!ue||g&&M&&G||!u&&G||!y)return 1;if(!g&&!O&&!ue&&s<a||ue&&u&&y&&!g&&!O||k&&u&&y||!M&&y||!G)return-1}return 0}function n$(s,a,u){for(var g=-1,y=s.criteria,O=a.criteria,M=y.length,k=u.length;++g<M;){var G=f2(y[g],O[g]);if(G){if(g>=k)return G;var ue=u[g];return G*(ue=="desc"?-1:1)}}return s.index-a.index}function d2(s,a,u,g){for(var y=-1,O=s.length,M=u.length,k=-1,G=a.length,ue=dr(O-M,0),he=te(G+ue),pe=!g;++k<G;)he[k]=a[k];for(;++y<M;)(pe||y<O)&&(he[u[y]]=s[y]);for(;ue--;)he[k++]=s[y++];return he}function p2(s,a,u,g){for(var y=-1,O=s.length,M=-1,k=u.length,G=-1,ue=a.length,he=dr(O-k,0),pe=te(he+ue),be=!g;++y<he;)pe[y]=s[y];for(var Pe=y;++G<ue;)pe[Pe+G]=a[G];for(;++M<k;)(be||y<O)&&(pe[Pe+u[M]]=s[y++]);return pe}function Vr(s,a){var u=-1,g=s.length;for(a||(a=te(g));++u<g;)a[u]=s[u];return a}function Hn(s,a,u,g){var y=!u;u||(u={});for(var O=-1,M=a.length;++O<M;){var k=a[O],G=g?g(u[k],s[k],k,u,s):r;G===r&&(G=s[k]),y?ri(u,k,G):Aa(u,k,G)}return u}function i$(s,a){return Hn(s,q0(s),a)}function s$(s,a){return Hn(s,A2(s),a)}function Fl(s,a){return function(u,g){var y=Qe(u)?uO:AD,O=a?a():{};return y(u,s,ze(g,2),O)}}function go(s){return ct(function(a,u){var g=-1,y=u.length,O=y>1?u[y-1]:r,M=y>2?u[2]:r;for(O=s.length>3&&typeof O=="function"?(y--,O):r,M&&Br(u[0],u[1],M)&&(O=y<3?r:O,y=1),a=At(a);++g<y;){var k=u[g];k&&s(a,k,g,O)}return a})}function g2(s,a){return function(u,g){if(u==null)return u;if(!Kr(u))return s(u,g);for(var y=u.length,O=a?y:-1,M=At(u);(a?O--:++O<y)&&g(M[O],O,M)!==!1;);return u}}function m2(s){return function(a,u,g){for(var y=-1,O=At(a),M=g(a),k=M.length;k--;){var G=M[s?k:++y];if(u(O[G],G,O)===!1)break}return a}}function o$(s,a,u){var g=a&H,y=Ta(s);function O(){var M=this&&this!==mt&&this instanceof O?y:s;return M.apply(g?u:this,arguments)}return O}function w2(s){return function(a){a=yt(a);var u=ao(a)?Sn(a):r,g=u?u[0]:a.charAt(0),y=u?Li(u,1).join(""):a.slice(1);return g[s]()+y}}function mo(s){return function(a){return l0(gw(pw(a).replace(ya,"")),s,"")}}function Ta(s){return function(){var a=arguments;switch(a.length){case 0:return new s;case 1:return new s(a[0]);case 2:return new s(a[0],a[1]);case 3:return new s(a[0],a[1],a[2]);case 4:return new s(a[0],a[1],a[2],a[3]);case 5:return new s(a[0],a[1],a[2],a[3],a[4]);case 6:return new s(a[0],a[1],a[2],a[3],a[4],a[5]);case 7:return new s(a[0],a[1],a[2],a[3],a[4],a[5],a[6])}var u=po(s.prototype),g=s.apply(u,a);return Bt(g)?g:u}}function a$(s,a,u){var g=Ta(s);function y(){for(var O=arguments.length,M=te(O),k=O,G=wo(y);k--;)M[k]=arguments[k];var ue=O<3&&M[0]!==G&&M[O-1]!==G?[]:$i(M,G);if(O-=ue.length,O<u)return E2(s,a,Bl,y.placeholder,r,M,ue,r,r,u-O);var he=this&&this!==mt&&this instanceof y?g:s;return vr(he,this,M)}return y}function v2(s){return function(a,u,g){var y=At(a);if(!Kr(a)){var O=ze(u,3);a=yr(a),u=function(k){return O(y[k],k,y)}}var M=s(a,u,g);return M>-1?y[O?a[M]:M]:r}}function y2(s){return ii(function(a){var u=a.length,g=u,y=mn.prototype.thru;for(s&&a.reverse();g--;){var O=a[g];if(typeof O!="function")throw new gn(c);if(y&&!M&&Wl(O)=="wrapper")var M=new mn([],!0)}for(g=M?g:u;++g<u;){O=a[g];var k=Wl(O),G=k=="wrapper"?z0(O):r;G&&K0(G[0])&&G[1]==(d|L|T|x)&&!G[4].length&&G[9]==1?M=M[Wl(G[0])].apply(M,G[3]):M=O.length==1&&K0(O)?M[k]():M.thru(O)}return function(){var ue=arguments,he=ue[0];if(M&&ue.length==1&&Qe(he))return M.plant(he).value();for(var pe=0,be=u?a[pe].apply(this,ue):he;++pe<u;)be=a[pe].call(this,be);return be}})}function Bl(s,a,u,g,y,O,M,k,G,ue){var he=a&d,pe=a&H,be=a&Z,Pe=a&(L|$),We=a&J,ot=be?r:Ta(s);function qe(){for(var ft=arguments.length,wt=te(ft),nn=ft;nn--;)wt[nn]=arguments[nn];if(Pe)var kr=wo(qe),sn=yO(wt,kr);if(g&&(wt=d2(wt,g,y,Pe)),O&&(wt=p2(wt,O,M,Pe)),ft-=sn,Pe&&ft<ue){var tr=$i(wt,kr);return E2(s,a,Bl,qe.placeholder,u,wt,tr,k,G,ue-ft)}var Dn=pe?u:this,ci=be?Dn[s]:s;return ft=wt.length,k?wt=A$(wt,k):We&&ft>1&&wt.reverse(),he&&G<ft&&(wt.length=G),this&&this!==mt&&this instanceof qe&&(ci=ot||Ta(ci)),ci.apply(Dn,wt)}return qe}function b2(s,a){return function(u,g){return LD(u,s,a(g),{})}}function kl(s,a){return function(u,g){var y;if(u===r&&g===r)return a;if(u!==r&&(y=u),g!==r){if(y===r)return g;typeof u=="string"||typeof g=="string"?(u=tn(u),g=tn(g)):(u=s2(u),g=s2(g)),y=s(u,g)}return y}}function F0(s){return ii(function(a){return a=Ut(a,en(ze())),ct(function(u){var g=this;return s(a,function(y){return vr(y,g,u)})})})}function Hl(s,a){a=a===r?" ":tn(a);var u=a.length;if(u<2)return u?T0(a,s):a;var g=T0(a,Ol(s/co(a)));return ao(a)?Li(Sn(g),0,s).join(""):g.slice(0,s)}function c$(s,a,u,g){var y=a&H,O=Ta(s);function M(){for(var k=-1,G=arguments.length,ue=-1,he=g.length,pe=te(he+G),be=this&&this!==mt&&this instanceof M?O:s;++ue<he;)pe[ue]=g[ue];for(;G--;)pe[ue++]=arguments[++k];return vr(be,y?u:this,pe)}return M}function _2(s){return function(a,u,g){return g&&typeof g!="number"&&Br(a,u,g)&&(u=g=r),a=ai(a),u===r?(u=a,a=0):u=ai(u),g=g===r?a<u?1:-1:ai(g),KD(a,u,g,s)}}function zl(s){return function(a,u){return typeof a=="string"&&typeof u=="string"||(a=bn(a),u=bn(u)),s(a,u)}}function E2(s,a,u,g,y,O,M,k,G,ue){var he=a&L,pe=he?M:r,be=he?r:M,Pe=he?O:r,We=he?r:O;a|=he?T:I,a&=~(he?I:T),a&R||(a&=~(H|Z));var ot=[s,a,y,Pe,pe,We,be,k,G,ue],qe=u.apply(r,ot);return K0(s)&&R2(qe,ot),qe.placeholder=g,L2(qe,s,a)}function B0(s){var a=fr[s];return function(u,g){if(u=bn(u),g=g==null?0:Ar(it(g),292),g&&Lm(u)){var y=(yt(u)+"e").split("e"),O=a(y[0]+"e"+(+y[1]+g));return y=(yt(O)+"e").split("e"),+(y[0]+"e"+(+y[1]-g))}return a(u)}}var l$=ho&&1/vl(new ho([,-0]))[1]==le?function(s){return new ho(s)}:cd;function x2(s){return function(a){var u=Or(a);return u==Ue?m0(a):u==He?SO(a):vO(a,s(a))}}function ni(s,a,u,g,y,O,M,k){var G=a&Z;if(!G&&typeof s!="function")throw new gn(c);var ue=g?g.length:0;if(ue||(a&=~(T|I),g=y=r),M=M===r?M:dr(it(M),0),k=k===r?k:it(k),ue-=y?y.length:0,a&I){var he=g,pe=y;g=y=r}var be=G?r:z0(s),Pe=[s,a,u,g,y,he,pe,O,M,k];if(be&&C$(Pe,be),s=Pe[0],a=Pe[1],u=Pe[2],g=Pe[3],y=Pe[4],k=Pe[9]=Pe[9]===r?G?0:s.length:dr(Pe[9]-ue,0),!k&&a&(L|$)&&(a&=~(L|$)),!a||a==H)var We=o$(s,a,u);else a==L||a==$?We=a$(s,a,k):(a==T||a==(H|T))&&!y.length?We=c$(s,a,u,g):We=Bl.apply(r,Pe);var ot=be?n2:R2;return L2(ot(We,Pe),s,a)}function C2(s,a,u,g){return s===r||On(s,uo[u])&&!bt.call(g,u)?a:s}function I2(s,a,u,g,y,O){return Bt(s)&&Bt(a)&&(O.set(a,s),Ml(s,a,r,I2,O),O.delete(a)),s}function u$(s){return La(s)?r:s}function S2(s,a,u,g,y,O){var M=u&P,k=s.length,G=a.length;if(k!=G&&!(M&&G>k))return!1;var ue=O.get(s),he=O.get(a);if(ue&&he)return ue==a&&he==s;var pe=-1,be=!0,Pe=u&j?new ms:r;for(O.set(s,a),O.set(a,s);++pe<k;){var We=s[pe],ot=a[pe];if(g)var qe=M?g(ot,We,pe,a,s,O):g(We,ot,pe,s,a,O);if(qe!==r){if(qe)continue;be=!1;break}if(Pe){if(!u0(a,function(ft,wt){if(!_a(Pe,wt)&&(We===ft||y(We,ft,u,g,O)))return Pe.push(wt)})){be=!1;break}}else if(!(We===ot||y(We,ot,u,g,O))){be=!1;break}}return O.delete(s),O.delete(a),be}function h$(s,a,u,g,y,O,M){switch(u){case p:if(s.byteLength!=a.byteLength||s.byteOffset!=a.byteOffset)return!1;s=s.buffer,a=a.buffer;case b:return!(s.byteLength!=a.byteLength||!O(new Cl(s),new Cl(a)));case Y:case W:case nt:return On(+s,+a);case F:return s.name==a.name&&s.message==a.message;case Je:case ke:return s==a+"";case Ue:var k=m0;case He:var G=g&P;if(k||(k=vl),s.size!=a.size&&!G)return!1;var ue=M.get(s);if(ue)return ue==a;g|=j,M.set(s,a);var he=S2(k(s),k(a),g,y,O,M);return M.delete(s),he;case Ke:if(Sa)return Sa.call(s)==Sa.call(a)}return!1}function f$(s,a,u,g,y,O){var M=u&P,k=k0(s),G=k.length,ue=k0(a),he=ue.length;if(G!=he&&!M)return!1;for(var pe=G;pe--;){var be=k[pe];if(!(M?be in a:bt.call(a,be)))return!1}var Pe=O.get(s),We=O.get(a);if(Pe&&We)return Pe==a&&We==s;var ot=!0;O.set(s,a),O.set(a,s);for(var qe=M;++pe<G;){be=k[pe];var ft=s[be],wt=a[be];if(g)var nn=M?g(wt,ft,be,a,s,O):g(ft,wt,be,s,a,O);if(!(nn===r?ft===wt||y(ft,wt,u,g,O):nn)){ot=!1;break}qe||(qe=be=="constructor")}if(ot&&!qe){var kr=s.constructor,sn=a.constructor;kr!=sn&&"constructor"in s&&"constructor"in a&&!(typeof kr=="function"&&kr instanceof kr&&typeof sn=="function"&&sn instanceof sn)&&(ot=!1)}return O.delete(s),O.delete(a),ot}function ii(s){return Z0(T2(s,r,k2),s+"")}function k0(s){return Vm(s,yr,q0)}function H0(s){return Vm(s,Gr,A2)}var z0=$l?function(s){return $l.get(s)}:cd;function Wl(s){for(var a=s.name+"",u=fo[a],g=bt.call(fo,a)?u.length:0;g--;){var y=u[g],O=y.func;if(O==null||O==s)return y.name}return a}function wo(s){var a=bt.call(C,"placeholder")?C:s;return a.placeholder}function ze(){var s=C.iteratee||od;return s=s===od?Zm:s,arguments.length?s(arguments[0],arguments[1]):s}function ql(s,a){var u=s.__data__;return b$(a)?u[typeof a=="string"?"string":"hash"]:u.map}function W0(s){for(var a=yr(s),u=a.length;u--;){var g=a[u],y=s[g];a[u]=[g,y,$2(y)]}return a}function ys(s,a){var u=xO(s,a);return Gm(u)?u:r}function d$(s){var a=bt.call(s,ps),u=s[ps];try{s[ps]=r;var g=!0}catch{}var y=El.call(s);return g&&(a?s[ps]=u:delete s[ps]),y}var q0=v0?function(s){return s==null?[]:(s=At(s),Oi(v0(s),function(a){return Nm.call(s,a)}))}:ld,A2=v0?function(s){for(var a=[];s;)Di(a,q0(s)),s=Il(s);return a}:ld,Or=Fr;(y0&&Or(new y0(new ArrayBuffer(1)))!=p||xa&&Or(new xa)!=Ue||b0&&Or(b0.resolve())!=Dt||ho&&Or(new ho)!=He||Ca&&Or(new Ca)!=je)&&(Or=function(s){var a=Fr(s),u=a==Ge?s.constructor:r,g=u?bs(u):"";if(g)switch(g){case ZO:return p;case YO:return Ue;case JO:return Dt;case XO:return He;case QO:return je}return a});function p$(s,a,u){for(var g=-1,y=u.length;++g<y;){var O=u[g],M=O.size;switch(O.type){case"drop":s+=M;break;case"dropRight":a-=M;break;case"take":a=Ar(a,s+M);break;case"takeRight":s=dr(s,a-M);break}}return{start:s,end:a}}function g$(s){var a=s.match(Pt);return a?a[1].split(ar):[]}function O2(s,a,u){a=Ri(a,s);for(var g=-1,y=a.length,O=!1;++g<y;){var M=zn(a[g]);if(!(O=s!=null&&u(s,M)))break;s=s[M]}return O||++g!=y?O:(y=s==null?0:s.length,!!y&&Xl(y)&&si(M,y)&&(Qe(s)||_s(s)))}function m$(s){var a=s.length,u=new s.constructor(a);return a&&typeof s[0]=="string"&&bt.call(s,"index")&&(u.index=s.index,u.input=s.input),u}function D2(s){return typeof s.constructor=="function"&&!Na(s)?po(Il(s)):{}}function w$(s,a,u){var g=s.constructor;switch(a){case b:return j0(s);case Y:case W:return new g(+s);case p:return e$(s,u);case m:case D:case B:case K:case Q:case Ee:case Ne:case st:case ht:return h2(s,u);case Ue:return new g;case nt:case ke:return new g(s);case Je:return t$(s);case He:return new g;case Ke:return r$(s)}}function v$(s,a){var u=a.length;if(!u)return s;var g=u-1;return a[g]=(u>1?"& ":"")+a[g],a=a.join(u>2?", ":" "),s.replace(Gt,`{
79
+ */(function(t,e){(function(){var r,n="4.17.21",i=200,o="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",c="Expected a function",l="Invalid `variable` option passed into `_.template`",h="__lodash_hash_undefined__",d=500,v="__lodash_placeholder__",x=1,_=2,A=4,P=1,L=2,k=1,q=2,R=4,F=8,$=16,T=32,C=64,f=128,E=256,Z=512,z=30,ee="...",de=800,me=16,O=1,U=2,ce=3,le=1/0,re=9007199254740991,ne=17976931348623157e292,ae=0/0,ie=4294967295,Oe=ie-1,ge=ie>>>1,Be=[["ary",f],["bind",k],["bindKey",q],["curry",F],["curryRight",$],["flip",Z],["partial",T],["partialRight",C],["rearg",E]],ye="[object Arguments]",Le="[object Array]",X="[object AsyncFunction]",J="[object Boolean]",W="[object Date]",w="[object DOMException]",j="[object Error]",we="[object Function]",ve="[object GeneratorFunction]",Me="[object Map]",nt="[object Number]",at="[object Null]",Ge="[object Object]",Dt="[object Promise]",Pt="[object Proxy]",Je="[object RegExp]",He="[object Set]",ke="[object String]",Ke="[object Symbol]",rt="[object Undefined]",Ue="[object WeakMap]",Ze="[object WeakSet]",b="[object ArrayBuffer]",p="[object DataView]",m="[object Float32Array]",D="[object Float64Array]",B="[object Int8Array]",G="[object Int16Array]",Q="[object Int32Array]",Ee="[object Uint8Array]",Re="[object Uint8ClampedArray]",st="[object Uint16Array]",ht="[object Uint32Array]",lt=/\b__p \+= '';/g,Ur=/\b(__p \+=) '' \+/g,Qn=/(__e\(.*?\)|\b__t\)) \+\n'';/g,$i=/&(?:amp|lt|gt|quot|#39);/g,us=/[&<>"']/g,Wt=RegExp($i.source),Lt=RegExp(us.source),qt=/<%-([\s\S]+?)%>/g,Vt=/<%([\s\S]+?)%>/g,Bt=/<%=([\s\S]+?)%>/g,Mt=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,sr=/^\w*$/,or=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Kt=/[\\^$.*+?()[\]{}|]/g,ar=RegExp(Kt.source),Gt=/^\s+/,Qt=/\s/,Zt=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Tt=/\{\n\/\* \[wrapped with (.+)\] \*/,cr=/,? & /,lr=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,t0=/[()=,{}\[\]\/\s]/,r0=/\\(\\)?/g,n0=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,pn=/\w*$/,i0=/^[-+]0x[0-9a-f]+$/i,s0=/^0b[01]+$/i,o0=/^\[object .+?Constructor\]$/,a0=/^0o[0-7]+$/i,c0=/^(?:0|[1-9]\d*)$/,ei=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ro=/($^)/,l0=/['\n\r\u2028\u2029\\]/g,no="\\ud800-\\udfff",u0="\\u0300-\\u036f",h0="\\ufe20-\\ufe2f",io="\\u20d0-\\u20ff",ol=u0+h0+io,al="\\u2700-\\u27bf",An="a-z\\xdf-\\xf6\\xf8-\\xff",f0="\\xac\\xb1\\xd7\\xf7",d0="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",p0="\\u2000-\\u206f",g0=" \\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",cl="A-Z\\xc0-\\xd6\\xd8-\\xde",ll="\\ufe0e\\ufe0f",hs=f0+d0+p0+g0,Ca="['\u2019]",fs="["+no+"]",Ia="["+hs+"]",ds="["+ol+"]",ul="\\d+",m0="["+al+"]",hl="["+An+"]",fl="[^"+no+hs+ul+al+An+cl+"]",so="\\ud83c[\\udffb-\\udfff]",w0="(?:"+ds+"|"+so+")",dl="[^"+no+"]",oo="(?:\\ud83c[\\udde6-\\uddff]){2}",Oi="[\\ud800-\\udbff][\\udc00-\\udfff]",Qr="["+cl+"]",pl="\\u200d",gl="(?:"+hl+"|"+fl+")",kn="(?:"+Qr+"|"+fl+")",ml="(?:"+Ca+"(?:d|ll|m|re|s|t|ve))?",wl="(?:"+Ca+"(?:D|LL|M|RE|S|T|VE))?",vl=w0+"?",yl="["+ll+"]?",v0="(?:"+pl+"(?:"+[dl,oo,Oi].join("|")+")"+yl+vl+")*",ti="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",bl="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",_l=yl+vl+v0,ao="(?:"+[m0,oo,Oi].join("|")+")"+_l,y0="(?:"+[dl+ds+"?",ds,oo,Oi,fs].join("|")+")",Aa=RegExp(Ca,"g"),b0=RegExp(ds,"g"),co=RegExp(so+"(?="+so+")|"+y0+_l,"g"),El=RegExp([Qr+"?"+hl+"+"+ml+"(?="+[Ia,Qr,"$"].join("|")+")",kn+"+"+wl+"(?="+[Ia,Qr+gl,"$"].join("|")+")",Qr+"?"+gl+"+"+ml,Qr+"+"+wl,bl,ti,ul,ao].join("|"),"g"),xl=RegExp("["+pl+no+ol+ll+"]"),ps=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Cl=["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"],_0=-1,It={};It[m]=It[D]=It[B]=It[G]=It[Q]=It[Ee]=It[Re]=It[st]=It[ht]=!0,It[ye]=It[Le]=It[b]=It[J]=It[p]=It[W]=It[j]=It[we]=It[Me]=It[nt]=It[Ge]=It[Je]=It[He]=It[ke]=It[Ue]=!1;var Ct={};Ct[ye]=Ct[Le]=Ct[b]=Ct[p]=Ct[J]=Ct[W]=Ct[m]=Ct[D]=Ct[B]=Ct[G]=Ct[Q]=Ct[Me]=Ct[nt]=Ct[Ge]=Ct[Je]=Ct[He]=Ct[ke]=Ct[Ke]=Ct[Ee]=Ct[Re]=Ct[st]=Ct[ht]=!0,Ct[j]=Ct[we]=Ct[Ue]=!1;var N={\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"},V={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},fe={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},Ce={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},At=parseFloat,Xe=parseInt,Rt=typeof Jo=="object"&&Jo&&Jo.Object===Object&&Jo,ur=typeof self=="object"&&self&&self.Object===Object&&self,mt=Rt||ur||Function("return this")(),$t=e&&!e.nodeType&&e,er=$t&&!0&&t&&!t.nodeType&&t,qr=er&&er.exports===$t,hr=qr&&Rt.process,Nt=function(){try{var K=er&&er.require&&er.require("util").types;return K||hr&&hr.binding&&hr.binding("util")}catch{}}(),jr=Nt&&Nt.isArrayBuffer,$n=Nt&&Nt.isDate,gn=Nt&&Nt.isMap,Hn=Nt&&Nt.isRegExp,$a=Nt&&Nt.isSet,gs=Nt&&Nt.isTypedArray;function yr(K,se,te){switch(te.length){case 0:return K.call(se);case 1:return K.call(se,te[0]);case 2:return K.call(se,te[0],te[1]);case 3:return K.call(se,te[0],te[1],te[2])}return K.apply(se,te)}function AD(K,se,te,Ie){for(var Ye=-1,vt=K==null?0:K.length;++Ye<vt;){var dr=K[Ye];se(Ie,dr,te(dr),K)}return Ie}function mn(K,se){for(var te=-1,Ie=K==null?0:K.length;++te<Ie&&se(K[te],te,K)!==!1;);return K}function $D(K,se){for(var te=K==null?0:K.length;te--&&se(K[te],te,K)!==!1;);return K}function u2(K,se){for(var te=-1,Ie=K==null?0:K.length;++te<Ie;)if(!se(K[te],te,K))return!1;return!0}function Si(K,se){for(var te=-1,Ie=K==null?0:K.length,Ye=0,vt=[];++te<Ie;){var dr=K[te];se(dr,te,K)&&(vt[Ye++]=dr)}return vt}function Il(K,se){var te=K==null?0:K.length;return!!te&&lo(K,se,0)>-1}function E0(K,se,te){for(var Ie=-1,Ye=K==null?0:K.length;++Ie<Ye;)if(te(se,K[Ie]))return!0;return!1}function Ut(K,se){for(var te=-1,Ie=K==null?0:K.length,Ye=Array(Ie);++te<Ie;)Ye[te]=se(K[te],te,K);return Ye}function Di(K,se){for(var te=-1,Ie=se.length,Ye=K.length;++te<Ie;)K[Ye+te]=se[te];return K}function x0(K,se,te,Ie){var Ye=-1,vt=K==null?0:K.length;for(Ie&&vt&&(te=K[++Ye]);++Ye<vt;)te=se(te,K[Ye],Ye,K);return te}function OD(K,se,te,Ie){var Ye=K==null?0:K.length;for(Ie&&Ye&&(te=K[--Ye]);Ye--;)te=se(te,K[Ye],Ye,K);return te}function C0(K,se){for(var te=-1,Ie=K==null?0:K.length;++te<Ie;)if(se(K[te],te,K))return!0;return!1}var SD=I0("length");function DD(K){return K.split("")}function PD(K){return K.match(lr)||[]}function h2(K,se,te){var Ie;return te(K,function(Ye,vt,dr){if(se(Ye,vt,dr))return Ie=vt,!1}),Ie}function Al(K,se,te,Ie){for(var Ye=K.length,vt=te+(Ie?1:-1);Ie?vt--:++vt<Ye;)if(se(K[vt],vt,K))return vt;return-1}function lo(K,se,te){return se===se?zD(K,se,te):Al(K,f2,te)}function TD(K,se,te,Ie){for(var Ye=te-1,vt=K.length;++Ye<vt;)if(Ie(K[Ye],se))return Ye;return-1}function f2(K){return K!==K}function d2(K,se){var te=K==null?0:K.length;return te?$0(K,se)/te:ae}function I0(K){return function(se){return se==null?r:se[K]}}function A0(K){return function(se){return K==null?r:K[se]}}function p2(K,se,te,Ie,Ye){return Ye(K,function(vt,dr,Ot){te=Ie?(Ie=!1,vt):se(te,vt,dr,Ot)}),te}function RD(K,se){var te=K.length;for(K.sort(se);te--;)K[te]=K[te].value;return K}function $0(K,se){for(var te,Ie=-1,Ye=K.length;++Ie<Ye;){var vt=se(K[Ie]);vt!==r&&(te=te===r?vt:te+vt)}return te}function O0(K,se){for(var te=-1,Ie=Array(K);++te<K;)Ie[te]=se(te);return Ie}function ND(K,se){return Ut(se,function(te){return[te,K[te]]})}function g2(K){return K&&K.slice(0,y2(K)+1).replace(Gt,"")}function en(K){return function(se){return K(se)}}function S0(K,se){return Ut(se,function(te){return K[te]})}function Oa(K,se){return K.has(se)}function m2(K,se){for(var te=-1,Ie=K.length;++te<Ie&&lo(se,K[te],0)>-1;);return te}function w2(K,se){for(var te=K.length;te--&&lo(se,K[te],0)>-1;);return te}function FD(K,se){for(var te=K.length,Ie=0;te--;)K[te]===se&&++Ie;return Ie}var LD=A0(N),MD=A0(V);function UD(K){return"\\"+Ce[K]}function jD(K,se){return K==null?r:K[se]}function uo(K){return xl.test(K)}function BD(K){return ps.test(K)}function kD(K){for(var se,te=[];!(se=K.next()).done;)te.push(se.value);return te}function D0(K){var se=-1,te=Array(K.size);return K.forEach(function(Ie,Ye){te[++se]=[Ye,Ie]}),te}function v2(K,se){return function(te){return K(se(te))}}function Pi(K,se){for(var te=-1,Ie=K.length,Ye=0,vt=[];++te<Ie;){var dr=K[te];(dr===se||dr===v)&&(K[te]=v,vt[Ye++]=te)}return vt}function $l(K){var se=-1,te=Array(K.size);return K.forEach(function(Ie){te[++se]=Ie}),te}function HD(K){var se=-1,te=Array(K.size);return K.forEach(function(Ie){te[++se]=[Ie,Ie]}),te}function zD(K,se,te){for(var Ie=te-1,Ye=K.length;++Ie<Ye;)if(K[Ie]===se)return Ie;return-1}function WD(K,se,te){for(var Ie=te+1;Ie--;)if(K[Ie]===se)return Ie;return Ie}function ho(K){return uo(K)?VD(K):SD(K)}function On(K){return uo(K)?KD(K):DD(K)}function y2(K){for(var se=K.length;se--&&Qt.test(K.charAt(se)););return se}var qD=A0(fe);function VD(K){for(var se=co.lastIndex=0;co.test(K);)++se;return se}function KD(K){return K.match(co)||[]}function GD(K){return K.match(El)||[]}var ZD=function K(se){se=se==null?mt:fo.defaults(mt.Object(),se,fo.pick(mt,Cl));var te=se.Array,Ie=se.Date,Ye=se.Error,vt=se.Function,dr=se.Math,Ot=se.Object,P0=se.RegExp,YD=se.String,wn=se.TypeError,Ol=te.prototype,JD=vt.prototype,po=Ot.prototype,Sl=se["__core-js_shared__"],Dl=JD.toString,bt=po.hasOwnProperty,XD=0,b2=function(){var s=/[^.]+$/.exec(Sl&&Sl.keys&&Sl.keys.IE_PROTO||"");return s?"Symbol(src)_1."+s:""}(),Pl=po.toString,QD=Dl.call(Ot),eP=mt._,tP=P0("^"+Dl.call(bt).replace(Kt,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Tl=qr?se.Buffer:r,Ti=se.Symbol,Rl=se.Uint8Array,_2=Tl?Tl.allocUnsafe:r,Nl=v2(Ot.getPrototypeOf,Ot),E2=Ot.create,x2=po.propertyIsEnumerable,Fl=Ol.splice,C2=Ti?Ti.isConcatSpreadable:r,Sa=Ti?Ti.iterator:r,ms=Ti?Ti.toStringTag:r,Ll=function(){try{var s=_s(Ot,"defineProperty");return s({},"",{}),s}catch{}}(),rP=se.clearTimeout!==mt.clearTimeout&&se.clearTimeout,nP=Ie&&Ie.now!==mt.Date.now&&Ie.now,iP=se.setTimeout!==mt.setTimeout&&se.setTimeout,Ml=dr.ceil,Ul=dr.floor,T0=Ot.getOwnPropertySymbols,sP=Tl?Tl.isBuffer:r,I2=se.isFinite,oP=Ol.join,aP=v2(Ot.keys,Ot),pr=dr.max,Sr=dr.min,cP=Ie.now,lP=se.parseInt,A2=dr.random,uP=Ol.reverse,R0=_s(se,"DataView"),Da=_s(se,"Map"),N0=_s(se,"Promise"),go=_s(se,"Set"),Pa=_s(se,"WeakMap"),Ta=_s(Ot,"create"),jl=Pa&&new Pa,mo={},hP=Es(R0),fP=Es(Da),dP=Es(N0),pP=Es(go),gP=Es(Pa),Bl=Ti?Ti.prototype:r,Ra=Bl?Bl.valueOf:r,$2=Bl?Bl.toString:r;function I(s){if(Yt(s)&&!Qe(s)&&!(s instanceof dt)){if(s instanceof vn)return s;if(bt.call(s,"__wrapped__"))return Ow(s)}return new vn(s)}var wo=function(){function s(){}return function(a){if(!kt(a))return{};if(E2)return E2(a);s.prototype=a;var u=new s;return s.prototype=r,u}}();function kl(){}function vn(s,a){this.__wrapped__=s,this.__actions__=[],this.__chain__=!!a,this.__index__=0,this.__values__=r}I.templateSettings={escape:qt,evaluate:Vt,interpolate:Bt,variable:"",imports:{_:I}},I.prototype=kl.prototype,I.prototype.constructor=I,vn.prototype=wo(kl.prototype),vn.prototype.constructor=vn;function dt(s){this.__wrapped__=s,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=ie,this.__views__=[]}function mP(){var s=new dt(this.__wrapped__);return s.__actions__=Vr(this.__actions__),s.__dir__=this.__dir__,s.__filtered__=this.__filtered__,s.__iteratees__=Vr(this.__iteratees__),s.__takeCount__=this.__takeCount__,s.__views__=Vr(this.__views__),s}function wP(){if(this.__filtered__){var s=new dt(this);s.__dir__=-1,s.__filtered__=!0}else s=this.clone(),s.__dir__*=-1;return s}function vP(){var s=this.__wrapped__.value(),a=this.__dir__,u=Qe(s),g=a<0,y=u?s.length:0,S=DT(0,y,this.__views__),M=S.start,H=S.end,Y=H-M,ue=g?H:M-1,he=this.__iteratees__,pe=he.length,be=0,Te=Sr(Y,this.__takeCount__);if(!u||!g&&y==Y&&Te==Y)return J2(s,this.__actions__);var We=[];e:for(;Y--&&be<Te;){ue+=a;for(var ot=-1,qe=s[ue];++ot<pe;){var ft=he[ot],wt=ft.iteratee,nn=ft.type,Hr=wt(qe);if(nn==U)qe=Hr;else if(!Hr){if(nn==O)continue e;break e}}We[be++]=qe}return We}dt.prototype=wo(kl.prototype),dt.prototype.constructor=dt;function ws(s){var a=-1,u=s==null?0:s.length;for(this.clear();++a<u;){var g=s[a];this.set(g[0],g[1])}}function yP(){this.__data__=Ta?Ta(null):{},this.size=0}function bP(s){var a=this.has(s)&&delete this.__data__[s];return this.size-=a?1:0,a}function _P(s){var a=this.__data__;if(Ta){var u=a[s];return u===h?r:u}return bt.call(a,s)?a[s]:r}function EP(s){var a=this.__data__;return Ta?a[s]!==r:bt.call(a,s)}function xP(s,a){var u=this.__data__;return this.size+=this.has(s)?0:1,u[s]=Ta&&a===r?h:a,this}ws.prototype.clear=yP,ws.prototype.delete=bP,ws.prototype.get=_P,ws.prototype.has=EP,ws.prototype.set=xP;function ri(s){var a=-1,u=s==null?0:s.length;for(this.clear();++a<u;){var g=s[a];this.set(g[0],g[1])}}function CP(){this.__data__=[],this.size=0}function IP(s){var a=this.__data__,u=Hl(a,s);if(u<0)return!1;var g=a.length-1;return u==g?a.pop():Fl.call(a,u,1),--this.size,!0}function AP(s){var a=this.__data__,u=Hl(a,s);return u<0?r:a[u][1]}function $P(s){return Hl(this.__data__,s)>-1}function OP(s,a){var u=this.__data__,g=Hl(u,s);return g<0?(++this.size,u.push([s,a])):u[g][1]=a,this}ri.prototype.clear=CP,ri.prototype.delete=IP,ri.prototype.get=AP,ri.prototype.has=$P,ri.prototype.set=OP;function ni(s){var a=-1,u=s==null?0:s.length;for(this.clear();++a<u;){var g=s[a];this.set(g[0],g[1])}}function SP(){this.size=0,this.__data__={hash:new ws,map:new(Da||ri),string:new ws}}function DP(s){var a=eu(this,s).delete(s);return this.size-=a?1:0,a}function PP(s){return eu(this,s).get(s)}function TP(s){return eu(this,s).has(s)}function RP(s,a){var u=eu(this,s),g=u.size;return u.set(s,a),this.size+=u.size==g?0:1,this}ni.prototype.clear=SP,ni.prototype.delete=DP,ni.prototype.get=PP,ni.prototype.has=TP,ni.prototype.set=RP;function vs(s){var a=-1,u=s==null?0:s.length;for(this.__data__=new ni;++a<u;)this.add(s[a])}function NP(s){return this.__data__.set(s,h),this}function FP(s){return this.__data__.has(s)}vs.prototype.add=vs.prototype.push=NP,vs.prototype.has=FP;function Sn(s){var a=this.__data__=new ri(s);this.size=a.size}function LP(){this.__data__=new ri,this.size=0}function MP(s){var a=this.__data__,u=a.delete(s);return this.size=a.size,u}function UP(s){return this.__data__.get(s)}function jP(s){return this.__data__.has(s)}function BP(s,a){var u=this.__data__;if(u instanceof ri){var g=u.__data__;if(!Da||g.length<i-1)return g.push([s,a]),this.size=++u.size,this;u=this.__data__=new ni(g)}return u.set(s,a),this.size=u.size,this}Sn.prototype.clear=LP,Sn.prototype.delete=MP,Sn.prototype.get=UP,Sn.prototype.has=jP,Sn.prototype.set=BP;function O2(s,a){var u=Qe(s),g=!u&&xs(s),y=!u&&!g&&Mi(s),S=!u&&!g&&!y&&_o(s),M=u||g||y||S,H=M?O0(s.length,YD):[],Y=H.length;for(var ue in s)(a||bt.call(s,ue))&&!(M&&(ue=="length"||y&&(ue=="offset"||ue=="parent")||S&&(ue=="buffer"||ue=="byteLength"||ue=="byteOffset")||ai(ue,Y)))&&H.push(ue);return H}function S2(s){var a=s.length;return a?s[q0(0,a-1)]:r}function kP(s,a){return tu(Vr(s),ys(a,0,s.length))}function HP(s){return tu(Vr(s))}function F0(s,a,u){(u!==r&&!Dn(s[a],u)||u===r&&!(a in s))&&ii(s,a,u)}function Na(s,a,u){var g=s[a];(!(bt.call(s,a)&&Dn(g,u))||u===r&&!(a in s))&&ii(s,a,u)}function Hl(s,a){for(var u=s.length;u--;)if(Dn(s[u][0],a))return u;return-1}function zP(s,a,u,g){return Ri(s,function(y,S,M){a(g,y,u(y),M)}),g}function D2(s,a){return s&&Wn(a,br(a),s)}function WP(s,a){return s&&Wn(a,Gr(a),s)}function ii(s,a,u){a=="__proto__"&&Ll?Ll(s,a,{configurable:!0,enumerable:!0,value:u,writable:!0}):s[a]=u}function L0(s,a){for(var u=-1,g=a.length,y=te(g),S=s==null;++u<g;)y[u]=S?r:md(s,a[u]);return y}function ys(s,a,u){return s===s&&(u!==r&&(s=s<=u?s:u),a!==r&&(s=s>=a?s:a)),s}function yn(s,a,u,g,y,S){var M,H=a&x,Y=a&_,ue=a&A;if(u&&(M=y?u(s,g,y,S):u(s)),M!==r)return M;if(!kt(s))return s;var he=Qe(s);if(he){if(M=TT(s),!H)return Vr(s,M)}else{var pe=Dr(s),be=pe==we||pe==ve;if(Mi(s))return ew(s,H);if(pe==Ge||pe==ye||be&&!y){if(M=Y||be?{}:yw(s),!H)return Y?_T(s,WP(M,s)):bT(s,D2(M,s))}else{if(!Ct[pe])return y?s:{};M=RT(s,pe,H)}}S||(S=new Sn);var Te=S.get(s);if(Te)return Te;S.set(s,M),Gw(s)?s.forEach(function(qe){M.add(yn(qe,a,u,qe,s,S))}):Vw(s)&&s.forEach(function(qe,ft){M.set(ft,yn(qe,a,u,ft,s,S))});var We=ue?Y?rd:td:Y?Gr:br,ot=he?r:We(s);return mn(ot||s,function(qe,ft){ot&&(ft=qe,qe=s[ft]),Na(M,ft,yn(qe,a,u,ft,s,S))}),M}function qP(s){var a=br(s);return function(u){return P2(u,s,a)}}function P2(s,a,u){var g=u.length;if(s==null)return!g;for(s=Ot(s);g--;){var y=u[g],S=a[y],M=s[y];if(M===r&&!(y in s)||!S(M))return!1}return!0}function T2(s,a,u){if(typeof s!="function")throw new wn(c);return ka(function(){s.apply(r,u)},a)}function Fa(s,a,u,g){var y=-1,S=Il,M=!0,H=s.length,Y=[],ue=a.length;if(!H)return Y;u&&(a=Ut(a,en(u))),g?(S=E0,M=!1):a.length>=i&&(S=Oa,M=!1,a=new vs(a));e:for(;++y<H;){var he=s[y],pe=u==null?he:u(he);if(he=g||he!==0?he:0,M&&pe===pe){for(var be=ue;be--;)if(a[be]===pe)continue e;Y.push(he)}else S(a,pe,g)||Y.push(he)}return Y}var Ri=sw(zn),R2=sw(U0,!0);function VP(s,a){var u=!0;return Ri(s,function(g,y,S){return u=!!a(g,y,S),u}),u}function zl(s,a,u){for(var g=-1,y=s.length;++g<y;){var S=s[g],M=a(S);if(M!=null&&(H===r?M===M&&!rn(M):u(M,H)))var H=M,Y=S}return Y}function KP(s,a,u,g){var y=s.length;for(u=it(u),u<0&&(u=-u>y?0:y+u),g=g===r||g>y?y:it(g),g<0&&(g+=y),g=u>g?0:Yw(g);u<g;)s[u++]=a;return s}function N2(s,a){var u=[];return Ri(s,function(g,y,S){a(g,y,S)&&u.push(g)}),u}function Ar(s,a,u,g,y){var S=-1,M=s.length;for(u||(u=FT),y||(y=[]);++S<M;){var H=s[S];a>0&&u(H)?a>1?Ar(H,a-1,u,g,y):Di(y,H):g||(y[y.length]=H)}return y}var M0=ow(),F2=ow(!0);function zn(s,a){return s&&M0(s,a,br)}function U0(s,a){return s&&F2(s,a,br)}function Wl(s,a){return Si(a,function(u){return ci(s[u])})}function bs(s,a){a=Fi(a,s);for(var u=0,g=a.length;s!=null&&u<g;)s=s[qn(a[u++])];return u&&u==g?s:r}function L2(s,a,u){var g=a(s);return Qe(s)?g:Di(g,u(s))}function Br(s){return s==null?s===r?rt:at:ms&&ms in Ot(s)?ST(s):HT(s)}function j0(s,a){return s>a}function GP(s,a){return s!=null&&bt.call(s,a)}function ZP(s,a){return s!=null&&a in Ot(s)}function YP(s,a,u){return s>=Sr(a,u)&&s<pr(a,u)}function B0(s,a,u){for(var g=u?E0:Il,y=s[0].length,S=s.length,M=S,H=te(S),Y=1/0,ue=[];M--;){var he=s[M];M&&a&&(he=Ut(he,en(a))),Y=Sr(he.length,Y),H[M]=!u&&(a||y>=120&&he.length>=120)?new vs(M&&he):r}he=s[0];var pe=-1,be=H[0];e:for(;++pe<y&&ue.length<Y;){var Te=he[pe],We=a?a(Te):Te;if(Te=u||Te!==0?Te:0,!(be?Oa(be,We):g(ue,We,u))){for(M=S;--M;){var ot=H[M];if(!(ot?Oa(ot,We):g(s[M],We,u)))continue e}be&&be.push(We),ue.push(Te)}}return ue}function JP(s,a,u,g){return zn(s,function(y,S,M){a(g,u(y),S,M)}),g}function La(s,a,u){a=Fi(a,s),s=xw(s,a);var g=s==null?s:s[qn(_n(a))];return g==null?r:yr(g,s,u)}function M2(s){return Yt(s)&&Br(s)==ye}function XP(s){return Yt(s)&&Br(s)==b}function QP(s){return Yt(s)&&Br(s)==W}function Ma(s,a,u,g,y){return s===a?!0:s==null||a==null||!Yt(s)&&!Yt(a)?s!==s&&a!==a:eT(s,a,u,g,Ma,y)}function eT(s,a,u,g,y,S){var M=Qe(s),H=Qe(a),Y=M?Le:Dr(s),ue=H?Le:Dr(a);Y=Y==ye?Ge:Y,ue=ue==ye?Ge:ue;var he=Y==Ge,pe=ue==Ge,be=Y==ue;if(be&&Mi(s)){if(!Mi(a))return!1;M=!0,he=!1}if(be&&!he)return S||(S=new Sn),M||_o(s)?mw(s,a,u,g,y,S):$T(s,a,Y,u,g,y,S);if(!(u&P)){var Te=he&&bt.call(s,"__wrapped__"),We=pe&&bt.call(a,"__wrapped__");if(Te||We){var ot=Te?s.value():s,qe=We?a.value():a;return S||(S=new Sn),y(ot,qe,u,g,S)}}return be?(S||(S=new Sn),OT(s,a,u,g,y,S)):!1}function tT(s){return Yt(s)&&Dr(s)==Me}function k0(s,a,u,g){var y=u.length,S=y,M=!g;if(s==null)return!S;for(s=Ot(s);y--;){var H=u[y];if(M&&H[2]?H[1]!==s[H[0]]:!(H[0]in s))return!1}for(;++y<S;){H=u[y];var Y=H[0],ue=s[Y],he=H[1];if(M&&H[2]){if(ue===r&&!(Y in s))return!1}else{var pe=new Sn;if(g)var be=g(ue,he,Y,s,a,pe);if(!(be===r?Ma(he,ue,P|L,g,pe):be))return!1}}return!0}function U2(s){if(!kt(s)||MT(s))return!1;var a=ci(s)?tP:o0;return a.test(Es(s))}function rT(s){return Yt(s)&&Br(s)==Je}function nT(s){return Yt(s)&&Dr(s)==He}function iT(s){return Yt(s)&&au(s.length)&&!!It[Br(s)]}function j2(s){return typeof s=="function"?s:s==null?Zr:typeof s=="object"?Qe(s)?H2(s[0],s[1]):k2(s):av(s)}function H0(s){if(!Ba(s))return aP(s);var a=[];for(var u in Ot(s))bt.call(s,u)&&u!="constructor"&&a.push(u);return a}function sT(s){if(!kt(s))return kT(s);var a=Ba(s),u=[];for(var g in s)g=="constructor"&&(a||!bt.call(s,g))||u.push(g);return u}function z0(s,a){return s<a}function B2(s,a){var u=-1,g=Kr(s)?te(s.length):[];return Ri(s,function(y,S,M){g[++u]=a(y,S,M)}),g}function k2(s){var a=id(s);return a.length==1&&a[0][2]?_w(a[0][0],a[0][1]):function(u){return u===s||k0(u,s,a)}}function H2(s,a){return od(s)&&bw(a)?_w(qn(s),a):function(u){var g=md(u,s);return g===r&&g===a?wd(u,s):Ma(a,g,P|L)}}function ql(s,a,u,g,y){s!==a&&M0(a,function(S,M){if(y||(y=new Sn),kt(S))oT(s,a,M,u,ql,g,y);else{var H=g?g(cd(s,M),S,M+"",s,a,y):r;H===r&&(H=S),F0(s,M,H)}},Gr)}function oT(s,a,u,g,y,S,M){var H=cd(s,u),Y=cd(a,u),ue=M.get(Y);if(ue){F0(s,u,ue);return}var he=S?S(H,Y,u+"",s,a,M):r,pe=he===r;if(pe){var be=Qe(Y),Te=!be&&Mi(Y),We=!be&&!Te&&_o(Y);he=Y,be||Te||We?Qe(H)?he=H:tr(H)?he=Vr(H):Te?(pe=!1,he=ew(Y,!0)):We?(pe=!1,he=tw(Y,!0)):he=[]:Ha(Y)||xs(Y)?(he=H,xs(H)?he=Jw(H):(!kt(H)||ci(H))&&(he=yw(Y))):pe=!1}pe&&(M.set(Y,he),y(he,Y,g,S,M),M.delete(Y)),F0(s,u,he)}function z2(s,a){var u=s.length;if(u)return a+=a<0?u:0,ai(a,u)?s[a]:r}function W2(s,a,u){a.length?a=Ut(a,function(S){return Qe(S)?function(M){return bs(M,S.length===1?S[0]:S)}:S}):a=[Zr];var g=-1;a=Ut(a,en(ze()));var y=B2(s,function(S,M,H){var Y=Ut(a,function(ue){return ue(S)});return{criteria:Y,index:++g,value:S}});return RD(y,function(S,M){return yT(S,M,u)})}function aT(s,a){return q2(s,a,function(u,g){return wd(s,g)})}function q2(s,a,u){for(var g=-1,y=a.length,S={};++g<y;){var M=a[g],H=bs(s,M);u(H,M)&&Ua(S,Fi(M,s),H)}return S}function cT(s){return function(a){return bs(a,s)}}function W0(s,a,u,g){var y=g?TD:lo,S=-1,M=a.length,H=s;for(s===a&&(a=Vr(a)),u&&(H=Ut(s,en(u)));++S<M;)for(var Y=0,ue=a[S],he=u?u(ue):ue;(Y=y(H,he,Y,g))>-1;)H!==s&&Fl.call(H,Y,1),Fl.call(s,Y,1);return s}function V2(s,a){for(var u=s?a.length:0,g=u-1;u--;){var y=a[u];if(u==g||y!==S){var S=y;ai(y)?Fl.call(s,y,1):G0(s,y)}}return s}function q0(s,a){return s+Ul(A2()*(a-s+1))}function lT(s,a,u,g){for(var y=-1,S=pr(Ml((a-s)/(u||1)),0),M=te(S);S--;)M[g?S:++y]=s,s+=u;return M}function V0(s,a){var u="";if(!s||a<1||a>re)return u;do a%2&&(u+=s),a=Ul(a/2),a&&(s+=s);while(a);return u}function ct(s,a){return ld(Ew(s,a,Zr),s+"")}function uT(s){return S2(Eo(s))}function hT(s,a){var u=Eo(s);return tu(u,ys(a,0,u.length))}function Ua(s,a,u,g){if(!kt(s))return s;a=Fi(a,s);for(var y=-1,S=a.length,M=S-1,H=s;H!=null&&++y<S;){var Y=qn(a[y]),ue=u;if(Y==="__proto__"||Y==="constructor"||Y==="prototype")return s;if(y!=M){var he=H[Y];ue=g?g(he,Y,H):r,ue===r&&(ue=kt(he)?he:ai(a[y+1])?[]:{})}Na(H,Y,ue),H=H[Y]}return s}var K2=jl?function(s,a){return jl.set(s,a),s}:Zr,fT=Ll?function(s,a){return Ll(s,"toString",{configurable:!0,enumerable:!1,value:yd(a),writable:!0})}:Zr;function dT(s){return tu(Eo(s))}function bn(s,a,u){var g=-1,y=s.length;a<0&&(a=-a>y?0:y+a),u=u>y?y:u,u<0&&(u+=y),y=a>u?0:u-a>>>0,a>>>=0;for(var S=te(y);++g<y;)S[g]=s[g+a];return S}function pT(s,a){var u;return Ri(s,function(g,y,S){return u=a(g,y,S),!u}),!!u}function Vl(s,a,u){var g=0,y=s==null?g:s.length;if(typeof a=="number"&&a===a&&y<=ge){for(;g<y;){var S=g+y>>>1,M=s[S];M!==null&&!rn(M)&&(u?M<=a:M<a)?g=S+1:y=S}return y}return K0(s,a,Zr,u)}function K0(s,a,u,g){var y=0,S=s==null?0:s.length;if(S===0)return 0;a=u(a);for(var M=a!==a,H=a===null,Y=rn(a),ue=a===r;y<S;){var he=Ul((y+S)/2),pe=u(s[he]),be=pe!==r,Te=pe===null,We=pe===pe,ot=rn(pe);if(M)var qe=g||We;else ue?qe=We&&(g||be):H?qe=We&&be&&(g||!Te):Y?qe=We&&be&&!Te&&(g||!ot):Te||ot?qe=!1:qe=g?pe<=a:pe<a;qe?y=he+1:S=he}return Sr(S,Oe)}function G2(s,a){for(var u=-1,g=s.length,y=0,S=[];++u<g;){var M=s[u],H=a?a(M):M;if(!u||!Dn(H,Y)){var Y=H;S[y++]=M===0?0:M}}return S}function Z2(s){return typeof s=="number"?s:rn(s)?ae:+s}function tn(s){if(typeof s=="string")return s;if(Qe(s))return Ut(s,tn)+"";if(rn(s))return $2?$2.call(s):"";var a=s+"";return a=="0"&&1/s==-le?"-0":a}function Ni(s,a,u){var g=-1,y=Il,S=s.length,M=!0,H=[],Y=H;if(u)M=!1,y=E0;else if(S>=i){var ue=a?null:IT(s);if(ue)return $l(ue);M=!1,y=Oa,Y=new vs}else Y=a?[]:H;e:for(;++g<S;){var he=s[g],pe=a?a(he):he;if(he=u||he!==0?he:0,M&&pe===pe){for(var be=Y.length;be--;)if(Y[be]===pe)continue e;a&&Y.push(pe),H.push(he)}else y(Y,pe,u)||(Y!==H&&Y.push(pe),H.push(he))}return H}function G0(s,a){return a=Fi(a,s),s=xw(s,a),s==null||delete s[qn(_n(a))]}function Y2(s,a,u,g){return Ua(s,a,u(bs(s,a)),g)}function Kl(s,a,u,g){for(var y=s.length,S=g?y:-1;(g?S--:++S<y)&&a(s[S],S,s););return u?bn(s,g?0:S,g?S+1:y):bn(s,g?S+1:0,g?y:S)}function J2(s,a){var u=s;return u instanceof dt&&(u=u.value()),x0(a,function(g,y){return y.func.apply(y.thisArg,Di([g],y.args))},u)}function Z0(s,a,u){var g=s.length;if(g<2)return g?Ni(s[0]):[];for(var y=-1,S=te(g);++y<g;)for(var M=s[y],H=-1;++H<g;)H!=y&&(S[y]=Fa(S[y]||M,s[H],a,u));return Ni(Ar(S,1),a,u)}function X2(s,a,u){for(var g=-1,y=s.length,S=a.length,M={};++g<y;){var H=g<S?a[g]:r;u(M,s[g],H)}return M}function Y0(s){return tr(s)?s:[]}function J0(s){return typeof s=="function"?s:Zr}function Fi(s,a){return Qe(s)?s:od(s,a)?[s]:$w(yt(s))}var gT=ct;function Li(s,a,u){var g=s.length;return u=u===r?g:u,!a&&u>=g?s:bn(s,a,u)}var Q2=rP||function(s){return mt.clearTimeout(s)};function ew(s,a){if(a)return s.slice();var u=s.length,g=_2?_2(u):new s.constructor(u);return s.copy(g),g}function X0(s){var a=new s.constructor(s.byteLength);return new Rl(a).set(new Rl(s)),a}function mT(s,a){var u=a?X0(s.buffer):s.buffer;return new s.constructor(u,s.byteOffset,s.byteLength)}function wT(s){var a=new s.constructor(s.source,pn.exec(s));return a.lastIndex=s.lastIndex,a}function vT(s){return Ra?Ot(Ra.call(s)):{}}function tw(s,a){var u=a?X0(s.buffer):s.buffer;return new s.constructor(u,s.byteOffset,s.length)}function rw(s,a){if(s!==a){var u=s!==r,g=s===null,y=s===s,S=rn(s),M=a!==r,H=a===null,Y=a===a,ue=rn(a);if(!H&&!ue&&!S&&s>a||S&&M&&Y&&!H&&!ue||g&&M&&Y||!u&&Y||!y)return 1;if(!g&&!S&&!ue&&s<a||ue&&u&&y&&!g&&!S||H&&u&&y||!M&&y||!Y)return-1}return 0}function yT(s,a,u){for(var g=-1,y=s.criteria,S=a.criteria,M=y.length,H=u.length;++g<M;){var Y=rw(y[g],S[g]);if(Y){if(g>=H)return Y;var ue=u[g];return Y*(ue=="desc"?-1:1)}}return s.index-a.index}function nw(s,a,u,g){for(var y=-1,S=s.length,M=u.length,H=-1,Y=a.length,ue=pr(S-M,0),he=te(Y+ue),pe=!g;++H<Y;)he[H]=a[H];for(;++y<M;)(pe||y<S)&&(he[u[y]]=s[y]);for(;ue--;)he[H++]=s[y++];return he}function iw(s,a,u,g){for(var y=-1,S=s.length,M=-1,H=u.length,Y=-1,ue=a.length,he=pr(S-H,0),pe=te(he+ue),be=!g;++y<he;)pe[y]=s[y];for(var Te=y;++Y<ue;)pe[Te+Y]=a[Y];for(;++M<H;)(be||y<S)&&(pe[Te+u[M]]=s[y++]);return pe}function Vr(s,a){var u=-1,g=s.length;for(a||(a=te(g));++u<g;)a[u]=s[u];return a}function Wn(s,a,u,g){var y=!u;u||(u={});for(var S=-1,M=a.length;++S<M;){var H=a[S],Y=g?g(u[H],s[H],H,u,s):r;Y===r&&(Y=s[H]),y?ii(u,H,Y):Na(u,H,Y)}return u}function bT(s,a){return Wn(s,sd(s),a)}function _T(s,a){return Wn(s,ww(s),a)}function Gl(s,a){return function(u,g){var y=Qe(u)?AD:zP,S=a?a():{};return y(u,s,ze(g,2),S)}}function vo(s){return ct(function(a,u){var g=-1,y=u.length,S=y>1?u[y-1]:r,M=y>2?u[2]:r;for(S=s.length>3&&typeof S=="function"?(y--,S):r,M&&kr(u[0],u[1],M)&&(S=y<3?r:S,y=1),a=Ot(a);++g<y;){var H=u[g];H&&s(a,H,g,S)}return a})}function sw(s,a){return function(u,g){if(u==null)return u;if(!Kr(u))return s(u,g);for(var y=u.length,S=a?y:-1,M=Ot(u);(a?S--:++S<y)&&g(M[S],S,M)!==!1;);return u}}function ow(s){return function(a,u,g){for(var y=-1,S=Ot(a),M=g(a),H=M.length;H--;){var Y=M[s?H:++y];if(u(S[Y],Y,S)===!1)break}return a}}function ET(s,a,u){var g=a&k,y=ja(s);function S(){var M=this&&this!==mt&&this instanceof S?y:s;return M.apply(g?u:this,arguments)}return S}function aw(s){return function(a){a=yt(a);var u=uo(a)?On(a):r,g=u?u[0]:a.charAt(0),y=u?Li(u,1).join(""):a.slice(1);return g[s]()+y}}function yo(s){return function(a){return x0(sv(iv(a).replace(Aa,"")),s,"")}}function ja(s){return function(){var a=arguments;switch(a.length){case 0:return new s;case 1:return new s(a[0]);case 2:return new s(a[0],a[1]);case 3:return new s(a[0],a[1],a[2]);case 4:return new s(a[0],a[1],a[2],a[3]);case 5:return new s(a[0],a[1],a[2],a[3],a[4]);case 6:return new s(a[0],a[1],a[2],a[3],a[4],a[5]);case 7:return new s(a[0],a[1],a[2],a[3],a[4],a[5],a[6])}var u=wo(s.prototype),g=s.apply(u,a);return kt(g)?g:u}}function xT(s,a,u){var g=ja(s);function y(){for(var S=arguments.length,M=te(S),H=S,Y=bo(y);H--;)M[H]=arguments[H];var ue=S<3&&M[0]!==Y&&M[S-1]!==Y?[]:Pi(M,Y);if(S-=ue.length,S<u)return fw(s,a,Zl,y.placeholder,r,M,ue,r,r,u-S);var he=this&&this!==mt&&this instanceof y?g:s;return yr(he,this,M)}return y}function cw(s){return function(a,u,g){var y=Ot(a);if(!Kr(a)){var S=ze(u,3);a=br(a),u=function(H){return S(y[H],H,y)}}var M=s(a,u,g);return M>-1?y[S?a[M]:M]:r}}function lw(s){return oi(function(a){var u=a.length,g=u,y=vn.prototype.thru;for(s&&a.reverse();g--;){var S=a[g];if(typeof S!="function")throw new wn(c);if(y&&!M&&Ql(S)=="wrapper")var M=new vn([],!0)}for(g=M?g:u;++g<u;){S=a[g];var H=Ql(S),Y=H=="wrapper"?nd(S):r;Y&&ad(Y[0])&&Y[1]==(f|F|T|E)&&!Y[4].length&&Y[9]==1?M=M[Ql(Y[0])].apply(M,Y[3]):M=S.length==1&&ad(S)?M[H]():M.thru(S)}return function(){var ue=arguments,he=ue[0];if(M&&ue.length==1&&Qe(he))return M.plant(he).value();for(var pe=0,be=u?a[pe].apply(this,ue):he;++pe<u;)be=a[pe].call(this,be);return be}})}function Zl(s,a,u,g,y,S,M,H,Y,ue){var he=a&f,pe=a&k,be=a&q,Te=a&(F|$),We=a&Z,ot=be?r:ja(s);function qe(){for(var ft=arguments.length,wt=te(ft),nn=ft;nn--;)wt[nn]=arguments[nn];if(Te)var Hr=bo(qe),sn=FD(wt,Hr);if(g&&(wt=nw(wt,g,y,Te)),S&&(wt=iw(wt,S,M,Te)),ft-=sn,Te&&ft<ue){var rr=Pi(wt,Hr);return fw(s,a,Zl,qe.placeholder,u,wt,rr,H,Y,ue-ft)}var Pn=pe?u:this,ui=be?Pn[s]:s;return ft=wt.length,H?wt=zT(wt,H):We&&ft>1&&wt.reverse(),he&&Y<ft&&(wt.length=Y),this&&this!==mt&&this instanceof qe&&(ui=ot||ja(ui)),ui.apply(Pn,wt)}return qe}function uw(s,a){return function(u,g){return JP(u,s,a(g),{})}}function Yl(s,a){return function(u,g){var y;if(u===r&&g===r)return a;if(u!==r&&(y=u),g!==r){if(y===r)return g;typeof u=="string"||typeof g=="string"?(u=tn(u),g=tn(g)):(u=Z2(u),g=Z2(g)),y=s(u,g)}return y}}function Q0(s){return oi(function(a){return a=Ut(a,en(ze())),ct(function(u){var g=this;return s(a,function(y){return yr(y,g,u)})})})}function Jl(s,a){a=a===r?" ":tn(a);var u=a.length;if(u<2)return u?V0(a,s):a;var g=V0(a,Ml(s/ho(a)));return uo(a)?Li(On(g),0,s).join(""):g.slice(0,s)}function CT(s,a,u,g){var y=a&k,S=ja(s);function M(){for(var H=-1,Y=arguments.length,ue=-1,he=g.length,pe=te(he+Y),be=this&&this!==mt&&this instanceof M?S:s;++ue<he;)pe[ue]=g[ue];for(;Y--;)pe[ue++]=arguments[++H];return yr(be,y?u:this,pe)}return M}function hw(s){return function(a,u,g){return g&&typeof g!="number"&&kr(a,u,g)&&(u=g=r),a=li(a),u===r?(u=a,a=0):u=li(u),g=g===r?a<u?1:-1:li(g),lT(a,u,g,s)}}function Xl(s){return function(a,u){return typeof a=="string"&&typeof u=="string"||(a=En(a),u=En(u)),s(a,u)}}function fw(s,a,u,g,y,S,M,H,Y,ue){var he=a&F,pe=he?M:r,be=he?r:M,Te=he?S:r,We=he?r:S;a|=he?T:C,a&=~(he?C:T),a&R||(a&=~(k|q));var ot=[s,a,y,Te,pe,We,be,H,Y,ue],qe=u.apply(r,ot);return ad(s)&&Cw(qe,ot),qe.placeholder=g,Iw(qe,s,a)}function ed(s){var a=dr[s];return function(u,g){if(u=En(u),g=g==null?0:Sr(it(g),292),g&&I2(u)){var y=(yt(u)+"e").split("e"),S=a(y[0]+"e"+(+y[1]+g));return y=(yt(S)+"e").split("e"),+(y[0]+"e"+(+y[1]-g))}return a(u)}}var IT=go&&1/$l(new go([,-0]))[1]==le?function(s){return new go(s)}:Ed;function dw(s){return function(a){var u=Dr(a);return u==Me?D0(a):u==He?HD(a):ND(a,s(a))}}function si(s,a,u,g,y,S,M,H){var Y=a&q;if(!Y&&typeof s!="function")throw new wn(c);var ue=g?g.length:0;if(ue||(a&=~(T|C),g=y=r),M=M===r?M:pr(it(M),0),H=H===r?H:it(H),ue-=y?y.length:0,a&C){var he=g,pe=y;g=y=r}var be=Y?r:nd(s),Te=[s,a,u,g,y,he,pe,S,M,H];if(be&&BT(Te,be),s=Te[0],a=Te[1],u=Te[2],g=Te[3],y=Te[4],H=Te[9]=Te[9]===r?Y?0:s.length:pr(Te[9]-ue,0),!H&&a&(F|$)&&(a&=~(F|$)),!a||a==k)var We=ET(s,a,u);else a==F||a==$?We=xT(s,a,H):(a==T||a==(k|T))&&!y.length?We=CT(s,a,u,g):We=Zl.apply(r,Te);var ot=be?K2:Cw;return Iw(ot(We,Te),s,a)}function pw(s,a,u,g){return s===r||Dn(s,po[u])&&!bt.call(g,u)?a:s}function gw(s,a,u,g,y,S){return kt(s)&&kt(a)&&(S.set(a,s),ql(s,a,r,gw,S),S.delete(a)),s}function AT(s){return Ha(s)?r:s}function mw(s,a,u,g,y,S){var M=u&P,H=s.length,Y=a.length;if(H!=Y&&!(M&&Y>H))return!1;var ue=S.get(s),he=S.get(a);if(ue&&he)return ue==a&&he==s;var pe=-1,be=!0,Te=u&L?new vs:r;for(S.set(s,a),S.set(a,s);++pe<H;){var We=s[pe],ot=a[pe];if(g)var qe=M?g(ot,We,pe,a,s,S):g(We,ot,pe,s,a,S);if(qe!==r){if(qe)continue;be=!1;break}if(Te){if(!C0(a,function(ft,wt){if(!Oa(Te,wt)&&(We===ft||y(We,ft,u,g,S)))return Te.push(wt)})){be=!1;break}}else if(!(We===ot||y(We,ot,u,g,S))){be=!1;break}}return S.delete(s),S.delete(a),be}function $T(s,a,u,g,y,S,M){switch(u){case p:if(s.byteLength!=a.byteLength||s.byteOffset!=a.byteOffset)return!1;s=s.buffer,a=a.buffer;case b:return!(s.byteLength!=a.byteLength||!S(new Rl(s),new Rl(a)));case J:case W:case nt:return Dn(+s,+a);case j:return s.name==a.name&&s.message==a.message;case Je:case ke:return s==a+"";case Me:var H=D0;case He:var Y=g&P;if(H||(H=$l),s.size!=a.size&&!Y)return!1;var ue=M.get(s);if(ue)return ue==a;g|=L,M.set(s,a);var he=mw(H(s),H(a),g,y,S,M);return M.delete(s),he;case Ke:if(Ra)return Ra.call(s)==Ra.call(a)}return!1}function OT(s,a,u,g,y,S){var M=u&P,H=td(s),Y=H.length,ue=td(a),he=ue.length;if(Y!=he&&!M)return!1;for(var pe=Y;pe--;){var be=H[pe];if(!(M?be in a:bt.call(a,be)))return!1}var Te=S.get(s),We=S.get(a);if(Te&&We)return Te==a&&We==s;var ot=!0;S.set(s,a),S.set(a,s);for(var qe=M;++pe<Y;){be=H[pe];var ft=s[be],wt=a[be];if(g)var nn=M?g(wt,ft,be,a,s,S):g(ft,wt,be,s,a,S);if(!(nn===r?ft===wt||y(ft,wt,u,g,S):nn)){ot=!1;break}qe||(qe=be=="constructor")}if(ot&&!qe){var Hr=s.constructor,sn=a.constructor;Hr!=sn&&"constructor"in s&&"constructor"in a&&!(typeof Hr=="function"&&Hr instanceof Hr&&typeof sn=="function"&&sn instanceof sn)&&(ot=!1)}return S.delete(s),S.delete(a),ot}function oi(s){return ld(Ew(s,r,Pw),s+"")}function td(s){return L2(s,br,sd)}function rd(s){return L2(s,Gr,ww)}var nd=jl?function(s){return jl.get(s)}:Ed;function Ql(s){for(var a=s.name+"",u=mo[a],g=bt.call(mo,a)?u.length:0;g--;){var y=u[g],S=y.func;if(S==null||S==s)return y.name}return a}function bo(s){var a=bt.call(I,"placeholder")?I:s;return a.placeholder}function ze(){var s=I.iteratee||bd;return s=s===bd?j2:s,arguments.length?s(arguments[0],arguments[1]):s}function eu(s,a){var u=s.__data__;return LT(a)?u[typeof a=="string"?"string":"hash"]:u.map}function id(s){for(var a=br(s),u=a.length;u--;){var g=a[u],y=s[g];a[u]=[g,y,bw(y)]}return a}function _s(s,a){var u=jD(s,a);return U2(u)?u:r}function ST(s){var a=bt.call(s,ms),u=s[ms];try{s[ms]=r;var g=!0}catch{}var y=Pl.call(s);return g&&(a?s[ms]=u:delete s[ms]),y}var sd=T0?function(s){return s==null?[]:(s=Ot(s),Si(T0(s),function(a){return x2.call(s,a)}))}:xd,ww=T0?function(s){for(var a=[];s;)Di(a,sd(s)),s=Nl(s);return a}:xd,Dr=Br;(R0&&Dr(new R0(new ArrayBuffer(1)))!=p||Da&&Dr(new Da)!=Me||N0&&Dr(N0.resolve())!=Dt||go&&Dr(new go)!=He||Pa&&Dr(new Pa)!=Ue)&&(Dr=function(s){var a=Br(s),u=a==Ge?s.constructor:r,g=u?Es(u):"";if(g)switch(g){case hP:return p;case fP:return Me;case dP:return Dt;case pP:return He;case gP:return Ue}return a});function DT(s,a,u){for(var g=-1,y=u.length;++g<y;){var S=u[g],M=S.size;switch(S.type){case"drop":s+=M;break;case"dropRight":a-=M;break;case"take":a=Sr(a,s+M);break;case"takeRight":s=pr(s,a-M);break}}return{start:s,end:a}}function PT(s){var a=s.match(Tt);return a?a[1].split(cr):[]}function vw(s,a,u){a=Fi(a,s);for(var g=-1,y=a.length,S=!1;++g<y;){var M=qn(a[g]);if(!(S=s!=null&&u(s,M)))break;s=s[M]}return S||++g!=y?S:(y=s==null?0:s.length,!!y&&au(y)&&ai(M,y)&&(Qe(s)||xs(s)))}function TT(s){var a=s.length,u=new s.constructor(a);return a&&typeof s[0]=="string"&&bt.call(s,"index")&&(u.index=s.index,u.input=s.input),u}function yw(s){return typeof s.constructor=="function"&&!Ba(s)?wo(Nl(s)):{}}function RT(s,a,u){var g=s.constructor;switch(a){case b:return X0(s);case J:case W:return new g(+s);case p:return mT(s,u);case m:case D:case B:case G:case Q:case Ee:case Re:case st:case ht:return tw(s,u);case Me:return new g;case nt:case ke:return new g(s);case Je:return wT(s);case He:return new g;case Ke:return vT(s)}}function NT(s,a){var u=a.length;if(!u)return s;var g=u-1;return a[g]=(u>1?"& ":"")+a[g],a=a.join(u>2?", ":" "),s.replace(Zt,`{
80
80
  /* [wrapped with `+a+`] */
81
- `)}function y$(s){return Qe(s)||_s(s)||!!(Rm&&s&&s[Rm])}function si(s,a){var u=typeof s;return a=a??re,!!a&&(u=="number"||u!="symbol"&&Gf.test(s))&&s>-1&&s%1==0&&s<a}function Br(s,a,u){if(!Bt(u))return!1;var g=typeof a;return(g=="number"?Kr(u)&&si(a,u.length):g=="string"&&a in u)?On(u[a],s):!1}function V0(s,a){if(Qe(s))return!1;var u=typeof s;return u=="number"||u=="symbol"||u=="boolean"||s==null||rn(s)?!0:ir.test(s)||!Mt.test(s)||a!=null&&s in At(a)}function b$(s){var a=typeof s;return a=="string"||a=="number"||a=="symbol"||a=="boolean"?s!=="__proto__":s===null}function K0(s){var a=Wl(s),u=C[a];if(typeof u!="function"||!(a in dt.prototype))return!1;if(s===u)return!0;var g=z0(u);return!!g&&s===g[0]}function _$(s){return!!$m&&$m in s}var E$=bl?oi:ud;function Na(s){var a=s&&s.constructor,u=typeof a=="function"&&a.prototype||uo;return s===u}function $2(s){return s===s&&!Bt(s)}function P2(s,a){return function(u){return u==null?!1:u[s]===a&&(a!==r||s in At(u))}}function x$(s){var a=Yl(s,function(g){return u.size===f&&u.clear(),g}),u=a.cache;return a}function C$(s,a){var u=s[1],g=a[1],y=u|g,O=y<(H|Z|d),M=g==d&&u==L||g==d&&u==x&&s[7].length<=a[8]||g==(d|x)&&a[7].length<=a[8]&&u==L;if(!(O||M))return s;g&H&&(s[2]=a[2],y|=u&H?0:R);var k=a[3];if(k){var G=s[3];s[3]=G?d2(G,k,a[4]):k,s[4]=G?$i(s[3],v):a[4]}return k=a[5],k&&(G=s[5],s[5]=G?p2(G,k,a[6]):k,s[6]=G?$i(s[5],v):a[6]),k=a[7],k&&(s[7]=k),g&d&&(s[8]=s[8]==null?a[8]:Ar(s[8],a[8])),s[9]==null&&(s[9]=a[9]),s[0]=a[0],s[1]=y,s}function I$(s){var a=[];if(s!=null)for(var u in At(s))a.push(u);return a}function S$(s){return El.call(s)}function T2(s,a,u){return a=dr(a===r?s.length-1:a,0),function(){for(var g=arguments,y=-1,O=dr(g.length-a,0),M=te(O);++y<O;)M[y]=g[a+y];y=-1;for(var k=te(a+1);++y<a;)k[y]=g[y];return k[a]=u(M),vr(s,this,k)}}function N2(s,a){return a.length<2?s:vs(s,vn(a,0,-1))}function A$(s,a){for(var u=s.length,g=Ar(a.length,u),y=Vr(s);g--;){var O=a[g];s[g]=si(O,u)?y[O]:r}return s}function G0(s,a){if(!(a==="constructor"&&typeof s[a]=="function")&&a!="__proto__")return s[a]}var R2=M2(n2),Ra=HO||function(s,a){return mt.setTimeout(s,a)},Z0=M2(YD);function L2(s,a,u){var g=a+"";return Z0(s,v$(g,O$(g$(g),u)))}function M2(s){var a=0,u=0;return function(){var g=VO(),y=me-(g-u);if(u=g,y>0){if(++a>=de)return arguments[0]}else a=0;return s.apply(r,arguments)}}function Vl(s,a){var u=-1,g=s.length,y=g-1;for(a=a===r?g:a;++u<a;){var O=P0(u,y),M=s[O];s[O]=s[u],s[u]=M}return s.length=a,s}var U2=x$(function(s){var a=[];return s.charCodeAt(0)===46&&a.push(""),s.replace(sr,function(u,g,y,O){a.push(y?O.replace(Hf,"$1"):g||u)}),a});function zn(s){if(typeof s=="string"||rn(s))return s;var a=s+"";return a=="0"&&1/s==-le?"-0":a}function bs(s){if(s!=null){try{return _l.call(s)}catch{}try{return s+""}catch{}}return""}function O$(s,a){return pn(Be,function(u){var g="_."+u[0];a&u[1]&&!ml(s,g)&&s.push(g)}),s.sort()}function j2(s){if(s instanceof dt)return s.clone();var a=new mn(s.__wrapped__,s.__chain__);return a.__actions__=Vr(s.__actions__),a.__index__=s.__index__,a.__values__=s.__values__,a}function D$(s,a,u){(u?Br(s,a,u):a===r)?a=1:a=dr(it(a),0);var g=s==null?0:s.length;if(!g||a<1)return[];for(var y=0,O=0,M=te(Ol(g/a));y<g;)M[O++]=vn(s,y,y+=a);return M}function $$(s){for(var a=-1,u=s==null?0:s.length,g=0,y=[];++a<u;){var O=s[a];O&&(y[g++]=O)}return y}function P$(){var s=arguments.length;if(!s)return[];for(var a=te(s-1),u=arguments[0],g=s;g--;)a[g-1]=arguments[g];return Di(Qe(u)?Vr(u):[u],Cr(a,1))}var T$=ct(function(s,a){return er(s)?Oa(s,Cr(a,1,er,!0)):[]}),N$=ct(function(s,a){var u=yn(a);return er(u)&&(u=r),er(s)?Oa(s,Cr(a,1,er,!0),ze(u,2)):[]}),R$=ct(function(s,a){var u=yn(a);return er(u)&&(u=r),er(s)?Oa(s,Cr(a,1,er,!0),r,u):[]});function L$(s,a,u){var g=s==null?0:s.length;return g?(a=u||a===r?1:it(a),vn(s,a<0?0:a,g)):[]}function M$(s,a,u){var g=s==null?0:s.length;return g?(a=u||a===r?1:it(a),a=g-a,vn(s,0,a<0?0:a)):[]}function U$(s,a){return s&&s.length?jl(s,ze(a,3),!0,!0):[]}function j$(s,a){return s&&s.length?jl(s,ze(a,3),!0):[]}function F$(s,a,u,g){var y=s==null?0:s.length;return y?(u&&typeof u!="number"&&Br(s,a,u)&&(u=0,g=y),PD(s,a,u,g)):[]}function F2(s,a,u){var g=s==null?0:s.length;if(!g)return-1;var y=u==null?0:it(u);return y<0&&(y=dr(g+y,0)),wl(s,ze(a,3),y)}function B2(s,a,u){var g=s==null?0:s.length;if(!g)return-1;var y=g-1;return u!==r&&(y=it(u),y=u<0?dr(g+y,0):Ar(y,g-1)),wl(s,ze(a,3),y,!0)}function k2(s){var a=s==null?0:s.length;return a?Cr(s,1):[]}function B$(s){var a=s==null?0:s.length;return a?Cr(s,le):[]}function k$(s,a){var u=s==null?0:s.length;return u?(a=a===r?1:it(a),Cr(s,a)):[]}function H$(s){for(var a=-1,u=s==null?0:s.length,g={};++a<u;){var y=s[a];g[y[0]]=y[1]}return g}function H2(s){return s&&s.length?s[0]:r}function z$(s,a,u){var g=s==null?0:s.length;if(!g)return-1;var y=u==null?0:it(u);return y<0&&(y=dr(g+y,0)),oo(s,a,y)}function W$(s){var a=s==null?0:s.length;return a?vn(s,0,-1):[]}var q$=ct(function(s){var a=Ut(s,M0);return a.length&&a[0]===s[0]?S0(a):[]}),V$=ct(function(s){var a=yn(s),u=Ut(s,M0);return a===yn(u)?a=r:u.pop(),u.length&&u[0]===s[0]?S0(u,ze(a,2)):[]}),K$=ct(function(s){var a=yn(s),u=Ut(s,M0);return a=typeof a=="function"?a:r,a&&u.pop(),u.length&&u[0]===s[0]?S0(u,r,a):[]});function G$(s,a){return s==null?"":WO.call(s,a)}function yn(s){var a=s==null?0:s.length;return a?s[a-1]:r}function Z$(s,a,u){var g=s==null?0:s.length;if(!g)return-1;var y=g;return u!==r&&(y=it(u),y=y<0?dr(g+y,0):Ar(y,g-1)),a===a?OO(s,a,y):wl(s,Em,y,!0)}function Y$(s,a){return s&&s.length?Qm(s,it(a)):r}var J$=ct(z2);function z2(s,a){return s&&s.length&&a&&a.length?$0(s,a):s}function X$(s,a,u){return s&&s.length&&a&&a.length?$0(s,a,ze(u,2)):s}function Q$(s,a,u){return s&&s.length&&a&&a.length?$0(s,a,r,u):s}var eP=ii(function(s,a){var u=s==null?0:s.length,g=E0(s,a);return r2(s,Ut(a,function(y){return si(y,u)?+y:y}).sort(f2)),g});function tP(s,a){var u=[];if(!(s&&s.length))return u;var g=-1,y=[],O=s.length;for(a=ze(a,3);++g<O;){var M=s[g];a(M,g,s)&&(u.push(M),y.push(g))}return r2(s,y),u}function Y0(s){return s==null?s:GO.call(s)}function rP(s,a,u){var g=s==null?0:s.length;return g?(u&&typeof u!="number"&&Br(s,a,u)?(a=0,u=g):(a=a==null?0:it(a),u=u===r?g:it(u)),vn(s,a,u)):[]}function nP(s,a){return Ul(s,a)}function iP(s,a,u){return N0(s,a,ze(u,2))}function sP(s,a){var u=s==null?0:s.length;if(u){var g=Ul(s,a);if(g<u&&On(s[g],a))return g}return-1}function oP(s,a){return Ul(s,a,!0)}function aP(s,a,u){return N0(s,a,ze(u,2),!0)}function cP(s,a){var u=s==null?0:s.length;if(u){var g=Ul(s,a,!0)-1;if(On(s[g],a))return g}return-1}function lP(s){return s&&s.length?i2(s):[]}function uP(s,a){return s&&s.length?i2(s,ze(a,2)):[]}function hP(s){var a=s==null?0:s.length;return a?vn(s,1,a):[]}function fP(s,a,u){return s&&s.length?(a=u||a===r?1:it(a),vn(s,0,a<0?0:a)):[]}function dP(s,a,u){var g=s==null?0:s.length;return g?(a=u||a===r?1:it(a),a=g-a,vn(s,a<0?0:a,g)):[]}function pP(s,a){return s&&s.length?jl(s,ze(a,3),!1,!0):[]}function gP(s,a){return s&&s.length?jl(s,ze(a,3)):[]}var mP=ct(function(s){return Ni(Cr(s,1,er,!0))}),wP=ct(function(s){var a=yn(s);return er(a)&&(a=r),Ni(Cr(s,1,er,!0),ze(a,2))}),vP=ct(function(s){var a=yn(s);return a=typeof a=="function"?a:r,Ni(Cr(s,1,er,!0),r,a)});function yP(s){return s&&s.length?Ni(s):[]}function bP(s,a){return s&&s.length?Ni(s,ze(a,2)):[]}function _P(s,a){return a=typeof a=="function"?a:r,s&&s.length?Ni(s,r,a):[]}function J0(s){if(!(s&&s.length))return[];var a=0;return s=Oi(s,function(u){if(er(u))return a=dr(u.length,a),!0}),p0(a,function(u){return Ut(s,h0(u))})}function W2(s,a){if(!(s&&s.length))return[];var u=J0(s);return a==null?u:Ut(u,function(g){return vr(a,r,g)})}var EP=ct(function(s,a){return er(s)?Oa(s,a):[]}),xP=ct(function(s){return L0(Oi(s,er))}),CP=ct(function(s){var a=yn(s);return er(a)&&(a=r),L0(Oi(s,er),ze(a,2))}),IP=ct(function(s){var a=yn(s);return a=typeof a=="function"?a:r,L0(Oi(s,er),r,a)}),SP=ct(J0);function AP(s,a){return c2(s||[],a||[],Aa)}function OP(s,a){return c2(s||[],a||[],Pa)}var DP=ct(function(s){var a=s.length,u=a>1?s[a-1]:r;return u=typeof u=="function"?(s.pop(),u):r,W2(s,u)});function q2(s){var a=C(s);return a.__chain__=!0,a}function $P(s,a){return a(s),s}function Kl(s,a){return a(s)}var PP=ii(function(s){var a=s.length,u=a?s[0]:0,g=this.__wrapped__,y=function(O){return E0(O,s)};return a>1||this.__actions__.length||!(g instanceof dt)||!si(u)?this.thru(y):(g=g.slice(u,+u+(a?1:0)),g.__actions__.push({func:Kl,args:[y],thisArg:r}),new mn(g,this.__chain__).thru(function(O){return a&&!O.length&&O.push(r),O}))});function TP(){return q2(this)}function NP(){return new mn(this.value(),this.__chain__)}function RP(){this.__values__===r&&(this.__values__=sw(this.value()));var s=this.__index__>=this.__values__.length,a=s?r:this.__values__[this.__index__++];return{done:s,value:a}}function LP(){return this}function MP(s){for(var a,u=this;u instanceof Tl;){var g=j2(u);g.__index__=0,g.__values__=r,a?y.__wrapped__=g:a=g;var y=g;u=u.__wrapped__}return y.__wrapped__=s,a}function UP(){var s=this.__wrapped__;if(s instanceof dt){var a=s;return this.__actions__.length&&(a=new dt(this)),a=a.reverse(),a.__actions__.push({func:Kl,args:[Y0],thisArg:r}),new mn(a,this.__chain__)}return this.thru(Y0)}function jP(){return a2(this.__wrapped__,this.__actions__)}var FP=Fl(function(s,a,u){bt.call(s,u)?++s[u]:ri(s,u,1)});function BP(s,a,u){var g=Qe(s)?bm:$D;return u&&Br(s,a,u)&&(a=r),g(s,ze(a,3))}function kP(s,a){var u=Qe(s)?Oi:Wm;return u(s,ze(a,3))}var HP=v2(F2),zP=v2(B2);function WP(s,a){return Cr(Gl(s,a),1)}function qP(s,a){return Cr(Gl(s,a),le)}function VP(s,a,u){return u=u===r?1:it(u),Cr(Gl(s,a),u)}function V2(s,a){var u=Qe(s)?pn:Ti;return u(s,ze(a,3))}function K2(s,a){var u=Qe(s)?hO:zm;return u(s,ze(a,3))}var KP=Fl(function(s,a,u){bt.call(s,u)?s[u].push(a):ri(s,u,[a])});function GP(s,a,u,g){s=Kr(s)?s:yo(s),u=u&&!g?it(u):0;var y=s.length;return u<0&&(u=dr(y+u,0)),Ql(s)?u<=y&&s.indexOf(a,u)>-1:!!y&&oo(s,a,u)>-1}var ZP=ct(function(s,a,u){var g=-1,y=typeof a=="function",O=Kr(s)?te(s.length):[];return Ti(s,function(M){O[++g]=y?vr(a,M,u):Da(M,a,u)}),O}),YP=Fl(function(s,a,u){ri(s,u,a)});function Gl(s,a){var u=Qe(s)?Ut:Ym;return u(s,ze(a,3))}function JP(s,a,u,g){return s==null?[]:(Qe(a)||(a=a==null?[]:[a]),u=g?r:u,Qe(u)||(u=u==null?[]:[u]),e2(s,a,u))}var XP=Fl(function(s,a,u){s[u?0:1].push(a)},function(){return[[],[]]});function QP(s,a,u){var g=Qe(s)?l0:Cm,y=arguments.length<3;return g(s,ze(a,4),u,y,Ti)}function eT(s,a,u){var g=Qe(s)?fO:Cm,y=arguments.length<3;return g(s,ze(a,4),u,y,zm)}function tT(s,a){var u=Qe(s)?Oi:Wm;return u(s,Jl(ze(a,3)))}function rT(s){var a=Qe(s)?Fm:GD;return a(s)}function nT(s,a,u){(u?Br(s,a,u):a===r)?a=1:a=it(a);var g=Qe(s)?ID:ZD;return g(s,a)}function iT(s){var a=Qe(s)?SD:JD;return a(s)}function sT(s){if(s==null)return 0;if(Kr(s))return Ql(s)?co(s):s.length;var a=Or(s);return a==Ue||a==He?s.size:O0(s).length}function oT(s,a,u){var g=Qe(s)?u0:XD;return u&&Br(s,a,u)&&(a=r),g(s,ze(a,3))}var aT=ct(function(s,a){if(s==null)return[];var u=a.length;return u>1&&Br(s,a[0],a[1])?a=[]:u>2&&Br(a[0],a[1],a[2])&&(a=[a[0]]),e2(s,Cr(a,1),[])}),Zl=kO||function(){return mt.Date.now()};function cT(s,a){if(typeof a!="function")throw new gn(c);return s=it(s),function(){if(--s<1)return a.apply(this,arguments)}}function G2(s,a,u){return a=u?r:a,a=s&&a==null?s.length:a,ni(s,d,r,r,r,r,a)}function Z2(s,a){var u;if(typeof a!="function")throw new gn(c);return s=it(s),function(){return--s>0&&(u=a.apply(this,arguments)),s<=1&&(a=r),u}}var X0=ct(function(s,a,u){var g=H;if(u.length){var y=$i(u,wo(X0));g|=T}return ni(s,g,a,u,y)}),Y2=ct(function(s,a,u){var g=H|Z;if(u.length){var y=$i(u,wo(Y2));g|=T}return ni(a,g,s,u,y)});function J2(s,a,u){a=u?r:a;var g=ni(s,L,r,r,r,r,r,a);return g.placeholder=J2.placeholder,g}function X2(s,a,u){a=u?r:a;var g=ni(s,$,r,r,r,r,r,a);return g.placeholder=X2.placeholder,g}function Q2(s,a,u){var g,y,O,M,k,G,ue=0,he=!1,pe=!1,be=!0;if(typeof s!="function")throw new gn(c);a=bn(a)||0,Bt(u)&&(he=!!u.leading,pe="maxWait"in u,O=pe?dr(bn(u.maxWait)||0,a):O,be="trailing"in u?!!u.trailing:be);function Pe(tr){var Dn=g,ci=y;return g=y=r,ue=tr,M=s.apply(ci,Dn),M}function We(tr){return ue=tr,k=Ra(ft,a),he?Pe(tr):M}function ot(tr){var Dn=tr-G,ci=tr-ue,vw=a-Dn;return pe?Ar(vw,O-ci):vw}function qe(tr){var Dn=tr-G,ci=tr-ue;return G===r||Dn>=a||Dn<0||pe&&ci>=O}function ft(){var tr=Zl();if(qe(tr))return wt(tr);k=Ra(ft,ot(tr))}function wt(tr){return k=r,be&&g?Pe(tr):(g=y=r,M)}function nn(){k!==r&&l2(k),ue=0,g=G=y=k=r}function kr(){return k===r?M:wt(Zl())}function sn(){var tr=Zl(),Dn=qe(tr);if(g=arguments,y=this,G=tr,Dn){if(k===r)return We(G);if(pe)return l2(k),k=Ra(ft,a),Pe(G)}return k===r&&(k=Ra(ft,a)),M}return sn.cancel=nn,sn.flush=kr,sn}var lT=ct(function(s,a){return Hm(s,1,a)}),uT=ct(function(s,a,u){return Hm(s,bn(a)||0,u)});function hT(s){return ni(s,J)}function Yl(s,a){if(typeof s!="function"||a!=null&&typeof a!="function")throw new gn(c);var u=function(){var g=arguments,y=a?a.apply(this,g):g[0],O=u.cache;if(O.has(y))return O.get(y);var M=s.apply(this,g);return u.cache=O.set(y,M)||O,M};return u.cache=new(Yl.Cache||ti),u}Yl.Cache=ti;function Jl(s){if(typeof s!="function")throw new gn(c);return function(){var a=arguments;switch(a.length){case 0:return!s.call(this);case 1:return!s.call(this,a[0]);case 2:return!s.call(this,a[0],a[1]);case 3:return!s.call(this,a[0],a[1],a[2])}return!s.apply(this,a)}}function fT(s){return Z2(2,s)}var dT=QD(function(s,a){a=a.length==1&&Qe(a[0])?Ut(a[0],en(ze())):Ut(Cr(a,1),en(ze()));var u=a.length;return ct(function(g){for(var y=-1,O=Ar(g.length,u);++y<O;)g[y]=a[y].call(this,g[y]);return vr(s,this,g)})}),Q0=ct(function(s,a){var u=$i(a,wo(Q0));return ni(s,T,r,a,u)}),ew=ct(function(s,a){var u=$i(a,wo(ew));return ni(s,I,r,a,u)}),pT=ii(function(s,a){return ni(s,x,r,r,r,a)});function gT(s,a){if(typeof s!="function")throw new gn(c);return a=a===r?a:it(a),ct(s,a)}function mT(s,a){if(typeof s!="function")throw new gn(c);return a=a==null?0:dr(it(a),0),ct(function(u){var g=u[a],y=Li(u,0,a);return g&&Di(y,g),vr(s,this,y)})}function wT(s,a,u){var g=!0,y=!0;if(typeof s!="function")throw new gn(c);return Bt(u)&&(g="leading"in u?!!u.leading:g,y="trailing"in u?!!u.trailing:y),Q2(s,a,{leading:g,maxWait:a,trailing:y})}function vT(s){return G2(s,1)}function yT(s,a){return Q0(U0(a),s)}function bT(){if(!arguments.length)return[];var s=arguments[0];return Qe(s)?s:[s]}function _T(s){return wn(s,S)}function ET(s,a){return a=typeof a=="function"?a:r,wn(s,S,a)}function xT(s){return wn(s,E|S)}function CT(s,a){return a=typeof a=="function"?a:r,wn(s,E|S,a)}function IT(s,a){return a==null||km(s,a,yr(a))}function On(s,a){return s===a||s!==s&&a!==a}var ST=zl(I0),AT=zl(function(s,a){return s>=a}),_s=Km(function(){return arguments}())?Km:function(s){return Zt(s)&&bt.call(s,"callee")&&!Nm.call(s,"callee")},Qe=te.isArray,OT=jr?en(jr):MD;function Kr(s){return s!=null&&Xl(s.length)&&!oi(s)}function er(s){return Zt(s)&&Kr(s)}function DT(s){return s===!0||s===!1||Zt(s)&&Fr(s)==Y}var Mi=zO||ud,$T=In?en(In):UD;function PT(s){return Zt(s)&&s.nodeType===1&&!La(s)}function TT(s){if(s==null)return!0;if(Kr(s)&&(Qe(s)||typeof s=="string"||typeof s.splice=="function"||Mi(s)||vo(s)||_s(s)))return!s.length;var a=Or(s);if(a==Ue||a==He)return!s.size;if(Na(s))return!O0(s).length;for(var u in s)if(bt.call(s,u))return!1;return!0}function NT(s,a){return $a(s,a)}function RT(s,a,u){u=typeof u=="function"?u:r;var g=u?u(s,a):r;return g===r?$a(s,a,r,u):!!g}function ed(s){if(!Zt(s))return!1;var a=Fr(s);return a==F||a==w||typeof s.message=="string"&&typeof s.name=="string"&&!La(s)}function LT(s){return typeof s=="number"&&Lm(s)}function oi(s){if(!Bt(s))return!1;var a=Fr(s);return a==we||a==ve||a==X||a==$t}function tw(s){return typeof s=="number"&&s==it(s)}function Xl(s){return typeof s=="number"&&s>-1&&s%1==0&&s<=re}function Bt(s){var a=typeof s;return s!=null&&(a=="object"||a=="function")}function Zt(s){return s!=null&&typeof s=="object"}var rw=dn?en(dn):FD;function MT(s,a){return s===a||A0(s,a,W0(a))}function UT(s,a,u){return u=typeof u=="function"?u:r,A0(s,a,W0(a),u)}function jT(s){return nw(s)&&s!=+s}function FT(s){if(E$(s))throw new Ye(o);return Gm(s)}function BT(s){return s===null}function kT(s){return s==null}function nw(s){return typeof s=="number"||Zt(s)&&Fr(s)==nt}function La(s){if(!Zt(s)||Fr(s)!=Ge)return!1;var a=Il(s);if(a===null)return!0;var u=bt.call(a,"constructor")&&a.constructor;return typeof u=="function"&&u instanceof u&&_l.call(u)==UO}var td=Bn?en(Bn):BD;function HT(s){return tw(s)&&s>=-re&&s<=re}var iw=ba?en(ba):kD;function Ql(s){return typeof s=="string"||!Qe(s)&&Zt(s)&&Fr(s)==ke}function rn(s){return typeof s=="symbol"||Zt(s)&&Fr(s)==Ke}var vo=ds?en(ds):HD;function zT(s){return s===r}function WT(s){return Zt(s)&&Or(s)==je}function qT(s){return Zt(s)&&Fr(s)==Ze}var VT=zl(D0),KT=zl(function(s,a){return s<=a});function sw(s){if(!s)return[];if(Kr(s))return Ql(s)?Sn(s):Vr(s);if(Ea&&s[Ea])return IO(s[Ea]());var a=Or(s),u=a==Ue?m0:a==He?vl:yo;return u(s)}function ai(s){if(!s)return s===0?s:0;if(s=bn(s),s===le||s===-le){var a=s<0?-1:1;return a*ne}return s===s?s:0}function it(s){var a=ai(s),u=a%1;return a===a?u?a-u:a:0}function ow(s){return s?ws(it(s),0,ie):0}function bn(s){if(typeof s=="number")return s;if(rn(s))return ae;if(Bt(s)){var a=typeof s.valueOf=="function"?s.valueOf():s;s=Bt(a)?a+"":a}if(typeof s!="string")return s===0?s:+s;s=Im(s);var u=qf.test(s);return u||Kf.test(s)?Xe(s.slice(2),u?2:8):Wf.test(s)?ae:+s}function aw(s){return Hn(s,Gr(s))}function GT(s){return s?ws(it(s),-re,re):s===0?s:0}function yt(s){return s==null?"":tn(s)}var ZT=go(function(s,a){if(Na(a)||Kr(a)){Hn(a,yr(a),s);return}for(var u in a)bt.call(a,u)&&Aa(s,u,a[u])}),cw=go(function(s,a){Hn(a,Gr(a),s)}),eu=go(function(s,a,u,g){Hn(a,Gr(a),s,g)}),YT=go(function(s,a,u,g){Hn(a,yr(a),s,g)}),JT=ii(E0);function XT(s,a){var u=po(s);return a==null?u:Bm(u,a)}var QT=ct(function(s,a){s=At(s);var u=-1,g=a.length,y=g>2?a[2]:r;for(y&&Br(a[0],a[1],y)&&(g=1);++u<g;)for(var O=a[u],M=Gr(O),k=-1,G=M.length;++k<G;){var ue=M[k],he=s[ue];(he===r||On(he,uo[ue])&&!bt.call(s,ue))&&(s[ue]=O[ue])}return s}),eN=ct(function(s){return s.push(r,I2),vr(lw,r,s)});function tN(s,a){return _m(s,ze(a,3),kn)}function rN(s,a){return _m(s,ze(a,3),C0)}function nN(s,a){return s==null?s:x0(s,ze(a,3),Gr)}function iN(s,a){return s==null?s:qm(s,ze(a,3),Gr)}function sN(s,a){return s&&kn(s,ze(a,3))}function oN(s,a){return s&&C0(s,ze(a,3))}function aN(s){return s==null?[]:Ll(s,yr(s))}function cN(s){return s==null?[]:Ll(s,Gr(s))}function rd(s,a,u){var g=s==null?r:vs(s,a);return g===r?u:g}function lN(s,a){return s!=null&&O2(s,a,TD)}function nd(s,a){return s!=null&&O2(s,a,ND)}var uN=b2(function(s,a,u){a!=null&&typeof a.toString!="function"&&(a=El.call(a)),s[a]=u},sd(Zr)),hN=b2(function(s,a,u){a!=null&&typeof a.toString!="function"&&(a=El.call(a)),bt.call(s,a)?s[a].push(u):s[a]=[u]},ze),fN=ct(Da);function yr(s){return Kr(s)?jm(s):O0(s)}function Gr(s){return Kr(s)?jm(s,!0):zD(s)}function dN(s,a){var u={};return a=ze(a,3),kn(s,function(g,y,O){ri(u,a(g,y,O),g)}),u}function pN(s,a){var u={};return a=ze(a,3),kn(s,function(g,y,O){ri(u,y,a(g,y,O))}),u}var gN=go(function(s,a,u){Ml(s,a,u)}),lw=go(function(s,a,u,g){Ml(s,a,u,g)}),mN=ii(function(s,a){var u={};if(s==null)return u;var g=!1;a=Ut(a,function(O){return O=Ri(O,s),g||(g=O.length>1),O}),Hn(s,H0(s),u),g&&(u=wn(u,E|_|S,u$));for(var y=a.length;y--;)R0(u,a[y]);return u});function wN(s,a){return uw(s,Jl(ze(a)))}var vN=ii(function(s,a){return s==null?{}:qD(s,a)});function uw(s,a){if(s==null)return{};var u=Ut(H0(s),function(g){return[g]});return a=ze(a),t2(s,u,function(g,y){return a(g,y[0])})}function yN(s,a,u){a=Ri(a,s);var g=-1,y=a.length;for(y||(y=1,s=r);++g<y;){var O=s==null?r:s[zn(a[g])];O===r&&(g=y,O=u),s=oi(O)?O.call(s):O}return s}function bN(s,a,u){return s==null?s:Pa(s,a,u)}function _N(s,a,u,g){return g=typeof g=="function"?g:r,s==null?s:Pa(s,a,u,g)}var hw=x2(yr),fw=x2(Gr);function EN(s,a,u){var g=Qe(s),y=g||Mi(s)||vo(s);if(a=ze(a,4),u==null){var O=s&&s.constructor;y?u=g?new O:[]:Bt(s)?u=oi(O)?po(Il(s)):{}:u={}}return(y?pn:kn)(s,function(M,k,G){return a(u,M,k,G)}),u}function xN(s,a){return s==null?!0:R0(s,a)}function CN(s,a,u){return s==null?s:o2(s,a,U0(u))}function IN(s,a,u,g){return g=typeof g=="function"?g:r,s==null?s:o2(s,a,U0(u),g)}function yo(s){return s==null?[]:g0(s,yr(s))}function SN(s){return s==null?[]:g0(s,Gr(s))}function AN(s,a,u){return u===r&&(u=a,a=r),u!==r&&(u=bn(u),u=u===u?u:0),a!==r&&(a=bn(a),a=a===a?a:0),ws(bn(s),a,u)}function ON(s,a,u){return a=ai(a),u===r?(u=a,a=0):u=ai(u),s=bn(s),RD(s,a,u)}function DN(s,a,u){if(u&&typeof u!="boolean"&&Br(s,a,u)&&(a=u=r),u===r&&(typeof a=="boolean"?(u=a,a=r):typeof s=="boolean"&&(u=s,s=r)),s===r&&a===r?(s=0,a=1):(s=ai(s),a===r?(a=s,s=0):a=ai(a)),s>a){var g=s;s=a,a=g}if(u||s%1||a%1){var y=Mm();return Ar(s+y*(a-s+It("1e-"+((y+"").length-1))),a)}return P0(s,a)}var $N=mo(function(s,a,u){return a=a.toLowerCase(),s+(u?dw(a):a)});function dw(s){return id(yt(s).toLowerCase())}function pw(s){return s=yt(s),s&&s.replace(Xn,bO).replace(o0,"")}function PN(s,a,u){s=yt(s),a=tn(a);var g=s.length;u=u===r?g:ws(it(u),0,g);var y=u;return u-=a.length,u>=0&&s.slice(u,y)==a}function TN(s){return s=yt(s),s&&Lt.test(s)?s.replace(cs,_O):s}function NN(s){return s=yt(s),s&&or.test(s)?s.replace(Vt,"\\$&"):s}var RN=mo(function(s,a,u){return s+(u?"-":"")+a.toLowerCase()}),LN=mo(function(s,a,u){return s+(u?" ":"")+a.toLowerCase()}),MN=w2("toLowerCase");function UN(s,a,u){s=yt(s),a=it(a);var g=a?co(s):0;if(!a||g>=a)return s;var y=(a-g)/2;return Hl(Dl(y),u)+s+Hl(Ol(y),u)}function jN(s,a,u){s=yt(s),a=it(a);var g=a?co(s):0;return a&&g<a?s+Hl(a-g,u):s}function FN(s,a,u){s=yt(s),a=it(a);var g=a?co(s):0;return a&&g<a?Hl(a-g,u)+s:s}function BN(s,a,u){return u||a==null?a=0:a&&(a=+a),KO(yt(s).replace(Kt,""),a||0)}function kN(s,a,u){return(u?Br(s,a,u):a===r)?a=1:a=it(a),T0(yt(s),a)}function HN(){var s=arguments,a=yt(s[0]);return s.length<3?a:a.replace(s[1],s[2])}var zN=mo(function(s,a,u){return s+(u?"_":"")+a.toLowerCase()});function WN(s,a,u){return u&&typeof u!="number"&&Br(s,a,u)&&(a=u=r),u=u===r?ie:u>>>0,u?(s=yt(s),s&&(typeof a=="string"||a!=null&&!td(a))&&(a=tn(a),!a&&ao(s))?Li(Sn(s),0,u):s.split(a,u)):[]}var qN=mo(function(s,a,u){return s+(u?" ":"")+id(a)});function VN(s,a,u){return s=yt(s),u=u==null?0:ws(it(u),0,s.length),a=tn(a),s.slice(u,u+a.length)==a}function KN(s,a,u){var g=C.templateSettings;u&&Br(s,a,u)&&(a=r),s=yt(s),a=eu({},a,g,C2);var y=eu({},a.imports,g.imports,C2),O=yr(y),M=g0(y,O),k,G,ue=0,he=a.interpolate||Qs,pe="__p += '",be=w0((a.escape||Qs).source+"|"+he.source+"|"+(he===Ft?zf:Qs).source+"|"+(a.evaluate||Qs).source+"|$","g"),Pe="//# sourceURL="+(bt.call(a,"sourceURL")?(a.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++a0+"]")+`
82
- `;s.replace(be,function(qe,ft,wt,nn,kr,sn){return wt||(wt=nn),pe+=s.slice(ue,sn).replace(Zf,EO),ft&&(k=!0,pe+=`' +
81
+ `)}function FT(s){return Qe(s)||xs(s)||!!(C2&&s&&s[C2])}function ai(s,a){var u=typeof s;return a=a??re,!!a&&(u=="number"||u!="symbol"&&c0.test(s))&&s>-1&&s%1==0&&s<a}function kr(s,a,u){if(!kt(u))return!1;var g=typeof a;return(g=="number"?Kr(u)&&ai(a,u.length):g=="string"&&a in u)?Dn(u[a],s):!1}function od(s,a){if(Qe(s))return!1;var u=typeof s;return u=="number"||u=="symbol"||u=="boolean"||s==null||rn(s)?!0:sr.test(s)||!Mt.test(s)||a!=null&&s in Ot(a)}function LT(s){var a=typeof s;return a=="string"||a=="number"||a=="symbol"||a=="boolean"?s!=="__proto__":s===null}function ad(s){var a=Ql(s),u=I[a];if(typeof u!="function"||!(a in dt.prototype))return!1;if(s===u)return!0;var g=nd(u);return!!g&&s===g[0]}function MT(s){return!!b2&&b2 in s}var UT=Sl?ci:Cd;function Ba(s){var a=s&&s.constructor,u=typeof a=="function"&&a.prototype||po;return s===u}function bw(s){return s===s&&!kt(s)}function _w(s,a){return function(u){return u==null?!1:u[s]===a&&(a!==r||s in Ot(u))}}function jT(s){var a=su(s,function(g){return u.size===d&&u.clear(),g}),u=a.cache;return a}function BT(s,a){var u=s[1],g=a[1],y=u|g,S=y<(k|q|f),M=g==f&&u==F||g==f&&u==E&&s[7].length<=a[8]||g==(f|E)&&a[7].length<=a[8]&&u==F;if(!(S||M))return s;g&k&&(s[2]=a[2],y|=u&k?0:R);var H=a[3];if(H){var Y=s[3];s[3]=Y?nw(Y,H,a[4]):H,s[4]=Y?Pi(s[3],v):a[4]}return H=a[5],H&&(Y=s[5],s[5]=Y?iw(Y,H,a[6]):H,s[6]=Y?Pi(s[5],v):a[6]),H=a[7],H&&(s[7]=H),g&f&&(s[8]=s[8]==null?a[8]:Sr(s[8],a[8])),s[9]==null&&(s[9]=a[9]),s[0]=a[0],s[1]=y,s}function kT(s){var a=[];if(s!=null)for(var u in Ot(s))a.push(u);return a}function HT(s){return Pl.call(s)}function Ew(s,a,u){return a=pr(a===r?s.length-1:a,0),function(){for(var g=arguments,y=-1,S=pr(g.length-a,0),M=te(S);++y<S;)M[y]=g[a+y];y=-1;for(var H=te(a+1);++y<a;)H[y]=g[y];return H[a]=u(M),yr(s,this,H)}}function xw(s,a){return a.length<2?s:bs(s,bn(a,0,-1))}function zT(s,a){for(var u=s.length,g=Sr(a.length,u),y=Vr(s);g--;){var S=a[g];s[g]=ai(S,u)?y[S]:r}return s}function cd(s,a){if(!(a==="constructor"&&typeof s[a]=="function")&&a!="__proto__")return s[a]}var Cw=Aw(K2),ka=iP||function(s,a){return mt.setTimeout(s,a)},ld=Aw(fT);function Iw(s,a,u){var g=a+"";return ld(s,NT(g,WT(PT(g),u)))}function Aw(s){var a=0,u=0;return function(){var g=cP(),y=me-(g-u);if(u=g,y>0){if(++a>=de)return arguments[0]}else a=0;return s.apply(r,arguments)}}function tu(s,a){var u=-1,g=s.length,y=g-1;for(a=a===r?g:a;++u<a;){var S=q0(u,y),M=s[S];s[S]=s[u],s[u]=M}return s.length=a,s}var $w=jT(function(s){var a=[];return s.charCodeAt(0)===46&&a.push(""),s.replace(or,function(u,g,y,S){a.push(y?S.replace(r0,"$1"):g||u)}),a});function qn(s){if(typeof s=="string"||rn(s))return s;var a=s+"";return a=="0"&&1/s==-le?"-0":a}function Es(s){if(s!=null){try{return Dl.call(s)}catch{}try{return s+""}catch{}}return""}function WT(s,a){return mn(Be,function(u){var g="_."+u[0];a&u[1]&&!Il(s,g)&&s.push(g)}),s.sort()}function Ow(s){if(s instanceof dt)return s.clone();var a=new vn(s.__wrapped__,s.__chain__);return a.__actions__=Vr(s.__actions__),a.__index__=s.__index__,a.__values__=s.__values__,a}function qT(s,a,u){(u?kr(s,a,u):a===r)?a=1:a=pr(it(a),0);var g=s==null?0:s.length;if(!g||a<1)return[];for(var y=0,S=0,M=te(Ml(g/a));y<g;)M[S++]=bn(s,y,y+=a);return M}function VT(s){for(var a=-1,u=s==null?0:s.length,g=0,y=[];++a<u;){var S=s[a];S&&(y[g++]=S)}return y}function KT(){var s=arguments.length;if(!s)return[];for(var a=te(s-1),u=arguments[0],g=s;g--;)a[g-1]=arguments[g];return Di(Qe(u)?Vr(u):[u],Ar(a,1))}var GT=ct(function(s,a){return tr(s)?Fa(s,Ar(a,1,tr,!0)):[]}),ZT=ct(function(s,a){var u=_n(a);return tr(u)&&(u=r),tr(s)?Fa(s,Ar(a,1,tr,!0),ze(u,2)):[]}),YT=ct(function(s,a){var u=_n(a);return tr(u)&&(u=r),tr(s)?Fa(s,Ar(a,1,tr,!0),r,u):[]});function JT(s,a,u){var g=s==null?0:s.length;return g?(a=u||a===r?1:it(a),bn(s,a<0?0:a,g)):[]}function XT(s,a,u){var g=s==null?0:s.length;return g?(a=u||a===r?1:it(a),a=g-a,bn(s,0,a<0?0:a)):[]}function QT(s,a){return s&&s.length?Kl(s,ze(a,3),!0,!0):[]}function eR(s,a){return s&&s.length?Kl(s,ze(a,3),!0):[]}function tR(s,a,u,g){var y=s==null?0:s.length;return y?(u&&typeof u!="number"&&kr(s,a,u)&&(u=0,g=y),KP(s,a,u,g)):[]}function Sw(s,a,u){var g=s==null?0:s.length;if(!g)return-1;var y=u==null?0:it(u);return y<0&&(y=pr(g+y,0)),Al(s,ze(a,3),y)}function Dw(s,a,u){var g=s==null?0:s.length;if(!g)return-1;var y=g-1;return u!==r&&(y=it(u),y=u<0?pr(g+y,0):Sr(y,g-1)),Al(s,ze(a,3),y,!0)}function Pw(s){var a=s==null?0:s.length;return a?Ar(s,1):[]}function rR(s){var a=s==null?0:s.length;return a?Ar(s,le):[]}function nR(s,a){var u=s==null?0:s.length;return u?(a=a===r?1:it(a),Ar(s,a)):[]}function iR(s){for(var a=-1,u=s==null?0:s.length,g={};++a<u;){var y=s[a];g[y[0]]=y[1]}return g}function Tw(s){return s&&s.length?s[0]:r}function sR(s,a,u){var g=s==null?0:s.length;if(!g)return-1;var y=u==null?0:it(u);return y<0&&(y=pr(g+y,0)),lo(s,a,y)}function oR(s){var a=s==null?0:s.length;return a?bn(s,0,-1):[]}var aR=ct(function(s){var a=Ut(s,Y0);return a.length&&a[0]===s[0]?B0(a):[]}),cR=ct(function(s){var a=_n(s),u=Ut(s,Y0);return a===_n(u)?a=r:u.pop(),u.length&&u[0]===s[0]?B0(u,ze(a,2)):[]}),lR=ct(function(s){var a=_n(s),u=Ut(s,Y0);return a=typeof a=="function"?a:r,a&&u.pop(),u.length&&u[0]===s[0]?B0(u,r,a):[]});function uR(s,a){return s==null?"":oP.call(s,a)}function _n(s){var a=s==null?0:s.length;return a?s[a-1]:r}function hR(s,a,u){var g=s==null?0:s.length;if(!g)return-1;var y=g;return u!==r&&(y=it(u),y=y<0?pr(g+y,0):Sr(y,g-1)),a===a?WD(s,a,y):Al(s,f2,y,!0)}function fR(s,a){return s&&s.length?z2(s,it(a)):r}var dR=ct(Rw);function Rw(s,a){return s&&s.length&&a&&a.length?W0(s,a):s}function pR(s,a,u){return s&&s.length&&a&&a.length?W0(s,a,ze(u,2)):s}function gR(s,a,u){return s&&s.length&&a&&a.length?W0(s,a,r,u):s}var mR=oi(function(s,a){var u=s==null?0:s.length,g=L0(s,a);return V2(s,Ut(a,function(y){return ai(y,u)?+y:y}).sort(rw)),g});function wR(s,a){var u=[];if(!(s&&s.length))return u;var g=-1,y=[],S=s.length;for(a=ze(a,3);++g<S;){var M=s[g];a(M,g,s)&&(u.push(M),y.push(g))}return V2(s,y),u}function ud(s){return s==null?s:uP.call(s)}function vR(s,a,u){var g=s==null?0:s.length;return g?(u&&typeof u!="number"&&kr(s,a,u)?(a=0,u=g):(a=a==null?0:it(a),u=u===r?g:it(u)),bn(s,a,u)):[]}function yR(s,a){return Vl(s,a)}function bR(s,a,u){return K0(s,a,ze(u,2))}function _R(s,a){var u=s==null?0:s.length;if(u){var g=Vl(s,a);if(g<u&&Dn(s[g],a))return g}return-1}function ER(s,a){return Vl(s,a,!0)}function xR(s,a,u){return K0(s,a,ze(u,2),!0)}function CR(s,a){var u=s==null?0:s.length;if(u){var g=Vl(s,a,!0)-1;if(Dn(s[g],a))return g}return-1}function IR(s){return s&&s.length?G2(s):[]}function AR(s,a){return s&&s.length?G2(s,ze(a,2)):[]}function $R(s){var a=s==null?0:s.length;return a?bn(s,1,a):[]}function OR(s,a,u){return s&&s.length?(a=u||a===r?1:it(a),bn(s,0,a<0?0:a)):[]}function SR(s,a,u){var g=s==null?0:s.length;return g?(a=u||a===r?1:it(a),a=g-a,bn(s,a<0?0:a,g)):[]}function DR(s,a){return s&&s.length?Kl(s,ze(a,3),!1,!0):[]}function PR(s,a){return s&&s.length?Kl(s,ze(a,3)):[]}var TR=ct(function(s){return Ni(Ar(s,1,tr,!0))}),RR=ct(function(s){var a=_n(s);return tr(a)&&(a=r),Ni(Ar(s,1,tr,!0),ze(a,2))}),NR=ct(function(s){var a=_n(s);return a=typeof a=="function"?a:r,Ni(Ar(s,1,tr,!0),r,a)});function FR(s){return s&&s.length?Ni(s):[]}function LR(s,a){return s&&s.length?Ni(s,ze(a,2)):[]}function MR(s,a){return a=typeof a=="function"?a:r,s&&s.length?Ni(s,r,a):[]}function hd(s){if(!(s&&s.length))return[];var a=0;return s=Si(s,function(u){if(tr(u))return a=pr(u.length,a),!0}),O0(a,function(u){return Ut(s,I0(u))})}function Nw(s,a){if(!(s&&s.length))return[];var u=hd(s);return a==null?u:Ut(u,function(g){return yr(a,r,g)})}var UR=ct(function(s,a){return tr(s)?Fa(s,a):[]}),jR=ct(function(s){return Z0(Si(s,tr))}),BR=ct(function(s){var a=_n(s);return tr(a)&&(a=r),Z0(Si(s,tr),ze(a,2))}),kR=ct(function(s){var a=_n(s);return a=typeof a=="function"?a:r,Z0(Si(s,tr),r,a)}),HR=ct(hd);function zR(s,a){return X2(s||[],a||[],Na)}function WR(s,a){return X2(s||[],a||[],Ua)}var qR=ct(function(s){var a=s.length,u=a>1?s[a-1]:r;return u=typeof u=="function"?(s.pop(),u):r,Nw(s,u)});function Fw(s){var a=I(s);return a.__chain__=!0,a}function VR(s,a){return a(s),s}function ru(s,a){return a(s)}var KR=oi(function(s){var a=s.length,u=a?s[0]:0,g=this.__wrapped__,y=function(S){return L0(S,s)};return a>1||this.__actions__.length||!(g instanceof dt)||!ai(u)?this.thru(y):(g=g.slice(u,+u+(a?1:0)),g.__actions__.push({func:ru,args:[y],thisArg:r}),new vn(g,this.__chain__).thru(function(S){return a&&!S.length&&S.push(r),S}))});function GR(){return Fw(this)}function ZR(){return new vn(this.value(),this.__chain__)}function YR(){this.__values__===r&&(this.__values__=Zw(this.value()));var s=this.__index__>=this.__values__.length,a=s?r:this.__values__[this.__index__++];return{done:s,value:a}}function JR(){return this}function XR(s){for(var a,u=this;u instanceof kl;){var g=Ow(u);g.__index__=0,g.__values__=r,a?y.__wrapped__=g:a=g;var y=g;u=u.__wrapped__}return y.__wrapped__=s,a}function QR(){var s=this.__wrapped__;if(s instanceof dt){var a=s;return this.__actions__.length&&(a=new dt(this)),a=a.reverse(),a.__actions__.push({func:ru,args:[ud],thisArg:r}),new vn(a,this.__chain__)}return this.thru(ud)}function eN(){return J2(this.__wrapped__,this.__actions__)}var tN=Gl(function(s,a,u){bt.call(s,u)?++s[u]:ii(s,u,1)});function rN(s,a,u){var g=Qe(s)?u2:VP;return u&&kr(s,a,u)&&(a=r),g(s,ze(a,3))}function nN(s,a){var u=Qe(s)?Si:N2;return u(s,ze(a,3))}var iN=cw(Sw),sN=cw(Dw);function oN(s,a){return Ar(nu(s,a),1)}function aN(s,a){return Ar(nu(s,a),le)}function cN(s,a,u){return u=u===r?1:it(u),Ar(nu(s,a),u)}function Lw(s,a){var u=Qe(s)?mn:Ri;return u(s,ze(a,3))}function Mw(s,a){var u=Qe(s)?$D:R2;return u(s,ze(a,3))}var lN=Gl(function(s,a,u){bt.call(s,u)?s[u].push(a):ii(s,u,[a])});function uN(s,a,u,g){s=Kr(s)?s:Eo(s),u=u&&!g?it(u):0;var y=s.length;return u<0&&(u=pr(y+u,0)),cu(s)?u<=y&&s.indexOf(a,u)>-1:!!y&&lo(s,a,u)>-1}var hN=ct(function(s,a,u){var g=-1,y=typeof a=="function",S=Kr(s)?te(s.length):[];return Ri(s,function(M){S[++g]=y?yr(a,M,u):La(M,a,u)}),S}),fN=Gl(function(s,a,u){ii(s,u,a)});function nu(s,a){var u=Qe(s)?Ut:B2;return u(s,ze(a,3))}function dN(s,a,u,g){return s==null?[]:(Qe(a)||(a=a==null?[]:[a]),u=g?r:u,Qe(u)||(u=u==null?[]:[u]),W2(s,a,u))}var pN=Gl(function(s,a,u){s[u?0:1].push(a)},function(){return[[],[]]});function gN(s,a,u){var g=Qe(s)?x0:p2,y=arguments.length<3;return g(s,ze(a,4),u,y,Ri)}function mN(s,a,u){var g=Qe(s)?OD:p2,y=arguments.length<3;return g(s,ze(a,4),u,y,R2)}function wN(s,a){var u=Qe(s)?Si:N2;return u(s,ou(ze(a,3)))}function vN(s){var a=Qe(s)?S2:uT;return a(s)}function yN(s,a,u){(u?kr(s,a,u):a===r)?a=1:a=it(a);var g=Qe(s)?kP:hT;return g(s,a)}function bN(s){var a=Qe(s)?HP:dT;return a(s)}function _N(s){if(s==null)return 0;if(Kr(s))return cu(s)?ho(s):s.length;var a=Dr(s);return a==Me||a==He?s.size:H0(s).length}function EN(s,a,u){var g=Qe(s)?C0:pT;return u&&kr(s,a,u)&&(a=r),g(s,ze(a,3))}var xN=ct(function(s,a){if(s==null)return[];var u=a.length;return u>1&&kr(s,a[0],a[1])?a=[]:u>2&&kr(a[0],a[1],a[2])&&(a=[a[0]]),W2(s,Ar(a,1),[])}),iu=nP||function(){return mt.Date.now()};function CN(s,a){if(typeof a!="function")throw new wn(c);return s=it(s),function(){if(--s<1)return a.apply(this,arguments)}}function Uw(s,a,u){return a=u?r:a,a=s&&a==null?s.length:a,si(s,f,r,r,r,r,a)}function jw(s,a){var u;if(typeof a!="function")throw new wn(c);return s=it(s),function(){return--s>0&&(u=a.apply(this,arguments)),s<=1&&(a=r),u}}var fd=ct(function(s,a,u){var g=k;if(u.length){var y=Pi(u,bo(fd));g|=T}return si(s,g,a,u,y)}),Bw=ct(function(s,a,u){var g=k|q;if(u.length){var y=Pi(u,bo(Bw));g|=T}return si(a,g,s,u,y)});function kw(s,a,u){a=u?r:a;var g=si(s,F,r,r,r,r,r,a);return g.placeholder=kw.placeholder,g}function Hw(s,a,u){a=u?r:a;var g=si(s,$,r,r,r,r,r,a);return g.placeholder=Hw.placeholder,g}function zw(s,a,u){var g,y,S,M,H,Y,ue=0,he=!1,pe=!1,be=!0;if(typeof s!="function")throw new wn(c);a=En(a)||0,kt(u)&&(he=!!u.leading,pe="maxWait"in u,S=pe?pr(En(u.maxWait)||0,a):S,be="trailing"in u?!!u.trailing:be);function Te(rr){var Pn=g,ui=y;return g=y=r,ue=rr,M=s.apply(ui,Pn),M}function We(rr){return ue=rr,H=ka(ft,a),he?Te(rr):M}function ot(rr){var Pn=rr-Y,ui=rr-ue,cv=a-Pn;return pe?Sr(cv,S-ui):cv}function qe(rr){var Pn=rr-Y,ui=rr-ue;return Y===r||Pn>=a||Pn<0||pe&&ui>=S}function ft(){var rr=iu();if(qe(rr))return wt(rr);H=ka(ft,ot(rr))}function wt(rr){return H=r,be&&g?Te(rr):(g=y=r,M)}function nn(){H!==r&&Q2(H),ue=0,g=Y=y=H=r}function Hr(){return H===r?M:wt(iu())}function sn(){var rr=iu(),Pn=qe(rr);if(g=arguments,y=this,Y=rr,Pn){if(H===r)return We(Y);if(pe)return Q2(H),H=ka(ft,a),Te(Y)}return H===r&&(H=ka(ft,a)),M}return sn.cancel=nn,sn.flush=Hr,sn}var IN=ct(function(s,a){return T2(s,1,a)}),AN=ct(function(s,a,u){return T2(s,En(a)||0,u)});function $N(s){return si(s,Z)}function su(s,a){if(typeof s!="function"||a!=null&&typeof a!="function")throw new wn(c);var u=function(){var g=arguments,y=a?a.apply(this,g):g[0],S=u.cache;if(S.has(y))return S.get(y);var M=s.apply(this,g);return u.cache=S.set(y,M)||S,M};return u.cache=new(su.Cache||ni),u}su.Cache=ni;function ou(s){if(typeof s!="function")throw new wn(c);return function(){var a=arguments;switch(a.length){case 0:return!s.call(this);case 1:return!s.call(this,a[0]);case 2:return!s.call(this,a[0],a[1]);case 3:return!s.call(this,a[0],a[1],a[2])}return!s.apply(this,a)}}function ON(s){return jw(2,s)}var SN=gT(function(s,a){a=a.length==1&&Qe(a[0])?Ut(a[0],en(ze())):Ut(Ar(a,1),en(ze()));var u=a.length;return ct(function(g){for(var y=-1,S=Sr(g.length,u);++y<S;)g[y]=a[y].call(this,g[y]);return yr(s,this,g)})}),dd=ct(function(s,a){var u=Pi(a,bo(dd));return si(s,T,r,a,u)}),Ww=ct(function(s,a){var u=Pi(a,bo(Ww));return si(s,C,r,a,u)}),DN=oi(function(s,a){return si(s,E,r,r,r,a)});function PN(s,a){if(typeof s!="function")throw new wn(c);return a=a===r?a:it(a),ct(s,a)}function TN(s,a){if(typeof s!="function")throw new wn(c);return a=a==null?0:pr(it(a),0),ct(function(u){var g=u[a],y=Li(u,0,a);return g&&Di(y,g),yr(s,this,y)})}function RN(s,a,u){var g=!0,y=!0;if(typeof s!="function")throw new wn(c);return kt(u)&&(g="leading"in u?!!u.leading:g,y="trailing"in u?!!u.trailing:y),zw(s,a,{leading:g,maxWait:a,trailing:y})}function NN(s){return Uw(s,1)}function FN(s,a){return dd(J0(a),s)}function LN(){if(!arguments.length)return[];var s=arguments[0];return Qe(s)?s:[s]}function MN(s){return yn(s,A)}function UN(s,a){return a=typeof a=="function"?a:r,yn(s,A,a)}function jN(s){return yn(s,x|A)}function BN(s,a){return a=typeof a=="function"?a:r,yn(s,x|A,a)}function kN(s,a){return a==null||P2(s,a,br(a))}function Dn(s,a){return s===a||s!==s&&a!==a}var HN=Xl(j0),zN=Xl(function(s,a){return s>=a}),xs=M2(function(){return arguments}())?M2:function(s){return Yt(s)&&bt.call(s,"callee")&&!x2.call(s,"callee")},Qe=te.isArray,WN=jr?en(jr):XP;function Kr(s){return s!=null&&au(s.length)&&!ci(s)}function tr(s){return Yt(s)&&Kr(s)}function qN(s){return s===!0||s===!1||Yt(s)&&Br(s)==J}var Mi=sP||Cd,VN=$n?en($n):QP;function KN(s){return Yt(s)&&s.nodeType===1&&!Ha(s)}function GN(s){if(s==null)return!0;if(Kr(s)&&(Qe(s)||typeof s=="string"||typeof s.splice=="function"||Mi(s)||_o(s)||xs(s)))return!s.length;var a=Dr(s);if(a==Me||a==He)return!s.size;if(Ba(s))return!H0(s).length;for(var u in s)if(bt.call(s,u))return!1;return!0}function ZN(s,a){return Ma(s,a)}function YN(s,a,u){u=typeof u=="function"?u:r;var g=u?u(s,a):r;return g===r?Ma(s,a,r,u):!!g}function pd(s){if(!Yt(s))return!1;var a=Br(s);return a==j||a==w||typeof s.message=="string"&&typeof s.name=="string"&&!Ha(s)}function JN(s){return typeof s=="number"&&I2(s)}function ci(s){if(!kt(s))return!1;var a=Br(s);return a==we||a==ve||a==X||a==Pt}function qw(s){return typeof s=="number"&&s==it(s)}function au(s){return typeof s=="number"&&s>-1&&s%1==0&&s<=re}function kt(s){var a=typeof s;return s!=null&&(a=="object"||a=="function")}function Yt(s){return s!=null&&typeof s=="object"}var Vw=gn?en(gn):tT;function XN(s,a){return s===a||k0(s,a,id(a))}function QN(s,a,u){return u=typeof u=="function"?u:r,k0(s,a,id(a),u)}function eF(s){return Kw(s)&&s!=+s}function tF(s){if(UT(s))throw new Ye(o);return U2(s)}function rF(s){return s===null}function nF(s){return s==null}function Kw(s){return typeof s=="number"||Yt(s)&&Br(s)==nt}function Ha(s){if(!Yt(s)||Br(s)!=Ge)return!1;var a=Nl(s);if(a===null)return!0;var u=bt.call(a,"constructor")&&a.constructor;return typeof u=="function"&&u instanceof u&&Dl.call(u)==QD}var gd=Hn?en(Hn):rT;function iF(s){return qw(s)&&s>=-re&&s<=re}var Gw=$a?en($a):nT;function cu(s){return typeof s=="string"||!Qe(s)&&Yt(s)&&Br(s)==ke}function rn(s){return typeof s=="symbol"||Yt(s)&&Br(s)==Ke}var _o=gs?en(gs):iT;function sF(s){return s===r}function oF(s){return Yt(s)&&Dr(s)==Ue}function aF(s){return Yt(s)&&Br(s)==Ze}var cF=Xl(z0),lF=Xl(function(s,a){return s<=a});function Zw(s){if(!s)return[];if(Kr(s))return cu(s)?On(s):Vr(s);if(Sa&&s[Sa])return kD(s[Sa]());var a=Dr(s),u=a==Me?D0:a==He?$l:Eo;return u(s)}function li(s){if(!s)return s===0?s:0;if(s=En(s),s===le||s===-le){var a=s<0?-1:1;return a*ne}return s===s?s:0}function it(s){var a=li(s),u=a%1;return a===a?u?a-u:a:0}function Yw(s){return s?ys(it(s),0,ie):0}function En(s){if(typeof s=="number")return s;if(rn(s))return ae;if(kt(s)){var a=typeof s.valueOf=="function"?s.valueOf():s;s=kt(a)?a+"":a}if(typeof s!="string")return s===0?s:+s;s=g2(s);var u=s0.test(s);return u||a0.test(s)?Xe(s.slice(2),u?2:8):i0.test(s)?ae:+s}function Jw(s){return Wn(s,Gr(s))}function uF(s){return s?ys(it(s),-re,re):s===0?s:0}function yt(s){return s==null?"":tn(s)}var hF=vo(function(s,a){if(Ba(a)||Kr(a)){Wn(a,br(a),s);return}for(var u in a)bt.call(a,u)&&Na(s,u,a[u])}),Xw=vo(function(s,a){Wn(a,Gr(a),s)}),lu=vo(function(s,a,u,g){Wn(a,Gr(a),s,g)}),fF=vo(function(s,a,u,g){Wn(a,br(a),s,g)}),dF=oi(L0);function pF(s,a){var u=wo(s);return a==null?u:D2(u,a)}var gF=ct(function(s,a){s=Ot(s);var u=-1,g=a.length,y=g>2?a[2]:r;for(y&&kr(a[0],a[1],y)&&(g=1);++u<g;)for(var S=a[u],M=Gr(S),H=-1,Y=M.length;++H<Y;){var ue=M[H],he=s[ue];(he===r||Dn(he,po[ue])&&!bt.call(s,ue))&&(s[ue]=S[ue])}return s}),mF=ct(function(s){return s.push(r,gw),yr(Qw,r,s)});function wF(s,a){return h2(s,ze(a,3),zn)}function vF(s,a){return h2(s,ze(a,3),U0)}function yF(s,a){return s==null?s:M0(s,ze(a,3),Gr)}function bF(s,a){return s==null?s:F2(s,ze(a,3),Gr)}function _F(s,a){return s&&zn(s,ze(a,3))}function EF(s,a){return s&&U0(s,ze(a,3))}function xF(s){return s==null?[]:Wl(s,br(s))}function CF(s){return s==null?[]:Wl(s,Gr(s))}function md(s,a,u){var g=s==null?r:bs(s,a);return g===r?u:g}function IF(s,a){return s!=null&&vw(s,a,GP)}function wd(s,a){return s!=null&&vw(s,a,ZP)}var AF=uw(function(s,a,u){a!=null&&typeof a.toString!="function"&&(a=Pl.call(a)),s[a]=u},yd(Zr)),$F=uw(function(s,a,u){a!=null&&typeof a.toString!="function"&&(a=Pl.call(a)),bt.call(s,a)?s[a].push(u):s[a]=[u]},ze),OF=ct(La);function br(s){return Kr(s)?O2(s):H0(s)}function Gr(s){return Kr(s)?O2(s,!0):sT(s)}function SF(s,a){var u={};return a=ze(a,3),zn(s,function(g,y,S){ii(u,a(g,y,S),g)}),u}function DF(s,a){var u={};return a=ze(a,3),zn(s,function(g,y,S){ii(u,y,a(g,y,S))}),u}var PF=vo(function(s,a,u){ql(s,a,u)}),Qw=vo(function(s,a,u,g){ql(s,a,u,g)}),TF=oi(function(s,a){var u={};if(s==null)return u;var g=!1;a=Ut(a,function(S){return S=Fi(S,s),g||(g=S.length>1),S}),Wn(s,rd(s),u),g&&(u=yn(u,x|_|A,AT));for(var y=a.length;y--;)G0(u,a[y]);return u});function RF(s,a){return ev(s,ou(ze(a)))}var NF=oi(function(s,a){return s==null?{}:aT(s,a)});function ev(s,a){if(s==null)return{};var u=Ut(rd(s),function(g){return[g]});return a=ze(a),q2(s,u,function(g,y){return a(g,y[0])})}function FF(s,a,u){a=Fi(a,s);var g=-1,y=a.length;for(y||(y=1,s=r);++g<y;){var S=s==null?r:s[qn(a[g])];S===r&&(g=y,S=u),s=ci(S)?S.call(s):S}return s}function LF(s,a,u){return s==null?s:Ua(s,a,u)}function MF(s,a,u,g){return g=typeof g=="function"?g:r,s==null?s:Ua(s,a,u,g)}var tv=dw(br),rv=dw(Gr);function UF(s,a,u){var g=Qe(s),y=g||Mi(s)||_o(s);if(a=ze(a,4),u==null){var S=s&&s.constructor;y?u=g?new S:[]:kt(s)?u=ci(S)?wo(Nl(s)):{}:u={}}return(y?mn:zn)(s,function(M,H,Y){return a(u,M,H,Y)}),u}function jF(s,a){return s==null?!0:G0(s,a)}function BF(s,a,u){return s==null?s:Y2(s,a,J0(u))}function kF(s,a,u,g){return g=typeof g=="function"?g:r,s==null?s:Y2(s,a,J0(u),g)}function Eo(s){return s==null?[]:S0(s,br(s))}function HF(s){return s==null?[]:S0(s,Gr(s))}function zF(s,a,u){return u===r&&(u=a,a=r),u!==r&&(u=En(u),u=u===u?u:0),a!==r&&(a=En(a),a=a===a?a:0),ys(En(s),a,u)}function WF(s,a,u){return a=li(a),u===r?(u=a,a=0):u=li(u),s=En(s),YP(s,a,u)}function qF(s,a,u){if(u&&typeof u!="boolean"&&kr(s,a,u)&&(a=u=r),u===r&&(typeof a=="boolean"?(u=a,a=r):typeof s=="boolean"&&(u=s,s=r)),s===r&&a===r?(s=0,a=1):(s=li(s),a===r?(a=s,s=0):a=li(a)),s>a){var g=s;s=a,a=g}if(u||s%1||a%1){var y=A2();return Sr(s+y*(a-s+At("1e-"+((y+"").length-1))),a)}return q0(s,a)}var VF=yo(function(s,a,u){return a=a.toLowerCase(),s+(u?nv(a):a)});function nv(s){return vd(yt(s).toLowerCase())}function iv(s){return s=yt(s),s&&s.replace(ei,LD).replace(b0,"")}function KF(s,a,u){s=yt(s),a=tn(a);var g=s.length;u=u===r?g:ys(it(u),0,g);var y=u;return u-=a.length,u>=0&&s.slice(u,y)==a}function GF(s){return s=yt(s),s&&Lt.test(s)?s.replace(us,MD):s}function ZF(s){return s=yt(s),s&&ar.test(s)?s.replace(Kt,"\\$&"):s}var YF=yo(function(s,a,u){return s+(u?"-":"")+a.toLowerCase()}),JF=yo(function(s,a,u){return s+(u?" ":"")+a.toLowerCase()}),XF=aw("toLowerCase");function QF(s,a,u){s=yt(s),a=it(a);var g=a?ho(s):0;if(!a||g>=a)return s;var y=(a-g)/2;return Jl(Ul(y),u)+s+Jl(Ml(y),u)}function eL(s,a,u){s=yt(s),a=it(a);var g=a?ho(s):0;return a&&g<a?s+Jl(a-g,u):s}function tL(s,a,u){s=yt(s),a=it(a);var g=a?ho(s):0;return a&&g<a?Jl(a-g,u)+s:s}function rL(s,a,u){return u||a==null?a=0:a&&(a=+a),lP(yt(s).replace(Gt,""),a||0)}function nL(s,a,u){return(u?kr(s,a,u):a===r)?a=1:a=it(a),V0(yt(s),a)}function iL(){var s=arguments,a=yt(s[0]);return s.length<3?a:a.replace(s[1],s[2])}var sL=yo(function(s,a,u){return s+(u?"_":"")+a.toLowerCase()});function oL(s,a,u){return u&&typeof u!="number"&&kr(s,a,u)&&(a=u=r),u=u===r?ie:u>>>0,u?(s=yt(s),s&&(typeof a=="string"||a!=null&&!gd(a))&&(a=tn(a),!a&&uo(s))?Li(On(s),0,u):s.split(a,u)):[]}var aL=yo(function(s,a,u){return s+(u?" ":"")+vd(a)});function cL(s,a,u){return s=yt(s),u=u==null?0:ys(it(u),0,s.length),a=tn(a),s.slice(u,u+a.length)==a}function lL(s,a,u){var g=I.templateSettings;u&&kr(s,a,u)&&(a=r),s=yt(s),a=lu({},a,g,pw);var y=lu({},a.imports,g.imports,pw),S=br(y),M=S0(y,S),H,Y,ue=0,he=a.interpolate||ro,pe="__p += '",be=P0((a.escape||ro).source+"|"+he.source+"|"+(he===Bt?n0:ro).source+"|"+(a.evaluate||ro).source+"|$","g"),Te="//# sourceURL="+(bt.call(a,"sourceURL")?(a.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++_0+"]")+`
82
+ `;s.replace(be,function(qe,ft,wt,nn,Hr,sn){return wt||(wt=nn),pe+=s.slice(ue,sn).replace(l0,UD),ft&&(H=!0,pe+=`' +
83
83
  __e(`+ft+`) +
84
- '`),kr&&(G=!0,pe+=`';
85
- `+kr+`;
84
+ '`),Hr&&(Y=!0,pe+=`';
85
+ `+Hr+`;
86
86
  __p += '`),wt&&(pe+=`' +
87
87
  ((__t = (`+wt+`)) == null ? '' : __t) +
88
88
  '`),ue=sn+qe.length,qe}),pe+=`';
89
89
  `;var We=bt.call(a,"variable")&&a.variable;if(!We)pe=`with (obj) {
90
90
  `+pe+`
91
91
  }
92
- `;else if(kf.test(We))throw new Ye(l);pe=(G?pe.replace(lt,""):pe).replace(Ur,"$1").replace(Jn,"$1;"),pe="function("+(We||"obj")+`) {
92
+ `;else if(t0.test(We))throw new Ye(l);pe=(Y?pe.replace(lt,""):pe).replace(Ur,"$1").replace(Qn,"$1;"),pe="function("+(We||"obj")+`) {
93
93
  `+(We?"":`obj || (obj = {});
94
- `)+"var __t, __p = ''"+(k?", __e = _.escape":"")+(G?`, __j = Array.prototype.join;
94
+ `)+"var __t, __p = ''"+(H?", __e = _.escape":"")+(Y?`, __j = Array.prototype.join;
95
95
  function print() { __p += __j.call(arguments, '') }
96
96
  `:`;
97
97
  `)+pe+`return __p
98
- }`;var ot=mw(function(){return vt(O,Pe+"return "+pe).apply(r,M)});if(ot.source=pe,ed(ot))throw ot;return ot}function GN(s){return yt(s).toLowerCase()}function ZN(s){return yt(s).toUpperCase()}function YN(s,a,u){if(s=yt(s),s&&(u||a===r))return Im(s);if(!s||!(a=tn(a)))return s;var g=Sn(s),y=Sn(a),O=Sm(g,y),M=Am(g,y)+1;return Li(g,O,M).join("")}function JN(s,a,u){if(s=yt(s),s&&(u||a===r))return s.slice(0,Dm(s)+1);if(!s||!(a=tn(a)))return s;var g=Sn(s),y=Am(g,Sn(a))+1;return Li(g,0,y).join("")}function XN(s,a,u){if(s=yt(s),s&&(u||a===r))return s.replace(Kt,"");if(!s||!(a=tn(a)))return s;var g=Sn(s),y=Sm(g,Sn(a));return Li(g,y).join("")}function QN(s,a){var u=z,g=ee;if(Bt(a)){var y="separator"in a?a.separator:y;u="length"in a?it(a.length):u,g="omission"in a?tn(a.omission):g}s=yt(s);var O=s.length;if(ao(s)){var M=Sn(s);O=M.length}if(u>=O)return s;var k=u-co(g);if(k<1)return g;var G=M?Li(M,0,k).join(""):s.slice(0,k);if(y===r)return G+g;if(M&&(k+=G.length-k),td(y)){if(s.slice(k).search(y)){var ue,he=G;for(y.global||(y=w0(y.source,yt(fn.exec(y))+"g")),y.lastIndex=0;ue=y.exec(he);)var pe=ue.index;G=G.slice(0,pe===r?k:pe)}}else if(s.indexOf(tn(y),k)!=k){var be=G.lastIndexOf(y);be>-1&&(G=G.slice(0,be))}return G+g}function eR(s){return s=yt(s),s&&zt.test(s)?s.replace(Si,DO):s}var tR=mo(function(s,a,u){return s+(u?" ":"")+a.toUpperCase()}),id=w2("toUpperCase");function gw(s,a,u){return s=yt(s),a=u?r:a,a===r?CO(s)?TO(s):gO(s):s.match(a)||[]}var mw=ct(function(s,a){try{return vr(s,r,a)}catch(u){return ed(u)?u:new Ye(u)}}),rR=ii(function(s,a){return pn(a,function(u){u=zn(u),ri(s,u,X0(s[u],s))}),s});function nR(s){var a=s==null?0:s.length,u=ze();return s=a?Ut(s,function(g){if(typeof g[1]!="function")throw new gn(c);return[u(g[0]),g[1]]}):[],ct(function(g){for(var y=-1;++y<a;){var O=s[y];if(vr(O[0],this,g))return vr(O[1],this,g)}})}function iR(s){return DD(wn(s,E))}function sd(s){return function(){return s}}function sR(s,a){return s==null||s!==s?a:s}var oR=y2(),aR=y2(!0);function Zr(s){return s}function od(s){return Zm(typeof s=="function"?s:wn(s,E))}function cR(s){return Jm(wn(s,E))}function lR(s,a){return Xm(s,wn(a,E))}var uR=ct(function(s,a){return function(u){return Da(u,s,a)}}),hR=ct(function(s,a){return function(u){return Da(s,u,a)}});function ad(s,a,u){var g=yr(a),y=Ll(a,g);u==null&&!(Bt(a)&&(y.length||!g.length))&&(u=a,a=s,s=this,y=Ll(a,yr(a)));var O=!(Bt(u)&&"chain"in u)||!!u.chain,M=oi(s);return pn(y,function(k){var G=a[k];s[k]=G,M&&(s.prototype[k]=function(){var ue=this.__chain__;if(O||ue){var he=s(this.__wrapped__),pe=he.__actions__=Vr(this.__actions__);return pe.push({func:G,args:arguments,thisArg:s}),he.__chain__=ue,he}return G.apply(s,Di([this.value()],arguments))})}),s}function fR(){return mt._===this&&(mt._=jO),this}function cd(){}function dR(s){return s=it(s),ct(function(a){return Qm(a,s)})}var pR=F0(Ut),gR=F0(bm),mR=F0(u0);function ww(s){return V0(s)?h0(zn(s)):VD(s)}function wR(s){return function(a){return s==null?r:vs(s,a)}}var vR=_2(),yR=_2(!0);function ld(){return[]}function ud(){return!1}function bR(){return{}}function _R(){return""}function ER(){return!0}function xR(s,a){if(s=it(s),s<1||s>re)return[];var u=ie,g=Ar(s,ie);a=ze(a),s-=ie;for(var y=p0(g,a);++u<s;)a(u);return y}function CR(s){return Qe(s)?Ut(s,zn):rn(s)?[s]:Vr(U2(yt(s)))}function IR(s){var a=++MO;return yt(s)+a}var SR=kl(function(s,a){return s+a},0),AR=B0("ceil"),OR=kl(function(s,a){return s/a},1),DR=B0("floor");function $R(s){return s&&s.length?Rl(s,Zr,I0):r}function PR(s,a){return s&&s.length?Rl(s,ze(a,2),I0):r}function TR(s){return xm(s,Zr)}function NR(s,a){return xm(s,ze(a,2))}function RR(s){return s&&s.length?Rl(s,Zr,D0):r}function LR(s,a){return s&&s.length?Rl(s,ze(a,2),D0):r}var MR=kl(function(s,a){return s*a},1),UR=B0("round"),jR=kl(function(s,a){return s-a},0);function FR(s){return s&&s.length?d0(s,Zr):0}function BR(s,a){return s&&s.length?d0(s,ze(a,2)):0}return C.after=cT,C.ary=G2,C.assign=ZT,C.assignIn=cw,C.assignInWith=eu,C.assignWith=YT,C.at=JT,C.before=Z2,C.bind=X0,C.bindAll=rR,C.bindKey=Y2,C.castArray=bT,C.chain=q2,C.chunk=D$,C.compact=$$,C.concat=P$,C.cond=nR,C.conforms=iR,C.constant=sd,C.countBy=FP,C.create=XT,C.curry=J2,C.curryRight=X2,C.debounce=Q2,C.defaults=QT,C.defaultsDeep=eN,C.defer=lT,C.delay=uT,C.difference=T$,C.differenceBy=N$,C.differenceWith=R$,C.drop=L$,C.dropRight=M$,C.dropRightWhile=U$,C.dropWhile=j$,C.fill=F$,C.filter=kP,C.flatMap=WP,C.flatMapDeep=qP,C.flatMapDepth=VP,C.flatten=k2,C.flattenDeep=B$,C.flattenDepth=k$,C.flip=hT,C.flow=oR,C.flowRight=aR,C.fromPairs=H$,C.functions=aN,C.functionsIn=cN,C.groupBy=KP,C.initial=W$,C.intersection=q$,C.intersectionBy=V$,C.intersectionWith=K$,C.invert=uN,C.invertBy=hN,C.invokeMap=ZP,C.iteratee=od,C.keyBy=YP,C.keys=yr,C.keysIn=Gr,C.map=Gl,C.mapKeys=dN,C.mapValues=pN,C.matches=cR,C.matchesProperty=lR,C.memoize=Yl,C.merge=gN,C.mergeWith=lw,C.method=uR,C.methodOf=hR,C.mixin=ad,C.negate=Jl,C.nthArg=dR,C.omit=mN,C.omitBy=wN,C.once=fT,C.orderBy=JP,C.over=pR,C.overArgs=dT,C.overEvery=gR,C.overSome=mR,C.partial=Q0,C.partialRight=ew,C.partition=XP,C.pick=vN,C.pickBy=uw,C.property=ww,C.propertyOf=wR,C.pull=J$,C.pullAll=z2,C.pullAllBy=X$,C.pullAllWith=Q$,C.pullAt=eP,C.range=vR,C.rangeRight=yR,C.rearg=pT,C.reject=tT,C.remove=tP,C.rest=gT,C.reverse=Y0,C.sampleSize=nT,C.set=bN,C.setWith=_N,C.shuffle=iT,C.slice=rP,C.sortBy=aT,C.sortedUniq=lP,C.sortedUniqBy=uP,C.split=WN,C.spread=mT,C.tail=hP,C.take=fP,C.takeRight=dP,C.takeRightWhile=pP,C.takeWhile=gP,C.tap=$P,C.throttle=wT,C.thru=Kl,C.toArray=sw,C.toPairs=hw,C.toPairsIn=fw,C.toPath=CR,C.toPlainObject=aw,C.transform=EN,C.unary=vT,C.union=mP,C.unionBy=wP,C.unionWith=vP,C.uniq=yP,C.uniqBy=bP,C.uniqWith=_P,C.unset=xN,C.unzip=J0,C.unzipWith=W2,C.update=CN,C.updateWith=IN,C.values=yo,C.valuesIn=SN,C.without=EP,C.words=gw,C.wrap=yT,C.xor=xP,C.xorBy=CP,C.xorWith=IP,C.zip=SP,C.zipObject=AP,C.zipObjectDeep=OP,C.zipWith=DP,C.entries=hw,C.entriesIn=fw,C.extend=cw,C.extendWith=eu,ad(C,C),C.add=SR,C.attempt=mw,C.camelCase=$N,C.capitalize=dw,C.ceil=AR,C.clamp=AN,C.clone=_T,C.cloneDeep=xT,C.cloneDeepWith=CT,C.cloneWith=ET,C.conformsTo=IT,C.deburr=pw,C.defaultTo=sR,C.divide=OR,C.endsWith=PN,C.eq=On,C.escape=TN,C.escapeRegExp=NN,C.every=BP,C.find=HP,C.findIndex=F2,C.findKey=tN,C.findLast=zP,C.findLastIndex=B2,C.findLastKey=rN,C.floor=DR,C.forEach=V2,C.forEachRight=K2,C.forIn=nN,C.forInRight=iN,C.forOwn=sN,C.forOwnRight=oN,C.get=rd,C.gt=ST,C.gte=AT,C.has=lN,C.hasIn=nd,C.head=H2,C.identity=Zr,C.includes=GP,C.indexOf=z$,C.inRange=ON,C.invoke=fN,C.isArguments=_s,C.isArray=Qe,C.isArrayBuffer=OT,C.isArrayLike=Kr,C.isArrayLikeObject=er,C.isBoolean=DT,C.isBuffer=Mi,C.isDate=$T,C.isElement=PT,C.isEmpty=TT,C.isEqual=NT,C.isEqualWith=RT,C.isError=ed,C.isFinite=LT,C.isFunction=oi,C.isInteger=tw,C.isLength=Xl,C.isMap=rw,C.isMatch=MT,C.isMatchWith=UT,C.isNaN=jT,C.isNative=FT,C.isNil=kT,C.isNull=BT,C.isNumber=nw,C.isObject=Bt,C.isObjectLike=Zt,C.isPlainObject=La,C.isRegExp=td,C.isSafeInteger=HT,C.isSet=iw,C.isString=Ql,C.isSymbol=rn,C.isTypedArray=vo,C.isUndefined=zT,C.isWeakMap=WT,C.isWeakSet=qT,C.join=G$,C.kebabCase=RN,C.last=yn,C.lastIndexOf=Z$,C.lowerCase=LN,C.lowerFirst=MN,C.lt=VT,C.lte=KT,C.max=$R,C.maxBy=PR,C.mean=TR,C.meanBy=NR,C.min=RR,C.minBy=LR,C.stubArray=ld,C.stubFalse=ud,C.stubObject=bR,C.stubString=_R,C.stubTrue=ER,C.multiply=MR,C.nth=Y$,C.noConflict=fR,C.noop=cd,C.now=Zl,C.pad=UN,C.padEnd=jN,C.padStart=FN,C.parseInt=BN,C.random=DN,C.reduce=QP,C.reduceRight=eT,C.repeat=kN,C.replace=HN,C.result=yN,C.round=UR,C.runInContext=V,C.sample=rT,C.size=sT,C.snakeCase=zN,C.some=oT,C.sortedIndex=nP,C.sortedIndexBy=iP,C.sortedIndexOf=sP,C.sortedLastIndex=oP,C.sortedLastIndexBy=aP,C.sortedLastIndexOf=cP,C.startCase=qN,C.startsWith=VN,C.subtract=jR,C.sum=FR,C.sumBy=BR,C.template=KN,C.times=xR,C.toFinite=ai,C.toInteger=it,C.toLength=ow,C.toLower=GN,C.toNumber=bn,C.toSafeInteger=GT,C.toString=yt,C.toUpper=ZN,C.trim=YN,C.trimEnd=JN,C.trimStart=XN,C.truncate=QN,C.unescape=eR,C.uniqueId=IR,C.upperCase=tR,C.upperFirst=id,C.each=V2,C.eachRight=K2,C.first=H2,ad(C,function(){var s={};return kn(C,function(a,u){bt.call(C.prototype,u)||(s[u]=a)}),s}(),{chain:!1}),C.VERSION=n,pn(["bind","bindKey","curry","curryRight","partial","partialRight"],function(s){C[s].placeholder=C}),pn(["drop","take"],function(s,a){dt.prototype[s]=function(u){u=u===r?1:dr(it(u),0);var g=this.__filtered__&&!a?new dt(this):this.clone();return g.__filtered__?g.__takeCount__=Ar(u,g.__takeCount__):g.__views__.push({size:Ar(u,ie),type:s+(g.__dir__<0?"Right":"")}),g},dt.prototype[s+"Right"]=function(u){return this.reverse()[s](u).reverse()}}),pn(["filter","map","takeWhile"],function(s,a){var u=a+1,g=u==A||u==ce;dt.prototype[s]=function(y){var O=this.clone();return O.__iteratees__.push({iteratee:ze(y,3),type:u}),O.__filtered__=O.__filtered__||g,O}}),pn(["head","last"],function(s,a){var u="take"+(a?"Right":"");dt.prototype[s]=function(){return this[u](1).value()[0]}}),pn(["initial","tail"],function(s,a){var u="drop"+(a?"":"Right");dt.prototype[s]=function(){return this.__filtered__?new dt(this):this[u](1)}}),dt.prototype.compact=function(){return this.filter(Zr)},dt.prototype.find=function(s){return this.filter(s).head()},dt.prototype.findLast=function(s){return this.reverse().find(s)},dt.prototype.invokeMap=ct(function(s,a){return typeof s=="function"?new dt(this):this.map(function(u){return Da(u,s,a)})}),dt.prototype.reject=function(s){return this.filter(Jl(ze(s)))},dt.prototype.slice=function(s,a){s=it(s);var u=this;return u.__filtered__&&(s>0||a<0)?new dt(u):(s<0?u=u.takeRight(-s):s&&(u=u.drop(s)),a!==r&&(a=it(a),u=a<0?u.dropRight(-a):u.take(a-s)),u)},dt.prototype.takeRightWhile=function(s){return this.reverse().takeWhile(s).reverse()},dt.prototype.toArray=function(){return this.take(ie)},kn(dt.prototype,function(s,a){var u=/^(?:filter|find|map|reject)|While$/.test(a),g=/^(?:head|last)$/.test(a),y=C[g?"take"+(a=="last"?"Right":""):a],O=g||/^find/.test(a);y&&(C.prototype[a]=function(){var M=this.__wrapped__,k=g?[1]:arguments,G=M instanceof dt,ue=k[0],he=G||Qe(M),pe=function(ft){var wt=y.apply(C,Di([ft],k));return g&&be?wt[0]:wt};he&&u&&typeof ue=="function"&&ue.length!=1&&(G=he=!1);var be=this.__chain__,Pe=!!this.__actions__.length,We=O&&!be,ot=G&&!Pe;if(!O&&he){M=ot?M:new dt(this);var qe=s.apply(M,k);return qe.__actions__.push({func:Kl,args:[pe],thisArg:r}),new mn(qe,be)}return We&&ot?s.apply(this,k):(qe=this.thru(pe),We?g?qe.value()[0]:qe.value():qe)})}),pn(["pop","push","shift","sort","splice","unshift"],function(s){var a=yl[s],u=/^(?:push|sort|unshift)$/.test(s)?"tap":"thru",g=/^(?:pop|shift)$/.test(s);C.prototype[s]=function(){var y=arguments;if(g&&!this.__chain__){var O=this.value();return a.apply(Qe(O)?O:[],y)}return this[u](function(M){return a.apply(Qe(M)?M:[],y)})}}),kn(dt.prototype,function(s,a){var u=C[a];if(u){var g=u.name+"";bt.call(fo,g)||(fo[g]=[]),fo[g].push({name:a,func:u})}}),fo[Bl(r,Z).name]=[{name:"wrapper",func:r}],dt.prototype.clone=eD,dt.prototype.reverse=tD,dt.prototype.value=rD,C.prototype.at=PP,C.prototype.chain=TP,C.prototype.commit=NP,C.prototype.next=RP,C.prototype.plant=MP,C.prototype.reverse=UP,C.prototype.toJSON=C.prototype.valueOf=C.prototype.value=jP,C.prototype.first=C.prototype.head,Ea&&(C.prototype[Ea]=LP),C},lo=NO();Qt?((Qt.exports=lo)._=lo,St._=lo):mt._=lo}).call(Wo)})(yh,yh.exports);var I7=Object.defineProperty,S7=Object.defineProperties,A7=Object.getOwnPropertyDescriptors,Ig=Object.getOwnPropertySymbols,O7=Object.prototype.hasOwnProperty,D7=Object.prototype.propertyIsEnumerable,Sg=(t,e,r)=>e in t?I7(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,cc=(t,e)=>{for(var r in e||(e={}))O7.call(e,r)&&Sg(t,r,e[r]);if(Ig)for(var r of Ig(e))D7.call(e,r)&&Sg(t,r,e[r]);return t},$7=(t,e)=>S7(t,A7(e));function cn(t,e,r){let n;const i=bh(t);return e.rpcMap&&(n=e.rpcMap[i]),n||(n=`${C7}?chainId=eip155:${i}&projectId=${r}`),n}function bh(t){return t.includes("eip155")?Number(t.split(":")[1]):Number(t)}function Ag(t){return t.map(e=>`${e.split(":")[0]}:${e.split(":")[1]}`)}function P7(t,e){const r=Object.keys(e.namespaces).filter(i=>i.includes(t));if(!r.length)return[];const n=[];return r.forEach(i=>{const o=e.namespaces[i].accounts;n.push(...o)}),n}function T7(t={},e={}){const r=Og(t),n=Og(e);return yh.exports.merge(r,n)}function Og(t){var e,r,n,i;const o={};if(!Ds(t))return o;for(const[c,l]of Object.entries(t)){const h=Ru(c)?[c]:l.chains,f=l.methods||[],v=l.events||[],E=l.rpcMap||{},_=Ya(c);o[_]=$7(cc(cc({},o[_]),l),{chains:Tu(h,(e=o[_])==null?void 0:e.chains),methods:Tu(f,(r=o[_])==null?void 0:r.methods),events:Tu(v,(n=o[_])==null?void 0:n.events),rpcMap:cc(cc({},E),(i=o[_])==null?void 0:i.rpcMap)})}return o}function N7(t){return t.includes(":")?t.split(":")[2]:t}function R7(t){const e={};for(const[r,n]of Object.entries(t)){const i=n.methods||[],o=n.events||[],c=n.accounts||[],l=Ru(r)?[r]:n.chains?n.chains:Ag(n.accounts);e[r]={chains:l,methods:i,events:o,accounts:c}}return e}const Dg={},Jt=t=>Dg[t],_h=(t,e)=>{Dg[t]=e};class L7{constructor(e){this.name="polkadot",this.namespace=e.namespace,this.events=Jt("events"),this.client=Jt("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,r){if(this.chainId=e,!this.httpProviders[e]){const n=r||cn(`${this.name}:${e}`,this.namespace);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,n)}this.events.emit(pi.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e?e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2])||[]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;e[r]=this.createHttpProvider(r,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||cn(e,this.namespace);return typeof n>"u"?void 0:new fi(new Vi(n,Jt("disableProviderPing")))}}class M7{constructor(e){this.name="eip155",this.namespace=e.namespace,this.events=Jt("events"),this.client=Jt("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,r){const n=bh(e);if(!this.httpProviders[n]){const i=r||cn(`${this.name}:${n}`,this.namespace,this.client.core.projectId);if(!i)throw new Error(`No RPC url provided for chainId: ${n}`);this.setHttpProvider(n,i)}this.chainId=n,this.events.emit(pi.DEFAULT_CHAIN_CHANGED,`${this.name}:${n}`)}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,r){const n=r||cn(`${this.name}:${e}`,this.namespace,this.client.core.projectId);return typeof n>"u"?void 0:new fi(new Vi(n,Jt("disableProviderPing")))}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;const i=bh(r);e[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}getHttpProvider(){const e=this.chainId,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}async handleSwitchChain(e){var r,n;let i=e.request.params?(r=e.request.params[0])==null?void 0:r.chainId:"0x0";i=i.startsWith("0x")?i:`0x${i}`;const o=parseInt(i,16);if(this.isChainApproved(o))this.setDefaultChain(`${o}`);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(`${o}`);else throw new Error(`Failed to switch to chain 'eip155:${o}'. 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 U7{constructor(e){this.name="solana",this.namespace=e.namespace,this.events=Jt("events"),this.client=Jt("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,r){if(!this.httpProviders[e]){const n=r||cn(`${this.name}:${e}`,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,n)}this.chainId=e,this.events.emit(pi.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}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(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;e[r]=this.createHttpProvider(r,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||cn(e,this.namespace,this.client.core.projectId);return typeof n>"u"?void 0:new fi(new Vi(n,Jt("disableProviderPing")))}}class j7{constructor(e){this.name="cosmos",this.namespace=e.namespace,this.events=Jt("events"),this.client=Jt("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,r){if(this.chainId=e,!this.httpProviders[e]){const n=r||cn(`${this.name}:${e}`,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,n)}this.events.emit(pi.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;e[r]=this.createHttpProvider(r,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||cn(e,this.namespace,this.client.core.projectId);return typeof n>"u"?void 0:new fi(new Vi(n,Jt("disableProviderPing")))}}class F7{constructor(e){this.name="cip34",this.namespace=e.namespace,this.events=Jt("events"),this.client=Jt("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,r){if(this.chainId=e,!this.httpProviders[e]){const n=r||this.getCardanoRPCUrl(e);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,n)}this.events.emit(pi.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{const n=this.getCardanoRPCUrl(r);e[r]=this.createHttpProvider(r,n)}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}getCardanoRPCUrl(e){const r=this.namespace.rpcMap;if(r)return r[e]}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||this.getCardanoRPCUrl(e);return typeof n>"u"?void 0:new fi(new Vi(n,Jt("disableProviderPing")))}}class B7{constructor(e){this.name="elrond",this.namespace=e.namespace,this.events=Jt("events"),this.client=Jt("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,r){if(!this.httpProviders[e]){const n=r||cn(`${this.name}:${e}`,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,n)}this.chainId=e,this.events.emit(pi.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}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(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;e[r]=this.createHttpProvider(r,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||cn(e,this.namespace,this.client.core.projectId);return typeof n>"u"?void 0:new fi(new Vi(n,Jt("disableProviderPing")))}}class k7{constructor(e){this.name="multiversx",this.namespace=e.namespace,this.events=Jt("events"),this.client=Jt("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,r){if(!this.httpProviders[e]){const n=r||cn(`${this.name}:${e}`,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,n)}this.chainId=e,this.events.emit(pi.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}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(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;e[r]=this.createHttpProvider(r,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||cn(e,this.namespace,this.client.core.projectId);return typeof n>"u"?void 0:new fi(new Vi(n,Jt("disableProviderPing")))}}var H7=Object.defineProperty,z7=Object.defineProperties,W7=Object.getOwnPropertyDescriptors,$g=Object.getOwnPropertySymbols,q7=Object.prototype.hasOwnProperty,V7=Object.prototype.propertyIsEnumerable,Pg=(t,e,r)=>e in t?H7(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,lc=(t,e)=>{for(var r in e||(e={}))q7.call(e,r)&&Pg(t,r,e[r]);if($g)for(var r of $g(e))V7.call(e,r)&&Pg(t,r,e[r]);return t},Eh=(t,e)=>z7(t,W7(e));class xh{constructor(e){this.events=new br.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:pt.pino(pt.getDefaultLoggerOptions({level:e?.logger||xg})),this.disableProviderPing=e?.disableProviderPing||!1}static async init(e){const r=new xh(e);return await r.initialize(),r}async request(e,r){const[n,i]=this.validateChain(r);if(!this.session)throw new Error("Please call connect() before request()");return await this.getProvider(n).request({request:lc({},e),chainId:`${n}:${i}`,topic:this.session.topic})}sendAsync(e,r,n){this.request(e,n).then(i=>r(null,i)).catch(i=>r(i,void 0))}async enable(){if(!this.client)throw new Error("Sign Client not initialized");return this.session||await this.connect({namespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties}),await this.requestAccounts()}async disconnect(){var e;if(!this.session)throw new Error("Please call connect() before enable()");await this.client.disconnect({topic:(e=this.session)==null?void 0:e.topic,reason:Yt("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,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}removeListener(e,r){this.events.removeListener(e,r)}off(e,r){this.events.off(e,r)}get isWalletConnect(){return!0}async pair(e){this.shouldAbortPairingAttempt=!1;let r=0;do{if(this.shouldAbortPairingAttempt)throw new Error("Pairing aborted");if(r>=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(o=>{this.session=o,this.namespaces||(this.namespaces=R7(o.namespaces),this.persist("namespaces",this.namespaces))}).catch(o=>{if(o.message!==wg)throw o;r++})}while(!this.session);return this.onConnect(),this.session}setDefaultChain(e,r){try{if(!this.session)return;const[n,i]=this.validateChain(e);this.getProvider(n).setDefaultChain(i,r)}catch(n){if(!/Please call connect/.test(n.message))throw n}}async cleanupPendingPairings(e={}){this.logger.info("Cleaning up inactive pairings...");const r=this.client.pairing.getAll();if(Pn(r)){for(const n of r)e.deletePairings?this.client.core.expirer.set(n.topic,0):await this.client.core.relayer.subscriber.unsubscribe(n.topic);this.logger.info(`Inactive pairings cleared: ${r.length}`)}}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 wh.init({logger:this.providerOpts.logger||xg,relayUrl:this.providerOpts.relayUrl||_7,projectId:this.providerOpts.projectId,metadata:this.providerOpts.metadata,storageOptions:this.providerOpts.storageOptions,name:this.providerOpts.name}),this.logger.trace("SignClient Initialized")}createProviders(){if(!this.client)throw new Error("Sign Client not initialized");if(!this.session)throw new Error("Session not initialized. Please call connect() before enable()");const e=[...new Set(Object.keys(this.session.namespaces).map(r=>Ya(r)))];_h("client",this.client),_h("events",this.events),_h("disableProviderPing",this.disableProviderPing),e.forEach(r=>{if(!this.session)return;const n=P7(r,this.session),i=Ag(n),o=T7(this.namespaces,this.optionalNamespaces),c=Eh(lc({},o[r]),{accounts:n,chains:i});switch(r){case"eip155":this.rpcProviders[r]=new M7({namespace:c});break;case"solana":this.rpcProviders[r]=new U7({namespace:c});break;case"cosmos":this.rpcProviders[r]=new j7({namespace:c});break;case"polkadot":this.rpcProviders[r]=new L7({namespace:c});break;case"cip34":this.rpcProviders[r]=new F7({namespace:c});break;case"elrond":this.rpcProviders[r]=new B7({namespace:c});break;case"multiversx":this.rpcProviders[r]=new k7({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:r}=e,{event:n}=r;if(n.name==="accountsChanged"){const i=n.data;i&&Pn(i)&&this.events.emit("accountsChanged",i.map(N7))}else n.name==="chainChanged"?this.onChainChanged(r.chainId):this.events.emit(n.name,n.data);this.events.emit("session_event",e)}),this.client.on("session_update",({topic:e,params:r})=>{var n;const{namespaces:i}=r,o=(n=this.client)==null?void 0:n.session.get(e);this.session=Eh(lc({},o),{namespaces:i}),this.onSessionUpdate(),this.events.emit("session_update",{topic:e,params:r})}),this.client.on("session_delete",async e=>{await this.cleanup(),this.events.emit("session_delete",e),this.events.emit("disconnect",Eh(lc({},Yt("USER_DISCONNECTED")),{data:e.topic}))}),this.on(pi.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 r;this.getProvider(e).updateNamespace((r=this.session)==null?void 0:r.namespaces[e])})}setNamespaces(e){const{namespaces:r,optionalNamespaces:n,sessionProperties:i}=e;r&&Object.keys(r).length&&(this.namespaces=r),n&&Object.keys(n).length&&(this.optionalNamespaces=n),this.sessionProperties=i,this.persist("namespaces",r),this.persist("optionalNamespaces",n)}validateChain(e){const[r,n]=e?.split(":")||["",""];if(!this.namespaces||!Object.keys(this.namespaces).length)return[r,n];if(r&&!Object.keys(this.namespaces||{}).map(c=>Ya(c)).includes(r))throw new Error(`Namespace '${r}' is not configured. Please call connect() first with namespace config.`);if(r&&n)return[r,n];const i=Ya(Object.keys(this.namespaces)[0]),o=this.rpcProviders[i].getDefaultChain();return[i,o]}async requestAccounts(){const[e]=this.validateChain();return await this.getProvider(e).requestAccounts()}onChainChanged(e,r=!1){var n;if(!this.namespaces)return;const[i,o]=this.validateChain(e);r||this.getProvider(i).setDefaultChain(o),((n=this.namespaces[i])!=null?n:this.namespaces[`${i}:${o}`]).defaultChain=o,this.persist("namespaces",this.namespaces),this.events.emit("chainChanged",o)}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,r){this.client.core.storage.setItem(`${Cg}/${e}`,r)}async getFromStore(e){return await this.client.core.storage.getItem(`${Cg}/${e}`)}}const K7=xh,G7="wc",Z7="ethereum_provider",Y7=`${G7}@2:${Z7}:`,J7="https://rpc.walletconnect.com/v1/",uc=["eth_sendTransaction","personal_sign"],Tg=["eth_accounts","eth_requestAccounts","eth_sendRawTransaction","eth_sign","eth_signTransaction","eth_signTypedData","eth_signTypedData_v3","eth_signTypedData_v4","wallet_switchEthereumChain","wallet_addEthereumChain","wallet_getPermissions","wallet_requestPermissions","wallet_registerOnboarding","wallet_watchAsset","wallet_scanQRCode"],hc=["chainChanged","accountsChanged"],Ng=["message","disconnect","connect"];var X7=Object.defineProperty,Q7=Object.defineProperties,ex=Object.getOwnPropertyDescriptors,Rg=Object.getOwnPropertySymbols,tx=Object.prototype.hasOwnProperty,rx=Object.prototype.propertyIsEnumerable,Lg=(t,e,r)=>e in t?X7(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,qo=(t,e)=>{for(var r in e||(e={}))tx.call(e,r)&&Lg(t,r,e[r]);if(Rg)for(var r of Rg(e))rx.call(e,r)&&Lg(t,r,e[r]);return t},Mg=(t,e)=>Q7(t,ex(e));function fc(t){return Number(t[0].split(":")[1])}function Ch(t){return`0x${t.toString(16)}`}function nx(t){const{chains:e,optionalChains:r,methods:n,optionalMethods:i,events:o,optionalEvents:c,rpcMap:l}=t;if(!Pn(e))throw new Error("Invalid chains");const h={chains:e,methods:n||uc,events:o||hc,rpcMap:qo({},e.length?{[fc(e)]:l[fc(e)]}:{})},f=o?.filter(S=>!hc.includes(S)),v=n?.filter(S=>!uc.includes(S));if(!r&&!c&&!i&&!(f!=null&&f.length)&&!(v!=null&&v.length))return{required:e.length?h:void 0};const E=f?.length&&v?.length||!r,_={chains:[...new Set(E?h.chains.concat(r||[]):r)],methods:[...new Set(h.methods.concat(i!=null&&i.length?i:Tg))],events:[...new Set(h.events.concat(c||Ng))],rpcMap:l};return{required:e.length?h:void 0,optional:r.length?_:void 0}}class dc{constructor(){this.events=new br.exports.EventEmitter,this.namespace="eip155",this.accounts=[],this.chainId=1,this.STORAGE_KEY=Y7,this.on=(e,r)=>(this.events.on(e,r),this),this.once=(e,r)=>(this.events.once(e,r),this),this.removeListener=(e,r)=>(this.events.removeListener(e,r),this),this.off=(e,r)=>(this.events.off(e,r),this),this.parseAccount=e=>this.isCompatibleChainId(e)?this.parseAccountId(e).address:e,this.signer={},this.rpc={}}static async init(e){const r=new dc;return await r.initialize(e),r}async request(e){return await this.signer.request(e,this.formatChainId(this.chainId))}sendAsync(e,r){this.signer.sendAsync(e,r,this.formatChainId(this.chainId))}get connected(){return this.signer.client?this.signer.client.core.relayer.connected:!1}get connecting(){return this.signer.client?this.signer.client.core.relayer.connecting:!1}async enable(){return this.session||await this.connect(),await this.request({method:"eth_requestAccounts"})}async connect(e){if(!this.signer.client)throw new Error("Provider not initialized. Call init() first");this.loadConnectOpts(e);const{required:r,optional:n}=nx(this.rpc);try{const i=await new Promise(async(c,l)=>{var h;this.rpc.showQrModal&&((h=this.modal)==null||h.subscribeModal(f=>{!f.open&&!this.signer.session&&(this.signer.abortPairingAttempt(),l(new Error("Connection request reset. Please try again.")))})),await this.signer.connect(Mg(qo({namespaces:qo({},r&&{[this.namespace]:r})},n&&{optionalNamespaces:{[this.namespace]:n}}),{pairingTopic:e?.pairingTopic})).then(f=>{c(f)}).catch(f=>{l(new Error(f.message))})});if(!i)return;this.setChainIds(this.rpc.chains);const o=B5(i.namespaces,[this.namespace]);this.setAccounts(o),this.events.emit("connect",{chainId:Ch(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:r}=e,{event:n}=r;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 r=parseInt(e);this.chainId=r,this.events.emit("chainChanged",Ch(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",Mg(qo({},Yt("USER_DISCONNECTED")),{data:e.topic,name:"USER_DISCONNECTED"}))}),this.signer.on("display_uri",e=>{var r,n;this.rpc.showQrModal&&((r=this.modal)==null||r.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 r=e.filter(n=>this.isCompatibleChainId(n)).map(n=>this.parseChainId(n));r.length&&(this.chainId=r[0],this.events.emit("chainChanged",Ch(this.chainId)),this.persist())}setChainId(e){if(this.isCompatibleChainId(e)){const r=this.parseChainId(e);this.chainId=r,this.switchEthereumChain(r)}}parseAccountId(e){const[r,n,i]=e.split(":");return{chainId:`${r}:${n}`,address:i}}setAccounts(e){this.accounts=e.filter(r=>this.parseChainId(this.parseAccountId(r).chainId)===this.chainId).map(r=>this.parseAccountId(r).address),this.events.emit("accountsChanged",this.accounts)}getRpcConfig(e){var r,n;const i=(r=e?.chains)!=null?r:[],o=(n=e?.optionalChains)!=null?n:[],c=i.concat(o);if(!c.length)throw new Error("No chains specified in either `chains` or `optionalChains`");const l=i.length?e?.methods||uc:[],h=i.length?e?.events||hc:[],f=e?.optionalMethods||[],v=e?.optionalEvents||[],E=e?.rpcMap||this.buildRpcMap(c,e.projectId),_=e?.qrModalOptions||void 0;return{chains:i?.map(S=>this.formatChainId(S)),optionalChains:o.map(S=>this.formatChainId(S)),methods:l,events:h,optionalMethods:f,optionalEvents:v,rpcMap:E,showQrModal:!!(e!=null&&e.showQrModal),qrModalOptions:_,projectId:e.projectId,metadata:e.metadata}}buildRpcMap(e,r){const n={};return e.forEach(i=>{n[i]=this.getRpcUrl(i,r)}),n}async initialize(e){if(this.rpc=this.getRpcConfig(e),this.chainId=this.rpc.chains.length?fc(this.rpc.chains):fc(this.rpc.optionalChains),this.signer=await K7.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 r;try{const{WalletConnectModal:n}=await Promise.resolve().then(function(){return Rx});r=n}catch{throw new Error("To use QR modal, please install @walletconnect/modal package")}if(r)try{this.modal=new r(qo({walletConnectVersion:2,projectId:this.rpc.projectId,standaloneChains:this.rpc.chains},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:r,optionalChains:n,rpcMap:i}=e;r&&Pn(r)&&(this.rpc.chains=r.map(o=>this.formatChainId(o)),r.forEach(o=>{this.rpc.rpcMap[o]=i?.[o]||this.getRpcUrl(o)})),n&&Pn(n)&&(this.rpc.optionalChains=[],this.rpc.optionalChains=n?.map(o=>this.formatChainId(o)),n.forEach(o=>{this.rpc.rpcMap[o]=i?.[o]||this.getRpcUrl(o)}))}getRpcUrl(e,r){var n;return((n=this.rpc.rpcMap)==null?void 0:n[e])||`${J7}?chainId=eip155:${e}&projectId=${r||this.rpc.projectId}`}async loadPersistedSession(){if(!this.session)return;const e=await this.signer.client.core.storage.getItem(`${this.STORAGE_KEY}/chainId`),r=this.session.namespaces[`${this.namespace}:${e}`]?this.session.namespaces[`${this.namespace}:${e}`]:this.session.namespaces[this.namespace];this.setChainIds(e?[this.formatChainId(e)]:r?.accounts),this.setAccounts(r?.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(r=>this.parseAccount(r))}}const ix=dc,sx=Symbol(),Ug=Object.getPrototypeOf,Ih=new WeakMap,ox=t=>t&&(Ih.has(t)?Ih.get(t):Ug(t)===Object.prototype||Ug(t)===Array.prototype),ax=t=>ox(t)&&t[sx]||null,jg=(t,e=!0)=>{Ih.set(t,e)},Sh=t=>typeof t=="object"&&t!==null,gi=new WeakMap,pc=new WeakSet,cx=(t=Object.is,e=(f,v)=>new Proxy(f,v),r=f=>Sh(f)&&!pc.has(f)&&(Array.isArray(f)||!(Symbol.iterator in f))&&!(f instanceof WeakMap)&&!(f instanceof WeakSet)&&!(f instanceof Error)&&!(f instanceof Number)&&!(f instanceof Date)&&!(f instanceof String)&&!(f instanceof RegExp)&&!(f instanceof ArrayBuffer),n=f=>{switch(f.status){case"fulfilled":return f.value;case"rejected":throw f.reason;default:throw f}},i=new WeakMap,o=(f,v,E=n)=>{const _=i.get(f);if(_?.[0]===v)return _[1];const S=Array.isArray(f)?[]:Object.create(Object.getPrototypeOf(f));return jg(S,!0),i.set(f,[v,S]),Reflect.ownKeys(f).forEach(P=>{if(Object.getOwnPropertyDescriptor(S,P))return;const j=Reflect.get(f,P),H={value:j,enumerable:!0,configurable:!0};if(pc.has(j))jg(j,!1);else if(j instanceof Promise)delete H.value,H.get=()=>E(j);else if(gi.has(j)){const[Z,R]=gi.get(j);H.value=o(Z,R(),E)}Object.defineProperty(S,P,H)}),S},c=new WeakMap,l=[1,1],h=f=>{if(!Sh(f))throw new Error("object required");const v=c.get(f);if(v)return v;let E=l[0];const _=new Set,S=(J,z=++l[0])=>{E!==z&&(E=z,_.forEach(ee=>ee(J,z)))};let P=l[1];const j=(J=++l[1])=>(P!==J&&!_.size&&(P=J,Z.forEach(([z])=>{const ee=z[1](J);ee>E&&(E=ee)})),E),H=J=>(z,ee)=>{const de=[...z];de[1]=[J,...de[1]],S(de,ee)},Z=new Map,R=(J,z)=>{if(Z.has(J))throw new Error("prop listener already exists");if(_.size){const ee=z[3](H(J));Z.set(J,[z,ee])}else Z.set(J,[z])},L=J=>{var z;const ee=Z.get(J);ee&&(Z.delete(J),(z=ee[1])==null||z.call(ee))},$=J=>(_.add(J),_.size===1&&Z.forEach(([ee,de],me)=>{if(de)throw new Error("remove already exists");const A=ee[3](H(me));Z.set(me,[ee,A])}),()=>{_.delete(J),_.size===0&&Z.forEach(([ee,de],me)=>{de&&(de(),Z.set(me,[ee]))})}),T=Array.isArray(f)?[]:Object.create(Object.getPrototypeOf(f)),d=e(T,{deleteProperty(J,z){const ee=Reflect.get(J,z);L(z);const de=Reflect.deleteProperty(J,z);return de&&S(["delete",[z],ee]),de},set(J,z,ee,de){const me=Reflect.has(J,z),A=Reflect.get(J,z,de);if(me&&(t(A,ee)||c.has(ee)&&t(A,c.get(ee))))return!0;L(z),Sh(ee)&&(ee=ax(ee)||ee);let U=ee;if(ee instanceof Promise)ee.then(ce=>{ee.status="fulfilled",ee.value=ce,S(["resolve",[z],ce])}).catch(ce=>{ee.status="rejected",ee.reason=ce,S(["reject",[z],ce])});else{!gi.has(ee)&&r(ee)&&(U=h(ee));const ce=!pc.has(U)&&gi.get(U);ce&&R(z,ce)}return Reflect.set(J,z,U,de),S(["set",[z],ee,A]),!0}});c.set(f,d);const x=[T,j,o,$];return gi.set(d,x),Reflect.ownKeys(f).forEach(J=>{const z=Object.getOwnPropertyDescriptor(f,J);"value"in z&&(d[J]=f[J],delete z.value,delete z.writable),Object.defineProperty(T,J,z)}),d})=>[h,gi,pc,t,e,r,n,i,o,c,l],[lx]=cx();function Rn(t={}){return lx(t)}function Kn(t,e,r){const n=gi.get(t);n||console.warn("Please use proxy object");let i;const o=[],c=n[3];let l=!1;const f=c(v=>{if(o.push(v),r){e(o.splice(0));return}i||(i=Promise.resolve().then(()=>{i=void 0,l&&e(o.splice(0))}))});return l=!0,()=>{l=!1,f()}}function ux(t,e){const r=gi.get(t);r||console.warn("Please use proxy object");const[n,i,o]=r;return o(n,i(),e)}var Fg={},gc={};gc.byteLength=dx,gc.toByteArray=gx,gc.fromByteArray=vx;for(var Ln=[],ln=[],hx=typeof Uint8Array<"u"?Uint8Array:Array,Ah="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Ts=0,fx=Ah.length;Ts<fx;++Ts)Ln[Ts]=Ah[Ts],ln[Ah.charCodeAt(Ts)]=Ts;ln["-".charCodeAt(0)]=62,ln["_".charCodeAt(0)]=63;function Bg(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");r===-1&&(r=e);var n=r===e?0:4-r%4;return[r,n]}function dx(t){var e=Bg(t),r=e[0],n=e[1];return(r+n)*3/4-n}function px(t,e,r){return(e+r)*3/4-r}function gx(t){var e,r=Bg(t),n=r[0],i=r[1],o=new hx(px(t,n,i)),c=0,l=i>0?n-4:n,h;for(h=0;h<l;h+=4)e=ln[t.charCodeAt(h)]<<18|ln[t.charCodeAt(h+1)]<<12|ln[t.charCodeAt(h+2)]<<6|ln[t.charCodeAt(h+3)],o[c++]=e>>16&255,o[c++]=e>>8&255,o[c++]=e&255;return i===2&&(e=ln[t.charCodeAt(h)]<<2|ln[t.charCodeAt(h+1)]>>4,o[c++]=e&255),i===1&&(e=ln[t.charCodeAt(h)]<<10|ln[t.charCodeAt(h+1)]<<4|ln[t.charCodeAt(h+2)]>>2,o[c++]=e>>8&255,o[c++]=e&255),o}function mx(t){return Ln[t>>18&63]+Ln[t>>12&63]+Ln[t>>6&63]+Ln[t&63]}function wx(t,e,r){for(var n,i=[],o=e;o<r;o+=3)n=(t[o]<<16&16711680)+(t[o+1]<<8&65280)+(t[o+2]&255),i.push(mx(n));return i.join("")}function vx(t){for(var e,r=t.length,n=r%3,i=[],o=16383,c=0,l=r-n;c<l;c+=o)i.push(wx(t,c,c+o>l?l:c+o));return n===1?(e=t[r-1],i.push(Ln[e>>2]+Ln[e<<4&63]+"==")):n===2&&(e=(t[r-2]<<8)+t[r-1],i.push(Ln[e>>10]+Ln[e>>4&63]+Ln[e<<2&63]+"=")),i.join("")}var Oh={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */Oh.read=function(t,e,r,n,i){var o,c,l=i*8-n-1,h=(1<<l)-1,f=h>>1,v=-7,E=r?i-1:0,_=r?-1:1,S=t[e+E];for(E+=_,o=S&(1<<-v)-1,S>>=-v,v+=l;v>0;o=o*256+t[e+E],E+=_,v-=8);for(c=o&(1<<-v)-1,o>>=-v,v+=n;v>0;c=c*256+t[e+E],E+=_,v-=8);if(o===0)o=1-f;else{if(o===h)return c?NaN:(S?-1:1)*(1/0);c=c+Math.pow(2,n),o=o-f}return(S?-1:1)*c*Math.pow(2,o-n)},Oh.write=function(t,e,r,n,i,o){var c,l,h,f=o*8-i-1,v=(1<<f)-1,E=v>>1,_=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,S=n?0:o-1,P=n?1:-1,j=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(l=isNaN(e)?1:0,c=v):(c=Math.floor(Math.log(e)/Math.LN2),e*(h=Math.pow(2,-c))<1&&(c--,h*=2),c+E>=1?e+=_/h:e+=_*Math.pow(2,1-E),e*h>=2&&(c++,h/=2),c+E>=v?(l=0,c=v):c+E>=1?(l=(e*h-1)*Math.pow(2,i),c=c+E):(l=e*Math.pow(2,E-1)*Math.pow(2,i),c=0));i>=8;t[r+S]=l&255,S+=P,l/=256,i-=8);for(c=c<<i|l,f+=i;f>0;t[r+S]=c&255,S+=P,c/=256,f-=8);t[r+S-P]|=j*128};/*!
98
+ }`;var ot=ov(function(){return vt(S,Te+"return "+pe).apply(r,M)});if(ot.source=pe,pd(ot))throw ot;return ot}function uL(s){return yt(s).toLowerCase()}function hL(s){return yt(s).toUpperCase()}function fL(s,a,u){if(s=yt(s),s&&(u||a===r))return g2(s);if(!s||!(a=tn(a)))return s;var g=On(s),y=On(a),S=m2(g,y),M=w2(g,y)+1;return Li(g,S,M).join("")}function dL(s,a,u){if(s=yt(s),s&&(u||a===r))return s.slice(0,y2(s)+1);if(!s||!(a=tn(a)))return s;var g=On(s),y=w2(g,On(a))+1;return Li(g,0,y).join("")}function pL(s,a,u){if(s=yt(s),s&&(u||a===r))return s.replace(Gt,"");if(!s||!(a=tn(a)))return s;var g=On(s),y=m2(g,On(a));return Li(g,y).join("")}function gL(s,a){var u=z,g=ee;if(kt(a)){var y="separator"in a?a.separator:y;u="length"in a?it(a.length):u,g="omission"in a?tn(a.omission):g}s=yt(s);var S=s.length;if(uo(s)){var M=On(s);S=M.length}if(u>=S)return s;var H=u-ho(g);if(H<1)return g;var Y=M?Li(M,0,H).join(""):s.slice(0,H);if(y===r)return Y+g;if(M&&(H+=Y.length-H),gd(y)){if(s.slice(H).search(y)){var ue,he=Y;for(y.global||(y=P0(y.source,yt(pn.exec(y))+"g")),y.lastIndex=0;ue=y.exec(he);)var pe=ue.index;Y=Y.slice(0,pe===r?H:pe)}}else if(s.indexOf(tn(y),H)!=H){var be=Y.lastIndexOf(y);be>-1&&(Y=Y.slice(0,be))}return Y+g}function mL(s){return s=yt(s),s&&Wt.test(s)?s.replace($i,qD):s}var wL=yo(function(s,a,u){return s+(u?" ":"")+a.toUpperCase()}),vd=aw("toUpperCase");function sv(s,a,u){return s=yt(s),a=u?r:a,a===r?BD(s)?GD(s):PD(s):s.match(a)||[]}var ov=ct(function(s,a){try{return yr(s,r,a)}catch(u){return pd(u)?u:new Ye(u)}}),vL=oi(function(s,a){return mn(a,function(u){u=qn(u),ii(s,u,fd(s[u],s))}),s});function yL(s){var a=s==null?0:s.length,u=ze();return s=a?Ut(s,function(g){if(typeof g[1]!="function")throw new wn(c);return[u(g[0]),g[1]]}):[],ct(function(g){for(var y=-1;++y<a;){var S=s[y];if(yr(S[0],this,g))return yr(S[1],this,g)}})}function bL(s){return qP(yn(s,x))}function yd(s){return function(){return s}}function _L(s,a){return s==null||s!==s?a:s}var EL=lw(),xL=lw(!0);function Zr(s){return s}function bd(s){return j2(typeof s=="function"?s:yn(s,x))}function CL(s){return k2(yn(s,x))}function IL(s,a){return H2(s,yn(a,x))}var AL=ct(function(s,a){return function(u){return La(u,s,a)}}),$L=ct(function(s,a){return function(u){return La(s,u,a)}});function _d(s,a,u){var g=br(a),y=Wl(a,g);u==null&&!(kt(a)&&(y.length||!g.length))&&(u=a,a=s,s=this,y=Wl(a,br(a)));var S=!(kt(u)&&"chain"in u)||!!u.chain,M=ci(s);return mn(y,function(H){var Y=a[H];s[H]=Y,M&&(s.prototype[H]=function(){var ue=this.__chain__;if(S||ue){var he=s(this.__wrapped__),pe=he.__actions__=Vr(this.__actions__);return pe.push({func:Y,args:arguments,thisArg:s}),he.__chain__=ue,he}return Y.apply(s,Di([this.value()],arguments))})}),s}function OL(){return mt._===this&&(mt._=eP),this}function Ed(){}function SL(s){return s=it(s),ct(function(a){return z2(a,s)})}var DL=Q0(Ut),PL=Q0(u2),TL=Q0(C0);function av(s){return od(s)?I0(qn(s)):cT(s)}function RL(s){return function(a){return s==null?r:bs(s,a)}}var NL=hw(),FL=hw(!0);function xd(){return[]}function Cd(){return!1}function LL(){return{}}function ML(){return""}function UL(){return!0}function jL(s,a){if(s=it(s),s<1||s>re)return[];var u=ie,g=Sr(s,ie);a=ze(a),s-=ie;for(var y=O0(g,a);++u<s;)a(u);return y}function BL(s){return Qe(s)?Ut(s,qn):rn(s)?[s]:Vr($w(yt(s)))}function kL(s){var a=++XD;return yt(s)+a}var HL=Yl(function(s,a){return s+a},0),zL=ed("ceil"),WL=Yl(function(s,a){return s/a},1),qL=ed("floor");function VL(s){return s&&s.length?zl(s,Zr,j0):r}function KL(s,a){return s&&s.length?zl(s,ze(a,2),j0):r}function GL(s){return d2(s,Zr)}function ZL(s,a){return d2(s,ze(a,2))}function YL(s){return s&&s.length?zl(s,Zr,z0):r}function JL(s,a){return s&&s.length?zl(s,ze(a,2),z0):r}var XL=Yl(function(s,a){return s*a},1),QL=ed("round"),eM=Yl(function(s,a){return s-a},0);function tM(s){return s&&s.length?$0(s,Zr):0}function rM(s,a){return s&&s.length?$0(s,ze(a,2)):0}return I.after=CN,I.ary=Uw,I.assign=hF,I.assignIn=Xw,I.assignInWith=lu,I.assignWith=fF,I.at=dF,I.before=jw,I.bind=fd,I.bindAll=vL,I.bindKey=Bw,I.castArray=LN,I.chain=Fw,I.chunk=qT,I.compact=VT,I.concat=KT,I.cond=yL,I.conforms=bL,I.constant=yd,I.countBy=tN,I.create=pF,I.curry=kw,I.curryRight=Hw,I.debounce=zw,I.defaults=gF,I.defaultsDeep=mF,I.defer=IN,I.delay=AN,I.difference=GT,I.differenceBy=ZT,I.differenceWith=YT,I.drop=JT,I.dropRight=XT,I.dropRightWhile=QT,I.dropWhile=eR,I.fill=tR,I.filter=nN,I.flatMap=oN,I.flatMapDeep=aN,I.flatMapDepth=cN,I.flatten=Pw,I.flattenDeep=rR,I.flattenDepth=nR,I.flip=$N,I.flow=EL,I.flowRight=xL,I.fromPairs=iR,I.functions=xF,I.functionsIn=CF,I.groupBy=lN,I.initial=oR,I.intersection=aR,I.intersectionBy=cR,I.intersectionWith=lR,I.invert=AF,I.invertBy=$F,I.invokeMap=hN,I.iteratee=bd,I.keyBy=fN,I.keys=br,I.keysIn=Gr,I.map=nu,I.mapKeys=SF,I.mapValues=DF,I.matches=CL,I.matchesProperty=IL,I.memoize=su,I.merge=PF,I.mergeWith=Qw,I.method=AL,I.methodOf=$L,I.mixin=_d,I.negate=ou,I.nthArg=SL,I.omit=TF,I.omitBy=RF,I.once=ON,I.orderBy=dN,I.over=DL,I.overArgs=SN,I.overEvery=PL,I.overSome=TL,I.partial=dd,I.partialRight=Ww,I.partition=pN,I.pick=NF,I.pickBy=ev,I.property=av,I.propertyOf=RL,I.pull=dR,I.pullAll=Rw,I.pullAllBy=pR,I.pullAllWith=gR,I.pullAt=mR,I.range=NL,I.rangeRight=FL,I.rearg=DN,I.reject=wN,I.remove=wR,I.rest=PN,I.reverse=ud,I.sampleSize=yN,I.set=LF,I.setWith=MF,I.shuffle=bN,I.slice=vR,I.sortBy=xN,I.sortedUniq=IR,I.sortedUniqBy=AR,I.split=oL,I.spread=TN,I.tail=$R,I.take=OR,I.takeRight=SR,I.takeRightWhile=DR,I.takeWhile=PR,I.tap=VR,I.throttle=RN,I.thru=ru,I.toArray=Zw,I.toPairs=tv,I.toPairsIn=rv,I.toPath=BL,I.toPlainObject=Jw,I.transform=UF,I.unary=NN,I.union=TR,I.unionBy=RR,I.unionWith=NR,I.uniq=FR,I.uniqBy=LR,I.uniqWith=MR,I.unset=jF,I.unzip=hd,I.unzipWith=Nw,I.update=BF,I.updateWith=kF,I.values=Eo,I.valuesIn=HF,I.without=UR,I.words=sv,I.wrap=FN,I.xor=jR,I.xorBy=BR,I.xorWith=kR,I.zip=HR,I.zipObject=zR,I.zipObjectDeep=WR,I.zipWith=qR,I.entries=tv,I.entriesIn=rv,I.extend=Xw,I.extendWith=lu,_d(I,I),I.add=HL,I.attempt=ov,I.camelCase=VF,I.capitalize=nv,I.ceil=zL,I.clamp=zF,I.clone=MN,I.cloneDeep=jN,I.cloneDeepWith=BN,I.cloneWith=UN,I.conformsTo=kN,I.deburr=iv,I.defaultTo=_L,I.divide=WL,I.endsWith=KF,I.eq=Dn,I.escape=GF,I.escapeRegExp=ZF,I.every=rN,I.find=iN,I.findIndex=Sw,I.findKey=wF,I.findLast=sN,I.findLastIndex=Dw,I.findLastKey=vF,I.floor=qL,I.forEach=Lw,I.forEachRight=Mw,I.forIn=yF,I.forInRight=bF,I.forOwn=_F,I.forOwnRight=EF,I.get=md,I.gt=HN,I.gte=zN,I.has=IF,I.hasIn=wd,I.head=Tw,I.identity=Zr,I.includes=uN,I.indexOf=sR,I.inRange=WF,I.invoke=OF,I.isArguments=xs,I.isArray=Qe,I.isArrayBuffer=WN,I.isArrayLike=Kr,I.isArrayLikeObject=tr,I.isBoolean=qN,I.isBuffer=Mi,I.isDate=VN,I.isElement=KN,I.isEmpty=GN,I.isEqual=ZN,I.isEqualWith=YN,I.isError=pd,I.isFinite=JN,I.isFunction=ci,I.isInteger=qw,I.isLength=au,I.isMap=Vw,I.isMatch=XN,I.isMatchWith=QN,I.isNaN=eF,I.isNative=tF,I.isNil=nF,I.isNull=rF,I.isNumber=Kw,I.isObject=kt,I.isObjectLike=Yt,I.isPlainObject=Ha,I.isRegExp=gd,I.isSafeInteger=iF,I.isSet=Gw,I.isString=cu,I.isSymbol=rn,I.isTypedArray=_o,I.isUndefined=sF,I.isWeakMap=oF,I.isWeakSet=aF,I.join=uR,I.kebabCase=YF,I.last=_n,I.lastIndexOf=hR,I.lowerCase=JF,I.lowerFirst=XF,I.lt=cF,I.lte=lF,I.max=VL,I.maxBy=KL,I.mean=GL,I.meanBy=ZL,I.min=YL,I.minBy=JL,I.stubArray=xd,I.stubFalse=Cd,I.stubObject=LL,I.stubString=ML,I.stubTrue=UL,I.multiply=XL,I.nth=fR,I.noConflict=OL,I.noop=Ed,I.now=iu,I.pad=QF,I.padEnd=eL,I.padStart=tL,I.parseInt=rL,I.random=qF,I.reduce=gN,I.reduceRight=mN,I.repeat=nL,I.replace=iL,I.result=FF,I.round=QL,I.runInContext=K,I.sample=vN,I.size=_N,I.snakeCase=sL,I.some=EN,I.sortedIndex=yR,I.sortedIndexBy=bR,I.sortedIndexOf=_R,I.sortedLastIndex=ER,I.sortedLastIndexBy=xR,I.sortedLastIndexOf=CR,I.startCase=aL,I.startsWith=cL,I.subtract=eM,I.sum=tM,I.sumBy=rM,I.template=lL,I.times=jL,I.toFinite=li,I.toInteger=it,I.toLength=Yw,I.toLower=uL,I.toNumber=En,I.toSafeInteger=uF,I.toString=yt,I.toUpper=hL,I.trim=fL,I.trimEnd=dL,I.trimStart=pL,I.truncate=gL,I.unescape=mL,I.uniqueId=kL,I.upperCase=wL,I.upperFirst=vd,I.each=Lw,I.eachRight=Mw,I.first=Tw,_d(I,function(){var s={};return zn(I,function(a,u){bt.call(I.prototype,u)||(s[u]=a)}),s}(),{chain:!1}),I.VERSION=n,mn(["bind","bindKey","curry","curryRight","partial","partialRight"],function(s){I[s].placeholder=I}),mn(["drop","take"],function(s,a){dt.prototype[s]=function(u){u=u===r?1:pr(it(u),0);var g=this.__filtered__&&!a?new dt(this):this.clone();return g.__filtered__?g.__takeCount__=Sr(u,g.__takeCount__):g.__views__.push({size:Sr(u,ie),type:s+(g.__dir__<0?"Right":"")}),g},dt.prototype[s+"Right"]=function(u){return this.reverse()[s](u).reverse()}}),mn(["filter","map","takeWhile"],function(s,a){var u=a+1,g=u==O||u==ce;dt.prototype[s]=function(y){var S=this.clone();return S.__iteratees__.push({iteratee:ze(y,3),type:u}),S.__filtered__=S.__filtered__||g,S}}),mn(["head","last"],function(s,a){var u="take"+(a?"Right":"");dt.prototype[s]=function(){return this[u](1).value()[0]}}),mn(["initial","tail"],function(s,a){var u="drop"+(a?"":"Right");dt.prototype[s]=function(){return this.__filtered__?new dt(this):this[u](1)}}),dt.prototype.compact=function(){return this.filter(Zr)},dt.prototype.find=function(s){return this.filter(s).head()},dt.prototype.findLast=function(s){return this.reverse().find(s)},dt.prototype.invokeMap=ct(function(s,a){return typeof s=="function"?new dt(this):this.map(function(u){return La(u,s,a)})}),dt.prototype.reject=function(s){return this.filter(ou(ze(s)))},dt.prototype.slice=function(s,a){s=it(s);var u=this;return u.__filtered__&&(s>0||a<0)?new dt(u):(s<0?u=u.takeRight(-s):s&&(u=u.drop(s)),a!==r&&(a=it(a),u=a<0?u.dropRight(-a):u.take(a-s)),u)},dt.prototype.takeRightWhile=function(s){return this.reverse().takeWhile(s).reverse()},dt.prototype.toArray=function(){return this.take(ie)},zn(dt.prototype,function(s,a){var u=/^(?:filter|find|map|reject)|While$/.test(a),g=/^(?:head|last)$/.test(a),y=I[g?"take"+(a=="last"?"Right":""):a],S=g||/^find/.test(a);y&&(I.prototype[a]=function(){var M=this.__wrapped__,H=g?[1]:arguments,Y=M instanceof dt,ue=H[0],he=Y||Qe(M),pe=function(ft){var wt=y.apply(I,Di([ft],H));return g&&be?wt[0]:wt};he&&u&&typeof ue=="function"&&ue.length!=1&&(Y=he=!1);var be=this.__chain__,Te=!!this.__actions__.length,We=S&&!be,ot=Y&&!Te;if(!S&&he){M=ot?M:new dt(this);var qe=s.apply(M,H);return qe.__actions__.push({func:ru,args:[pe],thisArg:r}),new vn(qe,be)}return We&&ot?s.apply(this,H):(qe=this.thru(pe),We?g?qe.value()[0]:qe.value():qe)})}),mn(["pop","push","shift","sort","splice","unshift"],function(s){var a=Ol[s],u=/^(?:push|sort|unshift)$/.test(s)?"tap":"thru",g=/^(?:pop|shift)$/.test(s);I.prototype[s]=function(){var y=arguments;if(g&&!this.__chain__){var S=this.value();return a.apply(Qe(S)?S:[],y)}return this[u](function(M){return a.apply(Qe(M)?M:[],y)})}}),zn(dt.prototype,function(s,a){var u=I[a];if(u){var g=u.name+"";bt.call(mo,g)||(mo[g]=[]),mo[g].push({name:a,func:u})}}),mo[Zl(r,q).name]=[{name:"wrapper",func:r}],dt.prototype.clone=mP,dt.prototype.reverse=wP,dt.prototype.value=vP,I.prototype.at=KR,I.prototype.chain=GR,I.prototype.commit=ZR,I.prototype.next=YR,I.prototype.plant=XR,I.prototype.reverse=QR,I.prototype.toJSON=I.prototype.valueOf=I.prototype.value=eN,I.prototype.first=I.prototype.head,Sa&&(I.prototype[Sa]=JR),I},fo=ZD();er?((er.exports=fo)._=fo,$t._=fo):mt._=fo}).call(Jo)})(Rh,Rh.exports);var k9=Object.defineProperty,H9=Object.defineProperties,z9=Object.getOwnPropertyDescriptors,g3=Object.getOwnPropertySymbols,W9=Object.prototype.hasOwnProperty,q9=Object.prototype.propertyIsEnumerable,m3=(t,e,r)=>e in t?k9(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,wc=(t,e)=>{for(var r in e||(e={}))W9.call(e,r)&&m3(t,r,e[r]);if(g3)for(var r of g3(e))q9.call(e,r)&&m3(t,r,e[r]);return t},V9=(t,e)=>H9(t,z9(e));function un(t,e,r){let n;const i=Nh(t);return e.rpcMap&&(n=e.rpcMap[i]),n||(n=`${B9}?chainId=eip155:${i}&projectId=${r}`),n}function Nh(t){return t.includes("eip155")?Number(t.split(":")[1]):Number(t)}function w3(t){return t.map(e=>`${e.split(":")[0]}:${e.split(":")[1]}`)}function K9(t,e){const r=Object.keys(e.namespaces).filter(i=>i.includes(t));if(!r.length)return[];const n=[];return r.forEach(i=>{const o=e.namespaces[i].accounts;n.push(...o)}),n}function G9(t={},e={}){const r=v3(t),n=v3(e);return Rh.exports.merge(r,n)}function v3(t){var e,r,n,i;const o={};if(!Ps(t))return o;for(const[c,l]of Object.entries(t)){const h=Hu(c)?[c]:l.chains,d=l.methods||[],v=l.events||[],x=l.rpcMap||{},_=nc(c);o[_]=V9(wc(wc({},o[_]),l),{chains:Bu(h,(e=o[_])==null?void 0:e.chains),methods:Bu(d,(r=o[_])==null?void 0:r.methods),events:Bu(v,(n=o[_])==null?void 0:n.events),rpcMap:wc(wc({},x),(i=o[_])==null?void 0:i.rpcMap)})}return o}function Z9(t){return t.includes(":")?t.split(":")[2]:t}function Y9(t){const e={};for(const[r,n]of Object.entries(t)){const i=n.methods||[],o=n.events||[],c=n.accounts||[],l=Hu(r)?[r]:n.chains?n.chains:w3(n.accounts);e[r]={chains:l,methods:i,events:o,accounts:c}}return e}const y3={},Xt=t=>y3[t],Fh=(t,e)=>{y3[t]=e};class J9{constructor(e){this.name="polkadot",this.namespace=e.namespace,this.events=Xt("events"),this.client=Xt("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,r){if(this.chainId=e,!this.httpProviders[e]){const n=r||un(`${this.name}:${e}`,this.namespace);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,n)}this.events.emit(gi.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e?e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2])||[]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;e[r]=this.createHttpProvider(r,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||un(e,this.namespace);return typeof n>"u"?void 0:new Gi(new Ki(n,Xt("disableProviderPing")))}}class X9{constructor(e){this.name="eip155",this.namespace=e.namespace,this.events=Xt("events"),this.client=Xt("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,r){const n=Nh(e);if(!this.httpProviders[n]){const i=r||un(`${this.name}:${n}`,this.namespace,this.client.core.projectId);if(!i)throw new Error(`No RPC url provided for chainId: ${n}`);this.setHttpProvider(n,i)}this.chainId=n,this.events.emit(gi.DEFAULT_CHAIN_CHANGED,`${this.name}:${n}`)}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,r){const n=r||un(`${this.name}:${e}`,this.namespace,this.client.core.projectId);return typeof n>"u"?void 0:new Gi(new Ki(n,Xt("disableProviderPing")))}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;const i=Nh(r);e[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}getHttpProvider(){const e=this.chainId,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}async handleSwitchChain(e){var r,n;let i=e.request.params?(r=e.request.params[0])==null?void 0:r.chainId:"0x0";i=i.startsWith("0x")?i:`0x${i}`;const o=parseInt(i,16);if(this.isChainApproved(o))this.setDefaultChain(`${o}`);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(`${o}`);else throw new Error(`Failed to switch to chain 'eip155:${o}'. 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 Q9{constructor(e){this.name="solana",this.namespace=e.namespace,this.events=Xt("events"),this.client=Xt("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,r){if(!this.httpProviders[e]){const n=r||un(`${this.name}:${e}`,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,n)}this.chainId=e,this.events.emit(gi.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}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(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;e[r]=this.createHttpProvider(r,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||un(e,this.namespace,this.client.core.projectId);return typeof n>"u"?void 0:new Gi(new Ki(n,Xt("disableProviderPing")))}}class eC{constructor(e){this.name="cosmos",this.namespace=e.namespace,this.events=Xt("events"),this.client=Xt("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,r){if(this.chainId=e,!this.httpProviders[e]){const n=r||un(`${this.name}:${e}`,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,n)}this.events.emit(gi.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;e[r]=this.createHttpProvider(r,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||un(e,this.namespace,this.client.core.projectId);return typeof n>"u"?void 0:new Gi(new Ki(n,Xt("disableProviderPing")))}}class tC{constructor(e){this.name="cip34",this.namespace=e.namespace,this.events=Xt("events"),this.client=Xt("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,r){if(this.chainId=e,!this.httpProviders[e]){const n=r||this.getCardanoRPCUrl(e);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,n)}this.events.emit(gi.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{const n=this.getCardanoRPCUrl(r);e[r]=this.createHttpProvider(r,n)}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}getCardanoRPCUrl(e){const r=this.namespace.rpcMap;if(r)return r[e]}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||this.getCardanoRPCUrl(e);return typeof n>"u"?void 0:new Gi(new Ki(n,Xt("disableProviderPing")))}}class rC{constructor(e){this.name="elrond",this.namespace=e.namespace,this.events=Xt("events"),this.client=Xt("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,r){if(!this.httpProviders[e]){const n=r||un(`${this.name}:${e}`,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,n)}this.chainId=e,this.events.emit(gi.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}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(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;e[r]=this.createHttpProvider(r,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||un(e,this.namespace,this.client.core.projectId);return typeof n>"u"?void 0:new Gi(new Ki(n,Xt("disableProviderPing")))}}class nC{constructor(e){this.name="multiversx",this.namespace=e.namespace,this.events=Xt("events"),this.client=Xt("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,r){if(!this.httpProviders[e]){const n=r||un(`${this.name}:${e}`,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,n)}this.chainId=e,this.events.emit(gi.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}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(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;e[r]=this.createHttpProvider(r,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||un(e,this.namespace,this.client.core.projectId);return typeof n>"u"?void 0:new Gi(new Ki(n,Xt("disableProviderPing")))}}var iC=Object.defineProperty,sC=Object.defineProperties,oC=Object.getOwnPropertyDescriptors,b3=Object.getOwnPropertySymbols,aC=Object.prototype.hasOwnProperty,cC=Object.prototype.propertyIsEnumerable,_3=(t,e,r)=>e in t?iC(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,vc=(t,e)=>{for(var r in e||(e={}))aC.call(e,r)&&_3(t,r,e[r]);if(b3)for(var r of b3(e))cC.call(e,r)&&_3(t,r,e[r]);return t},Lh=(t,e)=>sC(t,oC(e));class Mh{constructor(e){this.events=new _r.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:pt.pino(pt.getDefaultLoggerOptions({level:e?.logger||d3})),this.disableProviderPing=e?.disableProviderPing||!1}static async init(e){const r=new Mh(e);return await r.initialize(),r}async request(e,r){const[n,i]=this.validateChain(r);if(!this.session)throw new Error("Please call connect() before request()");return await this.getProvider(n).request({request:vc({},e),chainId:`${n}:${i}`,topic:this.session.topic})}sendAsync(e,r,n){this.request(e,n).then(i=>r(null,i)).catch(i=>r(i,void 0))}async enable(){if(!this.client)throw new Error("Sign Client not initialized");return this.session||await this.connect({namespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties}),await this.requestAccounts()}async disconnect(){var e;if(!this.session)throw new Error("Please call connect() before enable()");await this.client.disconnect({topic:(e=this.session)==null?void 0:e.topic,reason:Jt("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,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}removeListener(e,r){this.events.removeListener(e,r)}off(e,r){this.events.off(e,r)}get isWalletConnect(){return!0}async pair(e){this.shouldAbortPairingAttempt=!1;let r=0;do{if(this.shouldAbortPairingAttempt)throw new Error("Pairing aborted");if(r>=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(o=>{this.session=o,this.namespaces||(this.namespaces=Y9(o.namespaces),this.persist("namespaces",this.namespaces))}).catch(o=>{if(o.message!==a3)throw o;r++})}while(!this.session);return this.onConnect(),this.session}setDefaultChain(e,r){try{if(!this.session)return;const[n,i]=this.validateChain(e);this.getProvider(n).setDefaultChain(i,r)}catch(n){if(!/Please call connect/.test(n.message))throw n}}async cleanupPendingPairings(e={}){this.logger.info("Cleaning up inactive pairings...");const r=this.client.pairing.getAll();if(Rn(r)){for(const n of r)e.deletePairings?this.client.core.expirer.set(n.topic,0):await this.client.core.relayer.subscriber.unsubscribe(n.topic);this.logger.info(`Inactive pairings cleared: ${r.length}`)}}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 Ph.init({logger:this.providerOpts.logger||d3,relayUrl:this.providerOpts.relayUrl||M9,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(r=>nc(r)))];Fh("client",this.client),Fh("events",this.events),Fh("disableProviderPing",this.disableProviderPing),e.forEach(r=>{if(!this.session)return;const n=K9(r,this.session),i=w3(n),o=G9(this.namespaces,this.optionalNamespaces),c=Lh(vc({},o[r]),{accounts:n,chains:i});switch(r){case"eip155":this.rpcProviders[r]=new X9({namespace:c});break;case"solana":this.rpcProviders[r]=new Q9({namespace:c});break;case"cosmos":this.rpcProviders[r]=new eC({namespace:c});break;case"polkadot":this.rpcProviders[r]=new J9({namespace:c});break;case"cip34":this.rpcProviders[r]=new tC({namespace:c});break;case"elrond":this.rpcProviders[r]=new rC({namespace:c});break;case"multiversx":this.rpcProviders[r]=new nC({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:r}=e,{event:n}=r;if(n.name==="accountsChanged"){const i=n.data;i&&Rn(i)&&this.events.emit("accountsChanged",i.map(Z9))}else n.name==="chainChanged"?this.onChainChanged(r.chainId):this.events.emit(n.name,n.data);this.events.emit("session_event",e)}),this.client.on("session_update",({topic:e,params:r})=>{var n;const{namespaces:i}=r,o=(n=this.client)==null?void 0:n.session.get(e);this.session=Lh(vc({},o),{namespaces:i}),this.onSessionUpdate(),this.events.emit("session_update",{topic:e,params:r})}),this.client.on("session_delete",async e=>{await this.cleanup(),this.events.emit("session_delete",e),this.events.emit("disconnect",Lh(vc({},Jt("USER_DISCONNECTED")),{data:e.topic}))}),this.on(gi.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 r;this.getProvider(e).updateNamespace((r=this.session)==null?void 0:r.namespaces[e])})}setNamespaces(e){const{namespaces:r,optionalNamespaces:n,sessionProperties:i}=e;r&&Object.keys(r).length&&(this.namespaces=r),n&&Object.keys(n).length&&(this.optionalNamespaces=n),this.sessionProperties=i,this.persist("namespaces",r),this.persist("optionalNamespaces",n)}validateChain(e){const[r,n]=e?.split(":")||["",""];if(!this.namespaces||!Object.keys(this.namespaces).length)return[r,n];if(r&&!Object.keys(this.namespaces||{}).map(c=>nc(c)).includes(r))throw new Error(`Namespace '${r}' is not configured. Please call connect() first with namespace config.`);if(r&&n)return[r,n];const i=nc(Object.keys(this.namespaces)[0]),o=this.rpcProviders[i].getDefaultChain();return[i,o]}async requestAccounts(){const[e]=this.validateChain();return await this.getProvider(e).requestAccounts()}onChainChanged(e,r=!1){var n;if(!this.namespaces)return;const[i,o]=this.validateChain(e);r||this.getProvider(i).setDefaultChain(o),((n=this.namespaces[i])!=null?n:this.namespaces[`${i}:${o}`]).defaultChain=o,this.persist("namespaces",this.namespaces),this.events.emit("chainChanged",o)}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,r){this.client.core.storage.setItem(`${p3}/${e}`,r)}async getFromStore(e){return await this.client.core.storage.getItem(`${p3}/${e}`)}}const lC=Mh,uC="wc",hC="ethereum_provider",fC=`${uC}@2:${hC}:`,dC="https://rpc.walletconnect.com/v1/",yc=["eth_sendTransaction","personal_sign"],E3=["eth_accounts","eth_requestAccounts","eth_sendRawTransaction","eth_sign","eth_signTransaction","eth_signTypedData","eth_signTypedData_v3","eth_signTypedData_v4","wallet_switchEthereumChain","wallet_addEthereumChain","wallet_getPermissions","wallet_requestPermissions","wallet_registerOnboarding","wallet_watchAsset","wallet_scanQRCode"],bc=["chainChanged","accountsChanged"],x3=["message","disconnect","connect"];var pC=Object.defineProperty,gC=Object.defineProperties,mC=Object.getOwnPropertyDescriptors,C3=Object.getOwnPropertySymbols,wC=Object.prototype.hasOwnProperty,vC=Object.prototype.propertyIsEnumerable,I3=(t,e,r)=>e in t?pC(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Xo=(t,e)=>{for(var r in e||(e={}))wC.call(e,r)&&I3(t,r,e[r]);if(C3)for(var r of C3(e))vC.call(e,r)&&I3(t,r,e[r]);return t},A3=(t,e)=>gC(t,mC(e));function _c(t){return Number(t[0].split(":")[1])}function Uh(t){return`0x${t.toString(16)}`}function yC(t){const{chains:e,optionalChains:r,methods:n,optionalMethods:i,events:o,optionalEvents:c,rpcMap:l}=t;if(!Rn(e))throw new Error("Invalid chains");const h={chains:e,methods:n||yc,events:o||bc,rpcMap:Xo({},e.length?{[_c(e)]:l[_c(e)]}:{})},d=o?.filter(A=>!bc.includes(A)),v=n?.filter(A=>!yc.includes(A));if(!r&&!c&&!i&&!(d!=null&&d.length)&&!(v!=null&&v.length))return{required:e.length?h:void 0};const x=d?.length&&v?.length||!r,_={chains:[...new Set(x?h.chains.concat(r||[]):r)],methods:[...new Set(h.methods.concat(i!=null&&i.length?i:E3))],events:[...new Set(h.events.concat(c||x3))],rpcMap:l};return{required:e.length?h:void 0,optional:r.length?_:void 0}}class Ec{constructor(){this.events=new _r.exports.EventEmitter,this.namespace="eip155",this.accounts=[],this.chainId=1,this.STORAGE_KEY=fC,this.on=(e,r)=>(this.events.on(e,r),this),this.once=(e,r)=>(this.events.once(e,r),this),this.removeListener=(e,r)=>(this.events.removeListener(e,r),this),this.off=(e,r)=>(this.events.off(e,r),this),this.parseAccount=e=>this.isCompatibleChainId(e)?this.parseAccountId(e).address:e,this.signer={},this.rpc={}}static async init(e){const r=new Ec;return await r.initialize(e),r}async request(e){return await this.signer.request(e,this.formatChainId(this.chainId))}sendAsync(e,r){this.signer.sendAsync(e,r,this.formatChainId(this.chainId))}get connected(){return this.signer.client?this.signer.client.core.relayer.connected:!1}get connecting(){return this.signer.client?this.signer.client.core.relayer.connecting:!1}async enable(){return this.session||await this.connect(),await this.request({method:"eth_requestAccounts"})}async connect(e){if(!this.signer.client)throw new Error("Provider not initialized. Call init() first");this.loadConnectOpts(e);const{required:r,optional:n}=yC(this.rpc);try{const i=await new Promise(async(c,l)=>{var h;this.rpc.showQrModal&&((h=this.modal)==null||h.subscribeModal(d=>{!d.open&&!this.signer.session&&(this.signer.abortPairingAttempt(),l(new Error("Connection request reset. Please try again.")))})),await this.signer.connect(A3(Xo({namespaces:Xo({},r&&{[this.namespace]:r})},n&&{optionalNamespaces:{[this.namespace]:n}}),{pairingTopic:e?.pairingTopic})).then(d=>{c(d)}).catch(d=>{l(new Error(d.message))})});if(!i)return;this.setChainIds(this.rpc.chains);const o=Db(i.namespaces,[this.namespace]);this.setAccounts(o),this.events.emit("connect",{chainId:Uh(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:r}=e,{event:n}=r;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 r=parseInt(e);this.chainId=r,this.events.emit("chainChanged",Uh(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",A3(Xo({},Jt("USER_DISCONNECTED")),{data:e.topic,name:"USER_DISCONNECTED"}))}),this.signer.on("display_uri",e=>{var r,n;this.rpc.showQrModal&&((r=this.modal)==null||r.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 r=e.filter(n=>this.isCompatibleChainId(n)).map(n=>this.parseChainId(n));r.length&&(this.chainId=r[0],this.events.emit("chainChanged",Uh(this.chainId)),this.persist())}setChainId(e){if(this.isCompatibleChainId(e)){const r=this.parseChainId(e);this.chainId=r,this.switchEthereumChain(r)}}parseAccountId(e){const[r,n,i]=e.split(":");return{chainId:`${r}:${n}`,address:i}}setAccounts(e){this.accounts=e.filter(r=>this.parseChainId(this.parseAccountId(r).chainId)===this.chainId).map(r=>this.parseAccountId(r).address),this.events.emit("accountsChanged",this.accounts)}getRpcConfig(e){var r,n;const i=(r=e?.chains)!=null?r:[],o=(n=e?.optionalChains)!=null?n:[],c=i.concat(o);if(!c.length)throw new Error("No chains specified in either `chains` or `optionalChains`");const l=i.length?e?.methods||yc:[],h=i.length?e?.events||bc:[],d=e?.optionalMethods||[],v=e?.optionalEvents||[],x=e?.rpcMap||this.buildRpcMap(c,e.projectId),_=e?.qrModalOptions||void 0;return{chains:i?.map(A=>this.formatChainId(A)),optionalChains:o.map(A=>this.formatChainId(A)),methods:l,events:h,optionalMethods:d,optionalEvents:v,rpcMap:x,showQrModal:!!(e!=null&&e.showQrModal),qrModalOptions:_,projectId:e.projectId,metadata:e.metadata}}buildRpcMap(e,r){const n={};return e.forEach(i=>{n[i]=this.getRpcUrl(i,r)}),n}async initialize(e){if(this.rpc=this.getRpcConfig(e),this.chainId=this.rpc.chains.length?_c(this.rpc.chains):_c(this.rpc.optionalChains),this.signer=await lC.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 r;try{const{WalletConnectModal:n}=await Promise.resolve().then(function(){return YC});r=n}catch{throw new Error("To use QR modal, please install @walletconnect/modal package")}if(r)try{this.modal=new r(Xo({walletConnectVersion:2,projectId:this.rpc.projectId,standaloneChains:this.rpc.chains},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:r,optionalChains:n,rpcMap:i}=e;r&&Rn(r)&&(this.rpc.chains=r.map(o=>this.formatChainId(o)),r.forEach(o=>{this.rpc.rpcMap[o]=i?.[o]||this.getRpcUrl(o)})),n&&Rn(n)&&(this.rpc.optionalChains=[],this.rpc.optionalChains=n?.map(o=>this.formatChainId(o)),n.forEach(o=>{this.rpc.rpcMap[o]=i?.[o]||this.getRpcUrl(o)}))}getRpcUrl(e,r){var n;return((n=this.rpc.rpcMap)==null?void 0:n[e])||`${dC}?chainId=eip155:${e}&projectId=${r||this.rpc.projectId}`}async loadPersistedSession(){if(!this.session)return;const e=await this.signer.client.core.storage.getItem(`${this.STORAGE_KEY}/chainId`),r=this.session.namespaces[`${this.namespace}:${e}`]?this.session.namespaces[`${this.namespace}:${e}`]:this.session.namespaces[this.namespace];this.setChainIds(e?[this.formatChainId(e)]:r?.accounts),this.setAccounts(r?.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(r=>this.parseAccount(r))}}const bC=Ec,_C=Symbol(),$3=Object.getPrototypeOf,jh=new WeakMap,EC=t=>t&&(jh.has(t)?jh.get(t):$3(t)===Object.prototype||$3(t)===Array.prototype),xC=t=>EC(t)&&t[_C]||null,O3=(t,e=!0)=>{jh.set(t,e)},Bh=t=>typeof t=="object"&&t!==null,mi=new WeakMap,xc=new WeakSet,CC=(t=Object.is,e=(d,v)=>new Proxy(d,v),r=d=>Bh(d)&&!xc.has(d)&&(Array.isArray(d)||!(Symbol.iterator in d))&&!(d instanceof WeakMap)&&!(d instanceof WeakSet)&&!(d instanceof Error)&&!(d instanceof Number)&&!(d instanceof Date)&&!(d instanceof String)&&!(d instanceof RegExp)&&!(d instanceof ArrayBuffer),n=d=>{switch(d.status){case"fulfilled":return d.value;case"rejected":throw d.reason;default:throw d}},i=new WeakMap,o=(d,v,x=n)=>{const _=i.get(d);if(_?.[0]===v)return _[1];const A=Array.isArray(d)?[]:Object.create(Object.getPrototypeOf(d));return O3(A,!0),i.set(d,[v,A]),Reflect.ownKeys(d).forEach(P=>{if(Object.getOwnPropertyDescriptor(A,P))return;const L=Reflect.get(d,P),k={value:L,enumerable:!0,configurable:!0};if(xc.has(L))O3(L,!1);else if(L instanceof Promise)delete k.value,k.get=()=>x(L);else if(mi.has(L)){const[q,R]=mi.get(L);k.value=o(q,R(),x)}Object.defineProperty(A,P,k)}),A},c=new WeakMap,l=[1,1],h=d=>{if(!Bh(d))throw new Error("object required");const v=c.get(d);if(v)return v;let x=l[0];const _=new Set,A=(Z,z=++l[0])=>{x!==z&&(x=z,_.forEach(ee=>ee(Z,z)))};let P=l[1];const L=(Z=++l[1])=>(P!==Z&&!_.size&&(P=Z,q.forEach(([z])=>{const ee=z[1](Z);ee>x&&(x=ee)})),x),k=Z=>(z,ee)=>{const de=[...z];de[1]=[Z,...de[1]],A(de,ee)},q=new Map,R=(Z,z)=>{if(q.has(Z))throw new Error("prop listener already exists");if(_.size){const ee=z[3](k(Z));q.set(Z,[z,ee])}else q.set(Z,[z])},F=Z=>{var z;const ee=q.get(Z);ee&&(q.delete(Z),(z=ee[1])==null||z.call(ee))},$=Z=>(_.add(Z),_.size===1&&q.forEach(([ee,de],me)=>{if(de)throw new Error("remove already exists");const O=ee[3](k(me));q.set(me,[ee,O])}),()=>{_.delete(Z),_.size===0&&q.forEach(([ee,de],me)=>{de&&(de(),q.set(me,[ee]))})}),T=Array.isArray(d)?[]:Object.create(Object.getPrototypeOf(d)),f=e(T,{deleteProperty(Z,z){const ee=Reflect.get(Z,z);F(z);const de=Reflect.deleteProperty(Z,z);return de&&A(["delete",[z],ee]),de},set(Z,z,ee,de){const me=Reflect.has(Z,z),O=Reflect.get(Z,z,de);if(me&&(t(O,ee)||c.has(ee)&&t(O,c.get(ee))))return!0;F(z),Bh(ee)&&(ee=xC(ee)||ee);let U=ee;if(ee instanceof Promise)ee.then(ce=>{ee.status="fulfilled",ee.value=ce,A(["resolve",[z],ce])}).catch(ce=>{ee.status="rejected",ee.reason=ce,A(["reject",[z],ce])});else{!mi.has(ee)&&r(ee)&&(U=h(ee));const ce=!xc.has(U)&&mi.get(U);ce&&R(z,ce)}return Reflect.set(Z,z,U,de),A(["set",[z],ee,O]),!0}});c.set(d,f);const E=[T,L,o,$];return mi.set(f,E),Reflect.ownKeys(d).forEach(Z=>{const z=Object.getOwnPropertyDescriptor(d,Z);"value"in z&&(f[Z]=d[Z],delete z.value,delete z.writable),Object.defineProperty(T,Z,z)}),f})=>[h,mi,xc,t,e,r,n,i,o,c,l],[IC]=CC();function Ln(t={}){return IC(t)}function Zn(t,e,r){const n=mi.get(t);n||console.warn("Please use proxy object");let i;const o=[],c=n[3];let l=!1;const d=c(v=>{if(o.push(v),r){e(o.splice(0));return}i||(i=Promise.resolve().then(()=>{i=void 0,l&&e(o.splice(0))}))});return l=!0,()=>{l=!1,d()}}function AC(t,e){const r=mi.get(t);r||console.warn("Please use proxy object");const[n,i,o]=r;return o(n,i(),e)}var S3={},Cc={};Cc.byteLength=SC,Cc.toByteArray=PC,Cc.fromByteArray=NC;for(var Mn=[],hn=[],$C=typeof Uint8Array<"u"?Uint8Array:Array,kh="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Fs=0,OC=kh.length;Fs<OC;++Fs)Mn[Fs]=kh[Fs],hn[kh.charCodeAt(Fs)]=Fs;hn["-".charCodeAt(0)]=62,hn["_".charCodeAt(0)]=63;function D3(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");r===-1&&(r=e);var n=r===e?0:4-r%4;return[r,n]}function SC(t){var e=D3(t),r=e[0],n=e[1];return(r+n)*3/4-n}function DC(t,e,r){return(e+r)*3/4-r}function PC(t){var e,r=D3(t),n=r[0],i=r[1],o=new $C(DC(t,n,i)),c=0,l=i>0?n-4:n,h;for(h=0;h<l;h+=4)e=hn[t.charCodeAt(h)]<<18|hn[t.charCodeAt(h+1)]<<12|hn[t.charCodeAt(h+2)]<<6|hn[t.charCodeAt(h+3)],o[c++]=e>>16&255,o[c++]=e>>8&255,o[c++]=e&255;return i===2&&(e=hn[t.charCodeAt(h)]<<2|hn[t.charCodeAt(h+1)]>>4,o[c++]=e&255),i===1&&(e=hn[t.charCodeAt(h)]<<10|hn[t.charCodeAt(h+1)]<<4|hn[t.charCodeAt(h+2)]>>2,o[c++]=e>>8&255,o[c++]=e&255),o}function TC(t){return Mn[t>>18&63]+Mn[t>>12&63]+Mn[t>>6&63]+Mn[t&63]}function RC(t,e,r){for(var n,i=[],o=e;o<r;o+=3)n=(t[o]<<16&16711680)+(t[o+1]<<8&65280)+(t[o+2]&255),i.push(TC(n));return i.join("")}function NC(t){for(var e,r=t.length,n=r%3,i=[],o=16383,c=0,l=r-n;c<l;c+=o)i.push(RC(t,c,c+o>l?l:c+o));return n===1?(e=t[r-1],i.push(Mn[e>>2]+Mn[e<<4&63]+"==")):n===2&&(e=(t[r-2]<<8)+t[r-1],i.push(Mn[e>>10]+Mn[e>>4&63]+Mn[e<<2&63]+"=")),i.join("")}var Hh={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */Hh.read=function(t,e,r,n,i){var o,c,l=i*8-n-1,h=(1<<l)-1,d=h>>1,v=-7,x=r?i-1:0,_=r?-1:1,A=t[e+x];for(x+=_,o=A&(1<<-v)-1,A>>=-v,v+=l;v>0;o=o*256+t[e+x],x+=_,v-=8);for(c=o&(1<<-v)-1,o>>=-v,v+=n;v>0;c=c*256+t[e+x],x+=_,v-=8);if(o===0)o=1-d;else{if(o===h)return c?NaN:(A?-1:1)*(1/0);c=c+Math.pow(2,n),o=o-d}return(A?-1:1)*c*Math.pow(2,o-n)},Hh.write=function(t,e,r,n,i,o){var c,l,h,d=o*8-i-1,v=(1<<d)-1,x=v>>1,_=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,A=n?0:o-1,P=n?1:-1,L=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(l=isNaN(e)?1:0,c=v):(c=Math.floor(Math.log(e)/Math.LN2),e*(h=Math.pow(2,-c))<1&&(c--,h*=2),c+x>=1?e+=_/h:e+=_*Math.pow(2,1-x),e*h>=2&&(c++,h/=2),c+x>=v?(l=0,c=v):c+x>=1?(l=(e*h-1)*Math.pow(2,i),c=c+x):(l=e*Math.pow(2,x-1)*Math.pow(2,i),c=0));i>=8;t[r+A]=l&255,A+=P,l/=256,i-=8);for(c=c<<i|l,d+=i;d>0;t[r+A]=c&255,A+=P,c/=256,d-=8);t[r+A-P]|=L*128};/*!
99
99
  * The buffer module from node.js, for the browser.
100
100
  *
101
101
  * @author Feross Aboukhadijeh <https://feross.org>
102
102
  * @license MIT
103
- */(function(t){const e=gc,r=Oh,n=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=l,t.SlowBuffer=R,t.INSPECT_MAX_BYTES=50;const i=2147483647;t.kMaxLength=i,l.TYPED_ARRAY_SUPPORT=o(),!l.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function o(){try{const b=new Uint8Array(1),p={foo:function(){return 42}};return Object.setPrototypeOf(p,Uint8Array.prototype),Object.setPrototypeOf(b,p),b.foo()===42}catch{return!1}}Object.defineProperty(l.prototype,"parent",{enumerable:!0,get:function(){if(l.isBuffer(this))return this.buffer}}),Object.defineProperty(l.prototype,"offset",{enumerable:!0,get:function(){if(l.isBuffer(this))return this.byteOffset}});function c(b){if(b>i)throw new RangeError('The value "'+b+'" is invalid for option "size"');const p=new Uint8Array(b);return Object.setPrototypeOf(p,l.prototype),p}function l(b,p,m){if(typeof b=="number"){if(typeof p=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return E(b)}return h(b,p,m)}l.poolSize=8192;function h(b,p,m){if(typeof b=="string")return _(b,p);if(ArrayBuffer.isView(b))return P(b);if(b==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof b);if(ke(b,ArrayBuffer)||b&&ke(b.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(ke(b,SharedArrayBuffer)||b&&ke(b.buffer,SharedArrayBuffer)))return j(b,p,m);if(typeof b=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const D=b.valueOf&&b.valueOf();if(D!=null&&D!==b)return l.from(D,p,m);const B=H(b);if(B)return B;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof b[Symbol.toPrimitive]=="function")return l.from(b[Symbol.toPrimitive]("string"),p,m);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof b)}l.from=function(b,p,m){return h(b,p,m)},Object.setPrototypeOf(l.prototype,Uint8Array.prototype),Object.setPrototypeOf(l,Uint8Array);function f(b){if(typeof b!="number")throw new TypeError('"size" argument must be of type number');if(b<0)throw new RangeError('The value "'+b+'" is invalid for option "size"')}function v(b,p,m){return f(b),b<=0?c(b):p!==void 0?typeof m=="string"?c(b).fill(p,m):c(b).fill(p):c(b)}l.alloc=function(b,p,m){return v(b,p,m)};function E(b){return f(b),c(b<0?0:Z(b)|0)}l.allocUnsafe=function(b){return E(b)},l.allocUnsafeSlow=function(b){return E(b)};function _(b,p){if((typeof p!="string"||p==="")&&(p="utf8"),!l.isEncoding(p))throw new TypeError("Unknown encoding: "+p);const m=L(b,p)|0;let D=c(m);const B=D.write(b,p);return B!==m&&(D=D.slice(0,B)),D}function S(b){const p=b.length<0?0:Z(b.length)|0,m=c(p);for(let D=0;D<p;D+=1)m[D]=b[D]&255;return m}function P(b){if(ke(b,Uint8Array)){const p=new Uint8Array(b);return j(p.buffer,p.byteOffset,p.byteLength)}return S(b)}function j(b,p,m){if(p<0||b.byteLength<p)throw new RangeError('"offset" is outside of buffer bounds');if(b.byteLength<p+(m||0))throw new RangeError('"length" is outside of buffer bounds');let D;return p===void 0&&m===void 0?D=new Uint8Array(b):m===void 0?D=new Uint8Array(b,p):D=new Uint8Array(b,p,m),Object.setPrototypeOf(D,l.prototype),D}function H(b){if(l.isBuffer(b)){const p=Z(b.length)|0,m=c(p);return m.length===0||b.copy(m,0,0,p),m}if(b.length!==void 0)return typeof b.length!="number"||Ke(b.length)?c(0):S(b);if(b.type==="Buffer"&&Array.isArray(b.data))return S(b.data)}function Z(b){if(b>=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return b|0}function R(b){return+b!=b&&(b=0),l.alloc(+b)}l.isBuffer=function(p){return p!=null&&p._isBuffer===!0&&p!==l.prototype},l.compare=function(p,m){if(ke(p,Uint8Array)&&(p=l.from(p,p.offset,p.byteLength)),ke(m,Uint8Array)&&(m=l.from(m,m.offset,m.byteLength)),!l.isBuffer(p)||!l.isBuffer(m))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(p===m)return 0;let D=p.length,B=m.length;for(let K=0,Q=Math.min(D,B);K<Q;++K)if(p[K]!==m[K]){D=p[K],B=m[K];break}return D<B?-1:B<D?1:0},l.isEncoding=function(p){switch(String(p).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},l.concat=function(p,m){if(!Array.isArray(p))throw new TypeError('"list" argument must be an Array of Buffers');if(p.length===0)return l.alloc(0);let D;if(m===void 0)for(m=0,D=0;D<p.length;++D)m+=p[D].length;const B=l.allocUnsafe(m);let K=0;for(D=0;D<p.length;++D){let Q=p[D];if(ke(Q,Uint8Array))K+Q.length>B.length?(l.isBuffer(Q)||(Q=l.from(Q)),Q.copy(B,K)):Uint8Array.prototype.set.call(B,Q,K);else if(l.isBuffer(Q))Q.copy(B,K);else throw new TypeError('"list" argument must be an Array of Buffers');K+=Q.length}return B};function L(b,p){if(l.isBuffer(b))return b.length;if(ArrayBuffer.isView(b)||ke(b,ArrayBuffer))return b.byteLength;if(typeof b!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof b);const m=b.length,D=arguments.length>2&&arguments[2]===!0;if(!D&&m===0)return 0;let B=!1;for(;;)switch(p){case"ascii":case"latin1":case"binary":return m;case"utf8":case"utf-8":return Ge(b).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return m*2;case"hex":return m>>>1;case"base64":return Je(b).length;default:if(B)return D?-1:Ge(b).length;p=(""+p).toLowerCase(),B=!0}}l.byteLength=L;function $(b,p,m){let D=!1;if((p===void 0||p<0)&&(p=0),p>this.length||((m===void 0||m>this.length)&&(m=this.length),m<=0)||(m>>>=0,p>>>=0,m<=p))return"";for(b||(b="utf8");;)switch(b){case"hex":return ne(this,p,m);case"utf8":case"utf-8":return A(this,p,m);case"ascii":return le(this,p,m);case"latin1":case"binary":return re(this,p,m);case"base64":return me(this,p,m);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ae(this,p,m);default:if(D)throw new TypeError("Unknown encoding: "+b);b=(b+"").toLowerCase(),D=!0}}l.prototype._isBuffer=!0;function T(b,p,m){const D=b[p];b[p]=b[m],b[m]=D}l.prototype.swap16=function(){const p=this.length;if(p%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let m=0;m<p;m+=2)T(this,m,m+1);return this},l.prototype.swap32=function(){const p=this.length;if(p%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let m=0;m<p;m+=4)T(this,m,m+3),T(this,m+1,m+2);return this},l.prototype.swap64=function(){const p=this.length;if(p%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let m=0;m<p;m+=8)T(this,m,m+7),T(this,m+1,m+6),T(this,m+2,m+5),T(this,m+3,m+4);return this},l.prototype.toString=function(){const p=this.length;return p===0?"":arguments.length===0?A(this,0,p):$.apply(this,arguments)},l.prototype.toLocaleString=l.prototype.toString,l.prototype.equals=function(p){if(!l.isBuffer(p))throw new TypeError("Argument must be a Buffer");return this===p?!0:l.compare(this,p)===0},l.prototype.inspect=function(){let p="";const m=t.INSPECT_MAX_BYTES;return p=this.toString("hex",0,m).replace(/(.{2})/g,"$1 ").trim(),this.length>m&&(p+=" ... "),"<Buffer "+p+">"},n&&(l.prototype[n]=l.prototype.inspect),l.prototype.compare=function(p,m,D,B,K){if(ke(p,Uint8Array)&&(p=l.from(p,p.offset,p.byteLength)),!l.isBuffer(p))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof p);if(m===void 0&&(m=0),D===void 0&&(D=p?p.length:0),B===void 0&&(B=0),K===void 0&&(K=this.length),m<0||D>p.length||B<0||K>this.length)throw new RangeError("out of range index");if(B>=K&&m>=D)return 0;if(B>=K)return-1;if(m>=D)return 1;if(m>>>=0,D>>>=0,B>>>=0,K>>>=0,this===p)return 0;let Q=K-B,Ee=D-m;const Ne=Math.min(Q,Ee),st=this.slice(B,K),ht=p.slice(m,D);for(let lt=0;lt<Ne;++lt)if(st[lt]!==ht[lt]){Q=st[lt],Ee=ht[lt];break}return Q<Ee?-1:Ee<Q?1:0};function I(b,p,m,D,B){if(b.length===0)return-1;if(typeof m=="string"?(D=m,m=0):m>2147483647?m=2147483647:m<-2147483648&&(m=-2147483648),m=+m,Ke(m)&&(m=B?0:b.length-1),m<0&&(m=b.length+m),m>=b.length){if(B)return-1;m=b.length-1}else if(m<0)if(B)m=0;else return-1;if(typeof p=="string"&&(p=l.from(p,D)),l.isBuffer(p))return p.length===0?-1:d(b,p,m,D,B);if(typeof p=="number")return p=p&255,typeof Uint8Array.prototype.indexOf=="function"?B?Uint8Array.prototype.indexOf.call(b,p,m):Uint8Array.prototype.lastIndexOf.call(b,p,m):d(b,[p],m,D,B);throw new TypeError("val must be string, number or Buffer")}function d(b,p,m,D,B){let K=1,Q=b.length,Ee=p.length;if(D!==void 0&&(D=String(D).toLowerCase(),D==="ucs2"||D==="ucs-2"||D==="utf16le"||D==="utf-16le")){if(b.length<2||p.length<2)return-1;K=2,Q/=2,Ee/=2,m/=2}function Ne(ht,lt){return K===1?ht[lt]:ht.readUInt16BE(lt*K)}let st;if(B){let ht=-1;for(st=m;st<Q;st++)if(Ne(b,st)===Ne(p,ht===-1?0:st-ht)){if(ht===-1&&(ht=st),st-ht+1===Ee)return ht*K}else ht!==-1&&(st-=st-ht),ht=-1}else for(m+Ee>Q&&(m=Q-Ee),st=m;st>=0;st--){let ht=!0;for(let lt=0;lt<Ee;lt++)if(Ne(b,st+lt)!==Ne(p,lt)){ht=!1;break}if(ht)return st}return-1}l.prototype.includes=function(p,m,D){return this.indexOf(p,m,D)!==-1},l.prototype.indexOf=function(p,m,D){return I(this,p,m,D,!0)},l.prototype.lastIndexOf=function(p,m,D){return I(this,p,m,D,!1)};function x(b,p,m,D){m=Number(m)||0;const B=b.length-m;D?(D=Number(D),D>B&&(D=B)):D=B;const K=p.length;D>K/2&&(D=K/2);let Q;for(Q=0;Q<D;++Q){const Ee=parseInt(p.substr(Q*2,2),16);if(Ke(Ee))return Q;b[m+Q]=Ee}return Q}function J(b,p,m,D){return He(Ge(p,b.length-m),b,m,D)}function z(b,p,m,D){return He(Dt(p),b,m,D)}function ee(b,p,m,D){return He(Je(p),b,m,D)}function de(b,p,m,D){return He($t(p,b.length-m),b,m,D)}l.prototype.write=function(p,m,D,B){if(m===void 0)B="utf8",D=this.length,m=0;else if(D===void 0&&typeof m=="string")B=m,D=this.length,m=0;else if(isFinite(m))m=m>>>0,isFinite(D)?(D=D>>>0,B===void 0&&(B="utf8")):(B=D,D=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const K=this.length-m;if((D===void 0||D>K)&&(D=K),p.length>0&&(D<0||m<0)||m>this.length)throw new RangeError("Attempt to write outside buffer bounds");B||(B="utf8");let Q=!1;for(;;)switch(B){case"hex":return x(this,p,m,D);case"utf8":case"utf-8":return J(this,p,m,D);case"ascii":case"latin1":case"binary":return z(this,p,m,D);case"base64":return ee(this,p,m,D);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return de(this,p,m,D);default:if(Q)throw new TypeError("Unknown encoding: "+B);B=(""+B).toLowerCase(),Q=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function me(b,p,m){return p===0&&m===b.length?e.fromByteArray(b):e.fromByteArray(b.slice(p,m))}function A(b,p,m){m=Math.min(b.length,m);const D=[];let B=p;for(;B<m;){const K=b[B];let Q=null,Ee=K>239?4:K>223?3:K>191?2:1;if(B+Ee<=m){let Ne,st,ht,lt;switch(Ee){case 1:K<128&&(Q=K);break;case 2:Ne=b[B+1],(Ne&192)===128&&(lt=(K&31)<<6|Ne&63,lt>127&&(Q=lt));break;case 3:Ne=b[B+1],st=b[B+2],(Ne&192)===128&&(st&192)===128&&(lt=(K&15)<<12|(Ne&63)<<6|st&63,lt>2047&&(lt<55296||lt>57343)&&(Q=lt));break;case 4:Ne=b[B+1],st=b[B+2],ht=b[B+3],(Ne&192)===128&&(st&192)===128&&(ht&192)===128&&(lt=(K&15)<<18|(Ne&63)<<12|(st&63)<<6|ht&63,lt>65535&&lt<1114112&&(Q=lt))}}Q===null?(Q=65533,Ee=1):Q>65535&&(Q-=65536,D.push(Q>>>10&1023|55296),Q=56320|Q&1023),D.push(Q),B+=Ee}return ce(D)}const U=4096;function ce(b){const p=b.length;if(p<=U)return String.fromCharCode.apply(String,b);let m="",D=0;for(;D<p;)m+=String.fromCharCode.apply(String,b.slice(D,D+=U));return m}function le(b,p,m){let D="";m=Math.min(b.length,m);for(let B=p;B<m;++B)D+=String.fromCharCode(b[B]&127);return D}function re(b,p,m){let D="";m=Math.min(b.length,m);for(let B=p;B<m;++B)D+=String.fromCharCode(b[B]);return D}function ne(b,p,m){const D=b.length;(!p||p<0)&&(p=0),(!m||m<0||m>D)&&(m=D);let B="";for(let K=p;K<m;++K)B+=rt[b[K]];return B}function ae(b,p,m){const D=b.slice(p,m);let B="";for(let K=0;K<D.length-1;K+=2)B+=String.fromCharCode(D[K]+D[K+1]*256);return B}l.prototype.slice=function(p,m){const D=this.length;p=~~p,m=m===void 0?D:~~m,p<0?(p+=D,p<0&&(p=0)):p>D&&(p=D),m<0?(m+=D,m<0&&(m=0)):m>D&&(m=D),m<p&&(m=p);const B=this.subarray(p,m);return Object.setPrototypeOf(B,l.prototype),B};function ie(b,p,m){if(b%1!==0||b<0)throw new RangeError("offset is not uint");if(b+p>m)throw new RangeError("Trying to access beyond buffer length")}l.prototype.readUintLE=l.prototype.readUIntLE=function(p,m,D){p=p>>>0,m=m>>>0,D||ie(p,m,this.length);let B=this[p],K=1,Q=0;for(;++Q<m&&(K*=256);)B+=this[p+Q]*K;return B},l.prototype.readUintBE=l.prototype.readUIntBE=function(p,m,D){p=p>>>0,m=m>>>0,D||ie(p,m,this.length);let B=this[p+--m],K=1;for(;m>0&&(K*=256);)B+=this[p+--m]*K;return B},l.prototype.readUint8=l.prototype.readUInt8=function(p,m){return p=p>>>0,m||ie(p,1,this.length),this[p]},l.prototype.readUint16LE=l.prototype.readUInt16LE=function(p,m){return p=p>>>0,m||ie(p,2,this.length),this[p]|this[p+1]<<8},l.prototype.readUint16BE=l.prototype.readUInt16BE=function(p,m){return p=p>>>0,m||ie(p,2,this.length),this[p]<<8|this[p+1]},l.prototype.readUint32LE=l.prototype.readUInt32LE=function(p,m){return p=p>>>0,m||ie(p,4,this.length),(this[p]|this[p+1]<<8|this[p+2]<<16)+this[p+3]*16777216},l.prototype.readUint32BE=l.prototype.readUInt32BE=function(p,m){return p=p>>>0,m||ie(p,4,this.length),this[p]*16777216+(this[p+1]<<16|this[p+2]<<8|this[p+3])},l.prototype.readBigUInt64LE=je(function(p){p=p>>>0,ve(p,"offset");const m=this[p],D=this[p+7];(m===void 0||D===void 0)&&Ue(p,this.length-8);const B=m+this[++p]*2**8+this[++p]*2**16+this[++p]*2**24,K=this[++p]+this[++p]*2**8+this[++p]*2**16+D*2**24;return BigInt(B)+(BigInt(K)<<BigInt(32))}),l.prototype.readBigUInt64BE=je(function(p){p=p>>>0,ve(p,"offset");const m=this[p],D=this[p+7];(m===void 0||D===void 0)&&Ue(p,this.length-8);const B=m*2**24+this[++p]*2**16+this[++p]*2**8+this[++p],K=this[++p]*2**24+this[++p]*2**16+this[++p]*2**8+D;return(BigInt(B)<<BigInt(32))+BigInt(K)}),l.prototype.readIntLE=function(p,m,D){p=p>>>0,m=m>>>0,D||ie(p,m,this.length);let B=this[p],K=1,Q=0;for(;++Q<m&&(K*=256);)B+=this[p+Q]*K;return K*=128,B>=K&&(B-=Math.pow(2,8*m)),B},l.prototype.readIntBE=function(p,m,D){p=p>>>0,m=m>>>0,D||ie(p,m,this.length);let B=m,K=1,Q=this[p+--B];for(;B>0&&(K*=256);)Q+=this[p+--B]*K;return K*=128,Q>=K&&(Q-=Math.pow(2,8*m)),Q},l.prototype.readInt8=function(p,m){return p=p>>>0,m||ie(p,1,this.length),this[p]&128?(255-this[p]+1)*-1:this[p]},l.prototype.readInt16LE=function(p,m){p=p>>>0,m||ie(p,2,this.length);const D=this[p]|this[p+1]<<8;return D&32768?D|4294901760:D},l.prototype.readInt16BE=function(p,m){p=p>>>0,m||ie(p,2,this.length);const D=this[p+1]|this[p]<<8;return D&32768?D|4294901760:D},l.prototype.readInt32LE=function(p,m){return p=p>>>0,m||ie(p,4,this.length),this[p]|this[p+1]<<8|this[p+2]<<16|this[p+3]<<24},l.prototype.readInt32BE=function(p,m){return p=p>>>0,m||ie(p,4,this.length),this[p]<<24|this[p+1]<<16|this[p+2]<<8|this[p+3]},l.prototype.readBigInt64LE=je(function(p){p=p>>>0,ve(p,"offset");const m=this[p],D=this[p+7];(m===void 0||D===void 0)&&Ue(p,this.length-8);const B=this[p+4]+this[p+5]*2**8+this[p+6]*2**16+(D<<24);return(BigInt(B)<<BigInt(32))+BigInt(m+this[++p]*2**8+this[++p]*2**16+this[++p]*2**24)}),l.prototype.readBigInt64BE=je(function(p){p=p>>>0,ve(p,"offset");const m=this[p],D=this[p+7];(m===void 0||D===void 0)&&Ue(p,this.length-8);const B=(m<<24)+this[++p]*2**16+this[++p]*2**8+this[++p];return(BigInt(B)<<BigInt(32))+BigInt(this[++p]*2**24+this[++p]*2**16+this[++p]*2**8+D)}),l.prototype.readFloatLE=function(p,m){return p=p>>>0,m||ie(p,4,this.length),r.read(this,p,!0,23,4)},l.prototype.readFloatBE=function(p,m){return p=p>>>0,m||ie(p,4,this.length),r.read(this,p,!1,23,4)},l.prototype.readDoubleLE=function(p,m){return p=p>>>0,m||ie(p,8,this.length),r.read(this,p,!0,52,8)},l.prototype.readDoubleBE=function(p,m){return p=p>>>0,m||ie(p,8,this.length),r.read(this,p,!1,52,8)};function Oe(b,p,m,D,B,K){if(!l.isBuffer(b))throw new TypeError('"buffer" argument must be a Buffer instance');if(p>B||p<K)throw new RangeError('"value" argument is out of bounds');if(m+D>b.length)throw new RangeError("Index out of range")}l.prototype.writeUintLE=l.prototype.writeUIntLE=function(p,m,D,B){if(p=+p,m=m>>>0,D=D>>>0,!B){const Ee=Math.pow(2,8*D)-1;Oe(this,p,m,D,Ee,0)}let K=1,Q=0;for(this[m]=p&255;++Q<D&&(K*=256);)this[m+Q]=p/K&255;return m+D},l.prototype.writeUintBE=l.prototype.writeUIntBE=function(p,m,D,B){if(p=+p,m=m>>>0,D=D>>>0,!B){const Ee=Math.pow(2,8*D)-1;Oe(this,p,m,D,Ee,0)}let K=D-1,Q=1;for(this[m+K]=p&255;--K>=0&&(Q*=256);)this[m+K]=p/Q&255;return m+D},l.prototype.writeUint8=l.prototype.writeUInt8=function(p,m,D){return p=+p,m=m>>>0,D||Oe(this,p,m,1,255,0),this[m]=p&255,m+1},l.prototype.writeUint16LE=l.prototype.writeUInt16LE=function(p,m,D){return p=+p,m=m>>>0,D||Oe(this,p,m,2,65535,0),this[m]=p&255,this[m+1]=p>>>8,m+2},l.prototype.writeUint16BE=l.prototype.writeUInt16BE=function(p,m,D){return p=+p,m=m>>>0,D||Oe(this,p,m,2,65535,0),this[m]=p>>>8,this[m+1]=p&255,m+2},l.prototype.writeUint32LE=l.prototype.writeUInt32LE=function(p,m,D){return p=+p,m=m>>>0,D||Oe(this,p,m,4,4294967295,0),this[m+3]=p>>>24,this[m+2]=p>>>16,this[m+1]=p>>>8,this[m]=p&255,m+4},l.prototype.writeUint32BE=l.prototype.writeUInt32BE=function(p,m,D){return p=+p,m=m>>>0,D||Oe(this,p,m,4,4294967295,0),this[m]=p>>>24,this[m+1]=p>>>16,this[m+2]=p>>>8,this[m+3]=p&255,m+4};function ge(b,p,m,D,B){we(p,D,B,b,m,7);let K=Number(p&BigInt(4294967295));b[m++]=K,K=K>>8,b[m++]=K,K=K>>8,b[m++]=K,K=K>>8,b[m++]=K;let Q=Number(p>>BigInt(32)&BigInt(4294967295));return b[m++]=Q,Q=Q>>8,b[m++]=Q,Q=Q>>8,b[m++]=Q,Q=Q>>8,b[m++]=Q,m}function Be(b,p,m,D,B){we(p,D,B,b,m,7);let K=Number(p&BigInt(4294967295));b[m+7]=K,K=K>>8,b[m+6]=K,K=K>>8,b[m+5]=K,K=K>>8,b[m+4]=K;let Q=Number(p>>BigInt(32)&BigInt(4294967295));return b[m+3]=Q,Q=Q>>8,b[m+2]=Q,Q=Q>>8,b[m+1]=Q,Q=Q>>8,b[m]=Q,m+8}l.prototype.writeBigUInt64LE=je(function(p,m=0){return ge(this,p,m,BigInt(0),BigInt("0xffffffffffffffff"))}),l.prototype.writeBigUInt64BE=je(function(p,m=0){return Be(this,p,m,BigInt(0),BigInt("0xffffffffffffffff"))}),l.prototype.writeIntLE=function(p,m,D,B){if(p=+p,m=m>>>0,!B){const Ne=Math.pow(2,8*D-1);Oe(this,p,m,D,Ne-1,-Ne)}let K=0,Q=1,Ee=0;for(this[m]=p&255;++K<D&&(Q*=256);)p<0&&Ee===0&&this[m+K-1]!==0&&(Ee=1),this[m+K]=(p/Q>>0)-Ee&255;return m+D},l.prototype.writeIntBE=function(p,m,D,B){if(p=+p,m=m>>>0,!B){const Ne=Math.pow(2,8*D-1);Oe(this,p,m,D,Ne-1,-Ne)}let K=D-1,Q=1,Ee=0;for(this[m+K]=p&255;--K>=0&&(Q*=256);)p<0&&Ee===0&&this[m+K+1]!==0&&(Ee=1),this[m+K]=(p/Q>>0)-Ee&255;return m+D},l.prototype.writeInt8=function(p,m,D){return p=+p,m=m>>>0,D||Oe(this,p,m,1,127,-128),p<0&&(p=255+p+1),this[m]=p&255,m+1},l.prototype.writeInt16LE=function(p,m,D){return p=+p,m=m>>>0,D||Oe(this,p,m,2,32767,-32768),this[m]=p&255,this[m+1]=p>>>8,m+2},l.prototype.writeInt16BE=function(p,m,D){return p=+p,m=m>>>0,D||Oe(this,p,m,2,32767,-32768),this[m]=p>>>8,this[m+1]=p&255,m+2},l.prototype.writeInt32LE=function(p,m,D){return p=+p,m=m>>>0,D||Oe(this,p,m,4,2147483647,-2147483648),this[m]=p&255,this[m+1]=p>>>8,this[m+2]=p>>>16,this[m+3]=p>>>24,m+4},l.prototype.writeInt32BE=function(p,m,D){return p=+p,m=m>>>0,D||Oe(this,p,m,4,2147483647,-2147483648),p<0&&(p=4294967295+p+1),this[m]=p>>>24,this[m+1]=p>>>16,this[m+2]=p>>>8,this[m+3]=p&255,m+4},l.prototype.writeBigInt64LE=je(function(p,m=0){return ge(this,p,m,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),l.prototype.writeBigInt64BE=je(function(p,m=0){return Be(this,p,m,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function ye(b,p,m,D,B,K){if(m+D>b.length)throw new RangeError("Index out of range");if(m<0)throw new RangeError("Index out of range")}function Me(b,p,m,D,B){return p=+p,m=m>>>0,B||ye(b,p,m,4),r.write(b,p,m,D,23,4),m+4}l.prototype.writeFloatLE=function(p,m,D){return Me(this,p,m,!0,D)},l.prototype.writeFloatBE=function(p,m,D){return Me(this,p,m,!1,D)};function X(b,p,m,D,B){return p=+p,m=m>>>0,B||ye(b,p,m,8),r.write(b,p,m,D,52,8),m+8}l.prototype.writeDoubleLE=function(p,m,D){return X(this,p,m,!0,D)},l.prototype.writeDoubleBE=function(p,m,D){return X(this,p,m,!1,D)},l.prototype.copy=function(p,m,D,B){if(!l.isBuffer(p))throw new TypeError("argument should be a Buffer");if(D||(D=0),!B&&B!==0&&(B=this.length),m>=p.length&&(m=p.length),m||(m=0),B>0&&B<D&&(B=D),B===D||p.length===0||this.length===0)return 0;if(m<0)throw new RangeError("targetStart out of bounds");if(D<0||D>=this.length)throw new RangeError("Index out of range");if(B<0)throw new RangeError("sourceEnd out of bounds");B>this.length&&(B=this.length),p.length-m<B-D&&(B=p.length-m+D);const K=B-D;return this===p&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(m,D,B):Uint8Array.prototype.set.call(p,this.subarray(D,B),m),K},l.prototype.fill=function(p,m,D,B){if(typeof p=="string"){if(typeof m=="string"?(B=m,m=0,D=this.length):typeof D=="string"&&(B=D,D=this.length),B!==void 0&&typeof B!="string")throw new TypeError("encoding must be a string");if(typeof B=="string"&&!l.isEncoding(B))throw new TypeError("Unknown encoding: "+B);if(p.length===1){const Q=p.charCodeAt(0);(B==="utf8"&&Q<128||B==="latin1")&&(p=Q)}}else typeof p=="number"?p=p&255:typeof p=="boolean"&&(p=Number(p));if(m<0||this.length<m||this.length<D)throw new RangeError("Out of range index");if(D<=m)return this;m=m>>>0,D=D===void 0?this.length:D>>>0,p||(p=0);let K;if(typeof p=="number")for(K=m;K<D;++K)this[K]=p;else{const Q=l.isBuffer(p)?p:l.from(p,B),Ee=Q.length;if(Ee===0)throw new TypeError('The value "'+p+'" is invalid for argument "value"');for(K=0;K<D-m;++K)this[K+m]=Q[K%Ee]}return this};const Y={};function W(b,p,m){Y[b]=class extends m{constructor(){super(),Object.defineProperty(this,"message",{value:p.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${b}]`,this.stack,delete this.name}get code(){return b}set code(B){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:B,writable:!0})}toString(){return`${this.name} [${b}]: ${this.message}`}}}W("ERR_BUFFER_OUT_OF_BOUNDS",function(b){return b?`${b} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),W("ERR_INVALID_ARG_TYPE",function(b,p){return`The "${b}" argument must be of type number. Received type ${typeof p}`},TypeError),W("ERR_OUT_OF_RANGE",function(b,p,m){let D=`The value of "${b}" is out of range.`,B=m;return Number.isInteger(m)&&Math.abs(m)>2**32?B=w(String(m)):typeof m=="bigint"&&(B=String(m),(m>BigInt(2)**BigInt(32)||m<-(BigInt(2)**BigInt(32)))&&(B=w(B)),B+="n"),D+=` It must be ${p}. Received ${B}`,D},RangeError);function w(b){let p="",m=b.length;const D=b[0]==="-"?1:0;for(;m>=D+4;m-=3)p=`_${b.slice(m-3,m)}${p}`;return`${b.slice(0,m)}${p}`}function F(b,p,m){ve(p,"offset"),(b[p]===void 0||b[p+m]===void 0)&&Ue(p,b.length-(m+1))}function we(b,p,m,D,B,K){if(b>m||b<p){const Q=typeof p=="bigint"?"n":"";let Ee;throw K>3?p===0||p===BigInt(0)?Ee=`>= 0${Q} and < 2${Q} ** ${(K+1)*8}${Q}`:Ee=`>= -(2${Q} ** ${(K+1)*8-1}${Q}) and < 2 ** ${(K+1)*8-1}${Q}`:Ee=`>= ${p}${Q} and <= ${m}${Q}`,new Y.ERR_OUT_OF_RANGE("value",Ee,b)}F(D,B,K)}function ve(b,p){if(typeof b!="number")throw new Y.ERR_INVALID_ARG_TYPE(p,"number",b)}function Ue(b,p,m){throw Math.floor(b)!==b?(ve(b,m),new Y.ERR_OUT_OF_RANGE(m||"offset","an integer",b)):p<0?new Y.ERR_BUFFER_OUT_OF_BOUNDS:new Y.ERR_OUT_OF_RANGE(m||"offset",`>= ${m?1:0} and <= ${p}`,b)}const nt=/[^+/0-9A-Za-z-_]/g;function at(b){if(b=b.split("=")[0],b=b.trim().replace(nt,""),b.length<2)return"";for(;b.length%4!==0;)b=b+"=";return b}function Ge(b,p){p=p||1/0;let m;const D=b.length;let B=null;const K=[];for(let Q=0;Q<D;++Q){if(m=b.charCodeAt(Q),m>55295&&m<57344){if(!B){if(m>56319){(p-=3)>-1&&K.push(239,191,189);continue}else if(Q+1===D){(p-=3)>-1&&K.push(239,191,189);continue}B=m;continue}if(m<56320){(p-=3)>-1&&K.push(239,191,189),B=m;continue}m=(B-55296<<10|m-56320)+65536}else B&&(p-=3)>-1&&K.push(239,191,189);if(B=null,m<128){if((p-=1)<0)break;K.push(m)}else if(m<2048){if((p-=2)<0)break;K.push(m>>6|192,m&63|128)}else if(m<65536){if((p-=3)<0)break;K.push(m>>12|224,m>>6&63|128,m&63|128)}else if(m<1114112){if((p-=4)<0)break;K.push(m>>18|240,m>>12&63|128,m>>6&63|128,m&63|128)}else throw new Error("Invalid code point")}return K}function Dt(b){const p=[];for(let m=0;m<b.length;++m)p.push(b.charCodeAt(m)&255);return p}function $t(b,p){let m,D,B;const K=[];for(let Q=0;Q<b.length&&!((p-=2)<0);++Q)m=b.charCodeAt(Q),D=m>>8,B=m%256,K.push(B),K.push(D);return K}function Je(b){return e.toByteArray(at(b))}function He(b,p,m,D){let B;for(B=0;B<D&&!(B+m>=p.length||B>=b.length);++B)p[B+m]=b[B];return B}function ke(b,p){return b instanceof p||b!=null&&b.constructor!=null&&b.constructor.name!=null&&b.constructor.name===p.name}function Ke(b){return b!==b}const rt=function(){const b="0123456789abcdef",p=new Array(256);for(let m=0;m<16;++m){const D=m*16;for(let B=0;B<16;++B)p[D+B]=b[m]+b[B]}return p}();function je(b){return typeof BigInt>"u"?Ze:b}function Ze(){throw new Error("BigInt not supported")}})(Fg);let Dh;const Rt={ethereumClient:void 0,setEthereumClient(t){Dh=t},client(){if(Dh)return Dh;throw new Error("ClientCtrl has no client set")}},mr=Rn({history:["ConnectWallet"],view:"ConnectWallet",data:void 0}),tt={state:mr,subscribe(t){return Kn(mr,()=>t(mr))},push(t,e){t!==mr.view&&(mr.view=t,e&&(mr.data=e),mr.history.push(t))},reset(t){mr.view=t,mr.history=[t]},replace(t){mr.history.length>1&&(mr.history[mr.history.length-1]=t,mr.view=t)},goBack(){if(mr.history.length>1){mr.history.pop();const[t]=mr.history.slice(-1);mr.view=t}},setData(t){mr.data=t}},Se={WALLETCONNECT_DEEPLINK_CHOICE:"WALLETCONNECT_DEEPLINK_CHOICE",W3M_VERSION:"W3M_VERSION",W3M_PREFER_INJECTED_URL_FLAG:"w3mPreferInjected",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 Se.isMobile()&&navigator.userAgent.toLowerCase().includes("android")},isIos(){const t=navigator.userAgent.toLowerCase();return Se.isMobile()&&(t.includes("iphone")||t.includes("ipad"))},isHttpUrl(t){return t.startsWith("http://")||t.startsWith("https://")},isArray(t){return Array.isArray(t)&&t.length>0},formatNativeUrl(t,e,r){if(Se.isHttpUrl(t))return this.formatUniversalUrl(t,e,r);let n=t;n.includes("://")||(n=t.replaceAll("/","").replaceAll(":",""),n=`${n}://`),this.setWalletConnectDeepLink(n,r);const i=encodeURIComponent(e);return`${n}wc?uri=${i}`},formatUniversalUrl(t,e,r){if(!Se.isHttpUrl(t))return this.formatNativeUrl(t,e,r);let n=t;t.endsWith("/")&&(n=t.slice(0,-1)),this.setWalletConnectDeepLink(n,r);const i=encodeURIComponent(e);return`${n}/wc?uri=${i}`},async wait(t){return new Promise(e=>{setTimeout(e,t)})},openHref(t,e){window.open(t,e,"noreferrer noopener")},setWalletConnectDeepLink(t,e){localStorage.setItem(Se.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:t,name:e}))},setWalletConnectAndroidDeepLink(t){const[e]=t.split("?");localStorage.setItem(Se.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:e,name:"Android"}))},removeWalletConnectDeepLink(){localStorage.removeItem(Se.WALLETCONNECT_DEEPLINK_CHOICE)},setWeb3ModalVersionInStorage(){typeof localStorage<"u"&&localStorage.setItem(Se.W3M_VERSION,"2.4.2")},getWalletRouterData(){var t;const e=(t=tt.state.data)==null?void 0:t.Wallet;if(!e)throw new Error('Missing "Wallet" view data');return e},getSwitchNetworkRouterData(){var t;const e=(t=tt.state.data)==null?void 0:t.SwitchNetwork;if(!e)throw new Error('Missing "SwitchNetwork" view data');return e},isPreferInjectedFlag(){return typeof location<"u"?new URLSearchParams(location.search).has(Se.W3M_PREFER_INJECTED_URL_FLAG):!1}},yx=typeof location<"u"&&(location.hostname.includes("localhost")||location.protocol.includes("https")),Sr=Rn({enabled:yx,userSessionId:"",events:[],connectedWalletId:void 0}),mi={state:Sr,subscribe(t){return Kn(Sr.events,()=>t(ux(Sr.events[Sr.events.length-1])))},initialize(){Sr.enabled&&typeof crypto<"u"&&(Sr.userSessionId=crypto.randomUUID())},setConnectedWalletId(t){Sr.connectedWalletId=t},click(t){if(Sr.enabled){const e={type:"CLICK",name:t.name,userSessionId:Sr.userSessionId,timestamp:Date.now(),data:t};Sr.events.push(e)}},track(t){if(Sr.enabled){const e={type:"TRACK",name:t.name,userSessionId:Sr.userSessionId,timestamp:Date.now(),data:t};Sr.events.push(e)}},view(t){if(Sr.enabled){const e={type:"VIEW",name:t.name,userSessionId:Sr.userSessionId,timestamp:Date.now(),data:t};Sr.events.push(e)}}},xr=Rn({selectedChain:void 0,chains:void 0,standaloneChains:void 0,standaloneUri:void 0,isStandalone:!1,isAuth:!1,isCustomDesktop:!1,isCustomMobile:!1,isDataLoaded:!1,isUiLoaded:!1,isPreferInjected:!1,walletConnectVersion:1}),De={state:xr,subscribe(t){return Kn(xr,()=>t(xr))},setChains(t){xr.chains=t},setStandaloneChains(t){xr.standaloneChains=t},setStandaloneUri(t){xr.standaloneUri=t},getSelectedChain(){const t=Rt.client().getNetwork().chain;return t&&(xr.selectedChain=t),xr.selectedChain},setSelectedChain(t){xr.selectedChain=t},setIsStandalone(t){xr.isStandalone=t},setIsCustomDesktop(t){xr.isCustomDesktop=t},setIsCustomMobile(t){xr.isCustomMobile=t},setIsDataLoaded(t){xr.isDataLoaded=t},setIsUiLoaded(t){xr.isUiLoaded=t},setWalletConnectVersion(t){xr.walletConnectVersion=t},setIsPreferInjected(t){xr.isPreferInjected=t},setIsAuth(t){xr.isAuth=t}},mc=Rn({projectId:"",mobileWallets:void 0,desktopWallets:void 0,walletImages:void 0,chainImages:void 0,tokenImages:void 0,tokenContracts:void 0,standaloneChains:void 0,enableStandaloneMode:!1,enableAuthMode:!1,enableNetworkView:!1,enableAccountView:!0,enableExplorer:!0,defaultChain:void 0,explorerExcludedWalletIds:void 0,explorerRecommendedWalletIds:void 0,termsOfServiceUrl:void 0,privacyPolicyUrl:void 0}),jt={state:mc,subscribe(t){return Kn(mc,()=>t(mc))},setConfig(t){var e,r,n,i;mi.initialize(),De.setStandaloneChains(t.standaloneChains),De.setIsStandalone(!!((e=t.standaloneChains)!=null&&e.length)||!!t.enableStandaloneMode),De.setIsAuth(!!t.enableAuthMode),De.setIsCustomMobile(!!((r=t.mobileWallets)!=null&&r.length)),De.setIsCustomDesktop(!!((n=t.desktopWallets)!=null&&n.length)),De.setWalletConnectVersion((i=t.walletConnectVersion)!=null?i:1),De.state.isStandalone||(De.setChains(Rt.client().chains),De.setIsPreferInjected(Rt.client().isInjectedProviderInstalled()&&Se.isPreferInjectedFlag())),t.defaultChain&&De.setSelectedChain(t.defaultChain),Se.setWeb3ModalVersionInStorage(),Object.assign(mc,t)}},Ht=Rn({address:void 0,profileName:void 0,profileAvatar:void 0,profileLoading:!1,balanceLoading:!1,balance:void 0,isConnected:!1}),Et={state:Ht,subscribe(t){return Kn(Ht,()=>t(Ht))},getAccount(){const t=Rt.client().getAccount();Ht.address=t.address,Ht.isConnected=t.isConnected},async fetchProfile(t,e){var r;try{Ht.profileLoading=!0;const n=e??Ht.address,i=(r=De.state.chains)==null?void 0:r.find(o=>o.id===1);if(n&&i){const o=await Rt.client().fetchEnsName({address:n,chainId:1});if(o){const c=await Rt.client().fetchEnsAvatar({name:o,chainId:1});c&&await t(c),Ht.profileAvatar=c}Ht.profileName=o}}finally{Ht.profileLoading=!1}},async fetchBalance(t){try{const{chain:e}=Rt.client().getNetwork(),{tokenContracts:r}=jt.state;let n;e&&r&&(n=r[e.id]),Ht.balanceLoading=!0;const i=t??Ht.address;if(i){const o=await Rt.client().fetchBalance({address:i,token:n});Ht.balance={amount:o.formatted,symbol:o.symbol}}}finally{Ht.balanceLoading=!1}},setAddress(t){Ht.address=t},setIsConnected(t){Ht.isConnected=t},resetBalance(){Ht.balance=void 0},resetAccount(){Ht.address=void 0,Ht.isConnected=!1,Ht.profileName=void 0,Ht.profileAvatar=void 0,Ht.balance=void 0}},$h="https://explorer-api.walletconnect.com";async function wc(t,e){const r=new URL(t,$h);return r.searchParams.append("projectId",jt.state.projectId),Object.entries(e).forEach(([n,i])=>{i&&r.searchParams.append(n,String(i))}),(await fetch(r)).json()}const wi={async getDesktopListings(t){return wc("/w3m/v1/getDesktopListings",t)},async getMobileListings(t){return wc("/w3m/v1/getMobileListings",t)},async getInjectedListings(t){return wc("/w3m/v1/getInjectedListings",t)},async getAllListings(t){return wc("/w3m/v1/getAllListings",t)},getWalletImageUrl(t){return`${$h}/w3m/v1/getWalletImage/${t}?projectId=${jt.state.projectId}`},getAssetImageUrl(t){return`${$h}/w3m/v1/getAssetImage/${t}?projectId=${jt.state.projectId}`}};var bx=Object.defineProperty,kg=Object.getOwnPropertySymbols,_x=Object.prototype.hasOwnProperty,Ex=Object.prototype.propertyIsEnumerable,Hg=(t,e,r)=>e in t?bx(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,xx=(t,e)=>{for(var r in e||(e={}))_x.call(e,r)&&Hg(t,r,e[r]);if(kg)for(var r of kg(e))Ex.call(e,r)&&Hg(t,r,e[r]);return t};const zg=Se.isMobile(),un=Rn({wallets:{listings:[],total:0,page:1},injectedWallets:[],search:{listings:[],total:0,page:1},recomendedWallets:[]}),nr={state:un,async getRecomendedWallets(){const{explorerRecommendedWalletIds:t,explorerExcludedWalletIds:e}=jt.state;if(t==="NONE"||e==="ALL"&&!t)return un.recomendedWallets;if(Se.isArray(t)){const r={recommendedIds:t.join(",")},{listings:n}=await wi.getAllListings(r),i=Object.values(n);i.sort((o,c)=>{const l=t.indexOf(o.id),h=t.indexOf(c.id);return l-h}),un.recomendedWallets=i}else{const{standaloneChains:r,walletConnectVersion:n,isAuth:i}=De.state,o=r?.join(","),c=Se.isArray(e),l={page:1,sdks:i?"auth_v1":void 0,entries:Se.RECOMMENDED_WALLET_AMOUNT,chains:o,version:n,excludedIds:c?e.join(","):void 0},{listings:h}=zg?await wi.getMobileListings(l):await wi.getDesktopListings(l);un.recomendedWallets=Object.values(h)}return un.recomendedWallets},async getWallets(t){const e=xx({},t),{explorerRecommendedWalletIds:r,explorerExcludedWalletIds:n}=jt.state,{recomendedWallets:i}=un;if(n==="ALL")return un.wallets;e.search||(i.length?e.excludedIds=i.map(E=>E.id).join(","):Se.isArray(r)&&(e.excludedIds=r.join(","))),Se.isArray(n)&&(e.excludedIds=[e.excludedIds,n].filter(Boolean).join(",")),De.state.isAuth&&(e.sdks="auth_v1");const{page:o,search:c}=t,{listings:l,total:h}=zg?await wi.getMobileListings(e):await wi.getDesktopListings(e),f=Object.values(l),v=c?"search":"wallets";return un[v]={listings:[...un[v].listings,...f],total:h,page:o??1},{listings:f,total:h}},async getInjectedWallets(){const{listings:t}=await wi.getInjectedListings({}),e=Object.values(t);return un.injectedWallets=e,un.injectedWallets},getWalletImageUrl(t){return wi.getWalletImageUrl(t)},getAssetImageUrl(t){return wi.getAssetImageUrl(t)},resetSearch(){un.search={listings:[],total:0,page:1}}},Vo=Rn({pairingUri:"",pairingError:!1}),hr={state:Vo,subscribe(t){return Kn(Vo,()=>t(Vo))},setPairingUri(t){Vo.pairingUri=t},setPairingError(t){Vo.pairingError=t}},Ns=Rn({open:!1}),Rr={state:Ns,subscribe(t){return Kn(Ns,()=>t(Ns))},async open(t){return new Promise(e=>{const{isStandalone:r,isUiLoaded:n,isDataLoaded:i,isPreferInjected:o,selectedChain:c}=De.state,{isConnected:l}=Et.state,{enableNetworkView:h}=jt.state;if(r)De.setStandaloneUri(t?.uri),De.setStandaloneChains(t?.standaloneChains),tt.reset("ConnectWallet");else if(t!=null&&t.route)tt.reset(t.route);else if(l)tt.reset("Account");else if(h)tt.reset("SelectNetwork");else if(o){Rt.client().connectConnector("injected",c?.id).catch(v=>console.error(v)),e();return}else tt.reset("ConnectWallet");const{pairingUri:f}=hr.state;if(n&&i&&(r||f||l))Ns.open=!0,e();else{const v=setInterval(()=>{const E=De.state,_=hr.state;E.isUiLoaded&&E.isDataLoaded&&(E.isStandalone||_.pairingUri||l)&&(clearInterval(v),Ns.open=!0,e())},200)}})},close(){Ns.open=!1}};var Cx=Object.defineProperty,Wg=Object.getOwnPropertySymbols,Ix=Object.prototype.hasOwnProperty,Sx=Object.prototype.propertyIsEnumerable,qg=(t,e,r)=>e in t?Cx(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Ax=(t,e)=>{for(var r in e||(e={}))Ix.call(e,r)&&qg(t,r,e[r]);if(Wg)for(var r of Wg(e))Sx.call(e,r)&&qg(t,r,e[r]);return t};function Ox(){return typeof matchMedia<"u"&&matchMedia("(prefers-color-scheme: dark)").matches}const Ko=Rn({themeMode:Ox()?"dark":"light"}),Mn={state:Ko,subscribe(t){return Kn(Ko,()=>t(Ko))},setThemeConfig(t){const{themeMode:e,themeVariables:r}=t;e&&(Ko.themeMode=e),r&&(Ko.themeVariables=Ax({},r))}},Ki=Rn({open:!1,message:"",variant:"success"}),Wr={state:Ki,subscribe(t){return Kn(Ki,()=>t(Ki))},openToast(t,e){Ki.open=!0,Ki.message=t,Ki.variant=e},closeToast(){Ki.open=!1}};typeof window<"u"&&(window.Buffer||(window.Buffer=Fg.Buffer),window.global||(window.global=window),window.process||(window.process={env:{}}));var Dx=Object.defineProperty,Vg=Object.getOwnPropertySymbols,$x=Object.prototype.hasOwnProperty,Px=Object.prototype.propertyIsEnumerable,Kg=(t,e,r)=>e in t?Dx(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Tx=(t,e)=>{for(var r in e||(e={}))$x.call(e,r)&&Kg(t,r,e[r]);if(Vg)for(var r of Vg(e))Px.call(e,r)&&Kg(t,r,e[r]);return t};class Nx{constructor(e){this.openModal=Rr.open,this.closeModal=Rr.close,this.subscribeModal=Rr.subscribe,this.setTheme=Mn.setThemeConfig,Mn.setThemeConfig(e),jt.setConfig(Tx({enableStandaloneMode:!0},e)),this.initUi()}async initUi(){if(typeof window<"u"){await Promise.resolve().then(function(){return lO});const e=document.createElement("w3m-modal");document.body.insertAdjacentElement("beforeend",e),De.setIsUiLoaded(!0)}}}var Rx=Object.freeze({__proto__:null,WalletConnectModal:Nx});/**
103
+ */(function(t){const e=Cc,r=Hh,n=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=l,t.SlowBuffer=R,t.INSPECT_MAX_BYTES=50;const i=2147483647;t.kMaxLength=i,l.TYPED_ARRAY_SUPPORT=o(),!l.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function o(){try{const b=new Uint8Array(1),p={foo:function(){return 42}};return Object.setPrototypeOf(p,Uint8Array.prototype),Object.setPrototypeOf(b,p),b.foo()===42}catch{return!1}}Object.defineProperty(l.prototype,"parent",{enumerable:!0,get:function(){if(l.isBuffer(this))return this.buffer}}),Object.defineProperty(l.prototype,"offset",{enumerable:!0,get:function(){if(l.isBuffer(this))return this.byteOffset}});function c(b){if(b>i)throw new RangeError('The value "'+b+'" is invalid for option "size"');const p=new Uint8Array(b);return Object.setPrototypeOf(p,l.prototype),p}function l(b,p,m){if(typeof b=="number"){if(typeof p=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return x(b)}return h(b,p,m)}l.poolSize=8192;function h(b,p,m){if(typeof b=="string")return _(b,p);if(ArrayBuffer.isView(b))return P(b);if(b==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof b);if(ke(b,ArrayBuffer)||b&&ke(b.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(ke(b,SharedArrayBuffer)||b&&ke(b.buffer,SharedArrayBuffer)))return L(b,p,m);if(typeof b=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const D=b.valueOf&&b.valueOf();if(D!=null&&D!==b)return l.from(D,p,m);const B=k(b);if(B)return B;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof b[Symbol.toPrimitive]=="function")return l.from(b[Symbol.toPrimitive]("string"),p,m);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof b)}l.from=function(b,p,m){return h(b,p,m)},Object.setPrototypeOf(l.prototype,Uint8Array.prototype),Object.setPrototypeOf(l,Uint8Array);function d(b){if(typeof b!="number")throw new TypeError('"size" argument must be of type number');if(b<0)throw new RangeError('The value "'+b+'" is invalid for option "size"')}function v(b,p,m){return d(b),b<=0?c(b):p!==void 0?typeof m=="string"?c(b).fill(p,m):c(b).fill(p):c(b)}l.alloc=function(b,p,m){return v(b,p,m)};function x(b){return d(b),c(b<0?0:q(b)|0)}l.allocUnsafe=function(b){return x(b)},l.allocUnsafeSlow=function(b){return x(b)};function _(b,p){if((typeof p!="string"||p==="")&&(p="utf8"),!l.isEncoding(p))throw new TypeError("Unknown encoding: "+p);const m=F(b,p)|0;let D=c(m);const B=D.write(b,p);return B!==m&&(D=D.slice(0,B)),D}function A(b){const p=b.length<0?0:q(b.length)|0,m=c(p);for(let D=0;D<p;D+=1)m[D]=b[D]&255;return m}function P(b){if(ke(b,Uint8Array)){const p=new Uint8Array(b);return L(p.buffer,p.byteOffset,p.byteLength)}return A(b)}function L(b,p,m){if(p<0||b.byteLength<p)throw new RangeError('"offset" is outside of buffer bounds');if(b.byteLength<p+(m||0))throw new RangeError('"length" is outside of buffer bounds');let D;return p===void 0&&m===void 0?D=new Uint8Array(b):m===void 0?D=new Uint8Array(b,p):D=new Uint8Array(b,p,m),Object.setPrototypeOf(D,l.prototype),D}function k(b){if(l.isBuffer(b)){const p=q(b.length)|0,m=c(p);return m.length===0||b.copy(m,0,0,p),m}if(b.length!==void 0)return typeof b.length!="number"||Ke(b.length)?c(0):A(b);if(b.type==="Buffer"&&Array.isArray(b.data))return A(b.data)}function q(b){if(b>=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return b|0}function R(b){return+b!=b&&(b=0),l.alloc(+b)}l.isBuffer=function(p){return p!=null&&p._isBuffer===!0&&p!==l.prototype},l.compare=function(p,m){if(ke(p,Uint8Array)&&(p=l.from(p,p.offset,p.byteLength)),ke(m,Uint8Array)&&(m=l.from(m,m.offset,m.byteLength)),!l.isBuffer(p)||!l.isBuffer(m))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(p===m)return 0;let D=p.length,B=m.length;for(let G=0,Q=Math.min(D,B);G<Q;++G)if(p[G]!==m[G]){D=p[G],B=m[G];break}return D<B?-1:B<D?1:0},l.isEncoding=function(p){switch(String(p).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},l.concat=function(p,m){if(!Array.isArray(p))throw new TypeError('"list" argument must be an Array of Buffers');if(p.length===0)return l.alloc(0);let D;if(m===void 0)for(m=0,D=0;D<p.length;++D)m+=p[D].length;const B=l.allocUnsafe(m);let G=0;for(D=0;D<p.length;++D){let Q=p[D];if(ke(Q,Uint8Array))G+Q.length>B.length?(l.isBuffer(Q)||(Q=l.from(Q)),Q.copy(B,G)):Uint8Array.prototype.set.call(B,Q,G);else if(l.isBuffer(Q))Q.copy(B,G);else throw new TypeError('"list" argument must be an Array of Buffers');G+=Q.length}return B};function F(b,p){if(l.isBuffer(b))return b.length;if(ArrayBuffer.isView(b)||ke(b,ArrayBuffer))return b.byteLength;if(typeof b!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof b);const m=b.length,D=arguments.length>2&&arguments[2]===!0;if(!D&&m===0)return 0;let B=!1;for(;;)switch(p){case"ascii":case"latin1":case"binary":return m;case"utf8":case"utf-8":return Ge(b).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return m*2;case"hex":return m>>>1;case"base64":return Je(b).length;default:if(B)return D?-1:Ge(b).length;p=(""+p).toLowerCase(),B=!0}}l.byteLength=F;function $(b,p,m){let D=!1;if((p===void 0||p<0)&&(p=0),p>this.length||((m===void 0||m>this.length)&&(m=this.length),m<=0)||(m>>>=0,p>>>=0,m<=p))return"";for(b||(b="utf8");;)switch(b){case"hex":return ne(this,p,m);case"utf8":case"utf-8":return O(this,p,m);case"ascii":return le(this,p,m);case"latin1":case"binary":return re(this,p,m);case"base64":return me(this,p,m);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ae(this,p,m);default:if(D)throw new TypeError("Unknown encoding: "+b);b=(b+"").toLowerCase(),D=!0}}l.prototype._isBuffer=!0;function T(b,p,m){const D=b[p];b[p]=b[m],b[m]=D}l.prototype.swap16=function(){const p=this.length;if(p%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let m=0;m<p;m+=2)T(this,m,m+1);return this},l.prototype.swap32=function(){const p=this.length;if(p%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let m=0;m<p;m+=4)T(this,m,m+3),T(this,m+1,m+2);return this},l.prototype.swap64=function(){const p=this.length;if(p%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let m=0;m<p;m+=8)T(this,m,m+7),T(this,m+1,m+6),T(this,m+2,m+5),T(this,m+3,m+4);return this},l.prototype.toString=function(){const p=this.length;return p===0?"":arguments.length===0?O(this,0,p):$.apply(this,arguments)},l.prototype.toLocaleString=l.prototype.toString,l.prototype.equals=function(p){if(!l.isBuffer(p))throw new TypeError("Argument must be a Buffer");return this===p?!0:l.compare(this,p)===0},l.prototype.inspect=function(){let p="";const m=t.INSPECT_MAX_BYTES;return p=this.toString("hex",0,m).replace(/(.{2})/g,"$1 ").trim(),this.length>m&&(p+=" ... "),"<Buffer "+p+">"},n&&(l.prototype[n]=l.prototype.inspect),l.prototype.compare=function(p,m,D,B,G){if(ke(p,Uint8Array)&&(p=l.from(p,p.offset,p.byteLength)),!l.isBuffer(p))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof p);if(m===void 0&&(m=0),D===void 0&&(D=p?p.length:0),B===void 0&&(B=0),G===void 0&&(G=this.length),m<0||D>p.length||B<0||G>this.length)throw new RangeError("out of range index");if(B>=G&&m>=D)return 0;if(B>=G)return-1;if(m>=D)return 1;if(m>>>=0,D>>>=0,B>>>=0,G>>>=0,this===p)return 0;let Q=G-B,Ee=D-m;const Re=Math.min(Q,Ee),st=this.slice(B,G),ht=p.slice(m,D);for(let lt=0;lt<Re;++lt)if(st[lt]!==ht[lt]){Q=st[lt],Ee=ht[lt];break}return Q<Ee?-1:Ee<Q?1:0};function C(b,p,m,D,B){if(b.length===0)return-1;if(typeof m=="string"?(D=m,m=0):m>2147483647?m=2147483647:m<-2147483648&&(m=-2147483648),m=+m,Ke(m)&&(m=B?0:b.length-1),m<0&&(m=b.length+m),m>=b.length){if(B)return-1;m=b.length-1}else if(m<0)if(B)m=0;else return-1;if(typeof p=="string"&&(p=l.from(p,D)),l.isBuffer(p))return p.length===0?-1:f(b,p,m,D,B);if(typeof p=="number")return p=p&255,typeof Uint8Array.prototype.indexOf=="function"?B?Uint8Array.prototype.indexOf.call(b,p,m):Uint8Array.prototype.lastIndexOf.call(b,p,m):f(b,[p],m,D,B);throw new TypeError("val must be string, number or Buffer")}function f(b,p,m,D,B){let G=1,Q=b.length,Ee=p.length;if(D!==void 0&&(D=String(D).toLowerCase(),D==="ucs2"||D==="ucs-2"||D==="utf16le"||D==="utf-16le")){if(b.length<2||p.length<2)return-1;G=2,Q/=2,Ee/=2,m/=2}function Re(ht,lt){return G===1?ht[lt]:ht.readUInt16BE(lt*G)}let st;if(B){let ht=-1;for(st=m;st<Q;st++)if(Re(b,st)===Re(p,ht===-1?0:st-ht)){if(ht===-1&&(ht=st),st-ht+1===Ee)return ht*G}else ht!==-1&&(st-=st-ht),ht=-1}else for(m+Ee>Q&&(m=Q-Ee),st=m;st>=0;st--){let ht=!0;for(let lt=0;lt<Ee;lt++)if(Re(b,st+lt)!==Re(p,lt)){ht=!1;break}if(ht)return st}return-1}l.prototype.includes=function(p,m,D){return this.indexOf(p,m,D)!==-1},l.prototype.indexOf=function(p,m,D){return C(this,p,m,D,!0)},l.prototype.lastIndexOf=function(p,m,D){return C(this,p,m,D,!1)};function E(b,p,m,D){m=Number(m)||0;const B=b.length-m;D?(D=Number(D),D>B&&(D=B)):D=B;const G=p.length;D>G/2&&(D=G/2);let Q;for(Q=0;Q<D;++Q){const Ee=parseInt(p.substr(Q*2,2),16);if(Ke(Ee))return Q;b[m+Q]=Ee}return Q}function Z(b,p,m,D){return He(Ge(p,b.length-m),b,m,D)}function z(b,p,m,D){return He(Dt(p),b,m,D)}function ee(b,p,m,D){return He(Je(p),b,m,D)}function de(b,p,m,D){return He(Pt(p,b.length-m),b,m,D)}l.prototype.write=function(p,m,D,B){if(m===void 0)B="utf8",D=this.length,m=0;else if(D===void 0&&typeof m=="string")B=m,D=this.length,m=0;else if(isFinite(m))m=m>>>0,isFinite(D)?(D=D>>>0,B===void 0&&(B="utf8")):(B=D,D=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const G=this.length-m;if((D===void 0||D>G)&&(D=G),p.length>0&&(D<0||m<0)||m>this.length)throw new RangeError("Attempt to write outside buffer bounds");B||(B="utf8");let Q=!1;for(;;)switch(B){case"hex":return E(this,p,m,D);case"utf8":case"utf-8":return Z(this,p,m,D);case"ascii":case"latin1":case"binary":return z(this,p,m,D);case"base64":return ee(this,p,m,D);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return de(this,p,m,D);default:if(Q)throw new TypeError("Unknown encoding: "+B);B=(""+B).toLowerCase(),Q=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function me(b,p,m){return p===0&&m===b.length?e.fromByteArray(b):e.fromByteArray(b.slice(p,m))}function O(b,p,m){m=Math.min(b.length,m);const D=[];let B=p;for(;B<m;){const G=b[B];let Q=null,Ee=G>239?4:G>223?3:G>191?2:1;if(B+Ee<=m){let Re,st,ht,lt;switch(Ee){case 1:G<128&&(Q=G);break;case 2:Re=b[B+1],(Re&192)===128&&(lt=(G&31)<<6|Re&63,lt>127&&(Q=lt));break;case 3:Re=b[B+1],st=b[B+2],(Re&192)===128&&(st&192)===128&&(lt=(G&15)<<12|(Re&63)<<6|st&63,lt>2047&&(lt<55296||lt>57343)&&(Q=lt));break;case 4:Re=b[B+1],st=b[B+2],ht=b[B+3],(Re&192)===128&&(st&192)===128&&(ht&192)===128&&(lt=(G&15)<<18|(Re&63)<<12|(st&63)<<6|ht&63,lt>65535&&lt<1114112&&(Q=lt))}}Q===null?(Q=65533,Ee=1):Q>65535&&(Q-=65536,D.push(Q>>>10&1023|55296),Q=56320|Q&1023),D.push(Q),B+=Ee}return ce(D)}const U=4096;function ce(b){const p=b.length;if(p<=U)return String.fromCharCode.apply(String,b);let m="",D=0;for(;D<p;)m+=String.fromCharCode.apply(String,b.slice(D,D+=U));return m}function le(b,p,m){let D="";m=Math.min(b.length,m);for(let B=p;B<m;++B)D+=String.fromCharCode(b[B]&127);return D}function re(b,p,m){let D="";m=Math.min(b.length,m);for(let B=p;B<m;++B)D+=String.fromCharCode(b[B]);return D}function ne(b,p,m){const D=b.length;(!p||p<0)&&(p=0),(!m||m<0||m>D)&&(m=D);let B="";for(let G=p;G<m;++G)B+=rt[b[G]];return B}function ae(b,p,m){const D=b.slice(p,m);let B="";for(let G=0;G<D.length-1;G+=2)B+=String.fromCharCode(D[G]+D[G+1]*256);return B}l.prototype.slice=function(p,m){const D=this.length;p=~~p,m=m===void 0?D:~~m,p<0?(p+=D,p<0&&(p=0)):p>D&&(p=D),m<0?(m+=D,m<0&&(m=0)):m>D&&(m=D),m<p&&(m=p);const B=this.subarray(p,m);return Object.setPrototypeOf(B,l.prototype),B};function ie(b,p,m){if(b%1!==0||b<0)throw new RangeError("offset is not uint");if(b+p>m)throw new RangeError("Trying to access beyond buffer length")}l.prototype.readUintLE=l.prototype.readUIntLE=function(p,m,D){p=p>>>0,m=m>>>0,D||ie(p,m,this.length);let B=this[p],G=1,Q=0;for(;++Q<m&&(G*=256);)B+=this[p+Q]*G;return B},l.prototype.readUintBE=l.prototype.readUIntBE=function(p,m,D){p=p>>>0,m=m>>>0,D||ie(p,m,this.length);let B=this[p+--m],G=1;for(;m>0&&(G*=256);)B+=this[p+--m]*G;return B},l.prototype.readUint8=l.prototype.readUInt8=function(p,m){return p=p>>>0,m||ie(p,1,this.length),this[p]},l.prototype.readUint16LE=l.prototype.readUInt16LE=function(p,m){return p=p>>>0,m||ie(p,2,this.length),this[p]|this[p+1]<<8},l.prototype.readUint16BE=l.prototype.readUInt16BE=function(p,m){return p=p>>>0,m||ie(p,2,this.length),this[p]<<8|this[p+1]},l.prototype.readUint32LE=l.prototype.readUInt32LE=function(p,m){return p=p>>>0,m||ie(p,4,this.length),(this[p]|this[p+1]<<8|this[p+2]<<16)+this[p+3]*16777216},l.prototype.readUint32BE=l.prototype.readUInt32BE=function(p,m){return p=p>>>0,m||ie(p,4,this.length),this[p]*16777216+(this[p+1]<<16|this[p+2]<<8|this[p+3])},l.prototype.readBigUInt64LE=Ue(function(p){p=p>>>0,ve(p,"offset");const m=this[p],D=this[p+7];(m===void 0||D===void 0)&&Me(p,this.length-8);const B=m+this[++p]*2**8+this[++p]*2**16+this[++p]*2**24,G=this[++p]+this[++p]*2**8+this[++p]*2**16+D*2**24;return BigInt(B)+(BigInt(G)<<BigInt(32))}),l.prototype.readBigUInt64BE=Ue(function(p){p=p>>>0,ve(p,"offset");const m=this[p],D=this[p+7];(m===void 0||D===void 0)&&Me(p,this.length-8);const B=m*2**24+this[++p]*2**16+this[++p]*2**8+this[++p],G=this[++p]*2**24+this[++p]*2**16+this[++p]*2**8+D;return(BigInt(B)<<BigInt(32))+BigInt(G)}),l.prototype.readIntLE=function(p,m,D){p=p>>>0,m=m>>>0,D||ie(p,m,this.length);let B=this[p],G=1,Q=0;for(;++Q<m&&(G*=256);)B+=this[p+Q]*G;return G*=128,B>=G&&(B-=Math.pow(2,8*m)),B},l.prototype.readIntBE=function(p,m,D){p=p>>>0,m=m>>>0,D||ie(p,m,this.length);let B=m,G=1,Q=this[p+--B];for(;B>0&&(G*=256);)Q+=this[p+--B]*G;return G*=128,Q>=G&&(Q-=Math.pow(2,8*m)),Q},l.prototype.readInt8=function(p,m){return p=p>>>0,m||ie(p,1,this.length),this[p]&128?(255-this[p]+1)*-1:this[p]},l.prototype.readInt16LE=function(p,m){p=p>>>0,m||ie(p,2,this.length);const D=this[p]|this[p+1]<<8;return D&32768?D|4294901760:D},l.prototype.readInt16BE=function(p,m){p=p>>>0,m||ie(p,2,this.length);const D=this[p+1]|this[p]<<8;return D&32768?D|4294901760:D},l.prototype.readInt32LE=function(p,m){return p=p>>>0,m||ie(p,4,this.length),this[p]|this[p+1]<<8|this[p+2]<<16|this[p+3]<<24},l.prototype.readInt32BE=function(p,m){return p=p>>>0,m||ie(p,4,this.length),this[p]<<24|this[p+1]<<16|this[p+2]<<8|this[p+3]},l.prototype.readBigInt64LE=Ue(function(p){p=p>>>0,ve(p,"offset");const m=this[p],D=this[p+7];(m===void 0||D===void 0)&&Me(p,this.length-8);const B=this[p+4]+this[p+5]*2**8+this[p+6]*2**16+(D<<24);return(BigInt(B)<<BigInt(32))+BigInt(m+this[++p]*2**8+this[++p]*2**16+this[++p]*2**24)}),l.prototype.readBigInt64BE=Ue(function(p){p=p>>>0,ve(p,"offset");const m=this[p],D=this[p+7];(m===void 0||D===void 0)&&Me(p,this.length-8);const B=(m<<24)+this[++p]*2**16+this[++p]*2**8+this[++p];return(BigInt(B)<<BigInt(32))+BigInt(this[++p]*2**24+this[++p]*2**16+this[++p]*2**8+D)}),l.prototype.readFloatLE=function(p,m){return p=p>>>0,m||ie(p,4,this.length),r.read(this,p,!0,23,4)},l.prototype.readFloatBE=function(p,m){return p=p>>>0,m||ie(p,4,this.length),r.read(this,p,!1,23,4)},l.prototype.readDoubleLE=function(p,m){return p=p>>>0,m||ie(p,8,this.length),r.read(this,p,!0,52,8)},l.prototype.readDoubleBE=function(p,m){return p=p>>>0,m||ie(p,8,this.length),r.read(this,p,!1,52,8)};function Oe(b,p,m,D,B,G){if(!l.isBuffer(b))throw new TypeError('"buffer" argument must be a Buffer instance');if(p>B||p<G)throw new RangeError('"value" argument is out of bounds');if(m+D>b.length)throw new RangeError("Index out of range")}l.prototype.writeUintLE=l.prototype.writeUIntLE=function(p,m,D,B){if(p=+p,m=m>>>0,D=D>>>0,!B){const Ee=Math.pow(2,8*D)-1;Oe(this,p,m,D,Ee,0)}let G=1,Q=0;for(this[m]=p&255;++Q<D&&(G*=256);)this[m+Q]=p/G&255;return m+D},l.prototype.writeUintBE=l.prototype.writeUIntBE=function(p,m,D,B){if(p=+p,m=m>>>0,D=D>>>0,!B){const Ee=Math.pow(2,8*D)-1;Oe(this,p,m,D,Ee,0)}let G=D-1,Q=1;for(this[m+G]=p&255;--G>=0&&(Q*=256);)this[m+G]=p/Q&255;return m+D},l.prototype.writeUint8=l.prototype.writeUInt8=function(p,m,D){return p=+p,m=m>>>0,D||Oe(this,p,m,1,255,0),this[m]=p&255,m+1},l.prototype.writeUint16LE=l.prototype.writeUInt16LE=function(p,m,D){return p=+p,m=m>>>0,D||Oe(this,p,m,2,65535,0),this[m]=p&255,this[m+1]=p>>>8,m+2},l.prototype.writeUint16BE=l.prototype.writeUInt16BE=function(p,m,D){return p=+p,m=m>>>0,D||Oe(this,p,m,2,65535,0),this[m]=p>>>8,this[m+1]=p&255,m+2},l.prototype.writeUint32LE=l.prototype.writeUInt32LE=function(p,m,D){return p=+p,m=m>>>0,D||Oe(this,p,m,4,4294967295,0),this[m+3]=p>>>24,this[m+2]=p>>>16,this[m+1]=p>>>8,this[m]=p&255,m+4},l.prototype.writeUint32BE=l.prototype.writeUInt32BE=function(p,m,D){return p=+p,m=m>>>0,D||Oe(this,p,m,4,4294967295,0),this[m]=p>>>24,this[m+1]=p>>>16,this[m+2]=p>>>8,this[m+3]=p&255,m+4};function ge(b,p,m,D,B){we(p,D,B,b,m,7);let G=Number(p&BigInt(4294967295));b[m++]=G,G=G>>8,b[m++]=G,G=G>>8,b[m++]=G,G=G>>8,b[m++]=G;let Q=Number(p>>BigInt(32)&BigInt(4294967295));return b[m++]=Q,Q=Q>>8,b[m++]=Q,Q=Q>>8,b[m++]=Q,Q=Q>>8,b[m++]=Q,m}function Be(b,p,m,D,B){we(p,D,B,b,m,7);let G=Number(p&BigInt(4294967295));b[m+7]=G,G=G>>8,b[m+6]=G,G=G>>8,b[m+5]=G,G=G>>8,b[m+4]=G;let Q=Number(p>>BigInt(32)&BigInt(4294967295));return b[m+3]=Q,Q=Q>>8,b[m+2]=Q,Q=Q>>8,b[m+1]=Q,Q=Q>>8,b[m]=Q,m+8}l.prototype.writeBigUInt64LE=Ue(function(p,m=0){return ge(this,p,m,BigInt(0),BigInt("0xffffffffffffffff"))}),l.prototype.writeBigUInt64BE=Ue(function(p,m=0){return Be(this,p,m,BigInt(0),BigInt("0xffffffffffffffff"))}),l.prototype.writeIntLE=function(p,m,D,B){if(p=+p,m=m>>>0,!B){const Re=Math.pow(2,8*D-1);Oe(this,p,m,D,Re-1,-Re)}let G=0,Q=1,Ee=0;for(this[m]=p&255;++G<D&&(Q*=256);)p<0&&Ee===0&&this[m+G-1]!==0&&(Ee=1),this[m+G]=(p/Q>>0)-Ee&255;return m+D},l.prototype.writeIntBE=function(p,m,D,B){if(p=+p,m=m>>>0,!B){const Re=Math.pow(2,8*D-1);Oe(this,p,m,D,Re-1,-Re)}let G=D-1,Q=1,Ee=0;for(this[m+G]=p&255;--G>=0&&(Q*=256);)p<0&&Ee===0&&this[m+G+1]!==0&&(Ee=1),this[m+G]=(p/Q>>0)-Ee&255;return m+D},l.prototype.writeInt8=function(p,m,D){return p=+p,m=m>>>0,D||Oe(this,p,m,1,127,-128),p<0&&(p=255+p+1),this[m]=p&255,m+1},l.prototype.writeInt16LE=function(p,m,D){return p=+p,m=m>>>0,D||Oe(this,p,m,2,32767,-32768),this[m]=p&255,this[m+1]=p>>>8,m+2},l.prototype.writeInt16BE=function(p,m,D){return p=+p,m=m>>>0,D||Oe(this,p,m,2,32767,-32768),this[m]=p>>>8,this[m+1]=p&255,m+2},l.prototype.writeInt32LE=function(p,m,D){return p=+p,m=m>>>0,D||Oe(this,p,m,4,2147483647,-2147483648),this[m]=p&255,this[m+1]=p>>>8,this[m+2]=p>>>16,this[m+3]=p>>>24,m+4},l.prototype.writeInt32BE=function(p,m,D){return p=+p,m=m>>>0,D||Oe(this,p,m,4,2147483647,-2147483648),p<0&&(p=4294967295+p+1),this[m]=p>>>24,this[m+1]=p>>>16,this[m+2]=p>>>8,this[m+3]=p&255,m+4},l.prototype.writeBigInt64LE=Ue(function(p,m=0){return ge(this,p,m,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),l.prototype.writeBigInt64BE=Ue(function(p,m=0){return Be(this,p,m,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function ye(b,p,m,D,B,G){if(m+D>b.length)throw new RangeError("Index out of range");if(m<0)throw new RangeError("Index out of range")}function Le(b,p,m,D,B){return p=+p,m=m>>>0,B||ye(b,p,m,4),r.write(b,p,m,D,23,4),m+4}l.prototype.writeFloatLE=function(p,m,D){return Le(this,p,m,!0,D)},l.prototype.writeFloatBE=function(p,m,D){return Le(this,p,m,!1,D)};function X(b,p,m,D,B){return p=+p,m=m>>>0,B||ye(b,p,m,8),r.write(b,p,m,D,52,8),m+8}l.prototype.writeDoubleLE=function(p,m,D){return X(this,p,m,!0,D)},l.prototype.writeDoubleBE=function(p,m,D){return X(this,p,m,!1,D)},l.prototype.copy=function(p,m,D,B){if(!l.isBuffer(p))throw new TypeError("argument should be a Buffer");if(D||(D=0),!B&&B!==0&&(B=this.length),m>=p.length&&(m=p.length),m||(m=0),B>0&&B<D&&(B=D),B===D||p.length===0||this.length===0)return 0;if(m<0)throw new RangeError("targetStart out of bounds");if(D<0||D>=this.length)throw new RangeError("Index out of range");if(B<0)throw new RangeError("sourceEnd out of bounds");B>this.length&&(B=this.length),p.length-m<B-D&&(B=p.length-m+D);const G=B-D;return this===p&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(m,D,B):Uint8Array.prototype.set.call(p,this.subarray(D,B),m),G},l.prototype.fill=function(p,m,D,B){if(typeof p=="string"){if(typeof m=="string"?(B=m,m=0,D=this.length):typeof D=="string"&&(B=D,D=this.length),B!==void 0&&typeof B!="string")throw new TypeError("encoding must be a string");if(typeof B=="string"&&!l.isEncoding(B))throw new TypeError("Unknown encoding: "+B);if(p.length===1){const Q=p.charCodeAt(0);(B==="utf8"&&Q<128||B==="latin1")&&(p=Q)}}else typeof p=="number"?p=p&255:typeof p=="boolean"&&(p=Number(p));if(m<0||this.length<m||this.length<D)throw new RangeError("Out of range index");if(D<=m)return this;m=m>>>0,D=D===void 0?this.length:D>>>0,p||(p=0);let G;if(typeof p=="number")for(G=m;G<D;++G)this[G]=p;else{const Q=l.isBuffer(p)?p:l.from(p,B),Ee=Q.length;if(Ee===0)throw new TypeError('The value "'+p+'" is invalid for argument "value"');for(G=0;G<D-m;++G)this[G+m]=Q[G%Ee]}return this};const J={};function W(b,p,m){J[b]=class extends m{constructor(){super(),Object.defineProperty(this,"message",{value:p.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${b}]`,this.stack,delete this.name}get code(){return b}set code(B){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:B,writable:!0})}toString(){return`${this.name} [${b}]: ${this.message}`}}}W("ERR_BUFFER_OUT_OF_BOUNDS",function(b){return b?`${b} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),W("ERR_INVALID_ARG_TYPE",function(b,p){return`The "${b}" argument must be of type number. Received type ${typeof p}`},TypeError),W("ERR_OUT_OF_RANGE",function(b,p,m){let D=`The value of "${b}" is out of range.`,B=m;return Number.isInteger(m)&&Math.abs(m)>2**32?B=w(String(m)):typeof m=="bigint"&&(B=String(m),(m>BigInt(2)**BigInt(32)||m<-(BigInt(2)**BigInt(32)))&&(B=w(B)),B+="n"),D+=` It must be ${p}. Received ${B}`,D},RangeError);function w(b){let p="",m=b.length;const D=b[0]==="-"?1:0;for(;m>=D+4;m-=3)p=`_${b.slice(m-3,m)}${p}`;return`${b.slice(0,m)}${p}`}function j(b,p,m){ve(p,"offset"),(b[p]===void 0||b[p+m]===void 0)&&Me(p,b.length-(m+1))}function we(b,p,m,D,B,G){if(b>m||b<p){const Q=typeof p=="bigint"?"n":"";let Ee;throw G>3?p===0||p===BigInt(0)?Ee=`>= 0${Q} and < 2${Q} ** ${(G+1)*8}${Q}`:Ee=`>= -(2${Q} ** ${(G+1)*8-1}${Q}) and < 2 ** ${(G+1)*8-1}${Q}`:Ee=`>= ${p}${Q} and <= ${m}${Q}`,new J.ERR_OUT_OF_RANGE("value",Ee,b)}j(D,B,G)}function ve(b,p){if(typeof b!="number")throw new J.ERR_INVALID_ARG_TYPE(p,"number",b)}function Me(b,p,m){throw Math.floor(b)!==b?(ve(b,m),new J.ERR_OUT_OF_RANGE(m||"offset","an integer",b)):p<0?new J.ERR_BUFFER_OUT_OF_BOUNDS:new J.ERR_OUT_OF_RANGE(m||"offset",`>= ${m?1:0} and <= ${p}`,b)}const nt=/[^+/0-9A-Za-z-_]/g;function at(b){if(b=b.split("=")[0],b=b.trim().replace(nt,""),b.length<2)return"";for(;b.length%4!==0;)b=b+"=";return b}function Ge(b,p){p=p||1/0;let m;const D=b.length;let B=null;const G=[];for(let Q=0;Q<D;++Q){if(m=b.charCodeAt(Q),m>55295&&m<57344){if(!B){if(m>56319){(p-=3)>-1&&G.push(239,191,189);continue}else if(Q+1===D){(p-=3)>-1&&G.push(239,191,189);continue}B=m;continue}if(m<56320){(p-=3)>-1&&G.push(239,191,189),B=m;continue}m=(B-55296<<10|m-56320)+65536}else B&&(p-=3)>-1&&G.push(239,191,189);if(B=null,m<128){if((p-=1)<0)break;G.push(m)}else if(m<2048){if((p-=2)<0)break;G.push(m>>6|192,m&63|128)}else if(m<65536){if((p-=3)<0)break;G.push(m>>12|224,m>>6&63|128,m&63|128)}else if(m<1114112){if((p-=4)<0)break;G.push(m>>18|240,m>>12&63|128,m>>6&63|128,m&63|128)}else throw new Error("Invalid code point")}return G}function Dt(b){const p=[];for(let m=0;m<b.length;++m)p.push(b.charCodeAt(m)&255);return p}function Pt(b,p){let m,D,B;const G=[];for(let Q=0;Q<b.length&&!((p-=2)<0);++Q)m=b.charCodeAt(Q),D=m>>8,B=m%256,G.push(B),G.push(D);return G}function Je(b){return e.toByteArray(at(b))}function He(b,p,m,D){let B;for(B=0;B<D&&!(B+m>=p.length||B>=b.length);++B)p[B+m]=b[B];return B}function ke(b,p){return b instanceof p||b!=null&&b.constructor!=null&&b.constructor.name!=null&&b.constructor.name===p.name}function Ke(b){return b!==b}const rt=function(){const b="0123456789abcdef",p=new Array(256);for(let m=0;m<16;++m){const D=m*16;for(let B=0;B<16;++B)p[D+B]=b[m]+b[B]}return p}();function Ue(b){return typeof BigInt>"u"?Ze:b}function Ze(){throw new Error("BigInt not supported")}})(S3);let zh;const Ft={ethereumClient:void 0,setEthereumClient(t){zh=t},client(){if(zh)return zh;throw new Error("ClientCtrl has no client set")}},wr=Ln({history:["ConnectWallet"],view:"ConnectWallet",data:void 0}),tt={state:wr,subscribe(t){return Zn(wr,()=>t(wr))},push(t,e){t!==wr.view&&(wr.view=t,e&&(wr.data=e),wr.history.push(t))},reset(t){wr.view=t,wr.history=[t]},replace(t){wr.history.length>1&&(wr.history[wr.history.length-1]=t,wr.view=t)},goBack(){if(wr.history.length>1){wr.history.pop();const[t]=wr.history.slice(-1);wr.view=t}},setData(t){wr.data=t}},Ae={WALLETCONNECT_DEEPLINK_CHOICE:"WALLETCONNECT_DEEPLINK_CHOICE",W3M_VERSION:"W3M_VERSION",W3M_PREFER_INJECTED_URL_FLAG:"w3mPreferInjected",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 Ae.isMobile()&&navigator.userAgent.toLowerCase().includes("android")},isIos(){const t=navigator.userAgent.toLowerCase();return Ae.isMobile()&&(t.includes("iphone")||t.includes("ipad"))},isHttpUrl(t){return t.startsWith("http://")||t.startsWith("https://")},isArray(t){return Array.isArray(t)&&t.length>0},formatNativeUrl(t,e,r){if(Ae.isHttpUrl(t))return this.formatUniversalUrl(t,e,r);let n=t;n.includes("://")||(n=t.replaceAll("/","").replaceAll(":",""),n=`${n}://`),this.setWalletConnectDeepLink(n,r);const i=encodeURIComponent(e);return`${n}wc?uri=${i}`},formatUniversalUrl(t,e,r){if(!Ae.isHttpUrl(t))return this.formatNativeUrl(t,e,r);let n=t;t.endsWith("/")&&(n=t.slice(0,-1)),this.setWalletConnectDeepLink(n,r);const i=encodeURIComponent(e);return`${n}/wc?uri=${i}`},async wait(t){return new Promise(e=>{setTimeout(e,t)})},openHref(t,e){window.open(t,e,"noreferrer noopener")},setWalletConnectDeepLink(t,e){localStorage.setItem(Ae.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:t,name:e}))},setWalletConnectAndroidDeepLink(t){const[e]=t.split("?");localStorage.setItem(Ae.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:e,name:"Android"}))},removeWalletConnectDeepLink(){localStorage.removeItem(Ae.WALLETCONNECT_DEEPLINK_CHOICE)},setWeb3ModalVersionInStorage(){typeof localStorage<"u"&&localStorage.setItem(Ae.W3M_VERSION,"2.4.2")},getWalletRouterData(){var t;const e=(t=tt.state.data)==null?void 0:t.Wallet;if(!e)throw new Error('Missing "Wallet" view data');return e},getSwitchNetworkRouterData(){var t;const e=(t=tt.state.data)==null?void 0:t.SwitchNetwork;if(!e)throw new Error('Missing "SwitchNetwork" view data');return e},isPreferInjectedFlag(){return typeof location<"u"?new URLSearchParams(location.search).has(Ae.W3M_PREFER_INJECTED_URL_FLAG):!1}},FC=typeof location<"u"&&(location.hostname.includes("localhost")||location.protocol.includes("https")),Or=Ln({enabled:FC,userSessionId:"",events:[],connectedWalletId:void 0}),wi={state:Or,subscribe(t){return Zn(Or.events,()=>t(AC(Or.events[Or.events.length-1])))},initialize(){Or.enabled&&typeof crypto<"u"&&(Or.userSessionId=crypto.randomUUID())},setConnectedWalletId(t){Or.connectedWalletId=t},click(t){if(Or.enabled){const e={type:"CLICK",name:t.name,userSessionId:Or.userSessionId,timestamp:Date.now(),data:t};Or.events.push(e)}},track(t){if(Or.enabled){const e={type:"TRACK",name:t.name,userSessionId:Or.userSessionId,timestamp:Date.now(),data:t};Or.events.push(e)}},view(t){if(Or.enabled){const e={type:"VIEW",name:t.name,userSessionId:Or.userSessionId,timestamp:Date.now(),data:t};Or.events.push(e)}}},Ir=Ln({selectedChain:void 0,chains:void 0,standaloneChains:void 0,standaloneUri:void 0,isStandalone:!1,isAuth:!1,isCustomDesktop:!1,isCustomMobile:!1,isDataLoaded:!1,isUiLoaded:!1,isPreferInjected:!1,walletConnectVersion:1}),De={state:Ir,subscribe(t){return Zn(Ir,()=>t(Ir))},setChains(t){Ir.chains=t},setStandaloneChains(t){Ir.standaloneChains=t},setStandaloneUri(t){Ir.standaloneUri=t},getSelectedChain(){const t=Ft.client().getNetwork().chain;return t&&(Ir.selectedChain=t),Ir.selectedChain},setSelectedChain(t){Ir.selectedChain=t},setIsStandalone(t){Ir.isStandalone=t},setIsCustomDesktop(t){Ir.isCustomDesktop=t},setIsCustomMobile(t){Ir.isCustomMobile=t},setIsDataLoaded(t){Ir.isDataLoaded=t},setIsUiLoaded(t){Ir.isUiLoaded=t},setWalletConnectVersion(t){Ir.walletConnectVersion=t},setIsPreferInjected(t){Ir.isPreferInjected=t},setIsAuth(t){Ir.isAuth=t}},Ic=Ln({projectId:"",mobileWallets:void 0,desktopWallets:void 0,walletImages:void 0,chainImages:void 0,tokenImages:void 0,tokenContracts:void 0,standaloneChains:void 0,enableStandaloneMode:!1,enableAuthMode:!1,enableNetworkView:!1,enableAccountView:!0,enableExplorer:!0,defaultChain:void 0,explorerExcludedWalletIds:void 0,explorerRecommendedWalletIds:void 0,termsOfServiceUrl:void 0,privacyPolicyUrl:void 0}),jt={state:Ic,subscribe(t){return Zn(Ic,()=>t(Ic))},setConfig(t){var e,r,n,i;wi.initialize(),De.setStandaloneChains(t.standaloneChains),De.setIsStandalone(!!((e=t.standaloneChains)!=null&&e.length)||!!t.enableStandaloneMode),De.setIsAuth(!!t.enableAuthMode),De.setIsCustomMobile(!!((r=t.mobileWallets)!=null&&r.length)),De.setIsCustomDesktop(!!((n=t.desktopWallets)!=null&&n.length)),De.setWalletConnectVersion((i=t.walletConnectVersion)!=null?i:1),De.state.isStandalone||(De.setChains(Ft.client().chains),De.setIsPreferInjected(Ft.client().isInjectedProviderInstalled()&&Ae.isPreferInjectedFlag())),t.defaultChain&&De.setSelectedChain(t.defaultChain),Ae.setWeb3ModalVersionInStorage(),Object.assign(Ic,t)}},zt=Ln({address:void 0,profileName:void 0,profileAvatar:void 0,profileLoading:!1,balanceLoading:!1,balance:void 0,isConnected:!1}),xt={state:zt,subscribe(t){return Zn(zt,()=>t(zt))},getAccount(){const t=Ft.client().getAccount();zt.address=t.address,zt.isConnected=t.isConnected},async fetchProfile(t,e){var r;try{zt.profileLoading=!0;const n=e??zt.address,i=(r=De.state.chains)==null?void 0:r.find(o=>o.id===1);if(n&&i){const o=await Ft.client().fetchEnsName({address:n,chainId:1});if(o){const c=await Ft.client().fetchEnsAvatar({name:o,chainId:1});c&&await t(c),zt.profileAvatar=c}zt.profileName=o}}finally{zt.profileLoading=!1}},async fetchBalance(t){try{const{chain:e}=Ft.client().getNetwork(),{tokenContracts:r}=jt.state;let n;e&&r&&(n=r[e.id]),zt.balanceLoading=!0;const i=t??zt.address;if(i){const o=await Ft.client().fetchBalance({address:i,token:n});zt.balance={amount:o.formatted,symbol:o.symbol}}}finally{zt.balanceLoading=!1}},setAddress(t){zt.address=t},setIsConnected(t){zt.isConnected=t},resetBalance(){zt.balance=void 0},resetAccount(){zt.address=void 0,zt.isConnected=!1,zt.profileName=void 0,zt.profileAvatar=void 0,zt.balance=void 0}},Wh="https://explorer-api.walletconnect.com";async function Ac(t,e){const r=new URL(t,Wh);return r.searchParams.append("projectId",jt.state.projectId),Object.entries(e).forEach(([n,i])=>{i&&r.searchParams.append(n,String(i))}),(await fetch(r)).json()}const vi={async getDesktopListings(t){return Ac("/w3m/v1/getDesktopListings",t)},async getMobileListings(t){return Ac("/w3m/v1/getMobileListings",t)},async getInjectedListings(t){return Ac("/w3m/v1/getInjectedListings",t)},async getAllListings(t){return Ac("/w3m/v1/getAllListings",t)},getWalletImageUrl(t){return`${Wh}/w3m/v1/getWalletImage/${t}?projectId=${jt.state.projectId}`},getAssetImageUrl(t){return`${Wh}/w3m/v1/getAssetImage/${t}?projectId=${jt.state.projectId}`}};var LC=Object.defineProperty,P3=Object.getOwnPropertySymbols,MC=Object.prototype.hasOwnProperty,UC=Object.prototype.propertyIsEnumerable,T3=(t,e,r)=>e in t?LC(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,jC=(t,e)=>{for(var r in e||(e={}))MC.call(e,r)&&T3(t,r,e[r]);if(P3)for(var r of P3(e))UC.call(e,r)&&T3(t,r,e[r]);return t};const R3=Ae.isMobile(),fn=Ln({wallets:{listings:[],total:0,page:1},injectedWallets:[],search:{listings:[],total:0,page:1},recomendedWallets:[]}),ir={state:fn,async getRecomendedWallets(){const{explorerRecommendedWalletIds:t,explorerExcludedWalletIds:e}=jt.state;if(t==="NONE"||e==="ALL"&&!t)return fn.recomendedWallets;if(Ae.isArray(t)){const r={recommendedIds:t.join(",")},{listings:n}=await vi.getAllListings(r),i=Object.values(n);i.sort((o,c)=>{const l=t.indexOf(o.id),h=t.indexOf(c.id);return l-h}),fn.recomendedWallets=i}else{const{standaloneChains:r,walletConnectVersion:n,isAuth:i}=De.state,o=r?.join(","),c=Ae.isArray(e),l={page:1,sdks:i?"auth_v1":void 0,entries:Ae.RECOMMENDED_WALLET_AMOUNT,chains:o,version:n,excludedIds:c?e.join(","):void 0},{listings:h}=R3?await vi.getMobileListings(l):await vi.getDesktopListings(l);fn.recomendedWallets=Object.values(h)}return fn.recomendedWallets},async getWallets(t){const e=jC({},t),{explorerRecommendedWalletIds:r,explorerExcludedWalletIds:n}=jt.state,{recomendedWallets:i}=fn;if(n==="ALL")return fn.wallets;e.search||(i.length?e.excludedIds=i.map(x=>x.id).join(","):Ae.isArray(r)&&(e.excludedIds=r.join(","))),Ae.isArray(n)&&(e.excludedIds=[e.excludedIds,n].filter(Boolean).join(",")),De.state.isAuth&&(e.sdks="auth_v1");const{page:o,search:c}=t,{listings:l,total:h}=R3?await vi.getMobileListings(e):await vi.getDesktopListings(e),d=Object.values(l),v=c?"search":"wallets";return fn[v]={listings:[...fn[v].listings,...d],total:h,page:o??1},{listings:d,total:h}},async getInjectedWallets(){const{listings:t}=await vi.getInjectedListings({}),e=Object.values(t);return fn.injectedWallets=e,fn.injectedWallets},getWalletImageUrl(t){return vi.getWalletImageUrl(t)},getAssetImageUrl(t){return vi.getAssetImageUrl(t)},resetSearch(){fn.search={listings:[],total:0,page:1}}},Qo=Ln({pairingUri:"",pairingError:!1}),fr={state:Qo,subscribe(t){return Zn(Qo,()=>t(Qo))},setPairingUri(t){Qo.pairingUri=t},setPairingError(t){Qo.pairingError=t}},Ls=Ln({open:!1}),Fr={state:Ls,subscribe(t){return Zn(Ls,()=>t(Ls))},async open(t){return new Promise(e=>{const{isStandalone:r,isUiLoaded:n,isDataLoaded:i,isPreferInjected:o,selectedChain:c}=De.state,{isConnected:l}=xt.state,{enableNetworkView:h}=jt.state;if(r)De.setStandaloneUri(t?.uri),De.setStandaloneChains(t?.standaloneChains),tt.reset("ConnectWallet");else if(t!=null&&t.route)tt.reset(t.route);else if(l)tt.reset("Account");else if(h)tt.reset("SelectNetwork");else if(o){Ft.client().connectConnector("injected",c?.id).catch(v=>console.error(v)),e();return}else tt.reset("ConnectWallet");const{pairingUri:d}=fr.state;if(n&&i&&(r||d||l))Ls.open=!0,e();else{const v=setInterval(()=>{const x=De.state,_=fr.state;x.isUiLoaded&&x.isDataLoaded&&(x.isStandalone||_.pairingUri||l)&&(clearInterval(v),Ls.open=!0,e())},200)}})},close(){Ls.open=!1}};var BC=Object.defineProperty,N3=Object.getOwnPropertySymbols,kC=Object.prototype.hasOwnProperty,HC=Object.prototype.propertyIsEnumerable,F3=(t,e,r)=>e in t?BC(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,zC=(t,e)=>{for(var r in e||(e={}))kC.call(e,r)&&F3(t,r,e[r]);if(N3)for(var r of N3(e))HC.call(e,r)&&F3(t,r,e[r]);return t};function WC(){return typeof matchMedia<"u"&&matchMedia("(prefers-color-scheme: dark)").matches}const ea=Ln({themeMode:WC()?"dark":"light"}),Un={state:ea,subscribe(t){return Zn(ea,()=>t(ea))},setThemeConfig(t){const{themeMode:e,themeVariables:r}=t;e&&(ea.themeMode=e),r&&(ea.themeVariables=zC({},r))}},Zi=Ln({open:!1,message:"",variant:"success"}),Wr={state:Zi,subscribe(t){return Zn(Zi,()=>t(Zi))},openToast(t,e){Zi.open=!0,Zi.message=t,Zi.variant=e},closeToast(){Zi.open=!1}};typeof window<"u"&&(window.Buffer||(window.Buffer=S3.Buffer),window.global||(window.global=window),window.process||(window.process={env:{}}));var qC=Object.defineProperty,L3=Object.getOwnPropertySymbols,VC=Object.prototype.hasOwnProperty,KC=Object.prototype.propertyIsEnumerable,M3=(t,e,r)=>e in t?qC(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,GC=(t,e)=>{for(var r in e||(e={}))VC.call(e,r)&&M3(t,r,e[r]);if(L3)for(var r of L3(e))KC.call(e,r)&&M3(t,r,e[r]);return t};class ZC{constructor(e){this.openModal=Fr.open,this.closeModal=Fr.close,this.subscribeModal=Fr.subscribe,this.setTheme=Un.setThemeConfig,Un.setThemeConfig(e),jt.setConfig(GC({enableStandaloneMode:!0},e)),this.initUi()}async initUi(){if(typeof window<"u"){await Promise.resolve().then(function(){return ID});const e=document.createElement("w3m-modal");document.body.insertAdjacentElement("beforeend",e),De.setIsUiLoaded(!0)}}}var YC=Object.freeze({__proto__:null,WalletConnectModal:ZC});/**
104
104
  * @license
105
105
  * Copyright 2019 Google LLC
106
106
  * SPDX-License-Identifier: BSD-3-Clause
107
- */const vc=window,Ph=vc.ShadowRoot&&(vc.ShadyCSS===void 0||vc.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Th=Symbol(),Gg=new WeakMap;class Zg{constructor(e,r,n){if(this._$cssResult$=!0,n!==Th)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=r}get styleSheet(){let e=this.o;const r=this.t;if(Ph&&e===void 0){const n=r!==void 0&&r.length===1;n&&(e=Gg.get(r)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&Gg.set(r,e))}return e}toString(){return this.cssText}}const Lx=t=>new Zg(typeof t=="string"?t:t+"",void 0,Th),Ve=(t,...e)=>{const r=t.length===1?t[0]:e.reduce((n,i,o)=>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)+t[o+1],t[0]);return new Zg(r,t,Th)},Mx=(t,e)=>{Ph?t.adoptedStyleSheets=e.map(r=>r instanceof CSSStyleSheet?r:r.styleSheet):e.forEach(r=>{const n=document.createElement("style"),i=vc.litNonce;i!==void 0&&n.setAttribute("nonce",i),n.textContent=r.cssText,t.appendChild(n)})},Yg=Ph?t=>t:t=>t instanceof CSSStyleSheet?(e=>{let r="";for(const n of e.cssRules)r+=n.cssText;return Lx(r)})(t):t;/**
107
+ */const $c=window,qh=$c.ShadowRoot&&($c.ShadyCSS===void 0||$c.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Vh=Symbol(),U3=new WeakMap;class j3{constructor(e,r,n){if(this._$cssResult$=!0,n!==Vh)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=r}get styleSheet(){let e=this.o;const r=this.t;if(qh&&e===void 0){const n=r!==void 0&&r.length===1;n&&(e=U3.get(r)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&U3.set(r,e))}return e}toString(){return this.cssText}}const JC=t=>new j3(typeof t=="string"?t:t+"",void 0,Vh),Ve=(t,...e)=>{const r=t.length===1?t[0]:e.reduce((n,i,o)=>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)+t[o+1],t[0]);return new j3(r,t,Vh)},XC=(t,e)=>{qh?t.adoptedStyleSheets=e.map(r=>r instanceof CSSStyleSheet?r:r.styleSheet):e.forEach(r=>{const n=document.createElement("style"),i=$c.litNonce;i!==void 0&&n.setAttribute("nonce",i),n.textContent=r.cssText,t.appendChild(n)})},B3=qh?t=>t:t=>t instanceof CSSStyleSheet?(e=>{let r="";for(const n of e.cssRules)r+=n.cssText;return JC(r)})(t):t;/**
108
108
  * @license
109
109
  * Copyright 2017 Google LLC
110
110
  * SPDX-License-Identifier: BSD-3-Clause
111
- */var Nh;const yc=window,Jg=yc.trustedTypes,Ux=Jg?Jg.emptyScript:"",Xg=yc.reactiveElementPolyfillSupport,Rh={toAttribute(t,e){switch(e){case Boolean:t=t?Ux:null;break;case Object:case Array:t=t==null?t:JSON.stringify(t)}return t},fromAttribute(t,e){let r=t;switch(e){case Boolean:r=t!==null;break;case Number:r=t===null?null:Number(t);break;case Object:case Array:try{r=JSON.parse(t)}catch{r=null}}return r}},Qg=(t,e)=>e!==t&&(e==e||t==t),Lh={attribute:!0,type:String,converter:Rh,reflect:!1,hasChanged:Qg};class Rs extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this.u()}static addInitializer(e){var r;this.finalize(),((r=this.h)!==null&&r!==void 0?r:this.h=[]).push(e)}static get observedAttributes(){this.finalize();const e=[];return this.elementProperties.forEach((r,n)=>{const i=this._$Ep(n,r);i!==void 0&&(this._$Ev.set(i,n),e.push(i))}),e}static createProperty(e,r=Lh){if(r.state&&(r.attribute=!1),this.finalize(),this.elementProperties.set(e,r),!r.noAccessor&&!this.prototype.hasOwnProperty(e)){const n=typeof e=="symbol"?Symbol():"__"+e,i=this.getPropertyDescriptor(e,n,r);i!==void 0&&Object.defineProperty(this.prototype,e,i)}}static getPropertyDescriptor(e,r,n){return{get(){return this[r]},set(i){const o=this[e];this[r]=i,this.requestUpdate(e,o,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)||Lh}static finalize(){if(this.hasOwnProperty("finalized"))return!1;this.finalized=!0;const e=Object.getPrototypeOf(this);if(e.finalize(),e.h!==void 0&&(this.h=[...e.h]),this.elementProperties=new Map(e.elementProperties),this._$Ev=new Map,this.hasOwnProperty("properties")){const r=this.properties,n=[...Object.getOwnPropertyNames(r),...Object.getOwnPropertySymbols(r)];for(const i of n)this.createProperty(i,r[i])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(e){const r=[];if(Array.isArray(e)){const n=new Set(e.flat(1/0).reverse());for(const i of n)r.unshift(Yg(i))}else e!==void 0&&r.push(Yg(e));return r}static _$Ep(e,r){const n=r.attribute;return n===!1?void 0:typeof n=="string"?n:typeof e=="string"?e.toLowerCase():void 0}u(){var e;this._$E_=new Promise(r=>this.enableUpdating=r),this._$AL=new Map,this._$Eg(),this.requestUpdate(),(e=this.constructor.h)===null||e===void 0||e.forEach(r=>r(this))}addController(e){var r,n;((r=this._$ES)!==null&&r!==void 0?r:this._$ES=[]).push(e),this.renderRoot!==void 0&&this.isConnected&&((n=e.hostConnected)===null||n===void 0||n.call(e))}removeController(e){var r;(r=this._$ES)===null||r===void 0||r.splice(this._$ES.indexOf(e)>>>0,1)}_$Eg(){this.constructor.elementProperties.forEach((e,r)=>{this.hasOwnProperty(r)&&(this._$Ei.set(r,this[r]),delete this[r])})}createRenderRoot(){var e;const r=(e=this.shadowRoot)!==null&&e!==void 0?e:this.attachShadow(this.constructor.shadowRootOptions);return Mx(r,this.constructor.elementStyles),r}connectedCallback(){var e;this.renderRoot===void 0&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(e=this._$ES)===null||e===void 0||e.forEach(r=>{var n;return(n=r.hostConnected)===null||n===void 0?void 0:n.call(r)})}enableUpdating(e){}disconnectedCallback(){var e;(e=this._$ES)===null||e===void 0||e.forEach(r=>{var n;return(n=r.hostDisconnected)===null||n===void 0?void 0:n.call(r)})}attributeChangedCallback(e,r,n){this._$AK(e,n)}_$EO(e,r,n=Lh){var i;const o=this.constructor._$Ep(e,n);if(o!==void 0&&n.reflect===!0){const c=(((i=n.converter)===null||i===void 0?void 0:i.toAttribute)!==void 0?n.converter:Rh).toAttribute(r,n.type);this._$El=e,c==null?this.removeAttribute(o):this.setAttribute(o,c),this._$El=null}}_$AK(e,r){var n;const i=this.constructor,o=i._$Ev.get(e);if(o!==void 0&&this._$El!==o){const c=i.getPropertyOptions(o),l=typeof c.converter=="function"?{fromAttribute:c.converter}:((n=c.converter)===null||n===void 0?void 0:n.fromAttribute)!==void 0?c.converter:Rh;this._$El=o,this[o]=l.fromAttribute(r,c.type),this._$El=null}}requestUpdate(e,r,n){let i=!0;e!==void 0&&(((n=n||this.constructor.getPropertyOptions(e)).hasChanged||Qg)(this[e],r)?(this._$AL.has(e)||this._$AL.set(e,r),n.reflect===!0&&this._$El!==e&&(this._$EC===void 0&&(this._$EC=new Map),this._$EC.set(e,n))):i=!1),!this.isUpdatePending&&i&&(this._$E_=this._$Ej())}async _$Ej(){this.isUpdatePending=!0;try{await this._$E_}catch(r){Promise.reject(r)}const e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var e;if(!this.isUpdatePending)return;this.hasUpdated,this._$Ei&&(this._$Ei.forEach((i,o)=>this[o]=i),this._$Ei=void 0);let r=!1;const n=this._$AL;try{r=this.shouldUpdate(n),r?(this.willUpdate(n),(e=this._$ES)===null||e===void 0||e.forEach(i=>{var o;return(o=i.hostUpdate)===null||o===void 0?void 0:o.call(i)}),this.update(n)):this._$Ek()}catch(i){throw r=!1,this._$Ek(),i}r&&this._$AE(n)}willUpdate(e){}_$AE(e){var r;(r=this._$ES)===null||r===void 0||r.forEach(n=>{var i;return(i=n.hostUpdated)===null||i===void 0?void 0:i.call(n)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$Ek(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$E_}shouldUpdate(e){return!0}update(e){this._$EC!==void 0&&(this._$EC.forEach((r,n)=>this._$EO(n,this[n],r)),this._$EC=void 0),this._$Ek()}updated(e){}firstUpdated(e){}}Rs.finalized=!0,Rs.elementProperties=new Map,Rs.elementStyles=[],Rs.shadowRootOptions={mode:"open"},Xg?.({ReactiveElement:Rs}),((Nh=yc.reactiveElementVersions)!==null&&Nh!==void 0?Nh:yc.reactiveElementVersions=[]).push("1.6.1");/**
111
+ */var Kh;const Oc=window,k3=Oc.trustedTypes,QC=k3?k3.emptyScript:"",H3=Oc.reactiveElementPolyfillSupport,Gh={toAttribute(t,e){switch(e){case Boolean:t=t?QC:null;break;case Object:case Array:t=t==null?t:JSON.stringify(t)}return t},fromAttribute(t,e){let r=t;switch(e){case Boolean:r=t!==null;break;case Number:r=t===null?null:Number(t);break;case Object:case Array:try{r=JSON.parse(t)}catch{r=null}}return r}},z3=(t,e)=>e!==t&&(e==e||t==t),Zh={attribute:!0,type:String,converter:Gh,reflect:!1,hasChanged:z3};class Ms extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this.u()}static addInitializer(e){var r;this.finalize(),((r=this.h)!==null&&r!==void 0?r:this.h=[]).push(e)}static get observedAttributes(){this.finalize();const e=[];return this.elementProperties.forEach((r,n)=>{const i=this._$Ep(n,r);i!==void 0&&(this._$Ev.set(i,n),e.push(i))}),e}static createProperty(e,r=Zh){if(r.state&&(r.attribute=!1),this.finalize(),this.elementProperties.set(e,r),!r.noAccessor&&!this.prototype.hasOwnProperty(e)){const n=typeof e=="symbol"?Symbol():"__"+e,i=this.getPropertyDescriptor(e,n,r);i!==void 0&&Object.defineProperty(this.prototype,e,i)}}static getPropertyDescriptor(e,r,n){return{get(){return this[r]},set(i){const o=this[e];this[r]=i,this.requestUpdate(e,o,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)||Zh}static finalize(){if(this.hasOwnProperty("finalized"))return!1;this.finalized=!0;const e=Object.getPrototypeOf(this);if(e.finalize(),e.h!==void 0&&(this.h=[...e.h]),this.elementProperties=new Map(e.elementProperties),this._$Ev=new Map,this.hasOwnProperty("properties")){const r=this.properties,n=[...Object.getOwnPropertyNames(r),...Object.getOwnPropertySymbols(r)];for(const i of n)this.createProperty(i,r[i])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(e){const r=[];if(Array.isArray(e)){const n=new Set(e.flat(1/0).reverse());for(const i of n)r.unshift(B3(i))}else e!==void 0&&r.push(B3(e));return r}static _$Ep(e,r){const n=r.attribute;return n===!1?void 0:typeof n=="string"?n:typeof e=="string"?e.toLowerCase():void 0}u(){var e;this._$E_=new Promise(r=>this.enableUpdating=r),this._$AL=new Map,this._$Eg(),this.requestUpdate(),(e=this.constructor.h)===null||e===void 0||e.forEach(r=>r(this))}addController(e){var r,n;((r=this._$ES)!==null&&r!==void 0?r:this._$ES=[]).push(e),this.renderRoot!==void 0&&this.isConnected&&((n=e.hostConnected)===null||n===void 0||n.call(e))}removeController(e){var r;(r=this._$ES)===null||r===void 0||r.splice(this._$ES.indexOf(e)>>>0,1)}_$Eg(){this.constructor.elementProperties.forEach((e,r)=>{this.hasOwnProperty(r)&&(this._$Ei.set(r,this[r]),delete this[r])})}createRenderRoot(){var e;const r=(e=this.shadowRoot)!==null&&e!==void 0?e:this.attachShadow(this.constructor.shadowRootOptions);return XC(r,this.constructor.elementStyles),r}connectedCallback(){var e;this.renderRoot===void 0&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(e=this._$ES)===null||e===void 0||e.forEach(r=>{var n;return(n=r.hostConnected)===null||n===void 0?void 0:n.call(r)})}enableUpdating(e){}disconnectedCallback(){var e;(e=this._$ES)===null||e===void 0||e.forEach(r=>{var n;return(n=r.hostDisconnected)===null||n===void 0?void 0:n.call(r)})}attributeChangedCallback(e,r,n){this._$AK(e,n)}_$EO(e,r,n=Zh){var i;const o=this.constructor._$Ep(e,n);if(o!==void 0&&n.reflect===!0){const c=(((i=n.converter)===null||i===void 0?void 0:i.toAttribute)!==void 0?n.converter:Gh).toAttribute(r,n.type);this._$El=e,c==null?this.removeAttribute(o):this.setAttribute(o,c),this._$El=null}}_$AK(e,r){var n;const i=this.constructor,o=i._$Ev.get(e);if(o!==void 0&&this._$El!==o){const c=i.getPropertyOptions(o),l=typeof c.converter=="function"?{fromAttribute:c.converter}:((n=c.converter)===null||n===void 0?void 0:n.fromAttribute)!==void 0?c.converter:Gh;this._$El=o,this[o]=l.fromAttribute(r,c.type),this._$El=null}}requestUpdate(e,r,n){let i=!0;e!==void 0&&(((n=n||this.constructor.getPropertyOptions(e)).hasChanged||z3)(this[e],r)?(this._$AL.has(e)||this._$AL.set(e,r),n.reflect===!0&&this._$El!==e&&(this._$EC===void 0&&(this._$EC=new Map),this._$EC.set(e,n))):i=!1),!this.isUpdatePending&&i&&(this._$E_=this._$Ej())}async _$Ej(){this.isUpdatePending=!0;try{await this._$E_}catch(r){Promise.reject(r)}const e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var e;if(!this.isUpdatePending)return;this.hasUpdated,this._$Ei&&(this._$Ei.forEach((i,o)=>this[o]=i),this._$Ei=void 0);let r=!1;const n=this._$AL;try{r=this.shouldUpdate(n),r?(this.willUpdate(n),(e=this._$ES)===null||e===void 0||e.forEach(i=>{var o;return(o=i.hostUpdate)===null||o===void 0?void 0:o.call(i)}),this.update(n)):this._$Ek()}catch(i){throw r=!1,this._$Ek(),i}r&&this._$AE(n)}willUpdate(e){}_$AE(e){var r;(r=this._$ES)===null||r===void 0||r.forEach(n=>{var i;return(i=n.hostUpdated)===null||i===void 0?void 0:i.call(n)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$Ek(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$E_}shouldUpdate(e){return!0}update(e){this._$EC!==void 0&&(this._$EC.forEach((r,n)=>this._$EO(n,this[n],r)),this._$EC=void 0),this._$Ek()}updated(e){}firstUpdated(e){}}Ms.finalized=!0,Ms.elementProperties=new Map,Ms.elementStyles=[],Ms.shadowRootOptions={mode:"open"},H3?.({ReactiveElement:Ms}),((Kh=Oc.reactiveElementVersions)!==null&&Kh!==void 0?Kh:Oc.reactiveElementVersions=[]).push("1.6.1");/**
112
112
  * @license
113
113
  * Copyright 2017 Google LLC
114
114
  * SPDX-License-Identifier: BSD-3-Clause
115
- */var Mh;const bc=window,Ls=bc.trustedTypes,e3=Ls?Ls.createPolicy("lit-html",{createHTML:t=>t}):void 0,Uh="$lit$",vi=`lit$${(Math.random()+"").slice(9)}$`,t3="?"+vi,jx=`<${t3}>`,Gi=document,Go=()=>Gi.createComment(""),Zo=t=>t===null||typeof t!="object"&&typeof t!="function",r3=Array.isArray,Fx=t=>r3(t)||typeof t?.[Symbol.iterator]=="function",jh=`[
116
- \f\r]`,Yo=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,n3=/-->/g,i3=/>/g,Zi=RegExp(`>|${jh}(?:([^\\s"'>=/]+)(${jh}*=${jh}*(?:[^
117
- \f\r"'\`<>=]|("|')|))|$)`,"g"),s3=/'/g,o3=/"/g,a3=/^(?:script|style|textarea|title)$/i,c3=t=>(e,...r)=>({_$litType$:t,strings:e,values:r}),oe=c3(1),ut=c3(2),Yi=Symbol.for("lit-noChange"),wr=Symbol.for("lit-nothing"),l3=new WeakMap,Ji=Gi.createTreeWalker(Gi,129,null,!1),Bx=(t,e)=>{const r=t.length-1,n=[];let i,o=e===2?"<svg>":"",c=Yo;for(let h=0;h<r;h++){const f=t[h];let v,E,_=-1,S=0;for(;S<f.length&&(c.lastIndex=S,E=c.exec(f),E!==null);)S=c.lastIndex,c===Yo?E[1]==="!--"?c=n3:E[1]!==void 0?c=i3:E[2]!==void 0?(a3.test(E[2])&&(i=RegExp("</"+E[2],"g")),c=Zi):E[3]!==void 0&&(c=Zi):c===Zi?E[0]===">"?(c=i??Yo,_=-1):E[1]===void 0?_=-2:(_=c.lastIndex-E[2].length,v=E[1],c=E[3]===void 0?Zi:E[3]==='"'?o3:s3):c===o3||c===s3?c=Zi:c===n3||c===i3?c=Yo:(c=Zi,i=void 0);const P=c===Zi&&t[h+1].startsWith("/>")?" ":"";o+=c===Yo?f+jx:_>=0?(n.push(v),f.slice(0,_)+Uh+f.slice(_)+vi+P):f+vi+(_===-2?(n.push(void 0),h):P)}const l=o+(t[r]||"<?>")+(e===2?"</svg>":"");if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return[e3!==void 0?e3.createHTML(l):l,n]};class Jo{constructor({strings:e,_$litType$:r},n){let i;this.parts=[];let o=0,c=0;const l=e.length-1,h=this.parts,[f,v]=Bx(e,r);if(this.el=Jo.createElement(f,n),Ji.currentNode=this.el.content,r===2){const E=this.el.content,_=E.firstChild;_.remove(),E.append(..._.childNodes)}for(;(i=Ji.nextNode())!==null&&h.length<l;){if(i.nodeType===1){if(i.hasAttributes()){const E=[];for(const _ of i.getAttributeNames())if(_.endsWith(Uh)||_.startsWith(vi)){const S=v[c++];if(E.push(_),S!==void 0){const P=i.getAttribute(S.toLowerCase()+Uh).split(vi),j=/([.?@])?(.*)/.exec(S);h.push({type:1,index:o,name:j[2],strings:P,ctor:j[1]==="."?Hx:j[1]==="?"?Wx:j[1]==="@"?qx:_c})}else h.push({type:6,index:o})}for(const _ of E)i.removeAttribute(_)}if(a3.test(i.tagName)){const E=i.textContent.split(vi),_=E.length-1;if(_>0){i.textContent=Ls?Ls.emptyScript:"";for(let S=0;S<_;S++)i.append(E[S],Go()),Ji.nextNode(),h.push({type:2,index:++o});i.append(E[_],Go())}}}else if(i.nodeType===8)if(i.data===t3)h.push({type:2,index:o});else{let E=-1;for(;(E=i.data.indexOf(vi,E+1))!==-1;)h.push({type:7,index:o}),E+=vi.length-1}o++}}static createElement(e,r){const n=Gi.createElement("template");return n.innerHTML=e,n}}function Ms(t,e,r=t,n){var i,o,c,l;if(e===Yi)return e;let h=n!==void 0?(i=r._$Co)===null||i===void 0?void 0:i[n]:r._$Cl;const f=Zo(e)?void 0:e._$litDirective$;return h?.constructor!==f&&((o=h?._$AO)===null||o===void 0||o.call(h,!1),f===void 0?h=void 0:(h=new f(t),h._$AT(t,r,n)),n!==void 0?((c=(l=r)._$Co)!==null&&c!==void 0?c:l._$Co=[])[n]=h:r._$Cl=h),h!==void 0&&(e=Ms(t,h._$AS(t,e.values),h,n)),e}class kx{constructor(e,r){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=r}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){var r;const{el:{content:n},parts:i}=this._$AD,o=((r=e?.creationScope)!==null&&r!==void 0?r:Gi).importNode(n,!0);Ji.currentNode=o;let c=Ji.nextNode(),l=0,h=0,f=i[0];for(;f!==void 0;){if(l===f.index){let v;f.type===2?v=new Xo(c,c.nextSibling,this,e):f.type===1?v=new f.ctor(c,f.name,f.strings,this,e):f.type===6&&(v=new Vx(c,this,e)),this._$AV.push(v),f=i[++h]}l!==f?.index&&(c=Ji.nextNode(),l++)}return Ji.currentNode=Gi,o}v(e){let r=0;for(const n of this._$AV)n!==void 0&&(n.strings!==void 0?(n._$AI(e,n,r),r+=n.strings.length-2):n._$AI(e[r])),r++}}class Xo{constructor(e,r,n,i){var o;this.type=2,this._$AH=wr,this._$AN=void 0,this._$AA=e,this._$AB=r,this._$AM=n,this.options=i,this._$Cp=(o=i?.isConnected)===null||o===void 0||o}get _$AU(){var e,r;return(r=(e=this._$AM)===null||e===void 0?void 0:e._$AU)!==null&&r!==void 0?r:this._$Cp}get parentNode(){let e=this._$AA.parentNode;const r=this._$AM;return r!==void 0&&e?.nodeType===11&&(e=r.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,r=this){e=Ms(this,e,r),Zo(e)?e===wr||e==null||e===""?(this._$AH!==wr&&this._$AR(),this._$AH=wr):e!==this._$AH&&e!==Yi&&this._(e):e._$litType$!==void 0?this.g(e):e.nodeType!==void 0?this.$(e):Fx(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!==wr&&Zo(this._$AH)?this._$AA.nextSibling.data=e:this.$(Gi.createTextNode(e)),this._$AH=e}g(e){var r;const{values:n,_$litType$:i}=e,o=typeof i=="number"?this._$AC(e):(i.el===void 0&&(i.el=Jo.createElement(i.h,this.options)),i);if(((r=this._$AH)===null||r===void 0?void 0:r._$AD)===o)this._$AH.v(n);else{const c=new kx(o,this),l=c.u(this.options);c.v(n),this.$(l),this._$AH=c}}_$AC(e){let r=l3.get(e.strings);return r===void 0&&l3.set(e.strings,r=new Jo(e)),r}T(e){r3(this._$AH)||(this._$AH=[],this._$AR());const r=this._$AH;let n,i=0;for(const o of e)i===r.length?r.push(n=new Xo(this.k(Go()),this.k(Go()),this,this.options)):n=r[i],n._$AI(o),i++;i<r.length&&(this._$AR(n&&n._$AB.nextSibling,i),r.length=i)}_$AR(e=this._$AA.nextSibling,r){var n;for((n=this._$AP)===null||n===void 0||n.call(this,!1,!0,r);e&&e!==this._$AB;){const i=e.nextSibling;e.remove(),e=i}}setConnected(e){var r;this._$AM===void 0&&(this._$Cp=e,(r=this._$AP)===null||r===void 0||r.call(this,e))}}class _c{constructor(e,r,n,i,o){this.type=1,this._$AH=wr,this._$AN=void 0,this.element=e,this.name=r,this._$AM=i,this.options=o,n.length>2||n[0]!==""||n[1]!==""?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=wr}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(e,r=this,n,i){const o=this.strings;let c=!1;if(o===void 0)e=Ms(this,e,r,0),c=!Zo(e)||e!==this._$AH&&e!==Yi,c&&(this._$AH=e);else{const l=e;let h,f;for(e=o[0],h=0;h<o.length-1;h++)f=Ms(this,l[n+h],r,h),f===Yi&&(f=this._$AH[h]),c||(c=!Zo(f)||f!==this._$AH[h]),f===wr?e=wr:e!==wr&&(e+=(f??"")+o[h+1]),this._$AH[h]=f}c&&!i&&this.j(e)}j(e){e===wr?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}}class Hx extends _c{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===wr?void 0:e}}const zx=Ls?Ls.emptyScript:"";class Wx extends _c{constructor(){super(...arguments),this.type=4}j(e){e&&e!==wr?this.element.setAttribute(this.name,zx):this.element.removeAttribute(this.name)}}class qx extends _c{constructor(e,r,n,i,o){super(e,r,n,i,o),this.type=5}_$AI(e,r=this){var n;if((e=(n=Ms(this,e,r,0))!==null&&n!==void 0?n:wr)===Yi)return;const i=this._$AH,o=e===wr&&i!==wr||e.capture!==i.capture||e.once!==i.once||e.passive!==i.passive,c=e!==wr&&(i===wr||o);o&&this.element.removeEventListener(this.name,this,i),c&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){var r,n;typeof this._$AH=="function"?this._$AH.call((n=(r=this.options)===null||r===void 0?void 0:r.host)!==null&&n!==void 0?n:this.element,e):this._$AH.handleEvent(e)}}class Vx{constructor(e,r,n){this.element=e,this.type=6,this._$AN=void 0,this._$AM=r,this.options=n}get _$AU(){return this._$AM._$AU}_$AI(e){Ms(this,e)}}const u3=bc.litHtmlPolyfillSupport;u3?.(Jo,Xo),((Mh=bc.litHtmlVersions)!==null&&Mh!==void 0?Mh:bc.litHtmlVersions=[]).push("2.7.4");const Kx=(t,e,r)=>{var n,i;const o=(n=r?.renderBefore)!==null&&n!==void 0?n:e;let c=o._$litPart$;if(c===void 0){const l=(i=r?.renderBefore)!==null&&i!==void 0?i:null;o._$litPart$=c=new Xo(e.insertBefore(Go(),l),l,void 0,r??{})}return c._$AI(t),c};/**
115
+ */var Yh;const Sc=window,Us=Sc.trustedTypes,W3=Us?Us.createPolicy("lit-html",{createHTML:t=>t}):void 0,Jh="$lit$",yi=`lit$${(Math.random()+"").slice(9)}$`,q3="?"+yi,eI=`<${q3}>`,Yi=document,ta=()=>Yi.createComment(""),ra=t=>t===null||typeof t!="object"&&typeof t!="function",V3=Array.isArray,tI=t=>V3(t)||typeof t?.[Symbol.iterator]=="function",Xh=`[
116
+ \f\r]`,na=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,K3=/-->/g,G3=/>/g,Ji=RegExp(`>|${Xh}(?:([^\\s"'>=/]+)(${Xh}*=${Xh}*(?:[^
117
+ \f\r"'\`<>=]|("|')|))|$)`,"g"),Z3=/'/g,Y3=/"/g,J3=/^(?:script|style|textarea|title)$/i,X3=t=>(e,...r)=>({_$litType$:t,strings:e,values:r}),oe=X3(1),ut=X3(2),Xi=Symbol.for("lit-noChange"),vr=Symbol.for("lit-nothing"),Q3=new WeakMap,Qi=Yi.createTreeWalker(Yi,129,null,!1),rI=(t,e)=>{const r=t.length-1,n=[];let i,o=e===2?"<svg>":"",c=na;for(let h=0;h<r;h++){const d=t[h];let v,x,_=-1,A=0;for(;A<d.length&&(c.lastIndex=A,x=c.exec(d),x!==null);)A=c.lastIndex,c===na?x[1]==="!--"?c=K3:x[1]!==void 0?c=G3:x[2]!==void 0?(J3.test(x[2])&&(i=RegExp("</"+x[2],"g")),c=Ji):x[3]!==void 0&&(c=Ji):c===Ji?x[0]===">"?(c=i??na,_=-1):x[1]===void 0?_=-2:(_=c.lastIndex-x[2].length,v=x[1],c=x[3]===void 0?Ji:x[3]==='"'?Y3:Z3):c===Y3||c===Z3?c=Ji:c===K3||c===G3?c=na:(c=Ji,i=void 0);const P=c===Ji&&t[h+1].startsWith("/>")?" ":"";o+=c===na?d+eI:_>=0?(n.push(v),d.slice(0,_)+Jh+d.slice(_)+yi+P):d+yi+(_===-2?(n.push(void 0),h):P)}const l=o+(t[r]||"<?>")+(e===2?"</svg>":"");if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return[W3!==void 0?W3.createHTML(l):l,n]};class ia{constructor({strings:e,_$litType$:r},n){let i;this.parts=[];let o=0,c=0;const l=e.length-1,h=this.parts,[d,v]=rI(e,r);if(this.el=ia.createElement(d,n),Qi.currentNode=this.el.content,r===2){const x=this.el.content,_=x.firstChild;_.remove(),x.append(..._.childNodes)}for(;(i=Qi.nextNode())!==null&&h.length<l;){if(i.nodeType===1){if(i.hasAttributes()){const x=[];for(const _ of i.getAttributeNames())if(_.endsWith(Jh)||_.startsWith(yi)){const A=v[c++];if(x.push(_),A!==void 0){const P=i.getAttribute(A.toLowerCase()+Jh).split(yi),L=/([.?@])?(.*)/.exec(A);h.push({type:1,index:o,name:L[2],strings:P,ctor:L[1]==="."?iI:L[1]==="?"?oI:L[1]==="@"?aI:Dc})}else h.push({type:6,index:o})}for(const _ of x)i.removeAttribute(_)}if(J3.test(i.tagName)){const x=i.textContent.split(yi),_=x.length-1;if(_>0){i.textContent=Us?Us.emptyScript:"";for(let A=0;A<_;A++)i.append(x[A],ta()),Qi.nextNode(),h.push({type:2,index:++o});i.append(x[_],ta())}}}else if(i.nodeType===8)if(i.data===q3)h.push({type:2,index:o});else{let x=-1;for(;(x=i.data.indexOf(yi,x+1))!==-1;)h.push({type:7,index:o}),x+=yi.length-1}o++}}static createElement(e,r){const n=Yi.createElement("template");return n.innerHTML=e,n}}function js(t,e,r=t,n){var i,o,c,l;if(e===Xi)return e;let h=n!==void 0?(i=r._$Co)===null||i===void 0?void 0:i[n]:r._$Cl;const d=ra(e)?void 0:e._$litDirective$;return h?.constructor!==d&&((o=h?._$AO)===null||o===void 0||o.call(h,!1),d===void 0?h=void 0:(h=new d(t),h._$AT(t,r,n)),n!==void 0?((c=(l=r)._$Co)!==null&&c!==void 0?c:l._$Co=[])[n]=h:r._$Cl=h),h!==void 0&&(e=js(t,h._$AS(t,e.values),h,n)),e}class nI{constructor(e,r){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=r}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){var r;const{el:{content:n},parts:i}=this._$AD,o=((r=e?.creationScope)!==null&&r!==void 0?r:Yi).importNode(n,!0);Qi.currentNode=o;let c=Qi.nextNode(),l=0,h=0,d=i[0];for(;d!==void 0;){if(l===d.index){let v;d.type===2?v=new sa(c,c.nextSibling,this,e):d.type===1?v=new d.ctor(c,d.name,d.strings,this,e):d.type===6&&(v=new cI(c,this,e)),this._$AV.push(v),d=i[++h]}l!==d?.index&&(c=Qi.nextNode(),l++)}return Qi.currentNode=Yi,o}v(e){let r=0;for(const n of this._$AV)n!==void 0&&(n.strings!==void 0?(n._$AI(e,n,r),r+=n.strings.length-2):n._$AI(e[r])),r++}}class sa{constructor(e,r,n,i){var o;this.type=2,this._$AH=vr,this._$AN=void 0,this._$AA=e,this._$AB=r,this._$AM=n,this.options=i,this._$Cp=(o=i?.isConnected)===null||o===void 0||o}get _$AU(){var e,r;return(r=(e=this._$AM)===null||e===void 0?void 0:e._$AU)!==null&&r!==void 0?r:this._$Cp}get parentNode(){let e=this._$AA.parentNode;const r=this._$AM;return r!==void 0&&e?.nodeType===11&&(e=r.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,r=this){e=js(this,e,r),ra(e)?e===vr||e==null||e===""?(this._$AH!==vr&&this._$AR(),this._$AH=vr):e!==this._$AH&&e!==Xi&&this._(e):e._$litType$!==void 0?this.g(e):e.nodeType!==void 0?this.$(e):tI(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!==vr&&ra(this._$AH)?this._$AA.nextSibling.data=e:this.$(Yi.createTextNode(e)),this._$AH=e}g(e){var r;const{values:n,_$litType$:i}=e,o=typeof i=="number"?this._$AC(e):(i.el===void 0&&(i.el=ia.createElement(i.h,this.options)),i);if(((r=this._$AH)===null||r===void 0?void 0:r._$AD)===o)this._$AH.v(n);else{const c=new nI(o,this),l=c.u(this.options);c.v(n),this.$(l),this._$AH=c}}_$AC(e){let r=Q3.get(e.strings);return r===void 0&&Q3.set(e.strings,r=new ia(e)),r}T(e){V3(this._$AH)||(this._$AH=[],this._$AR());const r=this._$AH;let n,i=0;for(const o of e)i===r.length?r.push(n=new sa(this.k(ta()),this.k(ta()),this,this.options)):n=r[i],n._$AI(o),i++;i<r.length&&(this._$AR(n&&n._$AB.nextSibling,i),r.length=i)}_$AR(e=this._$AA.nextSibling,r){var n;for((n=this._$AP)===null||n===void 0||n.call(this,!1,!0,r);e&&e!==this._$AB;){const i=e.nextSibling;e.remove(),e=i}}setConnected(e){var r;this._$AM===void 0&&(this._$Cp=e,(r=this._$AP)===null||r===void 0||r.call(this,e))}}class Dc{constructor(e,r,n,i,o){this.type=1,this._$AH=vr,this._$AN=void 0,this.element=e,this.name=r,this._$AM=i,this.options=o,n.length>2||n[0]!==""||n[1]!==""?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=vr}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(e,r=this,n,i){const o=this.strings;let c=!1;if(o===void 0)e=js(this,e,r,0),c=!ra(e)||e!==this._$AH&&e!==Xi,c&&(this._$AH=e);else{const l=e;let h,d;for(e=o[0],h=0;h<o.length-1;h++)d=js(this,l[n+h],r,h),d===Xi&&(d=this._$AH[h]),c||(c=!ra(d)||d!==this._$AH[h]),d===vr?e=vr:e!==vr&&(e+=(d??"")+o[h+1]),this._$AH[h]=d}c&&!i&&this.j(e)}j(e){e===vr?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}}class iI extends Dc{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===vr?void 0:e}}const sI=Us?Us.emptyScript:"";class oI extends Dc{constructor(){super(...arguments),this.type=4}j(e){e&&e!==vr?this.element.setAttribute(this.name,sI):this.element.removeAttribute(this.name)}}class aI extends Dc{constructor(e,r,n,i,o){super(e,r,n,i,o),this.type=5}_$AI(e,r=this){var n;if((e=(n=js(this,e,r,0))!==null&&n!==void 0?n:vr)===Xi)return;const i=this._$AH,o=e===vr&&i!==vr||e.capture!==i.capture||e.once!==i.once||e.passive!==i.passive,c=e!==vr&&(i===vr||o);o&&this.element.removeEventListener(this.name,this,i),c&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){var r,n;typeof this._$AH=="function"?this._$AH.call((n=(r=this.options)===null||r===void 0?void 0:r.host)!==null&&n!==void 0?n:this.element,e):this._$AH.handleEvent(e)}}class cI{constructor(e,r,n){this.element=e,this.type=6,this._$AN=void 0,this._$AM=r,this.options=n}get _$AU(){return this._$AM._$AU}_$AI(e){js(this,e)}}const em=Sc.litHtmlPolyfillSupport;em?.(ia,sa),((Yh=Sc.litHtmlVersions)!==null&&Yh!==void 0?Yh:Sc.litHtmlVersions=[]).push("2.7.4");const lI=(t,e,r)=>{var n,i;const o=(n=r?.renderBefore)!==null&&n!==void 0?n:e;let c=o._$litPart$;if(c===void 0){const l=(i=r?.renderBefore)!==null&&i!==void 0?i:null;o._$litPart$=c=new sa(e.insertBefore(ta(),l),l,void 0,r??{})}return c._$AI(t),c};/**
118
118
  * @license
119
119
  * Copyright 2017 Google LLC
120
120
  * SPDX-License-Identifier: BSD-3-Clause
121
- */var Fh,Bh;class $e extends Rs{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var e,r;const n=super.createRenderRoot();return(e=(r=this.renderOptions).renderBefore)!==null&&e!==void 0||(r.renderBefore=n.firstChild),n}update(e){const r=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=Kx(r,this.renderRoot,this.renderOptions)}connectedCallback(){var e;super.connectedCallback(),(e=this._$Do)===null||e===void 0||e.setConnected(!0)}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this._$Do)===null||e===void 0||e.setConnected(!1)}render(){return Yi}}$e.finalized=!0,$e._$litElement$=!0,(Fh=globalThis.litElementHydrateSupport)===null||Fh===void 0||Fh.call(globalThis,{LitElement:$e});const h3=globalThis.litElementPolyfillSupport;h3?.({LitElement:$e}),((Bh=globalThis.litElementVersions)!==null&&Bh!==void 0?Bh:globalThis.litElementVersions=[]).push("3.3.2");/**
121
+ */var Qh,ef;class Pe extends Ms{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var e,r;const n=super.createRenderRoot();return(e=(r=this.renderOptions).renderBefore)!==null&&e!==void 0||(r.renderBefore=n.firstChild),n}update(e){const r=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=lI(r,this.renderRoot,this.renderOptions)}connectedCallback(){var e;super.connectedCallback(),(e=this._$Do)===null||e===void 0||e.setConnected(!0)}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this._$Do)===null||e===void 0||e.setConnected(!1)}render(){return Xi}}Pe.finalized=!0,Pe._$litElement$=!0,(Qh=globalThis.litElementHydrateSupport)===null||Qh===void 0||Qh.call(globalThis,{LitElement:Pe});const tm=globalThis.litElementPolyfillSupport;tm?.({LitElement:Pe}),((ef=globalThis.litElementVersions)!==null&&ef!==void 0?ef:globalThis.litElementVersions=[]).push("3.3.2");/**
122
122
  * @license
123
123
  * Copyright 2017 Google LLC
124
124
  * SPDX-License-Identifier: BSD-3-Clause
125
- */const Re=t=>e=>typeof e=="function"?((r,n)=>(customElements.define(r,n),n))(t,e):((r,n)=>{const{kind:i,elements:o}=n;return{kind:i,elements:o,finisher(c){customElements.define(r,c)}}})(t,e);/**
125
+ */const Ne=t=>e=>typeof e=="function"?((r,n)=>(customElements.define(r,n),n))(t,e):((r,n)=>{const{kind:i,elements:o}=n;return{kind:i,elements:o,finisher(c){customElements.define(r,c)}}})(t,e);/**
126
126
  * @license
127
127
  * Copyright 2017 Google LLC
128
128
  * SPDX-License-Identifier: BSD-3-Clause
129
- */const Gx=(t,e)=>e.kind==="method"&&e.descriptor&&!("value"in e.descriptor)?{...e,finisher(r){r.createProperty(e.key,t)}}:{kind:"field",key:Symbol(),placement:"own",descriptor:{},originalKey:e.key,initializer(){typeof e.initializer=="function"&&(this[e.key]=e.initializer.call(this))},finisher(r){r.createProperty(e.key,t)}};function Ae(t){return(e,r)=>r!==void 0?((n,i,o)=>{i.constructor.createProperty(o,n)})(t,e,r):Gx(t,e)}/**
129
+ */const uI=(t,e)=>e.kind==="method"&&e.descriptor&&!("value"in e.descriptor)?{...e,finisher(r){r.createProperty(e.key,t)}}:{kind:"field",key:Symbol(),placement:"own",descriptor:{},originalKey:e.key,initializer(){typeof e.initializer=="function"&&(this[e.key]=e.initializer.call(this))},finisher(r){r.createProperty(e.key,t)}};function $e(t){return(e,r)=>r!==void 0?((n,i,o)=>{i.constructor.createProperty(o,n)})(t,e,r):uI(t,e)}/**
130
130
  * @license
131
131
  * Copyright 2017 Google LLC
132
132
  * SPDX-License-Identifier: BSD-3-Clause
133
- */function gt(t){return Ae({...t,state:!0})}/**
133
+ */function gt(t){return $e({...t,state:!0})}/**
134
134
  * @license
135
135
  * Copyright 2021 Google LLC
136
136
  * SPDX-License-Identifier: BSD-3-Clause
137
- */var kh;((kh=window.HTMLSlotElement)===null||kh===void 0?void 0:kh.prototype.assignedElements)!=null;/**
137
+ */var tf;((tf=window.HTMLSlotElement)===null||tf===void 0?void 0:tf.prototype.assignedElements)!=null;/**
138
138
  * @license
139
139
  * Copyright 2017 Google LLC
140
140
  * SPDX-License-Identifier: BSD-3-Clause
141
- */const Zx={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},Yx=t=>(...e)=>({_$litDirective$:t,values:e});class Jx{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,r,n){this._$Ct=e,this._$AM=r,this._$Ci=n}_$AS(e,r){return this.update(e,r)}update(e,r){return this.render(...r)}}/**
141
+ */const hI={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},fI=t=>(...e)=>({_$litDirective$:t,values:e});class dI{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,r,n){this._$Ct=e,this._$AM=r,this._$Ci=n}_$AS(e,r){return this.update(e,r)}update(e,r){return this.render(...r)}}/**
142
142
  * @license
143
143
  * Copyright 2018 Google LLC
144
144
  * SPDX-License-Identifier: BSD-3-Clause
145
- */const Lr=Yx(class extends Jx{constructor(t){var e;if(super(t),t.type!==Zx.ATTRIBUTE||t.name!=="class"||((e=t.strings)===null||e===void 0?void 0:e.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(t){return" "+Object.keys(t).filter(e=>t[e]).join(" ")+" "}update(t,[e]){var r,n;if(this.it===void 0){this.it=new Set,t.strings!==void 0&&(this.nt=new Set(t.strings.join(" ").split(/\s/).filter(o=>o!=="")));for(const o in e)e[o]&&!(!((r=this.nt)===null||r===void 0)&&r.has(o))&&this.it.add(o);return this.render(e)}const i=t.element.classList;this.it.forEach(o=>{o in e||(i.remove(o),this.it.delete(o))});for(const o in e){const c=!!e[o];c===this.it.has(o)||!((n=this.nt)===null||n===void 0)&&n.has(o)||(c?(i.add(o),this.it.add(o)):(i.remove(o),this.it.delete(o)))}return Yi}});function Xx(t,e){t.indexOf(e)===-1&&t.push(e)}const f3=(t,e,r)=>Math.min(Math.max(r,t),e),hn={duration:.3,delay:0,endDelay:0,repeat:0,easing:"ease"},Ec=t=>typeof t=="number",Us=t=>Array.isArray(t)&&!Ec(t[0]),Qx=(t,e,r)=>{const n=e-t;return((r-t)%n+n)%n+t};function e9(t,e){return Us(t)?t[Qx(0,t.length,e)]:t}const d3=(t,e,r)=>-r*t+r*e+t,p3=()=>{},yi=t=>t,Hh=(t,e,r)=>e-t===0?1:(r-t)/(e-t);function g3(t,e){const r=t[t.length-1];for(let n=1;n<=e;n++){const i=Hh(0,e,n);t.push(d3(r,1,i))}}function t9(t){const e=[0];return g3(e,t-1),e}function r9(t,e=t9(t.length),r=yi){const n=t.length,i=n-e.length;return i>0&&g3(e,i),o=>{let c=0;for(;c<n-2&&!(o<e[c+1]);c++);let l=f3(0,1,Hh(e[c],e[c+1],o));return l=e9(r,c)(l),d3(t[c],t[c+1],l)}}const m3=t=>Array.isArray(t)&&Ec(t[0]),zh=t=>typeof t=="object"&&!!t.createAnimation,Xi=t=>typeof t=="function",n9=t=>typeof t=="string",Qo={ms:t=>t*1e3,s:t=>t/1e3},w3=(t,e,r)=>(((1-3*r+3*e)*t+(3*r-6*e))*t+3*e)*t,i9=1e-7,s9=12;function o9(t,e,r,n,i){let o,c,l=0;do c=e+(r-e)/2,o=w3(c,n,i)-t,o>0?r=c:e=c;while(Math.abs(o)>i9&&++l<s9);return c}function ea(t,e,r,n){if(t===e&&r===n)return yi;const i=o=>o9(o,0,1,t,r);return o=>o===0||o===1?o:w3(i(o),e,n)}const a9=(t,e="end")=>r=>{r=e==="end"?Math.min(r,.999):Math.max(r,.001);const n=r*t,i=e==="end"?Math.floor(n):Math.ceil(n);return f3(0,1,i/t)},v3={ease:ea(.25,.1,.25,1),"ease-in":ea(.42,0,1,1),"ease-in-out":ea(.42,0,.58,1),"ease-out":ea(0,0,.58,1)},c9=/\((.*?)\)/;function y3(t){if(Xi(t))return t;if(m3(t))return ea(...t);if(v3[t])return v3[t];if(t.startsWith("steps")){const e=c9.exec(t);if(e){const r=e[1].split(",");return a9(parseFloat(r[0]),r[1].trim())}}return yi}class b3{constructor(e,r=[0,1],{easing:n,duration:i=hn.duration,delay:o=hn.delay,endDelay:c=hn.endDelay,repeat:l=hn.repeat,offset:h,direction:f="normal"}={}){if(this.startTime=null,this.rate=1,this.t=0,this.cancelTimestamp=null,this.easing=yi,this.duration=0,this.totalDuration=0,this.repeat=0,this.playState="idle",this.finished=new Promise((E,_)=>{this.resolve=E,this.reject=_}),n=n||hn.easing,zh(n)){const E=n.createAnimation(r);n=E.easing,r=E.keyframes||r,i=E.duration||i}this.repeat=l,this.easing=Us(n)?yi:y3(n),this.updateDuration(i);const v=r9(r,h,Us(n)?n.map(y3):yi);this.tick=E=>{var _;o=o;let S=0;this.pauseTime!==void 0?S=this.pauseTime:S=(E-this.startTime)*this.rate,this.t=S,S/=1e3,S=Math.max(S-o,0),this.playState==="finished"&&this.pauseTime===void 0&&(S=this.totalDuration);const P=S/this.duration;let j=Math.floor(P),H=P%1;!H&&P>=1&&(H=1),H===1&&j--;const Z=j%2;(f==="reverse"||f==="alternate"&&Z||f==="alternate-reverse"&&!Z)&&(H=1-H);const R=S>=this.totalDuration?1:Math.min(H,1),L=v(this.easing(R));e(L),this.pauseTime===void 0&&(this.playState==="finished"||S>=this.totalDuration+c)?(this.playState="finished",(_=this.resolve)===null||_===void 0||_.call(this,L)):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(t,e){if(!t)throw new Error(e)});class l9{setAnimation(e){this.animation=e,e?.finished.then(()=>this.clearAnimation()).catch(()=>{})}clearAnimation(){this.animation=this.generator=void 0}}const qh=new WeakMap;function _3(t){return qh.has(t)||qh.set(t,{transforms:[],values:new Map}),qh.get(t)}function u9(t,e){return t.has(e)||t.set(e,new l9),t.get(e)}const h9=["","X","Y","Z"],f9=["translate","scale","rotate","skew"],xc={x:"translateX",y:"translateY",z:"translateZ"},E3={syntax:"<angle>",initialValue:"0deg",toDefaultUnit:t=>t+"deg"},d9={translate:{syntax:"<length-percentage>",initialValue:"0px",toDefaultUnit:t=>t+"px"},rotate:E3,scale:{syntax:"<number>",initialValue:1,toDefaultUnit:yi},skew:E3},ta=new Map,Vh=t=>`--motion-${t}`,Cc=["x","y","z"];f9.forEach(t=>{h9.forEach(e=>{Cc.push(t+e),ta.set(Vh(t+e),d9[t])})});const p9=(t,e)=>Cc.indexOf(t)-Cc.indexOf(e),g9=new Set(Cc),x3=t=>g9.has(t),m9=(t,e)=>{xc[e]&&(e=xc[e]);const{transforms:r}=_3(t);Xx(r,e),t.style.transform=w9(r)},w9=t=>t.sort(p9).reduce(v9,"").trim(),v9=(t,e)=>`${t} ${e}(var(${Vh(e)}))`,Kh=t=>t.startsWith("--"),C3=new Set;function y9(t){if(!C3.has(t)){C3.add(t);try{const{syntax:e,initialValue:r}=ta.has(t)?ta.get(t):{};CSS.registerProperty({name:t,inherits:!1,syntax:e,initialValue:r})}catch{}}}const Gh=(t,e)=>document.createElement("div").animate(t,e),I3={cssRegisterProperty:()=>typeof CSS<"u"&&Object.hasOwnProperty.call(CSS,"registerProperty"),waapi:()=>Object.hasOwnProperty.call(Element.prototype,"animate"),partialKeyframes:()=>{try{Gh({opacity:[1]})}catch{return!1}return!0},finished:()=>!!Gh({opacity:[0,1]},{duration:.001}).finished,linearEasing:()=>{try{Gh({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0}},Zh={},js={};for(const t in I3)js[t]=()=>(Zh[t]===void 0&&(Zh[t]=I3[t]()),Zh[t]);const b9=.015,_9=(t,e)=>{let r="";const n=Math.round(e/b9);for(let i=0;i<n;i++)r+=t(Hh(0,n-1,i))+", ";return r.substring(0,r.length-2)},S3=(t,e)=>Xi(t)?js.linearEasing()?`linear(${_9(t,e)})`:hn.easing:m3(t)?E9(t):t,E9=([t,e,r,n])=>`cubic-bezier(${t}, ${e}, ${r}, ${n})`;function x9(t,e){for(let r=0;r<t.length;r++)t[r]===null&&(t[r]=r?t[r-1]:e());return t}const C9=t=>Array.isArray(t)?t:[t];function Yh(t){return xc[t]&&(t=xc[t]),x3(t)?Vh(t):t}const Ic={get:(t,e)=>{e=Yh(e);let r=Kh(e)?t.style.getPropertyValue(e):getComputedStyle(t)[e];if(!r&&r!==0){const n=ta.get(e);n&&(r=n.initialValue)}return r},set:(t,e,r)=>{e=Yh(e),Kh(e)?t.style.setProperty(e,r):t.style[e]=r}};function A3(t,e=!0){if(!(!t||t.playState==="finished"))try{t.stop?t.stop():(e&&t.commitStyles(),t.cancel())}catch{}}function I9(t,e){var r;let n=e?.toDefaultUnit||yi;const i=t[t.length-1];if(n9(i)){const o=((r=i.match(/(-?[\d.]+)([a-z%]*)/))===null||r===void 0?void 0:r[2])||"";o&&(n=c=>c+o)}return n}function S9(){return window.__MOTION_DEV_TOOLS_RECORD}function A9(t,e,r,n={},i){const o=S9(),c=n.record!==!1&&o;let l,{duration:h=hn.duration,delay:f=hn.delay,endDelay:v=hn.endDelay,repeat:E=hn.repeat,easing:_=hn.easing,persist:S=!1,direction:P,offset:j,allowWebkitAcceleration:H=!1}=n;const Z=_3(t),R=x3(e);let L=js.waapi();R&&m9(t,e);const $=Yh(e),T=u9(Z.values,$),I=ta.get($);return A3(T.animation,!(zh(_)&&T.generator)&&n.record!==!1),()=>{const d=()=>{var z,ee;return(ee=(z=Ic.get(t,$))!==null&&z!==void 0?z:I?.initialValue)!==null&&ee!==void 0?ee:0};let x=x9(C9(r),d);const J=I9(x,I);if(zh(_)){const z=_.createAnimation(x,e!=="opacity",d,$,T);_=z.easing,x=z.keyframes||x,h=z.duration||h}if(Kh($)&&(js.cssRegisterProperty()?y9($):L=!1),R&&!js.linearEasing()&&(Xi(_)||Us(_)&&_.some(Xi))&&(L=!1),L){I&&(x=x.map(de=>Ec(de)?I.toDefaultUnit(de):de)),x.length===1&&(!js.partialKeyframes()||c)&&x.unshift(d());const z={delay:Qo.ms(f),duration:Qo.ms(h),endDelay:Qo.ms(v),easing:Us(_)?void 0:S3(_,h),direction:P,iterations:E+1,fill:"both"};l=t.animate({[$]:x,offset:j,easing:Us(_)?_.map(de=>S3(de,h)):void 0},z),l.finished||(l.finished=new Promise((de,me)=>{l.onfinish=de,l.oncancel=me}));const ee=x[x.length-1];l.finished.then(()=>{S||(Ic.set(t,$,ee),l.cancel())}).catch(p3),H||(l.playbackRate=1.000001)}else if(i&&R)x=x.map(z=>typeof z=="string"?parseFloat(z):z),x.length===1&&x.unshift(parseFloat(d())),l=new i(z=>{Ic.set(t,$,J?J(z):z)},x,Object.assign(Object.assign({},n),{duration:h,easing:_}));else{const z=x[x.length-1];Ic.set(t,$,I&&Ec(z)?I.toDefaultUnit(z):z)}return c&&o(t,e,x,{duration:h,delay:f,easing:_,repeat:E,offset:j},"motion-one"),T.setAnimation(l),l}}const O9=(t,e)=>t[e]?Object.assign(Object.assign({},t),t[e]):Object.assign({},t);function O3(t,e){var r;return typeof t=="string"?e?((r=e[t])!==null&&r!==void 0||(e[t]=document.querySelectorAll(t)),t=e[t]):t=document.querySelectorAll(t):t instanceof Element&&(t=[t]),Array.from(t||[])}const D9=t=>t(),D3=(t,e,r=hn.duration)=>new Proxy({animations:t.map(D9).filter(Boolean),duration:r,options:e},P9),$9=t=>t.animations[0],P9={get:(t,e)=>{const r=$9(t);switch(e){case"duration":return t.duration;case"currentTime":return Qo.s(r?.[e]||0);case"playbackRate":case"playState":return r?.[e];case"finished":return t.finished||(t.finished=Promise.all(t.animations.map(T9)).catch(p3)),t.finished;case"stop":return()=>{t.animations.forEach(n=>A3(n))};case"forEachNative":return n=>{t.animations.forEach(i=>n(i,t))};default:return typeof r?.[e]>"u"?void 0:()=>t.animations.forEach(n=>n[e]())}},set:(t,e,r)=>{switch(e){case"currentTime":r=Qo.ms(r);case"currentTime":case"playbackRate":for(let n=0;n<t.animations.length;n++)t.animations[n][e]=r;return!0}return!1}},T9=t=>t.finished;function N9(t,e,r){return Xi(t)?t(e,r):t}function R9(t){return function(r,n,i={}){r=O3(r);const o=r.length;Wh(!!o,"No valid element provided."),Wh(!!n,"No keyframes defined.");const c=[];for(let l=0;l<o;l++){const h=r[l];for(const f in n){const v=O9(i,f);v.delay=N9(v.delay,l,o);const E=A9(h,f,n[f],v,t);c.push(E)}}return D3(c,i,i.duration)}}const L9=R9(b3);function M9(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r}const U9={any:0,all:1};function j9(t,e,{root:r,margin:n,amount:i="any"}={}){if(typeof IntersectionObserver>"u")return()=>{};const o=O3(t),c=new WeakMap,l=f=>{f.forEach(v=>{const E=c.get(v.target);if(v.isIntersecting!==!!E)if(v.isIntersecting){const _=e(v);Xi(_)?c.set(v.target,_):h.unobserve(v.target)}else E&&(E(v),c.delete(v.target))})},h=new IntersectionObserver(l,{root:r,rootMargin:n,threshold:typeof i=="number"?i:U9[i]});return o.forEach(f=>h.observe(f)),()=>h.disconnect()}function Jh(t,e,r){t.dispatchEvent(new CustomEvent(e,{detail:{originalEvent:r}}))}function $3(t,e,r){t.dispatchEvent(new CustomEvent(e,{detail:{originalEntry:r}}))}const F9={isActive:t=>!!t.inView,subscribe:(t,{enable:e,disable:r},{inViewOptions:n={}})=>{const{once:i}=n,o=M9(n,["once"]);return j9(t,c=>{if(e(),$3(t,"viewenter",c),!i)return l=>{r(),$3(t,"viewleave",l)}},o)}},P3=(t,e,r)=>n=>{n.pointerType&&n.pointerType!=="mouse"||(r(),Jh(t,e,n))};[...Object.keys({inView:F9,hover:{isActive:t=>!!t.hover,subscribe:(t,{enable:e,disable:r})=>{const n=P3(t,"hoverstart",e),i=P3(t,"hoverend",r);return t.addEventListener("pointerenter",n),t.addEventListener("pointerleave",i),()=>{t.removeEventListener("pointerenter",n),t.removeEventListener("pointerleave",i)}}},press:{isActive:t=>!!t.press,subscribe:(t,{enable:e,disable:r})=>{const n=o=>{r(),Jh(t,"pressend",o),window.removeEventListener("pointerup",n)},i=o=>{e(),Jh(t,"pressstart",o),window.addEventListener("pointerup",n)};return t.addEventListener("pointerdown",i),()=>{t.removeEventListener("pointerdown",i),window.removeEventListener("pointerup",n)}}}})];function B9(t,e={}){return D3([()=>{const r=new b3(t,[0,1],e);return r.finished.catch(()=>{}),r}],e,e.duration)}function Qi(t,e,r){return(Xi(t)?B9:L9)(t,e,r)}var ra={},k9=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then},T3={},Jr={};let Xh;const H9=[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];Jr.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},Jr.getSymbolTotalCodewords=function(e){return H9[e]},Jr.getBCHDigit=function(t){let e=0;for(;t!==0;)e++,t>>>=1;return e},Jr.setToSJISFunction=function(e){if(typeof e!="function")throw new Error('"toSJISFunc" is not a valid function.');Xh=e},Jr.isKanjiModeEnabled=function(){return typeof Xh<"u"},Jr.toSJIS=function(e){return Xh(e)};var Sc={};(function(t){t.L={bit:1},t.M={bit:0},t.Q={bit:3},t.H={bit:2};function e(r){if(typeof r!="string")throw new Error("Param is not a string");switch(r.toLowerCase()){case"l":case"low":return t.L;case"m":case"medium":return t.M;case"q":case"quartile":return t.Q;case"h":case"high":return t.H;default:throw new Error("Unknown EC Level: "+r)}}t.isValid=function(n){return n&&typeof n.bit<"u"&&n.bit>=0&&n.bit<4},t.from=function(n,i){if(t.isValid(n))return n;try{return e(n)}catch{return i}}})(Sc);function N3(){this.buffer=[],this.length=0}N3.prototype={get:function(t){const e=Math.floor(t/8);return(this.buffer[e]>>>7-t%8&1)===1},put:function(t,e){for(let r=0;r<e;r++)this.putBit((t>>>e-r-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(t){const e=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),t&&(this.buffer[e]|=128>>>this.length%8),this.length++}};var z9=N3;function na(t){if(!t||t<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=t,this.data=new Uint8Array(t*t),this.reservedBit=new Uint8Array(t*t)}na.prototype.set=function(t,e,r,n){const i=t*this.size+e;this.data[i]=r,n&&(this.reservedBit[i]=!0)},na.prototype.get=function(t,e){return this.data[t*this.size+e]},na.prototype.xor=function(t,e,r){this.data[t*this.size+e]^=r},na.prototype.isReserved=function(t,e){return this.reservedBit[t*this.size+e]};var W9=na,R3={};(function(t){const e=Jr.getSymbolSize;t.getRowColCoords=function(n){if(n===1)return[];const i=Math.floor(n/7)+2,o=e(n),c=o===145?26:Math.ceil((o-13)/(2*i-2))*2,l=[o-7];for(let h=1;h<i-1;h++)l[h]=l[h-1]-c;return l.push(6),l.reverse()},t.getPositions=function(n){const i=[],o=t.getRowColCoords(n),c=o.length;for(let l=0;l<c;l++)for(let h=0;h<c;h++)l===0&&h===0||l===0&&h===c-1||l===c-1&&h===0||i.push([o[l],o[h]]);return i}})(R3);var L3={};const q9=Jr.getSymbolSize,M3=7;L3.getPositions=function(e){const r=q9(e);return[[0,0],[r-M3,0],[0,r-M3]]};var U3={};(function(t){t.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};const e={N1:3,N2:3,N3:40,N4:10};t.isValid=function(i){return i!=null&&i!==""&&!isNaN(i)&&i>=0&&i<=7},t.from=function(i){return t.isValid(i)?parseInt(i,10):void 0},t.getPenaltyN1=function(i){const o=i.size;let c=0,l=0,h=0,f=null,v=null;for(let E=0;E<o;E++){l=h=0,f=v=null;for(let _=0;_<o;_++){let S=i.get(E,_);S===f?l++:(l>=5&&(c+=e.N1+(l-5)),f=S,l=1),S=i.get(_,E),S===v?h++:(h>=5&&(c+=e.N1+(h-5)),v=S,h=1)}l>=5&&(c+=e.N1+(l-5)),h>=5&&(c+=e.N1+(h-5))}return c},t.getPenaltyN2=function(i){const o=i.size;let c=0;for(let l=0;l<o-1;l++)for(let h=0;h<o-1;h++){const f=i.get(l,h)+i.get(l,h+1)+i.get(l+1,h)+i.get(l+1,h+1);(f===4||f===0)&&c++}return c*e.N2},t.getPenaltyN3=function(i){const o=i.size;let c=0,l=0,h=0;for(let f=0;f<o;f++){l=h=0;for(let v=0;v<o;v++)l=l<<1&2047|i.get(f,v),v>=10&&(l===1488||l===93)&&c++,h=h<<1&2047|i.get(v,f),v>=10&&(h===1488||h===93)&&c++}return c*e.N3},t.getPenaltyN4=function(i){let o=0;const c=i.data.length;for(let h=0;h<c;h++)o+=i.data[h];return Math.abs(Math.ceil(o*100/c/5)-10)*e.N4};function r(n,i,o){switch(n){case t.Patterns.PATTERN000:return(i+o)%2===0;case t.Patterns.PATTERN001:return i%2===0;case t.Patterns.PATTERN010:return o%3===0;case t.Patterns.PATTERN011:return(i+o)%3===0;case t.Patterns.PATTERN100:return(Math.floor(i/2)+Math.floor(o/3))%2===0;case t.Patterns.PATTERN101:return i*o%2+i*o%3===0;case t.Patterns.PATTERN110:return(i*o%2+i*o%3)%2===0;case t.Patterns.PATTERN111:return(i*o%3+(i+o)%2)%2===0;default:throw new Error("bad maskPattern:"+n)}}t.applyMask=function(i,o){const c=o.size;for(let l=0;l<c;l++)for(let h=0;h<c;h++)o.isReserved(h,l)||o.xor(h,l,r(i,h,l))},t.getBestMask=function(i,o){const c=Object.keys(t.Patterns).length;let l=0,h=1/0;for(let f=0;f<c;f++){o(f),t.applyMask(f,i);const v=t.getPenaltyN1(i)+t.getPenaltyN2(i)+t.getPenaltyN3(i)+t.getPenaltyN4(i);t.applyMask(f,i),v<h&&(h=v,l=f)}return l}})(U3);var Ac={};const bi=Sc,Oc=[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],Dc=[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];Ac.getBlocksCount=function(e,r){switch(r){case bi.L:return Oc[(e-1)*4+0];case bi.M:return Oc[(e-1)*4+1];case bi.Q:return Oc[(e-1)*4+2];case bi.H:return Oc[(e-1)*4+3];default:return}},Ac.getTotalCodewordsCount=function(e,r){switch(r){case bi.L:return Dc[(e-1)*4+0];case bi.M:return Dc[(e-1)*4+1];case bi.Q:return Dc[(e-1)*4+2];case bi.H:return Dc[(e-1)*4+3];default:return}};var j3={},$c={};const ia=new Uint8Array(512),Pc=new Uint8Array(256);(function(){let e=1;for(let r=0;r<255;r++)ia[r]=e,Pc[e]=r,e<<=1,e&256&&(e^=285);for(let r=255;r<512;r++)ia[r]=ia[r-255]})(),$c.log=function(e){if(e<1)throw new Error("log("+e+")");return Pc[e]},$c.exp=function(e){return ia[e]},$c.mul=function(e,r){return e===0||r===0?0:ia[Pc[e]+Pc[r]]},function(t){const e=$c;t.mul=function(n,i){const o=new Uint8Array(n.length+i.length-1);for(let c=0;c<n.length;c++)for(let l=0;l<i.length;l++)o[c+l]^=e.mul(n[c],i[l]);return o},t.mod=function(n,i){let o=new Uint8Array(n);for(;o.length-i.length>=0;){const c=o[0];for(let h=0;h<i.length;h++)o[h]^=e.mul(i[h],c);let l=0;for(;l<o.length&&o[l]===0;)l++;o=o.slice(l)}return o},t.generateECPolynomial=function(n){let i=new Uint8Array([1]);for(let o=0;o<n;o++)i=t.mul(i,new Uint8Array([1,e.exp(o)]));return i}}(j3);const F3=j3;function Qh(t){this.genPoly=void 0,this.degree=t,this.degree&&this.initialize(this.degree)}Qh.prototype.initialize=function(e){this.degree=e,this.genPoly=F3.generateECPolynomial(this.degree)},Qh.prototype.encode=function(e){if(!this.genPoly)throw new Error("Encoder not initialized");const r=new Uint8Array(e.length+this.degree);r.set(e);const n=F3.mod(r,this.genPoly),i=this.degree-n.length;if(i>0){const o=new Uint8Array(this.degree);return o.set(n,i),o}return n};var V9=Qh,B3={},_i={},ef={};ef.isValid=function(e){return!isNaN(e)&&e>=1&&e<=40};var Un={};const k3="[0-9]+",K9="[A-Z $%*+\\-./:]+";let sa="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";sa=sa.replace(/u/g,"\\u");const G9="(?:(?![A-Z0-9 $%*+\\-./:]|"+sa+`)(?:.|[\r
146
- ]))+`;Un.KANJI=new RegExp(sa,"g"),Un.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),Un.BYTE=new RegExp(G9,"g"),Un.NUMERIC=new RegExp(k3,"g"),Un.ALPHANUMERIC=new RegExp(K9,"g");const Z9=new RegExp("^"+sa+"$"),Y9=new RegExp("^"+k3+"$"),J9=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");Un.testKanji=function(e){return Z9.test(e)},Un.testNumeric=function(e){return Y9.test(e)},Un.testAlphanumeric=function(e){return J9.test(e)},function(t){const e=ef,r=Un;t.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},t.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},t.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},t.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},t.MIXED={bit:-1},t.getCharCountIndicator=function(o,c){if(!o.ccBits)throw new Error("Invalid mode: "+o);if(!e.isValid(c))throw new Error("Invalid version: "+c);return c>=1&&c<10?o.ccBits[0]:c<27?o.ccBits[1]:o.ccBits[2]},t.getBestModeForData=function(o){return r.testNumeric(o)?t.NUMERIC:r.testAlphanumeric(o)?t.ALPHANUMERIC:r.testKanji(o)?t.KANJI:t.BYTE},t.toString=function(o){if(o&&o.id)return o.id;throw new Error("Invalid mode")},t.isValid=function(o){return o&&o.bit&&o.ccBits};function n(i){if(typeof i!="string")throw new Error("Param is not a string");switch(i.toLowerCase()){case"numeric":return t.NUMERIC;case"alphanumeric":return t.ALPHANUMERIC;case"kanji":return t.KANJI;case"byte":return t.BYTE;default:throw new Error("Unknown mode: "+i)}}t.from=function(o,c){if(t.isValid(o))return o;try{return n(o)}catch{return c}}}(_i),function(t){const e=Jr,r=Ac,n=Sc,i=_i,o=ef,c=7973,l=e.getBCHDigit(c);function h(_,S,P){for(let j=1;j<=40;j++)if(S<=t.getCapacity(j,P,_))return j}function f(_,S){return i.getCharCountIndicator(_,S)+4}function v(_,S){let P=0;return _.forEach(function(j){const H=f(j.mode,S);P+=H+j.getBitsLength()}),P}function E(_,S){for(let P=1;P<=40;P++)if(v(_,P)<=t.getCapacity(P,S,i.MIXED))return P}t.from=function(S,P){return o.isValid(S)?parseInt(S,10):P},t.getCapacity=function(S,P,j){if(!o.isValid(S))throw new Error("Invalid QR Code version");typeof j>"u"&&(j=i.BYTE);const H=e.getSymbolTotalCodewords(S),Z=r.getTotalCodewordsCount(S,P),R=(H-Z)*8;if(j===i.MIXED)return R;const L=R-f(j,S);switch(j){case i.NUMERIC:return Math.floor(L/10*3);case i.ALPHANUMERIC:return Math.floor(L/11*2);case i.KANJI:return Math.floor(L/13);case i.BYTE:default:return Math.floor(L/8)}},t.getBestVersionForData=function(S,P){let j;const H=n.from(P,n.M);if(Array.isArray(S)){if(S.length>1)return E(S,H);if(S.length===0)return 1;j=S[0]}else j=S;return h(j.mode,j.getLength(),H)},t.getEncodedBits=function(S){if(!o.isValid(S)||S<7)throw new Error("Invalid QR Code version");let P=S<<12;for(;e.getBCHDigit(P)-l>=0;)P^=c<<e.getBCHDigit(P)-l;return S<<12|P}}(B3);var H3={};const tf=Jr,z3=1335,X9=21522,W3=tf.getBCHDigit(z3);H3.getEncodedBits=function(e,r){const n=e.bit<<3|r;let i=n<<10;for(;tf.getBCHDigit(i)-W3>=0;)i^=z3<<tf.getBCHDigit(i)-W3;return(n<<10|i)^X9};var q3={};const Q9=_i;function Fs(t){this.mode=Q9.NUMERIC,this.data=t.toString()}Fs.getBitsLength=function(e){return 10*Math.floor(e/3)+(e%3?e%3*3+1:0)},Fs.prototype.getLength=function(){return this.data.length},Fs.prototype.getBitsLength=function(){return Fs.getBitsLength(this.data.length)},Fs.prototype.write=function(e){let r,n,i;for(r=0;r+3<=this.data.length;r+=3)n=this.data.substr(r,3),i=parseInt(n,10),e.put(i,10);const o=this.data.length-r;o>0&&(n=this.data.substr(r),i=parseInt(n,10),e.put(i,o*3+1))};var eC=Fs;const tC=_i,rf=["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 Bs(t){this.mode=tC.ALPHANUMERIC,this.data=t}Bs.getBitsLength=function(e){return 11*Math.floor(e/2)+6*(e%2)},Bs.prototype.getLength=function(){return this.data.length},Bs.prototype.getBitsLength=function(){return Bs.getBitsLength(this.data.length)},Bs.prototype.write=function(e){let r;for(r=0;r+2<=this.data.length;r+=2){let n=rf.indexOf(this.data[r])*45;n+=rf.indexOf(this.data[r+1]),e.put(n,11)}this.data.length%2&&e.put(rf.indexOf(this.data[r]),6)};var rC=Bs,nC=function(e){for(var r=[],n=e.length,i=0;i<n;i++){var o=e.charCodeAt(i);if(o>=55296&&o<=56319&&n>i+1){var c=e.charCodeAt(i+1);c>=56320&&c<=57343&&(o=(o-55296)*1024+c-56320+65536,i+=1)}if(o<128){r.push(o);continue}if(o<2048){r.push(o>>6|192),r.push(o&63|128);continue}if(o<55296||o>=57344&&o<65536){r.push(o>>12|224),r.push(o>>6&63|128),r.push(o&63|128);continue}if(o>=65536&&o<=1114111){r.push(o>>18|240),r.push(o>>12&63|128),r.push(o>>6&63|128),r.push(o&63|128);continue}r.push(239,191,189)}return new Uint8Array(r).buffer};const iC=nC,sC=_i;function ks(t){this.mode=sC.BYTE,typeof t=="string"&&(t=iC(t)),this.data=new Uint8Array(t)}ks.getBitsLength=function(e){return e*8},ks.prototype.getLength=function(){return this.data.length},ks.prototype.getBitsLength=function(){return ks.getBitsLength(this.data.length)},ks.prototype.write=function(t){for(let e=0,r=this.data.length;e<r;e++)t.put(this.data[e],8)};var oC=ks;const aC=_i,cC=Jr;function Hs(t){this.mode=aC.KANJI,this.data=t}Hs.getBitsLength=function(e){return e*13},Hs.prototype.getLength=function(){return this.data.length},Hs.prototype.getBitsLength=function(){return Hs.getBitsLength(this.data.length)},Hs.prototype.write=function(t){let e;for(e=0;e<this.data.length;e++){let r=cC.toSJIS(this.data[e]);if(r>=33088&&r<=40956)r-=33088;else if(r>=57408&&r<=60351)r-=49472;else throw new Error("Invalid SJIS character: "+this.data[e]+`
147
- Make sure your charset is UTF-8`);r=(r>>>8&255)*192+(r&255),t.put(r,13)}};var lC=Hs,V3={exports:{}};(function(t){var e={single_source_shortest_paths:function(r,n,i){var o={},c={};c[n]=0;var l=e.PriorityQueue.make();l.push(n,0);for(var h,f,v,E,_,S,P,j,H;!l.empty();){h=l.pop(),f=h.value,E=h.cost,_=r[f]||{};for(v in _)_.hasOwnProperty(v)&&(S=_[v],P=E+S,j=c[v],H=typeof c[v]>"u",(H||j>P)&&(c[v]=P,l.push(v,P),o[v]=f))}if(typeof i<"u"&&typeof c[i]>"u"){var Z=["Could not find a path from ",n," to ",i,"."].join("");throw new Error(Z)}return o},extract_shortest_path_from_predecessor_list:function(r,n){for(var i=[],o=n;o;)i.push(o),r[o],o=r[o];return i.reverse(),i},find_path:function(r,n,i){var o=e.single_source_shortest_paths(r,n,i);return e.extract_shortest_path_from_predecessor_list(o,i)},PriorityQueue:{make:function(r){var n=e.PriorityQueue,i={},o;r=r||{};for(o in n)n.hasOwnProperty(o)&&(i[o]=n[o]);return i.queue=[],i.sorter=r.sorter||n.default_sorter,i},default_sorter:function(r,n){return r.cost-n.cost},push:function(r,n){var i={value:r,cost:n};this.queue.push(i),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};t.exports=e})(V3),function(t){const e=_i,r=eC,n=rC,i=oC,o=lC,c=Un,l=Jr,h=V3.exports;function f(Z){return unescape(encodeURIComponent(Z)).length}function v(Z,R,L){const $=[];let T;for(;(T=Z.exec(L))!==null;)$.push({data:T[0],index:T.index,mode:R,length:T[0].length});return $}function E(Z){const R=v(c.NUMERIC,e.NUMERIC,Z),L=v(c.ALPHANUMERIC,e.ALPHANUMERIC,Z);let $,T;return l.isKanjiModeEnabled()?($=v(c.BYTE,e.BYTE,Z),T=v(c.KANJI,e.KANJI,Z)):($=v(c.BYTE_KANJI,e.BYTE,Z),T=[]),R.concat(L,$,T).sort(function(d,x){return d.index-x.index}).map(function(d){return{data:d.data,mode:d.mode,length:d.length}})}function _(Z,R){switch(R){case e.NUMERIC:return r.getBitsLength(Z);case e.ALPHANUMERIC:return n.getBitsLength(Z);case e.KANJI:return o.getBitsLength(Z);case e.BYTE:return i.getBitsLength(Z)}}function S(Z){return Z.reduce(function(R,L){const $=R.length-1>=0?R[R.length-1]:null;return $&&$.mode===L.mode?(R[R.length-1].data+=L.data,R):(R.push(L),R)},[])}function P(Z){const R=[];for(let L=0;L<Z.length;L++){const $=Z[L];switch($.mode){case e.NUMERIC:R.push([$,{data:$.data,mode:e.ALPHANUMERIC,length:$.length},{data:$.data,mode:e.BYTE,length:$.length}]);break;case e.ALPHANUMERIC:R.push([$,{data:$.data,mode:e.BYTE,length:$.length}]);break;case e.KANJI:R.push([$,{data:$.data,mode:e.BYTE,length:f($.data)}]);break;case e.BYTE:R.push([{data:$.data,mode:e.BYTE,length:f($.data)}])}}return R}function j(Z,R){const L={},$={start:{}};let T=["start"];for(let I=0;I<Z.length;I++){const d=Z[I],x=[];for(let J=0;J<d.length;J++){const z=d[J],ee=""+I+J;x.push(ee),L[ee]={node:z,lastCount:0},$[ee]={};for(let de=0;de<T.length;de++){const me=T[de];L[me]&&L[me].node.mode===z.mode?($[me][ee]=_(L[me].lastCount+z.length,z.mode)-_(L[me].lastCount,z.mode),L[me].lastCount+=z.length):(L[me]&&(L[me].lastCount=z.length),$[me][ee]=_(z.length,z.mode)+4+e.getCharCountIndicator(z.mode,R))}}T=x}for(let I=0;I<T.length;I++)$[T[I]].end=0;return{map:$,table:L}}function H(Z,R){let L;const $=e.getBestModeForData(Z);if(L=e.from(R,$),L!==e.BYTE&&L.bit<$.bit)throw new Error('"'+Z+'" cannot be encoded with mode '+e.toString(L)+`.
148
- Suggested mode is: `+e.toString($));switch(L===e.KANJI&&!l.isKanjiModeEnabled()&&(L=e.BYTE),L){case e.NUMERIC:return new r(Z);case e.ALPHANUMERIC:return new n(Z);case e.KANJI:return new o(Z);case e.BYTE:return new i(Z)}}t.fromArray=function(R){return R.reduce(function(L,$){return typeof $=="string"?L.push(H($,null)):$.data&&L.push(H($.data,$.mode)),L},[])},t.fromString=function(R,L){const $=E(R,l.isKanjiModeEnabled()),T=P($),I=j(T,L),d=h.find_path(I.map,"start","end"),x=[];for(let J=1;J<d.length-1;J++)x.push(I.table[d[J]].node);return t.fromArray(S(x))},t.rawSplit=function(R){return t.fromArray(E(R,l.isKanjiModeEnabled()))}}(q3);const Tc=Jr,nf=Sc,uC=z9,hC=W9,fC=R3,dC=L3,sf=U3,of=Ac,pC=V9,Nc=B3,gC=H3,mC=_i,af=q3;function wC(t,e){const r=t.size,n=dC.getPositions(e);for(let i=0;i<n.length;i++){const o=n[i][0],c=n[i][1];for(let l=-1;l<=7;l++)if(!(o+l<=-1||r<=o+l))for(let h=-1;h<=7;h++)c+h<=-1||r<=c+h||(l>=0&&l<=6&&(h===0||h===6)||h>=0&&h<=6&&(l===0||l===6)||l>=2&&l<=4&&h>=2&&h<=4?t.set(o+l,c+h,!0,!0):t.set(o+l,c+h,!1,!0))}}function vC(t){const e=t.size;for(let r=8;r<e-8;r++){const n=r%2===0;t.set(r,6,n,!0),t.set(6,r,n,!0)}}function yC(t,e){const r=fC.getPositions(e);for(let n=0;n<r.length;n++){const i=r[n][0],o=r[n][1];for(let c=-2;c<=2;c++)for(let l=-2;l<=2;l++)c===-2||c===2||l===-2||l===2||c===0&&l===0?t.set(i+c,o+l,!0,!0):t.set(i+c,o+l,!1,!0)}}function bC(t,e){const r=t.size,n=Nc.getEncodedBits(e);let i,o,c;for(let l=0;l<18;l++)i=Math.floor(l/3),o=l%3+r-8-3,c=(n>>l&1)===1,t.set(i,o,c,!0),t.set(o,i,c,!0)}function cf(t,e,r){const n=t.size,i=gC.getEncodedBits(e,r);let o,c;for(o=0;o<15;o++)c=(i>>o&1)===1,o<6?t.set(o,8,c,!0):o<8?t.set(o+1,8,c,!0):t.set(n-15+o,8,c,!0),o<8?t.set(8,n-o-1,c,!0):o<9?t.set(8,15-o-1+1,c,!0):t.set(8,15-o-1,c,!0);t.set(n-8,8,1,!0)}function _C(t,e){const r=t.size;let n=-1,i=r-1,o=7,c=0;for(let l=r-1;l>0;l-=2)for(l===6&&l--;;){for(let h=0;h<2;h++)if(!t.isReserved(i,l-h)){let f=!1;c<e.length&&(f=(e[c]>>>o&1)===1),t.set(i,l-h,f),o--,o===-1&&(c++,o=7)}if(i+=n,i<0||r<=i){i-=n,n=-n;break}}}function EC(t,e,r){const n=new uC;r.forEach(function(h){n.put(h.mode.bit,4),n.put(h.getLength(),mC.getCharCountIndicator(h.mode,t)),h.write(n)});const i=Tc.getSymbolTotalCodewords(t),o=of.getTotalCodewordsCount(t,e),c=(i-o)*8;for(n.getLengthInBits()+4<=c&&n.put(0,4);n.getLengthInBits()%8!==0;)n.putBit(0);const l=(c-n.getLengthInBits())/8;for(let h=0;h<l;h++)n.put(h%2?17:236,8);return xC(n,t,e)}function xC(t,e,r){const n=Tc.getSymbolTotalCodewords(e),i=of.getTotalCodewordsCount(e,r),o=n-i,c=of.getBlocksCount(e,r),l=n%c,h=c-l,f=Math.floor(n/c),v=Math.floor(o/c),E=v+1,_=f-v,S=new pC(_);let P=0;const j=new Array(c),H=new Array(c);let Z=0;const R=new Uint8Array(t.buffer);for(let d=0;d<c;d++){const x=d<h?v:E;j[d]=R.slice(P,P+x),H[d]=S.encode(j[d]),P+=x,Z=Math.max(Z,x)}const L=new Uint8Array(n);let $=0,T,I;for(T=0;T<Z;T++)for(I=0;I<c;I++)T<j[I].length&&(L[$++]=j[I][T]);for(T=0;T<_;T++)for(I=0;I<c;I++)L[$++]=H[I][T];return L}function CC(t,e,r,n){let i;if(Array.isArray(t))i=af.fromArray(t);else if(typeof t=="string"){let f=e;if(!f){const v=af.rawSplit(t);f=Nc.getBestVersionForData(v,r)}i=af.fromString(t,f||40)}else throw new Error("Invalid data");const o=Nc.getBestVersionForData(i,r);if(!o)throw new Error("The amount of data is too big to be stored in a QR Code");if(!e)e=o;else if(e<o)throw new Error(`
145
+ */const Lr=fI(class extends dI{constructor(t){var e;if(super(t),t.type!==hI.ATTRIBUTE||t.name!=="class"||((e=t.strings)===null||e===void 0?void 0:e.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(t){return" "+Object.keys(t).filter(e=>t[e]).join(" ")+" "}update(t,[e]){var r,n;if(this.it===void 0){this.it=new Set,t.strings!==void 0&&(this.nt=new Set(t.strings.join(" ").split(/\s/).filter(o=>o!=="")));for(const o in e)e[o]&&!(!((r=this.nt)===null||r===void 0)&&r.has(o))&&this.it.add(o);return this.render(e)}const i=t.element.classList;this.it.forEach(o=>{o in e||(i.remove(o),this.it.delete(o))});for(const o in e){const c=!!e[o];c===this.it.has(o)||!((n=this.nt)===null||n===void 0)&&n.has(o)||(c?(i.add(o),this.it.add(o)):(i.remove(o),this.it.delete(o)))}return Xi}});function pI(t,e){t.indexOf(e)===-1&&t.push(e)}const rm=(t,e,r)=>Math.min(Math.max(r,t),e),dn={duration:.3,delay:0,endDelay:0,repeat:0,easing:"ease"},Pc=t=>typeof t=="number",Bs=t=>Array.isArray(t)&&!Pc(t[0]),gI=(t,e,r)=>{const n=e-t;return((r-t)%n+n)%n+t};function mI(t,e){return Bs(t)?t[gI(0,t.length,e)]:t}const nm=(t,e,r)=>-r*t+r*e+t,im=()=>{},bi=t=>t,rf=(t,e,r)=>e-t===0?1:(r-t)/(e-t);function sm(t,e){const r=t[t.length-1];for(let n=1;n<=e;n++){const i=rf(0,e,n);t.push(nm(r,1,i))}}function wI(t){const e=[0];return sm(e,t-1),e}function vI(t,e=wI(t.length),r=bi){const n=t.length,i=n-e.length;return i>0&&sm(e,i),o=>{let c=0;for(;c<n-2&&!(o<e[c+1]);c++);let l=rm(0,1,rf(e[c],e[c+1],o));return l=mI(r,c)(l),nm(t[c],t[c+1],l)}}const om=t=>Array.isArray(t)&&Pc(t[0]),nf=t=>typeof t=="object"&&!!t.createAnimation,es=t=>typeof t=="function",yI=t=>typeof t=="string",oa={ms:t=>t*1e3,s:t=>t/1e3},am=(t,e,r)=>(((1-3*r+3*e)*t+(3*r-6*e))*t+3*e)*t,bI=1e-7,_I=12;function EI(t,e,r,n,i){let o,c,l=0;do c=e+(r-e)/2,o=am(c,n,i)-t,o>0?r=c:e=c;while(Math.abs(o)>bI&&++l<_I);return c}function aa(t,e,r,n){if(t===e&&r===n)return bi;const i=o=>EI(o,0,1,t,r);return o=>o===0||o===1?o:am(i(o),e,n)}const xI=(t,e="end")=>r=>{r=e==="end"?Math.min(r,.999):Math.max(r,.001);const n=r*t,i=e==="end"?Math.floor(n):Math.ceil(n);return rm(0,1,i/t)},cm={ease:aa(.25,.1,.25,1),"ease-in":aa(.42,0,1,1),"ease-in-out":aa(.42,0,.58,1),"ease-out":aa(0,0,.58,1)},CI=/\((.*?)\)/;function lm(t){if(es(t))return t;if(om(t))return aa(...t);if(cm[t])return cm[t];if(t.startsWith("steps")){const e=CI.exec(t);if(e){const r=e[1].split(",");return xI(parseFloat(r[0]),r[1].trim())}}return bi}class um{constructor(e,r=[0,1],{easing:n,duration:i=dn.duration,delay:o=dn.delay,endDelay:c=dn.endDelay,repeat:l=dn.repeat,offset:h,direction:d="normal"}={}){if(this.startTime=null,this.rate=1,this.t=0,this.cancelTimestamp=null,this.easing=bi,this.duration=0,this.totalDuration=0,this.repeat=0,this.playState="idle",this.finished=new Promise((x,_)=>{this.resolve=x,this.reject=_}),n=n||dn.easing,nf(n)){const x=n.createAnimation(r);n=x.easing,r=x.keyframes||r,i=x.duration||i}this.repeat=l,this.easing=Bs(n)?bi:lm(n),this.updateDuration(i);const v=vI(r,h,Bs(n)?n.map(lm):bi);this.tick=x=>{var _;o=o;let A=0;this.pauseTime!==void 0?A=this.pauseTime:A=(x-this.startTime)*this.rate,this.t=A,A/=1e3,A=Math.max(A-o,0),this.playState==="finished"&&this.pauseTime===void 0&&(A=this.totalDuration);const P=A/this.duration;let L=Math.floor(P),k=P%1;!k&&P>=1&&(k=1),k===1&&L--;const q=L%2;(d==="reverse"||d==="alternate"&&q||d==="alternate-reverse"&&!q)&&(k=1-k);const R=A>=this.totalDuration?1:Math.min(k,1),F=v(this.easing(R));e(F),this.pauseTime===void 0&&(this.playState==="finished"||A>=this.totalDuration+c)?(this.playState="finished",(_=this.resolve)===null||_===void 0||_.call(this,F)):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 sf=function(){};process.env.NODE_ENV!=="production"&&(sf=function(t,e){if(!t)throw new Error(e)});class II{setAnimation(e){this.animation=e,e?.finished.then(()=>this.clearAnimation()).catch(()=>{})}clearAnimation(){this.animation=this.generator=void 0}}const of=new WeakMap;function hm(t){return of.has(t)||of.set(t,{transforms:[],values:new Map}),of.get(t)}function AI(t,e){return t.has(e)||t.set(e,new II),t.get(e)}const $I=["","X","Y","Z"],OI=["translate","scale","rotate","skew"],Tc={x:"translateX",y:"translateY",z:"translateZ"},fm={syntax:"<angle>",initialValue:"0deg",toDefaultUnit:t=>t+"deg"},SI={translate:{syntax:"<length-percentage>",initialValue:"0px",toDefaultUnit:t=>t+"px"},rotate:fm,scale:{syntax:"<number>",initialValue:1,toDefaultUnit:bi},skew:fm},ca=new Map,af=t=>`--motion-${t}`,Rc=["x","y","z"];OI.forEach(t=>{$I.forEach(e=>{Rc.push(t+e),ca.set(af(t+e),SI[t])})});const DI=(t,e)=>Rc.indexOf(t)-Rc.indexOf(e),PI=new Set(Rc),dm=t=>PI.has(t),TI=(t,e)=>{Tc[e]&&(e=Tc[e]);const{transforms:r}=hm(t);pI(r,e),t.style.transform=RI(r)},RI=t=>t.sort(DI).reduce(NI,"").trim(),NI=(t,e)=>`${t} ${e}(var(${af(e)}))`,cf=t=>t.startsWith("--"),pm=new Set;function FI(t){if(!pm.has(t)){pm.add(t);try{const{syntax:e,initialValue:r}=ca.has(t)?ca.get(t):{};CSS.registerProperty({name:t,inherits:!1,syntax:e,initialValue:r})}catch{}}}const lf=(t,e)=>document.createElement("div").animate(t,e),gm={cssRegisterProperty:()=>typeof CSS<"u"&&Object.hasOwnProperty.call(CSS,"registerProperty"),waapi:()=>Object.hasOwnProperty.call(Element.prototype,"animate"),partialKeyframes:()=>{try{lf({opacity:[1]})}catch{return!1}return!0},finished:()=>!!lf({opacity:[0,1]},{duration:.001}).finished,linearEasing:()=>{try{lf({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0}},uf={},ks={};for(const t in gm)ks[t]=()=>(uf[t]===void 0&&(uf[t]=gm[t]()),uf[t]);const LI=.015,MI=(t,e)=>{let r="";const n=Math.round(e/LI);for(let i=0;i<n;i++)r+=t(rf(0,n-1,i))+", ";return r.substring(0,r.length-2)},mm=(t,e)=>es(t)?ks.linearEasing()?`linear(${MI(t,e)})`:dn.easing:om(t)?UI(t):t,UI=([t,e,r,n])=>`cubic-bezier(${t}, ${e}, ${r}, ${n})`;function jI(t,e){for(let r=0;r<t.length;r++)t[r]===null&&(t[r]=r?t[r-1]:e());return t}const BI=t=>Array.isArray(t)?t:[t];function hf(t){return Tc[t]&&(t=Tc[t]),dm(t)?af(t):t}const Nc={get:(t,e)=>{e=hf(e);let r=cf(e)?t.style.getPropertyValue(e):getComputedStyle(t)[e];if(!r&&r!==0){const n=ca.get(e);n&&(r=n.initialValue)}return r},set:(t,e,r)=>{e=hf(e),cf(e)?t.style.setProperty(e,r):t.style[e]=r}};function wm(t,e=!0){if(!(!t||t.playState==="finished"))try{t.stop?t.stop():(e&&t.commitStyles(),t.cancel())}catch{}}function kI(t,e){var r;let n=e?.toDefaultUnit||bi;const i=t[t.length-1];if(yI(i)){const o=((r=i.match(/(-?[\d.]+)([a-z%]*)/))===null||r===void 0?void 0:r[2])||"";o&&(n=c=>c+o)}return n}function HI(){return window.__MOTION_DEV_TOOLS_RECORD}function zI(t,e,r,n={},i){const o=HI(),c=n.record!==!1&&o;let l,{duration:h=dn.duration,delay:d=dn.delay,endDelay:v=dn.endDelay,repeat:x=dn.repeat,easing:_=dn.easing,persist:A=!1,direction:P,offset:L,allowWebkitAcceleration:k=!1}=n;const q=hm(t),R=dm(e);let F=ks.waapi();R&&TI(t,e);const $=hf(e),T=AI(q.values,$),C=ca.get($);return wm(T.animation,!(nf(_)&&T.generator)&&n.record!==!1),()=>{const f=()=>{var z,ee;return(ee=(z=Nc.get(t,$))!==null&&z!==void 0?z:C?.initialValue)!==null&&ee!==void 0?ee:0};let E=jI(BI(r),f);const Z=kI(E,C);if(nf(_)){const z=_.createAnimation(E,e!=="opacity",f,$,T);_=z.easing,E=z.keyframes||E,h=z.duration||h}if(cf($)&&(ks.cssRegisterProperty()?FI($):F=!1),R&&!ks.linearEasing()&&(es(_)||Bs(_)&&_.some(es))&&(F=!1),F){C&&(E=E.map(de=>Pc(de)?C.toDefaultUnit(de):de)),E.length===1&&(!ks.partialKeyframes()||c)&&E.unshift(f());const z={delay:oa.ms(d),duration:oa.ms(h),endDelay:oa.ms(v),easing:Bs(_)?void 0:mm(_,h),direction:P,iterations:x+1,fill:"both"};l=t.animate({[$]:E,offset:L,easing:Bs(_)?_.map(de=>mm(de,h)):void 0},z),l.finished||(l.finished=new Promise((de,me)=>{l.onfinish=de,l.oncancel=me}));const ee=E[E.length-1];l.finished.then(()=>{A||(Nc.set(t,$,ee),l.cancel())}).catch(im),k||(l.playbackRate=1.000001)}else if(i&&R)E=E.map(z=>typeof z=="string"?parseFloat(z):z),E.length===1&&E.unshift(parseFloat(f())),l=new i(z=>{Nc.set(t,$,Z?Z(z):z)},E,Object.assign(Object.assign({},n),{duration:h,easing:_}));else{const z=E[E.length-1];Nc.set(t,$,C&&Pc(z)?C.toDefaultUnit(z):z)}return c&&o(t,e,E,{duration:h,delay:d,easing:_,repeat:x,offset:L},"motion-one"),T.setAnimation(l),l}}const WI=(t,e)=>t[e]?Object.assign(Object.assign({},t),t[e]):Object.assign({},t);function vm(t,e){var r;return typeof t=="string"?e?((r=e[t])!==null&&r!==void 0||(e[t]=document.querySelectorAll(t)),t=e[t]):t=document.querySelectorAll(t):t instanceof Element&&(t=[t]),Array.from(t||[])}const qI=t=>t(),ym=(t,e,r=dn.duration)=>new Proxy({animations:t.map(qI).filter(Boolean),duration:r,options:e},KI),VI=t=>t.animations[0],KI={get:(t,e)=>{const r=VI(t);switch(e){case"duration":return t.duration;case"currentTime":return oa.s(r?.[e]||0);case"playbackRate":case"playState":return r?.[e];case"finished":return t.finished||(t.finished=Promise.all(t.animations.map(GI)).catch(im)),t.finished;case"stop":return()=>{t.animations.forEach(n=>wm(n))};case"forEachNative":return n=>{t.animations.forEach(i=>n(i,t))};default:return typeof r?.[e]>"u"?void 0:()=>t.animations.forEach(n=>n[e]())}},set:(t,e,r)=>{switch(e){case"currentTime":r=oa.ms(r);case"currentTime":case"playbackRate":for(let n=0;n<t.animations.length;n++)t.animations[n][e]=r;return!0}return!1}},GI=t=>t.finished;function ZI(t,e,r){return es(t)?t(e,r):t}function YI(t){return function(r,n,i={}){r=vm(r);const o=r.length;sf(!!o,"No valid element provided."),sf(!!n,"No keyframes defined.");const c=[];for(let l=0;l<o;l++){const h=r[l];for(const d in n){const v=WI(i,d);v.delay=ZI(v.delay,l,o);const x=zI(h,d,n[d],v,t);c.push(x)}}return ym(c,i,i.duration)}}const JI=YI(um);function XI(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r}const QI={any:0,all:1};function eA(t,e,{root:r,margin:n,amount:i="any"}={}){if(typeof IntersectionObserver>"u")return()=>{};const o=vm(t),c=new WeakMap,l=d=>{d.forEach(v=>{const x=c.get(v.target);if(v.isIntersecting!==!!x)if(v.isIntersecting){const _=e(v);es(_)?c.set(v.target,_):h.unobserve(v.target)}else x&&(x(v),c.delete(v.target))})},h=new IntersectionObserver(l,{root:r,rootMargin:n,threshold:typeof i=="number"?i:QI[i]});return o.forEach(d=>h.observe(d)),()=>h.disconnect()}function ff(t,e,r){t.dispatchEvent(new CustomEvent(e,{detail:{originalEvent:r}}))}function bm(t,e,r){t.dispatchEvent(new CustomEvent(e,{detail:{originalEntry:r}}))}const tA={isActive:t=>!!t.inView,subscribe:(t,{enable:e,disable:r},{inViewOptions:n={}})=>{const{once:i}=n,o=XI(n,["once"]);return eA(t,c=>{if(e(),bm(t,"viewenter",c),!i)return l=>{r(),bm(t,"viewleave",l)}},o)}},_m=(t,e,r)=>n=>{n.pointerType&&n.pointerType!=="mouse"||(r(),ff(t,e,n))};[...Object.keys({inView:tA,hover:{isActive:t=>!!t.hover,subscribe:(t,{enable:e,disable:r})=>{const n=_m(t,"hoverstart",e),i=_m(t,"hoverend",r);return t.addEventListener("pointerenter",n),t.addEventListener("pointerleave",i),()=>{t.removeEventListener("pointerenter",n),t.removeEventListener("pointerleave",i)}}},press:{isActive:t=>!!t.press,subscribe:(t,{enable:e,disable:r})=>{const n=o=>{r(),ff(t,"pressend",o),window.removeEventListener("pointerup",n)},i=o=>{e(),ff(t,"pressstart",o),window.addEventListener("pointerup",n)};return t.addEventListener("pointerdown",i),()=>{t.removeEventListener("pointerdown",i),window.removeEventListener("pointerup",n)}}}})];function rA(t,e={}){return ym([()=>{const r=new um(t,[0,1],e);return r.finished.catch(()=>{}),r}],e,e.duration)}function ts(t,e,r){return(es(t)?rA:JI)(t,e,r)}var la={},nA=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then},Em={},Jr={};let df;const iA=[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];Jr.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},Jr.getSymbolTotalCodewords=function(e){return iA[e]},Jr.getBCHDigit=function(t){let e=0;for(;t!==0;)e++,t>>>=1;return e},Jr.setToSJISFunction=function(e){if(typeof e!="function")throw new Error('"toSJISFunc" is not a valid function.');df=e},Jr.isKanjiModeEnabled=function(){return typeof df<"u"},Jr.toSJIS=function(e){return df(e)};var Fc={};(function(t){t.L={bit:1},t.M={bit:0},t.Q={bit:3},t.H={bit:2};function e(r){if(typeof r!="string")throw new Error("Param is not a string");switch(r.toLowerCase()){case"l":case"low":return t.L;case"m":case"medium":return t.M;case"q":case"quartile":return t.Q;case"h":case"high":return t.H;default:throw new Error("Unknown EC Level: "+r)}}t.isValid=function(n){return n&&typeof n.bit<"u"&&n.bit>=0&&n.bit<4},t.from=function(n,i){if(t.isValid(n))return n;try{return e(n)}catch{return i}}})(Fc);function xm(){this.buffer=[],this.length=0}xm.prototype={get:function(t){const e=Math.floor(t/8);return(this.buffer[e]>>>7-t%8&1)===1},put:function(t,e){for(let r=0;r<e;r++)this.putBit((t>>>e-r-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(t){const e=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),t&&(this.buffer[e]|=128>>>this.length%8),this.length++}};var sA=xm;function ua(t){if(!t||t<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=t,this.data=new Uint8Array(t*t),this.reservedBit=new Uint8Array(t*t)}ua.prototype.set=function(t,e,r,n){const i=t*this.size+e;this.data[i]=r,n&&(this.reservedBit[i]=!0)},ua.prototype.get=function(t,e){return this.data[t*this.size+e]},ua.prototype.xor=function(t,e,r){this.data[t*this.size+e]^=r},ua.prototype.isReserved=function(t,e){return this.reservedBit[t*this.size+e]};var oA=ua,Cm={};(function(t){const e=Jr.getSymbolSize;t.getRowColCoords=function(n){if(n===1)return[];const i=Math.floor(n/7)+2,o=e(n),c=o===145?26:Math.ceil((o-13)/(2*i-2))*2,l=[o-7];for(let h=1;h<i-1;h++)l[h]=l[h-1]-c;return l.push(6),l.reverse()},t.getPositions=function(n){const i=[],o=t.getRowColCoords(n),c=o.length;for(let l=0;l<c;l++)for(let h=0;h<c;h++)l===0&&h===0||l===0&&h===c-1||l===c-1&&h===0||i.push([o[l],o[h]]);return i}})(Cm);var Im={};const aA=Jr.getSymbolSize,Am=7;Im.getPositions=function(e){const r=aA(e);return[[0,0],[r-Am,0],[0,r-Am]]};var $m={};(function(t){t.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};const e={N1:3,N2:3,N3:40,N4:10};t.isValid=function(i){return i!=null&&i!==""&&!isNaN(i)&&i>=0&&i<=7},t.from=function(i){return t.isValid(i)?parseInt(i,10):void 0},t.getPenaltyN1=function(i){const o=i.size;let c=0,l=0,h=0,d=null,v=null;for(let x=0;x<o;x++){l=h=0,d=v=null;for(let _=0;_<o;_++){let A=i.get(x,_);A===d?l++:(l>=5&&(c+=e.N1+(l-5)),d=A,l=1),A=i.get(_,x),A===v?h++:(h>=5&&(c+=e.N1+(h-5)),v=A,h=1)}l>=5&&(c+=e.N1+(l-5)),h>=5&&(c+=e.N1+(h-5))}return c},t.getPenaltyN2=function(i){const o=i.size;let c=0;for(let l=0;l<o-1;l++)for(let h=0;h<o-1;h++){const d=i.get(l,h)+i.get(l,h+1)+i.get(l+1,h)+i.get(l+1,h+1);(d===4||d===0)&&c++}return c*e.N2},t.getPenaltyN3=function(i){const o=i.size;let c=0,l=0,h=0;for(let d=0;d<o;d++){l=h=0;for(let v=0;v<o;v++)l=l<<1&2047|i.get(d,v),v>=10&&(l===1488||l===93)&&c++,h=h<<1&2047|i.get(v,d),v>=10&&(h===1488||h===93)&&c++}return c*e.N3},t.getPenaltyN4=function(i){let o=0;const c=i.data.length;for(let h=0;h<c;h++)o+=i.data[h];return Math.abs(Math.ceil(o*100/c/5)-10)*e.N4};function r(n,i,o){switch(n){case t.Patterns.PATTERN000:return(i+o)%2===0;case t.Patterns.PATTERN001:return i%2===0;case t.Patterns.PATTERN010:return o%3===0;case t.Patterns.PATTERN011:return(i+o)%3===0;case t.Patterns.PATTERN100:return(Math.floor(i/2)+Math.floor(o/3))%2===0;case t.Patterns.PATTERN101:return i*o%2+i*o%3===0;case t.Patterns.PATTERN110:return(i*o%2+i*o%3)%2===0;case t.Patterns.PATTERN111:return(i*o%3+(i+o)%2)%2===0;default:throw new Error("bad maskPattern:"+n)}}t.applyMask=function(i,o){const c=o.size;for(let l=0;l<c;l++)for(let h=0;h<c;h++)o.isReserved(h,l)||o.xor(h,l,r(i,h,l))},t.getBestMask=function(i,o){const c=Object.keys(t.Patterns).length;let l=0,h=1/0;for(let d=0;d<c;d++){o(d),t.applyMask(d,i);const v=t.getPenaltyN1(i)+t.getPenaltyN2(i)+t.getPenaltyN3(i)+t.getPenaltyN4(i);t.applyMask(d,i),v<h&&(h=v,l=d)}return l}})($m);var Lc={};const _i=Fc,Mc=[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],Uc=[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];Lc.getBlocksCount=function(e,r){switch(r){case _i.L:return Mc[(e-1)*4+0];case _i.M:return Mc[(e-1)*4+1];case _i.Q:return Mc[(e-1)*4+2];case _i.H:return Mc[(e-1)*4+3];default:return}},Lc.getTotalCodewordsCount=function(e,r){switch(r){case _i.L:return Uc[(e-1)*4+0];case _i.M:return Uc[(e-1)*4+1];case _i.Q:return Uc[(e-1)*4+2];case _i.H:return Uc[(e-1)*4+3];default:return}};var Om={},jc={};const ha=new Uint8Array(512),Bc=new Uint8Array(256);(function(){let e=1;for(let r=0;r<255;r++)ha[r]=e,Bc[e]=r,e<<=1,e&256&&(e^=285);for(let r=255;r<512;r++)ha[r]=ha[r-255]})(),jc.log=function(e){if(e<1)throw new Error("log("+e+")");return Bc[e]},jc.exp=function(e){return ha[e]},jc.mul=function(e,r){return e===0||r===0?0:ha[Bc[e]+Bc[r]]},function(t){const e=jc;t.mul=function(n,i){const o=new Uint8Array(n.length+i.length-1);for(let c=0;c<n.length;c++)for(let l=0;l<i.length;l++)o[c+l]^=e.mul(n[c],i[l]);return o},t.mod=function(n,i){let o=new Uint8Array(n);for(;o.length-i.length>=0;){const c=o[0];for(let h=0;h<i.length;h++)o[h]^=e.mul(i[h],c);let l=0;for(;l<o.length&&o[l]===0;)l++;o=o.slice(l)}return o},t.generateECPolynomial=function(n){let i=new Uint8Array([1]);for(let o=0;o<n;o++)i=t.mul(i,new Uint8Array([1,e.exp(o)]));return i}}(Om);const Sm=Om;function pf(t){this.genPoly=void 0,this.degree=t,this.degree&&this.initialize(this.degree)}pf.prototype.initialize=function(e){this.degree=e,this.genPoly=Sm.generateECPolynomial(this.degree)},pf.prototype.encode=function(e){if(!this.genPoly)throw new Error("Encoder not initialized");const r=new Uint8Array(e.length+this.degree);r.set(e);const n=Sm.mod(r,this.genPoly),i=this.degree-n.length;if(i>0){const o=new Uint8Array(this.degree);return o.set(n,i),o}return n};var cA=pf,Dm={},Ei={},gf={};gf.isValid=function(e){return!isNaN(e)&&e>=1&&e<=40};var jn={};const Pm="[0-9]+",lA="[A-Z $%*+\\-./:]+";let fa="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";fa=fa.replace(/u/g,"\\u");const uA="(?:(?![A-Z0-9 $%*+\\-./:]|"+fa+`)(?:.|[\r
146
+ ]))+`;jn.KANJI=new RegExp(fa,"g"),jn.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),jn.BYTE=new RegExp(uA,"g"),jn.NUMERIC=new RegExp(Pm,"g"),jn.ALPHANUMERIC=new RegExp(lA,"g");const hA=new RegExp("^"+fa+"$"),fA=new RegExp("^"+Pm+"$"),dA=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");jn.testKanji=function(e){return hA.test(e)},jn.testNumeric=function(e){return fA.test(e)},jn.testAlphanumeric=function(e){return dA.test(e)},function(t){const e=gf,r=jn;t.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},t.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},t.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},t.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},t.MIXED={bit:-1},t.getCharCountIndicator=function(o,c){if(!o.ccBits)throw new Error("Invalid mode: "+o);if(!e.isValid(c))throw new Error("Invalid version: "+c);return c>=1&&c<10?o.ccBits[0]:c<27?o.ccBits[1]:o.ccBits[2]},t.getBestModeForData=function(o){return r.testNumeric(o)?t.NUMERIC:r.testAlphanumeric(o)?t.ALPHANUMERIC:r.testKanji(o)?t.KANJI:t.BYTE},t.toString=function(o){if(o&&o.id)return o.id;throw new Error("Invalid mode")},t.isValid=function(o){return o&&o.bit&&o.ccBits};function n(i){if(typeof i!="string")throw new Error("Param is not a string");switch(i.toLowerCase()){case"numeric":return t.NUMERIC;case"alphanumeric":return t.ALPHANUMERIC;case"kanji":return t.KANJI;case"byte":return t.BYTE;default:throw new Error("Unknown mode: "+i)}}t.from=function(o,c){if(t.isValid(o))return o;try{return n(o)}catch{return c}}}(Ei),function(t){const e=Jr,r=Lc,n=Fc,i=Ei,o=gf,c=7973,l=e.getBCHDigit(c);function h(_,A,P){for(let L=1;L<=40;L++)if(A<=t.getCapacity(L,P,_))return L}function d(_,A){return i.getCharCountIndicator(_,A)+4}function v(_,A){let P=0;return _.forEach(function(L){const k=d(L.mode,A);P+=k+L.getBitsLength()}),P}function x(_,A){for(let P=1;P<=40;P++)if(v(_,P)<=t.getCapacity(P,A,i.MIXED))return P}t.from=function(A,P){return o.isValid(A)?parseInt(A,10):P},t.getCapacity=function(A,P,L){if(!o.isValid(A))throw new Error("Invalid QR Code version");typeof L>"u"&&(L=i.BYTE);const k=e.getSymbolTotalCodewords(A),q=r.getTotalCodewordsCount(A,P),R=(k-q)*8;if(L===i.MIXED)return R;const F=R-d(L,A);switch(L){case i.NUMERIC:return Math.floor(F/10*3);case i.ALPHANUMERIC:return Math.floor(F/11*2);case i.KANJI:return Math.floor(F/13);case i.BYTE:default:return Math.floor(F/8)}},t.getBestVersionForData=function(A,P){let L;const k=n.from(P,n.M);if(Array.isArray(A)){if(A.length>1)return x(A,k);if(A.length===0)return 1;L=A[0]}else L=A;return h(L.mode,L.getLength(),k)},t.getEncodedBits=function(A){if(!o.isValid(A)||A<7)throw new Error("Invalid QR Code version");let P=A<<12;for(;e.getBCHDigit(P)-l>=0;)P^=c<<e.getBCHDigit(P)-l;return A<<12|P}}(Dm);var Tm={};const mf=Jr,Rm=1335,pA=21522,Nm=mf.getBCHDigit(Rm);Tm.getEncodedBits=function(e,r){const n=e.bit<<3|r;let i=n<<10;for(;mf.getBCHDigit(i)-Nm>=0;)i^=Rm<<mf.getBCHDigit(i)-Nm;return(n<<10|i)^pA};var Fm={};const gA=Ei;function Hs(t){this.mode=gA.NUMERIC,this.data=t.toString()}Hs.getBitsLength=function(e){return 10*Math.floor(e/3)+(e%3?e%3*3+1:0)},Hs.prototype.getLength=function(){return this.data.length},Hs.prototype.getBitsLength=function(){return Hs.getBitsLength(this.data.length)},Hs.prototype.write=function(e){let r,n,i;for(r=0;r+3<=this.data.length;r+=3)n=this.data.substr(r,3),i=parseInt(n,10),e.put(i,10);const o=this.data.length-r;o>0&&(n=this.data.substr(r),i=parseInt(n,10),e.put(i,o*3+1))};var mA=Hs;const wA=Ei,wf=["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 zs(t){this.mode=wA.ALPHANUMERIC,this.data=t}zs.getBitsLength=function(e){return 11*Math.floor(e/2)+6*(e%2)},zs.prototype.getLength=function(){return this.data.length},zs.prototype.getBitsLength=function(){return zs.getBitsLength(this.data.length)},zs.prototype.write=function(e){let r;for(r=0;r+2<=this.data.length;r+=2){let n=wf.indexOf(this.data[r])*45;n+=wf.indexOf(this.data[r+1]),e.put(n,11)}this.data.length%2&&e.put(wf.indexOf(this.data[r]),6)};var vA=zs,yA=function(e){for(var r=[],n=e.length,i=0;i<n;i++){var o=e.charCodeAt(i);if(o>=55296&&o<=56319&&n>i+1){var c=e.charCodeAt(i+1);c>=56320&&c<=57343&&(o=(o-55296)*1024+c-56320+65536,i+=1)}if(o<128){r.push(o);continue}if(o<2048){r.push(o>>6|192),r.push(o&63|128);continue}if(o<55296||o>=57344&&o<65536){r.push(o>>12|224),r.push(o>>6&63|128),r.push(o&63|128);continue}if(o>=65536&&o<=1114111){r.push(o>>18|240),r.push(o>>12&63|128),r.push(o>>6&63|128),r.push(o&63|128);continue}r.push(239,191,189)}return new Uint8Array(r).buffer};const bA=yA,_A=Ei;function Ws(t){this.mode=_A.BYTE,typeof t=="string"&&(t=bA(t)),this.data=new Uint8Array(t)}Ws.getBitsLength=function(e){return e*8},Ws.prototype.getLength=function(){return this.data.length},Ws.prototype.getBitsLength=function(){return Ws.getBitsLength(this.data.length)},Ws.prototype.write=function(t){for(let e=0,r=this.data.length;e<r;e++)t.put(this.data[e],8)};var EA=Ws;const xA=Ei,CA=Jr;function qs(t){this.mode=xA.KANJI,this.data=t}qs.getBitsLength=function(e){return e*13},qs.prototype.getLength=function(){return this.data.length},qs.prototype.getBitsLength=function(){return qs.getBitsLength(this.data.length)},qs.prototype.write=function(t){let e;for(e=0;e<this.data.length;e++){let r=CA.toSJIS(this.data[e]);if(r>=33088&&r<=40956)r-=33088;else if(r>=57408&&r<=60351)r-=49472;else throw new Error("Invalid SJIS character: "+this.data[e]+`
147
+ Make sure your charset is UTF-8`);r=(r>>>8&255)*192+(r&255),t.put(r,13)}};var IA=qs,Lm={exports:{}};(function(t){var e={single_source_shortest_paths:function(r,n,i){var o={},c={};c[n]=0;var l=e.PriorityQueue.make();l.push(n,0);for(var h,d,v,x,_,A,P,L,k;!l.empty();){h=l.pop(),d=h.value,x=h.cost,_=r[d]||{};for(v in _)_.hasOwnProperty(v)&&(A=_[v],P=x+A,L=c[v],k=typeof c[v]>"u",(k||L>P)&&(c[v]=P,l.push(v,P),o[v]=d))}if(typeof i<"u"&&typeof c[i]>"u"){var q=["Could not find a path from ",n," to ",i,"."].join("");throw new Error(q)}return o},extract_shortest_path_from_predecessor_list:function(r,n){for(var i=[],o=n;o;)i.push(o),r[o],o=r[o];return i.reverse(),i},find_path:function(r,n,i){var o=e.single_source_shortest_paths(r,n,i);return e.extract_shortest_path_from_predecessor_list(o,i)},PriorityQueue:{make:function(r){var n=e.PriorityQueue,i={},o;r=r||{};for(o in n)n.hasOwnProperty(o)&&(i[o]=n[o]);return i.queue=[],i.sorter=r.sorter||n.default_sorter,i},default_sorter:function(r,n){return r.cost-n.cost},push:function(r,n){var i={value:r,cost:n};this.queue.push(i),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};t.exports=e})(Lm),function(t){const e=Ei,r=mA,n=vA,i=EA,o=IA,c=jn,l=Jr,h=Lm.exports;function d(q){return unescape(encodeURIComponent(q)).length}function v(q,R,F){const $=[];let T;for(;(T=q.exec(F))!==null;)$.push({data:T[0],index:T.index,mode:R,length:T[0].length});return $}function x(q){const R=v(c.NUMERIC,e.NUMERIC,q),F=v(c.ALPHANUMERIC,e.ALPHANUMERIC,q);let $,T;return l.isKanjiModeEnabled()?($=v(c.BYTE,e.BYTE,q),T=v(c.KANJI,e.KANJI,q)):($=v(c.BYTE_KANJI,e.BYTE,q),T=[]),R.concat(F,$,T).sort(function(f,E){return f.index-E.index}).map(function(f){return{data:f.data,mode:f.mode,length:f.length}})}function _(q,R){switch(R){case e.NUMERIC:return r.getBitsLength(q);case e.ALPHANUMERIC:return n.getBitsLength(q);case e.KANJI:return o.getBitsLength(q);case e.BYTE:return i.getBitsLength(q)}}function A(q){return q.reduce(function(R,F){const $=R.length-1>=0?R[R.length-1]:null;return $&&$.mode===F.mode?(R[R.length-1].data+=F.data,R):(R.push(F),R)},[])}function P(q){const R=[];for(let F=0;F<q.length;F++){const $=q[F];switch($.mode){case e.NUMERIC:R.push([$,{data:$.data,mode:e.ALPHANUMERIC,length:$.length},{data:$.data,mode:e.BYTE,length:$.length}]);break;case e.ALPHANUMERIC:R.push([$,{data:$.data,mode:e.BYTE,length:$.length}]);break;case e.KANJI:R.push([$,{data:$.data,mode:e.BYTE,length:d($.data)}]);break;case e.BYTE:R.push([{data:$.data,mode:e.BYTE,length:d($.data)}])}}return R}function L(q,R){const F={},$={start:{}};let T=["start"];for(let C=0;C<q.length;C++){const f=q[C],E=[];for(let Z=0;Z<f.length;Z++){const z=f[Z],ee=""+C+Z;E.push(ee),F[ee]={node:z,lastCount:0},$[ee]={};for(let de=0;de<T.length;de++){const me=T[de];F[me]&&F[me].node.mode===z.mode?($[me][ee]=_(F[me].lastCount+z.length,z.mode)-_(F[me].lastCount,z.mode),F[me].lastCount+=z.length):(F[me]&&(F[me].lastCount=z.length),$[me][ee]=_(z.length,z.mode)+4+e.getCharCountIndicator(z.mode,R))}}T=E}for(let C=0;C<T.length;C++)$[T[C]].end=0;return{map:$,table:F}}function k(q,R){let F;const $=e.getBestModeForData(q);if(F=e.from(R,$),F!==e.BYTE&&F.bit<$.bit)throw new Error('"'+q+'" cannot be encoded with mode '+e.toString(F)+`.
148
+ Suggested mode is: `+e.toString($));switch(F===e.KANJI&&!l.isKanjiModeEnabled()&&(F=e.BYTE),F){case e.NUMERIC:return new r(q);case e.ALPHANUMERIC:return new n(q);case e.KANJI:return new o(q);case e.BYTE:return new i(q)}}t.fromArray=function(R){return R.reduce(function(F,$){return typeof $=="string"?F.push(k($,null)):$.data&&F.push(k($.data,$.mode)),F},[])},t.fromString=function(R,F){const $=x(R,l.isKanjiModeEnabled()),T=P($),C=L(T,F),f=h.find_path(C.map,"start","end"),E=[];for(let Z=1;Z<f.length-1;Z++)E.push(C.table[f[Z]].node);return t.fromArray(A(E))},t.rawSplit=function(R){return t.fromArray(x(R,l.isKanjiModeEnabled()))}}(Fm);const kc=Jr,vf=Fc,AA=sA,$A=oA,OA=Cm,SA=Im,yf=$m,bf=Lc,DA=cA,Hc=Dm,PA=Tm,TA=Ei,_f=Fm;function RA(t,e){const r=t.size,n=SA.getPositions(e);for(let i=0;i<n.length;i++){const o=n[i][0],c=n[i][1];for(let l=-1;l<=7;l++)if(!(o+l<=-1||r<=o+l))for(let h=-1;h<=7;h++)c+h<=-1||r<=c+h||(l>=0&&l<=6&&(h===0||h===6)||h>=0&&h<=6&&(l===0||l===6)||l>=2&&l<=4&&h>=2&&h<=4?t.set(o+l,c+h,!0,!0):t.set(o+l,c+h,!1,!0))}}function NA(t){const e=t.size;for(let r=8;r<e-8;r++){const n=r%2===0;t.set(r,6,n,!0),t.set(6,r,n,!0)}}function FA(t,e){const r=OA.getPositions(e);for(let n=0;n<r.length;n++){const i=r[n][0],o=r[n][1];for(let c=-2;c<=2;c++)for(let l=-2;l<=2;l++)c===-2||c===2||l===-2||l===2||c===0&&l===0?t.set(i+c,o+l,!0,!0):t.set(i+c,o+l,!1,!0)}}function LA(t,e){const r=t.size,n=Hc.getEncodedBits(e);let i,o,c;for(let l=0;l<18;l++)i=Math.floor(l/3),o=l%3+r-8-3,c=(n>>l&1)===1,t.set(i,o,c,!0),t.set(o,i,c,!0)}function Ef(t,e,r){const n=t.size,i=PA.getEncodedBits(e,r);let o,c;for(o=0;o<15;o++)c=(i>>o&1)===1,o<6?t.set(o,8,c,!0):o<8?t.set(o+1,8,c,!0):t.set(n-15+o,8,c,!0),o<8?t.set(8,n-o-1,c,!0):o<9?t.set(8,15-o-1+1,c,!0):t.set(8,15-o-1,c,!0);t.set(n-8,8,1,!0)}function MA(t,e){const r=t.size;let n=-1,i=r-1,o=7,c=0;for(let l=r-1;l>0;l-=2)for(l===6&&l--;;){for(let h=0;h<2;h++)if(!t.isReserved(i,l-h)){let d=!1;c<e.length&&(d=(e[c]>>>o&1)===1),t.set(i,l-h,d),o--,o===-1&&(c++,o=7)}if(i+=n,i<0||r<=i){i-=n,n=-n;break}}}function UA(t,e,r){const n=new AA;r.forEach(function(h){n.put(h.mode.bit,4),n.put(h.getLength(),TA.getCharCountIndicator(h.mode,t)),h.write(n)});const i=kc.getSymbolTotalCodewords(t),o=bf.getTotalCodewordsCount(t,e),c=(i-o)*8;for(n.getLengthInBits()+4<=c&&n.put(0,4);n.getLengthInBits()%8!==0;)n.putBit(0);const l=(c-n.getLengthInBits())/8;for(let h=0;h<l;h++)n.put(h%2?17:236,8);return jA(n,t,e)}function jA(t,e,r){const n=kc.getSymbolTotalCodewords(e),i=bf.getTotalCodewordsCount(e,r),o=n-i,c=bf.getBlocksCount(e,r),l=n%c,h=c-l,d=Math.floor(n/c),v=Math.floor(o/c),x=v+1,_=d-v,A=new DA(_);let P=0;const L=new Array(c),k=new Array(c);let q=0;const R=new Uint8Array(t.buffer);for(let f=0;f<c;f++){const E=f<h?v:x;L[f]=R.slice(P,P+E),k[f]=A.encode(L[f]),P+=E,q=Math.max(q,E)}const F=new Uint8Array(n);let $=0,T,C;for(T=0;T<q;T++)for(C=0;C<c;C++)T<L[C].length&&(F[$++]=L[C][T]);for(T=0;T<_;T++)for(C=0;C<c;C++)F[$++]=k[C][T];return F}function BA(t,e,r,n){let i;if(Array.isArray(t))i=_f.fromArray(t);else if(typeof t=="string"){let d=e;if(!d){const v=_f.rawSplit(t);d=Hc.getBestVersionForData(v,r)}i=_f.fromString(t,d||40)}else throw new Error("Invalid data");const o=Hc.getBestVersionForData(i,r);if(!o)throw new Error("The amount of data is too big to be stored in a QR Code");if(!e)e=o;else if(e<o)throw new Error(`
149
149
  The chosen QR Code version cannot contain this amount of data.
150
150
  Minimum version required to store current data is: `+o+`.
151
- `);const c=EC(e,r,i),l=Tc.getSymbolSize(e),h=new hC(l);return wC(h,e),vC(h),yC(h,e),cf(h,r,0),e>=7&&bC(h,e),_C(h,c),isNaN(n)&&(n=sf.getBestMask(h,cf.bind(null,h,r))),sf.applyMask(n,h),cf(h,r,n),{modules:h,version:e,errorCorrectionLevel:r,maskPattern:n,segments:i}}T3.create=function(e,r){if(typeof e>"u"||e==="")throw new Error("No input text");let n=nf.M,i,o;return typeof r<"u"&&(n=nf.from(r.errorCorrectionLevel,nf.M),i=Nc.from(r.version),o=sf.from(r.maskPattern),r.toSJISFunc&&Tc.setToSJISFunction(r.toSJISFunc)),CC(e,i,n,o)};var K3={},lf={};(function(t){function e(r){if(typeof r=="number"&&(r=r.toString()),typeof r!="string")throw new Error("Color should be defined as hex string");let n=r.slice().replace("#","").split("");if(n.length<3||n.length===5||n.length>8)throw new Error("Invalid hex color: "+r);(n.length===3||n.length===4)&&(n=Array.prototype.concat.apply([],n.map(function(o){return[o,o]}))),n.length===6&&n.push("F","F");const i=parseInt(n.join(""),16);return{r:i>>24&255,g:i>>16&255,b:i>>8&255,a:i&255,hex:"#"+n.slice(0,6).join("")}}t.getOptions=function(n){n||(n={}),n.color||(n.color={});const i=typeof n.margin>"u"||n.margin===null||n.margin<0?4:n.margin,o=n.width&&n.width>=21?n.width:void 0,c=n.scale||4;return{width:o,scale:o?4:c,margin:i,color:{dark:e(n.color.dark||"#000000ff"),light:e(n.color.light||"#ffffffff")},type:n.type,rendererOpts:n.rendererOpts||{}}},t.getScale=function(n,i){return i.width&&i.width>=n+i.margin*2?i.width/(n+i.margin*2):i.scale},t.getImageWidth=function(n,i){const o=t.getScale(n,i);return Math.floor((n+i.margin*2)*o)},t.qrToImageData=function(n,i,o){const c=i.modules.size,l=i.modules.data,h=t.getScale(c,o),f=Math.floor((c+o.margin*2)*h),v=o.margin*h,E=[o.color.light,o.color.dark];for(let _=0;_<f;_++)for(let S=0;S<f;S++){let P=(_*f+S)*4,j=o.color.light;if(_>=v&&S>=v&&_<f-v&&S<f-v){const H=Math.floor((_-v)/h),Z=Math.floor((S-v)/h);j=E[l[H*c+Z]?1:0]}n[P++]=j.r,n[P++]=j.g,n[P++]=j.b,n[P]=j.a}}})(lf),function(t){const e=lf;function r(i,o,c){i.clearRect(0,0,o.width,o.height),o.style||(o.style={}),o.height=c,o.width=c,o.style.height=c+"px",o.style.width=c+"px"}function n(){try{return document.createElement("canvas")}catch{throw new Error("You need to specify a canvas element")}}t.render=function(o,c,l){let h=l,f=c;typeof h>"u"&&(!c||!c.getContext)&&(h=c,c=void 0),c||(f=n()),h=e.getOptions(h);const v=e.getImageWidth(o.modules.size,h),E=f.getContext("2d"),_=E.createImageData(v,v);return e.qrToImageData(_.data,o,h),r(E,f,v),E.putImageData(_,0,0),f},t.renderToDataURL=function(o,c,l){let h=l;typeof h>"u"&&(!c||!c.getContext)&&(h=c,c=void 0),h||(h={});const f=t.render(o,c,h),v=h.type||"image/png",E=h.rendererOpts||{};return f.toDataURL(v,E.quality)}}(K3);var G3={};const IC=lf;function Z3(t,e){const r=t.a/255,n=e+'="'+t.hex+'"';return r<1?n+" "+e+'-opacity="'+r.toFixed(2).slice(1)+'"':n}function uf(t,e,r){let n=t+e;return typeof r<"u"&&(n+=" "+r),n}function SC(t,e,r){let n="",i=0,o=!1,c=0;for(let l=0;l<t.length;l++){const h=Math.floor(l%e),f=Math.floor(l/e);!h&&!o&&(o=!0),t[l]?(c++,l>0&&h>0&&t[l-1]||(n+=o?uf("M",h+r,.5+f+r):uf("m",i,0),i=0,o=!1),h+1<e&&t[l+1]||(n+=uf("h",c),c=0)):i++}return n}G3.render=function(e,r,n){const i=IC.getOptions(r),o=e.modules.size,c=e.modules.data,l=o+i.margin*2,h=i.color.light.a?"<path "+Z3(i.color.light,"fill")+' d="M0 0h'+l+"v"+l+'H0z"/>':"",f="<path "+Z3(i.color.dark,"stroke")+' d="'+SC(c,o,i.margin)+'"/>',v='viewBox="0 0 '+l+" "+l+'"',_='<svg xmlns="http://www.w3.org/2000/svg" '+(i.width?'width="'+i.width+'" height="'+i.width+'" ':"")+v+' shape-rendering="crispEdges">'+h+f+`</svg>
152
- `;return typeof n=="function"&&n(null,_),_};const AC=k9,hf=T3,Y3=K3,OC=G3;function ff(t,e,r,n,i){const o=[].slice.call(arguments,1),c=o.length,l=typeof o[c-1]=="function";if(!l&&!AC())throw new Error("Callback required as last argument");if(l){if(c<2)throw new Error("Too few arguments provided");c===2?(i=r,r=e,e=n=void 0):c===3&&(e.getContext&&typeof i>"u"?(i=n,n=void 0):(i=n,n=r,r=e,e=void 0))}else{if(c<1)throw new Error("Too few arguments provided");return c===1?(r=e,e=n=void 0):c===2&&!e.getContext&&(n=r,r=e,e=void 0),new Promise(function(h,f){try{const v=hf.create(r,n);h(t(v,e,n))}catch(v){f(v)}})}try{const h=hf.create(r,n);i(null,t(h,e,n))}catch(h){i(h)}}ra.create=hf.create,ra.toCanvas=ff.bind(null,Y3.render),ra.toDataURL=ff.bind(null,Y3.renderToDataURL),ra.toString=ff.bind(null,function(t,e,r){return OC.render(t,r)});var DC=Object.defineProperty,J3=Object.getOwnPropertySymbols,$C=Object.prototype.hasOwnProperty,PC=Object.prototype.propertyIsEnumerable,X3=(t,e,r)=>e in t?DC(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Rc=(t,e)=>{for(var r in e||(e={}))$C.call(e,r)&&X3(t,r,e[r]);if(J3)for(var r of J3(e))PC.call(e,r)&&X3(t,r,e[r]);return t};function TC(){var t;const e=(t=Mn.state.themeMode)!=null?t:"dark",r={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{"--w3m-color-fg-1":r.foreground[1],"--w3m-color-fg-2":r.foreground[2],"--w3m-color-fg-3":r.foreground[3],"--w3m-color-bg-1":r.background[1],"--w3m-color-bg-2":r.background[2],"--w3m-color-bg-3":r.background[3],"--w3m-color-overlay":r.overlay}}function Q3(){return{"--w3m-accent-color":"#3396FF","--w3m-accent-fill-color":"#FFFFFF","--w3m-z-index":"89","--w3m-background-color":"#3396FF","--w3m-background-border-radius":"8px","--w3m-container-border-radius":"30px","--w3m-wallet-icon-border-radius":"15px","--w3m-wallet-icon-large-border-radius":"30px","--w3m-wallet-icon-small-border-radius":"7px","--w3m-input-border-radius":"28px","--w3m-button-border-radius":"10px","--w3m-notification-border-radius":"36px","--w3m-secondary-button-border-radius":"28px","--w3m-icon-button-border-radius":"50%","--w3m-button-hover-highlight-border-radius":"10px","--w3m-text-big-bold-size":"20px","--w3m-text-big-bold-weight":"600","--w3m-text-big-bold-line-height":"24px","--w3m-text-big-bold-letter-spacing":"-0.03em","--w3m-text-big-bold-text-transform":"none","--w3m-text-xsmall-bold-size":"10px","--w3m-text-xsmall-bold-weight":"700","--w3m-text-xsmall-bold-line-height":"12px","--w3m-text-xsmall-bold-letter-spacing":"0.02em","--w3m-text-xsmall-bold-text-transform":"uppercase","--w3m-text-xsmall-regular-size":"12px","--w3m-text-xsmall-regular-weight":"600","--w3m-text-xsmall-regular-line-height":"14px","--w3m-text-xsmall-regular-letter-spacing":"-0.03em","--w3m-text-xsmall-regular-text-transform":"none","--w3m-text-small-thin-size":"14px","--w3m-text-small-thin-weight":"500","--w3m-text-small-thin-line-height":"16px","--w3m-text-small-thin-letter-spacing":"-0.03em","--w3m-text-small-thin-text-transform":"none","--w3m-text-small-regular-size":"14px","--w3m-text-small-regular-weight":"600","--w3m-text-small-regular-line-height":"16px","--w3m-text-small-regular-letter-spacing":"-0.03em","--w3m-text-small-regular-text-transform":"none","--w3m-text-medium-regular-size":"16px","--w3m-text-medium-regular-weight":"600","--w3m-text-medium-regular-line-height":"20px","--w3m-text-medium-regular-letter-spacing":"-0.03em","--w3m-text-medium-regular-text-transform":"none","--w3m-font-family":"-apple-system, system-ui, BlinkMacSystemFont, 'Segoe UI', Roboto, Ubuntu, 'Helvetica Neue', sans-serif","--w3m-success-color":"rgb(38,181,98)","--w3m-error-color":"rgb(242, 90, 103)"}}function NC(){const{themeVariables:t}=Mn.state;return{"--w3m-background-image-url":t!=null&&t["--w3m-background-image-url"]?`url(${t["--w3m-background-image-url"]})`:"none"}}const Fe={getPreset(t){return Q3()[t]},setTheme(){const t=document.querySelector(":root"),{themeVariables:e}=Mn.state;if(t){const r=Rc(Rc(Rc(Rc({},TC()),Q3()),e),NC());Object.entries(r).forEach(([n,i])=>t.style.setProperty(n,i))}},globalCss:Ve`*,::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 w3m-text{position:relative;z-index:1}input{border:none;outline:0;appearance:none}img{display:block}::selection{color:var(--w3m-accent-fill-color);background:var(--w3m-accent-color)}`},RC=Ve`button{display:flex;border-radius:var(--w3m-button-hover-highlight-border-radius);flex-direction:column;justify-content:center;padding:5px;width:100px}button:active{background-color:var(--w3m-color-overlay)}@media(hover:hover){button:hover{background-color:var(--w3m-color-overlay)}}button>div{display:flex;justify-content:center;align-items:center;width:32px;height:32px;box-shadow:inset 0 0 0 1px var(--w3m-color-overlay);background-color:var(--w3m-accent-color);border-radius:var(--w3m-icon-button-border-radius);margin-bottom:4px}button path{fill:var(--w3m-accent-fill-color)}`;var LC=Object.defineProperty,MC=Object.getOwnPropertyDescriptor,Lc=(t,e,r,n)=>{for(var i=n>1?void 0:n?MC(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&LC(e,r,i),i};let zs=class extends $e{constructor(){super(...arguments),this.icon=void 0,this.label="",this.onClick=()=>null}render(){return oe`<button @click="${this.onClick}"><div>${this.icon}</div><w3m-text variant="xsmall-regular" color="accent">${this.label}</w3m-text></button>`}};zs.styles=[Fe.globalCss,RC],Lc([Ae()],zs.prototype,"icon",2),Lc([Ae()],zs.prototype,"label",2),Lc([Ae()],zs.prototype,"onClick",2),zs=Lc([Re("w3m-box-button")],zs);const UC=Ve`button{border-radius:var(--w3m-secondary-button-border-radius);height:28px;padding:0 10px;background-color:var(--w3m-accent-color)}button path{fill:var(--w3m-accent-fill-color)}button::after{border-radius:inherit;border:1px solid var(--w3m-color-overlay)}button:disabled::after{background-color:transparent}.w3m-icon-left svg{margin-right:5px}.w3m-icon-right svg{margin-left:5px}button:active::after{background-color:var(--w3m-color-overlay)}.w3m-ghost,.w3m-ghost:active::after,.w3m-outline{background-color:transparent}.w3m-ghost:active{opacity:.5}@media(hover:hover){button:hover::after{background-color:var(--w3m-color-overlay)}.w3m-ghost:hover::after{background-color:transparent}.w3m-ghost:hover{opacity:.5}}button:disabled{background-color:var(--w3m-color-bg-3);pointer-events:none}.w3m-ghost::after{border-color:transparent}.w3m-ghost path{fill:var(--w3m-color-fg-2)}.w3m-outline path{fill:var(--w3m-accent-color)}.w3m-outline:disabled{background-color:transparent;opacity:.5}`;var jC=Object.defineProperty,FC=Object.getOwnPropertyDescriptor,Ws=(t,e,r,n)=>{for(var i=n>1?void 0:n?FC(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&jC(e,r,i),i};let Ei=class extends $e{constructor(){super(...arguments),this.disabled=!1,this.iconLeft=void 0,this.iconRight=void 0,this.onClick=()=>null,this.variant="default"}render(){const t={"w3m-icon-left":this.iconLeft!==void 0,"w3m-icon-right":this.iconRight!==void 0,"w3m-ghost":this.variant==="ghost","w3m-outline":this.variant==="outline"};let e="inverse";return this.variant==="ghost"&&(e="secondary"),this.variant==="outline"&&(e="accent"),oe`<button class="${Lr(t)}" ?disabled="${this.disabled}" @click="${this.onClick}">${this.iconLeft}<w3m-text variant="small-regular" color="${e}"><slot></slot></w3m-text>${this.iconRight}</button>`}};Ei.styles=[Fe.globalCss,UC],Ws([Ae()],Ei.prototype,"disabled",2),Ws([Ae()],Ei.prototype,"iconLeft",2),Ws([Ae()],Ei.prototype,"iconRight",2),Ws([Ae()],Ei.prototype,"onClick",2),Ws([Ae()],Ei.prototype,"variant",2),Ei=Ws([Re("w3m-button")],Ei);const BC=Ve`:host{display:inline-block}button{padding:0 15px 1px;height:40px;border-radius:var(--w3m-button-border-radius);color:var(--w3m-accent-fill-color);background-color:var(--w3m-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(--w3m-color-overlay)}button:active::after{background-color:var(--w3m-color-overlay)}button:disabled{padding-bottom:0;background-color:var(--w3m-color-bg-3);color:var(--w3m-color-fg-3)}.w3m-secondary{color:var(--w3m-accent-color);background-color:transparent}.w3m-secondary::after{display:none}@media(hover:hover){button:hover::after{background-color:var(--w3m-color-overlay)}}`;var kC=Object.defineProperty,HC=Object.getOwnPropertyDescriptor,df=(t,e,r,n)=>{for(var i=n>1?void 0:n?HC(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&kC(e,r,i),i};let oa=class extends $e{constructor(){super(...arguments),this.disabled=!1,this.variant="primary"}render(){const t={"w3m-secondary":this.variant==="secondary"};return oe`<button ?disabled="${this.disabled}" class="${Lr(t)}"><slot></slot></button>`}};oa.styles=[Fe.globalCss,BC],df([Ae()],oa.prototype,"disabled",2),df([Ae()],oa.prototype,"variant",2),oa=df([Re("w3m-button-big")],oa);const zC=Ve`:host{background-color:var(--w3m-color-bg-2);border-top:1px solid var(--w3m-color-bg-3)}div{padding:10px 20px;display:inherit;flex-direction:inherit;align-items:inherit;width:inherit;justify-content:inherit}`;var WC=Object.defineProperty,qC=Object.getOwnPropertyDescriptor,VC=(t,e,r,n)=>{for(var i=n>1?void 0:n?qC(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&WC(e,r,i),i};let pf=class extends $e{render(){return oe`<div><slot></slot></div>`}};pf.styles=[Fe.globalCss,zC],pf=VC([Re("w3m-info-footer")],pf);const Le={CROSS_ICON:ut`<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:ut`<svg width="178" height="29" viewBox="0 0 178 29" id="w3m-wc-logo"><path d="M10.683 7.926c5.284-5.17 13.85-5.17 19.134 0l.636.623a.652.652 0 0 1 0 .936l-2.176 2.129a.343.343 0 0 1-.478 0l-.875-.857c-3.686-3.607-9.662-3.607-13.348 0l-.937.918a.343.343 0 0 1-.479 0l-2.175-2.13a.652.652 0 0 1 0-.936l.698-.683Zm23.633 4.403 1.935 1.895a.652.652 0 0 1 0 .936l-8.73 8.543a.687.687 0 0 1-.956 0L20.37 17.64a.172.172 0 0 0-.239 0l-6.195 6.063a.687.687 0 0 1-.957 0l-8.73-8.543a.652.652 0 0 1 0-.936l1.936-1.895a.687.687 0 0 1 .957 0l6.196 6.064a.172.172 0 0 0 .239 0l6.195-6.064a.687.687 0 0 1 .957 0l6.196 6.064a.172.172 0 0 0 .24 0l6.195-6.064a.687.687 0 0 1 .956 0ZM48.093 20.948l2.338-9.355c.139-.515.258-1.07.416-1.942.12.872.258 1.427.357 1.942l2.022 9.355h4.181l3.528-13.874h-3.21l-1.943 8.523a24.825 24.825 0 0 0-.456 2.457c-.158-.931-.317-1.625-.495-2.438l-1.883-8.542h-4.201l-2.042 8.542a41.204 41.204 0 0 0-.475 2.438 41.208 41.208 0 0 0-.476-2.438l-1.903-8.542h-3.349l3.508 13.874h4.083ZM63.33 21.304c1.585 0 2.596-.654 3.11-1.605-.059.297-.078.595-.078.892v.357h2.655V15.22c0-2.735-1.248-4.32-4.3-4.32-2.636 0-4.36 1.466-4.52 3.487h2.914c.1-.891.734-1.426 1.705-1.426.911 0 1.407.515 1.407 1.11 0 .435-.258.693-1.03.792l-1.388.159c-2.061.257-3.825 1.01-3.825 3.19 0 1.982 1.645 3.092 3.35 3.092Zm.891-2.041c-.773 0-1.348-.436-1.348-1.19 0-.733.655-1.09 1.645-1.268l.674-.119c.575-.118.892-.218 1.09-.396v.912c0 1.228-.892 2.06-2.06 2.06ZM70.398 7.074v13.874h2.874V7.074h-2.874ZM74.934 7.074v13.874h2.874V7.074h-2.874ZM84.08 21.304c2.735 0 4.5-1.546 4.697-3.567h-2.893c-.139.892-.892 1.387-1.804 1.387-1.228 0-2.12-.99-2.14-2.358h6.897v-.555c0-3.21-1.764-5.312-4.816-5.312-2.933 0-4.994 2.062-4.994 5.173 0 3.37 2.12 5.232 5.053 5.232Zm-2.16-6.421c.119-1.11.932-1.922 2.081-1.922 1.11 0 1.883.772 1.903 1.922H81.92ZM94.92 21.146c.633 0 1.248-.1 1.525-.179v-2.18c-.218.04-.475.06-.693.06-1.05 0-1.427-.595-1.427-1.566v-3.805h2.338v-2.24h-2.338V7.788H91.47v3.448H89.37v2.24h2.1v4.201c0 2.3 1.15 3.469 3.45 3.469ZM104.62 21.304c3.924 0 6.302-2.299 6.599-5.608h-3.111c-.238 1.803-1.506 3.032-3.369 3.032-2.2 0-3.746-1.784-3.746-4.796 0-2.953 1.605-4.638 3.805-4.638 1.883 0 2.953 1.15 3.171 2.834h3.191c-.317-3.448-2.854-5.41-6.342-5.41-3.984 0-7.036 2.695-7.036 7.214 0 4.677 2.676 7.372 6.838 7.372ZM117.449 21.304c2.993 0 5.114-1.882 5.114-5.172 0-3.23-2.121-5.233-5.114-5.233-2.972 0-5.093 2.002-5.093 5.233 0 3.29 2.101 5.172 5.093 5.172Zm0-2.22c-1.327 0-2.18-1.09-2.18-2.952 0-1.903.892-2.973 2.18-2.973 1.308 0 2.2 1.07 2.2 2.973 0 1.862-.872 2.953-2.2 2.953ZM126.569 20.948v-5.689c0-1.208.753-2.1 1.823-2.1 1.011 0 1.606.773 1.606 2.06v5.729h2.873v-6.144c0-2.339-1.229-3.905-3.428-3.905-1.526 0-2.458.734-2.953 1.606a5.31 5.31 0 0 0 .079-.892v-.377h-2.874v9.712h2.874ZM137.464 20.948v-5.689c0-1.208.753-2.1 1.823-2.1 1.011 0 1.606.773 1.606 2.06v5.729h2.873v-6.144c0-2.339-1.228-3.905-3.428-3.905-1.526 0-2.458.734-2.953 1.606a5.31 5.31 0 0 0 .079-.892v-.377h-2.874v9.712h2.874ZM149.949 21.304c2.735 0 4.499-1.546 4.697-3.567h-2.893c-.139.892-.892 1.387-1.804 1.387-1.228 0-2.12-.99-2.14-2.358h6.897v-.555c0-3.21-1.764-5.312-4.816-5.312-2.933 0-4.994 2.062-4.994 5.173 0 3.37 2.12 5.232 5.053 5.232Zm-2.16-6.421c.119-1.11.932-1.922 2.081-1.922 1.11 0 1.883.772 1.903 1.922h-3.984ZM160.876 21.304c3.013 0 4.658-1.645 4.975-4.201h-2.874c-.099 1.07-.713 1.982-2.001 1.982-1.309 0-2.2-1.21-2.2-2.993 0-1.942 1.03-2.933 2.259-2.933 1.209 0 1.803.872 1.883 1.882h2.873c-.218-2.358-1.823-4.142-4.776-4.142-2.874 0-5.153 1.903-5.153 5.193 0 3.25 1.923 5.212 5.014 5.212ZM172.067 21.146c.634 0 1.248-.1 1.526-.179v-2.18c-.218.04-.476.06-.694.06-1.05 0-1.427-.595-1.427-1.566v-3.805h2.339v-2.24h-2.339V7.788h-2.854v3.448h-2.1v2.24h2.1v4.201c0 2.3 1.15 3.469 3.449 3.469Z" fill="#fff"/></svg>`,WALLET_CONNECT_ICON:ut`<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:ut`<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:ut`<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:ut`<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:ut`<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:ut`<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:ut`<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:ut`<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:ut`<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:ut`<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:ut`<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:ut`<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:ut`<svg width="13" height="12" viewBox="0 0 13 12"><path fill-rule="evenodd" clip-rule="evenodd" d="M12.155.132a.75.75 0 0 1 .232 1.035L5.821 11.535a1 1 0 0 1-1.626.09L.665 7.21a.75.75 0 1 1 1.17-.937L4.71 9.867a.25.25 0 0 0 .406-.023L11.12.364a.75.75 0 0 1 1.035-.232Z" fill="#fff"/></svg>`,HELP_ETH_IMG:ut`<svg width="60" height="60" fill="none" viewBox="0 0 60 60"><g clip-path="url(#j)"><rect width="60" height="60" rx="30" fill="#987DE8"/><path fill-rule="evenodd" clip-rule="evenodd" d="m15.48 28.367 11.966-19.3c1.174-1.892 3.927-1.892 5.1 0l11.97 19.306a6 6 0 0 1 .9 3.142v.028a6 6 0 0 1-1.154 3.56L33.227 50.208c-1.599 2.188-4.864 2.188-6.461 0L15.733 35.095a6 6 0 0 1-1.154-3.538v-.029a6 6 0 0 1 .9-3.161Z" fill="#fff"/><path d="M30.84 10.112a.992.992 0 0 0-.844-.464V24.5l12.598 5.53c.081-.466-.001-.963-.27-1.398L30.84 10.112Z" fill="#643CDD"/><path d="M29.996 9.648a.991.991 0 0 0-.845.465l-11.489 18.53a1.991 1.991 0 0 0-.264 1.387l12.598-5.53V9.648Z" fill="#BDADEB"/><path d="M29.996 50.544a.994.994 0 0 0 .808-.41l11.235-15.38c.307-.434-.193-.988-.658-.72L31.49 39.71a2.998 2.998 0 0 1-1.494.398v10.437Z" fill="#643CDD"/><path d="M17.966 34.762 29.19 50.134c.2.274.503.41.807.41V40.108a2.998 2.998 0 0 1-1.493-.398l-9.884-5.676c-.468-.27-.971.292-.653.728Z" fill="#BDADEB"/><path d="M42.594 30.03 29.996 24.5v13.138a3 3 0 0 0 1.495-.399l10.149-5.83c.525-.31.856-.823.954-1.38Z" fill="#401AB3"/><path d="M29.996 37.638V24.462l-12.598 5.566c.098.564.437 1.083.974 1.392l10.13 5.82c.462.265.978.398 1.494.398Z" fill="#7C5AE2"/></g><rect class="help-img-highlight" x=".5" y=".5" width="59" height="59" rx="29.5"/><defs><clipPath id="j"><rect width="60" height="60" rx="30" fill="#fff"/></clipPath></defs></svg>`,HELP_PAINTING_IMG:ut`<svg width="60" height="60" fill="none" viewBox="0 0 60 60"><g clip-path="url(#k)"><rect width="60" height="60" rx="3" fill="#C653C6"/><path d="M52.094 47.344c0-4.246-1.436-9.557-5.885-12.4a2.876 2.876 0 0 0-1.615-3.891v-.819a4.037 4.037 0 0 0-1.34-3.007 4.75 4.75 0 0 0-2.41-6.252v-5.506c0-6.248-5.065-11.313-11.313-11.313-6.247 0-11.312 5.065-11.312 11.313v2.152a3.343 3.343 0 0 0-1.18 5.045 4.738 4.738 0 0 0-1.633 3.584 4.73 4.73 0 0 0 .956 2.858 5.218 5.218 0 0 0-2.358 6.815c-3.06 4.129-6.098 8.298-6.098 15.64 0 2.668.364 4.856.731 6.385.184.765.368 1.366.509 1.78a12.721 12.721 0 0 0 .225.611l.015.037.005.011.001.004v.002h.001l.92-.393-.92.394.26.606h38.26l.291-.49-.86-.51.86.51v-.001l.002-.002.002-.005.01-.017.035-.06.127-.225c.108-.195.26-.477.441-.835.363-.714.845-1.732 1.328-2.953.959-2.427 1.945-5.725 1.945-9.068Z" fill="#E87DE8" stroke="#fff" stroke-width="2"/><path fill-rule="evenodd" clip-rule="evenodd" d="M26.5 29.5c-3-.5-5.5-3-5.503-7l.002-7c0-.466 0-.698.026-.893a3 3 0 0 1 2.582-2.582c.195-.026.428-.026.893-.026 2 0 2.5-2.5 2.5-2.5s0 2.5 2.5 2.5c1.398 0 2.097 0 2.648.229a3 3 0 0 1 1.624 1.623c.228.552.228 1.25.228 2.649v6c0 4-3 7-6.5 7 1.35.23 4 0 6.5-2v9.53C34 38.5 31.495 40 28 40s-6-1.5-6-2.97L24 34l2.5 1.5v-6ZM26 47h4.5c2.5 0 3 4 3 5.5h-3l-1-1.5H26v-4Zm-6.25 5.5H24V57h-8c0-1 1-4.5 3.75-4.5Z" fill="#fff"/></g><rect class="help-img-highlight" x=".5" y=".5" width="59" height="59" rx="2.5"/><defs><clipPath id="k"><rect width="60" height="60" rx="3" fill="#fff"/></clipPath></defs></svg>`,HELP_CHART_IMG:ut`<svg width="60" height="60" fill="none" viewBox="0 0 60 60"><g clip-path="url(#l)"><path d="M0 25.01C0 15.76 0 11.133 1.97 7.678a15 15 0 0 1 5.598-5.597C11.023.11 15.648.11 24.9.11h10.2c9.251 0 13.877 0 17.332 1.97a15 15 0 0 1 5.597 5.597C60 11.133 60 15.758 60 25.01v10.2c0 9.252 0 13.877-1.97 17.332a15 15 0 0 1-5.598 5.598c-3.455 1.97-8.08 1.97-17.332 1.97H24.9c-9.251 0-13.877 0-17.332-1.97a14.999 14.999 0 0 1-5.597-5.598C0 49.087 0 44.462 0 35.21v-10.2Z" fill="#1DC956"/><path d="M.5 25.01c0-4.635 0-8.078.244-10.795.244-2.71.726-4.65 1.66-6.289a14.5 14.5 0 0 1 5.412-5.41c1.639-.936 3.579-1.418 6.289-1.661C16.822.61 20.265.61 24.9.61h10.2c4.635 0 8.078 0 10.795.245 2.71.243 4.65.725 6.29 1.66a14.5 14.5 0 0 1 5.41 5.411c.935 1.64 1.417 3.579 1.66 6.29.244 2.717.245 6.16.245 10.794v10.2c0 4.635 0 8.078-.244 10.795-.244 2.71-.726 4.65-1.66 6.29a14.5 14.5 0 0 1-5.412 5.41c-1.639.936-3.579 1.418-6.289 1.661-2.717.244-6.16.244-10.795.244H24.9c-4.635 0-8.078 0-10.795-.244-2.71-.243-4.65-.725-6.29-1.66a14.5 14.5 0 0 1-5.41-5.412C1.47 50.655.988 48.716.745 46.005.5 43.288.5 39.845.5 35.21v-10.2Z" stroke="#fff" stroke-opacity=".1"/><path d="M16.109 60c-3.833-.179-6.41-.645-8.541-1.86a15 15 0 0 1-5.598-5.598C.553 50.057.155 46.967.043 41.985l4.146-1.382a4 4 0 0 0 2.48-2.39l4.654-12.409a2 2 0 0 1 2.505-1.195l2.526.842a2 2 0 0 0 2.422-1.003l2.968-5.938c.81-1.62 3.185-1.415 3.705.32l3.774 12.581a2 2 0 0 0 3.025 1.09l3.342-2.228c.27-.18.49-.422.646-.706l5.297-9.712a2 2 0 0 1 1.428-1.016l4.134-.689a2 2 0 0 1 1.61.437l3.892 3.243a2 2 0 0 0 2.694-.122l4.633-4.632C60 19.28 60 21.88 60 25.01v10.2c0 9.252 0 13.877-1.97 17.332a14.998 14.998 0 0 1-5.598 5.598c-2.131 1.215-4.708 1.681-8.54 1.86H16.108Z" fill="#2BEE6C"/><path d="M.072 43.03a112.37 112.37 0 0 1-.048-2.093l3.85-1.283a3 3 0 0 0 1.86-1.793l4.653-12.408a3 3 0 0 1 3.758-1.793l2.526.842a1 1 0 0 0 1.21-.501l2.97-5.938c1.214-2.43 4.775-2.123 5.556.48l3.774 12.58a1 1 0 0 0 1.513.545l3.341-2.227a1 1 0 0 0 .323-.353l5.298-9.712a3 3 0 0 1 2.14-1.523l4.135-.69a3 3 0 0 1 2.414.655l3.892 3.244a1 1 0 0 0 1.347-.061l5.28-5.28c.046.845.077 1.752.097 2.732l-3.962 3.962a3 3 0 0 1-4.042.183l-3.893-3.243a1 1 0 0 0-.804-.218l-4.135.689a1 1 0 0 0-.714.507l-5.297 9.712c-.233.427-.565.79-.97 1.06l-3.34 2.228a3 3 0 0 1-4.538-1.635l-3.775-12.58c-.26-.868-1.447-.97-1.852-.16l-2.969 5.937a3 3 0 0 1-3.632 1.505l-2.526-.842a1 1 0 0 0-1.252.597L7.606 38.564a5 5 0 0 1-3.1 2.988L.072 43.029Z" fill="#fff"/><path fill-rule="evenodd" clip-rule="evenodd" d="M49.5 19a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0Z" fill="#2BEE6C"/><path d="M47.5 19a3.5 3.5 0 1 1-7 0 3.5 3.5 0 0 1 7 0Z" fill="#fff"/><path d="M45 .283v59.654c-.63.042-1.294.074-2 .098V.185c.706.025 1.37.056 2 .098Z" fill="#fff"/><path class="help-img-highlight" d="M.5 25.01c0-4.635 0-8.078.244-10.795.244-2.71.726-4.65 1.66-6.289a14.5 14.5 0 0 1 5.412-5.41c1.639-.936 3.579-1.418 6.289-1.661C16.822.61 20.265.61 24.9.61h10.2c4.635 0 8.078 0 10.795.245 2.71.243 4.65.725 6.29 1.66a14.5 14.5 0 0 1 5.41 5.411c.935 1.64 1.417 3.579 1.66 6.29.244 2.717.245 6.16.245 10.794v10.2c0 4.635 0 8.078-.244 10.795-.244 2.71-.726 4.65-1.66 6.29a14.5 14.5 0 0 1-5.412 5.41c-1.639.936-3.579 1.418-6.289 1.661-2.717.244-6.16.244-10.795.244H24.9c-4.635 0-8.078 0-10.795-.244-2.71-.243-4.65-.725-6.29-1.66a14.5 14.5 0 0 1-5.41-5.412C1.47 50.655.988 48.716.745 46.005.5 43.288.5 39.845.5 35.21v-10.2Z"/></g><defs><clipPath id="l"><path fill="#fff" d="M0 0h60v60H0z"/></clipPath></defs></svg>`,HELP_KEY_IMG:ut`<svg width="60" height="60" fill="none" viewBox="0 0 60 60"><g clip-path="url(#m)"><path fill="#EB8B47" d="M0 24.9c0-9.252 0-13.878 1.97-17.332A15 15 0 0 1 7.569 1.97C11.023 0 15.648 0 24.9 0h10.2c9.251 0 13.877 0 17.332 1.97a15 15 0 0 1 5.597 5.598C60 11.022 60 15.648 60 24.899v10.2c0 9.252 0 13.878-1.97 17.332a15.001 15.001 0 0 1-5.598 5.598c-3.455 1.97-8.08 1.97-17.332 1.97H24.9c-9.251 0-13.877 0-17.332-1.97a15 15 0 0 1-5.597-5.598C0 48.977 0 44.351 0 35.1V24.9Z"/><path class="help-img-highlight" d="M.5 24.9c0-4.635 0-8.078.244-10.795.244-2.71.726-4.65 1.66-6.29a14.5 14.5 0 0 1 5.412-5.41C9.455 1.468 11.395.986 14.105.743 16.822.5 20.265.5 24.9.5h10.2c4.635 0 8.078 0 10.795.244 2.71.243 4.65.725 6.29 1.66a14.5 14.5 0 0 1 5.41 5.411c.935 1.64 1.417 3.58 1.66 6.29.244 2.717.245 6.16.245 10.794v10.2c0 4.635 0 8.078-.244 10.796-.244 2.71-.726 4.65-1.66 6.289a14.5 14.5 0 0 1-5.412 5.41c-1.639.936-3.579 1.418-6.289 1.661-2.717.244-6.16.244-10.795.244H24.9c-4.635 0-8.078 0-10.795-.244-2.71-.243-4.65-.725-6.29-1.66a14.5 14.5 0 0 1-5.41-5.411c-.935-1.64-1.417-3.58-1.66-6.29C.5 43.178.5 39.734.5 35.1V24.9Z"/><path fill="#FF974C" stroke="#fff" stroke-width="2" d="M39.192 29.192c5.077-5.077 5.077-13.308 0-18.385-5.076-5.077-13.308-5.077-18.384 0-5.077 5.077-5.077 13.308 0 18.385l1.287 1.291c1.137 1.142 1.706 1.712 2.097 2.387.267.462.472.957.608 1.473.2.755.2 1.56.2 3.171V48.75c0 1.077 0 1.615.134 2.119a4 4 0 0 0 .407.984c.262.45.643.831 1.404 1.592l.294.295c.654.654.982.981 1.365 1.086.26.07.533.07.792 0 .383-.105.71-.432 1.365-1.086l3.478-3.479c.655-.654.982-.981 1.087-1.365a1.5 1.5 0 0 0 0-.791c-.105-.384-.432-.711-1.087-1.365l-.478-.479c-.655-.654-.982-.981-1.087-1.365a1.5 1.5 0 0 1 0-.791c.105-.384.432-.711 1.087-1.365l.478-.479c.655-.654.982-.981 1.087-1.365a1.5 1.5 0 0 0 0-.791c-.105-.384-.432-.711-1.087-1.365l-.492-.493c-.65-.65-.974-.974-1.08-1.355a1.5 1.5 0 0 1-.003-.788c.102-.382.425-.71 1.069-1.364l5.46-5.547Z"/><circle cx="30" cy="17" r="4" fill="#EB8B47" stroke="#fff" stroke-width="2"/></g><defs><clipPath id="m"><path fill="#fff" d="M0 0h60v60H0z"/></clipPath></defs></svg>`,HELP_USER_IMG:ut`<svg width="60" height="60" fill="none" viewBox="0 0 60 60"><g clip-path="url(#n)"><rect width="60" height="60" fill="#00ACE6" rx="30"/><path fill="#1AC6FF" stroke="#fff" stroke-width="2" d="M59 73c0 16.016-12.984 29-29 29S1 89.016 1 73c0-16.017 11-29 29-29s29 12.983 29 29ZM18.69 19.902a11 11 0 0 1 9.281-8.692 14.842 14.842 0 0 1 4.058 0 11 11 0 0 1 9.28 8.692c.178.866.322 1.75.44 2.625.132.977.132 1.968 0 2.945a39.467 39.467 0 0 1-.44 2.625 11 11 0 0 1-9.28 8.692 14.862 14.862 0 0 1-4.058 0 11 11 0 0 1-9.28-8.692 39.467 39.467 0 0 1-.44-2.625 11.004 11.004 0 0 1 0-2.945c.118-.876.262-1.759.44-2.625Z"/><circle cx="24.5" cy="23.5" r="1.5" fill="#fff"/><circle cx="35.5" cy="23.5" r="1.5" fill="#fff"/><path stroke="#fff" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m31 20-3 8h4"/></g><rect class="help-img-highlight" width="59" height="59" x=".5" y=".5" rx="29.5"/><defs><clipPath id="n"><rect width="60" height="60" fill="#fff" rx="30"/></clipPath></defs></svg>`,HELP_LOCK_IMG:ut`<svg width="60" height="60" fill="none" viewBox="0 0 60 60"><rect width="60" height="60" fill="#C653C6" rx="3"/><path fill="#fff" d="M20.034 15.216C20 15.607 20 16.07 20 17v2.808c0 1.13 0 1.696-.2 2.11a1.78 1.78 0 0 1-.584.714c-.366.28-1.051.42-2.423.7a7.076 7.076 0 0 0-1.597.511 9.001 9.001 0 0 0-4.353 4.353C10 30.005 10 32.336 10 37c0 4.663 0 6.995.843 8.804a9.001 9.001 0 0 0 4.353 4.353C17.005 51 19.336 51 24 51h12c4.663 0 6.995 0 8.804-.843a9.001 9.001 0 0 0 4.353-4.353C50 43.995 50 41.664 50 37c0-4.663 0-6.995-.843-8.804a9.001 9.001 0 0 0-4.353-4.353 7.076 7.076 0 0 0-1.597-.511c-1.372-.28-2.057-.42-2.423-.7a1.78 1.78 0 0 1-.583-.715C40 21.505 40 20.94 40 19.809V17c0-.929 0-1.393-.034-1.784a9 9 0 0 0-8.182-8.182C31.393 7 30.93 7 30 7s-1.393 0-1.784.034a9 9 0 0 0-8.182 8.182Z"/><path fill="#E87DE8" d="M22 17c0-.929 0-1.393.044-1.784a7 7 0 0 1 6.172-6.172C28.606 9 29.071 9 30 9s1.393 0 1.784.044a7 7 0 0 1 6.172 6.172c.044.39.044.855.044 1.784v4.5a1.5 1.5 0 0 1-3 0V17c0-.93 0-1.394-.077-1.78a4 4 0 0 0-3.143-3.143C31.394 12 30.93 12 30 12s-1.394 0-1.78.077a4 4 0 0 0-3.143 3.143C25 15.606 25 16.07 25 17v4.5a1.5 1.5 0 0 1-3 0V17Z"/><path fill="#E87DE8" fill-rule="evenodd" d="M12 36.62c0-4.317 0-6.476.92-8.088a7 7 0 0 1 2.612-2.612c1.612-.92 3.77-.92 8.088-.92h6.855c.469 0 .703 0 .906.017 2.73.222 4.364 2.438 4.619 4.983.27-2.698 2.111-5 5.015-5A6.985 6.985 0 0 1 48 31.985v5.395c0 4.317 0 6.476-.92 8.088a7 7 0 0 1-2.612 2.612c-1.612.92-3.77.92-8.088.92h-5.855c-.469 0-.703 0-.906-.017-2.73-.222-4.364-2.438-4.619-4.983-.258 2.583-1.943 4.818-4.714 4.99-.155.01-.335.01-.694.01-.55 0-.825 0-1.057-.015a7 7 0 0 1-6.52-6.52C12 42.233 12 41.958 12 41.408V36.62Zm21.24-.273a4 4 0 1 0-6.478 0c.985 1.36 1.479 2.039 1.564 2.229.178.398.176.818.174 1.247V42.5a1.5 1.5 0 0 0 3 0v-2.677c-.002-.429-.004-.85.174-1.247.085-.19.579-.87 1.565-2.229Z" clip-rule="evenodd"/><rect class="help-img-highlight" width="59" height="59" x=".5" y=".5" rx="2.5"/></svg>`,HELP_COMPAS_IMG:ut`<svg width="60" height="60" fill="none" viewBox="0 0 60 60"><rect width="60" height="60" fill="#1DC956" rx="30"/><circle cx="30" cy="29.999" r="3" fill="#fff"/><path fill="#2BEE6C" stroke="#fff" stroke-width="2" d="m45.316 17.9-.88-.425.88.424a7.9 7.9 0 0 1 .026-.053c.093-.192.21-.432.26-.687l-.819-.162.819.162a2 2 0 0 0-.239-1.405c-.132-.224-.32-.412-.472-.562a8.415 8.415 0 0 1-.042-.042l-.042-.042c-.15-.151-.338-.34-.562-.472l-.508.862.508-.862a2 2 0 0 0-1.405-.239c-.255.05-.495.167-.687.26l-.053.026-15.05 7.246-.108.052c-1.131.545-1.843.887-2.456 1.374a6.994 6.994 0 0 0-1.13 1.13c-.487.613-.83 1.325-1.375 2.457l-.051.108-7.247 15.05-.025.053c-.094.192-.21.431-.26.686a2 2 0 0 0 .239 1.406l.855-.505-.856.505c.133.224.321.411.473.562l.042.042.041.042c.15.151.338.34.563.472a2 2 0 0 0 1.405.239l-.195-.981.195.98c.255-.05.494-.166.686-.26l.054-.025-.419-.87.419.87 15.05-7.247.107-.051c1.132-.545 1.844-.888 2.457-1.374a7.002 7.002 0 0 0 1.13-1.13c.487-.614.83-1.325 1.374-2.457l.052-.108 7.246-15.05Z"/><path fill="#1DC956" d="m33.376 32.723-2.669-3.43-14.85 14.849.206.205a1 1 0 0 0 1.141.194l15.105-7.273a3 3 0 0 0 1.067-4.545Z"/><path fill="#86F999" d="m26.624 27.276 2.669 3.43 14.85-14.849-.206-.205a1 1 0 0 0-1.141-.194L27.69 22.731a3 3 0 0 0-1.067 4.545Z"/><circle cx="30" cy="30" r="3" fill="#fff" transform="rotate(45 30 30)"/><rect class="help-img-highlight" width="59" height="59" x=".5" y=".5" rx="29.5"/></svg>`,HELP_NOUN_IMG:ut`<svg width="60" height="60" fill="none" viewBox="0 0 60 60"><rect width="60" height="60" fill="#794CFF" rx="3"/><path fill="#987DE8" stroke="#fff" stroke-width="2" d="M33 22.5v-1H16v5H8.5V36H13v-5h3v7.5h17V31h1v7.5h17v-17H34v5h-1v-4Z"/><path fill="#fff" d="M37.5 25h10v10h-10z"/><path fill="#4019B2" d="M42.5 25h5v10h-5z"/><path fill="#fff" d="M19.5 25h10v10h-10z"/><path fill="#4019B2" d="M24.5 25h5v10h-5z"/><path fill="#fff" d="M12 30.5h4V37h-4v-6.5Z"/><rect class="help-img-highlight" width="59" height="59" x=".5" y=".5" rx="2.5"/></svg>`,HELP_DAO_IMG:ut`<svg width="60" height="60" fill="none" viewBox="0 0 60 60"><g clip-path="url(#o)"><path fill="#EB8B47" d="M0 24.9c0-9.252 0-13.878 1.97-17.332A15 15 0 0 1 7.569 1.97C11.023 0 15.648 0 24.9 0h10.2c9.251 0 13.877 0 17.332 1.97a15 15 0 0 1 5.597 5.598C60 11.022 60 15.648 60 24.899v10.2c0 9.252 0 13.878-1.97 17.332a15.001 15.001 0 0 1-5.598 5.598c-3.455 1.97-8.08 1.97-17.332 1.97H24.9c-9.251 0-13.877 0-17.332-1.97a15 15 0 0 1-5.597-5.598C0 48.977 0 44.351 0 35.1V24.9Z"/><path class="help-img-highlight" d="M.5 24.9c0-4.635 0-8.078.244-10.795.244-2.71.726-4.65 1.66-6.29a14.5 14.5 0 0 1 5.412-5.41C9.455 1.468 11.395.986 14.105.743 16.822.5 20.265.5 24.9.5h10.2c4.635 0 8.078 0 10.795.244 2.71.243 4.65.725 6.29 1.66a14.5 14.5 0 0 1 5.41 5.411c.935 1.64 1.417 3.58 1.66 6.29.244 2.717.245 6.16.245 10.794v10.2c0 4.635 0 8.078-.244 10.796-.244 2.71-.726 4.65-1.66 6.289a14.5 14.5 0 0 1-5.412 5.41c-1.639.936-3.579 1.418-6.289 1.661-2.717.244-6.16.244-10.795.244H24.9c-4.635 0-8.078 0-10.795-.244-2.71-.243-4.65-.725-6.29-1.66a14.5 14.5 0 0 1-5.41-5.411c-.935-1.64-1.417-3.58-1.66-6.29C.5 43.178.5 39.734.5 35.1V24.9Z"/><path fill="#FF974C" stroke="#fff" stroke-width="2" d="M19 52c5.523 0 10-4.477 10-10s-4.477-10-10-10S9 36.477 9 42s4.477 10 10 10Z"/><path fill="#fff" fill-rule="evenodd" d="M42.844 8.326a1 1 0 0 0-1.687 0L28.978 27.463A1 1 0 0 0 29.822 29h24.357a1 1 0 0 0 .843-1.537L42.844 8.326Z" clip-rule="evenodd"/><path fill="#FF974C" fill-rule="evenodd" d="M42.335 11.646c.324.115.571.504 1.066 1.28l7.332 11.523c.562.883.843 1.325.792 1.69a1 1 0 0 1-.342.623c-.28.238-.803.238-1.85.238H34.667c-1.047 0-1.57 0-1.85-.238a1 1 0 0 1-.342-.623c-.051-.365.23-.806.792-1.69l7.332-11.523c.495-.776.742-1.165 1.066-1.28a1 1 0 0 1 .67 0ZM35 27a7 7 0 0 0 7-7 7 7 0 0 0 7 7H35Z" clip-rule="evenodd"/><path fill="#FF974C" stroke="#fff" stroke-width="2" d="M10.106 9.357c-.109.32-.107.682-.106.975V25.668c-.001.293-.003.654.106.975a2 2 0 0 0 1.251 1.25c.32.11.682.108.975.107H19c5.523 0 10-4.477 10-10S24.523 8 19 8h-6.668c-.293-.001-.654-.003-.975.106a2 2 0 0 0-1.25 1.251Z"/><circle cx="19" cy="18" r="4" fill="#EB8B47" stroke="#fff" stroke-width="2"/><circle cx="19" cy="41.999" r="4" fill="#EB8B47" stroke="#fff" stroke-width="2"/></g><defs><clipPath id="o"><path fill="#fff" d="M0 0h60v60H0z"/></clipPath></defs></svg>`,SEARCH_ICON:ut`<svg width="20" height="21"><path fill-rule="evenodd" clip-rule="evenodd" d="M12.432 13.992c-.354-.353-.91-.382-1.35-.146a5.5 5.5 0 1 1 2.265-2.265c-.237.441-.208.997.145 1.35l3.296 3.296a.75.75 0 1 1-1.06 1.061l-3.296-3.296Zm.06-5a4 4 0 1 1-8 0 4 4 0 0 1 8 0Z" fill="#949E9E"/></svg>`,HELP_ICON:ut`<svg width="11" height="17" viewBox="0 0 11 17"><path fill="#fff" d="M5.22 2.97c-1.07 0-2.25.843-2.25 2.25a.75.75 0 0 1-1.5 0c0-2.393 2.019-3.75 3.75-3.75 1.73 0 3.75 1.357 3.75 3.75 0 1.64-1.038 2.466-1.785 3.057-.802.635-1.215.984-1.215 1.693a.75.75 0 1 1-1.5 0c0-1.466.985-2.24 1.681-2.788l.103-.081C7.007 6.504 7.47 6.08 7.47 5.22c0-1.407-1.181-2.25-2.25-2.25ZM5.22 14.97a1.25 1.25 0 1 0 0-2.5 1.25 1.25 0 0 0 0 2.5Z"/></svg>`,WALLET_ICON:ut`<svg width="15" height="14" fill="none" viewBox="0 0 15 14"><path fill="#fff" fill-rule="evenodd" d="M.64 9.2v-3h.001c.009-1.857.07-2.886.525-3.682a4 4 0 0 1 1.492-1.493C3.58.5 4.813.5 7.28.5h3.735c.58 0 .871 0 1.114.04A3 3 0 0 1 14.6 3.011c.04.243.04.533.04 1.114 0 .58 0 .871-.04 1.114a3 3 0 0 1-2.471 2.47c-.243.041-.533.041-1.114.041h-.777c.178.307.302.648.362 1.011.04.243.04.533.04 1.114 0 .58 0 .871-.04 1.114a3 3 0 0 1-2.471 2.47c-.243.041-.533.041-1.114.041H4.507A3.867 3.867 0 0 1 .64 9.633V9.2ZM7.28 2h3.735c.64 0 .779.005.87.02a1.5 1.5 0 0 1 1.235 1.236c.015.09.02.229.02.869s-.005.779-.02.87a1.5 1.5 0 0 1-1.236 1.235c-.09.015-.229.02-.869.02H4.023c-.697 0-1.345.21-1.883.572V6.25h.001c.004-.791.015-1.383.059-1.867.056-.629.157-.926.269-1.122a2.5 2.5 0 0 1 .932-.933c.197-.111.494-.212 1.123-.268C5.173 2 6.019 2 7.28 2Zm-.265 5.75H4.023c-1.04 0-1.883.843-1.883 1.883A2.367 2.367 0 0 0 4.507 12h2.508c.64 0 .779-.005.87-.02a1.5 1.5 0 0 0 1.235-1.236c.015-.09.02-.229.02-.869s-.005-.779-.02-.87A1.5 1.5 0 0 0 7.884 7.77c-.09-.015-.228-.02-.869-.02Z" clip-rule="evenodd"/></svg>`,NETWORK_PLACEHOLDER:ut`<svg width="28" height="28" fill="none" viewBox="0 0 28 28"><mask id="p" width="26" height="28" x="1" y="0" maskUnits="userSpaceOnUse" style="mask-type:alpha"><path fill="#D9D9D9" d="M12 1.172a4 4 0 0 1 4 0l8.124 4.69a4 4 0 0 1 2 3.465v9.381a4 4 0 0 1-2 3.464L16 26.862a4 4 0 0 1-4 0l-8.124-4.69a4 4 0 0 1-2-3.464V9.327a4 4 0 0 1 2-3.464L12 1.173Z"/></mask><g mask="url(#p)"><path id="network-placeholder-fill" fill="#fff" d="M0 0h28v28H0z"/><path id="network-placeholder-dash" stroke="#000" stroke-dasharray="2 2" d="m8.953 2.931 2.032-1.173.25.433 1.015-.586c.269-.155.553-.271.844-.35l-.13-.483a4.003 4.003 0 0 1 2.071 0l-.13.483c.293.079.576.195.845.35l1.016.586.25-.433 2.03 1.173-.25.433 2.032 1.173.25-.433 2.03 1.172-.25.433 1.016.587c.269.155.512.342.725.556l.354-.354a4.003 4.003 0 0 1 1.035 1.794l-.483.129c.078.292.12.596.12.906v1.172h.5v2.346h-.5v2.345h.5v2.345h-.5v1.173c0 .31-.042.614-.12.906l.483.13a4.003 4.003 0 0 1-1.035 1.793l-.354-.354a3.498 3.498 0 0 1-.725.556l-1.015.586.25.434-2.031 1.172-.25-.433-2.031 1.173.25.433-2.031 1.172-.25-.433-1.016.587a3.494 3.494 0 0 1-.844.35l.13.482a4.003 4.003 0 0 1-2.071 0l.13-.483a3.496 3.496 0 0 1-.845-.35l-1.015-.586-.25.433-2.032-1.172.25-.433-2.03-1.173-.25.433L4.89 22.76l.25-.434-1.015-.586a3.498 3.498 0 0 1-.725-.556l-.354.354a4.003 4.003 0 0 1-1.035-1.794l.483-.13a3.497 3.497 0 0 1-.12-.905v-1.173h-.5V15.19h.5v-2.345h-.5v-2.346h.5V9.327c0-.31.042-.614.12-.906l-.483-.13a4.003 4.003 0 0 1 1.035-1.793l.354.354c.213-.214.456-.401.725-.556l1.015-.587-.25-.433 2.031-1.172.25.433 2.031-1.173-.25-.433Z"/><path fill="#798686" stroke="#fff" d="M14.243 13.563 14 13.428l-.243.135-6.388 3.549-.024.013c-.432.24-.79.44-1.053.622-.266.184-.516.405-.636.722a1.5 1.5 0 0 0 0 1.062c.12.317.37.538.636.722.263.183.62.382 1.053.622l.024.013 3.164 1.758.088.049c1.164.646 1.857 1.032 2.607 1.162.51.09 1.033.09 1.544 0 .75-.13 1.443-.516 2.606-1.162l.09-.05 3.163-1.757.024-.013c.432-.24.79-.44 1.053-.622.266-.184.516-.405.636-.722l-.468-.177.468.177a1.5 1.5 0 0 0 0-1.062l-.468.177.468-.177c-.12-.317-.37-.538-.636-.722-.263-.183-.62-.382-1.053-.622l-.024-.013-6.388-3.55Z"/><path fill="#9EA9A9" stroke="#fff" d="M14.243 8.563 14 8.428l-.243.135-6.388 3.549-.024.013c-.432.24-.79.44-1.053.622-.266.184-.516.405-.636.722a1.5 1.5 0 0 0 0 1.062c.12.316.37.537.636.722.263.183.62.382 1.053.622l.024.013 3.164 1.758.088.049c1.164.646 1.857 1.032 2.607 1.162.51.09 1.033.09 1.544 0 .75-.13 1.443-.516 2.606-1.162l.09-.05 3.163-1.757.024-.013c.432-.24.79-.44 1.053-.622.266-.184.516-.405.636-.722l-.468-.177.468.177a1.5 1.5 0 0 0 0-1.062l-.468.177.468-.177c-.12-.316-.37-.537-.636-.722-.263-.183-.62-.382-1.053-.622l-.024-.013-6.388-3.55Z"/><path fill="#C9CFCF" stroke="#fff" d="m22.344 9.53-.468-.176.468.177a1.5 1.5 0 0 0 0-1.062l-.468.177.468-.177c-.12-.317-.37-.537-.636-.722-.263-.183-.62-.382-1.053-.622l-.024-.013-3.163-1.758-.09-.05c-1.163-.645-1.856-1.03-2.606-1.161a4.5 4.5 0 0 0-1.544 0c-.75.13-1.443.516-2.607 1.162l-.088.05-3.164 1.757-.024.013c-.432.24-.79.44-1.053.622-.266.185-.516.405-.636.722a1.5 1.5 0 0 0 0 1.062c.12.317.37.537.636.722.263.183.62.382 1.053.622l.024.013 3.164 1.758.088.049c1.164.646 1.857 1.032 2.607 1.162.51.09 1.033.09 1.544 0 .75-.13 1.443-.516 2.606-1.162l.09-.05 3.163-1.757.024-.013c.432-.24.79-.44 1.053-.622.266-.184.516-.405.636-.722Z"/></g></svg>`,WALLET_PLACEHOLDER:ut`<svg width="60" height="60" fill="none" viewBox="0 0 60 60"><g clip-path="url(#q)"><path id="wallet-placeholder-fill" fill="#fff" d="M0 24.9c0-9.251 0-13.877 1.97-17.332a15 15 0 0 1 5.598-5.597C11.023 0 15.648 0 24.9 0h10.2c9.252 0 13.877 0 17.332 1.97a15 15 0 0 1 5.597 5.598C60 11.023 60 15.648 60 24.9v10.2c0 9.252 0 13.877-1.97 17.332a15.001 15.001 0 0 1-5.598 5.597C48.977 60 44.352 60 35.1 60H24.9c-9.251 0-13.877 0-17.332-1.97a15 15 0 0 1-5.597-5.598C0 48.977 0 44.352 0 35.1V24.9Z"/><path id="wallet-placeholder-dash" stroke="#000" stroke-dasharray="4 4" stroke-width="1.5" d="M.04 41.708a231.598 231.598 0 0 1-.039-4.403l.75-.001L.75 35.1v-2.55H0v-5.1h.75V24.9l.001-2.204h-.75c.003-1.617.011-3.077.039-4.404l.75.016c.034-1.65.099-3.08.218-4.343l-.746-.07c.158-1.678.412-3.083.82-4.316l.713.236c.224-.679.497-1.296.827-1.875a14.25 14.25 0 0 1 1.05-1.585L3.076 5.9A15 15 0 0 1 5.9 3.076l.455.596a14.25 14.25 0 0 1 1.585-1.05c.579-.33 1.196-.603 1.875-.827l-.236-.712C10.812.674 12.217.42 13.895.262l.07.746C15.23.89 16.66.824 18.308.79l-.016-.75C19.62.012 21.08.004 22.695.001l.001.75L24.9.75h2.55V0h5.1v.75h2.55l2.204.001v-.75c1.617.003 3.077.011 4.404.039l-.016.75c1.65.034 3.08.099 4.343.218l.07-.746c1.678.158 3.083.412 4.316.82l-.236.713c.679.224 1.296.497 1.875.827a14.24 14.24 0 0 1 1.585 1.05l.455-.596A14.999 14.999 0 0 1 56.924 5.9l-.596.455c.384.502.735 1.032 1.05 1.585.33.579.602 1.196.827 1.875l.712-.236c.409 1.233.663 2.638.822 4.316l-.747.07c.119 1.264.184 2.694.218 4.343l.75-.016c.028 1.327.036 2.787.039 4.403l-.75.001.001 2.204v2.55H60v5.1h-.75v2.55l-.001 2.204h.75a231.431 231.431 0 0 1-.039 4.404l-.75-.016c-.034 1.65-.099 3.08-.218 4.343l.747.07c-.159 1.678-.413 3.083-.822 4.316l-.712-.236a10.255 10.255 0 0 1-.827 1.875 14.242 14.242 0 0 1-1.05 1.585l.596.455a14.997 14.997 0 0 1-2.824 2.824l-.455-.596c-.502.384-1.032.735-1.585 1.05-.579.33-1.196.602-1.875.827l.236.712c-1.233.409-2.638.663-4.316.822l-.07-.747c-1.264.119-2.694.184-4.343.218l.016.75c-1.327.028-2.787.036-4.403.039l-.001-.75-2.204.001h-2.55V60h-5.1v-.75H24.9l-2.204-.001v.75a231.431 231.431 0 0 1-4.404-.039l.016-.75c-1.65-.034-3.08-.099-4.343-.218l-.07.747c-1.678-.159-3.083-.413-4.316-.822l.236-.712a10.258 10.258 0 0 1-1.875-.827 14.252 14.252 0 0 1-1.585-1.05l-.455.596A14.999 14.999 0 0 1 3.076 54.1l.596-.455a14.24 14.24 0 0 1-1.05-1.585 10.259 10.259 0 0 1-.827-1.875l-.712.236C.674 49.188.42 47.783.262 46.105l.746-.07C.89 44.77.824 43.34.79 41.692l-.75.016Z"/><path fill="#fff" fill-rule="evenodd" d="M35.643 32.145c-.297-.743-.445-1.114-.401-1.275a.42.42 0 0 1 .182-.27c.134-.1.463-.1 1.123-.1.742 0 1.499.046 2.236-.05a6 6 0 0 0 5.166-5.166c.051-.39.051-.855.051-1.784 0-.928 0-1.393-.051-1.783a6 6 0 0 0-5.166-5.165c-.39-.052-.854-.052-1.783-.052h-7.72c-4.934 0-7.401 0-9.244 1.051a8 8 0 0 0-2.985 2.986C16.057 22.28 16.003 24.58 16 29 15.998 31.075 16 33.15 16 35.224A7.778 7.778 0 0 0 23.778 43H28.5c1.394 0 2.09 0 2.67-.116a6 6 0 0 0 4.715-4.714c.115-.58.115-1.301.115-2.744 0-1.31 0-1.964-.114-2.49a4.998 4.998 0 0 0-.243-.792Z" clip-rule="evenodd"/><path fill="#9EA9A9" fill-rule="evenodd" d="M37 18h-7.72c-2.494 0-4.266.002-5.647.126-1.361.122-2.197.354-2.854.728a6.5 6.5 0 0 0-2.425 2.426c-.375.657-.607 1.492-.729 2.853-.11 1.233-.123 2.777-.125 4.867 0 .7 0 1.05.097 1.181.096.13.182.181.343.2.163.02.518-.18 1.229-.581a6.195 6.195 0 0 1 3.053-.8H37c.977 0 1.32-.003 1.587-.038a4.5 4.5 0 0 0 3.874-3.874c.036-.268.039-.611.039-1.588 0-.976-.003-1.319-.038-1.587a4.5 4.5 0 0 0-3.875-3.874C38.32 18.004 37.977 18 37 18Zm-7.364 12.5h-7.414a4.722 4.722 0 0 0-4.722 4.723 6.278 6.278 0 0 0 6.278 6.278H28.5c1.466 0 1.98-.008 2.378-.087a4.5 4.5 0 0 0 3.535-3.536c.08-.397.087-.933.087-2.451 0-1.391-.009-1.843-.08-2.17a3.5 3.5 0 0 0-2.676-2.676c-.328-.072-.762-.08-2.108-.08Z" clip-rule="evenodd"/></g><defs><clipPath id="q"><path fill="#fff" d="M0 0h60v60H0z"/></clipPath></defs></svg>`,TOKEN_PLACEHOLDER:ut`<svg width="60" height="60" viewBox="0 0 60 60" fill="none"><rect id="token-placeholder-fill" width="58" height="58" x="1" y="1" fill="#fff" rx="29"/><path fill="#3B4040" stroke="#fff" stroke-width="2" d="M32 10a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v5.566c0 .357.192.685.495.875a16.001 16.001 0 0 1 4.256 3.894c.667.88.33 2.113-.627 2.665l-2.494 1.44c-.956.552-2.166.204-2.913-.609a9.12 9.12 0 1 0 .064 12.267c.739-.82 1.945-1.181 2.907-.64l2.509 1.415c.962.542 1.312 1.77.654 2.658a16 16 0 0 1-4.356 4.028c-.303.19-.495.518-.495.875V50a2 2 0 0 1-2 2h-2a2 2 0 0 1-2-2v-2.992c0-.602-.528-1.065-1.13-1.032-.579.032-1.16.032-1.74 0-.602-.032-1.13.43-1.13 1.032V50a2 2 0 0 1-2 2h-2a2 2 0 0 1-2-2v-5.566c0-.357-.192-.685-.495-.875a16 16 0 0 1 0-27.118c.303-.19.495-.517.495-.875V10a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v2.992c0 .601.528 1.064 1.13 1.032.58-.032 1.161-.032 1.74 0 .602.033 1.13-.43 1.13-1.032V10Z"/><rect id="token-placeholder-dash" width="58" height="58" x="1" y="1" stroke="#000" stroke-dasharray="6 6" stroke-width="2" rx="29"/></svg>`,ACCOUNT_COPY:ut`<svg width="14" height="14" fill="none" viewBox="0 0 14 14"><path fill="#fff" fill-rule="evenodd" d="M4.003 4.005c.012-1.225.074-1.936.391-2.491a3 3 0 0 1 1.12-1.12C6.204 0 7.136 0 9 0s2.795 0 3.486.394a3 3 0 0 1 1.12 1.12C14 2.204 14 3.136 14 5s0 2.795-.394 3.486a3 3 0 0 1-1.12 1.12c-.555.317-1.266.379-2.491.391l.002.003c-.012 1.222-.075 1.932-.391 2.486a3 3 0 0 1-1.12 1.12C7.796 14 6.864 14 5 14s-2.795 0-3.486-.394a3 3 0 0 1-1.12-1.12C0 11.796 0 10.864 0 9s0-2.795.394-3.486a3 3 0 0 1 1.12-1.12c.554-.316 1.264-.379 2.486-.391l.003.002ZM9 8.5c-.959 0-1.58-.001-2.05-.043-.45-.04-.613-.109-.693-.154a1.5 1.5 0 0 1-.56-.56c-.045-.08-.113-.243-.154-.693C5.501 6.58 5.5 5.959 5.5 5c0-.959.001-1.58.043-2.05.04-.45.109-.613.154-.693a1.5 1.5 0 0 1 .56-.56c.08-.045.243-.113.693-.154C7.42 1.501 8.041 1.5 9 1.5c.959 0 1.58.001 2.05.043.45.04.613.109.693.154a1.5 1.5 0 0 1 .56.56c.045.08.113.243.154.693.042.47.043 1.091.043 2.05 0 .959-.001 1.58-.043 2.05-.04.45-.109.613-.154.693a1.5 1.5 0 0 1-.56.56c-.08.045-.242.113-.693.154-.47.042-1.091.043-2.05.043ZM4 5.503a13.77 13.77 0 0 0-1.05.04c-.45.04-.613.109-.693.154a1.5 1.5 0 0 0-.56.56c-.045.08-.113.243-.154.693C1.501 7.42 1.5 8.041 1.5 9c0 .959.001 1.58.043 2.05.04.45.109.613.154.693a1.5 1.5 0 0 0 .56.56c.08.045.243.113.693.154.47.042 1.091.043 2.05.043.959 0 1.58-.001 2.05-.043.45-.04.613-.109.693-.154a1.5 1.5 0 0 0 .56-.56c.045-.08.113-.242.154-.693.025-.283.035-.619.04-1.05-1.534-.003-2.358-.037-2.983-.394a3 3 0 0 1-1.12-1.12c-.357-.625-.39-1.449-.394-2.983Z" clip-rule="evenodd"/></svg>`,ACCOUNT_DISCONNECT:ut`<svg width="16" height="14" fill="none" viewBox="0 0 16 14"><path fill="#fff" d="M9.677 1.5h-2.61c-1.261 0-2.107.001-2.757.06-.629.056-.926.157-1.122.268a2.5 2.5 0 0 0-.933.933c-.112.196-.212.493-.269 1.122-.058.65-.06 1.496-.06 2.757v.72c0 1.26.002 2.107.06 2.756.057.63.157.927.27 1.123a2.5 2.5 0 0 0 .932.933c.196.111.493.212 1.122.268.65.059 1.496.06 2.757.06h2.61a.75.75 0 1 1 0 1.5h-2.61c-2.467 0-3.7 0-4.622-.525a4 4 0 0 1-1.493-1.493C.427 11.06.427 9.827.427 7.36v-.72c0-2.467 0-3.7.525-4.622A4 4 0 0 1 2.445.525C3.366 0 4.6 0 7.067 0h2.61a.75.75 0 1 1 0 1.5Z"/><path fill="#fff" d="M10.896 11.03a.75.75 0 0 1 0-1.06l1.793-1.793a.25.25 0 0 0-.176-.427H8.177a.75.75 0 0 1 0-1.5h4.336a.25.25 0 0 0 .176-.427L10.896 4.03a.75.75 0 0 1 1.061-1.06l3.323 3.323a1 1 0 0 1 0 1.414l-3.323 3.323a.75.75 0 0 1-1.06 0Z"/></svg>`,GLOBE_ICON:ut`<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>`},KC=Ve`.w3m-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(--w3m-background-border-radius) * .9);background-color:var(--w3m-background-color);background-image:var(--w3m-background-image-url);background-position:center;background-size:cover}.w3m-toolbar{height:38px;display:flex;position:relative;margin:5px 15px 5px 5px;justify-content:space-between;align-items:center}.w3m-toolbar img,.w3m-toolbar svg{height:28px;object-position:left center;object-fit:contain}#w3m-wc-logo path{fill:var(--w3m-accent-fill-color)}button{width:28px;height:28px;border-radius:var(--w3m-icon-button-border-radius);border:0;display:flex;justify-content:center;align-items:center;cursor:pointer;background-color:var(--w3m-color-bg-1);box-shadow:0 0 0 1px var(--w3m-color-overlay)}button:active{background-color:var(--w3m-color-bg-2)}button svg{display:block;object-position:center}button path{fill:var(--w3m-color-fg-1)}.w3m-toolbar div{display:flex}.w3m-toolbar div button:first-child{margin-right:16px}.w3m-help-active button:first-child{background-color:var(--w3m-color-fg-1)}.w3m-help-active button:first-child path{fill:var(--w3m-color-bg-1)}@media(hover:hover){button:hover{background-color:var(--w3m-color-bg-2)}}`;var GC=Object.defineProperty,ZC=Object.getOwnPropertyDescriptor,em=(t,e,r,n)=>{for(var i=n>1?void 0:n?ZC(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&GC(e,r,i),i};let Mc=class extends $e{constructor(){super(),this.isHelp=!1,this.unsubscribeRouter=void 0,this.unsubscribeRouter=tt.subscribe(t=>{this.isHelp=t.view==="Help"})}disconnectedCallback(){var t;(t=this.unsubscribeRouter)==null||t.call(this)}onHelp(){tt.push("Help")}logoTemplate(){var t;const e=(t=Mn.state.themeVariables)==null?void 0:t["--w3m-logo-image-url"];return e?oe`<img src="${e}">`:Le.WALLET_CONNECT_LOGO}render(){const t={"w3m-help-active":this.isHelp};return oe`<div class="w3m-toolbar-placeholder"></div><div class="w3m-toolbar">${this.logoTemplate()}<div class="${Lr(t)}"><button @click="${this.onHelp}">${Le.HELP_ICON}</button> <button @click="${Rr.close}">${Le.CROSS_ICON}</button></div></div>`}};Mc.styles=[Fe.globalCss,KC],em([gt()],Mc.prototype,"isHelp",2),Mc=em([Re("w3m-modal-backcard")],Mc);const YC=Ve`main{padding:20px;padding-top:0;width:100%}`;var JC=Object.defineProperty,XC=Object.getOwnPropertyDescriptor,QC=(t,e,r,n)=>{for(var i=n>1?void 0:n?XC(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&JC(e,r,i),i};let gf=class extends $e{render(){return oe`<main><slot></slot></main>`}};gf.styles=[Fe.globalCss,YC],gf=QC([Re("w3m-modal-content")],gf);const eI=Ve`footer{padding:10px;display:flex;flex-direction:column;align-items:inherit;justify-content:inherit;border-top:1px solid var(--w3m-color-bg-2)}`;var tI=Object.defineProperty,rI=Object.getOwnPropertyDescriptor,nI=(t,e,r,n)=>{for(var i=n>1?void 0:n?rI(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&tI(e,r,i),i};let mf=class extends $e{render(){return oe`<footer><slot></slot></footer>`}};mf.styles=[Fe.globalCss,eI],mf=nI([Re("w3m-modal-footer")],mf);const iI=Ve`header{display:flex;justify-content:center;align-items:center;padding:20px;position:relative}.w3m-border{border-bottom:1px solid var(--w3m-color-bg-2);margin-bottom:20px}header button{padding:15px 20px}header button:active{opacity:.5}@media(hover:hover){header button:hover{opacity:.5}}.w3m-back-btn{position:absolute;left:0}.w3m-action-btn{position:absolute;right:0}path{fill:var(--w3m-accent-color)}`;var sI=Object.defineProperty,oI=Object.getOwnPropertyDescriptor,aa=(t,e,r,n)=>{for(var i=n>1?void 0:n?oI(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&sI(e,r,i),i};let es=class extends $e{constructor(){super(...arguments),this.title="",this.onAction=void 0,this.actionIcon=void 0,this.border=!1}backBtnTemplate(){return oe`<button class="w3m-back-btn" @click="${tt.goBack}">${Le.BACK_ICON}</button>`}actionBtnTemplate(){return oe`<button class="w3m-action-btn" @click="${this.onAction}">${this.actionIcon}</button>`}render(){const t={"w3m-border":this.border},e=tt.state.history.length>1,r=this.title?oe`<w3m-text variant="big-bold">${this.title}</w3m-text>`:oe`<slot></slot>`;return oe`<header class="${Lr(t)}">${e?this.backBtnTemplate():null} ${r} ${this.onAction?this.actionBtnTemplate():null}</header>`}};es.styles=[Fe.globalCss,iI],aa([Ae()],es.prototype,"title",2),aa([Ae()],es.prototype,"onAction",2),aa([Ae()],es.prototype,"actionIcon",2),aa([Ae()],es.prototype,"border",2),es=aa([Re("w3m-modal-header")],es);const aI={1:"692ed6ba-e569-459a-556a-776476829e00",42161:"600a9a04-c1b9-42ca-6785-9b4b6ff85200",43114:"30c46e53-e989-45fb-4549-be3bd4eb3b00",56:"93564157-2e8e-4ce7-81df-b264dbee9b00",250:"06b26297-fe0c-4733-5d6b-ffa5498aac00",10:"ab9c186a-c52f-464b-2906-ca59d760a400",137:"41d04d42-da3b-4453-8506-668cc0727900",100:"02b53f6a-e3d4-479e-1cb4-21178987d100",9001:"f926ff41-260d-4028-635e-91913fc28e00",324:"b310f07f-4ef7-49f3-7073-2a0a39685800",314:"5a73b3dd-af74-424e-cae0-0de859ee9400",4689:"34e68754-e536-40da-c153-6ef2e7188a00",1088:"3897a66d-40b9-4833-162f-a2c90531c900",1284:"161038da-44ae-4ec7-1208-0ea569454b00",1285:"f1d73bb6-5450-4e18-38f7-fb6484264a00"},cI={ETH:{icon:"692ed6ba-e569-459a-556a-776476829e00"},WETH:{icon:"692ed6ba-e569-459a-556a-776476829e00"},AVAX:{icon:"30c46e53-e989-45fb-4549-be3bd4eb3b00"},FTM:{icon:"06b26297-fe0c-4733-5d6b-ffa5498aac00"},BNB:{icon:"93564157-2e8e-4ce7-81df-b264dbee9b00"},MATIC:{icon:"41d04d42-da3b-4453-8506-668cc0727900"},OP:{icon:"ab9c186a-c52f-464b-2906-ca59d760a400"},xDAI:{icon:"02b53f6a-e3d4-479e-1cb4-21178987d100"},EVMOS:{icon:"f926ff41-260d-4028-635e-91913fc28e00"},METIS:{icon:"3897a66d-40b9-4833-162f-a2c90531c900"},IOTX:{icon:"34e68754-e536-40da-c153-6ef2e7188a00"}},Xr={externalWallets(){const{isStandalone:t}=De.state;if(t)return[];let e=Rt.client().getConnectors();return e=e.filter(r=>r.id!=="injected"),e},manualWallets(){var t,e;const{mobileWallets:r,desktopWallets:n}=jt.state,i=(t=Xr.recentWallet())==null?void 0:t.id,o=Se.isMobile()?r:n,c=o?.filter(l=>i!==l.id);return(e=Se.isMobile()?c?.map(({id:l,name:h,links:f})=>({id:l,name:h,mobile:f,links:f})):c?.map(({id:l,name:h,links:f})=>({id:l,name:h,desktop:f,links:f})))!=null?e:[]},installedInjectedWallets(){const{isStandalone:t}=De.state;if(t)return[];if(!Rt.client().isInjectedProviderInstalled())return[];const{namespace:e}=Rt.client(),{injectedWallets:r}=nr.state;let n=r.filter(({injected:i})=>!!i.some(o=>Rt.client().safeCheckInjectedProvider(o.injected_id)&&o.namespace===e));return n.length>1&&(n=n.filter(({injected:i})=>!!i.map(({injected_id:o})=>o).every(o=>o!=="isMetaMask"))),n.length?n:[{name:"Browser",id:"browser",image_id:void 0}]},injectedWallets(){const{isStandalone:t}=De.state,{explorerExcludedWalletIds:e,explorerRecommendedWalletIds:r}=jt.state,n=Se.isMobile();if(t||e==="ALL"||n)return[];const{namespace:i}=Rt.client(),{injectedWallets:o}=nr.state;return o.filter(({id:c,injected:l})=>{const h=Se.isArray(e)?e:[],f=Se.isArray(r)?r:[];return!!l.some(v=>v.namespace===i&&!h.includes(c)&&!f.includes(c))})},recentWallet(){return xe.getRecentWallet()},recomendedWallets(t=!1){var e;const r=Xr.installedInjectedWallets().map(({id:c})=>c),n=t||(e=Xr.recentWallet())==null?void 0:e.id,i=[...r,n],{recomendedWallets:o}=nr.state;return o.filter(c=>!i.includes(c.id))}},xe={MOBILE_BREAKPOINT:600,W3M_RECENT_WALLET_DATA:"W3M_RECENT_WALLET_DATA",EXPLORER_WALLET_URL:"https://explorer.walletconnect.com/?type=wallet",rejectStandaloneButtonComponent(){const{isStandalone:t}=De.state;if(t)throw new Error("Web3Modal button components are not available in standalone mode.")},getShadowRootElement(t,e){const r=t.renderRoot.querySelector(e);if(!r)throw new Error(`${e} not found`);return r},getWalletIcon({id:t,image_id:e}){const{walletImages:r}=jt.state;return r!=null&&r[t]?r[t]:e?nr.getWalletImageUrl(e):""},getWalletName(t,e=!1){return e?t.split(" ")[0]:t},getChainIcon(t){var e;const r=aI[t],{projectId:n,chainImages:i}=jt.state;return(e=i?.[t])!=null?e:n&&r?nr.getAssetImageUrl(r):""},getTokenIcon(t){var e,r;const n=(e=cI[t])==null?void 0:e.icon,{projectId:i,tokenImages:o}=jt.state;return(r=o?.[t])!=null?r:i&&n?nr.getAssetImageUrl(n):""},isMobileAnimation(){return window.innerWidth<=xe.MOBILE_BREAKPOINT},async preloadImage(t){const e=new Promise((r,n)=>{const i=new Image;i.onload=r,i.onerror=n,i.src=t});return Promise.race([e,Se.wait(3e3)])},getErrorMessage(t){return t instanceof Error?t.message:"Unknown Error"},debounce(t,e=500){let r;return(...n)=>{function i(){t(...n)}r&&clearTimeout(r),r=setTimeout(i,e)}},handleMobileLinking(t){const{standaloneUri:e}=De.state,{pairingUri:r}=hr.state,{mobile:n,name:i}=t,o=n?.native,c=n?.universal;xe.setRecentWallet(t);function l(h){let f="";o?f=Se.formatUniversalUrl(o,h,i):c&&(f=Se.formatNativeUrl(c,h,i)),Se.openHref(f,"_self")}l(e||r)},handleAndroidLinking(){const{standaloneUri:t}=De.state,{pairingUri:e}=hr.state;t?(Se.setWalletConnectAndroidDeepLink(t),Se.openHref(t,"_self")):(Se.setWalletConnectAndroidDeepLink(e),Se.openHref(e,"_self"))},async handleUriCopy(){const{standaloneUri:t}=De.state,{pairingUri:e}=hr.state;t?await navigator.clipboard.writeText(t):await navigator.clipboard.writeText(e),Wr.openToast("Link copied","success")},async handleConnectorConnection(t,e){try{const{selectedChain:r}=De.state;await Rt.client().connectConnector(t,r?.id),Rr.close()}catch(r){console.error(r),e?e():Wr.openToast(xe.getErrorMessage(r),"error")}},getCustomImageUrls(){const{chainImages:t,walletImages:e}=jt.state,r=Object.values(t??{}),n=Object.values(e??{});return Object.values([...r,...n])},truncate(t,e=8){return t.length<=e?t:`${t.substring(0,4)}...${t.substring(t.length-4)}`},generateAvatarColors(t){var e;const r=(e=t.match(/.{1,7}/g))==null?void 0:e.splice(0,5),n=[];r?.forEach(o=>{let c=0;for(let h=0;h<o.length;h+=1)c=o.charCodeAt(h)+((c<<5)-c),c=c&c;const l=[0,0,0];for(let h=0;h<3;h+=1){const f=c>>h*8&255;l[h]=f}n.push(`rgb(${l[0]}, ${l[1]}, ${l[2]})`)});const i=document.querySelector(":root");if(i){const o={"--w3m-color-av-1":n[0],"--w3m-color-av-2":n[1],"--w3m-color-av-3":n[2],"--w3m-color-av-4":n[3],"--w3m-color-av-5":n[4]};Object.entries(o).forEach(([c,l])=>i.style.setProperty(c,l))}},setRecentWallet(t){const{walletConnectVersion:e}=De.state;localStorage.setItem(xe.W3M_RECENT_WALLET_DATA,JSON.stringify({[e]:t}))},getRecentWallet(){const t=localStorage.getItem(xe.W3M_RECENT_WALLET_DATA);if(t){const{walletConnectVersion:e}=De.state,r=JSON.parse(t);if(r[e])return r[e]}},caseSafeIncludes(t,e){return t.toUpperCase().includes(e.toUpperCase())},openWalletExplorerUrl(){Se.openHref(xe.EXPLORER_WALLET_URL,"_blank")},getCachedRouterWalletPlatforms(){const{id:t,desktop:e,mobile:r,injected:n}=Se.getWalletRouterData(),i=Xr.installedInjectedWallets(),o=!!(n!=null&&n.length),c=i.some(v=>v.id===t),l=!!(e!=null&&e.native),h=!!(e!=null&&e.universal),f=!!(r!=null&&r.native)||!!(r!=null&&r.universal);return{isInjectedInstalled:c,isInjected:o,isDesktop:l,isMobile:f,isWeb:h}},goToConnectingView(t){tt.setData({Wallet:t});const e=Se.isMobile(),{isDesktop:r,isWeb:n,isMobile:i,isInjectedInstalled:o}=xe.getCachedRouterWalletPlatforms();e?o?tt.push("InjectedConnecting"):i?tt.push("MobileConnecting"):n?tt.push("WebConnecting"):tt.push("InstallWallet"):o?tt.push("InjectedConnecting"):r?tt.push("DesktopConnecting"):n?tt.push("WebConnecting"):i?tt.push("MobileQrcodeConnecting"):tt.push("InstallWallet")}},lI=Ve`.w3m-router{overflow:hidden;will-change:transform}.w3m-content{display:flex;flex-direction:column}`;var uI=Object.defineProperty,hI=Object.getOwnPropertyDescriptor,wf=(t,e,r,n)=>{for(var i=n>1?void 0:n?hI(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&uI(e,r,i),i};let ca=class extends $e{constructor(){super(),this.view=tt.state.view,this.prevView=tt.state.view,this.unsubscribe=void 0,this.oldHeight="0px",this.resizeObserver=void 0,this.unsubscribe=tt.subscribe(t=>{this.view!==t.view&&this.onChangeRoute()})}firstUpdated(){this.resizeObserver=new ResizeObserver(([t])=>{const e=`${t.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 t,e;(t=this.unsubscribe)==null||t.call(this),(e=this.resizeObserver)==null||e.disconnect()}get routerEl(){return xe.getShadowRootElement(this,".w3m-router")}get contentEl(){return xe.getShadowRootElement(this,".w3m-content")}viewTemplate(){switch(this.view){case"ConnectWallet":return oe`<w3m-connect-wallet-view></w3m-connect-wallet-view>`;case"SelectNetwork":return oe`<w3m-select-network-view></w3m-select-network-view>`;case"InjectedConnecting":return oe`<w3m-injected-connecting-view></w3m-injected-connecting-view>`;case"DesktopConnecting":return oe`<w3m-desktop-connecting-view></w3m-desktop-connecting-view>`;case"MobileConnecting":return oe`<w3m-mobile-connecting-view></w3m-mobile-connecting-view>`;case"WebConnecting":return oe`<w3m-web-connecting-view></w3m-web-connecting-view>`;case"MobileQrcodeConnecting":return oe`<w3m-mobile-qr-connecting-view></w3m-mobile-qr-connecting-view>`;case"GetWallet":return oe`<w3m-get-wallet-view></w3m-get-wallet-view>`;case"WalletExplorer":return oe`<w3m-wallet-explorer-view></w3m-wallet-explorer-view>`;case"Qrcode":return oe`<w3m-qrcode-view></w3m-qrcode-view>`;case"Help":return oe`<w3m-help-view></w3m-help-view>`;case"Account":return oe`<w3m-account-view></w3m-account-view>`;case"SwitchNetwork":return oe`<w3m-switch-network-view></w3m-switch-network-view>`;case"InstallWallet":return oe`<w3m-install-wallet-view></w3m-install-wallet-view>`;default:return oe`<div>Not Found</div>`}}async onChangeRoute(){await Qi(this.routerEl,{opacity:[1,0],scale:[1,1.02]},{duration:.15,delay:.1}).finished,this.view=tt.state.view,Qi(this.routerEl,{opacity:[0,1],scale:[.99,1]},{duration:.37,delay:.05})}render(){return oe`<div class="w3m-router"><div class="w3m-content">${this.viewTemplate()}</div></div>`}};ca.styles=[Fe.globalCss,lI],wf([gt()],ca.prototype,"view",2),wf([gt()],ca.prototype,"prevView",2),ca=wf([Re("w3m-modal-router")],ca);const fI=Ve`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(--w3m-notification-border-radius);border:1px solid var(--w3m-color-overlay);background-color:var(--w3m-color-overlay)}svg{margin-right:5px}@-moz-document url-prefix(){div{background-color:var(--w3m-color-bg-3)}}.w3m-success path{fill:var(--w3m-accent-color)}.w3m-error path{fill:var(--w3m-error-color)}`;var dI=Object.defineProperty,pI=Object.getOwnPropertyDescriptor,tm=(t,e,r,n)=>{for(var i=n>1?void 0:n?pI(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&dI(e,r,i),i};let Uc=class extends $e{constructor(){super(),this.open=!1,this.unsubscribe=void 0,this.timeout=void 0,this.unsubscribe=Wr.subscribe(t=>{t.open?(this.open=!0,this.timeout=setTimeout(()=>Wr.closeToast(),2200)):(this.open=!1,clearTimeout(this.timeout))})}disconnectedCallback(){var t;(t=this.unsubscribe)==null||t.call(this),clearTimeout(this.timeout),Wr.closeToast()}render(){const{message:t,variant:e}=Wr.state,r={"w3m-success":e==="success","w3m-error":e==="error"};return this.open?oe`<div class="${Lr(r)}">${e==="success"?Le.CHECKMARK_ICON:null} ${e==="error"?Le.CROSS_ICON:null}<w3m-text variant="small-regular">${t}</w3m-text></div>`:null}};Uc.styles=[Fe.globalCss,fI],tm([gt()],Uc.prototype,"open",2),Uc=tm([Re("w3m-modal-toast")],Uc);const gI=Ve`button{padding:5px;border-radius:var(--w3m-button-hover-highlight-border-radius);display:flex;flex-direction:column;align-items:center;justify-content:center;width:80px;height:90px;position:relative}w3m-network-image{width:54px;height:59px}w3m-text{width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-align:center;margin-top:5px}button:active{background-color:var(--w3m-color-overlay)}.w3m-unsupported{opacity:.3}@media(hover:hover){button:hover{background-color:var(--w3m-color-overlay)}}`;var mI=Object.defineProperty,wI=Object.getOwnPropertyDescriptor,la=(t,e,r,n)=>{for(var i=n>1?void 0:n?wI(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&mI(e,r,i),i};let ts=class extends $e{constructor(){super(...arguments),this.onClick=()=>null,this.name="",this.chainId="",this.unsupported=!1}render(){const t={"w3m-unsupported":this.unsupported};return oe`<button @click="${this.onClick}" class="${Lr(t)}"><w3m-network-image chainId="${this.chainId}"></w3m-network-image><w3m-text variant="xsmall-regular">${this.name}</w3m-text></button>`}};ts.styles=[Fe.globalCss,gI],la([Ae()],ts.prototype,"onClick",2),la([Ae()],ts.prototype,"name",2),la([Ae()],ts.prototype,"chainId",2),la([Ae()],ts.prototype,"unsupported",2),ts=la([Re("w3m-network-button")],ts);const vI=Ve`@keyframes loading{to{stroke-dashoffset:0}}:host{width:inherit;height:inherit;position:relative}path{stroke:var(--w3m-color-overlay)}svg{width:100%;height:100%;margin:0}#network-placeholder-fill{fill:var(--w3m-color-bg-3)}#network-placeholder-dash{stroke:var(--w3m-color-overlay)}image{clip-path:path('M17.033 4.964c3.852-2.262 5.778-3.393 7.84-3.77a11.807 11.807 0 0 1 4.254 0c2.062.377 3.988 1.508 7.84 3.77l6.066 3.562c3.852 2.263 5.777 3.394 7.13 5.022a12.268 12.268 0 0 1 2.127 3.747c.71 2.006.71 4.268.71 8.793v7.124c0 4.525 0 6.787-.71 8.793a12.268 12.268 0 0 1-2.126 3.747c-1.354 1.628-3.28 2.76-7.131 5.022l-6.066 3.562c-3.852 2.262-5.778 3.393-7.84 3.771a11.814 11.814 0 0 1-4.254 0c-2.062-.378-3.988-1.509-7.84-3.77l-6.066-3.563c-3.852-2.263-5.778-3.394-7.13-5.022a12.268 12.268 0 0 1-2.127-3.747C1 40 1 37.737 1 33.212v-7.124c0-4.525 0-6.787.71-8.793a12.268 12.268 0 0 1 2.127-3.747c1.352-1.628 3.278-2.76 7.13-5.022l6.066-3.562Z')}`;var yI=Object.defineProperty,bI=Object.getOwnPropertyDescriptor,rm=(t,e,r,n)=>{for(var i=n>1?void 0:n?bI(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&yI(e,r,i),i};let jc=class extends $e{constructor(){super(...arguments),this.chainId=""}render(){const t=xe.getChainIcon(this.chainId);return t?oe`<svg width="54" height="59" viewBox="0 0 54 59" fill="none"><image href="${t}"/><image href="${t}" width="54" height="59"/><path d="M17.22 5.295c3.877-2.277 5.737-3.363 7.72-3.726a11.44 11.44 0 0 1 4.12 0c1.983.363 3.844 1.45 7.72 3.726l6.065 3.562c3.876 2.276 5.731 3.372 7.032 4.938a11.896 11.896 0 0 1 2.06 3.63c.683 1.928.688 4.11.688 8.663v7.124c0 4.553-.005 6.735-.688 8.664a11.896 11.896 0 0 1-2.06 3.63c-1.3 1.565-3.156 2.66-7.032 4.937l-6.065 3.563c-3.877 2.276-5.737 3.362-7.72 3.725a11.46 11.46 0 0 1-4.12 0c-1.983-.363-3.844-1.449-7.72-3.726l-6.065-3.562c-3.876-2.276-5.731-3.372-7.032-4.938a11.885 11.885 0 0 1-2.06-3.63c-.682-1.928-.688-4.11-.688-8.663v-7.124c0-4.553.006-6.735.688-8.664a11.885 11.885 0 0 1 2.06-3.63c1.3-1.565 3.156-2.66 7.032-4.937l6.065-3.562Z"/></svg>`:oe`${Le.NETWORK_PLACEHOLDER}`}};jc.styles=[Fe.globalCss,vI],rm([Ae()],jc.prototype,"chainId",2),jc=rm([Re("w3m-network-image")],jc);const _I=.1,nm=2.5,Gn=7;function vf(t,e,r){return t===e?!1:(t-e<0?e-t:t-e)<=r+_I}function EI(t,e){const r=Array.prototype.slice.call(ra.create(t,{errorCorrectionLevel:e}).modules.data,0),n=Math.sqrt(r.length);return r.reduce((i,o,c)=>(c%n===0?i.push([o]):i[i.length-1].push(o))&&i,[])}const xI={generate(t,e,r,n){const i=n==="light"?"#141414":"#fff",o=n==="light"?"#fff":"#141414",c=[],l=EI(t,"Q"),h=e/l.length,f=[{x:0,y:0},{x:1,y:0},{x:0,y:1}];f.forEach(({x:j,y:H})=>{const Z=(l.length-Gn)*h*j,R=(l.length-Gn)*h*H,L=.32;for(let $=0;$<f.length;$+=1){const T=h*(Gn-$*2);c.push(ut`<rect fill="${$%2===0?i:o}" height="${T}" rx="${T*L}" ry="${T*L}" width="${T}" x="${Z+h*$}" y="${R+h*$}">`)}});const v=Math.floor((r+25)/h),E=l.length/2-v/2,_=l.length/2+v/2-1,S=[];l.forEach((j,H)=>{j.forEach((Z,R)=>{if(l[H][R]&&!(H<Gn&&R<Gn||H>l.length-(Gn+1)&&R<Gn||H<Gn&&R>l.length-(Gn+1))&&!(H>E&&H<_&&R>E&&R<_)){const L=H*h+h/2,$=R*h+h/2;S.push([L,$])}})});const P={};return S.forEach(([j,H])=>{P[j]?P[j].push(H):P[j]=[H]}),Object.entries(P).map(([j,H])=>{const Z=H.filter(R=>H.every(L=>!vf(R,L,h)));return[Number(j),Z]}).forEach(([j,H])=>{H.forEach(Z=>{c.push(ut`<circle cx="${j}" cy="${Z}" fill="${i}" r="${h/nm}">`)})}),Object.entries(P).filter(([j,H])=>H.length>1).map(([j,H])=>{const Z=H.filter(R=>H.some(L=>vf(R,L,h)));return[Number(j),Z]}).map(([j,H])=>{H.sort((R,L)=>R<L?-1:1);const Z=[];for(const R of H){const L=Z.find($=>$.some(T=>vf(R,T,h)));L?L.push(R):Z.push([R])}return[j,Z.map(R=>[R[0],R[R.length-1]])]}).forEach(([j,H])=>{H.forEach(([Z,R])=>{c.push(ut`<line x1="${j}" x2="${j}" y1="${Z}" y2="${R}" stroke="${i}" stroke-width="${h/(nm/2)}" stroke-linecap="round">`)})}),c}},CI=Ve`@keyframes fadeIn{0%{opacity:0}100%{opacity:1}}div{position:relative;user-select:none;display:block;overflow:hidden;width:100%;aspect-ratio:1/1;animation:fadeIn ease .2s}svg:first-child,w3m-wallet-image{position:absolute;top:50%;left:50%;transform:translateY(-50%) translateX(-50%)}w3m-wallet-image{transform:translateY(-50%) translateX(-50%)}w3m-wallet-image{width:25%;height:25%;border-radius:var(--w3m-wallet-icon-border-radius)}svg:first-child{transform:translateY(-50%) translateX(-50%) scale(.9)}svg:first-child path:first-child{fill:var(--w3m-accent-color)}svg:first-child path:last-child{stroke:var(--w3m-color-overlay)}`;var II=Object.defineProperty,SI=Object.getOwnPropertyDescriptor,qs=(t,e,r,n)=>{for(var i=n>1?void 0:n?SI(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&II(e,r,i),i};let Zn=class extends $e{constructor(){super(...arguments),this.uri="",this.size=0,this.imageId=void 0,this.walletId=void 0,this.imageUrl=void 0}svgTemplate(){var t;const e=(t=Mn.state.themeMode)!=null?t:"light";return ut`<svg height="${this.size}" width="${this.size}">${xI.generate(this.uri,this.size,this.size/4,e)}</svg>`}render(){return oe`<div>${this.walletId||this.imageUrl?oe`<w3m-wallet-image walletId="${this.walletId}" imageId="${this.imageId}" imageUrl="${this.imageUrl}"></w3m-wallet-image>`:Le.WALLET_CONNECT_ICON_COLORED} ${this.svgTemplate()}<w3m-theme-context></w3m-theme-context></div>`}};Zn.styles=[Fe.globalCss,CI],qs([Ae()],Zn.prototype,"uri",2),qs([Ae({type:Number})],Zn.prototype,"size",2),qs([Ae()],Zn.prototype,"imageId",2),qs([Ae()],Zn.prototype,"walletId",2),qs([Ae()],Zn.prototype,"imageUrl",2),Zn=qs([Re("w3m-qrcode")],Zn);const AI=Ve`:host{position:relative;height:28px;width:80%}input{width:100%;height:100%;line-height:28px!important;border-radius:var(--w3m-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(--w3m-color-fg-1);background-color:var(--w3m-color-bg-3);box-shadow:inset 0 0 0 1px var(--w3m-color-overlay);caret-color:var(--w3m-accent-color)}input::placeholder{color:var(--w3m-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(--w3m-accent-color)}path{fill:var(--w3m-color-fg-2)}`;var OI=Object.defineProperty,DI=Object.getOwnPropertyDescriptor,im=(t,e,r,n)=>{for(var i=n>1?void 0:n?DI(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&OI(e,r,i),i};let Fc=class extends $e{constructor(){super(...arguments),this.onChange=()=>null}render(){return oe`<input type="text" @input="${this.onChange}" placeholder="Search wallets"> ${Le.SEARCH_ICON}`}};Fc.styles=[Fe.globalCss,AI],im([Ae()],Fc.prototype,"onChange",2),Fc=im([Re("w3m-search-input")],Fc);const $I=Ve`@keyframes rotate{100%{transform:rotate(360deg)}}@keyframes dash{0%{stroke-dasharray:1,150;stroke-dashoffset:0}50%{stroke-dasharray:90,150;stroke-dashoffset:-35}100%{stroke-dasharray:90,150;stroke-dashoffset:-124}}svg{animation:rotate 2s linear infinite;display:flex;justify-content:center;align-items:center}svg circle{stroke-linecap:round;animation:dash 1.5s ease infinite;stroke:var(--w3m-accent-color)}`;var PI=Object.defineProperty,TI=Object.getOwnPropertyDescriptor,NI=(t,e,r,n)=>{for(var i=n>1?void 0:n?TI(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&PI(e,r,i),i};let yf=class extends $e{render(){return oe`<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>`}};yf.styles=[Fe.globalCss,$I],yf=NI([Re("w3m-spinner")],yf);const RI=Ve`span{font-style:normal;font-family:var(--w3m-font-family);font-feature-settings:'tnum' on,'lnum' on,'case' on}.w3m-xsmall-bold{font-family:var(--w3m-text-xsmall-bold-font-family);font-weight:var(--w3m-text-xsmall-bold-weight);font-size:var(--w3m-text-xsmall-bold-size);line-height:var(--w3m-text-xsmall-bold-line-height);letter-spacing:var(--w3m-text-xsmall-bold-letter-spacing);text-transform:var(--w3m-text-xsmall-bold-text-transform)}.w3m-xsmall-regular{font-family:var(--w3m-text-xsmall-regular-font-family);font-weight:var(--w3m-text-xsmall-regular-weight);font-size:var(--w3m-text-xsmall-regular-size);line-height:var(--w3m-text-xsmall-regular-line-height);letter-spacing:var(--w3m-text-xsmall-regular-letter-spacing);text-transform:var(--w3m-text-xsmall-regular-text-transform)}.w3m-small-thin{font-family:var(--w3m-text-small-thin-font-family);font-weight:var(--w3m-text-small-thin-weight);font-size:var(--w3m-text-small-thin-size);line-height:var(--w3m-text-small-thin-line-height);letter-spacing:var(--w3m-text-small-thin-letter-spacing);text-transform:var(--w3m-text-small-thin-text-transform)}.w3m-small-regular{font-family:var(--w3m-text-small-regular-font-family);font-weight:var(--w3m-text-small-regular-weight);font-size:var(--w3m-text-small-regular-size);line-height:var(--w3m-text-small-regular-line-height);letter-spacing:var(--w3m-text-small-regular-letter-spacing);text-transform:var(--w3m-text-small-regular-text-transform)}.w3m-medium-regular{font-family:var(--w3m-text-medium-regular-font-family);font-weight:var(--w3m-text-medium-regular-weight);font-size:var(--w3m-text-medium-regular-size);line-height:var(--w3m-text-medium-regular-line-height);letter-spacing:var(--w3m-text-medium-regular-letter-spacing);text-transform:var(--w3m-text-medium-regular-text-transform)}.w3m-big-bold{font-family:var(--w3m-text-big-bold-font-family);font-weight:var(--w3m-text-big-bold-weight);font-size:var(--w3m-text-big-bold-size);line-height:var(--w3m-text-big-bold-line-height);letter-spacing:var(--w3m-text-big-bold-letter-spacing);text-transform:var(--w3m-text-big-bold-text-transform)}:host(*){color:var(--w3m-color-fg-1)}.w3m-color-primary{color:var(--w3m-color-fg-1)}.w3m-color-secondary{color:var(--w3m-color-fg-2)}.w3m-color-tertiary{color:var(--w3m-color-fg-3)}.w3m-color-inverse{color:var(--w3m-accent-fill-color)}.w3m-color-accnt{color:var(--w3m-accent-color)}.w3m-color-error{color:var(--w3m-error-color)}`;var LI=Object.defineProperty,MI=Object.getOwnPropertyDescriptor,bf=(t,e,r,n)=>{for(var i=n>1?void 0:n?MI(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&LI(e,r,i),i};let ua=class extends $e{constructor(){super(...arguments),this.variant="medium-regular",this.color="primary"}render(){const t={"w3m-big-bold":this.variant==="big-bold","w3m-medium-regular":this.variant==="medium-regular","w3m-small-regular":this.variant==="small-regular","w3m-small-thin":this.variant==="small-thin","w3m-xsmall-regular":this.variant==="xsmall-regular","w3m-xsmall-bold":this.variant==="xsmall-bold","w3m-color-primary":this.color==="primary","w3m-color-secondary":this.color==="secondary","w3m-color-tertiary":this.color==="tertiary","w3m-color-inverse":this.color==="inverse","w3m-color-accnt":this.color==="accent","w3m-color-error":this.color==="error"};return oe`<span><slot class="${Lr(t)}"></slot></span>`}};ua.styles=[Fe.globalCss,RI],bf([Ae()],ua.prototype,"variant",2),bf([Ae()],ua.prototype,"color",2),ua=bf([Re("w3m-text")],ua);const UI=Ve`div{overflow:hidden;position:relative;border-radius:50%}div::after{content:'';position:absolute;top:0;bottom:0;left:0;right:0;border-radius:50%;border:1px solid var(--w3m-color-overlay)}div img{width:100%;height:100%;object-fit:cover;object-position:center}svg{width:100%;height:100%}#token-placeholder-fill{fill:var(--w3m-color-bg-3)}#token-placeholder-dash{stroke:var(--w3m-color-overlay)}`;var jI=Object.defineProperty,FI=Object.getOwnPropertyDescriptor,sm=(t,e,r,n)=>{for(var i=n>1?void 0:n?FI(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&jI(e,r,i),i};let Bc=class extends $e{constructor(){super(...arguments),this.symbol=void 0}render(){var t;const e=xe.getTokenIcon((t=this.symbol)!=null?t:"");return e?oe`<div><img src="${e}" alt="${this.id}"></div>`:Le.TOKEN_PLACEHOLDER}};Bc.styles=[Fe.globalCss,UI],sm([Ae()],Bc.prototype,"symbol",2),Bc=sm([Re("w3m-token-image")],Bc);const BI=Ve`button{width:100%;height:100%;border-radius:var(--w3m-button-hover-highlight-border-radius);display:flex;align-items:flex-start}button:active{background-color:var(--w3m-color-overlay)}@media(hover:hover){button:hover{background-color:var(--w3m-color-overlay)}}button>div{width:80px;padding:5px 0;display:flex;flex-direction:column;align-items:center}w3m-text{width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-align:center}w3m-wallet-image{height:60px;width:60px;transition:all .2s ease;border-radius:var(--w3m-wallet-icon-border-radius);margin-bottom:5px}.w3m-sublabel{margin-top:2px}`;var kI=Object.defineProperty,HI=Object.getOwnPropertyDescriptor,xi=(t,e,r,n)=>{for(var i=n>1?void 0:n?HI(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&kI(e,r,i),i};let jn=class extends $e{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?oe`<w3m-text class="w3m-sublabel" variant="xsmall-bold" color="tertiary">RECENT</w3m-text>`:this.installed?oe`<w3m-text class="w3m-sublabel" variant="xsmall-bold" color="tertiary">INSTALLED</w3m-text>`:null}handleClick(){mi.click({name:"WALLET_BUTTON",walletId:this.walletId}),this.onClick()}render(){var t;return oe`<button @click="${this.handleClick.bind(this)}"><div><w3m-wallet-image walletId="${this.walletId}" imageId="${this.imageId}"></w3m-wallet-image><w3m-text variant="xsmall-regular">${(t=this.label)!=null?t:xe.getWalletName(this.name,!0)}</w3m-text>${this.sublabelTemplate()}</div></button>`}};jn.styles=[Fe.globalCss,BI],xi([Ae()],jn.prototype,"onClick",2),xi([Ae()],jn.prototype,"name",2),xi([Ae()],jn.prototype,"walletId",2),xi([Ae()],jn.prototype,"label",2),xi([Ae()],jn.prototype,"imageId",2),xi([Ae()],jn.prototype,"installed",2),xi([Ae()],jn.prototype,"recent",2),jn=xi([Re("w3m-wallet-button")],jn);const zI=Ve`:host{display:block}div{overflow:hidden;position:relative;border-radius:inherit;width:100%;height:100%;background-color:var(--w3m-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(--w3m-color-overlay)}div img{width:100%;height:100%;object-fit:cover;object-position:center}#wallet-placeholder-fill{fill:var(--w3m-color-bg-3)}#wallet-placeholder-dash{stroke:var(--w3m-color-overlay)}`;var WI=Object.defineProperty,qI=Object.getOwnPropertyDescriptor,kc=(t,e,r,n)=>{for(var i=n>1?void 0:n?qI(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&WI(e,r,i),i};let Vs=class extends $e{constructor(){super(...arguments),this.walletId="",this.imageId=void 0,this.imageUrl=void 0}render(){var t;const e=(t=this.imageUrl)!=null&&t.length?this.imageUrl:xe.getWalletIcon({id:this.walletId,image_id:this.imageId});return oe`${e.length?oe`<div><img src="${e}" alt="${this.id}"></div>`:Le.WALLET_PLACEHOLDER}`}};Vs.styles=[Fe.globalCss,zI],kc([Ae()],Vs.prototype,"walletId",2),kc([Ae()],Vs.prototype,"imageId",2),kc([Ae()],Vs.prototype,"imageUrl",2),Vs=kc([Re("w3m-wallet-image")],Vs);var VI=Object.defineProperty,KI=Object.getOwnPropertyDescriptor,GI=(t,e,r,n)=>{for(var i=n>1?void 0:n?KI(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&VI(e,r,i),i};let om=class extends $e{constructor(){super(),this.unwatchAccount=void 0,Et.getAccount(),this.fetchProfile(),this.fetchBalance(),this.unwatchAccount=Rt.client().watchAccount(t=>{const{address:e,isConnected:r}=Et.state;t.isConnected&&t.address!==e&&(this.fetchProfile(t.address),this.fetchBalance(t.address),Et.setAddress(t.address)),t.isConnected||Et.resetAccount(),r!==t.isConnected&&Rr.close(),!r&&t.isConnected?mi.track({name:"ACCOUNT_CONNECTED"}):r&&!t.isConnected&&mi.track({name:"ACCOUNT_DISCONNECTED"}),Et.setIsConnected(t.isConnected)})}disconnectedCallback(){var t;(t=this.unwatchAccount)==null||t.call(this)}async fetchProfile(t){var e;const r=(e=De.state.chains)==null?void 0:e.find(n=>n.id===1);if(jt.state.enableAccountView&&r)try{await Et.fetchProfile(xe.preloadImage,t)}catch(n){console.error(n),Wr.openToast(xe.getErrorMessage(n),"error")}}async fetchBalance(t){if(jt.state.enableAccountView)try{await Et.fetchBalance(t)}catch(e){console.error(e),Wr.openToast(xe.getErrorMessage(e),"error")}}};om=GI([Re("w3m-account-context")],om);var ZI=Object.defineProperty,YI=Object.getOwnPropertyDescriptor,am=(t,e,r,n)=>{for(var i=n>1?void 0:n?YI(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&ZI(e,r,i),i};let _f=class extends $e{constructor(){super(),this.preload=!0,this.preloadData()}async loadImages(t){try{t!=null&&t.length&&await Promise.all(t.map(async e=>xe.preloadImage(e)))}catch{console.info("Unsuccessful attempt at preloading some images",t)}}async preloadListings(){var t;if(jt.state.enableExplorer){const{chains:e}=De.state;await Promise.all([nr.getRecomendedWallets(),nr.getInjectedWallets()]),De.setIsDataLoaded(!0);const{recomendedWallets:r}=nr.state,n=Xr.installedInjectedWallets(),i=(t=e?.map(l=>xe.getChainIcon(l.id)))!=null?t:[],o=r.map(l=>xe.getWalletIcon(l)),c=n.map(l=>xe.getWalletIcon(l));await this.loadImages([...i,...o,...c])}else De.setIsDataLoaded(!0)}async preloadCustomImages(){const t=xe.getCustomImageUrls();await this.loadImages(t)}async preloadData(){try{this.preload&&(this.preload=!1,await Promise.all([this.preloadListings(),this.preloadCustomImages()]))}catch(t){console.error(t),Wr.openToast("Failed preloading","error")}}};am([gt()],_f.prototype,"preload",2),_f=am([Re("w3m-explorer-context")],_f);var JI=Object.defineProperty,XI=Object.getOwnPropertyDescriptor,cm=(t,e,r,n)=>{for(var i=n>1?void 0:n?XI(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&JI(e,r,i),i};let Ef=class extends $e{constructor(){super(),this.activeChainId=void 0,this.unwatchNetwork=void 0;const t=De.getSelectedChain();this.activeChainId=t?.id,this.unwatchNetwork=Rt.client().watchNetwork(e=>{const r=e.chain;r&&this.activeChainId!==r.id&&(De.setSelectedChain(r),this.activeChainId=r.id,Et.resetBalance(),this.fetchBalance())})}disconnectedCallback(){var t;(t=this.unwatchNetwork)==null||t.call(this)}async fetchBalance(){if(jt.state.enableAccountView)try{await Et.fetchBalance()}catch(t){console.error(t),Wr.openToast(xe.getErrorMessage(t),"error")}}};cm([gt()],Ef.prototype,"activeChainId",2),Ef=cm([Re("w3m-network-context")],Ef);var QI=Object.defineProperty,eS=Object.getOwnPropertyDescriptor,tS=(t,e,r,n)=>{for(var i=n>1?void 0:n?eS(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&QI(e,r,i),i};let lm=class extends $e{constructor(){super(),this.unsubscribeTheme=void 0,Fe.setTheme(),this.unsubscribeTheme=Mn.subscribe(Fe.setTheme),this.preloadThemeImages()}disconnectedCallback(){var t;(t=this.unsubscribeTheme)==null||t.call(this)}async preloadThemeImages(){try{const{themeVariables:t}=Mn.state,e=[t?.["--w3m-background-image-url"],t?.["--w3m-logo-image-url"]].filter(Boolean);e.length&&await Promise.all(e.map(async r=>xe.preloadImage(r)))}catch{console.info("Unsuccessful attempt at preloading some images")}}};lm=tS([Re("w3m-theme-context")],lm);var rS=Object.defineProperty,nS=Object.getOwnPropertyDescriptor,iS=(t,e,r,n)=>{for(var i=n>1?void 0:n?nS(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&rS(e,r,i),i};const sS=24e4,oS=1e3;var um;let hm=class extends $e{constructor(){super(),this.unwatchOptions=void 0,this.unwatchAccount=void 0,this.timeout=void 0,this.isGenerated=!1,this.selectedChainId=(um=De.state.selectedChain)==null?void 0:um.id,this.isAccountConnected=Et.state.isConnected,this.lastRetry=Date.now(),this.unwatchOptions=De.subscribe(t=>{var e,r;((e=t.selectedChain)==null?void 0:e.id)!==this.selectedChainId&&(this.selectedChainId=(r=t.selectedChain)==null?void 0:r.id,this.connectAndWait())}),this.unwatchAccount=Et.subscribe(t=>{(this.isAccountConnected!==t.isConnected||!this.isGenerated)&&(this.isAccountConnected=t.isConnected,setTimeout(this.connectAndWait.bind(this),0))})}disconnectedCallback(){var t,e;(t=this.unwatchOptions)==null||t.call(this),(e=this.unwatchAccount)==null||e.call(this)}async connectAndWait(){if(clearTimeout(this.timeout),!this.isAccountConnected){this.isGenerated=!0,this.timeout=setTimeout(this.connectAndWait.bind(this),sS);try{const{standaloneUri:t,selectedChain:e}=De.state;t?hr.setPairingUri(t):await Rt.client().connectWalletConnect(r=>hr.setPairingUri(r),e?.id)}catch(t){console.error(t),hr.setPairingError(!0),Wr.openToast("Connection request declined","error"),Date.now()-this.lastRetry>=oS&&(this.lastRetry=Date.now(),this.connectAndWait())}}}};hm=iS([Re("w3m-wc-connection-context")],hm);const aS=Ve`:host{all:initial}div{display:flex;align-items:center;background-color:var(--w3m-color-overlay);box-shadow:inset 0 0 0 1px var(--w3m-color-overlay);border-radius:var(--w3m-button-border-radius);padding:4px 4px 4px 8px}div button{border-radius:var(--w3m-secondary-button-border-radius);padding:4px 8px;padding-left:4px;height:auto;margin-left:10px;color:var(--w3m-accent-fill-color);background-color:var(--w3m-accent-color)}.w3m-no-avatar{padding-left:8px}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(--w3m-color-overlay)}button:hover::after{background-color:var(--w3m-color-overlay)}w3m-avatar{margin-right:6px}w3m-button-big w3m-avatar{margin-left:-5px}`;var cS=Object.defineProperty,lS=Object.getOwnPropertyDescriptor,xf=(t,e,r,n)=>{for(var i=n>1?void 0:n?lS(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&cS(e,r,i),i};let Ks=class extends $e{constructor(){super(),this.balance="hide",this.avatar="show",xe.rejectStandaloneButtonComponent()}onOpen(){const{isStandalone:t}=De.state;t||(mi.click({name:"ACCOUNT_BUTTON"}),Rr.open({route:"Account"}))}accountTemplate(){const t=this.avatar==="show";return oe`${t?oe`<w3m-avatar></w3m-avatar>`:null}<w3m-address-text></w3m-address-text>`}render(){const t=this.balance==="show",e={"w3m-no-avatar":this.avatar==="hide"};return t?oe`<div><w3m-balance></w3m-balance><button @click="${this.onOpen}" class="${Lr(e)}">${this.accountTemplate()}</button></div>`:oe`<w3m-button-big @click="${this.onOpen}">${this.accountTemplate()}</w3m-button-big>`}};Ks.styles=[Fe.globalCss,aS],xf([Ae()],Ks.prototype,"balance",2),xf([Ae()],Ks.prototype,"avatar",2),Ks=xf([Re("w3m-account-button")],Ks);const uS=Ve`button{display:flex;border-radius:var(--w3m-button-hover-highlight-border-radius);flex-direction:column;justify-content:center;padding:5px;width:100px}button:active{background-color:var(--w3m-color-overlay)}@media(hover:hover){button:hover{background-color:var(--w3m-color-overlay)}}button:disabled{pointer-events:none}w3m-network-image{width:32px;height:32px}w3m-text{margin-top:4px}`;var hS=Object.defineProperty,fS=Object.getOwnPropertyDescriptor,Cf=(t,e,r,n)=>{for(var i=n>1?void 0:n?fS(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&hS(e,r,i),i};let ha=class extends $e{constructor(){super(),this.chainId=0,this.label="",this.unsubscribeNetwork=void 0;const{selectedChain:t}=De.state;this.chainId=t?.id,this.label=t?.name,this.unsubscribeNetwork=De.subscribe(({selectedChain:e})=>{this.chainId=e?.id,this.label=e?.name})}disconnectedCallback(){var t;(t=this.unsubscribeNetwork)==null||t.call(this)}onClick(){tt.push("SelectNetwork")}render(){const{chains:t,selectedChain:e}=De.state,r=t?.map(o=>o.id),n=e&&r?.includes(e.id),i=t&&t.length<=1&&n;return oe`<button @click="${this.onClick}" ?disabled="${i}"><w3m-network-image chainId="${this.chainId}"></w3m-network-image><w3m-text variant="xsmall-regular" color="accent">${this.label}</w3m-text></button>`}};ha.styles=[Fe.globalCss,uS],Cf([gt()],ha.prototype,"chainId",2),Cf([gt()],ha.prototype,"label",2),ha=Cf([Re("w3m-account-network-button")],ha);const dS=Ve`@keyframes slide{0%{background-position:0 0}100%{background-position:200px 0}}w3m-text{padding:1px 0}.w3m-loading{background:linear-gradient(270deg,var(--w3m-color-fg-1) 36.33%,var(--w3m-color-fg-3) 42.07%,var(--w3m-color-fg-1) 83.3%);background-size:200px 100%;background-clip:text;-webkit-background-clip:text;-webkit-text-fill-color:transparent;animation-name:slide;animation-duration:1.5s;animation-iteration-count:infinite;animation-timing-function:linear}`;var pS=Object.defineProperty,gS=Object.getOwnPropertyDescriptor,fa=(t,e,r,n)=>{for(var i=n>1?void 0:n?gS(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&pS(e,r,i),i};let rs=class extends $e{constructor(){super(),this.address=void 0,this.name=void 0,this.loading=!0,this.variant="button",this.unsubscribeAccount=void 0,this.address=Et.state.address,this.name=Et.state.profileName,this.loading=!!Et.state.profileLoading,this.unsubscribeAccount=Et.subscribe(({address:t,profileName:e,profileLoading:r})=>{this.address=t,this.name=e,this.loading=!!r})}disconnectedCallback(){var t;(t=this.unsubscribeAccount)==null||t.call(this)}render(){var t;const e=this.variant==="button",r={"w3m-loading":this.loading};return oe`<w3m-text class="${Lr(r)}" variant="${e?"medium-regular":"big-bold"}" color="${e?"inverse":"primary"}">${this.name?this.name:xe.truncate((t=this.address)!=null?t:"")}</w3m-text>`}};rs.styles=[Fe.globalCss,dS],fa([gt()],rs.prototype,"address",2),fa([gt()],rs.prototype,"name",2),fa([gt()],rs.prototype,"loading",2),fa([Ae()],rs.prototype,"variant",2),rs=fa([Re("w3m-address-text")],rs);const Mr={onConnecting(t){xe.goToConnectingView(t)},onExternal(t){xe.handleConnectorConnection(t)},manualWalletsTemplate(){return Xr.manualWallets().map(t=>oe`<w3m-wallet-button walletId="${t.id}" name="${t.name}" .onClick="${()=>this.onConnecting(t)}"></w3m-wallet-button>`)},recomendedWalletsTemplate(t=!1){return Xr.recomendedWallets(t).map(e=>oe`<w3m-wallet-button walletId="${e.id}" imageId="${e.image_id}" name="${e.name}" .onClick="${()=>this.onConnecting(e)}"></w3m-wallet-button>`)},externalWalletsTemplate(){return Xr.externalWallets().map(t=>oe`<w3m-wallet-button name="${t.name}" walletId="${t.id}" .onClick="${()=>this.onExternal(t.id)}"></w3m-wallet-button>`)},recentWalletTemplate(){const t=Xr.recentWallet();if(t)return oe`<w3m-wallet-button name="${t.name}" walletId="${t.id}" imageId="${t.image_id}" .recent="${!0}" .onClick="${()=>this.onConnecting(t)}"></w3m-wallet-button>`},installedInjectedWalletsTemplate(){return Xr.installedInjectedWallets().map(t=>oe`<w3m-wallet-button .installed="${!0}" name="${t.name}" walletId="${t.id}" imageId="${t.image_id}" .onClick="${()=>this.onConnecting(t)}"></w3m-wallet-button>`)},injectedWalletsTemplate(){return Xr.injectedWallets().map(t=>oe`<w3m-wallet-button name="${t.name}" walletId="${t.id}" imageId="${t.image_id}" .onClick="${()=>this.onConnecting(t)}"></w3m-wallet-button>`)}},mS=Ve`@keyframes scroll{0%{transform:translate3d(0,0,0)}100%{transform:translate3d(calc(-70px * 9),0,0)}}.w3m-slider{position:relative;overflow-x:hidden;padding:10px 0;margin:0 -20px;width:calc(100% + 40px)}.w3m-track{display:flex;width:calc(70px * 18);animation:scroll 20s linear infinite;opacity:.7}.w3m-track svg{margin:0 5px}w3m-wallet-image{width:60px;height:60px;margin:0 5px;border-radius:var(--w3m-wallet-icon-border-radius)}.w3m-grid{display:grid;grid-template-columns:repeat(4,80px);justify-content:space-between}.w3m-title{display:flex;align-items:center;margin-bottom:10px}.w3m-title svg{margin-right:6px}.w3m-title path{fill:var(--w3m-accent-color)}w3m-modal-footer .w3m-title{padding:0 10px}w3m-button-big{position:absolute;top:50%;left:50%;transform:translateY(-50%) translateX(-50%);filter:drop-shadow(0 0 17px var(--w3m-color-bg-1))}w3m-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}w3m-info-footer w3m-text{text-align:center;margin-bottom:15px}#wallet-placeholder-fill{fill:var(--w3m-color-bg-3)}#wallet-placeholder-dash{stroke:var(--w3m-color-overlay)}`;var wS=Object.defineProperty,vS=Object.getOwnPropertyDescriptor,yS=(t,e,r,n)=>{for(var i=n>1?void 0:n?vS(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&wS(e,r,i),i};let If=class extends $e{onGoToQrcode(){tt.push("Qrcode")}onGetWallet(){tt.push("GetWallet")}render(){const{recomendedWallets:t}=nr.state,e=[...t,...t],r=Mr.externalWalletsTemplate(),n=Mr.installedInjectedWalletsTemplate(),i=[...n,...r].length>0,o=Se.RECOMMENDED_WALLET_AMOUNT*2;return oe`<w3m-modal-header title="Connect your wallet" .onAction="${this.onGoToQrcode}" .actionIcon="${Le.QRCODE_ICON}"></w3m-modal-header><w3m-modal-content><div class="w3m-title">${Le.MOBILE_ICON}<w3m-text variant="small-regular" color="accent">WalletConnect</w3m-text></div><div class="w3m-slider"><div class="w3m-track">${[...Array(o)].map((c,l)=>{const h=e[l%e.length];return h?oe`<w3m-wallet-image walletId="${h.id}" imageId="${h.image_id}"></w3m-wallet-image>`:Le.WALLET_PLACEHOLDER})}</div><w3m-button-big @click="${xe.handleAndroidLinking}"><w3m-text variant="medium-regular" color="inverse">Select Wallet</w3m-text></w3m-button-big></div></w3m-modal-content>${i?oe`<w3m-modal-footer><div class="w3m-title">${Le.WALLET_ICON}<w3m-text variant="small-regular" color="accent">Other</w3m-text></div><div class="w3m-grid">${n} ${r}</div></w3m-modal-footer>`:null}<w3m-info-footer><w3m-text color="secondary" variant="small-thin">${`Choose WalletConnect to see supported apps on your device${i?", or select from other options":""}`}</w3m-text><w3m-button variant="outline" .iconRight="${Le.ARROW_UP_RIGHT_ICON}" .onClick="${()=>this.onGetWallet()}">I don't have a wallet</w3m-button></w3m-info-footer>`}};If.styles=[Fe.globalCss,mS],If=yS([Re("w3m-android-wallet-selection")],If);const bS=Ve`@keyframes slide{0%{transform:translateX(-50px)}100%{transform:translateX(200px)}}.w3m-placeholder,img{border-radius:50%;box-shadow:inset 0 0 0 1px var(--w3m-color-overlay);display:block;position:relative;overflow:hidden!important;background-color:var(--w3m-color-av-1);background-image:radial-gradient(at 66% 77%,var(--w3m-color-av-2) 0,transparent 50%),radial-gradient(at 29% 97%,var(--w3m-color-av-3) 0,transparent 50%),radial-gradient(at 99% 86%,var(--w3m-color-av-4) 0,transparent 50%),radial-gradient(at 29% 88%,var(--w3m-color-av-5) 0,transparent 50%);transform:translateZ(0)}.w3m-loader{width:50px;height:100%;background:linear-gradient(270deg,transparent 0,rgba(255,255,255,.4) 30%,transparent 100%);animation-name:slide;animation-duration:1.5s;transform:translateX(-50px);animation-iteration-count:infinite;animation-timing-function:linear;animation-delay:.55s}.w3m-small{width:24px;height:24px}.w3m-medium{width:60px;height:60px}`;var _S=Object.defineProperty,ES=Object.getOwnPropertyDescriptor,da=(t,e,r,n)=>{for(var i=n>1?void 0:n?ES(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&_S(e,r,i),i};let ns=class extends $e{constructor(){super(),this.address=void 0,this.avatar=void 0,this.loading=!0,this.size="small",this.unsubscribeAccount=void 0,this.address=Et.state.address,this.avatar=Et.state.profileAvatar,this.loading=!!Et.state.profileLoading,this.unsubscribeAccount=Et.subscribe(({address:t,profileAvatar:e,profileLoading:r})=>{this.address=t,this.avatar=e,this.loading=!!r})}disconnectedCallback(){var t;(t=this.unsubscribeAccount)==null||t.call(this)}render(){const t={"w3m-placeholder":!0,"w3m-small":this.size==="small","w3m-medium":this.size==="medium"};return this.avatar?oe`<img class="${Lr(t)}" src="${this.avatar}">`:this.address?(xe.generateAvatarColors(this.address),oe`<div class="${Lr(t)}">${this.loading?oe`<div class="w3m-loader"></div>`:null}</div>`):null}};ns.styles=[Fe.globalCss,bS],da([gt()],ns.prototype,"address",2),da([gt()],ns.prototype,"avatar",2),da([gt()],ns.prototype,"loading",2),da([Ae()],ns.prototype,"size",2),ns=da([Re("w3m-avatar")],ns);const xS=Ve`div{display:flex;align-items:center}w3m-token-image{width:28px;height:28px;margin-right:6px}`;var CS=Object.defineProperty,IS=Object.getOwnPropertyDescriptor,Sf=(t,e,r,n)=>{for(var i=n>1?void 0:n?IS(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&CS(e,r,i),i};let pa=class extends $e{constructor(){var t,e;super(),this.symbol=void 0,this.amount=void 0,this.unsubscribeAccount=void 0,this.symbol=(t=Et.state.balance)==null?void 0:t.symbol,this.amount=(e=Et.state.balance)==null?void 0:e.amount,this.unsubscribeAccount=Et.subscribe(({balance:r})=>{this.symbol=r?.symbol,this.amount=r?.amount})}disconnectedCallback(){var t;(t=this.unsubscribeAccount)==null||t.call(this)}render(){let t="_._";return this.amount==="0.0"?t="0":typeof this.amount=="string"&&this.amount.length>6?t=this.amount.substring(0,6):typeof this.amount=="string"&&(t=this.amount),oe`<div><w3m-token-image symbol="${this.symbol}"></w3m-token-image><w3m-text variant="medium-regular" color="primary">${t} ${this.symbol}</w3m-text></div>`}};pa.styles=[Fe.globalCss,xS],Sf([gt()],pa.prototype,"symbol",2),Sf([gt()],pa.prototype,"amount",2),pa=Sf([Re("w3m-balance")],pa);const SS=Ve`:host{all:initial}svg{width:28px;height:20px;margin:-1px 3px 0 -5px}svg path{fill:var(--w3m-accent-fill-color)}button:disabled svg path{fill:var(--w3m-color-fg-3)}w3m-spinner{margin:0 10px 0 0}`;var AS=Object.defineProperty,OS=Object.getOwnPropertyDescriptor,Hc=(t,e,r,n)=>{for(var i=n>1?void 0:n?OS(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&AS(e,r,i),i};let is=class extends $e{constructor(){super(),this.loading=!1,this.label="Connect Wallet",this.icon="show",this.modalUnsub=void 0,xe.rejectStandaloneButtonComponent(),this.modalUnsub=Rr.subscribe(t=>{t.open&&(this.loading=!0),t.open||(this.loading=!1)})}disconnectedCallback(){var t;(t=this.modalUnsub)==null||t.call(this)}iconTemplate(){return this.icon==="show"?Le.WALLET_CONNECT_ICON:null}onClick(){Et.state.isConnected?this.onDisconnect():this.onConnect()}async onConnect(){this.loading=!0,mi.click({name:"CONNECT_BUTTON"}),await Rr.open(),Rr.state.open||(this.loading=!1)}async onDisconnect(){mi.click({name:"DISCONNECT_BUTTON"}),await Rt.client().disconnect()}render(){return oe`<w3m-button-big .disabled="${this.loading}" @click="${this.onClick}">${this.loading?oe`<w3m-spinner></w3m-spinner><w3m-text variant="medium-regular" color="accent">Connecting...</w3m-text>`:oe`${this.iconTemplate()}<w3m-text variant="medium-regular" color="inverse">${this.label}</w3m-text>`}</w3m-button-big>`}};is.styles=[Fe.globalCss,SS],Hc([gt()],is.prototype,"loading",2),Hc([Ae()],is.prototype,"label",2),Hc([Ae()],is.prototype,"icon",2),is=Hc([Re("w3m-connect-button")],is);const DS=Ve`@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(--w3m-accent-color);animation:loading 1s linear infinite}w3m-wallet-image{border-radius:var(--w3m-wallet-icon-large-border-radius);width:90px;height:90px}w3m-text{margin-bottom:40px}.w3m-error svg{stroke:var(--w3m-error-color)}.w3m-error use{display:none}.w3m-error{animation:shake .4s cubic-bezier(.36,.07,.19,.97) both}.w3m-stale svg,.w3m-stale use{display:none}`;var $S=Object.defineProperty,PS=Object.getOwnPropertyDescriptor,Gs=(t,e,r,n)=>{for(var i=n>1?void 0:n?PS(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&$S(e,r,i),i};let Ci=class extends $e{constructor(){super(...arguments),this.walletId=void 0,this.imageId=void 0,this.isError=!1,this.isStale=!1,this.label=""}svgLoaderTemplate(){var t,e;const r=(e=(t=Mn.state.themeVariables)==null?void 0:t["--w3m-wallet-icon-large-border-radius"])!=null?e:Fe.getPreset("--w3m-wallet-icon-large-border-radius");let n=0;r.includes("%")?n=88/100*parseInt(r,10):n=parseInt(r,10),n*=1.17;const i=317-n*1.57,o=425-n*1.8;return oe`<svg viewBox="0 0 110 110" width="110" height="110"><rect id="w3m-loader" x="2" y="2" width="106" height="106" rx="${n}"/><use xlink:href="#w3m-loader" stroke-dasharray="106 ${i}" stroke-dashoffset="${o}"></use></svg>`}render(){const t={"w3m-error":this.isError,"w3m-stale":this.isStale};return oe`<div class="${Lr(t)}">${this.svgLoaderTemplate()}<w3m-wallet-image walletId="${this.walletId}" imageId="${this.imageId}"></w3m-wallet-image></div><w3m-text variant="medium-regular" color="${this.isError?"error":"primary"}">${this.isError?"Connection declined":this.label}</w3m-text>`}};Ci.styles=[Fe.globalCss,DS],Gs([Ae()],Ci.prototype,"walletId",2),Gs([Ae()],Ci.prototype,"imageId",2),Gs([Ae()],Ci.prototype,"isError",2),Gs([Ae()],Ci.prototype,"isStale",2),Gs([Ae()],Ci.prototype,"label",2),Ci=Gs([Re("w3m-connector-waiting")],Ci);var TS=Object.defineProperty,NS=Object.getOwnPropertyDescriptor,Zs=(t,e,r,n)=>{for(var i=n>1?void 0:n?NS(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&TS(e,r,i),i};let Ii=class extends $e{constructor(){super(),this.isConnected=!1,this.label="Connect Wallet",this.icon="show",this.avatar="show",this.balance="hide",this.unsubscribeAccount=void 0,xe.rejectStandaloneButtonComponent(),this.isConnected=Et.state.isConnected,this.unsubscribeAccount=Et.subscribe(({isConnected:t})=>{this.isConnected=t})}disconnectedCallback(){var t;(t=this.unsubscribeAccount)==null||t.call(this)}render(){const{enableAccountView:t}=jt.state,e=this.balance,r=this.label,n=this.icon,i=this.avatar;return this.isConnected&&t?oe`<w3m-account-button balance="${e}" avatar="${i}"></w3m-account-button>`:oe`<w3m-connect-button label="${this.isConnected?"Disconnect":r}" icon="${n}"></w3m-connect-button>`}};Zs([gt()],Ii.prototype,"isConnected",2),Zs([Ae()],Ii.prototype,"label",2),Zs([Ae()],Ii.prototype,"icon",2),Zs([Ae()],Ii.prototype,"avatar",2),Zs([Ae()],Ii.prototype,"balance",2),Ii=Zs([Re("w3m-core-button")],Ii);const RS=Ve`.w3m-grid{display:grid;grid-template-columns:repeat(4,80px);justify-content:space-between}.w3m-desktop-title,.w3m-mobile-title{display:flex;align-items:center}.w3m-mobile-title{justify-content:space-between;margin-bottom:20px;margin-top:-10px}.w3m-desktop-title{margin-bottom:10px;padding:0 10px}.w3m-subtitle{display:flex;align-items:center}.w3m-subtitle:last-child path{fill:var(--w3m-color-fg-3)}.w3m-desktop-title svg,.w3m-mobile-title svg{margin-right:6px}.w3m-desktop-title path,.w3m-mobile-title path{fill:var(--w3m-accent-color)}`;var LS=Object.defineProperty,MS=Object.getOwnPropertyDescriptor,US=(t,e,r,n)=>{for(var i=n>1?void 0:n?MS(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&LS(e,r,i),i};let Af=class extends $e{render(){const{isStandalone:t}=De.state,{explorerExcludedWalletIds:e,enableExplorer:r}=jt.state,n=e!=="ALL"&&r,i=Mr.manualWalletsTemplate(),o=Mr.recomendedWalletsTemplate(),c=Mr.externalWalletsTemplate(),l=Mr.recentWalletTemplate(),h=Mr.installedInjectedWalletsTemplate();let f=[l,...i,...o];t||(f=[...h,l,...c,...i,...o]),f=f.filter(Boolean);const v=f.length>4||n;let E=[];v?E=f.slice(0,3):E=f;const _=!!E.length;return oe`<w3m-modal-header .border="${!0}" title="Connect your wallet" .onAction="${xe.handleUriCopy}" .actionIcon="${Le.COPY_ICON}"></w3m-modal-header><w3m-modal-content><div class="w3m-mobile-title"><div class="w3m-subtitle">${Le.MOBILE_ICON}<w3m-text variant="small-regular" color="accent">Mobile</w3m-text></div><div class="w3m-subtitle">${Le.SCAN_ICON}<w3m-text variant="small-regular" color="secondary">Scan with your wallet</w3m-text></div></div><w3m-walletconnect-qr></w3m-walletconnect-qr></w3m-modal-content>${_?oe`<w3m-modal-footer><div class="w3m-desktop-title">${Le.DESKTOP_ICON}<w3m-text variant="small-regular" color="accent">Desktop</w3m-text></div><div class="w3m-grid">${E} ${v?oe`<w3m-view-all-wallets-button></w3m-view-all-wallets-button>`:null}</div></w3m-modal-footer>`:null}`}};Af.styles=[Fe.globalCss,RS],Af=US([Re("w3m-desktop-wallet-selection")],Af);const jS=Ve`div{background-color:var(--w3m-color-bg-2);padding:10px 20px 15px 20px;border-top:1px solid var(--w3m-color-bg-3);text-align:center}a{color:var(--w3m-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 FS=Object.defineProperty,BS=Object.getOwnPropertyDescriptor,kS=(t,e,r,n)=>{for(var i=n>1?void 0:n?BS(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&FS(e,r,i),i};let Of=class extends $e{render(){const{termsOfServiceUrl:t,privacyPolicyUrl:e}=jt.state;return t??e?oe`<div><w3m-text variant="small-regular" color="secondary">By connecting your wallet to this app, you agree to the app's ${t?oe`<a href="${t}" target="_blank" rel="noopener noreferrer">Terms of Service</a>`:null} ${t&&e?"and":null} ${e?oe`<a href="${e}" target="_blank" rel="noopener noreferrer">Privacy Policy</a>`:null}</w3m-text></div>`:null}};Of.styles=[Fe.globalCss,jS],Of=kS([Re("w3m-legal-notice")],Of);const HS=Ve`div{display:grid;grid-template-columns:repeat(4,80px);margin:0 -10px;justify-content:space-between;row-gap:10px}`;var zS=Object.defineProperty,WS=Object.getOwnPropertyDescriptor,qS=(t,e,r,n)=>{for(var i=n>1?void 0:n?WS(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&zS(e,r,i),i};let Df=class extends $e{onQrcode(){tt.push("Qrcode")}render(){const{isStandalone:t}=De.state,{explorerExcludedWalletIds:e,enableExplorer:r}=jt.state,n=e!=="ALL"&&r,i=Mr.manualWalletsTemplate(),o=Mr.recomendedWalletsTemplate(),c=Mr.externalWalletsTemplate(),l=Mr.recentWalletTemplate(),h=Mr.installedInjectedWalletsTemplate();let f=[l,...i,...o];t||(f=[...h,l,...c,...i,...o]),f=f.filter(Boolean);const v=f.length>8||n;let E=[];v?E=f.slice(0,7):E=f;const _=!!E.length;return oe`<w3m-modal-header title="Connect your wallet" .onAction="${this.onQrcode}" .actionIcon="${Le.QRCODE_ICON}"></w3m-modal-header>${_?oe`<w3m-modal-content><div>${E} ${v?oe`<w3m-view-all-wallets-button></w3m-view-all-wallets-button>`:null}</div></w3m-modal-content>`:null}`}};Df.styles=[Fe.globalCss,HS],Df=qS([Re("w3m-mobile-wallet-selection")],Df);const VS=Ve`:host{all:initial}.w3m-overlay{top:0;bottom:0;left:0;right:0;position:fixed;z-index:var(--w3m-z-index);overflow:hidden;display:flex;justify-content:center;align-items:center;background-color:rgba(0,0,0,.3);opacity:0;pointer-events:none}@media(max-height:720px) and (orientation:landscape){.w3m-overlay{overflow:scroll;align-items:flex-start;padding:20px 0}}.w3m-active{pointer-events:auto}.w3m-container{position:relative;max-width:360px;width:100%;outline:0;border-radius:var(--w3m-background-border-radius) var(--w3m-background-border-radius) var(--w3m-container-border-radius) var(--w3m-container-border-radius);border:1px solid var(--w3m-color-overlay);overflow:hidden}.w3m-card{width:100%;position:relative;border-radius:var(--w3m-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(--w3m-color-overlay);background-color:var(--w3m-color-bg-1);color:var(--w3m-color-fg-1)}@media(max-width:600px){.w3m-container{max-width:440px;border-radius:var(--w3m-background-border-radius) var(--w3m-background-border-radius) 0 0}.w3m-card{border-radius:var(--w3m-container-border-radius) var(--w3m-container-border-radius) 0 0}.w3m-overlay{align-items:flex-end}}@media(max-width:440px){.w3m-container{border:0}}`;var KS=Object.defineProperty,GS=Object.getOwnPropertyDescriptor,$f=(t,e,r,n)=>{for(var i=n>1?void 0:n?GS(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&KS(e,r,i),i};let Ys=class extends $e{constructor(){super(),this.open=!1,this.active=!1,this.unsubscribeModal=void 0,this.abortController=void 0,this.unsubscribeModal=Rr.subscribe(t=>{t.open?this.onOpenModalEvent():this.onCloseModalEvent()})}disconnectedCallback(){var t;(t=this.unsubscribeModal)==null||t.call(this)}get overlayEl(){return xe.getShadowRootElement(this,".w3m-overlay")}get containerEl(){return xe.getShadowRootElement(this,".w3m-container")}toggleBodyScroll(t){document.querySelector("body")&&(t?document.getElementById("w3m-styles")?.remove():document.head.insertAdjacentHTML("beforeend",'<style id="w3m-styles">html,body{touch-action:none;overflow:hidden;overscroll-behavior:contain;}</style>'))}onCloseModal(t){t.target===t.currentTarget&&Rr.close()}onOpenModalEvent(){this.toggleBodyScroll(!1),this.addKeyboardEvents(),this.open=!0,setTimeout(async()=>{const t=xe.isMobileAnimation()?{y:["50vh","0vh"]}:{scale:[.98,1]},e=.1,r=.2;await Promise.all([Qi(this.overlayEl,{opacity:[0,1]},{delay:e,duration:r}).finished,Qi(this.containerEl,t,{delay:e,duration:r}).finished]),this.active=!0},0)}async onCloseModalEvent(){this.toggleBodyScroll(!0),this.removeKeyboardEvents();const t=xe.isMobileAnimation()?{y:["0vh","50vh"]}:{scale:[1,.98]},e=.2;await Promise.all([Qi(this.overlayEl,{opacity:[1,0]},{duration:e}).finished,Qi(this.containerEl,t,{duration:e}).finished]),this.containerEl.removeAttribute("style"),this.active=!1,this.open=!1}addKeyboardEvents(){this.abortController=new AbortController,window.addEventListener("keydown",t=>{var e;t.key==="Escape"?Rr.close():t.key==="Tab"&&((e=t.target)!=null&&e.tagName.includes("W3M-")||this.containerEl.focus())},this.abortController),this.containerEl.focus()}removeKeyboardEvents(){var t;(t=this.abortController)==null||t.abort(),this.abortController=void 0}managedModalContextTemplate(){const{isStandalone:t}=De.state;return t?null:oe`<w3m-wc-connection-context></w3m-wc-connection-context><w3m-account-context></w3m-account-context><w3m-network-context></w3m-network-context>`}render(){const t={"w3m-overlay":!0,"w3m-active":this.active};return oe`<w3m-explorer-context></w3m-explorer-context><w3m-theme-context></w3m-theme-context>${this.managedModalContextTemplate()}<div id="w3m-modal" class="${Lr(t)}" @click="${this.onCloseModal}" role="alertdialog" aria-modal="true"><div class="w3m-container" tabindex="0">${this.open?oe`<w3m-modal-backcard></w3m-modal-backcard><div class="w3m-card"><w3m-modal-router></w3m-modal-router><w3m-modal-toast></w3m-modal-toast></div>`:null}</div></div>`}};Ys.styles=[Fe.globalCss,VS],$f([gt()],Ys.prototype,"open",2),$f([gt()],Ys.prototype,"active",2),Ys=$f([Re("w3m-modal")],Ys);const ZS=Ve`:host{all:initial}w3m-network-image{margin-left:-6px;margin-right:6px;width:28px;height:28px}`;var YS=Object.defineProperty,JS=Object.getOwnPropertyDescriptor,zc=(t,e,r,n)=>{for(var i=n>1?void 0:n?JS(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&YS(e,r,i),i};let ss=class extends $e{constructor(){super(),this.chainId="",this.label="",this.wrongNetwork=!1,this.unsubscribeNetwork=void 0,xe.rejectStandaloneButtonComponent();const{selectedChain:t}=De.state;this.onSetChainData(t),this.unsubscribeNetwork=De.subscribe(({selectedChain:e})=>{this.onSetChainData(e)})}disconnectedCallback(){var t;(t=this.unsubscribeNetwork)==null||t.call(this)}onSetChainData(t){if(t){const{chains:e}=De.state,r=e?.map(n=>n.id);this.chainId=t.id.toString(),this.wrongNetwork=!(r!=null&&r.includes(t.id)),this.label=this.wrongNetwork?"Wrong Network":t.name}}onClick(){mi.click({name:"NETWORK_BUTTON"}),Rr.open({route:"SelectNetwork"})}render(){var t;const{chains:e}=De.state,r=e&&e.length>1;return oe`<w3m-button-big @click="${this.onClick}" ?disabled="${!r}"><w3m-network-image chainId="${this.chainId}"></w3m-network-image><w3m-text variant="medium-regular" color="inverse">${(t=this.label)!=null&&t.length?this.label:"Select Network"}</w3m-text></w3m-button-big>`}};ss.styles=[Fe.globalCss,ZS],zc([gt()],ss.prototype,"chainId",2),zc([gt()],ss.prototype,"label",2),zc([gt()],ss.prototype,"wrongNetwork",2),ss=zc([Re("w3m-network-switch")],ss);const XS=Ve`@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:1px;top:0;left:0}use{stroke:var(--w3m-accent-color);animation:loading 1s linear infinite}w3m-network-image{width:92px;height:92px}w3m-text{margin-bottom:40px}.w3m-error svg{stroke:var(--w3m-error-color)}.w3m-error use{display:none}.w3m-error{animation:shake .4s cubic-bezier(.36,.07,.19,.97) both}`;var QS=Object.defineProperty,eA=Object.getOwnPropertyDescriptor,Wc=(t,e,r,n)=>{for(var i=n>1?void 0:n?eA(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&QS(e,r,i),i};let Js=class extends $e{constructor(){super(...arguments),this.chainId=void 0,this.isError=!1,this.label=""}svgLoaderTemplate(){return oe`<svg width="54" height="59" viewBox="0 0 54 59" fill="none" class="w3m-loader"><path id="w3m-loader-path" d="M17.22 5.295c3.877-2.277 5.737-3.363 7.72-3.726a11.44 11.44 0 0 1 4.12 0c1.983.363 3.844 1.45 7.72 3.726l6.065 3.562c3.876 2.276 5.731 3.372 7.032 4.938a11.896 11.896 0 0 1 2.06 3.63c.683 1.928.688 4.11.688 8.663v7.124c0 4.553-.005 6.735-.688 8.664a11.896 11.896 0 0 1-2.06 3.63c-1.3 1.565-3.156 2.66-7.032 4.937l-6.065 3.563c-3.877 2.276-5.737 3.362-7.72 3.725a11.46 11.46 0 0 1-4.12 0c-1.983-.363-3.844-1.449-7.72-3.726l-6.065-3.562c-3.876-2.276-5.731-3.372-7.032-4.938a11.885 11.885 0 0 1-2.06-3.63c-.682-1.928-.688-4.11-.688-8.663v-7.124c0-4.553.006-6.735.688-8.664a11.885 11.885 0 0 1 2.06-3.63c1.3-1.565 3.156-2.66 7.032-4.937l6.065-3.562Z"/><use xlink:href="#w3m-loader-path" stroke-dasharray="54 118" stroke-dashoffset="172"></use></svg>`}render(){const t={"w3m-error":this.isError};return oe`<div class="${Lr(t)}">${this.svgLoaderTemplate()}<w3m-network-image chainId="${this.chainId}"></w3m-network-image></div><w3m-text variant="medium-regular" color="${this.isError?"error":"primary"}">${this.isError?"Switch declined":this.label}</w3m-text>`}};Js.styles=[Fe.globalCss,XS],Wc([Ae()],Js.prototype,"chainId",2),Wc([Ae()],Js.prototype,"isError",2),Wc([Ae()],Js.prototype,"label",2),Js=Wc([Re("w3m-network-waiting")],Js);const tA=Ve`div{display:flex;margin-top:15px}slot{display:inline-block;margin:0 5px}w3m-button{margin:0 5px}`;var rA=Object.defineProperty,nA=Object.getOwnPropertyDescriptor,os=(t,e,r,n)=>{for(var i=n>1?void 0:n?nA(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&rA(e,r,i),i};let Yn=class extends $e{constructor(){super(...arguments),this.isMobile=!1,this.isInjected=!1,this.isInjectedInstalled=!1,this.isDesktop=!1,this.isWeb=!1,this.isRetry=!1}onMobile(){Se.isMobile()?tt.replace("MobileConnecting"):tt.replace("MobileQrcodeConnecting")}onInjected(){this.isInjectedInstalled?tt.replace("InjectedConnecting"):tt.replace("InstallWallet")}onDesktop(){tt.replace("DesktopConnecting")}onWeb(){tt.replace("WebConnecting")}render(){const{isStandalone:t}=De.state;return oe`<div>${this.isRetry?oe`<slot></slot>`:null} ${this.isMobile?oe`<w3m-button .onClick="${this.onMobile}" .iconLeft="${Le.MOBILE_ICON}" variant="outline">Mobile</w3m-button>`:null} ${this.isInjected&&!t?oe`<w3m-button .onClick="${this.onInjected}" .iconLeft="${Le.WALLET_ICON}" variant="outline">Browser</w3m-button>`:null} ${this.isDesktop?oe`<w3m-button .onClick="${this.onDesktop}" .iconLeft="${Le.DESKTOP_ICON}" variant="outline">Desktop</w3m-button>`:null} ${this.isWeb?oe`<w3m-button .onClick="${this.onWeb}" .iconLeft="${Le.GLOBE_ICON}" variant="outline">Web</w3m-button>`:null}</div>`}};Yn.styles=[Fe.globalCss,tA],os([Ae()],Yn.prototype,"isMobile",2),os([Ae()],Yn.prototype,"isInjected",2),os([Ae()],Yn.prototype,"isInjectedInstalled",2),os([Ae()],Yn.prototype,"isDesktop",2),os([Ae()],Yn.prototype,"isWeb",2),os([Ae()],Yn.prototype,"isRetry",2),Yn=os([Re("w3m-platform-selection")],Yn);const iA=Ve`button{display:flex;flex-direction:column;padding:5px 10px;border-radius:var(--w3m-button-hover-highlight-border-radius);height:100%;justify-content:flex-start}.w3m-icons{width:60px;height:60px;display:flex;flex-wrap:wrap;padding:7px;border-radius:var(--w3m-wallet-icon-border-radius);justify-content:space-between;align-items:center;margin-bottom:5px;background-color:var(--w3m-color-bg-2);box-shadow:inset 0 0 0 1px var(--w3m-color-overlay)}button:active{background-color:var(--w3m-color-overlay)}@media(hover:hover){button:hover{background-color:var(--w3m-color-overlay)}}.w3m-icons img{width:21px;height:21px;object-fit:cover;object-position:center;border-radius:calc(var(--w3m-wallet-icon-border-radius)/ 2);border:1px solid var(--w3m-color-overlay)}.w3m-icons svg{width:21px;height:21px}.w3m-icons img:nth-child(1),.w3m-icons img:nth-child(2),.w3m-icons svg:nth-child(1),.w3m-icons svg:nth-child(2){margin-bottom:4px}w3m-text{width:100%;text-align:center}#wallet-placeholder-fill{fill:var(--w3m-color-bg-3)}#wallet-placeholder-dash{stroke:var(--w3m-color-overlay)}`;var sA=Object.defineProperty,oA=Object.getOwnPropertyDescriptor,aA=(t,e,r,n)=>{for(var i=n>1?void 0:n?oA(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&sA(e,r,i),i};let Pf=class extends $e{onClick(){tt.push("WalletExplorer")}render(){const{recomendedWallets:t}=nr.state,e=Xr.manualWallets(),r=[...t,...e].reverse().slice(0,4);return oe`<button @click="${this.onClick}"><div class="w3m-icons">${r.map(n=>{const i=xe.getWalletIcon(n);if(i)return oe`<img src="${i}">`;const o=xe.getWalletIcon({id:n.id});return o?oe`<img src="${o}">`:Le.WALLET_PLACEHOLDER})} ${[...Array(4-r.length)].map(()=>Le.WALLET_PLACEHOLDER)}</div><w3m-text variant="xsmall-regular">View All</w3m-text></button>`}};Pf.styles=[Fe.globalCss,iA],Pf=aA([Re("w3m-view-all-wallets-button")],Pf);const cA=Ve`.w3m-qr-container{width:100%;display:flex;justify-content:center;align-items:center;aspect-ratio:1/1}`;var lA=Object.defineProperty,uA=Object.getOwnPropertyDescriptor,qc=(t,e,r,n)=>{for(var i=n>1?void 0:n?uA(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&lA(e,r,i),i};let Xs=class extends $e{constructor(){super(),this.walletId="",this.imageId="",this.uri="",this.unwatchWcConnection=void 0,setTimeout(()=>{const{pairingUri:t}=hr.state,{standaloneUri:e}=De.state;this.uri=e??t},0),this.unwatchWcConnection=hr.subscribe(t=>{t.pairingUri&&(this.uri=t.pairingUri)})}disconnectedCallback(){var t;(t=this.unwatchWcConnection)==null||t.call(this)}get overlayEl(){return xe.getShadowRootElement(this,".w3m-qr-container")}render(){return oe`<div class="w3m-qr-container">${this.uri?oe`<w3m-qrcode size="${this.overlayEl.offsetWidth}" uri="${this.uri}" walletId="${this.walletId}" imageId="${this.imageId}"></w3m-qrcode>`:oe`<w3m-spinner></w3m-spinner>`}</div>`}};Xs.styles=[Fe.globalCss,cA],qc([Ae()],Xs.prototype,"walletId",2),qc([Ae()],Xs.prototype,"imageId",2),qc([gt()],Xs.prototype,"uri",2),Xs=qc([Re("w3m-walletconnect-qr")],Xs);const hA=Ve`.w3m-profile{display:flex;justify-content:space-between;align-items:flex-start;padding-top:20px}.w3m-connection-badge{background-color:var(--w3m-color-bg-2);box-shadow:inset 0 0 0 1px var(--w3m-color-overlay);padding:6px 10px 6px 26px;position:relative;border-radius:28px}.w3m-connection-badge::before{content:'';position:absolute;width:10px;height:10px;left:10px;background-color:var(--w3m-success-color);border-radius:50%;top:50%;margin-top:-5px;box-shadow:0 1px 4px 1px var(--w3m-success-color),inset 0 0 0 1px var(--w3m-color-overlay)}.w3m-footer{display:flex;justify-content:space-between}w3m-address-text{margin-top:10px;display:block}.w3m-balance{border-top:1px solid var(--w3m-color-bg-2);padding:11px 20px}`;var fA=Object.defineProperty,dA=Object.getOwnPropertyDescriptor,pA=(t,e,r,n)=>{for(var i=n>1?void 0:n?dA(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&fA(e,r,i),i};let Tf=class extends $e{async onDisconnect(){await Rt.client().disconnect()}async onCopyAddress(){var t;await navigator.clipboard.writeText((t=Et.state.address)!=null?t:""),Wr.openToast("Address copied","success")}render(){return oe`<w3m-modal-content><div class="w3m-profile"><div class="w3m-info"><w3m-avatar size="medium"></w3m-avatar><w3m-address-text variant="modal"></w3m-address-text></div><div class="w3m-connection-badge"><w3m-text variant="small-regular" color="secondary">Connected</w3m-text></div></div></w3m-modal-content><div class="w3m-balance"><w3m-balance></w3m-balance></div><w3m-modal-footer><div class="w3m-footer"><w3m-account-network-button></w3m-account-network-button><w3m-box-button label="Copy Address" .onClick="${this.onCopyAddress}" .icon="${Le.ACCOUNT_COPY}"></w3m-box-button><w3m-box-button label="Disconnect" .onClick="${this.onDisconnect}" .icon="${Le.ACCOUNT_DISCONNECT}"></w3m-box-button></div></w3m-modal-footer>`}};Tf.styles=[Fe.globalCss,hA],Tf=pA([Re("w3m-account-view")],Tf);var gA=Object.defineProperty,mA=Object.getOwnPropertyDescriptor,wA=(t,e,r,n)=>{for(var i=n>1?void 0:n?mA(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&gA(e,r,i),i};let Nf=class extends $e{viewTemplate(){return Se.isAndroid()?oe`<w3m-android-wallet-selection></w3m-android-wallet-selection>`:Se.isMobile()?oe`<w3m-mobile-wallet-selection></w3m-mobile-wallet-selection>`:oe`<w3m-desktop-wallet-selection></w3m-desktop-wallet-selection>`}render(){return oe`${this.viewTemplate()}<w3m-legal-notice></w3m-legal-notice>`}};Nf.styles=[Fe.globalCss],Nf=wA([Re("w3m-connect-wallet-view")],Nf);const vA=Ve`w3m-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}w3m-text{text-align:center}`;var yA=Object.defineProperty,bA=Object.getOwnPropertyDescriptor,fm=(t,e,r,n)=>{for(var i=n>1?void 0:n?bA(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&yA(e,r,i),i};let Vc=class extends $e{constructor(){super(),this.isError=!1,this.unwatchConnection=void 0,this.openDesktopApp(),this.unwatchConnection=hr.subscribe(t=>{this.isError=t.pairingError})}disconnectedCallback(){var t;(t=this.unwatchConnection)==null||t.call(this)}onFormatAndRedirect(t){const{desktop:e,name:r}=Se.getWalletRouterData(),n=e?.native;if(n){const i=Se.formatNativeUrl(n,t,r);Se.openHref(i,"_self")}}openDesktopApp(){hr.setPairingError(!1);const{standaloneUri:t}=De.state,{pairingUri:e}=hr.state,r=Se.getWalletRouterData();xe.setRecentWallet(r),t?this.onFormatAndRedirect(t):this.onFormatAndRedirect(e)}render(){const{name:t,id:e,image_id:r}=Se.getWalletRouterData(),{isMobile:n,isInjected:i,isWeb:o}=xe.getCachedRouterWalletPlatforms();return oe`<w3m-modal-header title="${t}" .onAction="${xe.handleUriCopy}" .actionIcon="${Le.COPY_ICON}"></w3m-modal-header><w3m-modal-content><w3m-connector-waiting walletId="${e}" imageId="${r}" label="${`Continue in ${t}...`}" .isError="${this.isError}"></w3m-connector-waiting></w3m-modal-content><w3m-info-footer><w3m-text color="secondary" variant="small-thin">${`Connection can continue loading if ${t} is not installed on your device`}</w3m-text><w3m-platform-selection .isMobile="${n}" .isInjected="${i}" .isWeb="${o}" .isRetry="${!0}"><w3m-button .onClick="${this.openDesktopApp.bind(this)}" .iconRight="${Le.RETRY_ICON}">Retry</w3m-button></w3m-platform-selection></w3m-info-footer>`}};Vc.styles=[Fe.globalCss,vA],fm([gt()],Vc.prototype,"isError",2),Vc=fm([Re("w3m-desktop-connecting-view")],Vc);const _A=Ve`.w3m-info-text{margin:5px 0 15px;max-width:320px;text-align:center}.w3m-wallet-item{margin:0 -20px 0 0;padding-right:20px;display:flex;align-items:center;border-bottom:1px solid var(--w3m-color-bg-2)}.w3m-wallet-item:last-child{margin-bottom:-20px;border-bottom:0}.w3m-wallet-content{margin-left:20px;height:60px;display:flex;flex:1;align-items:center;justify-content:space-between}.w3m-footer-actions{display:flex;flex-direction:column;align-items:center;padding:20px 0;border-top:1px solid var(--w3m-color-bg-2)}w3m-wallet-image{display:block;width:40px;height:40px;border-radius:10px}`;var EA=Object.defineProperty,xA=Object.getOwnPropertyDescriptor,CA=(t,e,r,n)=>{for(var i=n>1?void 0:n?xA(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&EA(e,r,i),i};let Rf=class extends $e{onGet(t){Se.openHref(t,"_blank")}render(){const t=nr.state.recomendedWallets.slice(0,5),e=Xr.manualWallets().slice(0,5),r=t.length,n=e.length;return oe`<w3m-modal-header title="Get a wallet"></w3m-modal-header><w3m-modal-content>${r?t.map(i=>oe`<div class="w3m-wallet-item"><w3m-wallet-image walletId="${i.id}" imageId="${i.image_id}"></w3m-wallet-image><div class="w3m-wallet-content"><w3m-text variant="medium-regular">${i.name}</w3m-text><w3m-button .iconRight="${Le.ARROW_RIGHT_ICON}" .onClick="${()=>this.onGet(i.homepage)}">Get</w3m-button></div></div>`):null} ${n?e.map(i=>oe`<div class="w3m-wallet-item"><w3m-wallet-image walletId="${i.id}"></w3m-wallet-image><div class="w3m-wallet-content"><w3m-text variant="medium-regular">${i.name}</w3m-text><w3m-button .iconRight="${Le.ARROW_RIGHT_ICON}" .onClick="${()=>this.onGet(i.links.universal)}">Get</w3m-button></div></div>`):null}</w3m-modal-content><div class="w3m-footer-actions"><w3m-text variant="medium-regular">Not what you're looking for?</w3m-text><w3m-text variant="small-thin" color="secondary" class="w3m-info-text">With hundreds of wallets out there, there's something for everyone</w3m-text><w3m-button .onClick="${xe.openWalletExplorerUrl}" .iconRight="${Le.ARROW_UP_RIGHT_ICON}">Explore Wallets</w3m-button></div>`}};Rf.styles=[Fe.globalCss,_A],Rf=CA([Re("w3m-get-wallet-view")],Rf);const IA=Ve`.w3m-footer-actions{display:flex;justify-content:center}.w3m-footer-actions w3m-button{margin:0 5px}.w3m-info-container{display:flex;flex-direction:column;justify-content:center;align-items:center;margin-bottom:20px}.w3m-info-container:last-child{margin-bottom:0}.w3m-info-text{margin-top:5px;text-align:center}.w3m-images svg{margin:0 2px 5px;width:55px;height:55px}.help-img-highlight{stroke:var(--w3m-color-overlay)}`;var SA=Object.defineProperty,AA=Object.getOwnPropertyDescriptor,OA=(t,e,r,n)=>{for(var i=n>1?void 0:n?AA(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&SA(e,r,i),i};let Lf=class extends $e{constructor(){super(...arguments),this.learnUrl="https://ethereum.org/en/wallets/"}onGet(){jt.state.enableExplorer?tt.push("GetWallet"):xe.openWalletExplorerUrl()}onLearnMore(){Se.openHref(this.learnUrl,"_blank")}render(){return oe`<w3m-modal-header title="What is a wallet?"></w3m-modal-header><w3m-modal-content><div class="w3m-info-container"><div class="w3m-images">${Le.HELP_CHART_IMG} ${Le.HELP_PAINTING_IMG} ${Le.HELP_ETH_IMG}</div><w3m-text variant="medium-regular">A home for your digital assets</w3m-text><w3m-text variant="small-thin" color="secondary" class="w3m-info-text">A wallet lets you store, send and receive digital assets like cryptocurrencies and NFTs.</w3m-text></div><div class="w3m-info-container"><div class="w3m-images">${Le.HELP_KEY_IMG} ${Le.HELP_USER_IMG} ${Le.HELP_LOCK_IMG}</div><w3m-text variant="medium-regular">One login for all of web3</w3m-text><w3m-text variant="small-thin" color="secondary" class="w3m-info-text">Log in to any app by connecting your wallet. Say goodbye to countless passwords!</w3m-text></div><div class="w3m-info-container"><div class="w3m-images">${Le.HELP_COMPAS_IMG} ${Le.HELP_NOUN_IMG} ${Le.HELP_DAO_IMG}</div><w3m-text variant="medium-regular">Your gateway to a new web</w3m-text><w3m-text variant="small-thin" color="secondary" class="w3m-info-text">With your wallet, you can explore and interact with DeFi, NFTs, DAOs, and much more.</w3m-text></div><div class="w3m-footer-actions"><w3m-button .onClick="${this.onGet.bind(this)}" .iconLeft="${Le.WALLET_ICON}">Get a Wallet</w3m-button><w3m-button .onClick="${this.onLearnMore.bind(this)}" .iconRight="${Le.ARROW_UP_RIGHT_ICON}">Learn More</w3m-button></div></w3m-modal-content>`}};Lf.styles=[Fe.globalCss,IA],Lf=OA([Re("w3m-help-view")],Lf);const DA=Ve`w3m-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}w3m-text{text-align:center}`;var $A=Object.defineProperty,PA=Object.getOwnPropertyDescriptor,dm=(t,e,r,n)=>{for(var i=n>1?void 0:n?PA(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&$A(e,r,i),i};let Kc=class extends $e{constructor(){super(),this.isError=!1,this.connector=Rt.client().getConnectorById("injected"),this.openInjectedApp()}async openInjectedApp(){const{ready:t}=this.connector;t&&(this.isError=!1,await xe.handleConnectorConnection("injected",()=>{this.isError=!0}))}render(){const{name:t,id:e,image_id:r}=Se.getWalletRouterData(),{isMobile:n,isDesktop:i,isWeb:o}=xe.getCachedRouterWalletPlatforms();return oe`<w3m-modal-header title="${t}"></w3m-modal-header><w3m-modal-content><w3m-connector-waiting walletId="${e}" imageId="${r}" label="${`Continue in ${t}...`}" .isError="${this.isError}"></w3m-connector-waiting></w3m-modal-content><w3m-info-footer><w3m-text color="secondary" variant="small-thin">Connection can be declined if multiple wallets are installed or previous request is still active</w3m-text><w3m-platform-selection .isMobile="${n}" .isDesktop="${i}" .isWeb="${o}" .isRetry="${!0}"><w3m-button .onClick="${this.openInjectedApp.bind(this)}" .disabled="${!this.isError}" .iconRight="${Le.RETRY_ICON}">Retry</w3m-button></w3m-platform-selection></w3m-info-footer>`}};Kc.styles=[Fe.globalCss,DA],dm([gt()],Kc.prototype,"isError",2),Kc=dm([Re("w3m-injected-connecting-view")],Kc);const TA=Ve`w3m-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}w3m-text{text-align:center}w3m-button{margin-top:15px}`;var NA=Object.defineProperty,RA=Object.getOwnPropertyDescriptor,LA=(t,e,r,n)=>{for(var i=n>1?void 0:n?RA(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&NA(e,r,i),i};let Mf=class extends $e{onInstall(t){t&&Se.openHref(t,"_blank")}render(){const{name:t,id:e,image_id:r,homepage:n}=Se.getWalletRouterData();return oe`<w3m-modal-header title="${t}"></w3m-modal-header><w3m-modal-content><w3m-connector-waiting walletId="${e}" imageId="${r}" label="Not Detected" .isStale="${!0}"></w3m-connector-waiting></w3m-modal-content><w3m-info-footer><w3m-text color="secondary" variant="small-thin">${`Download ${t} to continue. If multiple browser extensions are installed, disable non ${t} ones and try again`}</w3m-text><w3m-button .onClick="${()=>this.onInstall(n)}" .iconLeft="${Le.ARROW_DOWN_ICON}">Download</w3m-button></w3m-info-footer>`}};Mf.styles=[Fe.globalCss,TA],Mf=LA([Re("w3m-install-wallet-view")],Mf);const MA=Ve`w3m-wallet-image{border-radius:var(--w3m-wallet-icon-large-border-radius);width:96px;height:96px;margin-bottom:20px}w3m-info-footer{display:flex;width:100%}.w3m-app-store{justify-content:space-between}.w3m-app-store w3m-wallet-image{margin-right:10px;margin-bottom:0;width:28px;height:28px;border-radius:var(--w3m-wallet-icon-small-border-radius)}.w3m-app-store div{display:flex;align-items:center}.w3m-app-store w3m-button{margin-right:-10px}.w3m-note{flex-direction:column;align-items:center;padding:5px 0}.w3m-note w3m-text{text-align:center}w3m-platform-selection{margin-top:-15px}.w3m-note w3m-text{margin-top:15px}.w3m-note w3m-text span{color:var(--w3m-accent-color)}`;var UA=Object.defineProperty,jA=Object.getOwnPropertyDescriptor,pm=(t,e,r,n)=>{for(var i=n>1?void 0:n?jA(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&UA(e,r,i),i};let Gc=class extends $e{constructor(){super(),this.isError=!1,this.unwatchConnection=void 0,this.openMobileApp(),this.unwatchConnection=hr.subscribe(t=>{this.isError=t.pairingError})}disconnectedCallback(){var t;(t=this.unwatchConnection)==null||t.call(this)}onFormatAndRedirect(t,e=!1){const{mobile:r,name:n}=Se.getWalletRouterData(),i=r?.native,o=r?.universal;if(i&&!e){const c=Se.formatNativeUrl(i,t,n);Se.openHref(c,"_self")}else if(o){const c=Se.formatUniversalUrl(o,t,n);Se.openHref(c,"_self")}}openMobileApp(t=!1){hr.setPairingError(!1);const{standaloneUri:e}=De.state,{pairingUri:r}=hr.state,n=Se.getWalletRouterData();xe.setRecentWallet(n),e?this.onFormatAndRedirect(e,t):this.onFormatAndRedirect(r,t)}onGoToAppStore(t){t&&Se.openHref(t,"_blank")}render(){const{name:t,id:e,image_id:r,app:n,mobile:i}=Se.getWalletRouterData(),{isWeb:o}=xe.getCachedRouterWalletPlatforms(),c=n?.ios,l=i?.universal;return oe`<w3m-modal-header title="${t}"></w3m-modal-header><w3m-modal-content><w3m-connector-waiting walletId="${e}" imageId="${r}" label="Tap 'Open' to continue…" .isError="${this.isError}"></w3m-connector-waiting></w3m-modal-content><w3m-info-footer class="w3m-note"><w3m-platform-selection .isWeb="${o}" .isRetry="${!0}"><w3m-button .onClick="${()=>this.openMobileApp(!1)}" .iconRight="${Le.RETRY_ICON}">Retry</w3m-button></w3m-platform-selection>${l?oe`<w3m-text color="secondary" variant="small-thin">Still doesn't work? <span tabindex="0" @click="${()=>this.openMobileApp(!0)}">Try this alternate link</span></w3m-text>`:null}</w3m-info-footer><w3m-info-footer class="w3m-app-store"><div><w3m-wallet-image walletId="${e}" imageId="${r}"></w3m-wallet-image><w3m-text>${`Get ${t}`}</w3m-text></div><w3m-button .iconRight="${Le.ARROW_RIGHT_ICON}" .onClick="${()=>this.onGoToAppStore(c)}" variant="ghost">App Store</w3m-button></w3m-info-footer>`}};Gc.styles=[Fe.globalCss,MA],pm([gt()],Gc.prototype,"isError",2),Gc=pm([Re("w3m-mobile-connecting-view")],Gc);const FA=Ve`w3m-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}w3m-text{text-align:center}`;var BA=Object.defineProperty,kA=Object.getOwnPropertyDescriptor,HA=(t,e,r,n)=>{for(var i=n>1?void 0:n?kA(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&BA(e,r,i),i};let Uf=class extends $e{render(){const{name:t,id:e,image_id:r}=Se.getWalletRouterData(),{isInjected:n,isDesktop:i,isWeb:o}=xe.getCachedRouterWalletPlatforms();return oe`<w3m-modal-header title="${t}" .onAction="${xe.handleUriCopy}" .actionIcon="${Le.COPY_ICON}"></w3m-modal-header><w3m-modal-content><w3m-walletconnect-qr walletId="${e}" imageId="${r}"></w3m-walletconnect-qr></w3m-modal-content><w3m-info-footer><w3m-text color="secondary" variant="small-thin">${`Scan this QR Code with your phone's camera or inside ${t} app`}</w3m-text><w3m-platform-selection .isDesktop="${i}" .isInjected="${n}" .isWeb="${o}"></w3m-platform-selection></w3m-info-footer>`}};Uf.styles=[Fe.globalCss,FA],Uf=HA([Re("w3m-mobile-qr-connecting-view")],Uf);var zA=Object.defineProperty,WA=Object.getOwnPropertyDescriptor,qA=(t,e,r,n)=>{for(var i=n>1?void 0:n?WA(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&zA(e,r,i),i};let jf=class extends $e{render(){return oe`<w3m-modal-header title="Scan the code" .onAction="${xe.handleUriCopy}" .actionIcon="${Le.COPY_ICON}"></w3m-modal-header><w3m-modal-content><w3m-walletconnect-qr></w3m-walletconnect-qr></w3m-modal-content>`}};jf.styles=[Fe.globalCss],jf=qA([Re("w3m-qrcode-view")],jf);const VA=Ve`div{display:grid;grid-template-columns:repeat(4,80px);margin:-5px -10px;justify-content:space-between}w3m-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}w3m-info-footer w3m-text{text-align:center}`;var gm=Object.defineProperty,KA=Object.defineProperties,GA=Object.getOwnPropertyDescriptor,ZA=Object.getOwnPropertyDescriptors,mm=Object.getOwnPropertySymbols,YA=Object.prototype.hasOwnProperty,JA=Object.prototype.propertyIsEnumerable,wm=(t,e,r)=>e in t?gm(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,XA=(t,e)=>{for(var r in e||(e={}))YA.call(e,r)&&wm(t,r,e[r]);if(mm)for(var r of mm(e))JA.call(e,r)&&wm(t,r,e[r]);return t},QA=(t,e)=>KA(t,ZA(e)),Ff=(t,e,r,n)=>{for(var i=n>1?void 0:n?GA(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&gm(e,r,i),i};let ga=class extends $e{constructor(){super(),this.connectedChains="ALL",this.isUnsupportedChains=!1,this.getConnectedChainIds()}async getConnectedChainIds(){this.connectedChains=await Rt.client().getConnectedChainIds()}async onSelectChain(t){try{const{selectedChain:e,walletConnectVersion:r,isPreferInjected:n}=De.state,{isConnected:i}=Et.state;i?e?.id===t.id?tt.reset("Account"):r===2?(await Rt.client().switchNetwork({chainId:t.id}),tt.reset("Account")):tt.push("SwitchNetwork",{SwitchNetwork:t}):n?(De.setSelectedChain(t),Rr.close()):(De.setSelectedChain(t),tt.push("ConnectWallet"))}catch(e){console.error(e),Wr.openToast("Unsupported chain","error")}}isUnsuportedChainId(t){return typeof this.connectedChains=="string"&&this.connectedChains!=="ALL"?(this.isUnsupportedChains=!0,!0):Array.isArray(this.connectedChains)&&!this.connectedChains.includes(String(t))?(this.isUnsupportedChains=!0,!0):!1}render(){const{chains:t}=De.state,e=t?.map(n=>QA(XA({},n),{unsupported:this.isUnsuportedChainId(n.id)})),r=e?.sort((n,i)=>Number(n.unsupported)-Number(i.unsupported));return oe`<w3m-modal-header title="Select network"></w3m-modal-header><w3m-modal-content><div>${r?.map(n=>oe`<w3m-network-button name="${n.name}" chainId="${n.id}" .unsupported="${n.unsupported}" .onClick="${async()=>this.onSelectChain(n)}">${n.name}</w3m-network-button>`)}</div></w3m-modal-content>${this.isUnsupportedChains?oe`<w3m-info-footer><w3m-text color="secondary" variant="small-thin">Your connected wallet may not support some of the networks available for this dapp</w3m-text></w3m-info-footer>`:null}`}};ga.styles=[Fe.globalCss,VA],Ff([gt()],ga.prototype,"connectedChains",2),Ff([gt()],ga.prototype,"isUnsupportedChains",2),ga=Ff([Re("w3m-select-network-view")],ga);const eO=Ve`w3m-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}w3m-text{text-align:center}w3m-button{margin-top:15px}`;var tO=Object.defineProperty,rO=Object.getOwnPropertyDescriptor,vm=(t,e,r,n)=>{for(var i=n>1?void 0:n?rO(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&tO(e,r,i),i};let Zc=class extends $e{constructor(){super(),this.isError=!1,this.onSwitchNetwork()}async onSwitchNetwork(){try{this.isError=!1;const t=Se.getSwitchNetworkRouterData();await Rt.client().switchNetwork({chainId:t.id}),De.setSelectedChain(t),tt.reset("Account")}catch{this.isError=!0}}render(){const{id:t,name:e}=Se.getSwitchNetworkRouterData();return oe`<w3m-modal-header title="${`Connect to ${e}`}"></w3m-modal-header><w3m-modal-content><w3m-network-waiting chainId="${t}" label="Approve in your wallet" .isError="${this.isError}"></w3m-network-waiting></w3m-modal-content><w3m-info-footer><w3m-text color="secondary" variant="small-thin">Switch can be declined if chain is not supported by a wallet or previous request is still active</w3m-text><w3m-button .onClick="${this.onSwitchNetwork.bind(this)}" .disabled="${!this.isError}" .iconRight="${Le.RETRY_ICON}">Try Again</w3m-button></w3m-info-footer>`}};Zc.styles=[Fe.globalCss,eO],vm([gt()],Zc.prototype,"isError",2),Zc=vm([Re("w3m-switch-network-view")],Zc);const nO=Ve`w3m-modal-content{height:clamp(200px,60vh,600px);display:block;overflow:scroll;scrollbar-width:none;position:relative;margin-top:1px}.w3m-grid{display:grid;grid-template-columns:repeat(4,80px);justify-content:space-between;margin:-15px -10px;padding-top:20px}w3m-modal-content::after,w3m-modal-content::before{content:'';position:fixed;pointer-events:none;z-index:1;width:100%;height:20px;opacity:1}w3m-modal-content::before{box-shadow:0 -1px 0 0 var(--w3m-color-bg-1);background:linear-gradient(var(--w3m-color-bg-1),rgba(255,255,255,0))}w3m-modal-content::after{box-shadow:0 1px 0 0 var(--w3m-color-bg-1);background:linear-gradient(rgba(255,255,255,0),var(--w3m-color-bg-1));top:calc(100% - 20px)}w3m-modal-content::-webkit-scrollbar{display:none}.w3m-placeholder-block{display:flex;justify-content:center;align-items:center;height:100px;overflow:hidden}.w3m-empty,.w3m-loading{display:flex}.w3m-loading .w3m-placeholder-block{height:100%}.w3m-end-reached .w3m-placeholder-block{height:0;opacity:0}.w3m-empty .w3m-placeholder-block{opacity:1;height:100%}w3m-wallet-button{margin:calc((100% - 60px)/ 3) 0}`;var iO=Object.defineProperty,sO=Object.getOwnPropertyDescriptor,ma=(t,e,r,n)=>{for(var i=n>1?void 0:n?sO(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&iO(e,r,i),i};const Bf=40;let as=class extends $e{constructor(){super(...arguments),this.loading=!nr.state.wallets.listings.length,this.firstFetch=!nr.state.wallets.listings.length,this.search="",this.endReached=!1,this.intersectionObserver=void 0,this.searchDebounce=xe.debounce(t=>{t.length>=3?(this.firstFetch=!0,this.endReached=!1,this.search=t,nr.resetSearch(),this.fetchWallets()):this.search&&(this.search="",this.endReached=this.isLastPage(),nr.resetSearch())})}firstUpdated(){this.createPaginationObserver()}disconnectedCallback(){var t;(t=this.intersectionObserver)==null||t.disconnect()}get placeholderEl(){return xe.getShadowRootElement(this,".w3m-placeholder-block")}createPaginationObserver(){this.intersectionObserver=new IntersectionObserver(([t])=>{t.isIntersecting&&!(this.search&&this.firstFetch)&&this.fetchWallets()}),this.intersectionObserver.observe(this.placeholderEl)}isLastPage(){const{wallets:t,search:e}=nr.state,{listings:r,total:n}=this.search?e:t;return n<=Bf||r.length>=n}async fetchWallets(){var t;const{wallets:e,search:r,injectedWallets:n}=nr.state,{listings:i,total:o,page:c}=this.search?r:e;if(!this.endReached&&(this.firstFetch||o>Bf&&i.length<o))try{this.loading=!0;const l=(t=De.state.standaloneChains)==null?void 0:t.join(","),{listings:h}=await nr.getWallets({page:this.firstFetch?1:c+1,entries:Bf,search:this.search,version:De.state.walletConnectVersion,chains:l}),f=h.map(E=>xe.getWalletIcon(E)),v=n.map(E=>xe.getWalletIcon(E));await Promise.all([...f.map(async E=>xe.preloadImage(E)),...v.map(async E=>xe.preloadImage(E)),Se.wait(300)]),this.endReached=this.isLastPage()}catch(l){console.error(l),Wr.openToast(xe.getErrorMessage(l),"error")}finally{this.loading=!1,this.firstFetch=!1}}onConnect(t){Se.isAndroid()?xe.handleMobileLinking(t):xe.goToConnectingView(t)}onSearchChange(t){const{value:e}=t.target;this.searchDebounce(e)}render(){const{wallets:t,search:e}=nr.state,{listings:r}=this.search?e:t,n=this.loading&&!r.length,i=this.search.length>=3;let o=Mr.injectedWalletsTemplate(),c=Mr.manualWalletsTemplate(),l=Mr.recomendedWalletsTemplate(!0);i&&(o=o.filter(({values:E})=>xe.caseSafeIncludes(E[0],this.search)),c=c.filter(({values:E})=>xe.caseSafeIncludes(E[0],this.search)),l=l.filter(({values:E})=>xe.caseSafeIncludes(E[0],this.search)));const h=!this.loading&&!r.length&&!o.length&&!l.length,f=Math.max(o.length,r.length),v={"w3m-loading":n,"w3m-end-reached":this.endReached||!this.loading,"w3m-empty":h};return oe`<w3m-modal-header><w3m-search-input .onChange="${this.onSearchChange.bind(this)}"></w3m-search-input></w3m-modal-header><w3m-modal-content class="${Lr(v)}"><div class="w3m-grid">${n?null:l} ${n?null:[...Array(f)].map((E,_)=>oe`${c[_]} ${o[_]} ${r[_]?oe`<w3m-wallet-button imageId="${r[_].image_id}" name="${r[_].name}" walletId="${r[_].id}" .onClick="${()=>this.onConnect(r[_])}"></w3m-wallet-button>`:null}`)}</div><div class="w3m-placeholder-block">${h?oe`<w3m-text variant="big-bold" color="secondary">No results found</w3m-text>`:null} ${!h&&this.loading?oe`<w3m-spinner></w3m-spinner>`:null}</div></w3m-modal-content>`}};as.styles=[Fe.globalCss,nO],ma([gt()],as.prototype,"loading",2),ma([gt()],as.prototype,"firstFetch",2),ma([gt()],as.prototype,"search",2),ma([gt()],as.prototype,"endReached",2),as=ma([Re("w3m-wallet-explorer-view")],as);const oO=Ve`w3m-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}w3m-text{text-align:center}`;var aO=Object.defineProperty,cO=Object.getOwnPropertyDescriptor,ym=(t,e,r,n)=>{for(var i=n>1?void 0:n?cO(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&aO(e,r,i),i};let Yc=class extends $e{constructor(){super(),this.isError=!1,this.unwatchConnection=void 0,this.openWebWallet(),this.unwatchConnection=hr.subscribe(t=>{this.isError=t.pairingError})}disconnectedCallback(){var t;(t=this.unwatchConnection)==null||t.call(this)}onFormatAndRedirect(t){const{desktop:e,name:r}=Se.getWalletRouterData(),n=e?.universal;if(n){const i=Se.formatUniversalUrl(n,t,r);Se.openHref(i,"_blank")}}openWebWallet(){hr.setPairingError(!1);const{standaloneUri:t}=De.state,{pairingUri:e}=hr.state,r=Se.getWalletRouterData();xe.setRecentWallet(r),t?this.onFormatAndRedirect(t):this.onFormatAndRedirect(e)}render(){const{name:t,id:e,image_id:r}=Se.getWalletRouterData(),{isMobile:n,isInjected:i,isDesktop:o}=xe.getCachedRouterWalletPlatforms(),c=Se.isMobile();return oe`<w3m-modal-header title="${t}" .onAction="${xe.handleUriCopy}" .actionIcon="${Le.COPY_ICON}"></w3m-modal-header><w3m-modal-content><w3m-connector-waiting walletId="${e}" imageId="${r}" label="${`Continue in ${t}...`}" .isError="${this.isError}"></w3m-connector-waiting></w3m-modal-content><w3m-info-footer><w3m-text color="secondary" variant="small-thin">${`${t} web app has opened in a new tab. Go there, accept the connection, and come back`}</w3m-text><w3m-platform-selection .isMobile="${n}" .isInjected="${c?!1:i}" .isDesktop="${c?!1:o}" .isRetry="${!0}"><w3m-button .onClick="${this.openWebWallet.bind(this)}" .iconRight="${Le.RETRY_ICON}">Retry</w3m-button></w3m-platform-selection></w3m-info-footer>`}};Yc.styles=[Fe.globalCss,oO],ym([gt()],Yc.prototype,"isError",2),Yc=ym([Re("w3m-web-connecting-view")],Yc);var lO=Object.freeze({__proto__:null,get W3mAccountButton(){return Ks},get W3mConnectButton(){return is},get W3mCoreButton(){return Ii},get W3mModal(){return Ys},get W3mNetworkSwitch(){return ss},get W3mQrCode(){return Zn}});_n.EthereumProvider=ix,_n.OPTIONAL_EVENTS=Ng,_n.OPTIONAL_METHODS=Tg,_n.REQUIRED_EVENTS=hc,_n.REQUIRED_METHODS=uc,_n.default=dc,Object.defineProperty(_n,"__esModule",{value:!0})});
151
+ `);const c=UA(e,r,i),l=kc.getSymbolSize(e),h=new $A(l);return RA(h,e),NA(h),FA(h,e),Ef(h,r,0),e>=7&&LA(h,e),MA(h,c),isNaN(n)&&(n=yf.getBestMask(h,Ef.bind(null,h,r))),yf.applyMask(n,h),Ef(h,r,n),{modules:h,version:e,errorCorrectionLevel:r,maskPattern:n,segments:i}}Em.create=function(e,r){if(typeof e>"u"||e==="")throw new Error("No input text");let n=vf.M,i,o;return typeof r<"u"&&(n=vf.from(r.errorCorrectionLevel,vf.M),i=Hc.from(r.version),o=yf.from(r.maskPattern),r.toSJISFunc&&kc.setToSJISFunction(r.toSJISFunc)),BA(e,i,n,o)};var Mm={},xf={};(function(t){function e(r){if(typeof r=="number"&&(r=r.toString()),typeof r!="string")throw new Error("Color should be defined as hex string");let n=r.slice().replace("#","").split("");if(n.length<3||n.length===5||n.length>8)throw new Error("Invalid hex color: "+r);(n.length===3||n.length===4)&&(n=Array.prototype.concat.apply([],n.map(function(o){return[o,o]}))),n.length===6&&n.push("F","F");const i=parseInt(n.join(""),16);return{r:i>>24&255,g:i>>16&255,b:i>>8&255,a:i&255,hex:"#"+n.slice(0,6).join("")}}t.getOptions=function(n){n||(n={}),n.color||(n.color={});const i=typeof n.margin>"u"||n.margin===null||n.margin<0?4:n.margin,o=n.width&&n.width>=21?n.width:void 0,c=n.scale||4;return{width:o,scale:o?4:c,margin:i,color:{dark:e(n.color.dark||"#000000ff"),light:e(n.color.light||"#ffffffff")},type:n.type,rendererOpts:n.rendererOpts||{}}},t.getScale=function(n,i){return i.width&&i.width>=n+i.margin*2?i.width/(n+i.margin*2):i.scale},t.getImageWidth=function(n,i){const o=t.getScale(n,i);return Math.floor((n+i.margin*2)*o)},t.qrToImageData=function(n,i,o){const c=i.modules.size,l=i.modules.data,h=t.getScale(c,o),d=Math.floor((c+o.margin*2)*h),v=o.margin*h,x=[o.color.light,o.color.dark];for(let _=0;_<d;_++)for(let A=0;A<d;A++){let P=(_*d+A)*4,L=o.color.light;if(_>=v&&A>=v&&_<d-v&&A<d-v){const k=Math.floor((_-v)/h),q=Math.floor((A-v)/h);L=x[l[k*c+q]?1:0]}n[P++]=L.r,n[P++]=L.g,n[P++]=L.b,n[P]=L.a}}})(xf),function(t){const e=xf;function r(i,o,c){i.clearRect(0,0,o.width,o.height),o.style||(o.style={}),o.height=c,o.width=c,o.style.height=c+"px",o.style.width=c+"px"}function n(){try{return document.createElement("canvas")}catch{throw new Error("You need to specify a canvas element")}}t.render=function(o,c,l){let h=l,d=c;typeof h>"u"&&(!c||!c.getContext)&&(h=c,c=void 0),c||(d=n()),h=e.getOptions(h);const v=e.getImageWidth(o.modules.size,h),x=d.getContext("2d"),_=x.createImageData(v,v);return e.qrToImageData(_.data,o,h),r(x,d,v),x.putImageData(_,0,0),d},t.renderToDataURL=function(o,c,l){let h=l;typeof h>"u"&&(!c||!c.getContext)&&(h=c,c=void 0),h||(h={});const d=t.render(o,c,h),v=h.type||"image/png",x=h.rendererOpts||{};return d.toDataURL(v,x.quality)}}(Mm);var Um={};const kA=xf;function jm(t,e){const r=t.a/255,n=e+'="'+t.hex+'"';return r<1?n+" "+e+'-opacity="'+r.toFixed(2).slice(1)+'"':n}function Cf(t,e,r){let n=t+e;return typeof r<"u"&&(n+=" "+r),n}function HA(t,e,r){let n="",i=0,o=!1,c=0;for(let l=0;l<t.length;l++){const h=Math.floor(l%e),d=Math.floor(l/e);!h&&!o&&(o=!0),t[l]?(c++,l>0&&h>0&&t[l-1]||(n+=o?Cf("M",h+r,.5+d+r):Cf("m",i,0),i=0,o=!1),h+1<e&&t[l+1]||(n+=Cf("h",c),c=0)):i++}return n}Um.render=function(e,r,n){const i=kA.getOptions(r),o=e.modules.size,c=e.modules.data,l=o+i.margin*2,h=i.color.light.a?"<path "+jm(i.color.light,"fill")+' d="M0 0h'+l+"v"+l+'H0z"/>':"",d="<path "+jm(i.color.dark,"stroke")+' d="'+HA(c,o,i.margin)+'"/>',v='viewBox="0 0 '+l+" "+l+'"',_='<svg xmlns="http://www.w3.org/2000/svg" '+(i.width?'width="'+i.width+'" height="'+i.width+'" ':"")+v+' shape-rendering="crispEdges">'+h+d+`</svg>
152
+ `;return typeof n=="function"&&n(null,_),_};const zA=nA,If=Em,Bm=Mm,WA=Um;function Af(t,e,r,n,i){const o=[].slice.call(arguments,1),c=o.length,l=typeof o[c-1]=="function";if(!l&&!zA())throw new Error("Callback required as last argument");if(l){if(c<2)throw new Error("Too few arguments provided");c===2?(i=r,r=e,e=n=void 0):c===3&&(e.getContext&&typeof i>"u"?(i=n,n=void 0):(i=n,n=r,r=e,e=void 0))}else{if(c<1)throw new Error("Too few arguments provided");return c===1?(r=e,e=n=void 0):c===2&&!e.getContext&&(n=r,r=e,e=void 0),new Promise(function(h,d){try{const v=If.create(r,n);h(t(v,e,n))}catch(v){d(v)}})}try{const h=If.create(r,n);i(null,t(h,e,n))}catch(h){i(h)}}la.create=If.create,la.toCanvas=Af.bind(null,Bm.render),la.toDataURL=Af.bind(null,Bm.renderToDataURL),la.toString=Af.bind(null,function(t,e,r){return WA.render(t,r)});var qA=Object.defineProperty,km=Object.getOwnPropertySymbols,VA=Object.prototype.hasOwnProperty,KA=Object.prototype.propertyIsEnumerable,Hm=(t,e,r)=>e in t?qA(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,zc=(t,e)=>{for(var r in e||(e={}))VA.call(e,r)&&Hm(t,r,e[r]);if(km)for(var r of km(e))KA.call(e,r)&&Hm(t,r,e[r]);return t};function GA(){var t;const e=(t=Un.state.themeMode)!=null?t:"dark",r={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{"--w3m-color-fg-1":r.foreground[1],"--w3m-color-fg-2":r.foreground[2],"--w3m-color-fg-3":r.foreground[3],"--w3m-color-bg-1":r.background[1],"--w3m-color-bg-2":r.background[2],"--w3m-color-bg-3":r.background[3],"--w3m-color-overlay":r.overlay}}function zm(){return{"--w3m-accent-color":"#3396FF","--w3m-accent-fill-color":"#FFFFFF","--w3m-z-index":"89","--w3m-background-color":"#3396FF","--w3m-background-border-radius":"8px","--w3m-container-border-radius":"30px","--w3m-wallet-icon-border-radius":"15px","--w3m-wallet-icon-large-border-radius":"30px","--w3m-wallet-icon-small-border-radius":"7px","--w3m-input-border-radius":"28px","--w3m-button-border-radius":"10px","--w3m-notification-border-radius":"36px","--w3m-secondary-button-border-radius":"28px","--w3m-icon-button-border-radius":"50%","--w3m-button-hover-highlight-border-radius":"10px","--w3m-text-big-bold-size":"20px","--w3m-text-big-bold-weight":"600","--w3m-text-big-bold-line-height":"24px","--w3m-text-big-bold-letter-spacing":"-0.03em","--w3m-text-big-bold-text-transform":"none","--w3m-text-xsmall-bold-size":"10px","--w3m-text-xsmall-bold-weight":"700","--w3m-text-xsmall-bold-line-height":"12px","--w3m-text-xsmall-bold-letter-spacing":"0.02em","--w3m-text-xsmall-bold-text-transform":"uppercase","--w3m-text-xsmall-regular-size":"12px","--w3m-text-xsmall-regular-weight":"600","--w3m-text-xsmall-regular-line-height":"14px","--w3m-text-xsmall-regular-letter-spacing":"-0.03em","--w3m-text-xsmall-regular-text-transform":"none","--w3m-text-small-thin-size":"14px","--w3m-text-small-thin-weight":"500","--w3m-text-small-thin-line-height":"16px","--w3m-text-small-thin-letter-spacing":"-0.03em","--w3m-text-small-thin-text-transform":"none","--w3m-text-small-regular-size":"14px","--w3m-text-small-regular-weight":"600","--w3m-text-small-regular-line-height":"16px","--w3m-text-small-regular-letter-spacing":"-0.03em","--w3m-text-small-regular-text-transform":"none","--w3m-text-medium-regular-size":"16px","--w3m-text-medium-regular-weight":"600","--w3m-text-medium-regular-line-height":"20px","--w3m-text-medium-regular-letter-spacing":"-0.03em","--w3m-text-medium-regular-text-transform":"none","--w3m-font-family":"-apple-system, system-ui, BlinkMacSystemFont, 'Segoe UI', Roboto, Ubuntu, 'Helvetica Neue', sans-serif","--w3m-success-color":"rgb(38,181,98)","--w3m-error-color":"rgb(242, 90, 103)"}}function ZA(){const{themeVariables:t}=Un.state;return{"--w3m-background-image-url":t!=null&&t["--w3m-background-image-url"]?`url(${t["--w3m-background-image-url"]})`:"none"}}const je={getPreset(t){return zm()[t]},setTheme(){const t=document.querySelector(":root"),{themeVariables:e}=Un.state;if(t){const r=zc(zc(zc(zc({},GA()),zm()),e),ZA());Object.entries(r).forEach(([n,i])=>t.style.setProperty(n,i))}},globalCss:Ve`*,::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 w3m-text{position:relative;z-index:1}input{border:none;outline:0;appearance:none}img{display:block}::selection{color:var(--w3m-accent-fill-color);background:var(--w3m-accent-color)}`},YA=Ve`button{display:flex;border-radius:var(--w3m-button-hover-highlight-border-radius);flex-direction:column;justify-content:center;padding:5px;width:100px}button:active{background-color:var(--w3m-color-overlay)}@media(hover:hover){button:hover{background-color:var(--w3m-color-overlay)}}button>div{display:flex;justify-content:center;align-items:center;width:32px;height:32px;box-shadow:inset 0 0 0 1px var(--w3m-color-overlay);background-color:var(--w3m-accent-color);border-radius:var(--w3m-icon-button-border-radius);margin-bottom:4px}button path{fill:var(--w3m-accent-fill-color)}`;var JA=Object.defineProperty,XA=Object.getOwnPropertyDescriptor,Wc=(t,e,r,n)=>{for(var i=n>1?void 0:n?XA(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&JA(e,r,i),i};let Vs=class extends Pe{constructor(){super(...arguments),this.icon=void 0,this.label="",this.onClick=()=>null}render(){return oe`<button @click="${this.onClick}"><div>${this.icon}</div><w3m-text variant="xsmall-regular" color="accent">${this.label}</w3m-text></button>`}};Vs.styles=[je.globalCss,YA],Wc([$e()],Vs.prototype,"icon",2),Wc([$e()],Vs.prototype,"label",2),Wc([$e()],Vs.prototype,"onClick",2),Vs=Wc([Ne("w3m-box-button")],Vs);const QA=Ve`button{border-radius:var(--w3m-secondary-button-border-radius);height:28px;padding:0 10px;background-color:var(--w3m-accent-color)}button path{fill:var(--w3m-accent-fill-color)}button::after{border-radius:inherit;border:1px solid var(--w3m-color-overlay)}button:disabled::after{background-color:transparent}.w3m-icon-left svg{margin-right:5px}.w3m-icon-right svg{margin-left:5px}button:active::after{background-color:var(--w3m-color-overlay)}.w3m-ghost,.w3m-ghost:active::after,.w3m-outline{background-color:transparent}.w3m-ghost:active{opacity:.5}@media(hover:hover){button:hover::after{background-color:var(--w3m-color-overlay)}.w3m-ghost:hover::after{background-color:transparent}.w3m-ghost:hover{opacity:.5}}button:disabled{background-color:var(--w3m-color-bg-3);pointer-events:none}.w3m-ghost::after{border-color:transparent}.w3m-ghost path{fill:var(--w3m-color-fg-2)}.w3m-outline path{fill:var(--w3m-accent-color)}.w3m-outline:disabled{background-color:transparent;opacity:.5}`;var e$=Object.defineProperty,t$=Object.getOwnPropertyDescriptor,Ks=(t,e,r,n)=>{for(var i=n>1?void 0:n?t$(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&e$(e,r,i),i};let xi=class extends Pe{constructor(){super(...arguments),this.disabled=!1,this.iconLeft=void 0,this.iconRight=void 0,this.onClick=()=>null,this.variant="default"}render(){const t={"w3m-icon-left":this.iconLeft!==void 0,"w3m-icon-right":this.iconRight!==void 0,"w3m-ghost":this.variant==="ghost","w3m-outline":this.variant==="outline"};let e="inverse";return this.variant==="ghost"&&(e="secondary"),this.variant==="outline"&&(e="accent"),oe`<button class="${Lr(t)}" ?disabled="${this.disabled}" @click="${this.onClick}">${this.iconLeft}<w3m-text variant="small-regular" color="${e}"><slot></slot></w3m-text>${this.iconRight}</button>`}};xi.styles=[je.globalCss,QA],Ks([$e()],xi.prototype,"disabled",2),Ks([$e()],xi.prototype,"iconLeft",2),Ks([$e()],xi.prototype,"iconRight",2),Ks([$e()],xi.prototype,"onClick",2),Ks([$e()],xi.prototype,"variant",2),xi=Ks([Ne("w3m-button")],xi);const r$=Ve`:host{display:inline-block}button{padding:0 15px 1px;height:40px;border-radius:var(--w3m-button-border-radius);color:var(--w3m-accent-fill-color);background-color:var(--w3m-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(--w3m-color-overlay)}button:active::after{background-color:var(--w3m-color-overlay)}button:disabled{padding-bottom:0;background-color:var(--w3m-color-bg-3);color:var(--w3m-color-fg-3)}.w3m-secondary{color:var(--w3m-accent-color);background-color:transparent}.w3m-secondary::after{display:none}@media(hover:hover){button:hover::after{background-color:var(--w3m-color-overlay)}}`;var n$=Object.defineProperty,i$=Object.getOwnPropertyDescriptor,$f=(t,e,r,n)=>{for(var i=n>1?void 0:n?i$(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&n$(e,r,i),i};let da=class extends Pe{constructor(){super(...arguments),this.disabled=!1,this.variant="primary"}render(){const t={"w3m-secondary":this.variant==="secondary"};return oe`<button ?disabled="${this.disabled}" class="${Lr(t)}"><slot></slot></button>`}};da.styles=[je.globalCss,r$],$f([$e()],da.prototype,"disabled",2),$f([$e()],da.prototype,"variant",2),da=$f([Ne("w3m-button-big")],da);const s$=Ve`:host{background-color:var(--w3m-color-bg-2);border-top:1px solid var(--w3m-color-bg-3)}div{padding:10px 20px;display:inherit;flex-direction:inherit;align-items:inherit;width:inherit;justify-content:inherit}`;var o$=Object.defineProperty,a$=Object.getOwnPropertyDescriptor,c$=(t,e,r,n)=>{for(var i=n>1?void 0:n?a$(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&o$(e,r,i),i};let Of=class extends Pe{render(){return oe`<div><slot></slot></div>`}};Of.styles=[je.globalCss,s$],Of=c$([Ne("w3m-info-footer")],Of);const Fe={CROSS_ICON:ut`<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:ut`<svg width="178" height="29" viewBox="0 0 178 29" id="w3m-wc-logo"><path d="M10.683 7.926c5.284-5.17 13.85-5.17 19.134 0l.636.623a.652.652 0 0 1 0 .936l-2.176 2.129a.343.343 0 0 1-.478 0l-.875-.857c-3.686-3.607-9.662-3.607-13.348 0l-.937.918a.343.343 0 0 1-.479 0l-2.175-2.13a.652.652 0 0 1 0-.936l.698-.683Zm23.633 4.403 1.935 1.895a.652.652 0 0 1 0 .936l-8.73 8.543a.687.687 0 0 1-.956 0L20.37 17.64a.172.172 0 0 0-.239 0l-6.195 6.063a.687.687 0 0 1-.957 0l-8.73-8.543a.652.652 0 0 1 0-.936l1.936-1.895a.687.687 0 0 1 .957 0l6.196 6.064a.172.172 0 0 0 .239 0l6.195-6.064a.687.687 0 0 1 .957 0l6.196 6.064a.172.172 0 0 0 .24 0l6.195-6.064a.687.687 0 0 1 .956 0ZM48.093 20.948l2.338-9.355c.139-.515.258-1.07.416-1.942.12.872.258 1.427.357 1.942l2.022 9.355h4.181l3.528-13.874h-3.21l-1.943 8.523a24.825 24.825 0 0 0-.456 2.457c-.158-.931-.317-1.625-.495-2.438l-1.883-8.542h-4.201l-2.042 8.542a41.204 41.204 0 0 0-.475 2.438 41.208 41.208 0 0 0-.476-2.438l-1.903-8.542h-3.349l3.508 13.874h4.083ZM63.33 21.304c1.585 0 2.596-.654 3.11-1.605-.059.297-.078.595-.078.892v.357h2.655V15.22c0-2.735-1.248-4.32-4.3-4.32-2.636 0-4.36 1.466-4.52 3.487h2.914c.1-.891.734-1.426 1.705-1.426.911 0 1.407.515 1.407 1.11 0 .435-.258.693-1.03.792l-1.388.159c-2.061.257-3.825 1.01-3.825 3.19 0 1.982 1.645 3.092 3.35 3.092Zm.891-2.041c-.773 0-1.348-.436-1.348-1.19 0-.733.655-1.09 1.645-1.268l.674-.119c.575-.118.892-.218 1.09-.396v.912c0 1.228-.892 2.06-2.06 2.06ZM70.398 7.074v13.874h2.874V7.074h-2.874ZM74.934 7.074v13.874h2.874V7.074h-2.874ZM84.08 21.304c2.735 0 4.5-1.546 4.697-3.567h-2.893c-.139.892-.892 1.387-1.804 1.387-1.228 0-2.12-.99-2.14-2.358h6.897v-.555c0-3.21-1.764-5.312-4.816-5.312-2.933 0-4.994 2.062-4.994 5.173 0 3.37 2.12 5.232 5.053 5.232Zm-2.16-6.421c.119-1.11.932-1.922 2.081-1.922 1.11 0 1.883.772 1.903 1.922H81.92ZM94.92 21.146c.633 0 1.248-.1 1.525-.179v-2.18c-.218.04-.475.06-.693.06-1.05 0-1.427-.595-1.427-1.566v-3.805h2.338v-2.24h-2.338V7.788H91.47v3.448H89.37v2.24h2.1v4.201c0 2.3 1.15 3.469 3.45 3.469ZM104.62 21.304c3.924 0 6.302-2.299 6.599-5.608h-3.111c-.238 1.803-1.506 3.032-3.369 3.032-2.2 0-3.746-1.784-3.746-4.796 0-2.953 1.605-4.638 3.805-4.638 1.883 0 2.953 1.15 3.171 2.834h3.191c-.317-3.448-2.854-5.41-6.342-5.41-3.984 0-7.036 2.695-7.036 7.214 0 4.677 2.676 7.372 6.838 7.372ZM117.449 21.304c2.993 0 5.114-1.882 5.114-5.172 0-3.23-2.121-5.233-5.114-5.233-2.972 0-5.093 2.002-5.093 5.233 0 3.29 2.101 5.172 5.093 5.172Zm0-2.22c-1.327 0-2.18-1.09-2.18-2.952 0-1.903.892-2.973 2.18-2.973 1.308 0 2.2 1.07 2.2 2.973 0 1.862-.872 2.953-2.2 2.953ZM126.569 20.948v-5.689c0-1.208.753-2.1 1.823-2.1 1.011 0 1.606.773 1.606 2.06v5.729h2.873v-6.144c0-2.339-1.229-3.905-3.428-3.905-1.526 0-2.458.734-2.953 1.606a5.31 5.31 0 0 0 .079-.892v-.377h-2.874v9.712h2.874ZM137.464 20.948v-5.689c0-1.208.753-2.1 1.823-2.1 1.011 0 1.606.773 1.606 2.06v5.729h2.873v-6.144c0-2.339-1.228-3.905-3.428-3.905-1.526 0-2.458.734-2.953 1.606a5.31 5.31 0 0 0 .079-.892v-.377h-2.874v9.712h2.874ZM149.949 21.304c2.735 0 4.499-1.546 4.697-3.567h-2.893c-.139.892-.892 1.387-1.804 1.387-1.228 0-2.12-.99-2.14-2.358h6.897v-.555c0-3.21-1.764-5.312-4.816-5.312-2.933 0-4.994 2.062-4.994 5.173 0 3.37 2.12 5.232 5.053 5.232Zm-2.16-6.421c.119-1.11.932-1.922 2.081-1.922 1.11 0 1.883.772 1.903 1.922h-3.984ZM160.876 21.304c3.013 0 4.658-1.645 4.975-4.201h-2.874c-.099 1.07-.713 1.982-2.001 1.982-1.309 0-2.2-1.21-2.2-2.993 0-1.942 1.03-2.933 2.259-2.933 1.209 0 1.803.872 1.883 1.882h2.873c-.218-2.358-1.823-4.142-4.776-4.142-2.874 0-5.153 1.903-5.153 5.193 0 3.25 1.923 5.212 5.014 5.212ZM172.067 21.146c.634 0 1.248-.1 1.526-.179v-2.18c-.218.04-.476.06-.694.06-1.05 0-1.427-.595-1.427-1.566v-3.805h2.339v-2.24h-2.339V7.788h-2.854v3.448h-2.1v2.24h2.1v4.201c0 2.3 1.15 3.469 3.449 3.469Z" fill="#fff"/></svg>`,WALLET_CONNECT_ICON:ut`<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:ut`<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:ut`<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:ut`<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:ut`<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:ut`<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:ut`<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:ut`<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:ut`<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:ut`<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:ut`<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:ut`<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:ut`<svg width="13" height="12" viewBox="0 0 13 12"><path fill-rule="evenodd" clip-rule="evenodd" d="M12.155.132a.75.75 0 0 1 .232 1.035L5.821 11.535a1 1 0 0 1-1.626.09L.665 7.21a.75.75 0 1 1 1.17-.937L4.71 9.867a.25.25 0 0 0 .406-.023L11.12.364a.75.75 0 0 1 1.035-.232Z" fill="#fff"/></svg>`,HELP_ETH_IMG:ut`<svg width="60" height="60" fill="none" viewBox="0 0 60 60"><g clip-path="url(#j)"><rect width="60" height="60" rx="30" fill="#987DE8"/><path fill-rule="evenodd" clip-rule="evenodd" d="m15.48 28.367 11.966-19.3c1.174-1.892 3.927-1.892 5.1 0l11.97 19.306a6 6 0 0 1 .9 3.142v.028a6 6 0 0 1-1.154 3.56L33.227 50.208c-1.599 2.188-4.864 2.188-6.461 0L15.733 35.095a6 6 0 0 1-1.154-3.538v-.029a6 6 0 0 1 .9-3.161Z" fill="#fff"/><path d="M30.84 10.112a.992.992 0 0 0-.844-.464V24.5l12.598 5.53c.081-.466-.001-.963-.27-1.398L30.84 10.112Z" fill="#643CDD"/><path d="M29.996 9.648a.991.991 0 0 0-.845.465l-11.489 18.53a1.991 1.991 0 0 0-.264 1.387l12.598-5.53V9.648Z" fill="#BDADEB"/><path d="M29.996 50.544a.994.994 0 0 0 .808-.41l11.235-15.38c.307-.434-.193-.988-.658-.72L31.49 39.71a2.998 2.998 0 0 1-1.494.398v10.437Z" fill="#643CDD"/><path d="M17.966 34.762 29.19 50.134c.2.274.503.41.807.41V40.108a2.998 2.998 0 0 1-1.493-.398l-9.884-5.676c-.468-.27-.971.292-.653.728Z" fill="#BDADEB"/><path d="M42.594 30.03 29.996 24.5v13.138a3 3 0 0 0 1.495-.399l10.149-5.83c.525-.31.856-.823.954-1.38Z" fill="#401AB3"/><path d="M29.996 37.638V24.462l-12.598 5.566c.098.564.437 1.083.974 1.392l10.13 5.82c.462.265.978.398 1.494.398Z" fill="#7C5AE2"/></g><rect class="help-img-highlight" x=".5" y=".5" width="59" height="59" rx="29.5"/><defs><clipPath id="j"><rect width="60" height="60" rx="30" fill="#fff"/></clipPath></defs></svg>`,HELP_PAINTING_IMG:ut`<svg width="60" height="60" fill="none" viewBox="0 0 60 60"><g clip-path="url(#k)"><rect width="60" height="60" rx="3" fill="#C653C6"/><path d="M52.094 47.344c0-4.246-1.436-9.557-5.885-12.4a2.876 2.876 0 0 0-1.615-3.891v-.819a4.037 4.037 0 0 0-1.34-3.007 4.75 4.75 0 0 0-2.41-6.252v-5.506c0-6.248-5.065-11.313-11.313-11.313-6.247 0-11.312 5.065-11.312 11.313v2.152a3.343 3.343 0 0 0-1.18 5.045 4.738 4.738 0 0 0-1.633 3.584 4.73 4.73 0 0 0 .956 2.858 5.218 5.218 0 0 0-2.358 6.815c-3.06 4.129-6.098 8.298-6.098 15.64 0 2.668.364 4.856.731 6.385.184.765.368 1.366.509 1.78a12.721 12.721 0 0 0 .225.611l.015.037.005.011.001.004v.002h.001l.92-.393-.92.394.26.606h38.26l.291-.49-.86-.51.86.51v-.001l.002-.002.002-.005.01-.017.035-.06.127-.225c.108-.195.26-.477.441-.835.363-.714.845-1.732 1.328-2.953.959-2.427 1.945-5.725 1.945-9.068Z" fill="#E87DE8" stroke="#fff" stroke-width="2"/><path fill-rule="evenodd" clip-rule="evenodd" d="M26.5 29.5c-3-.5-5.5-3-5.503-7l.002-7c0-.466 0-.698.026-.893a3 3 0 0 1 2.582-2.582c.195-.026.428-.026.893-.026 2 0 2.5-2.5 2.5-2.5s0 2.5 2.5 2.5c1.398 0 2.097 0 2.648.229a3 3 0 0 1 1.624 1.623c.228.552.228 1.25.228 2.649v6c0 4-3 7-6.5 7 1.35.23 4 0 6.5-2v9.53C34 38.5 31.495 40 28 40s-6-1.5-6-2.97L24 34l2.5 1.5v-6ZM26 47h4.5c2.5 0 3 4 3 5.5h-3l-1-1.5H26v-4Zm-6.25 5.5H24V57h-8c0-1 1-4.5 3.75-4.5Z" fill="#fff"/></g><rect class="help-img-highlight" x=".5" y=".5" width="59" height="59" rx="2.5"/><defs><clipPath id="k"><rect width="60" height="60" rx="3" fill="#fff"/></clipPath></defs></svg>`,HELP_CHART_IMG:ut`<svg width="60" height="60" fill="none" viewBox="0 0 60 60"><g clip-path="url(#l)"><path d="M0 25.01C0 15.76 0 11.133 1.97 7.678a15 15 0 0 1 5.598-5.597C11.023.11 15.648.11 24.9.11h10.2c9.251 0 13.877 0 17.332 1.97a15 15 0 0 1 5.597 5.597C60 11.133 60 15.758 60 25.01v10.2c0 9.252 0 13.877-1.97 17.332a15 15 0 0 1-5.598 5.598c-3.455 1.97-8.08 1.97-17.332 1.97H24.9c-9.251 0-13.877 0-17.332-1.97a14.999 14.999 0 0 1-5.597-5.598C0 49.087 0 44.462 0 35.21v-10.2Z" fill="#1DC956"/><path d="M.5 25.01c0-4.635 0-8.078.244-10.795.244-2.71.726-4.65 1.66-6.289a14.5 14.5 0 0 1 5.412-5.41c1.639-.936 3.579-1.418 6.289-1.661C16.822.61 20.265.61 24.9.61h10.2c4.635 0 8.078 0 10.795.245 2.71.243 4.65.725 6.29 1.66a14.5 14.5 0 0 1 5.41 5.411c.935 1.64 1.417 3.579 1.66 6.29.244 2.717.245 6.16.245 10.794v10.2c0 4.635 0 8.078-.244 10.795-.244 2.71-.726 4.65-1.66 6.29a14.5 14.5 0 0 1-5.412 5.41c-1.639.936-3.579 1.418-6.289 1.661-2.717.244-6.16.244-10.795.244H24.9c-4.635 0-8.078 0-10.795-.244-2.71-.243-4.65-.725-6.29-1.66a14.5 14.5 0 0 1-5.41-5.412C1.47 50.655.988 48.716.745 46.005.5 43.288.5 39.845.5 35.21v-10.2Z" stroke="#fff" stroke-opacity=".1"/><path d="M16.109 60c-3.833-.179-6.41-.645-8.541-1.86a15 15 0 0 1-5.598-5.598C.553 50.057.155 46.967.043 41.985l4.146-1.382a4 4 0 0 0 2.48-2.39l4.654-12.409a2 2 0 0 1 2.505-1.195l2.526.842a2 2 0 0 0 2.422-1.003l2.968-5.938c.81-1.62 3.185-1.415 3.705.32l3.774 12.581a2 2 0 0 0 3.025 1.09l3.342-2.228c.27-.18.49-.422.646-.706l5.297-9.712a2 2 0 0 1 1.428-1.016l4.134-.689a2 2 0 0 1 1.61.437l3.892 3.243a2 2 0 0 0 2.694-.122l4.633-4.632C60 19.28 60 21.88 60 25.01v10.2c0 9.252 0 13.877-1.97 17.332a14.998 14.998 0 0 1-5.598 5.598c-2.131 1.215-4.708 1.681-8.54 1.86H16.108Z" fill="#2BEE6C"/><path d="M.072 43.03a112.37 112.37 0 0 1-.048-2.093l3.85-1.283a3 3 0 0 0 1.86-1.793l4.653-12.408a3 3 0 0 1 3.758-1.793l2.526.842a1 1 0 0 0 1.21-.501l2.97-5.938c1.214-2.43 4.775-2.123 5.556.48l3.774 12.58a1 1 0 0 0 1.513.545l3.341-2.227a1 1 0 0 0 .323-.353l5.298-9.712a3 3 0 0 1 2.14-1.523l4.135-.69a3 3 0 0 1 2.414.655l3.892 3.244a1 1 0 0 0 1.347-.061l5.28-5.28c.046.845.077 1.752.097 2.732l-3.962 3.962a3 3 0 0 1-4.042.183l-3.893-3.243a1 1 0 0 0-.804-.218l-4.135.689a1 1 0 0 0-.714.507l-5.297 9.712c-.233.427-.565.79-.97 1.06l-3.34 2.228a3 3 0 0 1-4.538-1.635l-3.775-12.58c-.26-.868-1.447-.97-1.852-.16l-2.969 5.937a3 3 0 0 1-3.632 1.505l-2.526-.842a1 1 0 0 0-1.252.597L7.606 38.564a5 5 0 0 1-3.1 2.988L.072 43.029Z" fill="#fff"/><path fill-rule="evenodd" clip-rule="evenodd" d="M49.5 19a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0Z" fill="#2BEE6C"/><path d="M47.5 19a3.5 3.5 0 1 1-7 0 3.5 3.5 0 0 1 7 0Z" fill="#fff"/><path d="M45 .283v59.654c-.63.042-1.294.074-2 .098V.185c.706.025 1.37.056 2 .098Z" fill="#fff"/><path class="help-img-highlight" d="M.5 25.01c0-4.635 0-8.078.244-10.795.244-2.71.726-4.65 1.66-6.289a14.5 14.5 0 0 1 5.412-5.41c1.639-.936 3.579-1.418 6.289-1.661C16.822.61 20.265.61 24.9.61h10.2c4.635 0 8.078 0 10.795.245 2.71.243 4.65.725 6.29 1.66a14.5 14.5 0 0 1 5.41 5.411c.935 1.64 1.417 3.579 1.66 6.29.244 2.717.245 6.16.245 10.794v10.2c0 4.635 0 8.078-.244 10.795-.244 2.71-.726 4.65-1.66 6.29a14.5 14.5 0 0 1-5.412 5.41c-1.639.936-3.579 1.418-6.289 1.661-2.717.244-6.16.244-10.795.244H24.9c-4.635 0-8.078 0-10.795-.244-2.71-.243-4.65-.725-6.29-1.66a14.5 14.5 0 0 1-5.41-5.412C1.47 50.655.988 48.716.745 46.005.5 43.288.5 39.845.5 35.21v-10.2Z"/></g><defs><clipPath id="l"><path fill="#fff" d="M0 0h60v60H0z"/></clipPath></defs></svg>`,HELP_KEY_IMG:ut`<svg width="60" height="60" fill="none" viewBox="0 0 60 60"><g clip-path="url(#m)"><path fill="#EB8B47" d="M0 24.9c0-9.252 0-13.878 1.97-17.332A15 15 0 0 1 7.569 1.97C11.023 0 15.648 0 24.9 0h10.2c9.251 0 13.877 0 17.332 1.97a15 15 0 0 1 5.597 5.598C60 11.022 60 15.648 60 24.899v10.2c0 9.252 0 13.878-1.97 17.332a15.001 15.001 0 0 1-5.598 5.598c-3.455 1.97-8.08 1.97-17.332 1.97H24.9c-9.251 0-13.877 0-17.332-1.97a15 15 0 0 1-5.597-5.598C0 48.977 0 44.351 0 35.1V24.9Z"/><path class="help-img-highlight" d="M.5 24.9c0-4.635 0-8.078.244-10.795.244-2.71.726-4.65 1.66-6.29a14.5 14.5 0 0 1 5.412-5.41C9.455 1.468 11.395.986 14.105.743 16.822.5 20.265.5 24.9.5h10.2c4.635 0 8.078 0 10.795.244 2.71.243 4.65.725 6.29 1.66a14.5 14.5 0 0 1 5.41 5.411c.935 1.64 1.417 3.58 1.66 6.29.244 2.717.245 6.16.245 10.794v10.2c0 4.635 0 8.078-.244 10.796-.244 2.71-.726 4.65-1.66 6.289a14.5 14.5 0 0 1-5.412 5.41c-1.639.936-3.579 1.418-6.289 1.661-2.717.244-6.16.244-10.795.244H24.9c-4.635 0-8.078 0-10.795-.244-2.71-.243-4.65-.725-6.29-1.66a14.5 14.5 0 0 1-5.41-5.411c-.935-1.64-1.417-3.58-1.66-6.29C.5 43.178.5 39.734.5 35.1V24.9Z"/><path fill="#FF974C" stroke="#fff" stroke-width="2" d="M39.192 29.192c5.077-5.077 5.077-13.308 0-18.385-5.076-5.077-13.308-5.077-18.384 0-5.077 5.077-5.077 13.308 0 18.385l1.287 1.291c1.137 1.142 1.706 1.712 2.097 2.387.267.462.472.957.608 1.473.2.755.2 1.56.2 3.171V48.75c0 1.077 0 1.615.134 2.119a4 4 0 0 0 .407.984c.262.45.643.831 1.404 1.592l.294.295c.654.654.982.981 1.365 1.086.26.07.533.07.792 0 .383-.105.71-.432 1.365-1.086l3.478-3.479c.655-.654.982-.981 1.087-1.365a1.5 1.5 0 0 0 0-.791c-.105-.384-.432-.711-1.087-1.365l-.478-.479c-.655-.654-.982-.981-1.087-1.365a1.5 1.5 0 0 1 0-.791c.105-.384.432-.711 1.087-1.365l.478-.479c.655-.654.982-.981 1.087-1.365a1.5 1.5 0 0 0 0-.791c-.105-.384-.432-.711-1.087-1.365l-.492-.493c-.65-.65-.974-.974-1.08-1.355a1.5 1.5 0 0 1-.003-.788c.102-.382.425-.71 1.069-1.364l5.46-5.547Z"/><circle cx="30" cy="17" r="4" fill="#EB8B47" stroke="#fff" stroke-width="2"/></g><defs><clipPath id="m"><path fill="#fff" d="M0 0h60v60H0z"/></clipPath></defs></svg>`,HELP_USER_IMG:ut`<svg width="60" height="60" fill="none" viewBox="0 0 60 60"><g clip-path="url(#n)"><rect width="60" height="60" fill="#00ACE6" rx="30"/><path fill="#1AC6FF" stroke="#fff" stroke-width="2" d="M59 73c0 16.016-12.984 29-29 29S1 89.016 1 73c0-16.017 11-29 29-29s29 12.983 29 29ZM18.69 19.902a11 11 0 0 1 9.281-8.692 14.842 14.842 0 0 1 4.058 0 11 11 0 0 1 9.28 8.692c.178.866.322 1.75.44 2.625.132.977.132 1.968 0 2.945a39.467 39.467 0 0 1-.44 2.625 11 11 0 0 1-9.28 8.692 14.862 14.862 0 0 1-4.058 0 11 11 0 0 1-9.28-8.692 39.467 39.467 0 0 1-.44-2.625 11.004 11.004 0 0 1 0-2.945c.118-.876.262-1.759.44-2.625Z"/><circle cx="24.5" cy="23.5" r="1.5" fill="#fff"/><circle cx="35.5" cy="23.5" r="1.5" fill="#fff"/><path stroke="#fff" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m31 20-3 8h4"/></g><rect class="help-img-highlight" width="59" height="59" x=".5" y=".5" rx="29.5"/><defs><clipPath id="n"><rect width="60" height="60" fill="#fff" rx="30"/></clipPath></defs></svg>`,HELP_LOCK_IMG:ut`<svg width="60" height="60" fill="none" viewBox="0 0 60 60"><rect width="60" height="60" fill="#C653C6" rx="3"/><path fill="#fff" d="M20.034 15.216C20 15.607 20 16.07 20 17v2.808c0 1.13 0 1.696-.2 2.11a1.78 1.78 0 0 1-.584.714c-.366.28-1.051.42-2.423.7a7.076 7.076 0 0 0-1.597.511 9.001 9.001 0 0 0-4.353 4.353C10 30.005 10 32.336 10 37c0 4.663 0 6.995.843 8.804a9.001 9.001 0 0 0 4.353 4.353C17.005 51 19.336 51 24 51h12c4.663 0 6.995 0 8.804-.843a9.001 9.001 0 0 0 4.353-4.353C50 43.995 50 41.664 50 37c0-4.663 0-6.995-.843-8.804a9.001 9.001 0 0 0-4.353-4.353 7.076 7.076 0 0 0-1.597-.511c-1.372-.28-2.057-.42-2.423-.7a1.78 1.78 0 0 1-.583-.715C40 21.505 40 20.94 40 19.809V17c0-.929 0-1.393-.034-1.784a9 9 0 0 0-8.182-8.182C31.393 7 30.93 7 30 7s-1.393 0-1.784.034a9 9 0 0 0-8.182 8.182Z"/><path fill="#E87DE8" d="M22 17c0-.929 0-1.393.044-1.784a7 7 0 0 1 6.172-6.172C28.606 9 29.071 9 30 9s1.393 0 1.784.044a7 7 0 0 1 6.172 6.172c.044.39.044.855.044 1.784v4.5a1.5 1.5 0 0 1-3 0V17c0-.93 0-1.394-.077-1.78a4 4 0 0 0-3.143-3.143C31.394 12 30.93 12 30 12s-1.394 0-1.78.077a4 4 0 0 0-3.143 3.143C25 15.606 25 16.07 25 17v4.5a1.5 1.5 0 0 1-3 0V17Z"/><path fill="#E87DE8" fill-rule="evenodd" d="M12 36.62c0-4.317 0-6.476.92-8.088a7 7 0 0 1 2.612-2.612c1.612-.92 3.77-.92 8.088-.92h6.855c.469 0 .703 0 .906.017 2.73.222 4.364 2.438 4.619 4.983.27-2.698 2.111-5 5.015-5A6.985 6.985 0 0 1 48 31.985v5.395c0 4.317 0 6.476-.92 8.088a7 7 0 0 1-2.612 2.612c-1.612.92-3.77.92-8.088.92h-5.855c-.469 0-.703 0-.906-.017-2.73-.222-4.364-2.438-4.619-4.983-.258 2.583-1.943 4.818-4.714 4.99-.155.01-.335.01-.694.01-.55 0-.825 0-1.057-.015a7 7 0 0 1-6.52-6.52C12 42.233 12 41.958 12 41.408V36.62Zm21.24-.273a4 4 0 1 0-6.478 0c.985 1.36 1.479 2.039 1.564 2.229.178.398.176.818.174 1.247V42.5a1.5 1.5 0 0 0 3 0v-2.677c-.002-.429-.004-.85.174-1.247.085-.19.579-.87 1.565-2.229Z" clip-rule="evenodd"/><rect class="help-img-highlight" width="59" height="59" x=".5" y=".5" rx="2.5"/></svg>`,HELP_COMPAS_IMG:ut`<svg width="60" height="60" fill="none" viewBox="0 0 60 60"><rect width="60" height="60" fill="#1DC956" rx="30"/><circle cx="30" cy="29.999" r="3" fill="#fff"/><path fill="#2BEE6C" stroke="#fff" stroke-width="2" d="m45.316 17.9-.88-.425.88.424a7.9 7.9 0 0 1 .026-.053c.093-.192.21-.432.26-.687l-.819-.162.819.162a2 2 0 0 0-.239-1.405c-.132-.224-.32-.412-.472-.562a8.415 8.415 0 0 1-.042-.042l-.042-.042c-.15-.151-.338-.34-.562-.472l-.508.862.508-.862a2 2 0 0 0-1.405-.239c-.255.05-.495.167-.687.26l-.053.026-15.05 7.246-.108.052c-1.131.545-1.843.887-2.456 1.374a6.994 6.994 0 0 0-1.13 1.13c-.487.613-.83 1.325-1.375 2.457l-.051.108-7.247 15.05-.025.053c-.094.192-.21.431-.26.686a2 2 0 0 0 .239 1.406l.855-.505-.856.505c.133.224.321.411.473.562l.042.042.041.042c.15.151.338.34.563.472a2 2 0 0 0 1.405.239l-.195-.981.195.98c.255-.05.494-.166.686-.26l.054-.025-.419-.87.419.87 15.05-7.247.107-.051c1.132-.545 1.844-.888 2.457-1.374a7.002 7.002 0 0 0 1.13-1.13c.487-.614.83-1.325 1.374-2.457l.052-.108 7.246-15.05Z"/><path fill="#1DC956" d="m33.376 32.723-2.669-3.43-14.85 14.849.206.205a1 1 0 0 0 1.141.194l15.105-7.273a3 3 0 0 0 1.067-4.545Z"/><path fill="#86F999" d="m26.624 27.276 2.669 3.43 14.85-14.849-.206-.205a1 1 0 0 0-1.141-.194L27.69 22.731a3 3 0 0 0-1.067 4.545Z"/><circle cx="30" cy="30" r="3" fill="#fff" transform="rotate(45 30 30)"/><rect class="help-img-highlight" width="59" height="59" x=".5" y=".5" rx="29.5"/></svg>`,HELP_NOUN_IMG:ut`<svg width="60" height="60" fill="none" viewBox="0 0 60 60"><rect width="60" height="60" fill="#794CFF" rx="3"/><path fill="#987DE8" stroke="#fff" stroke-width="2" d="M33 22.5v-1H16v5H8.5V36H13v-5h3v7.5h17V31h1v7.5h17v-17H34v5h-1v-4Z"/><path fill="#fff" d="M37.5 25h10v10h-10z"/><path fill="#4019B2" d="M42.5 25h5v10h-5z"/><path fill="#fff" d="M19.5 25h10v10h-10z"/><path fill="#4019B2" d="M24.5 25h5v10h-5z"/><path fill="#fff" d="M12 30.5h4V37h-4v-6.5Z"/><rect class="help-img-highlight" width="59" height="59" x=".5" y=".5" rx="2.5"/></svg>`,HELP_DAO_IMG:ut`<svg width="60" height="60" fill="none" viewBox="0 0 60 60"><g clip-path="url(#o)"><path fill="#EB8B47" d="M0 24.9c0-9.252 0-13.878 1.97-17.332A15 15 0 0 1 7.569 1.97C11.023 0 15.648 0 24.9 0h10.2c9.251 0 13.877 0 17.332 1.97a15 15 0 0 1 5.597 5.598C60 11.022 60 15.648 60 24.899v10.2c0 9.252 0 13.878-1.97 17.332a15.001 15.001 0 0 1-5.598 5.598c-3.455 1.97-8.08 1.97-17.332 1.97H24.9c-9.251 0-13.877 0-17.332-1.97a15 15 0 0 1-5.597-5.598C0 48.977 0 44.351 0 35.1V24.9Z"/><path class="help-img-highlight" d="M.5 24.9c0-4.635 0-8.078.244-10.795.244-2.71.726-4.65 1.66-6.29a14.5 14.5 0 0 1 5.412-5.41C9.455 1.468 11.395.986 14.105.743 16.822.5 20.265.5 24.9.5h10.2c4.635 0 8.078 0 10.795.244 2.71.243 4.65.725 6.29 1.66a14.5 14.5 0 0 1 5.41 5.411c.935 1.64 1.417 3.58 1.66 6.29.244 2.717.245 6.16.245 10.794v10.2c0 4.635 0 8.078-.244 10.796-.244 2.71-.726 4.65-1.66 6.289a14.5 14.5 0 0 1-5.412 5.41c-1.639.936-3.579 1.418-6.289 1.661-2.717.244-6.16.244-10.795.244H24.9c-4.635 0-8.078 0-10.795-.244-2.71-.243-4.65-.725-6.29-1.66a14.5 14.5 0 0 1-5.41-5.411c-.935-1.64-1.417-3.58-1.66-6.29C.5 43.178.5 39.734.5 35.1V24.9Z"/><path fill="#FF974C" stroke="#fff" stroke-width="2" d="M19 52c5.523 0 10-4.477 10-10s-4.477-10-10-10S9 36.477 9 42s4.477 10 10 10Z"/><path fill="#fff" fill-rule="evenodd" d="M42.844 8.326a1 1 0 0 0-1.687 0L28.978 27.463A1 1 0 0 0 29.822 29h24.357a1 1 0 0 0 .843-1.537L42.844 8.326Z" clip-rule="evenodd"/><path fill="#FF974C" fill-rule="evenodd" d="M42.335 11.646c.324.115.571.504 1.066 1.28l7.332 11.523c.562.883.843 1.325.792 1.69a1 1 0 0 1-.342.623c-.28.238-.803.238-1.85.238H34.667c-1.047 0-1.57 0-1.85-.238a1 1 0 0 1-.342-.623c-.051-.365.23-.806.792-1.69l7.332-11.523c.495-.776.742-1.165 1.066-1.28a1 1 0 0 1 .67 0ZM35 27a7 7 0 0 0 7-7 7 7 0 0 0 7 7H35Z" clip-rule="evenodd"/><path fill="#FF974C" stroke="#fff" stroke-width="2" d="M10.106 9.357c-.109.32-.107.682-.106.975V25.668c-.001.293-.003.654.106.975a2 2 0 0 0 1.251 1.25c.32.11.682.108.975.107H19c5.523 0 10-4.477 10-10S24.523 8 19 8h-6.668c-.293-.001-.654-.003-.975.106a2 2 0 0 0-1.25 1.251Z"/><circle cx="19" cy="18" r="4" fill="#EB8B47" stroke="#fff" stroke-width="2"/><circle cx="19" cy="41.999" r="4" fill="#EB8B47" stroke="#fff" stroke-width="2"/></g><defs><clipPath id="o"><path fill="#fff" d="M0 0h60v60H0z"/></clipPath></defs></svg>`,SEARCH_ICON:ut`<svg width="20" height="21"><path fill-rule="evenodd" clip-rule="evenodd" d="M12.432 13.992c-.354-.353-.91-.382-1.35-.146a5.5 5.5 0 1 1 2.265-2.265c-.237.441-.208.997.145 1.35l3.296 3.296a.75.75 0 1 1-1.06 1.061l-3.296-3.296Zm.06-5a4 4 0 1 1-8 0 4 4 0 0 1 8 0Z" fill="#949E9E"/></svg>`,HELP_ICON:ut`<svg width="11" height="17" viewBox="0 0 11 17"><path fill="#fff" d="M5.22 2.97c-1.07 0-2.25.843-2.25 2.25a.75.75 0 0 1-1.5 0c0-2.393 2.019-3.75 3.75-3.75 1.73 0 3.75 1.357 3.75 3.75 0 1.64-1.038 2.466-1.785 3.057-.802.635-1.215.984-1.215 1.693a.75.75 0 1 1-1.5 0c0-1.466.985-2.24 1.681-2.788l.103-.081C7.007 6.504 7.47 6.08 7.47 5.22c0-1.407-1.181-2.25-2.25-2.25ZM5.22 14.97a1.25 1.25 0 1 0 0-2.5 1.25 1.25 0 0 0 0 2.5Z"/></svg>`,WALLET_ICON:ut`<svg width="15" height="14" fill="none" viewBox="0 0 15 14"><path fill="#fff" fill-rule="evenodd" d="M.64 9.2v-3h.001c.009-1.857.07-2.886.525-3.682a4 4 0 0 1 1.492-1.493C3.58.5 4.813.5 7.28.5h3.735c.58 0 .871 0 1.114.04A3 3 0 0 1 14.6 3.011c.04.243.04.533.04 1.114 0 .58 0 .871-.04 1.114a3 3 0 0 1-2.471 2.47c-.243.041-.533.041-1.114.041h-.777c.178.307.302.648.362 1.011.04.243.04.533.04 1.114 0 .58 0 .871-.04 1.114a3 3 0 0 1-2.471 2.47c-.243.041-.533.041-1.114.041H4.507A3.867 3.867 0 0 1 .64 9.633V9.2ZM7.28 2h3.735c.64 0 .779.005.87.02a1.5 1.5 0 0 1 1.235 1.236c.015.09.02.229.02.869s-.005.779-.02.87a1.5 1.5 0 0 1-1.236 1.235c-.09.015-.229.02-.869.02H4.023c-.697 0-1.345.21-1.883.572V6.25h.001c.004-.791.015-1.383.059-1.867.056-.629.157-.926.269-1.122a2.5 2.5 0 0 1 .932-.933c.197-.111.494-.212 1.123-.268C5.173 2 6.019 2 7.28 2Zm-.265 5.75H4.023c-1.04 0-1.883.843-1.883 1.883A2.367 2.367 0 0 0 4.507 12h2.508c.64 0 .779-.005.87-.02a1.5 1.5 0 0 0 1.235-1.236c.015-.09.02-.229.02-.869s-.005-.779-.02-.87A1.5 1.5 0 0 0 7.884 7.77c-.09-.015-.228-.02-.869-.02Z" clip-rule="evenodd"/></svg>`,NETWORK_PLACEHOLDER:ut`<svg width="28" height="28" fill="none" viewBox="0 0 28 28"><mask id="p" width="26" height="28" x="1" y="0" maskUnits="userSpaceOnUse" style="mask-type:alpha"><path fill="#D9D9D9" d="M12 1.172a4 4 0 0 1 4 0l8.124 4.69a4 4 0 0 1 2 3.465v9.381a4 4 0 0 1-2 3.464L16 26.862a4 4 0 0 1-4 0l-8.124-4.69a4 4 0 0 1-2-3.464V9.327a4 4 0 0 1 2-3.464L12 1.173Z"/></mask><g mask="url(#p)"><path id="network-placeholder-fill" fill="#fff" d="M0 0h28v28H0z"/><path id="network-placeholder-dash" stroke="#000" stroke-dasharray="2 2" d="m8.953 2.931 2.032-1.173.25.433 1.015-.586c.269-.155.553-.271.844-.35l-.13-.483a4.003 4.003 0 0 1 2.071 0l-.13.483c.293.079.576.195.845.35l1.016.586.25-.433 2.03 1.173-.25.433 2.032 1.173.25-.433 2.03 1.172-.25.433 1.016.587c.269.155.512.342.725.556l.354-.354a4.003 4.003 0 0 1 1.035 1.794l-.483.129c.078.292.12.596.12.906v1.172h.5v2.346h-.5v2.345h.5v2.345h-.5v1.173c0 .31-.042.614-.12.906l.483.13a4.003 4.003 0 0 1-1.035 1.793l-.354-.354a3.498 3.498 0 0 1-.725.556l-1.015.586.25.434-2.031 1.172-.25-.433-2.031 1.173.25.433-2.031 1.172-.25-.433-1.016.587a3.494 3.494 0 0 1-.844.35l.13.482a4.003 4.003 0 0 1-2.071 0l.13-.483a3.496 3.496 0 0 1-.845-.35l-1.015-.586-.25.433-2.032-1.172.25-.433-2.03-1.173-.25.433L4.89 22.76l.25-.434-1.015-.586a3.498 3.498 0 0 1-.725-.556l-.354.354a4.003 4.003 0 0 1-1.035-1.794l.483-.13a3.497 3.497 0 0 1-.12-.905v-1.173h-.5V15.19h.5v-2.345h-.5v-2.346h.5V9.327c0-.31.042-.614.12-.906l-.483-.13a4.003 4.003 0 0 1 1.035-1.793l.354.354c.213-.214.456-.401.725-.556l1.015-.587-.25-.433 2.031-1.172.25.433 2.031-1.173-.25-.433Z"/><path fill="#798686" stroke="#fff" d="M14.243 13.563 14 13.428l-.243.135-6.388 3.549-.024.013c-.432.24-.79.44-1.053.622-.266.184-.516.405-.636.722a1.5 1.5 0 0 0 0 1.062c.12.317.37.538.636.722.263.183.62.382 1.053.622l.024.013 3.164 1.758.088.049c1.164.646 1.857 1.032 2.607 1.162.51.09 1.033.09 1.544 0 .75-.13 1.443-.516 2.606-1.162l.09-.05 3.163-1.757.024-.013c.432-.24.79-.44 1.053-.622.266-.184.516-.405.636-.722l-.468-.177.468.177a1.5 1.5 0 0 0 0-1.062l-.468.177.468-.177c-.12-.317-.37-.538-.636-.722-.263-.183-.62-.382-1.053-.622l-.024-.013-6.388-3.55Z"/><path fill="#9EA9A9" stroke="#fff" d="M14.243 8.563 14 8.428l-.243.135-6.388 3.549-.024.013c-.432.24-.79.44-1.053.622-.266.184-.516.405-.636.722a1.5 1.5 0 0 0 0 1.062c.12.316.37.537.636.722.263.183.62.382 1.053.622l.024.013 3.164 1.758.088.049c1.164.646 1.857 1.032 2.607 1.162.51.09 1.033.09 1.544 0 .75-.13 1.443-.516 2.606-1.162l.09-.05 3.163-1.757.024-.013c.432-.24.79-.44 1.053-.622.266-.184.516-.405.636-.722l-.468-.177.468.177a1.5 1.5 0 0 0 0-1.062l-.468.177.468-.177c-.12-.316-.37-.537-.636-.722-.263-.183-.62-.382-1.053-.622l-.024-.013-6.388-3.55Z"/><path fill="#C9CFCF" stroke="#fff" d="m22.344 9.53-.468-.176.468.177a1.5 1.5 0 0 0 0-1.062l-.468.177.468-.177c-.12-.317-.37-.537-.636-.722-.263-.183-.62-.382-1.053-.622l-.024-.013-3.163-1.758-.09-.05c-1.163-.645-1.856-1.03-2.606-1.161a4.5 4.5 0 0 0-1.544 0c-.75.13-1.443.516-2.607 1.162l-.088.05-3.164 1.757-.024.013c-.432.24-.79.44-1.053.622-.266.185-.516.405-.636.722a1.5 1.5 0 0 0 0 1.062c.12.317.37.537.636.722.263.183.62.382 1.053.622l.024.013 3.164 1.758.088.049c1.164.646 1.857 1.032 2.607 1.162.51.09 1.033.09 1.544 0 .75-.13 1.443-.516 2.606-1.162l.09-.05 3.163-1.757.024-.013c.432-.24.79-.44 1.053-.622.266-.184.516-.405.636-.722Z"/></g></svg>`,WALLET_PLACEHOLDER:ut`<svg width="60" height="60" fill="none" viewBox="0 0 60 60"><g clip-path="url(#q)"><path id="wallet-placeholder-fill" fill="#fff" d="M0 24.9c0-9.251 0-13.877 1.97-17.332a15 15 0 0 1 5.598-5.597C11.023 0 15.648 0 24.9 0h10.2c9.252 0 13.877 0 17.332 1.97a15 15 0 0 1 5.597 5.598C60 11.023 60 15.648 60 24.9v10.2c0 9.252 0 13.877-1.97 17.332a15.001 15.001 0 0 1-5.598 5.597C48.977 60 44.352 60 35.1 60H24.9c-9.251 0-13.877 0-17.332-1.97a15 15 0 0 1-5.597-5.598C0 48.977 0 44.352 0 35.1V24.9Z"/><path id="wallet-placeholder-dash" stroke="#000" stroke-dasharray="4 4" stroke-width="1.5" d="M.04 41.708a231.598 231.598 0 0 1-.039-4.403l.75-.001L.75 35.1v-2.55H0v-5.1h.75V24.9l.001-2.204h-.75c.003-1.617.011-3.077.039-4.404l.75.016c.034-1.65.099-3.08.218-4.343l-.746-.07c.158-1.678.412-3.083.82-4.316l.713.236c.224-.679.497-1.296.827-1.875a14.25 14.25 0 0 1 1.05-1.585L3.076 5.9A15 15 0 0 1 5.9 3.076l.455.596a14.25 14.25 0 0 1 1.585-1.05c.579-.33 1.196-.603 1.875-.827l-.236-.712C10.812.674 12.217.42 13.895.262l.07.746C15.23.89 16.66.824 18.308.79l-.016-.75C19.62.012 21.08.004 22.695.001l.001.75L24.9.75h2.55V0h5.1v.75h2.55l2.204.001v-.75c1.617.003 3.077.011 4.404.039l-.016.75c1.65.034 3.08.099 4.343.218l.07-.746c1.678.158 3.083.412 4.316.82l-.236.713c.679.224 1.296.497 1.875.827a14.24 14.24 0 0 1 1.585 1.05l.455-.596A14.999 14.999 0 0 1 56.924 5.9l-.596.455c.384.502.735 1.032 1.05 1.585.33.579.602 1.196.827 1.875l.712-.236c.409 1.233.663 2.638.822 4.316l-.747.07c.119 1.264.184 2.694.218 4.343l.75-.016c.028 1.327.036 2.787.039 4.403l-.75.001.001 2.204v2.55H60v5.1h-.75v2.55l-.001 2.204h.75a231.431 231.431 0 0 1-.039 4.404l-.75-.016c-.034 1.65-.099 3.08-.218 4.343l.747.07c-.159 1.678-.413 3.083-.822 4.316l-.712-.236a10.255 10.255 0 0 1-.827 1.875 14.242 14.242 0 0 1-1.05 1.585l.596.455a14.997 14.997 0 0 1-2.824 2.824l-.455-.596c-.502.384-1.032.735-1.585 1.05-.579.33-1.196.602-1.875.827l.236.712c-1.233.409-2.638.663-4.316.822l-.07-.747c-1.264.119-2.694.184-4.343.218l.016.75c-1.327.028-2.787.036-4.403.039l-.001-.75-2.204.001h-2.55V60h-5.1v-.75H24.9l-2.204-.001v.75a231.431 231.431 0 0 1-4.404-.039l.016-.75c-1.65-.034-3.08-.099-4.343-.218l-.07.747c-1.678-.159-3.083-.413-4.316-.822l.236-.712a10.258 10.258 0 0 1-1.875-.827 14.252 14.252 0 0 1-1.585-1.05l-.455.596A14.999 14.999 0 0 1 3.076 54.1l.596-.455a14.24 14.24 0 0 1-1.05-1.585 10.259 10.259 0 0 1-.827-1.875l-.712.236C.674 49.188.42 47.783.262 46.105l.746-.07C.89 44.77.824 43.34.79 41.692l-.75.016Z"/><path fill="#fff" fill-rule="evenodd" d="M35.643 32.145c-.297-.743-.445-1.114-.401-1.275a.42.42 0 0 1 .182-.27c.134-.1.463-.1 1.123-.1.742 0 1.499.046 2.236-.05a6 6 0 0 0 5.166-5.166c.051-.39.051-.855.051-1.784 0-.928 0-1.393-.051-1.783a6 6 0 0 0-5.166-5.165c-.39-.052-.854-.052-1.783-.052h-7.72c-4.934 0-7.401 0-9.244 1.051a8 8 0 0 0-2.985 2.986C16.057 22.28 16.003 24.58 16 29 15.998 31.075 16 33.15 16 35.224A7.778 7.778 0 0 0 23.778 43H28.5c1.394 0 2.09 0 2.67-.116a6 6 0 0 0 4.715-4.714c.115-.58.115-1.301.115-2.744 0-1.31 0-1.964-.114-2.49a4.998 4.998 0 0 0-.243-.792Z" clip-rule="evenodd"/><path fill="#9EA9A9" fill-rule="evenodd" d="M37 18h-7.72c-2.494 0-4.266.002-5.647.126-1.361.122-2.197.354-2.854.728a6.5 6.5 0 0 0-2.425 2.426c-.375.657-.607 1.492-.729 2.853-.11 1.233-.123 2.777-.125 4.867 0 .7 0 1.05.097 1.181.096.13.182.181.343.2.163.02.518-.18 1.229-.581a6.195 6.195 0 0 1 3.053-.8H37c.977 0 1.32-.003 1.587-.038a4.5 4.5 0 0 0 3.874-3.874c.036-.268.039-.611.039-1.588 0-.976-.003-1.319-.038-1.587a4.5 4.5 0 0 0-3.875-3.874C38.32 18.004 37.977 18 37 18Zm-7.364 12.5h-7.414a4.722 4.722 0 0 0-4.722 4.723 6.278 6.278 0 0 0 6.278 6.278H28.5c1.466 0 1.98-.008 2.378-.087a4.5 4.5 0 0 0 3.535-3.536c.08-.397.087-.933.087-2.451 0-1.391-.009-1.843-.08-2.17a3.5 3.5 0 0 0-2.676-2.676c-.328-.072-.762-.08-2.108-.08Z" clip-rule="evenodd"/></g><defs><clipPath id="q"><path fill="#fff" d="M0 0h60v60H0z"/></clipPath></defs></svg>`,TOKEN_PLACEHOLDER:ut`<svg width="60" height="60" viewBox="0 0 60 60" fill="none"><rect id="token-placeholder-fill" width="58" height="58" x="1" y="1" fill="#fff" rx="29"/><path fill="#3B4040" stroke="#fff" stroke-width="2" d="M32 10a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v5.566c0 .357.192.685.495.875a16.001 16.001 0 0 1 4.256 3.894c.667.88.33 2.113-.627 2.665l-2.494 1.44c-.956.552-2.166.204-2.913-.609a9.12 9.12 0 1 0 .064 12.267c.739-.82 1.945-1.181 2.907-.64l2.509 1.415c.962.542 1.312 1.77.654 2.658a16 16 0 0 1-4.356 4.028c-.303.19-.495.518-.495.875V50a2 2 0 0 1-2 2h-2a2 2 0 0 1-2-2v-2.992c0-.602-.528-1.065-1.13-1.032-.579.032-1.16.032-1.74 0-.602-.032-1.13.43-1.13 1.032V50a2 2 0 0 1-2 2h-2a2 2 0 0 1-2-2v-5.566c0-.357-.192-.685-.495-.875a16 16 0 0 1 0-27.118c.303-.19.495-.517.495-.875V10a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v2.992c0 .601.528 1.064 1.13 1.032.58-.032 1.161-.032 1.74 0 .602.033 1.13-.43 1.13-1.032V10Z"/><rect id="token-placeholder-dash" width="58" height="58" x="1" y="1" stroke="#000" stroke-dasharray="6 6" stroke-width="2" rx="29"/></svg>`,ACCOUNT_COPY:ut`<svg width="14" height="14" fill="none" viewBox="0 0 14 14"><path fill="#fff" fill-rule="evenodd" d="M4.003 4.005c.012-1.225.074-1.936.391-2.491a3 3 0 0 1 1.12-1.12C6.204 0 7.136 0 9 0s2.795 0 3.486.394a3 3 0 0 1 1.12 1.12C14 2.204 14 3.136 14 5s0 2.795-.394 3.486a3 3 0 0 1-1.12 1.12c-.555.317-1.266.379-2.491.391l.002.003c-.012 1.222-.075 1.932-.391 2.486a3 3 0 0 1-1.12 1.12C7.796 14 6.864 14 5 14s-2.795 0-3.486-.394a3 3 0 0 1-1.12-1.12C0 11.796 0 10.864 0 9s0-2.795.394-3.486a3 3 0 0 1 1.12-1.12c.554-.316 1.264-.379 2.486-.391l.003.002ZM9 8.5c-.959 0-1.58-.001-2.05-.043-.45-.04-.613-.109-.693-.154a1.5 1.5 0 0 1-.56-.56c-.045-.08-.113-.243-.154-.693C5.501 6.58 5.5 5.959 5.5 5c0-.959.001-1.58.043-2.05.04-.45.109-.613.154-.693a1.5 1.5 0 0 1 .56-.56c.08-.045.243-.113.693-.154C7.42 1.501 8.041 1.5 9 1.5c.959 0 1.58.001 2.05.043.45.04.613.109.693.154a1.5 1.5 0 0 1 .56.56c.045.08.113.243.154.693.042.47.043 1.091.043 2.05 0 .959-.001 1.58-.043 2.05-.04.45-.109.613-.154.693a1.5 1.5 0 0 1-.56.56c-.08.045-.242.113-.693.154-.47.042-1.091.043-2.05.043ZM4 5.503a13.77 13.77 0 0 0-1.05.04c-.45.04-.613.109-.693.154a1.5 1.5 0 0 0-.56.56c-.045.08-.113.243-.154.693C1.501 7.42 1.5 8.041 1.5 9c0 .959.001 1.58.043 2.05.04.45.109.613.154.693a1.5 1.5 0 0 0 .56.56c.08.045.243.113.693.154.47.042 1.091.043 2.05.043.959 0 1.58-.001 2.05-.043.45-.04.613-.109.693-.154a1.5 1.5 0 0 0 .56-.56c.045-.08.113-.242.154-.693.025-.283.035-.619.04-1.05-1.534-.003-2.358-.037-2.983-.394a3 3 0 0 1-1.12-1.12c-.357-.625-.39-1.449-.394-2.983Z" clip-rule="evenodd"/></svg>`,ACCOUNT_DISCONNECT:ut`<svg width="16" height="14" fill="none" viewBox="0 0 16 14"><path fill="#fff" d="M9.677 1.5h-2.61c-1.261 0-2.107.001-2.757.06-.629.056-.926.157-1.122.268a2.5 2.5 0 0 0-.933.933c-.112.196-.212.493-.269 1.122-.058.65-.06 1.496-.06 2.757v.72c0 1.26.002 2.107.06 2.756.057.63.157.927.27 1.123a2.5 2.5 0 0 0 .932.933c.196.111.493.212 1.122.268.65.059 1.496.06 2.757.06h2.61a.75.75 0 1 1 0 1.5h-2.61c-2.467 0-3.7 0-4.622-.525a4 4 0 0 1-1.493-1.493C.427 11.06.427 9.827.427 7.36v-.72c0-2.467 0-3.7.525-4.622A4 4 0 0 1 2.445.525C3.366 0 4.6 0 7.067 0h2.61a.75.75 0 1 1 0 1.5Z"/><path fill="#fff" d="M10.896 11.03a.75.75 0 0 1 0-1.06l1.793-1.793a.25.25 0 0 0-.176-.427H8.177a.75.75 0 0 1 0-1.5h4.336a.25.25 0 0 0 .176-.427L10.896 4.03a.75.75 0 0 1 1.061-1.06l3.323 3.323a1 1 0 0 1 0 1.414l-3.323 3.323a.75.75 0 0 1-1.06 0Z"/></svg>`,GLOBE_ICON:ut`<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>`},l$=Ve`.w3m-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(--w3m-background-border-radius) * .9);background-color:var(--w3m-background-color);background-image:var(--w3m-background-image-url);background-position:center;background-size:cover}.w3m-toolbar{height:38px;display:flex;position:relative;margin:5px 15px 5px 5px;justify-content:space-between;align-items:center}.w3m-toolbar img,.w3m-toolbar svg{height:28px;object-position:left center;object-fit:contain}#w3m-wc-logo path{fill:var(--w3m-accent-fill-color)}button{width:28px;height:28px;border-radius:var(--w3m-icon-button-border-radius);border:0;display:flex;justify-content:center;align-items:center;cursor:pointer;background-color:var(--w3m-color-bg-1);box-shadow:0 0 0 1px var(--w3m-color-overlay)}button:active{background-color:var(--w3m-color-bg-2)}button svg{display:block;object-position:center}button path{fill:var(--w3m-color-fg-1)}.w3m-toolbar div{display:flex}.w3m-toolbar div button:first-child{margin-right:16px}.w3m-help-active button:first-child{background-color:var(--w3m-color-fg-1)}.w3m-help-active button:first-child path{fill:var(--w3m-color-bg-1)}@media(hover:hover){button:hover{background-color:var(--w3m-color-bg-2)}}`;var u$=Object.defineProperty,h$=Object.getOwnPropertyDescriptor,Wm=(t,e,r,n)=>{for(var i=n>1?void 0:n?h$(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&u$(e,r,i),i};let qc=class extends Pe{constructor(){super(),this.isHelp=!1,this.unsubscribeRouter=void 0,this.unsubscribeRouter=tt.subscribe(t=>{this.isHelp=t.view==="Help"})}disconnectedCallback(){var t;(t=this.unsubscribeRouter)==null||t.call(this)}onHelp(){tt.push("Help")}logoTemplate(){var t;const e=(t=Un.state.themeVariables)==null?void 0:t["--w3m-logo-image-url"];return e?oe`<img src="${e}">`:Fe.WALLET_CONNECT_LOGO}render(){const t={"w3m-help-active":this.isHelp};return oe`<div class="w3m-toolbar-placeholder"></div><div class="w3m-toolbar">${this.logoTemplate()}<div class="${Lr(t)}"><button @click="${this.onHelp}">${Fe.HELP_ICON}</button> <button @click="${Fr.close}">${Fe.CROSS_ICON}</button></div></div>`}};qc.styles=[je.globalCss,l$],Wm([gt()],qc.prototype,"isHelp",2),qc=Wm([Ne("w3m-modal-backcard")],qc);const f$=Ve`main{padding:20px;padding-top:0;width:100%}`;var d$=Object.defineProperty,p$=Object.getOwnPropertyDescriptor,g$=(t,e,r,n)=>{for(var i=n>1?void 0:n?p$(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&d$(e,r,i),i};let Sf=class extends Pe{render(){return oe`<main><slot></slot></main>`}};Sf.styles=[je.globalCss,f$],Sf=g$([Ne("w3m-modal-content")],Sf);const m$=Ve`footer{padding:10px;display:flex;flex-direction:column;align-items:inherit;justify-content:inherit;border-top:1px solid var(--w3m-color-bg-2)}`;var w$=Object.defineProperty,v$=Object.getOwnPropertyDescriptor,y$=(t,e,r,n)=>{for(var i=n>1?void 0:n?v$(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&w$(e,r,i),i};let Df=class extends Pe{render(){return oe`<footer><slot></slot></footer>`}};Df.styles=[je.globalCss,m$],Df=y$([Ne("w3m-modal-footer")],Df);const b$=Ve`header{display:flex;justify-content:center;align-items:center;padding:20px;position:relative}.w3m-border{border-bottom:1px solid var(--w3m-color-bg-2);margin-bottom:20px}header button{padding:15px 20px}header button:active{opacity:.5}@media(hover:hover){header button:hover{opacity:.5}}.w3m-back-btn{position:absolute;left:0}.w3m-action-btn{position:absolute;right:0}path{fill:var(--w3m-accent-color)}`;var _$=Object.defineProperty,E$=Object.getOwnPropertyDescriptor,pa=(t,e,r,n)=>{for(var i=n>1?void 0:n?E$(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&_$(e,r,i),i};let rs=class extends Pe{constructor(){super(...arguments),this.title="",this.onAction=void 0,this.actionIcon=void 0,this.border=!1}backBtnTemplate(){return oe`<button class="w3m-back-btn" @click="${tt.goBack}">${Fe.BACK_ICON}</button>`}actionBtnTemplate(){return oe`<button class="w3m-action-btn" @click="${this.onAction}">${this.actionIcon}</button>`}render(){const t={"w3m-border":this.border},e=tt.state.history.length>1,r=this.title?oe`<w3m-text variant="big-bold">${this.title}</w3m-text>`:oe`<slot></slot>`;return oe`<header class="${Lr(t)}">${e?this.backBtnTemplate():null} ${r} ${this.onAction?this.actionBtnTemplate():null}</header>`}};rs.styles=[je.globalCss,b$],pa([$e()],rs.prototype,"title",2),pa([$e()],rs.prototype,"onAction",2),pa([$e()],rs.prototype,"actionIcon",2),pa([$e()],rs.prototype,"border",2),rs=pa([Ne("w3m-modal-header")],rs);const x$={1:"692ed6ba-e569-459a-556a-776476829e00",42161:"600a9a04-c1b9-42ca-6785-9b4b6ff85200",43114:"30c46e53-e989-45fb-4549-be3bd4eb3b00",56:"93564157-2e8e-4ce7-81df-b264dbee9b00",250:"06b26297-fe0c-4733-5d6b-ffa5498aac00",10:"ab9c186a-c52f-464b-2906-ca59d760a400",137:"41d04d42-da3b-4453-8506-668cc0727900",100:"02b53f6a-e3d4-479e-1cb4-21178987d100",9001:"f926ff41-260d-4028-635e-91913fc28e00",324:"b310f07f-4ef7-49f3-7073-2a0a39685800",314:"5a73b3dd-af74-424e-cae0-0de859ee9400",4689:"34e68754-e536-40da-c153-6ef2e7188a00",1088:"3897a66d-40b9-4833-162f-a2c90531c900",1284:"161038da-44ae-4ec7-1208-0ea569454b00",1285:"f1d73bb6-5450-4e18-38f7-fb6484264a00"},C$={ETH:{icon:"692ed6ba-e569-459a-556a-776476829e00"},WETH:{icon:"692ed6ba-e569-459a-556a-776476829e00"},AVAX:{icon:"30c46e53-e989-45fb-4549-be3bd4eb3b00"},FTM:{icon:"06b26297-fe0c-4733-5d6b-ffa5498aac00"},BNB:{icon:"93564157-2e8e-4ce7-81df-b264dbee9b00"},MATIC:{icon:"41d04d42-da3b-4453-8506-668cc0727900"},OP:{icon:"ab9c186a-c52f-464b-2906-ca59d760a400"},xDAI:{icon:"02b53f6a-e3d4-479e-1cb4-21178987d100"},EVMOS:{icon:"f926ff41-260d-4028-635e-91913fc28e00"},METIS:{icon:"3897a66d-40b9-4833-162f-a2c90531c900"},IOTX:{icon:"34e68754-e536-40da-c153-6ef2e7188a00"}},Xr={externalWallets(){const{isStandalone:t}=De.state;if(t)return[];let e=Ft.client().getConnectors();return e=e.filter(r=>r.id!=="injected"),e},manualWallets(){var t,e;const{mobileWallets:r,desktopWallets:n}=jt.state,i=(t=Xr.recentWallet())==null?void 0:t.id,o=Ae.isMobile()?r:n,c=o?.filter(l=>i!==l.id);return(e=Ae.isMobile()?c?.map(({id:l,name:h,links:d})=>({id:l,name:h,mobile:d,links:d})):c?.map(({id:l,name:h,links:d})=>({id:l,name:h,desktop:d,links:d})))!=null?e:[]},installedInjectedWallets(){const{isStandalone:t}=De.state;if(t)return[];if(!Ft.client().isInjectedProviderInstalled())return[];const{namespace:e}=Ft.client(),{injectedWallets:r}=ir.state;let n=r.filter(({injected:i})=>!!i.some(o=>Ft.client().safeCheckInjectedProvider(o.injected_id)&&o.namespace===e));return n.length>1&&(n=n.filter(({injected:i})=>!!i.map(({injected_id:o})=>o).every(o=>o!=="isMetaMask"))),n.length?n:[{name:"Browser",id:"browser",image_id:void 0}]},injectedWallets(){const{isStandalone:t}=De.state,{explorerExcludedWalletIds:e,explorerRecommendedWalletIds:r}=jt.state,n=Ae.isMobile();if(t||e==="ALL"||n)return[];const{namespace:i}=Ft.client(),{injectedWallets:o}=ir.state;return o.filter(({id:c,injected:l})=>{const h=Ae.isArray(e)?e:[],d=Ae.isArray(r)?r:[];return!!l.some(v=>v.namespace===i&&!h.includes(c)&&!d.includes(c))})},recentWallet(){return xe.getRecentWallet()},recomendedWallets(t=!1){var e;const r=Xr.installedInjectedWallets().map(({id:c})=>c),n=t||(e=Xr.recentWallet())==null?void 0:e.id,i=[...r,n],{recomendedWallets:o}=ir.state;return o.filter(c=>!i.includes(c.id))}},xe={MOBILE_BREAKPOINT:600,W3M_RECENT_WALLET_DATA:"W3M_RECENT_WALLET_DATA",EXPLORER_WALLET_URL:"https://explorer.walletconnect.com/?type=wallet",rejectStandaloneButtonComponent(){const{isStandalone:t}=De.state;if(t)throw new Error("Web3Modal button components are not available in standalone mode.")},getShadowRootElement(t,e){const r=t.renderRoot.querySelector(e);if(!r)throw new Error(`${e} not found`);return r},getWalletIcon({id:t,image_id:e}){const{walletImages:r}=jt.state;return r!=null&&r[t]?r[t]:e?ir.getWalletImageUrl(e):""},getWalletName(t,e=!1){return e?t.split(" ")[0]:t},getChainIcon(t){var e;const r=x$[t],{projectId:n,chainImages:i}=jt.state;return(e=i?.[t])!=null?e:n&&r?ir.getAssetImageUrl(r):""},getTokenIcon(t){var e,r;const n=(e=C$[t])==null?void 0:e.icon,{projectId:i,tokenImages:o}=jt.state;return(r=o?.[t])!=null?r:i&&n?ir.getAssetImageUrl(n):""},isMobileAnimation(){return window.innerWidth<=xe.MOBILE_BREAKPOINT},async preloadImage(t){const e=new Promise((r,n)=>{const i=new Image;i.onload=r,i.onerror=n,i.src=t});return Promise.race([e,Ae.wait(3e3)])},getErrorMessage(t){return t instanceof Error?t.message:"Unknown Error"},debounce(t,e=500){let r;return(...n)=>{function i(){t(...n)}r&&clearTimeout(r),r=setTimeout(i,e)}},handleMobileLinking(t){const{standaloneUri:e}=De.state,{pairingUri:r}=fr.state,{mobile:n,name:i}=t,o=n?.native,c=n?.universal;xe.setRecentWallet(t);function l(h){let d="";o?d=Ae.formatUniversalUrl(o,h,i):c&&(d=Ae.formatNativeUrl(c,h,i)),Ae.openHref(d,"_self")}l(e||r)},handleAndroidLinking(){const{standaloneUri:t}=De.state,{pairingUri:e}=fr.state;t?(Ae.setWalletConnectAndroidDeepLink(t),Ae.openHref(t,"_self")):(Ae.setWalletConnectAndroidDeepLink(e),Ae.openHref(e,"_self"))},async handleUriCopy(){const{standaloneUri:t}=De.state,{pairingUri:e}=fr.state;t?await navigator.clipboard.writeText(t):await navigator.clipboard.writeText(e),Wr.openToast("Link copied","success")},async handleConnectorConnection(t,e){try{const{selectedChain:r}=De.state;await Ft.client().connectConnector(t,r?.id),Fr.close()}catch(r){console.error(r),e?e():Wr.openToast(xe.getErrorMessage(r),"error")}},getCustomImageUrls(){const{chainImages:t,walletImages:e}=jt.state,r=Object.values(t??{}),n=Object.values(e??{});return Object.values([...r,...n])},truncate(t,e=8){return t.length<=e?t:`${t.substring(0,4)}...${t.substring(t.length-4)}`},generateAvatarColors(t){var e;const r=(e=t.match(/.{1,7}/g))==null?void 0:e.splice(0,5),n=[];r?.forEach(o=>{let c=0;for(let h=0;h<o.length;h+=1)c=o.charCodeAt(h)+((c<<5)-c),c=c&c;const l=[0,0,0];for(let h=0;h<3;h+=1){const d=c>>h*8&255;l[h]=d}n.push(`rgb(${l[0]}, ${l[1]}, ${l[2]})`)});const i=document.querySelector(":root");if(i){const o={"--w3m-color-av-1":n[0],"--w3m-color-av-2":n[1],"--w3m-color-av-3":n[2],"--w3m-color-av-4":n[3],"--w3m-color-av-5":n[4]};Object.entries(o).forEach(([c,l])=>i.style.setProperty(c,l))}},setRecentWallet(t){const{walletConnectVersion:e}=De.state;localStorage.setItem(xe.W3M_RECENT_WALLET_DATA,JSON.stringify({[e]:t}))},getRecentWallet(){const t=localStorage.getItem(xe.W3M_RECENT_WALLET_DATA);if(t){const{walletConnectVersion:e}=De.state,r=JSON.parse(t);if(r[e])return r[e]}},caseSafeIncludes(t,e){return t.toUpperCase().includes(e.toUpperCase())},openWalletExplorerUrl(){Ae.openHref(xe.EXPLORER_WALLET_URL,"_blank")},getCachedRouterWalletPlatforms(){const{id:t,desktop:e,mobile:r,injected:n}=Ae.getWalletRouterData(),i=Xr.installedInjectedWallets(),o=!!(n!=null&&n.length),c=i.some(v=>v.id===t),l=!!(e!=null&&e.native),h=!!(e!=null&&e.universal),d=!!(r!=null&&r.native)||!!(r!=null&&r.universal);return{isInjectedInstalled:c,isInjected:o,isDesktop:l,isMobile:d,isWeb:h}},goToConnectingView(t){tt.setData({Wallet:t});const e=Ae.isMobile(),{isDesktop:r,isWeb:n,isMobile:i,isInjectedInstalled:o}=xe.getCachedRouterWalletPlatforms();e?o?tt.push("InjectedConnecting"):i?tt.push("MobileConnecting"):n?tt.push("WebConnecting"):tt.push("InstallWallet"):o?tt.push("InjectedConnecting"):r?tt.push("DesktopConnecting"):n?tt.push("WebConnecting"):i?tt.push("MobileQrcodeConnecting"):tt.push("InstallWallet")}},I$=Ve`.w3m-router{overflow:hidden;will-change:transform}.w3m-content{display:flex;flex-direction:column}`;var A$=Object.defineProperty,$$=Object.getOwnPropertyDescriptor,Pf=(t,e,r,n)=>{for(var i=n>1?void 0:n?$$(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&A$(e,r,i),i};let ga=class extends Pe{constructor(){super(),this.view=tt.state.view,this.prevView=tt.state.view,this.unsubscribe=void 0,this.oldHeight="0px",this.resizeObserver=void 0,this.unsubscribe=tt.subscribe(t=>{this.view!==t.view&&this.onChangeRoute()})}firstUpdated(){this.resizeObserver=new ResizeObserver(([t])=>{const e=`${t.contentRect.height}px`;this.oldHeight!=="0px"&&ts(this.routerEl,{height:[this.oldHeight,e]},{duration:.2}),this.oldHeight=e}),this.resizeObserver.observe(this.contentEl)}disconnectedCallback(){var t,e;(t=this.unsubscribe)==null||t.call(this),(e=this.resizeObserver)==null||e.disconnect()}get routerEl(){return xe.getShadowRootElement(this,".w3m-router")}get contentEl(){return xe.getShadowRootElement(this,".w3m-content")}viewTemplate(){switch(this.view){case"ConnectWallet":return oe`<w3m-connect-wallet-view></w3m-connect-wallet-view>`;case"SelectNetwork":return oe`<w3m-select-network-view></w3m-select-network-view>`;case"InjectedConnecting":return oe`<w3m-injected-connecting-view></w3m-injected-connecting-view>`;case"DesktopConnecting":return oe`<w3m-desktop-connecting-view></w3m-desktop-connecting-view>`;case"MobileConnecting":return oe`<w3m-mobile-connecting-view></w3m-mobile-connecting-view>`;case"WebConnecting":return oe`<w3m-web-connecting-view></w3m-web-connecting-view>`;case"MobileQrcodeConnecting":return oe`<w3m-mobile-qr-connecting-view></w3m-mobile-qr-connecting-view>`;case"GetWallet":return oe`<w3m-get-wallet-view></w3m-get-wallet-view>`;case"WalletExplorer":return oe`<w3m-wallet-explorer-view></w3m-wallet-explorer-view>`;case"Qrcode":return oe`<w3m-qrcode-view></w3m-qrcode-view>`;case"Help":return oe`<w3m-help-view></w3m-help-view>`;case"Account":return oe`<w3m-account-view></w3m-account-view>`;case"SwitchNetwork":return oe`<w3m-switch-network-view></w3m-switch-network-view>`;case"InstallWallet":return oe`<w3m-install-wallet-view></w3m-install-wallet-view>`;default:return oe`<div>Not Found</div>`}}async onChangeRoute(){await ts(this.routerEl,{opacity:[1,0],scale:[1,1.02]},{duration:.15,delay:.1}).finished,this.view=tt.state.view,ts(this.routerEl,{opacity:[0,1],scale:[.99,1]},{duration:.37,delay:.05})}render(){return oe`<div class="w3m-router"><div class="w3m-content">${this.viewTemplate()}</div></div>`}};ga.styles=[je.globalCss,I$],Pf([gt()],ga.prototype,"view",2),Pf([gt()],ga.prototype,"prevView",2),ga=Pf([Ne("w3m-modal-router")],ga);const O$=Ve`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(--w3m-notification-border-radius);border:1px solid var(--w3m-color-overlay);background-color:var(--w3m-color-overlay)}svg{margin-right:5px}@-moz-document url-prefix(){div{background-color:var(--w3m-color-bg-3)}}.w3m-success path{fill:var(--w3m-accent-color)}.w3m-error path{fill:var(--w3m-error-color)}`;var S$=Object.defineProperty,D$=Object.getOwnPropertyDescriptor,qm=(t,e,r,n)=>{for(var i=n>1?void 0:n?D$(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&S$(e,r,i),i};let Vc=class extends Pe{constructor(){super(),this.open=!1,this.unsubscribe=void 0,this.timeout=void 0,this.unsubscribe=Wr.subscribe(t=>{t.open?(this.open=!0,this.timeout=setTimeout(()=>Wr.closeToast(),2200)):(this.open=!1,clearTimeout(this.timeout))})}disconnectedCallback(){var t;(t=this.unsubscribe)==null||t.call(this),clearTimeout(this.timeout),Wr.closeToast()}render(){const{message:t,variant:e}=Wr.state,r={"w3m-success":e==="success","w3m-error":e==="error"};return this.open?oe`<div class="${Lr(r)}">${e==="success"?Fe.CHECKMARK_ICON:null} ${e==="error"?Fe.CROSS_ICON:null}<w3m-text variant="small-regular">${t}</w3m-text></div>`:null}};Vc.styles=[je.globalCss,O$],qm([gt()],Vc.prototype,"open",2),Vc=qm([Ne("w3m-modal-toast")],Vc);const P$=Ve`button{padding:5px;border-radius:var(--w3m-button-hover-highlight-border-radius);display:flex;flex-direction:column;align-items:center;justify-content:center;width:80px;height:90px;position:relative}w3m-network-image{width:54px;height:59px}w3m-text{width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-align:center;margin-top:5px}button:active{background-color:var(--w3m-color-overlay)}.w3m-unsupported{opacity:.3}@media(hover:hover){button:hover{background-color:var(--w3m-color-overlay)}}`;var T$=Object.defineProperty,R$=Object.getOwnPropertyDescriptor,ma=(t,e,r,n)=>{for(var i=n>1?void 0:n?R$(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&T$(e,r,i),i};let ns=class extends Pe{constructor(){super(...arguments),this.onClick=()=>null,this.name="",this.chainId="",this.unsupported=!1}render(){const t={"w3m-unsupported":this.unsupported};return oe`<button @click="${this.onClick}" class="${Lr(t)}"><w3m-network-image chainId="${this.chainId}"></w3m-network-image><w3m-text variant="xsmall-regular">${this.name}</w3m-text></button>`}};ns.styles=[je.globalCss,P$],ma([$e()],ns.prototype,"onClick",2),ma([$e()],ns.prototype,"name",2),ma([$e()],ns.prototype,"chainId",2),ma([$e()],ns.prototype,"unsupported",2),ns=ma([Ne("w3m-network-button")],ns);const N$=Ve`@keyframes loading{to{stroke-dashoffset:0}}:host{width:inherit;height:inherit;position:relative}path{stroke:var(--w3m-color-overlay)}svg{width:100%;height:100%;margin:0}#network-placeholder-fill{fill:var(--w3m-color-bg-3)}#network-placeholder-dash{stroke:var(--w3m-color-overlay)}image{clip-path:path('M17.033 4.964c3.852-2.262 5.778-3.393 7.84-3.77a11.807 11.807 0 0 1 4.254 0c2.062.377 3.988 1.508 7.84 3.77l6.066 3.562c3.852 2.263 5.777 3.394 7.13 5.022a12.268 12.268 0 0 1 2.127 3.747c.71 2.006.71 4.268.71 8.793v7.124c0 4.525 0 6.787-.71 8.793a12.268 12.268 0 0 1-2.126 3.747c-1.354 1.628-3.28 2.76-7.131 5.022l-6.066 3.562c-3.852 2.262-5.778 3.393-7.84 3.771a11.814 11.814 0 0 1-4.254 0c-2.062-.378-3.988-1.509-7.84-3.77l-6.066-3.563c-3.852-2.263-5.778-3.394-7.13-5.022a12.268 12.268 0 0 1-2.127-3.747C1 40 1 37.737 1 33.212v-7.124c0-4.525 0-6.787.71-8.793a12.268 12.268 0 0 1 2.127-3.747c1.352-1.628 3.278-2.76 7.13-5.022l6.066-3.562Z')}`;var F$=Object.defineProperty,L$=Object.getOwnPropertyDescriptor,Vm=(t,e,r,n)=>{for(var i=n>1?void 0:n?L$(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&F$(e,r,i),i};let Kc=class extends Pe{constructor(){super(...arguments),this.chainId=""}render(){const t=xe.getChainIcon(this.chainId);return t?oe`<svg width="54" height="59" viewBox="0 0 54 59" fill="none"><image href="${t}"/><image href="${t}" width="54" height="59"/><path d="M17.22 5.295c3.877-2.277 5.737-3.363 7.72-3.726a11.44 11.44 0 0 1 4.12 0c1.983.363 3.844 1.45 7.72 3.726l6.065 3.562c3.876 2.276 5.731 3.372 7.032 4.938a11.896 11.896 0 0 1 2.06 3.63c.683 1.928.688 4.11.688 8.663v7.124c0 4.553-.005 6.735-.688 8.664a11.896 11.896 0 0 1-2.06 3.63c-1.3 1.565-3.156 2.66-7.032 4.937l-6.065 3.563c-3.877 2.276-5.737 3.362-7.72 3.725a11.46 11.46 0 0 1-4.12 0c-1.983-.363-3.844-1.449-7.72-3.726l-6.065-3.562c-3.876-2.276-5.731-3.372-7.032-4.938a11.885 11.885 0 0 1-2.06-3.63c-.682-1.928-.688-4.11-.688-8.663v-7.124c0-4.553.006-6.735.688-8.664a11.885 11.885 0 0 1 2.06-3.63c1.3-1.565 3.156-2.66 7.032-4.937l6.065-3.562Z"/></svg>`:oe`${Fe.NETWORK_PLACEHOLDER}`}};Kc.styles=[je.globalCss,N$],Vm([$e()],Kc.prototype,"chainId",2),Kc=Vm([Ne("w3m-network-image")],Kc);const M$=.1,Km=2.5,Yn=7;function Tf(t,e,r){return t===e?!1:(t-e<0?e-t:t-e)<=r+M$}function U$(t,e){const r=Array.prototype.slice.call(la.create(t,{errorCorrectionLevel:e}).modules.data,0),n=Math.sqrt(r.length);return r.reduce((i,o,c)=>(c%n===0?i.push([o]):i[i.length-1].push(o))&&i,[])}const j$={generate(t,e,r,n){const i=n==="light"?"#141414":"#fff",o=n==="light"?"#fff":"#141414",c=[],l=U$(t,"Q"),h=e/l.length,d=[{x:0,y:0},{x:1,y:0},{x:0,y:1}];d.forEach(({x:L,y:k})=>{const q=(l.length-Yn)*h*L,R=(l.length-Yn)*h*k,F=.32;for(let $=0;$<d.length;$+=1){const T=h*(Yn-$*2);c.push(ut`<rect fill="${$%2===0?i:o}" height="${T}" rx="${T*F}" ry="${T*F}" width="${T}" x="${q+h*$}" y="${R+h*$}">`)}});const v=Math.floor((r+25)/h),x=l.length/2-v/2,_=l.length/2+v/2-1,A=[];l.forEach((L,k)=>{L.forEach((q,R)=>{if(l[k][R]&&!(k<Yn&&R<Yn||k>l.length-(Yn+1)&&R<Yn||k<Yn&&R>l.length-(Yn+1))&&!(k>x&&k<_&&R>x&&R<_)){const F=k*h+h/2,$=R*h+h/2;A.push([F,$])}})});const P={};return A.forEach(([L,k])=>{P[L]?P[L].push(k):P[L]=[k]}),Object.entries(P).map(([L,k])=>{const q=k.filter(R=>k.every(F=>!Tf(R,F,h)));return[Number(L),q]}).forEach(([L,k])=>{k.forEach(q=>{c.push(ut`<circle cx="${L}" cy="${q}" fill="${i}" r="${h/Km}">`)})}),Object.entries(P).filter(([L,k])=>k.length>1).map(([L,k])=>{const q=k.filter(R=>k.some(F=>Tf(R,F,h)));return[Number(L),q]}).map(([L,k])=>{k.sort((R,F)=>R<F?-1:1);const q=[];for(const R of k){const F=q.find($=>$.some(T=>Tf(R,T,h)));F?F.push(R):q.push([R])}return[L,q.map(R=>[R[0],R[R.length-1]])]}).forEach(([L,k])=>{k.forEach(([q,R])=>{c.push(ut`<line x1="${L}" x2="${L}" y1="${q}" y2="${R}" stroke="${i}" stroke-width="${h/(Km/2)}" stroke-linecap="round">`)})}),c}},B$=Ve`@keyframes fadeIn{0%{opacity:0}100%{opacity:1}}div{position:relative;user-select:none;display:block;overflow:hidden;width:100%;aspect-ratio:1/1;animation:fadeIn ease .2s}svg:first-child,w3m-wallet-image{position:absolute;top:50%;left:50%;transform:translateY(-50%) translateX(-50%)}w3m-wallet-image{transform:translateY(-50%) translateX(-50%)}w3m-wallet-image{width:25%;height:25%;border-radius:var(--w3m-wallet-icon-border-radius)}svg:first-child{transform:translateY(-50%) translateX(-50%) scale(.9)}svg:first-child path:first-child{fill:var(--w3m-accent-color)}svg:first-child path:last-child{stroke:var(--w3m-color-overlay)}`;var k$=Object.defineProperty,H$=Object.getOwnPropertyDescriptor,Gs=(t,e,r,n)=>{for(var i=n>1?void 0:n?H$(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&k$(e,r,i),i};let Jn=class extends Pe{constructor(){super(...arguments),this.uri="",this.size=0,this.imageId=void 0,this.walletId=void 0,this.imageUrl=void 0}svgTemplate(){var t;const e=(t=Un.state.themeMode)!=null?t:"light";return ut`<svg height="${this.size}" width="${this.size}">${j$.generate(this.uri,this.size,this.size/4,e)}</svg>`}render(){return oe`<div>${this.walletId||this.imageUrl?oe`<w3m-wallet-image walletId="${this.walletId}" imageId="${this.imageId}" imageUrl="${this.imageUrl}"></w3m-wallet-image>`:Fe.WALLET_CONNECT_ICON_COLORED} ${this.svgTemplate()}<w3m-theme-context></w3m-theme-context></div>`}};Jn.styles=[je.globalCss,B$],Gs([$e()],Jn.prototype,"uri",2),Gs([$e({type:Number})],Jn.prototype,"size",2),Gs([$e()],Jn.prototype,"imageId",2),Gs([$e()],Jn.prototype,"walletId",2),Gs([$e()],Jn.prototype,"imageUrl",2),Jn=Gs([Ne("w3m-qrcode")],Jn);const z$=Ve`:host{position:relative;height:28px;width:80%}input{width:100%;height:100%;line-height:28px!important;border-radius:var(--w3m-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(--w3m-color-fg-1);background-color:var(--w3m-color-bg-3);box-shadow:inset 0 0 0 1px var(--w3m-color-overlay);caret-color:var(--w3m-accent-color)}input::placeholder{color:var(--w3m-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(--w3m-accent-color)}path{fill:var(--w3m-color-fg-2)}`;var W$=Object.defineProperty,q$=Object.getOwnPropertyDescriptor,Gm=(t,e,r,n)=>{for(var i=n>1?void 0:n?q$(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&W$(e,r,i),i};let Gc=class extends Pe{constructor(){super(...arguments),this.onChange=()=>null}render(){return oe`<input type="text" @input="${this.onChange}" placeholder="Search wallets"> ${Fe.SEARCH_ICON}`}};Gc.styles=[je.globalCss,z$],Gm([$e()],Gc.prototype,"onChange",2),Gc=Gm([Ne("w3m-search-input")],Gc);const V$=Ve`@keyframes rotate{100%{transform:rotate(360deg)}}@keyframes dash{0%{stroke-dasharray:1,150;stroke-dashoffset:0}50%{stroke-dasharray:90,150;stroke-dashoffset:-35}100%{stroke-dasharray:90,150;stroke-dashoffset:-124}}svg{animation:rotate 2s linear infinite;display:flex;justify-content:center;align-items:center}svg circle{stroke-linecap:round;animation:dash 1.5s ease infinite;stroke:var(--w3m-accent-color)}`;var K$=Object.defineProperty,G$=Object.getOwnPropertyDescriptor,Z$=(t,e,r,n)=>{for(var i=n>1?void 0:n?G$(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&K$(e,r,i),i};let Rf=class extends Pe{render(){return oe`<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>`}};Rf.styles=[je.globalCss,V$],Rf=Z$([Ne("w3m-spinner")],Rf);const Y$=Ve`span{font-style:normal;font-family:var(--w3m-font-family);font-feature-settings:'tnum' on,'lnum' on,'case' on}.w3m-xsmall-bold{font-family:var(--w3m-text-xsmall-bold-font-family);font-weight:var(--w3m-text-xsmall-bold-weight);font-size:var(--w3m-text-xsmall-bold-size);line-height:var(--w3m-text-xsmall-bold-line-height);letter-spacing:var(--w3m-text-xsmall-bold-letter-spacing);text-transform:var(--w3m-text-xsmall-bold-text-transform)}.w3m-xsmall-regular{font-family:var(--w3m-text-xsmall-regular-font-family);font-weight:var(--w3m-text-xsmall-regular-weight);font-size:var(--w3m-text-xsmall-regular-size);line-height:var(--w3m-text-xsmall-regular-line-height);letter-spacing:var(--w3m-text-xsmall-regular-letter-spacing);text-transform:var(--w3m-text-xsmall-regular-text-transform)}.w3m-small-thin{font-family:var(--w3m-text-small-thin-font-family);font-weight:var(--w3m-text-small-thin-weight);font-size:var(--w3m-text-small-thin-size);line-height:var(--w3m-text-small-thin-line-height);letter-spacing:var(--w3m-text-small-thin-letter-spacing);text-transform:var(--w3m-text-small-thin-text-transform)}.w3m-small-regular{font-family:var(--w3m-text-small-regular-font-family);font-weight:var(--w3m-text-small-regular-weight);font-size:var(--w3m-text-small-regular-size);line-height:var(--w3m-text-small-regular-line-height);letter-spacing:var(--w3m-text-small-regular-letter-spacing);text-transform:var(--w3m-text-small-regular-text-transform)}.w3m-medium-regular{font-family:var(--w3m-text-medium-regular-font-family);font-weight:var(--w3m-text-medium-regular-weight);font-size:var(--w3m-text-medium-regular-size);line-height:var(--w3m-text-medium-regular-line-height);letter-spacing:var(--w3m-text-medium-regular-letter-spacing);text-transform:var(--w3m-text-medium-regular-text-transform)}.w3m-big-bold{font-family:var(--w3m-text-big-bold-font-family);font-weight:var(--w3m-text-big-bold-weight);font-size:var(--w3m-text-big-bold-size);line-height:var(--w3m-text-big-bold-line-height);letter-spacing:var(--w3m-text-big-bold-letter-spacing);text-transform:var(--w3m-text-big-bold-text-transform)}:host(*){color:var(--w3m-color-fg-1)}.w3m-color-primary{color:var(--w3m-color-fg-1)}.w3m-color-secondary{color:var(--w3m-color-fg-2)}.w3m-color-tertiary{color:var(--w3m-color-fg-3)}.w3m-color-inverse{color:var(--w3m-accent-fill-color)}.w3m-color-accnt{color:var(--w3m-accent-color)}.w3m-color-error{color:var(--w3m-error-color)}`;var J$=Object.defineProperty,X$=Object.getOwnPropertyDescriptor,Nf=(t,e,r,n)=>{for(var i=n>1?void 0:n?X$(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&J$(e,r,i),i};let wa=class extends Pe{constructor(){super(...arguments),this.variant="medium-regular",this.color="primary"}render(){const t={"w3m-big-bold":this.variant==="big-bold","w3m-medium-regular":this.variant==="medium-regular","w3m-small-regular":this.variant==="small-regular","w3m-small-thin":this.variant==="small-thin","w3m-xsmall-regular":this.variant==="xsmall-regular","w3m-xsmall-bold":this.variant==="xsmall-bold","w3m-color-primary":this.color==="primary","w3m-color-secondary":this.color==="secondary","w3m-color-tertiary":this.color==="tertiary","w3m-color-inverse":this.color==="inverse","w3m-color-accnt":this.color==="accent","w3m-color-error":this.color==="error"};return oe`<span><slot class="${Lr(t)}"></slot></span>`}};wa.styles=[je.globalCss,Y$],Nf([$e()],wa.prototype,"variant",2),Nf([$e()],wa.prototype,"color",2),wa=Nf([Ne("w3m-text")],wa);const Q$=Ve`div{overflow:hidden;position:relative;border-radius:50%}div::after{content:'';position:absolute;top:0;bottom:0;left:0;right:0;border-radius:50%;border:1px solid var(--w3m-color-overlay)}div img{width:100%;height:100%;object-fit:cover;object-position:center}svg{width:100%;height:100%}#token-placeholder-fill{fill:var(--w3m-color-bg-3)}#token-placeholder-dash{stroke:var(--w3m-color-overlay)}`;var eO=Object.defineProperty,tO=Object.getOwnPropertyDescriptor,Zm=(t,e,r,n)=>{for(var i=n>1?void 0:n?tO(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&eO(e,r,i),i};let Zc=class extends Pe{constructor(){super(...arguments),this.symbol=void 0}render(){var t;const e=xe.getTokenIcon((t=this.symbol)!=null?t:"");return e?oe`<div><img src="${e}" alt="${this.id}"></div>`:Fe.TOKEN_PLACEHOLDER}};Zc.styles=[je.globalCss,Q$],Zm([$e()],Zc.prototype,"symbol",2),Zc=Zm([Ne("w3m-token-image")],Zc);const rO=Ve`button{width:100%;height:100%;border-radius:var(--w3m-button-hover-highlight-border-radius);display:flex;align-items:flex-start}button:active{background-color:var(--w3m-color-overlay)}@media(hover:hover){button:hover{background-color:var(--w3m-color-overlay)}}button>div{width:80px;padding:5px 0;display:flex;flex-direction:column;align-items:center}w3m-text{width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-align:center}w3m-wallet-image{height:60px;width:60px;transition:all .2s ease;border-radius:var(--w3m-wallet-icon-border-radius);margin-bottom:5px}.w3m-sublabel{margin-top:2px}`;var nO=Object.defineProperty,iO=Object.getOwnPropertyDescriptor,Ci=(t,e,r,n)=>{for(var i=n>1?void 0:n?iO(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&nO(e,r,i),i};let Bn=class extends Pe{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?oe`<w3m-text class="w3m-sublabel" variant="xsmall-bold" color="tertiary">RECENT</w3m-text>`:this.installed?oe`<w3m-text class="w3m-sublabel" variant="xsmall-bold" color="tertiary">INSTALLED</w3m-text>`:null}handleClick(){wi.click({name:"WALLET_BUTTON",walletId:this.walletId}),this.onClick()}render(){var t;return oe`<button @click="${this.handleClick.bind(this)}"><div><w3m-wallet-image walletId="${this.walletId}" imageId="${this.imageId}"></w3m-wallet-image><w3m-text variant="xsmall-regular">${(t=this.label)!=null?t:xe.getWalletName(this.name,!0)}</w3m-text>${this.sublabelTemplate()}</div></button>`}};Bn.styles=[je.globalCss,rO],Ci([$e()],Bn.prototype,"onClick",2),Ci([$e()],Bn.prototype,"name",2),Ci([$e()],Bn.prototype,"walletId",2),Ci([$e()],Bn.prototype,"label",2),Ci([$e()],Bn.prototype,"imageId",2),Ci([$e()],Bn.prototype,"installed",2),Ci([$e()],Bn.prototype,"recent",2),Bn=Ci([Ne("w3m-wallet-button")],Bn);const sO=Ve`:host{display:block}div{overflow:hidden;position:relative;border-radius:inherit;width:100%;height:100%;background-color:var(--w3m-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(--w3m-color-overlay)}div img{width:100%;height:100%;object-fit:cover;object-position:center}#wallet-placeholder-fill{fill:var(--w3m-color-bg-3)}#wallet-placeholder-dash{stroke:var(--w3m-color-overlay)}`;var oO=Object.defineProperty,aO=Object.getOwnPropertyDescriptor,Yc=(t,e,r,n)=>{for(var i=n>1?void 0:n?aO(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&oO(e,r,i),i};let Zs=class extends Pe{constructor(){super(...arguments),this.walletId="",this.imageId=void 0,this.imageUrl=void 0}render(){var t;const e=(t=this.imageUrl)!=null&&t.length?this.imageUrl:xe.getWalletIcon({id:this.walletId,image_id:this.imageId});return oe`${e.length?oe`<div><img src="${e}" alt="${this.id}"></div>`:Fe.WALLET_PLACEHOLDER}`}};Zs.styles=[je.globalCss,sO],Yc([$e()],Zs.prototype,"walletId",2),Yc([$e()],Zs.prototype,"imageId",2),Yc([$e()],Zs.prototype,"imageUrl",2),Zs=Yc([Ne("w3m-wallet-image")],Zs);var cO=Object.defineProperty,lO=Object.getOwnPropertyDescriptor,uO=(t,e,r,n)=>{for(var i=n>1?void 0:n?lO(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&cO(e,r,i),i};let Ym=class extends Pe{constructor(){super(),this.unwatchAccount=void 0,xt.getAccount(),this.fetchProfile(),this.fetchBalance(),this.unwatchAccount=Ft.client().watchAccount(t=>{const{address:e,isConnected:r}=xt.state;t.isConnected&&t.address!==e&&(this.fetchProfile(t.address),this.fetchBalance(t.address),xt.setAddress(t.address)),t.isConnected||xt.resetAccount(),r!==t.isConnected&&Fr.close(),!r&&t.isConnected?wi.track({name:"ACCOUNT_CONNECTED"}):r&&!t.isConnected&&wi.track({name:"ACCOUNT_DISCONNECTED"}),xt.setIsConnected(t.isConnected)})}disconnectedCallback(){var t;(t=this.unwatchAccount)==null||t.call(this)}async fetchProfile(t){var e;const r=(e=De.state.chains)==null?void 0:e.find(n=>n.id===1);if(jt.state.enableAccountView&&r)try{await xt.fetchProfile(xe.preloadImage,t)}catch(n){console.error(n),Wr.openToast(xe.getErrorMessage(n),"error")}}async fetchBalance(t){if(jt.state.enableAccountView)try{await xt.fetchBalance(t)}catch(e){console.error(e),Wr.openToast(xe.getErrorMessage(e),"error")}}};Ym=uO([Ne("w3m-account-context")],Ym);var hO=Object.defineProperty,fO=Object.getOwnPropertyDescriptor,Jm=(t,e,r,n)=>{for(var i=n>1?void 0:n?fO(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&hO(e,r,i),i};let Ff=class extends Pe{constructor(){super(),this.preload=!0,this.preloadData()}async loadImages(t){try{t!=null&&t.length&&await Promise.all(t.map(async e=>xe.preloadImage(e)))}catch{console.info("Unsuccessful attempt at preloading some images",t)}}async preloadListings(){var t;if(jt.state.enableExplorer){const{chains:e}=De.state;await Promise.all([ir.getRecomendedWallets(),ir.getInjectedWallets()]),De.setIsDataLoaded(!0);const{recomendedWallets:r}=ir.state,n=Xr.installedInjectedWallets(),i=(t=e?.map(l=>xe.getChainIcon(l.id)))!=null?t:[],o=r.map(l=>xe.getWalletIcon(l)),c=n.map(l=>xe.getWalletIcon(l));await this.loadImages([...i,...o,...c])}else De.setIsDataLoaded(!0)}async preloadCustomImages(){const t=xe.getCustomImageUrls();await this.loadImages(t)}async preloadData(){try{this.preload&&(this.preload=!1,await Promise.all([this.preloadListings(),this.preloadCustomImages()]))}catch(t){console.error(t),Wr.openToast("Failed preloading","error")}}};Jm([gt()],Ff.prototype,"preload",2),Ff=Jm([Ne("w3m-explorer-context")],Ff);var dO=Object.defineProperty,pO=Object.getOwnPropertyDescriptor,Xm=(t,e,r,n)=>{for(var i=n>1?void 0:n?pO(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&dO(e,r,i),i};let Lf=class extends Pe{constructor(){super(),this.activeChainId=void 0,this.unwatchNetwork=void 0;const t=De.getSelectedChain();this.activeChainId=t?.id,this.unwatchNetwork=Ft.client().watchNetwork(e=>{const r=e.chain;r&&this.activeChainId!==r.id&&(De.setSelectedChain(r),this.activeChainId=r.id,xt.resetBalance(),this.fetchBalance())})}disconnectedCallback(){var t;(t=this.unwatchNetwork)==null||t.call(this)}async fetchBalance(){if(jt.state.enableAccountView)try{await xt.fetchBalance()}catch(t){console.error(t),Wr.openToast(xe.getErrorMessage(t),"error")}}};Xm([gt()],Lf.prototype,"activeChainId",2),Lf=Xm([Ne("w3m-network-context")],Lf);var gO=Object.defineProperty,mO=Object.getOwnPropertyDescriptor,wO=(t,e,r,n)=>{for(var i=n>1?void 0:n?mO(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&gO(e,r,i),i};let Qm=class extends Pe{constructor(){super(),this.unsubscribeTheme=void 0,je.setTheme(),this.unsubscribeTheme=Un.subscribe(je.setTheme),this.preloadThemeImages()}disconnectedCallback(){var t;(t=this.unsubscribeTheme)==null||t.call(this)}async preloadThemeImages(){try{const{themeVariables:t}=Un.state,e=[t?.["--w3m-background-image-url"],t?.["--w3m-logo-image-url"]].filter(Boolean);e.length&&await Promise.all(e.map(async r=>xe.preloadImage(r)))}catch{console.info("Unsuccessful attempt at preloading some images")}}};Qm=wO([Ne("w3m-theme-context")],Qm);var vO=Object.defineProperty,yO=Object.getOwnPropertyDescriptor,bO=(t,e,r,n)=>{for(var i=n>1?void 0:n?yO(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&vO(e,r,i),i};const _O=24e4,EO=1e3;var e2;let t2=class extends Pe{constructor(){super(),this.unwatchOptions=void 0,this.unwatchAccount=void 0,this.timeout=void 0,this.isGenerated=!1,this.selectedChainId=(e2=De.state.selectedChain)==null?void 0:e2.id,this.isAccountConnected=xt.state.isConnected,this.lastRetry=Date.now(),this.unwatchOptions=De.subscribe(t=>{var e,r;((e=t.selectedChain)==null?void 0:e.id)!==this.selectedChainId&&(this.selectedChainId=(r=t.selectedChain)==null?void 0:r.id,this.connectAndWait())}),this.unwatchAccount=xt.subscribe(t=>{(this.isAccountConnected!==t.isConnected||!this.isGenerated)&&(this.isAccountConnected=t.isConnected,setTimeout(this.connectAndWait.bind(this),0))})}disconnectedCallback(){var t,e;(t=this.unwatchOptions)==null||t.call(this),(e=this.unwatchAccount)==null||e.call(this)}async connectAndWait(){if(clearTimeout(this.timeout),!this.isAccountConnected){this.isGenerated=!0,this.timeout=setTimeout(this.connectAndWait.bind(this),_O);try{const{standaloneUri:t,selectedChain:e}=De.state;t?fr.setPairingUri(t):await Ft.client().connectWalletConnect(r=>fr.setPairingUri(r),e?.id)}catch(t){console.error(t),fr.setPairingError(!0),Wr.openToast("Connection request declined","error"),Date.now()-this.lastRetry>=EO&&(this.lastRetry=Date.now(),this.connectAndWait())}}}};t2=bO([Ne("w3m-wc-connection-context")],t2);const xO=Ve`:host{all:initial}div{display:flex;align-items:center;background-color:var(--w3m-color-overlay);box-shadow:inset 0 0 0 1px var(--w3m-color-overlay);border-radius:var(--w3m-button-border-radius);padding:4px 4px 4px 8px}div button{border-radius:var(--w3m-secondary-button-border-radius);padding:4px 8px;padding-left:4px;height:auto;margin-left:10px;color:var(--w3m-accent-fill-color);background-color:var(--w3m-accent-color)}.w3m-no-avatar{padding-left:8px}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(--w3m-color-overlay)}button:hover::after{background-color:var(--w3m-color-overlay)}w3m-avatar{margin-right:6px}w3m-button-big w3m-avatar{margin-left:-5px}`;var CO=Object.defineProperty,IO=Object.getOwnPropertyDescriptor,Mf=(t,e,r,n)=>{for(var i=n>1?void 0:n?IO(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&CO(e,r,i),i};let Ys=class extends Pe{constructor(){super(),this.balance="hide",this.avatar="show",xe.rejectStandaloneButtonComponent()}onOpen(){const{isStandalone:t}=De.state;t||(wi.click({name:"ACCOUNT_BUTTON"}),Fr.open({route:"Account"}))}accountTemplate(){const t=this.avatar==="show";return oe`${t?oe`<w3m-avatar></w3m-avatar>`:null}<w3m-address-text></w3m-address-text>`}render(){const t=this.balance==="show",e={"w3m-no-avatar":this.avatar==="hide"};return t?oe`<div><w3m-balance></w3m-balance><button @click="${this.onOpen}" class="${Lr(e)}">${this.accountTemplate()}</button></div>`:oe`<w3m-button-big @click="${this.onOpen}">${this.accountTemplate()}</w3m-button-big>`}};Ys.styles=[je.globalCss,xO],Mf([$e()],Ys.prototype,"balance",2),Mf([$e()],Ys.prototype,"avatar",2),Ys=Mf([Ne("w3m-account-button")],Ys);const AO=Ve`button{display:flex;border-radius:var(--w3m-button-hover-highlight-border-radius);flex-direction:column;justify-content:center;padding:5px;width:100px}button:active{background-color:var(--w3m-color-overlay)}@media(hover:hover){button:hover{background-color:var(--w3m-color-overlay)}}button:disabled{pointer-events:none}w3m-network-image{width:32px;height:32px}w3m-text{margin-top:4px}`;var $O=Object.defineProperty,OO=Object.getOwnPropertyDescriptor,Uf=(t,e,r,n)=>{for(var i=n>1?void 0:n?OO(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&$O(e,r,i),i};let va=class extends Pe{constructor(){super(),this.chainId=0,this.label="",this.unsubscribeNetwork=void 0;const{selectedChain:t}=De.state;this.chainId=t?.id,this.label=t?.name,this.unsubscribeNetwork=De.subscribe(({selectedChain:e})=>{this.chainId=e?.id,this.label=e?.name})}disconnectedCallback(){var t;(t=this.unsubscribeNetwork)==null||t.call(this)}onClick(){tt.push("SelectNetwork")}render(){const{chains:t,selectedChain:e}=De.state,r=t?.map(o=>o.id),n=e&&r?.includes(e.id),i=t&&t.length<=1&&n;return oe`<button @click="${this.onClick}" ?disabled="${i}"><w3m-network-image chainId="${this.chainId}"></w3m-network-image><w3m-text variant="xsmall-regular" color="accent">${this.label}</w3m-text></button>`}};va.styles=[je.globalCss,AO],Uf([gt()],va.prototype,"chainId",2),Uf([gt()],va.prototype,"label",2),va=Uf([Ne("w3m-account-network-button")],va);const SO=Ve`@keyframes slide{0%{background-position:0 0}100%{background-position:200px 0}}w3m-text{padding:1px 0}.w3m-loading{background:linear-gradient(270deg,var(--w3m-color-fg-1) 36.33%,var(--w3m-color-fg-3) 42.07%,var(--w3m-color-fg-1) 83.3%);background-size:200px 100%;background-clip:text;-webkit-background-clip:text;-webkit-text-fill-color:transparent;animation-name:slide;animation-duration:1.5s;animation-iteration-count:infinite;animation-timing-function:linear}`;var DO=Object.defineProperty,PO=Object.getOwnPropertyDescriptor,ya=(t,e,r,n)=>{for(var i=n>1?void 0:n?PO(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&DO(e,r,i),i};let is=class extends Pe{constructor(){super(),this.address=void 0,this.name=void 0,this.loading=!0,this.variant="button",this.unsubscribeAccount=void 0,this.address=xt.state.address,this.name=xt.state.profileName,this.loading=!!xt.state.profileLoading,this.unsubscribeAccount=xt.subscribe(({address:t,profileName:e,profileLoading:r})=>{this.address=t,this.name=e,this.loading=!!r})}disconnectedCallback(){var t;(t=this.unsubscribeAccount)==null||t.call(this)}render(){var t;const e=this.variant==="button",r={"w3m-loading":this.loading};return oe`<w3m-text class="${Lr(r)}" variant="${e?"medium-regular":"big-bold"}" color="${e?"inverse":"primary"}">${this.name?this.name:xe.truncate((t=this.address)!=null?t:"")}</w3m-text>`}};is.styles=[je.globalCss,SO],ya([gt()],is.prototype,"address",2),ya([gt()],is.prototype,"name",2),ya([gt()],is.prototype,"loading",2),ya([$e()],is.prototype,"variant",2),is=ya([Ne("w3m-address-text")],is);const Mr={onConnecting(t){xe.goToConnectingView(t)},onExternal(t){xe.handleConnectorConnection(t)},manualWalletsTemplate(){return Xr.manualWallets().map(t=>oe`<w3m-wallet-button walletId="${t.id}" name="${t.name}" .onClick="${()=>this.onConnecting(t)}"></w3m-wallet-button>`)},recomendedWalletsTemplate(t=!1){return Xr.recomendedWallets(t).map(e=>oe`<w3m-wallet-button walletId="${e.id}" imageId="${e.image_id}" name="${e.name}" .onClick="${()=>this.onConnecting(e)}"></w3m-wallet-button>`)},externalWalletsTemplate(){return Xr.externalWallets().map(t=>oe`<w3m-wallet-button name="${t.name}" walletId="${t.id}" .onClick="${()=>this.onExternal(t.id)}"></w3m-wallet-button>`)},recentWalletTemplate(){const t=Xr.recentWallet();if(t)return oe`<w3m-wallet-button name="${t.name}" walletId="${t.id}" imageId="${t.image_id}" .recent="${!0}" .onClick="${()=>this.onConnecting(t)}"></w3m-wallet-button>`},installedInjectedWalletsTemplate(){return Xr.installedInjectedWallets().map(t=>oe`<w3m-wallet-button .installed="${!0}" name="${t.name}" walletId="${t.id}" imageId="${t.image_id}" .onClick="${()=>this.onConnecting(t)}"></w3m-wallet-button>`)},injectedWalletsTemplate(){return Xr.injectedWallets().map(t=>oe`<w3m-wallet-button name="${t.name}" walletId="${t.id}" imageId="${t.image_id}" .onClick="${()=>this.onConnecting(t)}"></w3m-wallet-button>`)}},TO=Ve`@keyframes scroll{0%{transform:translate3d(0,0,0)}100%{transform:translate3d(calc(-70px * 9),0,0)}}.w3m-slider{position:relative;overflow-x:hidden;padding:10px 0;margin:0 -20px;width:calc(100% + 40px)}.w3m-track{display:flex;width:calc(70px * 18);animation:scroll 20s linear infinite;opacity:.7}.w3m-track svg{margin:0 5px}w3m-wallet-image{width:60px;height:60px;margin:0 5px;border-radius:var(--w3m-wallet-icon-border-radius)}.w3m-grid{display:grid;grid-template-columns:repeat(4,80px);justify-content:space-between}.w3m-title{display:flex;align-items:center;margin-bottom:10px}.w3m-title svg{margin-right:6px}.w3m-title path{fill:var(--w3m-accent-color)}w3m-modal-footer .w3m-title{padding:0 10px}w3m-button-big{position:absolute;top:50%;left:50%;transform:translateY(-50%) translateX(-50%);filter:drop-shadow(0 0 17px var(--w3m-color-bg-1))}w3m-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}w3m-info-footer w3m-text{text-align:center;margin-bottom:15px}#wallet-placeholder-fill{fill:var(--w3m-color-bg-3)}#wallet-placeholder-dash{stroke:var(--w3m-color-overlay)}`;var RO=Object.defineProperty,NO=Object.getOwnPropertyDescriptor,FO=(t,e,r,n)=>{for(var i=n>1?void 0:n?NO(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&RO(e,r,i),i};let jf=class extends Pe{onGoToQrcode(){tt.push("Qrcode")}onGetWallet(){tt.push("GetWallet")}render(){const{recomendedWallets:t}=ir.state,e=[...t,...t],r=Mr.externalWalletsTemplate(),n=Mr.installedInjectedWalletsTemplate(),i=[...n,...r].length>0,o=Ae.RECOMMENDED_WALLET_AMOUNT*2;return oe`<w3m-modal-header title="Connect your wallet" .onAction="${this.onGoToQrcode}" .actionIcon="${Fe.QRCODE_ICON}"></w3m-modal-header><w3m-modal-content><div class="w3m-title">${Fe.MOBILE_ICON}<w3m-text variant="small-regular" color="accent">WalletConnect</w3m-text></div><div class="w3m-slider"><div class="w3m-track">${[...Array(o)].map((c,l)=>{const h=e[l%e.length];return h?oe`<w3m-wallet-image walletId="${h.id}" imageId="${h.image_id}"></w3m-wallet-image>`:Fe.WALLET_PLACEHOLDER})}</div><w3m-button-big @click="${xe.handleAndroidLinking}"><w3m-text variant="medium-regular" color="inverse">Select Wallet</w3m-text></w3m-button-big></div></w3m-modal-content>${i?oe`<w3m-modal-footer><div class="w3m-title">${Fe.WALLET_ICON}<w3m-text variant="small-regular" color="accent">Other</w3m-text></div><div class="w3m-grid">${n} ${r}</div></w3m-modal-footer>`:null}<w3m-info-footer><w3m-text color="secondary" variant="small-thin">${`Choose WalletConnect to see supported apps on your device${i?", or select from other options":""}`}</w3m-text><w3m-button variant="outline" .iconRight="${Fe.ARROW_UP_RIGHT_ICON}" .onClick="${()=>this.onGetWallet()}">I don't have a wallet</w3m-button></w3m-info-footer>`}};jf.styles=[je.globalCss,TO],jf=FO([Ne("w3m-android-wallet-selection")],jf);const LO=Ve`@keyframes slide{0%{transform:translateX(-50px)}100%{transform:translateX(200px)}}.w3m-placeholder,img{border-radius:50%;box-shadow:inset 0 0 0 1px var(--w3m-color-overlay);display:block;position:relative;overflow:hidden!important;background-color:var(--w3m-color-av-1);background-image:radial-gradient(at 66% 77%,var(--w3m-color-av-2) 0,transparent 50%),radial-gradient(at 29% 97%,var(--w3m-color-av-3) 0,transparent 50%),radial-gradient(at 99% 86%,var(--w3m-color-av-4) 0,transparent 50%),radial-gradient(at 29% 88%,var(--w3m-color-av-5) 0,transparent 50%);transform:translateZ(0)}.w3m-loader{width:50px;height:100%;background:linear-gradient(270deg,transparent 0,rgba(255,255,255,.4) 30%,transparent 100%);animation-name:slide;animation-duration:1.5s;transform:translateX(-50px);animation-iteration-count:infinite;animation-timing-function:linear;animation-delay:.55s}.w3m-small{width:24px;height:24px}.w3m-medium{width:60px;height:60px}`;var MO=Object.defineProperty,UO=Object.getOwnPropertyDescriptor,ba=(t,e,r,n)=>{for(var i=n>1?void 0:n?UO(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&MO(e,r,i),i};let ss=class extends Pe{constructor(){super(),this.address=void 0,this.avatar=void 0,this.loading=!0,this.size="small",this.unsubscribeAccount=void 0,this.address=xt.state.address,this.avatar=xt.state.profileAvatar,this.loading=!!xt.state.profileLoading,this.unsubscribeAccount=xt.subscribe(({address:t,profileAvatar:e,profileLoading:r})=>{this.address=t,this.avatar=e,this.loading=!!r})}disconnectedCallback(){var t;(t=this.unsubscribeAccount)==null||t.call(this)}render(){const t={"w3m-placeholder":!0,"w3m-small":this.size==="small","w3m-medium":this.size==="medium"};return this.avatar?oe`<img class="${Lr(t)}" src="${this.avatar}">`:this.address?(xe.generateAvatarColors(this.address),oe`<div class="${Lr(t)}">${this.loading?oe`<div class="w3m-loader"></div>`:null}</div>`):null}};ss.styles=[je.globalCss,LO],ba([gt()],ss.prototype,"address",2),ba([gt()],ss.prototype,"avatar",2),ba([gt()],ss.prototype,"loading",2),ba([$e()],ss.prototype,"size",2),ss=ba([Ne("w3m-avatar")],ss);const jO=Ve`div{display:flex;align-items:center}w3m-token-image{width:28px;height:28px;margin-right:6px}`;var BO=Object.defineProperty,kO=Object.getOwnPropertyDescriptor,Bf=(t,e,r,n)=>{for(var i=n>1?void 0:n?kO(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&BO(e,r,i),i};let _a=class extends Pe{constructor(){var t,e;super(),this.symbol=void 0,this.amount=void 0,this.unsubscribeAccount=void 0,this.symbol=(t=xt.state.balance)==null?void 0:t.symbol,this.amount=(e=xt.state.balance)==null?void 0:e.amount,this.unsubscribeAccount=xt.subscribe(({balance:r})=>{this.symbol=r?.symbol,this.amount=r?.amount})}disconnectedCallback(){var t;(t=this.unsubscribeAccount)==null||t.call(this)}render(){let t="_._";return this.amount==="0.0"?t="0":typeof this.amount=="string"&&this.amount.length>6?t=this.amount.substring(0,6):typeof this.amount=="string"&&(t=this.amount),oe`<div><w3m-token-image symbol="${this.symbol}"></w3m-token-image><w3m-text variant="medium-regular" color="primary">${t} ${this.symbol}</w3m-text></div>`}};_a.styles=[je.globalCss,jO],Bf([gt()],_a.prototype,"symbol",2),Bf([gt()],_a.prototype,"amount",2),_a=Bf([Ne("w3m-balance")],_a);const HO=Ve`:host{all:initial}svg{width:28px;height:20px;margin:-1px 3px 0 -5px}svg path{fill:var(--w3m-accent-fill-color)}button:disabled svg path{fill:var(--w3m-color-fg-3)}w3m-spinner{margin:0 10px 0 0}`;var zO=Object.defineProperty,WO=Object.getOwnPropertyDescriptor,Jc=(t,e,r,n)=>{for(var i=n>1?void 0:n?WO(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&zO(e,r,i),i};let os=class extends Pe{constructor(){super(),this.loading=!1,this.label="Connect Wallet",this.icon="show",this.modalUnsub=void 0,xe.rejectStandaloneButtonComponent(),this.modalUnsub=Fr.subscribe(t=>{t.open&&(this.loading=!0),t.open||(this.loading=!1)})}disconnectedCallback(){var t;(t=this.modalUnsub)==null||t.call(this)}iconTemplate(){return this.icon==="show"?Fe.WALLET_CONNECT_ICON:null}onClick(){xt.state.isConnected?this.onDisconnect():this.onConnect()}async onConnect(){this.loading=!0,wi.click({name:"CONNECT_BUTTON"}),await Fr.open(),Fr.state.open||(this.loading=!1)}async onDisconnect(){wi.click({name:"DISCONNECT_BUTTON"}),await Ft.client().disconnect()}render(){return oe`<w3m-button-big .disabled="${this.loading}" @click="${this.onClick}">${this.loading?oe`<w3m-spinner></w3m-spinner><w3m-text variant="medium-regular" color="accent">Connecting...</w3m-text>`:oe`${this.iconTemplate()}<w3m-text variant="medium-regular" color="inverse">${this.label}</w3m-text>`}</w3m-button-big>`}};os.styles=[je.globalCss,HO],Jc([gt()],os.prototype,"loading",2),Jc([$e()],os.prototype,"label",2),Jc([$e()],os.prototype,"icon",2),os=Jc([Ne("w3m-connect-button")],os);const qO=Ve`@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(--w3m-accent-color);animation:loading 1s linear infinite}w3m-wallet-image{border-radius:var(--w3m-wallet-icon-large-border-radius);width:90px;height:90px}w3m-text{margin-bottom:40px}.w3m-error svg{stroke:var(--w3m-error-color)}.w3m-error use{display:none}.w3m-error{animation:shake .4s cubic-bezier(.36,.07,.19,.97) both}.w3m-stale svg,.w3m-stale use{display:none}`;var VO=Object.defineProperty,KO=Object.getOwnPropertyDescriptor,Js=(t,e,r,n)=>{for(var i=n>1?void 0:n?KO(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&VO(e,r,i),i};let Ii=class extends Pe{constructor(){super(...arguments),this.walletId=void 0,this.imageId=void 0,this.isError=!1,this.isStale=!1,this.label=""}svgLoaderTemplate(){var t,e;const r=(e=(t=Un.state.themeVariables)==null?void 0:t["--w3m-wallet-icon-large-border-radius"])!=null?e:je.getPreset("--w3m-wallet-icon-large-border-radius");let n=0;r.includes("%")?n=88/100*parseInt(r,10):n=parseInt(r,10),n*=1.17;const i=317-n*1.57,o=425-n*1.8;return oe`<svg viewBox="0 0 110 110" width="110" height="110"><rect id="w3m-loader" x="2" y="2" width="106" height="106" rx="${n}"/><use xlink:href="#w3m-loader" stroke-dasharray="106 ${i}" stroke-dashoffset="${o}"></use></svg>`}render(){const t={"w3m-error":this.isError,"w3m-stale":this.isStale};return oe`<div class="${Lr(t)}">${this.svgLoaderTemplate()}<w3m-wallet-image walletId="${this.walletId}" imageId="${this.imageId}"></w3m-wallet-image></div><w3m-text variant="medium-regular" color="${this.isError?"error":"primary"}">${this.isError?"Connection declined":this.label}</w3m-text>`}};Ii.styles=[je.globalCss,qO],Js([$e()],Ii.prototype,"walletId",2),Js([$e()],Ii.prototype,"imageId",2),Js([$e()],Ii.prototype,"isError",2),Js([$e()],Ii.prototype,"isStale",2),Js([$e()],Ii.prototype,"label",2),Ii=Js([Ne("w3m-connector-waiting")],Ii);var GO=Object.defineProperty,ZO=Object.getOwnPropertyDescriptor,Xs=(t,e,r,n)=>{for(var i=n>1?void 0:n?ZO(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&GO(e,r,i),i};let Ai=class extends Pe{constructor(){super(),this.isConnected=!1,this.label="Connect Wallet",this.icon="show",this.avatar="show",this.balance="hide",this.unsubscribeAccount=void 0,xe.rejectStandaloneButtonComponent(),this.isConnected=xt.state.isConnected,this.unsubscribeAccount=xt.subscribe(({isConnected:t})=>{this.isConnected=t})}disconnectedCallback(){var t;(t=this.unsubscribeAccount)==null||t.call(this)}render(){const{enableAccountView:t}=jt.state,e=this.balance,r=this.label,n=this.icon,i=this.avatar;return this.isConnected&&t?oe`<w3m-account-button balance="${e}" avatar="${i}"></w3m-account-button>`:oe`<w3m-connect-button label="${this.isConnected?"Disconnect":r}" icon="${n}"></w3m-connect-button>`}};Xs([gt()],Ai.prototype,"isConnected",2),Xs([$e()],Ai.prototype,"label",2),Xs([$e()],Ai.prototype,"icon",2),Xs([$e()],Ai.prototype,"avatar",2),Xs([$e()],Ai.prototype,"balance",2),Ai=Xs([Ne("w3m-core-button")],Ai);const YO=Ve`.w3m-grid{display:grid;grid-template-columns:repeat(4,80px);justify-content:space-between}.w3m-desktop-title,.w3m-mobile-title{display:flex;align-items:center}.w3m-mobile-title{justify-content:space-between;margin-bottom:20px;margin-top:-10px}.w3m-desktop-title{margin-bottom:10px;padding:0 10px}.w3m-subtitle{display:flex;align-items:center}.w3m-subtitle:last-child path{fill:var(--w3m-color-fg-3)}.w3m-desktop-title svg,.w3m-mobile-title svg{margin-right:6px}.w3m-desktop-title path,.w3m-mobile-title path{fill:var(--w3m-accent-color)}`;var JO=Object.defineProperty,XO=Object.getOwnPropertyDescriptor,QO=(t,e,r,n)=>{for(var i=n>1?void 0:n?XO(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&JO(e,r,i),i};let kf=class extends Pe{render(){const{isStandalone:t}=De.state,{explorerExcludedWalletIds:e,enableExplorer:r}=jt.state,n=e!=="ALL"&&r,i=Mr.manualWalletsTemplate(),o=Mr.recomendedWalletsTemplate(),c=Mr.externalWalletsTemplate(),l=Mr.recentWalletTemplate(),h=Mr.installedInjectedWalletsTemplate();let d=[l,...i,...o];t||(d=[...h,l,...c,...i,...o]),d=d.filter(Boolean);const v=d.length>4||n;let x=[];v?x=d.slice(0,3):x=d;const _=!!x.length;return oe`<w3m-modal-header .border="${!0}" title="Connect your wallet" .onAction="${xe.handleUriCopy}" .actionIcon="${Fe.COPY_ICON}"></w3m-modal-header><w3m-modal-content><div class="w3m-mobile-title"><div class="w3m-subtitle">${Fe.MOBILE_ICON}<w3m-text variant="small-regular" color="accent">Mobile</w3m-text></div><div class="w3m-subtitle">${Fe.SCAN_ICON}<w3m-text variant="small-regular" color="secondary">Scan with your wallet</w3m-text></div></div><w3m-walletconnect-qr></w3m-walletconnect-qr></w3m-modal-content>${_?oe`<w3m-modal-footer><div class="w3m-desktop-title">${Fe.DESKTOP_ICON}<w3m-text variant="small-regular" color="accent">Desktop</w3m-text></div><div class="w3m-grid">${x} ${v?oe`<w3m-view-all-wallets-button></w3m-view-all-wallets-button>`:null}</div></w3m-modal-footer>`:null}`}};kf.styles=[je.globalCss,YO],kf=QO([Ne("w3m-desktop-wallet-selection")],kf);const eS=Ve`div{background-color:var(--w3m-color-bg-2);padding:10px 20px 15px 20px;border-top:1px solid var(--w3m-color-bg-3);text-align:center}a{color:var(--w3m-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 tS=Object.defineProperty,rS=Object.getOwnPropertyDescriptor,nS=(t,e,r,n)=>{for(var i=n>1?void 0:n?rS(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&tS(e,r,i),i};let Hf=class extends Pe{render(){const{termsOfServiceUrl:t,privacyPolicyUrl:e}=jt.state;return t??e?oe`<div><w3m-text variant="small-regular" color="secondary">By connecting your wallet to this app, you agree to the app's ${t?oe`<a href="${t}" target="_blank" rel="noopener noreferrer">Terms of Service</a>`:null} ${t&&e?"and":null} ${e?oe`<a href="${e}" target="_blank" rel="noopener noreferrer">Privacy Policy</a>`:null}</w3m-text></div>`:null}};Hf.styles=[je.globalCss,eS],Hf=nS([Ne("w3m-legal-notice")],Hf);const iS=Ve`div{display:grid;grid-template-columns:repeat(4,80px);margin:0 -10px;justify-content:space-between;row-gap:10px}`;var sS=Object.defineProperty,oS=Object.getOwnPropertyDescriptor,aS=(t,e,r,n)=>{for(var i=n>1?void 0:n?oS(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&sS(e,r,i),i};let zf=class extends Pe{onQrcode(){tt.push("Qrcode")}render(){const{isStandalone:t}=De.state,{explorerExcludedWalletIds:e,enableExplorer:r}=jt.state,n=e!=="ALL"&&r,i=Mr.manualWalletsTemplate(),o=Mr.recomendedWalletsTemplate(),c=Mr.externalWalletsTemplate(),l=Mr.recentWalletTemplate(),h=Mr.installedInjectedWalletsTemplate();let d=[l,...i,...o];t||(d=[...h,l,...c,...i,...o]),d=d.filter(Boolean);const v=d.length>8||n;let x=[];v?x=d.slice(0,7):x=d;const _=!!x.length;return oe`<w3m-modal-header title="Connect your wallet" .onAction="${this.onQrcode}" .actionIcon="${Fe.QRCODE_ICON}"></w3m-modal-header>${_?oe`<w3m-modal-content><div>${x} ${v?oe`<w3m-view-all-wallets-button></w3m-view-all-wallets-button>`:null}</div></w3m-modal-content>`:null}`}};zf.styles=[je.globalCss,iS],zf=aS([Ne("w3m-mobile-wallet-selection")],zf);const cS=Ve`:host{all:initial}.w3m-overlay{top:0;bottom:0;left:0;right:0;position:fixed;z-index:var(--w3m-z-index);overflow:hidden;display:flex;justify-content:center;align-items:center;background-color:rgba(0,0,0,.3);opacity:0;pointer-events:none}@media(max-height:720px) and (orientation:landscape){.w3m-overlay{overflow:scroll;align-items:flex-start;padding:20px 0}}.w3m-active{pointer-events:auto}.w3m-container{position:relative;max-width:360px;width:100%;outline:0;border-radius:var(--w3m-background-border-radius) var(--w3m-background-border-radius) var(--w3m-container-border-radius) var(--w3m-container-border-radius);border:1px solid var(--w3m-color-overlay);overflow:hidden}.w3m-card{width:100%;position:relative;border-radius:var(--w3m-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(--w3m-color-overlay);background-color:var(--w3m-color-bg-1);color:var(--w3m-color-fg-1)}@media(max-width:600px){.w3m-container{max-width:440px;border-radius:var(--w3m-background-border-radius) var(--w3m-background-border-radius) 0 0}.w3m-card{border-radius:var(--w3m-container-border-radius) var(--w3m-container-border-radius) 0 0}.w3m-overlay{align-items:flex-end}}@media(max-width:440px){.w3m-container{border:0}}`;var lS=Object.defineProperty,uS=Object.getOwnPropertyDescriptor,Wf=(t,e,r,n)=>{for(var i=n>1?void 0:n?uS(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&lS(e,r,i),i};let Qs=class extends Pe{constructor(){super(),this.open=!1,this.active=!1,this.unsubscribeModal=void 0,this.abortController=void 0,this.unsubscribeModal=Fr.subscribe(t=>{t.open?this.onOpenModalEvent():this.onCloseModalEvent()})}disconnectedCallback(){var t;(t=this.unsubscribeModal)==null||t.call(this)}get overlayEl(){return xe.getShadowRootElement(this,".w3m-overlay")}get containerEl(){return xe.getShadowRootElement(this,".w3m-container")}toggleBodyScroll(t){document.querySelector("body")&&(t?document.getElementById("w3m-styles")?.remove():document.head.insertAdjacentHTML("beforeend",'<style id="w3m-styles">html,body{touch-action:none;overflow:hidden;overscroll-behavior:contain;}</style>'))}onCloseModal(t){t.target===t.currentTarget&&Fr.close()}onOpenModalEvent(){this.toggleBodyScroll(!1),this.addKeyboardEvents(),this.open=!0,setTimeout(async()=>{const t=xe.isMobileAnimation()?{y:["50vh","0vh"]}:{scale:[.98,1]},e=.1,r=.2;await Promise.all([ts(this.overlayEl,{opacity:[0,1]},{delay:e,duration:r}).finished,ts(this.containerEl,t,{delay:e,duration:r}).finished]),this.active=!0},0)}async onCloseModalEvent(){this.toggleBodyScroll(!0),this.removeKeyboardEvents();const t=xe.isMobileAnimation()?{y:["0vh","50vh"]}:{scale:[1,.98]},e=.2;await Promise.all([ts(this.overlayEl,{opacity:[1,0]},{duration:e}).finished,ts(this.containerEl,t,{duration:e}).finished]),this.containerEl.removeAttribute("style"),this.active=!1,this.open=!1}addKeyboardEvents(){this.abortController=new AbortController,window.addEventListener("keydown",t=>{var e;t.key==="Escape"?Fr.close():t.key==="Tab"&&((e=t.target)!=null&&e.tagName.includes("W3M-")||this.containerEl.focus())},this.abortController),this.containerEl.focus()}removeKeyboardEvents(){var t;(t=this.abortController)==null||t.abort(),this.abortController=void 0}managedModalContextTemplate(){const{isStandalone:t}=De.state;return t?null:oe`<w3m-wc-connection-context></w3m-wc-connection-context><w3m-account-context></w3m-account-context><w3m-network-context></w3m-network-context>`}render(){const t={"w3m-overlay":!0,"w3m-active":this.active};return oe`<w3m-explorer-context></w3m-explorer-context><w3m-theme-context></w3m-theme-context>${this.managedModalContextTemplate()}<div id="w3m-modal" class="${Lr(t)}" @click="${this.onCloseModal}" role="alertdialog" aria-modal="true"><div class="w3m-container" tabindex="0">${this.open?oe`<w3m-modal-backcard></w3m-modal-backcard><div class="w3m-card"><w3m-modal-router></w3m-modal-router><w3m-modal-toast></w3m-modal-toast></div>`:null}</div></div>`}};Qs.styles=[je.globalCss,cS],Wf([gt()],Qs.prototype,"open",2),Wf([gt()],Qs.prototype,"active",2),Qs=Wf([Ne("w3m-modal")],Qs);const hS=Ve`:host{all:initial}w3m-network-image{margin-left:-6px;margin-right:6px;width:28px;height:28px}`;var fS=Object.defineProperty,dS=Object.getOwnPropertyDescriptor,Xc=(t,e,r,n)=>{for(var i=n>1?void 0:n?dS(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&fS(e,r,i),i};let as=class extends Pe{constructor(){super(),this.chainId="",this.label="",this.wrongNetwork=!1,this.unsubscribeNetwork=void 0,xe.rejectStandaloneButtonComponent();const{selectedChain:t}=De.state;this.onSetChainData(t),this.unsubscribeNetwork=De.subscribe(({selectedChain:e})=>{this.onSetChainData(e)})}disconnectedCallback(){var t;(t=this.unsubscribeNetwork)==null||t.call(this)}onSetChainData(t){if(t){const{chains:e}=De.state,r=e?.map(n=>n.id);this.chainId=t.id.toString(),this.wrongNetwork=!(r!=null&&r.includes(t.id)),this.label=this.wrongNetwork?"Wrong Network":t.name}}onClick(){wi.click({name:"NETWORK_BUTTON"}),Fr.open({route:"SelectNetwork"})}render(){var t;const{chains:e}=De.state,r=e&&e.length>1;return oe`<w3m-button-big @click="${this.onClick}" ?disabled="${!r}"><w3m-network-image chainId="${this.chainId}"></w3m-network-image><w3m-text variant="medium-regular" color="inverse">${(t=this.label)!=null&&t.length?this.label:"Select Network"}</w3m-text></w3m-button-big>`}};as.styles=[je.globalCss,hS],Xc([gt()],as.prototype,"chainId",2),Xc([gt()],as.prototype,"label",2),Xc([gt()],as.prototype,"wrongNetwork",2),as=Xc([Ne("w3m-network-switch")],as);const pS=Ve`@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:1px;top:0;left:0}use{stroke:var(--w3m-accent-color);animation:loading 1s linear infinite}w3m-network-image{width:92px;height:92px}w3m-text{margin-bottom:40px}.w3m-error svg{stroke:var(--w3m-error-color)}.w3m-error use{display:none}.w3m-error{animation:shake .4s cubic-bezier(.36,.07,.19,.97) both}`;var gS=Object.defineProperty,mS=Object.getOwnPropertyDescriptor,Qc=(t,e,r,n)=>{for(var i=n>1?void 0:n?mS(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&gS(e,r,i),i};let eo=class extends Pe{constructor(){super(...arguments),this.chainId=void 0,this.isError=!1,this.label=""}svgLoaderTemplate(){return oe`<svg width="54" height="59" viewBox="0 0 54 59" fill="none" class="w3m-loader"><path id="w3m-loader-path" d="M17.22 5.295c3.877-2.277 5.737-3.363 7.72-3.726a11.44 11.44 0 0 1 4.12 0c1.983.363 3.844 1.45 7.72 3.726l6.065 3.562c3.876 2.276 5.731 3.372 7.032 4.938a11.896 11.896 0 0 1 2.06 3.63c.683 1.928.688 4.11.688 8.663v7.124c0 4.553-.005 6.735-.688 8.664a11.896 11.896 0 0 1-2.06 3.63c-1.3 1.565-3.156 2.66-7.032 4.937l-6.065 3.563c-3.877 2.276-5.737 3.362-7.72 3.725a11.46 11.46 0 0 1-4.12 0c-1.983-.363-3.844-1.449-7.72-3.726l-6.065-3.562c-3.876-2.276-5.731-3.372-7.032-4.938a11.885 11.885 0 0 1-2.06-3.63c-.682-1.928-.688-4.11-.688-8.663v-7.124c0-4.553.006-6.735.688-8.664a11.885 11.885 0 0 1 2.06-3.63c1.3-1.565 3.156-2.66 7.032-4.937l6.065-3.562Z"/><use xlink:href="#w3m-loader-path" stroke-dasharray="54 118" stroke-dashoffset="172"></use></svg>`}render(){const t={"w3m-error":this.isError};return oe`<div class="${Lr(t)}">${this.svgLoaderTemplate()}<w3m-network-image chainId="${this.chainId}"></w3m-network-image></div><w3m-text variant="medium-regular" color="${this.isError?"error":"primary"}">${this.isError?"Switch declined":this.label}</w3m-text>`}};eo.styles=[je.globalCss,pS],Qc([$e()],eo.prototype,"chainId",2),Qc([$e()],eo.prototype,"isError",2),Qc([$e()],eo.prototype,"label",2),eo=Qc([Ne("w3m-network-waiting")],eo);const wS=Ve`div{display:flex;margin-top:15px}slot{display:inline-block;margin:0 5px}w3m-button{margin:0 5px}`;var vS=Object.defineProperty,yS=Object.getOwnPropertyDescriptor,cs=(t,e,r,n)=>{for(var i=n>1?void 0:n?yS(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&vS(e,r,i),i};let Xn=class extends Pe{constructor(){super(...arguments),this.isMobile=!1,this.isInjected=!1,this.isInjectedInstalled=!1,this.isDesktop=!1,this.isWeb=!1,this.isRetry=!1}onMobile(){Ae.isMobile()?tt.replace("MobileConnecting"):tt.replace("MobileQrcodeConnecting")}onInjected(){this.isInjectedInstalled?tt.replace("InjectedConnecting"):tt.replace("InstallWallet")}onDesktop(){tt.replace("DesktopConnecting")}onWeb(){tt.replace("WebConnecting")}render(){const{isStandalone:t}=De.state;return oe`<div>${this.isRetry?oe`<slot></slot>`:null} ${this.isMobile?oe`<w3m-button .onClick="${this.onMobile}" .iconLeft="${Fe.MOBILE_ICON}" variant="outline">Mobile</w3m-button>`:null} ${this.isInjected&&!t?oe`<w3m-button .onClick="${this.onInjected}" .iconLeft="${Fe.WALLET_ICON}" variant="outline">Browser</w3m-button>`:null} ${this.isDesktop?oe`<w3m-button .onClick="${this.onDesktop}" .iconLeft="${Fe.DESKTOP_ICON}" variant="outline">Desktop</w3m-button>`:null} ${this.isWeb?oe`<w3m-button .onClick="${this.onWeb}" .iconLeft="${Fe.GLOBE_ICON}" variant="outline">Web</w3m-button>`:null}</div>`}};Xn.styles=[je.globalCss,wS],cs([$e()],Xn.prototype,"isMobile",2),cs([$e()],Xn.prototype,"isInjected",2),cs([$e()],Xn.prototype,"isInjectedInstalled",2),cs([$e()],Xn.prototype,"isDesktop",2),cs([$e()],Xn.prototype,"isWeb",2),cs([$e()],Xn.prototype,"isRetry",2),Xn=cs([Ne("w3m-platform-selection")],Xn);const bS=Ve`button{display:flex;flex-direction:column;padding:5px 10px;border-radius:var(--w3m-button-hover-highlight-border-radius);height:100%;justify-content:flex-start}.w3m-icons{width:60px;height:60px;display:flex;flex-wrap:wrap;padding:7px;border-radius:var(--w3m-wallet-icon-border-radius);justify-content:space-between;align-items:center;margin-bottom:5px;background-color:var(--w3m-color-bg-2);box-shadow:inset 0 0 0 1px var(--w3m-color-overlay)}button:active{background-color:var(--w3m-color-overlay)}@media(hover:hover){button:hover{background-color:var(--w3m-color-overlay)}}.w3m-icons img{width:21px;height:21px;object-fit:cover;object-position:center;border-radius:calc(var(--w3m-wallet-icon-border-radius)/ 2);border:1px solid var(--w3m-color-overlay)}.w3m-icons svg{width:21px;height:21px}.w3m-icons img:nth-child(1),.w3m-icons img:nth-child(2),.w3m-icons svg:nth-child(1),.w3m-icons svg:nth-child(2){margin-bottom:4px}w3m-text{width:100%;text-align:center}#wallet-placeholder-fill{fill:var(--w3m-color-bg-3)}#wallet-placeholder-dash{stroke:var(--w3m-color-overlay)}`;var _S=Object.defineProperty,ES=Object.getOwnPropertyDescriptor,xS=(t,e,r,n)=>{for(var i=n>1?void 0:n?ES(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&_S(e,r,i),i};let qf=class extends Pe{onClick(){tt.push("WalletExplorer")}render(){const{recomendedWallets:t}=ir.state,e=Xr.manualWallets(),r=[...t,...e].reverse().slice(0,4);return oe`<button @click="${this.onClick}"><div class="w3m-icons">${r.map(n=>{const i=xe.getWalletIcon(n);if(i)return oe`<img src="${i}">`;const o=xe.getWalletIcon({id:n.id});return o?oe`<img src="${o}">`:Fe.WALLET_PLACEHOLDER})} ${[...Array(4-r.length)].map(()=>Fe.WALLET_PLACEHOLDER)}</div><w3m-text variant="xsmall-regular">View All</w3m-text></button>`}};qf.styles=[je.globalCss,bS],qf=xS([Ne("w3m-view-all-wallets-button")],qf);const CS=Ve`.w3m-qr-container{width:100%;display:flex;justify-content:center;align-items:center;aspect-ratio:1/1}`;var IS=Object.defineProperty,AS=Object.getOwnPropertyDescriptor,el=(t,e,r,n)=>{for(var i=n>1?void 0:n?AS(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&IS(e,r,i),i};let to=class extends Pe{constructor(){super(),this.walletId="",this.imageId="",this.uri="",this.unwatchWcConnection=void 0,setTimeout(()=>{const{pairingUri:t}=fr.state,{standaloneUri:e}=De.state;this.uri=e??t},0),this.unwatchWcConnection=fr.subscribe(t=>{t.pairingUri&&(this.uri=t.pairingUri)})}disconnectedCallback(){var t;(t=this.unwatchWcConnection)==null||t.call(this)}get overlayEl(){return xe.getShadowRootElement(this,".w3m-qr-container")}render(){return oe`<div class="w3m-qr-container">${this.uri?oe`<w3m-qrcode size="${this.overlayEl.offsetWidth}" uri="${this.uri}" walletId="${this.walletId}" imageId="${this.imageId}"></w3m-qrcode>`:oe`<w3m-spinner></w3m-spinner>`}</div>`}};to.styles=[je.globalCss,CS],el([$e()],to.prototype,"walletId",2),el([$e()],to.prototype,"imageId",2),el([gt()],to.prototype,"uri",2),to=el([Ne("w3m-walletconnect-qr")],to);const $S=Ve`.w3m-profile{display:flex;justify-content:space-between;align-items:flex-start;padding-top:20px}.w3m-connection-badge{background-color:var(--w3m-color-bg-2);box-shadow:inset 0 0 0 1px var(--w3m-color-overlay);padding:6px 10px 6px 26px;position:relative;border-radius:28px}.w3m-connection-badge::before{content:'';position:absolute;width:10px;height:10px;left:10px;background-color:var(--w3m-success-color);border-radius:50%;top:50%;margin-top:-5px;box-shadow:0 1px 4px 1px var(--w3m-success-color),inset 0 0 0 1px var(--w3m-color-overlay)}.w3m-footer{display:flex;justify-content:space-between}w3m-address-text{margin-top:10px;display:block}.w3m-balance{border-top:1px solid var(--w3m-color-bg-2);padding:11px 20px}`;var OS=Object.defineProperty,SS=Object.getOwnPropertyDescriptor,DS=(t,e,r,n)=>{for(var i=n>1?void 0:n?SS(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&OS(e,r,i),i};let Vf=class extends Pe{async onDisconnect(){await Ft.client().disconnect()}async onCopyAddress(){var t;await navigator.clipboard.writeText((t=xt.state.address)!=null?t:""),Wr.openToast("Address copied","success")}render(){return oe`<w3m-modal-content><div class="w3m-profile"><div class="w3m-info"><w3m-avatar size="medium"></w3m-avatar><w3m-address-text variant="modal"></w3m-address-text></div><div class="w3m-connection-badge"><w3m-text variant="small-regular" color="secondary">Connected</w3m-text></div></div></w3m-modal-content><div class="w3m-balance"><w3m-balance></w3m-balance></div><w3m-modal-footer><div class="w3m-footer"><w3m-account-network-button></w3m-account-network-button><w3m-box-button label="Copy Address" .onClick="${this.onCopyAddress}" .icon="${Fe.ACCOUNT_COPY}"></w3m-box-button><w3m-box-button label="Disconnect" .onClick="${this.onDisconnect}" .icon="${Fe.ACCOUNT_DISCONNECT}"></w3m-box-button></div></w3m-modal-footer>`}};Vf.styles=[je.globalCss,$S],Vf=DS([Ne("w3m-account-view")],Vf);var PS=Object.defineProperty,TS=Object.getOwnPropertyDescriptor,RS=(t,e,r,n)=>{for(var i=n>1?void 0:n?TS(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&PS(e,r,i),i};let Kf=class extends Pe{viewTemplate(){return Ae.isAndroid()?oe`<w3m-android-wallet-selection></w3m-android-wallet-selection>`:Ae.isMobile()?oe`<w3m-mobile-wallet-selection></w3m-mobile-wallet-selection>`:oe`<w3m-desktop-wallet-selection></w3m-desktop-wallet-selection>`}render(){return oe`${this.viewTemplate()}<w3m-legal-notice></w3m-legal-notice>`}};Kf.styles=[je.globalCss],Kf=RS([Ne("w3m-connect-wallet-view")],Kf);const NS=Ve`w3m-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}w3m-text{text-align:center}`;var FS=Object.defineProperty,LS=Object.getOwnPropertyDescriptor,r2=(t,e,r,n)=>{for(var i=n>1?void 0:n?LS(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&FS(e,r,i),i};let tl=class extends Pe{constructor(){super(),this.isError=!1,this.unwatchConnection=void 0,this.openDesktopApp(),this.unwatchConnection=fr.subscribe(t=>{this.isError=t.pairingError})}disconnectedCallback(){var t;(t=this.unwatchConnection)==null||t.call(this)}onFormatAndRedirect(t){const{desktop:e,name:r}=Ae.getWalletRouterData(),n=e?.native;if(n){const i=Ae.formatNativeUrl(n,t,r);Ae.openHref(i,"_self")}}openDesktopApp(){fr.setPairingError(!1);const{standaloneUri:t}=De.state,{pairingUri:e}=fr.state,r=Ae.getWalletRouterData();xe.setRecentWallet(r),t?this.onFormatAndRedirect(t):this.onFormatAndRedirect(e)}render(){const{name:t,id:e,image_id:r}=Ae.getWalletRouterData(),{isMobile:n,isInjected:i,isWeb:o}=xe.getCachedRouterWalletPlatforms();return oe`<w3m-modal-header title="${t}" .onAction="${xe.handleUriCopy}" .actionIcon="${Fe.COPY_ICON}"></w3m-modal-header><w3m-modal-content><w3m-connector-waiting walletId="${e}" imageId="${r}" label="${`Continue in ${t}...`}" .isError="${this.isError}"></w3m-connector-waiting></w3m-modal-content><w3m-info-footer><w3m-text color="secondary" variant="small-thin">${`Connection can continue loading if ${t} is not installed on your device`}</w3m-text><w3m-platform-selection .isMobile="${n}" .isInjected="${i}" .isWeb="${o}" .isRetry="${!0}"><w3m-button .onClick="${this.openDesktopApp.bind(this)}" .iconRight="${Fe.RETRY_ICON}">Retry</w3m-button></w3m-platform-selection></w3m-info-footer>`}};tl.styles=[je.globalCss,NS],r2([gt()],tl.prototype,"isError",2),tl=r2([Ne("w3m-desktop-connecting-view")],tl);const MS=Ve`.w3m-info-text{margin:5px 0 15px;max-width:320px;text-align:center}.w3m-wallet-item{margin:0 -20px 0 0;padding-right:20px;display:flex;align-items:center;border-bottom:1px solid var(--w3m-color-bg-2)}.w3m-wallet-item:last-child{margin-bottom:-20px;border-bottom:0}.w3m-wallet-content{margin-left:20px;height:60px;display:flex;flex:1;align-items:center;justify-content:space-between}.w3m-footer-actions{display:flex;flex-direction:column;align-items:center;padding:20px 0;border-top:1px solid var(--w3m-color-bg-2)}w3m-wallet-image{display:block;width:40px;height:40px;border-radius:10px}`;var US=Object.defineProperty,jS=Object.getOwnPropertyDescriptor,BS=(t,e,r,n)=>{for(var i=n>1?void 0:n?jS(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&US(e,r,i),i};let Gf=class extends Pe{onGet(t){Ae.openHref(t,"_blank")}render(){const t=ir.state.recomendedWallets.slice(0,5),e=Xr.manualWallets().slice(0,5),r=t.length,n=e.length;return oe`<w3m-modal-header title="Get a wallet"></w3m-modal-header><w3m-modal-content>${r?t.map(i=>oe`<div class="w3m-wallet-item"><w3m-wallet-image walletId="${i.id}" imageId="${i.image_id}"></w3m-wallet-image><div class="w3m-wallet-content"><w3m-text variant="medium-regular">${i.name}</w3m-text><w3m-button .iconRight="${Fe.ARROW_RIGHT_ICON}" .onClick="${()=>this.onGet(i.homepage)}">Get</w3m-button></div></div>`):null} ${n?e.map(i=>oe`<div class="w3m-wallet-item"><w3m-wallet-image walletId="${i.id}"></w3m-wallet-image><div class="w3m-wallet-content"><w3m-text variant="medium-regular">${i.name}</w3m-text><w3m-button .iconRight="${Fe.ARROW_RIGHT_ICON}" .onClick="${()=>this.onGet(i.links.universal)}">Get</w3m-button></div></div>`):null}</w3m-modal-content><div class="w3m-footer-actions"><w3m-text variant="medium-regular">Not what you're looking for?</w3m-text><w3m-text variant="small-thin" color="secondary" class="w3m-info-text">With hundreds of wallets out there, there's something for everyone</w3m-text><w3m-button .onClick="${xe.openWalletExplorerUrl}" .iconRight="${Fe.ARROW_UP_RIGHT_ICON}">Explore Wallets</w3m-button></div>`}};Gf.styles=[je.globalCss,MS],Gf=BS([Ne("w3m-get-wallet-view")],Gf);const kS=Ve`.w3m-footer-actions{display:flex;justify-content:center}.w3m-footer-actions w3m-button{margin:0 5px}.w3m-info-container{display:flex;flex-direction:column;justify-content:center;align-items:center;margin-bottom:20px}.w3m-info-container:last-child{margin-bottom:0}.w3m-info-text{margin-top:5px;text-align:center}.w3m-images svg{margin:0 2px 5px;width:55px;height:55px}.help-img-highlight{stroke:var(--w3m-color-overlay)}`;var HS=Object.defineProperty,zS=Object.getOwnPropertyDescriptor,WS=(t,e,r,n)=>{for(var i=n>1?void 0:n?zS(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&HS(e,r,i),i};let Zf=class extends Pe{constructor(){super(...arguments),this.learnUrl="https://ethereum.org/en/wallets/"}onGet(){jt.state.enableExplorer?tt.push("GetWallet"):xe.openWalletExplorerUrl()}onLearnMore(){Ae.openHref(this.learnUrl,"_blank")}render(){return oe`<w3m-modal-header title="What is a wallet?"></w3m-modal-header><w3m-modal-content><div class="w3m-info-container"><div class="w3m-images">${Fe.HELP_CHART_IMG} ${Fe.HELP_PAINTING_IMG} ${Fe.HELP_ETH_IMG}</div><w3m-text variant="medium-regular">A home for your digital assets</w3m-text><w3m-text variant="small-thin" color="secondary" class="w3m-info-text">A wallet lets you store, send and receive digital assets like cryptocurrencies and NFTs.</w3m-text></div><div class="w3m-info-container"><div class="w3m-images">${Fe.HELP_KEY_IMG} ${Fe.HELP_USER_IMG} ${Fe.HELP_LOCK_IMG}</div><w3m-text variant="medium-regular">One login for all of web3</w3m-text><w3m-text variant="small-thin" color="secondary" class="w3m-info-text">Log in to any app by connecting your wallet. Say goodbye to countless passwords!</w3m-text></div><div class="w3m-info-container"><div class="w3m-images">${Fe.HELP_COMPAS_IMG} ${Fe.HELP_NOUN_IMG} ${Fe.HELP_DAO_IMG}</div><w3m-text variant="medium-regular">Your gateway to a new web</w3m-text><w3m-text variant="small-thin" color="secondary" class="w3m-info-text">With your wallet, you can explore and interact with DeFi, NFTs, DAOs, and much more.</w3m-text></div><div class="w3m-footer-actions"><w3m-button .onClick="${this.onGet.bind(this)}" .iconLeft="${Fe.WALLET_ICON}">Get a Wallet</w3m-button><w3m-button .onClick="${this.onLearnMore.bind(this)}" .iconRight="${Fe.ARROW_UP_RIGHT_ICON}">Learn More</w3m-button></div></w3m-modal-content>`}};Zf.styles=[je.globalCss,kS],Zf=WS([Ne("w3m-help-view")],Zf);const qS=Ve`w3m-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}w3m-text{text-align:center}`;var VS=Object.defineProperty,KS=Object.getOwnPropertyDescriptor,n2=(t,e,r,n)=>{for(var i=n>1?void 0:n?KS(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&VS(e,r,i),i};let rl=class extends Pe{constructor(){super(),this.isError=!1,this.connector=Ft.client().getConnectorById("injected"),this.openInjectedApp()}async openInjectedApp(){const{ready:t}=this.connector;t&&(this.isError=!1,await xe.handleConnectorConnection("injected",()=>{this.isError=!0}))}render(){const{name:t,id:e,image_id:r}=Ae.getWalletRouterData(),{isMobile:n,isDesktop:i,isWeb:o}=xe.getCachedRouterWalletPlatforms();return oe`<w3m-modal-header title="${t}"></w3m-modal-header><w3m-modal-content><w3m-connector-waiting walletId="${e}" imageId="${r}" label="${`Continue in ${t}...`}" .isError="${this.isError}"></w3m-connector-waiting></w3m-modal-content><w3m-info-footer><w3m-text color="secondary" variant="small-thin">Connection can be declined if multiple wallets are installed or previous request is still active</w3m-text><w3m-platform-selection .isMobile="${n}" .isDesktop="${i}" .isWeb="${o}" .isRetry="${!0}"><w3m-button .onClick="${this.openInjectedApp.bind(this)}" .disabled="${!this.isError}" .iconRight="${Fe.RETRY_ICON}">Retry</w3m-button></w3m-platform-selection></w3m-info-footer>`}};rl.styles=[je.globalCss,qS],n2([gt()],rl.prototype,"isError",2),rl=n2([Ne("w3m-injected-connecting-view")],rl);const GS=Ve`w3m-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}w3m-text{text-align:center}w3m-button{margin-top:15px}`;var ZS=Object.defineProperty,YS=Object.getOwnPropertyDescriptor,JS=(t,e,r,n)=>{for(var i=n>1?void 0:n?YS(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&ZS(e,r,i),i};let Yf=class extends Pe{onInstall(t){t&&Ae.openHref(t,"_blank")}render(){const{name:t,id:e,image_id:r,homepage:n}=Ae.getWalletRouterData();return oe`<w3m-modal-header title="${t}"></w3m-modal-header><w3m-modal-content><w3m-connector-waiting walletId="${e}" imageId="${r}" label="Not Detected" .isStale="${!0}"></w3m-connector-waiting></w3m-modal-content><w3m-info-footer><w3m-text color="secondary" variant="small-thin">${`Download ${t} to continue. If multiple browser extensions are installed, disable non ${t} ones and try again`}</w3m-text><w3m-button .onClick="${()=>this.onInstall(n)}" .iconLeft="${Fe.ARROW_DOWN_ICON}">Download</w3m-button></w3m-info-footer>`}};Yf.styles=[je.globalCss,GS],Yf=JS([Ne("w3m-install-wallet-view")],Yf);const XS=Ve`w3m-wallet-image{border-radius:var(--w3m-wallet-icon-large-border-radius);width:96px;height:96px;margin-bottom:20px}w3m-info-footer{display:flex;width:100%}.w3m-app-store{justify-content:space-between}.w3m-app-store w3m-wallet-image{margin-right:10px;margin-bottom:0;width:28px;height:28px;border-radius:var(--w3m-wallet-icon-small-border-radius)}.w3m-app-store div{display:flex;align-items:center}.w3m-app-store w3m-button{margin-right:-10px}.w3m-note{flex-direction:column;align-items:center;padding:5px 0}.w3m-note w3m-text{text-align:center}w3m-platform-selection{margin-top:-15px}.w3m-note w3m-text{margin-top:15px}.w3m-note w3m-text span{color:var(--w3m-accent-color)}`;var QS=Object.defineProperty,eD=Object.getOwnPropertyDescriptor,i2=(t,e,r,n)=>{for(var i=n>1?void 0:n?eD(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&QS(e,r,i),i};let nl=class extends Pe{constructor(){super(),this.isError=!1,this.unwatchConnection=void 0,this.openMobileApp(),this.unwatchConnection=fr.subscribe(t=>{this.isError=t.pairingError})}disconnectedCallback(){var t;(t=this.unwatchConnection)==null||t.call(this)}onFormatAndRedirect(t,e=!1){const{mobile:r,name:n}=Ae.getWalletRouterData(),i=r?.native,o=r?.universal;if(i&&!e){const c=Ae.formatNativeUrl(i,t,n);Ae.openHref(c,"_self")}else if(o){const c=Ae.formatUniversalUrl(o,t,n);Ae.openHref(c,"_self")}}openMobileApp(t=!1){fr.setPairingError(!1);const{standaloneUri:e}=De.state,{pairingUri:r}=fr.state,n=Ae.getWalletRouterData();xe.setRecentWallet(n),e?this.onFormatAndRedirect(e,t):this.onFormatAndRedirect(r,t)}onGoToAppStore(t){t&&Ae.openHref(t,"_blank")}render(){const{name:t,id:e,image_id:r,app:n,mobile:i}=Ae.getWalletRouterData(),{isWeb:o}=xe.getCachedRouterWalletPlatforms(),c=n?.ios,l=i?.universal;return oe`<w3m-modal-header title="${t}"></w3m-modal-header><w3m-modal-content><w3m-connector-waiting walletId="${e}" imageId="${r}" label="Tap 'Open' to continue…" .isError="${this.isError}"></w3m-connector-waiting></w3m-modal-content><w3m-info-footer class="w3m-note"><w3m-platform-selection .isWeb="${o}" .isRetry="${!0}"><w3m-button .onClick="${()=>this.openMobileApp(!1)}" .iconRight="${Fe.RETRY_ICON}">Retry</w3m-button></w3m-platform-selection>${l?oe`<w3m-text color="secondary" variant="small-thin">Still doesn't work? <span tabindex="0" @click="${()=>this.openMobileApp(!0)}">Try this alternate link</span></w3m-text>`:null}</w3m-info-footer><w3m-info-footer class="w3m-app-store"><div><w3m-wallet-image walletId="${e}" imageId="${r}"></w3m-wallet-image><w3m-text>${`Get ${t}`}</w3m-text></div><w3m-button .iconRight="${Fe.ARROW_RIGHT_ICON}" .onClick="${()=>this.onGoToAppStore(c)}" variant="ghost">App Store</w3m-button></w3m-info-footer>`}};nl.styles=[je.globalCss,XS],i2([gt()],nl.prototype,"isError",2),nl=i2([Ne("w3m-mobile-connecting-view")],nl);const tD=Ve`w3m-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}w3m-text{text-align:center}`;var rD=Object.defineProperty,nD=Object.getOwnPropertyDescriptor,iD=(t,e,r,n)=>{for(var i=n>1?void 0:n?nD(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&rD(e,r,i),i};let Jf=class extends Pe{render(){const{name:t,id:e,image_id:r}=Ae.getWalletRouterData(),{isInjected:n,isDesktop:i,isWeb:o}=xe.getCachedRouterWalletPlatforms();return oe`<w3m-modal-header title="${t}" .onAction="${xe.handleUriCopy}" .actionIcon="${Fe.COPY_ICON}"></w3m-modal-header><w3m-modal-content><w3m-walletconnect-qr walletId="${e}" imageId="${r}"></w3m-walletconnect-qr></w3m-modal-content><w3m-info-footer><w3m-text color="secondary" variant="small-thin">${`Scan this QR Code with your phone's camera or inside ${t} app`}</w3m-text><w3m-platform-selection .isDesktop="${i}" .isInjected="${n}" .isWeb="${o}"></w3m-platform-selection></w3m-info-footer>`}};Jf.styles=[je.globalCss,tD],Jf=iD([Ne("w3m-mobile-qr-connecting-view")],Jf);var sD=Object.defineProperty,oD=Object.getOwnPropertyDescriptor,aD=(t,e,r,n)=>{for(var i=n>1?void 0:n?oD(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&sD(e,r,i),i};let Xf=class extends Pe{render(){return oe`<w3m-modal-header title="Scan the code" .onAction="${xe.handleUriCopy}" .actionIcon="${Fe.COPY_ICON}"></w3m-modal-header><w3m-modal-content><w3m-walletconnect-qr></w3m-walletconnect-qr></w3m-modal-content>`}};Xf.styles=[je.globalCss],Xf=aD([Ne("w3m-qrcode-view")],Xf);const cD=Ve`div{display:grid;grid-template-columns:repeat(4,80px);margin:-5px -10px;justify-content:space-between}w3m-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}w3m-info-footer w3m-text{text-align:center}`;var s2=Object.defineProperty,lD=Object.defineProperties,uD=Object.getOwnPropertyDescriptor,hD=Object.getOwnPropertyDescriptors,o2=Object.getOwnPropertySymbols,fD=Object.prototype.hasOwnProperty,dD=Object.prototype.propertyIsEnumerable,a2=(t,e,r)=>e in t?s2(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,pD=(t,e)=>{for(var r in e||(e={}))fD.call(e,r)&&a2(t,r,e[r]);if(o2)for(var r of o2(e))dD.call(e,r)&&a2(t,r,e[r]);return t},gD=(t,e)=>lD(t,hD(e)),Qf=(t,e,r,n)=>{for(var i=n>1?void 0:n?uD(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&s2(e,r,i),i};let Ea=class extends Pe{constructor(){super(),this.connectedChains="ALL",this.isUnsupportedChains=!1,this.getConnectedChainIds()}async getConnectedChainIds(){this.connectedChains=await Ft.client().getConnectedChainIds()}async onSelectChain(t){try{const{selectedChain:e,walletConnectVersion:r,isPreferInjected:n}=De.state,{isConnected:i}=xt.state;i?e?.id===t.id?tt.reset("Account"):r===2?(await Ft.client().switchNetwork({chainId:t.id}),tt.reset("Account")):tt.push("SwitchNetwork",{SwitchNetwork:t}):n?(De.setSelectedChain(t),Fr.close()):(De.setSelectedChain(t),tt.push("ConnectWallet"))}catch(e){console.error(e),Wr.openToast("Unsupported chain","error")}}isUnsuportedChainId(t){return typeof this.connectedChains=="string"&&this.connectedChains!=="ALL"?(this.isUnsupportedChains=!0,!0):Array.isArray(this.connectedChains)&&!this.connectedChains.includes(String(t))?(this.isUnsupportedChains=!0,!0):!1}render(){const{chains:t}=De.state,e=t?.map(n=>gD(pD({},n),{unsupported:this.isUnsuportedChainId(n.id)})),r=e?.sort((n,i)=>Number(n.unsupported)-Number(i.unsupported));return oe`<w3m-modal-header title="Select network"></w3m-modal-header><w3m-modal-content><div>${r?.map(n=>oe`<w3m-network-button name="${n.name}" chainId="${n.id}" .unsupported="${n.unsupported}" .onClick="${async()=>this.onSelectChain(n)}">${n.name}</w3m-network-button>`)}</div></w3m-modal-content>${this.isUnsupportedChains?oe`<w3m-info-footer><w3m-text color="secondary" variant="small-thin">Your connected wallet may not support some of the networks available for this dapp</w3m-text></w3m-info-footer>`:null}`}};Ea.styles=[je.globalCss,cD],Qf([gt()],Ea.prototype,"connectedChains",2),Qf([gt()],Ea.prototype,"isUnsupportedChains",2),Ea=Qf([Ne("w3m-select-network-view")],Ea);const mD=Ve`w3m-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}w3m-text{text-align:center}w3m-button{margin-top:15px}`;var wD=Object.defineProperty,vD=Object.getOwnPropertyDescriptor,c2=(t,e,r,n)=>{for(var i=n>1?void 0:n?vD(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&wD(e,r,i),i};let il=class extends Pe{constructor(){super(),this.isError=!1,this.onSwitchNetwork()}async onSwitchNetwork(){try{this.isError=!1;const t=Ae.getSwitchNetworkRouterData();await Ft.client().switchNetwork({chainId:t.id}),De.setSelectedChain(t),tt.reset("Account")}catch{this.isError=!0}}render(){const{id:t,name:e}=Ae.getSwitchNetworkRouterData();return oe`<w3m-modal-header title="${`Connect to ${e}`}"></w3m-modal-header><w3m-modal-content><w3m-network-waiting chainId="${t}" label="Approve in your wallet" .isError="${this.isError}"></w3m-network-waiting></w3m-modal-content><w3m-info-footer><w3m-text color="secondary" variant="small-thin">Switch can be declined if chain is not supported by a wallet or previous request is still active</w3m-text><w3m-button .onClick="${this.onSwitchNetwork.bind(this)}" .disabled="${!this.isError}" .iconRight="${Fe.RETRY_ICON}">Try Again</w3m-button></w3m-info-footer>`}};il.styles=[je.globalCss,mD],c2([gt()],il.prototype,"isError",2),il=c2([Ne("w3m-switch-network-view")],il);const yD=Ve`w3m-modal-content{height:clamp(200px,60vh,600px);display:block;overflow:scroll;scrollbar-width:none;position:relative;margin-top:1px}.w3m-grid{display:grid;grid-template-columns:repeat(4,80px);justify-content:space-between;margin:-15px -10px;padding-top:20px}w3m-modal-content::after,w3m-modal-content::before{content:'';position:fixed;pointer-events:none;z-index:1;width:100%;height:20px;opacity:1}w3m-modal-content::before{box-shadow:0 -1px 0 0 var(--w3m-color-bg-1);background:linear-gradient(var(--w3m-color-bg-1),rgba(255,255,255,0))}w3m-modal-content::after{box-shadow:0 1px 0 0 var(--w3m-color-bg-1);background:linear-gradient(rgba(255,255,255,0),var(--w3m-color-bg-1));top:calc(100% - 20px)}w3m-modal-content::-webkit-scrollbar{display:none}.w3m-placeholder-block{display:flex;justify-content:center;align-items:center;height:100px;overflow:hidden}.w3m-empty,.w3m-loading{display:flex}.w3m-loading .w3m-placeholder-block{height:100%}.w3m-end-reached .w3m-placeholder-block{height:0;opacity:0}.w3m-empty .w3m-placeholder-block{opacity:1;height:100%}w3m-wallet-button{margin:calc((100% - 60px)/ 3) 0}`;var bD=Object.defineProperty,_D=Object.getOwnPropertyDescriptor,xa=(t,e,r,n)=>{for(var i=n>1?void 0:n?_D(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&bD(e,r,i),i};const e0=40;let ls=class extends Pe{constructor(){super(...arguments),this.loading=!ir.state.wallets.listings.length,this.firstFetch=!ir.state.wallets.listings.length,this.search="",this.endReached=!1,this.intersectionObserver=void 0,this.searchDebounce=xe.debounce(t=>{t.length>=3?(this.firstFetch=!0,this.endReached=!1,this.search=t,ir.resetSearch(),this.fetchWallets()):this.search&&(this.search="",this.endReached=this.isLastPage(),ir.resetSearch())})}firstUpdated(){this.createPaginationObserver()}disconnectedCallback(){var t;(t=this.intersectionObserver)==null||t.disconnect()}get placeholderEl(){return xe.getShadowRootElement(this,".w3m-placeholder-block")}createPaginationObserver(){this.intersectionObserver=new IntersectionObserver(([t])=>{t.isIntersecting&&!(this.search&&this.firstFetch)&&this.fetchWallets()}),this.intersectionObserver.observe(this.placeholderEl)}isLastPage(){const{wallets:t,search:e}=ir.state,{listings:r,total:n}=this.search?e:t;return n<=e0||r.length>=n}async fetchWallets(){var t;const{wallets:e,search:r,injectedWallets:n}=ir.state,{listings:i,total:o,page:c}=this.search?r:e;if(!this.endReached&&(this.firstFetch||o>e0&&i.length<o))try{this.loading=!0;const l=(t=De.state.standaloneChains)==null?void 0:t.join(","),{listings:h}=await ir.getWallets({page:this.firstFetch?1:c+1,entries:e0,search:this.search,version:De.state.walletConnectVersion,chains:l}),d=h.map(x=>xe.getWalletIcon(x)),v=n.map(x=>xe.getWalletIcon(x));await Promise.all([...d.map(async x=>xe.preloadImage(x)),...v.map(async x=>xe.preloadImage(x)),Ae.wait(300)]),this.endReached=this.isLastPage()}catch(l){console.error(l),Wr.openToast(xe.getErrorMessage(l),"error")}finally{this.loading=!1,this.firstFetch=!1}}onConnect(t){Ae.isAndroid()?xe.handleMobileLinking(t):xe.goToConnectingView(t)}onSearchChange(t){const{value:e}=t.target;this.searchDebounce(e)}render(){const{wallets:t,search:e}=ir.state,{listings:r}=this.search?e:t,n=this.loading&&!r.length,i=this.search.length>=3;let o=Mr.injectedWalletsTemplate(),c=Mr.manualWalletsTemplate(),l=Mr.recomendedWalletsTemplate(!0);i&&(o=o.filter(({values:x})=>xe.caseSafeIncludes(x[0],this.search)),c=c.filter(({values:x})=>xe.caseSafeIncludes(x[0],this.search)),l=l.filter(({values:x})=>xe.caseSafeIncludes(x[0],this.search)));const h=!this.loading&&!r.length&&!o.length&&!l.length,d=Math.max(o.length,r.length),v={"w3m-loading":n,"w3m-end-reached":this.endReached||!this.loading,"w3m-empty":h};return oe`<w3m-modal-header><w3m-search-input .onChange="${this.onSearchChange.bind(this)}"></w3m-search-input></w3m-modal-header><w3m-modal-content class="${Lr(v)}"><div class="w3m-grid">${n?null:l} ${n?null:[...Array(d)].map((x,_)=>oe`${c[_]} ${o[_]} ${r[_]?oe`<w3m-wallet-button imageId="${r[_].image_id}" name="${r[_].name}" walletId="${r[_].id}" .onClick="${()=>this.onConnect(r[_])}"></w3m-wallet-button>`:null}`)}</div><div class="w3m-placeholder-block">${h?oe`<w3m-text variant="big-bold" color="secondary">No results found</w3m-text>`:null} ${!h&&this.loading?oe`<w3m-spinner></w3m-spinner>`:null}</div></w3m-modal-content>`}};ls.styles=[je.globalCss,yD],xa([gt()],ls.prototype,"loading",2),xa([gt()],ls.prototype,"firstFetch",2),xa([gt()],ls.prototype,"search",2),xa([gt()],ls.prototype,"endReached",2),ls=xa([Ne("w3m-wallet-explorer-view")],ls);const ED=Ve`w3m-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}w3m-text{text-align:center}`;var xD=Object.defineProperty,CD=Object.getOwnPropertyDescriptor,l2=(t,e,r,n)=>{for(var i=n>1?void 0:n?CD(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&xD(e,r,i),i};let sl=class extends Pe{constructor(){super(),this.isError=!1,this.unwatchConnection=void 0,this.openWebWallet(),this.unwatchConnection=fr.subscribe(t=>{this.isError=t.pairingError})}disconnectedCallback(){var t;(t=this.unwatchConnection)==null||t.call(this)}onFormatAndRedirect(t){const{desktop:e,name:r}=Ae.getWalletRouterData(),n=e?.universal;if(n){const i=Ae.formatUniversalUrl(n,t,r);Ae.openHref(i,"_blank")}}openWebWallet(){fr.setPairingError(!1);const{standaloneUri:t}=De.state,{pairingUri:e}=fr.state,r=Ae.getWalletRouterData();xe.setRecentWallet(r),t?this.onFormatAndRedirect(t):this.onFormatAndRedirect(e)}render(){const{name:t,id:e,image_id:r}=Ae.getWalletRouterData(),{isMobile:n,isInjected:i,isDesktop:o}=xe.getCachedRouterWalletPlatforms(),c=Ae.isMobile();return oe`<w3m-modal-header title="${t}" .onAction="${xe.handleUriCopy}" .actionIcon="${Fe.COPY_ICON}"></w3m-modal-header><w3m-modal-content><w3m-connector-waiting walletId="${e}" imageId="${r}" label="${`Continue in ${t}...`}" .isError="${this.isError}"></w3m-connector-waiting></w3m-modal-content><w3m-info-footer><w3m-text color="secondary" variant="small-thin">${`${t} web app has opened in a new tab. Go there, accept the connection, and come back`}</w3m-text><w3m-platform-selection .isMobile="${n}" .isInjected="${c?!1:i}" .isDesktop="${c?!1:o}" .isRetry="${!0}"><w3m-button .onClick="${this.openWebWallet.bind(this)}" .iconRight="${Fe.RETRY_ICON}">Retry</w3m-button></w3m-platform-selection></w3m-info-footer>`}};sl.styles=[je.globalCss,ED],l2([gt()],sl.prototype,"isError",2),sl=l2([Ne("w3m-web-connecting-view")],sl);var ID=Object.freeze({__proto__:null,get W3mAccountButton(){return Ys},get W3mConnectButton(){return os},get W3mCoreButton(){return Ai},get W3mModal(){return Qs},get W3mNetworkSwitch(){return as},get W3mQrCode(){return Jn}});xn.EthereumProvider=bC,xn.OPTIONAL_EVENTS=x3,xn.OPTIONAL_METHODS=E3,xn.REQUIRED_EVENTS=bc,xn.REQUIRED_METHODS=yc,xn.default=Ec,Object.defineProperty(xn,"__esModule",{value:!0})});
153
153
  //# sourceMappingURL=index.umd.js.map